/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Licensed Materials - Property of IBM
 (c) Copyright IBM Corporation 2011. All Rights Reserved. 

 Note to U.S. Government Users Restricted Rights:  Use, 
 duplication or disclosure restricted by GSA ADP Schedule 
 Contract with IBM Corp.

 Licensed Materials - Property of IBM
 (c) Copyright IBM Corporation 2014. All Rights Reserved. 

 Note to U.S. Government Users Restricted Rights:  Use, 
 duplication or disclosure restricted by GSA ADP Schedule 
 Contract with IBM Corp.

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

 Contributors:
     IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

 Copyright (c) 2011, 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
*/
define("orion/util",[],function(){var l=navigator.userAgent,p=-1!==l.indexOf("MSIE")||-1!==l.indexOf("Trident")?document.documentMode:void 0,n=parseFloat(l.split("Firefox/")[1]||l.split("Minefield/")[1])||void 0,k=-1!==l.indexOf("Opera")?parseFloat(l.split("Version/")[1]):void 0,b=parseFloat(l.split("Chrome/")[1])||void 0,h=-1!==l.indexOf("Safari")&&!b,g=parseFloat(l.split("WebKit/")[1])||void 0,e=-1!==l.indexOf("Android"),a=-1!==l.indexOf("iPad"),l=-1!==l.indexOf("iPhone"),f=a||l,d=-1!==navigator.platform.indexOf("Mac"),
m=-1!==navigator.platform.indexOf("Win"),r=-1!==navigator.platform.indexOf("Linux"),u="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return d[(f<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:p,isFirefox:n,isOpera:k,isChrome:b,isSafari:h,isWebkit:g,isAndroid:e,isIPad:a,isIPhone:l,
isIOS:f,isMac:d,isWindows:m,isLinux:r,isTouch:u,platformDelimiter:m?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(l){function p(a,f){f||(f=document);return f.querySelectorAll(a)}function n(a){var f=a.tabIndex;0===f&&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&&(f=-1);return f}function k(a){if(0<=n(a))return a;if(a.hasChildNodes())for(var f=0;f<a.childNodes.length;f++){var d=k(a.childNodes[f]);if(d)return d}return null}function b(a){if(0<=
n(a))return a;if(a.hasChildNodes())for(var f=a.childNodes.length-1;0<=f;f--){var d=b(a.childNodes[f]);if(d)return d}return null}function h(a,f){if(3===a.nodeType){var d=g.exec(a.nodeValue);d&&1<d.length&&f(a,d)}if(a.hasChildNodes())for(d=0;d<a.childNodes.length;d++)h(a.childNodes[d],f)}var g=/\$\{([^\}]+)\}/,e=null;return{$:function(a,f){f||(f=document);return f.querySelector(a)},$$:p,$$array:function(a,f){return Array.prototype.slice.call(p(a,f))},node:function(a){var f=a;"string"===typeof a&&(f=
document.getElementById(a));return f},contains:function(a,f){if(!a||!f)return!1;if(a===f)return!0;var d=a.compareDocumentPosition(f);return Boolean(d&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:b,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,f){h(a,function(a,m){a.parentNode.replaceChild(document.createTextNode(f[m[1]]||m[1]),a)})},processDOMNodes:function(a,f){h(a,function(a,m){var e=f[m[1]];if(e){var b=document.createRange(),g=m.index;b.setStart(a,g);b.setEnd(a,g+m[0].length);b.deleteContents();b.insertNode(e)}})},addAutoDismiss:function(a,f){function d(a){e.forEach(function(d){var f=!1,e=d.excludeNodes.some(function(d){return document.body.contains(d)?(f=!0,d.contains(a.target)):
!1});if(f&&!e)try{d.dismiss(a)}catch(b){"undefined"!==typeof console&&console&&console.error(b&&b.message)}});e=e.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===e&&(e=[],document.addEventListener("click",d,!0),l.isIOS&&document.addEventListener("touchend",function(a){function d(){a.target.removeEventListener("click",d)}0===a.touches.length&&a.target.addEventListener("click",d)},!1));e.push({excludeNodes:a,dismiss:f})},setFramesEnabled:function(a){for(var f=
document.getElementsByTagName("iframe"),d=0;d<f.length;d++)f[d].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){e=e.filter(function(f){return a!==f.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}}});
(function(l,p){"function"===typeof define&&define.amd?define("orion/Deferred",p):"object"===typeof exports?module.exports=p():(l.orion=l.orion||{},l.orion.Deferred=p())})(this,function(){function l(){for(var e;e=b.shift();)e();h=!1}function p(e){b.push(e);h||(h=!0,g())}function n(e){return function(a){e(a)}}function k(){function e(){for(var a;a=g.shift();){var d=a.deferred,f="fulfilled"===b?"resolve":"reject";a=a[f];if("function"===typeof a)try{var e=a(m),q=e&&("object"===typeof e||"function"===typeof e)&&
e.then;if("function"===typeof q)if(e===d.promise)d.reject(new TypeError);else{var h=e.cancel;"function"===typeof h?d._parentCancel=h.bind(e):delete d._parentCancel;q.call(e,n(d.resolve),n(d.reject),n(d.progress))}else d.resolve(e)}catch(k){d.reject(k)}else d[f](m)}}function a(a){delete q._parentCancel;b="rejected";m=a;g.length&&p(e)}function f(d){function h(a){return function(d){(!b||"assumed"===b)&&a(d)}}delete q._parentCancel;try{var s=d&&("object"===typeof d||"function"===typeof d)&&d.then;if("function"===
typeof s)if(d===q)a(new TypeError);else{b="assumed";var n=d&&d.cancel;if("function"!==typeof n){var l=new k;d=l.promise;try{s(l.resolve,l.reject,l.progress)}catch(y){l.reject(y)}n=d.cancel;s=d.then}m=d;s.call(d,h(f),h(a));q._parentCancel=n.bind(d)}else b="fulfilled",m=d,g.length&&p(e)}catch(B){h(a)(B)}}function d(){var d=q._parentCancel;d?(delete q._parentCancel,d()):b||(d=Error("Cancel"),d.name="Cancel",a(d))}var m,b,g=[],q=this;this.resolve=function(a){b||f(a);return q};this.reject=function(d){b||
a(d);return q};this.progress=function(a){b||g.forEach(function(d){if(d.progress)try{d.progress(a)}catch(f){}});return q.promise};this.cancel=function(){q._parentCancel?setTimeout(d,0):d();return q};this.then=function(a,d,f){var m=new k;m._parentCancel=q.promise.cancel;g.push({resolve:a,reject:d,progress:f,deferred:m});("fulfilled"===b||"rejected"===b)&&p(e);return m.promise};this.promise={then:q.then,cancel:q.cancel}}var b=[],h=!1,g=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var e=
process.nextTick;return function(){e(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(e,a){function f(a,d){g||(b[a]=d,0===--m&&q.resolve(b))}function d(d,m){if(!g){if(a)try{f(d,a(m));return}catch(e){m=e}q.reject(m)}}var m=e.length,b=[],g=!1,q=new k;q.then(void 0,function(){g=!0;e.forEach(function(a){a.cancel&&a.cancel()})});
0===m?q.resolve(b):e.forEach(function(a,m){a.then(f.bind(void 0,m),d.bind(void 0,m))});return q.promise};k.when=function(e,a,f,d){var m;e&&"function"===typeof e.then||(m=new k,m.resolve(e),e=m.promise);return e.then(a,f,d)};return k});
define("orion/EventTarget",[],function(){function l(){this._namedListeners={}}l.prototype={dispatchEvent:function(l){if(!l.type)throw Error("unspecified type");var n=this._namedListeners[l.type];n&&n.forEach(function(k){try{"function"===typeof k?k(l):k.handleEvent(l)}catch(b){"undefined"!==typeof console&&console.log(b)}});return!l.defaultPrevented},addEventListener:function(l,n){if("function"===typeof n||n.handleEvent)this._namedListeners[l]=this._namedListeners[l]||[],this._namedListeners[l].push(n)},
removeEventListener:function(l,n){var k=this._namedListeners[l];if(k)for(var b=0;b<k.length;b++)if(k[b]===n){1===k.length?delete this._namedListeners[l]:k.splice(b,1);break}}};l.prototype.constructor=l;l.attach=function(p){var n=new l;p.dispatchEvent=n.dispatchEvent.bind(n);p.addEventListener=n.addEventListener.bind(n);p.removeEventListener=n.removeEventListener.bind(n)};return l});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(l,p){function n(e,a,f){this._properties=f||{};this._properties["service.id"]=e;this._properties.objectClass=a;this._properties["service.names"]=a}function k(e,a,f){this._serviceId=e;this._serviceReference=a;this._internalRegistry=f}function b(e,a){function f(d){return function(){var f;try{if(!a())throw Error("Service was unregistered");var b=e[d].apply(e,Array.prototype.slice.call(arguments));if(b&&"function"===typeof b.then)return b;
f=new l;f.resolve(b)}catch(g){f=new l,f.reject(g)}return f.promise}}for(var d in e)"function"===typeof e[d]&&(this[d]=f(d))}function h(e,a){this.type=e;this.serviceReference=a}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new p;var e=this;this._internalRegistry={isRegistered:function(a){return e._entries[a]?!0:!1},unregisterService:function(a){var f=e._entries[a];if(!f)throw Error("Service has already been unregistered: "+a);var d=f.reference;e._serviceEventTarget.dispatchEvent(new h("unregistering",
d));e._entries[a]=null;d.getProperty("objectClass").forEach(function(a){for(var f=e._namedReferences[a],b=0;b<f.length;b++)if(f[b]===d){1===f.length?delete e._namedReferences[a]:f.splice(b,1);break}})},modifyService:function(a){var f=e._entries[a];if(!f)throw Error("Service not found while trying to send modified event: "+a);e._serviceEventTarget.dispatchEvent(new h("modified",f.reference))}}}n.prototype={getPropertyKeys:function(){var e=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
e.push(a);return e},getProperty:function(e){return this._properties[e]}};n.prototype.constructor=n;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(e){var a=this._serviceReference._properties;this._serviceReference._properties=e||{};e["service.id"]=this._serviceId;
e.objectClass=a.objectClass;e["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};k.prototype.constructor=k;g.prototype={getService:function(e){var a;if("string"===typeof e)(e=this._namedReferences[e])&&e.some(function(f){a=this._entries[f.getProperty("service.id")].service;return!!a},this);else if(e=this._entries[e.getProperty("service.id")])a=e.service;return a||null},getServiceReferences:function(e){if(e)return this._namedReferences[e]?this._namedReferences[e]:
[];var a=[];this._entries.forEach(function(f){f&&a.push(f.reference)});return a},registerService:function(e,a,f){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof e?e=[e]:Array.isArray(e)||(e=[]);var d=this._entries.length,m=new n(d,e,f),g=this._namedReferences;e.forEach(function(a){g[a]=g[a]||[];g[a].push(m)});e=new b(a,this._internalRegistry.isRegistered.bind(null,d));this._entries.push({reference:m,service:e});e=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",
m));return new k(d,m,e)},addEventListener:function(e,a){this._serviceEventTarget.addEventListener(e,a)},removeEventListener:function(e,a){this._serviceEventTarget.removeEventListener(e,a)}};g.prototype.constructor=g;return{ServiceRegistry:g}});
define("orion/xhr",["orion/Deferred"],function(l){function p(n,k,b,h){var g="undefined"!==typeof b.response?b.response:b.responseText,e;try{e=b.status}catch(a){e=0}n={args:k,response:g,responseText:"string"===typeof g?g:null,status:e,url:n,xhr:b};"undefined"!==typeof h&&(n.error=h);return n}return function(n,k,b){b=b||{};var h=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,g=new l,e=b.headers||{},a=b.log||!1,f;"undefined"===typeof e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof b.data&&("POST"===n||"PUT"===n))f=b.data;var d=!1,m=!1;g.promise.then(void 0,function(a){d=!0;!m&&(a instanceof Error&&"Cancel"===a.name)&&h.abort()});h.onabort=function(){m=!0;if(!d){var a=Error("Cancel");a.name="Cancel";g.reject(a)}};h.onload=function(){var d=p(k,b,h);200<=h.status&&400>h.status?g.resolve(d):(g.reject(d),a&&"undefined"!==typeof console&&console.log(Error(h.statusText)))};h.onerror=function(){var d=p(k,b,h);g.reject(d);a&&"undefined"!==typeof console&&console.log(Error(h.statusText))};
h.onprogress=function(a){a.xhr=h;g.progress(a)};try{h.open(n,k,!0);"string"===typeof b.responseType&&(h.responseType=b.responseType);if("number"===typeof b.timeout)if("number"===typeof h.timeout)h.timeout=b.timeout,h.addEventListener("timeout",function(a){g.reject(p(k,b,h,"Timeout exceeded"))});else{var r=setTimeout(function(){g.reject(p(k,b,h,"Timeout exceeded"))},b.timeout);g.promise.then(clearTimeout.bind(null,r),clearTimeout.bind(null,r))}Object.keys(e).forEach(function(a){h.setRequestHeader(a,
e[a])});h.send(f||null)}catch(u){g.reject(p(k,b,h,u))}return g.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(l,p,n){function k(a,d){this._name=a;this._providers=d;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function b(a,d){return{get:function(m,e){if(0===d)return null;var b=localStorage.getItem(a+m);if(null===b)return null;b=JSON.parse(b);return e||-1===d||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(m,e){if(0!==d)if(-1!==d&&(e._expires=(new Date).getTime()+
1E3*d),0===Object.keys(e).length)localStorage.removeItem(a+m);else{var b=JSON.stringify(e);localStorage.setItem(a+m,b);delete e._expires}},remove:function(d){localStorage.removeItem(a+d)}}}function h(a){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var d=a.getServiceReferences("orion.core.preference.provider");0<d.length&&(this._service=a.getService(d[0]))}return!!this._service}}function g(a){this._location=
a;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function e(){this._cache=new b("/orion/preferences/local",-1)}function a(a,d){this._userProvider=new h(a);this._localProvider=new e;d=d||"defaults.pref";-1===d.indexOf("://")&&(d=l.toUrl(d));this._defaultsProvider=new g(d);this._serviceRegistration=a.registerService("orion.core.preference",this)}k.prototype={_flush:function(){for(var a=[],d=0;d<this._stores.length;++d){var m=this._stores[d];-1!==this._dirty.indexOf(m)&&
a.push(this._providers[d].put(this._name,m));if(this._pendingDeletes[d]&&0<this._pendingDeletes[d].length){for(m=0;m<this._pendingDeletes[d].length;m++)a.push(this._providers[d].remove(this._name,this._pendingDeletes[d][m]));delete this._pendingDeletes[d]}}this._dirty=[];return p.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 d=this._stores[a],m;for(m in d)d.hasOwnProperty(m)&&"undefined"===typeof this._cached[m]&&(this._cached[m]=d[m])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,d){if(0!==this._stores.length){var m=this._stores[0];m[a]!==d&&(m[a]=d,this._cached=null,this._scheduleFlush(m))}},remove:function(a){for(var d=0;d<
this._stores.length;++d){var m=this._stores[d];if(m.hasOwnProperty(a))return delete m[a],this._pendingDeletes[d]||(this._pendingDeletes[d]=[]),this._pendingDeletes[d].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 d=this,m=[],e=0;e<this._providers.length;++e)m.push(this._providers[e].get(this._name,
a).then(function(a){return function(f){d._stores[a]=f}}(e)));return p.all(m).then(function(){d._cached=null;d._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(a,d){if(this._currentPromises[a])return this._currentPromises[a];var m=new p,e=null;d?this._cache.remove(a):e=this._cache.get(a);if(null!==e)m.resolve(e);else{this._currentPromises[a]=m;var b=this;this._service.get(a).then(function(d){b._cache.set(a,d);delete b._currentPromises[a];m.resolve(d)},function(d){404===d.status?
(d={},b._cache.set(a,d),delete b._currentPromises[a],m.resolve(d)):(delete b._currentPromises[a],m.resolve(b._cache.get(a,!0)||{}))})}return m},put:function(a,d){this._cache.set(a,d);return this._service.put(a,d)},remove:function(a,d){var m=this._cache.get(a);delete m[d];this._cache.set(a,m);return this._service.remove(a,d)}};g.prototype={get:function(a,d){if(this._currentPromise)return this._currentPromise;var m=new p,e=null;d?this._cache.remove(a):e=this._cache.get(a);if(null!==e)m.resolve(e);else{this._currentPromise=
m;var b=this;n("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){d=JSON.parse(d.response);b._cache.set(a,d[a]||{});b._currentPromise=null;m.resolve(d[a]||{})},function(d){401===d.xhr.status||404===d.xhr.status?(b._cache.set(a,{}),b._currentPromise=null,m.resolve({})):(b._currentPromise=null,d=b._cache.get(a,!0),null!==d?m.resolve(d[a]||{}):m.resolve({}))})}return m},put:function(a,d){var m=new p;m.resolve();return m},remove:function(a,d){var m=this._cache.get(a);
delete m[d];this.put(a,m)}};e.prototype={get:function(a){var d=new p;a=this._cache.get(a);null!==a?d.resolve(a):d.resolve({});return d},put:function(a,d){var m=new p;this._cache.set(a,d);m.resolve();return m},remove:function(a,d){var m=this._cache.get(a);delete m[d];this.put(a,m)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(f,d,m){if(!d||"number"!==typeof d||7<d||1>d)m=d,d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
m,!1);return 0!==(a.USER_SCOPE&d)?"/orion/preferences/user"+f:0!==(a.LOCAL_SCOPE&d)?"/orion/preferences/local"+f:"/orion/preferences/default"+f},getPreferences:function(f,d){if(!d||"number"!==typeof d||7<d||1>d)d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var m=[];a.USER_SCOPE&d&&this._userProvider.available()&&m.push(this._userProvider);a.LOCAL_SCOPE&d&&m.push(this._localProvider);a.DEFAULT_SCOPE&d&&m.push(this._defaultsProvider);var e=new k(f,m);return e.sync().then(function(){return e})},getSetting:function(a,
d,m){for(var e,b=0;b<a.length;b++)if(a[b].label===d)for(var g=0;g<a[b].data.length;g++)if(a[b].data[g].label===m){e=a[b].data[g].value;break}return e}};return{PreferencesService:a}});
(function(){function l(a){if("string"!==typeof a)throw new TypeError;}function p(a){return a?a.split("\x26"):[]}function n(a){return 0===a.length?"":a.join("\x26")}function k(a){var d=/([^=]*)(?:=?)(.*)/.exec(a);a=d[1]?decodeURIComponent(d[1]):"";d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function b(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="\x3d"+encodeURIComponent(a[1]));return d}function h(a,d){var m="",f=[],e=0;return{next:function(){m!==a.query&&(m=a.query,f=p(m));if(e<f.length){var b=
k(f[e++]);switch(d){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw C;}}}function g(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function e(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var d=[];a.split("/").forEach(function(a){".."===a?d.pop():"."!==a&&d.push(a)});return d.join("/")}function f(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function d(d,m){if("string"!==
typeof d)throw new TypeError;d=f(d);var b=q.exec(d);if(!b)return null;var v={};v.scheme=b[1]||"";if(v.scheme&&!w.test(v.scheme))return null;var g=b[2];if(g&&(g=t.exec(g),v.userinfo=g[1],v.host=g[2],v.port=g[3],v.port&&!s.test(v.port)))return null;v.path=b[3];v.query=b[4];v.fragment=b[5];!v.scheme&&m&&(v.scheme=m.scheme,!v.host&&m.host&&(v.userinfo=m.userinfo,v.host=m.host,v.port=m.port,v.pathRelative=!0));v.pathRelative&&(v.path?"/"!==v.path[0]&&(b=/^(.*\/)[^\/]*$/.exec(m.path)[1]||"/",v.path=b+v.path):
v.path=m.path);v.scheme&&(v.scheme=v.scheme.toLowerCase());v.port&&(v.port=e(v.port));v.host&&v.path&&(v.path=a(v.path));return v}function m(a,m){var f;if(m){m=m.href||m;f=d(m);if(!f||!f.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:f})}f=d(a,f);if(!f)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:f,writable:!0});var e=new g(this);Object.defineProperty(this,"query",{get:function(){return this._url?
e:null},enumerable:!0})}try{var r;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(r=new window.URL("http://www.w3.org?q")).protocol&&r.query)return}catch(u){}var q=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,t=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,x=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,z=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,y=/^([^?#\s]*)$/,B=/^([^\s]*)$/,v=/^\S*$/,A=/([^:]*):?(.*)/,C="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),F={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(g.prototype,{get:{value:function(a){l(a);var d;p(this._url.query).some(function(m){m=k(m);if(m[0]===a)return d=m[1],!0});return d},enumerable:!0},set:{value:function(a,d){l(a);l(d);var m=p(this._url.query);m.some(function(f,e){var v=k(f);if(v[0]===a)return v[1]=d,m[e]=b(v),!0})||m.push(b([a,d]));this._url.query=n(m)},enumerable:!0},has:{value:function(a){l(a);
return p(this._url.query).some(function(d){if(k(d)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){l(a);var d=p(this._url.query),m=d.filter(function(d){return k(d)[0]!==a});return m.length!==d.length?(this._url.query=n(m),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if("function"!==typeof a)throw new TypeError;var m=h(this._url,"keys+values");try{for(;;){var f=m.next();a.call(d,f[1],f[0],this)}}catch(e){if(e!==C)throw e;
}},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 p(this._url.query).length},enumerable:!0},getAll:{value:function(a){l(a);var d=[];p(this._url.query).forEach(function(m){m=k(m);m[0]===a&&d.push(m[1])});return d},enumerable:!0},append:{value:function(a,d){l(a);l(d);var m=p(this._url.query);m.push(b([a,d]));this._url.query=
n(m)},enumerable:!0}});Object.defineProperties(m.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(a){l(a);this._input=a;this._url=d(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||w.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 d=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];d[2]&&a.push(d[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 d=[A.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.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=z.exec(a)))this._url.host=a[1],this._url.port=e(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){l(a);this._url&&x.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===F[this.protocol]&&(a="");return a},set:function(a){l(a);this._url&&s.exec(a)&&(this._url.port=e(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(d){l(d);
this._url&&y.exec(d)&&(this._url.host&&(d&&"/"!==d[0])&&(d="/"+d),this._url.path=d?a(d):"")},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((r=window.URL||window.webkitURL)&&r.createObjectURL)Object.defineProperty(m,"createObjectURL",{value:r.createObjectURL.bind(r),enumerable:!1}),Object.defineProperty(m,"revokeObjectURL",{value:r.revokeObjectURL.bind(r),enumerable:!1});window.URL=m})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(l,p){function n(a,d){var f=Object.keys(a),e=Object.keys(d);if(f.length!==e.length)return!1;f.sort();e.sort();for(var b=0,g=f.length;b<g;b++){var h=f[b];if(h!==e[b])return!1;var k=a[h],h=d[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(d){}return a}function b(a){var d=null,f={key:function(f){return(d=
d||Object.keys(a))[f]},getItem:function(d){return a[d]},setItem:function(f,e){a[f]=e;d=null},removeItem:function(f){delete a[f];d=null},clear:function(){(d=d||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));d=null}};Object.defineProperty(f,"length",{get:function(){return(d=d||Object.keys(a)).length}});return f}function h(a,d){if(d&&d instanceof XMLHttpRequest){var f,e;try{f=d.status,e=d.statusText}catch(b){f=0,e=""}return{status:f||0,statusText:e}}return d}function g(a){var d=a?JSON.parse(JSON.stringify(a,
h)):a;a instanceof Error&&(d.__isError=!0,d.message=d.message||a.message,d.name=d.name||a.name);return d}function e(a,d){this.type=a;this.plugin=d}function a(a,d){this.__objectId=a;this.__methods=d}function f(d,f,b){function q(a){M&&b.postMessage(a,M)}function h(d){if(!M)return(new l).reject(Error("plugin not connected"));d.id=String(W++);var f=new l;U[d.id]=f;f.then(null,function(a){"active"===G&&(a instanceof Error&&"Cancel"===a.name)&&q({requestId:d.id,method:"cancel",params:a.message?[a.message]:
[]})});var m=Object.prototype.toString;d.params.forEach(function(e,b){if("[object Object]"===m.call(e)&&!(e instanceof a)){var v,g;for(v in e)"[object Function]"===m.call(e[v])&&(g=g||[],g.push(v));if(g){var q=N++;T[q]=e;v=function(){delete T[q]};f.then(v,v);d.params[b]=new a(q,g)}}});b.postMessage(d,M);return f.promise}function k(a,d){a||0===a?q({id:a,result:null,error:d}):console.log(d)}function s(a,d,f,m){m.forEach(function(a,d){if(a&&"undefined"!==typeof a.__objectId){var f={};a.__methods.forEach(function(d){f[d]=
function(){return h({objectId:a.__objectId,method:d,params:Array.prototype.slice.call(arguments)})}});m[d]=f}});var e=void 0===typeof a?null:{id:a,result:null,error:null};try{var b=f.apply(d,m);e&&(b&&"function"===typeof b.then?(S[a]=b,b.then(function(d){delete S[a];e.result=d;q(e)},function(d){S[a]&&(delete S[a],e.error=g(d),q(e))},function(){q({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=b,q(e)))}catch(v){e&&(e.error=g(v),q(e))}}function x(a){try{if(a.method){var d=
a.method,f=a.params||[];if("serviceId"in a){var m=Q[a.serviceId];m||k(a.id,"service not found");d in m?s(a.id,m,m[d],f):k(a.id,"method not found")}else if("objectId"in a){var e=T[a.objectId];e||k(a.id,"object not found");d in e?s(a.id,e,e[d],f):k(a.id,"method not found")}else if("requestId"in a){var v=S[a.requestId];v&&("cancel"===d&&v.cancel)&&v.cancel.apply(v,f)}else if("responseId"in a){var g=U[a.responseId];g&&("progress"===d&&g.progress)&&g.progress.apply(g,f)}else if("plugin"===a.method){M.connected();
var q=a.params[0];X({headers:q.headers,services:q.services}).then(function(){J&&J.resolve(A)})}else if("timeout"===a.method)J&&J.reject(a.error);else throw Error("Bad method: "+a.method);}else{var r=U[String(a.id)];delete U[String(a.id)];if(a.error){var C=b.handleServiceError(A,a.error);r.reject(C)}else r.resolve(a.result)}}catch(h){console.log("Plugin._messageHandler "+h)}}function z(d){var f={};if(d.methods&&(d.methods.forEach(function(a){f[a]=function(){var f={serviceId:d.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===G?h(f):A.start({"transient":!0}).then(function(){return h(f)})}}),f.addEventListener&&f.removeEventListener)){var m=new p,e=N++;T[e]={handleEvent:m.dispatchEvent.bind(m)};var b=new a(e,["handleEvent"]),v=f.addEventListener;f.addEventListener=function(a,d){m._namedListeners[a]||v(a,b);m.addEventListener(a,d)};var g=f.removeEventListener;f.removeEventListener=function(a,d){m.removeEventListener(a,d);m._namedListeners[a]||g(a,b)}}return f}function y(a){var f=JSON.parse(JSON.stringify(a.properties));
f.__plugin__=d;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);f.objectClass=a;return f}function B(a){var d=z(a),f=y(a),f=b.registerService(a.names||a.type,d,f);L[a.serviceId]={registration:f,proxy:d}}function v(){b.persist(d,{created:C,headers:F,services:D,autostart:E,lastModified:I})}var A=this;f=f||{};var C=f.created||(new Date).getTime(),F=f.headers||{},D=f.services||[],E=f.autostart,I=f.lastModified||0,G="installed",H,J,M,Y,L={},W=0,N=0,S={},U={},T={},Q={},X;this._default=!1;this._persist=v;
this._resolve=function(){G="resolved";b.dispatchEvent(new e("resolved",A))};this._getAutostart=function(){return E};this._getCreated=function(){return C};this.getLocation=function(){return d};this.getHeaders=function(){return JSON.parse(JSON.stringify(F))};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 I};this.getServiceReferences=function(){var a=
[];Object.keys(L).forEach(function(d){a.push(L[d].registration.getReference())});return a};this.setParent=function(a){return Y!==a?(Y=a,A.stop({"transient":!0}).then(function(){if("started"===E)return A.start({"transient":!0});if("lazy"===E)return A.start({lazy:!0,"transient":!0})})):(new l).resolve()};this.getState=function(){return G};this.start=function(a){if("uninstalled"===G)return(new l).reject(Error("Plugin is uninstalled"));if(H)return H.promise.then(this.start.bind(this,a));if("active"===
G)return(new l).resolve();if(!a||!a.transient){var f=a&&a.lazy?"lazy":"started";f!==E&&(E=f,v())}f=b.getState();if("starting"!==f&&"active"!==f)return a.transient?(new l).reject(Error("start transient error")):(new l).resolve();if("installed"===G)try{this._resolve()}catch(g){return(new l).reject(g)}"resolved"===G&&D.forEach(function(a){B(a)});if(a&&a.lazy)return"starting"!==G&&(G="starting",b.dispatchEvent(new e("lazy activation",A))),(new l).resolve();var q=new l;H=q;G="starting";b.dispatchEvent(new e("starting",
A));J=new l;M=b.connect(d,x,Y);J.then(function(){J=null;G="active";b.dispatchEvent(new e("started",A));H=null;q.resolve()},function(){J=null;G="stopping";b.dispatchEvent(new e("stopping",A));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});b.disconnect(M);M=null;G="resolved";H=null;b.dispatchEvent(new e("stopped",A));q.reject(Error("Failed to load plugin: "+d));A._default&&(I=0,v())});return q.promise};this.stop=function(a){if("uninstalled"===G)return(new l).reject(Error("Plugin is uninstalled"));
if(H)return H.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==E)E="stopped",v();if("active"!==G&&"starting"!==G)return(new l).resolve();H=a=new l;G="stopping";b.dispatchEvent(new e("stopping",A));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});M&&(b.disconnect(M),M=null);G="resolved";H=null;b.dispatchEvent(new e("stopped",A));a.resolve();return a.promise};X=function(a){if("uninstalled"===G)return(new l).reject(Error("Plugin is uninstalled"));
if(!a)return 0===I&&(I=(new Date).getTime(),v()),b.loadManifest(d).then(X,function(){A._default&&(I=0,v());console.log("Failed to load plugin: "+d)});var f=F,g=D,q=E;F=a.headers||{};D=a.services||[];E=a.autostart||E;a.lastModified?I=a.lastModified:(I=(new Date).getTime(),v());if(n(F,f)&&n(D,g)&&E===q)return(new l).resolve();if("active"===G||"starting"===G){var r=[];Object.keys(D).forEach(function(a){var d=D[a];r.push(a);var f=L[a];if(f){if(n(d.methods,Object.keys(f.proxy))){a=y(d);var m=f.registration.getReference(),
e={};m.getPropertyKeys().forEach(function(a){e[a]=m.getProperty(a)});n(a,e)||f.registration.setProperties(a);return}f.registration.unregister();delete L[a]}B(d)});Object.keys(L).forEach(function(a){-1===r.indexOf(a)&&(L[a].registration.unregister(),delete L[a])})}"active"===G&&(b.disconnect(M),J=new l,M=b.connect(d,x,Y),J.then(function(){J=null},function(){J=null;G="stopping";b.dispatchEvent(new e("stopping"),A);Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});b.disconnect(M);
M=null;G="resolved";b.dispatchEvent(new e("stopped",A))}));return(new l).resolve()};this.update=function(a){return X(a).then(function(){b.dispatchEvent(new e("updated",A))})};this.uninstall=function(){if("uninstalled"===G)return(new l).reject(Error("Plugin is uninstalled"));if("active"===G||"starting"===G||"stopping"===G)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));b.removePlugin(this);G="uninstalled";b.dispatchEvent(new e("uninstalled",A));return(new l).resolve()}}
var d=/^http[s]?/i;return{Plugin:f,PluginRegistry:function(a,g){function h(a){var d=a.source;n.some(function(f){if(d===f.target){try{var m;if("undefined"===typeof f.useStructuredClone){var e="string"!==typeof a.data;m=e?a.data:JSON.parse(a.data);f.useStructuredClone=e}else m=f.useStructuredClone?a.data:JSON.parse(a.data);f.handler(m)}catch(b){}return!0}})}g=g||{};var q=g.storage||localStorage;q.getItem||(q=b(q));var t="installed",w,s=[],n=[],z=new p,y={},B={registerService:a.registerService.bind(a),
connect:function(a,d,f,m){function e(a){a=Error(a);a.name="timeout";d({method:"timeout",error:a})}var b={handler:d,url:a},g=setTimeout(e.bind(null,"Load timeout for: "+a),m||15E3),q=document.createElement("iframe");q.name=a+"_"+(new Date).getTime();q.src=a;q.onload=function(){clearTimeout(g);g=setTimeout(e.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;(f||w).appendChild(q);b.target=q.contentWindow;
b.connected=function(){clearTimeout(g)};b.close=function(){clearTimeout(g);if(q){var a=q.parentNode;a&&a.removeChild(q);q=null}};n.push(b);return b},disconnect:function(a){for(var d=0;d<n.length;d++)if(a===n[d]){n.splice(d,1);try{a.close()}catch(f){}break}},removePlugin:function(a){for(var d=0;d<s.length;d++)if(a===s[d]){s.splice(d,1);break}q.removeItem("plugin."+a.getLocation())},persist:function(a,d){q.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?
a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{z.dispatchEvent(a)}catch(d){console&&console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new l,f=B.connect(a,function(a){f&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],B.disconnect(f),f=null,d.resolve(a)):"timeout"===a.method&&(B.disconnect(f),f=null,d.reject(a.error)))});return d.promise},getState:function(){return t},handleServiceError:function(a,f){if(f&&401===f.status){var m=a.getHeaders(),
e=a.getName()||a.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+e+"."));m.login&&(b.appendChild(document.createTextNode(" ")),e=document.createElement("a"),e.target="_blank",e.textContent="Login",e.href=m.login,d.test(e.href)?(b.appendChild(e),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+m.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(b)}}if(f.__isError){var g=
f;f=Error(g.message);Object.keys(g).forEach(function(a){f[a]=g[a]});delete f.__isError}return f}};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"===t||"active"===t||"stopping"===t)){addEventListener("message",h,!1);for(var a=[],d=0,m=q.length;d<m;d++)a.push(q.key(d));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var d=a.substring(7);a=JSON.parse(q.getItem(a));a.created&&s.push(new f(d,a,B))}});s.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});g.parent?w=g.parent:(w=document.createElement("div"),g.visible||(w.style.display="none",w.style.visibility="hidden"),document.body.appendChild(w));g.plugins&&Object.keys(g.plugins).forEach(function(a){a=k(a);var d=this.getPlugin(a);d?d._default=!0:(d=g.plugins[a],"object"!==typeof d&&(d={}),d.autostart=d.autostart||g.defaultAutostart||
"lazy",d=new f(a,d,B),d._default=!0,s.push(d))}.bind(this));t="starting"}};this.start=function(){"starting"!==t&&this.init();if("starting"!==t)return(new l).reject("Cannot start framework. Framework is already "+t+".");var a=[],d=(new Date).getTime();s.forEach(function(f){var m=f._getAutostart();0===f.getLastModified()?a.push(f.update().then(function(){if("started"===m)return f.start({"transient":!0});if("lazy"===m)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===m?a.push(f.start({"transient":!0})):
"lazy"===m?(a.push(f.start({lazy:!0,"transient":!0})),d>f.getLastModified()+864E5&&f.update()):f._resolve()});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){t="active"})};this.stop=function(){if("starting"!==t&&"active"!==t)return(new l).reject("Cannot stop registry. Registry is already "+t+".");t="stopping";var a=[];s.forEach(function(d){a.push(d.stop({"transient":!0}))});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!g.parent){var a=
w.parentNode;a&&a.removeChild(w)}w=null;removeEventListener("message",h);t="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,d){a=k(a);var m=this.getPlugin(a);if(m)return(new l).resolve(m);if(y[a])return y[a];if(d)return m=new f(a,d,B),s.push(m),m._persist(),B.dispatchEvent(new e("installed",m)),(new l).resolve(m);var b=B.loadManifest(a).then(function(d){m=new f(a,
d,B);s.push(m);m._persist();delete y[a];B.dispatchEvent(new e("installed",m));return m},function(d){delete y[a];throw d;});return y[a]=b};this.getPlugins=function(){return s.slice()};this.getPlugin=function(a){var d=null;a=k(a);s.some(function(f){if(a===f.getLocation())return d=f,!0});return d};this.addEventListener=z.addEventListener.bind(z);this.removeEventListener=z.removeEventListener.bind(z);this.resolvePlugins=function(){var a=!0;s.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/objects",[],function(){function l(l){for(var n=Object.prototype.hasOwnProperty,k=1,b=arguments.length;k<b;k++){var h=arguments[k],g;for(g in h)n.call(h,g)&&(l[g]=h[g])}return l}return{clone:function(p){if(Array.isArray(p))return Array.prototype.slice.call(p);var n=Object.create(Object.getPrototypeOf(p));l(n,p);return n},mixin:l,toArray:function(l){return Array.isArray(l)?l:[l]}}});
define("orion/serviceTracker",[],function(){function l(k,b){function h(d){var f=d.getProperty("service.id"),m=this.addingService(d);m&&(e[f]=d,a[f]=m)}function g(d){var f=d.getProperty("service.id"),m=a[f];delete e[f];delete a[f];this.removedService(d,m)}this.serviceRegistry=k;var e={},a={},f=p,d,m;this.close=function(){if(f!==n)throw"Already closed";f=p;k.removeEventListener("registered",d);k.removeEventListener("unregistering",m);m=d=null;var a=this;this.getServiceReferences().forEach(function(d){g.call(a,
d)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(e);return!a.length?null:a.map(function(a){return e[a]})};this.open=function(){if(f!==p)throw"Already open";f=n;var a=this;d=function(d){if(-1!==d.serviceReference.getProperty("objectClass").indexOf(b)&&(h.call(a,d.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(d.serviceReference,a.serviceRegistry.getService(d.serviceReference))};m=function(d){-1!==d.serviceReference.getProperty("objectClass").indexOf(b)&&
g.call(a,d.serviceReference)};k.addEventListener("registered",d);k.addEventListener("unregistering",m);k.getServiceReferences(b).forEach(function(d){h.call(a,d);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(d,k.getService(d))});if("function"===typeof this.onOpen)this.onOpen()}}var p=0,n=1;l.prototype={addingService:function(k){return this.serviceRegistry.getService(k)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(k,b){}};return l});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(l,p,n,k){var b=n.PreferencesService,h,g,e,a,f=b.DEFAULT_SCOPE,d="pid",m="/cm/configurations";h=function(a,f,m){function e(a,d,m){d.forEach(function(e,b){try{var g=a[b].getProperty("__plugin__"),q=g&&f.getPlugin(g);(!g||q&&"active"===q.getState())&&d[b].updated(m)}catch(r){"undefined"!==typeof console&&console.log(r)}})}k.call(this,a,"orion.cm.managedservice");var b={},g={},h=function(f){var e=
[];f.plugin.getServiceReferences().forEach(function(f){if(-1!==f.getProperty("objectClass").indexOf("orion.cm.managedservice")){var b=f.getProperty(d);f=a.getService(f);b&&f&&(b=(b=m._find(b))&&b.getProperties(),e.push(f.updated(b)))}});return l.all(e)};this.addingService=function(f){var m=f.getProperty(d),e=a.getService(f);if(!m||!e)return null;b[m]||(b[m]=[]);g[m]||(g[m]=[]);b[m].push(f);g[m].push(e);return e};this.onServiceAdded=function(a,f){var b=a.getProperty(d),b=m._find(b);e([a],[f],b&&b.getProperties())};
this.onOpen=function(){f.addEventListener("started",h)};this.onClose=function(){f.removeEventListener("started",h)};this.notifyUpdated=function(a){var d=a.getPid();e(b[d]||[],g[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();e(b[a]||[],g[a]||[],null)};this.removedService=function(a,f){var m=a.getProperty(d),e=b[m],q=g[m];1<e.length?e.splice(e.indexOf(a),1):delete b[m];1<q.length?q.splice(q.indexOf(f),1):delete g[m]}};n=function(){function a(d,f,m){this.store=new g(this,m);this.configAdmin=
new e(this,this.store);this.tracker=new h(d,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(d){a.tracker.open();return d})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();e=function(){function a(d,f){this.factory=d;this.store=f}a.prototype={_prefName:m,_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,f)},listConfigurations:function(){return this.store.list()}};return a}();g=function(){function e(a,d){this.factory=a;this.prefsService=d;this.pref=this.configs=this.defaultConfigs=null;var b=this;this.initPromise=l.all([this.prefsService.getPreferences(m,f),this.prefsService.getPreferences(m)]).then(function(a){var d=a[0];b.pref=a[1];b.defaultConfigs=b._toConfigs(d,!0);b.configs=b._toConfigs(b.pref,!1,d)})}e.prototype={_toConfigs:function(f,
m,e){var b=Object.create(null),g=this;f.keys().forEach(function(r){if(!b[r]){var h=f.get(r),k=e&&e.get(r);"object"===typeof h&&(null!==h&&0<Object.keys(h).length)&&(h[d]=r,b[r]=new a(g.factory,g,h,m,k))}});return b},_init:function(){return this.initPromise},_find:function(a,d){return d===b.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(d){var m=this._find(d),e=this._find(d,f);m||(m=e&&e.getProperties(!0),m=new a(this.factory,this,d,!1,m),this.configs[d]=m);return m},
list:function(){var a=this,d=[];this.pref.keys().forEach(function(f){(f=a._find(f))&&null!==f.getProperties()&&d.push(f)});return d},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,d){var m=d.getProperties(!0)||{},e=this._find(a,f);if(e){var b=e.getProperties(!0);Object.keys(b).forEach(function(a){Object.prototype.hasOwnProperty.call(m,a)&&m[a]===b[a]&&delete m[a]})}this.pref.put(a,m)}};return e}();a=function(){function a(f,m){m=p.clone(m);delete m[d];f.properties=m}
function f(m,e,b,g,h){this.factory=m;this.store=e;this.readOnly=g;if(null!==b&&"object"===typeof b)this.pid=b[d],a(this,b);else if("string"===typeof b)this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);if(h){var k=this;Object.keys(h).forEach(function(a){a===d||Object.prototype.hasOwnProperty.call(k.properties,a)||(k.properties[a]=h[a])})}}f.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 f=null;this.properties&&(f=p.clone(this.properties),a||(f[d]=this.pid));return f},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(d){this._checkReadOnly();this._checkRemoved();a(this,d);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+
this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return f}();return{ConfigurationAdminFactory:n}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(l,p,n,k,b,h){var g;return{startup:function(){if(g)return g;g=new p;var e=new n.ServiceRegistry,a=new k.PreferencesService(e);return a.getPreferences("/plugins").then(function(f){var d={plugins:{}};f.keys().forEach(function(a){var m=l.toUrl(a);d.plugins[m]=f[a]});var m=new b.PluginRegistry(e,d);return m.start().then(function(){if(0<e.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=l.toUrl(a);m.getPlugin(a)||d.push(m.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return p.all(d,function(a){console.log(a)})})}).then(function(){return(new h.ConfigurationAdminFactory(e,m,a)).getConfigurationAdmin().then(e.registerService.bind(e,"orion.cm.configadmin"))}).then(function(){var a=e.getService("orion.core.auth");if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return d}}).then(function(){var d={serviceRegistry:e,preferences:a,pluginRegistry:m};g.resolve(d);return d})})}}});
(function(){function l(b,h,g,e,a,f){h[b]&&(g.push(b),(!0===h[b]||1===h[b])&&e.push(a+b+"/"+f))}function p(b,h,g,e,a){h=e+h+"/"+a;require._fileExists(b.toUrl(h+".js"))&&g.push(h)}function n(b,h,g){for(var e in h)h.hasOwnProperty(e)&&(!b.hasOwnProperty(e)||g)?b[e]=h[e]:"object"===typeof h[e]&&n(b[e],h[e],g)}var k=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var h=b.config?b.config():{},h=h||{};return{version:"2.0.1+",load:function(b,e,a,f){f=f||{};f.locale&&(h.locale=
f.locale);var d=k.exec(b),m=d[1],r=d[4],u=d[5],q=r.split("-"),t=[],w={},s,x="";d[5]?(m=d[1],b=m+u):(u=d[4],r=h.locale,r||(r=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),q=r.split("-"));if(f.isBuild){t.push(b);p(e,"root",t,m,u);for(s=0;s<q.length;s++)f=q[s],x+=(x?"-":"")+f,p(e,x,t,m,u);e(t,function(){a()})}else e([b],function(d){var f=[],b;l("root",d,f,t,m,u);for(s=0;s<q.length;s++)b=q[s],x+=(x?"-":"")+b,l(x,d,f,t,m,u);e(t,function(){var b,
g,q;for(b=f.length-1;-1<b&&f[b];b--){q=f[b];g=d[q];if(!0===g||1===g)g=e(m+q+"/"+u);n(w,g)}a(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(l,p,n,k){k=k||{};var b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=b.exec(l);if(h){if(!p.defined||p.defined(l))try{n(p(l));return}catch(g){}if(k.isBuild||k.isTest)n({});else if(p.specified&&!p.specified("orion/bootstrap"))n({});else{var e=h[1],a=h[3]?h[2]:"",f=h[3]||h[2];p(["orion/bootstrap"],function(d){d.startup().then(function(d){var g=d.serviceRegistry;d=g.getServiceReferences("orion.i18n.message");if(a)d.some(function(a){return l===a.getProperty("name")?
(g.getService(a).getMessageBundle().then(function(a){n(a)},function(){n({})}),!0):!1})||n({});else{var u={},q;d.forEach(function(d){var m=d.getProperty("name");if((h=b.exec(m))&&e===h[1]&&f===(h[3]||h[2]))if(a=h[3]?h[2]:""){if((d=k.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===d.toLowerCase().indexOf(a.toLowerCase()))u[a]=!0,(!p.specified||!p.specified(m))&&define(m,["orion/i18n!"+m],function(a){return a})}else q=d});!p.specified||!p.specified(l)?q?
g.getService(q).getMessageBundle().then(function(a){Object.keys(u).forEach(function(d){"undefined"===typeof a[d]&&(a[d]=u[d])});define(l,[],a);n(a)},function(){define(l,[],u);n(u)}):(define(l,[],u),n(u)):n(u)}})})}}else n(null)}}});
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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("text",["module"],function(l){var p,n,k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,h=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,g="undefined"!==typeof location&&location.href,e=g&&location.protocol&&location.protocol.replace(/\:/,""),a=g&&location.hostname,f=g&&(location.port||void 0),d=[],m=l.config&&l.config()||{};p={version:"2.0.5",strip:function(a){if(a){a=a.replace(b,"");var d=a.match(h);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:m.createXhr||function(){var a,d,f;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(d=0;3>d;d+=1){f=k[d];try{a=new ActiveXObject(f)}catch(m){}if(a){k=[f];break}}return a},parseName:function(a){var d,
f,m=!1,e=a.indexOf(".");d=0===a.indexOf("./")||0===a.indexOf("../");-1!==e&&(!d||1<e)?(d=a.substring(0,e),f=a.substring(e+1,a.length)):d=a;a=f||d;e=a.indexOf("!");-1!==e&&(m="strip"===a.substring(e+1),a=a.substring(0,e),f?f=a:d=a);return{moduleName:d,ext:f,strip:m}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,f,m){var e,b;e=p.xdRegExp.exec(a);if(!e)return!0;a=e[2];e=e[3];e=e.split(":");b=e[1];e=e[0];return(!a||a===d)&&(!e||e.toLowerCase()===f.toLowerCase())&&(!b&&!e||b===m)},finishLoad:function(a,
f,e,b){e=f?p.strip(e):e;m.isBuild&&(d[a]=e);b(e)},load:function(d,b,q,h){if(h.isBuild&&!h.inlineText)q();else{m.isBuild=h.isBuild;var k=p.parseName(d);h=k.moduleName+(k.ext?"."+k.ext:"");var s=b.toUrl(h),n=m.useXhr||p.useXhr;!g||n(s,e,a,f)?p.get(s,function(a){p.finishLoad(d,k.strip,a,q)},function(a){q.error&&q.error(a)}):b([h],function(a){p.finishLoad(k.moduleName+"."+k.ext,k.strip,a,q)})}},write:function(a,f,m,e){d.hasOwnProperty(f)&&(e=p.jsEscape(d[f]),m.asModule(a+"!"+f,"define(function () { return '"+
e+"';});\n"))},writeFile:function(a,d,f,m,e){d=p.parseName(d);var b=d.ext?"."+d.ext:"",g=d.moduleName+b,h=f.toUrl(d.moduleName+b)+".js";p.load(g,f,function(d){d=function(a){return m(h,a)};d.asModule=function(a,d){return m.asModule(a,h,d)};p.write(a,g,d,e)},e)}};if("node"===m.env||!m.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)n=require.nodeRequire("fs"),p.get=function(a,d){var f=n.readFileSync(a,"utf8");0===f.indexOf("\ufeff")&&(f=f.substring(1));d(f)};else if("xhr"===
m.env||!m.env&&p.createXhr())p.get=function(a,d,f,e){var b=p.createXhr(),g;b.open("GET",a,!0);if(e)for(g in e)e.hasOwnProperty(g)&&b.setRequestHeader(g.toLowerCase(),e[g]);if(m.onXhr)m.onXhr(b,a);b.onreadystatechange=function(m){4===b.readyState&&(m=b.status,399<m&&600>m?(m=Error(a+" HTTP status: "+m),m.xhr=b,f(m)):d(b.responseText))};b.send(null)};else if("rhino"===m.env||!m.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)p.get=function(a,d){var f,m,e=new java.io.File(a),b=java.lang.System.getProperty("line.separator"),
e=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(e),"utf-8")),g="";try{f=new java.lang.StringBuffer;(m=e.readLine())&&(m.length()&&65279===m.charAt(0))&&(m=m.substring(1));for(null!==m&&f.append(m);null!==(m=e.readLine());)f.append(b),f.append(m);g=String(f.toString())}finally{e.close()}d(g)};return p});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,p,n){return{slideoutHTMLFragment:function(k){var b=document.createElement("div");b.innerHTML=n;var h=p.$("#slideContainer",b);h.id=k+h.id;h=p.$("#pageCommandParameters",b);h.id=k+h.id;h=p.$("#pageCommandDismiss",b);h.id=k+h.id;return b.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(l){function p(k,b,h,g,e,a){this.type=a||"keydown";this.keyCode="string"===typeof k&&"keydown"===this.type?k.toUpperCase().charCodeAt(0):k;this.mod1=void 0!==b&&null!==b?b:!1;this.mod2=void 0!==h&&null!==h?h:!1;this.mod3=void 0!==g&&null!==g?g:!1;this.mod4=void 0!==e&&null!==e?e:!1}function n(k){this.keys=k}p.prototype={getKeys:function(){return[this]},match:function(k,b){if(void 0!==b){if(0!==b)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}};n.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(k,b){var h=this.keys;if(void 0!==b)return b>h.length?!1:h[b].match(k)?b===h.length-1?!0:b+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 b=0;b<k.keys.length;b++)if(!k.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:p,KeyStroke:p,KeySequence:n}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(l,p,n){function k(b){n.attach(this);this._init(b)}function b(b,e){var a=document.createElement(void 0===e?"span":e);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var f=document.createElement("span");f.appendChild(document.createTextNode(b));f.classList.add("dropdownCommandName");a.appendChild(f);f=document.createElement("li");f.appendChild(a);return f}function h(){var b=document.createElement("li");
b.classList.add("dropdownSeparator");return b}k.prototype={_init:function(b){this._dropdownNode=p.node(b.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=b.populate;this._selectionClass=b.selectionClass;this._parentDropdown=b.parentDropdown;this._positioningNode=b.positioningNode;if(!this._parentDropdown)for(var e=this._dropdownNode.parentNode;e&&document!==e;){if(e.classList&&e.classList.contains("dropdownMenu")){this._parentDropdown=e.dropdown;break}e=e.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=b.triggerNode?b.triggerNode:p.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(f){a.toggle(f)&&p.stop(f)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(f){if(f.keyCode===p.KEY.ENTER||f.keyCode===p.KEY.SPACE)a.toggle(),p.stop(f)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var e=this;b.addEventListener("click",function(a){e.toggle(a)&&p.stop(a)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var e=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:b}),p.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?p.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),e=p.$$array(".dropdownSubMenu",this._dropdownNode),p.addAutoDismiss([this._triggerNode].concat(e),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(b),this._focusDropdownNode(),
e=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return e},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(b){if(this.close(!1)&&this._dropdownNode.contains(b.target))for(b=this._parentDropdown;b;)b.close(!1),b=b._parentDropdown},_positionDropdown:function(b){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{b=p.bounds(this._dropdownNode);
var e=p.bounds(document.body);if(b.left+b.width>e.left+e.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var a=p.bounds(this._boundingNode(this._triggerNode)),f=p.bounds(this._triggerNode);this._dropdownNode.style.left=f.left-a.left-b.width+f.width+"px"}b=b.top+b.height-(e.top+e.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var e=window.getComputedStyle(b,null);
return null===e||"absolute"===e.getPropertyValue("position")||!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var e=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),p.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),e=!0);return e},getItems:function(){var b=[],e=this;p.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===e._dropdownNode&&b.push(a)});b.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(f){a.dropdown?a.dropdown.open(f):(e._closeSelectedSubmenu(),p.stop(f));e._selectItem(a)}),a._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;p.$$array("li",this._dropdownNode).forEach(function(e){e.parentNode===
b._dropdownNode&&e.parentNode.removeChild(e)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===p.KEY.UP||b.keyCode===p.KEY.DOWN||b.keyCode===p.KEY.RIGHT||b.keyCode===p.KEY.ENTER||b.keyCode===p.KEY.LEFT){var e=this.getItems();if(e.length&&0<e.length){if(this._selectedItem){var a=e.indexOf(this._selectedItem);0>a&&(a=e.indexOf(this._selectedItem.parentNode));0<=a&&(b.keyCode===p.KEY.UP&&0<a?(a--,this._selectItem(e[a])):b.keyCode===p.KEY.DOWN&&a<e.length-1?(a++,this._selectItem(e[a])):
b.keyCode===p.KEY.ENTER||b.keyCode===p.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):b.keyCode===p.KEY.ENTER&&this._selectedItem.click():b.keyCode===p.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(e[0]);p.stop(b)}}else b.keyCode===
p.KEY.ESCAPE&&(this.close(!0),p.stop(b))},_selectItem:function(b){if(b=b||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=b,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(b){b!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=b)},_closeSelectedSubmenu:function(){for(var b=this._selectedSubmenu;b;)b.close(),
b=b._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&p.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(g,e){var a=b(g,e);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var b=h();this._dropdownNode.appendChild(b);return b}};k.prototype.constructor=k;return{Dropdown:k,appendKeyBindingString:function(b,e){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(e));b.appendChild(a)},
createMenuItem:b,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,p){function n(k){this._init(k)}n.prototype={_init:function(k){this._node=p.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 b=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(g){g.target===b._node&&(b.show(),p.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){p.contains(b._node,g.target)&&(b.show(),p.stop(g))},!1);this._leaveHandler=function(g){p.contains(b._node,g.target)&&b.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 b=this;p.addAutoDismiss([this._tip,this._node],function(){b.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){b._timeout&&(window.clearTimeout(b._timeout),b._timeout=null);b._tip.addEventListener("mouseout",function(g){p.contains(b._tip,g.target)&&(b.hide(),p.stop(g))},
!1)},!1))}return this._tip},_positionTip:function(k,b){this._makeTipNode();"left"===k?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,g;for(g=p.bounds(h);h&&!g.width&&!g.height;h=h.parentNode)g=p.bounds(h);var h=p.bounds(this._tipInner),e;switch(k){case "above":e=g.top-h.height-this._tailSize-1;g=g.left-this._tailSize;break;case "below":e=g.top+g.height+this._tailSize+1;g=g.left-this._tailSize;break;case "left":e=g.top-this._tailSize/2;g=g.left-h.width-
this._tailSize-1;break;default:e=g.top-this._tailSize/2,g=g.left+g.width+this._tailSize+1}var a=p.bounds(document.documentElement);if(e+h.height>a.height)if(b)e=a.height-h.height-1;else return!1;if(g+h.width>a.width)if(b)g=a.width-h.width-1;else return!1;if(0>g)if(b)g=4;else return!1;if(0>e)if(b)e=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=e+"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,b=0;!k&&b<this._position.length;)k=this._positionTip(this._position[b]),b++;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 b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");
b._tip.removeAttribute("style");b._afterHiding&&b._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"],b=0;b<k.length;b++)this._node.removeEventListener(k[b],
this._leaveHandler,!1)}}};n.prototype.constructor=n;return{Tooltip:n}});
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,p,n,k,b,h,g,e){function a(a){var d=a.invocation;if(d){var f=a.command;if(f.hrefCallback)return a=f.hrefCallback.call(d.handler||window,d),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(d.commandRegistry)return d.commandRegistry._invoke(d),
!0;if(f.onClick||f.callback)return window.setTimeout(function(){(f.onClick||f.callback).call(d.handler||window,d)},0),!0}return!1}function f(d,f){for(var m in f)if(f[m]&&(f[m].keyBinding&&f[m].command)&&f[m].keyBinding.match(d)){var e=f[m],b=e.keyBinding;if((!b.domScope||p.contains(p.node(b.domScope),d.target))&&a(e)){p.stop(d);break}}}function d(){var a={};if(s){var d,f,m;f=Object.keys(x);for(d=0;d<f.length;d++)m=f[d],a[m]=x[m];var e=s();f=Object.keys(e);for(d=0;d<f.length;d++)m=f[d],a[m]=e[m]}else a=
x;return a}function m(a){f(a,d())}function r(a,d){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 f=a.target.nodeName.toLowerCase();if("input"===f)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"===f)return}d?d(a):m(a)}function u(){this._init()}
function q(a,d,f){d.classList.add("commandImage");var m;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(m=document.createElement("span"),d.appendChild(m),m.classList.add(a.spriteClass),m.classList.add(a.imageClass)):(m=new Image,m.alt=a.name,m.name=f,m.id=f,m.src=a.image,d.appendChild(m));return m}function t(a,d,f,m,e){this.commandRegistry=e;this.handler=a;this.items=d;this.userData=f;this.command=m;m.parameters&&(this.parameters=m.parameters.makeCopy());this.id=m.id}function w(a){this._init(a)}
var s=null,x={};u.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(d){return r(d,function(d){var f=a.proxy,m=a.bindings;if(m&&f)for(var e=0;e<m.length;e++)m[e].match(d)&&(f.processKey({type:d.type,keyCode:d.keyCode,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey}),p.stop(d))})})}};window.document.addEventListener("keydown",r,!1);t.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new t(this.handler,this.items,this.userData,this.command,this.commandRegistry);d.domNode=this.domNode;d.domParent=this.domParent;a?d.parameters=a.makeCopy():this.parameters&&(d.parameters=this.parameters.makeCopy());return d}};t.prototype.constructor=t;w.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,
d,f,m,e){f=this.getChoices(d,f,m);var b=f.some(function(a){return a.checked});f.forEach(function(f){if(f.name){var m=document.createElement("li");a.appendChild(m);var g=document.createElement("span");g.tabIndex=0;g.role="menuitem";g.classList.add("dropdownMenuItem");if(b){var v=document.createElement("span");v.classList.add("check");v.appendChild(document.createTextNode(f.checked?"\u25cf":""));g.appendChild(v)}v=document.createTextNode(f.name);g.appendChild(v);m.appendChild(g);g.choice=f;g.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);g.addEventListener("keydown",function(a){(a.keyCode===p.KEY.ENTER||a.keyCode===p.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else e._generateMenuSeparator(a)})},getChoices:function(a,d,f){return this.choiceCallback?this.choiceCallback.call(d,a,f):null},makeChoiceCallback:function(a,d){return function(f){a.callback&&a.callback.call(a,d,f)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};w.prototype.constructor=w;return{Command:w,CommandInvocation:t,createDropdownMenu:function(a,d,f,m,e,g,r,h,t){a=p.node(a);if(!a)throw"no parent node was specified";var u=document.createRange();u.selectNode(a);u=t?u.createContextualFragment(b):u.createContextualFragment(k);p.processTextNodes(u,{ButtonText:d});a.appendChild(u);a=a.lastChild;
var w;t?(t=a.previousSibling,w=t.lastChild):t=a.previousSibling;m?t.classList.add(m):(t.classList.add("orionButton"),t.classList.add("commandButton"));e&&(g||(t.textContent="",t.setAttribute("aria-label",d)),q({spriteClass:"commandSprite",imageClass:e},t,d),t.classList.add("orionButton"));t.dropdown=new n.Dropdown({dropdown:a,populate:f,selectionClass:r,skipTriggerEventListeners:!!w,positioningNode:h});a.dropdown=t.dropdown;return{menuButton:t,menu:a,dropdown:t.dropdown,dropdownArrow:w}},createCheckedMenuItem:function(a,
d,f,m){a=p.node(a);if(!a)throw"no parent node was specified";var e=document.createRange();e.selectNode(a);e=e.createContextualFragment(g);p.processTextNodes(e,{ItemText:d});a.appendChild(e);a=p.$(".checkedMenuItem",a.lastChild);a.checked=f;a.addEventListener("change",m,!1);return a},createCommandItem:function(a,d,f,m,b,g,r){var h;g=g||!d.name&&d.hasImage();if(d.hrefCallback)h=document.createElement("a"),h.id=m,g&&d.hasImage()?q(d,h,m):(h.className="commandLink",h.appendChild(document.createTextNode(d.name))),
r=d.hrefCallback.call(f.handler,f),r.then?r.then(function(a){h.href=a}):h.href=r?r:"#";else{h=document.createElement("button");h.className="orionButton";d.extraClass&&h.classList.add(d.extraClass);g?d.hasImage()?(q(d,h,m),d.name&&h.setAttribute("aria-label",d.name)):(h.classList.add("commandButton"),h.classList.add("commandMissingImageButton"),h.appendChild(document.createTextNode(d.name))):(h.classList.add("commandButton"),m=document.createTextNode(d.name),h.appendChild(m));var k=r||d.callback;k&&
(d.onClick=k,h.addEventListener("click",function(a){k.call(f.handler,f)},!1))}"ul"===a.nodeName.toLowerCase()?(r=document.createElement("li"),a.appendChild(r),a=r):h.classList.add("commandMargins");a.appendChild(h);d.tooltip&&(h.commandTooltip=new e.Tooltip({node:h,text:d.tooltip,position:["above","below","right","left"]}));b&&(x[d.id]={keyBinding:b,command:d,invocation:f});return h},createCommandMenuItem:function(a,d,f,m,b,g){var q,r,h=a.dropdown;if(d.hrefCallback)r=n.createMenuItem(d.name,"a"),
q=r.firstElementChild,b=d.hrefCallback.call(f.handler,f),b.then?b.then(function(a){q.href=a}):q.href=b?b:"#",q.addEventListener("keydown",function(a){(a.keyCode===p.KEY.ENTER||a.keyCode===p.KEY.SPACE)&&q.click()},!1);else{r=n.createMenuItem(d.name);q=r.firstElementChild;var k=b||d.callback;k&&(d.onClick=k,q.addEventListener("click",function(a){h.close(!0);k.call(f.handler,f)},!1),q.addEventListener("keydown",function(a){if(a.keyCode===p.KEY.ENTER||a.keyCode===p.KEY.SPACE)a.preventDefault(),q.click()},
!1))}d.tooltip&&(q.commandTooltip=new e.Tooltip({node:q,text:d.tooltip,position:["above","below","right","left"]}));g&&n.appendKeyBindingString(q,g);a.appendChild(r);m&&(x[d.id]={keyBinding:m,command:d,invocation:f});return q},executeBinding:a,setKeyBindingProvider:function(a){s=a},localKeyBindings:x,CommandsProxy:u,getKeyBindings:d,processKey:m,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:f}});define("orion/explorers/navigationUtils",[],function(){function l(n,k,b,h){!p&&n&&(n.push({domNode:k}),k.tabIndex=-1,k.style.outline="none")}var p=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(n,k,b){n&&(n=n.getGridNavHolder(k,!0))&&l(n,b)},generateNavGrid:l,removeNavGrid:function(n,k){if(n)for(var b=0;b<n.length;b++)if(n[b].domNode===k){n.splice(b,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 n={resource:""},k=l.indexOf("#");if(-1!==k&&(l=l.substring(k+1),0!==l.length)){l=l.split(",");n.resource=decodeURIComponent(l[0]);for(k=1;k<l.length;k++){var b=/([^=]*)(=?)(.*)/.exec(l[k]),h=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");""!==h&&"resource"!==h&&(n[h]=b)}}return n},
validateURLScheme:function(p,n){var k=p;if(-1===p.indexOf("://")){var b=document.createElement("a");b.href=p;k=b.href}b=!1;if(b=n?n.some(function(b){return RegExp("^"+b+":","i").test(k)}):l.test(k))return p;console.log("Illegal URL Scheme: '"+p+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(l){function p(k){var b="",h=-1!==navigator.platform.indexOf("Mac");h?(k.mod4&&(b+="\u2303"),k.mod3&&(b+="\u2325"),k.mod2&&(b+="\u21e7"),k.mod1&&(b+="\u2318")):(k.mod1&&(b+="Ctrl+"),k.mod2&&(b+="Shift+"),k.mod3&&(b+="Alt+"));if(k.alphaKey)return b+k.alphaKey;if("keypress"===k.type)return b+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 b+g}var e;switch(k.keyCode){case 59:e=k.mod2?":":";";break;case 61:e=k.mod2?
"+":"\x3d";break;case 188:e=k.mod2?"\x3c":",";break;case 190:e=k.mod2?"\x3e":".";break;case 191:e=k.mod2?"?":"/";break;case 192:e=k.mod2?"~":"`";break;case 219:e=k.mod2?"{":"[";break;case 220:e=k.mod2?"|":"\\";break;case 221:e=k.mod2?"}":"]";break;case 222:e=k.mod2?'"':"'"}return e?b+e:112<=k.keyCode&&123>=k.keyCode?b+"F"+(k.keyCode-111):b+String.fromCharCode(k.keyCode)}function n(k){var b=-1!==window.navigator.platform.indexOf("Mac");return b&&k.metaKey||!b&&k.ctrlKey}return{getUserKeyString:function(k){var b=
"";k=k.getKeys();for(var h=0;h<k.length;h++)0!==h&&(b+=" "),b+=p(k[h]);return b},getUserText:function(k){var b=k.id,h=k.refNode,g=k.hideRefNode,e=k.initialText,a=k.onComplete,f=k.onEditDestroy,d=k.selectTo,m=k.isInitialValid;k=k.insertAsChild;var r=!1,u=function(d){return function(q){if(!r){var k=l.node(b),u=k.value;k&&(d&&q.keyCode===l.KEY.ESCAPE?(g&&(h.style.display="inline"),r=!0,k.parentNode.removeChild(k),f&&f()):d&&q.keyCode!==l.KEY.ENTER||(0===u.length||!m&&u===e?g&&(h.style.display="inline"):
(a(u),g&&h.parentNode&&(h.style.display="inline")),r=!0,k.parentNode&&k.parentNode.removeChild(k),f&&f()))}}},q=document.createElement("input");q.id=b;q.value=e||"";k?h.appendChild(q):h.parentNode.insertBefore(q,h.nextSibling);q.classList.add("userEditBoxPrompt");g&&(h.style.display="none");q.addEventListener("keydown",u(!0),!1);q.addEventListener("blur",u(!1),!1);window.setTimeout(function(){q.focus();if(e){var a=l.node(b),f=d?e.indexOf(d):-1;0<f?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",f),a.select()):a.setSelectionRange?a.setSelectionRange(0,f):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=f):a.select()}},0)},openInNewWindow:n,followLink:function(k,b){b&&n(b)?window.open(k):window.location=k},createButton:function(k,b){var h=document.createElement("button");h.className="orionButton commandButton commandMargins";h.addEventListener("click",function(g){b();l.stop(g)},!1);k&&h.appendChild(document.createTextNode(k));return h},
createDropdownButton:function(k,b,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,p,n,k,b,h,g,e,a,f){function d(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function m(a,d){this.token=a;this.parameterName=d}function r(a,d,f){this.event=a;this.handler=d;this.capture=f||!1}function u(a,d,f,m,e,b){this.name=a;this.type=d;this.label=f;this.value=m;this.lines=e||1;this.eventListeners=Array.isArray(b)?b:b?[b]:[]}function q(a,d,f){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=d&&d.clientCollect;this.getParameterElement=d&&d.getParameterElement;
this.getSubmitName=d&&d.getSubmitName}d.prototype={_init:function(a){this._selectionService=a.selection;var d=this;l.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var f=this._urlBindings[d].urlBinding.match(a);if(f){var m=this._urlBindings[d],e=m.command,b=m.invocation;if(b&&b.parameters&&e.callback){b.parameters.setValue(f.parameterName,f.parameterValue);
var g=this;window.setTimeout(function(){g._invoke(b)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,f,m,e,b){if(d){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback)return d=new l.CommandInvocation(f,d,e,a,this),d.domParent=b,this._invoke(d,m)}else if((b=this._urlBindings[a])&&b.command&&b.command.callback)return this._invoke(b.invocation,m)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,d,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,f))},confirm:function(a,d,f,m,b,e){var g=!1;if(this._parameterCollector&&!b){var v=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,b){var e=document.createElement("span");e.classList.add("parameterPrompt");e.textContent=d;a.appendChild(e);e=document.createElement("button");e.addEventListener("click",function(a){g=!0;v._parameterCollector.close()},
!1);b.appendChild(e);e.appendChild(document.createTextNode(f));e.className="dismissButton";var q=document.createElement("button");q.addEventListener("click",function(a){g=!1;v._parameterCollector.close()},!1);b.appendChild(q);q.appendChild(document.createTextNode(m));q.className="dismissButton";return e},function(){e(g)}))return}g=window.confirm(d);e(g)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,d,f){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){d=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(d=this._parameterCollector.collectParameters(a,f),!d)){var m=new g.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});d=
m.contentContainer();d.classList.add("parameterPopup");var e=window.document.activeElement,b=this._parameterCollector.getFillFunction(a,function(){e&&e.focus();m.destroy()},f)(d);m.show();window.setTimeout(function(){b.focus();b.select()},0);d=!0}if(!d)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,
d){this._collectAndInvoke(a,!0,d)},showKeyBindings:function(a){function d(a){return function(){l.executeBinding(a)}}var f={},m,e,b=[],g;for(g in this._activeBindings)(e=this._activeBindings[g])&&(e.keyBinding&&e.command&&(e.command.name||e.command.tooltip))&&b.push(e);b.sort(function(a,d){return(a.command.name||a.command.tooltip).localeCompare(d.command.name||d.command.tooltip)});for(g=0;g<b.length;g++)e=b[g],e.keyBinding.scopeName?(f[e.keyBinding.scopeName]||(f[e.keyBinding.scopeName]=[]),f[e.keyBinding.scopeName].push(e)):
(m=k.getUserKeyString(e.keyBinding),a.createItem(m,e.command.name||e.command.tooltip,d(e)));for(var v in f)f[v].length&&0<f[v].length&&(a.createHeader(v),f[v].forEach(function(f){m=k.getUserKeyString(f.keyBinding);a.createItem(m,f.command.name||f.command.tooltip,d(f))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var f=this;d.forEach(function(d){f._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
d,f,m,e,b,g,v,q,r){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,e));a[d]?(m&&(a[d].title=m),f&&(a[d].position=f),g&&(a[d].imageClass=g),v&&(a[d].tooltip=v),q&&(a[d].selectionClass=q),!0===r?a[d].pretendDefaultActionId=!0:a[d].defaultActionId=r,a[d].emptyGroupMessage=b):(a[d]={title:m,position:f,emptyGroupMessage:b,imageClass:g,tooltip:v,selectionClass:q,defaultActionId:!0===r?null:r,pretendDefaultActionId:!0===
r,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){1<d.length&&(a[d]||(a[d]={position:0,children:{}},a.sortedContributions=null),a=a[d].children)});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,d,f,m,e,b,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];m&&(a=this._createEntryForPath(a,m));a[d]={position:f};b&&((f=this._commandList[d])?this._addBinding(f,"key",b,e):this._addPendingBinding(d,"key",b,e));g&&((f=this._commandList[d])?this._addBinding(f,"url",g,e):this._addPendingBinding(d,"url",g,e));a.sortedContributions=null},unregisterCommandContribution:function(a,d,f){if(this._contributionsByScopeId[a]){delete this._commandList[d];delete this._activeBindings[d];delete this._urlBindings[d];delete this._pendingBindings[d];
var m=this._contributionsByScopeId[a];f&&f.split("/").forEach(function(a){1<a.length&&m[a]&&(m=m[a].children)});delete m[d];m.sortedContributions=null}},_addBinding:function(a,d,f,m){if(!a.id)throw Error("No command id: "+a);"key"===d?this._activeBindings[a.id]={command:a,keyBinding:f,bindingOnly:m}:"url"===d&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:m})},_addPendingBinding:function(a,d,f,m){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,
binding:f,bindingOnly:m})},_checkForTrailingSeparator:function(a,d,f){var m;if("tool"===d||"button"===d)if((m=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&m.classList.contains("commandSeparator"))return f?(a.removeChild(m),!1):!0;if("menu"===d&&(a=b.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(m=a[a.length-1],f)m.parentNode.parentNode.removeChild(m.parentNode);else return!0;return!1},renderCommands:function(a,d,f,m,e,g,q){if("string"!==
typeof a)throw"a scope id for rendering must be specified";d=b.node(d);if(!d)throw"no parent";var v=this._contributionsByScopeId[a];if(!f&&v){f=v.localSelectionService||this._selectionService;var r=this;f&&f.getSelections(function(f){r.renderCommands(a,d,f,m,e,g)})}else v&&(this._render(v,d,f,m,e||"button",g,q),this._checkForTrailingSeparator(d,e,!0))},destroy:function(a){a=b.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&
d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,d,f,m,e,b,q){var v=a.sortedContributions;if(!v){var v=[],r=!1,h;for(h in a)if(Object.prototype.hasOwnProperty.call(a,h)){var u=a[h];u&&"number"===typeof u.position&&(u.id=h,v.push(u),r=!0)}r&&(v.sort(function(a,d){return a.position-d.position}),a.sortedContributions=v)}var n=0,E=this;v.forEach(function(a){var v;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var r=
a.children;if("tool"===e||"button"===e)if(a.title){var h;a.defaultActionId&&((r=E._commandList[a.defaultActionId])&&(r.visibleWhen?r.visibleWhen(f):1)?(h=new l.CommandInvocation(m,f,b,r,E),h.domParent=d):a.pretendDefaultActionId=!0);r=E._createDropdownMenu(d,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,h,a.pretendDefaultActionId);q&&p.generateNavGrid(q,r.menuButton);r&&(E._render(a.children,r.menu,f,m,"menu",b,q),E._checkForTrailingSeparator(r.menu,"menu",!0),0===r.menu.childNodes.length?
a.emptyGroupMessage?r.menuButton.emptyGroupTooltip||(r.menuButton.emptyGroupTooltip=new g.Tooltip({node:r.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(q&&p.removeNavGrid(q,r.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(r.menu),a(r.menuButton),a(r.destroyButton)):r.menuButton.style.visibility="visible")}else{var C;0<d.childNodes.length&&!E._checkForTrailingSeparator(d,e)&&(C=E.generateSeparatorImage(d));E._render(r,d,
f,m,e,b,q);0<d.childNodes.length&&d.childNodes[d.childNodes.length-1]!==C&&(C=E.generateSeparatorImage(d))}else if(a.title){if(a=E._createDropdownMenu(d,a.title,!0,null,null,a.imageClass))E._render(r,a.menu,f,m,"menu",b,q),E._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&d.removeChild(a.destroyButton)}else 0<d.childNodes.length&&E._generateMenuSeparator(d),E._render(r,d,f,m,e,b,q),E._generateMenuSeparator(d)}else{var A=E._commandList[a.id],r=A?!0:!1;h=
a=null;if(A){v=new l.CommandInvocation(m,f,b,A,E);v.domParent=d;C=!1;try{C=r&&(A.visibleWhen?A.visibleWhen(f):!0)}catch(t){throw console.log(t),t;}E._activeBindings[A.id]&&E._activeBindings[A.id].keyBinding&&(a=E._activeBindings[A.id],a.invocation=C?v:null,a.bindingOnly&&(r=!1));E._urlBindings[A.id]&&E._urlBindings[A.id].urlBinding&&(h=E._urlBindings[A.id],h.invocation=C?v:null,h.bindingOnly&&(r=!1));r=r&&C}r&&(A.choiceCallback?("tool"===e||"button"===e?(a=d,r=!1,"ul"===d.nodeName.toLowerCase()&&
(a=document.createElement("li"),d.appendChild(a))):(a=d,r=!0),E._createDropdownMenu(a,A.name,r,function(a){A.populateChoicesMenu(a,f,m,b,E)}.bind(A),A.imageClass,A.tooltip||A.title,A.selectionClass,A.positioningNode)):(v.handler=v.handler||this,v.domParent=d,r=function(a){E._invoke(v)},"menu"===e?(h=null,a&&a.keyBinding&&(h=k.getUserKeyString(a.keyBinding)),a=l.createCommandMenuItem(d,A,v,null,r,h)):(a=e+A.id+n,a=l.createCommandItem(d,A,v,a,null,"tool"===e,r)),p.generateNavGrid(q,a),v.domNode=a,n++))}})},
_createDropdownMenu:function(a,d,m,e,q,r,k,v,A,C){a=b.node(a);if(!a||!b.contains(document.body,a))return null;var u,n,p=a;if(m)r=document.createRange(),r.selectNode(a),r=r.createContextualFragment(f),b.processTextNodes(r,{ButtonText:d}),a.appendChild(r),n=a.lastChild,q=n.lastChild,d=q.previousSibling,d.dropdown=new h.Dropdown({dropdown:q,populate:e,parentDropdown:a.dropdown}),q.dropdown=d.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(p=document.createElement("li"),a.appendChild(p),n=p);a=null;q&&
(a="dropdownButtonWithIcon",r=r||d);r=q?r||d:r;var I=l.createDropdownMenu(p,d,e,a,q,!1,k,v,A||C);u=I.dropdownArrow;d=I.menuButton;if(u){A&&(A.domNode=I.menuButton);var G=this;d.onclick=function(a){var d=b.bounds(u);a.clientX>=d.left&&I.dropdown?I.dropdown.toggle(a):G._invoke(A)};I.dropdown&&(d.onkeydown=function(a){b.KEY.DOWN===a.keyCode&&(I.dropdown.toggle(a),b.stop(a))})}q=I.menu;var H;(e=A&&A.command&&(A.command.tooltip||A.command.name))?H=A.command.tooltip||A.command.name:e&&(H=r);H&&(d.commandTooltip=
new g.Tooltip({node:d,text:H,position:["above","below","right","left"]}))}return{menuButton:d,menu:q,dropdown:d.dropdown,destroyButton:n,dropdownArrow:u}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");d.appendChild(f);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};d.prototype.constructor=d;m.prototype={match:function(a){a=n.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};m.prototype.constructor=m;r.prototype.constructor=r;u.prototype={optionsRequested:function(){return this.optionsRequested}};u.prototype.constructor=u;q.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[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,d){var f=this.parameterTable[a];
f&&(f.value=d)},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new u(d.name,d.type,d.label,d.value,d.lines,d.eventListeners);a.push(d)});var d=new q(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=q;return{CommandRegistry:d,URLBinding:m,
ParametersDescription:q,CommandParameter:u,CommandEventListener:r}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(l,p,n){function k(b,h){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=h}k.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&n.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&n.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(b,h,g){"string"===typeof b&&(b=n.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=g;var e=h(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!e)return!1;this._activeElements.focusNode=e;b=n.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===b.length){h=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=l.Close;h.appendChild(b);var a=this;b.addEventListener("click",function(f){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);e&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){e.focus();e.select&&e.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,h){n.$$array("input",h).forEach(function(e){"checkbox"===e.type?b.parameters.setValue(e.parameterName,e.checked):"button"!==e.type&&b.parameters.setValue(e.parameterName,e.value.trim())});n.$$array("textArea",h).forEach(function(e){b.parameters.setValue(e.parameterName,e.value.trim())});var g=b.parameters.getParameterElement;g&&b.parameters.forEach(function(e){(e=g(e,h))&&("checkbox"===e.type?
b.parameters.setValue(e.parameterName,e.checked):"button"!==e.type?b.parameters.setValue(e.parameterName,e.value.trim()):"textarea"!==e.type&&b.parameters.setValue(e.parameterName,e.value.trim()))});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b,h){return b.parameters?(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b,null,h))):!1},getFillFunction:function(b,h,g){var e=this;return function(a,f){var d=
null,m=function(){h&&h();e.close()},r=function(d){d.keyCode===n.KEY.ENTER&&(e._collectAndCall(b,a),m(),n.stop(d));d.keyCode===n.KEY.ESCAPE&&("function"===typeof g&&g(),m(),n.stop(d))},k=b.parameters;k.forEach(function(f){var e=k.getParameterElement?k.getParameterElement(f,a):null,g=null;!e&&f.label&&(g=document.createElement("label"),g.classList.add("parameterInput"),g.setAttribute("for",f.name+"parameterCollector"),g.textContent=f.label,a.appendChild(g));var q=f.name+"parameterCollector",g=g||a;
"text"===f.type&&"number"===typeof f.lines&&1<f.lines?(e||(e=document.createElement("textarea"),e.rows=f.lines,e.type="textarea",e.id=q,g.appendChild(e)),r=function(a){a.keyCode===n.KEY.ESCAPE&&(m(),n.stop(a))}):"boolean"===f.type?(e||(e=document.createElement("input"),e.type="checkbox",e.id=q,g.appendChild(e)),f.value&&(e.checked=!0)):(e||(e=document.createElement("input"),e.type=f.type,e.id=q,g.appendChild(e)),f.value&&(e.value=f.value));e.classList.add("parameterInput");e.setAttribute("speech",
"speech");e.setAttribute("x-webkit-speech","x-webkit-speech");e.parameterName=f.name;d||(d=e);0<f.eventListeners.length&&f.eventListeners.forEach(function(a){e.addEventListener(a.event,function(d){return a.handler(d,b)},a.capture)});e.addEventListener("keydown",r,!1)});var q=f;q||(q=document.createElement("span"),q.classList.add("layoutRight"),q.classList.add("parametersDismiss"),a.appendChild(q));var t=function(a,d){var f=document.createElement("button");d.appendChild(f);a&&f.appendChild(document.createTextNode(a));
f.classList.add("dismissButton");return f};b.parameters.hasOptionalParameters()&&(b.parameters.optionsRequested=!1,t(l.More,q).addEventListener("click",function(){b.parameters.optionsRequested=!0;e._collectAndCall(b,a);m()},!1));t(k.getSubmitName?k.getSubmitName(b):l.Submit,q).addEventListener("click",function(){e._collectAndCall(b,a);m()},!1);q=t(null,q);q.id="closebox";q.classList.add("imageSprite");q.classList.add("core-sprite-close");q.title=l.Close;q.addEventListener("click",function(a){m();
"function"===typeof g&&g()},!1);return d}}};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,d){if("string"!==typeof a)return null;for(var m=a&&a.split(".").pop(),e=null,b=0;b<d.length;b++){var g=d[b],h;a:{h=e;var k=g,n=m,l=0<=k.filename.indexOf(a),p;p=n.toLowerCase();p=-1!==k.extension.indexOf(p);if(l||p){if(!(p=!h))l&&(n=n.toLowerCase(),l=-1!==h.extension.indexOf(n)),p=l;if(p){h=k;break a}}}h===g&&(e=g)}return e}function p(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function n(a){return p(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:n(a.extension),filename:p(a.filename)}}function b(a){var d=Object.create(null);a.map(k).forEach(function(a){Object.prototype.hasOwnProperty.call(d,a.id)||(d[a.id]=a)});return d}function h(f){if(f&&f.registerService){this.serviceRegistry=f;for(var d=f.getServiceReferences(e).concat(f.getServiceReferences(a)),m=[],r=0;r<d.length;r++)for(var h=p(d[r].getProperty("contentTypes")),q=0;q<h.length;q++)m.push(h[q]);
this.map=b(m);f.registerService(g,this)}else if(Array.isArray(f))this.serviceRegistry=null,this.map=b(f);else throw Error("Invalid parameter");}var g="orion.core.contentTypeRegistry",e="orion.core.contenttype",a="orion.file.contenttype";h.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),d=[],m;for(m in a)Object.prototype.hasOwnProperty.call(a,m)&&d.push(a[m]);return d},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,d){a="string"===typeof a?this.getContentType(a):a;d="string"===typeof d?this.getContentType(d):d;if(!a||!d)return!1;if(a.id===d.id)return!0;for(var m=a,e={};m&&(m=this.getContentType(m["extends"]));){if(m.id===d.id)return!0;if(e[m.id])throw Error("Cycle: "+m.id);e[m.id]=!0}return!1},isSomeExtensionOf:function(a,d){for(var m=0;m<d.length;m++)if(this.isExtensionOf(a,
d[m]))return!0;return!1}};return{ContentTypeRegistry:h,getFilenameContentType:l}});
define("orion/URITemplate",[],function(){function l(a){this._text=a}function p(a){return a.replace("%25","%")}function n(a,m){if("U"===m)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===m)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(f,p);if("U+R-,"===m)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+m);}function k(a,f,e){for(var b=
[],g=0;g<a.length;g++)"undefined"!==typeof a[g]&&b.push(n(a[g],f));return b.join(e)}function b(a,f,e,b){for(var g=Object.keys(a),h=[],k=0;k<g.length;k++)"undefined"!==typeof a[g[k]]&&h.push(n(g[k],f)+e+n(a[g[k]],f));return h.join(b)}function h(d){if(0===d.length)throw Error("Invalid Expression: 0 length expression");(this._operator=e[d[0]])?d=d.substring(1):this._operator=e.NUL;for(var f=[],b=d.split(","),g=0;g<b.length;g++){var q=b[g].match(a);if(null===q)throw Error("Bad VarSpec: "+d);f.push({name:q[1],
explode:!!q[2],prefix:q[3]?parseInt(q[3],10):-1})}this._varSpecList=f}function g(a){for(var f=[],e=0,b=a.indexOf("{",e);-1!==b;){f.push(new l(a.substring(e,b)));e=a.indexOf("}",b+1);if(-1===e)throw Error("Invalid template: "+a);f.push(new h(a.substring(b+1,e)));e+=1;b=a.indexOf("{",e)}f.push(new l(a.substring(e)));this._templateComponents=f}var e={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\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]+))?$/,f=/%25[0-9A-F][0-9A-F]/g;l.prototype={expand:function(a){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var f=[],e=0;e<this._varSpecList.length;e++){var g=this._varSpecList[e],q=g.name,h=a[q],l=typeof h;if("undefined"!==l&&null!==h){var s=0===f.length?this._operator.first:this._operator.sep;if("string"===l)this._operator.named&&(s+=n(q,"U+R"),s+=0===h.length?this._operator.ifemp:"\x3d"),-1!==g.prefix&&g.prefix<h.length&&(h=h.substring(0,g.prefix)),s+=n(h,this._operator.allow);else if(Array.isArray(h)){if(0===h.length)continue;g.explode?s+=k(h,this._operator.allow,
this._operator.sep):(g=k(h,this._operator.allow,","),this._operator.named&&(s+=n(q,"U+R"),s+=0===g.length?this._operator.ifemp:"\x3d"),s+=g)}else if("object"===l){if(0===Object.keys(h).length)continue;g.explode?s+=b(h,this._operator.allow,"\x3d",this._operator.sep):(g=b(h,this._operator.allow,",",","),this._operator.named&&(s+=n(q,"U+R"),s+=0===g.length?this._operator.ifemp:"\x3d"),s+=g)}else throw Error("bad param type: "+q+" : "+l);f.push(s)}}return f.join("")}};g.prototype={expand:function(a){for(var f=
[],e=0;e<this._templateComponents.length;e++)f.push(this._templateComponents[e].expand(a));return f.join("")}};return g});
define("orion/i18nUtil",["require","orion/Deferred"],function(l,p){function n(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var k={};return{getMessageBundle:function(b){function h(a){a?l(["i18n!"+b],function(a){if(a){var d=b;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+d,JSON.stringify(a));delete a._expires}e.resolve(a)}):g(Error(b))}function g(a){e.reject(a)}
if(k[b])return k[b];var e=new p;k[b]=e;var a=n(b);if(a)return e.resolve(a),e;try{l([b],h,g)}catch(f){l(["orion/i18n!"+b],h,g)}return e},formatMessage:function(b){var h=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,e){return h[(e<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(l,p,n,k,b,h,g){function e(){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 d={};a.getPropertyKeys().forEach(function(f){"objectClass"!==f&&("service.names"!==f&&"service.id"!==f&&"__plugin__"!==f)&&(d[f]=a.getProperty(f))});return d}function f(a){return b.getMessageBundle(a.nls).then(function(d){a.textContent=
a.nameKey?d[a.nameKey]:a.name;return a},function(d){a.textContent=a.nameKey||a.name;return a})}function d(d,m){var b=d.getServiceReferences(m||"orion.page.link"),g=n.matchResourceParameters(window.location.href),q={OrionHome:e(),Location:g.resource},h=[];b.forEach(function(d){d=a(d);if(d.uriTemplate&&(d.nls||d.name)){var e=(new k(d.uriTemplate)).expand(q),e=n.validateURLScheme(e);d.href=e;d.nls?h.push(f(d)):(d.textContent=d.name,h.push((new p).resolve(d)))}});return p.all(h)}function m(a){var d=this.categories=
Object.create(null);a.forEach(function(a){d[a.id]=a})}function r(a){this.allPageLinks=a;this.allPageLinks.sort(u)}function u(a,d){var f=a.textContent&&a.textContent.toLowerCase(),e=d.textContent&&d.textContent.toLowerCase();return f<e?-1:f>e?1:0}var q;h.mixin(m.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(r.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var d=a.href;a=
a.textContent;var f=document.createElement("a");f.href=d;f.target="_self";f.classList.add("targetSelector");f.textContent=a;return f})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(d){var e;return!q?(e=[],d.getServiceReferences("orion.page.link.category").forEach(function(m){var b=a(m);if(b.id&&(b.name||b.nameKey))b.service=d.getService(m),b.nls?e.push(f(b)):(b.textContent=b.name,e.push((new p).resolve(b)))}),p.all(e).then(function(a){return q=new m(a)})):(new p).resolve(q)},
getPageLinksInfo:function(a,f){return d(a,f).then(function(a){return new r(a)})},getOrionHome:e}});
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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
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,p,n,k,b,h,g,e,a,f){function d(a){var d={};a.getPropertyKeys().forEach(function(f){d[f]=a.getProperty(f)});return d}var m={},r=a.getOrionHome();m._cloneItemWithoutChildren=function w(a){if(null===a||"object"!==typeof a)return a;var d=a.constructor(),f;for(f in a)"children"!==f&&"Children"!==
f&&(d[f]=w(a[f]));return d};m._getOpenWithNavCommandExtensions=function(a,d){function f(a,d){for(var e=a.getServiceReferences("orion.navigate.openWith"),m=[],b=[],g=0;g<e.length;g++){var v=e[g];if(v.getProperty("editor")===d.id){var q=v.getProperty("contentType");q instanceof Array?m=m.concat(q):m.push(q||"*/*");v=v.getProperty("excludedContentTypes");v instanceof Array?b=b.concat(v):null!==v&&"undefined"!==typeof v&&b.push(v)}}0===m.length&&(m=null);0===b.length&&(b=null);return{contentTypes:m,excludedContentTypes:b}}
for(var e=function(){for(var d=a.getServiceReferences("orion.edit.editor"),f=[],e=0;e<d.length;e++){var m=d[e],b=m.getProperty("id");f.push({id:b,"default":m.getProperty("default")||!1,name:m.getProperty("name"),nameKey:m.getProperty("nameKey"),nls:m.getProperty("nls"),uriTemplate:m.getProperty("orionTemplate")||m.getProperty("uriTemplate"),validationProperties:m.getProperty("validationProperties")||[]})}return f}(),m=[],b,g=0;g<e.length;g++){var q=e[g],h=f(a,q),h={properties:{name:q.name||q.id,nameKey:q.nameKey,
id:"eclipse.openWithCommand."+q.id,contentType:h.contentTypes,excludedContentTypes:h.excludedContentTypes,uriTemplate:q.uriTemplate,nls:q.nls,forceSingleItem:!0,isEditor:q["default"]?"default":"editor",validationProperties:q.validationProperties},service:{}};"orion.editor"===q.id?b=h:m.push(h)}b&&m.push(b);return m};m._makeValidator=function(a,d,f,e){function m(a,d,f,e,b){var g=!1,v;if("!"===d.charAt(0))return"undefined"===typeof a[d.substring(1)];if("undefined"!==typeof a[d]){if("undefined"===typeof f)v=
a[d],g=!0;else if("string"===typeof f){if(!typeof("string"===a[d]))return!1;if(e.variableName){if(f=RegExp(f).exec(a[d]))g=f[0],v="before"===e.variableMatchPosition?a[d].substring(0,f.index):"after"===e.variableMatchPosition?a[d].substring(f.index+g.length):"only"===e.variableMatchPosition?g:a[d],g=!0}else return RegExp(f).test(a[d])}else a[d]===f&&(v=a[d],g=!0);d=e.variableName;e=e.replacements;if(g&&d&&(b[d]=v,b.itemCached=a,e)){if("string"!==typeof v)return window.console.log("Cannot replace "+
d+", value is not a string: "+v),g;for(a=0;a<e.length;a++){v=!1;if(e[a].pattern){f=e[a].pattern;var q=e[a].replacement||"";b[d]=b[d].replace(RegExp(f),q).replace(RegExp(f),q)}else v=!0;v&&window.console.log("Invalid replacements specified in validation property.  "+e[a])}}return g}return!1}function g(a,d,f,e){var b=f.match,v,q;if(0<=(v=d.indexOf("["))){if(0>(q=d.indexOf("]")))return!1;var h=d.substring(0,v),r;if(!(r=a[h])||!Array.isArray(r))return!1;v=d.substring(v+1,q);v=parseInt(v,10);if(isNaN(v))return!1;
0>v&&(v+=r.length);d=d.substring(q+1);d=h+":"+String(v)+d}return 0<=d.indexOf("|")?(v=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),g(a,v,f,e)?!0:g(a,d,f,e)):0<=d.indexOf(":")?(v=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[v]?g(a[v],d,f,e):!1):m(a,d,b,f,e)}function v(d,f,e){if(e.info.validationProperties)for(var m=0;m<e.info.validationProperties.length;m++){var v=e.info.validationProperties[m];if("undefined"!==typeof v.source){if(!g(d,v.source,v,e))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var m=!0,q=f?b.getFilenameContentType(d.Name,f):null,q=q||{id:"application/octet-stream"};e.info.excludedContentTypes&&f&&(m=e.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==q.id.search(a)?!1:!0}));m&&(e.info.contentType&&f)&&(m=e.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==q.id.search(a)?!0:!1}));return m}return{info:a,validationFunction:function(a){"function"===typeof e&&(a=e.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 d=0;d<a.length;d++)if(!v(a[d],f,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},f;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(d[f]=a[f]);if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var e=this.info.validationProperties[f];
e.source&&e.variableName&&(this.itemCached===a&&this[e.variableName]||g(a,e.source,e,this),a[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[e.variableName]=this[e.variableName])}d.OrionHome=r;return(new h(this.info.uriTemplate)).expand(d)}return null}}};var u=f.UnnamedCommand;m._createCommandOptions=function(a,d,f,e,b,q){function v(g,v){var h=m._makeValidator(a,f,e,q);g.visibleWhen=
h.validationFunction.bind(h);if(b)if(h.generatesURI.bind(h)())g.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return h.getURI.bind(h)(a)};else{var r=a;g.callback=function(a){var e;if(r.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,e=m._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){e=[];for(var b=0;b<a.items.length;b++)e.push(m._cloneItemWithoutChildren(a.items[b]))}else e=m._cloneItemWithoutChildren(a.items);if(f)var v=f.getService("orion.page.progress");
d.run?v?v.progress(d.run(e),"Running command: "+g.name):d.run(e):f&&(v?v.progress(f.getService(d).run(e),"Running command: "+g.name):f.getService(d).run(e))}}v.resolve(g)}var h=new p;if(a.nls){var r=function(d){var f;d?(f=a.tooltipKey&&d[a.tooltipKey],d=a.nameKey&&d[a.nameKey]||a.name||u,f=f||a.tooltip||""):(d=a.name||a.nameKey||u,f=a.tooltip||a.tooltipKey||"");v({name:d,image:a.image,id:a.id||a.name,tooltip:f,isEditor:a.isEditor,showGlobally:a.showGlobally},h)};g.getMessageBundle(a.nls).then(r,r.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},h);return h};m.getOpenWithCommand=function(a,d,f){var e;a=f||m.getOpenWithCommands(a);for(f=0;f<a.length;f++)if(a[f].visibleWhen(d)){var b="default"===a[f].isEditor;if(!e||b)if(e=a[f],b)break}return e};m.getOpenWithCommands=function(a){var d=[],f;for(f in a._commandList){var e=a._commandList[f];e.isEditor&&d.push(e)}return d};var q;m.createAndPlaceFileCommandsExtension=function(a,
d,e,b,g,q){return m.createFileCommands(a,null,q?"all":void 0,!!q,d).then(function(a){g&&0<a.length&&(d.addCommandGroup(e,"eclipse.openWith",1E3,f.OpenWith,g,null,null,null,"dropdownSelection"),d.addCommandGroup(e,"eclipse.fileCommandExtensions",1E3,f.OpenRelated,g));a.forEach(function(a){var f=null;g&&(f=a.isEditor?g+"/eclipse.openWith":g+"/eclipse.fileCommandExtensions");d.registerCommandContribution(e,a.id,b,f)});return{}})};m.createFileCommands=function(a,d,f,e,b){f=void 0===f?"global":f;e=void 0===
e?!0:e;var g=[];m._cachedFileCommands||m._createCachedFileCommands(a);("all"===f||"global"===f)&&m._cachedFileCommands.forEach(function(a){var d=a.properties;("all"===f||d.forceSingleItem&&d.showGlobally)&&g.push(a)});return p.when(function(){var f=a.getService("orion.core.contentTypeRegistry")||d;return q||p.when(f.getContentTypes(),function(a){return q=a})}(),function(){e&&(m._cachedOpenWithExtensions||(m._cachedOpenWithExtensions=m._getOpenWithNavCommandExtensions(a,q)),g=g.concat(m._cachedOpenWithExtensions),
b._addedOpenWithCommands=e);var d=g.map(function(d){var f=d.properties;d=d.service;var e=b.findCommand(f.id||f.name);return e?(new p).resolve(e):m._createCommandOptions(f,d,a,q,!0).then(function(a){a=new n.Command(a);b.addCommand(a);return a})});return p.all(d,function(a){return{_error:a}}).then(function(a){return a})})};m._createCachedFileCommands=function(a){var f=a.getServiceReferences("orion.navigate.command");m._cachedFileCommands=[];for(var e=0;e<f.length;e++)if("orion.navigateFromMetadata"!==
f[e].getProperty("id")){var b=a.getService(f[e]),g=d(f[e]);m._cachedFileCommands.push({properties:g,service:b})}};m.getFileCommandIds=function(){var a=[];if(m._cachedFileCommands)m._cachedFileCommands.length&&(a=m._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};m.createOpenWithCommands=function(a,d,f){return f&&f._addedOpenWithCommands?(new p).resolve(m.getOpenWithCommands(f)):m.createFileCommands(a,d,
"none",!0,f)};return m});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(l,p){function n(k){this._init(k)}n.prototype={_init:function(k){var b=p.node(k.container);if(!b)throw"no parent container";this._container=b;b.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 b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(k,b):k.href=l.toUrl("edit/edit.html")+"#"+b}else k=document.createElement("span");p.empty(k);k.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return k}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(k){var b=document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(k));return b},addSegmentHref:function(k,b){this._makeHref?this._makeHref(k,b.Location,b):k.href=l.toUrl("edit/edit.html")+"#"+b.ChildrenLocation},buildSegments:function(k,b){if(this._resource.Parents){var h=this._resource.Parents.slice(0),g,e;h&&(h=h.slice(0),"reverse"===b&&(h=h.reverse().slice(0)),
h.forEach(function(a){a.skip||(k?(e=k,k=null):e=a.Name,g=this.buildSegment(e),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=p.node(this._id))?p.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,b){var h=b||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,b){if(!this._resource.skip){var h;h=b?b: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(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.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(),b=this._rootSegmentName;b?this.addTitle(k,b):(this.finalSegment(k,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"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(),b=this._rootSegmentName;b?this.addTitle(k,b):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(k),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(k,b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};n.prototype.constructor=n;return{BreadCrumbs:n}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(l,p,n){function k(b){l.attach(this);this._init(b)}k.prototype={_init:function(b){this._tracking=null;this._animationDelay=501;this._closeReversely=b.closeReversely;this.$node=n.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=n.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=n.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=b.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||"");b.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 b.closeByDefault&&(this._closeByDefault=b.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";p.isIOS||p.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(b){b="vertical"===b;b!==this._vertical&&(this._vertical=b,b=this.$node.classList,b.toggle("splitLayout"),b.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",b=this.$sideNode.classList,b.toggle("sidePanelLayout"),b.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",b=this.$mainNode.classList,b.toggle("mainPanelLayout"),b.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(b=this._thumb.classList,b.toggle("splitThumbLayout"),b.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(b){this.addEventListener("resize",function(h){b(h.node)})},_initializeFromStoredSettings:function(){var b=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof b?"closed"===b:this._closeByDefault;var b=n.bounds(this.$node.parentNode),h=n.bounds(this.$node),g;this._vertical?(g=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(g,10),this._splitTop>b.top+b.height-h.height&&
(this._splitTop=b.top+b.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(g=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(g,10),this._splitLeft>b.left+b.width-h.width&&(this._splitLeft=b.left+b.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var b=n.bounds(this.$node),h=n.bounds(this.$node.parentNode);return this.vertical?b.top-h.top:b.left-h.left},
_adjustToSplitPosition:function(b){var h=n.bounds(this.$node),g=n.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=h.height;if(b||!this._splitTop)this._splitTop=h.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);b=this._splitTop;b=this._splitTop-g.top;this.$sideNode.style.height=b+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=h.width;if(b||!this._splitLeft)this._splitLeft=h.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);b=this._splitLeft;b=this._splitLeft-g.left;this.$sideNode.style.width=b+"px";this.$sideNode.style.display="block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b,h,g){b=b||0;var e=n.bounds(this.$node.parentNode),a=n.bounds(this.$node);this._vertical?(void 0===g&&(g=a.top-e.top),g+=a.height,this.$mainNode.style.top=g+"px"):(void 0===h&&(h=a.left-e.left),h+=a.width,this.$mainNode.style.left=h+"px");var f=this;window.setTimeout(function(){f._notifyResizeListeners(f.$mainNode);
f._notifyResizeListeners(f.$sideNode)},b)},_notifyResizeListeners:function(b){this.dispatchEvent({type:"resize",node:b})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(b,h){b||this._addAnimation();var g=this._splitTop,e=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(g=e=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=n.bounds(this.$node.parentNode),
f=n.bounds(this.$node);this._vertical?g=a.height-f.height:e=a.width-f.width}else g=e=0;this._vertical?(this.$sideNode.style.height=g+"px",this.$node.style.top=g+"px"):(this.$sideNode.style.width=e+"px",this.$node.style.left=e+"px");this._resize(this._animationDelay,e,g);b||this._removeAnimation();h||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var d=this;window.setTimeout(function(){d._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var b=
this;window.setTimeout(function(){b.$sideNode.classList.remove(b._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");b.$mainNode.classList.remove(b._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");b.$node.classList.remove(b._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(b,h){var g=n.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 e=this._splitTop,e=this._splitTop-g.top;this.$node.style.top=e+"px"}else this._splitLeft=b,this._splitLeft<g.left+5?this._splitLeft=g.left+5:this._splitLeft>g.left+g.width-5&&(this._splitLeft=g.left+g.width-5),e=this._splitLeft,e=this._splitLeft-g.left,this.$node.style.left=e+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(b){if(b.target===
this._thumb)return n.stop(b),this._thumbDown();this._tracking||(this._down(b),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),n.setFramesEnabled(!1),n.stop(b))},_mouseMove:function(b){this._tracking&&this._move(b.clientX,b.clientY)},_mouseUp:function(b){this._tracking&&(n.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),n.stop(b))},_touchStart:function(b){if(1===b.touches.length){n.stop(b);if(b.target===
this._thumb)return this._thumbDown();this._down(b);this._touching=!0}},_touchMove:function(b){this._touching&&(b=b.touches,1===b.length&&(b=b[0],this._move(b.clientX,b.clientY)))},_touchEnd:function(b){0===b.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,p,n){function k(b){this.commandRegistry=b.commandRegistry;this.create();this._filterString="";this._providers=[]}k.prototype={addProvider:function(b){this._providers.push(b)},create:function(){var b=this._keyAssistDiv=document.createElement("div");b.id="keyAssist";b.style.display="none";b.classList.add("keyAssistFloat");b.setAttribute("role","menu");var h=this._keyAssistInput=document.createElement("input");
h.classList.add("keyAssistInput");h.type="text";h.placeholder=l["Filter bindings"];b.appendChild(h);var g=this._keyAssistContents=document.createElement("div");g.classList.add("keyAssistContents");if(n.isIOS||n.isAndroid)g.style.overflowY="auto";b.appendChild(g);var e=this._keyAssistTable=document.createElement("table");e.tabIndex=0;e.classList.add("keyAssistList");g.appendChild(e);document.body.appendChild(b);h.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));e.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));h.addEventListener("input",function(a){this.filterChanged()}.bind(this));g.addEventListener(n.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===p.KEY.ESCAPE&&this.hide()}.bind(this));p.addAutoDismiss([b],function(){this.hide()}.bind(this))},createContents:function(){p.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var b=this._idCount=
this._keyAssistContents.scrollTop=0;b<this._providers.length;b++)this._providers[b].showKeyBindings(this);this.createHeader(l.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(b,h,g){if(this._filterString){var e=this._filterString.toLowerCase(),a;e!==this._filterString?(e=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(h).indexOf(e)&&-1===a(b).indexOf(e)&&-1===a(this._lastHeader).indexOf(e))return}var f=this._keyAssistTable.insertRow(-1);
f.id="keyAssist-keyBinding-"+this._idCount++;f.setAttribute("role","menuitem");f._execute=g;f.classList.add("keyAssistItem");f.addEventListener("click",function(a){this._selectedRow=f;this.execute();a.preventDefault()}.bind(this));g=f.insertCell(-1);g.classList.add("keyAssistName");g.appendChild(document.createTextNode(h));g=f.insertCell(-1);g.classList.add("keyAssistAccel");g.appendChild(document.createTextNode(b))},createHeader:function(b){this._lastHeader=b;var h=this._keyAssistTable.insertRow(-1);
h.classList.add("keyAssistSection");var h=h.insertCell(-1),g=document.createElement("h2");g.appendChild(document.createTextNode(b));h.appendChild(g)},execute:function(){window.setTimeout(function(){this.hide();var b=this._selectedRow;this._selectedRow=null;b&&b._execute&&b._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var b=this._keyAssistInput.value;this._filterString!==b&&(this._filterString=
b,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var b=document.activeElement,h=this._keyAssistDiv,b=h===b||0!==(h.compareDocumentPosition(b)&16);h.style.display="none";b&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(b){b=this._providers.indexOf(b);-1!==b&&this._providers.splice(b,
1)},select:function(b){var h=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===h.length)this._selectedIndex=-1;else{var g=this._selectedIndex,g=(g+(b?1:-1))%h.length;0>g&&(g=h.length-1);-1!==this._selectedIndex&&(b=h[this._selectedIndex],b.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=g;if(-1!==this._selectedIndex){this._selectedRow=b=h[this._selectedIndex];b.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",b.id);this._keyAssistTable.focus();
var h=b.getBoundingClientRect(),e=this._keyAssistContents,a=e.getBoundingClientRect();b.offsetTop<e.scrollTop?0===g?e.scrollTop=0:b.scrollIntoView(!0):h.bottom>a.bottom&&b.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(b){if(40===b.keyCode)this.select(!0);else if(38===b.keyCode)this.select(!1);else if(13===b.keyCode)this.execute();else return;b.preventDefault()},_scrollWheel:function(b){var h=0,h=n.isIE||n.isOpera?-b.wheelDelta:n.isFirefox?40*b.detail:-b.wheelDeltaY,g=this._keyAssistContents,e=g.scrollTop;g.scrollTop+=h;if(e!==g.scrollTop)return b.preventDefault&&b.preventDefault(),!1}};return{KeyAssistPanel:k}});
define("orion/widgets/themes/ThemePreferences",[],function(){function l(l,n){this._preferences=l;this._themeData=n;var k=n.getThemeStorageInfo();this._themeVersion=k.version;var b=l.listenForChangedSettings(k.storage,2,function(h){h.key===b&&this.apply()}.bind(this))}l.prototype={_initialize:function(l,n,k){var b,h;void 0===this._themeVersion||k.get("version")===this._themeVersion?(b=k.get(l.styleset),(h=k.get("selected"))&&(h=JSON.parse(h))):h=b=null;b||(b=n.getStyles(),k.put(l.styleset,JSON.stringify(b)));
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 n=this._themeData,k=n.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(b){this._initialize(k,n,b);var h=JSON.parse(b.get("selected"));b=JSON.parse(b.get(k.styleset));var g;if(b)for(var e=0;e<b.length;e++)if(b[e].name===h[k.selectedKey]){g=b[e];break}l({style:g,styles:b})}.bind(this))},
setTheme:function(l,n){var k=this._themeData,b=k.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(h){this._initialize(b,k,h);var g=JSON.parse(h.get("selected"));l||(l=g[b.selectedKey]);g[b.selectedKey]=l;h.put("selected",JSON.stringify(g));n?h.put(b.styleset,JSON.stringify(n)):n=JSON.parse(h.get(b.styleset));for(var e=0;e<n.length;e++)if(n[e].name===g[b.selectedKey]){k.processSettings(n[e]);break}h.put("version",this._themeVersion)}.bind(this))},setFontSize:function(l){var n=
this._themeData,k=n.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(b){this._initialize(k,n,b);var h=JSON.parse(b.get("selected")),g=JSON.parse(b.get(k.styleset)),e;if(g)for(var a=0;a<g.length;a++)g[a].fontSize=l,g[a].name===h[k.selectedKey]&&(e=g[a]);b.put(k.styleset,JSON.stringify(g));n.processSettings(e)}.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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/editor/eventTarget",[],function(){function l(){}l.addMixin=function(p){var n=l.prototype,k;for(k in n)n.hasOwnProperty(k)&&(p[k]=n[k])};l.prototype={addEventListener:function(l,n,k){this._eventTypes||(this._eventTypes={});var b=this._eventTypes[l];b||(b=this._eventTypes[l]={level:0,listeners:[]});b.listeners.push({listener:n,useCapture:k})},dispatchEvent:function(l){var n=l.type;this._dispatchEvent("pre"+n,l);this._dispatchEvent(n,l);this._dispatchEvent("post"+n,l)},_dispatchEvent:function(l,
n){var k=this._eventTypes?this._eventTypes[l]:null;if(k){var b=k.listeners;try{if(k.level++,b)for(var h=0,g=b.length;h<g;h++)if(b[h]){var e=b[h].listener;"function"===typeof e?e.call(this,n):e.handleEvent&&"function"===typeof e.handleEvent&&e.handleEvent(n)}}finally{if(k.level--,k.compact&&0===k.level){for(h=b.length-1;0<=h;h--)b[h]||b.splice(h,1);0===b.length&&delete this._eventTypes[l];k.compact=!1}}}},isListening:function(l){return!this._eventTypes?!1:void 0!==this._eventTypes[l]},removeEventListener:function(l,
n,k){if(this._eventTypes){var b=this._eventTypes[l];if(b){for(var h=b.listeners,g=0,e=h.length;g<e;g++){var a=h[g];if(a&&a.listener===n&&a.useCapture===k){0!==b.level?(h[g]=null,b.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,p,n){function k(b){b=b||{};this._document=b.document||document}var b={};k.getTheme=function(h){h=h||"default";var g=b[h];g||(g=b[h]=new k);return g};k.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,g){var e=this,a=e._themeClass;e._themeClass=b;this._load(b,g,function(){e.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:e.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,g){function e(f,d,e){d&&(a.push("."+b+" ."+f+" {"),a.push("\t"+(e?"background-color":"color")+": "+d+";"),a.push("}"))}var a=[];a.push("");a.push("."+b+" {");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("."+b+".textview {");g.background&&a.push("\tbackground-color: "+g.background+";");a.push("}");a.push("."+b+" .textviewLeftRuler {");g.leftRuler&&
a.push("\tborder-right: 1px solid "+g.leftRuler+";");a.push("}");a.push("."+b+" .textviewRightRuler {");g.rightRuler&&a.push("\tborder-left: 1px solid "+g.rightRuler+";");a.push("}");e("ruler.annotations",g.annotationRuler,!0);e("ruler.lines",g.annotationRuler,!0);e("ruler.folding",g.annotationRuler,!0);e("ruler.overview",g.overviewRuler,!0);e("rulerLines",g.lineNumber,!1);e("rulerLines.even",g.lineNumberEven,!1);e("rulerLines.odd",g.lineNumberOdd,!1);e("annotationLine.currentLine",g.currentLine,
!0);e("entity-name-tag",g.keyword,!1);e("entity-other-attribute-name",g.attribute,!1);e("string-quoted",g.string,!1);e("meta.annotation.currentLine",g.currentLine,!0);e("keyword",g.keyword,!1);e("string",g.string,!1);e("constant",g.constant,!1);e("comment",g.comment,!1);e("comment.block.documentation",g.comment,!1);e("keyword.other.documentation.markup",g.comment,!1);e("keyword.other.documentation.markup",g.comment,!1);return a.join("\n")},_createStyle:function(b,g,e,a){var f=this._document;b="orion-theme-"+
b;var d=f.getElementById(b);if(d){if(a||d.firstChild.data===g)return;d.removeChild(d.firstChild);d.appendChild(f.createTextNode(g))}else a?(d=n.createElement(f,"link"),d.rel="stylesheet",d.type="text/css",d.href=g,d.addEventListener("load",function(){e()})):(d=n.createElement(f,"style"),d.appendChild(f.createTextNode(g))),d.id=b,(f.getElementsByTagName("head")[0]||f.documentElement).appendChild(d);a||e()},_load:function(b,g,e){if(b)if("string"===typeof g)this._createStyle(b,g,e);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(b,g,e,!0);else{var a=this;l(["text!"+g],function(f){a._createStyle(b,f,e,!1)})}else e()}};p.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 p(){}p.prototype.navbar="white";p.prototype.button="#777777";p.prototype.location="#EFEFEF";p.prototype.selection="#cedce7";p.prototype.sidepanel="#F7F7F7";p.prototype.mainpanel="white";p.prototype.navtext="#bfbfbf";p.prototype.content="#3087B3";p.prototype.search="#444";p.prototype.toolpanel="white";p.prototype.writeNavigationStyle=function(){var n="",k=[],b=new l.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";k.push(b);b=new l.ThemeClass("topRowBanner");b.style.margin="0";b.style.border="0";b.style.backgroundColor=this.navbar;b.style.height="16px";b.style.padding="10px";b.style.paddingLeft="6px";b.style.paddingRight="2px";b.style.borderBottom="none";b.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";b.style.zIndex="100";k.push(b);b=new l.ThemeClass("a");b.style.textDecoration="none";b.style.color=
this.content;k.push(b);b=new l.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;b.style.verticalAlign="bottom";k.push(b);b=new l.ThemeClass("primaryNav");b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";k.push(b);b=new l.ThemeClass("primaryNav a");b.style.fontSize="8pt";b.style.color=this.navtext;b.style.marginRight="6px";b.style.marginLeft="6px";b.style.verticalAlign=
"baseline";b.style.textDecoration="none";k.push(b);b=new l.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";b.style.fontWeight="normal";k.push(b);for(var h in k)n+=k[h].toString();return n};p.prototype.writeLocationStyle=function(){var n="",k=[],b=new l.ThemeClass("titleArea");b.style.margin="0";b.style.paddingTop="5px";b.style.border="0";b.style.background=this.location;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";b.style.borderBottom="1px solid "+this.location;b.style.minHeight="20px";k.push(b);b=new l.ThemeClass("breadcrumb");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";k.push(b);b=new l.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";k.push(b);b=new l.ThemeClass("breadcrumbSeparator");b.style.fontSize=
"8pt";b.style.textDecoration="none";b.style.color=this.separator;b.style.fontWeight="bold";k.push(b);b=new l.ThemeClass("currentLocation");b.style.fontWeight="bold";b.style.fontSize="8pt";b.style.color=this.breadcrumb;b.style.textDecoration="none";b.style.textWrap="normal";b.style.lineHeight="10pt";k.push(b);b=new l.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";k.push(b);b=new l.ThemeClass("navlinkonpage");
b.style.color=this.content;b.style.verticalAlign="middle";k.push(b);this.bannerProgress&&(b=new l.ThemeClass("topRowBanner .progressPane_running"),b.style.borderColor=this.bannerProgress,k.push(b));for(var h in k)n+=k[h].toString();return n};p.prototype.writeButtonStyle=function(){var n="",k=[],b=new l.ThemeClass("commandButton");b.style.color="#666";b.style.border="1px solid #dedede";b.style.backgroundColor="#ddd";b.style.textAlign="center";b.style.verticalAlign="middle";b.style.cursor="pointer";
b.style.display="inline-block";b.style.padding="4px 6px";b.style.borderRadius="3px";b.style.lineHeight="12px";b.style.fontSize="9pt";b.style.userSelect="none";k.push(b);b=new l.ThemeClass("commandButton:over");b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";k.push(b);b=new l.ThemeClass("commandMenu");b.style.color="#222";b.style.display="inline-block";b.style.verticalAlign="baseline";b.style.margin="0";b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.border="1px solid #dedede";
b.style.backgroundColor="#efefef";b.style.cursor="pointer";b.style.borderRadius="1px";k.push(b);b=new l.ThemeClass("commandMenuItem");b.style.border="0";b.style.padding="0";b.style.margin="0";k.push(b);for(var h in k)n+=k[h].toString();return n};p.prototype.writeMainStyle=function(){var n="",k=[],b=new l.ThemeClass("searchbox");b.style.backgroundImage="url(../images/core_sprites.png)";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="4px -297px";b.style.width="12px";b.style.height=
"12px";b.style.backgroundColor=this.search;b.style.border="1px solid "+this.search;b.style.fontSize="11px";b.style.width="15em";b.style.height="16px";b.style.borderRadius="10px";b.style.color="#999";b.style.padding="0";b.style.paddingLeft="20px";b.style.marginLeft="5px";b.style.marginTop="6px !important";b.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";k.push(b);b=new l.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline=
"none";k.push(b);b=new l.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";k.push(b);b=new l.ThemeClass("navbar-item-selected");b.style.background=this.selection;b.style.color=this.content;k.push(b);b=new l.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;k.push(b);b=new l.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;k.push(b);b=new l.ThemeClass("mainToolbar");b.style.background=this.toolpanel;k.push(b);
for(var h in k)n+=k[h].toString();return n};p.prototype.render=function(l){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};p.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:p}});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,p,n,k){function b(){}function h(){this.styles=[];var e=new b;e.name="Orion";e.navbar="white";e.button="#EFEFEF";e.location="#efefef";e.selection="FEC";e.sidepanel="#FBFBFB";e.mainpanel="white";e.toolpanel="white";e.navtext="#bfbfbf";e.content="#3087B3";e.search="#444";e.breadcrumb="#3087B3";
e.separator="#333";e.bannerProgress="whitesmoke";this.styles.push(e);e=new b;e.name="Orion2014";e.navbar="white";e.button="#EFEFEF";e.location="#EFEFEF";e.selection="FEC";e.sidepanel="#EEEEEE";e.mainpanel="#EEEEEE";e.toolpanel="#EEEEEE";e.navtext="#BFBFBF";e.content="#333333";e.search="#444444";e.breadcrumb="#333333";e.separator="#333333";e.bannerProgress="orange";this.styles.push(e);e=new b;e.name="Green Zone";e.navbar="seagreen";e.button="lavender";e.location="darkseagreen";e.selection="moccasin";
e.sidepanel="aliceblue";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="darkgreen";e.search="darkgreen";e.breadcrumb="#3087B3";e.separator="seagreen";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new b;e.name="Pretty In Pink";e.navbar="plum";e.button="lavender";e.location="pink";e.selection="lavender";e.sidepanel="seashell";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="mediumorchid";e.search="violet";e.breadcrumb="#3087B3";e.separator="plum";e.bannerProgress=
"#F2F2F2";this.styles.push(e);e=new b;e.name="Blue Monday";e.navbar="cornflowerblue";e.button="lavender";e.location="skyblue";e.selection="lavender";e.sidepanel="aliceblue";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="royalblue";e.search="royalblue";e.breadcrumb="#3087B3";e.separator="cornflowerblue";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new b;e.name="Vanilla Skies";e.navbar="sandybrown";e.button="lemmonchiffon";e.location="cornsilk";e.selection="lemonchiffon";
e.sidepanel="white";e.mainpanel="white";e.toolpanel="white";e.navtext="lemonchiffon";e.content="chocolate";e.search="moccasin";e.breadcrumb="#3087B3";e.separator="sandybrown";e.bannerProgress="#F2F2F2";this.styles.push(e);e=new b;e.name="Beetlejuice";e.navbar="indigo";e.button="slateblue";e.location="darkslateblue";e.selection="silver";e.sidepanel="lavender";e.mainpanel="white";e.toolpanel="white";e.navtext="#FBFBFB";e.content="mediumslateblue";e.search="#444";e.breadcrumb="#3087B3";e.separator="indigo";
e.bannerProgress="#F2F2F2";this.styles.push(e);e=new b;e.name="Red";e.navbar="#CD2127";e.button="#777777";e.location="#D85F56";e.selection="lightcoral";e.sidepanel="#EFDAB2";e.mainpanel="#FDFADD";e.toolpanel="#FDFADD";e.navtext="#FBFBFB";e.content="darkred";e.search="#D85F56";e.breadcrumb="darkred";e.separator="#CD2127";e.bannerProgress="#F2F2F2";this.styles.push(e)}function g(){return this.styles}b.prototype.name="Orion";b.prototype.navbar="#404648";b.prototype.button="#EFEFEF";b.prototype.location=
"#333";b.prototype.breadcrumb="#3087B3";b.prototype.separator="#333";b.prototype.selection="FEC";b.prototype.sidepanel="#FBFBFB";b.prototype.mainpanel="white";b.prototype.toolpanel="white";b.prototype.navtext="#bfbfbf";b.prototype.content="#3087B3";b.prototype.search="#444";b.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 e={top:10,left:10,width:350,height:350};e.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++)e.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++)e.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++)e.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"});e.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return e};h.prototype.processSettings=function(e){var a=new n.ThemeSheetWriter;(new p.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(e))};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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(l){function p(n,k,b){this.elements=b;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))):n.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}p.prototype.elementNode=null;p.prototype.switchesContainer=null;p.prototype.switches=null;p.prototype.radioButtons=null;p.prototype.chosenSwitch=
null;p.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 b=this;k.onclick=function(){b.showMedia(l)};this.elementNode.appendChild(k)};p.prototype.clearElements=function(){this.elementNode.innerHTML=""};p.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"};p.prototype.createSwitch=
function(l){var k;k=l?l.label+"switch":"indexSwitch";var b=document.createElement("span");b.className="workingSpan";b.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+k+'"\x3e\x3c/div\x3e';var h=this;b.onclick=l?function(){h.showMedia(l)}:function(){h.initialize();h.chosenSwitch.firstChild.className="circle";h.chosenSwitch=b;h.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(b);return this.radioButtons[this.radioButtons.length]=b};p.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};p.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return p});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(l,p,n,k){function b(){}var h=null;b.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 b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var e=document.createRange();e.selectNode(b);e=e.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(e);this.$frame=b.lastChild;this.title&&n.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=n.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(f){a.hide()},!1);this.$parent=n.$(".dialogContent",this.$frame);e=document.createRange();e.selectNode(this.$parent);
b=e.createContextualFragment(this.TEMPLATE);this.messages&&n.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=n.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(f){f.keyCode===n.KEY.ESCAPE?a.hide():f.keyCode===n.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 b=this;this.buttons.forEach(function(e){var a=k.createButton(e.text,e.callback);e.id&&(a.id=e.id,b["$"+a.id]=a);e.isDefault&&(b._defaultCallback=e.callback,b._defaultButton=a);b.$buttonContainer.appendChild(a)})}},_makeModal:function(b){var e=this;this.$frame.addEventListener("blur",function(a){e.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!n.contains(e.$frame,a.target);if(d)for(var f=0;f<e.$$modalExclusions.length;f++)if(n.contains(e.$$modalExclusions[f],
a.target)){d=!1;break}d&&(window.setTimeout(function(){(e.$lastFocusedElement||e.$parent).focus()},0),n.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);b=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var f=0;f<b.length;f++){for(var d=0;d<this.$$modalExclusions.length;d++)if(n.contains(this.$$modalExclusions[d],b[f])){a=!0;break}!a&&(b[f]!==e.$frame&&b[f].classList&&!b[f].classList.contains("tooltipContainer"))&&
(d=b[f],d.classList.contains("modalBackdrop")||(d.classList.add("modalBackdrop"),this._addedBackdrop.push(d)))}(b=n.lastTabbable(this.$buttonContainer)||n.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.TAB){var d=e._getFirstFocusField();d&&d!==a.target&&d.focus();n.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_inModalExclusion:function(b){return this.$$modalExclusions.some(function(e){return b.$frame===e||
b.$parent===e})},_bindElements:function(b){for(var e=0;e<b.childNodes.length;e++){var a=b.childNodes[e];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(b){!b&&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");n.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var e=this;this.keepAlive||window.setTimeout(function(){e.destroy()},0)},show:function(b){if(this.modal)if(this._makeModal(),h){if(!h._inModalExclusion(this)){this.hide(!0);return}}else h=this;"function"===typeof this._beforeShowing&&this._beforeShowing();n.setFramesEnabled(!1);var e=n.bounds(this.$frame),a=n.bounds(document.documentElement),f;b?(f=n.bounds(b),b=f.top+f.height+4,f=f.left+4,b+e.height>a.height&&(b=Math.max(0,a.height-e.height-4)),f+e.width>a.width&&(f=Math.max(0,
a.width-e.width-4))):(f=Math.max(0,(a.width-e.width)/2),b=Math.max(0,(a.height-e.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=f+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return n.firstTabbable(this.$parent)||this._defaultButton||n.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(h===this&&(h=null),n.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0)}};b.prototype.constructor=b;return{Dialog:b}});
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,p,n,k,b,h,g){function e(a){this._displaySignOut=!0;this._init(a)}e.prototype={_init:function(a){this._dropdownNode=n.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 f=0,d;for(d in a)a.hasOwnProperty(d)&&f++;
return f},_makeMenuItem:function(a,f){var d=g.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&d.classList.add(this._dropDownItemClass);d.addEventListener("click",f,!1);d.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&f()},!1);return d},_renderAuthenticatedService:function(a,f){var d=this,e=this.authenticatedServices[a].authService;if(e&&e.logout&&this._displaySignOut){var b=this._makeMenuItem(l["Sign Out"],
function(){e.logout().then(function(){d.addUserItem(a,e,d.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var f=localStorage.length-1;0<=f;f--){var b=localStorage.key(f);b&&0===b.indexOf("/orion/preferences/user")&&localStorage.removeItem(b)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(b.parentNode)}},renderServices:function(){function a(a){d[a]||(d[a]=f.createDocumentFragment());return d[a]}
var f=document,d=[],e=this._serviceRegistry;k.getPageLinksInfo(e,"orion.page.link.user").then(function(b){this._dropdown?this._dropdown.empty():this._dropdownNode&&n.empty(this._dropdownNode);b.getAllLinks().forEach(function(d){var e,b;if(d.category&&(b=/user\.(\d+)/.exec(d.category)))e=parseInt(b[1],10);if("number"!==typeof e||isNaN(e))e=1;e=a(e);b=f.createElement("li");var m=f.createElement("a");m.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&m.classList.add(this._dropDownItemClass):
m.classList.add("dropdownMenuItem");m.href=d.href;m.textContent=d.textContent;b.appendChild(m);e.appendChild(b);m.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&m.click()},!1)}.bind(this));this.keyAssistFunction&&(b=this._makeMenuItem(l["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&b.classList.add(this._keyAssistClass):b.classList.add("key-assist-menuitem"),b=b.parentNode,a(0).appendChild(b));
if(b=e.getServiceReferences("orion.page.getstarted")[0])b=b.getProperty("data"),b=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,b)).parentNode,a(0).appendChild(b);var h=this;d.sort(function(a,d){return a-d}).forEach(function(a,f){if(f<d.length-1&&!this._noSeparator){var e=g.createSeparator();a.appendChild(e)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var q in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(q)&&this._renderAuthenticatedService(q,
0)}.bind(this))},getStartedDialog:function(a){new b(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,f,d,e){e?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:f,label:d,data:e}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:f,label:d,pending:this.unauthenticatedServices[a].pending}:
{authService:f,label:d});this.renderServices()}};e.prototype.constructor=e;return{UserMenu:e}});
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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(l,p,n,k,b,h){function g(a,f,d){var e="";d&&(e="^");if(e=n.parse("/"+e+a.searchStr+"/"))d=e.pattern,e=e.flags,-1===e.indexOf("i")&&!f.caseSensitive&&(e+="i"),a.regExp={pattern:d,flags:e},a.wildCard=!0}var e={ALL_FILE_TYPE:"*.*",doSearch:function(a,f,d,b){a?(f=d,d=!0,"*"===f&&(f=""),""===f&&(d=b&&b.type!==e.ALL_FILE_TYPE),d&&(a=a.createSearchParams(f,!1,
!1,b),a=e.generateSearchHref(a),window.location=a)):window.alert(l["Can't search: no search service is available"])},generateSearchHelper:function(a,f){var d=a.keyword,b=d,h={};a.fileType&&(a.fileType!==e.ALL_FILE_TYPE&&""===d)&&(b="*."+a.fileType);if(a.regEx)h.searchStr=d,g(h,a,f);else{var k=-1<d.indexOf("*"),q=-1<d.indexOf("?");k&&(d=d.split("*").join(".*"));q&&(d=d.split("?").join("."));!k&&!q&&!a.nameSearch?(h.searchStr=a.caseSensitive?d.split("\\").join(""):d.split("\\").join("").toLowerCase(),
h.wildCard=!1):(h.searchStr=a.caseSensitive?d:d.toLowerCase(),g(h,a,f),h.wildCard=!0)}h.searchStrLength=h.searchStr.length;return{params:a,inFileQuery:h,displayedSearchTerm:b}},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=e.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var f=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,""),f=a.split("/"));return f},copySearchParams:function(a,f){var d={},e;for(e in a)if(void 0!==a[e]&&null!==a[e]&&(f||"replace"!==e))d[e]=a[e];return d},
generateSearchHref:function(a){var f=p.toUrl("search/search.html");a=e.copySearchParams(a,!0);var d=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new h(f+"#{,resource,params*}")).expand({resource:d,params:a}):(new h(f+"#{,resource}")).expand({resource:d})},generateFindURLBinding:function(a,f,d,e,b){a={find:f.searchStr,regEx:f.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof e?e:void 0,atLine:"number"===typeof d?d:void 0};return b?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,f,d){return a.replace(RegExp(f.pattern,f.flags),d)},replaceStringLiteral:function(a,f,d){f=n.parse("/"+f+"/gim");return e.replaceRegEx(a,f,d)},searchOnelineLiteral:function(a,f,d){var e;
e=0;for(var b=!1,g=[];!(e=f.indexOf(a.searchStr,e),0>e);){g.push({startIndex:e,length:a.searchStrLength});b=!0;if(d)break;e+=a.searchStrLength}return b?g:null},findRegExp:function(a,f,d,e){if(!f)return null;d=d||"";d+=(-1===d.indexOf("g")?"g":"")+(-1===d.indexOf("m")?"m":"");var b=null;return(b=RegExp(f,d).exec(a.substring(e)))&&{startIndex:b.index+e,length:b[0].length}},searchOnelineRegEx:function(a,f,d){for(var b=0,g=!1,h=[];;)if(b=e.findRegExp(f,a.regExp.pattern,a.regExp.flags,b)){h.push(b);g=
!0;if(d)break;b=b.startIndex+b.length}else break;return g?h:null},generateNewContents:function(a,f,d,b,g,h){if(b&&f){a||(d.contents=[]);for(var q=0;q<f.length;q++){for(var k=f[q],l=!1,n=!1,p=[],z,y=0,B=0;B<b.children.length;B++)if(b.children[B].lineNumber-1===q){y=B;for(l=0;l<b.children[B].matches.length;l++)!1!==b.children[B+l].checked&&p.push(l);n=0<p.length;z=b.children[B].matches;l=!0;break}if(l){if(n){p=e.replaceCheckedMatches(k,g,z,p,h);k=p.replacedStr;for(l=0;l<b.children[y].matches.length;l++)b.children[y+
l].newMatches=p.newMatches}else for(l=0;l<b.children[y].matches.length;l++)b.children[y+l].newMatches=b.children[y+l].matches;a?d.contents[q]=k:d.contents.push(k)}else a||d.contents.push(k)}}},generateMatchContext:function(a,f,d){var e=[],b=2*a+1,g;f.length<=b?(g=0,a=f.length-1):(g=d-a,0>g?(g=0,a=g+b-1):(a=d+a,a>f.length-1&&(a=f.length-1,g=a-b+1)));for(b=g;b<=a;b++)e.push({context:f[b],current:b===d});return e},splitFile:function(a){for(var f=0,d=0,e=0,b=0,g=[];;){-1!==f&&f<=e&&(f=a.indexOf("\r",
e));-1!==d&&d<=e&&(d=a.indexOf("\n",e));if(-1===d&&-1===f){g.push(a.substring(b));break}var q=1;-1!==f&&-1!==d?f+1===d?(q=2,e=d+1):e=(f<d?f:d)+1:e=-1!==f?f+1:d+1;g.push(a.substring(b,e-q));b=e}return g},searchWithinFile:function(a,f,d,b,g,h){d=e.splitFile(d);g&&(f.contents=d);if(f){f.children=[];for(var q=b=0;q<d.length;q++){var k=d[q];if(k&&0<k.length){var l=h?k:k.toLowerCase();if(l=a.wildCard?e.searchOnelineRegEx(a,l):e.searchOnelineLiteral(a,l)){var n,p=q+1;if(g)for(var z=0;z<l.length;z++)n=z+
1,n={parent:f,checked:f.checked,type:"detail",matches:l,lineNumber:p,matchNumber:n,name:k,location:f.location+"-"+p+"-"+n},f.children.push(n);else n={parent:f,context:e.generateMatchContext(2,d,q),checked:f.checked,type:"detail",matches:l,lineNumber:p,name:k,location:f.location+"-"+p},f.children.push(n);b+=l.length}}}f.totalMatches=b}},replaceCheckedMatches:function(a,f,d,e,b){for(var g=0,q="",h=[],k=0;k<d.length;k++){g!==d[k].startIndex&&(q+=a.substring(g,d[k].startIndex));d[k].length&&(b=d[k].length);
for(var g=!1,l=0;l<e.length;l++)if(e[l]===k){g=!0;break}g?(h.push({startIndex:q.length,length:f.length}),q+=f):(h.push({startIndex:q.length,length:b}),q+=a.substring(d[k].startIndex,d[k].startIndex+b));g=d[k].startIndex+b}g<a.length&&(q+=a.substring(g));return{replacedStr:q,newMatches:h}},fullPathNameByMeta:function(a){var f=a.length,d="";if(0<f)for(f-=1;-1<f;f--)d=d+(""===d?"":"/")+a[f].Name;return d},path2FolderName:function(a,f,d){return a.substring(0,a.length-f.length-(d?0:1))},getOpenSearchPref:function(a,
f){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");f(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:f})})}};return e});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(l,p,n,k,b,h){function g(e,a,f,d){this.registry=e;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=d&&d.searchOnName;this._buildSkeletonOnly=d&&d.buildSkeletonOnly;this._fetchChildrenCallBack=d&&d.fetchChildrenCallBack;this._searchParams=f;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:k.generateSearchHelper(f);this._location=d&&d.location;this._childrenLocation=d&&d.childrenLocation?d.childrenLocation:this._location;this._reportOnCancel=d&&d.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(e){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=e;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var d=this;this._visitRecursively(this._childrenLocation).then(function(){(!d._cancelled||d._reportOnCancel)&&d._reportResult();d._cancelled&&d._HandleStatus({name:"Cancel"})}.bind(d),function(a){d._reportResult();d._HandleStatus(a)}.bind(d))}.bind(this))};g.prototype.searchName=function(e,a){e&&(this._searchParams=
e,this.searchHelper=k.generateSearchHelper(e,!0));a&&(this.onSearchNameComplete=a);var f=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var d=0;d<this.fileSkeleton.length;d++){var b=this.fileSkeleton[d].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?k.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0))if(f.push(this.fileSkeleton[d]),f.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:f.length,
docs:f}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};g.prototype.buildSkeleton=function(e,a){this._buildingSkeleton=!0;var f=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var d=this;e();f.getContentTypes().then(function(f){d.contentTypesCache=f;d._visitRecursively(d._childrenLocation).then(function(){d._buildingSkeleton=!1;a();d.searchHelper&&!d._buildSkeletonOnly&&d.searchName()})})};g.prototype._sort=function(e){e.sort(function(a,
f){var d,e;if("Path asc"===this._searchParams.sort){d=a.Location&&a.Location.toLowerCase();d=k.path2FolderName(d,a.Name&&a.Name.toLowerCase(),!0);e=f.Location&&f.Location.toLowerCase();e=k.path2FolderName(e,f.Name&&f.Name.toLowerCase(),!0);if(d<e)return-1;if(d>e)return 1}return this._sortOnNameSingle(a,f)}.bind(this))};g.prototype._HandleStatus=function(e){this._statusService&&"Cancel"===e.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(e,a){var f=e.Name&&e.Name.toLowerCase(),d=a.Name&&a.Name.toLowerCase();return f<d?-1:f>d?1:0};g.prototype._fileNameMatches=function(e){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return e.match(a)}));return a};g.prototype._visitRecursively=function(e){var a=[],f=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(e);return(f._progressService?this._progressService.progress(f.fileClient.fetchChildren(e),"Crawling search for children of "+e):f.fileClient.fetchChildren(e)).then(function(d){for(var e=0;e<d.length;e++)if(void 0!==d[e].Directory&&!1===d[e].Directory)if(f._searchOnName)a.push(f._buildSingleSkeleton(d[e]));else if(f._buildSkeletonOnly)a.push(f._buildSingleSkeleton(d[e]));
else{if(!f._cancelled){var g=b.getFilenameContentType(d[e].Name,f.contentTypesCache);if(g&&("text/plain"===g["extends"]||"text/plain"===g.id)&&f._fileNameMatches(d[e].Name))g=f._sniffSearch(d[e]),a.push(g),f._deferredArray.push(g)}}else if(d[e].Location)if(f._cancelled)break;else g=f._visitRecursively(d[e].ChildrenLocation),a.push(g),f._deferredArray.push(g);return h.all(a)})};g.prototype._hitOnceWithinFile=function(e){e=this._searchParams.caseSensitive?e:e.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
k.searchOnelineRegEx(this.searchHelper.inFileQuery,e,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,e,!0)};g.prototype._reportSingleHit=function(e){this._cancelled||(e.LastModified=e.LocalTimeStamp,this.fileLocations.push(e),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(e){e.cancel()})};
g.prototype._sniffSearch=function(e){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(e),this._statusService&&this._statusService.setProgressResult({Message:n.formatMessage(l["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(e.Location),"Reading file "+e.Location):a.fileClient.read(e.Location)).then(function(f){a._hitOnceWithinFile(f)&&
a._reportSingleHit(e);a._statusService&&a._statusService.setProgressResult({Message:n.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(e){this._totalCounter++;this.fileSkeleton.push(e);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();e=new h;e.resolve(this._totalCounter);
return e};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,p,n,k,b,h,g){function e(a){this._init(a)}e.prototype=new g.Dialog;e.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';e.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 n.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()};e.prototype._bindToDom=function(a){var f=this;f.$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){f._time=+new Date;f._timeoutId&&clearTimeout(f._timeoutId);f._timeoutId=setTimeout(f.checkSearch.bind(f),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var e=b.$("a",f.$results);e&&(b.stop(a),(h.isMac?a.metaKey:a.ctrlKey)?window.open(e.href):(window.location.href=e.href,f.hide()))}},!1);a.addEventListener("keydown",function(a){var e,g,h;if(a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.UP)e=b.$$array("a",f.$results),g=document.activeElement,h=e.indexOf(g),a.keyCode===b.KEY.DOWN?0<=h?(g.classList.remove("treeIterationCursor"),e=h<e.length-1?e[h+1]:e[0],e.focus(),
e.classList.add("treeIterationCursor")):0<e.length&&(e=e[0],e.focus(),e.classList.add("treeIterationCursor")):0<=h?(g.classList.remove("treeIterationCursor"),g=f.$fileName,e=0<h?e[h-1]:g,e.focus(),0<h&&e.classList.add("treeIterationCursor")):0<e.length&&(e[e.length-1].focus(),e[e.length-1].classList.add("treeIterationCursor")),b.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(f._forceUseCrawler||!f._fileService.getService(f._searcher.getSearchLocation()).search){var a=
f._searchOnRoot?f._searcher.getSearchRootLocation():f._searcher.getChildrenLocation(),a=new p.SearchCrawler(f._searcher.registry,f._fileService,"",{searchOnName:!0,location:a});f._searcher.setCrawler(a);a.buildSkeleton(function(){f.$crawlingProgress.style.display="inline";f.$progress.appendChild(document.createTextNode(l["Building file skeleton..."]))},function(){f.$crawlingProgress.style.display="none";f.$progress.removeChild(f.$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())};e.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)};e.prototype._detectFolderKeyword=function(a){var f,d=a,e=null;if(this._nameSearch&&(f=/(\S+)\s*(.*)/,(a=f.exec(a))&&3===a.length))a[1]&&
(d=a[1]),a[2]&&(e=a[2]);return{keyword:d,folderKeyword:e}};e.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var f=this._detectFolderKeyword(a),d=this._searcher.createSearchParams(f.keyword,this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var g=document.createElement("div");g.appendChild(document.createTextNode(this._nameSearch?l["Searching..."]:h.formatMessage(l["Searching for occurrences of"],
a)));b.empty(this.$results);this.$results.appendChild(g);this._searcher.search(d,f.folderKeyword,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};e.prototype.decorateResult=function(a){function f(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&d.hide()}var d=this;a=b.$$array("a",a);for(var e=0;e<a.length;e++)a[e].addEventListener("click",f,!1)};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};
e.prototype.constructor=e;return{OpenResourceDialog:e}});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,p){function n(k,b,h){if(k=p.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(b=p.node(b))this._triggerNode=b;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(b){b.keyCode===p.KEY.ESCAPE&&this.clearPanel()}.bind(this))}l.mixin(n.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){p.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=p.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",p.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,b){b()},_positionDropdown:function(){this._dropdownMenu.style.right="";var k=p.bounds(this._dropdownMenu),b=p.bounds(document.body);k.left+k.width>b.left+b.width&&(k=p.bounds(this._boundingNode(this._triggerNode)),b=p.bounds(this._triggerNode),this._dropdownMenu.style.right=k.width-(b.left-k.left+b.width)+"px")},_boundingNode:function(k){var b=window.getComputedStyle(k,
null);return null===b||"absolute"===b.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&&(p.setFramesEnabled(!0),p.empty(this._parent),this._parent=this.select=null)}});return n});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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(l,p,n){function k(b,e,a){if(!b[e])throw e+l[" is not supported in this file system"];return b[e].apply(b,a)}function b(g,e,a,f){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("/"!==e[e.length-1])return k(g,"readBlob",[e]).then(function(d){return k(a,"writeBlob",[f,d])});var d=f.substring(0,
f.length-1),m=decodeURIComponent(d.substring(d.lastIndexOf("/")+1)),d=d.substring(0,d.lastIndexOf("/")+1);return k(a,"createFolder",[d,m]).then(function(){},function(){}).then(function(){return k(g,"fetchChildren",[e]).then(function(d){for(var e=[],m=0;m<d.length;++m){var h=d[m].Location,k=h;d[m].Directory&&(k=h.substring(0,h.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=f+encodeURIComponent(k);d[m].Directory&&(k+="/");e[m]=b(g,h,a,k)}return p.all(e)})})}function h(b,e){function a(a){var d=
new p;d.reject(l["No Matching FileService for location:"]+a);return d}var f=b.getServiceReferences("orion.core.file"),d=f;if(e)for(var d=[],m=0;m<f.length;++m)e(f[m])&&d.push(f[m]);for(var h=[],k=[],q=[],t=[],w={fetchChildren:function(){var a=new p;a.resolve(t);return a},createWorkspace:function(){var a=new p;a.reject(l["no file service"]);return a},loadWorkspaces:function(){var a=new p;a.reject(l["no file service"]);return a},loadWorkspace:function(a){var d=new p;window.setTimeout(function(){d.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:l["File Servers"],Location:"/",Children:t,ChildrenLocation:"/"})},100);return d},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},f=0;f<d.length;++f)t[f]={Directory:!0,Length:0,LocalTimeStamp:0,Location:d[f].getProperty("top"),ChildrenLocation:d[f].getProperty("top"),Name:d[f].getProperty("Name")},m=d[f].getProperty("pattern")||d[f].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==m[0]&&(m=
"^"+m),h[f]=RegExp(m),k[f]=b.getService(d[f]),q[f]=d[f].getProperty("Name"),d[f].getProperty("NameKey")&&d[f].getProperty("nls")&&n.getMessageBundle(d[f].getProperty("nls")).then(function(a,f){t[a].Name=f[d[a].getProperty("NameKey")];q[a]=f[d[a].getProperty("NameKey")]}.bind(this,f));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return k[0]?0:-1;for(var d=0;d<h.length;++d)if(h[d].test(a))return d;throw l["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?w:k[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?w.Name:q[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?w.Location:t[a].Location}}h.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return k(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return k(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return k(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return k(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,e,a,f){return k(this._getService(b),"createProject",arguments)},createFolder:function(b,e){return k(this._getService(b),"createFolder",arguments)},createFile:function(b,e){return k(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return k(this._getService(b),"deleteFile",arguments)},moveFile:function(g,e,a){var f=this._getService(g),d=this._getService(e);if(f===d)return k(f,"moveFile",arguments);var m="/"===g[g.length-1],h=e;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var u=g;m&&(u=u.substring(0,u.length-1));h+=u.substring(u.lastIndexOf("/")+1)}m&&"/"!==h[h.length-1]&&(h+="/");return b(f,g,d,h).then(function(){return k(f,"deleteFile",[g])})},copyFile:function(g,e,a){var f=
this._getService(g),d=this._getService(e);if(f===d)return k(f,"copyFile",arguments);var m="/"===g[g.length-1],h=e;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var u=g;m&&(u=u.substring(0,u.length-1));h+=u.substring(u.lastIndexOf("/")+1)}m&&"/"!==h[h.length-1]&&(h+="/");return b(f,g,d,h)},read:function(b,e){return k(this._getService(b),"read",arguments)},readBlob:function(b){return k(this._getService(b),"readBlob",arguments)},write:function(b,e,a){return k(this._getService(b),"write",
arguments)},remoteImport:function(b,e){return k(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,e){return k(this._getService(b),"remoteExport",arguments)},search:function(b){return k(this._getService(b.resource),"search",arguments)}};h.prototype.constructor=h;return{FileClient:h}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(l,p){function n(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)||b;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var k="sideMenuNavigation",b="open";n.prototype=
{constructor:n.prototype.constructor,setCategories:function(b){this._categoryInfos=b.getCategoryIDs().map(function(g){return b.getCategory(g)}).sort(function(b,e){var a=b.order||100,f=e.order||100;return a<f?-1:f<a?1:b.textContent.localeCompare(e.textContent)})},setPageLinks:function(b){this._categorizedPageLinks={};b.getAllLinks().forEach(function(b){var e=b.category;this._categorizedPageLinks[e]=this._categorizedPageLinks[e]||[];this._categorizedPageLinks[e].push({title:b.textContent,order:b.order||
100,href:b.href})},this)},setRelatedLinks:function(b,g){this._categorizedRelatedLinks={};b.forEach(function(e){var a=e.relatedLink,f=e.command;e=e.invocation;if(!g||-1===g.indexOf(a.id)){var d=a.category;this._categorizedRelatedLinks[d]=this._categorizedRelatedLinks[d]||[];this._categorizedRelatedLinks[d].push({title:f.name,order:a.order||100,href:f.hrefCallback.call(e.handler,e)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var b=new URL(window.location.href);this._currentCategory=b.hash="";Object.keys(this._categorizedPageLinks).some(function(e){if(this._categorizedPageLinks[e].some(function(a){var f=new URL(a.href);a.hash="";return b.href===f.href}))return this._currentCategory=e,!0},this);var g=document.createElement("ul");g.classList.add("sideMenuList");this._categoryInfos.forEach(function(e){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
e.id&&a.classList.add("sideMenuItemActive");a.categoryId=e.id;a.categoryName=e.textContent||e.id;var f=document.createElement("a");f.classList.add("submenu-trigger");if("string"===typeof e.imageDataURI&&0===e.imageDataURI.indexOf("data:image")){var d=document.createElement("img");d.width="16";d.height="16";d.src=e.imageDataURI;f.appendChild(d)}else f.classList.add(e.imageClass||"core-sprite-blank-menu-item");a.appendChild(f);g.appendChild(a);this._categorizedAnchors[e.id]=f},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(g);this._show=n.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===b?localStorage.removeItem(k):localStorage.setItem(k,this._state);this.render()},
_updateCategoryAnchors:function(){var b=[];Object.keys(this._categorizedRelatedLinks).forEach(function(g){("git"===g||g.match(/-scm$/))&&b.push(g)});Object.keys(this._categorizedAnchors).forEach(function(g){var e=this._categorizedAnchors[g],a=[];g===this._currentCategory?(e.parentElement.style.display="",e.href="",e.onclick=function(){return!1},e.title=e.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!==b.length&&("git"===g||g.match(/-scm$/))&&-1===b.indexOf(g)?(e.href="",e.title=e.parentElement.categoryName,e.parentElement.style.display="none"):(e.parentElement.style.display="",a.sort(function(a,d){return a.order<d.order?-1:d.order<a.order?1:a.title.localeCompare(d.title)}),g=a.shift(),e.href=g.href,e.title=g.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var b=p.matchResourceParameters().resource,g=(new URL(b,window.location.href)).href;this._categoryInfos.forEach(function(e){if(e.service&&e.service.getNotifications){var a=this._categorizedAnchors[e.id].parentElement;e.service.getNotifications(g).then(function(f){if(b===p.matchResourceParameters().resource){var d="";f.forEach(function(a){"info"===a.level&&!d?d="info":"warn"===a.level&&(!d||"info"===d)?d="warn":"error"===a.level&&"error"!==d&&(d="error")});d?a.setAttribute("level",d):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return n});
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,
p,n,k,b,h,g,e,a,f,d,m,r,u,q,t,w,s,x,z,y,B,v,A,C,F,D,E,I,G,H,J,M,Y,L){function W(a,d){if(a.getLabel)return a.getLabel();var f=new v;f.resolve(d.properties.name);return f}function N(a){r.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,d){var f=a.getServiceReferences("orion.core.auth");ba=[];var e=R.createMenuGenerator.apply(this,arguments);if(e)for(var b=0;b<
f.length;b++){var m=f[b],g=a.getService(m);W(g,m).then(function(a){g.getKey().then(function(d){ba.push(d);g.getUser().then(function(f){e.addUserItem(d,g,a,f)},function(f,b){e.addUserItem(d,g,a,b)});window.addEventListener("storage",function(f){P[d]!==localStorage.getItem(d)&&(P[d]=localStorage.getItem(d),g.getUser().then(function(f){e.addUserItem(d,g,a,f)},function(f){e.addUserItem(d,g,a)}))},!1)})})}}function U(a){return a}function T(d,f,e,b,m){function q(){if(u)return u;var a=d.getService("orion.core.contentTypeRegistry");
a||(a=new w.ContentTypeRegistry(d),a=d.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return u=a})}function h(a){for(var d={},f=a.getPropertyKeys(),e,b=0;b<f.length;b++)e=f[b],d[e]=a.getProperty(e);return d}function k(a,d){var f=null;a.some(function(a){return d===a.getProperty("id")?!!(f=a):!1});return f}function r(a){var d=a.command;return!d.visibleWhen||d.visibleWhen(f)?(a.invocation=new g.CommandInvocation(f,f,null,d,b),(new v).resolve(a)):"function"===
typeof m?(t||(t=m()),v.when(t,function(e){if(e&&f===ca&&(!d.visibleWhen||d.visibleWhen(e)))return a.invocation=new g.CommandInvocation(e,e,null,d,b),a})):(new v).resolve()}function C(a,d,f){return f?(new v).resolve({relatedLink:a,command:f}):d.then(function(d){return{relatedLink:a,command:new g.Command(d)}})}var A=arguments,u,t,l=d&&d.getServiceReferences("orion.page.link.related");if(l&&0!==l.length){var n=this;v.when(q(),function(){if(R.beforeGenerateRelatedLinks.apply(n,A)){var f=d.getServiceReferences("orion.navigate.command"),
m=[];l.forEach(function(e){var g=h(e);if(g.id){var v;if((g.nls&&g.nameKey||g.name)&&g.uriTemplate)v=a._createCommandOptions(g,e,d,u,!0),m.push(C(g,v,null));else if(v=k(f,g.id)){var q=h(v);e={};L.mixin(e,q,g);(g=b.findCommand(g.id))?m.push(C(e,null,g)):(v=a._createCommandOptions(q,v,d,u,!0),m.push(C(e,v,null)))}}});v.all(m,U).then(function(a){a.sort(function(a,d){return a.command.name.localeCompare(d.command.name)});return v.all(a.map(r),U).then(function(d){var f=[];d=d.filter(function(d,e){if(d)return!0;
f.push(a[e]);return!1});R.addRelatedLinkCommands.call(n,b,d,f,e);R.afterGenerateRelatedLinks.apply(n,A)})})}})}}function Q(a){var d=r.node("globalActions");d&&(a.destroy(d),a.renderCommands(d.id,d,{},{},"tool"))}function X(a){var d=window.getComputedStyle(a,null);return null===d||"absolute"===d.getPropertyValue("position")||!a.parentNode||a===document.body?a:X(a.parentNode)}function K(a){var d={},f=null;"string"===typeof a&&(a=r.node(a));a||(a=r.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){f=
e;break}e=e.parentNode}a.classList.contains("commandMarker")&&(d.commandNode=a);f||(f=r.node("pageToolbar"));f&&(d.slideContainer=r.$(".slideParameters",f),d.parameterArea=r.$(".parameters",f),d.dismissArea=r.$(".parametersDismiss",f),d.notifications=r.$("#notificationArea",f),f.parentNode&&(d.toolbarTarget=r.$(".toolbarTarget",f.parentNode),d.toolbarTarget&&(a=r.bounds(d.toolbarTarget),e=r.bounds(X(d.toolbarTarget.parentNode)),d.toolbarTargetY=a.top-e.top,d.toolbar=f)));return d}function O(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var d=r.bounds(a),f=r.bounds(a.parentNode);a.style.left=(f.width-d.width)/2+"px";a.style.top="0"}}h=function(a){var d=document.createElement("a");d.href=a;return d.href}(p.toUrl("auth/NotifyAuthentication.html"));var P={},R={createMenuGenerator:J.createMenuGenerator||function(a,d){if(r.node("userMenu")){var f=r.node("userDropdown"),e=new q.Dropdown({dropdown:f}),f=new A.UserMenu({dropdownNode:f,dropdown:e,
serviceRegistry:a}),e=r.node("userTrigger");new t.Tooltip({node:e,text:l.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),b=e.className;e.className=b+" imageSprite core-sprite-silhouette";f.setKeyAssist(d);return f}},beforeGenerateRelatedLinks:J.beforeGenerateRelatedLinks||function(a,d,f,e,b){return!0},addRelatedLinkCommands:J.addRelatedLinkCommands||function(a,d,f,e){this.sideMenu&&this.sideMenu.setRelatedLinks(d,e)},afterGenerateRelatedLinks:J.afterGenerateRelatedLinks||
function(a,d,f,e,b){},afterSetPageTarget:J.afterSetPageTarget||function(a){},generateNavigationMenu:J.generateNavigationMenu||function(a,d,f,e,b,m,g){if(a=r.node("sideMenu"))d=r.node("centralNavigation"),new t.Tooltip({node:d,text:l.CentralNavTooltip,position:["right"]}),this.sideMenu=new Y(a,r.node("pageContent")),d.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=r.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:J.afterGenerateNavigationMenu||
function(a,d,f,e,b,m,g){},afterGenerateBanner:J.afterGenerateBanner||function(a,d,f,e,b,m,g){}},ba=[],ca,aa=[],V,$=null,Z=null,da=new b;return{generateBanner:function(a,d,f,b,m,q,h,A){function t(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var d=r.$$array(".targetSelector"),f=0;f<d.length;f++)d[f].target=a}},{pid:"nav.config"})}(new y.ThemePreferences(b,new B.ThemeData)).apply();var w=r.node(a);
if(!w)throw l["could not find banner parent, id was "]+a;var s=document.createRange();s.selectNode(w);s=s.createContextualFragment(D);r.processTextNodes(s,l);w.firstChild?w.insertBefore(s,w.firstChild):w.appendChild(s);w=r.node("home");w.href=p.toUrl("edit/edit.html");w.setAttribute("aria-label",l["Orion Home"]);r.node("progressPane").src=g.NO_IMAGE;if(w=r.node("pageToolbar"))w.classList.add("toolbarLayout"),w.innerHTML=I+n.slideoutHTMLFragment("mainToolbar");(w=r.node("closeNotifications"))&&w.setAttribute("aria-label",
l["Close notification"]);if(17>=H.isFirefox&&(w=r.node("staticBanner")))w.style.width="100%",w.style.MozBoxSizing="border-box";if(w=r.node("footer"))w.innerHTML=E,r.processTextNodes(w,l);f.setParameterCollector(new e.CommandParameterCollector(K,O));document.addEventListener("keydown",function(a){a.keyCode===r.KEY.ESCAPE&&(a=d.getService("orion.page.message"))&&a.setProgressMessage("")},!1);R.generateNavigationMenu.apply(this,arguments);R.afterGenerateNavigationMenu.apply(this,arguments);w=C.getCategoriesInfo(d);
s=C.getPageLinksInfo(d,"orion.page.link");v.all([w,s]).then(function(a){if(this.sideMenu){var d=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(d);this.sideMenu.render()}}.bind(this));if(w=r.$(".split")){var s=r.$(".sidePanelLayout"),G=r.$(".mainPanelLayout");s&&G&&($={side:s,main:G},$.splitter=new u.Splitter({node:w,sidePanel:s,mainPanel:G,toggle:!0,closeByDefault:A}),w=new g.Command({name:l["Toggle side panel"],tooltip:l["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){$.splitter.toggleSidePanel()}}),f.addCommand(w),f.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new k.KeyBinding("l",H.isMac?!1:!0,!0,!1,H.isMac?!0:!1)))}var J=!1,z=function(a,d){if(!J){var f=d.getService("orion.page.progress"),e=new F.OpenResourceDialog({searcher:a,progress:f,searchRenderer:a.defaultRenderer,onHide:function(){J=!1}});window.setTimeout(function(){J=!0;e.show()},0)}},w=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){z(m,d)}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new k.KeyBinding("f",!0,!0));var M=!1,w=function(){if(M)return!1;var a=r.node("banner"),d=r.node("footer"),f=r.node("sideMenu"),e=r.$(".content-fixedHeight"),b="hidden"===a.style.visibility;b?(a.style.visibility="visible",d.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized"),f&&f.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",d.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"),f&&f.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!b});return!0};window.orionNoTrim?(w(),M=!0,this.sideMenu.hide()):(w=new g.Command({name:l["Toggle banner and footer"],tooltip:l["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:w}),f.addCommand(w),f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new k.KeyBinding("m",!0,!0)));
w=new g.Command({name:l["System Configuration Details"],tooltip:l["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return p.toUrl("help/about.html")}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new k.KeyBinding(112,!0,!0));w=new g.Command({name:l["Background Operations"],tooltip:l["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return p.toUrl("operations/list.html")}});f.addCommand(w);
f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new k.KeyBinding("o",!0,!0));Z=new x.KeyAssistPanel({commandRegistry:f});w=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}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new k.KeyBinding(191,!1,!0));Q(f);S(d,w.callback);N(d);window.addEventListener("hashchange",
function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){t(d)},0);R.afterGenerateBanner.apply(this,arguments)},getToolbarElements:K,getMainSplitter:function(){return $},getKeyAssist:function(){return Z},getGlobalEventTarget:function(){return da},layoutToolbarElements:O,setPageTarget:function(a){var d,f,e=a.breadcrumbRootName,b=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(f=(e?e+" ":"")+a.fileService.fileServiceName(a.target.Location),e=null),d=a.name||a.target.Name,ca=a.target,T.call(this,b,a.target,aa,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(e=e||a.task||a.name),d=a.name,T.call(this,b,{NoTarget:""},aa,a.commandService,a.makeAlternate));(V=a.title)||(V=d?d+" - "+a.task:a.task);window.document.title=V;R.afterSetPageTarget.apply(this,arguments);if(d=a.breadCrumbContainer?r.node(a.breadCrumbContainer):r.node("location"))if(r.empty(d),a.staticBreadcrumb)new m.BreadCrumbs({container:d,
rootSegmentName:e});else{var g=b&&new M.FileClient(b),b=a.breadcrumbTarget||a.target,g=g&&b&&b.Location?g.fileServiceRootURL(b.Location):null;new m.BreadCrumbs({container:d,resource:b,rootSegmentName:e,workspaceRootSegmentName:f,workspaceRootURL:g,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){V&&("*"===V.charAt(0)&&!a&&(V=V.substring(1)),a&&"*"!==V.charAt(0)&&(V="*"+V),window.document.title=V);var d=r.node("dirty");d&&(d.textContent=a?"*":"")},
setPageCommandExclusions:function(a){aa=a},notifyAuthenticationSite:h}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(l){return{detectValidURL:function(p){for(var n=/\[([^\]]*)\]\(([^\)]+)\)/g,k=n.exec(p),b=[],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&&b.push({segmentStr:p.substring(h,k.index)}),b.push({segmentStr:0<k[1].length?k[1]:k[2],urlStr:k[2]}),h=k.index+k[0].length)}k=n.exec(p)}if(0===h)return null;h<p.length&&b.push({segmentStr:p.substring(h)});return b},processURLSegments:function(l,
n){n.forEach(function(k){if(k.urlStr){var b=document.createElement("a");b.href=k.urlStr;b.appendChild(document.createTextNode(k.segmentStr))}else b=document.createElement("span"),b.textContent=k.segmentStr;l.appendChild(b)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(l,p,n,k){function b(b,e,a,f,d){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=d;this.domId=a;this.progressDomId=f||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var h;b.prototype={_init:function(){var b=p.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var e=p.node(this.notificationContainerDomId);p.addAutoDismiss([e],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));e.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=p.$$("a",e))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=p.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&b?(b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=n.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(b,e,a){this._init();this.currentMessage=b;var f=p.node(this.domId);
if("boolean"===typeof a){var d=f.getAttribute("aria-live");f.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(p.empty(f),f.appendChild(document.createTextNode(b)),window.setTimeout(function(){f.setAttribute("aria-live",d)},100))}.bind(this),100)}else p.empty(f),f.appendChild(document.createTextNode(b));"number"===typeof e&&window.setTimeout(function(){b===this.currentMessage&&(p.empty(f),f.appendChild(document.createTextNode("")))}.bind(this),e)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var e=b.responseText||b.message||b;if("string"===typeof e)try{e=JSON.parse(e)}catch(a){}b=e.Message||e;var f="red";if(e.Severity)switch(e.Severity){case "Warning":f="#FFCC00";break;case "Error":f="red";break;case "Info":case "Ok":f="green"}e=document.createElement("span");e.style.color=f;e.appendChild(document.createTextNode(b));b=p.node(this.domId);p.empty(b);b.appendChild(e)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var e=document.createElement("span");e.classList.add("progressIcon");var a=p.node(this.progressDomId);p.empty(a);a.appendChild(e);a.appendChild(document.createTextNode(b));e=p.node(this.notificationContainerDomId);e.classList.remove("notificationHide");if(b&&0<b.length)e.classList.add("progressNormal"),e.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();e.classList.remove("notificationShow");e.classList.add("notificationHide")}},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,e){this._clickToDisMiss=!1;this._cancelMsg=e;this.currentMessage=b;var a=b.responseText||b;if("string"===typeof a)try{a=JSON.parse(a)}catch(f){}this._init();var d=a.Message||a.toString(),m=l.UnknownError,h="core-sprite-information",u="progressNormal",q=document.createElement("span");q.classList.add("imageSprite");q.classList.add("progressIcon");var t=[];if(a.Severity)switch(a.Severity){case "Warning":m=l.UnknownWarning;
h="core-sprite-warning";u="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":h="core-sprite-error";u="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:u="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");q.classList.add(h);var n=p.node(this.progressDomId),h=p.node(this.notificationContainerDomId);
p.empty(n);n.appendChild(q);d===Object.prototype.toString()&&(d=m);a.HTML?(a=document.createElement("span"),a.innerHTML=d,n.appendChild(a)):((m=k.detectValidURL(d))?(d=document.createDocumentFragment(),k.processURLSegments(d,m),Array.prototype.forEach.call(p.$$("a",d),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!e)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
d=document.createTextNode(d)),n.appendChild(d));if(u&&this.progressDomId!==this.domId){h.classList.add(u);for(u=0;u<t.length;u++)h.classList.remove(t[u])}h.classList.add("notificationShow");if(t=p.node("closeNotifications"))this._cancelMsg?(t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg):(t.innerHTML="",t.classList.remove("cancelButton"),t.classList.add("dismissButton"),t.classList.add("core-sprite-close"),
t.classList.add("imageSprite"))},showWhile:function(b,e){var a=this;if(e){a.setProgressMessage(e);var f=function(){e===a.currentMessage&&a.setProgressMessage("")};b.then(f,f)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,e){return new h(this,++this._lastProgressId,b,e)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var b="",e=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(e||(b+=", "),b+=this._progressMonitors[a].status,
e=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};b.prototype.constructor=
b;h=function(b,e,a,f){this.statusService=b;this.progressId=e;if(a){this.deferred=a;this.begin(f);var d=this;a.then(function(a,f){d.done.bind(d)()},function(a,f){d.done.bind(d)()})}};h.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};h.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};h.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};h.prototype.constructor=h;return{StatusReportingService:b,
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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(l,p,n,k){function b(){}b.prototype={_initialize:function(b,g,e,a,f){this._tooltip=new k.Tooltip({node:b,hideDelay:f||0,afterShowing:this._afterShowingFunction(g).bind(this),afterHiding:e,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&n.processTextNodes(b,l);this.$parent.appendChild(b);var d=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&d.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var g=0;g<b.childNodes.length;g++){var e=b.childNodes[g];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var g=
n.firstTabbable(this.$parent);g&&g.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};b.prototype.constructor=b;return{PopupDialog:b}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(l,p,n,k){var b={};(function(){var h=!1;b.updateNavTools=function(b,e,a,f,d,m){var k=n.node(f);if(k)e.destroy(k);else throw l["could not find toolbar "]+f;e.renderCommands(f,k,m,a,"button");if(d&&(f=n.node(d)))e.destroy(f),e.renderCommands(d,f,null,a,"button");h||(h=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(f){var b=n.node(d);
b&&(e.destroy(b),e.renderCommands(d,b,f.selections,a,"button"))}))};b.createOperationsCommands=function(b,e,a){function f(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var d=new k.Command({name:l["Remove Completed"],tooltip:l["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(d){a.removeCompletedOperations().then(function(a){e.loadOperations.bind(e)()})},visibleWhen:function(a){return!0}});b.addCommand(d);
d=new k.Command({name:l.Remove,tooltip:l["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(d){d=Array.isArray(d.items)?d.items:[d.items];for(var f=0;f<d.length;f++){var b=d[f];a.removeOperation.bind(a)(b.Location).then(function(){e.loadOperations.bind(e)()},function(){e.loadOperations.bind(e)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!f(a);for(var d in a)if(f(a[d]))return!1;return!0}});b.addCommand(d);
d=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 d=0;d<a.length;d++){var f=a[d];f.deferred&&f.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return f(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var d in a)if(!f(a[d])||!a[d].operation||!a[d].operation.cancelable)return!1;return!0}});b.addCommand(d)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(l,p,n,k,b){function h(b){this._options=b}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;b.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(g.triggerNode)};h.prototype._bindToDom=function(b){this.$allOperationsLink.href=p.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(b,e){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(e[a]);this._renderOperations()};h.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(e){}var a={Message:b.Message||b,Severity:b.Severity};b.DetailedMessage&&b.DetailedMessage!==a.Message&&(a.DetailedMessage=b.DetailedMessage);return a};h.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};h.prototype._renderOperationsTable=function(b,e,a){n.empty(b);for(var f=0;f<e.length;f++){var d=e[f],m=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px";h.style.paddingRight="5px";h.textContent=d.Name;m.appendChild(h);var k=document.createElement("div");h.appendChild(k);h=document.createElement("span");h.style.paddingRight="5px";h.classList.add("imageSprite");switch(d.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=d.Name;k.appendChild(h);if(d.error){var q=d.error.Message||d.error;d.error.DetailedMessage&&""!==d.error.DetailedMessage&&(q+=": "+d.error.DetailedMessage);h.textContent=q;h.classList.remove("operationStatus");h.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",k,{operation:d,deferred:a[f]},this,"tool");b.appendChild(m)}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,p,n,k,b){function h(e,a){if(!this._progressPane){this._progressPane=k.node(e);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var f=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===k.KEY.ENTER)&&f._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){f._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function g(b,a,f,d){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=f;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=d}h.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var f={},d;for(d in b)b[d].progressMonitor||(f[d]=b[d]);if(this._isEmpty(f))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 m="";for(d in f){var g=f[d];if(g.type&&("loadstart"===g.type||"progress"===g.type)){m=
"running";break}}""===m&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==m;switch(m){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(f,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};h.prototype.constructor=h;g.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new h(b,this._commandRegistry))},progress:function(b,a,f){var d=this,m=this._operationsIndex++;!f&&this._progressMonitorClass&&(f=new this._progressMonitorClass,f.begin(a));b.then(function(g){d._operations[m]&&
(g=d._operations[m],a&&(g.Name=a),d._lastOperation=g,g.type="loadend",f&&(g.progressMonitor=f),d.writeOperation.bind(d)(m,g,b),g.Location||d._removeOperationFromTheList.bind(d)(m))},function(g){if(d._operations[m]){var h=d._operations[m];a&&(h.Name=a);f&&(h.progressMonitor=f);d._lastOperation=h;h.type=g.canceled?"abort":"error";h.error=g;d.writeOperation.bind(d)(m,h,b);h.Location||d._removeOperationFromTheList.bind(d)(m)}},function(g){a&&(g.Name=a);f&&(g.progressMonitor=f);d.writeOperation.bind(d)(m,
g,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];a.type&&("loadstart"!==a.type&&"progress"!==a.type)&&((a=this._operations[b].progressMonitor)&&a.done(),delete this._operations[b],delete this._operationDeferrds[b])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a,f){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var d=this;b.then(function(a){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){f?d._serviceRegistry.getService("orion.page.message").setProgressMessage(""):d.setProgressResult.bind(d)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,f){this._operations[b]=a;this._operationDeferrds[b]=f;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(d){d.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,n){n(window.confirm(l))},openFiles:function(l){}};l.prototype.constructor=l;return{DialogService:l}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(l,p){function n(k,b){b||(b="orion.page.selection");this._serviceRegistry=k;l.attach(this);this._serviceRegistration=k.registerService(b,this);this._selections=null}n.prototype={getSelection:function(k){var b=this._getSingleSelection();"function"===typeof k&&k(b);return b},getSelections:function(k){var b=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof k&&k(b);return b},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(k){var b=this._selections;Array.isArray(k)?this._selections=0<k.length?k.slice():null:this._selections=k?[k]:null;b!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};n.prototype.constructor=n;return{Selection:n}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(l,p){function n(b,e,a){return b[e].apply(b,a)}function k(b){this._location=b}function b(){var b=new p;b.reject(l["No Matching OperationService for location:"]+this._location);return b}function h(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var e=b.getServiceReferences("orion.core.operation"),
a=0;a<e.length;a++){var f=b.getService(e[a]);this._services[a]=f;f=e[a].getProperty("pattern")||".*";"^"!==f[0]&&(f="^"+f);this._patterns[a]=RegExp(f)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new k(a)}}k.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};k.prototype.constructor=k;h.prototype={getOperations:function(){var b=
new p;if(this._operations)return b.resolve(this._operations),b;var e=this;this._preferenceService.getPreferences("/operations").then(function(a){e._operations=a;b.resolve(e._operations)});return b},getOperation:function(b){return n(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],e=this,a=0;a<this._services.length;a++){var f=this._patterns[a],d=new p;b[a]=d.promise;n(this._services[a],"removeCompletedOperations").then(function(a){return function(d){Array.isArray(d)&&
e.getOperations.bind(e)().then(function(b){for(var e=b.keys(),g=0;g<e.length;g++){var h=e[g];f.test(h)&&0>d.indexOf(h)&&b.remove(h)}a.resolve()})}}(d),function(a){return function(d){a.reject(d)}}(d))}return p.all(b)},removeOperation:function(b){var e=this;return n(this._getService(b),"removeOperation",arguments).then(function(a){e.getOperations.bind(e)().then(function(a){a.remove(b)})},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,p){var n={root:p};Object.keys(l).forEach(function(k){"undefined"===typeof n[k]&&(n[k]=l[k])});return n});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,p){function n(k){this._init(k)}n.prototype={_init:function(k){var b=k.parent,h=this,b=p.node(b);if(!b)throw l["no parent"];if(!k.model)throw l["no tree model"];if(!k.renderer)throw l["no renderer"];this._parent=b;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(b){h._root=b;h._showRoot?(b._depth=0,h._generate([b],0)):h._treeModel.getChildren(b,function(b){h.destroyed||h._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(k,
b){p.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,b);g.appendChild(this._bodyElement);h.appendChild(g);this._parent.appendChild(h);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(k,b,h){for(var g=0;g<k.length;g++){var e=document.createElement(this._tableRowElement);e.id=this._treeModel.getId(k[g]);e._depth=b;e._item=k[g];this._renderer.render(k[g],e);var a=this._indent*b;e.childNodes[Math.min(e.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(e,k[g]);h?(this._bodyElement.insertBefore(e,h.nextSibling),h&&(h=e)):this._bodyElement.appendChild(e)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(k,b,h){var g=this._treeModel.getId(k),e;if(g===this._id)this._removeChildRows(g),this._generateChildren(b,0),this._rowsChanged();else if(g===
this._treeModel.getId(this._root)&&k.removeAll)this._removeAllRows(),this._generateChildren(b,0),this._rowsChanged();else{var a=p.node(g);a?(a._item=k,a&&(h||a._expanded)?(this._removeChildRows(g),b?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(b,a._depth+1,a),this._rowsChanged()):(e=this,this._renderer.updateExpandVisuals(a,"progress"),b=this._treeModel.getChildren(a._item,function(b){e.destroyed||(e._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,e._generateChildren(b,a._depth+1,a),e._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(l["could not find table row "]+g)}},getItem:function(k){var b=p.node(k);return b&&b._item?b._item:k},toggle:function(k){var b=p.node(k);b&&(b._expanded?this.collapse(k):this.expand(k))},isExpanded:function(k){k="string"===typeof k?k:this._treeModel.getId(k);return(k=p.node(k))?k._expanded:!1},expand:function(k,b,h){k="string"===typeof k?k:this._treeModel.getId(k);var g=p.node(k);if(g){var e=
this;g._expanded?b&&b.apply(e,h):(this._renderer.updateExpandVisuals(g,"progress"),this._treeModel.getChildren(g._item,function(a){e.destroyed||(e._renderer.updateExpandVisuals(g,!0),g._expanded||(g._expanded=!0,e._generateChildren(a,g._depth+1,g),e._rowsChanged()),b&&b.apply(e,h))}))}},_removeChildRows:function(k){for(var b=k===this._id,h=!1,g=-1,e=[],a=p.$$array(".treeTableRow",this._parent),f=0;f<a.length;f++){var d=a[f];if(h)break;b?d._depth>g?e.push(d):h=!0:d.id===k&&(b=!0,g=d._depth)}for(k=
0;k<e.length;k++)b=e[k],b.parentNode.removeChild(b)},_removeAllRows:function(){for(var k=p.$$array(".treeTableRow",this._parent),b=0;b<k.length;b++)k[b].parentNode.removeChild(k[b])},collapse:function(k){k="string"===typeof k?k:this._treeModel.getId(k);var b=p.node(k);if(b){if(!b._expanded)return;b._expanded=!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(k);this._rowsChanged()}this._onCollapse&&this._onCollapse(b._item)},getIndent:function(){return this._indent}};n.prototype.constructor=
n;return{TableTree:n}});
define("orion/treeModelIterator",[],function(){var l={};l.TreeModelIterator=function(){function l(n,k){this.firstLevelChildren=n;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 b=this;return this.forceExpandFunc(this._cursor,"first",function(h){h&&b.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 b=this;return this.forceExpandFunc(k,"last",function(h){h&&
b.setCursor(h)})}k&&this.setCursor(k);return k},_findSibling:function(l,k){for(var b=this.topLevel(l),h=this._getChildren(l.parent),h=b?this.firstLevelChildren:h,g=0;g<h.length;g++)if(h[g]===l)return 0===g&&!k?b?null:l.parent:g===h.length-1&&k?b?null:this._findSibling(l.parent,k):k?h[g+1]:h[g-1];return null},_inParentChain:function(l,k){for(var b=l.parent;b;){if(b===k)return!0;b=b.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,b){this.setCursor(k);var h=[];for(h.push(k);;){if(this.iterate(l))h.push(this.cursor());else break;if(b===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 b=this.cursor(),
h=this._scan(!0,l,k);h||(h=this._scan(!1,l,k));this.setCursor(b);return h},iterate:function(l,k){return l?this._forward(k):this._backward(k)},iterateOnTop:function(l,k){var b=this._findSibling(this._getTopLevelParent(this.cursor()),l);b?this.setCursor(b):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,p,n){var k={},b=-1!==navigator.userAgent.indexOf("iPad"),h=-1!==window.navigator.platform.indexOf("Mac");k.ExplorerNavHandler=function(){function g(b,a,f){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var d=this;this._modelIterator=
new p.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:f.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return d.explorer.renderer.isExpandable(a)}:function(a){return d.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,f){return d.explorer.forceExpandFunc(a,b,f)}:void 0});this._init(f);(!f||!1!==f.setFocus)&&b.focus();f=function(a){if(n.isFormElement(a.target)||d.explorer.preventDefaultFunc&&d.explorer.preventDefaultFunc(a,
d._modelIterator.cursor()))return!0;if(a.keyCode===l.KEY.DOWN)return d.onDownArrow(a);if(a.keyCode===l.KEY.UP)return d.onUpArrow(a);if(a.keyCode===l.KEY.RIGHT)return d.onRightArrow(a);if(a.keyCode===l.KEY.LEFT)return d.onLeftArrow(a);if(a.keyCode===l.KEY.SPACE)return d.onSpace(a);if(a.keyCode===l.KEY.ENTER)return d.onEnter(a)};b.addEventListener("keydown",f,!1);this._listeners.push({type:"keydown",listener:f});f=function(a){if(d.explorer.onFocus)d.explorer.onFocus(!1);else d.toggleCursor(null,!1)};
b.addEventListener("blur",f,!1);this._listeners.push({type:"blur",listener:f});f=function(a){if(d.explorer.onFocus)d.explorer.onFocus(!0);else d.toggleCursor(null,!0)};b.addEventListener("focus",f,!1);this._listeners.push({type:"focus",listener:f});this._parentDiv=b}g.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;b&&(this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc)},_ctrlKeyOn:function(b){return h?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(b):l.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b,a){var f=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){f._clearSelection(a);for(var m=0;m<d.length;m++)f._selections.push(d[m]);0<f._selections.length?f.cursorOn(f._selections[0],
!0,!1,b):f.cursorOn(null,!1,!1,b);f._shiftSelectionAnchor&&0<=f._inSelection(f._shiftSelectionAnchor)||(f._shiftSelectionAnchor=null)})},refreshModel:function(b,a,f,d){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():f&&(this.topIterationNodes=f);this._modelIterator.setTree(this.topIterationNodes);!d&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){b=this.model.getId(b);for(var a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){this._selectionPolicy!==
b&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===b)&&this._toggleSelectionClass("disabledRow","readonlySelection"===b),this._selectionPolicy=b,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(b,a,f){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0):this._isRowSelectable(b)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),0<=a?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)),f&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(b,a){b||(b=this.currentModel());var f=this._getGridChildren(b);if(f&&1<f.length||
0===a&&f){0!==a&&this.toggleCursor(b,!1);var d=this._currentColumn,m=!0,d=d+a;0>d?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():m=!1),d=m?f.length-1:this._currentColumn):d>=f.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():m=!1),d=m?0:this._currentColumn);this._currentColumn=d;0!==a&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},
getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&0<b.length?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=this._parentDiv,f;b&&b!==a&&"grid"!==(f=b.getAttribute("role"))&&"tree"!==f&&"treegrid"!==f;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var f=this.getRowDiv(b),d=this.getCurrentGrid(b);d?(f&&(a?f.classList.add("treeIterationCursorRow"):f.classList.remove("treeIterationCursorRow")),d.domNode&&(f=this.getAriaContainerElement(d.domNode),
a?(d.domNode.classList.add("treeIterationCursor"),f&&f.setAttribute("aria-activedescendant",d.domNode.id)):d.domNode.classList.remove("treeIterationCursor"))):f&&(a?f.classList.add("treeIterationCursorRow_Dotted"):f.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,f,d){var m,g;if(b||a){if(g===this._modelIterator.cursor())return;m=this._modelIterator.cursor();g=b;this._modelIterator.setCursor(g)}else m=this._modelIterator.prevCursor(),
g=this._modelIterator.cursor();if(m!==g||a)if(this.toggleCursor(m,!1),!a||g){this.moveColumn(null,0);this.toggleCursor(g,!0);if((b=this.getRowDiv())&&!d){d=b.parentNode;for(a=document.documentElement;d&&d!==a;){var h=window.getComputedStyle(d,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;d=d.parentNode}d&&(a=!0,b.offsetTop<=d.scrollTop?(a=!1,void 0===f&&(f=!1)):b.offsetTop+b.offsetHeight>=d.scrollTop+d.clientHeight&&(a=!1,void 0===f&&(f=!0)),a||b.scrollIntoView(!f))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(m,
g)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;b=this.model.getId(b);var a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:l.node(b)},iterate:function(b,a,f,d){var m=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(d){d=this.currentModel();for((m=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,f);m&&m.isNotSelectable;)(m=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,f);m||(this.cursorOn(d,!0,!1,!0),this._setCursorOnItem(b,f))}else(m=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,f)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(f){(f=this.getRowDiv(f))&&(a?f.classList.add(b):f.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var f=this._inSelection(this._modelIterator.prevCursor()),
d=this._inSelection(this._modelIterator.cursor());0<=f&&0<=d?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var f=this.getRowDiv(b);if(f){var d=l.node(this.explorer.renderer.getCheckBoxId(f.id)),m=a?!d.checked:!0;if(m!==d.checked)this.explorer.renderer.onCheck(f,d,m,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var f=this.getRowDiv(b);f&&(0>this._inSelection(b)?f.classList.add("checkedRow"):f.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var f=this._getGridChildren(b);if(f)for(var d=0;d<f.length;d++)if(a.target===f[d].domNode)return!0;return!1},onClick:function(e,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(e)))l.stop(a);else{var f=l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(e)));if(a.target!==f&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(e,a)))if(this.cursorOn(e,!0,!1,!0),b)this.setSelection(e,!0);else if(this._ctrlKeyOn(a))this.setSelection(e,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(f=this._modelIterator.scan(this._shiftSelectionAnchor,e)){this._clearSelection(!0);for(var d=0;d<f.length;d++)this.setSelection(f[d],!0)}}else this.setSelection(e,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&
!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=this.currentModel(),f=this._getGridChildren(a);return f&&1<f.length?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(f)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(f=this.explorer.renderer.getRowActionElement(this.model.getId(a)),f.href&&(this._ctrlKeyOn(b)?window.open(f.href):window.location.href=f.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,
a),b.preventDefault(),!1},setIsNotSelectable:function(b,a){b.isNotSelectable=a},disableItem:function(b){var a=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var a=this.getRowDiv(b);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,
!1))}};return g}();k.ExplorerNavDict=function(){function b(e){this._dict={};this._model=e}b.prototype={addRow:function(b,a){var f=this._model.getId(b);this._dict[f]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var f=this._model.getId(b);return this._dict[f]?(!this._dict[f].gridChildren&&a&&(this._dict[f].gridChildren=[]),this._dict[f].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return b}();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,p,n,k,b,h){var g={};g.Explorer=function(){function e(a,b,d,e){this.registry=a;this.renderer=d;this.selection=b;this.commandService=e;this.renderer&&(this.renderer.explorer=this);this.myTree=null}e.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceholder:function(a,b,d){var e=null;if(a=this.getRow(a)){var e=a.parentNode,g=document.createElement("tr");g.id=b+"placeHolderRow";g.classList.add("navRow");var h=document.createElement("td");h.id=b+"placeHolderCol";h.classList.add("navColumn");g.appendChild(h);
d?e.insertBefore(g,a.nextSibling):e.insertBefore(g,a);h.style.paddingLeft=a.firstChild.style.paddingLeft;e={wrapperNode:g,refNode:h,destroyFunction:function(){try{g&&g.parentNode&&g.parentNode.removeChild(g)}catch(a){}}}}return e},getRow:function(a){if(a=this.model.getId(a))return n.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();
for(var b=0;b<a.length;b++)this._expandRecursively(a[b])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var e=a.length,g=0;g<e;g++)b._expandRecursively(a[g])})})}},createTree:function(a,f,d){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=a+"innerTree",
g=n.node(e);g&&n.empty(g);f&&(f.rootId=e);this.model=f;this._parentId=a;this._treeOptions=d;if(!d||d&&!d.noSelection)this.selectionPolicy=d?d.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new k.TableTree({id:e,model:f,parent:a,onComplete:d?d.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:d?!!d.showRoot:!1,indent:d?d.indent:void 0,onCollapse:d?d.onCollapse:void 0,navHandlerFactory:d?d.navHandlerFactory:void 0,
tableElement:d?d.tableElement:void 0,tableBodyElement:d?d.tableBodyElement:void 0,tableRowElement:d?d.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(),b=[];if(a&&this.getNavDict())for(var d=a.getSelection(),e=0;e<d.length;e++){var g=a.getRowDiv(d[e]);g&&g.parentNode&&
(g=this.getNavDict().getValue(this.model.getId(d[e])),g.model&&b.push(g.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new b.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var f=this;this.model.getRoot(function(d){d instanceof Array?f.getNavHandler().refreshModel(f.getNavDict(),f.model,d):d.children&&d.children instanceof Array&&f.getNavHandler().refreshModel(f.getNavDict(),f.model,d.children);a&&a.setFocus&&f.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return e}();g.createExplorerCommands=function(b,a){function f(d){return"function"===
typeof d.getItemCount&&0<d.getItemCount()?a?a(d):!0:!1}var d=new h.Command({tooltip:l["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.expandAll()}}),m=new h.Command({tooltip:l["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.collapseAll()}});
b.addCommand(d);b.addCommand(m)};g.ExplorerModel=function(){function b(a,f,d){this.rootPath=a;this.fetchItems=f;this.idPrefix=d||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(d){a.Children=d;b(d)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,d=0;d<a.length;d++)b=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(d):b+a[d];return b}};return b}();g.ExplorerFlatModel=function(){function b(a,f,d){this.rootPath=a;this.fetchItems=f;this.root=d}b.prototype=new g.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};
return b}();g.ExplorerRenderer=function(){function b(a,f){this.explorer=f;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.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,b){this.tableTree=b;this.tableNode=a;n.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,d,e,g){d=d||"tool";var h=document.createElement("td");h.id=b.id+"actionswrapper";e&&h.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,d,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 h},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var d=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(b.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=b.id;this.getCheckedFunc&&(e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&b.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on")));d.appendChild(e);var g=this;e.addEventListener("click",function(d){g.onCheck(b,d.target,d.target.checked?!1:!0,!0,!1,a)},!1);return d}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,d,e,g,h){(b.checked=d)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,d,e,h);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(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),d=this.explorer.getNavHandler();if(d&&(b&&"cursorOnly"!==d.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var e=[],d=0;d<a.length;d++){var g=b.getValue(a[d]);if(g&&(g.rowDomNode&&g.model)&&(e.push(g.model),this._highlightSelection&&g.rowDomNode.classList.add("checkedRow"),g=n.node(this.getCheckBoxId(g.rowDomNode.id))))g.checked=!0,g.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,d=window.sessionStorage[a+"expanded"];"string"===typeof d&&(d=0<d.length?JSON.parse(d):null);var e;if(d)for(e=0;e<d.length;e++)if(n.node(d[e])){this._expanded.push(d[e]);var g=this;this.tableTree.expand(d[e],function(){g._restoreSelections(a)});b=!0}return!b},_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,b){var d=n.node(this.expandCollapseImageId(a.id));d&&(d.classList.remove(this._expandImageClass),d.classList.remove(this._collapseImageClass),d.classList.remove(this._progressImageClass),d.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,d,e){var g=document.createElement("span");
g.id=this.expandCollapseImageId(a.id);b.appendChild(g);g.classList.add(this._twistieSpriteClass);g.classList.add(this._collapseImageClass);if(d){var h=document.createElement("span");b.appendChild(h);h.classList.add(e||"imageSprite");h.classList.add(d)}var q=this;g.onclick=function(d){if(!q.explorer.getNavHandler().isDisabled(a)){q.tableTree.toggle(a.id);if(q.tableTree.isExpanded(a.id))q._expanded.push(a.id),q.explorer.postUserExpand&&q.explorer.postUserExpand(a.id);else for(var b in q._expanded)if(q._expanded[b]===
a.id){q._expanded.splice(b,1);break}(d=q._getUIStatePreferencePath())&&window.sessionStorage&&q._storeExpansions(d)}};return g},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(n.$(".sectionTreeTable",this.tableNode.parentNode)||n.$(".treetable",this.tableNode.parentNode))&&n.$$array(".treeTableRow",this.tableNode).forEach(function(a,
b){var d=!(b%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",e="lightSectionTreeTableRow"===d?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(d);a.classList.remove(e)})},updateCommands:function(){if(this.commandService)for(var a=n.$$array(".treeTableRow"),b=0;b<a.length;b++){var d=a[b],e=n.node(d.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();g.SelectionRenderer=function(){function b(a,f){this._init(a);this.explorer=f}b.prototype=new g.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),d=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&d.appendChild(this.initCheckboxColumn(a));for(var e=0,g=this.getCellHeaderElement(e);g;)0<
g.innerHTML.length&&g.classList.add("navColumn"),d.appendChild(g),g=this.getCellHeaderElement(++e);b.appendChild(d);0<e&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var d=this.explorer.getNavDict();if(d){"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");d.addRow(a,b);var e=this;b.addEventListener("click",function(d){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,
d)},!1)}if(d=this.getCheckboxColumn(a,b))d.classList.add("checkColumn"),b.appendChild(d)}for(var d=0,g=this.getCellElement(d,a,b);g;)b.appendChild(g),0===d?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(++d,a,b)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,b,d){};return b}();
g.SimpleFlatModel=function(){function b(a,f,d){this.items=a;this.getKey=d;this.idPrefix=f;this.root={children:a}}b.prototype=new g.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",d=0;d<a.length;d++)b=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(d):b+a[d];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return g});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(l,p,n,k){function b(b,a,f){return 0<b?1===b?a+" ":b+" "+f+" ":""}function h(e){e=new Date(e);var a=(new Date).getTime()-e.getTime();e=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*e,f=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*f,d=Math.floor(a/1E3/60/60/24),a=a-864E5*d,m=Math.floor(a/1E3/60/60),g=Math.floor((a-36E5*m)/1E3/60),a=b(e,"a year","years"),h=
b(f,"a month","months"),q=b(d,"a day","days"),k=b(m,"an hour","hours"),g=b(g,"a minute","minutes"),l="";a?l=0<e?a:a+h:h?l=0<f?h:h+q:q?l=0<d?q:q+k:k?l=0<m?k:k+g:g&&(l=g);return l?l+"ago":"Just now"}function g(b){this._parentDomNode=n.node(b.parent);this._commitInfo=b.commitInfo}l.mixin(g.prototype,{destroy:function(){},_simpleMessage:function(b){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var f=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");f&&0<f.length&&(a=f[0]);10<b&&a.length>
b&&(a=a.substring(0,b-3)+"...")}return a},_generateMessageNode:function(b){var a;if(this._commitInfo.URL||this._commitInfo.SHA1){a=document.createElement("a");if(this._commitInfo.SHA1){var f=(new URL("commit",window.location.href)).href,f=decodeURIComponent(f);a.href=(new p(f+"{/SHA1}")).expand(this._commitInfo)}else a.href=this._commitInfo.URL;a.classList.add("commitInfolink")}else a=document.createElement("span");a.appendChild(document.createTextNode(b));return a},_requestPhotoURL:function(b,a){var f=
this,d=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);d.query.set("contributorUserId",b);k("GET",d.href,{timeout:15E3}).then(function(d){d=JSON.parse(d.response);a.src=d.photoURI},function(){f._useOtherPhotoURL(a)})},_useOtherPhotoURL:function(b){b.src=this._commitInfo.AvatarURL?this._commitInfo.AvatarURL:"https://www.gravatar.com/avatar/?d\x3dmm"},renderSimple:function(b){this._parentDomNode.appendChild(this._generateMessageNode(this._simpleMessage(b)))},
render:function(b,a){var f=this._commitInfo.Author&&this._commitInfo.Author.Date?h(this._commitInfo.Author.Date):"",d=this._simpleMessage(-1),m=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",g=b;g||(g="Commit");g="Last "+g;if(a){var k=document.createElement("div"),q=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,q):this._useOtherPhotoURL(q);q.classList.add("commitInfoAvatar");k.appendChild(q)}else k=
document.createElement("div"),k.classList.add("commitInfoLabelContainer"),k.appendChild(document.createTextNode(g.toUpperCase()));this._parentDomNode.appendChild(k);k=document.createElement("div");k.classList.add("commitInfoMessageContainer");q=document.createElement("div");q.classList.add("commitInfoAutorContainer");var l=document.createDocumentFragment(),w=document.createElement("span");w.appendChild(document.createTextNode(m));w.classList.add("navColumnBold");a?(m=document.createElement("span"),
m.appendChild(document.createTextNode(g)),m.classList.add("navColumnBold"),l.textContent=f?"${0} by ${1} "+f+".":"${0} by ${1}.",f=[m,w]):(l.textContent=f?"by ${0} "+f+".":"by ${0}.",f=[w]);n.processDOMNodes(l,f);q.appendChild(l);k.appendChild(q);f=document.createElement("div");f.classList.add("commitInfoMessageTextContainer");f.appendChild(this._generateMessageNode(d));k.appendChild(f);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,p,n,k,b,h,g,e,a){function f(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 d(a,d,e,m,k,l,n,B,v){d=h.clone(d);
var A;if(d.Directory)A=document.createElement("a"),A.className="navlinkonpage",m=!a?r:new g(a+"#{,resource,params*}"),A.href=m.expand({resource:d.ChildrenLocation}),d.Name&&A.appendChild(document.createTextNode(d.Name));else{k||(k=b.getOpenWithCommands(e));A=document.createElement("a");A.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){A[a]=l[a]});var C=null,F=null;if(C=B?B.holderDom:A)F=document.createElement("span"),F.className="core-sprite-file modelDecorationSprite thumbnail",
C.appendChild(F);d.Name&&A.appendChild(document.createTextNode(d.Name));var D=d.Location;n&&"object"===typeof n&&(d.params={},h.mixin(d.params,n));(a=b.getOpenWithCommand(e,d,k))&&(D=a.hrefCallback({items:d}));p.when(m.getFileContentType(d),function(a){if(C){var b=C,e=F;if(a){var m,g=a.imageClass,h=a.image;g?(m=document.createElement("span"),m.className+=g,m.classList.add("thumbnail")):h&&(m=document.createElement("img"),m.src=h,m.classList.add("thumbnail"));m&&b.replaceChild(m,e)}}A.href=D;v&&"function"===
typeof v.updateFileNode&&v.updateFileNode(d,A,f(a))})}A.addEventListener("click",function(){u=d}.bind(this),!1);return A}function m(a,d,b,f){this.explorer=d;this.commandService=b;this.contentTypeService=f;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var r=new g("#{,resource,params*}"),u;m.prototype=new n.SelectionRenderer;m.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};m.prototype.tableCallback=function(a){a.setAttribute("aria-label",
l.Navigator);a.setAttribute("role","presentation")};m.prototype.rowCallback=function(a,d){a.setAttribute("role","treeitem")};m.prototype.emptyCallback=function(d){var b=document.createElement("tr"),f=document.createElement("td");f.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=l.NoFile;var m=document.createElement("span");m.appendChild(document.createTextNode(l.File));a.processDOMNodes(e,[m]);f.appendChild(e);b.appendChild(f);d.appendChild(b)};
m.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};m.prototype.getCommitRenderer=function(a,d){return new e.CommitInfoRenderer({parent:a,commitInfo:d})};m.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"}};m.prototype.setTarget=function(a){this.target=a};m.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};m.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=d(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};m.prototype.updateFileNode=function(a,d,b){};m.prototype.showFolderLinks=!0;m.prototype.getCellElement=function(a,f,e){var m=f.LastCommit?2:1,g=f.LastCommit?3:2,h=f.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),m=document.createElement("span"),m.id=e.id+"MainCol",m.setAttribute("role","presentation"),a.appendChild(m),a.setAttribute("role","presentation"),m.className="mainNavColumn",f.Directory?(this.getExpandImage(e,m),g=this.createFolderNode(f),m.appendChild(g),this.explorer._makeDropTarget(f,g),this.explorer._makeDropTarget(f,e)):(this.openWithCommands||(this.openWithCommands=b.getOpenWithCommands(this.commandService)),g=d("",f,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),m.appendChild(g)),g&&(g.id=e.id+"NameLink",1===g.nodeType&&(k.addNavGrid(this.explorer.getNavDict(),f,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,m,f,this.explorer,"tool",null,!0),a;case m:if(this.oneColumn)return null;e=document.createElement("td");f.LocalTimeStamp&&(e.textContent=this.getDisplayTime(f.LocalTimeStamp));return e;case g:if(this.oneColumn)return null;
e=document.createElement("td");!f.Directory&&"number"===typeof f.Length&&(f=parseInt(f.Length,10)/1024,e.textContent=Math.ceil(f).toLocaleString()+" KB");e.style.textAlign="right";return e;case h:if(this.oneColumn||!f.LastCommit)return null;e=document.createElement("td");this.getCommitRenderer(e,f.LastCommit).renderSimple(60);return e}};m.prototype.constructor=m;return{NavigatorRenderer:m,isImage:f,getClickedItem:function(){return u},createLink:d}});
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,p,n,k,b,h,g,e,a){function f(a,d){this.serviceRegistry=a;this.commandRegistry=d;this.openWithCommands=null}function d(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new f(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}f.prototype.makeRenderFunction=function(d,f,h,q,t){var w=this.serviceRegistry,s=this.commandRegistry;this.openWithCommands=this.openWithCommands||e.createOpenWithCommands(w,d,s);var x=this;return function(e,w,B,v){a.when(x.openWithCommands,function(a){if(B)n.empty(f),a=document.createElement("div"),a.appendChild(document.createTextNode(l["Search failed."])),f.appendChild(a),"function"===typeof q&&q(f);else{var C=
function(){function a(d,b){var f=b.folderName?b.folderName:b.path,e=document.createElement("span");e.id=f.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+f+" "));d.appendChild(e)}var d={};return function(b,f){var e=f.name;if(d.hasOwnProperty(e)){a(b,f);var m=d[e];"function"===typeof m&&(d[e]=null,m())}else d[e]=function(){a(b,f)}}}(),F=!1;n.empty(f);if(e&&0<e.length){var D=document.createElement("table");D.setAttribute("role","presentation");for(var E=0;E<e.length;E++){var I=
e[E],G;F||(F=!0,h&&(G=D.insertRow(0).insertCell(0),G.textContent=h));G=D.insertRow(-1).insertCell(0);G.colspan=2;t&&t(G);var x={Name:I.name,Directory:I.directory,Location:I.path||I.location},J=null;"number"===typeof I.LineNumber&&(J={},J.line=I.LineNumber);if(v&&v.keyword&&!v.nameSearch){var M=b.generateSearchHelper(v),J=J||{};J.find=M.inFileQuery.searchStr;J.regEx=M.inFileQuery.wildCard?!0:void 0}x=g.createLink(p.toUrl("edit/edit.html"),x,s,d,a,{"aria-describedby":(I.folderName?I.folderName:I.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},J);I.LineNumber&&x.appendChild(document.createTextNode(" (Line "+I.LineNumber+")"));G.appendChild(x);C(G,I)}f.appendChild(D);"function"===typeof q&&q(f)}!F&&w&&(a=k.formatMessage(l["No matches found for ${0}"],w),n.empty(f),f.appendChild(document.createTextNode(a)),"function"===typeof q&&q(f))}})}};d.prototype={search:function(a,d,f){var e=function(a){for(var f=[],e=0;e<a.response.docs.length;e++){var m=a.response.docs[e],g=m.Location,h=b.path2FolderName(m.Path?
m.Path:m.Location,m.Name),v=h?h:g;(d?0<=v.indexOf(d):1)&&f.push({name:m.Name,path:g,folderName:h,directory:m.Directory,lineNumber:m.LineNumber})}return f};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(d){f(e(d),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(d){var b=a.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);f(e(d),b,null,a)},function(a){f(null,
null,a,null)})}catch(g){"string"===typeof g&&-1<g.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(d){f(e(d),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(d){f(e(d),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,d){console.error(a);n.empty(d);d.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,d){var b="",f=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);d&&a&&a.Parents&&0<a.Parents.length?f="last"===d.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(f=a);f?(this.setLocationbyURL(f.Location),b=f.Name,this._childrenLocation=f.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);f=n.node("search");b||(b="");if(f&&f.placeholder){f.value="";var e=k.formatMessage(l["Search ${0}"],b);f.placeholder=30<e.length?e.substring(0,27)+"...":k.formatMessage(l["Search ${0}"],b)}f&&f.title&&(f.title=l["Type a keyword or wild card to search in "]+b)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,d,b,f){b=b?this.getSearchRootLocation():this.getSearchLocation();return d?{resource:b,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:f&&f.sort?f.sort:"Path asc",rows:f&&f.rows?f.rows:40,start:0,caseSensitive:f?f.caseSensitive:void 0,regEx:f?f.regEx:void 0,fileType:f?f.fileType:void 0,fileNamePatterns:f&&f.fileNamePatterns?f.fileNamePatterns:void 0,keyword:a,replace:f?f.replace:void 0}}};d.prototype.constructor=d;return{Searcher:d}});
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,n,k,b,h){var g=l.search(k);0<g&&(n.appendChild(document.createTextNode(l.substring(0,g))),l=l.substring(g));k=l.replace(k,"");var g=l.substring(0,l.length-k.length),e=g.split(" ",b);if(e.length===b){l=document.createElement("a");for(var a=0;a<b;a++)h=h.replace("%"+
(a+1),e[a]);l.setAttribute("href",h);l.textContent=g;n.appendChild(l);l=k}return l},addLinks:function(l,n){var k=n||document.createElement("div"),b=this._registry.getServiceReferences("orion.core.linkScanner");if(0<b.length)for(var h=b[0],b=RegExp(h.getProperty("pattern"),"i"),g=h.getProperty("words"),h=h.getProperty("anchor"),e=l.search(b);0<=e;)l=this._replaceLink(l,k,b,g,h),e=l.search(b);0<l.length&&k.appendChild(document.createTextNode(l));return k}};l.prototype.constructor=l;return{TextLinkService:l}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(l,p){function n(b,h,g,e){l("GET",b,{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(){n(b,h,g,e)},2E3):("error"===a.type||"abort"===a.type?h.reject(e?e(a):a.Result):h.resolve(g?g(a):a.Result.JsonData),a.Location||l("DELETE",b,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var b=a;if(void 0!==
a.responseText){b=a.responseText;try{b=JSON.parse(a.responseText)}catch(d){}}void 0!==b.Message?(b.HttpCode=void 0===b.HttpCode?a.status:b.HttpCode,b.Severity=void 0===b.Severity?"Error":b.Severity,h.reject(b)):h.reject({Severity:"Error",Message:b,HttpCode:a.status})})}function k(b,h){h.then(null,function(g){g instanceof Error&&"Cancel"===g.name&&l("PUT",b,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(b,h,g){var e=new p;k(b,e);n(b,e,h,g);return e}}});
define("orion/cfui/cFClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(l,p,n,k){var b=b||{};b.CFService=function(){function b(g){g&&(this._serviceRegistry=g,this._serviceRegistration=g.registerService("orion.cf.service",this))}b.prototype={_getServiceResponse:function(b,e){var a=e.response?JSON.parse(e.response):null;if(e.xhr&&202===e.xhr.status){var f=k.handle(a.Location);f.then(function(a){try{b.resolve(JSON.parse(a))}catch(f){b.resolve(a)}},function(d){d.failedOperation=
a.Location;b.reject(d)},b.progress);b.then(null,function(a){f.reject(a)})}else b.resolve(a)},_handleServiceResponseError:function(b,e){b.reject(this._translateResponseToStatus(e))},_translateResponseToStatus:function(b){var e;try{e=JSON.parse(b.responseText)}catch(a){e={Message:messages["Problem while performing the action"]}}e.HttpCode=b.status;return e},_xhrV1:function(b,e,a){var f=this,d=new n;p(b,e,{headers:{"CF-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify(a)}).then(function(a){f._getServiceResponse(d,a)},function(a){f._handleServiceResponseError(d,a)});return d},setTarget:function(b,e,a){b={Url:b};e&&(b.Org=e);a&&(b.Space=a);return this._xhrV1("POST",l.toUrl("cfapi/target"),b)},login:function(b,e,a,f,d){f={};b&&(f.Url=b);e&&(f.Username=e,f.Password=a);return this._xhrV1("POST",l.toUrl("cfapi/target"),f)},logout:function(){return this._xhrV1("DELETE",l.toUrl("cfapi/target"))},getLogs:function(b,e,a,f){e||(new n).reject("Application name not set");
e=l.toUrl("cfapi/logs/"+e);a&&(e+="/"+a);f&&(e+="/"+f);b&&(e+="?Target\x3d"+JSON.stringify(b));return this._xhrV1("GET",e)},getTarget:function(){return this._xhrV1("GET",l.toUrl("cfapi/target"))},getInfo:function(){return this._xhrV1("GET",l.toUrl("cfapi/info"))},pushApp:function(b,e,a){var f={};e&&(f.Name=e);a&&(f.ContentLocation=a);b&&(f.Target=b);return this._xhrV1("PUT",l.toUrl("cfapi/apps"),f)},getApp:function(b,e,a){var f=l.toUrl("cfapi/apps");e?f+="?Name\x3d"+e:a&&(f+="?ContentLocation\x3d"+
a);b&&(f+="\x26Target\x3d"+JSON.stringify(b));return this._xhrV1("GET",f)},getApps:function(){return this._xhrV1("GET",l.toUrl("cfapi/apps"))},startApp:function(b,e,a,f){e={Name:e,ContentLocation:a,Timeout:f,State:"Started"};b&&(e.Target=b);return this._xhrV1("PUT",l.toUrl("cfapi/apps"),e)},stopApp:function(b,e,a){e={Name:e,ContentLocation:a,State:"Stopped"};b&&(e.Target=b);return this._xhrV1("PUT",l.toUrl("cfapi/apps"),e)},getOrgs:function(b){var e=l.toUrl("cfapi/orgs");b&&(e+="?Target\x3d"+JSON.stringify(b));
return this._xhrV1("GET",e)},getRoutes:function(b){var e=l.toUrl("cfapi/routes");b&&(e+="?Target\x3d"+JSON.stringify(b));return this._xhrV1("GET",e)},deleteRoute:function(b,e,a){e={DomainName:e,HostName:a};a=l.toUrl("cfapi/routes");a+="?Route\x3d"+encodeURIComponent(JSON.stringify(e));b&&(a+="\x26Target\x3d"+JSON.stringify(b));return this._xhrV1("DELETE",a)},deleteRouteById:function(b,e){var a=l.toUrl("cfapi/routes/"+e);b&&(a+="\x26Target\x3d"+JSON.stringify(b));return this._xhrV1("DELETE",a)},deleteOrphanedRoutes:function(){var b=
l.toUrl("cfapi/routes/"+routeId),b=b+"?Orphaned\x3dtrue";target&&(b+="\x26Target\x3d"+JSON.stringify(target));return this._xhrV1("DELETE",b)}};return b}();return b});
define("orion/cfui/logsExplorer",["orion/webui/littlelib","orion/explorers/explorer","orion/objects","orion/URITemplate"],function(l,p,n,k){function b(b,a){this.root=b;this.numberOfInstances=Object.keys(this.root.logs).length;this.prefix=a}function h(b,a){this._init(b);this.explorer=a;this.commandService=b.commandRegistry;this.actionScopeId=b.actionScopeId;this.colorLightDarkRows=b.isMiniNav}function g(b,a,f,d,m,g){this.parent=d;this.titleNode=m;p.Explorer.apply(this,[b,a,new h({singleSelection:!0,
checkbox:!1,commandRegistry:f,isMiniNav:g},this),f])}b.prototype=new p.ExplorerModel;n.mixin(b.prototype,{getRoot:function(b){b(this.root)},getChildren:function(b,a){if(b===this.root)if(1===this.numberOfInstances){var f=Object.keys(this.root.logs)[0];this.root.children=this.root.logs[f];this.root.children.forEach(function(a){a.parent=this.root;a.Target=this.root.Target;a.Instance=f}.bind(this));a(this.root.children)}else{var d=[],m;for(m in this.root.logs)d.push({Instance:m,Children:this.root.logs[m],
Type:"Instance",parent:b});this.root.children=d;a(d)}else b.Instance?(d=b.Children,d.forEach(function(a){a.parent=b;a.Instance=b.Instance;a.Target=this.root.Target}.bind(this)),b.children=d,a(d)):a([])},getId:function(b){return b===this.root?this.prefix+this.root.Application:b.Instance&&b.Children?this.prefix+this.root.Application+"_"+b.Instance:b.Instance&&b.Name?this.prefix+this.root.Application+"_"+b.Instance+"_"+b.Name:this.prefix+this.root.Application+"_"+b.Name},constructor:b});h.prototype=
new p.SelectionRenderer;h.prototype.constructor=h;n.mixin(h.prototype,{getCellElement:function(b,a,f){if(0!==b)return null;b=document.createElement("td");var d=document.createElement("span");d.id=f.id+"MainCol";d.setAttribute("role","presentation");b.appendChild(d);b.setAttribute("role","presentation");d.className="mainNavColumn";if("Log"===a.Type){f=document.createElement("span");f.className="coreImageSprite core-sprite-file";f.style.paddingLeft="16px";d.appendChild(f);f=document.createElement("a");
f.appendChild(document.createTextNode(a.Name));var m=a.Target?n.clone(a.Target):{};n.mixin(m,{instance:a.Instance,log:a.Name});f.href=(new k("#{,resource,params*}")).expand({resource:a.Application,params:m});d.appendChild(f)}else"Instance"===a.Type&&(this.getExpandImage(f,d),d.appendChild(document.createTextNode("Instance: "+a.Instance)));b.appendChild(d);return b},rowsChanged:function(){p.SelectionRenderer.prototype.rowsChanged.apply(this,arguments);this.colorLightDarkRows&&(l.$$array(".darkSectionTreeTableRow",
this.tableNode).forEach(function(b,a){b.classList.remove("darkSectionTreeTableRow")}),l.$$array(".lightSectionTreeTableRow",this.tableNode).forEach(function(b,a){b.classList.remove("lightSectionTreeTableRow")}))},prototype:h});g.prototype=Object.create(p.Explorer.prototype);n.mixin(g.prototype,{load:function(e){this.logs=e;if(e.Application&&this.titleNode){l.empty(this.titleNode);var a=document.createElement("span");a.id="LogsNavigationTitle";a.className="filesystemName layoutLeft";a.appendChild(document.createTextNode(e.Application));
this.titleNode.appendChild(a)}e=new b(e,this.parent.id);this.createTree(this.parent,e,{indent:"8px"});this.initNavHandler()},constructor:g});return{LogsExplorer:g}});define("orion/editor/i18n",{load:function(l,p,n,k){p.specified&&p.specified("orion/bootstrap")?p(["orion/i18n!"+l],function(b){n(b)}):p(["orion/editor/config"],function(b){n(b&&b.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,p){var n={root:p},k;for(k in l)l.hasOwnProperty(k)&&"undefined"===typeof n[k]&&(n[k]=l[k]);return n});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(l,p,n){function k(b,h){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(h)}k.prototype={destroy:function(){},find:function(b){1<this._text.length&&(this._text=[this._text.join("")]);var h=b.string,g=b.regex,e=h,a="",f=b.caseInsensitive;if(e)if(g){if(h=p.parse(e))e=h.pattern,a=h.flags}else e=h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),f&&(e=e.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var d=null,m;if(e){var h=b.reverse,k=b.wrap,g=b.wholeWord,l=b.start||0;b=b.end;var q=null!==b&&void 0!==b;-1===a.indexOf("g")&&(a+="g");-1===a.indexOf("m")&&(a+="m");f&&-1===a.indexOf("i")&&(a+="i");g&&(e="\\b"+e+"\\b");var t=this._text[0],n,s,x=0;q&&(f=l<b?l:b,t=t.substring(f,l<b?b:l),x=f);var z=RegExp(e,a);h?m=function(){var a=null;for(z.lastIndex=0;;){s=z.lastIndex;n=z.exec(t);if(s===z.lastIndex)return null;if(n){if(!(n.index+x<l)){if(!k||a)break;l=t.length+x}a={start:n.index+
x,end:z.lastIndex+x}}else break}a&&(l=a.start);return a}:(q||(z.lastIndex=l),m=function(){for(;;){s=z.lastIndex;n=z.exec(t);if(s===z.lastIndex)break;if(n)return{start:n.index+x,end:z.lastIndex+x};if(!(0!==s&&k))break}return null});d=m()}return{next:function(){var a=d;a&&(d=m());return a},hasNext:function(){return null!==d}}},getCharCount:function(){for(var b=0,h=0;h<this._text.length;h++)b+=this._text[h].length;return b},getLine:function(b,h){var g=this.getLineCount();if(!(0<=b&&b<g))return null;
var e=this._lineOffsets[b];if(b+1<g){g=this.getText(e,this._lineOffsets[b+1]);if(h)return g;for(var e=g.length,a;10===(a=g.charCodeAt(e-1))||13===a;)e--;return g.substring(0,e)}return this.getText(e)},getLineAtOffset:function(b){var h=this.getCharCount();if(!(0<=b&&b<=h))return-1;var g=this.getLineCount();if(b===h)return g-1;var e,a,f=this._lastLineIndex;if(0<=f&&f<g&&(e=this._lineOffsets[f],a=f+1<g?this._lineOffsets[f+1]:h,e<=b&&b<a))return f;for(var d=g,m=-1;1<d-m;)if(f=Math.floor((d+m)/2),e=this._lineOffsets[f],
a=f+1<g?this._lineOffsets[f+1]:h,b<=e)d=f;else if(b<a){d=f;break}else m=f;return this._lastLineIndex=d},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,h){var g=this.getLineCount();if(!(0<=b&&b<g))return-1;if(b+1<g){g=this._lineOffsets[b+1];if(h)return g;for(var e=this.getText(Math.max(this._lineOffsets[b],g-2),g),a=e.length,f;10===(f=e.charCodeAt(a-1))||13===f;)a--;return g-(e.length-a)}return this.getCharCount()},
getLineStart:function(b){return!(0<=b&&b<this.getLineCount())?-1:this._lineOffsets[b]},getText:function(b,h){void 0===b&&(b=0);void 0===h&&(h=this.getCharCount());if(b===h)return"";for(var g=0,e=0,a;e<this._text.length;){a=this._text[e].length;if(b<=g+a)break;g+=a;e++}for(var f=g,d=e;e<this._text.length;){a=this._text[e].length;if(h<=g+a)break;g+=a;e++}if(d===e)return this._text[d].substring(b-f,h-g);f=this._text[d].substring(b-f);g=this._text[e].substring(0,h-g);return f+this._text.slice(d+1,e).join("")+
g},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b,h){"auto"===b&&(b=void 0,1<this.getLineCount()&&(b=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=b?b:n.platformDelimiter;if(h){var g=this.getLineCount();if(1<g){for(var e=Array(g),a=0;a<g;a++)e[a]=this.getLine(a);this.setText(e.join(this._lineDelimiter))}}},setText:function(b,h,g){void 0===b&&(b="");void 0===h&&(h=0);void 0===g&&(g=
this.getCharCount());if(!(h===g&&""===b)){for(var e=this.getLineAtOffset(h),a=this.getLineAtOffset(g),f=h,d=g-h,m=a-e,k=b.length,l=0,q=this.getLineCount(),t=0,n=0,s=0,p=[];;){-1!==t&&t<=s&&(t=b.indexOf("\r",s));-1!==n&&n<=s&&(n=b.indexOf("\n",s));if(-1===n&&-1===t)break;s=-1!==t&&-1!==n?t+1===n?n+1:(t<n?t:n)+1:-1!==t?t+1:n+1;p.push(h+s);l++}this.onChanging({type:"Changing",text:b,start:f,removedCharCount:d,addedCharCount:k,removedLineCount:m,addedLineCount:l});0===p.length&&(s=this.getLineStart(e),
a=a+1<q?this.getLineStart(a+1):this.getCharCount(),h!==s&&(b=this.getText(s,h)+b,h=s),g!==a&&(b+=this.getText(g,a),g=a));s=k-d;for(a=e+m+1;a<q;a++)this._lineOffsets[a]+=s;if(5E4>p.length)e=[e+1,m].concat(p),Array.prototype.splice.apply(this._lineOffsets,e);else{s=e+1;this._lineOffsets.splice(s,m);for(q=0;q<p.length;q+=5E4)e=[s,0].concat(p.slice(q,Math.min(p.length,q+5E4))),Array.prototype.splice.apply(this._lineOffsets,e),s+=5E4}for(s=q=0;s<this._text.length;){a=this._text[s].length;if(h<=q+a)break;
q+=a;s++}e=q;for(p=s;s<this._text.length;){a=this._text[s].length;if(g<=q+a)break;q+=a;s++}a=this._text[s];h=this._text[p].substring(0,h-e);g=a.substring(g-q);p=[p,s-p+1];h&&p.push(h);b&&p.push(b);g&&p.push(g);Array.prototype.splice.apply(this._text,p);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:f,removedCharCount:d,addedCharCount:k,removedLineCount:m,addedLineCount:l})}}};l.EventTarget.addMixin(k.prototype);return{TextModel:k}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(l,p){function n(b){b&&(this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function k(b){n.call(this,b)}n.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var h=[],g=this._keyBindings,e=0;e<g.length;e++)g[e].actionID===b&&h.push(g[e].keyBinding);return h},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(b){if("keydown"===
b.type)switch(b.keyCode){case 16:case 17:case 18:case 91:return}for(var h=this._keyBindingIndex,g=this._matchingKeyBindings||this._keyBindings,e=[],a=0;a<g.length;a++){var f=g[a],d=f.keyBinding.match(b,h);if(!0===d)return this._keyBindingIndex=0,this._matchingKeyBindings=null,f.actionID;"number"===typeof d&&e.push(f)}if(0===e.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=e,"noop"},setKeyBinding:function(b,h){for(var g=this._keyBindings,
e=0;e<g.length;e++){var a=g[e];if(a.keyBinding.equals(b)){h?a.actionID=h:a.predefined?a.actionID="noop":g.splice(e,1);return}}h&&g.push({keyBinding:b,actionID:h})},setView:function(b){this._view=b}};k.prototype=new n;k.prototype.createKeyBindings=function(){var b=l.KeyBinding,h=[];h.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});h.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});h.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});h.push({actionID:"charNext",
keyBinding:new b(39),predefined:!0});p.isMac?(h.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),h.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),h.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),h.push({actionID:"wordPrevious",
keyBinding:new b(37,null,null,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),h.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),h.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),h.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),h.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,!0),predefined:!0}),h.push({actionID:"scrollPageDown",
keyBinding:new b(40,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(h.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new b(34),predefined:!0}),
h.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),h.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),h.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));p.isFirefox&&p.isLinux&&(h.push({actionID:"lineUp",keyBinding:new b(38,!0),predefined:!0}),h.push({actionID:"lineDown",
keyBinding:new b(40,!0),predefined:!0}));p.isWindows&&(h.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),h.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));h.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});h.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});h.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});h.push({actionID:"selectCharNext",keyBinding:new b(39,null,!0),
predefined:!0});h.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});h.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});p.isMac?(h.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new b(39,null,!0,!0),predefined:!0}),
h.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),h.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineStart",
keyBinding:new b(38,null,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(p.isLinux&&(h.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),h.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),h.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",
keyBinding:new b(37,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));h.push({actionID:"undo",keyBinding:new l.KeyBinding("z",!0),predefined:!0});p.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 b(8),predefined:!0});h.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});h.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});h.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});h.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
h.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});h.push({actionID:"enter",keyBinding:new b(13),predefined:!0});h.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});h.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});h.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});p.isMac&&(h.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
predefined:!0}),h.push({actionID:"deleteWordNext",keyBinding:new b(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(!p.isFirefox){var g=p.isMac&&p.isChrome;h.push({actionID:"noop",keyBinding:new b("u",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new b("i",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new b("b",!g,!1,!1,g),predefined:!0})}p.isFirefox&&
(h.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),h.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),h.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));p.isMac&&(h.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
!1,!0),predefined:!0}),h.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),p.isFirefox?(h.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(h.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return h};return{KeyMode:n,DefaultKeyMode:k}});
define("orion/editor/util",[],function(){return{contains:function(l,p){if(!p)return!1;if(!l.compareDocumentPosition){for(var n=p;n;){if(l===n)return!0;n=n.parentNode}return!1}return l===p||0!==(l.compareDocumentPosition(p)&16)},addEventListener:function(l,p,n,k){"function"===typeof l.addEventListener?l.addEventListener(p,n,!0===k):l.attachEvent("on"+p,n)},removeEventListener:function(l,p,n,k){"function"===typeof l.removeEventListener?l.removeEventListener(p,n,!0===k):l.detachEvent("on"+p,n)},Animation:function(){function l(l){this.options=
l}l.prototype.play=function(){var l="number"===typeof this.options.duration?this.options.duration:350,n=this.options.easing||this.defaultEasing,k=this.options.onAnimate||function(){},b=this.options.curve[0],h=this.options.curve[1],g=h-b,e=-1,a,f=this;this.interval=this.options.window.setInterval(function(){e=-1===e?(new Date).getTime():e;var d=((new Date).getTime()-e)/l;1>d?(d=n(d),a=b+d*g,k(a)):(k(h),f.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,p,n,k,b,h,g){function e(a,d,b){if(b){d.className="";b=d.attributes;for(var f=b.length;0<f--;)(!g.isIE||9<=g.isIE||9>g.isIE&&b[f].specified)&&d.removeAttribute(b[f].name)}if(a){a.styleClass&&(d.className=a.styleClass);if(b=a.style)for(var e in b)b.hasOwnProperty(e)&&(d.style[e]=b[e]);if(a=a.attributes)for(var m in a)a.hasOwnProperty(m)&&
d.setAttribute(m,a[m])}}function a(a){return a instanceof Array?a.slice(0):a}function f(a,d){if(!a)return d;if(!d)return a;for(var b in d)d.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=d[b]));return a}function d(a,b){if(a===b)return!0;if(a&&!b||!a&&b||a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof Array&&b instanceof Array)||a.length!==b.length)return!1;for(var f=0;f<a.length;f++)if(!d(a[f],b[f]))return!1;return!0}if(!(a instanceof
Object)||!(b instanceof Object))return!1;for(f in a)if(a.hasOwnProperty(f)&&(!b.hasOwnProperty(f)||!d(a[f],b[f])))return!1;for(f in b)if(!a.hasOwnProperty(f))return!1;return!0}function m(a,d,b){for(var f=0,e=0,m=0,g=a.length;m<g;){-1!==f&&f<=m&&(f=a.indexOf("\r",m));-1!==e&&e<=m&&(e=a.indexOf("\n",m));var h=m,q;if(-1===e&&-1===f){d(a.substring(m));break}-1!==f&&-1!==e?f+1===e?(q=f,m=e+1):(q=f<e?f:e,m=(f<e?f:e)+1):-1!==f?(q=f,m=f+1):(q=e,m=e+1);d(a.substring(h,q));b()}}function r(a){var d,b,f,e,m=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;m.getComputedStyle?(a=m.getComputedStyle(a,null),d=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),f=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom")):a.currentStyle&&(d=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,f=a.currentStyle.paddingRight,e=a.currentStyle.paddingBottom);return{left:parseInt(d,10)||0,top:parseInt(b,10)||0,right:parseInt(f,10)||0,bottom:parseInt(e,10)||0}}function u(a){var d,
b,f,e,m=a._trim;if(!m){var m=r(a),g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;g.getComputedStyle?(e=g.getComputedStyle(a,null),d=e.getPropertyValue("border-left-width"),b=e.getPropertyValue("border-top-width"),f=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width")):a.currentStyle&&(d=a.currentStyle.borderLeftWidth,b=a.currentStyle.borderTopWidth,f=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth);d=parseInt(d,10)||0;b=parseInt(b,10)||
0;f=parseInt(f,10)||0;e=parseInt(e,10)||0;m.left+=d;m.top+=b;m.right+=f;m.bottom+=e;a._trim=m}return m}function q(a,d,b,f){function e(d){if(d.animationName===g){var b=d.target;"function"===typeof b.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){b.__DOMReady()},0)}}function m(a,d){for(var b=["","-webkit-","-moz-","-ms-","-o-"],f="",e="body ."+a+" {\n",g=0;g<b.length;g++)f+="@"+b[g]+"keyframes "+d+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",e+=b[g]+"animation-duration: 0.001s;\n"+
b[g]+"animation-name: "+d+";\n";return f+(e+"}")}b="_"+b+"DOMReady";d.className=d.className?d.className+" "+b:b;d.__DOMReady=f;f=b+"Style";if(!a.getElementById(f)){var g=b+"Animation";z(a,"animationstart",e,!1);z(a,"MSAnimationStart",e,!1);z(a,"webkitAnimationStart",e,!1);d=a.createElement("style");d.id=f;f=a.getElementsByTagName("head")[0]||a.documentElement;d.appendChild(a.createTextNode(m(b,g)));f.insertBefore(d,f.firstChild)}}function t(a,d,b){this.start=a;this.end=d;this.caret=b}function w(a){this.left=
a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function s(a,d,b){this.view=a;this.lineIndex=d;this._lineDiv=b}function x(a){this._init(a||{})}var z=h.addEventListener,y=h.removeEventListener,B=h.Animation;t.prototype={clone:function(){return new t(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}};w.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};
s.prototype={create:function(a,d){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,d,this.lineIndex);b._line=this;return b}},_createLine:function(a,b,f){var m=this.view,h=m._model,q=h.getLine(f),k=h.getLineStart(f),r={type:"LineStyle",textView:m,lineIndex:f,lineText:q,lineStart:k};m.onLineStyle(r);var l=a.ownerDocument,h=b||g.createElement(l,"div");if(!b||!d(b.viewStyle,r.style))e(r.style,h,b),b&&(b._trim=null),h.viewStyle=r.style,h.setAttribute("role","presentation");h.lineIndex=f;if(b&&
h.viewLineText===q&&d(r.ranges,h.viewRanges))return h;h.viewRanges=r.ranges;h.viewLineText=q;f=[];this._createRanges(r.ranges,q,0,q.length,k,{tabOffset:0,ranges:f});r=" ";!m._fullSelection&&9>g.isIE&&(r="\ufeff");m={text:r,style:m._metrics.largestFontStyle,ignoreChars:1};0===f.length||!f[f.length-1].style||"div"!==f[f.length-1].style.tagName?f.push(m):f.splice(f.length-1,0,m);var t,u,n,w=r=0;if(g.isFirefox&&2E3<q.length){b&&(h.innerHTML="",b.lineWidth=void 0);b=l.createDocumentFragment();for(q=0;q<
f.length;q++)m=f[q],k=m.text,t=m.style,t=this._createSpan(h,k,t,m.ignoreChars),b.appendChild(t);h.appendChild(b)}else{var s,p;if(b){if(u=b.modelChangedEvent)0===u.removedLineCount&&0===u.addedLineCount?(p=u.start-k,s=u.addedCharCount-u.removedCharCount):p=-1,b.modelChangedEvent=void 0;u=b.firstChild}for(q=0;q<f.length;q++){m=f[q];k=m.text;r+=k.length;t=m.style;if(u)if(n=u.firstChild.data,l=u.viewStyle,n===k&&d(t,l)){w+=n.length;u._rectsCache=void 0;t=u=u.nextSibling;continue}else for(;u;){if(-1!==
p){l=r;l>=p&&(l-=s);n=(n=u.firstChild.data)?n.length:0;if(w+n>l)break;w+=n}l=u.nextSibling;h.removeChild(u);u=l}t=this._createSpan(h,k,t,m.ignoreChars);u?h.insertBefore(t,u):h.appendChild(t);b&&(b.lineWidth=void 0)}if(b)for(s=t?t.nextSibling:null;s;)l=s.nextSibling,b.removeChild(s),s=l}h.parentNode||a.appendChild(h);return h},_createRanges:function(a,b,f,e,m,g){if(!(f>e)){if(a)for(var h=0;h<a.length;h++){var q=a[h];if(!(q.end<m+f)){var k=Math.max(m+f,q.start)-m;if(k>e)break;var r=Math.min(m+e,q.end)-
m;if(k<=r){k=Math.max(f,k);r=Math.min(e,r);f<k&&this._createRange(b,f,k,null,g);if(!q.style||!q.style.unmergeable)for(;h+1<a.length&&a[h+1].start-m===r&&d(q.style,a[h+1].style);)q=a[h+1],r=Math.min(m+e,q.end)-m,h++;this._createRange(b,k,r,q.style,g);f=r}}}f<e&&this._createRange(b,f,e,null,g)}},_createRange:function(a,b,d,f,e){if(!(b>d)){var m=this.view._customTabSize;if(m&&8!==m)for(var g=a.indexOf("\t",b);-1!==g&&g<d;){b<g&&(b={text:a.substring(b,g),style:f},e.ranges.push(b),e.tabOffset+=b.text.length);
b=m-e.tabOffset%m;if(0<b){for(var h="\u00a0",q=1;q<b;q++)h+=" ";b={text:h,style:f,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=g+1;if(b===d)return;g=a.indexOf("\t",b)}b<=d&&(b={text:a.substring(b,d),style:f},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(a,b,d,f){var m=this.view,h="span";d&&d.tagName&&(h=d.tagName.toLowerCase());var q="a"===h;q&&(this.hasLink=!0);q&&!m._linksVisible&&(h="span");q=a.ownerDocument;a=g.createElement(a.ownerDocument,h);a.appendChild(q.createTextNode(d&&
d.text?d.text:b));d&&d.html?(a.innerHTML=d.html,a.ignore=!0):d&&d.node&&(a.appendChild(d.node),a.ignore=!0);e(d,a);if("a"===h){var k=m._getWindow();z(a,"click",function(a){return m._handleLinkClick(a?a:k.event)},!1)}a.viewStyle=d;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 d=this._ensureCreated(),f=this.view;if(void 0===a)return this._getLineBoundingClientRect(d,
!0);var e=f._model,m=d.ownerDocument,h=this.lineIndex,q=null;if(a<e.getLineEnd(h)){var k=e.getLineStart(h);this.forEach(function(b){var e=b.firstChild,h=this._nodeLength(b);if(k+h>a){var r=a-k;if(1===e.length)q=new w(b.getBoundingClientRect());else if(f._isRangeRects)h=m.createRange(),h.setStart(e,r),h.setEnd(e,r+1),q=new w(h.getBoundingClientRect());else if(g.isIE)h=m.body.createTextRange(),h.moveToElementText(b),h.collapse(),(e=0===r&&8===g.isIE)&&(r=1),h.moveEnd("character",r+1),h.moveStart("character",
r),q=new w(h.getBoundingClientRect()),e&&(q.left=b.getClientRects()[0].left);else{var l=e.data;b.removeChild(e);b.appendChild(m.createTextNode(l.substring(0,r)));var A=g.createElement(m,"span");A.appendChild(m.createTextNode(l.substring(r,r+1)));b.appendChild(A);b.appendChild(m.createTextNode(l.substring(r+1)));q=new w(A.getBoundingClientRect());b.innerHTML="";b.appendChild(e);this._createdDiv||(b=f._getSelection(),(k<=b.start&&b.start<k+h||k<=b.end&&b.end<k+h)&&f._updateDOMSelection())}g.isIE&&(r=
d.ownerDocument.defaultView||d.ownerDocument.parentWindow,b=r.screen.logicalXDPI/r.screen.deviceXDPI,r=r.screen.logicalYDPI/r.screen.deviceYDPI,q.left*=b,q.right*=b,q.top*=r,q.bottom*=r);return!1}k+=h;return!0})}e=this.getBoundingClientRect();q||(f._wrapMode?(h=this.getClientRects(),q=h[h.length-1],q.left=q.right,q.left+=e.left,q.top+=e.top,q.right+=e.left,q.bottom+=e.top):(q=new w(e),q.left=q.right));if(b||void 0===b)q.left-=e.left,q.top-=e.top,q.right-=e.left,q.bottom-=e.top;return q},forEach:function(a){for(var b=
this._ensureCreated().firstChild;b;){var d=b.nextSibling;if(!b.ignore&&!a.call(this,b))break;b=d}},_getClientRects:function(a,b){var d,f,e,m;if(!a._rectsCache){d=a.getClientRects();f=Array(d.length);for(m=0;m<d.length;m++)e=f[m]=new w(d[m]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=f}d=a._rectsCache;f=[d.length];for(m=0;m<d.length;m++)f[m]=new w(d[m]);return f},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var b=[],d=this._ensureCreated().getBoundingClientRect();
this.forEach(function(a){a=this._getClientRects(a,d);for(var f=0;f<a.length;f++){var e=a[f],m,g;if(e.top!==e.bottom){var h=e.top+(e.bottom-e.top)/2;for(m=0;m<b.length&&!(g=b[m],g.top<=h&&h<g.bottom);m++);m===b.length?b.push(e):(e.left<g.left&&(g.left=e.left),e.top<g.top&&(g.top=e.top),e.right>g.right&&(g.right=e.right),e.bottom>g.bottom&&(g.bottom=e.bottom))}}return!0});return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,b){var d=new w(a.getBoundingClientRect());if(!this.view._wrapMode){d.right=
d.left;for(var f=a.lastChild;f&&f.ignoreChars===f.firstChild.length;)f=f.previousSibling;f&&(f=f.getBoundingClientRect(),d.right=f.right+u(a).right)}b&&(f=u(a),d.left+=f.left,d.right-=f.right);return d},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 d=0;d<b.length;d++)if(b[d].top<=a&&a<b[d].bottom)return d;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 d=0;this.forEach(function(f){var e=f.firstChild;if(e===a)return f.ignoreChars&&(d-=f.ignoreChars),d+=b,!1;f.ignoreChars&&(d-=f.ignoreChars);d+=e.data.length;
return!0});return Math.max(0,d)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var b=0,d,f,e=this.view._model,m=e.getLineStart(this.lineIndex),g=a-m,h=e.getLineEnd(this.lineIndex)-m;this.forEach(function(a){var e=a.firstChild,m=this._nodeLength(a);if(m+b>g||b+m>=h)return d=e,f=g-b,a.ignoreChars&&(0<m&&f===m)&&(f+=a.ignoreChars),!1;b+=m;return!0});return{node:d,offset:f}},getText:function(a){var b="",d=0;this.forEach(function(f){var e;if(f.ignoreChars){e=f.lastChild;for(var m=
0,g=[],h=-1;e;){var q=e.data;if(q)for(var k=q.length-1;0<=k;k--){var r=q.substring(k,k+1);m<f.ignoreChars&&(" "===r||"\ufeff"===r)?m++:g.push("\u00a0"===r?"\t":r)}a===e&&(h=g.length);e=e.previousSibling}g=g.reverse().join("");-1!==h&&(d=b.length+g.length-h);b+=g}else for(e=f.firstChild;e;)a===e&&(d=b.length),b+=e.data,e=e.nextSibling;return!0});return{text:b,offset:d}},getOffset:function(a,b){function d(f,k,C){var u=f.firstChild,n=t._nodeLength(f),w=r.ownerDocument,F=w.defaultView||w.parentWindow,
s=g.isIE?F.screen.logicalXDPI/F.screen.deviceXDPI:1,p=g.isIE?F.screen.logicalYDPI/F.screen.deviceYDPI:1,x,z,y,F=C.left+l.left,H,B;if(g.isIE||e._isRangeRects){for(var w=e._isRangeRects?w.createRange():w.body.createTextRange(),L=n,N=-1;1<L-N;){var W=Math.floor((L+N)/2);C=N+1;x=W===n-1&&f.ignoreChars?u.length:W+1;H=0===C&&8===g.isIE;e._isRangeRects?(w.setStart(u,C),w.setEnd(u,x)):(H&&(C=1),w.moveToElementText(f),w.move("character",C),w.moveEnd("character",x-C));B=w.getClientRects();for(var Q=!1,S=0;S<
B.length;S++)if(C=B[S],x=(H?F:C.left)*s-l.left,y=C.right*s-l.left,z=C.top*p-l.top,C=C.bottom*p-l.top,x<=a&&a<y&&(!e._wrapMode||z<=b&&b<C)){Q=!0;break}Q?L=W:N=W}k+=L;C=L;x=L===n-1&&f.ignoreChars?u.length:Math.min(L+1,u.length);e._isRangeRects?(w.setStart(u,C),w.setEnd(u,x)):(w.moveToElementText(f),w.move("character",C),w.moveEnd("character",x-C));B=w.getClientRects();n=!1;0<B.length&&(C=B[0],x=(H?F:C.left)*s-l.left,y=C.right*s-l.left,n=a>x+(y-x)/2);f=k-q;u=m.getLine(h);s=u.charCodeAt(f);55296<=s&&
56319>=s&&n?f<u.length&&(s=u.charCodeAt(f+1),56320<=s&&57343>=s&&(k+=1)):56320<=s&&(57343>=s&&!n)&&0<f&&(s=u.charCodeAt(f-1),55296<=s&&56319>=s&&(k-=1));n&&k++}else{s=[];for(H=0;H<n;H++)s.push("\x3cspan\x3e"),H===n-1?s.push(u.data.substring(H)):s.push(u.data.substring(H,H+1)),s.push("\x3c/span\x3e");f.innerHTML=s.join("");for(s=f.firstChild;s;){C=s.getBoundingClientRect();x=C.left-l.left;y=C.right-l.left;if(x<=a&&a<y){a>x+(y-x)/2&&k++;break}k++;s=s.nextSibling}t._createdDiv||(f.innerHTML="",f.appendChild(u),
f=e._getSelection(),(k<=f.start&&f.start<k+n||k<=f.end&&f.end<k+n)&&e._updateDOMSelection())}return k}function f(d){if(d.ignore)return null;d=t._getClientRects(d,l);for(var m=0;m<d.length;m++){var g=d[m];if(g.left<=a&&a<g.right&&(!e._wrapMode||g.top<=b&&b<g.bottom))return g}return null}var e=this.view,m=e._model,h=this.lineIndex,q=m.getLineStart(h),k=m.getLineEnd(h);if(q===k)return q;var r=this._ensureCreated(),l=this.getBoundingClientRect(),t=this,u,n;if(e._wrapMode){u=this.getClientRects();b<u[0].top&&
(b=u[0].top);for(var w=0;w<u.length&&!(n=u[w],n.top<=b&&b<n.bottom);w++);a<n.left&&(a=n.left);a>n.right&&(a=n.right-1)}else 0>a&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var s,p;if(this._lastHitChild&&this._lastHitChild.parentNode){if(s=this._lastHitOffset,p=this._lastHitChild,n=f(p),!n){u=s;for(var w=s+this._nodeLength(p),x=p.previousSibling,z=p.nextSibling;x||z;){if(x){u-=this._nodeLength(x);if(n=f(x)){p=x;s=u;break}x=x.previousSibling}if(z){if(n=f(z)){p=z;s=w;break}w+=this._nodeLength(z);z=z.nextSibling}}}}else s=
q,this.forEach(function(a){p=a;if(n=f(p))return!1;s+=this._nodeLength(p);return!0});p&&n&&(this._lastHitChild=p,this._lastHitOffset=s,s=d(p,s,n));return Math.min(k,Math.max(q,s))},getNextOffset:function(a,b){if("line"===b.unit){var d=this.view._model,f=d.getLineAtOffset(a);if(0<b.count)return b.count--,d.getLineEnd(f);b.count++;return d.getLineStart(f)}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 d(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function f(a){return 32===a||9===a}var e=this.view._model,m=e.getLineAtOffset(a),g=e.getLine(m),h=e.getLineStart(m),e=e.getLineEnd(m),m=g.length,q=a-h,k,r=0>b.count?-1:1;if("word"===b.unit||"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit)for(var l,u,t;0!==b.count;){if(0<b.count){if(q===m)return e;k=g.charCodeAt(q);l=d(k);u=!l&&!f(k);for(q++;q<m;){k=g.charCodeAt(q);
if("wordWS"!==b.unit&&"wordendWS"!==b.unit){t=d(k);if("wordend"===b.unit){if(!t&&l)break}else if(t&&!l)break;k=!t&&!f(k)}else k=!f(k);if("wordend"===b.unit||"wordendWS"===b.unit){if(!k&&u)break}else if(k&&!u)break;u=k;l=t;q++}}else{if(0===q)return h;q--;k=g.charCodeAt(q);l=d(k);for(u=!l&&!f(k);0<q;){k=g.charCodeAt(q-1);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){t=d(k);if("wordend"===b.unit){if(t&&!l)break}else if(!t&&l)break;k=!t&&!f(k)}else k=!f(k);if("wordend"===b.unit||"wordendWS"===b.unit){if(k&&
!u)break}else if(!k&&u)break;u=k;l=t;q--}}b.count-=r}else for(;0!==b.count&&0<=q+r&&q+r<=m;)q+=r,k=g.charCodeAt(q),56320<=k&&57343>=k&&0<q&&(k=g.charCodeAt(q-1),55296<=k&&56319>=k&&(q+=r)),b.count-=r;return h+q},_getNextOffset_IE:function(a,b){var d=this._ensureCreated(),f=this.view._model,e=this.lineIndex,m=0,g;g=f.getLineStart(e);var h=f.getLine(e),q=f.getLineStart(e),k=d.ownerDocument,r=0>b.count?-1:1;if(a===f.getLineEnd(e)){for(d=d.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;
if(!d)return g;m=k.body.createTextRange();m.moveToElementText(d);g=m.text.length;m.moveEnd(b.unit,r);m=a+m.text.length-g}else if(a===g&&0>b.count)m=g;else for(d=d.firstChild;d;){f=this._nodeLength(d);if(g+f>a){m=k.body.createTextRange();if(a===g&&0>b.count){for(g=d.previousSibling;g&&(!g.firstChild||!g.firstChild.length);)g=g.previousSibling;m.moveToElementText(g?g:d.previousSibling)}else m.moveToElementText(d),m.collapse(),m.moveEnd("character",a-g);g=m.text.length;m.moveEnd(b.unit,r);m=a+m.text.length-
g;break}g=f+g;d=d.nextSibling}g=m-q;c=h.charCodeAt(g);56320<=c&&57343>=c&&0<g&&(c=h.charCodeAt(g-1),55296<=c&&56319>=c&&(g+=r));b.count-=r;return g+q},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var b=this;this.forEach(function(d){var f=d.viewStyle;f&&(f.tagName&&"a"===f.tagName.toLowerCase())&&a.replaceChild(b._createSpan(a,d.firstChild.data,f),d);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};x.prototype={addKeyMode:function(a,
b){var d=this._keyModes;void 0!==b?d.splice(b,0,a):d.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var d=this._rulers;if(void 0!==b){var f,e;for(e=f=0;f<d.length&&e<b;f++)a.getLocation()===d[f].getLocation()&&e++;d.splice(e,0,a);b=e}else d.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,d=this._model,f=this._clientDiv;if(!f)return{width:a,height:b};var e=f.style.width;g.isWebkit&&(f.style.width="0x7fffffffpx");for(var d=d.getLineCount(),
m=0;m<d;m++){var h=this._getLine(m),q=h.getBoundingClientRect(),a=Math.max(a,q.right-q.left),b=b+(q.bottom-q.top);h.destroy()}g.isWebkit&&(f.style.width=e);f=this._getViewPadding();a+=f.right+f.left+this._metrics.scrollWidth;b+=f.bottom+f.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,b,d){if(this._clientDiv){var f=this._getScroll(),e=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect();"document"===b&&(void 0!==a.x&&(a.x+=-f.x+m.left+e.left),void 0!==a.y&&(a.y+=
-f.y+m.top+e.top));"document"===d&&(void 0!==a.x&&(a.x+=f.x-m.left-e.left),void 0!==a.y&&(a.y+=f.y-m.top-e.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=[],d=this._actions,f;for(f in d)d.hasOwnProperty(f)&&(a||!d[f].defaultHandler)&&b.push(f);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=[],d=this._keyModes,f=0;f<d.length;f++)b=b.concat(d[f].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),d=this._getLine(b);a=d.getBoundingClientRect(a);d.destroy();d=a.left;b=this._getLinePixel(b)+a.top;return{x:d,y:b}},getNextOffset:function(a,b){var d=new t(a,a,!1);this._doMove(b,d);return d.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 d in arguments)arguments.hasOwnProperty(d)&&(b[arguments[d]]=void 0)}for(var f in b)b.hasOwnProperty(f)&&(b[f]=a(this["_"+f]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var d=this._getLineIndex(b),f=this._getLine(d),d=f.getOffset(a,b-this._getLinePixel(d));
f.destroy();return d},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,d){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(d))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(d)}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 d=this.getRulers(),f=0;f<d.length;f++)this.redrawLines(a,b,d[f])},redrawLines:function(a,b,d){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===b&&(b=this._model.getLineCount()),a!==b)){var f=this._clientDiv;if(f){if(d)for(f=this._getRulerParent(d).firstChild;f&&f._ruler!==d;)f=f.nextSibling;d?f.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!d||"page"===d.getOverview())for(f=f.firstChild;f;){var e=f.lineIndex;a<=e&&e<b&&(f.lineChanged=!0);f=f.nextSibling}!d&&(!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 d=this._model;void 0===a&&(a=0);void 0===b&&(b=d.getCharCount());var f=d.getLineAtOffset(a),d=d.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(f,d)}},removeKeyMode:function(a){for(var b=this._keyModes,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,d){if(a){var f=this._actions,e=f[a];e||(e=f[a]={});e.handler=b;void 0!==d&&(e.actionDescription=
d)}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,d){var f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));a=new t(a,a,!1);this._setSelection(a,void 0===b||b,!0,d)},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(),d=this._model.getCharCount(),f=a.getLineCount(),e=a.getCharCount(),m={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,addedLineCount:f};this.onModelChanging(m);this._model=a;m={type:"ModelChanged",start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,addedLineCount:f};this.onModelChanged(m);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(b){var f=this._defaultOptions(),e;for(e in b)if(b.hasOwnProperty(e)){var m=b[e];if(!d(this["_"+e],m)){var g=f[e]?f[e].update:null;g?g.call(this,m):this["_"+e]=a(m)}}},setSelection:function(a,b,d,f){var e=a>b;if(e){var m=a;a=b;b=m}m=this._model.getCharCount();a=Math.max(0,Math.min(a,m));b=Math.max(0,Math.min(b,m));a=new t(a,b,e);this._setSelection(a,
void 0===d||d,!0,f)},setText:function(a,b,d){var f=void 0===b&&void 0===d;void 0===b&&(b=0);void 0===d&&(d=this._model.getCharCount());f&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:b,end:d,_code:!0},!f);f&&(this._columnX=-1,this._setSelection(new t(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 d=a.target?a.target:a.srcElement;d;){if(b===d||d.className&&-1!==d.className.indexOf("textViewFind"))return;d=d.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var f=this;this._getWindow().setTimeout(function(){f._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(),d=!0,f=b;if(g.isIE||g.isFirefox&&!this._overlayDiv)f=
this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var e=this;b.setTimeout(function(){e.focus();e._ignoreFocus=!1},0)}1===this._clickCount?(d=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!g.isOpera||12.16<=g.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(f):(this._isW3CEvents&&this._setGrab(f),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return d},_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 d=2!==b&&a.timeStamp?a.timeStamp:(new Date).getTime(),f=d-this._lastMouseTime,e=Math.abs(this._lastMouseX-a.clientX),m=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=d;this._lastMouseButton=b;1===b&&(this._isMouseDown=!0,h&&f<=this._clickTime&&
e<=this._clickDist&&m<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",a),this.onMouseDown(d),d.defaultPrevented)){a.preventDefault();return}if(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 d=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(d&&!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 f=this._getViewPadding(),
e=this._viewDiv.getBoundingClientRect(),m=this._getClientWidth(),h=this._getClientHeight(),d=e.left+f.left,q=e.top+f.top,m=e.left+f.left+m,f=e.top+f.top+h;a<q?this._doAutoScroll("up",b,a-q):a>f?this._doAutoScroll("down",b,a-f):b<d&&!this._wrapMode?this._doAutoScroll("left",b-d,a):b>m&&!this._wrapMode?this._doAutoScroll("right",b-m,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 d=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:d.x,y:d.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 d=this._getSelection();d.extend(this._dragOffset);d.collapse();this._setSelection(d,!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(),d=0,f=0;g.isIE||g.isOpera?f=-a.wheelDelta/40*b:g.isFirefox?"wheel"===a.type?a.deltaMode?(d=Math.max(-256,
Math.min(256,a.deltaX))*b,f=Math.max(-256,Math.min(256,a.deltaY))*b):(d=a.deltaX,f=a.deltaY):(b=g.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?d=b:f=b):g.isMac?(f=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,d=0!==a.wheelDeltaX%120?1:40>f?40/(40-f):40,f=0!==a.wheelDeltaY%120?1:40>f?40/(40-f):40,d=Math.ceil(-a.wheelDeltaX/d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1),f=Math.ceil(-a.wheelDeltaY/f),-1<f&&0>f&&(f=-1),0<f&&1>f&&(f=1)):(d=-a.wheelDeltaX,
f=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(d,f);d=this._getScroll();if(b.x!==d.x||b.y!==d.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 b=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==b)this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=a,this._rootHeight=b,a=9>g.isIE,b=this._calculateMetrics(),d(b,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=b,a=!0),a?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,d=b.lineIndex;b&&!b._ruler;)void 0===d&&void 0!==b.lineIndex&&(d=b.lineIndex),b=b.parentNode;var f=b?b._ruler:null;if(void 0===d&&f&&"document"===f.getOverview()){var d=this._getClientHeight(),e=this._model.getLineCount(),m=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect(),d=Math.floor((a.clientY-g.top-this._metrics.scrollWidth)*e/(d+m.top+m.bottom-2*this._metrics.scrollWidth));0<=d&&d<e||(d=void 0)}if(f)switch(a.type){case "click":if(f.onClick)f.onClick(d,
a);break;case "dblclick":if(f.onDblClick)f.onDblClick(d,a);break;case "mousemove":if(f.onMouseMove)f.onMouseMove(d,a);break;case "mouseover":if(f.onMouseOver)f.onMouseOver(d,a);break;case "mouseout":if(f.onMouseOut){for(e=a.relatedTarget;e&&e!==this._rootDiv;){if(e===b)return;e=e.parentNode}f.onMouseOut(d,a)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var a=this._getScroll(!1),b=this._hScroll,d=this._vScroll;if(b!==a.x||d!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),
this._update(d===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:d},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 d;d="DIV"===a.tagName?a:a.parentNode.parentNode;return!d._line?0:d._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),d=this._getModelOffset(a.focusNode,a.focusOffset),f=this._getSelection();if(void 0===b||void 0===d||f.start===b&&f.end===d)return!1;if(this._checkSelectionChange){var f=this._getLineNext(),e=this._getLinePrevious();if(a.anchorNode===f.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===e.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===f.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===
e.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)b=0,d=this.getModel().getCharCount()}this._setSelection(new t(b,d),!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,d=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=d.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 d=b.anchorNode;d&&void 0===d.lineIndex;)d=d.parentNode;if(d){var f=this._model,e=d.lineIndex,m=f.getLine(e),h=m,q=0,f=f.getLineStart(e);0<b.rangeCount&&(b.getRangeAt(0).deleteContents(),e=d.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(e),q=this._getDOMText(d,e),h=q.text,q=q.offset,e.parentNode.removeChild(e));d.lineRemoved=!0;for(d=0;m.charCodeAt(d)===h.charCodeAt(d)&&d<q;)d++;b=m.length-1;for(e=h.length-
m.length;m.charCodeAt(b)===h.charCodeAt(b+e)&&b+e>=q+a.data.length;)b--;b++;m=h.substring(d,b+e);this._ignoreQueueUpdate=g.isSafari;this._modifyContent({text:m,start:d+f,end:b+f,_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 d=a.touches;if(1===d.length){var d=d[0],f=d.clientX,e=d.clientY;this._touchStartX=f;this._touchStartY=e;if(g.isAndroid&&(e<d.pageY-b.pageYOffset||f<d.pageX-b.pageXOffset))f=d.pageX-b.pageXOffset,e=d.pageY-b.pageYOffset;b=this.convert({x:f,y:e},"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 d=this,f=this._getWindow();this._touchScrollTimer=f.setInterval(function(){var a=0,b=0;if(d._touching)a=d._touchStartX-d._touchCurrentX,b=d._touchStartY-d._touchCurrentY,d._touchSpeedX=a/10,d._touchSpeedY=b/10,d._touchStartX=d._touchCurrentX,d._touchStartY=d._touchCurrentY;else{if(0.1>Math.abs(d._touchSpeedX)&&
0.1>Math.abs(d._touchSpeedY)){d._vScrollDiv.style.display="none";d._hScrollDiv.style.display="none";f.clearInterval(d._touchScrollTimer);d._touchScrollTimer=null;return}a=10*d._touchSpeedX;b=10*d._touchSpeedY;d._touchSpeedX*=0.95;d._touchSpeedY*=0.95}d._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,d,f=this._keyModes;for(d=f.length-1;0<=d;d--)if(b=f[d],"function"===typeof b.match&&
(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var d=this._model,f=b.getCaret(),e=d.getLineAtOffset(f);a.count||(a.count=1);for(;0!==a.count;){var m=d.getLineStart(e);if(0>a.count&&f===m)if(0<e)"character"===a.unit&&a.count++,e--,b.extend(d.getLineEnd(e));else break;else if(0<a.count&&f===d.getLineEnd(e))if(e+1<d.getLineCount())"character"===a.unit&&a.count--,e++,b.extend(d.getLineStart(e));else break;else{var g=!1;a.expandTab&&("character"===a.unit&&0===(f-
m)%this._tabSize)&&(m=d.getText(m,f),g=!/[^ ]/.test(m));g?(b.extend(f-this._tabSize),a.count+=0>a.count?1:-1):(m=this._getLine(e),b.extend(m.getNextOffset(f,a)),m.destroy())}f=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 d=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":d=d.toLowerCase();break;case "capitalize":d=d.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<d.length;b++){var f=d[b],e=f.toLowerCase(),f=e!==f?e:f.toUpperCase();a+=f}d=a;break;default:d=d.toUpperCase()}this._doContent(d);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var d=this._model,f=d.getLineAtOffset(b.end);b.end<d.getLineEnd(f)&&(d=this._getLine(f),
b.extend(d.getNextOffset(b.getCaret(),{unit:"character",count:1})),d.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(),
d=this._model,f;if(a.ctrl)b.extend(d.getCharCount()),f=function(){};else{var e=b.getCaret(),m=d.getLineAtOffset(e);if(this._wrapMode){var g=this._getLine(m),e=g.getLineIndex(e),e=e===g.getLineCount()-1?d.getLineEnd(m):g.getLineStart(e+1)-1;g.destroy()}else a.count&&0<a.count&&(m=Math.min(m+a.count-1,d.getLineCount()-1)),e=d.getLineEnd(m);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,f);return!0},_doEnter:function(a){var b=this._model,d=this._getSelection();this._doContent(b.getLineDelimiter());
a&&a.noCursor&&(d.end=d.start,this._setSelection(d,!0));return!0},_doHome:function(a){var b=this._getSelection(),d=this._model,f;if(a.ctrl)b.extend(0),f=function(){};else{var e=b.getCaret(),m=d.getLineAtOffset(e);this._wrapMode?(d=this._getLine(m),e=d.getLineIndex(e),e=d.getLineStart(e),d.destroy()):e=d.getLineStart(m);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,f);return!0},_doLineDown:function(a){var b=this._model,d=this._getSelection(),f=d.getCaret(),e=b.getLineAtOffset(f),m=
this._getLine(e),h=this._columnX,q=1,k=!1;if(-1===h||a.wholeLine||a.select&&g.isIE)h=a.wholeLine?b.getLineEnd(e+1):f,h=m.getBoundingClientRect(h).left;(f=m.getLineIndex(f))<m.getLineCount()-1?q=m.getClientRects(f+1).top+1:(f=b.getLineCount()-1,k=e===f,a.count&&0<a.count?e=Math.min(e+a.count,f):e++);f=!1;if(k){if(a.select||g.isMac||g.isLinux)d.extend(b.getCharCount()),f=!0}else m.lineIndex!==e&&(m.destroy(),m=this._getLine(e)),d.extend(m.getOffset(h,q)),f=!0;f&&(a.select||d.collapse(),this._setSelection(d,
!0,!0));this._columnX=h;m.destroy();return!0},_doLineUp:function(a){var b=this._model,d=this._getSelection(),f=d.getCaret(),e=b.getLineAtOffset(f),m=this._getLine(e),h=this._columnX,q=!1,k;if(-1===h||a.wholeLine||a.select&&g.isIE)h=a.wholeLine?b.getLineStart(e-1):f,h=m.getBoundingClientRect(h).left;0<(f=m.getLineIndex(f))?k=m.getClientRects(f-1).top+1:(q=0===e,q||(a.count&&0<a.count?e=Math.max(e-a.count,0):e--,k=this._getLineHeight(e)-1));f=!1;if(q){if(a.select||g.isMac||g.isLinux)d.extend(0),f=!0}else m.lineIndex!==
e&&(m.destroy(),m=this._getLine(e)),d.extend(m.getOffset(h,k)),f=!0;f&&(a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=h;m.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,d=this._model,f=this._getSelection(),e=f.getCaret(),m=d.getLineAtOffset(e),h=d.getLineCount(),q=this._getScroll(),d=this._getClientHeight(),k,r;if(this._lineHeight){k=this._columnX;q=this._getBoundsAtOffset(e);if(-1===k||a.select&&g.isIE)k=q.left;e=this._getLineIndex(q.top+d);
r=this._getLine(e);m=this._getLinePixel(e);e=r.getOffset(k,q.top+d-m);d=r.getBoundingClientRect(e);r.destroy();f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){b._columnX=k},d.top+m-q.top);return!0}if(m<h-1){var l=this._getLineHeight(),u=Math.min(h-m-1,Math.floor(d/l)),u=Math.max(1,u);k=this._columnX;if(-1===k||a.select&&g.isIE)r=this._getLine(m),k=r.getBoundingClientRect(e).left,r.destroy();r=this._getLine(m+u);f.extend(r.getOffset(k,0));r.destroy();a.select||f.collapse();
a=h*l;e=q.y+u*l;e+d>a&&(e=a-d);this._setSelection(f,!0,!0,function(){b._columnX=k},e-q.y)}return!0},_doPageUp:function(a){var b=this,d=this._model,f=this._getSelection(),e=f.getCaret(),m=d.getLineAtOffset(e),h=this._getScroll(),q=this._getClientHeight(),k;if(this._lineHeight){k=this._columnX;h=this._getBoundsAtOffset(e);if(-1===k||a.select&&g.isIE)k=h.left;e=this._getLineIndex(h.bottom-q);d=this._getLine(e);m=this._getLinePixel(e);e=d.getOffset(k,h.bottom-q-m);q=d.getBoundingClientRect(e);d.destroy();
f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){b._columnX=k},q.top+m-h.top);return!0}if(0<m){var r=this._getLineHeight(),q=Math.max(1,Math.min(m,Math.floor(q/r)));k=this._columnX;if(-1===k||a.select&&g.isIE)d=this._getLine(m),k=d.getBoundingClientRect(e).left,d.destroy();d=this._getLine(m-q);f.extend(d.getOffset(k,this._getLineHeight(m-q)-1));d.destroy();a.select||f.collapse();a=Math.max(0,h.y-q*r);this._setSelection(f,!0,!0,function(){b._columnX=k},a-h.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,d=this._model,f=d.getLineCount();a=this._getClientHeight();var e=this._getLineHeight(),f=f*e,m=this._getScroll().y,g;switch(b){case "textStart":g=0;break;case "textEnd":g=f-a;break;case "pageDown":g=m+a;break;case "pageUp":g=m-a;break;case "lineDown":g=
m+e;break;case "lineUp":g=m-e;break;case "centerLine":b=this._getSelection(),g=d.getLineAtOffset(b.start),d=(d.getLineAtOffset(b.end)-g+1)*e,g=g*e-a/2+d/2}void 0!==g&&(g=Math.min(Math.max(0,g),f-a),this._scrollViewAnimated(0,g-m,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 d=b.getLineAtOffset(a),b=b.getLineStart(d);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(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),f=b.getCaret(),e=a.getLineCount(),m=a.getLineAtOffset(f),h;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)f=this._autoScrollY/this._getLineHeight(),f=0>f?Math.floor(f):Math.ceil(f),h=Math.max(0,Math.min(e-1,m+f));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)h=this._getLineIndex(d.y),m=this._getLine(m),d.x+=m.getBoundingClientRect(f,!1).left,m.destroy();
0===h&&(g.isMac||g.isLinux)?b.extend(0):h===e-1&&(g.isMac||g.isLinux)?b.extend(a.getCharCount()):(m=this._getLine(h),b.extend(m.getOffset(d.x,d.y-this._getLinePixel(h))),m.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(),d=0;if(a){a=
0;for(var f=(new Date).getTime(),e=0;d<b&&!(this._lineHeight[d]||(a++,e||(e=d),this._lineHeight[d]=this._calculateLineHeight(d)),d++,100<(new Date).getTime()-f););this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(d!==b){var m=this;this._calculateLHTimer=a.setTimeout(function(){m._calculateLHTimer=null;m._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,d=g.createElement(b,"div");d.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);e(f.style,d);d.style.position="fixed";d.style.left="-1000px";var m=g.createElement(b,"span");m.appendChild(b.createTextNode(" "));d.appendChild(m);var h=g.createElement(b,"span");h.style.fontStyle=
"italic";h.appendChild(b.createTextNode(" "));d.appendChild(h);var q=g.createElement(b,"span");q.style.fontWeight="bold";q.appendChild(b.createTextNode(" "));d.appendChild(q);f=g.createElement(b,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(b.createTextNode(" "));d.appendChild(f);a.appendChild(d);var k=d.getBoundingClientRect(),m=m.getBoundingClientRect(),h=h.getBoundingClientRect(),q=q.getBoundingClientRect(),f=f.getBoundingClientRect(),m=m.bottom-m.top,h=h.bottom-h.top,
q=q.bottom-q.top,l=f.bottom-f.top,t=0,f=0>=k.bottom-k.top,k=Math.max(1,k.bottom-k.top);h>m&&(t=1);q>h&&(t=2);l>q&&(t=3);var n;0!==t&&(n={style:{}},0!==(t&1)&&(n.style.fontStyle="italic"),0!==(t&2)&&(n.style.fontWeight="bold"));m=u(d);a.removeChild(d);l=r(this._viewDiv);d=g.createElement(b,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=l.left+"px";d.style.paddingTop=l.top+"px";d.style.paddingRight=l.right+"px";d.style.paddingBottom=l.bottom+"px";d.style.width="100px";d.style.height=
"100px";l=g.createElement(b,"div");l.style.width="100%";l.style.height="100%";d.appendChild(l);a.appendChild(d);t=d.getBoundingClientRect();h=l.getBoundingClientRect();q=0;this._singleMode||(d.style.overflow="hidden",l.style.height="200px",q=d.clientWidth,d.style.overflow="scroll",q-=d.clientWidth);a.removeChild(d);l={left:h.left-t.left,top:h.top-t.top,right:t.right-h.right,bottom:t.bottom-h.bottom};h=t=0;if(!f&&(this._wrapOffset||this._marginOffset))d=g.createElement(b,"div"),d.style.position="fixed",
d.style.left="-1000px",d.innerHTML=Array(this._wrapOffset+1+(g.isWebkit?0:1)).join(" "),a.appendChild(d),t=d.getBoundingClientRect(),t=Math.ceil(t.right-t.left),d.innerHTML=Array(this._marginOffset+1).join(" "),h=d.getBoundingClientRect(),h=Math.ceil(h.right-h.left),a.removeChild(d);return{lineHeight:k,largestFontStyle:n,lineTrim:m,viewPadding:l,scrollWidth:q,wrapWidth:t,marginWidth:h,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,d=b.getLineAtOffset(this._imeOffset),f=b.getLineStart(d),e=this._getLineNode(d);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var m=this._getDOMText(e).text,b=b.getLine(d),f=this._imeOffset-f,b=f+m.length-b.length;f!==b&&(a=m.substring(f,b))}a&&(!this._doContent(a)&&!g.isWebkit)&&(e.lineRemoved=!0,this._queueUpdate());
this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new n.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!1}))},actionDescription:{name:l.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!1}))},actionDescription:{name:l.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineStart}},
lineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(f(b,{select:!1}))},actionDescription:{name:l.pageUp}},
pageDown:{defaultHandler:function(b){return a._doPageDown(f(b,{select:!1}))},actionDescription:{name:l.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageUp"}))},actionDescription:{name:l.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageDown"}))},actionDescription:{name:l.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"lineUp"}))},actionDescription:{name:l.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(f(b,
{type:"lineDown"}))},actionDescription:{name:l.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!0}))},actionDescription:{name:l.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(f(b,
{select:!1,ctrl:!0}))},actionDescription:{name:l.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textStart"}))},actionDescription:{name:l.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textEnd"}))},actionDescription:{name:l.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(f(b,{type:"centerLine"}))},actionDescription:{name:l.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,
{select:!0}))},actionDescription:{name:l.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0}))},actionDescription:{name:l.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(f(b,
{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(f(b,
{select:!0}))},actionDescription:{name:l.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(f(b,{select:!0}))},actionDescription:{name:l.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(f(b,
{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"character"}))},actionDescription:{name:l.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"character"}))},actionDescription:{name:l.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(f(b,
{unit:"word"}))},actionDescription:{name:l.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"word"}))},actionDescription:{name:l.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"line"}))},actionDescription:{name:l.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(f(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(f(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(f(b,{type:"upper"}))},actionDescription:{name:l.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(f(b,{type:"lower"}))},actionDescription:{name:l.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(f(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:l.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(f(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 d=g.createElement(a,"div");d.className=b;d.tabIndex=-1;d.style.overflow=
"hidden";d.style.MozUserSelect="none";d.style.WebkitUserSelect="none";d.style.position="absolute";d.style.top="0px";d.style.bottom="0px";d.style.cursor="default";d.style.display="none";d.setAttribute("aria-hidden","true");this._rootDiv.appendChild(d);return d},_createRuler:function(a,b){if(this._clientDiv){var d=this._getRulerParent(a);if(d){if(d!==this._marginDiv||this._marginOffset)d.style.display="block";var f=g.createElement(d.ownerDocument,"div");f._ruler=a;f.rulerChanged=!0;f.style.position=
"relative";f.style.cssFloat="left";f.style.styleFloat="left";f.style.outline="none";if(void 0===b||0>b||b>=d.children.length)d.appendChild(f);else{for(var e=d.firstChild;e&&0<b--;)e=e.nextSibling;d.insertBefore(f,e)}}}},_createView:function(){function a(){m._rootDiv&&(m.update(!0),m._metrics.invalid&&m._getWindow().setTimeout(function(){a()},100))}if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var d=b.ownerDocument,f=g.createElement(d,"div");this._rootDiv=
f;f.tabIndex=-1;f.style.position="relative";f.style.overflow="hidden";f.style.width="100%";f.style.height="100%";f.style.overflow="hidden";f.style.WebkitTextSizeAdjust="100%";f.setAttribute("role","application");b.appendChild(f);this._leftDiv=this._createRulerParent(d,"textviewLeftRuler");b=g.createElement(d,"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";f.appendChild(b);var e=this._createRulerParent(d,"textviewRightRuler");this._rightDiv=e;e.style.right="0px";this._scrollDiv=e=g.createElement(d,"div");e.style.margin="0px";e.style.borderWidth="0px";e.style.padding="0px";b.appendChild(e);(this._marginDiv=this._createRulerParent(d,"textviewMarginRuler")).style.zIndex="4";!g.isIE&&!g.isIOS&&(this._clipDiv=b=g.createElement(d,"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",f.appendChild(b),this._clipScrollDiv=e=g.createElement(d,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",b.appendChild(e));this._setFullSelection(this._fullSelection,!0);b=g.createElement(d,"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||f).appendChild(b);if(g.isIOS||g.isAndroid)this._vScrollDiv=e=g.createElement(d,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline=
"none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",f.appendChild(e),this._hScrollDiv=e=g.createElement(d,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",f.appendChild(e);g.isFirefox&&!b.setCapture&&(this._overlayDiv=
e=g.createElement(d,"div"),e.style.position=b.style.position,e.style.borderWidth=b.style.borderWidth,e.style.margin=b.style.margin,e.style.padding=b.style.padding,e.style.cursor="text",e.style.zIndex="2",(this._clipDiv||f).appendChild(e));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(e=0;e<b.length;e++)this._createRuler(b[e]);this._update();var m=this;q(d,f,"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:b.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var d=
b.firstChild;d;){if(d._ruler===a){d._ruler=void 0;b.removeChild(d);if(0===b.children.length&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}d=d.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,d){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=d;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 d=this._model;d.getBaseModel&&(a=d.mapOffset(a),b=d.mapOffset(b),d=d.getBaseModel());return d.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();
var d=this._clientDiv.getBoundingClientRect();a.bottom>d.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 d=this._getLinePixel(b.lineIndex);a.top+=d;a.bottom+=d;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 d=this._model.getLineDelimiter(),f,e,h=this._getWindow(),q=h.clipboardData;!q&&a&&(q=a.clipboardData);if(q)return f=[],e=q.getData(g.isIE?"Text":"text/plain"),m(e,function(a){f.push(a)},function(){f.push(d)}),e=f.join(""),b&&b(e),e;if(g.isFirefox){this._ignoreFocus=!0;var k=this._clipboardDiv,q=this._rootDiv.ownerDocument;k||(this._clipboardDiv=k=g.createElement(q,"div"),k.style.position="fixed",k.style.whiteSpace="pre",
k.style.left="-1000px",this._rootDiv.appendChild(k));k.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";k.firstChild.focus();var r=this,l=function(){var a=r._getTextFromElement(k);k.innerHTML="";f=[];m(a,function(a){f.push(a)},function(){f.push(d)});return f.join("")},t=!1;this._ignorePaste=!0;if(!g.isLinux||2!==this._lastMouseButton)try{t=q.execCommand("paste",!1,null)}catch(u){t=1<k.childNodes.length||k.firstChild&&0<k.firstChild.childNodes.length}this._ignorePaste=!1;if(!t){if(a)return h.setTimeout(function(){r.focus();
(e=l())&&b&&b(e);r._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(e=l())&&b&&b(e);return e}return""},_getDOMText:function(a,b){return a._line.getText(b)},_getTextFromElement:function(a){var b=a.ownerDocument,d=b.defaultView;if(!d.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);a=d.getSelection();var d=[],f;for(f=0;f<a.rangeCount;f++)d.push(a.getRangeAt(f));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);
b=a.toString();a.removeAllRanges();for(f=0;f<d.length;f++)a.addRange(d[f]);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 s(this,a)},_getLineHeight:function(a,b){if(void 0!==a&&this._lineHeight){var d=this._lineHeight[a];if(d)return d;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(),d=-this._topIndexY+this._getScroll().y;
if(a>b)for(;b<a;b++)d+=this._getLineHeight(b);else for(b-=1;b>=a;b--)d-=this._getLineHeight(b);return d}return this._getLineHeight()*a},_getLineIndex:function(a){var b,d=0,f=this._model.getLineCount();if(this._lineHeight){var d=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<e&&0<d;)a+=this._getLineHeight(--d);else for(b=this._getLineHeight(d);a-b>=e&&d<f-1;)a-=b,b=this._getLineHeight(++d)}else b=this._getLineHeight(),d=Math.floor(a/b);return Math.max(0,Math.min(f-
1,d))},_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 d=this._getViewPadding(),
f=this._viewDiv.getBoundingClientRect();a.top<f.top+d.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=[],d=this._clientDiv,f=this._viewDiv,e=this._rootDiv,m=this._overlayDiv||d,h=d.ownerDocument,q=this._getWindow(),k=g.isIE?h:q;b.push({target:q,type:"resize",handler:function(b){return a._handleResize(b?b:q.event)}});b.push({target:d,type:"blur",handler:function(b){return a._handleBlur(b?b:q.event)}});b.push({target:d,type:"focus",handler:function(b){return a._handleFocus(b?b:q.event)}});b.push({target:f,type:"focus",handler:function(a){d.focus()}});
b.push({target:f,type:"scroll",handler:function(b){return a._handleScroll(b?b:q.event)}});b.push({target:d,type:"textInput",handler:function(b){return a._handleTextInput(b?b:q.event)}});b.push({target:d,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:q.event)}});b.push({target:d,type:"keypress",handler:function(b){return a._handleKeyPress(b?b:q.event)}});b.push({target:d,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:q.event)}});g.isIE&&b.push({target:h,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?
b:q.event)}});b.push({target:d,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:q.event)}});b.push({target:d,type:"copy",handler:function(b){return a._handleCopy(b?b:q.event)}});b.push({target:d,type:"cut",handler:function(b){return a._handleCut(b?b:q.event)}});b.push({target:d,type:"paste",handler:function(b){return a._handlePaste(b?b:q.event)}});b.push({target:h,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:q.event)}});if(g.isIOS||g.isAndroid)b.push({target:d,
type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:q.event)}}),b.push({target:d,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:q.event)}}),b.push({target:d,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:q.event)}});else{b.push({target:d,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:q.event)}});b.push({target:d,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:q.event)}});b.push({target:d,type:"mouseover",
handler:function(b){return a._handleMouseOver(b?b:q.event)}});b.push({target:d,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:q.event)}});b.push({target:k,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:q.event)}});b.push({target:k,type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:q.event)}});b.push({target:e,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:q.event)}});b.push({target:e,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?
b:q.event)}});b.push({target:m,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:q.event)}});b.push({target:m,type:"drag",handler:function(b){return a._handleDrag(b?b:q.event)}});b.push({target:m,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:q.event)}});b.push({target:m,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:q.event)}});b.push({target:m,type:"dragover",handler:function(b){return a._handleDragOver(b?b:q.event)}});b.push({target:m,type:"dragleave",
handler:function(b){return a._handleDragLeave(b?b:q.event)}});b.push({target:m,type:"drop",handler:function(b){return a._handleDrop(b?b:q.event)}});b.push({target:this._clientDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:q.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:q.event)}});if(g.isFirefox&&
(!g.isWindows||15<=g.isFirefox))(f=q.MutationObserver||q.MozMutationObserver)?(this._mutationObserver=new f(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:q.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:q.event)}}),b.push({target:this._clientDiv,type:"compositionend",handler:function(b){return a._handleCompositionEnd(b?b:q.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:q.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:q.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:q.event)}}),b.push({target:this._overlayDiv,
type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:q.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:q.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(f=0;f<b.length;f++)e=b[f],z(e.target,e.type,e.handler,e.capture)},_hookRulerEvents:function(a,b){if(a){var d=this,f=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 d._handleMouseWheel(a?a:f.event)}});b.push({target:a,type:"click",handler:function(a){d._handleRulerEvent(a?a:f.event)}});b.push({target:a,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:f.event)}});b.push({target:a,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:f.event)}});b.push({target:a,type:"mouseover",handler:function(a){d._handleRulerEvent(a?
a:f.event)}});b.push({target:a,type:"mouseout",handler:function(a){d._handleRulerEvent(a?a:f.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 p.TextModel;var d=this._defaultOptions(),
f;for(f in d)d.hasOwnProperty(f)&&(this["_"+f]=void 0!==a[f]?a[f]:d[f].value);this._keyModes=[];this._rulers=[];this._selection=new t(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,d=this._lastMouseMoveY;return{vertical:a.top<=d&&d<a.bottom&&a.right-15<=b&&b<a.right,horizontal:a.bottom-15<=d&&d<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 d=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),d.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}if(b){d=this._getSelection();d.setCaret(a.start+a.text.length);try{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!0),this._setSelection(d,!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,d=a.addedCharCount,f=a.removedCharCount,e=a.addedLineCount,m=a.removedLineCount,g=this._getSelection();g.end>b&&(g.end>b&&g.start<b+f?g.setCaret(b+d):(g.start+=d-f,g.end+=d-f),this._setSelection(g,!1,!1));b=this._model.getLineAtOffset(b);for(d=this._getLineNext();d;)f=d.lineIndex,b<=f&&f<=b+m&&(b===f&&!d.modelChangedEvent&&!d.lineRemoved?(d.modelChangedEvent=a,d.lineChanged=!0):(d.lineRemoved=!0,d.lineChanged=!1,d.modelChangedEvent=null)),f>b+
m&&(d.lineIndex=f+e-m,d._line.lineIndex=d.lineIndex),d=this._getLineNext(d);this._lineHeight&&(a=[b,m].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(b<=this._maxLineIndex&&this._maxLineIndex<=b+m)&&(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 d=a;d<b;d++)this._lineHeight[d]=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 t(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,d){var f=this._getWindow();if(d&&this._scrollAnimation){var e=this;this._animation=new B({window:f,
duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);e._scrollView(0,a);b-=a},onEnd:function(){e._animation=null;e._scrollView(a,b);d&&f.setTimeout(d,0)}});this._animation.play()}else this._scrollView(a,b),d&&f.setTimeout(d,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var d=this._viewDiv;a&&(d.scrollLeft+=a);b&&(d.scrollTop+=b)},_setClipboardText:function(a,b){var d,f=this._getWindow(),e=f.clipboardData;!e&&b&&(e=b.clipboardData);if(e&&(d=[],m(a,function(a){d.push(a)},
function(){d.push(g.platformDelimiter)}),e.setData(g.isIE?"Text":"text/plain",d.join(""))||21<g.isFirefox))return!0;var h=this._parent.ownerDocument,q=g.createElement(h,"pre");q.style.position="fixed";q.style.left="-1000px";m(a,function(a){q.appendChild(h.createTextNode(a))},function(){q.appendChild(g.createElement(h,"br"))});q.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(q);e=h.createRange();e.setStart(q.firstChild,0);e.setEndBefore(q.lastChild);var k=f.getSelection();0<k.rangeCount&&
k.removeAllRanges();k.addRange(e);var r=this,e=function(){q&&q.parentNode===r._clientDiv&&r._clientDiv.removeChild(q);r._updateDOMSelection()},k=!1;this._ignoreCopy=!0;try{k=h.execCommand("copy",!1,null)}catch(l){}this._ignoreCopy=!1;if(!k&&b)return f.setTimeout(e,0),!1;e();return!0},_setDOMSelection:function(a,b,d,f,e){this._setDOMFullSelection(a,b,d,f);a=a._line.getNodeOffset(b);d=d._line.getNodeOffset(f);f=this._getWindow();b=this._parent.ownerDocument;if(f.getSelection){var m=f.getSelection();
f=b.createRange();f.setStart(a.node,a.offset);f.setEnd(d.node,d.offset);if(this._hasFocus&&(m.anchorNode!==a.node||m.anchorOffset!==a.offset||m.focusNode!==d.node||m.focusOffset!==d.offset||m.anchorNode!==d.node||m.anchorOffset!==d.offset||m.focusNode!==a.node||m.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=d.node,this._focusOffset=d.offset,this._ignoreSelect=!1,0<m.rangeCount&&m.removeAllRanges(),m.addRange(f),this._ignoreSelect=!0;this._cursorDiv&&
(f=b.createRange(),e?(f.setStart(a.node,a.offset),f.setEnd(a.node,a.offset)):(f.setStart(d.node,d.offset),f.setEnd(d.node,d.offset)),e=f.getClientRects()[0],a=this._cursorDiv.parentNode,d=a.getBoundingClientRect(),e&&d&&(this._cursorDiv.style.top=e.top-d.top+a.scrollTop+"px",this._cursorDiv.style.left=e.left-d.left+a.scrollLeft+"px"))}else b.selection&&this._hasFocus&&(e=b.body,f=g.createElement(b,"div"),e.appendChild(f),e.removeChild(f),f=e.createTextRange(),f.moveToElementText(a.node.parentNode),
f.moveStart("character",a.offset),e=e.createTextRange(),e.moveToElementText(d.node.parentNode),e.moveStart("character",d.offset),f.setEndPoint("EndToStart",e),this._ignoreSelect=!1,f.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,b,d,f){if(this._selDiv1){var e=this._selDiv1;e.style.width="0px";e.style.height="0px";e=this._selDiv2;e.style.width="0px";e.style.height="0px";e=this._selDiv3;e.style.width="0px";e.style.height="0px";if(!(a===d&&b===f)){var m=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),
h=this._viewDiv.getBoundingClientRect(),e=h.left+m.left,q=g.right,m=h.top+m.top,k=g.bottom,h=g=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),g=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),g=h.left);h=h.top;this._ignoreDOMSelection=!0;var r=(new s(this,a.lineIndex,a)).getBoundingClientRect(b,!1),l=r.left;b=(new s(this,d.lineIndex,d)).getBoundingClientRect(f,!1);var t=b.left;this._ignoreDOMSelection=!1;var u=this._selDiv1,l=Math.min(q,Math.max(e,l)),n=Math.min(k,
Math.max(m,r.top)),w=q;f=Math.min(k,Math.max(m,r.bottom));u.style.left=l-g+"px";u.style.top=n-h+"px";u.style.width=Math.max(0,w-l)+"px";u.style.height=Math.max(0,f-n)+"px";a.lineIndex===d.lineIndex?(w=Math.min(t,q),u.style.width=Math.max(0,w-l)+"px"):(r=Math.min(k,Math.max(m,b.top)),t=Math.min(q,Math.max(e,t)),m=Math.min(k,Math.max(m,b.bottom)),k=this._selDiv3,k.style.left=e-g+"px",k.style.top=r-h+"px",k.style.width=Math.max(0,t-e)+"px",k.style.height=Math.max(0,m-r)+"px",1<Math.abs(a.lineIndex-d.lineIndex)&&
(a=this._selDiv2,a.style.left=e-g+"px",a.style.top=f-h+"px",a.style.width=Math.max(0,q-e)+"px",a.style.height=Math.max(0,r-f)+"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,d,f,e){if(a){this._columnX=-1;void 0===d&&(d=!0);var m=this._selection;this._selection=a;!1!==b&&this._showCaret(!1,f,b,e);d&&this._updateDOMSelection();if(!m.equals(a))this.onSelection({type:"Selection",oldValue:{start:m.start,end:m.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,
b,d,f){var e=this._model,m=this._getSelection();b=this.convert({x:a,y:b},"page","document");a=this._getLineIndex(b.y);if(1===this._clickCount){e=this._getLine(a);a=e.getOffset(b.x,b.y-this._getLinePixel(a));e.destroy();if(f&&!d&&m.start<=a&&a<m.end)return this._dragOffset=a,!1;m.extend(a);d||m.collapse()}else 0===(this._clickCount&1)?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(d=this._doubleClickSelection.start,f=
e.getNextOffset(a,{unit:"wordend",count:1})):(d=e.getNextOffset(a,{unit:"word",count:-1}),f=this._doubleClickSelection.end):(d=e.getNextOffset(a,{unit:"word",count:-1}),f=e.getNextOffset(d,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(f=e.getLineAtOffset(this._doubleClickSelection.start),a>=f?(d=e.getLineStart(f),f=e.getLineEnd(a)):(d=e.getLineStart(a),f=e.getLineEnd(f))):(d=e.getLineStart(a),f=e.getLineEnd(a)),m.setCaret(d),m.extend(f);this._setSelection(m,!0,!0);return!0},
_setFullSelection:function(a,b){this._fullSelection=a;g.isWebkit&&(this._fullSelection=!0);var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!g.isIOS){var f=d.ownerDocument;this._highlightRGB=g.isWebkit?"transparent":"Highlight";var e=g.createElement(f,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width=
"0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);var m=g.createElement(f,"div");this._selDiv2=m;m.style.position="absolute";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.outline="none";m.style.background=this._highlightRGB;m.style.width="0px";m.style.height="0px";m.style.zIndex="0";d.appendChild(m);this._selDiv3=f=g.createElement(f,"div");f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";
f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);if(g.isFirefox&&g.isMac){d=this._getWindow().getComputedStyle(f,null).getPropertyValue("background-color");switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;
case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;e.style.background=d;m.style.background=d;f.style.background=d}b||this._updateDOMSelection()}}else this._selDiv1&&(d.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(d.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(d.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 d=this._clientDiv;g.isOpera?d&&(d.style.OTabSize=this._tabSize+""):537.1<=g.isWebkit?d&&(d.style.tabSize=this._tabSize+""):4<=g.isFirefox?d&&(d.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 d="textview",f=this._theme.getThemeClass();f&&(d+=" "+f);this._themeClass&&f!==this._themeClass&&(d+=" "+this._themeClass);this._rootDiv.className=d;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var d=this._clientDiv;this._wrapMode?(d.style.whiteSpace=
"pre-wrap",d.style.wordWrap="break-word"):(d.style.whiteSpace="pre",d.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,d,f){if(this._clientDiv&&!(0<this._redrawCount)&&!this._ignoreDOMSelection){var e=this._model,m=this._getSelection(),g=this._getScroll(),h=m.getCaret(),q=m.start,k=m.end,r=e.getLineAtOffset(q),l=e.getLineAtOffset(k),t=Math.max(Math.max(q,e.getLineStart(l)),k-1),e=this._getClientWidth(),u=this._getClientHeight(),
n=e/4,w=this._getBoundsAtOffset(h===q?q:t),s=w.left,p=w.right,x=w.top,z=w.bottom,y=0,B="object"===typeof d;if((a||B)&&!m.isEmpty())w=this._getBoundsAtOffset(h===k?q:t),y=(w.bottom>z?w.bottom:z)-(w.top<x?w.top:x),a&&(w.top===x?h===q?p=s+Math.min(w.right-s,e):s=p-Math.min(p-w.left,e):h===q?z=x+Math.min(w.bottom-x,u):x=z-Math.min(z-w.top,u));a=0;s<g.x&&(a=Math.min(s-g.x,-n));p>g.x+e&&(a=Math.max(p-g.x-e,n));m=0;x<g.y?m=x-g.y:z>g.y+u&&(m=z-g.y-u);f&&(0<f?0<m&&(m=Math.max(m,f)):0>m&&(m=Math.min(m,f)));
f=B&&"always"===d.scrollPolicy;if(0!==a||0!==m||f)return B?(f=0<m,0===m&&(m=x-g.y),g=d.viewAnchor,x=d.selectionAnchor,d=Math.min(Math.max(0,d.viewAnchorOffset||0)),m="top"===g?m+Math.floor(f?(1-d)*u:-d*u):"bottom"===g?m+Math.floor(f?d*u:-(1-d)*u):"center"===g?m+Math.floor(f?u/2+d*u:u/2-(1-d)*u):m+Math.floor(f?d*u:-d*u),r!==l&&("top"===x&&h!==q?m+=Math.floor(-y):"bottom"===x&&h!==k?m+=Math.floor(y):"center"===x&&(m+=Math.floor(y/2)))):0!==m&&"number"===typeof d&&(0>d&&(d=0),1<d&&(d=1),m+=Math.floor(0<
m?d*u:-d*u)),this._scrollViewAnimated(a,m,b),u!==this._getClientHeight()||e!==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];y(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,d=b.getLineAtOffset(a.start),f=b.getLineAtOffset(a.end),
e=this._getLineNext();if(e){var m=this._getLinePrevious(),g;d<e.lineIndex?(d=e,g=b.getLineStart(e.lineIndex)):d>m.lineIndex?(d=m,g=b.getLineStart(m.lineIndex)):(d=this._getLineNode(d),g=a.start);f<e.lineIndex?(f=e,b=b.getLineStart(e.lineIndex)):f>m.lineIndex?(f=m,b=b.getLineStart(m.lineIndex)):(f=this._getLineNode(f),b=a.end);this._setDOMSelection(d,g,f,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,d=this._viewDiv;if(b){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var f=this._model,e=this._getScroll(!1),m=this._getViewPadding(),h=f.getLineCount(),q=this._getLineHeight(),k=!1,r=!1,l=!1,u=this._metrics.scrollWidth;this._wrapMode&&(b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var t,n,w,p,x=0,z=0,y;if(this._lineHeight){for(;z<h;){y=this._getLineHeight(z);if(x+y>e.y)break;x+=y;z++}t=z;
n=Math.max(0,t-1);w=f=e.y-x;0<t&&(f+=this._getLineHeight(t-1))}else p=Math.max(0,e.y)/q,t=Math.floor(p),n=Math.max(0,t-1),f=Math.round((p-n)*q),w=Math.round((p-t)*q);this._topIndexY=w;p=this._rootDiv;var B=p.clientWidth,K=p.clientHeight;if(a){q=0;this._leftDiv&&(t=this._leftDiv.getBoundingClientRect(),q=t.right-t.left);t=this._getClientWidth();p=this._getClientHeight();r=t;this._wrapMode?this._metrics.wrapWidth&&(r=this._metrics.wrapWidth):r=Math.max(this._maxLineWidth,r);for(;z<h;)y=this._getLineHeight(z,
!1),x+=y,z++;h=x}else{p=this._getClientHeight();w=Math.min(t+Math.floor((p+w)/q),h-1);var e=Math.min(w+1,h-1),O;for(y=b.firstChild;y;){O=y.lineIndex;var P=y.nextSibling;if(!(n<=O&&O<=e)||y.lineRemoved||-1===y.lineIndex)this._mouseWheelLine===y?(y.style.display="none",y.lineIndex=-1):b.removeChild(y);y=P}y=this._getLineNext();var P=d.ownerDocument,R=P.createDocumentFragment();for(O=n;O<=e;O++)!y||y.lineIndex>O?(new s(this,O)).create(R,null):(R.firstChild&&(b.insertBefore(R,y),R=P.createDocumentFragment()),
y&&y.lineChanged&&(y=(new s(this,O)).create(R,y),y.lineChanged=!1),y=this._getLineNext(y));R.firstChild&&b.insertBefore(R,y);g.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");y=this._getLineNext();O=p+f;for(R=!1;y;)n=y.lineWidth,void 0===n&&(P=y._line.getBoundingClientRect(),n=y.lineWidth=Math.ceil(P.right-P.left),P=P.bottom-P.top,this._lineHeight?this._lineHeight[y.lineIndex]=P:0!==q&&(0!==P&&Math.ceil(q)!==Math.ceil(P))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=
P)),this._lineHeight&&!R&&(O-=this._lineHeight[y.lineIndex],0>O&&(w=y.lineIndex,R=!0)),this._wrapMode||(n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=y.lineIndex),this._checkMaxLineIndex===y.lineIndex&&(this._checkMaxLineIndex=-1)),y.lineIndex===t&&(this._topChild=y),y.lineIndex===w&&(this._bottomChild=y),y=this._getLineNext(y);-1!==this._checkMaxLineIndex&&(O=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=O&&O<h&&(q=new s(this,O),P=q.getBoundingClientRect(),n=P.right-P.left,
n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=O),q.destroy()));for(;z<h;)y=this._getLineHeight(z,z<=w),x+=y,z++;h=x;this._updateRuler(this._leftDiv,t,e,K);this._updateRuler(this._rightDiv,t,e,K);this._updateRuler(this._marginDiv,t,e,K);q=0;this._leftDiv&&(t=this._leftDiv.getBoundingClientRect(),q=t.right-t.left);e=0;this._rightDiv&&(e=this._rightDiv.getBoundingClientRect(),e=e.right-e.left);d.style.left=q+"px";d.style.right=e+"px";e=this._scrollDiv;e.style.height=h+"px";t=this._getClientWidth();
!this._singleMode&&!this._wrapMode&&(x=k=p,(z="scroll"===d.style.overflowX)?k+=u:x-=u,y=w=t,(n="scroll"===d.style.overflowY)?w+=u:y-=u,p=k,t=w,h>p&&(l=!0,t=y),this._maxLineWidth>t&&(r=!0,p=x,h>p&&(l=!0,t=y)),z!==r&&(d.style.overflowX=r?"scroll":"hidden"),n!==l&&(d.style.overflowY=l?"scroll":"hidden"),k=z!==r||n!==l);l=t;this._wrapMode?this._metrics.wrapWidth&&(l=this._metrics.wrapWidth):l=Math.max(this._maxLineWidth,l);r=l;if((!g.isIE||9<=g.isIE)&&this._maxLineWidth>t)l+=m.right+m.left;e.style.width=
l+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=l+"px");e=this._getScroll(!1)}this._vScrollDiv&&(l=p-8,x=Math.max(15,Math.ceil(Math.min(1,l/(h+m.top+m.bottom))*l)),this._vScrollDiv.style.left=q+t-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,e.y*l/h))+"px",this._vScrollDiv.style.height=x+"px");!this._wrapMode&&this._hScrollDiv&&(l=t-8,x=Math.max(15,Math.ceil(Math.min(1,l/(this._maxLineWidth+m.left+m.right))*l)),this._hScrollDiv.style.left=q+Math.floor(Math.max(0,Math.floor(e.x*
l/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=p-9+"px",this._hScrollDiv.style.width=x+"px");z=e.x;x=this._clipDiv;l=this._overlayDiv;if(w=this._marginDiv)w.style.left=-z+q+this._metrics.marginWidth+m.left+"px",w.style.bottom=("scroll"===d.style.overflowX?u:0)+"px";x?(x.scrollLeft=z,x.scrollTop=0,d=q+m.left,u=m.top,a=t,q=p,z=0,w=-f,0===e.x&&(d-=m.left,a+=m.left,z=m.left),e.x+t===r&&(a+=m.right),0===e.y&&(u-=m.top,q+=m.top,w+=m.top),e.y+p===h&&(q+=m.bottom),x.style.left=d+"px",x.style.top=
u+"px",x.style.right=B-a-d+"px",x.style.bottom=K-q-u+"px",b.style.left=z+"px",b.style.top=w+"px",b.style.width=r+"px",b.style.height=p+f+"px",l&&(l.style.left=b.style.left,l.style.top=b.style.top,l.style.width=b.style.width,l.style.height=b.style.height)):(d=z,u=f,B=z+t,K=f+p,0===d&&(d-=m.left),0===u&&(u-=m.top),B===r&&(B+=m.right),e.y+p===h&&(K+=m.bottom),b.style.clip="rect("+u+"px,"+B+"px,"+K+"px,"+d+"px)",b.style.left=-z+q+m.left+"px",b.style.width=(this._wrapMode||g.isWebkit?r:t+z)+"px",a||(b.style.top=
-f+m.top+"px",b.style.height=p+f+"px"),l&&(l.style.clip=b.style.clip,l.style.left=b.style.left,l.style.width=b.style.width,a||(l.style.top=b.style.top,l.style.height=b.style.height)));this._updateDOMSelection();k&&(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,d,f){if(a){var m=
this._parent.ownerDocument,h=this._getLineHeight(),q=this._getViewPadding();for(a=a.firstChild;a;){var k=a._ruler,r=h,l=k.getOverview();"page"===l&&(r+=this._topIndexY);a.style.top=-r+"px";a.style.height=f+r+"px";a.rulerChanged&&e(k.getRulerStyle(),a);var t,u=a.firstChild;u?(t=u,u=u.nextSibling):(t=g.createElement(m,"div"),t.style.visibility="hidden",a.appendChild(t));var n;if(a.rulerChanged&&t){r=-1;if(n=k.getWidestAnnotation())e(n.style,t),n.html&&(t.innerHTML=n.html);t.lineIndex=r;t.style.height=
h+q.top+"px"}var w;if("page"===l){for(k=k.getAnnotations(b,d+1);u;)r=u.lineIndex,n=u.nextSibling,(!(b<=r&&r<=d)||u.lineChanged)&&a.removeChild(u),u=n;u=a.firstChild.nextSibling;w=m.createDocumentFragment();for(r=b;r<=d;r++)if(!u||u.lineIndex>r){t=g.createElement(m,"div");if(n=k[r])e(n.style,t),n.html&&(t.innerHTML=n.html),t.annotation=n;t.lineIndex=r;t.style.height=this._getLineHeight(r)+"px";w.appendChild(t)}else w.firstChild&&(a.insertBefore(w,u),w=m.createDocumentFragment()),u&&(u=u.nextSibling);
w.firstChild&&a.insertBefore(w,u)}else{n=this._getClientHeight();r=this._model.getLineCount();u=n+q.top+q.bottom-2*this._metrics.scrollWidth;l=h*r<u?h:u/r;if(a.rulerChanged){for(n=a.childNodes.length;1<n;)a.removeChild(a.lastChild),n--;k=k.getAnnotations(0,r);w=m.createDocumentFragment();for(var s in k)r=s>>>0,0>r||(t=g.createElement(m,"div"),n=k[s],e(n.style,t),t.style.position="absolute",t.style.top=this._metrics.scrollWidth+h+Math.floor(r*l)+"px",n.html&&(t.innerHTML=n.html),t.annotation=n,t.lineIndex=
r,w.appendChild(t));a.appendChild(w)}else if(a._oldTrackHeight!==u)for(t=a.firstChild?a.firstChild.nextSibling:null;t;)t.style.top=this._metrics.scrollWidth+h+Math.floor(t.lineIndex*l)+"px",t=t.nextSibling;a._oldTrackHeight=u}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,d=b.getElementById("_textviewStyle");if(d)d.removeChild(d.firstChild),d.appendChild(b.createTextNode(a));else{d=g.createElement(b,"style");d.id="_textviewStyle";var f=b.getElementsByTagName("head")[0]||b.documentElement;d.appendChild(b.createTextNode(a));f.insertBefore(d,f.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 d=this._viewDiv;!b.invalid&&0===b.scrollWidth?(d.style.pointerEvents="none",d.style.zIndex="2"):(d.style.pointerEvents="",d.style.zIndex="")}a||(this.redraw(),this._resetLineWidth())}};k.EventTarget.addMixin(x.prototype);return{TextView:x}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(l,p){function n(k){this._model=k;this._projections=[];var b=this;this._listener={onChanged:function(h){b._onChanged(h)},onChanging:function(h){b._onChanging(h)}};k.addEventListener("postChanged",this._listener.onChanged);k.addEventListener("preChanging",this._listener.onChanging)}n.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 b=this._model,h=this._projections;k._lineIndex=b.getLineAtOffset(k.start);k._lineCount=b.getLineAtOffset(k.end)-k._lineIndex;var g=k.text;g||(g="");k._model="string"===typeof g?new l.TextModel(g,b.getLineDelimiter()):g;var b=this.mapOffset(k.start,!0),g=k.end-k.start,e=k._lineCount,a=k._model.getCharCount(),f=k._model.getLineCount()-1,d={type:"Changing",text:k._model.getText(),
start:b,removedCharCount:g,addedCharCount:a,removedLineCount:e,addedLineCount:f};this.onChanging(d);d=this._binarySearch(h,k.start);h.splice(d,0,k);this.onChanged({type:"Changed",start:b,removedCharCount:g,addedCharCount:a,removedLineCount:e,addedLineCount:f})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(k,b){var h=this._projections,g=0,e,a;if(b){for(e=0;e<h.length;e++){a=h[e];if(a.start>k)break;if(a.end>k)return-1;g+=
a._model.getCharCount()-(a.end-a.start)}return k+g}for(e=0;e<h.length;e++){a=h[e];if(a.start>k-g)break;var f=a._model.getCharCount();if(a.start+f>k-g)return-1;g+=f-(a.end-a.start)}return k-g},removeProjection:function(k){this._removeProjection(k)},_removeProjection:function(k,b){var h,g=0;for(h=0;h<this._projections.length;h++){var e=this._projections[h];if(e===k){k=e;break}g+=e._model.getCharCount()-(e.end-e.start)}if(h<this._projections.length){var e=this._model,g=k.start+g,a=k.end-k.start,f=k._lineCount,
d=k._model.getCharCount(),m=k._model.getLineCount()-1;b||(e={type:"Changing",text:e.getText(k.start,k.end),start:g,removedCharCount:d,addedCharCount:a,removedLineCount:m,addedLineCount:f},this.onChanging(e));this._projections.splice(h,1);if(!b)this.onChanged({type:"Changed",start:g,removedCharCount:d,addedCharCount:a,removedLineCount:m,addedLineCount:f})}},_binarySearch:function(k,b){for(var h=k.length,g=-1,e;1<h-g;)e=Math.floor((h+g)/2),b<=k[e].start?h=e:g=e;return h},getCharCount:function(){for(var k=
this._model.getCharCount(),b=this._projections,h=0;h<b.length;h++)var g=b[h],k=k+(g._model.getCharCount()-(g.end-g.start));return k},getLine:function(k,b){if(0>k)return null;var h=this._model,g=this._projections,e=0,a=[],f=0,d,m,r;for(d=0;d<g.length;d++){r=g[d];if(r._lineIndex>=k-e)break;m=r._model.getLineCount()-1;if(r._lineIndex+m>=k-e){f=k-(r._lineIndex+e);if(f<m)return r._model.getLine(f,b);a.push(r._model.getLine(m))}f=r.end;e+=m-r._lineCount}for(f=Math.max(f,h.getLineStart(k-e));d<g.length;d++){r=
g[d];if(r._lineIndex>k-e)break;a.push(h.getText(f,r.start));m=r._model.getLineCount()-1;if(r._lineIndex+m>k-e)return a.push(r._model.getLine(0,b)),a.join("");a.push(r._model.getText());f=r.end;e+=m-r._lineCount}g=h.getLineEnd(k-e,b);f<g&&a.push(h.getText(f,g));return a.join("")},getLineAtOffset:function(k){for(var b=this._model,h=this._projections,g=0,e=0,a=0;a<h.length;a++){var f=h[a];if(f.start>k-g)break;var d=f._model.getCharCount();if(f.start+d>k-g){h=k-(f.start+g);e+=f._model.getLineAtOffset(h);
g+=h;break}e+=f._model.getLineCount()-1-f._lineCount;g+=d-(f.end-f.start)}return b.getLineAtOffset(k-g)+e},getLineCount:function(){for(var k=this._projections,b=this._model.getLineCount(),h=0;h<k.length;h++)var g=k[h],b=b+(g._model.getLineCount()-1-g._lineCount);return b},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(k,b){if(0>k)return-1;for(var h=this._model,g=this._projections,e=0,a=0,f=0;f<g.length;f++){var d=g[f];if(d._lineIndex>k-e)break;var m=d._model.getLineCount()-
1;if(d._lineIndex+m>k-e)return d._model.getLineEnd(k-(d._lineIndex+e),b)+d.start+a;a+=d._model.getCharCount()-(d.end-d.start);e+=m-d._lineCount}return h.getLineEnd(k-e,b)+a},getLineStart:function(k){if(0>k)return-1;for(var b=this._model,h=this._projections,g=0,e=0,a=0;a<h.length;a++){var f=h[a];if(f._lineIndex>=k-g)break;var d=f._model.getLineCount()-1;if(f._lineIndex+d>=k-g)return f._model.getLineStart(k-(f._lineIndex+g))+f.start+e;e+=f._model.getCharCount()-(f.end-f.start);g+=d-f._lineCount}return b.getLineStart(k-
g)+e},getText:function(k,b){void 0===k&&(k=0);var h=this._model,g=this._projections,e=0,a=[],f,d,m;for(f=0;f<g.length;f++){d=g[f];if(d.start>k-e)break;m=d._model.getCharCount();if(d.start+m>k-e){if(void 0!==b&&d.start+m>b-e)return d._model.getText(k-(d.start+e),b-(d.start+e));a.push(d._model.getText(k-(d.start+e)));k=d.end+e+m-(d.end-d.start)}e+=m-(d.end-d.start)}var r=k-e;if(void 0!==b){for(;f<g.length;f++){d=g[f];if(d.start>b-e)break;a.push(h.getText(r,d.start));m=d._model.getCharCount();if(d.start+
m>b-e)return a.push(d._model.getText(0,b-(d.start+e))),a.join("");a.push(d._model.getText());r=d.end;e+=m-(d.end-d.start)}a.push(h.getText(r,b-e))}else{for(;f<g.length;f++)d=g[f],a.push(h.getText(r,d.start)),a.push(d._model.getText()),r=d.end;a.push(h.getText(r))}return a.join("")},_onChanged:function(k){k=this._change;var b=k.baseStart,h=k.baseEnd,g,e,a=this._projections;for(g=0;g<a.length&&!(e=a[g],e.end>b);g++);var f=g;for(g=0;g<a.length&&!(e=a[g],e.start>=h);g++);var d=g,m=this._model,b=k.baseText.length-
(h-b);for(g=d;g<a.length;g++)e=a[g],e.start+=b,e.end+=b,e._lineIndex=m.getLineAtOffset(e.start);e=a.splice(f,d-f);for(g=0;g<e.length;g++)e[g].annotation&&e[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 b=!!this._change,h=this._change||{},g=k.start,e=g+k.removedCharCount;h.baseStart=g;h.baseEnd=
e;h.baseText=k.text;h.addedLineCount=k.addedLineCount;if(!b){this._change=h;h.text=k.text;var a=this._projections,f,d,m;k=function(b){for(f=d=0;d<a.length;d++){m=a[d];if(m.start>b)break;if(m.end>b)return-1;f+=m._model.getCharCount()-(m.end-m.start)}return b+f};h.start=k(g);-1===h.start&&(h.text=this._model.getText(m.start,g)+h.text,h.addedLineCount+=this._model.getLineAtOffset(g)-this._model.getLineAtOffset(m.start),h.start=m.start+f);h.end=k(e);-1===h.end&&(h.text+=this._model.getText(e,m.end),h.addedLineCount+=
this._model.getLineAtOffset(m.end)-this._model.getLineAtOffset(e),h.end=m.start+f)}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,b,h){function g(b){for(a=f=0;f<e.length;f++){d=e[f];if(d.start>b-a)break;var m=d._model.getCharCount();if(d.start+m>b-a)return-1;a+=m-(d.end-d.start)}return b-a}this._change={text:k||"",start:b||0,end:void 0===h?this.getCharCount():h};var e=this._projections,a,f,d,m,r;k=g(this._change.start);-1===k&&(m={projection:d,start:this._change.start-(d.start+a)},k=d.end);b=g(this._change.end);-1===b&&(r={projection:d,end:this._change.end-
(d.start+a)},b=d.start);m&&r&&m.projection===r.projection?d._model.setText(this._change.text,m.start,r.end):(this._model.setText(this._change.text,k,b),m&&(d=m.projection,d._model.setText("",m.start)),r&&(d=r.projection,d._model.setText("",0,r.end),d.start=d.end,d._lineCount=0));this._change=void 0}};p.EventTarget.addMixin(n.prototype);return{ProjectionTextModel:n}});
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,p,n,k,b,h){function g(b){this._view=b;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(b.getOptions("parent").ownerDocument)}g.getTooltip=function(b){b._tooltip||(b._tooltip=new g(b));return b._tooltip};g.prototype={_create:function(e){if(!this._tooltipDiv){var a=
this._tooltipDiv=h.createElement(e,"div");a.tabIndex=0;a.className="textviewTooltip";a.setAttribute("aria-live","assertive");a.setAttribute("aria-atomic","true");var f=this._tooltipContents=h.createElement(e,"div");a.appendChild(f);e.body.appendChild(a);var d=this;b.addEventListener(a,"mouseover",function(a){d._hideDelay&&(a=d._getWindow(),d._delayedHideTimeout&&(a.clearTimeout(d._delayedHideTimeout),d._delayedHideTimeout=null),d._hideTimeout&&(a.clearTimeout(d._hideTimeout),d._hideTimeout=null),
d._nextTarget=null)},!1);b.addEventListener(a,"mouseout",function(f){f=f.relatedTarget||f.toElement;!(f===a||d._hasFocus())&&(!f||!b.contains(a,f))&&d._hide()},!1);b.addEventListener(a,"keydown",function(a){27===a.keyCode&&d._hide()},!1);b.addEventListener(e,"mousedown",this._mouseDownHandler=function(f){d.isVisible()&&(b.contains(a,f.target||f.srcElement)||d._hide())},!0);this._view.addEventListener("Destroy",function(){d.destroy()});this._hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;
return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var e=this._tooltipDiv.parentNode;e&&e.removeChild(this._tooltipDiv);b.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var e=this._tooltipDiv;return!e?!1:b.contains(e,e.ownerDocument.activeElement)},hide:function(b){void 0===b&&(b=this._hideDelay);var a=this._getWindow();this._delayedHideTimeout&&(a.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null);var f=this;b?f._delayedHideTimeout=a.setTimeout(function(){f._delayedHideTimeout=null;f._hide();f.setTarget(f._nextTarget,0)},b):(f._hide(),f.setTarget(f._nextTarget,0))},_hide:function(){var b=this._tooltipDiv;b&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),b.style.visibility="hidden",b=this._getWindow(),this._showTimeout&&(b.clearTimeout(this._showTimeout),
this._showTimeout=null),this._delayedHideTimeout&&(b.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(b.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(b.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(b,a,f){if(this.isVisible())this._hasFocus()||(this._nextTarget=b,this.hide(f));else if(this._target=b){var d=
this;b=d._getWindow();d._showTimeout&&(b.clearTimeout(d._showTimeout),d._showTimeout=null);0===a?d.show(!0):d._showTimeout=b.setTimeout(function(){d._showTimeout=null;d.show(!0)},a?a:d._showDelay)}},show:function(b){if(this._target){var a=this._target.getTooltipInfo();if(a){var f=this._tooltipDiv,d=this._tooltipContents;f.style.left=f.style.right=f.style.width=f.style.height=d.style.width=d.style.height="auto";var m=a.contents;m instanceof Array&&(m=this._getAnnotationContents(m));if("string"===typeof m)d.innerHTML=
m;else if(this._isNode(m))d.appendChild(m);else if(m instanceof k.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=d;var q=h.themeClass;q?((q=q.replace("tooltipTheme",""))&&(q=" "+q),q="tooltipTheme"+q):q="tooltipTheme";h.themeClass=q;h=this._contentsView=new p.TextView(h);h.addEventListener("LineStyle",function(a){g.onLineStyle(a)});h.setModel(m);m=h.computeSize();d.style.width=m.width+"px";d.style.height=m.height+"px";h.resize()}else return;d=f.ownerDocument.documentElement;
"right"===a.anchor?(m=d.clientWidth-a.x,f.style.right=m+"px"):(m=parseInt(this._getNodeStyle(f,"padding-left","0"),10),m+=parseInt(this._getNodeStyle(f,"border-left-width","0"),10),m=a.x-m,f.style.left=m+"px");f.style.maxWidth=d.clientWidth-m-10+"px";m=parseInt(this._getNodeStyle(f,"padding-top","0"),10);m+=parseInt(this._getNodeStyle(f,"border-top-width","0"),10);m=a.y-m;f.style.top=m+"px";f.style.maxHeight=d.clientHeight-m-10+"px";f.style.opacity="1";f.style.visibility="visible";if(b){var l=this,
n=this._getWindow();l._hideTimeout=n.setTimeout(function(){l._hideTimeout=null;var a=parseFloat(l._getNodeStyle(f,"opacity","1"));l._fadeTimeout=n.setInterval(function(){"visible"===f.style.visibility&&0<a?(a-=0.1,f.style.opacity=a):l._hide()},l._fadeDelay/10)},l._autoHideDelay)}}}},_getAnnotationContents:function(e){function a(a,b){var d=p.getLineStart(p.getLineAtOffset(a)),f=p.getLineEnd(p.getLineAtOffset(b),!0);return p.getText(d,f)}function f(d){var f=d.title,e=h.createElement(q,"div");e.className=
"tooltipRow";d.html&&(e.innerHTML=d.html,e.lastChild&&b.addEventListener(e.lastChild,"click",function(a){a=d.start;var b=d.end;n.getBaseModel&&(a=n.mapOffset(a,!0),b=n.mapOffset(b,!0));t.setSelection(a,b,1/3,function(){u._hide()})},!1),e.appendChild(q.createTextNode("\u00a0")));f||(f=a(d.start,d.end));"function"===typeof f&&(f=d.title());if("string"===typeof f){var m=h.createElement(q,"span");m.appendChild(q.createTextNode(f));f=m}e.appendChild(f);return e}for(var d,m=[],g=0;g<e.length;g++)d=e[g],
""!==d.title&&!d.groupAnnotation&&m.push(d);e=m;if(0===e.length)return null;var u=this,q=this._tooltipDiv.ownerDocument,t=this._view,n=t.getModel(),p=n.getBaseModel?n.getBaseModel():n;if(1===e.length){d=e[0];if(void 0!==d.title)return d=f(d),d.firstChild&&((e=d.firstChild.className)&&(e+=" "),d.firstChild.className=e+"single"),d;e=new k.ProjectionTextModel(p);m=p.getLineStart(p.getLineAtOffset(d.start));g=p.getCharCount();d.end!==g&&e.addProjection({start:d.end,end:g});0<m&&e.addProjection({start:0,
end:m});return e}m=h.createElement(q,"div");d=h.createElement(q,"em");d.appendChild(q.createTextNode(l.multipleAnnotations));m.appendChild(d);for(g=0;g<e.length;g++)d=e[g],(d=f(d))&&m.appendChild(d);return m},_getNodeStyle:function(b,a,f){var d;if(b&&(d=b.style[a],!d))if(b.currentStyle){for(d=0;-1!==(d=a.indexOf("-",d));)a=a.substring(0,d)+a.substring(d+1,d+2).toUpperCase()+a.substring(d+2);d=b.currentStyle[a]}else d=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(a):null;
return d||f},_isNode:function(b){return"object"===typeof Node?b instanceof Node:b&&"object"===typeof b&&"number"===typeof b.nodeType&&"string"===typeof b.nodeName}};return{Tooltip:g}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(l,p){function n(){}function k(a,b,f){this.start=a;this.end=b;this._projectionModel=f;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function b(a,b){var f=a.lastIndexOf("."),f=a.substring(f+1),e={title:l[f],style:{styleClass:"annotation "+f},html:"\x3cdiv class\x3d'annotationHTML "+f+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+f}};b?e.lineStyle=
{styleClass:"annotationLine "+f}:e.rangeStyle={styleClass:"annotationRange "+f};n.registerType(a,e)}function h(){}function g(a,b,f,e,g){var h;void 0===e&&(e=-1);void 0===g&&(g=a.length);for(;1<g-e;)if(h=Math.floor((g+e)/2),b<=a[h].start)g=h;else if(f&&b<a[h].end){g=h;break}else e=h;return g}function e(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function a(a,b){this._view=a;this._annotationModel=b;var f=this;this._listener={onDestroy:function(a){f._onDestroy(a)},
onLineStyle:function(a){f._onLineStyle(a)},onChanged:function(a){f._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);b.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 b=a.getBaseModel();this._projection={annotation:this,start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.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 b=
this._annotationModel.getAnnotations(this.start,this.end);b.hasNext();){var f=b.next();f!==this&&f.type===n.ANNOTATION_FOLDING&&a.call(this,f)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};n.ANNOTATION_ERROR="orion.annotation.error";n.ANNOTATION_WARNING="orion.annotation.warning";n.ANNOTATION_TASK="orion.annotation.task";n.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";n.ANNOTATION_BOOKMARK="orion.annotation.bookmark";
n.ANNOTATION_FOLDING="orion.annotation.folding";n.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";n.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";n.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";n.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";n.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";n.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";n.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";n.ANNOTATION_SELECTED_LINKED_GROUP=
"orion.annotation.selectedLinkedGroup";n.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";n.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";n.ANNOTATION_BLAME="orion.annotation.blame";n.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var f={};n.registerType=function(a,b){var e=b;"function"!==typeof e&&(e=function(a,b,d){this.start=a;this.end=b;void 0!==d&&(this.title=d)},e.prototype=b);e.prototype.type=a;f[a]=e;return a};n.createAnnotation=function(a,b,f,e){return new (this.getType(a))(b,
f,e)};n.getType=function(a){return f[a]};b(n.ANNOTATION_ERROR);b(n.ANNOTATION_WARNING);b(n.ANNOTATION_TASK);b(n.ANNOTATION_BREAKPOINT);b(n.ANNOTATION_BOOKMARK);b(n.ANNOTATION_CURRENT_BRACKET);b(n.ANNOTATION_MATCHING_BRACKET);b(n.ANNOTATION_CURRENT_SEARCH);b(n.ANNOTATION_MATCHING_SEARCH);b(n.ANNOTATION_READ_OCCURRENCE);b(n.ANNOTATION_WRITE_OCCURRENCE);b(n.ANNOTATION_SELECTED_LINKED_GROUP);b(n.ANNOTATION_CURRENT_LINKED_GROUP);b(n.ANNOTATION_LINKED_GROUP);b(n.ANNOTATION_CURRENT_LINE,!0);b(n.ANNOTATION_BLAME,
!0);b(n.ANNOTATION_CURRENT_BLAME,!0);n.registerType(n.ANNOTATION_FOLDING,k);h.addMixin=function(a){var b=h.prototype,f;for(f in b)b.hasOwnProperty(f)&&(a[f]=b[f])};h.prototype={addAnnotationType:function(a,b){this._annotationTypes||(this._annotationTypes=[]);var f=b-1;void 0==b||!(0<=f&&f<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(f,0,a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===
a)return b+1;return 0},getAnnotationsByType:function(a,b,f){a=a.getAnnotations(b,f);for(f=[];a.hasNext();)b=a.next(),0!==this.getAnnotationTypePriority(b.type)&&f.push(b);var e=this;f.sort(function(a,b){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(b.type)});return f},isAnnotationTypeVisible:function(a){return 0!==this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===
a){this._annotationTypes.splice(b,1);break}}};e.prototype={addAnnotation:function(a){if(a){var b=this._annotations,f=g(b,a.start);b.splice(f,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var f=this._annotations,e,g=0,h;h=void 0===a&&void 0===b?function(){return g<f.length?f[g++]:null}:function(){for(;g<f.length;){var e=f[g++];if(a===e.start||(a>e.start?a<e.end:e.start<b))return e;
if(e.start>=b)break}return null};e=h();return{next:function(){var a=e;a&&(e=h());return a},hasNext:function(){return null!==e}}},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 b=this._annotations,f,e;if(a){f=[];for(e=b.length-1;0<=e;e--){var g=b[e];g.type===a&&(b.splice(e,1),f.splice(0,0,g),g._annotationModel=null)}}else f=b;this.onChanged({type:"Changed",
removed:f,added:[],changed:[]})},removeAnnotation:function(a){if(a){var b=this._getAnnotationIndex(a);0>b||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,b){var f=this._annotations,e,h,k,l=[];if(a)for(e=a.length-1;0<=e;e--)k=a[e],h=this._getAnnotationIndex(k),0>h||(k._annotationModel=null,f.splice(h,1),l.splice(0,0,k));b||(b=[]);for(e=0;e<b.length;e++)k=b[e],h=g(f,k.start),k._annotationModel=
this,f.splice(h,0,k);this.onChanged({type:"Changed",removed:l,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_getAnnotationIndex:function(a){for(var b=this._annotations,f=g(b,a.start);f<b.length&&b[f].start===a.start;){if(b[f]===a)return f;f++}return-1},_onChanged:function(a){var b=a.start,f=a.addedCharCount,e=a.removedCharCount,g=this._annotations,
h=b+e;if(0<g.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};f-=e;for(e=0;e<g.length;e++){var k=g[e];k.start>=h?(k._oldStart=k.start,k._oldEnd=k.end,k.start+=f,k.end+=f,a.changed.push(k)):k.end<=b||(k.start<b&&h<k.end?(k._oldStart=k.start,k._oldEnd=k.end,k.end+=f,a.changed.push(k)):(g.splice(e,1),a.removed.push(k),k._annotationModel=null,k.expand&&k.expand(),e--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};p.EventTarget.addMixin(e.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,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+(" "+b.styleClass):b.styleClass;var f;b.tagName&&!a.tagName&&(a.tagName=b.tagName);if(b.style)for(f in a.style||
(a.style={}),b.style)a.style[f]||(a.style[f]=b.style[f]);if(b.attributes)for(f in a.attributes||(a.attributes={}),b.attributes)a.attributes[f]||(a.attributes[f]=b.attributes[f])}return a},_mergeStyleRanges:function(a,b){a||(a=[]);for(var f,e=g(a,b.start,!0);e<a.length&&b;e++){var h=a[e];if(b.end<=h.start)break;if(!(b.start>=h.end)){f=this._mergeStyle({},h.style);f=this._mergeStyle(f,b.style);var k=[];k.push(e,1);b.start<h.start&&k.push({start:b.start,end:h.start,style:b.style});b.start>h.start&&k.push({start:h.start,
end:b.start,style:h.style});k.push({start:Math.max(h.start,b.start),end:Math.min(h.end,b.end),style:f});b.end<h.end&&k.push({start:b.end,end:h.end,style:h.style});b=b.end>h.end?{start:h.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,k)}}b&&(f=this._mergeStyle({},b.style),a.splice(e,0,{start:b.start,end:b.end,style:f}));return a},_onAnnotationModelChanged:function(a){function b(a,d){h.getBaseModel&&(a=h.mapOffset(a,!0),d=h.mapOffset(d,!0));-1!==a&&-1!==d&&e.redrawRange(a,d)}function f(a,
d){for(var e=0;e<a.length;e++)if(g.isAnnotationTypeVisible(a[e].type)){var h=a[e];b(h.start,h.end);d&&(void 0!==h._oldStart&&h._oldEnd)&&b(h._oldStart,h._oldEnd)}}var e=this._view;if(e){var g=this,h=e.getModel();f(a.added);f(a.removed);f(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,f=a.textView.getModel(),e=b.getTextModel(),g=a.lineStart,h=a.lineStart+a.lineText.length;e!==f&&(g=f.mapOffset(g),h=f.mapOffset(h));for(b=b.getAnnotations(g,
h);b.hasNext();)if(g=b.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var h=g.start,k=g.end;e!==f&&(h=f.mapOffset(h,!0),k=f.mapOffset(k,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:k,style:g.rangeStyle})}g.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,g.lineStyle))}}};h.addMixin(a.prototype);return{FoldingAnnotation:k,AnnotationType:n,AnnotationTypeList:h,AnnotationModel:e,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,p,n,k,b,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 e(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,e){this._statusReporter&&this._statusReporter(a,b,e)},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,e,g){this._title=a;g||(b?this.reportStatus(b,"error"):null!==e&&(void 0!==e&&"string"===typeof e)&&this._setModelText(e),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:e,contentsSaved:g})},setText:function(a,b,e){this.getModel().setText(a,b,e)},uninstall:function(){this.installed=!1}};p.EventTarget.addMixin(g.prototype);e.prototype=new g;
b.mixin(e.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 e=this._textView;a?e.addRuler(this._annotationRuler,0):e.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=
a,this._foldingRuler){var e=this._textView;e.getModel().getBaseModel&&(a?e.addRuler(this._foldingRuler):e.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var e=this._textView;a?e.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):e.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=
a,this._overviewRuler){var e=this._textView;a?e.addRuler(this._overviewRuler):e.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var e=this._textView.getModel();e.getBaseModel&&(a=e.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(b){var d=this._textView.getModel(),e=this._annotationModel;if(e&&d.getBaseModel)for(b=e.getAnnotations(b,b+1);b.hasNext();)d=b.next(),d.type===a.ANNOTATION_FOLDING&&d.expand&&d.expand()},setCaretOffset:function(a,b,e){var g=this._textView,h=g.getModel();h.getBaseModel&&(this._expandOffset(a),a=h.mapOffset(a,!0));g.setCaretOffset(a,b,e)},setText:function(a,b,e){var g=this._textView,
h=g.getModel();h.getBaseModel&&(void 0!==b&&(this._expandOffset(b),b=h.mapOffset(b,!0)),void 0!==e&&(this._expandOffset(e),e=h.mapOffset(e,!0)));g.setText(a,b,e)},setSelection:function(a,b,e,g){var h=this._textView,q=h.getModel();q.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=q.mapOffset(a,!0),b=q.mapOffset(b,!0));h.setSelection(a,b,e,g)},moveSelection:function(a,b,e,g){var h=this._textView;this.setSelection(a,b||a,1/3,function(){(void 0===g||g)&&h.focus();e&&e()})},_getTooltipInfo:function(a,
b){var e=this._textView,g=this.getAnnotationModel();if(!g)return null;var h=this._annotationStyler;if(!h)return null;var q=e.getOffsetAtLocation(a,b);if(-1===q)return null;q=this.mapOffset(q);h=h.getAnnotationsByType(g,q,q+1);g=[];for(q=0;q<h.length;q++)h[q].rangeStyle&&g.push(h[q]);if(0===g.length)return null;e=e.convert({x:a,y:b},"document","page");return{contents:g,anchor:"left",x:e.x+10,y:e.y+20}},_highlightCurrentLine:function(b,d){var e=this._annotationModel;if(e){var g=this._textView;if(!g.getOptions("singleMode")){var h=
g.getModel(),q=d?h.getLineAtOffset(d.start):-1,k=h.getLineAtOffset(b.start),g=b.start===b.end,l=!d||d.start===d.end,n=h.getLineStart(k),p=h.getLineEnd(k);h.getBaseModel&&(n=h.mapOffset(n),p=h.mapOffset(p));h=this._currentLineAnnotation;if(!(q===k&&l&&g&&h&&h.start===n&&h.end===p)){var q=h?[h]:null,z;g&&(h=a.createAnnotation(a.ANNOTATION_CURRENT_LINE,n,p),z=[h]);this._currentLineAnnotation=h;e.replaceAnnotations(q,z)}}}},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 b=this,d=this._textView,e=this;this._listener={onModelChanged:function(a){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var b=
n.Tooltip.getTooltip(d);b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY)&&(e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,b.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var b=n.Tooltip.getTooltip(d);b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY)&&(e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,
b.setTarget(null))},onScroll:function(a){(a=n.Tooltip.getTooltip(d))&&a.setTarget(null,0,0)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,a.oldValue)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("MouseOver",this._listener.onMouseOver);d.addEventListener("MouseOut",this._listener.onMouseOut);d.addEventListener("MouseMove",this._listener.onMouseMove);d.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var h;if(h="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(b,this._undoStack,this._contentAssist))this._textActions=h.textActions,this._linkedMode=h.linkedMode,this._sourceCodeActions=h.sourceCodeActions}h=function(d,e){if(void 0!==d&&-1!==d){for(var m=this.getView().getModel(),g=this.getAnnotationModel(),h=b.mapOffset(m.getLineStart(d)),
m=b.mapOffset(m.getLineEnd(d)),q=g.getAnnotations(h,m),k=null;q.hasNext();){var l=q.next();if(l.type===a.ANNOTATION_BOOKMARK){k=l;break}}k?g.removeAnnotation(k):(k=a.createAnnotation(a.ANNOTATION_BOOKMARK,h,m),k.title=void 0,g.addAnnotation(k))}};if(this._annotationFactory){var k=d.getModel();k.getBaseModel&&(k=k.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(k))if(k=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))k.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),
k.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_LINE),k.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_SELECTED_LINKED_GROUP),k.addAnnotationType(a.ANNOTATION_CURRENT_LINKED_GROUP),k.addAnnotationType(a.ANNOTATION_LINKED_GROUP),
k.addAnnotationType("orion.annotation.highlightError");var k=this._annotationFactory.createAnnotationRulers(this._annotationModel),q=this._annotationRuler=k.annotationRuler;q&&(q.onDblClick=h,q.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),q.addAnnotationType(a.ANNOTATION_ERROR),q.addAnnotationType(a.ANNOTATION_WARNING),q.addAnnotationType(a.ANNOTATION_TASK),q.addAnnotationType(a.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(q=this._overviewRuler=k.overviewRuler)q.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),q.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),q.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),q.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),q.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),q.addAnnotationType(a.ANNOTATION_ERROR),q.addAnnotationType(a.ANNOTATION_WARNING),q.addAnnotationType(a.ANNOTATION_TASK),q.addAnnotationType(a.ANNOTATION_BOOKMARK),q.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),
q.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),q.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=h,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:d});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(),e=a.getLineAtOffset(b),a=a.getLineStart(e),b=b-a,a=this.getKeyModes(),g=0;g<a.length;g++){var k=a[g];if(k.isActive()&&k.isStatusActive&&k.isStatusActive())return}this.reportStatus(h.formatMessage(l.lineColumn,e+1,b+1))},showAnnotations:function(b,d,e,g){var h=this._annotationModel;if(h){for(var q=[],k=[],l=h.getTextModel(),n=h.getAnnotations(),p;n.hasNext();)p=n.next(),-1!==d.indexOf(p.type)&&
p.creatorID===this&&q.push(p);if(b)for(d=0;d<b.length;d++)if(p=b[d]){if(e)p=e(p);else{var z;"number"===typeof p.line?(z=l.getLineStart(p.line-1),n=z+p.start-1,z=z+p.end-1):(n=p.start,z=p.end);var y=g(p);if(!y)continue;p=a.createAnnotation(y,n,z,p.description)}p.creatorID=this;k.push(p)}h.replaceAnnotations(q,k)}},showProblems:function(b){this.showAnnotations(b,[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(b){this.showAnnotations(b,[a.ANNOTATION_READ_OCCURRENCE,a.ANNOTATION_WRITE_OCCURRENCE],null,function(b){return b.readAccess?a.ANNOTATION_READ_OCCURRENCE:a.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(f){var d=this._blameRGB,e=this.getTextView().getOptions("parent").ownerDocument;if(!d){var g=h.createElement(e,"div");g.className="annotation blame";e.body.appendChild(g);var n=(e.defaultView||e.parentWindow).getComputedStyle(g).getPropertyValue("background-color");
g.parentNode.removeChild(g);var g=n.indexOf("("),q=n.indexOf(")"),n=n.substring(g+1,q);this._blameRGB=d=n.split(",").slice(0,3)}var t=function(){var a=k.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=b.mixin({},a.style);a.style.style=b.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},p=function(){var a=h.createElement(e,"div");a.className="tooltipTitle";var b=
this.blame.Message.indexOf("\n");-1===b&&(b=this.blame.Message.length);var d=h.createElement(e,"a");d.href=this.blame.CommitLink;d.appendChild(e.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(d);a.appendChild(h.createElement(e,"br"));a.appendChild(e.createTextNode(h.formatMessage(l.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},s=this.getModel();this.showAnnotations(f,[a.ANNOTATION_BLAME,a.ANNOTATION_CURRENT_BLAME],function(f){var e=s.getLineStart(f.Start-1),
m=s.getLineEnd(f.End-1,!0),e=k.AnnotationType.createAnnotation(a.ANNOTATION_BLAME,e,m,p),m=d.slice(0);m.push(f.Shade);e.style=b.mixin({},e.style);e.style.style=b.mixin({},e.style.style);e.style.style.backgroundColor="rgba("+m.join()+")";e.groupId=f.Name;e.groupType=a.ANNOTATION_CURRENT_BLAME;e.createGroupAnnotation=t;e.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+f.AuthorImage+'"/\x3e';e.blame=f;return e})},showSelection:function(a,b,e,g,h){"number"===typeof a?("number"!==typeof b&&(b=
a),this.moveSelection(a,b)):"number"===typeof e&&(a=this.getModel().getLineStart(e-1),"number"===typeof g&&(a+=g),"number"!==typeof h&&(h=0),this.moveSelection(a,a+h))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,e,h,k){g.prototype.setInput.call(this,a,b,e,h);this._textView&&(!h&&!k)&&this._textView.focus()},onGotoLine:function(a,b,e,g){if(this._textView){var h=
this.getModel();a=Math.max(0,Math.min(a,h.getLineCount()-1));var q=h.getLineStart(a),k=0;void 0===e&&(e=0);"string"===typeof b?(a=h.getLine(a).indexOf(b),-1!==a&&(k=a,e=k+b.length)):(k=b,b=h.getLineEnd(a)-q,k=Math.min(k,b),e=Math.min(e,b));this.moveSelection(q+k,q+e,g)}}});return{BaseEditor:g,Editor:e}});
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,p,n,k,b,h,g){function e(a){var f=a.getTextView();n.KeyMode.call(this,f);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";f.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));f.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var e=this;this._listener={onVerify:function(a){var d=e.editor,f=d.getModel(),m=d.mapOffset(a.start),d=d.mapOffset(a.end),f=f.getText(m,d);if((f=e._prefix.match(RegExp("^"+b.escape(f),"i")))&&0<f.length)e._prefix+=a.text,e._success=!0,e._status(),e.find(e._forward,!0),a.text=null},onSelection:function(){e._ignoreSelection||e.setActive(!1)}}}function a(a,b,f){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var e=this;this._listeners={onEditorFocus:function(a){e._removeCurrentAnnotation(a)}};this.setOptions(f)}}var f={};e.prototype=new n.KeyMode;h.mixin(e.prototype,{createKeyBindings:function(){var a=p.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var f=this._prefix;if(0===f.length)return!1;var e=this.editor,g=e.getModel(),g=a?this._success?b?this._start:e.getCaretOffset()+
1:0:this._success?b?this._start:e.getCaretOffset():g.getCharCount()-1;(f=e.getModel().find({string:f,start:g,reverse:!a,caseInsensitive:f.toLowerCase()===f}).next())?(b||(this._start=g),this._ignoreSelection=this._success=!0,e.moveSelection(a?f.start:f.end,a?f.end:f.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("")}});
f.IncrementalFind=e;a.prototype={find:function(a,b,f){this.setOptions({reverse:!a});var e=this.getFindString(),g;b&&(e=b.findString||e,g=b.count);a=this.getOptions();this.setOptions(b);b=f?this._startOffset:this.getStartOffset();if((g=this._doFind(e,b,g))&&!f)this._startOffset=g.start;this.setOptions(a);this._hideAfterFind&&this.hide();return g},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=b.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 b=a;if(this._regex){for(var b="",f=!1,e=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var h=a.substring(g,g+1);if(f){switch(h){case "R":b+=e;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+h}f=!1}else"\\"===h?f=!0:b+=h}f&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,f=this._processReplaceString(this.getReplaceString()),e=b.getSelection().start;if(b=b.getModel().find({string:a,start:e,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,f),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,f=b.getTextView();b.reportStatus(l.replacingAll);var e=this._processReplaceString(this.getReplaceString()),h=this;window.setTimeout(function(){for(var k=0,n=0;;){var p=h._doFind(a,k,null,!0);if(!p)break;n++;1===n&&(f.setRedraw(!1),h.startUndo());h._doReplace(p.start,p.end,a,e);k=h.getStartOffset()}0<
n&&(h.endUndo(),f.setRedraw(!0));0<k?b.reportStatus(g.formatMessage(l.replacedMatches,n)):b.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 b=this._editor.getAnnotationModel();b&&b.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 b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,f){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:f?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,f,e){f=f||1;var g=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,n;if(this._regex)try{n=this._find(a,b,e)}catch(p){g.reportStatus(p.message,
"error");return}else n=this._find(a,b,e);for(a=0;a<f&&n.hasNext();a++)h=n.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(l.notFound,"error");if(this.isVisible()){f=k.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(n=g.getAnnotationModel())n.removeAnnotations(f),h&&n.addAnnotation(k.AnnotationType.createAnnotation(f,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var x=this;this._timer=window.setTimeout(function(){x._markAllOccurrences();
x._timer=null},500)}}this._findCallback?this._findCallback(h):h&&g.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,f,e){var g=this._editor;this._regex&&(e=g.getText(a,b).replace(RegExp(f,this._caseInsensitive?"i":""),e));g.setText(e,a,b);g.setSelection(a,a+e.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=k.AnnotationType.ANNOTATION_MATCHING_SEARCH,f=a.getAnnotations(),e=[],g;f.hasNext();){var h=f.next();h.type===b&&e.push(h)}if(this.isVisible()){f=
this.getFindString();f=this._editor.getModel().find({string:f,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(g=[];f.hasNext();)h=f.next(),g.push(k.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(e,g)}},_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)}};f.Find=a;return f});
define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(l,p,n,k,b){function h(b,e,a){p.Find.call(this,b,e,a)}h.prototype=new p.Find;n.mixin(h.prototype,{getFindString:function(){var b=this._findInput;return!b?p.Find.prototype.getFindString.call(this):b.value},getReplaceString:function(){var b=this._replaceInput;return!b?p.Find.prototype.getReplaceString(this):b.value},hide:function(){var b=this.isVisible();p.Find.prototype.hide.call(this);
b&&(this._rootDiv.className="textViewFind")},show:function(b){p.Find.prototype.show.call(this,b);var e=b.findString;b=b.replaceString;var a=this._findInput;a||(this._create(),a=this._findInput);e&&(a.value=e);b&&(this._replaceInput.value=b);var f=this;window.setTimeout(function(){f._rootDiv.className="textViewFind show";a.select();a.focus()},0)},_create:function(){var g=this,e=this._editor.getTextView(),a=e.getOptions("parent").ownerDocument,f=b.createElement(a,"div");f.className="textViewFind";k.addEventListener(f,
"keydown",function(a){g._handleKeyDown(a)});this._rootDiv=f;this._createContents(a,f);e._rootDiv.insertBefore(f,e._rootDiv.firstChild)},_createContents:function(g,e){var a=this,f=b.createElement(g,"input");f.className="textViewFindInput";this._findInput=f;f.type="text";f.placeholder=l.findWith;k.addEventListener(f,"input",function(b){return a._handleInput(b)});e.appendChild(f);f=b.createElement(g,"span");a._createButton(g,f,l.next,function(){a.find(!0)});a._createButton(g,f,l.previous,function(){a.find(!1)});
e.appendChild(f);a._editor.getTextView().getOptions("readonly")||(f=b.createElement(g,"input"),f.className="textViewReplaceInput",this._replaceInput=f,f.type="text",f.placeholder=l.replaceWith,e.appendChild(f),f=b.createElement(g,"span"),a._createButton(g,f,l.replace,function(){a.replace()}),a._createButton(g,f,l.replaceAll,function(){a.replaceAll()}),e.appendChild(f));f=b.createElement(g,"span");a._createButton(g,f,l.regex,function(b){a._toggle("regex",b.target)},this._regex,l.regexTooltip);a._createButton(g,
f,l.caseInsensitive,function(b){a._toggle("caseInsensitive",b.target)},this._caseInsensitive,l.caseInsensitiveTooltip);a._createButton(g,f,l.wholeWord,function(b){a._toggle("wholeWord",b.target)},this._wholeWord,l.wholeWordTooltip);e.appendChild(f);f=a._createButton(g,e,"",function(){a.hide()});f.className="textViewFindCloseButton";f.title=l.closeTooltip},_createButton:function(b,e,a,f,d,m){var h=b.createElement("button");this._checked(d,h);m&&(h.title=m);k.addEventListener(h,"click",function(a){f.call(this,
a)},!1);a&&h.appendChild(b.createTextNode(a));e.appendChild(h);return h},_toggle:function(b,e){var a={};a[b]=!this["_"+b];this.setOptions(a);this._checked(a[b],e)},_checked:function(b,e){e.className="textViewFindButton";b&&(e.className+=" checked")},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(g){var e,a=(b.isMac?g.metaKey:g.ctrlKey)&&!g.altKey&&!g.shiftKey;a&&70===g.keyCode&&(e=!0);if((b.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),e=!0;a&&82===g.keyCode&&(this.replace(),e=!0);27===g.keyCode&&(this.hide(),e=!0);return e?(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,p,n,k,b,h,g){function e(a,d,f){this.editor=a;this.undoStack=d;this._incrementalFind=new b.IncrementalFind(a);this._find=f?f:new h.FindUI(a,d);this._lastEditLocation=null;this.init()}function a(a,b,d,f){this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedMode=f;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var f=n.AnnotationType,d={};e.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 p.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 p.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 p.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 p.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:l.incrementalFind});a.setKeyBinding(new p.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 p.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:l.moveLinesUp});a.setKeyBinding(new p.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:l.moveLinesDown});a.setKeyBinding(new p.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:l.copyLinesUp});a.setKeyBinding(new p.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:l.copyLinesDown});a.setKeyBinding(new p.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:l.deleteLines});a.setKeyBinding(new p.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:l.gotoLine});a.setKeyBinding(new p.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:l.nextAnnotation});a.setKeyBinding(new p.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:l.prevAnnotation});a.setKeyBinding(new p.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:l.expand});a.setKeyBinding(new p.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:l.collapse});a.setKeyBinding(new p.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:l.expandAll});a.setKeyBinding(new p.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:l.collapseAll});a.setKeyBinding(new p.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(),d=a.getSelection(),f=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),e=b.getLineStart(f),f=b.getLineEnd(d,!0),g=b.getLineCount(),h="",e=b.getText(e,f);d===g-1&&(e=(h=b.getLineDelimiter())+e);a.setText(e,f,f);a.setSelection(f+h.length,f+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-
1:d.end),f=b.getLineStart(f),e=b.getLineEnd(d,!0),g=b.getLineCount(),h="",e=b.getText(f,e);d===g-1&&(e+=h=b.getLineDelimiter());a.setText(e,f,f);a.setSelection(f,f+e.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=1;a&&a.count&&(d=a.count);var f=b.getSelection(),e=b.getModel(),g=e.getLineAtOffset(f.start);a=e.getLineStart(g);d=f.start!==f.end||1===d?e.getLineAtOffset(f.end>f.start?f.end-1:f.end):Math.min(g+d-1,e.getLineCount()-
1);d=e.getLineEnd(d,!0);b.setText("",a,d);return!0},expandAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;var f=b.getModel(),e=b.getCaretOffset(),g=f.getLineAtOffset(e),e=f.getLineStart(g),g=f.getLineEnd(g,!0);f.getBaseModel&&(e=f.mapOffset(e),g=f.mapOffset(g),f.getBaseModel());for(var h,d=d.getAnnotations(e,g);!h&&d.hasNext();)f=d.next(),f.type===n.AnnotationType.ANNOTATION_FOLDING&&(h=f);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,d=b.getTextView(),b=b.getAnnotationModel();if(!b)return!0;var f=b.getAnnotations();for(d.setRedraw(!1);f.hasNext();)b=f.next(),b.type===n.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var d=a.getModel(),f=a.getSelection(),e=d.getLineAtOffset(f.start),g=d.getLineAtOffset(f.end>
f.start?f.end-1:f.end);if(e!==g){var h=[];h.push("");for(var k=e;k<=g;k++)h.push(d.getLine(k,!0));k=d.getLineStart(e);d=d.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),k,d);a.setSelection(k===f.start?f.start:f.start+b.length,f.end+(g-e+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(),d=a.getSelection(),f=b.getLineAtOffset(d.start),e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=b.getLineCount();if(e===g-1)return!0;var f=b.getLineStart(f),d=b.getLineEnd(e,!0),h=b.getLineEnd(e+1,!0)-(d-f),k=0;e!==g-2?b=b.getText(f,d):(e=b.getLineEnd(e),
b=b.getText(e,d)+b.getText(f,e),k+=d-e);this.startUndo();a.setText("",f,d);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(),d=a.getSelection(),f=b.getLineAtOffset(d.start);if(0===f)return!0;var e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=b.getLineCount(),d=b.getLineStart(f-1),h=b.getLineStart(f),k=b.getLineEnd(e,!0),l=b.getText(h,k),n=0;e===g-1&&(e=b.getLineEnd(f-
1),f=b.getLineEnd(f-1,!0),l+=b.getText(e,f),h=e,n=f-e);this.startUndo();a.setText("",h,k);a.setText(l,d,d);a.setSelection(d,d+l.length-n);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===f.ANNOTATION_MATCHING_BRACKET||a.type===f.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var d=this.editor,e=d.getAnnotationModel();if(!e)return!0;var g=d.getOverviewRuler()||d.getAnnotationStyler();if(!g)return!0;for(var h=d.getModel(),l=d.getCaretOffset(),
n=e.getAnnotations(a?l:0,a?h.getCharCount():l),p=null;n.hasNext();){var y=n.next();if(a){if(y.start<=l)continue}else if(y.start>=l)continue;if(!b(y)&&(p=y,a))break}if(p){for(var B=[p],n=e.getAnnotations(p.start,p.start);n.hasNext();)y=n.next(),y!==p&&!b(y)&&B.push(y);var v=d.getTextView(),A=h.getLineAtOffset(p.start),C=k.Tooltip.getTooltip(v);if(!C)return d.moveSelection(p.start),!0;d.moveSelection(p.start,p.start,function(){C.setTarget({getTooltipInfo:function(){var a=v.convert({x:v.getLocationAtOffset(p.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 d=a.getModel(),f=a.getSelection(),e=d.getLineAtOffset(f.start),g=d.getLineAtOffset(f.end>f.start?f.end-1:f.end),h=b.getOptions("tabSize"),k=Array(h+1).join(" "),l=[],n=b=0,p=e;p<=g;p++){var v=d.getLine(p,!0);if(d.getLineStart(p)!==
d.getLineEnd(p))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;p===e&&(n=b);l.push(v)}e=d.getLineStart(e);h=d.getLineEnd(g,!0);d=d.getLineStart(g);a.setText(l.join(""),e,h);g=e===f.start?f.start:f.start-n;f=Math.max(g,f.end-b+(f.end===d+1&&f.start!==f.end?1:0));a.setSelection(g,f);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.TextActions=
e;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 p.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:l.trimTrailingWhitespaces});a.setKeyBinding(new p.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:l.toggleLineComment});a.setKeyBinding(new p.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:l.addBlockComment});a.setKeyBinding(new p.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:l.removeBlockComment});a.setKeyBinding(new p.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new p.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new p.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new p.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new p.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new p.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new p.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new p.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new p.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new p.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 d=a.getSelection();if(d.start===d.end){for(var f=a.getModel(),e=f.getLineAtOffset(d.start),
g=f.getLine(e,!1),h=f.getLineStart(e),k=0,l=d.start-h,n;k<l&&(32===(n=g.charCodeAt(k))||9===n);)k++;var h=g.substring(0,k),b=b.getOptions("tabSize","expandTab"),p=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=f.getLineDelimiter(),v=/^[\s]*\/\*[\*]*[\s]*$/,A=/^[\s]*\*/,C=/\*\/[\s]*$/,F=g.substring(0,l),D=g.substring(l),E;if(this.smartIndentation&&123===g.charCodeAt(E=F.trimRight().length-1))return f=l-E-1,D=D.length-D.trimLeft().length,g=125===g.charCodeAt(l+D)?b+h+p+b+h:b+h+p,a.setText(g,d.start-
f,d.end+D),a.setCaretOffset(d.start+b.length+h.length+p.length-f),!0;if(this.autoCompleteComments&&!C.test(F)&&(v.test(F)||A.test(F))){if(k=v.exec(F)){g=b+h+" * ";g=C.test(D)?g+D.substring(0,D.length-2).trim():g+D.trim();if(f.getLineCount()===e+1||!A.test(f.getLine(e+1)))g+=b+h+" */";a.setText(g,d.start,d.end+D.length);a.setCaretOffset(d.start+b.length+h.length+3);return!0}if(k=A.exec(F))for(e-=1;0<=e;e--){k=f.getLine(e,!1);if(v.test(k))return C.test(D)||47===g.charCodeAt(l)?(g=b+h+"*"+D,h=d.start+
b.length+h.length+1):(g=b+h+"* "+D,h=d.start+b.length+h.length+2),a.setText(g,d.start,d.end+D.length),a.setCaretOffset(h),!0;if(!A.test(k))break}}else{if(C.test(F)&&32===h.charCodeAt(h.length-1))return g=b+h.substring(0,h.length-1),a.setText(g,d.start,d.end),a.setCaretOffset(d.start+g.length),!0;if(0<k){for(k=l;k<g.length&&(32===(n=g.charCodeAt(k++))||9===n);)d.end++;a.setText(f.getLineDelimiter()+h,d.start,d.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),d=a.getSelection(),f=this._findEnclosingComment(b,d.start,d.end);if(void 0!==f.commentStart&&void 0!==f.commentEnd)return!0;b=b.getText(d.start,d.end);if(0===b.length)return!0;var f=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(e-f));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var d=this.editor;if(d.getTextView().getOptions("readonly"))return!1;var f=d.getSelection(),e=d.getModel(),g=d.getCaretOffset()===e.getCharCount()?"":e.getText(f.start,f.start+1).trim(),h=/^$|[)}\]>]/;return f.start===f.end&&h.test(g)?(d.setText(a+b,f.start,f.start),d.setCaretOffset(f.start+1),!0):f.start!==f.end?(e=e.getText(f.start,f.end),d.setText(a+e+b,f.start,f.end),d.setSelection(f.start+1,f.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
if(b.getTextView().getOptions("readonly"))return!1;var d=b.getSelection(),f=b.getModel(),e=b.getCaretOffset(),g=0===e?"":f.getText(d.start-1,d.start).trim(),h=e===f.getCharCount()?"":f.getText(d.start,d.start+1).trim(),e=/^"$|^'$/,k=/\w/,l=/^$|[)}\]>]/;if(d.start!==d.end){f=f.getText(d.start,d.end);if(e.test(f))return!1;b.setText(a+f+a,d.start,d.end);b.setSelection(d.start+1,d.end+1)}else{if(h!==a){if(g===a||e.test(h)||k.test(g)||!l.test(h))return!1;b.setText(a+a,d.start,d.start)}b.setCaretOffset(d.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],d=0;d<a.positions.length;++d)b[d]={positions:[{offset:a.positions[d].offset,length:a.positions[d].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&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 d=a.getModel(),f=a.getCaretOffset(),e=0===f?"":d.getText(b.start-1,b.start),d=f===d.getCharCount()?"":d.getText(b.start,b.start+1);("("===e&&")"===d||"["===e&&"]"===d||"{"===e&&"}"===d||"\x3c"===e&&"\x3e"===d||'"'===e&&'"'===d||"'"===e&&"'"===d)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,d){var f=a.getLineAtOffset(b),
e=a.getLineAtOffset(d),g,h,k,l,n,p;for(g=f;0<=g&&!(h=a.getLine(g),k=g===f?b-a.getLineStart(f):h.length,l=h.lastIndexOf("/*",k),h=h.lastIndexOf("*/",k),h>l);g--)if(-1!==l){n=a.getLineStart(g)+l;break}for(g=e;g<a.getLineCount()&&!(h=a.getLine(g),k=g===e?d-a.getLineStart(e):0,l=h.indexOf("/*",k),h=h.indexOf("*/",k),-1!==l&&l<h);g++)if(-1!==h){p=a.getLineStart(g)+h;break}return{commentStart:n,commentEnd:p}},lineStart:function(){for(var a=this.editor,b=a.getModel(),d=a.getCaretOffset(),f=b.getLineAtOffset(d),
e=b.getLineStart(f),b=b.getLine(f),f=0;f<b.length;f++){var g=b.charCodeAt(f);if(!(32===g||9===g))break}f+=e;return d!==f?(a.setSelection(f,f),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getText(d.start,d.end),e,g,h;for(h=0;h<f.length;h++)if("/*"===f.substring(h,h+2)){e=d.start+h;break}for(;h<f.length;h++)if("*/"===f.substring(h,h+2)){g=d.start+h;break}if(void 0!==e&&void 0!==g)a.setText(b.getText(e+
2,g),e,g+2),a.setSelection(e,g);else{f=this._findEnclosingComment(b,d.start,d.end);if(void 0===f.commentStart||void 0===f.commentEnd)return!0;b=b.getText(f.commentStart+2,f.commentEnd);a.setText(b,f.commentStart,f.commentEnd+2);a.setSelection(d.start-2,d.end-2)}return!0},toggleLineComment:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;for(var d=this.lineComment||"//",f=a.getModel(),e=a.getSelection(),g=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?
e.end-1:e.end),k=!0,l=[],n,p=g;p<=h;p++){var v=f.getLine(p,!0);n=v.indexOf(d);l.push(n);if(!k||-1===n)k=!1;else if(0!==n){for(k=0;k<n;k++){var A=v.charCodeAt(k);if(!(32===A||9===A))break}k=k===n}}p=d.length;v=f.getLineStart(g);b.setRedraw(!1);this.startUndo();if(k){for(k=l.length-1;0<=k;k--)n=l[k]+f.getLineStart(g+k),a.setText("",n,n+p);f=f.getLineStart(h);d=v===e.start?e.start:e.start-p;e=e.end-p*(h-g+1)+(e.end===f+1?p:0)}else{for(k=l.length-1;0<=k;k--)n=f.getLineStart(g+k),a.setText(d,n,n);d=v===
e.start?e.start:e.start+p;e=e.end+p*(h-g+1)}this.endUndo();b.setRedraw(!0);a.setSelection(d,e);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),d=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var f=/(\s+$)/,e=b.getLineCount(),g=0;g<e;g++){var h=b.getLine(g),k=f.exec(h);if(k){var l=b.getLineStart(g),h=k[0].length,k=l+k.index;b.setText("",k,k+h);d.start>k&&(d.start=Math.max(k,d.start-h));d.start!==d.end&&d.end>k&&(d.end=Math.max(k,
d.end-h))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(d.start,d.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=b.getSelection(),f=b.getModel();return(b.getCaretOffset()===f.getCharCount()?"":f.getText(d.start,d.start+1))===a?(b.setCaretOffset(d.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}};d.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 d});
define("orion/editor/undoStack",[],function(){function l(k,b,h,g,e){this.model=k;this.offset=b;this.text=h;this.previousText=g;this.type=e}function p(k){this.owner=k;this.changes=[]}function n(k,b){this.size=void 0!==b?b:100;this.reset();var h=this;this._listener={onChanging:function(b){h._onChanging(b)},onDestroy:function(b){h._onDestroy(b)}};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,b){this._doUndoRedo(this.offset,this.previousText,this.text,k,b);return!0},redo:function(k,b){this._doUndoRedo(this.offset,this.text,this.previousText,k,b);return!0},merge:function(k,b,h,g,e){if(g===this.type){if(1===g&&k===
this.offset+this.text.length)return this.text+=b,!0;if(-1===g&&e===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,b,h,g,e){this.model.setText(b,k,k+h.length);e&&g&&(h=g.getModel(),h!==this.model&&(k=h.mapOffset(k,!0)),g.setSelection(k,k+b.length))}};p.prototype={getRedoChanges:function(){for(var k=[],b=0;b<this.changes.length;b++)k=k.concat(this.changes[b].getRedoChanges());return k},
getUndoChanges:function(){for(var k=[],b=this.changes.length-1;0<=b;b--)k=k.concat(this.changes[b].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,b){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(b&&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,b){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(b&&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,b,h,g,e){var a=this.changes.length;
return 0<a?this.changes[a-1].merge(k,b,h,g,e):!1},start:function(k){k&&(this.startSelection=k.getSelection(),this.startCaret=k.getCaretOffset());(k=this.owner)&&k.start&&k.start()}};n.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=[],b=this.index;b<this.stack.length;b++)k=k.concat(this.stack[b].getRedoChanges());
return k},getUndoChanges:function(){this._commitUndo();for(var k=[],b=this.index;0<=b;b--)k=k.concat(this.stack[b].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 p(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 b=k.text,h=k.start,g=k.addedCharCount,e=k.removedCharCount;k=h+e;var a=0;0===g&&1===e?a=-1:1===g&&0===e&&(a=1);g=this.stack.length;e=this.model.getText(h,k);(!(0<g&&this.index===g)||!this.stack[g-1].merge(h,b,e,a,k))&&this.add(new l(this.model,
h,b,e,a))}}};return{UndoStack:n}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(l,p,n,k){function b(a,b,e,g){this._location=b||"left";this._overview=e||"page";this._rulerStyle=g;this._view=null;var h=this;this._listener={onTextModelChanged:function(a){h._onTextModelChanged(a)},onAnnotationModelChanged:function(a){h._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function h(a,d,e,g,h){b.call(this,a,d,"page",e);this._oddStyle=g||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function g(a,d,e){b.call(this,a,d,"page",e)}function e(a,d,e){b.call(this,a,d,"document",e)}function a(a,b,e){g.call(this,a,b,e)}b.prototype={getAnnotations:function(a,b){var e=this._annotationModel;if(!e)return[];var g=this._view.getModel(),h=g.getLineStart(a),k=g.getLineEnd(b-1),l=g;g.getBaseModel&&(l=g.getBaseModel(),h=g.mapOffset(h),k=g.mapOffset(k));for(var n=[],e=this.getAnnotationsByType(e,h,k),h=0;h<
e.length;h++)for(var k=e[h],p=l.getLineAtOffset(k.start),x=l.getLineAtOffset(Math.max(k.start,k.end-1)),z=p;z<=x;z++){var y=z;if(g!==l){y=l.getLineStart(z);y=g.mapOffset(y,!0);if(-1===y)continue;y=g.getLineAtOffset(y)}if(a<=y&&y<b){var B=this._mergeAnnotation(n[y],k,z-p,x-p+1);B&&(n[y]=B)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var v in n)n[v]._multiple&&(n[v].html+=this._multiAnnotationOverlay.html);return n},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 e=this._view,g=e.getModel(),h=g,k=g.getLineStart(a),l=k,p=k,s=this._annotationModel;if(s){e=e.getSelection();p=g.getLineEnd(a,!0);k<=e.start&&e.start<p&&(k=e.start);g.getBaseModel&&(k=g.mapOffset(k),
p=g.mapOffset(p),h=g.getBaseModel());for(var x,p=s.getAnnotations(k,p),s=null;!x&&p.hasNext();)e=p.next(),this.isAnnotationTypeVisible(e.type)&&(s=e,e.start<=k||(x=e));s&&void 0!==s.groupId&&(this._currentClickGroup=this._currentClickGroup===s.groupId?null:s.groupId,this._setCurrentGroup(a));x&&h.getLineAtOffset(x.start)===h.getLineAtOffset(k)?(k=x.start,p=x.end):p=k=l;g.getBaseModel&&(k=g.mapOffset(k,!0),p=g.mapOffset(p,!0))}(g=n.Tooltip.getTooltip(this._view))&&g.setTarget(null);this._view.setSelection(p,
k,1/3,function(){})}},onDblClick:function(a,b){},onMouseMove:function(a,b){var e=n.Tooltip.getTooltip(this._view);if(e&&!(e.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var g=this;e.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 e=n.Tooltip.getTooltip(this._view);
e&&e.setTarget(null)},_getTooltipInfo:function(a,b){if(void 0!==a){var e=this._view,g=e.getModel(),h=this._annotationModel,k=[];if(h){var k=g.getLineStart(a),l=g.getLineEnd(a);g.getBaseModel&&(k=g.mapOffset(k),l=g.mapOffset(l));k=this.getAnnotationsByType(h,k,l)}h=this._getTooltipContents(a,k);if(!h)return null;h={contents:h,anchor:this.getLocation()};k=e.getClientArea();"document"===this.getOverview()?k.y=e.convert({y:b},"view","document").y:k.y=e.getLocationAtOffset(g.getLineStart(a)).y;e.convert(k,
"document","page");h.x=k.x;h.y=k.y;"right"===h.anchor&&(h.x+=k.width);return h}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var d=0;d<a.length;d++)if(h.isAnnotationTypeVisible(a[d].type)){var f=a[d].start,k=a[d].end;g.getBaseModel&&(f=g.mapOffset(f,!0),k=g.mapOffset(k,!0));-1!==f&&-1!==k&&e.redrawLines(g.getLineAtOffset(f),g.getLineAtOffset(Math.max(f,k-1))+1,h)}}var e=this._view;if(e){var g=e.getModel(),h=this,k=g.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,g.getBaseModel&&(a=g.mapOffset(a,!0)),a=g.getLineAtOffset(a),e.redrawLines(a,k,h)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,e,g){a||(a={});0===e&&(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 e;if(b.style)for(e in a.style||(a.style={}),b.style)void 0===a.style[e]&&(a.style[e]=b.style[e]);if(b.attributes)for(e in a.attributes||(a.attributes={}),b.attributes)void 0===a.attributes[e]&&(a.attributes[e]=b.attributes[e])}return a},_setCurrentGroup:function(a){var b=this._annotationModel,e=null,g=b.getTextModel(),h,k=this._currentGroupAnnotation;if(-1!==a){var l=g.getLineStart(a),n=g.getLineEnd(a);g.getBaseModel&&(l=g.mapOffset(l),n=g.mapOffset(n));
for(h=b.getAnnotations(l,n);h.hasNext();)if(g=h.next(),this.isAnnotationTypeVisible(g.type)&&g.start<=l&&g.end>=n&&void 0!==g.groupId){e=g;break}if(k&&e&&k.groupId===e.groupId)return}this._currentGroupAnnotation=null;k&&b.removeAnnotations(k.groupType);if(e&&-1!==a){this._currentGroupAnnotation=e;h=b.getAnnotations();for(a=[];h.hasNext();)g=h.next(),delete g.groupAnnotation,g.groupId===e.groupId&&(g=g.createGroupAnnotation(),a.push(g));b.replaceAnnotations(null,a)}}};p.AnnotationTypeList.addMixin(b.prototype);
h.prototype=new b;h.prototype.getAnnotations=function(a,d){for(var e=b.prototype.getAnnotations.call(this,a,d),g=this._view.getModel(),h=a;h<d;h++){var k=h&1?this._oddStyle:this._evenStyle,l=h;g.getBaseModel&&(l=g.getLineStart(l),l=g.getBaseModel().getLineAtOffset(g.mapOffset(l)));e[h]||(e[h]={});e[h].html=this._firstLine+l+"";e[h].style||(e[h].style=k)}return e};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 e=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),e=(this._firstLine+e-1+"").length;this._numOfDigits!==e&&(this._numOfDigits=e,b=a.getLineAtOffset(b),this._view.redrawLines(b,a.getLineCount(),this))};g.prototype=new b;e.prototype=new b;e.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
e.prototype._getTooltipContents=function(a,d){if(0===d.length){var e=this._view.getModel(),g=a;e.getBaseModel&&(g=e.getLineStart(g),g=e.getBaseModel().getLineAtOffset(e.mapOffset(g)));return k.formatMessage(l.line,g+1)}return b.prototype._getTooltipContents.call(this,a,d)};e.prototype._mergeAnnotation=function(a,b,e,g){if(0===e)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 e=this._annotationModel;if(e){var g=this._view.getModel(),h=g.getLineStart(a),k=g.getLineEnd(a,!0);g.getBaseModel&&(h=g.mapOffset(h),k=g.mapOffset(k),g=g.getBaseModel());for(var l,e=e.getAnnotations(h,k);!l&&e.hasNext();)k=e.next(),this.isAnnotationTypeVisible(k.type)&&g.getLineAtOffset(k.start)===g.getLineAtOffset(h)&&(l=k);l&&((g=n.Tooltip.getTooltip(this._view))&&g.setTarget(null),l.expanded?l.collapse():l.expand())}}};a.prototype._getTooltipContents=function(a,b){if(0<b.length){var e=this._view.getModel(),
h=e.getLineStart(a);e.getBaseModel&&(h=e.mapOffset(h),e=e.getBaseModel());for(var h=e.getLineAtOffset(h),k=0;k<b.length;k++){var q=b[k];if(this.isAnnotationTypeVisible(q.type)&&e.getLineAtOffset(q.start)===h){if(b[k].expanded)break;return g.prototype._getTooltipContents.call(this,a,[q])}}}return null};a.prototype._onAnnotationModelChanged=function(a){function b(a){for(q=0;q<a.length;q++)if(k.isAnnotationTypeVisible(a[q].type)){var d=a[q].start;h.getBaseModel&&(d=h.mapOffset(d,!0));-1!==d&&(n=Math.min(n,
h.getLineAtOffset(d)))}}if(a.textModelChangedEvent)g.prototype._onAnnotationModelChanged.call(this,a);else{var e=this._view;if(e){var h=e.getModel(),k=this,q,l=h.getLineCount(),n=l;b(a.added);b(a.removed);b(a.changed);a=e.getRulers();for(q=0;q<a.length;q++)e.redrawLines(n,l,a[q])}}};return{Ruler:b,AnnotationRuler:g,LineNumberRuler:h,OverviewRuler:e,FoldingRuler:a}});
define("orion/editor/textDND",["orion/util"],function(l){function p(l,k){this._view=l;this._undoStack=k;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(h){b._onDragStart(h)},onDragEnd:function(h){b._onDragEnd(h)},onDragEnter:function(h){b._onDragEnter(h)},onDragOver:function(h){b._onDragOver(h)},onDrop:function(h){b._onDrop(h)},onDestroy:function(h){b._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)}p.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,b=k.getSelection(),k=k.getModel();k.getBaseModel&&(b.start=k.mapOffset(b.start),b.end=k.mapOffset(b.end),k=k.getBaseModel());if(k=k.getText(b.start,b.end))this._dragSelection=b,l.event.dataTransfer.effectAllowed="copyMove",l.event.dataTransfer.setData("Text",k)},_onDragEnd:function(n){if(this._dragSelection){var k=
this._view,b=n.event.dataTransfer.dropEffect;if(!l.isFirefox&&("none"!==b||this._dropText))b=n.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(n="move"===b)&&k.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,h=this._dropOffset;n&&(h>=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));k.setText(b,h,h);k.setSelection(h,
h+b.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(l){this._onDragOver(l)},_onDragOver:function(n){var k=n.event.dataTransfer.types,b=!this._view.getOptions("readonly");b&&k&&(b=k.contains?k.contains("text/plain")||k.contains("Text"):-1!==k.indexOf("text/plain")||-1!==k.indexOf("Text"));b?l.isFirefox||(this._dropEffect=n.event.dataTransfer.dropEffect=(l.isMac?n.event.altKey:n.event.ctrlKey)?"copy":
"move"):n.event.dataTransfer.dropEffect="none"},_onDrop:function(n){var k=this._view,b=n.event.dataTransfer.getData("Text");b&&(l.isFirefox||(n.event.dataTransfer.dropEffect=this._dropEffect),n=k.getOffsetAtLocation(n.x,n.y),this._dragSelection?(this._dropOffset=n,this._dropText=b):(k.setText(b,n,n),k.setSelection(n,n+b.length)))}};return{TextDND:p}});
define("orion/editor/templates",[],function(){function l(l,k,b,h){this.prefix=l;this.description=k;this.template=b;this.name=h;this._parse()}function p(l,k){this._keywords=l||[];this._templates=[];this.addTemplates(k||[])}l.prototype={getProposal:function(l,k,b){l=k-l.length;k={};var h,g=void 0!==b.delimiter?b.delimiter:"\n";b.indentation&&(g+=b.indentation);var e=void 0!==b.tab?b.tab:"\t",a=0,f=this.variables,d=this.segments;b=[];for(var m=0;m<d.length;m++){var p=d[m],u=f[p];if(void 0!==u)switch(p){case "${tab}":p=
e;break;case "${delimiter}":p=g;break;case "${cursor}":p="";h=a;break;default:var q=k[p];q||(q=k[p]={data:u.data,positions:[]});p=u.substitution;q.data&&q.data.values&&(p=q.data.values[0]);q.positions.push({offset:l+a,length:p.length})}b.push(p);a+=p.length}var g=[],t;for(t in k)k.hasOwnProperty(t)&&g.push(k[t]);b=b.join("");void 0===h&&(h=b.length);return{proposal:b,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=[],b={},h,g=0,l=l.replace(/\n/g,"${delimiter}"),l=l.replace(/\t/g,"${tab}");l.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(e,a,f){var d=e.substring(2,e.length-1);a=e;var m=d,p=null,u=m.indexOf(":");-1!==u&&(m=m.substring(0,u),a="${"+m+"}",p=JSON.parse(d.substring(u+1).replace("\\}","}").trim()));(d=b[a])||(d=b[a]={});d.substitution=m;p&&(d.data=p);(h=l.substring(g,f))&&k.push(h);k.push(a);g=f+e.length;return m});(h=l.substring(g,l.length))&&k.push(h);this.segments=
k;this.variables=b}};p.prototype={addTemplates:function(n){for(var k=this.getTemplates(),b=0;b<n.length;b++)k.push(new l(n[b].prefix,n[b].description,n[b].template,n[b].name))},initialize:function(){},computeProposals:function(l,k,b){var h=this.getPrefix(l,k,b),g=[];this.isValid(h,l,k,b)&&(g=g.concat(this.getTemplateProposals(h,k,b)),g=g.concat(this.getKeywordProposals(h)));return g},getKeywords:function(){return this._keywords},getKeywordProposals:function(l){var k=[],b=this.getKeywords();if(b){for(var h=
0;h<b.length;h++)0===b[h].indexOf(l)&&k.push({proposal:b[h].substring(l.length),description:b[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,b){return b.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(l,k,b){for(var h=[],g=this.getTemplates(),e=0;e<g.length;e++){var a=g[e];a.match(l)&&(a=a.getProposal(l,k,b),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,b,h){return!0}};return{Template:l,TemplateContentAssist:p}});
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,p,n,k,b,h){function g(a,b,d){var e=a.getTextView();n.KeyMode.call(this,e);this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.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,f;d;)if(e=this._getPositionChanged(d,b,b+a.removedCharCount),f=e.position,void 0===f||f.model!==d)this.exitLinkedMode(!1),d=this.linkedModeModel;else break;if(d){d=0;a=a.addedCharCount-a.removedCharCount;e=e.positions;for(var g,h=0;h<e.length;++h){g=e[h];f=g.position;var k=f.offset<=b&&b<=f.offset+f.length;k&&!g.ansestor?(f.offset+=d,
f.length+=a,d+=a):(f.offset+=d,g.ansestor&&k&&(f.length+=a));g.escape&&(g.model.escapePosition=f.offset)}this._updateAnnotations(e)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,d=b.mapOffset(a.start),f=this.editor.mapOffset(a.end),e=this.linkedModeModel,g,h;e;)if(g=this._getPositionChanged(e,d,f),h=g.position,void 0===h||h.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var k=this._compoundChange;k?k.owner.model===e&&k.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=h.group;var k=0,m=a.text.length-(f-d);g=g.positions;for(var l,d=d-h.position.offset,n=f-h.position.offset,p=0;p<g.length;++p)l=g[p],f=l.position,l.oldOffset=f.offset,l.model===e&&l.group===h.group?(f.offset+=k,f.length+=m,k+=m):(f.offset+=k,l.ansestor&&(f.length+=h.count*m)),l.escape&&(l.model.escapePosition=f.offset);this.ignoreVerify=!0;for(p=g.length-1;0<=p;p--)l=g[p],l.model===e&&l.group===h.group&&b.setText(a.text,l.oldOffset+
d,l.oldOffset+n);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(g)}}}.bind(this)}}var e={};g.prototype=new n.KeyMode;h.mixin(g.prototype,{createKeyBindings:function(){var a=p.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=
this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(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 b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var d=this.editor,e=d.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(l.linkedModeExited,null,!0);a&&d.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var e=this.linkedModeModel;if(e){e.selectedGroupIndex=a;a=e.groups[a];var d=a.positions[0],g=this.editor;g.setSelection(d.offset,d.offset+d.length);if(e=this.contentAssist)e.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new b.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),d.offset<=a&&a<=d.offset+d.length)?g.getText(d.offset,a):""},e.offset=d.offset,e.deactivate(),e.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,e.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,b,d){for(var e=b.groups,g=0;g<e.length;g++)for(var h=e[g].positions,k=0;k<h.length;k++){var l=h[k];d&&(l={offset:l.offset+d,length:l.length});l={index:k,group:g,count:h.length,model:b,
position:l};a.push(l);b.nextModel&&b.nextModel.parentGroup===g&&(l.ansestor=!0,this._getModelPositions(a,b.nextModel,(d||0)+h[k].offset-h[0].offset))}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)void 0!==a.escapePosition&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},
_getPositionChanged:function(a,b,d){var e;a=this._getSortedPositions(a);for(var g=a.length-1;0<=g;g--){var h=a[g].position;if(h.offset<=b&&d<=h.offset+h.length){e=a[g];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var d=[],e=[],g=b.getAnnotations(),h;g.hasNext();)switch(h=g.next(),h.type){case k.AnnotationType.ANNOTATION_LINKED_GROUP:case k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.push(h)}if(g=
this.linkedModeModel){a=a||this._getSortedPositions(g);for(var q=0;q<a.length;q++)if(h=a[q],h.model===g){var l=k.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===g.selectedGroupIndex&&(l=0===h.index?k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=k.AnnotationType.createAnnotation(l,h.offset,h.offset+h.length,"");e.push(h)}}b.replaceAnnotations(d,e)}}});e.LinkedMode=g;return e});
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,p,n,k,b,h){function g(){}function e(){}function a(){}function f(){}function d(){}function m(){}var r={};g.prototype={createKeyBindings:function(a,b,d,e){e=new l.TextActions(a,b,e);var f=new h.LinkedMode(a,b,d);a=new l.SourceCodeActions(a,b,d,f);return{textActions:e,linkedMode:f,sourceCodeActions:a}}};r.KeyBindingsFactory=
g;e.prototype={createUndoStack:function(a){a=a.getTextView();return new p.UndoStack(a,200)}};r.UndoFactory=e;a.prototype={createLineNumberRuler:function(a){return new n.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};r.LineNumberRulerFactory=a;f.prototype={createFoldingRuler:function(a){return new n.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};r.FoldingRulerFactory=f;d.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 n.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new n.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};r.AnnotationFactory=d;m.prototype={createTextDND:function(a,d){return new b.TextDND(a.getTextView(),d)}};r.TextDNDFactory=m;return r});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(l,p,n,k){return k.mixin({},l,p,n)});
define("orion/editor/contentAssist","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/eventTarget orion/Deferred orion/objects orion/editor/util orion/util orion/webui/littlelib".split(" "),function(l,p,n,k,b,h,g,e,a){function f(a){this.textView=a;this.state=r.INACTIVE;this.clearProviders();var b=this;this._textViewListeners={onModelChanging:function(a){(this._latestModelChangingEvent=a)&&this._updateFilterText(a)}.bind(this),onSelection:function(a){this.isDeactivatingChange(this._latestModelChangingEvent,
a)?this.setState(r.INACTIVE):this.isActive()&&(this.state===r.ACTIVE&&this.setState(r.FILTERING),this.filterProposals());this._latestModelChangingEvent=null}.bind(this),onScroll:function(a){this.setState(r.INACTIVE)}.bind(this)};a.setKeyBinding(e.isMac?new p.KeyBinding(" ",!1,!1,!1,!0):new p.KeyBinding(" ",!0),"contentAssist");a.setKeyBinding(e.isMac?new p.KeyBinding(" ",!1,!1,!0,!0):new p.KeyBinding(" ",!0,!1,!0),"contentAssist");a.setAction("contentAssist",function(){a.getOptions("readonly")||b.activate();
return!0},{name:l.contentAssist})}function d(a,b){var d=a.textView;n.KeyMode.call(this,d);this.contentAssist=a;this.widget=b;this.proposals=[];var e=this;this.contentAssist.addEventListener("ProposalsComputed",function(a){e.proposals=a.data.proposals;if(0===e.proposals.length)e.selectedIndex=-1,e.cancel();else{for(e.selectedIndex=0;e.proposals[e.selectedIndex]&&e.proposals[e.selectedIndex].unselectable;)e.selectedIndex++;if(e.proposals[e.selectedIndex]){if(e.widget){var b=!0;if(a.autoApply){for(a=
e.selectedIndex+1;e.proposals[a]&&e.proposals[a].unselectable;)a++;e.proposals[a]||(b=!1,e.contentAssist.apply(e.proposals[e.selectedIndex]))}b&&(e.widget.show(),e.widget.selectNode(e.selectedIndex))}}else e.selectedIndex=-1,e.cancel()}});d.setAction("contentAssistApply",function(){return this.enter()}.bind(this));d.setAction("contentAssistCancel",function(){return this.cancel()}.bind(this));d.setAction("contentAssistNextProposal",function(){return this.lineDown()}.bind(this));d.setAction("contentAssistPreviousProposal",
function(){return this.lineUp()}.bind(this));d.setAction("contentAssistNextPage",function(){return this.pageDown()}.bind(this));d.setAction("contentAssistPreviousPage",function(){return this.pageUp()}.bind(this));d.setAction("contentAssistHome",function(){this.widget&&this.widget.scrollIndex(0,!0);return this.lineDown(0)}.bind(this));d.setAction("contentAssistEnd",function(){return this.lineUp(this.proposals.length-1)}.bind(this));d.setAction("contentAssistTab",function(){return this.tab()}.bind(this));
this.widget&&(this.widget.setContentAssistMode(this),this.widget.createAccessible())}function m(a,b){this.contentAssist=a;this.textView=this.contentAssist.getTextView();this.isShowing=this.textViewListenerAdded=!1;var d=this.textView.getOptions("parent").ownerDocument;this.parentNode="string"===typeof b?d.getElementById(b):b;if(!this.parentNode){this.parentNode=e.createElement(d,"div");this.parentNode.className="contentassist";var f=d.getElementsByTagName("body")[0];if(f)f.appendChild(this.parentNode);
else throw Error("parentNode is required");}g.addEventListener(this.parentNode,"scroll",this.onScroll.bind(this));var h=this;this.textViewListener={onMouseDown:function(a){(a.event.target||a.event.srcElement).parentElement!==h.parentNode&&h.contentAssist.deactivate()}};this.contentAssist.addEventListener("Deactivating",function(a){h.hide()});this.scrollListener=function(a){h.isShowing&&h.position()};g.addEventListener(d,"scroll",this.scrollListener)}var r={INACTIVE:1,ACTIVE:2,FILTERING:3},u={selected:"selected",
hr:"proposal-hr",emphasis:"proposal-emphasis",noemphasis:"proposal-noemphasis",noemphasis_keyword:"proposal-noemphasis-keyword",noemphasis_title:"proposal-noemphasis-title",noemphasis_title_keywords:"proposal-noemphasis-title-keywords",dfault:"proposal-default"};f.prototype={apply:function(a){if(!a)return!1;var b=this.textView,d=b.getSelection(),e=this._initialCaretOffset,f=e,g=d=Math.max(d.start,d.end),h=b.getModel();h.getBaseModel&&(f=h.mapOffset(f),g=h.mapOffset(g),h=h.getBaseModel());a.overwrite&&
(e=this.getPrefixStart(h,f));f={proposal:a,start:f,end:g};this.setState(r.INACTIVE);b.setText("string"===typeof a?a:a.proposal,e,d);this.dispatchEvent({type:"ProposalApplied",data:f});return!0},activate:function(a,b){this.state===r.INACTIVE&&(this._autoTriggered=b?!0:!1,this.setState(r.ACTIVE,a))},deactivate:function(){this.setState(r.INACTIVE)},getTextView:function(){return this.textView},isActive:function(){return this.state===r.ACTIVE||this.state===r.FILTERING},isDeactivatingChange:function(a,
b){var d=!1;b.newValue.start<this._initialCaretOffset||!a?d=!0:a&&(d=0<a.removedLineCount||0<a.addedLineCount);return d},setState:function(a,b){var d;a===r.ACTIVE?(d="Activating",this._mode&&this._mode.setActive(!0)):a===r.INACTIVE&&(d="Deactivating",this._mode&&this._mode.setActive(!1));d&&this.dispatchEvent({type:d,providers:b});this.state=a;this.onStateChange(a)},setMode:function(a){this._mode=a},onStateChange:function(a){a===r.INACTIVE?(this._removeTextViewListeners(),this._filterText="",this._initialCaretOffset=
-1,this._computedProposals=null):a===r.ACTIVE&&(this._filterText="",this._addTextViewListeners(),this.computeProposals())},computeProposals:function(){var a=this.textView.getCaretOffset(),b=this.textView.getSelection(),b=Math.min(b.start,b.end);this._initialCaretOffset=Math.min(a,b);this._computedProposals=null;this._computeProposals(this._initialCaretOffset).then(function(a){if(this.isActive()){var b=this._flatten(a);b&&(Array.isArray(b)&&0<b.length)&&(this._computedProposals=a);this.dispatchEvent({type:"ProposalsComputed",
data:{proposals:b},autoApply:!this._autoTriggered});this._computedProposals&&this._filterText&&this.filterProposals(!0)}}.bind(this))},getPrefixStart:function(a,b){for(var d=b;0<d&&/[A-Za-z0-9_]/.test(a.getText(d-1,d));)d--;return d},handleError:function(a){"undefined"!==typeof console&&(console.log("Error retrieving content assist proposals"),console.log(a&&a.stack))},initialize:function(){this._providers.forEach(function(a){a=a.provider;"function"===typeof a.initialize&&a.initialize()})},_computeProposals:function(a){var d=
this._providers,e=this.textView,f=e.getSelection(),g=e.getModel(),k=a;g.getBaseModel&&(k=g.mapOffset(k),f.start=g.mapOffset(f.start),f.end=g.mapOffset(f.end),g=g.getBaseModel());a=g.getLine(g.getLineAtOffset(k));for(var m=0;m<a.length&&/\s/.test(a.charAt(m));)m++;var m=a.substring(0,m),e=e.getOptions("tabSize","expandTab"),e=e.expandTab?Array(e.tabSize+1).join(" "):"\t",l={line:a,offset:k,prefix:g.getText(this.getPrefixStart(g,k),k),selection:f,delimiter:g.getLineDelimiter(),tab:e,indentation:m},
n=this,d=d.map(function(a){a=a.provider;var d;try{var e,f;if(e=a.computeContentAssist){var m=n.editorContextProvider,q=m.getEditorContext();l=h.mixin(l,m.getOptions());f=e.apply(a,[q,l])}else if(e=a.getProposals||a.computeProposals)f=e.apply(a,[g.getText(),k,l]);d=n.progress?n.progress.progress(f,"Generating content assist proposal"):f}catch(p){return(new b).reject(p)}return b.when(d)});return b.all(d,this.handleError)},filterProposals:function(a){if(this._computedProposals&&(this._latestModelChangingEvent||
a)){a=this.textView.getModel();a.getBaseModel&&(a=a.getBaseModel());a=this.getPrefixStart(a,this._initialCaretOffset);var b=this.textView.getText(a,this._initialCaretOffset),d=[];this._computedProposals.forEach(function(a){a&&Array.isArray(a)&&(a=a.filter(function(a){if(!a)return!1;if(u[a.style]===u.hr||u[a.style]===u.noemphasis_title)return!0;var d="";if(a.overwrite){if(a.name)d=a.name;else if(a.proposal)d=a.proposal;else return!1;return 0===d.indexOf(b+this._filterText)}return a.name||a.proposal?
(d=!1,a.name&&(d=0===a.name.indexOf(b+this._filterText)),!d&&a.proposal&&(d=0===a.proposal.indexOf(this._filterText)),d):"string"===typeof a?0===a.indexOf(this._filterText):!1},this),0<a.length&&d.push(a))},this);a=[];d&&(d=this._removeExtraUnselectableElements(d),a=this._flatten(d));this.dispatchEvent({type:"ProposalsComputed",data:{proposals:a},autoApply:!1})}},_removeExtraUnselectableElements:function(a){return a.map(function(a){return a.filter(function(b,d){var e=!0;if(u[b.style]===u.hr)0===d||
a.length-1===d?e=!1:u.hr===u[a[d-1].style]&&(e=!1);else if(u[b.style]===u.noemphasis_title){var f=a[d+1];f?u[f.style]===u.noemphasis_title&&(e=!1):e=!1}return e})})},setEditorContextProvider:function(a){this.editorContextProvider=a},_generateProviderId:function(){this._idcount?this._idcount++:this._idcount=0;return"ContentAssistGeneratedID_"+this._idcount},setAutoTriggerEnabled:function(a){this._autoTriggerEnabled=a;this._updateAutoTriggerListenerState()},setProviders:function(a){var b=this;this.setProviderInfoArray(a.map(function(a){return a.id?
a:{provider:a,id:b._generateProviderId()}}))},setProviderInfoArray:function(a){this.clearProviders();this._providers=a;this._charTriggersInstalled=a.some(function(a){return a.charTriggers});this._updateAutoTriggerListenerState()},getProviders:function(){return this._providers.slice()},clearProviders:function(){this._providers=[];this._charTriggersInstalled=!1;this._updateAutoTriggerListenerState()},setProgress:function(a){this.progress=a},setStyleAccessor:function(a){this._styleAccessor=a},_flatten:function(a){return a.reduce(function(a,
b){var d=a,e=null;b&&Array.isArray(b)&&(e=b.filter(function(a){return a}));if(e&&Array.isArray(e)&&0<e.length){var d=e,f=a,g=e[0].style;g&&0===u[g].indexOf(u.noemphasis)&&(d=a,f=e);0<d.length&&(e=d[d.length-1].style)&&u.hr!==u[e]&&(d=d.concat({proposal:"",name:"",description:"---------------------------------",style:"hr",unselectable:!0}));d=d.concat(f)}return d},[])},_triggerListener:function(){var a=this.textView.getCaretOffset(),b=null,d=[];if(this._charTriggersInstalled){var e=this.textView.getText(a-
1,a);this._providers.forEach(function(f){var g=f.charTriggers;if(g&&g.test(e)){var g=!1,h=f.excludedStyles;this._styleAccessor&&h&&(b||(b=this._styleAccessor.getStyles(a-1)),g=b.some(function(a){return h.test(a.style)}));g||d.push(f)}},this);0<d.length&&this.activate(d,!0)}},_updateAutoTriggerListenerState:function(){this._boundTriggerListener||(this._boundTriggerListener=this._triggerListener.bind(this));if(this._triggerListenerInstalled){if(!this._autoTriggerEnabled||!this._charTriggersInstalled)this.textView.removeEventListener("Modify",
this._boundTriggerListener),this._triggerListenerInstalled=!1}else this._autoTriggerEnabled&&this._charTriggersInstalled&&(this.textView.addEventListener("Modify",this._boundTriggerListener),this._triggerListenerInstalled=!0)},_addTextViewListeners:function(){this._textViewListenersAdded||(this.textView.addEventListener("ModelChanging",this._textViewListeners.onModelChanging),this.textView.addEventListener("Scroll",this._textViewListeners.onScroll),this.textView.addEventListener("Selection",this._textViewListeners.onSelection),
this._textViewListenersAdded=!0)},_removeTextViewListeners:function(){this._textViewListenersAdded&&(this._latestModelChangingEvent=null,this.textView.removeEventListener("ModelChanging",this._textViewListeners.onModelChanging),this.textView.removeEventListener("Scroll",this._textViewListeners.onScroll),this.textView.removeEventListener("Selection",this._textViewListeners.onSelection),this._textViewListenersAdded=!1)},_updateFilterText:function(a){var b=a.removedCharCount;b&&(this._filterText=this._filterText.substring(0,
this._filterText.length-b));if(a=a.text)this._filterText=this._filterText.concat(a)}};k.EventTarget.addMixin(f.prototype);d.prototype=new n.KeyMode;h.mixin(d.prototype,{createKeyBindings:function(){var b=p.KeyBinding,d=[];d.push({actionID:"contentAssistApply",keyBinding:new b(13)});d.push({actionID:"contentAssistCancel",keyBinding:new b(27)});d.push({actionID:"contentAssistNextProposal",keyBinding:new b(40)});d.push({actionID:"contentAssistPreviousProposal",keyBinding:new b(38)});d.push({actionID:"contentAssistNextPage",
keyBinding:new b(34)});d.push({actionID:"contentAssistPreviousPage",keyBinding:new b(33)});d.push({actionID:"contentAssistHome",keyBinding:new b(a.KEY.HOME)});d.push({actionID:"contentAssistEnd",keyBinding:new b(a.KEY.END)});d.push({actionID:"contentAssistTab",keyBinding:new b(9)});return d},cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},getProposals:function(){return this.proposals},isActive:function(){return this.getContentAssist().isActive()},
setActive:function(a){a?this.contentAssist.textView.addKeyMode(this):this.contentAssist.textView.removeKeyMode(this)},lineUp:function(a,b){return this.selectNew(a,b,!1)},lineDown:function(a,b){return this.selectNew(a,b,!0)},selectNew:function(a,b,d){if(d){if(void 0===a&&(a=this.selectedIndex+1),a>=this.proposals.length){if(b)return!0;a=0}}else if(void 0===a&&(a=this.selectedIndex-1),0>a){if(b)return!0;a=this.proposals.length-1}for(var e=a;this.proposals[a]&&this.proposals[a].unselectable;){if(d){if(a++,
a>=this.proposals.length){if(b)return!0;a=0}}else if(a--,0>a){if(b)return!0;a=this.proposals.length-1}if(a===e){a=-1;break}}this.selectedIndex=a;this.widget&&this.widget.selectNode(a);return!0},pageUp:function(){if(this.widget){var a=this.widget.getTopIndex();a===this.selectedIndex&&(this.widget.scrollIndex(a,!1),a=this.widget.getTopIndex());return 0===a?this.lineDown(a,!0):this.lineUp(a,!0)}return this.lineUp()},pageDown:function(){if(this.widget){var a=this.widget.getBottomIndex();a===this.selectedIndex&&
(this.widget.scrollIndex(a,!0),a=this.widget.getBottomIndex());return this.lineDown(a,!0)}return this.lineDown()},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},tab:function(){return this.widget?(this.widget.parentNode.focus(),!0):!1}});m.prototype={onClick:function(a){a||(a=window.event);this.contentAssist.apply(this.getProposal(a.target||a.srcElement));this.textView.focus()},onScroll:function(a){this.previousCloneNode&&!this.preserveCloneThroughScroll&&
(this._removeCloneNode(),this.previousSelectedNode.classList.add(u.selected));this.preserveCloneThroughScroll=!1},createDiv:function(a,b,d){var f=b.ownerDocument,g=e.createElement(f,"div");g.id="contentoption"+d;g.setAttribute("role","option");g.className=u[a.style]?u[a.style]:u.dfault;"hr"===a.style?a=e.createElement(f,"hr"):(a=this._createDisplayNode(g,a,d),g.contentAssistProposalIndex=d);g.appendChild(a);b.appendChild(g)},createAccessible:function(){var b=this._contentAssistMode,d=this;g.addEventListener(this.parentNode,
"keydown",function(e){e||(e=window.event);e.preventDefault&&e.preventDefault();return e.keyCode===a.KEY.ESCAPE?b.cancel():e.keyCode===a.KEY.UP?b.lineUp():e.keyCode===a.KEY.DOWN?b.lineDown():e.keyCode===a.KEY.ENTER?b.enter():e.keyCode===a.KEY.PAGEDOWN?b.pageDown():e.keyCode===a.KEY.PAGEUP?b.pageUp():e.keyCode===a.KEY.HOME?(d.scrollIndex(0,!0),b.lineDown(0)):e.keyCode===a.KEY.END?b.lineUp(b.getProposals().length-1):!1})},_createDisplayNode:function(a,b,d){var e=null,f=null;if("string"===typeof b)f=
b;else if(b.description&&"string"===typeof b.description)if(b.name&&"string"===typeof b.name){var g=this._createNameNode(b.name);g.contentAssistProposalIndex=d;e=document.createElement("span");e.appendChild(g);g=document.createTextNode(b.description);e.appendChild(g);a.setAttribute("title",b.name+b.description)}else f=b.description;else f=b.proposal;f&&(e=this._createNameNode(f),a.setAttribute("title",f));e.contentAssistProposalIndex=d;return e},_createNameNode:function(a){var b=document.createElement("span");
b.classList.add("proposal-name");b.appendChild(document.createTextNode(a));return b},getProposal:function(a){var b=null;a=a.contentAssistProposalIndex;void 0!==a&&(b=this._contentAssistMode.getProposals()[a]||null);return b},getTopIndex:function(){for(var a=this.parentNode.childNodes,b=0;b<a.length;b++)if(a[b].offsetTop>=this.parentNode.scrollTop)return b;return 0},getBottomIndex:function(){for(var a=this.parentNode.childNodes,b=0;b<a.length;b++){var d=a[b];if(d.offsetTop+d.offsetHeight>this.parentNode.scrollTop+
this.parentNode.clientHeight)return Math.max(0,b-1)}return a.length-1},scrollIndex:function(a,b){this.parentNode.childNodes[a].scrollIntoView(b);this.preserveCloneThroughScroll=!0},selectNode:function(b){var d=null;this.previousSelectedNode&&(this.previousSelectedNode.classList.remove(u.selected),this.previousSelectedNode=null,this.previousCloneNode&&this._removeCloneNode());if(-1!==b){d=this.parentNode.childNodes[b];d.classList.add(u.selected);this.parentNode.setAttribute("aria-activedescendant",
d.id);d.focus();d.offsetTop<this.parentNode.scrollTop?(d.scrollIntoView(!0),this.preserveCloneThroughScroll=!0):d.offsetTop+d.offsetHeight>this.parentNode.scrollTop+this.parentNode.clientHeight&&(d.scrollIntoView(!1),this.preserveCloneThroughScroll=!0);var e=a.bounds(d.firstChild||d),f=a.bounds(this.parentNode);b=window.getComputedStyle(this.parentNode);var g=window.getComputedStyle(d),g=parseInt(b.paddingLeft)+parseInt(b.paddingRight)+parseInt(g.paddingLeft)+parseInt(g.paddingRight);if(e.width>=
f.width-g){g=parseInt(b.top);f=d.cloneNode(!0);f.classList.add("cloneProposal");f.style.top=g+d.offsetTop-this.parentNode.scrollTop+"px";f.style.left=b.left;f.setAttribute("id",f.id+"_clone");e=e.left+e.width-parseInt(document.documentElement.clientWidth);0<e&&(b=parseInt(b.left)-e,0>b&&(b=0),f.style.left=b+"px");b=document.createElement("div");b.id="clone_contentassist";b.classList.add("contentassist");b.classList.add("cloneWrapper");b.appendChild(f);b.onclick=this.parentNode.onclick;this.parentNode.parentNode.insertBefore(b,
this.parentNode);var h=function(a){a.contentAssistProposalIndex=d.contentAssistProposalIndex;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++)h(a.childNodes[b])};h(b);d.classList.remove(u.selected);this.previousCloneNode=b}}this.previousSelectedNode=d},setContentAssistMode:function(a){this._contentAssistMode=a},show:function(){var a=this._contentAssistMode.getProposals();if(0===a.length)this.hide();else{this.parentNode.innerHTML="";for(var b=0;b<a.length;b++)this.createDiv(a[b],this.parentNode,
b);this.position();this.parentNode.onclick=this.onClick.bind(this);this.isShowing=!0;this.textViewListenerAdded||(this.textView.addEventListener("MouseDown",this.textViewListener.onMouseDown),this.textViewListenerAdded=!0)}},hide:function(){this.parentNode.ownerDocument.activeElement===this.parentNode&&this.textView.focus();this.parentNode.style.display="none";this.parentNode.onclick=null;this.isShowing=!1;this.textViewListenerAdded&&(this.textView.removeEventListener("MouseDown",this.textViewListener.onMouseDown),
this.textViewListenerAdded=!1);this.previousSelectedNode&&(this.previousSelectedNode=null,this.previousCloneNode&&this._removeCloneNode())},position:function(){var a=this.contentAssist,b=this.textView;if(void 0!==a.offset){var a=a.offset,d=b.getModel();d.getBaseModel&&(a=d.mapOffset(a,!0))}else a=this.textView.getCaretOffset();a=b.getLocationAtOffset(a);a.y+=b.getLineHeight();this.textView.convert(a,"document","page");this.parentNode.style.position="fixed";this.parentNode.style.left=a.x+"px";this.parentNode.style.top=
a.y+"px";this.parentNode.style.display="block";this.parentNode.scrollTop=0;b=this.parentNode.ownerDocument;d=b.documentElement.clientWidth;a.y+this.parentNode.offsetHeight>b.documentElement.clientHeight&&(this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px");a.x+this.parentNode.offsetWidth>d&&(this.parentNode.style.left=d-this.parentNode.offsetWidth+"px")},_removeCloneNode:function(){this.parentNode.parentNode.contains(this.previousCloneNode)&&this.parentNode.parentNode.removeChild(this.previousCloneNode);
this.previousCloneNode=null}};return{ContentAssist:f,ContentAssistMode:d,ContentAssistWidget:m}});
define("orion/editor/emacs",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(l,p,n,k){function b(b){p.KeyMode.call(this,b)}b.prototype=new p.KeyMode;b.prototype.createKeyBindings=function(){var b=[];b.push({actionID:"emacs-beginning-of-line",keyBinding:this._createStroke("a",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-end-of-line",keyBinding:this._createStroke("e",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-forward-char",keyBinding:this._createStroke("f",
!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-backward-char",keyBinding:this._createStroke("b",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-forward-word",keyBinding:this._createStroke("f",!1,!1,!0)});b.push({actionID:"emacs-backward-word",keyBinding:this._createStroke("b",!1,!1,!0)});b.push({actionID:"emacs-next-line",keyBinding:this._createStroke("n",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-previous-line",keyBinding:this._createStroke("p",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-beginning-of-buffer",
keyBinding:this._createStroke(188,!1,!0,!0)});b.push({actionID:"emacs-end-of-buffer",keyBinding:this._createStroke(190,!1,!0,!0)});b.push({actionID:"emacs-delete-backward-char",keyBinding:this._createStroke(46,!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-delete-char",keyBinding:this._createStroke("d",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-kill-line",keyBinding:this._createStroke("k",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-kill-word",keyBinding:this._createStroke("d",!1,!1,
!0)});b.push({actionID:"emacs-backward-kill-word",keyBinding:this._createStroke(46,!1,!1,!0)});b.push({actionID:"undo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("u")])});b.push({actionID:"redo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("r")])});b.push({actionID:"emacs-scroll-up",keyBinding:this._createStroke("v",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-scroll-down",keyBinding:this._createStroke("v",!1,!1,!0)});b.push({actionID:"emacs-set-mark-command",
keyBinding:this._createStroke(" ",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-reset-mark-command",keyBinding:this._createStroke("g",!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-exchange-point-and-mark",keyBinding:this._createSequence([this._createStroke("x",!k.isMac,!1,!1,k.isMac),this._createStroke("x",!k.isMac,!1,!1,k.isMac)])});for(var g=0;9>=g;g++)b.push({actionID:"emacs-digit-argument-"+g,keyBinding:this._createStroke(48+g,!k.isMac,!1,!1,k.isMac)}),b.push({actionID:"emacs-digit-argument-"+
g,keyBinding:this._createStroke(48+g,!1,!1,!0)}),b.push({actionID:"emacs-digit-argument-"+g,keyBinding:this._createStroke(48+g,!k.isMac,!1,!0,k.isMac)});b.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!k.isMac,!1,!1,k.isMac)});b.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!1,!1,!0)});b.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!k.isMac,!1,!0,k.isMac)});b.push({actionID:"emacs-uppercase",keyBinding:this._createStroke("u",
!1,!1,!0)});b.push({actionID:"emacs-lowercase",keyBinding:this._createStroke("l",!1,!1,!0)});b.push({actionID:"emacs-capitalize",keyBinding:this._createStroke("c",!1,!1,!0)});b.push({actionID:"contentAssist",keyBinding:this._createStroke(191,!1,!1,!0)});b.push({actionID:"find",keyBinding:this._createStroke("r",!1,!1,!0)});b.push({actionID:"incrementalFind",keyBinding:this._createStroke("s",!0)});b.push({actionID:"incrementalFindReverse",keyBinding:this._createStroke("r",!0)});b.push({actionID:"save",
keyBinding:this._createSequence([this._createStroke("x",!k.isMac,!1,!1,k.isMac),this._createStroke("s",!k.isMac,!1,!1,k.isMac)])});this._createActions(this.getView());return b};b.prototype._createStroke=function(b,g,e,a,f){b=new n.KeyStroke(b,g,e,a,f);b.scopeName=l.emacs;return b};b.prototype._createSequence=function(b){b=new n.KeySequence(b);b.scopeName=l.emacs;return b};b.prototype._getData=function(){var b={count:(this._argument||1)*(this._sign||1)};this._argument=0;this._sign=1;return b};b.prototype._moveCursor=
function(b){var g=this._getData();this._marker&&(g.select=!0);return this.getView().invokeAction(b,!1,g)};b.prototype._digitArgument=function(b){this._argument=10*(this._argument||0)+b;return!0};b.prototype._negativeArgument=function(){this._sign=-1*(this._sign||1);return!0};b.prototype._createActions=function(b){var g=this;b.setAction("emacs-beginning-of-line",function(){return g._moveCursor("lineStart")},{name:l.lineStart});b.setAction("emacs-end-of-line",function(){return g._moveCursor("lineEnd")},
{name:l.lineEnd});b.setAction("emacs-forward-char",function(){return g._moveCursor("charNext")},{name:l.charNext});b.setAction("emacs-backward-char",function(){return g._moveCursor("charPrevious")},{name:l.charPrevious});b.setAction("emacs-forward-word",function(){return g._moveCursor("wordNext")},{name:l.wordNext});b.setAction("emacs-backward-word",function(){return g._moveCursor("wordPrevious")},{name:l.wordPrevious});b.setAction("emacs-next-line",function(){return g._moveCursor("lineDown")},{name:l.lineDown});
b.setAction("emacs-previous-line",function(){return g._moveCursor("lineUp")},{name:l.lineUp});b.setAction("emacs-beginning-of-buffer",function(){return g._moveCursor("textStart")},{name:l.textStart});b.setAction("emacs-end-of-buffer",function(){return g._moveCursor("textEnd")},{name:l.textEnd});b.setAction("emacs-delete-backward-char",function(){return b.invokeAction("deletePrevious")},{name:l.deletePrevious});b.setAction("emacs-delete-char",function(){return b.invokeAction("deletePrevious")},{name:l.deletePrevious});
b.setAction("emacs-kill-line",function(){return b.invokeAction("deleteLineEnd")},{name:l.deleteLineEnd});b.setAction("emacs-kill-word",function(){return b.invokeAction("deleteWordNext")},{name:l.deleteWordNext});b.setAction("emacs-backward-kill-word",function(){return b.invokeAction("deleteWordPrevious")},{name:l.deleteWordPrevious});b.setAction("emacs-scroll-up",function(){return g._moveCursor("pageDown")},{name:l.pageDown});b.setAction("emacs-scroll-down",function(){return g._moveCursor("pageUp")},
{name:l.pageUp});b.setAction("emacs-set-mark-command",function(){var e=b.getCaretOffset();b.setCaretOffset(e);g._marker=e;return!0},{name:l.setMarkCommand});b.setAction("emacs-exchange-point-and-mark",function(){if(void 0!==g._marker){var e=b.getCaretOffset(),a=b.getSelection();if(a.end===e){var f=a.start;a.start=a.end;a.end=f}g._marker=e;b.setSelection(a.start,a.end)}return!0},{name:l.exchangeMarkPoint});b.setAction("emacs-reset-mark-command",function(){var e=b.getCaretOffset();b.setCaretOffset(e);
g._marker=void 0;return!0},{name:l.clearMark});b.setAction("emacs-digit-argument-0",function(){return g._digitArgument(0)},{name:k.formatMessage(l.digitArgument,"0")});b.setAction("emacs-digit-argument-1",function(){return g._digitArgument(1)},{name:k.formatMessage(l.digitArgument,"1")});b.setAction("emacs-digit-argument-2",function(){return g._digitArgument(2)},{name:k.formatMessage(l.digitArgument,"2")});b.setAction("emacs-digit-argument-3",function(){return g._digitArgument(3)},{name:k.formatMessage(l.digitArgument,
"3")});b.setAction("emacs-digit-argument-4",function(){return g._digitArgument(4)},{name:k.formatMessage(l.digitArgument,"4")});b.setAction("emacs-digit-argument-5",function(){return g._digitArgument(5)},{name:k.formatMessage(l.digitArgument,"5")});b.setAction("emacs-digit-argument-6",function(){return g._digitArgument(6)},{name:k.formatMessage(l.digitArgument,"6")});b.setAction("emacs-digit-argument-7",function(){return g._digitArgument(7)},{name:k.formatMessage(l.digitArgument,"7")});b.setAction("emacs-digit-argument-8",
function(){return g._digitArgument(8)},{name:k.formatMessage(l.digitArgument,"8")});b.setAction("emacs-digit-argument-9",function(){return g._digitArgument(9)},{name:k.formatMessage(l.digitArgument,"9")});b.setAction("emacs-negative-argument",function(){return g._negativeArgument()},{name:l.negativeArgument});b.setAction("emacs-uppercase",function(){var e=g._getData();e.unit="word";return b.invokeAction("uppercase",!1,e)},{name:l.uppercase});b.setAction("emacs-lowercase",function(){var e=g._getData();
e.unit="word";return b.invokeAction("lowercase",!1,e)},{name:l.lowercase});b.setAction("emacs-capitalize",function(){var e=g._getData();e.unit="word";return b.invokeAction("capitalize",!1,e)},{name:l.capitalize})};return{EmacsMode:b}});
define("orion/editor/vi",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(l,p,n,k){function b(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])}function h(a,b,d,e,f,g,h){a=new n.KeyStroke(a,b,d,e,f,g);a.scopeName=h||l.vi;return a}function g(a,b){var d=new n.KeySequence(a);d.scopeName=b||l.vi;return d}function e(a,b,d){this.key=b;this.msg=d;this.number="";p.KeyMode.call(this,a);a&&this._createActions(a)}function a(a){var b=a.getView();this.viMode=
a;p.KeyMode.call(this,b);this._createActions(b)}function f(a,b,d,f){this.viMode=a;this.nextMode=b;e.call(this,a.getView(),d,f)}function d(a){var b=a.getView();p.KeyMode.call(this,b);this.viMode=a;this._createActions(b)}function m(a,b){e.call(this,a,"",l.vimove);this.insertMode=new d(this);this.changeMode=new f(this,this.insertMode,"c",l.vichange);this.deleteMode=new f(this,this,"d",l.videlete);this.yankMode=new f(this,this,"y",l.viyank);this.statusReporter=b}var r,u;e.prototype=new p.KeyMode;b(e.prototype,
{_msg:function(a){return{name:k.formatMessage(l[a],this.msg)}},createKeyBindings:function(){for(var a=[],b=this.key,b=b?"-"+b+"-":"-",d=0;9>=d;d++)a.push({actionID:"vi"+b+d,keyBinding:h(d+"",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi"+b+"Left",keyBinding:h("h",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"Left",keyBinding:h("h",!0,!1,!1,!1)});a.push({actionID:"vi"+b+"Left",keyBinding:h(8)});a.push({actionID:"vi"+b+"Left",keyBinding:h(37)});a.push({actionID:"vi"+b+"Down",keyBinding:h("j",
!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"Down",keyBinding:h(40)});a.push({actionID:"vi"+b+"Up",keyBinding:h("k",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"Up",keyBinding:h(38)});a.push({actionID:"vi"+b+"Right",keyBinding:h("l",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"Right",keyBinding:h(39)});a.push({actionID:"vi"+b+"Right",keyBinding:h(32)});a.push({actionID:"vi"+b+"w",keyBinding:h("w",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"b",keyBinding:h("b",!1,!1,!1,!1,
"keypress")});a.push({actionID:"vi"+b+"W",keyBinding:h("W",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"B",keyBinding:h("B",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"e",keyBinding:h("e",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"E",keyBinding:h("E",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"$",keyBinding:h("$",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"^_",keyBinding:h("^",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"^_",keyBinding:h("_",!1,!1,!1,!1,"keypress")});
a.push({actionID:"vi"+b+"+",keyBinding:h("+",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"+",keyBinding:h(13)});a.push({actionID:"vi"+b+"-",keyBinding:h("-",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"|",keyBinding:h("|",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"H",keyBinding:h("H",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"M",keyBinding:h("M",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"L",keyBinding:h("L",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"/",
keyBinding:h("/",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"?",keyBinding:h("?",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"n",keyBinding:h("n",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"N",keyBinding:h("N",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"f",keyBinding:h("f",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"F",keyBinding:h("F",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"t",keyBinding:h("t",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"T",keyBinding:h("T",
!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+",",keyBinding:h(",",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+";",keyBinding:h(";",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi"+b+"G",keyBinding:h("G",!1,!1,!1,!1,"keypress")});return a},_createActions:function(a){function b(d){d=a.getModel().getLine(d);for(var e=0,f=d.charCodeAt(e);32===f||9===f;)e++,f=d.charCodeAt(e);return e}function d(a,b){a&&f.getView().setCaretOffset(a.start);b.editDone&&b.editDone()}var e=this.key,e=e?"-"+e+"-":
"-",f=this;a.setAction("vi"+e+"0",function(){return f._storeNumber(0)});a.setAction("vi"+e+"1",function(){return f._storeNumber(1)});a.setAction("vi"+e+"2",function(){return f._storeNumber(2)});a.setAction("vi"+e+"3",function(){return f._storeNumber(3)});a.setAction("vi"+e+"4",function(){return f._storeNumber(4)});a.setAction("vi"+e+"5",function(){return f._storeNumber(5)});a.setAction("vi"+e+"6",function(){return f._storeNumber(6)});a.setAction("vi"+e+"7",function(){return f._storeNumber(7)});a.setAction("vi"+
e+"8",function(){return f._storeNumber(8)});a.setAction("vi"+e+"9",function(){return f._storeNumber(9)});a.setAction("vi"+e+"Left",function(){return f._invoke("charPrevious",{unit:"character"})},this._msg("viLeft"));a.setAction("vi"+e+"Right",function(){return f._invoke("charNext",{unit:"character"})},this._msg("viRight"));a.setAction("vi"+e+"Up",function(){return f._invoke("lineUp",{editLine:!0})},this._msg("viUp"));a.setAction("vi"+e+"Down",function(){return f._invoke("lineDown",{editLine:!0})},
this._msg("viDown"));a.setAction("vi"+e+"w",function(){return f._invoke("wordNext",{unit:"word"})},this._msg("viw"));a.setAction("vi"+e+"b",function(){return f._invoke("wordPrevious",{unit:"word"})},this._msg("vib"));a.setAction("vi"+e+"W",function(){return f._invoke("wordNext",{unit:"wordWS"})},this._msg("viW"));a.setAction("vi"+e+"B",function(){return f._invoke("wordPrevious",{unit:"wordWS"})},this._msg("viB"));a.setAction("vi"+e+"e",function(){f._invoke("charNext",{unit:"character"});f._invoke("wordNext",
{unit:"wordend"});f._invoke("charPrevious",{unit:"character"});return!0},this._msg("vie"));a.setAction("vi"+e+"E",function(){return f._invoke("wordNext",{unit:"wordendWS"})},this._msg("viE"));a.setAction("vi"+e+"$",function(){return f._invoke("lineEnd")},this._msg("vi$"));a.setAction("vi"+e+"^_",function(){return f._invoke(function(){var d=a.getModel(),e=a.getCaretOffset(),e=d.getLineAtOffset(e);a.setCaretOffset(d.getLineStart(e)+b(e))})},this._msg("vi^_"));a.setAction("vi"+e+"+",function(){return f._invoke(function(d){var e=
a.getModel(),f=a.getCaretOffset(),g=e.getLineCount()-1;d=Math.min(e.getLineAtOffset(f)+d.count,g);a.setCaretOffset(e.getLineStart(d)+b(d))},{editLine:!0})},this._msg("vi+"));a.setAction("vi"+e+"-",function(){return f._invoke(function(d){var e=a.getModel(),f=a.getCaretOffset();d=Math.max(e.getLineAtOffset(f)-d.count,0);a.setCaretOffset(e.getLineStart(d)+b(d))},{editLine:!0})},this._msg("vi-"));a.setAction("vi"+e+"|",function(){return f._invoke(function(b){var d=a.getModel(),e=a.getCaretOffset(),e=
d.getLineAtOffset(e);a.setCaretOffset(Math.min(d.getLineStart(e)+b.count-1,d.getLineEnd(e)))})},this._msg("vi|"));a.setAction("vi"+e+"H",function(){return f._invoke(function(b){b=a.getModel().getLineStart(a.getTopIndex(!0)+(b.count-1));a.setCaretOffset(b)},{editLine:!0})},this._msg("viH"));a.setAction("vi"+e+"M",function(){return f._invoke(function(b){b=Math.ceil((a.getBottomIndex(!0)-a.getTopIndex(!0))/2)+a.getTopIndex(!0);a.setCaretOffset(a.getModel().getLineStart(b))},{editLine:!0})},this._msg("viM"));
a.setAction("vi"+e+"L",function(){return f._invoke(function(b){a.setCaretOffset(a.getModel().getLineStart(a.getBottomIndex(!0)-(b.count-1)))},{editLine:!0})},this._msg("viL"));a.setAction("vi"+e+"/",function(){var a={hideAfterFind:!0,incremental:!1,reverse:!1,findCallback:function(b){f._searchFwd=!0;d(b,a)}};return f._invoke("find",a)},this._msg("vi/"));a.setAction("vi"+e+"?",function(){var a={hideAfterFind:!0,incremental:!1,reverse:!0,findCallback:function(b){f._searchFwd=!1;d(b,a)}};return f._invoke("find",
a)},this._msg("vi?"));a.setAction("vi"+e+"n",function(){var b,e=a.getCaretOffset();f._searchFwd?(b="findNext",e++):b="findPrevious";var g={start:e,findCallback:function(a){d(a,g)}};return f._invoke(b,g)},this._msg("vin"));a.setAction("vi"+e+"N",function(){var b,e=a.getCaretOffset();f._searchFwd?b="findPrevious":(b="findNext",e++);var g={start:e,findCallback:function(a){d(a,g)}};return f._invoke(b,g)},this._msg("viN"));a.setAction("vi"+e+"f",function(){var b=a.getModel(),d=a.getCaretOffset();return f._findChar(d,
b.getLineEnd(b.getLineAtOffset(d)),!1,0)},this._msg("vif"));a.setAction("vi"+e+"F",function(){var b=a.getModel(),d=a.getCaretOffset();return f._findChar(b.getLineStart(b.getLineAtOffset(d)),d,!0,0)},this._msg("viF"));a.setAction("vi"+e+"t",function(){var b=a.getModel(),d=a.getCaretOffset();return f._findChar(d,b.getLineEnd(b.getLineAtOffset(d)),!1,-1)},this._msg("vit"));a.setAction("vi"+e+"T",function(){var b=a.getModel(),d=a.getCaretOffset();return f._findChar(b.getLineStart(b.getLineAtOffset(d)),
d,!0,1)},this._msg("viT"));a.setAction("vi"+e+",",function(){return f._findNextChar(f._charTempOptions.reverse)},this._msg("vi,"));a.setAction("vi"+e+";",function(){return f._findNextChar(!f._charTempOptions.reverse)},this._msg("vi;"));a.setAction("vi"+e+"G",function(){if(""===f.number){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());f.number=b.getLineCount()}return f._invoke(function(b){b=b||{};b.line=b.count;b.editLine=!0;b.callback=function(){b.editDone&&b.editDone()};a.invokeAction("gotoLine",
!1,b)})},this._msg("viG"))},_invoke:function(a,b){var d=this.getView();b=b||{};b.count=this._getCount();"function"===typeof a?a(b):d.invokeAction(a,!1,b);return!0},_getCount:function(){var a=1;""!==this.number&&(a=this.number>>0);this.number="";return a},_findChar:function(a,b,d,e){this._charTempOptions={};this._charTempOptions.start=a;this._charTempOptions.end=b;this._charTempOptions.hideAfterFind=!0;this._charTempOptions.incremental=!1;this._charTempOptions.reverse=d;this._charTempOptions.offset=
e;var f=this._charTempOptions,g=this;this._charTempOptions.findCallback=function(a){a&&g.getView().setCaretOffset(a.start+e);f.editDone&&f.editDone()};return this._invoke("find",this._charTempOptions)},_findNextChar:function(a){if(this._charTempOptions){var b=this.getView(),d={};d.hideAfterFind=this._charTempOptions.hideAfterFind;d.incremental=this._charTempOptions.incremental;d.reverse=this._charTempOptions.reverse;d.wrap=!1;var e=this;d.findCallback=function(a){a&&e.getView().setCaretOffset(a.start+
e._charTempOptions.offset);d.editDone&&d.editDone()};var f=b.getModel();if(a)return d.start=b.getCaretOffset()+1-this._charTempOptions.offset,d.end=f.getLineEnd(f.getLineAtOffset(d.start)),d.reverse=!1,this._invoke("findNext",d);d.start=b.getCaretOffset()-this._charTempOptions.offset;d.end=f.getLineStart(f.getLineAtOffset(d.start));d.reverse=!0;return this._invoke("findPrevious",d)}return!0},_storeNumber:function(a){var b=this;if(0===a&&!this.number)return this._invoke(function(){b.getView().invokeAction("lineStart",
!0)});this.number+=a;return!0}});a.prototype=new p.KeyMode;b(a.prototype,{createKeyBindings:function(){var a=[];a.push({actionID:"vi-:-ESC",keyBinding:h(27),predefined:!0});return a},_createActions:function(a){var b=this;a.setAction("vi-:-ESC",function(){a.removeKeyMode(b);a.addKeyMode(b.viMode);return!0})},match:function(a){var b=p.KeyMode.prototype.match.call(this,a);b||(b=this.getView().getKeyModes()[0].match(a));return b},storeNumber:function(a){this.number=a}});f.prototype=new e;b(f.prototype,
{createKeyBindings:function(){var a=e.prototype.createKeyBindings.call(this);a.push({actionID:"vi-"+this.key+"ESC",keyBinding:h(27),predefined:!0});a.push({actionID:"vi-"+this.key+"-"+this.key,keyBinding:h(this.key,!1,!1,!1,!1,"keypress")});return a},_invoke:function(a,b){b=b||{};var d=this.getView(),f=d.getCaretOffset(),g=f,h=d.getModel(),k=this;b.editDone=function(){var a=d.getCaretOffset();if(g>a){var e=g;g=a;a=e}b.editLine&&(g=h.getLineStart(h.getLineAtOffset(g)),a=h.getLineEnd(h.getLineAtOffset(a),
"c"===k.key?!1:!0));"y"===k.key?(r=d.getText(g,a),u=b.editLine,d.setCaretOffset(f)):d.setText("",g,a);d.removeKeyMode(k);d.addKeyMode(k.nextMode)};e.prototype._invoke.call(this,a,b);b.editDone();return!0},_getCount:function(){var a=1;""!==this.firstNumber&&(a=this.firstNumber>>0);var b=1;""!==this.number&&(b=this.number>>0);this.number=this.firstNumber="";return a*b},_createActions:function(a){e.prototype._createActions.call(this,a);var b=this;a.setAction("vi-"+b.key+"ESC",function(){a.removeKeyMode(b);
a.addKeyMode(b.viMode);return!0});a.setAction("vi-"+b.key+"-"+b.key,function(){return b._invoke("lineEnd",{editLine:!0})},this._msg("viycd"))},storeNumber:function(a){this.firstNumber=a},_modeAdded:function(){this.secondNumber=""},_modeRemoved:function(){this.number=this.firstNumber=this.command=""}});d.prototype=new p.KeyMode;b(d.prototype,{createKeyBindings:function(){var a=[];a.push({actionID:"vi-insert-ESC",keyBinding:h(27),predefined:!0});return a},_createActions:function(a){var b=this;a.setAction("vi-insert-ESC",
function(){a.removeKeyMode(b);a.addKeyMode(b.viMode);return!0})},match:function(a){var b=p.KeyMode.prototype.match.call(this,a);b||(b=this.getView().getKeyModes()[0].match(a));return b},storeNumber:function(a){}});m.prototype=new e;b(m.prototype,{createKeyBindings:function(){var a=e.prototype.createKeyBindings.call(this);a.push({actionID:"vi-ctrl-f",keyBinding:h("f",!0)});a.push({actionID:"vi-ctrl-b",keyBinding:h("b",!0)});a.push({actionID:"vi-ctrl-e",keyBinding:h("e",!0)});a.push({actionID:"vi-ctrl-y",
keyBinding:h("y",!0)});a.push({actionID:"statusLineMode",keyBinding:h(":",!1,!1,!1,!1,"keypress")});a.push({actionID:"vi-a",keyBinding:h("a",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-A",keyBinding:h("A",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-i",keyBinding:h("i",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-I",keyBinding:h("I",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-o",keyBinding:h("o",!1,!1,!1,!1,"keypress"),predefined:!0});
a.push({actionID:"vi-O",keyBinding:h("O",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-R",keyBinding:h("R",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-s",keyBinding:h("s",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-S",keyBinding:h("S",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-p",keyBinding:h("p",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-P",keyBinding:h("P",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-u",
keyBinding:h("u",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-c",keyBinding:h("c",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-d",keyBinding:h("d",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-y",keyBinding:h("y",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-~",keyBinding:h("~",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-x",keyBinding:h("x",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-X",keyBinding:h("X",
!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-C",keyBinding:h("C",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-D",keyBinding:h("D",!1,!1,!1,!1,"keypress"),predefined:!0});a.push({actionID:"vi-*",keyBinding:h("*",!1,!1,!1,!1,"keypress"),predefined:!0});return a},getKeyBindings:function(a){var b=p.KeyMode.prototype.getKeyBindings.call(this,a),b=b||[],d=this.changeMode.getKeyBindings(a),e;if(!this.changeMode.isActive())for(e=0;e<d.length;e++)d[e]=g([h("c",!1,!1,!1,!1,"keypress"),
d[e]]);b=b.concat(d);d=this.deleteMode.getKeyBindings(a);if(!this.deleteMode.isActive())for(e=0;e<d.length;e++)d[e]=g([h("d",!1,!1,!1,!1,"keypress"),d[e]]);b=b.concat(d);d=this.yankMode.getKeyBindings(a);if(!this.yankMode.isActive())for(e=0;e<d.length;e++)d[e]=g([h("y",!1,!1,!1,!1,"keypress"),d[e]]);return b=b.concat(d)},match:function(a){var b=p.KeyMode.prototype.match.call(this,a);!b&&"keypress"===a.type&&(b="noop");return b},_createActions:function(a){e.prototype._createActions.call(this,a);var b=
this;a.setAction("vi-ctrl-f",function(){return b._invoke("pageDown")},{name:l.pageDown});a.setAction("vi-ctrl-b",function(){return b._invoke("pageUp")},{name:l.pageUp});a.setAction("vi-ctrl-e",function(){return b._invoke("scrollLineDown")},{name:l.scrollLineDown});a.setAction("vi-ctrl-y",function(){return b._invoke("scrollLineUp")},{name:l.scrollLineUp});a.setAction("vi-a",function(){return b._toInsertMode("charNext")},{name:l.via});a.setAction("vi-A",function(){return b._toInsertMode("lineEnd")},
{name:l.viA});a.setAction("vi-i",function(){return b._toInsertMode("noop")},{name:l.vii});a.setAction("vi-I",function(){return b._toInsertMode("lineStart")},{name:l.viI});a.setAction("vi-O",function(){b._invoke("lineUp");b._invoke("lineEnd");b._toInsertMode("enter");return!0},{name:l.viO});a.setAction("vi-o",function(){b._invoke("lineEnd");b._toInsertMode("enter");return!0},{name:l.vio});a.setAction("vi-R",function(){return b._toInsertMode("toggleOverwriteMode")},{name:l.viR});a.setAction("vi-s",
function(){return b._toInsertMode("deleteNext",{unit:"char"})},{name:l.vis});a.setAction("vi-S",function(){return b._toInsertMode("deleteLines",{unit:"line"})},{name:l.viS});a.setAction("vi-p",function(){return b._invoke(function(){var a=b.getView(),d=a.getSelection();if(d.start===d.end){var e=a.getModel(),f=a.getCaretOffset();u?d.start=d.end=e.getLineEnd(e.getLineAtOffset(f),!0):(d.start++,d.end++)}a.setText(r,d.start,d.end)})},{name:l.vip});a.setAction("vi-P",function(){return b._invoke(function(){var a=
b.getView(),d=a.getSelection();if(d.start===d.end){var e=a.getModel(),f=a.getCaretOffset();u&&(d.start=d.end=e.getLineStart(e.getLineAtOffset(f)))}a.setText(r,d.start,d.end)})},{name:l.viP});a.setAction("vi-u",function(){return b._invoke("undo")},{name:l.Undo});a.setAction("vi-c",function(){a.removeKeyMode(b);a.addKeyMode(b.changeMode);b.changeMode.storeNumber(b.number);b.number="";return!0});a.setAction("vi-d",function(){a.removeKeyMode(b);a.addKeyMode(b.deleteMode);b.deleteMode.storeNumber(b.number);
b.number="";return!0});a.setAction("vi-y",function(){a.removeKeyMode(b);a.addKeyMode(b.yankMode);b.yankMode.storeNumber(b.number);b.number="";return!0});a.setAction("vi-~",function(){return b._invoke("reversecase")},{name:l.reversecase});a.setAction("vi-x",function(){return b._invoke("deleteNext")},{name:l.deleteNext});a.setAction("vi-X",function(){return b._invoke("deletePrevious")},{name:l.deletePrevious});a.setAction("vi-C",function(){return b._toInsertMode("deleteLineEnd")},{name:l.viC});a.setAction("vi-D",
function(){return b._invoke("deleteLineEnd")},{name:l.deleteLineEnd});a.setAction("vi-*",function(){var a=b.getView(),d=a.getCaretOffset(),d=a.getNextOffset(d+1,{count:-1,unit:"word"}),e=a.getNextOffset(d,{count:1,unit:"wordend"}),a=a.getText(d,e);b._searchFwd=!0;return b._invoke("find",{hideAfterFind:!0,incremental:!1,reverse:!1,findString:a})},{name:l.viStar})},_reportStatus:function(a){this.statusReporter&&this.statusReporter(a)},_toInsertMode:function(a,b){b=b||{};var d=1;""!==this.number&&(d=
this.number>>0);b.count=d;d=this.getView();this.insertMode.storeNumber(this.number);d.invokeAction(a,!1,b);d.removeKeyMode(this);d.addKeyMode(this.insertMode);this.number="";return!0},_modeAdded:function(){this.getView().setOptions({blockCursorVisible:!0})},_modeRemoved:function(){var a=this.getView();a.setOptions({blockCursorVisible:!1});a.removeKeyMode(this.insertMode);a.removeKeyMode(this.changeMode);a.removeKeyMode(this.deleteMode)}});return{VIMode:m}});
define("orion/editorPreferences",[],function(){function l(k,b){this._preferences=k;if(this._callback=b)var h=k.listenForChangedSettings(p,function(g){g.key===h&&b()}.bind(this))}var p="/editor/settings",n={autoSave:!1,autoSaveVisible:!0,autoSaveLocalVisible:!0,autoSaveTimeout:250,autoSaveTimeoutVisible:!0,themeVisible:!0,themeLocalVisible:!0,fontSizeVisible:!0,fontSizeLocalVisible:!0,autoLoad:!0,autoLoadVisible:!0,saveDiffs:!0,saveDiffsVisible:!0,contentAssistAutoTrigger:!0,contentAssistAutoTriggerVisible:!0,
showOccurrences:!1,showOccurrencesVisible:!0,autoPairParentheses:!0,autoPairParenthesesVisible:!0,autoPairBraces:!0,autoPairBracesVisible:!0,autoPairSquareBrackets:!0,autoPairSquareBracketsVisible:!0,autoPairAngleBrackets:!1,autoPairAngleBracketsVisible:!0,autoPairQuotations:!0,autoPairQuotationsVisible:!0,autoCompleteComments:!0,autoCompleteCommentsVisible:!0,smartIndentation:!0,smartIndentationVisible:!0,trimTrailingWhiteSpace:!1,trimTrailingWhiteSpaceVisible:!0,tabSize:4,tabSizeVisible:!0,expandTab:!1,
expandTabVisible:!0,scrollAnimation:!0,scrollAnimationVisible:!0,scrollAnimationTimeout:300,scrollAnimationTimeoutVisible:!0,annotationRuler:!0,annotationRulerVisible:!0,lineNumberRuler:!0,lineNumberRulerVisible:!0,foldingRuler:!0,foldingRulerVisible:!0,overviewRuler:!0,overviewRulerVisible:!0,showTabs:!1,showTabsVisible:!0,showSpaces:!1,showSpacesVisible:!0,wordWrap:!1,wordWrapVisible:!0,showMargin:!1,showMarginVisible:!0,marginOffset:80,marginOffsetVisible:!0,keyBindings:"Default",keyBindingsVisible:!0,
keyBindingsLocalVisible:!0,splitOrientation:"horizontal",splitOrientationVisible:!0,splitOrientationLocalVisible:!0};l.prototype={_initialize:function(k){k=k.get("editorSettings")||{};for(var b in n)k.hasOwnProperty(b)||(k[b]=n[b]);return k},getPrefs:function(k){this._preferences.getPreferences(p).then(function(b){b=this._initialize(b);"string"===typeof b&&(b=JSON.parse(b));k(b)}.bind(this))},setPrefs:function(k,b){this._preferences.getPreferences(p).then(function(h){h.put("editorSettings",k);k=this._initialize(h);
b&&b(k);this._callback&&this._callback(k)}.bind(this))}};return{EditorPreferences:l}});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/ThemeVersion"],function(l,p,n){function k(){}function b(){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=e;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=e;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=e;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=e;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=e;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=e;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=e;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=e;a.constant="blue";this.styles.push(a)}function h(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", monospace',e="10pt";b.prototype.styles=[];b.prototype.getStyles=h;b.prototype.fontSettable=!0;b.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",
version:n}};b.prototype.parseToXML=function(a){try{var b=null;if(window.DOMParser){var b=(new DOMParser).parseFromString(a,"text/xml"),d=b.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?b:null}b=new ActiveXObject("Microsoft.XMLDOM");b.async=!1;b.loadXML(a);return b}catch(e){}};b.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};b.prototype.importTheme=function(a){console.log("import theme");console.log(a);var b=a.parameters.valueFor("name"),b=this.parseToXML(b),
d=new k;d.name=b.getElementsByTagName("colorTheme")[0].attributes[1].value;d.annotationRuler=b.getElementsByTagName("background")[0].attributes[0].value;d.background=b.getElementsByTagName("background")[0].attributes[0].value;d.comment=b.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=b.getElementsByTagName("keyword")[0].attributes[0].value;d.text=b.getElementsByTagName("foreground")[0].attributes[0].value;d.string=b.getElementsByTagName("string")[0].attributes[0].value;
d.overviewRuler=b.getElementsByTagName("background")[0].attributes[0].value;d.lineNumberOdd=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=b.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(d)};b.prototype.processSettings=function(a,b){var d=p.TextTheme.getTheme();d.setThemeClass("editorTheme",
d.buildStyleSheet("editorTheme",a))};b.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},b=a.left,d=a.top;a.shapes=[{type:"TEXT",name:l["Line Numbers"],label:"1",x:b+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:l.Background,x:b+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:l.Strings,label:"'text/javascript'",x:b+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:b+124,y:d+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Current Line"],x:b+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:b+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Overview Ruler"],x:b+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:l.Comments,label:"/* comment */",
x:b+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cscript",x:b+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:b+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'Result'",x:b+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"multiply(a,b){",x:b+120,y:d+
60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"function",x:b+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:b+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output \x3d ",x:b+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:";",x:b+205,y:d+80,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:b+95,y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"result \x3d a*b;",x:b+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"return",x:b+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output + result;",x:b+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:l.Foreground,label:"}",x:b+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/script\x3e",x:b+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cstyle",x:b+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:b+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:b+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'text/css'",x:b+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:b+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:".some-class",x:b+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],
label:"{",x:b+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Attribute"],label:"color:",x:b+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Value"],label:"#123456",x:b+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Text"],label:";",x:b+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:"}",x:b+
75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/style\x3e",x:b+55,y:d+280,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Annotation Ruler"],x:b,y:d,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var e=0;16>e;e++)a.shapes.push({type:"TEXT",name:l["Line Numbers"],label:e+1,x:b+20,y:d+20*e+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:b,
getStyles:h}});
define("orion/widgets/input/TextField",["orion/objects","orion/webui/littlelib"],function(l,p){function n(k,b){l.mixin(this,k);this.node=b||document.createElement("div");this.node.innerHTML=this.templateString;this.textfield=p.$(".setting-control",this.node)}l.mixin(n.prototype,{templateString:'\x3cinput type\x3d"text" class\x3d"setting-control" name\x3d"myname"/\x3e',category:null,item:null,element:null,ui:null,show:function(){this.textfield.addEventListener("change",this.change.bind(this));this.postCreate()},
destroy:function(){this.node&&(p.empty(this.node),this.textfield=this.node=null)},setStorageItem:function(){},width:function(k){this.textfield.style.width=k},getValue:function(){return"integer"===this.inputType?parseInt(this.textfield.value,10):this.textfield.value},setValue:function(k){this.textfield.value=k},getSelection:function(){return this.getValue()},setSelection:function(k){this.setValue(k)},postCreate:function(){this.inputType&&"password"===this.inputType&&(this.textfield.type="password");
this.editmode&&"readonly"===this.editmode&&this.textfield.setAttribute("readonly","true")},change:function(){var k;this.selection&&this.selection.value&&(k=this.selection.value);this.setStorageItem(this.category,this.item,this.element,k,this.ui)}});return n});
define("orion/widgets/input/LabeledTextfield",["orion/objects","orion/webui/littlelib","orion/widgets/input/TextField"],function(l,p,n){function k(b,h){n.apply(this,arguments);this.mylabel=p.$(".setting-label",this.node)}l.mixin(k.prototype,n.prototype,{templateString:'\x3cdiv class\x3d"setting-property"\x3e\x3clabel\x3e\x3cspan class\x3d"setting-label"\x3e\x3c/span\x3e\x3cinput class\x3d"setting-control" type\x3d"text" /\x3e\x3c/label\x3e\x3c/div\x3e',destroy:function(){n.prototype.destroy.call(this);
this.mylabel&&(this.mylabel=null)},postCreate:function(){n.prototype.postCreate.call(this);this.mylabel.textContent=this.fieldlabel+":"}});return k});
define("orion/widgets/input/Checkbox",["orion/objects","orion/webui/littlelib"],function(l,p){function n(k,b){l.mixin(this,k);this.node=b||document.createElement("div");this.node.innerHTML=this.templateString;this.checkbox=p.$(".setting-control",this.node)}l.mixin(n.prototype,{templateString:'\x3clabel\x3e\x3cinput class\x3d"setting-control settingsCheckbox" type\x3d"checkbox"/\x3e\x3c/label\x3e',show:function(){this.checkbox.addEventListener("change",this.change.bind(this));this.postCreate()},destroy:function(){this.node&&
(p.empty(this.node),this.checkbox=this.node=null)},setStorageItem:function(){},isChecked:function(){return this.checkbox.checked},setChecked:function(k){this.checkbox.checked=k},getSelection:function(){return this.isChecked()},setSelection:function(k){this.setChecked(k)},change:function(){this.setStorageItem(this.checkbox.value)},postCreate:function(){this.checkbox.style.width="20px";this.editmode&&"readonly"===this.editmode&&this.checkbox.setAttribute("disabled","disabled")}});return n});
define("orion/widgets/input/LabeledCheckbox",["orion/objects","orion/webui/littlelib","orion/widgets/input/Checkbox"],function(l,p,n){function k(b,h){n.apply(this,arguments);this.mylabel=p.$(".setting-label",this.node)}l.mixin(k.prototype,n.prototype,{templateString:'\x3clabel\x3e\x3cspan class\x3d"setting-label"\x3e\x3c/span\x3e\x3cinput class\x3d"setting-control settingsCheckbox" type\x3d"checkbox"/\x3e\x3c/label\x3e',postCreate:function(){n.prototype.postCreate.call(this);this.mylabel.textContent=
this.fieldlabel+":"},destroy:function(){n.prototype.destroy.call(this);this.mylabel&&(this.mylabel=null)}});return k});
define("orion/widgets/input/Select",["orion/objects","orion/webui/littlelib"],function(l,p){function n(k,b){l.mixin(this,k);this.node=b||document.createElement("div");this.node.innerHTML=this.templateString;this.select=p.$(".setting-control",this.node)}l.mixin(n.prototype,{templateString:'\x3cselect class\x3d"setting-control" id\x3d"selection"\x3e\x3c/select\x3e',addOptions:function(k,b,h){b=document.createElement("option");b.value=k.value;b.appendChild(document.createTextNode("string"===typeof k.label?
k.label:k.value));k.selected&&(b.selected="selected");this.select.appendChild(b)},show:function(){this.postCreate()},postCreate:function(){this.options.forEach(this.addOptions.bind(this));this.select.addEventListener("change",this.change.bind(this))},destroy:function(){this.node&&(p.empty(this.node),this.node=this.select=null)},setStorageItem:function(){},getSelected:function(){return this.select.value},getSelectedIndex:function(){return this.select.selectedIndex},setSelectedIndex:function(k){this.select.selectedIndex=
k},getSelection:function(){return this.getSelected()},setSelection:function(k){for(var b=0;b<this.options.length;b++)if(this.options[b].value===k){this.setSelectedIndex(b);return}this.setSelectedIndex(0)},change:function(){var k=this.select.value;this.category?this.setStorageItem(this.category,this.item,this.element,k,this.ui):this.setStorageItem(k)}});return n});
define("orion/widgets/input/LabeledSelect",["orion/objects","orion/webui/littlelib","orion/widgets/input/Select"],function(l,p,n){function k(b,h){n.apply(this,arguments);this.mylabel=p.$(".setting-label",this.node)}l.mixin(k.prototype,n.prototype,{templateString:'\x3cdiv class\x3d"setting-property"\x3e\x3clabel\x3e\x3cspan class\x3d"setting-label"\x3e\x3c/span\x3e\x3cselect class\x3d"setting-control"\x3e\x3c/select\x3e\x3c/label\x3e\x3c/div\x3e',postCreate:function(){n.prototype.postCreate.call(this);
this.mylabel.textContent=this.fieldlabel+":"},destroy:function(){n.prototype.destroy.call(this);this.mylabel&&(this.mylabel=null)}});return k});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(l,p,n,k,b,h){function g(a,b){var d=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");
var e=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var g=0;g<e.length;g++)this.domNode.classList.add(e[g]);this.domNode.id=b.id;b.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===d.titleNode||a.target===d.twistie||a.target===d.domNode)&&d._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===l.KEY.ENTER&&(a.target===d.domNode||a.target===d.titleNode||a.target===d.twistie)&&d._changeExpandedState()},!1));if(b.iconClass){var h=document.createElement("span");h.classList.add("sectionIcon");this.domNode.appendChild(h);e=Array.isArray(b.iconClass)?b.iconClass:
[b.iconClass];e.forEach(function(a){h.classList.add(a)})}b.headerClass&&(e=Array.isArray(b.headerClass)?b.headerClass:[b.headerClass],e.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleActionsNode=document.createElement("div");this.titleActionsNode.id=b.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=
b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;"function"===typeof b.getItemCount&&(e=document.createElement("div"),e.classList.add("layoutLeft"),e.classList.add("sectionItemCount"),this.domNode.appendChild(e),e.textContent=b.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=b.id+"Progress";
this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.display="none";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);this.titleLeftActionsNode=document.createElement("div");this.titleLeftActionsNode.id=b.id+"LeftTitleActionsArea";this.titleLeftActionsNode.classList.add("layoutLeft");this.titleLeftActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleLeftActionsNode);
e=document.createElement("div");e.id=b.id+"FilterSearchBox";this.domNode.appendChild(e);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=b.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=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);b.slideout&&(e=k.slideoutHTMLFragment(b.id),g=document.createRange(),g.selectNode(this.domNode),e=g.createContextualFragment(e),
this.domNode.appendChild(e));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);"function"===typeof b.onExpandCollapse&&(this._onExpandCollapse=b.onExpandCollapse);this._preferenceService=b.preferenceService;this._collapse();if(this._preferenceService){var q=
this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(q.id);void 0===a?b.hidden||q._expand():a&&q._expand();q._updateExpandedState(!1)})}else b.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function e(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,d){this._contentParent.innerHTML="";a.parent||(a.parent=e);this._contentParent.appendChild(a.parent);a.section=this;b.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 d=this.getNavHandler();d&&d.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&&!d&&(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 b=this.registerCommands();!b||!b.then?a.updateCommands():b.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,b.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 e(this)},_setMonitorMessage:function(a,b){this._progressNode.style.display="block";this._loading[a]=b;var d="",e;for(e in this._loading)""!==d&&(d+="\n"),d+=this._loading[e];this._progressNode.title=d;this._updateExpandedState(!1)},_monitorDone:function(a){delete this._loading[a];a="";for(var b in this._loading)""!==a&&(a+="\n"),a+=this._loading[b];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 b=!this.hidden,d=this.working,e=this.twistie,g=this.id;e&&(e.classList.remove(this._expandImageClass),e.classList.remove(this._collapseImageClass),e.classList.remove(this._progressImageClass),e.classList.add(d?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(g,
b)});this._onExpandCollapse&&this._onExpandCollapse(b,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;e.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)}};e.prototype.constructor=e;return{Section:g}});
define("orion/widgets/settings/Subsection",[],function(){function l(l){var n=l.sectionName;this.parentNode=l.parentNode;this.children=l.children;l=document.createElement("section");l.classList.add("setting-row");l.setAttribute("role","region");l.setAttribute("aria-labelledby","Navigation-header");var k=document.createElement("h3");k.classList.add("setting-header");k.textContent=n;n=document.createElement("div");n.classList.add("setting-content");l.appendChild(k);l.appendChild(n);this.node=l;this.subsectionContent=
n}l.prototype.show=function(){this.parentNode&&this.parentNode.appendChild(this.node);if(this.children){var l=this;this.children.forEach(function(n){l.subsectionContent.appendChild(n.node);n.show()})}};return l});
define("orion/widgets/settings/EditorSettings","i18n!orion/settings/nls/messages orion/widgets/input/LabeledTextfield orion/widgets/input/LabeledCheckbox orion/widgets/input/LabeledSelect orion/section orion/widgets/settings/Subsection orion/commands orion/objects orion/webui/littlelib".split(" "),function(l,p,n,k,b,h,g,e,a){function f(b,d,e,f,g){if(!f.local){var h=document.createElement("span");h.classList.add(t);h.classList.add(g[d+"LocalVisible"]?w:s);h.title=l.localSettingsTooltip;h.addEventListener("click",
function(a){h.classList.contains(s)?(h.classList.add(w),h.classList.remove(s)):(h.classList.add(s),h.classList.remove(w))});d=a.$("label",b.node);d.parentNode.insertBefore(h,d)}return b}function d(a,b,d){return f(new n(b),a,this,b,d)}function m(a,b,d){b.inputType="integer";return f(new p(b),a,this,b,d)}function r(a,b,d){var e=this.values;b.options=[];for(var g=0;g<e.length;g++){var h=e[g],m={value:h.value,label:h.label};h.value===d[a]&&(m.selected=!0);b.options.push(m)}return f(new k(b),a,this,b,
d)}function u(a,b){return!(this.min<=b[a]&&b[a]<=this.max)?l[a+"Invalid"]:""}function q(a,b){e.mixin(this,a);this.node=b}var t="setting-local-indicator",w="on",s="off",x={editorSettings:{keys:{keyBindings:{values:[{value:"",label:l.Default},{value:"Emacs",label:"Emacs"},{value:"vi",label:"vi"}],create:r}},splitEditors:{splitOrientation:{values:[{value:"vertical",label:l.vertical},{value:"horizontal",label:l.horizontal}],create:r}},fileManagement:{autoSave:{create:d},autoSaveTimeout:{min:50,max:1E4,
create:m,validate:u},autoLoad:{create:d},saveDiffs:{create:d},trimTrailingWhiteSpace:{create:d}},typing:{autoPairQuotations:{create:d},autoPairParentheses:{create:d},autoPairBraces:{create:d},autoPairSquareBrackets:{create:d},autoPairAngleBrackets:{create:d},autoCompleteComments:{create:d},smartIndentation:{create:d}},tabs:{tabSize:{min:1,max:16,create:m,validate:u},expandTab:{create:d}},whitespaces:{showTabs:{create:d},showSpaces:{create:d}},wrapping:{wordWrap:{create:d},showMargin:{create:d},marginOffset:{min:10,
max:200,create:m,validate:u}},smoothScrolling:{scrollAnimation:{create:d},scrollAnimationTimeout:{min:50,max:1E3,create:m,validate:u}},rulers:{annotationRuler:{create:d},lineNumberRuler:{create:d},foldingRuler:{create:d},overviewRuler:{create:d}},languageTools:{showOccurrences:{create:d},contentAssistAutoTrigger:{create:d}}}};e.mixin(q.prototype,{templateString:'\x3cdiv class\x3d"sections"\x3e\x3c/div\x3e',commandTemplate:'\x3cdiv id\x3d"commandButtons"\x3e\x3cdiv id\x3d"editorCommands" class\x3d"layoutRight sectionActions"\x3e\x3c/div\x3e\x3c/div\x3e',
createElements:function(){this.node.innerHTML=this.templateString;this.sections=a.$(".sections",this.node);this.createSections();this.local?this.sections.classList.add("local"):(document.getElementById("pageActions").innerHTML=this.commandTemplate,this.createToolbar())},createSections:function(){var d=this.oldPrefs,e=[],f,g,m=this.themePreferences;if(!this.local&&this.editorThemeWidget)this.editorThemeSection=new b.Section(this.sections,{id:"editorThemeSettings",title:l.EditorThemes,canHide:!0,slideout:!0}),
this.editorThemeWidget.renderData(this.editorThemeSection.getContentElement(),"INITIALIZE");else{var q=this.oldThemeStyles;if(d.themeVisible&&(!this.local||d.themeLocalVisible)){var n=q.styles;f=[];for(var p=0;p<n.length;p++)g={value:n[p].name,label:n[p].name},n[p].name===q.style.name&&(g.selected=!0),f.push(g);e.push(f=this.themeSelect=new k({fieldlabel:l.Theme,options:f}));f.setStorageItem=function(a){m.setTheme(a)}}if(d.fontSizeVisible&&(!this.local||d.fontSizeLocalVisible)){q=q.style.fontSize;
f=[];for(n=8;19>n;n++)g={value:n+"pt",label:n+"pt"},g.label===q&&(g.selected=!0),f.push(g);e.push(f=this.sizeSelect=new k({fieldlabel:l["Font Size"],options:f}));f.setStorageItem=function(a){m.setFontSize(a)}}!this.local&&0<e.length&&(e=new h({sectionName:l.Theme,parentNode:this.editorThemeSection.getContentElement(),children:e}),e.show(),e=[])}var r,u;for(u in x)if(x.hasOwnProperty(u)){this.local||(r=new b.Section(this.sections,{id:u,title:l[u],canHide:!0,slideout:!0}),f=document.createElement("div"),
f.classList.add("setting-info"),f.textContent=l.editorSettingsInfo,g=document.createElement("span"),g.classList.add(t),g.classList.add(w),q=document.createElement("span"),q.classList.add(t),q.classList.add(s),n=document.createElement("span"),n.classList.add("core-sprite-wrench"),n.classList.add("icon-inline"),n.classList.add("imageSprite"),a.processDOMNodes(f,[g,q,n]),r.getContentElement().appendChild(f));for(var G in x[u])if(x[u].hasOwnProperty(G)){for(var H in x[u][G])if(d[H+"Visible"]&&(!this.local||
d[H+"LocalVisible"]))g=x[u][G][H],f={},f.local=this.local,f.fieldlabel=l[H],e.push(g.widget=g.create(H,f,d));!this.local&&0<e.length&&(e=new h({sectionName:l[G],parentNode:r.getContentElement(),children:e}),e.show(),e=[])}}this.local&&e.forEach(function(a){this.sections.appendChild(a.node);a.hasOwnProperty("setStorageItem")||(a.setStorageItem=this.update.bind(this));a.show()}.bind(this))},createToolbar:function(){var b=a.node("editorSettingsToolActionsArea"),d=new g.Command({name:l.Restore,tooltip:l["Restore default Editor Settings"],
id:"orion.restoreeditorsettings",callback:function(a){this.restore(a.items)}.bind(this)});this.commandService.addCommand(d);this.commandService.registerCommandContribution("restoreEditorSettingCommand","orion.restoreeditorsettings",2);this.commandService.renderCommands("restoreEditorSettingCommand",b,this,this,"button");d=new g.Command({name:l.Update,tooltip:l["Update Editor Settings"],id:"orion.updateeditorsettings",callback:function(a){this.update(a.items)}.bind(this)});this.commandService.addCommand(d);
this.commandService.registerCommandContribution("editorSettingCommand","orion.updateeditorsettings",1);this.commandService.renderCommands("editorSettingCommand",b,this,this,"button")},valueChanged:function(){var a={},b;for(b in this.oldPrefs)this.oldPrefs.hasOwnProperty(b)&&(a[b]=this.oldPrefs[b]);this.getValues(a);for(var d in a)if(a.hasOwnProperty(d)&&a[d]!==this.oldPrefs[d])return a},validate:function(a){var b="";this._forEach(function(d,e){return e.validate&&(b=e.validate(d,a))?!1:!0});return b},
_progress:function(a,b){this.registry&&this.registry.getService("orion.page.message").setProgressResult({Message:a,Severity:b})},update:function(){var a=this.valueChanged();if(a){var b=this.validate(a);if(b){this._progress(b,"Error");return}this.preferences.setPrefs(a,function(){this.setValues(this.oldPrefs=a);this._progress(l["Editor preferences updated"],"Normal")}.bind(this))}else this.setValues(this.oldPrefs);this.editor&&this.editor.focus()},restore:function(){this.preferences.setPrefs({},function(a){this._show(a);
this._progress(l["Editor defaults restored"],"Normal")}.bind(this))},show:function(a,b){a&&(this.node=a);this.themePreferences.getTheme(function(a){this.preferences.getPrefs(function(d){this._show(d,a);b&&b()}.bind(this))}.bind(this))},_show:function(a,b){b&&(this.oldThemeStyles=b);this.oldPrefs=a;this.createElements();this.setValues(a)},_forEach:function(a){for(var b in x)if(x.hasOwnProperty(b))for(var d in x[b])if(x[b].hasOwnProperty(d))for(var e in x[b][d])if(x[b][d].hasOwnProperty(e)){var f=x[b][d][e];
if(f.widget&&!a(e,f))return}},getValues:function(b){this._forEach(function(d,e){b[d]=e.widget.getSelection();if(!this.local){var f=a.$("."+t,e.widget.node);b[d+"LocalVisible"]=f&&f.classList.contains(w)}return!0}.bind(this))},setValues:function(b){this._forEach(function(d,e){e.widget.setSelection(b[d]);if(!this.local){var f=a.$("."+t,e.widget.node);f&&(b[d+"LocalVisible"]?(f.classList.add(w),f.classList.remove(s)):(f.classList.add(s),f.classList.remove(w)))}return!0}.bind(this))},destroy:function(){this.node&&
(this.node=null);this.editorThemeWidget&&(this.editorThemeWidget.destroy(),this.editorThemeWidget=null)}});return q});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(l){function p(n,k,b){l.attach(this);this._binderFunc=k;this.setInputField(n);(n=b?b.group:null)||(n=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=n+"__completion__";this._proposeFromStart=b?b.proposeFromStart:!1;this._extendedProvider=b?b.extendedProvider:null;this._serviceRegistry=b?b.serviceRegistry:null;this._onDelete=b?b.onDelete:null;this._deleteToolTips=
b?b.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];b=function(b){this._binderFunc&&this._binderFunc(function(g){this._bind(g);b.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",b);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:b});b=function(b){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",b);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:b});b=function(b){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",b);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:b})}p.prototype._removeListeners=function(l){l&&l.forEach(function(k){k.evtTarget.removeEventListener(k.type,k.handler,!1)})};p.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};p.prototype.hasValueOf=function(l){return this._dataList.some(function(k){return k.value===l})};p.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(b){this._bind(b)}.bind(this)))}.bind(this);this._inputField.addEventListener("focus",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:l})};p.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};p.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};p.prototype._bind=function(l){this._dataList=l};p.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};p.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
p.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)};p.prototype._createProposalLink=function(l,k,b,h){var g=
document.createElement("a");g.href=require.toUrl(k);g.appendChild(this._createBoldText(l,b,h));return g};p.prototype._createBoldText=function(l,k,b,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 e=document.createElement("b");h.appendChild(e);g=document.createTextNode(l.substring(k,k+b));e.appendChild(g);k+b<l.length&&(g=document.createTextNode(l.substring(k+b)),h.appendChild(g));return h};
p.prototype._proposeOnCategory=function(l,k){if(0!==k.length){var b;if(l){b=document.createElement("li");b.className="inputCompletionLICategory";var h=document.createTextNode(l);b.appendChild(h);this._completionUL.appendChild(b)}k.forEach(function(g){b=document.createElement("li");b.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);b.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);b.className="inputCompletionLINormal";b.completionItem=g.item;
var e;if("string"===typeof g.item.value){var a=document.createElement("table");a.style.width="100%";a.style.tableLayout="fixed";a.style.borderSpacing="0";var f=document.createElement("tr");f.style.width=this._inputField.offsetWidth+"px";a.appendChild(f);var d=document.createElement("td");d.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(g.item.value,g.boldIndex,g.boldLength);d.appendChild(h);d.style.overflow="hidden";f.appendChild(d);this._onDelete&&(e=document.createElement("button"),
e.classList.add("inputCompletionDismissButton"),e.classList.add("layoutRight"),e.classList.add("core-sprite-close"),e.classList.add("imageSprite"),e.style.display="none",e.style.margin="0 0 0",e.title=this._deleteToolTips,e.onclick=function(a){a.stopPropagation();this._onDelete(g.item.value,this);this._resetIndexAfterDeletion()}.bind(this),d=document.createElement("td"),d.classList.add("inputCompletionLIRightTD"),d.appendChild(e),f.appendChild(d));b.appendChild(a)}else g.item.value.name&&"link"===
g.item.value.type&&b.appendChild(this._createProposalLink(g.item.value.name,g.item.value.value,g.boldIndex,g.boldLength));this._completionUL.appendChild(b);this._proposalList.push({item:g.item,domNode:b,deleteBtn:e})}.bind(this))}};p.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};p.prototype._highlight=function(l,k){var b=l,h,g=!1;isNaN(b)||(g=!0,this._proposalList&&0<=l&&l<this._proposalList.length?
(b=this._proposalList[l].domNode,h=this._proposalList[l].deleteBtn):b=null);b&&(b.className=k?"inputCompletionLISelected":"inputCompletionLINormal",h&&(h.style.display=k?"":"none"),k&&g&&(b.offsetTop<this._completionUIContainer.scrollTop?b.scrollIntoView(!0):b.offsetTop+b.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&b.scrollIntoView(!1)))};p.prototype._selectProposal=function(l,k){var b=l;isNaN(b)&&(b=this._domNode2Index(l));if(b!==this._proposalIndex||
k)this._highlight(this._proposalIndex,!1),this._proposalIndex=b,this._highlight(this._proposalIndex,!0)};p.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")};p.prototype._show=function(){if(this._proposalList&&
0<this._proposalList.length){for(var l=0,k=0,b=this._inputField;b;)l+=b.offsetLeft,k+=b.offsetTop,b=b.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"};p.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)};p.prototype._proposeOnList=function(l,k,b){var h="",g=[],e=k?k.length:0;l.forEach(function(a){if("category"===a.type)this._proposeOnCategory(h,g),h=a.label,g=[];else{var f=!0,d=-1;if(k&&b){var m;"string"===typeof a.value?m=a.value.toLowerCase():a.value.name&&(m=a.value.name.toLowerCase());d=m.indexOf(k);0>d?f=!1:this._proposeFromStart&&
(f=0===d)}f&&g.push({item:a,boldIndex:d,boldLength:e})}}.bind(this));this._proposeOnCategory(h,g)};p.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(b){b&&b.forEach(function(b){this._proposeOnList(b.proposals,b.filterForMe?k:l,b.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};p.prototype.constructor=p;return{InputCompletion:p}});
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,p,n,k,b,h,g){function e(a,b,d,e,g){p.Find.call(this,a,e,g);this._serviceRegistry=b;this._commandService=d}e.prototype=new p.Find;k.mixin(e.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?p.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?p.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();p.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){p.Find.prototype.show.call(this,a);var b=a.findString;this._addRecentfind(b);a=a.replaceString;var d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));
b&&(d.value=b);a&&(document.getElementById("localSearchReplaceWith").value=a);window.setTimeout(function(){d.select();d.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(b){var d=document.createElement("input");d.type="text";d.name=l["Find:"];d.className="parameterInput";d.id="localSearchFindWith";
d.placeholder=l["Find With"];d.oninput=function(b){return a._handleInput(b)};d.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(d);a._initCompletion(d);a._createButton(l.Next,b,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(l.Previous,b,function(){a._addRecentfind(a.getFindString());a.find(!1)});var e=a._editor.getTextView().getOptions("readonly");if(!e){var g=document.createElement("input");g.type="text";g.name=l["ReplaceWith:"];g.className="parameterInput";
g.id="localSearchReplaceWith";g.placeholder=l["Replace With"];g.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(g);a._replaceInfo=a._createInfoImage(null,b,null);a._showReplaceInfo();a._createButton(l.Replace,b,function(){a.replace()});a._createButton(l["Replace All"],b,function(){a.replaceAll()})}g=document.createElement("div");b.appendChild(g);g.classList.add("findOptionsDiv");var h=n.createDropdownMenu(g,l.Options,null,"dismissButton",null,!0);h.menuButton.classList.add("parameterInlineButton");
n.createCheckedMenuItem(h.menu,l["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});h.dropdown.close(!0)});n.createCheckedMenuItem(h.menu,l["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});h.dropdown.close(!0);a.find(!0)});n.createCheckedMenuItem(h.menu,l["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});h.dropdown.close(!0)});n.createCheckedMenuItem(h.menu,l["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});
h.dropdown.close(!0)});n.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=n.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()});e||n.createCheckedMenuItem(h.menu,l["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});h.dropdown.close(!0)});
return d},function(){a.hide()})},_storeRecentFind:function(a,b,d){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentFind",a);b&&window.setTimeout(function(){b.dispatchEvent({type:"inputDataListChanged",deleting:d})}.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(b){var d;
b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){for(d in b)if(b[d].name===a)return;30<=b.length&&b.splice(29,b.length-30+1)}else b=[];b.splice(0,0,{name:a});this._storeRecentFind(b,this._completion)}.bind(this))},_removeRecentSearch:function(a,b){"string"===typeof a&&a&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var e;d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d)for(e in d)if(d[e].name===a){d.splice(e,
1);this._storeRecentFind(d,b,!0);break}}.bind(this))},_initCompletion:function(a){if(this._completion)this._completion.setInputField(a);else{var b=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){var e=[];b.forEach(function(a){e.push({type:"proposal",label:a.name,value:a.name})});a(e)}})}.bind(this);this._completion=new h.InputCompletion(a,b,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,b){this._removeRecentSearch(a,b)}.bind(this),deleteToolTips:l["Click or use delete key to delete the search term"]})}},_createButton:function(a,b,d){var e=document.createElement("button");e.addEventListener("click",d.bind(this),!1);var h=this;e.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&h.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";b.appendChild(e)},_createInfoImage:function(a,b,
d){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));b.appendChild(a);return a},_handleInput:function(a){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var b=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;return b&&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):b&&82===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1):27===a.keyCode?(this.hide(),!1):!0}});return{TextSearcher:e}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(l){var p=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(n){var k=l.getService(n);Object.keys(k).forEach(function(b){"function"===typeof k[b]&&(p[b]=k[b].bind(k))})});return p},getOptions:function(l){var p=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(l){l.getPropertyKeys().forEach(function(k){"service.id"!==k&&("service.names"!==k&&"objectClass"!==
k)&&(p[k]=l.getProperty(k))})});return p}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(l,p,n,k){function b(b,g){for(var e=g.getFileMetadata(),a=b.getServiceReferences("orion.edit.blamer"),f=0;f<a.length;f++){var d=a[f],k={};k.validationProperties=d.getProperty("validationProperties");k.forceSingleItem=!0;k=l._makeValidator(k,b);if(k.validationFunction.bind(k)(e))return b.getService(d)}return null}return{isVisible:function(h,g){return!!b(h,g)&&!!h.getService("orion.core.blame")},
getBlame:function(h,g){var e=b(h,g);if(e){var a=function(a){for(var b=p.getOrionHome(),e=0;e<a.length;e++){var f=a[e],g=new n(f.CommitLink),k={};k.OrionHome=b;f.CommitLink=g.expand(k)}h.getService("orion.core.blame")._setAnnotations(a)};if(e.computeBlame){var f={metadata:g.getFileMetadata()};e.computeBlame(k.getEditorContext(h),f).then(a)}else e.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,p,n,k,b,h,g,e,a,f,d,m,r,u,q,t,w,s,x,z){function y(a){var b=
new g(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||q.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 H(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",H,!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=y;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(d){var f=this,g=new e.Command({imageClass:"core-sprite-wrench",tooltip:l.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return d.installed},callback:function(a){var e=g.settingsDropDown;if(!e||
e.isDestroyed())e=g.settingsDropDown=new b(a.domNode.parentNode,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){e.focus()},onHide:function(){d.focus()}}),e.updateContent=f.localSettings.show.bind(f.localSettings),a=e.getContentNode(),a.tabIndex=a.style.marginTop=0;e.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 d=
new e.Command({name:l.Undo,id:"orion.undo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().undo()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new a.KeyBinding("z",!0));d=new e.Command({name:l.Redo,id:"orion.redo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().redo()}});
this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,x.isMac?new a.KeyBinding("z",!0,!0):new a.KeyBinding("y",!0))},_generateSearchFilesCommand:function(b){var d=this;if(d._searcher){var f=!1,g=new e.Command({name:l.searchFiles,tooltip:l.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return b.installed},callback:function(a){if(!f){a=
b.getSelection();a=b.getText(a.start,a.end);var e=d.serviceRegistry.getService("orion.page.progress"),g=new k.OpenResourceDialog({searcher:d._searcher,progress:e,searchRenderer:d._searcher.defaultRenderer,nameSearch:!1,title:l.searchFiles,message:l.searchTerm,initialText:a,onHide:function(){f=!1;b.focus()}});window.setTimeout(function(){f=!0;g.show(n.node(d.toolbarId))},0)}}});this.commandService.addCommand(g);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,d){var f=this,g=d?d:"orion.save",h=new e.Command({name:l.Save,tooltip:l.saveFile,id:g,visibleWhen:function(){return!b.installed||f.inputManager.getReadOnly()?!1:!0},callback:function(a){f.inputManager.save();return!0}});this.commandService.addCommand(h);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,g,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 d=this,g=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new f.CommandParameter("line","number","Line:",a.toString())]}),
g=new e.Command({name:l.gotoLine,tooltip:l.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return b.installed},parameters:g,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(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("l",!x.isMac,!1,!1,x.isMac),new f.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;d.commandService.runCommand("orion.gotoLine");return!0},g)},_generateFindCommnand:function(b){var d=this,g=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var a=b.getSelection(),e="";a.end>a.start&&(e=b.getModel().getText(a.start,a.end),d._localSearcher&&d._localSearcher.getOptions().regex&&(e=s.escape(e)));return[new f.CommandParameter("find","text","Find:",e)]}),g=new e.Command({name:l.Find,tooltip:l.Find,id:"orion.editor.find",visibleWhen:function(){return b.installed},parameters:g,callback:function(a){if(d._localSearcher){var e="",f=null,g=b.getSelection();g.end>g.start&&a.parameters.valueFor("useEditorSelection")?(e=b.getModel().getText(g.start,
g.end),d._localSearcher.getOptions().regex&&(e=s.escape(e))):a.parameters&&a.parameters.valueFor("find")&&(e=a.parameters.valueFor("find"),f=u.matchResourceParameters(),r.convertFindURLBinding(f));f?(d._localSearcher.setOptions({regex:f.regEx,caseInsensitive:!f.caseSensitive}),a={},f.atLine&&(a.start=b.getModel().getLineStart(f.atLine-1)),d._localSearcher.show({findString:e,replaceString:f.replaceWith}),d._localSearcher.find(!0,a)):d._localSearcher.show({findString:e});return!0}return!1}});this.commandService.addCommand(g);
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 f.URLBinding("find","find"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("find",function(a){if(a)return d._localSearcher.show(a),!0;d.commandService.runCommand("orion.editor.find",null,null,new f.ParametersDescription([new f.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},g)},_generateBlame:function(b){var d=this,g=new e.Command({name:l.Blame,tooltip:l.BlameTooltip,id:"orion.edit.blame",parameters:new f.ParametersDescription([new f.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!b.installed?!1:w.isVisible(d.serviceRegistry,d.inputManager)},callback:function(a){for(var e=!1,f=b.getAnnotationModel().getAnnotations();f.hasNext();)if(f.next().type===t.AnnotationType.ANNOTATION_BLAME){e=!0;
break}e=!e;a.parameters&&a.parameters.valueFor("blame")&&(e="true"===a.parameters.valueFor("blame"));e?w.getBlame(d.serviceRegistry,d.inputManager):b.showBlame([])}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new a.KeyBinding("b",!0,!0),new f.URLBinding("blame","blame"))},_generateEditCommands:function(b){function f(b){if(!b)return null;var d=new a.KeyBinding;a.KeyBinding.apply(d,b);return d}function g(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,q=this.toolbarId,r=this.serviceRegistry,u=r.getServiceReferences("orion.edit.command"),t=this.inputManager,s=r.getService("orion.page.progress"),w=function(a,d,f){var h=f.visibleWhen;f.visibleWhen=function(a){return!b.installed||k.inputManager.getReadOnly()?!1:!h||h(a)};f.callback=function(e){b=this;var f=b.getSelection?b.getSelection():
{start:0,end:0};e=b.getModel();var h=function(a){"object"===typeof a&&a?(a.text&&b.setText(a.text),a.selection&&(b.setSelection&&b.setSelection(a.selection.start,a.selection.end,!0),b.focus())):"string"===typeof a&&(b.setText(a,f.start,f.end,!0),b.setSelection&&b.setSelection(f.start,f.start+a.length),b.focus())},k;d.execute?(e={contentType:t.getContentType(),input:t.getInput()},k=z.getEditorContext(r),k.openDelegatedUI=y,k.setStatus=g,e=d.execute(k,e),k=null):(e=d.run(e.getText(f.start,f.end),e.getText(),
f,t.getInput()),k=function(b){if(b&&b.uriTemplate){var d={};d.uriTemplate=b.uriTemplate;d.params=t.getFileMetadata();d.id=a.id;d.width=b.width;d.height=b.height;d.done=h;d.status=g;y(d)}else b&&(b.Status||b.status)?g(b.Status||b.status):h(b)});s.showWhile(e,p.formatMessage(l.running,a.name)).then(k);return!0};f.callback=f.callback.bind(b);return new e.Command(f)};h.when(function(a){if(A)return A;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new m.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));
return b.getContentTypes().then(function(a){return A=a})}(this.serviceRegistry),function(){var a=[],e=100;u.forEach(function(g){var h=g.getProperty("editor");if(!h||!(b.id&&h!==b.id)){for(var m=k.serviceRegistry.getService(g),l={},h=g.getPropertyKeys(),q=0;q<h.length;q++)l[h[q]]=g.getProperty(h[q]);l.forceSingleItem=!0;g=d._createCommandOptions(l,g,k.serviceRegistry,A,!1,function(a){return t.getFileMetadata()});a.push(g);g.then(function(a){a=w(l,m,a);k.commandService.addCommand(a);k.commandService.registerCommandContribution(k.toolbarId,
a.id,e,"orion.menuBarToolsGroup",l.bindingOnly,f(l.key))});e++}});h.all(a,function(a){return{_error:a}}).then(function(a){if(a=t.getFileMetadata()){var d=n.node(q);d&&(k.commandService.destroy(d),k.commandService.renderCommands(d.id,d,a,b,"button"));if(d=n.node("pageNavigationActions"))k.commandService.destroy(d),k.commandService.renderCommands(d.id,d,b,b,"button")}})})}};v.EditorCommandFactory=B;return v});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function l(l,n,k){this.serviceRegistry=l;this.editor=n;this.inputManager=k;this.contentTypeService=l.getService("orion.core.contentTypeRegistry");if(!this.contentTypeService)throw Error("Missing required service");this.serviceReferences={};var b=this;this.listener={onServiceAdded:function(h){b._onServiceAdded(h.serviceReference)},onServiceRemoved:function(h){b._onServiceRemoved(h.serviceReference)}};this.serviceRegistry.addEventListener("registered",
this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",this.listener.onServiceRemoved);this._init()}l.prototype={_init:function(){var l=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){l._wire(l.serviceRegistry)})},_wire:function(l){l=l.getServiceReferences("orion.edit.model");for(var n=0;n<l.length;n++)this._wireServiceReference(l[n])},_wireServiceReference:function(l){var n=l.getProperty("contentType");
if(void 0!==typeof n&&null!==n){var k=this;this.contentTypeService.isSomeExtensionOf(this.inputManager.getContentType(),n).then(function(b){b&&k._wireService(l,k.serviceRegistry.getService(l))})}},_wireService:function(l,n){for(var k=Object.keys(n),b=this.editor.getTextView(),h=0;h<k.length;h++){var g=k[h],e=n[g];"on"!==g.substr(0,2)||"function"!==typeof e||(g=g.substr(2),this._wireServiceMethod(l,n,e,b,g))}this._initService(n,b)},_wireServiceMethod:function(l,n,k,b,h){n=function(b){k(b).then()};
l=l.getProperty("service.id");this.serviceReferences[l]=this.serviceReferences[l]||[];this.serviceReferences[l].push([b,h,n]);b.addEventListener(h,n)},_onServiceRemoved:function(l){l=l.getProperty("service.id");var n=this.serviceReferences[l];if(n){for(var k=0;k<n.length;k++){var b=n[k];b[0].removeEventListener(b[1],b[2])}delete this.serviceReferences[l]}},_onServiceAdded:function(l){-1!==l.getProperty("objectClass").indexOf("orion.edit.model")&&this._wireServiceReference(l)},_initService:function(l,
n){var k=l.onModelChanging;if("function"===typeof k){var b=n.getModel(),h=b.getText(),b={type:"Changing",text:h,start:0,removedCharCount:0,addedCharCount:h.length,removedLineCount:0,addedLineCount:b.getLineCount()};k.call(l,b)}}};return{Dispatcher:l}});
define("orion/edit/typedefs",["orion/objects","orion/serviceTracker"],function(l,p){function n(k){this.props=Object.create(null);this.defs=Object.create(null);this.registration=null;var b=new p(k,"orion.core.typedef"),h=this;b.onServiceAdded=function(b){var e=b.getProperty("id"),a=b.getProperty("defs");if(!e||!a)throw Error("TypeDef registration missing required 'id' or 'defs' [service id: "+b.getProperty("service.id")+"]");var f={};b.getPropertyKeys().forEach(function(a){"defs"!==a&&("service.id"!==
a&&"service.names"!==a&&"objectClass"!==a)&&(f[a]=b.getProperty(a))});h.props[e]=f;h.defs[e]=a;h._updateRegistration()};b.removedService=function(b){b=b.getProperty("id");delete h.props[b];delete h.defs[b];h._updateRegistration()};b.open();this.registration=k.registerService("orion.edit.context",{getTypeDef:this.getTypeDef.bind(this)},null);this._updateRegistration()}l.mixin(n.prototype,{_updateRegistration:function(){this.registration&&this.registration.setProperties({typeDefs:this.getAllProperties()})},
getTypeDef:function(k){return this.defs[k]||null},getProperties:function(k){return this.props[k]||null},getAllProperties:function(){return this.props}});return n});
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 p="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(?:"+p.join("|")+")\\b",name:"keyword.control.js"}]});return{id:l[l.length-1].id,grammars:l,keywords:p}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(l){var p="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(?:"+
p.join("|")+")\\b",name:"keyword.control.java"}]});return{id:l[l.length-1].id,grammars:l,keywords:p}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(l){var p="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)(?:"+p.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:p}});
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,p,n,k){function b(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function h(){b.call(this,null,!0)}function g(a){b.call(this,null,a)}function e(){b.call(this,null,!1)}function a(a,k,l){this.commentStart="/*";this.commentEnd="*/";var q=[];switch(k){case "java":q=d;break;
case "js":q=f;break;case "css":q=m}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new b(q,this.whitespacesVisible);this._firstScanner=new e;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 f=p.keywords,d=n.keywords,m=k.keywords,r={styleClass:"comment"},u={styleClass:"comment"},q={styleClass:"comment block documentation"},t={styleClass:"keyword other documentation markup"},w={styleClass:"keyword other documentation task"},s={styleClass:"keyword other documentation tag"},x={styleClass:"string"},z={styleClass:"constant numeric"},y={styleClass:"keyword"},B={styleClass:"punctuation separator space",
unmergeable:!0},v={styleClass:"punctuation separator tab",unmergeable:!0},A={styleClass:"meta annotation currentLine"};b.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,f=!1,g=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===g&&2===this.offset-d)b=e=f=!0;else if(!(48<=a&&57>=a||f&&(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 b(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 b(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}}};e.prototype=new b(null);e.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,f){var g;void 0===e&&(e=-1);void 0===f&&(f=a.length);for(;1<f-e;)if(g=Math.floor((f+e)/2),b<=a[g].start)f=g;else if(d&&b<a[g].end){f=g;break}else e=g;return f},_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(),f=this.comments,g=0;g<f.length;g++){var h=f[g];(h=this._createFoldingAnnotation(a,e,h.start,h.end))&&d.push(h)}b.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,b,d,e){var f=b.getLineAtOffset(d);b=b.getLineAtOffset(e);return f===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 f=this.view.getModel(),g=f;f.getBaseModel&&(g=f.getBaseModel());for(var h=e.getAnnotations(b,d),f=[],k=l.AnnotationType.ANNOTATION_TASK;h.hasNext();){var m=h.next();m.type===k&&f.push(m)}h=[];m=this._commentScanner;m.setText(g.getText(b,d));for(var q;q=m.nextToken();){var n=m.getStartOffset()+b;14===q&&(q=g.getLineEnd(g.getLineAtOffset(n)),6!==a&&(q=Math.min(q,d-this.commentEnd.length)),h.push(l.AnnotationType.createAnnotation(k,n,q,g.getText(n,q))))}e.replaceAnnotations(f,
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,f=[],g=d,h=this.comments,k=this._binarySearch(h,d,!0);k<h.length&&!(h[k].start>=e);k++){var m=h[k].start,l=h[k].end;g<m&&this._parse(b.substring(g-d,m-d),g,f);var n=h[k].type,p;switch(n){case 8:p=q;break;case 7:p=u;break;case 5:p=x}g=Math.max(g,
m);m=Math.min(e,l);(8===n||7===n)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(g-d,m-d),g,f,p,n):5===n&&this.whitespacesVisible?this._parseString(b.substring(g-d,m-d),g,f,x):f.push({start:g,end:m,style:p});g=l}g<e&&this._parse(b.substring(g-d,e-d),g,f);if(a.getBaseModel)for(b=0;b<f.length;b++)d=f[b].end-f[b].start,f[b].start=a.mapOffset(f[b].start,!0),f[b].end=f[b].start+d;return f},_parse:function(a,b,d){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var f=
e.getStartOffset()+b,g=null;switch(a){case 2:g=y;break;case 3:g=z;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,x);continue}else g=x;break;case 8:this._parseComment(e.getData(),f,d,q,a);continue;case 6:this._parseComment(e.getData(),f,d,r,a);continue;case 7:this._parseComment(e.getData(),f,d,u,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=B)}d.push({start:f,end:e.getOffset()+b,
style:g})}},_parseComment:function(a,b,d,e,f){var g=this._commentScanner;g.setText(a);for(g.setType(f);a=g.nextToken();){f=g.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=t;break;case 13:h=s;break;case 14:h=w;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(g.getData(),f,d,h))}h&&d.push({start:f,end:g.getOffset()+b,style:h})}},_parseString:function(a,b,d,e){var f=
this._whitespaceScanner;for(f.setText(a);a=f.nextToken();){var g=f.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:g,end:f.getOffset()+b,style:h})}},_detectHyperlinks:function(a,b,d,e){var f=null,g;if(0<(g=a.indexOf("://"))){for(var f=a,h=g;0<h;){g=f.charCodeAt(h-1);if(!(97<=g&&122>=g||65<=g&&90>=g||45===g||48<=g&&57>=g))break;h--}if(0<h&&(g="\"\"''(){}[]\x3c\x3e".indexOf(f.substring(h-
1,h)),-1!==g&&0===(g&1)&&-1!==(g=f.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(g+1,g+2))))){var k=g;g=this._clone(e);g.tagName="a";g.attributes={href:f.substring(h,k)};d.push({start:b,end:b+h,style:e});d.push({start:b+h,end:b+k,style:g});d.push({start:b+k,end:b+a.length,style:e});return null}}else 0===a.toLowerCase().indexOf("bug#")&&(f="https://bugs.eclipse.org/bugs/show_bug.cgi?id\x3d"+parseInt(a.substring(4),10));return f?(g=this._clone(e),g.tagName="a",g.attributes={href:f},g):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 f=[];e=d.nextToken();)(7===e||8===e||5===e)&&f.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 f},_findMatchingBracket:function(a,b){var d="{}()[]\x3c\x3e",e=a.getText(b,b+1),f=d.indexOf(e,0);if(-1===f)return-1;var g;g=f&1?d.substring(f-1,f):d.substring(f+
1,f+2);for(var h=a.getLineAtOffset(b),d=a.getLine(h),k=a.getLineStart(h),m=a.getLineEnd(h),d=this._findBrackets(e,g,d,k,k,m),m=0;m<d.length;m++)if(k=0<=d[m]?1:-1,d[m]*k-1===b){var l=1;if(f&1){for(m--;0<=m;m--)if(k=0<=d[m]?1:-1,l+=k,0===l)return d[m]*k-1;for(h-=1;0<=h;){d=a.getLine(h);k=a.getLineStart(h);m=a.getLineEnd(h);d=this._findBrackets(e,g,d,k,k,m);for(f=d.length-1;0<=f;f--)if(k=0<=d[f]?1:-1,l+=k,0===l)return d[f]*k-1;h--}}else{for(m++;m<d.length;m++)if(k=0<=d[m]?1:-1,l+=k,0===l)return d[m]*
k-1;h+=1;for(f=a.getLineCount();h<f;){d=a.getLine(h);k=a.getLineStart(h);m=a.getLineEnd(h);d=this._findBrackets(e,g,d,k,k,m);for(m=0;m<d.length;m++)if(k=0<=d[m]?1:-1,l+=k,0===l)return d[m]*k-1;h++}}break}return-1},_findBrackets:function(a,b,d,e,f,g){var h=[];a=a.charCodeAt(0);b=b.charCodeAt(0);for(var k=f,m=this._scanner,l,q=this.comments,n=this._binarySearch(q,f,!0);n<q.length&&!(q[n].start>=g);n++){l=q[n].start;var p=q[n].end;if(k<l)for(m.setText(d.substring(k-f,l-f));l=m.nextToken();)l===a?h.push(m.getStartOffset()+
k-f+e+1):l===b&&h.push(-(m.getStartOffset()+k-f+e+1));k=p}if(k<g)for(m.setText(d.substring(k-f,g-f));l=m.nextToken();)l===a?h.push(m.getStartOffset()+k-f+e+1):l===b&&h.push(-(m.getStartOffset()+k-f+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 f;
if(this.highlightCaretLine){var g=a.getLineAtOffset(b.start);f=a.getLineAtOffset(d.start);var h=d.start===d.end,b=b.start===b.end;g===f&&b&&h||(b&&e.redrawLines(g,g+1),(g!==f||!b)&&h&&e.redrawLines(f,f+1))}if(this.annotationModel){var b=this._bracketAnnotations,k,m;if(d.start===d.end&&0<(m=e.getCaretOffset()))m-=1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),a=this._findMatchingBracket(a,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(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 f=e-1,g=d;d.getBaseModel&&(f=d.mapOffset(f),g=d.getBaseModel());f=this._findMatchingBracket(g,f);-1!==f&&(a.preventDefault(),a=f,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,f=this.view;a=f.getModel();var g=a.getBaseModel?a.getBaseModel():a,d=b+d,h=g.getCharCount(),k=this.comments.length,m=g.getLineStart(g.getLineAtOffset(b)),q=this._binarySearch(this.comments,m,!0),n=this._binarySearch(this.comments,d,!1,q-1,k);q<k&&this.comments[q].start<=m&&m<this.comments[q].end?(m=this.comments[q].start,m>b&&(m+=e)):m=q===k&&0<k&&h-e===this.comments[k-1].end?this.comments[k-1].start:m;var p;n<k?(p=this.comments[n].end,p>b&&(p+=e),
n+=1):(n=k,p=h);for(var h=g.getText(m,p),r,h=this._findComments(h,m),k=q;k<this.comments.length;k++)r=this.comments[k],r.start>b&&(r.start+=e),r.start>b&&(r.end+=e);var u=n-q!==h.length;if(!u)for(k=0;k<h.length;k++){r=this.comments[q+k];var t=h[k];if(r.start!==t.start||r.end!==t.end||r.type!==t.type){u=!0;break}}k=[q,n-q].concat(h);Array.prototype.splice.apply(this.comments,k);u&&(k=m,r=p,a!==g&&(k=a.mapOffset(k,!0),r=a.mapOffset(r,!0)),f.redrawRange(k,r));if(this.foldingEnabled&&g!==a&&this.annotationModel){f=
this.annotationModel;q=f.getAnnotations(m,p);m=[];for(p=[];q.hasNext();)if(r=q.next(),r.type===l.AnnotationType.ANNOTATION_FOLDING){p.push(r);for(k=0;k<h.length&&!(r.start===h[k].start&&r.end===h[k].end);k++);k===h.length?(m.push(r),r.expand()):(k=r.start,n=r.end,k>b&&(k-=e),n>b&&(n-=e),k<=b&&(b<n&&k<=d&&d<n)&&(k=g.getLineAtOffset(r.start),n=g.getLineAtOffset(r.end),k!==n?r.expanded||r.expand():f.removeAnnotation(r)))}b=[];for(k=0;k<h.length;k++){r=h[k];for(e=0;e<p.length&&!(p[e].start===r.start&&
p[e].end===r.end);e++);e===p.length&&(r=this._createFoldingAnnotation(a,g,r.start,r.end))&&b.push(r)}f.replaceAnnotations(m,b)}}};return{TextStyler:a}});
define("orion/editor/textStyler",["orion/editor/annotations","orion/editor/eventTarget"],function(l,p){function n(a,b){this._patternManager=new k(a,b)}function k(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function b(a,b,d,e,g,h,k){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.name=b;this.typeId=d;this.styler=
e;this.parent=h;k&&k(this);this._subBlocks=e.computeBlocks(g,g.getText(this.start,this.end),this,this.start,null,null,null)}function h(a){this._styler=a}function g(a,b,d){this._highlightCaretLine=this._whitespacesVisible=this._spacesVisible=this._tabsVisible=!1;this._detectTasks=this._foldingEnabled=!0;this._view=a;this._annotationModel=b;this._stylerAdapter=d;this._stylerAdapter.setStyler(this);this._accessor=new h(this);this._bracketAnnotations;var e=this;this._listener={onChanged:function(a){e._onModelChanged(a)},
onDestroy:function(a){e._onDestroy(a)},onLineStyle:function(a){e._onLineStyle(a)},onMouseDown:function(a){e._onMouseDown(a)},onSelection:function(a){e._onSelection(a)}};d=a.getModel();d.getBaseModel&&(d=d.getBaseModel());d.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 g=d.getCharCount();this._rootBlock=this._stylerAdapter.createBlock({start:0,contentStart:0,end:g,contentEnd:g},this,d,null);b&&(g=[],b.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),a.getModel(),g),this._detectTasks&&(b.removeAnnotations(l.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,d,g)),b.replaceAnnotations([],g));a.redrawLines()}var e=function(a,b,d,e,g){var h;void 0===e&&(e=-1);void 0===g&&(g=a.length);for(;1<
g-e;)if(h=Math.floor((g+e)/2),b<=a[h].start)g=h;else if(d&&b<a[h].end){g=h;break}else e=h;return g};n.prototype={blockSpansBeyondEnd:function(a){return a.pattern.regexEnd===this._eolRegex},computeBlocks:function(a,b,d,e,g,h,k){if(!b)return[];var l=[],n=[];g=g||0;h=h||Infinity;k=k||Infinity;d.blockPatterns.forEach(function(a){var d=this._findMatch(a.regexBegin||a.regex,b,g);d&&n.push({result:d,pattern:a})}.bind(this));if(!n.length)return l;n.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 p=0;0<n.length;){var x=n[0];n.splice(0,1);if(h<x.result.index)break;if(!(x.result.index<p)){var p=e+x.result.index,z=x.result.index,y=null,B=x.pattern.regexEnd;if(B){var z=z+x.result[0].length,v=x.pattern,A=this._substituteCaptureValues(B,x.result);A!==B&&(v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:A},B=A);for(A=z;!y;){A=this._findMatch(B,b,A);A||(this._eolRegex.lastIndex=0,A=this._eolRegex.exec(b),
v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:this._eolRegex});var C=this.createBlock({start:p,end:e+A.index+A[0].length,contentStart:e+z,contentEnd:e+A.index},d.styler,a,d,v),F=C.getBlocks();if(!F.length||F[F.length-1].end<=A.index+e)y=C;A=A.index+A[0].length}}else y=this.createBlock({start:p,end:p+x.result[0].length,contentStart:p,contentEnd:p+x.result[0].length},d.styler,a,d,x.pattern);l.push(y);if(l.length===k||h<=y.end)break;p=y.end-e}this._updateMatch(x,b,n,p,h)}return l},computeStyle:function(a,
b,d){if(!a.pattern)return null;var g={start:a.start,end:a.end,style:a.pattern.pattern.name};if(a.contentStart<=d&&d<a.contentEnd)return a.pattern.pattern.contentName?{start:a.contentStart,end:a.contentEnd,style:a.pattern.pattern.contentName}:g;var h,k;if(d<a.contentStart){k=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures;if(!k)return g;h=a.pattern.regexBegin;b=b.getText(a.start,a.contentStart);a=a.start}else{k=a.pattern.pattern.endCaptures||a.pattern.pattern.captures;if(!k)return g;h=
a.pattern.regexEnd;b=b.getText(a.contentEnd,a.end);a=a.contentEnd}h.lastIndex=0;if(h=h.exec(b))if(b=[],this._getCaptureStyles(h,k,a,b),(k=b[e(b,d,!0)])&&k.start<=d&&d<k.end)return k;return g},createBlock:function(a,e,d,g,h){return new b(a,h?h.pattern.name:null,h?h.pattern.id:null,e,d,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,b,d,e){var g;if(a.pattern.regexEnd&&(g=this._findMatch(a.pattern.regexEnd,b,0)))(b=a.pattern.pattern.endCaptures||a.pattern.pattern.captures)?this._getCaptureStyles(g,b,d-g[0].length,e):a.pattern.pattern.name&&e.push({start:d-g[0].length,end:d,style:a.pattern.pattern.name});return g?g[0]:null},getBlockStartStyle:function(a,b,d,e){var g;if(a.pattern.regexBegin&&(g=this._findMatch(a.pattern.regexBegin,b,0)))(b=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures)?
this._getCaptureStyles(g,b,d,e):e.push({start:d,end:d+g[0].length,style:a.pattern.pattern.name});return g?g[0]:null},getBracketMatch:function(a,b){for(var d,e=Object.keys(a.enclosurePatterns),g=0;g<e.length;g++){var h=a.enclosurePatterns[e[g]],k=this._findMatch(h.regex,b,0);if(k&&0===k.index){d=h;break}}if(!d)return null;g=!1;-1!==d.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)?(g=!0,e=d.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN,this._PUNCTUATION_SECTION_END)):e=d.pattern.name.replace(this._PUNCTUATION_SECTION_END,
this._PUNCTUATION_SECTION_BEGIN);return!a.enclosurePatterns[e]?null:{beginName:d.pattern.name,endName:e,atStart:g}},parse:function(a,b,d,e,g){if(a&&(d=d.linePatterns)){var h=[];d.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 n=l.result.index,p,x=[];if(l.pattern.regex){k=l.result;p=n+k[0].length;p={start:b+n,end:b+p,style:l.pattern.pattern.name};if(!g){l.pattern.pattern.captures&&this._getCaptureStyles(k,l.pattern.pattern.captures,b+n,x);x.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(n=0;n<x.length-1;n++)if(x[n+1].start<x[n].end){var z={start:x[n+1].end,end:x[n].end,style:x[n].style};x[n].end=x[n+1].start;x.splice(n+2,0,z)}}this._mergeStyles(p,x,
e)}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)),p=k.index+k[0].length,e.push({start:b+n,end:b+p,style:l.pattern.pattern.name});k=k.index+k[0].length}this._updateMatch(l,a,h,k)}d.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},setStyler:function(){},verifyBlock:function(a,b,d,e){var g=null,h=[];d.parent.blockPatterns.forEach(function(a){var d=
this._findMatch(a.regexBegin||a.regex,b,0);d&&h.push({result:d,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!==d.pattern.pattern.id)g=!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,n=this._findMatch(l,b,
k);null===g&&n&&d.start+n.index!==d.contentEnd+e;){var p=this.computeBlocks(a,b,d,d.start,k,n.index+1,null);!p.length||p[p.length-1].end<=d.start+n.index?g=!1:p.length?(k=p[p.length-1].end-d.start,n=this._findMatch(l,b,k)):n=null}n||(this._eolRegex.lastIndex=0,n=this._eolRegex.exec(b),g=d.start+n.index===d.end+e)}else g=d.start+k.result[0].length===d.end+e}return null!==g?g:!0},_findMatch:function(a,b,d,e){var g=d,h=a.lastIndex;this._linebreakRegex.lastIndex=d;d=this._linebreakRegex.exec(b);var k,
l;a.lastIndex=0;if(d){for(l=d.index;0<=--l&&!(k=b.charAt(l),k===this._NEWLINE||k===this._CR););k=b.substring(l+1,d.index+d[1].length);a.lastIndex=l=d.index-l-1}for(;d&&d.index<b.length;){var n;if(e){var p=a.lastIndex;a.test(k)&&(a.lastIndex=p,n=a.exec(k))}else n=a.exec(k);if(n)return n.index+=g,n.index-=l,a.lastIndex=h,n;l=0;g+=d[0].length;if(d=this._linebreakRegex.exec(b))k=d[1],a.lastIndex=0}a.lastIndex=h;return null},_getCaptureStyles:function(a,b,d,e){if(b[0])e.push({start:d,end:d+a[0].length,
style:b[0].name});else for(var g=0,h=1;h<a.length;h++)if(a[h]){var k=b[h];if(k){var l=d+g;e.push({start:l,end:l+a[h].length,style:k.name})}g+=a[h].length}},_initPatterns:function(a,b){if(b.pattern&&b.pattern.pattern.linePatterns)b.linePatterns=b.pattern.pattern.linePatterns,b.blockPatterns=b.pattern.pattern.blockPatterns,b.enclosurePatterns=b.pattern.pattern.enclosurePatterns;else{var d=a.getPatterns(b.pattern?b.pattern.pattern:null),e=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),g=-1,h=0;d.forEach(function(a){var d;if(a.match&&!a.begin&&!a.end){if(d={regex:e(a.match),pattern:a},b.linePatterns.push(d),a.name&&0===a.name.indexOf("punctuation.section")&&(-1!==a.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)||-1!==a.name.indexOf(this._PUNCTUATION_SECTION_END)))b.enclosurePatterns[a.name]=d}else!a.match&&(a.begin&&a.end)&&(g=h,d={regexBegin:e(a.begin),regexEnd:e(a.end),pattern:a},b.linePatterns.push(d));
h++}.bind(this));b.blockPatterns=b.linePatterns.slice(0,g+1);b.pattern&&(b.pattern.pattern.enclosurePatterns=b.enclosurePatterns,b.pattern.pattern.linePatterns=b.linePatterns,b.pattern.pattern.blockPatterns=b.blockPatterns)}},_mergeStyles:function(a,b,d){var e=a.start;b.forEach(function(b){e<=b.start&&d.push({start:e,end:b.start,style:a.style});d.push(b);e=b.end});e<a.end&&d.push({start:e,end:a.end,style:a.style})},_substituteCaptureValues:function(a,b){var d=a.toString();this._captureReferenceRegex.lastIndex=
0;if(!this._captureReferenceRegex.test(d))return a;this._captureReferenceRegex.lastIndex=0;for(var e=this._captureReferenceRegex.exec(d);e;)d=d.replace(e[0],b[e[1]]||""),this._captureReferenceRegex.lastIndex=0,e=this._captureReferenceRegex.exec(d);return RegExp(d.substring(1,d.length-1-this._FLAGS.length),this._FLAGS)},_updateMatch:function(a,b,d,e,g){var h=a.pattern.regex?a.pattern.regex:a.pattern.regexBegin;g=g||Infinity;if((b=this._findMatch(h,b,e,!0))&&b.index<g){a.result=b;for(g=0;g<d.length;g++)if(b.index<
d[g].result.index||b.index===d[g].result.index&&a.pattern.pattern.index<d[g].pattern.pattern.index){d.splice(g,0,a);return}d.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 b=[0],d={},e=RegExp("^"+a+"[^#]+$");
this._patterns.forEach(function(a){e.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,d):(a.index=b[0]++,d[a.id]=a))}.bind(this));var g=[];Object.keys(d).forEach(function(a){g.push(d[a])});return g},_addPattern:function(a,b,d){a.parentId=d;a.id=b;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_addPatterns:function(a,b){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,b)}.bind(this))},
_addRepositoryPatterns:function(a,b){Object.keys(a).forEach(function(d){this._addPattern(a[d],d,b)}.bind(this))},_processInclude:function(a,b,d){var e,g=a.include.indexOf("#");e=0===g?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===g?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){e.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,d):d[a.id]||(a.index=b[0]++,d[a.id]=a))}.bind(this))},_NO_ID:"NoID"};
b.prototype={adjustBounds:function(a,b){a<this.start&&(this.start+=b);a<this.contentStart&&(this.contentStart+=b);a<=this.end&&(this.end+=b);a<=this.contentEnd&&(this.contentEnd+=b);this._subBlocks.forEach(function(d){a<=d.end&&d.adjustBounds(a,b)})},getBlocks:function(){return this._subBlocks},getBlockAtIndex:function(a){return e(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,b,d,e,g,h,k){return this._stylerAdapter.computeBlocks(a,b,d,e,g,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 b=[],d=this._view.getModel();d.getBaseModel&&(d=d.getBaseModel());var g=this._findBlock(this._rootBlock,a),h=d.getLineAtOffset(a),k=d.getLine(h),l=[];this._stylerAdapter.parse(k,d.getLineStart(h),g,l);for((h=l[e(l,a,!0)])&&(h.start<=a&&a<h.end)&&b.push(h);g;)(h=
this._stylerAdapter.computeStyle(g,d,a))&&b.splice(0,0,h),g=g.parent;return b},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,b){this._whitespacesVisible!==a&&(this._whitespacesVisible=a,b&&this._view.redraw())},_computeFolding:function(a,b,d){if(b.getBaseModel){var e=b.getBaseModel();a.forEach(function(a){var g=this._createFoldingAnnotation(b,e,a.start,a.end);g&&d.push(g);this._computeFolding(a.getBlocks(),b,d)}.bind(this))}},_computeTasks:function(a,b,d,e,g){e=e||a.start;g=g||a.end;if(a.start<=
g&&e<=a.end&&this._annotationModel){var h=l.AnnotationType.ANNOTATION_TASK;if(a.name&&0===a.name.indexOf("comment")){var k=[];this._stylerAdapter.parse(b.getText(a.contentStart,a.end),a.contentStart,a,k,!0);for(var n=0;n<k.length;n++)"meta.annotation.task.todo"===k[n].style&&(e<=k[n].start&&k[n].end<=g)&&d.push(l.AnnotationType.createAnnotation(h,k[n].start,k[n].end,b.getText(k[n].start,k[n].end)))}a.getBlocks().forEach(function(a){this._computeTasks(a,b,d,e,g)}.bind(this))}},_createFoldingAnnotation:function(a,
b,d,e){var g=b.getLineAtOffset(d),h=b.getLineAtOffset(e);return g===h||g+1===h&&b.getLineStart(h)===b.getLineEnd(h)?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(d,e,a)},_findBlock:function(a,b){var d=a.getBlocks();if(!d.length)return a;var g=e(d,b,!0);return g<d.length&&d[g].start<=b&&b<d[g].end?this._findBlock(d[g],b):a},_findBrackets:function(a,b,d,g,h){for(var k=[],l=[],n=g,p=b.getBlocks(),s=e(p,g,!0);s<p.length&&!(p[s].start>=h);s++){var x=p[s].start,z=p[s].end;n<x&&
(this._stylerAdapter.parse(d.substring(n-g,x-g),n,b,l),l.forEach(function(b){0===b.style.indexOf(a.beginName)?k.push(b.start+1):0===b.style.indexOf(a.endName)&&k.push(-(b.start+1))}),l=[]);n=z}n<h&&(this._stylerAdapter.parse(d.substring(n-g,h-g),n,b,l),l.forEach(function(b){b.style&&(0===b.style.indexOf(a.beginName)?k.push(b.start+1):0===b.style.indexOf(a.endName)&&k.push(-(b.start+1)))}));return k},_findMatchingBracket:function(a,b,d){var e=a.getLineAtOffset(d),g=a.getLineEnd(e),h=a.getText(d,g),
h=this._stylerAdapter.getBracketMatch(b,h);if(!h)return-1;for(var k=a.getLine(e),l=a.getLineStart(e),g=this._findBrackets(h,b,k,l,g),n=0;n<g.length;n++)if(k=0<=g[n]?1:-1,g[n]*k-1===d){d=1;if(h.atStart){for(n++;n<g.length;n++)if(k=0<=g[n]?1:-1,d+=k,0===d)return g[n]*k-1;e+=1;for(n=a.getLineCount();e<n;){k=a.getLine(e);l=a.getLineStart(e);g=a.getLineEnd(e);g=this._findBrackets(h,b,k,l,g);for(l=0;l<g.length;l++)if(k=0<=g[l]?1:-1,d+=k,0===d)return g[l]*k-1;e++}}else{for(n--;0<=n;n--)if(k=0<=g[n]?1:-1,
d+=k,0===d)return g[n]*k-1;for(e-=1;0<=e;){k=a.getLine(e);l=a.getLineStart(e);g=a.getLineEnd(e);g=this._findBrackets(h,b,k,l,g);for(n=g.length-1;0<=n;n--)if(k=0<=g[n]?1:-1,d+=k,0===d)return g[n]*k-1;e--}}break}return-1},_getLineStyle:function(a){if(this._highlightCaretLine){var b=this._view.getModel(),d=this._view.getSelection();if(d.start===d.end&&b.getLineAtOffset(d.start)===a)return this._caretLineStyle}return null},_getStyles:function(a,b,d,g){b.getBaseModel&&(g=b.mapOffset(g));for(var h=g+d.length,
k=[],l=g,n=a.getBlocks(),p=e(n,g,!0);p<n.length&&!(n[p].start>=h);p++){var s=n[p].start,x=n[p].end;l<s&&this._stylerAdapter.parse(d.substring(l-g,s-g),l,a,k);var z=Math.max(l,s);z===s&&(s=this._stylerAdapter.getBlockStartStyle(n[p],d.substring(z-g),z,k))&&(z+=s.length);var s=Math.min(h,x),y=[];s===x&&(l=d.substring(s-l-(n[p].end-n[p].contentEnd)),(l=this._stylerAdapter.getBlockEndStyle(n[p],l,s,y))&&(s-=l.length));var l=this._getStyles(n[p],b,d.substring(z-g,s-g),z),B=this._stylerAdapter.getBlockContentStyleName(n[p]);
if(B){var v=z;l.forEach(function(a){a.start-v&&k.push({start:v,end:a.start,style:B});a.mergeable&&(a.style+=","+B);k.push(a);v=a.end});s-v&&k.push({start:v,end:s,style:B})}else k=k.concat(l);k=k.concat(y);l=x}l<h&&this._stylerAdapter.parse(d.substring(l-g,h-g),l,a,k);if(b.getBaseModel)for(a=0;a<k.length;a++)d=k[a].end-k[a].start,k[a].start=b.mapOffset(k[a].start,!0),k[a].end=k[a].start+d;return k},_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 b=a.start,d=a.removedCharCount;a=a.addedCharCount-d;var g=this._view.getModel(),h=g.getBaseModel?g.getBaseModel():g,d=b+d,k=h.getCharCount(),n=h.getLineStart(h.getLineAtOffset(b)),p=this._findBlock(this._rootBlock,b),w,s,x,z,y,B,v;do{x=p.parent;if(!w&&x&&(y=h.getText(p.start,Math.min(k,p.end+a+1)),!this._stylerAdapter.verifyBlock(h,y,p,a))){p=x;continue}s=p.getBlocks();var A=s.length,C=e(s,n,!0),F=e(s,d,!1,C-1,A);w=!1;if(C&&s.length&&s[C-1].end===b){y=
h.getText(s[C-1].start,Math.min(k,b+1));var D=this.computeBlocks(h,y,p,s[C-1].start,null,null,null);D.length&&D[0].end!==s[C-1].end&&(C--,w=!0)}C<A&&s[C].start<=n&&(n<s[C].end||w)?(v=s[C].start,v>b&&(v+=a)):C===A&&0<A&&p.end-a===s[A-1].end?(v=s[--C].start,v>b&&(v+=a)):v=Math.max(n,p.contentStart);B=F<A?s[F].end:p.contentEnd;b<=B&&(B+=a);B=Math.min(B,k-1);y=h.getText(v,B+1);D=this.computeBlocks(h,y,p,v,null,null,null);if(F<A){if(D.length&&D[D.length-1].end===B&&D[D.length-1].typeId===s[F].typeId)break;
if(D.length&&this._stylerAdapter.blockSpansBeyondEnd(D[D.length-1])){F++;for(var E=D[D.length-1].getBlocks(),E=(E.length?E[E.length-1]:D[D.length-1]).typeId;F<A;){if(s[F].typeId===E){var I=s[F].end+a,I=Math.min(I,k-1);y=h.getText(v,I+1);y=this.computeBlocks(h,y,p,v,null,null,null);if(y.length&&y[y.length-1].end===I){B=I;D=y;break}}F++}if(F<A)break}}else if(!D.length||D[D.length-1].end<=p.contentEnd+a)break;if(!x){B=k;F=A;y=h.getText(v,B);D=this.computeBlocks(h,y,p,v,null,null,null);break}p=x;z=!0}while(1);
this._rootBlock.adjustBounds(b,a);F=Math.min(F+1,A);z||(z=F-C!==D.length);if(!z)for(A=0;A<D.length;A++)if(w=s[C+A],k=D[A],w.start!==k.start||w.end!==k.end||w.typeId!==k.typeId){z=!0;break}!s.length&&!D.length?this.dispatchEvent({type:"BlocksChanged",old:[p],"new":[p]}):this.dispatchEvent({type:"BlocksChanged",old:s.slice(C,F),"new":D});C=[C,F-C].concat(D);Array.prototype.splice.apply(s,C);z&&(s=v,z=B,g!==h&&(s=g.mapOffset(s,!0),z=g.mapOffset(z,!0)),this._view.redrawRange(s,z));if(this._annotationModel){s=
[];var G=[],H=[];z=this._annotationModel.getAnnotations(v,B);C=this._foldingEnabled&&h!==g;for(F=p.parent||p;z.hasNext();)D=z.next(),C&&D.type===l.AnnotationType.ANNOTATION_FOLDING?(H.push(D),w=this._findBlock(F,D.start),!w||!(D.start===w.start&&D.end===w.end)?(s.push(D),D.expand()):(w=D.start,A=D.end,w>b&&(w-=a),A>b&&(A-=a),w<=b&&(b<A&&w<=d&&d<A)&&(w=h.getLineAtOffset(D.start),A=h.getLineAtOffset(D.end),w!==A?D.expanded||D.expand():s.push(D)))):D.type===l.AnnotationType.ANNOTATION_TASK&&p.start<=
D.start&&D.end<=p.end&&s.push(D);C&&F.getBlocks().forEach(function(a){this._updateFolding(a,h,g,H,G,v,B)}.bind(this));this._detectTasks&&this._computeTasks(p,h,G,v,B);this._annotationModel.replaceAnnotations(s,G)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this._view.getModel(),d=this._view.getOffsetAtLocation(a.x,a.y);if(0<d){var e=d-1,g=b;b.getBaseModel&&(e=b.mapOffset(e),g=b.getBaseModel());var h=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(g,h,e);-1!==e&&(a.preventDefault(),
a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),this._view.setSelection(a,d))}}},_onSelection:function(a){var b=a.oldValue,d=a.newValue;a=this._view.getModel();var e;if(this._highlightCaretLine){var g=a.getLineAtOffset(b.start);e=a.getLineAtOffset(d.start);var h=d.start===d.end,b=b.start===b.end;g===e&&b&&h||(b&&this._view.redrawLines(g,g+1),(g!==e||!b)&&h&&this._view.redrawLines(e,e+1))}if(this._annotationModel){var b=this._bracketAnnotations,k,n;if(d.start===d.end&&0<(n=this._view.getCaretOffset()))n-=
1,a.getBaseModel&&(n=a.mapOffset(n),a=a.getBaseModel()),d=this._findBlock(this._rootBlock,n),a=this._findMatchingBracket(a,d,n),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,n,n+1)]);this._bracketAnnotations=k;this._annotationModel.replaceAnnotations(b,k)}},_spliceStyles:function(a,b,d,e){for(var g=a.regex,h=g.lastIndex=0,k=g.exec(d);k;){for(k=e+k.index;h<b.length&&!(k<
b[h].end);)h++;var l={start:k,end:k+1,style:a.style};if(h<b.length&&b[h].start<=k){var n={start:k+1,end:b[h].end,style:b[h].style};b[h].end=k;b.splice(h+1,0,n);b.splice(h+1,0,l);h+=2}else b.splice(h,0,l),h++;k=g.exec(d)}},_updateFolding:function(a,b,d,g,h,k,l){k=k||a.start;l=l||a.end;if(!a.doNotFold&&a.start<=l&&k<=a.end){var n=e(g,a.start,!0);n<g.length&&g[n].start===a.start&&g[n].end===a.end||(n=this._createFoldingAnnotation(d,b,a.start,a.end))&&h.push(n);a.getBlocks().forEach(function(a){this._updateFolding(a,
b,d,g,h,k,l)}.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}}};p.EventTarget.addMixin(g.prototype);return{TextStyler:g,Block:b,createPatternBasedAdapter:function(a,b){return new n(a,b)}}});
define("orion/editor/textMateStyler",["orion/regex"],function(l){function p(b){var h;if(b instanceof Array){h=Array(b.length);for(var g=0;g<b.length;g++)h[g]=p(b[g])}else for(g in h={},b)if(Object.prototype.hasOwnProperty.call(b,g)){var e=b[g];h[g]="object"===typeof e&&null!==e?p(e):e}return h}function n(b,h,g){this.initialize(b);this.grammar=p(h);this.externalGrammars=g?p(g):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var k={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(b){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(b){return"\x3d"===b[1]?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(b){return"atomic group"}}],toRegExp:function(b){function h(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var g="",e;b=k.processGlobalFlag("x",b,function(a){for(var b="",e=!1,g=a.length,h=0;h<g;){var k=a.charAt(h);if(!e&&"#"===k)for(;h<g&&"\r"!==k&&"\n"!==k;)k=a.charAt(++h);
else if(!e&&/\s/.test(k))for(;h<g&&/\s/.test(k);)k=a.charAt(++h);else"\\"===k?(b+=k,/\s/.test(a.charAt(h+1))||(b+=a.charAt(h+1),h+=1)):("["===k?e=!0:"]"===k&&(e=!1),b+=k),h+=1}return b});b=k.processGlobalFlag("i",b,function(a){g+="i";return a});for(e=0;e<this.unsupported.length;e++){var a;(a=this.unsupported[e].regex.exec(b))&&h(this.unsupported[e].func(a),a)}return RegExp(b,g)},processGlobalFlag:function(b,h,g){var e="(?"+b+")";b="(?"+b+":";if(h.substring(0,e.length)===e)return g(h.substring(e.length));
if(h.substring(0,b.length)===b){for(var e=0,a=h.length,f=-1,d=0;d<a&&-1===f;d++)switch(h.charAt(d)){case "\\":d++;break;case "(":e++;break;case ")":e--,0===e&&(f=d)}e=f;if(e<h.length-1)throw Error("Only a "+b+") group that encloses the entire regex is supported in: "+h);return g(h.substring(b.length,e))}return h},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,h,g){g="undefined"===typeof g?!0:!1;b=b.source.split(/(\\\d+)/g);for(var e=[],a=0;a<b.length;a++){var f=
b[a],d=/\\(\d+)/.exec(f);d?(f=h[d[1]]||"",e.push(g?l.escape(f):f)):e.push(f)}return RegExp(e.join(""))},groupify:function(b,h){for(var g=b.source,e=g.length,a=[],f=0,d=[],k=1,l=1,n=[],p={},t={},w=0;w<e;w++){var s=a[a.length-1],x=g.charAt(w);switch(x){case "(":4===s&&(a.pop(),n.push(")"),d[d.length-1].end=w);var z=w+2<e?g.charAt(w+1)+""+g.charAt(w+2):null;if("?:"===z||"?\x3d"===z||"?!"===z){var y;"?:"===z?y=1:(y=3,f++);a.push(y);d.push({start:w,end:-1,type:y});n.push(x);n.push(z);w+=z.length}else a.push(2),
d.push({start:w,end:-1,type:2,oldNum:k,num:l}),n.push(x),0===f&&(t[l]=null),p[k]=l,k++,l++;break;case ")":s=a.pop();3===s&&f--;d[d.length-1].end=w;n.push(x);break;case "*":case "+":case "?":case "}":var B=x,v=g.charAt(w-1),z=w-1;if("}"===x){for(y=w-1;"{"!==g.charAt(y)&&0<=y;y--);v=g.charAt(y-1);z=y-1;B=g.substring(y,w+1)}y=d[d.length-1];if(")"===v&&(2===y.type||4===y.type)){n.splice(y.start,0,"(");n.push(B);n.push(")");x={start:y.start,end:n.length-1,type:4,num:y.num};for(v=0;v<d.length;v++)if(s=
d[v],(2===s.type||4===s.type)&&s.start>=y.start&&s.end<=z)s.start+=1,s.end+=1,s.num+=1,2===s.type&&(p[s.oldNum]=s.num);d.push(x);l++;break}default:"|"!==x&&(2!==s&&4!==s)&&0===f&&(a.push(4),d.push({start:w,end:-1,type:4,num:l}),n.push("("),t[l]=null,l++),n.push(x),"\\"===x&&(x=g.charAt(w+1),n.push(x),w+=1)}}for(;a.length;)a.pop(),n.push(")");g=RegExp(n.join(""));e={};h=h||p;for(var A in h)h.hasOwnProperty(A)&&(e[A]="\\"+h[A]);g=this.getSubstitutedRegex(g,e,!1);return[g,p,t]},complexCaptures:function(b){if(!b)return!1;
for(var h in b)if(b.hasOwnProperty(h)&&"0"!==h)return!0;return!1}};n.prototype={initialize:function(b){this.textView=b;this.textView.stylerOptions=this;var h=this;this._listener={onModelChanged:function(b){h.onModelChanged(b)},onDestroy:function(b){h.onDestroy(b)},onLineStyle:function(b){h.onLineStyle(b)},onStorage:function(b){h.onStorage(b)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);
b.redrawLines()},onDestroy:function(b){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(b){for(b=[b];0!==b.length;){var h=b.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&&b.push(h._resolvedRule),h.patterns)for(var g=0;g<h.patterns.length;g++)b.push(h.patterns[g])}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var h=b.split("."),g=0;g<h.length;g++)this._styles[b].push(h.slice(0,g+1).join("-"))}},
addStylesForCaptures:function(b){for(var h in b)b.hasOwnProperty(h)&&this.addStyles(b[h].name)},ContainerRule:function(){function b(b){this.rule=b;this.subrules=b.patterns}b.prototype.valueOf=function(){return"aa"};return b}(),BeginEndRule:function(){function b(b){this.rule=b;this.beginRegex=k.toRegExp(b.begin);this.endRegex=k.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=k.hasBackReference(this.endRegex);var g=k.complexCaptures(b.captures);b=k.complexCaptures(b.beginCaptures)||
k.complexCaptures(b.endCaptures);if(this.isComplex=g||b)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]}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(b){this.rule=b;this.matchRegex=k.toRegExp(b.match);if(this.isComplex=k.complexCaptures(b.captures))b=k.groupify(this.matchRegex),this.matchRegex=
b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var h=b;if(b.include){if(b.begin||b.end||b.match)throw Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if("#"===b.charAt(0)){if(h=this.grammar.repository&&this.grammar.repository[b.substring(1)],!h)throw Error("Couldn't find included rule "+
b+" in grammar repository");}else if("$self"===b)h=this.grammar;else{if("$base"===b)throw Error('Include "$base" is not supported');h=this._allGrammars[b];if(!h)for(var g=0;g<this.externalGrammars.length;g++){var e=this.externalGrammars[g];if(e.scopeName===b){this.preprocess(e);h=this._allGrammars[b]=e;break}}}}return h},ContainerNode:function(){function b(b,g){this.parent=b;this.rule=g;this.children=[];this.end=this.start=null}b.prototype.addChild=function(b){this.children.push(b)};b.prototype.valueOf=
function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(b,g,e){this.parent=b;this.rule=g;this.children=[];this.setStart(e);this.endMatch=this.end=null;this.endRegexSubstituted=g.endRegexHasBackRef?k.getSubstitutedRegex(g.endRegex,e):null}b.prototype.addChild=function(b){this.children.push(b)};b.prototype.getIndexInParent=function(b){return this.parent?this.parent.children.indexOf(this):-1};b.prototype.setStart=
function(b){this.start=b.index;this.beginMatch=b};b.prototype.setEnd=function(b){b&&"object"===typeof b?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};b.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};b.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range\x3d"+this.start+".."+this.end+"}"};return b}(),push:function(b,h){if(h)for(var g=h.length;0<
g;)b.push(h[--g])},exec:function(b,h,g){if(h=b.exec(h))h.index+=g;b.lastIndex=0;return h},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,h,g){if(b instanceof this.BeginEndNode){var e=b.rule;b=b.endRegexSubstituted||e.endRegex;return!b?null:this.exec(b,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(b){var h=b.addedCharCount,
g=b.removedCharCount;b=b.start;if(this._tree){var e=this.textView.getModel(),a=e.getCharCount(),e=e.getLineEnd(e.getLineAtOffset(b)-1),f=this.getFirstDamaged(e,e),e=-1===e?0:e,h=f?this.parse(f,!0,e,b,h,g):a;this.textView.redrawRange(e,h)}else this.initialParse()},getFirstDamaged:function(b,h){if(0>b)return this._tree;for(var g=[this._tree],e=null;g.length;){var a=g.pop();if(!a.parent||this.isDamaged(a,b,h)){a instanceof this.BeginEndNode&&(e=a);for(var f=0;f<a.children.length;f++)g.push(a.children[f])}}return e||
this._tree},isDamaged:function(b,h,g){return b.start<=g&&b.end>h},parse:function(b,h,g,e,a,f){var d=this.textView.getModel(),k=d.getLineStart(d.getLineCount()-1),l=d.getCharCount(),n=this.getInitialExpected(b,g),p=-1;h&&(b.repaired=!0,b.endNeedsUpdate=!0,p=(p=b.children[b.children.length-1])?d.getLineEnd(d.getLineAtOffset(p.end+(a-f))):-1,e=d.getLineEnd(d.getLineAtOffset(e+f)),p=Math.max(p,e));p=-1===p?l:p;e=n;for(var t=b,w=!1,s=g,x=-1;t&&(!h||s<p);){var z=this.getNextMatch(d,t,s);z||(s=s>=k?l:d.getLineStart(d.getLineAtOffset(s)+
1));var y=z&&z.match,B=z&&z.rule,v=z&&z.isEnd;if(z&&z.isSub)s=this.afterMatch(y),B instanceof this.BeginEndRule&&(w=!0,h&&B===e.rule&&t===e.parent?(t=e,t.setStart(y),t.repaired=!0,t.endNeedsUpdate=!0,e=this.getNextExpected(e,"begin")):(h&&(this.prune(t,e),h=!1),y=new this.BeginEndNode(t,B,y),t.addChild(y),t=y));else if(v||s===l)t instanceof this.BeginEndNode&&(y?(w=!0,x=Math.max(x,t.end),t.setEnd(y),s=this.afterMatch(y),h&&t===e&&t.parent===e.parent?(t.repaired=!0,delete t.endNeedsUpdate,e=this.getNextExpected(e,
"end")):h&&(this.prune(t,e),h=!1)):(t.setEnd(l),delete t.endNeedsUpdate)),t=t.parent;h&&(s>=p&&!w)&&(this.prune(b,n),h=!1)}this.removeUnrepairedChildren(b,h,g);this.cleanup(h,b,g,p,l,a,f);return h?Math.max(x,s):s},removeUnrepairedChildren:function(b,h,g){if(h){h=b.children;for(var e=-1,a=0;a<h.length;a++){var f=h[a];if(!f.repaired&&this.isDamaged(f,g,Number.MAX_VALUE)){e=a;break}}-1!==e&&(b.children.length=e)}},cleanup:function(b,h,g,e,a,f,d){if(b){b=f-d;a=this.getIntersecting(e-b+1,a);h=this.getIntersecting(g,
e);for(g=0;g<a.length;g++)e=a[g],!e.repaired&&e instanceof this.BeginEndNode&&(e.shiftEnd(b),e.shiftStart(b));for(g=0;g<h.length;g++)e=h[g],e.repaired&&e.endNeedsUpdate&&e.shiftEnd(b),delete e.endNeedsUpdate,delete e.repaired}else{h=this.getIntersecting(g,e);for(g=0;g<h.length;g++)delete h[g].repaired}},getNextMatch:function(b,h,g,e){var a=b.getLineAtOffset(g),a=b.getLineEnd(a),f=b.getText(g,a),d=[],k=[];b=[];a=[];for(this.push(d,h.rule.subrules);d.length;){var l=d.length?d.pop():null,l=l&&l._resolvedRule._typedRule;
if(l instanceof this.ContainerRule&&-1===k.indexOf(l))k.push(l),this.push(d,l.subrules);else if(!l||!e||l.matchRegex){var n=l&&this.exec(l.matchRegex||l.beginRegex,f,g);n&&(b.push(n),a.push(l))}}d=Number.MAX_VALUE;k=-1;for(l=0;l<b.length;l++)n=b[l],n.index<d&&(d=n.index,k=l);if(!e&&(g=this.getEndMatch(h,f,g)))if(e=h.rule.applyEndPatternLast,-1===k||g.index<d||!e&&g.index===d)return{isEnd:!0,rule:h.rule,match:g};return-1===k?null:{isSub:!0,rule:a[k],match:b[k]}},getInitialExpected:function(b,h){var g,
e;if(b===this._tree)for(g=0;g<b.children.length;g++){if(e=b.children[g],e.start>=h)return e}else if(b instanceof this.BeginEndNode&&b.endMatch){var a=b.endMatch.index;for(g=0;g<b.children.length&&!(e=b.children[g],e.start>=h);g++);if(e&&e.start<a)return e}return b},getNextExpected:function(b,h){if("begin"===h){var g=b.children[0];return g?g:b}if("end"===h&&(g=b.parent)){var e=g.children[g.children.indexOf(b)+1];return e?e:g}return null},prune:function(b,h){h.parent===b?b.children.length=h.getIndexInParent():
b instanceof this.BeginEndNode&&(b.endMatch=null,b.end=null);b.parent&&(b.parent.children.length=b.getIndexInParent()+1)},onLineStyle:function(b){this._tree||this.initialParse();var h=b.lineStart,g=this.textView.getModel(),e=g.getLineEnd(b.lineIndex),a=g.getLineEnd(g.getLineAtOffset(h)-1),a=this.getFirstDamaged(a,a),h=this.getLineScope(g,a,h,e);b.ranges=this.toStyleRanges(h);b.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(b,h,g,e){for(var a=g,f=this.getInitialExpected(h,
g),d=[],k=[];h&&a<e;){var l=this.getNextMatch(b,h,a);if(!l)break;var n=l&&l.match,p=l&&l.rule,t=l&&l.isSub,l=l&&l.isEnd;n.index!==a&&k.push({start:a,end:n.index,node:h});t?(a=this.afterMatch(n),p instanceof this.BeginEndRule?(this.addBeginScope(d,n,p),h=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(d,n,p)):l&&(a=this.afterMatch(n),this.addEndScope(d,n,p),f=this.getNextExpected(f,"end"),h=h.parent)}a<e&&k.push({start:a,end:e,node:h});b=this.getInheritedLineScope(k,g,e);return d.concat(b)},
getInheritedLineScope:function(b,h,g){h=[];for(g=0;g<b.length;g++)for(var e=b[g],a=e.node;a;){var f=a.rule.rule,d=f.name;if(f=f.contentName||d){this.addScopeRange(h,e.start,e.end,f);break}a=a.parent}return h},addBeginScope:function(b,h,g){var e=g.rule;this.addCapturesScope(b,h,e.beginCaptures||e.captures,g.isComplex,g.beginOld2New,g.beginConsuming)},addEndScope:function(b,h,g){var e=g.rule;this.addCapturesScope(b,h,e.endCaptures||e.captures,g.isComplex,g.endOld2New,g.endConsuming)},addMatchScope:function(b,
h,g){var e=g.rule,a=e.name;(e=e.captures)?this.addCapturesScope(b,h,e,g.isComplex,g.matchOld2New,g.matchConsuming):this.addScope(b,h,a)},addScope:function(b,h,g){g&&b.push({start:h.index,end:this.afterMatch(h),scope:g})},addScopeRange:function(b,h,g,e){e&&b.push({start:h,end:g,scope:e})},addCapturesScope:function(b,h,g,e,a,f){if(g)if(e){e={1:0};for(var d=0,k=1;void 0!==h[k];k++)void 0!==f[k]&&(d+=h[k].length),void 0!==h[k+1]&&(e[k+1]=d);f=h.index;for(d=1;g[d];d++){var k=g[d].name,l=a[d],n=f+e[l];
"undefined"!==typeof h[l]&&this.addScopeRange(b,n,n+h[l].length,k)}}else this.addScope(b,h,g[0]&&g[0].name)},getIntersecting:function(b,h){for(var g=[],e=this._tree?[this._tree]:[];e.length;){var a=e.pop(),f=!1;a instanceof this.ContainerNode?f=!0:this.isDamaged(a,b,h)&&(f=!0,g.push(a));if(f)for(var f=a.children.length,d=0;d<f;d++)e.push(a.children[d])}return g.reverse()},toStyleRanges:function(b){for(var h=[],g=0;g<b.length;g++){var e=b[g],a=this._styles[e.scope];if(!a)throw Error("styles not found for "+
e.scope);a=a.join(" ");h.push({start:e.start,end:e.end,style:{styleClass:a}})}return h}};return{RegexUtil:k,TextMateStyler:n}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(l,p){function n(g){return-1!==g.getProperty("objectClass").indexOf(b)&&"highlighter"===g.getProperty("type")}function k(b,e,a){this.initialize(b,e,a);this.lineStyles=[]}var b="orion.edit.highlighter",h=b+" service must be an event emitter";p.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,e,a){this.textView=g;this.serviceRegistry=e;this.annotationModel=a;this.services=[];var f=this;this.listener={onModelChanging:function(a){f.onModelChanging(a)},onModelChanged:function(a){f.onModelChanged(a)},onDestroy:function(a){f.onDestroy(a)},onLineStyle:function(a){f.onLineStyle(a)},onStyleReady:function(a){f.onStyleReady(a)},onServiceAdded:function(a){f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){f.onServiceRemoved(a.serviceReference,
f.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);e.addEventListener("registered",this.listener.onServiceAdded);e.addEventListener("unregistering",this.listener.onServiceRemoved);g=e.getServiceReferences(b);for(a=0;a<g.length;a++){var d=g[a];n(d)&&this.addServiceListener(e.getService(d))}},
onDestroy:function(b){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 b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);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(b){this.startLine=this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var e=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[e,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var e=b.lineStyles||b.style;b=Number.MAX_VALUE;var a=-1,f=this.textView.getModel(),d;for(d in e)Object.prototype.hasOwnProperty.call(e,d)&&(this.lineStyles[d]=e[d],b=Math.min(b,d),a=Math.max(a,d));b=Math.max(b,0);a=Math.min(a,f.getLineCount());if(e=this.annotationModel){for(var h=e.getAnnotations(f.getLineStart(b),f.getLineEnd(a)),k=[];h.hasNext();){var l=h.next();"orion.annotation.highlightError"===l.type&&k.push(l)}h=[];for(l=b;l<=a;l++){d=l;var n=this.lineStyles[d],n=n&&
n.errors;d=f.getLineStart(d);if(n)for(var t=0;t<n.length;t++){var w=n[t];h.push(p.AnnotationType.createAnnotation("orion.annotation.highlightError",w.start+d,w.end+d))}}e.replaceAnnotations(k,h)}this.textView.redrawLines(b,a+1)},onLineStyle:function(b){var e=this.lineStyles[b.lineIndex];if(e)if(e.ranges){for(var e=e.ranges,a=b.lineStart,f=e.length,d=[],h=0;h<f;h++){var k=e[h];d.push({start:k.start+a,end:k.end+a,style:k.style})}b.ranges=d}else e.style&&(b.style=e.style)},_getEmptyStyle:function(b){for(var e=
[],a=0;a<b;a++)e.push(null);return e},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var e=this.services[b];if(e.setContentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(e.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):e.setContentType(this.contentType)}}},onServiceAdded:function(b,e){n(b)&&this.addServiceListener(e)},onServiceRemoved:function(b,
e){-1!==this.services.indexOf(e)&&this.removeServiceListener(e)},addServiceListener:function(b){if("function"===typeof b.addEventListener){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){var e=this.serviceRegistry.getService("orion.page.progress");e?e.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else"undefined"!==
typeof console&&console.log(Error(h))},removeServiceListener:function(b){"function"===typeof b.removeEventListener?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),-1!==b&&this.services.splice(b,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,p,n,k,b){function h(a,f,d,g,h,u,q){function t(a,e){var g=a.getProperty("contentType")||a.getProperty("contentTypes"),h=a.getProperty("fileTypes");return g?b.when(f.isSomeExtensionOf(d,g)).then(function(b){return b?a:null}):e&&h&&-1!==h.indexOf(e)?(g=new b,g.resolve(a),g):null}function w(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(!e){var s=w(d);if(s)return u=new b,u.resolve(s),u}e&&!this.orionGrammars&&(this.orionGrammars={});s=u&&u.split(".").pop().toLowerCase();u=a.getServiceReferences("orion.edit.highlighter");for(var x=[],z=[],y=0;y<u.length;y++){var B=u[y],v=B.getProperty("type");"grammar"===v||!e&&"undefined"===typeof v?x.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=t(B,s))&&z.push(B)}return b.all(z,function(a){return{_error:a}}).then(function(b){for(var f,l=b.length-1;0<=l;l--){var t=b[l];if(t&&!t._error&&(q||"highlighter"!==t.getProperty("type"))){f=t;break}}var s;if(f)if(b=f.getProperty("type"),"highlighter"===b)s=new k(g,a,h),s.setContentType(d);else if("grammar"===
b||!e&&"undefined"===typeof b)f=f.getProperty("grammar"),s=new n.TextMateStyler(g,f,x);else if(e){s=[];for(var u in this.orionGrammars)s.push(this.orionGrammars[u]);f=new p.createPatternBasedAdapter(s,f.getProperty("id"));s=new p.TextStyler(g,h,f)}return s})}function g(a,b){this.serviceRegistry=a;this.contentTypeService=b;this.styler=null}var e=1;g.prototype={setup:function(a,b,d,e,g){g="undefined"===typeof g?!0:g;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,b,d,e,g).then(function(a){return k.styler=a})},getStyler:function(){return this.styler}};return{createStyler:h,SyntaxHighlighter:g}});
define("orion/markOccurrences",["orion/edit/editorContext","orion/Deferred"],function(l,p){function n(k,b,h){this.registry=k;this.inputManager=b;this.editor=h}n.prototype={setOccurrencesVisible:function(k){this.occurrencesVisible!==k&&((this.occurrencesVisible=k)||this.editor.showOccurrences([]))},findOccurrences:function(){function k(a,b,d){function e(a,b,d){a=b.getProperty("contentType");return g.isSomeExtensionOf(d,a).then(function(a){return a?b:null})}for(var g=a.getService("orion.core.contentTypeRegistry"),
h=a.getServiceReferences("orion.edit.occurrences"),k=[],l=0;l<h.length;l++){var n=h[l],s=n.getProperty("pattern");n.getProperty("contentType")?k.push(e(a,n,b)):s&&RegExp(s).test(d)&&(s=new p,s.resolve(n),k.push(s))}return p.all(k,function(a){return{_error:a}}).then(function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d];e&&!e._error&&b.push(e)}return b})}var b,h=this,g=h.registry.getService("orion.edit.occurrences"),e=function(a){b&&window.clearTimeout(b);h.occurrencesVisible&&(b=window.setTimeout(function(){b=
null;var a={selection:h.editor.getSelection(),contentType:h.inputManager.getContentType().id};g.computeOccurrences(l.getEditorContext(h.registry),a).then(function(a){h.editor.showOccurrences(a)})},500))};h.inputManager.addEventListener("InputChanged",function(a){var f=h.editor.getTextView();f&&(f.removeEventListener("Selection",e),k(h.registry,a.contentType,a.title).then(function(a){!a||0===a.length?b&&window.clearTimeout(b):f.addEventListener("Selection",e)}))})}};return{MarkOccurrences:n}});
define("orion/syntaxchecker",["orion/Deferred","orion/edit/editorContext"],function(l,p){return{SyntaxChecker:function(){function n(b,h){this.registry=b;this.editor=h}function k(b,h,g){b=Math.max(b,h);return b=Math.min(b,g)}n.prototype={checkSyntax:function(b,h,g,e){function a(a,b){function d(a,b,f){a=b.getProperty("contentType");return e.isSomeExtensionOf(f,a).then(function(a){return a?b:null})}for(var e=a.getService("orion.core.contentTypeRegistry"),f=a.getServiceReferences("orion.edit.validator"),
g=[],k=0;k<f.length;k++){var n=f[k],p=n.getProperty("pattern");n.getProperty("contentType")?g.push(d(a,n,b)):p&&RegExp(p).test(h)&&(p=new l,p.resolve(n),g.push(p))}return l.all(g,function(a){return{_error:a}}).then(function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d];e&&!e._error&&b.push(e)}return b})}if(b&&!g){var f=this,d=this.registry;a(d,b).then(function(a){var g=function(a){a=a||{};a=a.problems||a.errors||a;return Array.isArray(a)?a:[]},k=d.getService("orion.page.progress");a=a.map(function(a){a=
d.getService(a);var f;a.computeProblems?(f={contentType:b.id,title:h},f=a.computeProblems(p.getEditorContext(d),f)):a.checkSyntax&&(f=a.checkSyntax(h,e));return k.progress(f,"Validating "+h).then(g)});l.all(a,function(a){return{_error:a}}).then(function(a){for(var b=[],e=0;e<a.length;e++){var g=a[e];g._error||(f._fixup(g),b=b.concat(g))}d.getService("orion.core.marker")._setProblems(b)})})}},_fixup:function(b){for(var h=this.editor.getModel(),g=0;g<b.length;g++){var e=b[g];e.description=e.description||
e.reason;e.severity=e.severity||"error";e.start="number"===typeof e.start?e.start:e.character;if("number"===typeof e.line){var a=h.getLine(e.line-1,!1).length;e.start=k(e.start,1,a-1);e.end="number"===typeof e.end?e.end:-1;e.end=k(e.end,e.start+1,a)}else if(a=h.getCharCount(),e.start=k(e.start,0,a),e.end="number"===typeof e.end?e.end:-1,e.end=k(e.end,e.start,a),e.end===a&&1<h.getLineCount()&&a===h.getLineStart(h.getLineCount()-1)){var f=h.getLineCount()-2,a=h.getLineStart(f),f=h.getLineEnd(f);a===
f?e.start=e.end=f:(e.start=f-1,e.end=f)}}}};return n}()}});
define("orion/editorView","i18n!orion/edit/nls/messages orion/editor/editor orion/editor/eventTarget orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/editorFeatures orion/editor/contentAssist orion/editor/emacs orion/editor/vi orion/editorPreferences orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/widgets/settings/EditorSettings orion/searchAndReplace/textSearcher orion/editorCommands orion/globalCommands orion/edit/dispatcher orion/edit/editorContext orion/edit/typedefs orion/highlight orion/markOccurrences orion/syntaxchecker orion/keyBinding orion/uiUtils orion/util orion/objects".split(" "),function(l,
p,n,k,b,h,g,e,a,f,d,m,r,u,q,t,w,s,x,z,y,B,v,A,C,F,D){function E(a){this._parent=a.parent;this.renderToolbars=a.renderToolbars;this.serviceRegistry=a.serviceRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.commandRegistry=a.commandRegistry;this.progress=a.progress;this.statusService=a.statusService;this.fileClient=a.fileService;this.inputManager=a.inputManager;this.preferences=a.preferences;this.readonly=a.readonly;this.searcher=a.searcher;this.statusReporter=a.statusReporter;this.model=
a.model;this.undoStack=a.undoStack;this.syntaxHighlighter=new y.SyntaxHighlighter(this.serviceRegistry);this.typeDefRegistry=new z(this.serviceRegistry);(a=w.getKeyAssist())&&a.addProvider(this);var b=w.getMainSplitter();b&&b.splitter.addEventListener("resize",function(a){this.editor&&a.node===b.main&&this.editor.resize()}.bind(this));w.getGlobalEventTarget().addEventListener("toggleTrim",function(a){this.editor&&this.editor.resize()}.bind(this));this.settings={};this._init()}E.prototype={updateKeyMode:function(b,
d){this.emacs&&d.removeKeyMode(this.emacs);this.vi&&d.removeKeyMode(this.vi);"Emacs"===b.keyBindings?(this.emacs||(this.emacs=new a.EmacsMode(d)),d.addKeyMode(this.emacs)):"vi"===b.keyBindings&&(this.vi||(this.vi=new f.VIMode(d,this.statusReporter)),d.addKeyMode(this.vi))},getParent:function(){return this._parent},getSettings:function(){return this.settings},setParent:function(a){this._parent=a},updateSourceCodeActions:function(a,b){b&&(b.setAutoPairParentheses(a.autoPairParentheses),b.setAutoPairBraces(a.autoPairBraces),
b.setAutoPairSquareBrackets(a.autoPairSquareBrackets),b.setAutoPairAngleBrackets(a.autoPairAngleBrackets),b.setAutoPairQuotations(a.autoPairQuotations),b.setAutoCompleteComments(a.autoCompleteComments),b.setSmartIndentation(a.smartIndentation))},updateViewOptions:function(a){var b=0;a.showMargin&&(b=a.marginOffset,"number"!==typeof b&&(b=a.marginOffset=parseInt(b,10)));var d=0;a.wordWrap&&(d=b);return{readonly:this.readonly||this.inputManager.getReadOnly(),tabSize:a.tabSize||4,expandTab:a.expandTab,
wrapMode:a.wordWrap,wrapOffset:d,marginOffset:b,scrollAnimation:a.scrollAnimation?a.scrollAnimationTimeout:0}},updateSettings:function(a){this.settings=a;var b=this.editor,d=this.inputManager;d.setAutoLoadEnabled(a.autoLoad);d.setAutoSaveTimeout(a.autoSave?a.autoSaveTimeout:-1);d.setSaveDiffsEnabled(a.saveDiffs);this.updateStyler(a);var e=b.getTextView();e&&(this.updateKeyMode(a,e),e.setOptions(this.updateViewOptions(a)));this.updateSourceCodeActions(a,b.getSourceCodeActions());b.setAnnotationRulerVisible(a.annotationRuler);
b.setLineNumberRulerVisible(a.lineNumberRuler);b.setFoldingRulerVisible(a.foldingRuler);b.setOverviewRulerVisible(a.overviewRuler);this.renderToolbars&&this.renderToolbars(d.getFileMetadata());this.markOccurrences.setOccurrencesVisible(a.showOccurrences);b.getContentAssist()&&b.getContentAssist().setAutoTriggerEnabled(a.contentAssistAutoTrigger);this.dispatchEvent({type:"Settings",newSettings:this.settings})},updateStyler:function(a){var b=this.syntaxHighlighter.getStyler();b&&(b.setTabsVisible&&
b.setTabsVisible(a.showTabs),b.setSpacesVisible&&b.setSpacesVisible(a.showSpaces))},showKeyBindings:function(a){var b=this.editor;if(b&&b.getTextView&&b.getTextView()){var d=b.getTextView(),e=d.getActions(!0).filter(function(a){return(a=d.getActionDescription(a))&&a.name});e.sort(function(a,b){return d.getActionDescription(a).name.localeCompare(d.getActionDescription(b).name)});a.createHeader(l.Editor);for(var f=function(a){return function(){d.focus();return d.invokeAction(a)}},b={},g,h=0;h<e.length;h++)for(var k=
e[h],m=d.getActionDescription(k),n=d.getKeyBindings(k),p=0;p<n.length;p++){g=n[p];var q=C.getUserKeyString(g);g.scopeName?(b[g.scopeName]||(b[g.scopeName]=[]),b[g.scopeName].push({bindingString:q,name:m.name,execute:f(k)})):a.createItem(q,m.name,f(k))}for(var r in b)if(b[r].length){a.createHeader(r);for(e=0;e<b[r].length;e++)g=b[r][e],a.createItem(g.bindingString,g.name,g.execute)}}},_init:function(){var a=null;this.preferences&&(a=this.editorPreferences=new d.EditorPreferences(this.preferences,function(b){b?
this.updateSettings(b):a.getPrefs(this.updateSettings.bind(this))}.bind(this)));var f=null;this.preferences&&(f=new m.ThemePreferences(this.preferences,new r.ThemeData),f.apply());var n,w=this,y=this.readonly,z=this.commandRegistry,C=this.serviceRegistry,E=this.fileClient,N=this.inputManager,S=this.searcher,U=this.progress,T=this.contentTypeRegistry,Q=function(a,b,d){var e=N.getContentType(),f=a.getTitle();a=C.getServiceReferences("orion.edit.contentAssist").concat(C.getServiceReferences("orion.edit.contentassist"));
(d=d&&d.providers)||(d=a.map(function(a){var b=a.getProperty("contentType"),d=a.getProperty("pattern");if(b&&T.isSomeExtensionOf(e,b)||d&&RegExp(d).test(f)){var b=C.getService(a),d=a.getProperty("service.id").toString(),g=a.getProperty("charTriggers");a=a.getProperty("excludedStyles");g&&(g=RegExp(g));a&&(a=RegExp(a));return{provider:b,id:d,charTriggers:g,excludedStyles:a}}return null}).filter(function(a){return!!a}));var g={};Object.keys(x).forEach(function(a){"function"===typeof x[a]&&(g[a]=x[a].bind(null,
C))});b.setEditorContextProvider(g);b.setProviders(d);b.setAutoTriggerEnabled(w.settings.contentAssistAutoTrigger);b.setProgress(U);b.setStyleAccessor(w.getStyleAccessor())},X=y?null:{createContentAssistMode:function(a){var b=new e.ContentAssist(a.getTextView());b.addEventListener("Activating",Q.bind(null,a,b));var d=new e.ContentAssistWidget(b,"contentassist"),d=new e.ContentAssistMode(b,d);b.setMode(d);Q(a,b);b.initialize();return d}},K=this.editor=new p.Editor({textViewFactory:function(){var a=
w.updateViewOptions(w.settings);D.mixin(a,{parent:w._parent,model:new h.ProjectionTextModel(w.model||new b.TextModel),wrappable:!0});return new k.TextView(a)},undoStackFactory:w.undoStack?{createUndoStack:function(a){w.undoStack.setView(a.getTextView());return w.undoStack}}:new g.UndoFactory,textDNDFactory:new g.TextDNDFactory,annotationFactory:new g.AnnotationFactory,foldingRulerFactory:new g.FoldingRulerFactory,lineNumberRulerFactory:new g.LineNumberRulerFactory,contentAssistFactory:X,keyBindingFactory:function(b,
d,e,f){d=new q.TextSearcher(b,C,z,e);e=(new g.KeyBindingsFactory).createKeyBindings(b,e,f,d);w.updateSourceCodeActions(w.settings,e.sourceCodeActions);(new t.EditorCommandFactory({serviceRegistry:C,commandRegistry:z,fileClient:E,inputManager:N,toolbarId:"toolsActions",saveToolbarId:"fileActions",editToolbarId:"editActions",readonly:y,navToolbarId:"pageNavigationActions",textSearcher:d,searcher:S,editorSettings:function(){return w.settings},localSettings:n})).generateEditorCommands(b);var h=b.getTextView();
if(b=z.findCommand("orion.keyAssist"))h.setKeyBinding(new A.KeyStroke(191,!1,!0,!F.isMac,F.isMac),b.id),h.setAction(b.id,b.callback,b);h.setAction("toggleWrapMode",function(){h.invokeAction("toggleWrapMode",!0);var b=h.getOptions("wrapMode");w.settings.wordWrap=b;a&&a.setPrefs(w.settings);return!0});w.vi=w.emacs=null;w.updateKeyMode(w.settings,h);return e},statusReporter:this.statusReporter,domNode:this._parent});K.id="orion.editor";K.processParameters=function(a){for(var b=["start","end","line",
"offset","length"],d=0;d<b.length;d++){var e=b[d];a[e]&&(a[e]=parseInt(a[e],10))}this.showSelection(a.start,a.end,a.line,a.offset,a.length)};this.dispatcher=new s.Dispatcher(this.serviceRegistry,K,N);f&&a&&(n=new u({local:!0,editor:K,themePreferences:f,preferences:a}));N.addEventListener("InputChanged",function(a){var b=K.getTextView();b&&(b.setOptions(this.updateViewOptions(this.settings)),this.syntaxHighlighter.setup(a.contentType,K.getTextView(),K.getAnnotationModel(),a.title,!0).then(function(){this.updateStyler(this.settings);
K.getContentAssist()&&Q(K,K.getContentAssist())}.bind(this)))}.bind(this));N.addEventListener("Saving",function(a){w.settings.trimTrailingWhiteSpace&&K.getTextView().invokeAction("trimTrailingWhitespaces")});(f=C.getService("orion.core.marker"))&&f.addEventListener("problemsChanged",function(a){K.showProblems(a.problems)});(f=C.getService("orion.core.blame"))&&f.addEventListener("blameChanged",function(a){K.showBlame(a.blameInfo)});f=this.markOccurrences=new B.MarkOccurrences(C,N,K);f.setOccurrencesVisible(this.settings.occurrencesVisible);
f.findOccurrences();var O=new v.SyntaxChecker(C,K);K.addEventListener("InputChanged",function(a){O.checkSyntax(N.getContentType(),a.title,a.message,a.contents);N.getReadOnly()&&K.reportStatus(l.readonly,"error")});var P={};"getCaretOffset setCaretOffset getSelection setSelection getText setText getLineAtOffset getLineStart".split(" ").forEach(function(a){P[a]=K[a].bind(K)});C.registerService("orion.edit.context",P,null);this.editorPreferences&&this.editorPreferences.getPrefs(this.updateSettings.bind(this))},
create:function(){this.editor.install()},destroy:function(){this.editor.uninstall()},getStyleAccessor:function(){var a=null,b=this.syntaxHighlighter.getStyler();b&&b.getStyleAccessor&&(a=b.getStyleAccessor());return a}};n.EventTarget.addMixin(E.prototype);return{EditorView:E}});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(l,p,n,k,b,h,g){function e(a){this._document=a.document||document;this._timeout=a.timeout;a=["keypress","keydown","keyup"];for(var e=function(a){this._resetTimer()}.bind(this),f=0;f<a.length;f++)this._document.addEventListener(a[f],e,!0);b.attach(this)}function a(a,b){if(a){if(!b.Severity){var e=b,f={Severity:"Error",
Message:l.noResponse};if("Cancel"===e.name)b={Severity:"Warning",Message:e.name,Cancel:!0};else{if(0===e.status)f.Cancel=!0;else if(e.responseText){e=e.responseText;try{var g=JSON.parse(e);f.Severity=g.Severity||f.Severity;f.Message=g.Message||f.Message}catch(h){f.Message=e}}else try{f.Message=JSON.stringify(e)}catch(k){}b=f}}a.setProgressResult(b)}else window.console.log(b)}function f(a){b.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=[]}e.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(f.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):(new k).resolve(a)},_read:function(a){var b=this.cachedMetadata||p.getClickedItem();if(b&&b.Location===a&&b.Parents&&b.Attributes&&b.ETag)return(new k).resolve(b);var e=this.fileClient,f=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return e.read.apply(e,
[a].concat(f))})},load:function(){var b=this.getInput();if(b){var e=this.fileClient,f=this._parsedLocation.resource,g=this.progressService,h=function(a,b,d){return!g?a:g.progress(a,n.formatMessage(b,d))},p=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&h(e.read(f,!0),l.ReadingMetadata,b).then(function(a){this._fileMetadata&&(this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)&&(this._fileMetadata=a,(!p.isDirty()||window.confirm(l.loadOutOfSync))&&
h(e.read(f),l.Reading,b).then(function(a){p.setInput(b,null,a);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var w=f;if(0===w.indexOf("/gitapi/commit/")){var s=w.indexOf("/file"),x=w.indexOf("?",s);-1===x&&(x=w.length);w=w.substring(s,x);this._readonly=!0}var z=window.setTimeout(function(){z=null;this.reportStatus(n.formatMessage(l.Fetching,b))}.bind(this),800),y=function(){this.reportStatus("");z&&window.clearTimeout(z)}.bind(this),B=function(b){y();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;h(this._read(w,!0),l.ReadingMetadata,w).then(function(a){a?a.Directory?k.when(a.Children||h(e.fetchChildren(a.ChildrenLocation),l.Reading,b),function(e){y();a.Children=e;this._setInputContents(this._parsedLocation,b,e,a)}.bind(this),B):this._isText(a)?h(e.read(f,!1,!0),l.Reading,b).then(function(e){y();"string"!==typeof e&&(this._acceptPatch=e.acceptPatch,e=e.result);this._setInputContents(this._parsedLocation,
b,e,a)}.bind(this),B):h(e._getService(f).readBlob(f),l.Reading,b).then(function(e){y();this._setInputContents(this._parsedLocation,b,e,a)}.bind(this),B):B({responseText:n.formatMessage(l.ReadingMetadataError,w)})}.bind(this),B)}}},processParameters:function(a){var b=this.getEditor();b&&b.processParameters&&b.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 b=this._unsavedChanges.length,e=a.removedCharCount,f=a.start,g=a.start+e,h=
0;0===a.addedCharCount?h=-1:0===e&&(h=1);if(0<b&&h===this.previousChangeType){b=this._unsavedChanges[b-1];if(0===e&&f===b.end+b.text.length){b.text+=a.text;return}if(0===a.addedCharCount&&g===b.start){b.start=f;return}}this.previousChangeType=h;this._unsavedChanges.push({start:f,end:g,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function b(a){h===A.getInput()&&(A.getFileMetadata().ETag=a.ETag,f.setInput(h,
null,k,!0));A.reportStatus("");g&&v&&v.setProgressResult({Message:l.Saved,Severity:"Normal"});A.afterSave&&A.afterSave();A._saving=!1}function e(b){A.reportStatus("");a(v,b);A._saving=!1;A._errorSaving=!0}if(!this._saving){var f=this.getEditor();if(f&&f.isDirty()&&!this.getReadOnly()){var g=this._errorSaving;this._saving=!0;var h=this.getInput();this.reportStatus(l["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});f.markClean();var k=f.getText(),p=k;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var s=this._unsavedChanges,x=0,z=0;z<s.length;z++)x+=s[z].text.length;k.length>x&&(p={diff:s})}this._unsavedChanges=[];this._errorSaving=!1;var s={ETag:this.getFileMetadata().ETag},y=this._parsedLocation.resource,p=this.fileClient.write(y,p,s),B=this.progressService,v=null;this.serviceRegistry&&(v=this.serviceRegistry.getService("orion.page.message"));B&&(p=B.progress(p,n.formatMessage(l.savingFile,h)));var A=this;p.then(b,function(a){412===a.status?window.confirm(l.saveOutOfSync)?
(a=A.fileClient.write(y,k),B&&(a=B.progress(a,n.formatMessage(l.savingFile,h))),a.then(b,e)):A._saving=!1:e(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new e({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 b=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var e=g.matchResourceParameters(a),f=this._parsedLocation||{};if(b&&b.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}}b=b&&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?b?(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 b=a.lastIndexOf("/");-1!==b&&(a=a.substring(b+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 b=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,b)},_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,b,e,f,g){var h,k=!1;f?(this._fileMetadata=f,this.setTitle(f.Location||String(f)),this.setContentType(this.contentTypeRegistry.getFileContentType(f)),h=f.Name,k=f.Directory):(this._fileMetadata=null,this.setTitle(b),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);f={type:"InputChanged",input:a,name:h,title:b,contentType:this.getContentType(),metadata:f,location:window.location,contents:e};this.dispatchEvent(f);this.editor=l=f.editor;k||(l&&(l.getModel&&l.getModel())&&l.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),g||
l.setInput(b,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:f}});
define("orion/cfui/logView","orion/editor/editor orion/editor/textModel orion/editorView orion/inputManager orion/objects orion/webui/littlelib orion/PageUtil orion/Deferred orion/globalCommands orion/URL-shim".split(" "),function(l,p,n,k,b,h,g,e,a){function f(a){k.InputManager.apply(this,[a]);this.cFClient=a.cFClient;this.commandRegistry=a.commandRegistry}function d(a){this.options=a;this._parent=a.parent;this.serviceRegistry=a.serviceRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.commandRegistry=
a.commandRegistry;this.progress=a.progressService;this.undoStack=a.undoStack;this._createInputManager()}f.prototype=new k.InputManager({});b.mixin(f.prototype,{_read:function(b,d){var f=new e,g=this.applicationInfo.instance||Object.keys(this.applicationInfo.logs)[0];this.cFClient.getLogs(this.applicationInfo.Target,this.applicationInfo.Application,b,this.applicationInfo.instance).then(function(b){b=b[g];b.Instance=g;f.resolve(b);a.setPageTarget({task:"Cloud Foundry Logs",target:b,breadcrumbTarget:b,
serviceRegistry:this.serviceRegistry,commandService:this.commandRegistry})}.bind(this));return f},setApplicationInfo:function(a){this.applicationInfo=a},getApplicationInfo:function(){return this.applicationInfo},load:function(){var a=this.getInput();if(a){var b=null,d=function(){this.reportStatus("");b&&window.clearTimeout(b)}.bind(this),e=function(a){d();var b=this.serviceRegistry.getService("orion.page.message");if(b){if(0===a.status)a={Severity:"Error",Message:"No response"};else{var e=a.responseText;
if(e)try{a=JSON.parse(e)}catch(f){a={Severity:"Error",Message:e}}}b.setProgressResult(a)}else window.console.log(a);this._setNoInput()}.bind(this);this._acceptPatch=null;if(!this.lastLogLoaded||this.lastLogLoaded!==a||null!==this.applicationInfo.instance&&this.lastLogInstance!==this.applicationInfo.instance)this.progressService.showWhile(this._read(a,!0),"Loading "+a).then(function(b){this.lastLogLoaded=a;this.lastLogInstance=b.Instance;this._setInputContents(this._parsedLocation,a,b.Contents,b)}.bind(this),
e);else{var b=window.setTimeout(function(){b=null;this.reportStatus("Fetching "+a)}.bind(this),800),f=!1,g=this.applicationInfo.instance||Object.keys(this.applicationInfo.logs)[0];this.cFClient.getLogs(this.applicationInfo.Target,this.applicationInfo.Application).then(function(b){this.applicationInfo.logs[g].forEach(function(h){h.Name===a&&b[g].forEach(function(b){b.Name===a&&(h.Size!==b.Size&&(f=!0,this._read(a,!0).then(function(b){this._setInputContents(this._parsedLocation,a,b.Contents,b);this.lastLogLoaded=
a}.bind(this),e)),d())}.bind(this))}.bind(this));f||d();this.applicationInfo.logs=b}.bind(this),e)}}else this.lastLogInstance=this.lastLogLoaded=null},constructor:f});d.prototype={_createInputManager:function(){this.inputManager=new f(this.options);var a={parent:this._parent,model:new p.TextModel,undoStack:this.options.undoStack,serviceRegistry:this.options.serviceRegistry,pluginRegistry:this.options.pluginRegistry,commandRegistry:this.options.commandRegistry,contentTypeRegistry:this.options.contentTypeRegistry,
inputManager:this.inputManager,readonly:!0,preferences:this.options.preferences,searcher:this.options.searcher,selection:this.options.selection,fileService:this.options.fileClient,fileClient:this.options.fileClient,statusReporter:this.options.statusReporter,statusService:this.options.statusService,progressService:this.options.progressService};this.editorView=new n.EditorView(a)},create:function(){this.editorCreated||(this.editorView.create(),this.editorCreated=!0,this.inputListener=function(a){a.editor=
this.editorView.editor}.bind(this),this.inputManager.addEventListener("InputChanged",this.inputListener),this.inputManager.lastLogLoaded=null,this.inputManager.lastLogInstance=null)},destroy:function(){this.editorCreated&&(this.editorView.destroy(),this.inputListener&&this.inputManager.removeEventListener("InputChanged",this.inputListener));this.editorCreated=!1}};return{LogEditorView:d}});
define("orion/cfui/widgets/CfLoginDialog",["orion/webui/dialog"],function(l){function p(l){this._init(l)}p.prototype=new l.Dialog;p.prototype.TEMPLATE='\x3cdiv style\x3d"padding: 5px;" id\x3d"userIdRow"\x3e\x3cdiv style\x3d"float: left; width: 150px;"\x3e\x3clabel id\x3d"userIdLabel" for\x3d"userId"\x3e\x3c/label\x3e\x3c/div\x3e\x3cinput id\x3d"userId" style\x3d"width: 200px;" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 5px;" id\x3d"passwordRow"\x3e\x3cdiv style\x3d"float: left; width: 150px;"\x3e\x3clabel id\x3d"passwordLabel" for\x3d"password"\x3e\x3c/label\x3e\x3c/div\x3e\x3cinput type\x3d"password" id\x3d"password" style\x3d"width: 200px;" value\x3d""\x3e\x3c/div\x3e';
p.prototype._init=function(l){this.options=l||{};this.title=this.options.title||"Cloud Foundry Login";this.modal=!0;this.buttons=[{text:"OK",isDefault:!0,callback:this.done.bind(this)}];this._func=l.func;this._initialize()};p.prototype._bindToDom=function(){this.$userIdLabel.appendChild(document.createTextNode("User Id:"));this.$passwordLabel.appendChild(document.createTextNode("Password:"))};p.prototype.done=function(){this.options.func(this.$userId.value,this.$password.value);this.hide()};return p.prototype.constructor=
p});
define("cfui/logs","orion/webui/littlelib orion/bootstrap orion/status orion/progress orion/commandRegistry orion/keyBinding orion/dialogs orion/selection orion/contentTypes orion/fileClient orion/operationsClient orion/searchClient orion/globalCommands orion/links orion/cfui/cFClient orion/PageUtil orion/cfui/logsExplorer orion/cfui/logView orion/section orion/cfui/widgets/CfLoginDialog".split(" "),function(l,p,n,k,b,h,g,e,a,f,d,m,r,u,q,t,w,s,x,z){p.startup().then(function(h){function p(a){r.setPageTarget({task:a.Application?"Cloud Foundry Logs":
a.Application+" - Cloud Foundry Logs",target:a,breadcrumbTarget:a,serviceRegistry:C,commandService:E});N.classList.remove("toolbarTarget");l.empty(N);(new x.Section(N,{id:"logsNavSection",title:"Log Files",canHide:!1})).embedExplorer(T);T.setCommandsVisible(!1);T.load(a)}function v(a){if(G){if(0===a.status)a={Severity:"Error",Message:"No response"};else{var b=a.responseText;if(b)try{a=JSON.parse(b)}catch(d){a={Severity:"Error",Message:b}}}G.setProgressResult(a)}else window.console.log(a)}function A(a){var b;
if(a.Url||a.Org||a.Space)b={Url:a.Url,Org:a.Org,Space:a.Space},a.target=b;a.log&&Q.create();a.log||Q.destroy();this.lastLogsInfo.Application!==a.resource?H.showWhile(M.getLogs(b,a.resource),"Getting logs").then(function(d){this.lastLogsInfo=d={Target:b,Application:a.resource,instance:a.instance,logs:d};Q.inputManager.setApplicationInfo(d);U.load(d);a.log?(N.classList.add("toolbarTarget"),Q.inputManager.setInput(a.log)):p(d)},function(d){d.JsonData&&d.JsonData.error_code&&"CF-InvalidAuthToken"===d.JsonData.error_code?
(new z({title:"Login to "+b.Url,func:function(d,e){H.showWhile(M.login(b.Url,d,e,b.Org,b.Space),"Logging in to "+b.Url).then(function(){A(a)},v)}})).show():v(d)}):(this.lastLogsInfo.instance!==a.instance&&(this.lastLogsInfo.instance=a.instance,Q.inputManager.setApplicationInfo(this.lastLogsInfo),a.log&&Q.inputManager.getInput()===a.log&&Q.inputManager.load()),a.log?(N.classList.add("toolbarTarget"),Q.inputManager.setInput(a.log)):p(Q.inputManager.getApplicationInfo()))}var C=h.serviceRegistry,F=h.preferences;
h=h.pluginRegistry;new g.DialogService(C);var D=new e.Selection(C),E=new b.CommandRegistry({selection:D}),I=new d.OperationsClient(C),G=new n.StatusReportingService(C,I,"statusPane","notifications","notificationArea"),H=new k.ProgressService(C,I,E);new u.TextLinkService({serviceRegistry:C});var I=new f.FileClient(C),J=new m.Searcher({serviceRegistry:C,commandService:E,fileService:I}),M=new q.CFService(C),Y=new a.ContentTypeRegistry(C),L=l.node("sidebar"),W=l.node("sidebarToolbar"),N=l.node("log"),
S=document.createElement("div"),U=new w.LogsExplorer(C,D,E,L,W,!0),T=new w.LogsExplorer(C,D,E,S),Q=new s.LogEditorView({parent:N,undoStack:null,serviceRegistry:C,pluginRegistry:h,commandRegistry:E,contentTypeRegistry:Y,preferences:F,searcher:J,selection:D,fileService:I,statusReporter:function(a,b,d){"progress"===b?G.setProgressMessage(a):"error"===b?G.setErrorMessage(a):G.setMessage(a,null,d)},statusService:G,progressService:H,cFClient:M});r.generateBanner("cf-logs",C,E,F,J,{});this.lastLogsInfo=
{};A(t.matchResourceParameters());window.addEventListener("hashchange",function(){A(t.matchResourceParameters())}.bind(this))})});
//@ sourceMappingURL=logs.js.map