/*

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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: 
 IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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
*/
(function(){function m(){for(var b=navigator.userAgent,f={browser:!1,version:!1},g=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],d=0;d<g.length;d++){var a=g[d],k=b.match(a.regExp);if(k){f.browser=
!0;f.version=k[1]>=a.minVersion;f.name=a.name;break}}return f}function n(){try{return"localStorage"in window&&null!==window.localStorage}catch(b){return!1}}function l(b){alert(b);throw Error("unsupported browser");}var f=m();if(f.browser)f.version||l("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+f.name+".\n");else if(n()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else n()||l("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:m,supportsLocalStorage:n,throwBrowserAlert:l}})();define("orion/browserCompatibility",function(){});
(function(m,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(m.orion=m.orion||{},m.orion.Deferred=n())})(this,function(){function m(){for(var d;d=b.shift();)d();h=!1}function n(d){b.push(d);h||(h=!0,g())}function l(d){return function(a){d(a)}}function f(){function d(){for(var a;a=g.shift();){var e=a.deferred,k="fulfilled"===b?"resolve":"reject";a=a[k];if("function"===typeof a)try{var d=a(p),f=d&&("object"===typeof d||"function"===typeof d)&&
d.then;if("function"===typeof f)if(d===e.promise)e.reject(new TypeError);else{var h=d.cancel;"function"===typeof h?e._parentCancel=h.bind(d):delete e._parentCancel;f.call(d,l(e.resolve),l(e.reject),l(e.progress))}else e.resolve(d)}catch(r){e.reject(r)}else e[k](p)}}function a(a){delete h._parentCancel;b="rejected";p=a;g.length&&n(d)}function k(e){function t(a){return function(e){(!b||"assumed"===b)&&a(e)}}delete h._parentCancel;try{var l=e&&("object"===typeof e||"function"===typeof e)&&e.then;if("function"===
typeof l)if(e===h)a(new TypeError);else{b="assumed";var m=e&&e.cancel;if("function"!==typeof m){var z=new f;e=z.promise;try{l(z.resolve,z.reject,z.progress)}catch(y){z.reject(y)}m=e.cancel;l=e.then}p=e;l.call(e,t(k),t(a));h._parentCancel=m.bind(e)}else b="fulfilled",p=e,g.length&&n(d)}catch(C){t(a)(C)}}function e(){var e=h._parentCancel;e?(delete h._parentCancel,e()):b||(e=Error("Cancel"),e.name="Cancel",a(e))}var p,b,g=[],h=this;this.resolve=function(a){b||k(a);return h};this.reject=function(e){b||
a(e);return h};this.progress=function(a){b||g.forEach(function(e){if(e.progress)try{e.progress(a)}catch(k){}});return h.promise};this.cancel=function(){h._parentCancel?setTimeout(e,0):e();return h};this.then=function(a,e,k){var p=new f;p._parentCancel=h.promise.cancel;g.push({resolve:a,reject:e,progress:k,deferred:p});("fulfilled"===b||"rejected"===b)&&n(d);return p.promise};this.promise={then:h.then,cancel:h.cancel}}var b=[],h=!1,g=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var d=
process.nextTick;return function(){d(m)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(m)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(m,0)}}();f.all=function(d,a){function k(a,e){g||(b[a]=e,0===--p&&h.resolve(b))}function e(e,d){if(!g){if(a)try{k(e,a(d));return}catch(p){d=p}h.reject(d)}}var p=d.length,b=[],g=!1,h=new f;h.then(void 0,function(){g=!0;d.forEach(function(a){a.cancel&&a.cancel()})});
0===p?h.resolve(b):d.forEach(function(a,d){a.then(k.bind(void 0,d),e.bind(void 0,d))});return h.promise};f.when=function(d,a,k,e){var p;d&&"function"===typeof d.then||(p=new f,p.resolve(d),d=p.promise);return d.then(a,k,e)};return f});
define("orion/EventTarget",[],function(){function m(){this._namedListeners={}}m.prototype={dispatchEvent:function(m){if(!m.type)throw Error("unspecified type");var l=this._namedListeners[m.type];l&&l.forEach(function(f){try{"function"===typeof f?f(m):f.handleEvent(m)}catch(b){"undefined"!==typeof console&&console.log(b)}});return!m.defaultPrevented},addEventListener:function(m,l){if("function"===typeof l||l.handleEvent)this._namedListeners[m]=this._namedListeners[m]||[],this._namedListeners[m].push(l)},
removeEventListener:function(m,l){var f=this._namedListeners[m];if(f)for(var b=0;b<f.length;b++)if(f[b]===l){1===f.length?delete this._namedListeners[m]:f.splice(b,1);break}}};m.prototype.constructor=m;m.attach=function(n){var l=new m;n.dispatchEvent=l.dispatchEvent.bind(l);n.addEventListener=l.addEventListener.bind(l);n.removeEventListener=l.removeEventListener.bind(l)};return m});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(m,n){function l(d,a,k){this._properties=k||{};this._properties["service.id"]=d;this._properties.objectClass=a;this._properties["service.names"]=a}function f(d,a,k){this._serviceId=d;this._serviceReference=a;this._internalRegistry=k}function b(d,a){function k(e){return function(){var k;try{if(!a())throw Error("Service was unregistered");var b=d[e].apply(d,Array.prototype.slice.call(arguments));if(b&&"function"===typeof b.then)return b;
k=new m;k.resolve(b)}catch(g){k=new m,k.reject(g)}return k.promise}}for(var e in d)"function"===typeof d[e]&&(this[e]=k(e))}function h(d,a){this.type=d;this.serviceReference=a}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new n;var d=this;this._internalRegistry={isRegistered:function(a){return d._entries[a]?!0:!1},unregisterService:function(a){var k=d._entries[a];if(!k)throw Error("Service has already been unregistered: "+a);var e=k.reference;d._serviceEventTarget.dispatchEvent(new h("unregistering",
e));d._entries[a]=null;e.getProperty("objectClass").forEach(function(a){for(var k=d._namedReferences[a],b=0;b<k.length;b++)if(k[b]===e){1===k.length?delete d._namedReferences[a]:k.splice(b,1);break}})},modifyService:function(a){var k=d._entries[a];if(!k)throw Error("Service not found while trying to send modified event: "+a);d._serviceEventTarget.dispatchEvent(new h("modified",k.reference))}}}l.prototype={getPropertyKeys:function(){var d=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
d.push(a);return d},getProperty:function(d){return this._properties[d]}};l.prototype.constructor=l;f.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(d){var a=this._serviceReference._properties;this._serviceReference._properties=d||{};d["service.id"]=this._serviceId;
d.objectClass=a.objectClass;d["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};f.prototype.constructor=f;g.prototype={getService:function(d){var a;if("string"===typeof d)(d=this._namedReferences[d])&&d.some(function(k){a=this._entries[k.getProperty("service.id")].service;return!!a},this);else if(d=this._entries[d.getProperty("service.id")])a=d.service;return a||null},getServiceReferences:function(d){if(d)return this._namedReferences[d]?this._namedReferences[d]:
[];var a=[];this._entries.forEach(function(k){k&&a.push(k.reference)});return a},registerService:function(d,a,k){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof d?d=[d]:Array.isArray(d)||(d=[]);var e=this._entries.length,p=new l(e,d,k),g=this._namedReferences;d.forEach(function(a){g[a]=g[a]||[];g[a].push(p)});d=new b(a,this._internalRegistry.isRegistered.bind(null,e));this._entries.push({reference:p,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",
p));return new f(e,p,d)},addEventListener:function(d,a){this._serviceEventTarget.addEventListener(d,a)},removeEventListener:function(d,a){this._serviceEventTarget.removeEventListener(d,a)}};g.prototype.constructor=g;return{ServiceRegistry:g}});
define("orion/xhr",["orion/Deferred"],function(m){function n(l,f,b,h){var g="undefined"!==typeof b.response?b.response:b.responseText,d;try{d=b.status}catch(a){d=0}l={args:f,response:g,responseText:"string"===typeof g?g:null,status:d,url:l,xhr:b};"undefined"!==typeof h&&(l.error=h);return l}return function(l,f,b){b=b||{};var h=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,g=new m,d=b.headers||{},a=b.log||!1,k;"undefined"===typeof d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof b.data&&("POST"===l||"PUT"===l))k=b.data;var e=!1,p=!1;g.promise.then(void 0,function(a){e=!0;!p&&(a instanceof Error&&"Cancel"===a.name)&&h.abort()});h.onabort=function(){p=!0;if(!e){var a=Error("Cancel");a.name="Cancel";g.reject(a)}};h.onload=function(){var e=n(f,b,h);200<=h.status&&400>h.status?g.resolve(e):(g.reject(e),a&&"undefined"!==typeof console&&console.log(Error(h.statusText)))};h.onerror=function(){var e=n(f,b,h);g.reject(e);a&&"undefined"!==typeof console&&console.log(Error(h.statusText))};
h.onprogress=function(a){a.xhr=h;g.progress(a)};try{h.open(l,f,!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(n(f,b,h,"Timeout exceeded"))});else{var q=setTimeout(function(){g.reject(n(f,b,h,"Timeout exceeded"))},b.timeout);g.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(d).forEach(function(a){h.setRequestHeader(a,
d[a])});h.send(k||null)}catch(x){g.reject(n(f,b,h,x))}return g.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(m,n,l){function f(a,e){this._name=a;this._providers=e;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function b(a,e){return{get:function(d,b){if(0===e)return null;var g=localStorage.getItem(a+d);if(null===g)return null;g=JSON.parse(g);return b||-1===e||g._expires&&g._expires>(new Date).getTime()?(delete g._expires,g):null},set:function(d,b){if(0!==e)if(-1!==e&&(b._expires=(new Date).getTime()+
1E3*e),0===Object.keys(b).length)localStorage.removeItem(a+d);else{var g=JSON.stringify(b);localStorage.setItem(a+d,g);delete b._expires}},remove:function(e){localStorage.removeItem(a+e)}}}function h(a){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var e=a.getServiceReferences("orion.core.preference.provider");0<e.length&&(this._service=a.getService(e[0]))}return!!this._service}}function g(a){this._location=
a;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function d(){this._cache=new b("/orion/preferences/local",-1)}function a(a,e){this._userProvider=new h(a);this._localProvider=new d;e=e||"defaults.pref";-1===e.indexOf("://")&&(e=m.toUrl(e));this._defaultsProvider=new g(e);this._serviceRegistration=a.registerService("orion.core.preference",this)}f.prototype={_flush:function(){for(var a=[],e=0;e<this._stores.length;++e){var d=this._stores[e];-1!==this._dirty.indexOf(d)&&
a.push(this._providers[e].put(this._name,d));if(this._pendingDeletes[e]&&0<this._pendingDeletes[e].length){for(d=0;d<this._pendingDeletes[e].length;d++)a.push(this._providers[e].remove(this._name,this._pendingDeletes[e][d]));delete this._pendingDeletes[e]}}this._dirty=[];return n.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){this._flushPending&&(this._flushPending=!1,this._flush())}.bind(this),
0))},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var e=this._stores[a],d;for(d in e)e.hasOwnProperty(d)&&"undefined"===typeof this._cached[d]&&(this._cached[d]=e[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,e){if(0!==this._stores.length){var d=this._stores[0];d[a]!==e&&(d[a]=e,this._cached=null,this._scheduleFlush(d))}},remove:function(a){for(var e=0;e<
this._stores.length;++e){var d=this._stores[e];if(d.hasOwnProperty(a))return delete d[a],this._pendingDeletes[e]||(this._pendingDeletes[e]=[]),this._pendingDeletes[e].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 e=this,d=[],b=0;b<this._providers.length;++b)d.push(this._providers[b].get(this._name,
a).then(function(a){return function(d){e._stores[a]=d}}(b)));return n.all(d).then(function(){e._cached=null;e._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(a,e){if(this._currentPromises[a])return this._currentPromises[a];var d=new n,b=null;e?this._cache.remove(a):b=this._cache.get(a);if(null!==b)d.resolve(b);else{this._currentPromises[a]=d;var g=this;this._service.get(a).then(function(e){g._cache.set(a,e);delete g._currentPromises[a];d.resolve(e)},function(e){404===e.status?
(e={},g._cache.set(a,e),delete g._currentPromises[a],d.resolve(e)):(delete g._currentPromises[a],d.resolve(g._cache.get(a,!0)||{}))})}return d},put:function(a,e){this._cache.set(a,e);return this._service.put(a,e)},remove:function(a,e){var d=this._cache.get(a);delete d[e];this._cache.set(a,d);return this._service.remove(a,e)}};g.prototype={get:function(a,e){if(this._currentPromise)return this._currentPromise;var d=new n,b=null;e?this._cache.remove(a):b=this._cache.get(a);if(null!==b)d.resolve(b);else{this._currentPromise=
d;var g=this;l("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=JSON.parse(e.response);g._cache.set(a,e[a]||{});g._currentPromise=null;d.resolve(e[a]||{})},function(e){401===e.xhr.status||404===e.xhr.status?(g._cache.set(a,{}),g._currentPromise=null,d.resolve({})):(g._currentPromise=null,e=g._cache.get(a,!0),null!==e?d.resolve(e[a]||{}):d.resolve({}))})}return d},put:function(a,e){var d=new n;d.resolve();return d},remove:function(a,e){var d=this._cache.get(a);
delete d[e];this.put(a,d)}};d.prototype={get:function(a){var e=new n;a=this._cache.get(a);null!==a?e.resolve(a):e.resolve({});return e},put:function(a,e){var d=new n;this._cache.set(a,e);d.resolve();return d},remove:function(a,e){var d=this._cache.get(a);delete d[e];this.put(a,d)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(d,e,p){if(!e||"number"!==typeof e||7<e||1>e)p=e,e=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
p,!1);return 0!==(a.USER_SCOPE&e)?"/orion/preferences/user"+d:0!==(a.LOCAL_SCOPE&e)?"/orion/preferences/local"+d:"/orion/preferences/default"+d},getPreferences:function(d,e){if(!e||"number"!==typeof e||7<e||1>e)e=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var p=[];a.USER_SCOPE&e&&this._userProvider.available()&&p.push(this._userProvider);a.LOCAL_SCOPE&e&&p.push(this._localProvider);a.DEFAULT_SCOPE&e&&p.push(this._defaultsProvider);var b=new f(d,p);return b.sync().then(function(){return b})},getSetting:function(a,
e,d){for(var b,g=0;g<a.length;g++)if(a[g].label===e)for(var f=0;f<a[g].data.length;f++)if(a[g].data[f].label===d){b=a[g].data[f].value;break}return b}};return{PreferencesService:a}});
(function(){function m(a){if("string"!==typeof a)throw new TypeError;}function n(a){return a?a.split("\x26"):[]}function l(a){return 0===a.length?"":a.join("\x26")}function f(a){var e=/([^=]*)(?:=?)(.*)/.exec(a);a=e[1]?decodeURIComponent(e[1]):"";e=e[2]?decodeURIComponent(e[2]):"";return[a,e]}function b(a){var e=encodeURIComponent(a[0]);a[1]&&(e+="\x3d"+encodeURIComponent(a[1]));return e}function h(a,e){var s="",d=[],k=0;return{next:function(){s!==a.query&&(s=a.query,d=n(s));if(k<d.length){var b=
f(d[k++]);switch(e){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw B;}}}function g(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function d(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var e=[];a.split("/").forEach(function(a){".."===a?e.pop():"."!==a&&e.push(a)});return e.join("/")}function k(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function e(e,s){if("string"!==
typeof e)throw new TypeError;e=k(e);var b=r.exec(e);if(!b)return null;var p={};p.scheme=b[1]||"";if(p.scheme&&!t.test(p.scheme))return null;var g=b[2];if(g&&(g=v.exec(g),p.userinfo=g[1],p.host=g[2],p.port=g[3],p.port&&!u.test(p.port)))return null;p.path=b[3];p.query=b[4];p.fragment=b[5];!p.scheme&&s&&(p.scheme=s.scheme,!p.host&&s.host&&(p.userinfo=s.userinfo,p.host=s.host,p.port=s.port,p.pathRelative=!0));p.pathRelative&&(p.path?"/"!==p.path[0]&&(b=/^(.*\/)[^\/]*$/.exec(s.path)[1]||"/",p.path=b+p.path):
p.path=s.path);p.scheme&&(p.scheme=p.scheme.toLowerCase());p.port&&(p.port=d(p.port));p.host&&p.path&&(p.path=a(p.path));return p}function p(a,s){var d;if(s){s=s.href||s;d=e(s);if(!d||!d.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:d})}d=e(a,d);if(!d)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:d,writable:!0});var k=new g(this);Object.defineProperty(this,"query",{get:function(){return this._url?
k:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(x){}var r=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,v=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,t=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,z=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,y=/^([^?#\s]*)$/,C=/^([^\s]*)$/,s=/^\S*$/,A=/([^:]*):?(.*)/,B="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),E={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(g.prototype,{get:{value:function(a){m(a);var e;n(this._url.query).some(function(s){s=f(s);if(s[0]===a)return e=s[1],!0});return e},enumerable:!0},set:{value:function(a,e){m(a);m(e);var s=n(this._url.query);s.some(function(d,k){var p=f(d);if(p[0]===a)return p[1]=e,s[k]=b(p),!0})||s.push(b([a,e]));this._url.query=l(s)},enumerable:!0},has:{value:function(a){m(a);
return n(this._url.query).some(function(e){if(f(e)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){m(a);var e=n(this._url.query),s=e.filter(function(e){return f(e)[0]!==a});return s.length!==e.length?(this._url.query=l(s),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,e){if("function"!==typeof a)throw new TypeError;var s=h(this._url,"keys+values");try{for(;;){var d=s.next();a.call(e,d[1],d[0],this)}}catch(k){if(k!==B)throw k;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(a){m(a);var e=[];n(this._url.query).forEach(function(s){s=f(s);s[0]===a&&e.push(s[1])});return e},enumerable:!0},append:{value:function(a,e){m(a);m(e);var s=n(this._url.query);s.push(b([a,e]));this._url.query=
l(s)},enumerable:!0}});Object.defineProperties(p.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var e=a.scheme?a.scheme+":":"";a.host&&(e+="//",a.userinfo&&(e+=a.userinfo+"@"),e+=a.host,a.port&&(e+=":"+a.port));e+=a.path;a.query&&(e+="?"+a.query);a.fragment&&(e+="#"+a.fragment);a=e}else a=this._input;return a},set:function(a){m(a);this._input=a;this._url=e(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){m(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||t.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){m(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){m(a);if(this._url){var e=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];e[2]&&a.push(e[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){m(a);if(this._url){var e=[A.exec(this._userinfo)[1]||""];a&&e.push(encodeURIComponent(a));this._userinfo=e.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){m(a);if(this._url&&(a=z.exec(a)))this._url.host=a[1],this._url.port=d(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){m(a);this._url&&w.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===E[this.protocol]&&(a="");return a},set:function(a){m(a);this._url&&u.exec(a)&&(this._url.port=d(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(e){m(e);
this._url&&y.exec(e)&&(this._url.host&&(e&&"/"!==e[0])&&(e="/"+e),this._url.path=e?a(e):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){m(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),C.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){m(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),s.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(p,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(p,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=p})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(m,n){function l(a,e){var d=Object.keys(a),k=Object.keys(e);if(d.length!==k.length)return!1;d.sort();k.sort();for(var b=0,g=d.length;b<g;b++){var f=d[b];if(f!==k[b])return!1;var h=a[f],f=e[f];if(h!==f&&JSON.stringify(h)!==JSON.stringify(f))return!1}return!0}function f(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(e){}return a}function b(a){var e=null,d={key:function(d){return(e=
e||Object.keys(a))[d]},getItem:function(e){return a[e]},setItem:function(d,k){a[d]=k;e=null},removeItem:function(d){delete a[d];e=null},clear:function(){(e=e||Object.keys(a)).forEach(function(e){delete a[e]}.bind(this));e=null}};Object.defineProperty(d,"length",{get:function(){return(e=e||Object.keys(a)).length}});return d}function h(a,e){if(e&&e instanceof XMLHttpRequest){var d,k;try{d=e.status,k=e.statusText}catch(b){d=0,k=""}return{status:d||0,statusText:k}}return e}function g(a){var e=a?JSON.parse(JSON.stringify(a,
h)):a;a instanceof Error&&(e.__isError=!0,e.message=e.message||a.message,e.name=e.name||a.name);return e}function d(a,e){this.type=a;this.plugin=e}function a(a,e){this.__objectId=a;this.__methods=e}function k(e,k,b){function f(a){L&&b.postMessage(a,L)}function h(e){if(!L)return(new m).reject(Error("plugin not connected"));e.id=String(T++);var s=new m;U[e.id]=s;s.then(null,function(a){"active"===F&&(a instanceof Error&&"Cancel"===a.name)&&f({requestId:e.id,method:"cancel",params:a.message?[a.message]:
[]})});var d=Object.prototype.toString;e.params.forEach(function(k,b){if("[object Object]"===d.call(k)&&!(k instanceof a)){var p,g;for(p in k)"[object Function]"===d.call(k[p])&&(g=g||[],g.push(p));if(g){var A=S++;V[A]=k;p=function(){delete V[A]};s.then(p,p);e.params[b]=new a(A,g)}}});b.postMessage(e,L);return s.promise}function t(a,e){a||0===a?f({id:a,result:null,error:e}):console.log(e)}function u(a,e,s,d){d.forEach(function(a,e){if(a&&"undefined"!==typeof a.__objectId){var s={};a.__methods.forEach(function(e){s[e]=
function(){return h({objectId:a.__objectId,method:e,params:Array.prototype.slice.call(arguments)})}});d[e]=s}});var k=void 0===typeof a?null:{id:a,result:null,error:null};try{var b=s.apply(e,d);k&&(b&&"function"===typeof b.then?(R[a]=b,b.then(function(e){delete R[a];k.result=e;f(k)},function(e){R[a]&&(delete R[a],k.error=g(e),f(k))},function(){f({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(k.result=b,f(k)))}catch(p){k&&(k.error=g(p),f(k))}}function w(a){try{if(a.method){var e=
a.method,s=a.params||[];if("serviceId"in a){var d=X[a.serviceId];d||t(a.id,"service not found");e in d?u(a.id,d,d[e],s):t(a.id,"method not found")}else if("objectId"in a){var k=V[a.objectId];k||t(a.id,"object not found");e in k?u(a.id,k,k[e],s):t(a.id,"method not found")}else if("requestId"in a){var p=R[a.requestId];p&&("cancel"===e&&p.cancel)&&p.cancel.apply(p,s)}else if("responseId"in a){var g=U[a.responseId];g&&("progress"===e&&g.progress)&&g.progress.apply(g,s)}else if("plugin"===a.method){L.connected();
var B=a.params[0];W({headers:B.headers,services:B.services}).then(function(){H&&H.resolve(A)})}else if("timeout"===a.method)H&&H.reject(a.error);else throw Error("Bad method: "+a.method);}else{var q=U[String(a.id)];delete U[String(a.id)];if(a.error){var f=b.handleServiceError(A,a.error);q.reject(f)}else q.resolve(a.result)}}catch(h){console.log("Plugin._messageHandler "+h)}}function z(e){var s={};if(e.methods&&(e.methods.forEach(function(a){s[a]=function(){var s={serviceId:e.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===F?h(s):A.start({"transient":!0}).then(function(){return h(s)})}}),s.addEventListener&&s.removeEventListener)){var d=new n,k=S++;V[k]={handleEvent:d.dispatchEvent.bind(d)};var b=new a(k,["handleEvent"]),p=s.addEventListener;s.addEventListener=function(a,e){d._namedListeners[a]||p(a,b);d.addEventListener(a,e)};var g=s.removeEventListener;s.removeEventListener=function(a,e){d.removeEventListener(a,e);d._namedListeners[a]||g(a,b)}}return s}function y(a){var s=JSON.parse(JSON.stringify(a.properties));
s.__plugin__=e;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);s.objectClass=a;return s}function C(a){var e=z(a),s=y(a),s=b.registerService(a.names||a.type,e,s);K[a.serviceId]={registration:s,proxy:e}}function s(){b.persist(e,{created:B,headers:E,services:D,autostart:G,lastModified:J})}var A=this;k=k||{};var B=k.created||(new Date).getTime(),E=k.headers||{},D=k.services||[],G=k.autostart,J=k.lastModified||0,F="installed",I,H,L,Y,K={},T=0,S=0,R={},U={},V={},X={},W;this._default=!1;this._persist=s;
this._resolve=function(){F="resolved";b.dispatchEvent(new d("resolved",A))};this._getAutostart=function(){return G};this._getCreated=function(){return B};this.getLocation=function(){return e};this.getHeaders=function(){return JSON.parse(JSON.stringify(E))};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 J};this.getServiceReferences=function(){var a=
[];Object.keys(K).forEach(function(e){a.push(K[e].registration.getReference())});return a};this.setParent=function(a){return Y!==a?(Y=a,A.stop({"transient":!0}).then(function(){if("started"===G)return A.start({"transient":!0});if("lazy"===G)return A.start({lazy:!0,"transient":!0})})):(new m).resolve()};this.getState=function(){return F};this.start=function(a){if("uninstalled"===F)return(new m).reject(Error("Plugin is uninstalled"));if(I)return I.promise.then(this.start.bind(this,a));if("active"===
F)return(new m).resolve();if(!a||!a.transient){var k=a&&a.lazy?"lazy":"started";k!==G&&(G=k,s())}k=b.getState();if("starting"!==k&&"active"!==k)return a.transient?(new m).reject(Error("start transient error")):(new m).resolve();if("installed"===F)try{this._resolve()}catch(g){return(new m).reject(g)}"resolved"===F&&D.forEach(function(a){C(a)});if(a&&a.lazy)return"starting"!==F&&(F="starting",b.dispatchEvent(new d("lazy activation",A))),(new m).resolve();var B=new m;I=B;F="starting";b.dispatchEvent(new d("starting",
A));H=new m;L=b.connect(e,w,Y);H.then(function(){H=null;F="active";b.dispatchEvent(new d("started",A));I=null;B.resolve()},function(){H=null;F="stopping";b.dispatchEvent(new d("stopping",A));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});b.disconnect(L);L=null;F="resolved";I=null;b.dispatchEvent(new d("stopped",A));B.reject(Error("Failed to load plugin: "+e));A._default&&(J=0,s())});return B.promise};this.stop=function(a){if("uninstalled"===F)return(new m).reject(Error("Plugin is uninstalled"));
if(I)return I.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==G)G="stopped",s();if("active"!==F&&"starting"!==F)return(new m).resolve();I=a=new m;F="stopping";b.dispatchEvent(new d("stopping",A));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});L&&(b.disconnect(L),L=null);F="resolved";I=null;b.dispatchEvent(new d("stopped",A));a.resolve();return a.promise};W=function(a){if("uninstalled"===F)return(new m).reject(Error("Plugin is uninstalled"));
if(!a)return 0===J&&(J=(new Date).getTime(),s()),b.loadManifest(e).then(W,function(){A._default&&(J=0,s());console.log("Failed to load plugin: "+e)});var k=E,g=D,B=G;E=a.headers||{};D=a.services||[];G=a.autostart||G;a.lastModified?J=a.lastModified:(J=(new Date).getTime(),s());if(l(E,k)&&l(D,g)&&G===B)return(new m).resolve();if("active"===F||"starting"===F){var q=[];Object.keys(D).forEach(function(a){var e=D[a];q.push(a);var s=K[a];if(s){if(l(e.methods,Object.keys(s.proxy))){a=y(e);var d=s.registration.getReference(),
k={};d.getPropertyKeys().forEach(function(a){k[a]=d.getProperty(a)});l(a,k)||s.registration.setProperties(a);return}s.registration.unregister();delete K[a]}C(e)});Object.keys(K).forEach(function(a){-1===q.indexOf(a)&&(K[a].registration.unregister(),delete K[a])})}"active"===F&&(b.disconnect(L),H=new m,L=b.connect(e,w,Y),H.then(function(){H=null},function(){H=null;F="stopping";b.dispatchEvent(new d("stopping"),A);Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});b.disconnect(L);
L=null;F="resolved";b.dispatchEvent(new d("stopped",A))}));return(new m).resolve()};this.update=function(a){return W(a).then(function(){b.dispatchEvent(new d("updated",A))})};this.uninstall=function(){if("uninstalled"===F)return(new m).reject(Error("Plugin is uninstalled"));if("active"===F||"starting"===F||"stopping"===F)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));b.removePlugin(this);F="uninstalled";b.dispatchEvent(new d("uninstalled",A));return(new m).resolve()}}
var e=/^http[s]?/i;return{Plugin:k,PluginRegistry:function(a,g){function h(a){var e=a.source;w.some(function(d){if(e===d.target){try{var k;if("undefined"===typeof d.useStructuredClone){var b="string"!==typeof a.data;k=b?a.data:JSON.parse(a.data);d.useStructuredClone=b}else k=d.useStructuredClone?a.data:JSON.parse(a.data);d.handler(k)}catch(p){}return!0}})}g=g||{};var r=g.storage||localStorage;r.getItem||(r=b(r));var v="installed",t,l=[],w=[],z=new n,y={},C={registerService:a.registerService.bind(a),
connect:function(a,e,d,k){function b(a){a=Error(a);a.name="timeout";e({method:"timeout",error:a})}var p={handler:e,url:a},g=setTimeout(b.bind(null,"Load timeout for: "+a),k||15E3),q=document.createElement("iframe");q.name=a+"_"+(new Date).getTime();q.src=a;q.onload=function(){clearTimeout(g);g=setTimeout(b.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;(d||t).appendChild(q);p.target=q.contentWindow;
p.connected=function(){clearTimeout(g)};p.close=function(){clearTimeout(g);if(q){var a=q.parentNode;a&&a.removeChild(q);q=null}};w.push(p);return p},disconnect:function(a){for(var e=0;e<w.length;e++)if(a===w[e]){w.splice(e,1);try{a.close()}catch(d){}break}},removePlugin:function(a){for(var e=0;e<l.length;e++)if(a===l[e]){l.splice(e,1);break}r.removeItem("plugin."+a.getLocation())},persist:function(a,e){r.setItem("plugin."+a,JSON.stringify(e))},postMessage:function(a,e){e.target.postMessage(e.useStructuredClone?
a:JSON.stringify(a),e.url)},dispatchEvent:function(a){try{z.dispatchEvent(a)}catch(e){console&&console.log("PluginRegistry.dispatchEvent "+e)}},loadManifest:function(a){var e=new m,d=C.connect(a,function(a){d&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],C.disconnect(d),d=null,e.resolve(a)):"timeout"===a.method&&(C.disconnect(d),d=null,e.reject(a.error)))});return e.promise},getState:function(){return v},handleServiceError:function(a,d){if(d&&401===d.status){var k=a.getHeaders(),
b=a.getName()||a.getLocation(),p=document.createElement("span");p.appendChild(document.createTextNode("Authentication required for: "+b+"."));k.login&&(p.appendChild(document.createTextNode(" ")),b=document.createElement("a"),b.target="_blank",b.textContent="Login",b.href=k.login,e.test(b.href)?(p.appendChild(b),p.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+k.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(p)}}if(d.__isError){var g=
d;d=Error(g.message);Object.keys(g).forEach(function(a){d[a]=g[a]});delete d.__isError}return d}};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=C.getState;this.init=function(){if(!("starting"===v||"active"===v||"stopping"===v)){addEventListener("message",h,!1);for(var a=[],e=0,d=r.length;e<d;e++)a.push(r.key(e));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var e=a.substring(7);a=JSON.parse(r.getItem(a));a.created&&l.push(new k(e,a,C))}});l.sort(function(a,e){return a._getCreated()<e._getCreated()?-1:1});g.parent?t=g.parent:(t=document.createElement("div"),g.visible||(t.style.display="none",t.style.visibility="hidden"),document.body.appendChild(t));g.plugins&&Object.keys(g.plugins).forEach(function(a){a=f(a);var e=this.getPlugin(a);e?e._default=!0:(e=g.plugins[a],"object"!==typeof e&&(e={}),e.autostart=e.autostart||g.defaultAutostart||
"lazy",e=new k(a,e,C),e._default=!0,l.push(e))}.bind(this));v="starting"}};this.start=function(){"starting"!==v&&this.init();if("starting"!==v)return(new m).reject("Cannot start framework. Framework is already "+v+".");var a=[],e=(new Date).getTime();l.forEach(function(d){var k=d._getAutostart();0===d.getLastModified()?a.push(d.update().then(function(){if("started"===k)return d.start({"transient":!0});if("lazy"===k)return d.start({lazy:!0,"transient":!0});d._resolve()})):"started"===k?a.push(d.start({"transient":!0})):
"lazy"===k?(a.push(d.start({lazy:!0,"transient":!0})),e>d.getLastModified()+864E5&&d.update()):d._resolve()});return m.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){v="active"})};this.stop=function(){if("starting"!==v&&"active"!==v)return(new m).reject("Cannot stop registry. Registry is already "+v+".");v="stopping";var a=[];l.forEach(function(e){a.push(e.stop({"transient":!0}))});return m.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!g.parent){var a=
t.parentNode;a&&a.removeChild(t)}t=null;removeEventListener("message",h);v="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new m).reject("Cannot uninstall registry")};this.installPlugin=function(a,e){a=f(a);var b=this.getPlugin(a);if(b)return(new m).resolve(b);if(y[a])return y[a];if(e)return b=new k(a,e,C),l.push(b),b._persist(),C.dispatchEvent(new d("installed",b)),(new m).resolve(b);var p=C.loadManifest(a).then(function(e){b=new k(a,
e,C);l.push(b);b._persist();delete y[a];C.dispatchEvent(new d("installed",b));return b},function(e){delete y[a];throw e;});return y[a]=p};this.getPlugins=function(){return l.slice()};this.getPlugin=function(a){var e=null;a=f(a);l.some(function(d){if(a===d.getLocation())return e=d,!0});return e};this.addEventListener=z.addEventListener.bind(z);this.removeEventListener=z.removeEventListener.bind(z);this.resolvePlugins=function(){var a=!0;l.forEach(function(e){a=a&&e._resolve()});return a}}}});
define("orion/objects",[],function(){function m(m){for(var l=Object.prototype.hasOwnProperty,f=1,b=arguments.length;f<b;f++){var h=arguments[f],g;for(g in h)l.call(h,g)&&(m[g]=h[g])}return m}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var l=Object.create(Object.getPrototypeOf(n));m(l,n);return l},mixin:m,toArray:function(m){return Array.isArray(m)?m:[m]}}});
define("orion/serviceTracker",[],function(){function m(f,b){function h(e){var k=e.getProperty("service.id"),b=this.addingService(e);b&&(d[k]=e,a[k]=b)}function g(e){var k=e.getProperty("service.id"),b=a[k];delete d[k];delete a[k];this.removedService(e,b)}this.serviceRegistry=f;var d={},a={},k=n,e,p;this.close=function(){if(k!==l)throw"Already closed";k=n;f.removeEventListener("registered",e);f.removeEventListener("unregistering",p);p=e=null;var a=this;this.getServiceReferences().forEach(function(e){g.call(a,
e)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(d);return!a.length?null:a.map(function(a){return d[a]})};this.open=function(){if(k!==n)throw"Already open";k=l;var a=this;e=function(e){if(-1!==e.serviceReference.getProperty("objectClass").indexOf(b)&&(h.call(a,e.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(e.serviceReference,a.serviceRegistry.getService(e.serviceReference))};p=function(e){-1!==e.serviceReference.getProperty("objectClass").indexOf(b)&&
g.call(a,e.serviceReference)};f.addEventListener("registered",e);f.addEventListener("unregistering",p);f.getServiceReferences(b).forEach(function(e){h.call(a,e);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(e,f.getService(e))});if("function"===typeof this.onOpen)this.onOpen()}}var n=0,l=1;m.prototype={addingService:function(f){return this.serviceRegistry.getService(f)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(f,b){}};return m});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(m,n,l,f){var b=l.PreferencesService,h,g,d,a,k=b.DEFAULT_SCOPE,e="pid",p="/cm/configurations";h=function(a,d,k){function b(a,e,k){e.forEach(function(s,b){try{var p=a[b].getProperty("__plugin__"),g=p&&d.getPlugin(p);(!p||g&&"active"===g.getState())&&e[b].updated(k)}catch(q){"undefined"!==typeof console&&console.log(q)}})}f.call(this,a,"orion.cm.managedservice");var p={},g={},h=function(d){var b=
[];d.plugin.getServiceReferences().forEach(function(d){if(-1!==d.getProperty("objectClass").indexOf("orion.cm.managedservice")){var s=d.getProperty(e);d=a.getService(d);s&&d&&(s=(s=k._find(s))&&s.getProperties(),b.push(d.updated(s)))}});return m.all(b)};this.addingService=function(d){var k=d.getProperty(e),b=a.getService(d);if(!k||!b)return null;p[k]||(p[k]=[]);g[k]||(g[k]=[]);p[k].push(d);g[k].push(b);return b};this.onServiceAdded=function(a,d){var p=a.getProperty(e),p=k._find(p);b([a],[d],p&&p.getProperties())};
this.onOpen=function(){d.addEventListener("started",h)};this.onClose=function(){d.removeEventListener("started",h)};this.notifyUpdated=function(a){var e=a.getPid();b(p[e]||[],g[e]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(p[a]||[],g[a]||[],null)};this.removedService=function(a,d){var k=a.getProperty(e),s=p[k],b=g[k];1<s.length?s.splice(s.indexOf(a),1):delete p[k];1<b.length?b.splice(b.indexOf(d),1):delete g[k]}};l=function(){function a(e,k,b){this.store=new g(this,b);this.configAdmin=
new d(this,this.store);this.tracker=new h(e,k,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(e){a.tracker.open();return e})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();d=function(){function a(e,d){this.factory=e;this.store=d}a.prototype={_prefName:p,_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},
getDefaultConfiguration:function(a){return this.store._find(a,k)},listConfigurations:function(){return this.store.list()}};return a}();g=function(){function d(a,e){this.factory=a;this.prefsService=e;this.pref=this.configs=this.defaultConfigs=null;var b=this;this.initPromise=m.all([this.prefsService.getPreferences(p,k),this.prefsService.getPreferences(p)]).then(function(a){var e=a[0];b.pref=a[1];b.defaultConfigs=b._toConfigs(e,!0);b.configs=b._toConfigs(b.pref,!1,e)})}d.prototype={_toConfigs:function(d,
k,b){var p=Object.create(null),g=this;d.keys().forEach(function(q){if(!p[q]){var f=d.get(q),h=b&&b.get(q);"object"===typeof f&&(null!==f&&0<Object.keys(f).length)&&(f[e]=q,p[q]=new a(g.factory,g,f,k,h))}});return p},_init:function(){return this.initPromise},_find:function(a,e){return e===b.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(e){var d=this._find(e),b=this._find(e,k);d||(d=b&&b.getProperties(!0),d=new a(this.factory,this,e,!1,d),this.configs[e]=d);return d},
list:function(){var a=this,e=[];this.pref.keys().forEach(function(d){(d=a._find(d))&&null!==d.getProperties()&&e.push(d)});return e},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,e){var d=e.getProperties(!0)||{},b=this._find(a,k);if(b){var p=b.getProperties(!0);Object.keys(p).forEach(function(a){Object.prototype.hasOwnProperty.call(d,a)&&d[a]===p[a]&&delete d[a]})}this.pref.put(a,d)}};return d}();a=function(){function a(d,k){k=n.clone(k);delete k[e];d.properties=k}
function d(k,b,p,g,f){this.factory=k;this.store=b;this.readOnly=g;if(null!==p&&"object"===typeof p)this.pid=p[e],a(this,p);else if("string"===typeof p)this.pid=p,this.properties=null;else throw Error("Invalid pid/properties "+p);if(f){var h=this;Object.keys(f).forEach(function(a){a===e||Object.prototype.hasOwnProperty.call(h.properties,a)||(h.properties[a]=f[a])})}}d.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 d=null;this.properties&&(d=n.clone(this.properties),a||(d[e]=this.pid));return d},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(e){this._checkReadOnly();this._checkRemoved();a(this,e);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+
this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return d}();return{ConfigurationAdminFactory:l}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(m,n,l,f,b,h){var g;return{startup:function(){if(g)return g;g=new n;var d=new l.ServiceRegistry,a=new f.PreferencesService(d);return a.getPreferences("/plugins").then(function(k){var e={plugins:{}};k.keys().forEach(function(a){var d=m.toUrl(a);e.plugins[d]=k[a]});var p=new b.PluginRegistry(d,e);return p.start().then(function(){if(0<d.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var e=[];a.keys().forEach(function(a){a=m.toUrl(a);p.getPlugin(a)||e.push(p.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return n.all(e,function(a){console.log(a)})})}).then(function(){return(new h.ConfigurationAdminFactory(d,p,a)).getConfigurationAdmin().then(d.registerService.bind(d,"orion.cm.configadmin"))}).then(function(){var a=d.getService("orion.core.auth");if(a){var e=a.getUser().then(function(e){if(e)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),k=localStorage.getItem("lastLogin");if(!k||k<(new Date).getTime()-9E5)return e}}).then(function(){var e={serviceRegistry:d,preferences:a,pluginRegistry:p};g.resolve(e);return e})})}}});
(function(){function m(b,f,g,d,a,k){f[b]&&(g.push(b),(!0===f[b]||1===f[b])&&d.push(a+b+"/"+k))}function n(b,f,g,d,a){f=d+f+"/"+a;require._fileExists(b.toUrl(f+".js"))&&g.push(f)}function l(b,f,g){for(var d in f)f.hasOwnProperty(d)&&(!b.hasOwnProperty(d)||g)?b[d]=f[d]:"object"===typeof f[d]&&l(b[d],f[d],g)}var f=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var h=b.config?b.config():{},h=h||{};return{version:"2.0.1+",load:function(b,d,a,k){k=k||{};k.locale&&(h.locale=
k.locale);var e=f.exec(b),p=e[1],q=e[4],x=e[5],r=q.split("-"),v=[],t={},u,w="";e[5]?(p=e[1],b=p+x):(x=e[4],q=h.locale,q||(q=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),r=q.split("-"));if(k.isBuild){v.push(b);n(d,"root",v,p,x);for(u=0;u<r.length;u++)k=r[u],w+=(w?"-":"")+k,n(d,w,v,p,x);d(v,function(){a()})}else d([b],function(e){var k=[],b;m("root",e,k,v,p,x);for(u=0;u<r.length;u++)b=r[u],w+=(w?"-":"")+b,m(w,e,k,v,p,x);d(v,function(){var s,
b,g;for(s=k.length-1;-1<s&&k[s];s--){g=k[s];b=e[g];if(!0===b||1===b)b=d(p+g+"/"+x);l(t,b)}a(t)})})}}})})();
define("orion/i18n",[],function(){return{load:function(m,n,l,f){f=f||{};var b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=b.exec(m);if(h){if(!n.defined||n.defined(m))try{l(n(m));return}catch(g){}if(f.isBuild||f.isTest)l({});else if(n.specified&&!n.specified("orion/bootstrap"))l({});else{var d=h[1],a=h[3]?h[2]:"",k=h[3]||h[2];n(["orion/bootstrap"],function(e){e.startup().then(function(e){var g=e.serviceRegistry;e=g.getServiceReferences("orion.i18n.message");if(a)e.some(function(a){return m===a.getProperty("name")?
(g.getService(a).getMessageBundle().then(function(a){l(a)},function(){l({})}),!0):!1})||l({});else{var x={},r;e.forEach(function(e){var p=e.getProperty("name");if((h=b.exec(p))&&d===h[1]&&k===(h[3]||h[2]))if(a=h[3]?h[2]:""){if((e=f.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===e.toLowerCase().indexOf(a.toLowerCase()))x[a]=!0,(!n.specified||!n.specified(p))&&define(p,["orion/i18n!"+p],function(a){return a})}else r=e});!n.specified||!n.specified(m)?r?
g.getService(r).getMessageBundle().then(function(a){Object.keys(x).forEach(function(e){"undefined"===typeof a[e]&&(a[e]=x[e])});define(m,[],a);l(a)},function(){define(m,[],x);l(x)}):(define(m,[],x),l(x)):l(x)}})})}}else l(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(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/util",[],function(){var m=navigator.userAgent,n=-1!==m.indexOf("MSIE")||-1!==m.indexOf("Trident")?document.documentMode:void 0,l=parseFloat(m.split("Firefox/")[1]||m.split("Minefield/")[1])||void 0,f=-1!==m.indexOf("Opera")?parseFloat(m.split("Version/")[1]):void 0,b=parseFloat(m.split("Chrome/")[1])||void 0,h=-1!==m.indexOf("Safari")&&!b,g=parseFloat(m.split("WebKit/")[1])||void 0,d=-1!==m.indexOf("Android"),a=-1!==m.indexOf("iPad"),m=-1!==m.indexOf("iPhone"),k=a||m,e=-1!==navigator.platform.indexOf("Mac"),
p=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),x="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var e=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,d){return e[(d<<0)+1]})},createElement:function(a,e){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",e):a.createElement(e)},isIE:n,isFirefox:l,isOpera:f,isChrome:b,isSafari:h,isWebkit:g,isAndroid:d,isIPad:a,isIPhone:m,
isIOS:k,isMac:e,isWindows:p,isLinux:q,isTouch:x,platformDelimiter:p?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(m){function n(a,d){d||(d=document);return d.querySelectorAll(a)}function l(a){var d=a.tabIndex;0===d&&m.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&&(d=-1);return d}function f(a){if(0<=l(a))return a;if(a.hasChildNodes())for(var d=0;d<a.childNodes.length;d++){var e=f(a.childNodes[d]);if(e)return e}return null}function b(a){if(0<=
l(a))return a;if(a.hasChildNodes())for(var d=a.childNodes.length-1;0<=d;d--){var e=b(a.childNodes[d]);if(e)return e}return null}function h(a,d){if(3===a.nodeType){var e=g.exec(a.nodeValue);e&&1<e.length&&d(a,e)}if(a.hasChildNodes())for(e=0;e<a.childNodes.length;e++)h(a.childNodes[e],d)}var g=/\$\{([^\}]+)\}/,d=null;return{$:function(a,d){d||(d=document);return d.querySelector(a)},$$:n,$$array:function(a,d){return Array.prototype.slice.call(n(a,d))},node:function(a){var d=a;"string"===typeof a&&(d=
document.getElementById(a));return d},contains:function(a,d){if(!a||!d)return!1;if(a===d)return!0;var e=a.compareDocumentPosition(d);return Boolean(e&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:f,lastTabbable:b,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,d){h(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(d[b[1]]||b[1]),a)})},processDOMNodes:function(a,d){h(a,function(a,b){var g=d[b[1]];if(g){var f=document.createRange(),h=b.index;f.setStart(a,h);f.setEnd(a,h+b[0].length);f.deleteContents();f.insertNode(g)}})},addAutoDismiss:function(a,b){function e(a){d.forEach(function(e){var d=!1,b=e.excludeNodes.some(function(e){return document.body.contains(e)?(d=!0,e.contains(a.target)):
!1});if(d&&!b)try{e.dismiss(a)}catch(k){"undefined"!==typeof console&&console&&console.error(k&&k.message)}});d=d.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===d&&(d=[],document.addEventListener("click",e,!0),m.isIOS&&document.addEventListener("touchend",function(a){function e(){a.target.removeEventListener("click",e)}0===a.touches.length&&a.target.addEventListener("click",e)},!1));d.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var d=
document.getElementsByTagName("iframe"),e=0;e<d.length;e++)d[e].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){d=d.filter(function(d){return a!==d.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(m){var n,l,f=["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,d=g&&location.protocol&&location.protocol.replace(/\:/,""),a=g&&location.hostname,k=g&&(location.port||void 0),e=[],p=m.config&&m.config()||{};n={version:"2.0.5",strip:function(a){if(a){a=a.replace(b,"");var e=a.match(h);e&&(a=e[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,e,d;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(e=0;3>e;e+=1){d=f[e];try{a=new ActiveXObject(d)}catch(b){}if(a){f=[d];break}}return a},parseName:function(a){var e,
d,b=!1,k=a.indexOf(".");e=0===a.indexOf("./")||0===a.indexOf("../");-1!==k&&(!e||1<k)?(e=a.substring(0,k),d=a.substring(k+1,a.length)):e=a;a=d||e;k=a.indexOf("!");-1!==k&&(b="strip"===a.substring(k+1),a=a.substring(0,k),d?d=a:e=a);return{moduleName:e,ext:d,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,e,d,b){var k,p;k=n.xdRegExp.exec(a);if(!k)return!0;a=k[2];k=k[3];k=k.split(":");p=k[1];k=k[0];return(!a||a===e)&&(!k||k.toLowerCase()===d.toLowerCase())&&(!p&&!k||p===b)},finishLoad:function(a,
d,b,k){b=d?n.strip(b):b;p.isBuild&&(e[a]=b);k(b)},load:function(e,b,f,h){if(h.isBuild&&!h.inlineText)f();else{p.isBuild=h.isBuild;var l=n.parseName(e);h=l.moduleName+(l.ext?"."+l.ext:"");var u=b.toUrl(h),m=p.useXhr||n.useXhr;!g||m(u,d,a,k)?n.get(u,function(a){n.finishLoad(e,l.strip,a,f)},function(a){f.error&&f.error(a)}):b([h],function(a){n.finishLoad(l.moduleName+"."+l.ext,l.strip,a,f)})}},write:function(a,d,b,k){e.hasOwnProperty(d)&&(k=n.jsEscape(e[d]),b.asModule(a+"!"+d,"define(function () { return '"+
k+"';});\n"))},writeFile:function(a,e,d,b,k){e=n.parseName(e);var p=e.ext?"."+e.ext:"",g=e.moduleName+p,f=d.toUrl(e.moduleName+p)+".js";n.load(g,d,function(e){e=function(a){return b(f,a)};e.asModule=function(a,e){return b.asModule(a,f,e)};n.write(a,g,e,k)},k)}};if("node"===p.env||!p.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)l=require.nodeRequire("fs"),n.get=function(a,e){var d=l.readFileSync(a,"utf8");0===d.indexOf("\ufeff")&&(d=d.substring(1));e(d)};else if("xhr"===
p.env||!p.env&&n.createXhr())n.get=function(a,e,d,b){var k=n.createXhr(),g;k.open("GET",a,!0);if(b)for(g in b)b.hasOwnProperty(g)&&k.setRequestHeader(g.toLowerCase(),b[g]);if(p.onXhr)p.onXhr(k,a);k.onreadystatechange=function(b){4===k.readyState&&(b=k.status,399<b&&600>b?(b=Error(a+" HTTP status: "+b),b.xhr=k,d(b)):e(k.responseText))};k.send(null)};else if("rhino"===p.env||!p.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(a,e){var d,b,k=new java.io.File(a),p=java.lang.System.getProperty("line.separator"),
k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8")),g="";try{d=new java.lang.StringBuffer;(b=k.readLine())&&(b.length()&&65279===b.charAt(0))&&(b=b.substring(1));for(null!==b&&d.append(b);null!==(b=k.readLine());)d.append(p),d.append(b);g=String(d.toString())}finally{k.close()}e(g)};return n});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(m,n,l){return{slideoutHTMLFragment:function(f){var b=document.createElement("div");b.innerHTML=l;var h=n.$("#slideContainer",b);h.id=f+h.id;h=n.$("#pageCommandParameters",b);h.id=f+h.id;h=n.$("#pageCommandDismiss",b);h.id=f+h.id;return b.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(m){function n(f,b,h,g,d,a){this.type=a||"keydown";this.keyCode="string"===typeof f&&"keydown"===this.type?f.toUpperCase().charCodeAt(0):f;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!==d&&null!==d?d:!1}function l(f){this.keys=f}n.prototype={getKeys:function(){return[this]},match:function(f,b){if(void 0!==b){if(0!==b)return!1}else if(f instanceof Array){if(1<f.length)return!1;
f=f[0]}return f.type!==this.type?!1:this.keyCode===f.keyCode||this.keyCode===String.fromCharCode(m.isOpera?f.which:void 0!==f.charCode?f.charCode:f.keyCode)?this.mod1!==(m.isMac?f.metaKey:f.ctrlKey)||"keydown"===this.type&&this.mod2!==f.shiftKey||this.mod3!==f.altKey||m.isMac&&this.mod4!==f.ctrlKey?!1:!0:!1},equals:function(f){return!f||this.keyCode!==f.keyCode||this.mod1!==f.mod1||this.mod2!==f.mod2||this.mod3!==f.mod3||this.mod4!==f.mod4||this.type!==f.type?!1:!0}};l.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(f,b){var h=this.keys;if(void 0!==b)return b>h.length?!1:h[b].match(f)?b===h.length-1?!0:b+1:!1;f instanceof Array||(f=[f]);if(f.length>h.length)return!1;var g;for(g=0;g<f.length;g++)if(!h[g].match(f[g]))return!1;return g===h.length?!0:g},equals:function(f){if(!f.keys||f.keys.length!==this.keys.length)return!1;for(var b=0;b<f.keys.length;b++)if(!f.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:l}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(m,n,l){function f(b){l.attach(this);this._init(b)}function b(b,d){var a=document.createElement(void 0===d?"span":d);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var k=document.createElement("span");k.appendChild(document.createTextNode(b));k.classList.add("dropdownCommandName");a.appendChild(k);k=document.createElement("li");k.appendChild(a);return k}function h(){var b=document.createElement("li");
b.classList.add("dropdownSeparator");return b}f.prototype={_init:function(b){this._dropdownNode=n.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 d=this._dropdownNode.parentNode;d&&document!==d;){if(d.classList&&d.classList.contains("dropdownMenu")){this._parentDropdown=d.dropdown;break}d=d.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=b.triggerNode?b.triggerNode:n.$(".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(d){a.toggle(d)&&n.stop(d)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(d){if(d.keyCode===n.KEY.ENTER||d.keyCode===n.KEY.SPACE)a.toggle(),n.stop(d)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var d=this;b.addEventListener("click",function(a){d.toggle(a)&&n.stop(a)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var d=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:b}),n.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),d=n.$$array(".dropdownSubMenu",this._dropdownNode),n.addAutoDismiss([this._triggerNode].concat(d),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(b),this._focusDropdownNode(),
d=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return d},_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=n.bounds(this._dropdownNode);
var d=n.bounds(document.body);if(b.left+b.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var a=n.bounds(this._boundingNode(this._triggerNode)),k=n.bounds(this._triggerNode);this._dropdownNode.style.left=k.left-a.left-b.width+k.width+"px"}b=b.top+b.height-(d.top+d.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var d=window.getComputedStyle(b,null);
return null===d||"absolute"===d.getPropertyValue("position")||!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var d=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),d=!0);return d},getItems:function(){var b=[],d=this;n.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===d._dropdownNode&&b.push(a)});b.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(b){a.dropdown?a.dropdown.open(b):(d._closeSelectedSubmenu(),n.stop(b));d._selectItem(a)}),a._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;n.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===
b._dropdownNode&&d.parentNode.removeChild(d)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===n.KEY.UP||b.keyCode===n.KEY.DOWN||b.keyCode===n.KEY.RIGHT||b.keyCode===n.KEY.ENTER||b.keyCode===n.KEY.LEFT){var d=this.getItems();if(d.length&&0<d.length){if(this._selectedItem){var a=d.indexOf(this._selectedItem);0>a&&(a=d.indexOf(this._selectedItem.parentNode));0<=a&&(b.keyCode===n.KEY.UP&&0<a?(a--,this._selectItem(d[a])):b.keyCode===n.KEY.DOWN&&a<d.length-1?(a++,this._selectItem(d[a])):
b.keyCode===n.KEY.ENTER||b.keyCode===n.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):b.keyCode===n.KEY.ENTER&&this._selectedItem.click():b.keyCode===n.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(d[0]);n.stop(b)}}else b.keyCode===
n.KEY.ESCAPE&&(this.close(!0),n.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&&n.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(g,d){var a=b(g,d);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var b=h();this._dropdownNode.appendChild(b);return b}};f.prototype.constructor=f;return{Dropdown:f,appendKeyBindingString:function(b,d){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(d));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(m,n){function l(f){this._init(f)}l.prototype={_init:function(f){this._node=n.node(f.node);if(!this._node)throw"no dom node for tooltip found";this._position=f.position||["right","above","below","left"];this._text=f.text;this._hideDelay=void 0===f.hideDelay?200:f.hideDelay;this._tailSize=f.tailSize||10;this._trigger=f.trigger||"mouseover";this._afterShowing=f.afterShowing;this._afterHiding=f.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(),n.stop(g))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===f.showDelay?500:f.showDelay;f=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(g){n.contains(b._node,g.target)&&(b.show(),n.stop(g))},!1);this._leaveHandler=function(g){n.contains(b._node,g.target)&&b.hide()};for(var h=0;h<f.length;h++)this._node.addEventListener(f[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 f=document.createTextNode(this._text);this._tipTextContent.appendChild(f)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var b=this;n.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(f){b._timeout&&(window.clearTimeout(b._timeout),b._timeout=null);b._tip.addEventListener("mouseout",function(g){n.contains(b._tip,g.target)&&(b.hide(),n.stop(g))},
!1)},!1))}return this._tip},_positionTip:function(f,b){this._makeTipNode();"left"===f?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,g;for(g=n.bounds(h);h&&!g.width&&!g.height;h=h.parentNode)g=n.bounds(h);var h=n.bounds(this._tipInner),d;switch(f){case "above":d=g.top-h.height-this._tailSize-1;g=g.left-this._tailSize;break;case "below":d=g.top+g.height+this._tailSize+1;g=g.left-this._tailSize;break;case "left":d=g.top-this._tailSize/2;g=g.left-h.width-
this._tailSize-1;break;default:d=g.top-this._tailSize/2,g=g.left+g.width+this._tailSize+1}var a=n.bounds(document.documentElement);if(d+h.height>a.height)if(b)d=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>d)if(b)d=4;else return!1;this._tail&&this._tail.previousPosition!==f&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
f),"above"===f||"left"===f?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=f);this._tip.style.top=d+"px";this._tip.style.left=g+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=window.setTimeout(this._showImmediately.bind(this),
this._showDelay):this._showImmediately()},_showImmediately:function(){for(var f=!1,b=0;!f&&b<this._position.length;)f=this._positionTip(this._position[b]),b++;f||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(f){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===f&&(f=this._hideDelay);var b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");
b._tip.removeAttribute("style");b._afterHiding&&b._afterHiding()},f)}},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 f=["mouseout","click"],b=0;b<f.length;b++)this._node.removeEventListener(f[b],
this._leaveHandler,!1)}}};l.prototype.constructor=l;return{Tooltip:l}});
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(m,n,l,f,b,h,g,d){function a(a){var e=a.invocation;if(e){var d=a.command;if(d.hrefCallback)return a=d.hrefCallback.call(e.handler||window,e),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(e.commandRegistry)return e.commandRegistry._invoke(e),
!0;if(d.onClick||d.callback)return window.setTimeout(function(){(d.onClick||d.callback).call(e.handler||window,e)},0),!0}return!1}function k(e,d){for(var b in d)if(d[b]&&(d[b].keyBinding&&d[b].command)&&d[b].keyBinding.match(e)){var s=d[b],k=s.keyBinding;if((!k.domScope||n.contains(n.node(k.domScope),e.target))&&a(s)){n.stop(e);break}}}function e(){var a={};if(u){var e,d,b;d=Object.keys(w);for(e=0;e<d.length;e++)b=d[e],a[b]=w[b];var k=u();d=Object.keys(k);for(e=0;e<d.length;e++)b=d[e],a[b]=k[b]}else a=
w;return a}function p(a){k(a,e())}function q(a,e){a=a||window.event;if(function(a){if(m.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 d=a.target.nodeName.toLowerCase();if("input"===d)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"===d)return}e?e(a):p(a)}function x(){this._init()}
function r(a,e,d){e.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?e.classList.add(a.imageClass):(b=document.createElement("span"),e.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,b.name=d,b.id=d,b.src=a.image,e.appendChild(b));return b}function v(a,e,d,b,k){this.commandRegistry=k;this.handler=a;this.items=e;this.userData=d;this.command=b;b.parameters&&(this.parameters=b.parameters.makeCopy());this.id=b.id}function t(a){this._init(a)}
var u=null,w={};x.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(e){return q(e,function(e){var d=a.proxy,b=a.bindings;if(b&&d)for(var k=0;k<b.length;k++)b[k].match(e)&&(d.processKey({type:e.type,keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}),n.stop(e))})})}};window.document.addEventListener("keydown",q,!1);v.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var e=new v(this.handler,this.items,this.userData,this.command,this.commandRegistry);e.domNode=this.domNode;e.domParent=this.domParent;a?e.parameters=a.makeCopy():this.parameters&&(e.parameters=this.parameters.makeCopy());return e}};v.prototype.constructor=v;t.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,
e,d,b,k){d=this.getChoices(e,d,b);var p=d.some(function(a){return a.checked});d.forEach(function(d){if(d.name){var b=document.createElement("li");a.appendChild(b);var s=document.createElement("span");s.tabIndex=0;s.role="menuitem";s.classList.add("dropdownMenuItem");if(p){var g=document.createElement("span");g.classList.add("check");g.appendChild(document.createTextNode(d.checked?"\u25cf":""));s.appendChild(g)}g=document.createTextNode(d.name);s.appendChild(g);b.appendChild(s);s.choice=d;s.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1);s.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1)}else k._generateMenuSeparator(a)})},getChoices:function(a,e,d){return this.choiceCallback?this.choiceCallback.call(e,a,d):null},makeChoiceCallback:function(a,e){return function(d){a.callback&&a.callback.call(a,e,d)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};t.prototype.constructor=t;return{Command:t,CommandInvocation:v,createDropdownMenu:function(a,e,d,k,p,g,q,h,x){a=n.node(a);if(!a)throw"no parent node was specified";var v=document.createRange();v.selectNode(a);v=x?v.createContextualFragment(b):v.createContextualFragment(f);n.processTextNodes(v,{ButtonText:e});a.appendChild(v);a=a.lastChild;
var t;x?(x=a.previousSibling,t=x.lastChild):x=a.previousSibling;k?x.classList.add(k):(x.classList.add("orionButton"),x.classList.add("commandButton"));p&&(g||(x.textContent="",x.setAttribute("aria-label",e)),r({spriteClass:"commandSprite",imageClass:p},x,e),x.classList.add("orionButton"));x.dropdown=new l.Dropdown({dropdown:a,populate:d,selectionClass:q,skipTriggerEventListeners:!!t,positioningNode:h});a.dropdown=x.dropdown;return{menuButton:x,menu:a,dropdown:x.dropdown,dropdownArrow:t}},createCheckedMenuItem:function(a,
e,d,b){a=n.node(a);if(!a)throw"no parent node was specified";var k=document.createRange();k.selectNode(a);k=k.createContextualFragment(g);n.processTextNodes(k,{ItemText:e});a.appendChild(k);a=n.$(".checkedMenuItem",a.lastChild);a.checked=d;a.addEventListener("change",b,!1);return a},createCommandItem:function(a,e,b,k,p,g,q){var f;g=g||!e.name&&e.hasImage();if(e.hrefCallback)f=document.createElement("a"),f.id=k,g&&e.hasImage()?r(e,f,k):(f.className="commandLink",f.appendChild(document.createTextNode(e.name))),
q=e.hrefCallback.call(b.handler,b),q.then?q.then(function(a){f.href=a}):f.href=q?q:"#";else{f=document.createElement("button");f.className="orionButton";e.extraClass&&f.classList.add(e.extraClass);g?e.hasImage()?(r(e,f,k),e.name&&f.setAttribute("aria-label",e.name)):(f.classList.add("commandButton"),f.classList.add("commandMissingImageButton"),f.appendChild(document.createTextNode(e.name))):(f.classList.add("commandButton"),k=document.createTextNode(e.name),f.appendChild(k));var h=q||e.callback;h&&
(e.onClick=h,f.addEventListener("click",function(a){h.call(b.handler,b)},!1))}"ul"===a.nodeName.toLowerCase()?(q=document.createElement("li"),a.appendChild(q),a=q):f.classList.add("commandMargins");a.appendChild(f);e.tooltip&&(f.commandTooltip=new d.Tooltip({node:f,text:e.tooltip,position:["above","below","right","left"]}));p&&(w[e.id]={keyBinding:p,command:e,invocation:b});return f},createCommandMenuItem:function(a,e,b,k,p,g){var q,f,h=a.dropdown;if(e.hrefCallback)f=l.createMenuItem(e.name,"a"),
q=f.firstElementChild,p=e.hrefCallback.call(b.handler,b),p.then?p.then(function(a){q.href=a}):q.href=p?p:"#",q.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&q.click()},!1);else{f=l.createMenuItem(e.name);q=f.firstElementChild;var x=p||e.callback;x&&(e.onClick=x,q.addEventListener("click",function(a){h.close(!0);x.call(b.handler,b)},!1),q.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)a.preventDefault(),q.click()},
!1))}e.tooltip&&(q.commandTooltip=new d.Tooltip({node:q,text:e.tooltip,position:["above","below","right","left"]}));g&&l.appendKeyBindingString(q,g);a.appendChild(f);k&&(w[e.id]={keyBinding:k,command:e,invocation:b});return q},executeBinding:a,setKeyBindingProvider:function(a){u=a},localKeyBindings:w,CommandsProxy:x,getKeyBindings:e,processKey:p,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:k}});define("orion/explorers/navigationUtils",[],function(){function m(l,f,b,h){!n&&l&&(l.push({domNode:f}),f.tabIndex=-1,f.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(l,f,b){l&&(l=l.getGridNavHolder(f,!0))&&m(l,b)},generateNavGrid:m,removeNavGrid:function(l,f){if(l)for(var b=0;b<l.length;b++)if(l[b].domNode===f){l.splice(b,1);break}}}});
define("orion/PageUtil",[],function(){var m=/^http[s]?/i;return{hash:function(){var m=window.location.href.split("#")[1];return m?"#"+m:""},matchResourceParameters:function(m){m=m||window.location.toString();var l={resource:""},f=m.indexOf("#");if(-1!==f&&(m=m.substring(f+1),0!==m.length)){m=m.split(",");l.resource=decodeURIComponent(m[0]);for(f=1;f<m.length;f++){var b=/([^=]*)(=?)(.*)/.exec(m[f]),h=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");""!==h&&"resource"!==h&&(l[h]=b)}}return l},
validateURLScheme:function(n,l){var f=n;if(-1===n.indexOf("://")){var b=document.createElement("a");b.href=n;f=b.href}b=!1;if(b=l?l.some(function(b){return RegExp("^"+b+":","i").test(f)}):m.test(f))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(m){function n(f){var b="",h=-1!==navigator.platform.indexOf("Mac");h?(f.mod4&&(b+="\u2303"),f.mod3&&(b+="\u2325"),f.mod2&&(b+="\u21e7"),f.mod1&&(b+="\u2318")):(f.mod1&&(b+="Ctrl+"),f.mod2&&(b+="Shift+"),f.mod3&&(b+="Alt+"));if(f.alphaKey)return b+f.alphaKey;if("keypress"===f.type)return b+f.keyCode;for(var g in m.KEY)if(typeof("number"===m.KEY[g])&&m.KEY[g]===f.keyCode){if(h)switch(m.KEY[g]){case m.KEY.BKSPC:g="\u232b";break;case m.KEY.TAB:g=
"\u21e5";break;case m.KEY.ENTER:g="\u23ce";break;case m.KEY.ESCAPE:g="\u238b";break;case m.KEY.SPACE:g="\u2423";break;case m.KEY.PAGEUP:g="\u21de";break;case m.KEY.PAGEDOWN:g="\u21df";break;case m.KEY.END:g="\u21f2";break;case m.KEY.HOME:g="\u21f1";break;case m.KEY.DEL:g="\u2326"}switch(m.KEY[g]){case m.KEY.DOWN:g="\u2193";break;case m.KEY.UP:g="\u2191";break;case m.KEY.RIGHT:g="\u2192";break;case m.KEY.LEFT:g="\u2190"}return b+g}var d;switch(f.keyCode){case 59:d=f.mod2?":":";";break;case 61:d=f.mod2?
"+":"\x3d";break;case 188:d=f.mod2?"\x3c":",";break;case 190:d=f.mod2?"\x3e":".";break;case 191:d=f.mod2?"?":"/";break;case 192:d=f.mod2?"~":"`";break;case 219:d=f.mod2?"{":"[";break;case 220:d=f.mod2?"|":"\\";break;case 221:d=f.mod2?"}":"]";break;case 222:d=f.mod2?'"':"'"}return d?b+d:112<=f.keyCode&&123>=f.keyCode?b+"F"+(f.keyCode-111):b+String.fromCharCode(f.keyCode)}function l(f){var b=-1!==window.navigator.platform.indexOf("Mac");return b&&f.metaKey||!b&&f.ctrlKey}return{getUserKeyString:function(f){var b=
"";f=f.getKeys();for(var h=0;h<f.length;h++)0!==h&&(b+=" "),b+=n(f[h]);return b},getUserText:function(f){var b=f.id,h=f.refNode,g=f.hideRefNode,d=f.initialText,a=f.onComplete,k=f.onEditDestroy,e=f.selectTo,p=f.isInitialValid;f=f.insertAsChild;var q=!1,x=function(e){return function(f){if(!q){var x=m.node(b),r=x.value;x&&(e&&f.keyCode===m.KEY.ESCAPE?(g&&(h.style.display="inline"),q=!0,x.parentNode.removeChild(x),k&&k()):e&&f.keyCode!==m.KEY.ENTER||(0===r.length||!p&&r===d?g&&(h.style.display="inline"):
(a(r),g&&h.parentNode&&(h.style.display="inline")),q=!0,x.parentNode&&x.parentNode.removeChild(x),k&&k()))}}},r=document.createElement("input");r.id=b;r.value=d||"";f?h.appendChild(r):h.parentNode.insertBefore(r,h.nextSibling);r.classList.add("userEditBoxPrompt");g&&(h.style.display="none");r.addEventListener("keydown",x(!0),!1);r.addEventListener("blur",x(!1),!1);window.setTimeout(function(){r.focus();if(d){var a=m.node(b),k=e?d.indexOf(e):-1;0<k?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",k),a.select()):a.setSelectionRange?a.setSelectionRange(0,k):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=k):a.select()}},0)},openInNewWindow:l,followLink:function(f,b){b&&l(b)?window.open(f):window.location=f},createButton:function(f,b){var h=document.createElement("button");h.className="orionButton commandButton commandMargins";h.addEventListener("click",function(g){b();m.stop(g)},!1);f&&h.appendChild(document.createTextNode(f));return h},
createDropdownButton:function(f,b,h){},isFormElement:function(f){switch(f.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(m,n,l,f,b,h,g,d,a,k){function e(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function p(a,e){this.token=a;this.parameterName=e}function q(a,e,d){this.event=a;this.handler=e;this.capture=d||!1}function x(a,e,d,b,k,p){this.name=a;this.type=e;this.label=d;this.value=b;this.lines=k||1;this.eventListeners=Array.isArray(p)?p:p?[p]:[]}function r(a,e,d){this._storeParameters(a);this._hasOptionalParameters=e&&e.hasOptionalParameters;this._options=e;this.optionsRequested=!1;this.getParameters=d;this.clientCollect=e&&e.clientCollect;this.getParameterElement=e&&e.getParameterElement;
this.getSubmitName=e&&e.getSubmitName}e.prototype={_init:function(a){this._selectionService=a.selection;var e=this;m.setKeyBindingProvider(function(){return e._activeBindings})},processURL:function(a){for(var e in this._urlBindings)if(this._urlBindings[e]&&this._urlBindings[e].urlBinding&&this._urlBindings[e].command){var d=this._urlBindings[e].urlBinding.match(a);if(d){var b=this._urlBindings[e],k=b.command,p=b.invocation;if(p&&p.parameters&&k.callback){p.parameters.setValue(d.parameterName,d.parameterValue);
var g=this;window.setTimeout(function(){g._invoke(p)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,e,d,b,k,p){if(e){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(e):1)&&a.callback)return e=new m.CommandInvocation(d,e,k,a,this),e.domParent=p,this._invoke(e,b)}else if((p=this._urlBindings[a])&&p.command&&p.command.callback)return this._invoke(p.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,e,d){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,e,d))},confirm:function(a,e,d,b,k,p){var g=!1;if(this._parameterCollector&&!k){var s=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,k){var p=document.createElement("span");p.classList.add("parameterPrompt");p.textContent=e;a.appendChild(p);p=document.createElement("button");p.addEventListener("click",function(a){g=!0;s._parameterCollector.close()},
!1);k.appendChild(p);p.appendChild(document.createTextNode(d));p.className="dismissButton";var q=document.createElement("button");q.addEventListener("click",function(a){g=!1;s._parameterCollector.close()},!1);k.appendChild(q);q.appendChild(document.createTextNode(b));q.className="dismissButton";return p},function(){p(g)}))return}g=window.confirm(e);p(g)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,e){return this._collectAndInvoke(a.makeCopy(e),!1)},_collectAndInvoke:function(a,e,d){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(e||a.parameters.shouldCollectParameters())){e=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a,d),!e)){var b=new g.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});e=
b.contentContainer();e.classList.add("parameterPopup");var k=window.document.activeElement,p=this._parameterCollector.getFillFunction(a,function(){k&&k.focus();b.destroy()},d)(e);b.show();window.setTimeout(function(){p.focus();p.select()},0);e=!0}if(!e)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,
e){this._collectAndInvoke(a,!0,e)},showKeyBindings:function(a){function e(a){return function(){m.executeBinding(a)}}var d={},b,k,p=[],g;for(g in this._activeBindings)(k=this._activeBindings[g])&&(k.keyBinding&&k.command&&(k.command.name||k.command.tooltip))&&p.push(k);p.sort(function(a,e){return(a.command.name||a.command.tooltip).localeCompare(e.command.name||e.command.tooltip)});for(g=0;g<p.length;g++)k=p[g],k.keyBinding.scopeName?(d[k.keyBinding.scopeName]||(d[k.keyBinding.scopeName]=[]),d[k.keyBinding.scopeName].push(k)):
(b=f.getUserKeyString(k.keyBinding),a.createItem(b,k.command.name||k.command.tooltip,e(k)));for(var s in d)d[s].length&&0<d[s].length&&(a.createHeader(s),d[s].forEach(function(d){b=f.getUserKeyString(d.keyBinding);a.createItem(b,d.command.name||d.command.tooltip,e(d))}))},addCommand:function(a){this._commandList[a.id]=a;var e=this._pendingBindings[a.id];if(e){var d=this;e.forEach(function(e){d._addBinding(a,e.type,e.binding,e.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
e,d,b,k,p,g,s,q,B){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];k&&(a=this._createEntryForPath(a,k));a[e]?(b&&(a[e].title=b),d&&(a[e].position=d),g&&(a[e].imageClass=g),s&&(a[e].tooltip=s),q&&(a[e].selectionClass=q),!0===B?a[e].pretendDefaultActionId=!0:a[e].defaultActionId=B,a[e].emptyGroupMessage=p):(a[e]={title:b,position:d,emptyGroupMessage:p,imageClass:g,tooltip:s,selectionClass:q,defaultActionId:!0===B?null:B,pretendDefaultActionId:!0===
B,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,e){e&&e.split("/").forEach(function(e){1<e.length&&(a[e]||(a[e]={position:0,children:{}},a.sortedContributions=null),a=a[e].children)});return a},registerSelectionService:function(a,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=e},registerCommandContribution:function(a,e,d,b,k,p,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[e]={position:d};p&&((d=this._commandList[e])?this._addBinding(d,"key",p,k):this._addPendingBinding(e,"key",p,k));g&&((d=this._commandList[e])?this._addBinding(d,"url",g,k):this._addPendingBinding(e,"url",g,k));a.sortedContributions=null},unregisterCommandContribution:function(a,e,d){if(this._contributionsByScopeId[a]){delete this._commandList[e];delete this._activeBindings[e];delete this._urlBindings[e];delete this._pendingBindings[e];
var b=this._contributionsByScopeId[a];d&&d.split("/").forEach(function(a){1<a.length&&b[a]&&(b=b[a].children)});delete b[e];b.sortedContributions=null}},_addBinding:function(a,e,d,b){if(!a.id)throw Error("No command id: "+a);"key"===e?this._activeBindings[a.id]={command:a,keyBinding:d,bindingOnly:b}:"url"===e&&(this._urlBindings[a.id]={command:a,urlBinding:d,bindingOnly:b})},_addPendingBinding:function(a,e,d,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:e,
binding:d,bindingOnly:b})},_checkForTrailingSeparator:function(a,e,d){var k;if("tool"===e||"button"===e)if((k=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&k.classList.contains("commandSeparator"))return d?(a.removeChild(k),!1):!0;if("menu"===e&&(a=b.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(k=a[a.length-1],d)k.parentNode.parentNode.removeChild(k.parentNode);else return!0;return!1},renderCommands:function(a,e,d,k,p,g,q){if("string"!==
typeof a)throw"a scope id for rendering must be specified";e=b.node(e);if(!e)throw"no parent";var s=this._contributionsByScopeId[a];if(!d&&s){d=s.localSelectionService||this._selectionService;var f=this;d&&d.getSelections(function(d){f.renderCommands(a,e,d,k,p,g)})}else s&&(this._render(s,e,d,k,p||"button",g,q),this._checkForTrailingSeparator(e,p,!0))},destroy:function(a){a=b.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var e=a.firstChild;e.commandTooltip&&e.commandTooltip.destroy();e.emptyGroupTooltip&&
e.emptyGroupTooltip.destroy();this.destroy(e);a.removeChild(e)}},_render:function(a,e,d,b,k,p,q){var s=a.sortedContributions;if(!s){var s=[],A=!1,B;for(B in a)if(Object.prototype.hasOwnProperty.call(a,B)){var h=a[B];h&&"number"===typeof h.position&&(h.id=B,s.push(h),A=!0)}A&&(s.sort(function(a,e){return a.position-e.position}),a.sortedContributions=s)}var x=0,r=this;s.forEach(function(a){var s;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var B=
a.children;if("tool"===k||"button"===k)if(a.title){var A;a.defaultActionId&&((B=r._commandList[a.defaultActionId])&&(B.visibleWhen?B.visibleWhen(d):1)?(A=new m.CommandInvocation(b,d,p,B,r),A.domParent=e):a.pretendDefaultActionId=!0);B=r._createDropdownMenu(e,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,A,a.pretendDefaultActionId);q&&n.generateNavGrid(q,B.menuButton);B&&(r._render(a.children,B.menu,d,b,"menu",p,q),r._checkForTrailingSeparator(B.menu,"menu",!0),0===B.menu.childNodes.length?
a.emptyGroupMessage?B.menuButton.emptyGroupTooltip||(B.menuButton.emptyGroupTooltip=new g.Tooltip({node:B.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(q&&n.removeNavGrid(q,B.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(B.menu),a(B.menuButton),a(B.destroyButton)):B.menuButton.style.visibility="visible")}else{var h;0<e.childNodes.length&&!r._checkForTrailingSeparator(e,k)&&(h=r.generateSeparatorImage(e));r._render(B,e,
d,b,k,p,q);0<e.childNodes.length&&e.childNodes[e.childNodes.length-1]!==h&&(h=r.generateSeparatorImage(e))}else if(a.title){if(a=r._createDropdownMenu(e,a.title,!0,null,null,a.imageClass))r._render(B,a.menu,d,b,"menu",p,q),r._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&e.removeChild(a.destroyButton)}else 0<e.childNodes.length&&r._generateMenuSeparator(e),r._render(B,e,d,b,k,p,q),r._generateMenuSeparator(e)}else{var l=r._commandList[a.id],B=l?!0:!1;A=
a=null;if(l){s=new m.CommandInvocation(b,d,p,l,r);s.domParent=e;h=!1;try{h=B&&(l.visibleWhen?l.visibleWhen(d):!0)}catch(E){throw console.log(E),E;}r._activeBindings[l.id]&&r._activeBindings[l.id].keyBinding&&(a=r._activeBindings[l.id],a.invocation=h?s:null,a.bindingOnly&&(B=!1));r._urlBindings[l.id]&&r._urlBindings[l.id].urlBinding&&(A=r._urlBindings[l.id],A.invocation=h?s:null,A.bindingOnly&&(B=!1));B=B&&h}B&&(l.choiceCallback?("tool"===k||"button"===k?(a=e,B=!1,"ul"===e.nodeName.toLowerCase()&&
(a=document.createElement("li"),e.appendChild(a))):(a=e,B=!0),r._createDropdownMenu(a,l.name,B,function(a){l.populateChoicesMenu(a,d,b,p,r)}.bind(l),l.imageClass,l.tooltip||l.title,l.selectionClass,l.positioningNode)):(s.handler=s.handler||this,s.domParent=e,B=function(a){r._invoke(s)},"menu"===k?(A=null,a&&a.keyBinding&&(A=f.getUserKeyString(a.keyBinding)),a=m.createCommandMenuItem(e,l,s,null,B,A)):(a=k+l.id+x,a=m.createCommandItem(e,l,s,a,null,"tool"===k,B)),n.generateNavGrid(q,a),s.domNode=a,x++))}})},
_createDropdownMenu:function(a,e,d,p,q,f,x,s,A,B){a=b.node(a);if(!a||!b.contains(document.body,a))return null;var r,l,G=a;if(d)f=document.createRange(),f.selectNode(a),f=f.createContextualFragment(k),b.processTextNodes(f,{ButtonText:e}),a.appendChild(f),l=a.lastChild,q=l.lastChild,e=q.previousSibling,e.dropdown=new h.Dropdown({dropdown:q,populate:p,parentDropdown:a.dropdown}),q.dropdown=e.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(G=document.createElement("li"),a.appendChild(G),l=G);a=null;q&&
(a="dropdownButtonWithIcon",f=f||e);f=q?f||e:f;var n=m.createDropdownMenu(G,e,p,a,q,!1,x,s,A||B);r=n.dropdownArrow;e=n.menuButton;if(r){A&&(A.domNode=n.menuButton);var F=this;e.onclick=function(a){var e=b.bounds(r);a.clientX>=e.left&&n.dropdown?n.dropdown.toggle(a):F._invoke(A)};n.dropdown&&(e.onkeydown=function(a){b.KEY.DOWN===a.keyCode&&(n.dropdown.toggle(a),b.stop(a))})}q=n.menu;var I;(p=A&&A.command&&(A.command.tooltip||A.command.name))?I=A.command.tooltip||A.command.name:p&&(I=f);I&&(e.commandTooltip=
new g.Tooltip({node:e,text:I,position:["above","below","right","left"]}))}return{menuButton:e,menu:q,dropdown:e.dropdown,destroyButton:l,dropdownArrow:r}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var e=document.createElement("li");e.classList.add("dropdownSeparator");var d=document.createElement("span");d.classList.add("dropdownSeparator");e.appendChild(d);a.appendChild(e)}},generateSeparatorImage:function(a){var e;e="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(e);e.classList.add("core-sprite-sep");e.classList.add("imageSprite");e.classList.add("commandSeparator");return e}};e.prototype.constructor=e;p.prototype={match:function(a){a=l.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};p.prototype.constructor=p;q.prototype.constructor=q;x.prototype={optionsRequested:function(){return this.optionsRequested}};x.prototype.constructor=x;r.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var e=this.parameterTable={};a.forEach(function(a){e[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,e){var d=this.parameterTable[a];
d&&(d.value=e)},forEach:function(a){for(var e in this.parameterTable)this.parameterTable[e].type&&this.parameterTable[e].name&&a(this.parameterTable[e])},makeCopy:function(){var a=[];this.forEach(function(e){e=new x(e.name,e.type,e.label,e.value,e.lines,e.eventListeners);a.push(e)});var e=new r(a,this._options,this.getParameters);e.clientCollect=this.clientCollect;return e},hasOptionalParameters:function(){return this._hasOptionalParameters}};r.prototype.constructor=r;return{CommandRegistry:e,URLBinding:p,
ParametersDescription:r,CommandParameter:x,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(m,n,l){function f(b,f){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=f}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&l.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&l.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,f,g){"string"===typeof b&&(b=l.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 d=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;b=l.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===b.length){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=m.Close;f.appendChild(b);var a=this;b.addEventListener("click",function(d){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);d&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select&&d.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,f){l.$$array("input",f).forEach(function(d){"checkbox"===d.type?b.parameters.setValue(d.parameterName,d.checked):"button"!==d.type&&b.parameters.setValue(d.parameterName,d.value.trim())});l.$$array("textArea",f).forEach(function(d){b.parameters.setValue(d.parameterName,d.value.trim())});var g=b.parameters.getParameterElement;g&&b.parameters.forEach(function(d){(d=g(d,f))&&("checkbox"===d.type?
b.parameters.setValue(d.parameterName,d.checked):"button"!==d.type?b.parameters.setValue(d.parameterName,d.value.trim()):"textarea"!==d.type&&b.parameters.setValue(d.parameterName,d.value.trim()))});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b,f){return b.parameters?(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b,null,f))):!1},getFillFunction:function(b,f,g){var d=this;return function(a,k){var e=
null,p=function(){f&&f();d.close()},q=function(e){e.keyCode===l.KEY.ENTER&&(d._collectAndCall(b,a),p(),l.stop(e));e.keyCode===l.KEY.ESCAPE&&("function"===typeof g&&g(),p(),l.stop(e))},x=b.parameters;x.forEach(function(d){var k=x.getParameterElement?x.getParameterElement(d,a):null,g=null;!k&&d.label&&(g=document.createElement("label"),g.classList.add("parameterInput"),g.setAttribute("for",d.name+"parameterCollector"),g.textContent=d.label,a.appendChild(g));var f=d.name+"parameterCollector",g=g||a;
"text"===d.type&&"number"===typeof d.lines&&1<d.lines?(k||(k=document.createElement("textarea"),k.rows=d.lines,k.type="textarea",k.id=f,g.appendChild(k)),q=function(a){a.keyCode===l.KEY.ESCAPE&&(p(),l.stop(a))}):"boolean"===d.type?(k||(k=document.createElement("input"),k.type="checkbox",k.id=f,g.appendChild(k)),d.value&&(k.checked=!0)):(k||(k=document.createElement("input"),k.type=d.type,k.id=f,g.appendChild(k)),d.value&&(k.value=d.value));k.classList.add("parameterInput");k.setAttribute("speech",
"speech");k.setAttribute("x-webkit-speech","x-webkit-speech");k.parameterName=d.name;e||(e=k);0<d.eventListeners.length&&d.eventListeners.forEach(function(a){k.addEventListener(a.event,function(e){return a.handler(e,b)},a.capture)});k.addEventListener("keydown",q,!1)});var r=k;r||(r=document.createElement("span"),r.classList.add("layoutRight"),r.classList.add("parametersDismiss"),a.appendChild(r));var v=function(a,e){var d=document.createElement("button");e.appendChild(d);a&&d.appendChild(document.createTextNode(a));
d.classList.add("dismissButton");return d};b.parameters.hasOptionalParameters()&&(b.parameters.optionsRequested=!1,v(m.More,r).addEventListener("click",function(){b.parameters.optionsRequested=!0;d._collectAndCall(b,a);p()},!1));v(x.getSubmitName?x.getSubmitName(b):m.Submit,r).addEventListener("click",function(){d._collectAndCall(b,a);p()},!1);r=v(null,r);r.id="closebox";r.classList.add("imageSprite");r.classList.add("core-sprite-close");r.title=m.Close;r.addEventListener("click",function(a){p();
"function"===typeof g&&g()},!1);return e}}};f.prototype.constructor=f;return{CommandParameterCollector:f}});define("orion/regex",[],function(){return{escape:function(m){return m.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(m){return(m=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(m))?{pattern:m[1],flags:m[2]}:null}}});
define("orion/contentTypes",[],function(){function m(a,e){if("string"!==typeof a)return null;for(var d=a&&a.split(".").pop(),b=null,g=0;g<e.length;g++){var f=e[g],h;a:{h=b;var l=f,m=d,n=0<=l.filename.indexOf(a),z;z=m.toLowerCase();z=-1!==l.extension.indexOf(z);if(n||z){if(!(z=!h))n&&(m=m.toLowerCase(),n=-1!==h.extension.indexOf(m)),z=n;if(z){h=l;break a}}}h===f&&(b=f)}return b}function n(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function l(a){return n(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function f(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:l(a.extension),filename:n(a.filename)}}function b(a){var e=Object.create(null);a.map(f).forEach(function(a){Object.prototype.hasOwnProperty.call(e,a.id)||(e[a.id]=a)});return e}function h(k){if(k&&k.registerService){this.serviceRegistry=k;for(var e=k.getServiceReferences(d).concat(k.getServiceReferences(a)),p=[],q=0;q<e.length;q++)for(var f=n(e[q].getProperty("contentTypes")),h=0;h<f.length;h++)p.push(f[h]);
this.map=b(p);k.registerService(g,this)}else if(Array.isArray(k))this.serviceRegistry=null,this.map=b(k);else throw Error("Invalid parameter");}var g="orion.core.contentTypeRegistry",d="orion.core.contenttype",a="orion.file.contenttype";h.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),e=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&e.push(a[d]);return e},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return m(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return m(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,e){a="string"===typeof a?this.getContentType(a):a;e="string"===typeof e?this.getContentType(e):e;if(!a||!e)return!1;if(a.id===e.id)return!0;for(var d=a,b={};d&&(d=this.getContentType(d["extends"]));){if(d.id===e.id)return!0;if(b[d.id])throw Error("Cycle: "+d.id);b[d.id]=!0}return!1},isSomeExtensionOf:function(a,e){for(var d=0;d<e.length;d++)if(this.isExtensionOf(a,
e[d]))return!0;return!1}};return{ContentTypeRegistry:h,getFilenameContentType:m}});
define("orion/URITemplate",[],function(){function m(a){this._text=a}function n(a){return a.replace("%25","%")}function l(a,d){if("U"===d)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(k,n);if("U+R-,"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+d);}function f(a,d,b){for(var k=
[],g=0;g<a.length;g++)"undefined"!==typeof a[g]&&k.push(l(a[g],d));return k.join(b)}function b(a,d,b,k){for(var g=Object.keys(a),f=[],h=0;h<g.length;h++)"undefined"!==typeof a[g[h]]&&f.push(l(g[h],d)+b+l(a[g[h]],d));return f.join(k)}function h(e){if(0===e.length)throw Error("Invalid Expression: 0 length expression");(this._operator=d[e[0]])?e=e.substring(1):this._operator=d.NUL;for(var b=[],k=e.split(","),g=0;g<k.length;g++){var f=k[g].match(a);if(null===f)throw Error("Bad VarSpec: "+e);b.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=b}function g(a){for(var d=[],b=0,k=a.indexOf("{",b);-1!==k;){d.push(new m(a.substring(b,k)));b=a.indexOf("}",k+1);if(-1===b)throw Error("Invalid template: "+a);d.push(new h(a.substring(k+1,b)));b+=1;k=a.indexOf("{",b)}d.push(new m(a.substring(b)));this._templateComponents=d}var d={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,k=/%25[0-9A-F][0-9A-F]/g;m.prototype={expand:function(a){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var d=[],k=0;k<this._varSpecList.length;k++){var g=this._varSpecList[k],h=g.name,m=a[h],t=typeof m;if("undefined"!==t&&null!==m){var u=0===d.length?this._operator.first:this._operator.sep;if("string"===t)this._operator.named&&(u+=l(h,"U+R"),u+=0===m.length?this._operator.ifemp:"\x3d"),-1!==g.prefix&&g.prefix<m.length&&(m=m.substring(0,g.prefix)),u+=l(m,this._operator.allow);else if(Array.isArray(m)){if(0===m.length)continue;g.explode?u+=f(m,this._operator.allow,
this._operator.sep):(g=f(m,this._operator.allow,","),this._operator.named&&(u+=l(h,"U+R"),u+=0===g.length?this._operator.ifemp:"\x3d"),u+=g)}else if("object"===t){if(0===Object.keys(m).length)continue;g.explode?u+=b(m,this._operator.allow,"\x3d",this._operator.sep):(g=b(m,this._operator.allow,",",","),this._operator.named&&(u+=l(h,"U+R"),u+=0===g.length?this._operator.ifemp:"\x3d"),u+=g)}else throw Error("bad param type: "+h+" : "+t);d.push(u)}}return d.join("")}};g.prototype={expand:function(a){for(var d=
[],b=0;b<this._templateComponents.length;b++)d.push(this._templateComponents[b].expand(a));return d.join("")}};return g});
define("orion/i18nUtil",["require","orion/Deferred"],function(m,n){function l(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 f={};return{getMessageBundle:function(b){function h(a){a?m(["i18n!"+b],function(a){if(a){var e=b;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+e,JSON.stringify(a));delete a._expires}d.resolve(a)}):g(Error(b))}function g(a){d.reject(a)}
if(f[b])return f[b];var d=new n;f[b]=d;var a=l(b);if(a)return d.resolve(a),d;try{m([b],h,g)}catch(k){m(["orion/i18n!"+b],h,g)}return d},formatMessage:function(b){var f=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,d){return f[(d<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(m,n,l,f,b,h,g){function d(){return m.toUrl?(new URL(m.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var e={};a.getPropertyKeys().forEach(function(d){"objectClass"!==d&&("service.names"!==d&&"service.id"!==d&&"__plugin__"!==d)&&(e[d]=a.getProperty(d))});return e}function k(a){return b.getMessageBundle(a.nls).then(function(e){a.textContent=
a.nameKey?e[a.nameKey]:a.name;return a},function(e){a.textContent=a.nameKey||a.name;return a})}function e(e,b){var p=e.getServiceReferences(b||"orion.page.link"),g=l.matchResourceParameters(window.location.href),q={OrionHome:d(),Location:g.resource},h=[];p.forEach(function(e){e=a(e);if(e.uriTemplate&&(e.nls||e.name)){var d=(new f(e.uriTemplate)).expand(q),d=l.validateURLScheme(d);e.href=d;e.nls?h.push(k(e)):(e.textContent=e.name,h.push((new n).resolve(e)))}});return n.all(h)}function p(a){var e=this.categories=
Object.create(null);a.forEach(function(a){e[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(x)}function x(a,e){var d=a.textContent&&a.textContent.toLowerCase(),b=e.textContent&&e.textContent.toLowerCase();return d<b?-1:d>b?1:0}var r;h.mixin(p.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var e=a.href;a=
a.textContent;var d=document.createElement("a");d.href=e;d.target="_self";d.classList.add("targetSelector");d.textContent=a;return d})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(e){var d;return!r?(d=[],e.getServiceReferences("orion.page.link.category").forEach(function(b){var p=a(b);if(p.id&&(p.name||p.nameKey))p.service=e.getService(b),p.nls?d.push(k(p)):(p.textContent=p.name,d.push((new n).resolve(p)))}),n.all(d).then(function(a){return r=new p(a)})):(new n).resolve(r)},
getPageLinksInfo:function(a,d){return e(a,d).then(function(a){return new q(a)})},getOrionHome:d}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
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(m,n,l,f,b,h,g,d,a,k){function e(a){var e={};a.getPropertyKeys().forEach(function(d){e[d]=a.getProperty(d)});return e}var p={},q=a.getOrionHome();p._cloneItemWithoutChildren=function t(a){if(null===a||"object"!==typeof a)return a;var e=a.constructor(),d;for(d in a)"children"!==d&&"Children"!==
d&&(e[d]=t(a[d]));return e};p._getOpenWithNavCommandExtensions=function(a,e){function d(a,e){for(var b=a.getServiceReferences("orion.navigate.openWith"),k=[],s=[],p=0;p<b.length;p++){var g=b[p];if(g.getProperty("editor")===e.id){var B=g.getProperty("contentType");B instanceof Array?k=k.concat(B):k.push(B||"*/*");g=g.getProperty("excludedContentTypes");g instanceof Array?s=s.concat(g):null!==g&&"undefined"!==typeof g&&s.push(g)}}0===k.length&&(k=null);0===s.length&&(s=null);return{contentTypes:k,excludedContentTypes:s}}
for(var b=function(){for(var e=a.getServiceReferences("orion.edit.editor"),d=[],b=0;b<e.length;b++){var k=e[b],s=k.getProperty("id");d.push({id:s,"default":k.getProperty("default")||!1,name:k.getProperty("name"),nameKey:k.getProperty("nameKey"),nls:k.getProperty("nls"),uriTemplate:k.getProperty("orionTemplate")||k.getProperty("uriTemplate"),validationProperties:k.getProperty("validationProperties")||[]})}return d}(),k=[],p,s=0;s<b.length;s++){var g=b[s],B=d(a,g),B={properties:{name:g.name||g.id,nameKey:g.nameKey,
id:"eclipse.openWithCommand."+g.id,contentType:B.contentTypes,excludedContentTypes:B.excludedContentTypes,uriTemplate:g.uriTemplate,nls:g.nls,forceSingleItem:!0,isEditor:g["default"]?"default":"editor",validationProperties:g.validationProperties},service:{}};"orion.editor"===g.id?p=B:k.push(B)}p&&k.push(p);return k};p._makeValidator=function(a,e,d,k){function p(a,e,d,b,k){var s=!1,g;if("!"===e.charAt(0))return"undefined"===typeof a[e.substring(1)];if("undefined"!==typeof a[e]){if("undefined"===typeof d)g=
a[e],s=!0;else if("string"===typeof d){if(!typeof("string"===a[e]))return!1;if(b.variableName){if(d=RegExp(d).exec(a[e]))s=d[0],g="before"===b.variableMatchPosition?a[e].substring(0,d.index):"after"===b.variableMatchPosition?a[e].substring(d.index+s.length):"only"===b.variableMatchPosition?s:a[e],s=!0}else return RegExp(d).test(a[e])}else a[e]===d&&(g=a[e],s=!0);e=b.variableName;b=b.replacements;if(s&&e&&(k[e]=g,k.itemCached=a,b)){if("string"!==typeof g)return window.console.log("Cannot replace "+
e+", value is not a string: "+g),s;for(a=0;a<b.length;a++){g=!1;if(b[a].pattern){d=b[a].pattern;var f=b[a].replacement||"";k[e]=k[e].replace(RegExp(d),f).replace(RegExp(d),f)}else g=!0;g&&window.console.log("Invalid replacements specified in validation property.  "+b[a])}}return s}return!1}function g(a,e,d,b){var k=d.match,s,f;if(0<=(s=e.indexOf("["))){if(0>(f=e.indexOf("]")))return!1;var q=e.substring(0,s),h;if(!(h=a[q])||!Array.isArray(h))return!1;s=e.substring(s+1,f);s=parseInt(s,10);if(isNaN(s))return!1;
0>s&&(s+=h.length);e=e.substring(f+1);e=q+":"+String(s)+e}return 0<=e.indexOf("|")?(s=e.substring(0,e.indexOf("|")),e=e.substring(e.indexOf("|")+1),g(a,s,d,b)?!0:g(a,e,d,b)):0<=e.indexOf(":")?(s=e.substring(0,e.indexOf(":")),e=e.substring(e.indexOf(":")+1),a[s]?g(a[s],e,d,b):!1):p(a,e,k,d,b)}function s(e,d,k){if(k.info.validationProperties)for(var s=0;s<k.info.validationProperties.length;s++){var p=k.info.validationProperties[s];if("undefined"!==typeof p.source){if(!g(e,p.source,p,k))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var s=!0,f=d?b.getFilenameContentType(e.Name,d):null,f=f||{id:"application/octet-stream"};k.info.excludedContentTypes&&d&&(s=k.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==f.id.search(a)?!1:!0}));s&&(k.info.contentType&&d)&&(s=k.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==f.id.search(a)?!0:!1}));return s}return{info:a,validationFunction:function(a){"function"===typeof k&&(a=k.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 e=0;e<a.length;e++)if(!s(a[e],d,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var e={},d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(e[d]=a[d]);if(this.info.validationProperties)for(d=0;d<this.info.validationProperties.length;d++){var b=this.info.validationProperties[d];
b.source&&b.variableName&&(this.itemCached===a&&this[b.variableName]||g(a,b.source,b,this),a[b.variableName]?window.console.log("Variable name "+b.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):e[b.variableName]=this[b.variableName])}e.OrionHome=q;return(new h(this.info.uriTemplate)).expand(e)}return null}}};var x=k.UnnamedCommand;p._createCommandOptions=function(a,e,d,b,k,f){function s(s,g){var q=p._makeValidator(a,d,b,f);s.visibleWhen=
q.validationFunction.bind(q);if(k)if(q.generatesURI.bind(q)())s.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return q.getURI.bind(q)(a)};else{var B=a;s.callback=function(a){var b;if(B.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,b=p._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){b=[];for(var k=0;k<a.items.length;k++)b.push(p._cloneItemWithoutChildren(a.items[k]))}else b=p._cloneItemWithoutChildren(a.items);if(d)var g=d.getService("orion.page.progress");
e.run?g?g.progress(e.run(b),"Running command: "+s.name):e.run(b):d&&(g?g.progress(d.getService(e).run(b),"Running command: "+s.name):d.getService(e).run(b))}}g.resolve(s)}var q=new n;if(a.nls){var B=function(e){var d;e?(d=a.tooltipKey&&e[a.tooltipKey],e=a.nameKey&&e[a.nameKey]||a.name||x,d=d||a.tooltip||""):(e=a.name||a.nameKey||x,d=a.tooltip||a.tooltipKey||"");s({name:e,image:a.image,id:a.id||a.name,tooltip:d,isEditor:a.isEditor,showGlobally:a.showGlobally},q)};g.getMessageBundle(a.nls).then(B,B.bind(this,
null))}else s({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},q);return q};p.getOpenWithCommand=function(a,e,d){var b;a=d||p.getOpenWithCommands(a);for(d=0;d<a.length;d++)if(a[d].visibleWhen(e)){var k="default"===a[d].isEditor;if(!b||k)if(b=a[d],k)break}return b};p.getOpenWithCommands=function(a){var e=[],d;for(d in a._commandList){var b=a._commandList[d];b.isEditor&&e.push(b)}return e};var r;p.createAndPlaceFileCommandsExtension=function(a,
e,d,b,g,f){return p.createFileCommands(a,null,f?"all":void 0,!!f,e).then(function(a){g&&0<a.length&&(e.addCommandGroup(d,"eclipse.openWith",1E3,k.OpenWith,g,null,null,null,"dropdownSelection"),e.addCommandGroup(d,"eclipse.fileCommandExtensions",1E3,k.OpenRelated,g));a.forEach(function(a){var k=null;g&&(k=a.isEditor?g+"/eclipse.openWith":g+"/eclipse.fileCommandExtensions");e.registerCommandContribution(d,a.id,b,k)});return{}})};p.createFileCommands=function(a,e,d,b,k){d=void 0===d?"global":d;b=void 0===
b?!0:b;var g=[];p._cachedFileCommands||p._createCachedFileCommands(a);("all"===d||"global"===d)&&p._cachedFileCommands.forEach(function(a){var e=a.properties;("all"===d||e.forceSingleItem&&e.showGlobally)&&g.push(a)});return n.when(function(){var d=a.getService("orion.core.contentTypeRegistry")||e;return r||n.when(d.getContentTypes(),function(a){return r=a})}(),function(){b&&(p._cachedOpenWithExtensions||(p._cachedOpenWithExtensions=p._getOpenWithNavCommandExtensions(a,r)),g=g.concat(p._cachedOpenWithExtensions),
k._addedOpenWithCommands=b);var e=g.map(function(e){var d=e.properties;e=e.service;var b=k.findCommand(d.id||d.name);return b?(new n).resolve(b):p._createCommandOptions(d,e,a,r,!0).then(function(a){a=new l.Command(a);k.addCommand(a);return a})});return n.all(e,function(a){return{_error:a}}).then(function(a){return a})})};p._createCachedFileCommands=function(a){var d=a.getServiceReferences("orion.navigate.command");p._cachedFileCommands=[];for(var b=0;b<d.length;b++)if("orion.navigateFromMetadata"!==
d[b].getProperty("id")){var k=a.getService(d[b]),g=e(d[b]);p._cachedFileCommands.push({properties:g,service:k})}};p.getFileCommandIds=function(){var a=[];if(p._cachedFileCommands)p._cachedFileCommands.length&&(a=p._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};p.createOpenWithCommands=function(a,e,d){return d&&d._addedOpenWithCommands?(new n).resolve(p.getOpenWithCommands(d)):p.createFileCommands(a,e,
"none",!0,d)};return p});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(m,n){function l(f){this._init(f)}l.prototype={_init:function(f){var b=n.node(f.container);if(!b)throw"no parent container";this._container=b;b.classList.remove("currentLocation");this._id=f.id||"eclipse.breadcrumbs";this._resource=f.resource||null;this._rootSegmentName=f.rootSegmentName;this._workspaceRootSegmentName=f.workspaceRootSegmentName;this._workspaceRootURL=f.workspaceRootURL;this._makeHref=f.makeHref;this._makeFinalHref=
f.makeFinalHref;this._maxLength=f.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var f;if(this._resource&&this._resource.Parents&&!this._resource.skip){f=document.createElement("a");var b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(f,b):f.href=m.toUrl("edit/edit.html")+"#"+b}else f=document.createElement("span");n.empty(f);f.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return f}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(f){var b=document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(f));return b},addSegmentHref:function(f,b){this._makeHref?this._makeHref(f,b.Location,b):f.href=m.toUrl("edit/edit.html")+"#"+b.ChildrenLocation},buildSegments:function(f,b){if(this._resource.Parents){var h=this._resource.Parents.slice(0),g,d;h&&(h=h.slice(0),"reverse"===b&&(h=h.reverse().slice(0)),
h.forEach(function(a){a.skip||(f?(d=f,f=null):d=a.Name,g=this.buildSegment(d),this.path+=a.Name,this.addSegmentHref(g,a),g.include=!1,this.segments.push(g))}.bind(this)))}},addDivider:function(){var f=document.createElement("span");f.appendChild(document.createTextNode(" / "));this.path+="/";f.classList.add("breadcrumbSeparator");this.append(f)},refresh:function(){(this.crumbs=n.node(this._id))?n.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(f){this.crumbs.appendChild(f)},addTitle:function(f,b){var h=b||document.title;0===this.crumbs.childNodes.length&&(f=document.createElement("span"),f.appendChild(document.createTextNode(h)),
f.classList.add("breadcrumb"),f.classList.add("currentLocation"),this.append(f))},finalSegment:function(f,b){if(!this._resource.skip){var h;h=b?b:this._resource.Name;this._makeFinalHref?(f=this.buildSegment(h),this.addSegmentHref(f,this._resource)):(f=document.createElement("span"),f.appendChild(document.createTextNode(h)));f.classList.add("currentLocation");this.path+=this._resource.Name;this.append(f)}},firstSegment:function(f){f&&(this.append(f),this._resource&&this._resource.Parents&&!this._resource.skip?
(f.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(f.href=""),f.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(f){!0===f.include&&(this.append(f),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var f=this.segments.slice(0).reverse();f.forEach(function(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=f.reverse()}},measure:function(){var f=this._container;f.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:f.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var f=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;b?this.addTitle(f,b):(this.finalSegment(f,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"reverse"),this.measureSegments(),this.firstSegment(f)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var f=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;b?this.addTitle(f,b):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(f),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(f,b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};l.prototype.constructor=l;return{BreadCrumbs:l}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(m,n,l){function f(b){m.attach(this);this._init(b)}f.prototype={_init:function(b){this._tracking=null;this._animationDelay=501;this._closeReversely=b.closeReversely;this.$node=l.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=l.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=l.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=b.vertical||!1;var f=this.$node.classList;f.add("split");f.add(this._vertical?"splitVerticalLayout":"splitLayout");f=this.$sideNode.classList;f.add("hasSplit");f.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");f=this.$mainNode.classList;f.add("hasSplit");f.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";n.isIOS||n.isAndroid?(this.$node.addEventListener("touchstart",this._touchStart.bind(this),!1),this._thumb&&this._thumb.addEventListener("touchstart",this._touchStart.bind(this),!1),this.$node.addEventListener("touchmove",this._touchMove.bind(this),!1),this.$node.addEventListener("touchend",this._touchEnd.bind(this),!1)):(this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1),window.addEventListener("mouseup",this._mouseUp.bind(this),!1));window.addEventListener("resize",this._resize.bind(this),
!1)},isClosed:function(){return this._closed},getOrientation:function(){return this._vertical?"vertical":"horizontal"},setOrientation:function(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(f){b(f.node)})},_initializeFromStoredSettings:function(){var b=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof b?"closed"===b:this._closeByDefault;var b=l.bounds(this.$node.parentNode),f=l.bounds(this.$node),g;this._vertical?(g=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(g,10),this._splitTop>b.top+b.height-f.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-f.width&&(this._splitLeft=b.left+b.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var b=l.bounds(this.$node),f=l.bounds(this.$node.parentNode);return this.vertical?b.top-f.top:b.left-f.left},
_adjustToSplitPosition:function(b){var f=l.bounds(this.$node),g=l.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=f.height;if(b||!this._splitTop)this._splitTop=f.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=f.width;if(b||!this._splitLeft)this._splitLeft=f.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,f,g){b=b||0;var d=l.bounds(this.$node.parentNode),a=l.bounds(this.$node);this._vertical?(void 0===g&&(g=a.top-d.top),g+=a.height,this.$mainNode.style.top=g+"px"):(void 0===f&&(f=a.left-d.left),f+=a.width,this.$mainNode.style.left=f+"px");var k=this;window.setTimeout(function(){k._notifyResizeListeners(k.$mainNode);
k._notifyResizeListeners(k.$sideNode)},b)},_notifyResizeListeners:function(b){this.dispatchEvent({type:"resize",node:b})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(b,f){b||this._addAnimation();var g=this._splitTop,d=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(g=d=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=l.bounds(this.$node.parentNode),
k=l.bounds(this.$node);this._vertical?g=a.height-k.height:d=a.width-k.width}else g=d=0;this._vertical?(this.$sideNode.style.height=g+"px",this.$node.style.top=g+"px"):(this.$sideNode.style.width=d+"px",this.$node.style.left=d+"px");this._resize(this._animationDelay,d,g);b||this._removeAnimation();f||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var e=this;window.setTimeout(function(){e._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,f){var g=l.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=f;this._splitTop<g.top+5?this._splitTop=g.top+5:this._splitTop>g.top+g.height-5&&(this._splitTop=g.top+
g.height-5);var d=this._splitTop,d=this._splitTop-g.top;this.$node.style.top=d+"px"}else this._splitLeft=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),d=this._splitLeft,d=this._splitLeft-g.left,this.$node.style.left=d+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(b){if(b.target===
this._thumb)return l.stop(b),this._thumbDown();this._tracking||(this._down(b),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),l.setFramesEnabled(!1),l.stop(b))},_mouseMove:function(b){this._tracking&&this._move(b.clientX,b.clientY)},_mouseUp:function(b){this._tracking&&(l.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),l.stop(b))},_touchStart:function(b){if(1===b.touches.length){l.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())}};f.prototype.constructor=f;return{Splitter:f,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(m,n,l){function f(b){this.commandRegistry=b.commandRegistry;this.create();this._filterString="";this._providers=[]}f.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 f=this._keyAssistInput=document.createElement("input");
f.classList.add("keyAssistInput");f.type="text";f.placeholder=m["Filter bindings"];b.appendChild(f);var g=this._keyAssistContents=document.createElement("div");g.classList.add("keyAssistContents");if(l.isIOS||l.isAndroid)g.style.overflowY="auto";b.appendChild(g);var d=this._keyAssistTable=document.createElement("table");d.tabIndex=0;d.classList.add("keyAssistList");g.appendChild(d);document.body.appendChild(b);f.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));f.addEventListener("input",function(a){this.filterChanged()}.bind(this));g.addEventListener(l.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&this.hide()}.bind(this));n.addAutoDismiss([b],function(){this.hide()}.bind(this))},createContents:function(){n.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(m.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(b,f,g){if(this._filterString){var d=this._filterString.toLowerCase(),a;d!==this._filterString?(d=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(f).indexOf(d)&&-1===a(b).indexOf(d)&&-1===a(this._lastHeader).indexOf(d))return}var k=this._keyAssistTable.insertRow(-1);
k.id="keyAssist-keyBinding-"+this._idCount++;k.setAttribute("role","menuitem");k._execute=g;k.classList.add("keyAssistItem");k.addEventListener("click",function(a){this._selectedRow=k;this.execute();a.preventDefault()}.bind(this));g=k.insertCell(-1);g.classList.add("keyAssistName");g.appendChild(document.createTextNode(f));g=k.insertCell(-1);g.classList.add("keyAssistAccel");g.appendChild(document.createTextNode(b))},createHeader:function(b){this._lastHeader=b;var f=this._keyAssistTable.insertRow(-1);
f.classList.add("keyAssistSection");var f=f.insertCell(-1),g=document.createElement("h2");g.appendChild(document.createTextNode(b));f.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,f=this._keyAssistDiv,b=f===b||0!==(f.compareDocumentPosition(b)&16);f.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 f=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===f.length)this._selectedIndex=-1;else{var g=this._selectedIndex,g=(g+(b?1:-1))%f.length;0>g&&(g=f.length-1);-1!==this._selectedIndex&&(b=f[this._selectedIndex],b.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=g;if(-1!==this._selectedIndex){this._selectedRow=b=f[this._selectedIndex];b.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",b.id);this._keyAssistTable.focus();
var f=b.getBoundingClientRect(),d=this._keyAssistContents,a=d.getBoundingClientRect();b.offsetTop<d.scrollTop?0===g?d.scrollTop=0:b.scrollIntoView(!0):f.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 f=0,f=l.isIE||l.isOpera?-b.wheelDelta:l.isFirefox?40*b.detail:-b.wheelDeltaY,g=this._keyAssistContents,d=g.scrollTop;g.scrollTop+=f;if(d!==g.scrollTop)return b.preventDefault&&b.preventDefault(),!1}};return{KeyAssistPanel:f}});
define("orion/widgets/themes/ThemePreferences",[],function(){function m(m,l){this._preferences=m;this._themeData=l;var f=l.getThemeStorageInfo();this._themeVersion=f.version;var b=m.listenForChangedSettings(f.storage,2,function(f){f.key===b&&this.apply()}.bind(this))}m.prototype={_initialize:function(m,l,f){var b,h;void 0===this._themeVersion||f.get("version")===this._themeVersion?(b=f.get(m.styleset),(h=f.get("selected"))&&(h=JSON.parse(h))):h=b=null;b||(b=l.getStyles(),f.put(m.styleset,JSON.stringify(b)));
if(!h||void 0===h[m.selectedKey])h=h||{},h[m.selectedKey]=m.defaultTheme,f.put("selected",JSON.stringify(h));f.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(m){var l=this._themeData,f=l.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(b){this._initialize(f,l,b);var h=JSON.parse(b.get("selected"));b=JSON.parse(b.get(f.styleset));var g;if(b)for(var d=0;d<b.length;d++)if(b[d].name===h[f.selectedKey]){g=b[d];break}m({style:g,styles:b})}.bind(this))},
setTheme:function(m,l){var f=this._themeData,b=f.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(h){this._initialize(b,f,h);var g=JSON.parse(h.get("selected"));m||(m=g[b.selectedKey]);g[b.selectedKey]=m;h.put("selected",JSON.stringify(g));l?h.put(b.styleset,JSON.stringify(l)):l=JSON.parse(h.get(b.styleset));for(var d=0;d<l.length;d++)if(l[d].name===g[b.selectedKey]){f.processSettings(l[d]);break}h.put("version",this._themeVersion)}.bind(this))},setFontSize:function(m){var l=
this._themeData,f=l.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(b){this._initialize(f,l,b);var h=JSON.parse(b.get("selected")),g=JSON.parse(b.get(f.styleset)),d;if(g)for(var a=0;a<g.length;a++)g[a].fontSize=m,g[a].name===h[f.selectedKey]&&(d=g[a]);b.put(f.styleset,JSON.stringify(g));l.processSettings(d)}.bind(this))}};return{ThemePreferences:m}});
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(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/editor/eventTarget",[],function(){function m(){}m.addMixin=function(n){var l=m.prototype,f;for(f in l)l.hasOwnProperty(f)&&(n[f]=l[f])};m.prototype={addEventListener:function(m,l,f){this._eventTypes||(this._eventTypes={});var b=this._eventTypes[m];b||(b=this._eventTypes[m]={level:0,listeners:[]});b.listeners.push({listener:l,useCapture:f})},dispatchEvent:function(m){var l=m.type;this._dispatchEvent("pre"+l,m);this._dispatchEvent(l,m);this._dispatchEvent("post"+l,m)},_dispatchEvent:function(m,
l){var f=this._eventTypes?this._eventTypes[m]:null;if(f){var b=f.listeners;try{if(f.level++,b)for(var h=0,g=b.length;h<g;h++)if(b[h]){var d=b[h].listener;"function"===typeof d?d.call(this,l):d.handleEvent&&"function"===typeof d.handleEvent&&d.handleEvent(l)}}finally{if(f.level--,f.compact&&0===f.level){for(h=b.length-1;0<=h;h--)b[h]||b.splice(h,1);0===b.length&&delete this._eventTypes[m];f.compact=!1}}}},isListening:function(m){return!this._eventTypes?!1:void 0!==this._eventTypes[m]},removeEventListener:function(m,
l,f){if(this._eventTypes){var b=this._eventTypes[m];if(b){for(var h=b.listeners,g=0,d=h.length;g<d;g++){var a=h[g];if(a&&a.listener===l&&a.useCapture===f){0!==b.level?(h[g]=null,b.compact=!0):h.splice(g,1);break}}0===h.length&&delete this._eventTypes[m]}}}};return{EventTarget:m}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(m,n,l){function f(b){b=b||{};this._document=b.document||document}var b={};f.getTheme=function(h){h=h||"default";var g=b[h];g||(g=b[h]=new f);return g};f.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,g){var d=this,a=d._themeClass;d._themeClass=b;this._load(b,g,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:d.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,g){function d(d,e,p){e&&(a.push("."+b+" ."+d+" {"),a.push("\t"+(p?"background-color":"color")+": "+e+";"),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("}");d("ruler.annotations",g.annotationRuler,!0);d("ruler.lines",g.annotationRuler,!0);d("ruler.folding",g.annotationRuler,!0);d("ruler.overview",g.overviewRuler,!0);d("rulerLines",g.lineNumber,!1);d("rulerLines.even",g.lineNumberEven,!1);d("rulerLines.odd",g.lineNumberOdd,!1);d("annotationLine.currentLine",g.currentLine,
!0);d("entity-name-tag",g.keyword,!1);d("entity-other-attribute-name",g.attribute,!1);d("string-quoted",g.string,!1);d("meta.annotation.currentLine",g.currentLine,!0);d("keyword",g.keyword,!1);d("string",g.string,!1);d("constant",g.constant,!1);d("comment",g.comment,!1);d("comment.block.documentation",g.comment,!1);d("keyword.other.documentation.markup",g.comment,!1);d("keyword.other.documentation.markup",g.comment,!1);return a.join("\n")},_createStyle:function(b,g,d,a){var k=this._document;b="orion-theme-"+
b;var e=k.getElementById(b);if(e){if(a||e.firstChild.data===g)return;e.removeChild(e.firstChild);e.appendChild(k.createTextNode(g))}else a?(e=l.createElement(k,"link"),e.rel="stylesheet",e.type="text/css",e.href=g,e.addEventListener("load",function(){d()})):(e=l.createElement(k,"style"),e.appendChild(k.createTextNode(g))),e.id=b,(k.getElementsByTagName("head")[0]||k.documentElement).appendChild(e);a||d()},_load:function(b,g,d){if(b)if("string"===typeof g)this._createStyle(b,g,d);else if(g=g.href,
".css"!==g.substring(g.length-4)&&(g+=".css"),/^\//.test(g)||/[a-zA-Z0-9]+:\/\//i.test(g)||!m.toUrl)this._createStyle(b,g,d,!0);else{var a=this;m(["text!"+g],function(k){a._createStyle(b,k,d,!1)})}else d()}};n.EventTarget.addMixin(f.prototype);return{TextTheme:f}});
define("orion/widgets/themes/ThemeClass",[],function(){function m(m){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=m;this.classString="."+m+"{ "}m.prototype.className=null;m.prototype.classString=void 0;m.prototype.style=void 0;m.prototype.closeString=" }\n";m.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:m}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(m){function n(){}n.prototype.navbar="white";n.prototype.button="#777777";n.prototype.location="#EFEFEF";n.prototype.selection="#cedce7";n.prototype.sidepanel="#F7F7F7";n.prototype.mainpanel="white";n.prototype.navtext="#bfbfbf";n.prototype.content="#3087B3";n.prototype.search="#444";n.prototype.toolpanel="white";n.prototype.writeNavigationStyle=function(){var l="",f=[],b=new m.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";f.push(b);b=new m.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";f.push(b);b=new m.ThemeClass("a");b.style.textDecoration="none";b.style.color=
this.content;f.push(b);b=new m.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;b.style.verticalAlign="bottom";f.push(b);b=new m.ThemeClass("primaryNav");b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";f.push(b);b=new m.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";f.push(b);b=new m.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";b.style.fontWeight="normal";f.push(b);for(var h in f)l+=f[h].toString();return l};n.prototype.writeLocationStyle=function(){var l="",f=[],b=new m.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";f.push(b);b=new m.ThemeClass("breadcrumb");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";f.push(b);b=new m.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";f.push(b);b=new m.ThemeClass("breadcrumbSeparator");b.style.fontSize=
"8pt";b.style.textDecoration="none";b.style.color=this.separator;b.style.fontWeight="bold";f.push(b);b=new m.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";f.push(b);b=new m.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";f.push(b);b=new m.ThemeClass("navlinkonpage");
b.style.color=this.content;b.style.verticalAlign="middle";f.push(b);this.bannerProgress&&(b=new m.ThemeClass("topRowBanner .progressPane_running"),b.style.borderColor=this.bannerProgress,f.push(b));for(var h in f)l+=f[h].toString();return l};n.prototype.writeButtonStyle=function(){var l="",f=[],b=new m.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";f.push(b);b=new m.ThemeClass("commandButton:over");b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";f.push(b);b=new m.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";f.push(b);b=new m.ThemeClass("commandMenuItem");b.style.border="0";b.style.padding="0";b.style.margin="0";f.push(b);for(var h in f)l+=f[h].toString();return l};n.prototype.writeMainStyle=function(){var l="",f=[],b=new m.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";f.push(b);b=new m.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline=
"none";f.push(b);b=new m.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";f.push(b);b=new m.ThemeClass("navbar-item-selected");b.style.background=this.selection;b.style.color=this.content;f.push(b);b=new m.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;f.push(b);b=new m.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;f.push(b);b=new m.ThemeClass("mainToolbar");b.style.background=this.toolpanel;f.push(b);
for(var h in f)l+=f[h].toString();return l};n.prototype.render=function(l){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};n.prototype.getSheet=function(l){l.navbar.value?(this.navbar=l.navbar.value,this.button=l.button.value,this.location=l.location.value,this.selection=l.selection.value,this.sidepanel=l.sidepanel.value,this.mainpanel=l.mainpanel.value,this.navtext=l.navtext.value,this.search=
l.search.value,this.content=l.content.value,this.toolpanel=l.toolpanel.value,this.bannerProgress=l.bannerProgress.value):(this.navbar=l.navbar,this.button=l.button,this.location=l.location,this.selection=l.selection,this.sidepanel=l.sidepanel,this.mainpanel=l.mainpanel,this.navtext=l.navtext,this.search=l.search,this.content=l.content,this.toolpanel=l.toolpanel,this.bannerProgress=l.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:n}});define("orion/widgets/themes/ThemeVersion",[],function(){return"6.1"});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter","orion/widgets/themes/ThemeVersion"],function(m,n,l,f){function b(){}function h(){this.styles=[];var d=new b;d.name="Orion";d.navbar="white";d.button="#EFEFEF";d.location="#efefef";d.selection="FEC";d.sidepanel="#FBFBFB";d.mainpanel="white";d.toolpanel="white";d.navtext="#bfbfbf";d.content="#3087B3";d.search="#444";d.breadcrumb="#3087B3";
d.separator="#333";d.bannerProgress="whitesmoke";this.styles.push(d);d=new b;d.name="Orion2014";d.navbar="white";d.button="#EFEFEF";d.location="#EFEFEF";d.selection="FEC";d.sidepanel="#EEEEEE";d.mainpanel="#EEEEEE";d.toolpanel="#EEEEEE";d.navtext="#BFBFBF";d.content="#333333";d.search="#444444";d.breadcrumb="#333333";d.separator="#333333";d.bannerProgress="orange";this.styles.push(d);d=new b;d.name="Green Zone";d.navbar="seagreen";d.button="lavender";d.location="darkseagreen";d.selection="moccasin";
d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="darkgreen";d.search="darkgreen";d.breadcrumb="#3087B3";d.separator="seagreen";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new b;d.name="Pretty In Pink";d.navbar="plum";d.button="lavender";d.location="pink";d.selection="lavender";d.sidepanel="seashell";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumorchid";d.search="violet";d.breadcrumb="#3087B3";d.separator="plum";d.bannerProgress=
"#F2F2F2";this.styles.push(d);d=new b;d.name="Blue Monday";d.navbar="cornflowerblue";d.button="lavender";d.location="skyblue";d.selection="lavender";d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="royalblue";d.search="royalblue";d.breadcrumb="#3087B3";d.separator="cornflowerblue";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new b;d.name="Vanilla Skies";d.navbar="sandybrown";d.button="lemmonchiffon";d.location="cornsilk";d.selection="lemonchiffon";
d.sidepanel="white";d.mainpanel="white";d.toolpanel="white";d.navtext="lemonchiffon";d.content="chocolate";d.search="moccasin";d.breadcrumb="#3087B3";d.separator="sandybrown";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new b;d.name="Beetlejuice";d.navbar="indigo";d.button="slateblue";d.location="darkslateblue";d.selection="silver";d.sidepanel="lavender";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumslateblue";d.search="#444";d.breadcrumb="#3087B3";d.separator="indigo";
d.bannerProgress="#F2F2F2";this.styles.push(d);d=new b;d.name="Red";d.navbar="#CD2127";d.button="#777777";d.location="#D85F56";d.selection="lightcoral";d.sidepanel="#EFDAB2";d.mainpanel="#FDFADD";d.toolpanel="#FDFADD";d.navtext="#FBFBFB";d.content="darkred";d.search="#D85F56";d.breadcrumb="darkred";d.separator="#CD2127";d.bannerProgress="#F2F2F2";this.styles.push(d)}function g(){return this.styles}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:f}};
h.prototype.getViewData=function(){var d={top:10,left:10,width:350,height:350};d.shapes=[{type:"RECTANGLE",name:m["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:m["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:m["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:m["Tool Panel"],x:150,y:71,width:209,height:30,
family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:m["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:m.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:m["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:m.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},
{type:"TEXT",name:m.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:m.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:m["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:m.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:m["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:m["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:m["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:m["Line Color"],x1:150,
y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:m["Line Color"],x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:m["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:m["Navigation Text"],label:"Navigator",
x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var a=0;3>a;a++)d.shapes.push({type:"TEXT",name:m.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TEXT",name:m.Content,label:"Item",
x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+20*a,x2:165,y2:124+20*a,x3:160,y3:127+20*a,family:"navbar",fill:"#333"});d.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return d};h.prototype.processSettings=function(d){var a=new l.ThemeSheetWriter;(new n.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(d))};return{ThemeData:h,getStyles:g}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",Properties:"Properties",
" (Service Id: ":" (Service Id: ",Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links",Yes:"Yes",No:"No","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(m){function n(l,f,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===f?(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),m.addAutoDismiss([this.container],this.destroy.bind(this))):l.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}n.prototype.elementNode=null;n.prototype.switchesContainer=null;n.prototype.switches=null;n.prototype.radioButtons=null;n.prototype.chosenSwitch=
null;n.prototype.addElement=function(l){var f=document.createElement("span");f.className="UAContainer-icon";f.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";f.onmouseover=function(){document.getElementById(l.label+"ImageNode").src=l.secondaryImage;
document.getElementById(l.label+"LabelNode").className="UALabel-live";f.className="UAContainer-icon-live"};f.onmouseout=function(){document.getElementById(l.label+"ImageNode").src=l.image;document.getElementById(l.label+"LabelNode").className="UALabel";f.className="UAContainer-icon"};var b=this;f.onclick=function(){b.showMedia(l)};this.elementNode.appendChild(f)};n.prototype.clearElements=function(){this.elementNode.innerHTML=""};n.prototype.showMedia=function(l){this.clearElements();this.addElement(l);
var f=document.createElement("span");f.className="UAContainer-media";f.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(f);setTimeout(function(){f.style.opacity=1},100);l=document.getElementById(l.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=l.parentNode;l.className="chosenCircle"};n.prototype.createSwitch=
function(l){var f;f=l?l.label+"switch":"indexSwitch";var b=document.createElement("span");b.className="workingSpan";b.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+f+'"\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};n.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};n.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return n});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(m,n,l,f){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 d=document.createRange();d.selectNode(b);d=d.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(d);this.$frame=b.lastChild;this.title&&l.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=l.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(d){a.hide()},!1);this.$parent=l.$(".dialogContent",this.$frame);d=document.createRange();d.selectNode(this.$parent);
b=d.createContextualFragment(this.TEMPLATE);this.messages&&l.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=l.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(d){d.keyCode===l.KEY.ESCAPE?a.hide():d.keyCode===l.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(d){var a=f.createButton(d.text,d.callback);d.id&&(a.id=d.id,b["$"+a.id]=a);d.isDefault&&(b._defaultCallback=d.callback,b._defaultButton=a);b.$buttonContainer.appendChild(a)})}},_makeModal:function(b){var d=this;this.$frame.addEventListener("blur",function(a){d.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var e=!l.contains(d.$frame,a.target);if(e)for(var b=0;b<d.$$modalExclusions.length;b++)if(l.contains(d.$$modalExclusions[b],
a.target)){e=!1;break}e&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),l.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 k=0;k<b.length;k++){for(var e=0;e<this.$$modalExclusions.length;e++)if(l.contains(this.$$modalExclusions[e],b[k])){a=!0;break}!a&&(b[k]!==d.$frame&&b[k].classList&&!b[k].classList.contains("tooltipContainer"))&&
(e=b[k],e.classList.contains("modalBackdrop")||(e.classList.add("modalBackdrop"),this._addedBackdrop.push(e)))}(b=l.lastTabbable(this.$buttonContainer)||l.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===l.KEY.TAB){var e=d._getFirstFocusField();e&&e!==a.target&&e.focus();l.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_inModalExclusion:function(b){return this.$$modalExclusions.some(function(d){return b.$frame===d||
b.$parent===d})},_bindElements:function(b){for(var d=0;d<b.childNodes.length;d++){var a=b.childNodes[d];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");l.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var d=this;this.keepAlive||window.setTimeout(function(){d.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();l.setFramesEnabled(!1);var d=l.bounds(this.$frame),a=l.bounds(document.documentElement),k;b?(k=l.bounds(b),b=k.top+k.height+4,k=k.left+4,b+d.height>a.height&&(b=Math.max(0,a.height-d.height-4)),k+d.width>a.width&&(k=Math.max(0,
a.width-d.width-4))):(k=Math.max(0,(a.width-d.width)/2),b=Math.max(0,(a.height-d.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=k+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return l.firstTabbable(this.$parent)||this._defaultButton||l.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(h===this&&(h=null),l.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(m,n,l,f,b,h,g){function d(a){this._displaySignOut=!0;this._init(a)}d.prototype={_init:function(a){this._dropdownNode=l.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 d=0,e;for(e in a)a.hasOwnProperty(e)&&d++;
return d},_makeMenuItem:function(a,d){var e=g.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&e.classList.add(this._dropDownItemClass);e.addEventListener("click",d,!1);e.addEventListener("keydown",function(a){(a.keyCode===l.KEY.ENTER||a.keyCode===l.KEY.SPACE)&&d()},!1);return e},_renderAuthenticatedService:function(a,d){var e=this,b=this.authenticatedServices[a].authService;if(b&&b.logout&&this._displaySignOut){var g=this._makeMenuItem(m["Sign Out"],
function(){b.logout().then(function(){e.addUserItem(a,b,e.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var d=localStorage.length-1;0<=d;d--){var k=localStorage.key(d);k&&0===k.indexOf("/orion/preferences/user")&&localStorage.removeItem(k)}b.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(g.parentNode)}},renderServices:function(){function a(a){e[a]||(e[a]=d.createDocumentFragment());return e[a]}
var d=document,e=[],b=this._serviceRegistry;f.getPageLinksInfo(b,"orion.page.link.user").then(function(f){this._dropdown?this._dropdown.empty():this._dropdownNode&&l.empty(this._dropdownNode);f.getAllLinks().forEach(function(e){var b,p;if(e.category&&(p=/user\.(\d+)/.exec(e.category)))b=parseInt(p[1],10);if("number"!==typeof b||isNaN(b))b=1;b=a(b);p=d.createElement("li");var g=d.createElement("a");g.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&g.classList.add(this._dropDownItemClass):
g.classList.add("dropdownMenuItem");g.href=e.href;g.textContent=e.textContent;p.appendChild(g);b.appendChild(p);g.addEventListener("keydown",function(a){(a.keyCode===l.KEY.ENTER||a.keyCode===l.KEY.SPACE)&&g.click()},!1)}.bind(this));this.keyAssistFunction&&(f=this._makeMenuItem(m["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem"),f=f.parentNode,a(0).appendChild(f));
if(f=b.getServiceReferences("orion.page.getstarted")[0])f=f.getProperty("data"),f=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,f)).parentNode,a(0).appendChild(f);var h=this;e.sort(function(a,e){return a-e}).forEach(function(a,d){if(d<e.length-1&&!this._noSeparator){var b=g.createSeparator();a.appendChild(b)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var r in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(r)&&this._renderAuthenticatedService(r,
0)}.bind(this))},getStartedDialog:function(a){new b(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,d,e,b){b?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:d,label:e,data:b}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:d,label:e,pending:this.unauthenticatedServices[a].pending}:
{authService:d,label:e});this.renderServices()}};d.prototype.constructor=d;return{UserMenu:d}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(m,n,l,f,b,h){function g(a,d,e){var b="";e&&(b="^");if(b=l.parse("/"+b+a.searchStr+"/"))e=b.pattern,b=b.flags,-1===b.indexOf("i")&&!d.caseSensitive&&(b+="i"),a.regExp={pattern:e,flags:b},a.wildCard=!0}var d={ALL_FILE_TYPE:"*.*",doSearch:function(a,b,e,p){a?(b=e,e=!0,"*"===b&&(b=""),""===b&&(e=p&&p.type!==d.ALL_FILE_TYPE),e&&(a=a.createSearchParams(b,!1,
!1,p),a=d.generateSearchHref(a),window.location=a)):window.alert(m["Can't search: no search service is available"])},generateSearchHelper:function(a,b){var e=a.keyword,p=e,f={};a.fileType&&(a.fileType!==d.ALL_FILE_TYPE&&""===e)&&(p="*."+a.fileType);if(a.regEx)f.searchStr=e,g(f,a,b);else{var h=-1<e.indexOf("*"),r=-1<e.indexOf("?");h&&(e=e.split("*").join(".*"));r&&(e=e.split("?").join("."));!h&&!r&&!a.nameSearch?(f.searchStr=a.caseSensitive?e.split("\\").join(""):e.split("\\").join("").toLowerCase(),
f.wildCard=!1):(f.searchStr=a.caseSensitive?e:e.toLowerCase(),g(f,a,b),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:a,inFileQuery:f,displayedSearchTerm:p}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.nameSearch&&(a.nameSearch=
"true"===a.nameSearch.toLowerCase());void 0!==a.fileNamePatterns&&(a.fileNamePatterns=d.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var d=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,""),d=a.split("/"));return d},copySearchParams:function(a,d){var e={},b;for(b in a)if(void 0!==a[b]&&null!==a[b]&&(d||"replace"!==b))e[b]=a[b];return e},
generateSearchHref:function(a){var b=n.toUrl("search/search.html");a=d.copySearchParams(a,!0);var e=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new h(b+"#{,resource,params*}")).expand({resource:e,params:a}):(new h(b+"#{,resource}")).expand({resource:e})},generateFindURLBinding:function(a,d,e,b,g){a={find:d.searchStr,regEx:d.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof b?b:void 0,atLine:"number"===typeof e?e:void 0};return g?a:","+
(new h("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,d,e){return a.replace(RegExp(d.pattern,d.flags),e)},replaceStringLiteral:function(a,b,e){b=l.parse("/"+b+"/gim");return d.replaceRegEx(a,b,e)},searchOnelineLiteral:function(a,d,e){var b;
b=0;for(var g=!1,f=[];!(b=d.indexOf(a.searchStr,b),0>b);){f.push({startIndex:b,length:a.searchStrLength});g=!0;if(e)break;b+=a.searchStrLength}return g?f:null},findRegExp:function(a,d,e,b){if(!d)return null;e=e||"";e+=(-1===e.indexOf("g")?"g":"")+(-1===e.indexOf("m")?"m":"");var g=null;return(g=RegExp(d,e).exec(a.substring(b)))&&{startIndex:g.index+b,length:g[0].length}},searchOnelineRegEx:function(a,b,e){for(var g=0,f=!1,h=[];;)if(g=d.findRegExp(b,a.regExp.pattern,a.regExp.flags,g)){h.push(g);f=
!0;if(e)break;g=g.startIndex+g.length}else break;return f?h:null},generateNewContents:function(a,b,e,g,f,h){if(g&&b){a||(e.contents=[]);for(var r=0;r<b.length;r++){for(var l=b[r],m=!1,n=!1,w=[],z,y=0,C=0;C<g.children.length;C++)if(g.children[C].lineNumber-1===r){y=C;for(m=0;m<g.children[C].matches.length;m++)!1!==g.children[C+m].checked&&w.push(m);n=0<w.length;z=g.children[C].matches;m=!0;break}if(m){if(n){w=d.replaceCheckedMatches(l,f,z,w,h);l=w.replacedStr;for(m=0;m<g.children[y].matches.length;m++)g.children[y+
m].newMatches=w.newMatches}else for(m=0;m<g.children[y].matches.length;m++)g.children[y+m].newMatches=g.children[y+m].matches;a?e.contents[r]=l:e.contents.push(l)}else a||e.contents.push(l)}}},generateMatchContext:function(a,d,e){var b=[],g=2*a+1,f;d.length<=g?(f=0,a=d.length-1):(f=e-a,0>f?(f=0,a=f+g-1):(a=e+a,a>d.length-1&&(a=d.length-1,f=a-g+1)));for(g=f;g<=a;g++)b.push({context:d[g],current:g===e});return b},splitFile:function(a){for(var d=0,e=0,b=0,g=0,f=[];;){-1!==d&&d<=b&&(d=a.indexOf("\r",
b));-1!==e&&e<=b&&(e=a.indexOf("\n",b));if(-1===e&&-1===d){f.push(a.substring(g));break}var h=1;-1!==d&&-1!==e?d+1===e?(h=2,b=e+1):b=(d<e?d:e)+1:b=-1!==d?d+1:e+1;f.push(a.substring(g,b-h));g=b}return f},searchWithinFile:function(a,b,e,g,f,h){e=d.splitFile(e);f&&(b.contents=e);if(b){b.children=[];for(var r=g=0;r<e.length;r++){var l=e[r];if(l&&0<l.length){var m=h?l:l.toLowerCase();if(m=a.wildCard?d.searchOnelineRegEx(a,m):d.searchOnelineLiteral(a,m)){var n,w=r+1;if(f)for(var z=0;z<m.length;z++)n=z+
1,n={parent:b,checked:b.checked,type:"detail",matches:m,lineNumber:w,matchNumber:n,name:l,location:b.location+"-"+w+"-"+n},b.children.push(n);else n={parent:b,context:d.generateMatchContext(2,e,r),checked:b.checked,type:"detail",matches:m,lineNumber:w,name:l,location:b.location+"-"+w},b.children.push(n);g+=m.length}}}b.totalMatches=g}},replaceCheckedMatches:function(a,d,e,b,g){for(var f=0,h="",l=[],m=0;m<e.length;m++){f!==e[m].startIndex&&(h+=a.substring(f,e[m].startIndex));e[m].length&&(g=e[m].length);
for(var f=!1,n=0;n<b.length;n++)if(b[n]===m){f=!0;break}f?(l.push({startIndex:h.length,length:d.length}),h+=d):(l.push({startIndex:h.length,length:g}),h+=a.substring(e[m].startIndex,e[m].startIndex+g));f=e[m].startIndex+g}f<a.length&&(h+=a.substring(f));return{replacedStr:h,newMatches:l}},fullPathNameByMeta:function(a){var d=a.length,e="";if(0<d)for(d-=1;-1<d;d--)e=e+(""===e?"":"/")+a[d].Name;return e},path2FolderName:function(a,d,e){return a.substring(0,a.length-d.length-(e?0:1))},getOpenSearchPref:function(a,
d){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");d(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:d})})}};return d});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(m,n,l,f,b,h){function g(d,a,b,e){this.registry=d;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=b;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:f.generateSearchHelper(b);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location;this._reportOnCancel=e&&e.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}g.prototype.search=function(d){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=d;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var e=this;this._visitRecursively(this._childrenLocation).then(function(){(!e._cancelled||e._reportOnCancel)&&e._reportResult();e._cancelled&&e._HandleStatus({name:"Cancel"})}.bind(e),function(a){e._reportResult();e._HandleStatus(a)}.bind(e))}.bind(this))};g.prototype.searchName=function(d,a){d&&(this._searchParams=
d,this.searchHelper=f.generateSearchHelper(d,!0));a&&(this.onSearchNameComplete=a);var b=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var e=0;e<this.fileSkeleton.length;e++){var g=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,g,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,g,!0))if(b.push(this.fileSkeleton[e]),b.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:b.length,
docs:b}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};g.prototype.buildSkeleton=function(d,a){this._buildingSkeleton=!0;var b=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var e=this;d();b.getContentTypes().then(function(d){e.contentTypesCache=d;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=!1;a();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};g.prototype._sort=function(d){d.sort(function(a,
d){var e,b;if("Path asc"===this._searchParams.sort){e=a.Location&&a.Location.toLowerCase();e=f.path2FolderName(e,a.Name&&a.Name.toLowerCase(),!0);b=d.Location&&d.Location.toLowerCase();b=f.path2FolderName(b,d.Name&&d.Name.toLowerCase(),!0);if(e<b)return-1;if(e>b)return 1}return this._sortOnNameSingle(a,d)}.bind(this))};g.prototype._HandleStatus=function(d){this._statusService&&"Cancel"===d.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:m["Search cancelled by user"],
Severity:"Warning"}))};g.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};g.prototype._sortOnNameSingle=function(d,a){var b=d.Name&&d.Name.toLowerCase(),e=a.Name&&a.Name.toLowerCase();return b<e?-1:b>e?1:0};g.prototype._fileNameMatches=function(d){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return d.match(a)}));return a};g.prototype._visitRecursively=function(d){var a=[],k=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(d);return(k._progressService?this._progressService.progress(k.fileClient.fetchChildren(d),"Crawling search for children of "+d):k.fileClient.fetchChildren(d)).then(function(e){for(var d=0;d<e.length;d++)if(void 0!==e[d].Directory&&!1===e[d].Directory)if(k._searchOnName)a.push(k._buildSingleSkeleton(e[d]));else if(k._buildSkeletonOnly)a.push(k._buildSingleSkeleton(e[d]));
else{if(!k._cancelled){var g=b.getFilenameContentType(e[d].Name,k.contentTypesCache);if(g&&("text/plain"===g["extends"]||"text/plain"===g.id)&&k._fileNameMatches(e[d].Name))g=k._sniffSearch(e[d]),a.push(g),k._deferredArray.push(g)}}else if(e[d].Location)if(k._cancelled)break;else g=k._visitRecursively(e[d].ChildrenLocation),a.push(g),k._deferredArray.push(g);return h.all(a)})};g.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
f.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};g.prototype._reportSingleHit=function(d){this._cancelled||(d.LastModified=d.LocalTimeStamp,this.fileLocations.push(d),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};g.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(d){d.cancel()})};
g.prototype._sniffSearch=function(d){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(d),this._statusService&&this._statusService.setProgressResult({Message:l.formatMessage(m["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(d.Location),"Reading file "+d.Location):a.fileClient.read(d.Location)).then(function(b){a._hitOnceWithinFile(b)&&
a._reportSingleHit(d);a._statusService&&a._statusService.setProgressResult({Message:l.formatMessage(m["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},m.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};g.prototype._buildSingleSkeleton=function(d){this._totalCounter++;this.fileSkeleton.push(d);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();d=new h;d.resolve(this._totalCounter);
return d};g.prototype.constructor=g;return{SearchCrawler:g}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(m,n,l,f,b,h,g){function d(a){this._init(a)}d.prototype=new g.Dialog;d.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+f.toUrl("../../../images/progress_running.gif")+
'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';d.prototype._init=function(a){this.title=a.title||m["Find File Named"];this.modal=!0;this.messages=m;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new l.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(m["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(m["Missing required argument: searchRenderer"]);this._initialize()};d.prototype._bindToDom=function(a){var d=this;d.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",m["FileName FolderName"]):this.$fileName.setAttribute("placeholder",m.Search);this.$fileName.addEventListener("input",function(a){d._time=+new Date;d._timeoutId&&clearTimeout(d._timeoutId);d._timeoutId=setTimeout(d.checkSearch.bind(d),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var g=b.$("a",d.$results);g&&(b.stop(a),(h.isMac?a.metaKey:a.ctrlKey)?window.open(g.href):(window.location.href=g.href,d.hide()))}},!1);a.addEventListener("keydown",function(a){var g,f,h;if(a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.UP)g=b.$$array("a",d.$results),f=document.activeElement,h=g.indexOf(f),a.keyCode===b.KEY.DOWN?0<=h?(f.classList.remove("treeIterationCursor"),g=h<g.length-1?g[h+1]:g[0],g.focus(),
g.classList.add("treeIterationCursor")):0<g.length&&(g=g[0],g.focus(),g.classList.add("treeIterationCursor")):0<=h?(f.classList.remove("treeIterationCursor"),f=d.$fileName,g=0<h?g[h-1]:f,g.focus(),0<h&&g.classList.add("treeIterationCursor")):0<g.length&&(g[g.length-1].focus(),g[g.length-1].classList.add("treeIterationCursor")),b.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(d._forceUseCrawler||!d._fileService.getService(d._searcher.getSearchLocation()).search){var a=
d._searchOnRoot?d._searcher.getSearchRootLocation():d._searcher.getChildrenLocation(),a=new n.SearchCrawler(d._searcher.registry,d._fileService,"",{searchOnName:!0,location:a});d._searcher.setCrawler(a);a.buildSkeleton(function(){d.$crawlingProgress.style.display="inline";d.$progress.appendChild(document.createTextNode(m["Building file skeleton..."]))},function(){d.$crawlingProgress.style.display="none";d.$progress.removeChild(d.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};d.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};d.prototype._detectFolderKeyword=function(a){var d,e=a,b=null;if(this._nameSearch&&(d=/(\S+)\s*(.*)/,(a=d.exec(a))&&3===a.length))a[1]&&
(e=a[1]),a[2]&&(b=a[2]);return{keyword:e,folderKeyword:b}};d.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var d=this._detectFolderKeyword(a),e=this._searcher.createSearchParams(d.keyword,this._nameSearch,this._searchOnRoot),g=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=g;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?m["Searching..."]:h.formatMessage(m["Searching for occurrences of"],
a)));b.empty(this.$results);this.$results.appendChild(f);this._searcher.search(e,d.folderKeyword,function(){g===this.currentSearch&&g.apply(null,arguments)}.bind(this))}};d.prototype.decorateResult=function(a){function d(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&e.hide()}var e=this;a=b.$$array("a",a);for(var g=0;g<a.length;g++)a[g].addEventListener("click",d,!1)};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype._afterHiding=function(){this._onHide&&this._onHide()};
d.prototype.constructor=d;return{OpenResourceDialog:d}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(m,n){function l(f,b,h){if(f=n.node(f))this._parent=f;else throw Error("Parent node of dropdown menu not found");this.options=h=h||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=h.selectionClass;f=document.createElement("div");f.classList.add("dropdownMenu");f.classList.add("dropdownMenuOpen");f.id=this.navDropDownId;f.style.display="none";this._parent.appendChild(f);this._dropdownMenu=
f;if(b=n.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===n.KEY.ESCAPE&&this.clearPanel()}.bind(this))}m.mixin(l.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){n.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=n.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",n.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(f){this._dropdownMenu.innerHTML=f},getContentNode:function(){return this._dropdownMenu},updateContent:function(f,b){b()},_positionDropdown:function(){this._dropdownMenu.style.right="";var f=n.bounds(this._dropdownMenu),b=n.bounds(document.body);f.left+f.width>b.left+b.width&&(f=n.bounds(this._boundingNode(this._triggerNode)),b=n.bounds(this._triggerNode),this._dropdownMenu.style.right=f.width-(b.left-f.left+b.width)+"px")},_boundingNode:function(f){var b=window.getComputedStyle(f,
null);return null===b||"absolute"===b.getPropertyValue("position")||!f.parentNode||f===document.body?f:this._boundingNode(f.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(n.setFramesEnabled(!0),n.empty(this._parent),this._parent=this.select=null)}});return l});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(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(m,n,l){function f(b,d,a){if(!b[d])throw d+m[" is not supported in this file system"];return b[d].apply(b,a)}function b(g,d,a,k){if(!g.readBlob)throw m["source file service does not support binary read"];if(!a.writeBlob)throw m["target file service does not support binary write"];if("/"!==d[d.length-1])return f(g,"readBlob",[d]).then(function(e){return f(a,"writeBlob",[k,e])});var e=k.substring(0,
k.length-1),p=decodeURIComponent(e.substring(e.lastIndexOf("/")+1)),e=e.substring(0,e.lastIndexOf("/")+1);return f(a,"createFolder",[e,p]).then(function(){},function(){}).then(function(){return f(g,"fetchChildren",[d]).then(function(e){for(var d=[],p=0;p<e.length;++p){var f=e[p].Location,h=f;e[p].Directory&&(h=f.substring(0,f.length-1));h=decodeURIComponent(h.substring(h.lastIndexOf("/")+1));h=k+encodeURIComponent(h);e[p].Directory&&(h+="/");d[p]=b(g,f,a,h)}return n.all(d)})})}function h(b,d){function a(a){var e=
new n;e.reject(m["No Matching FileService for location:"]+a);return e}var k=b.getServiceReferences("orion.core.file"),e=k;if(d)for(var e=[],p=0;p<k.length;++p)d(k[p])&&e.push(k[p]);for(var f=[],h=[],r=[],v=[],t={fetchChildren:function(){var a=new n;a.resolve(v);return a},createWorkspace:function(){var a=new n;a.reject(m["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(m["no file service"]);return a},loadWorkspace:function(a){var e=new n;window.setTimeout(function(){e.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:m["File Servers"],Location:"/",Children:v,ChildrenLocation:"/"})},100);return e},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},k=0;k<e.length;++k)v[k]={Directory:!0,Length:0,LocalTimeStamp:0,Location:e[k].getProperty("top"),ChildrenLocation:e[k].getProperty("top"),Name:e[k].getProperty("Name")},p=e[k].getProperty("pattern")||e[k].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==p[0]&&(p=
"^"+p),f[k]=RegExp(p),h[k]=b.getService(e[k]),r[k]=e[k].getProperty("Name"),e[k].getProperty("NameKey")&&e[k].getProperty("nls")&&l.getMessageBundle(e[k].getProperty("nls")).then(function(a,d){v[a].Name=d[e[a].getProperty("NameKey")];r[a]=d[e[a].getProperty("NameKey")]}.bind(this,k));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return h[0]?0:-1;for(var e=0;e<f.length;++e)if(f[e].test(a))return e;throw m["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?t:h[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?t.Name:r[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?t.Location:v[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 f(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return f(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return f(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return f(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,d,a,k){return f(this._getService(b),"createProject",arguments)},createFolder:function(b,d){return f(this._getService(b),"createFolder",arguments)},createFile:function(b,d){return f(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return f(this._getService(b),"deleteFile",arguments)},moveFile:function(g,d,a){var k=this._getService(g),e=this._getService(d);if(k===e)return f(k,"moveFile",arguments);var p="/"===g[g.length-1],q=d;"/"!==q[q.length-1]&&(q+="/");if(a)q+=encodeURIComponent(a);else{var h=g;p&&(h=h.substring(0,h.length-1));q+=h.substring(h.lastIndexOf("/")+1)}p&&"/"!==q[q.length-1]&&(q+="/");return b(k,g,e,q).then(function(){return f(k,"deleteFile",[g])})},copyFile:function(g,d,a){var k=
this._getService(g),e=this._getService(d);if(k===e)return f(k,"copyFile",arguments);var p="/"===g[g.length-1],q=d;"/"!==q[q.length-1]&&(q+="/");if(a)q+=encodeURIComponent(a);else{var h=g;p&&(h=h.substring(0,h.length-1));q+=h.substring(h.lastIndexOf("/")+1)}p&&"/"!==q[q.length-1]&&(q+="/");return b(k,g,e,q)},read:function(b,d){return f(this._getService(b),"read",arguments)},readBlob:function(b){return f(this._getService(b),"readBlob",arguments)},write:function(b,d,a){return f(this._getService(b),"write",
arguments)},remoteImport:function(b,d){return f(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,d){return f(this._getService(b),"remoteExport",arguments)},search:function(b){return f(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(m,n){function l(h,g){this._parentNode=m.node(h);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=m.node(g);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(f)||b;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var f="sideMenuNavigation",b="open";l.prototype=
{constructor:l.prototype.constructor,setCategories:function(b){this._categoryInfos=b.getCategoryIDs().map(function(g){return b.getCategory(g)}).sort(function(b,d){var a=b.order||100,k=d.order||100;return a<k?-1:k<a?1:b.textContent.localeCompare(d.textContent)})},setPageLinks:function(b){this._categorizedPageLinks={};b.getAllLinks().forEach(function(b){var d=b.category;this._categorizedPageLinks[d]=this._categorizedPageLinks[d]||[];this._categorizedPageLinks[d].push({title:b.textContent,order:b.order||
100,href:b.href})},this)},setRelatedLinks:function(b,g){this._categorizedRelatedLinks={};b.forEach(function(d){var a=d.relatedLink,b=d.command;d=d.invocation;if(!g||-1===g.indexOf(a.id)){var e=a.category;this._categorizedRelatedLinks[e]=this._categorizedRelatedLinks[e]||[];this._categorizedRelatedLinks[e].push({title:b.name,order:a.order||100,href:b.hrefCallback.call(d.handler,d)})}},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(d){if(this._categorizedPageLinks[d].some(function(a){var d=new URL(a.href);a.hash="";return b.href===d.href}))return this._currentCategory=d,!0},this);var g=document.createElement("ul");g.classList.add("sideMenuList");this._categoryInfos.forEach(function(d){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
d.id&&a.classList.add("sideMenuItemActive");a.categoryId=d.id;a.categoryName=d.textContent||d.id;var b=document.createElement("a");b.classList.add("submenu-trigger");if("string"===typeof d.imageDataURI&&0===d.imageDataURI.indexOf("data:image")){var e=document.createElement("img");e.width="16";e.height="16";e.src=d.imageDataURI;b.appendChild(e)}else b.classList.add(d.imageClass||"core-sprite-blank-menu-item");a.appendChild(b);g.appendChild(a);this._categorizedAnchors[d.id]=b},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(g);this._show=l.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(f,"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(f):localStorage.setItem(f,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 d=this._categorizedAnchors[g],a=[];g===this._currentCategory?(d.parentElement.style.display="",d.href="",d.onclick=function(){return!1},d.title=d.parentElement.categoryName):(this._categorizedPageLinks[g]&&a.push.apply(a,this._categorizedPageLinks[g]),this._categorizedRelatedLinks[g]&&a.push.apply(a,
this._categorizedRelatedLinks[g]),0===a.length||0!==b.length&&("git"===g||g.match(/-scm$/))&&-1===b.indexOf(g)?(d.href="",d.title=d.parentElement.categoryName,d.parentElement.style.display="none"):(d.parentElement.style.display="",a.sort(function(a,e){return a.order<e.order?-1:e.order<a.order?1:a.title.localeCompare(e.title)}),g=a.shift(),d.href=g.href,d.title=g.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var b=n.matchResourceParameters().resource,g=(new URL(b,window.location.href)).href;this._categoryInfos.forEach(function(d){if(d.service&&d.service.getNotifications){var a=this._categorizedAnchors[d.id].parentElement;d.service.getNotifications(g).then(function(d){if(b===n.matchResourceParameters().resource){var e="";d.forEach(function(a){"info"===a.level&&!e?e="info":"warn"===a.level&&(!e||"info"===e)?e="warn":"error"===a.level&&"error"!==e&&(e="error")});e?a.setAttribute("level",e):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return l});
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(m,
n,l,f,b,h,g,d,a,k,e,p,q,x,r,v,t,u,w,z,y,C,s,A,B,E,D,G,J,F,I,H,L,Y,K){function T(a,e){if(a.getLabel)return a.getLabel();var d=new s;d.resolve(e.properties.name);return d}function S(a){q.node("progressPane").setAttribute("aria-label",m["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function R(a,e){var d=a.getServiceReferences("orion.core.auth");ba=[];var b=O.createMenuGenerator.apply(this,arguments);if(b)for(var s=0;s<
d.length;s++){var k=d[s],g=a.getService(k);T(g,k).then(function(a){g.getKey().then(function(e){ba.push(e);g.getUser().then(function(d){b.addUserItem(e,g,a,d)},function(d,s){b.addUserItem(e,g,a,s)});window.addEventListener("storage",function(d){N[e]!==localStorage.getItem(e)&&(N[e]=localStorage.getItem(e),g.getUser().then(function(d){b.addUserItem(e,g,a,d)},function(d){b.addUserItem(e,g,a)}))},!1)})})}}function U(a){return a}function V(e,d,b,k,p){function f(){if(l)return l;var a=e.getService("orion.core.contentTypeRegistry");
a||(a=new t.ContentTypeRegistry(e),a=e.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return l=a})}function B(a){for(var e={},d=a.getPropertyKeys(),b,s=0;s<d.length;s++)b=d[s],e[b]=a.getProperty(b);return e}function q(a,e){var d=null;a.some(function(a){return e===a.getProperty("id")?!!(d=a):!1});return d}function A(a){var e=a.command;return!e.visibleWhen||e.visibleWhen(d)?(a.invocation=new g.CommandInvocation(d,d,null,e,k),(new s).resolve(a)):"function"===
typeof p?(r||(r=p()),s.when(r,function(b){if(b&&d===ca&&(!e.visibleWhen||e.visibleWhen(b)))return a.invocation=new g.CommandInvocation(b,b,null,e,k),a})):(new s).resolve()}function h(a,e,d){return d?(new s).resolve({relatedLink:a,command:d}):e.then(function(e){return{relatedLink:a,command:new g.Command(e)}})}var x=arguments,l,r,m=e&&e.getServiceReferences("orion.page.link.related");if(m&&0!==m.length){var E=this;s.when(f(),function(){if(O.beforeGenerateRelatedLinks.apply(E,x)){var d=e.getServiceReferences("orion.navigate.command"),
g=[];m.forEach(function(b){var s=B(b);if(s.id){var p;if((s.nls&&s.nameKey||s.name)&&s.uriTemplate)p=a._createCommandOptions(s,b,e,l,!0),g.push(h(s,p,null));else if(p=q(d,s.id)){var f=B(p);b={};K.mixin(b,f,s);(s=k.findCommand(s.id))?g.push(h(b,null,s)):(p=a._createCommandOptions(f,p,e,l,!0),g.push(h(b,p,null)))}}});s.all(g,U).then(function(a){a.sort(function(a,e){return a.command.name.localeCompare(e.command.name)});return s.all(a.map(A),U).then(function(e){var d=[];e=e.filter(function(e,b){if(e)return!0;
d.push(a[b]);return!1});O.addRelatedLinkCommands.call(E,k,e,d,b);O.afterGenerateRelatedLinks.apply(E,x)})})}})}}function X(a){var e=q.node("globalActions");e&&(a.destroy(e),a.renderCommands(e.id,e,{},{},"tool"))}function W(a){var e=window.getComputedStyle(a,null);return null===e||"absolute"===e.getPropertyValue("position")||!a.parentNode||a===document.body?a:W(a.parentNode)}function P(a){var e={},d=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var b=a;b&&b.classList;){if(b.classList.contains("toolComposite")){d=
b;break}b=b.parentNode}a.classList.contains("commandMarker")&&(e.commandNode=a);d||(d=q.node("pageToolbar"));d&&(e.slideContainer=q.$(".slideParameters",d),e.parameterArea=q.$(".parameters",d),e.dismissArea=q.$(".parametersDismiss",d),e.notifications=q.$("#notificationArea",d),d.parentNode&&(e.toolbarTarget=q.$(".toolbarTarget",d.parentNode),e.toolbarTarget&&(a=q.bounds(e.toolbarTarget),b=q.bounds(W(e.toolbarTarget.parentNode)),e.toolbarTargetY=a.top-b.top,e.toolbar=d)));return e}function M(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var e=q.bounds(a),d=q.bounds(a.parentNode);a.style.left=(d.width-e.width)/2+"px";a.style.top="0"}}h=function(a){var e=document.createElement("a");e.href=a;return e.href}(n.toUrl("auth/NotifyAuthentication.html"));var N={},O={createMenuGenerator:H.createMenuGenerator||function(a,e){if(q.node("userMenu")){var d=q.node("userDropdown"),b=new r.Dropdown({dropdown:d}),d=new A.UserMenu({dropdownNode:d,dropdown:b,
serviceRegistry:a}),b=q.node("userTrigger");new v.Tooltip({node:b,text:m.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),s=b.className;b.className=s+" imageSprite core-sprite-silhouette";d.setKeyAssist(e);return d}},beforeGenerateRelatedLinks:H.beforeGenerateRelatedLinks||function(a,e,d,b,s){return!0},addRelatedLinkCommands:H.addRelatedLinkCommands||function(a,e,d,b){this.sideMenu&&this.sideMenu.setRelatedLinks(e,b)},afterGenerateRelatedLinks:H.afterGenerateRelatedLinks||
function(a,e,d,b,s){},afterSetPageTarget:H.afterSetPageTarget||function(a){},generateNavigationMenu:H.generateNavigationMenu||function(a,e,d,b,s,k,g){if(a=q.node("sideMenu"))e=q.node("centralNavigation"),new v.Tooltip({node:e,text:m.CentralNavTooltip,position:["right"]}),this.sideMenu=new Y(a,q.node("pageContent")),e.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:H.afterGenerateNavigationMenu||
function(a,e,d,b,s,k,g){},afterGenerateBanner:H.afterGenerateBanner||function(a,e,d,b,s,k,g){}},ba=[],ca,aa=[],Q,$=null,Z=null,da=new b;return{generateBanner:function(a,e,b,k,p,A,h,r){function v(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var e=q.$$array(".targetSelector"),d=0;d<e.length;d++)e[d].target=a}},{pid:"nav.config"})}(new y.ThemePreferences(k,new C.ThemeData)).apply();var t=q.node(a);
if(!t)throw m["could not find banner parent, id was "]+a;var u=document.createRange();u.selectNode(t);u=u.createContextualFragment(D);q.processTextNodes(u,m);t.firstChild?t.insertBefore(u,t.firstChild):t.appendChild(u);t=q.node("home");t.href=n.toUrl("edit/edit.html");t.setAttribute("aria-label",m["Orion Home"]);q.node("progressPane").src=g.NO_IMAGE;if(t=q.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=J+l.slideoutHTMLFragment("mainToolbar");(t=q.node("closeNotifications"))&&t.setAttribute("aria-label",
m["Close notification"]);if(17>=I.isFirefox&&(t=q.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=q.node("footer"))t.innerHTML=G,q.processTextNodes(t,m);b.setParameterCollector(new d.CommandParameterCollector(P,M));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=e.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);t=B.getCategoriesInfo(e);
u=B.getPageLinksInfo(e,"orion.page.link");s.all([t,u]).then(function(a){if(this.sideMenu){var e=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(e);this.sideMenu.render()}}.bind(this));if(t=q.$(".split")){var u=q.$(".sidePanelLayout"),F=q.$(".mainPanelLayout");u&&F&&($={side:u,main:F},$.splitter=new x.Splitter({node:t,sidePanel:u,mainPanel:F,toggle:!0,closeByDefault:r}),t=new g.Command({name:m["Toggle side panel"],tooltip:m["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){$.splitter.toggleSidePanel()}}),b.addCommand(t),b.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new f.KeyBinding("l",I.isMac?!1:!0,!0,!1,I.isMac?!0:!1)))}var z=!1,H=function(a,e){if(!z){var d=e.getService("orion.page.progress"),b=new E.OpenResourceDialog({searcher:a,progress:d,searchRenderer:a.defaultRenderer,onHide:function(){z=!1}});window.setTimeout(function(){z=!0;b.show()},0)}},t=new g.Command({name:m["Find File Named..."],tooltip:m["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){H(p,e)}});b.addCommand(t);b.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new f.KeyBinding("f",!0,!0));var L=!1,t=function(){if(L)return!1;var a=q.node("banner"),e=q.node("footer"),d=q.node("sideMenu"),b=q.$(".content-fixedHeight"),s="hidden"===a.style.visibility;s?(a.style.visibility="visible",e.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized"),d&&d.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",e.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"),d&&d.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!s});return!0};window.orionNoTrim?(t(),L=!0,this.sideMenu.hide()):(t=new g.Command({name:m["Toggle banner and footer"],tooltip:m["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:t}),b.addCommand(t),b.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new f.KeyBinding("m",!0,!0)));
t=new g.Command({name:m["System Configuration Details"],tooltip:m["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return n.toUrl("help/about.html")}});b.addCommand(t);b.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new f.KeyBinding(112,!0,!0));t=new g.Command({name:m["Background Operations"],tooltip:m["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return n.toUrl("operations/list.html")}});b.addCommand(t);
b.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new f.KeyBinding("o",!0,!0));Z=new w.KeyAssistPanel({commandRegistry:b});t=new g.Command({name:m["Show Keys"],tooltip:m["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Z.isVisible()?Z.hide():Z.show();return!0}});b.addCommand(t);b.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new f.KeyBinding(191,!1,!0));X(b);R(e,t.callback);S(e);window.addEventListener("hashchange",
function(){b.processURL(window.location.href)},!1);window.setTimeout(function(){v(e)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:P,getMainSplitter:function(){return $},getKeyAssist:function(){return Z},getGlobalEventTarget:function(){return da},layoutToolbarElements:M,setPageTarget:function(a){var e,d,b=a.breadcrumbRootName,s=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(d=(b?b+" ":"")+a.fileService.fileServiceName(a.target.Location),b=null),e=a.name||a.target.Name,ca=a.target,V.call(this,s,a.target,aa,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(b=b||a.task||a.name),e=a.name,V.call(this,s,{NoTarget:""},aa,a.commandService,a.makeAlternate));(Q=a.title)||(Q=e?e+" - "+a.task:a.task);window.document.title=Q;O.afterSetPageTarget.apply(this,arguments);if(e=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(e),a.staticBreadcrumb)new p.BreadCrumbs({container:e,
rootSegmentName:b});else{var k=s&&new L.FileClient(s),s=a.breadcrumbTarget||a.target,k=k&&s&&s.Location?k.fileServiceRootURL(s.Location):null;new p.BreadCrumbs({container:e,resource:s,rootSegmentName:b,workspaceRootSegmentName:d,workspaceRootURL:k,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){Q&&("*"===Q.charAt(0)&&!a&&(Q=Q.substring(1)),a&&"*"!==Q.charAt(0)&&(Q="*"+Q),window.document.title=Q);var e=q.node("dirty");e&&(e.textContent=a?"*":"")},
setPageCommandExclusions:function(a){aa=a},notifyAuthenticationSite:h}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(m){return{detectValidURL:function(n){for(var l=/\[([^\]]*)\]\(([^\)]+)\)/g,f=l.exec(n),b=[],h=0;f;){if(3===f.length&&0<f[2].length){var g=new URL(f[2]);":"!==g.protocol&&m.validateURLScheme(g.href)&&(f.index>h&&b.push({segmentStr:n.substring(h,f.index)}),b.push({segmentStr:0<f[1].length?f[1]:f[2],urlStr:f[2]}),h=f.index+f[0].length)}f=l.exec(n)}if(0===h)return null;h<n.length&&b.push({segmentStr:n.substring(h)});return b},processURLSegments:function(m,
l){l.forEach(function(f){if(f.urlStr){var b=document.createElement("a");b.href=f.urlStr;b.appendChild(document.createTextNode(f.segmentStr))}else b=document.createElement("span"),b.textContent=f.segmentStr;m.appendChild(b)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(m,n,l,f){function b(b,d,a,k,e){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=e;this.domId=a;this.progressDomId=k||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var h;b.prototype={_init:function(){var b=n.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var d=n.node(this.notificationContainerDomId);n.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=n.$$("a",d))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=n.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=l.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(b,d,a){this._init();this.currentMessage=b;var k=n.node(this.domId);
if("boolean"===typeof a){var e=k.getAttribute("aria-live");k.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(n.empty(k),k.appendChild(document.createTextNode(b)),window.setTimeout(function(){k.setAttribute("aria-live",e)},100))}.bind(this),100)}else n.empty(k),k.appendChild(document.createTextNode(b));"number"===typeof d&&window.setTimeout(function(){b===this.currentMessage&&(n.empty(k),k.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var d=b.responseText||b.message||b;if("string"===typeof d)try{d=JSON.parse(d)}catch(a){}b=d.Message||d;var k="red";if(d.Severity)switch(d.Severity){case "Warning":k="#FFCC00";break;case "Error":k="red";break;case "Info":case "Ok":k="green"}d=document.createElement("span");d.style.color=k;d.appendChild(document.createTextNode(b));b=n.node(this.domId);n.empty(b);b.appendChild(d)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var d=document.createElement("span");d.classList.add("progressIcon");var a=n.node(this.progressDomId);n.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(b));d=n.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(b&&0<b.length)d.classList.add("progressNormal"),d.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();d.classList.remove("notificationShow");d.classList.add("notificationHide")}},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,d){this._clickToDisMiss=!1;this._cancelMsg=d;this.currentMessage=b;var a=b.responseText||b;if("string"===typeof a)try{a=JSON.parse(a)}catch(k){}this._init();var e=a.Message||a.toString(),p=m.UnknownError,q="core-sprite-information",h="progressNormal",l=document.createElement("span");l.classList.add("imageSprite");l.classList.add("progressIcon");var v=[];if(a.Severity)switch(a.Severity){case "Warning":p=m.UnknownWarning;
q="core-sprite-warning";h="progressWarning";v.push("progressInfo");v.push("progressError");v.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":q="core-sprite-error";h="progressError";v.push("progressWarning");v.push("progressInfo");v.push("progressNormal");this._clickToDisMiss=!0;break;default:h="progressNormal",v.push("progressWarning"),v.push("progressError"),v.push("progressNormal")}v.push("notificationHide");l.classList.add(q);var t=n.node(this.progressDomId),q=n.node(this.notificationContainerDomId);
n.empty(t);t.appendChild(l);e===Object.prototype.toString()&&(e=p);a.HTML?(a=document.createElement("span"),a.innerHTML=e,t.appendChild(a)):((p=f.detectValidURL(e))?(e=document.createDocumentFragment(),f.processURLSegments(e,p),Array.prototype.forEach.call(n.$$("a",e),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!d)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
e=document.createTextNode(e)),t.appendChild(e));if(h&&this.progressDomId!==this.domId){q.classList.add(h);for(h=0;h<v.length;h++)q.classList.remove(v[h])}q.classList.add("notificationShow");if(v=n.node("closeNotifications"))this._cancelMsg?(v.classList.add("cancelButton"),v.classList.remove("dismissButton"),v.classList.remove("core-sprite-close"),v.classList.remove("imageSprite"),v.innerHTML=this._cancelMsg):(v.innerHTML="",v.classList.remove("cancelButton"),v.classList.add("dismissButton"),v.classList.add("core-sprite-close"),
v.classList.add("imageSprite"))},showWhile:function(b,d){var a=this;if(d){a.setProgressMessage(d);var k=function(){d===a.currentMessage&&a.setProgressMessage("")};b.then(k,k)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new h(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var b="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(b+=", "),b+=this._progressMonitors[a].status,
d=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};b.prototype.constructor=
b;h=function(b,d,a,k){this.statusService=b;this.progressId=d;if(a){this.deferred=a;this.begin(k);var e=this;a.then(function(a,d){e.done.bind(e)()},function(a,d){e.done.bind(e)()})}};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(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(m,n,l,f){function b(){}b.prototype={_initialize:function(b,g,d,a,k){this._tooltip=new f.Tooltip({node:b,hideDelay:k||0,afterShowing:this._afterShowingFunction(g).bind(this),afterHiding:d,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&&l.processTextNodes(b,m);this.$parent.appendChild(b);var e=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&e.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 d=b.childNodes[g];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var g=
l.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(m,n,l,f){var b={};(function(){var h=!1;b.updateNavTools=function(b,d,a,k,e,p){var f=l.node(k);if(f)d.destroy(f);else throw m["could not find toolbar "]+k;d.renderCommands(k,f,p,a,"button");if(e&&(k=l.node(e)))d.destroy(k),d.renderCommands(e,k,null,a,"button");h||(h=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var k=l.node(e);
k&&(d.destroy(k),d.renderCommands(e,k,b.selections,a,"button"))}))};b.createOperationsCommands=function(b,d,a){function k(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var e=new f.Command({name:m["Remove Completed"],tooltip:m["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(e){a.removeCompletedOperations().then(function(a){d.loadOperations.bind(d)()})},visibleWhen:function(a){return!0}});b.addCommand(e);
e=new f.Command({name:m.Remove,tooltip:m["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(e){e=Array.isArray(e.items)?e.items:[e.items];for(var b=0;b<e.length;b++){var k=e[b];a.removeOperation.bind(a)(k.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!k(a);for(var e in a)if(k(a[e]))return!1;return!0}});b.addCommand(e);
e=new f.Command({name:m.Cancel,tooltip:m["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 e=0;e<a.length;e++){var b=a[e];b.deferred&&b.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return k(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var e in a)if(!k(a[e])||!a[e].operation||!a[e].operation.cancelable)return!1;return!0}});b.addCommand(e)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(m,n,l,f,b){function h(b){this._options=b}h.prototype=new f.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=n.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(b,d){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};h.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var a={Message:b.Message||b,Severity:b.Severity};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,d,a){l.empty(b);for(var k=0;k<d.length;k++){var e=d[k],p=document.createElement("tr"),f=document.createElement("td");f.style.paddingLeft="5px";f.style.paddingRight="5px";f.textContent=e.Name;p.appendChild(f);var h=document.createElement("div");f.appendChild(h);f=document.createElement("span");f.style.paddingRight="5px";f.classList.add("imageSprite");switch(e.type){case "Warning":f.classList.add("core-sprite-warning");
f.setAttribute("aria-label",m["Operation resulted in a warning."]);break;case "error":f.classList.add("core-sprite-error");f.setAttribute("aria-label",m["Operation resulted in an error."]);break;case "loadstart":case "progress":f.classList.add("core-sprite-start");f.setAttribute("aria-label",m["Operation is running."]);break;case "abort":f.classList.add("core-sprite-stop");f.setAttribute("aria-label",m["Operation is canceled."]);break;case "load":case "loadend":f.classList.add("core-sprite-ok"),f.setAttribute("aria-label",
"Operation ok.")}h.appendChild(f);f=document.createElement("span");f.classList.add("operationStatus");f.textContent=e.Name;h.appendChild(f);if(e.error){var r=e.error.Message||e.error;e.error.DetailedMessage&&""!==e.error.DetailedMessage&&(r+=": "+e.error.DetailedMessage);f.textContent=r;f.classList.remove("operationStatus");f.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",h,{operation:e,deferred:a[k]},this,"tool");b.appendChild(p)}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(m,n,l,f,b){function h(d,a){if(!this._progressPane){this._progressPane=f.node(d);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var k=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===f.KEY.ENTER)&&k._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){k._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function g(b,a,k,e){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=k;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=e}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 k={},e;for(e in b)b[e].progressMonitor||(k[e]=b[e]);if(this._isEmpty(k))this._switchIconTo("progressPane_empty"),this._progressPane.title=m.Operations,this._progressPane.alt=m.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var g="";for(e in k){var f=k[e];if(f.type&&("loadstart"===f.type||"progress"===f.type)){g=
"running";break}}""===g&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==g;switch(g){case "running":this._progressPane.title=m["Operations running"];this._progressPane.alt=m["Operations running"];this._progressPane.setAttribute("aria-valuetext",m["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=m["Some operations finished with warning"];this._progressPane.alt=m["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",m["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=m["Some operations finished with error"];this._progressPane.alt=m["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",m["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=m.Operations,this._progressPane.alt=m.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(k,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,k){var e=this,g=this._operationsIndex++;!k&&this._progressMonitorClass&&(k=new this._progressMonitorClass,k.begin(a));b.then(function(f){e._operations[g]&&
(f=e._operations[g],a&&(f.Name=a),e._lastOperation=f,f.type="loadend",k&&(f.progressMonitor=k),e.writeOperation.bind(e)(g,f,b),f.Location||e._removeOperationFromTheList.bind(e)(g))},function(f){if(e._operations[g]){var h=e._operations[g];a&&(h.Name=a);k&&(h.progressMonitor=k);e._lastOperation=h;h.type=f.canceled?"abort":"error";h.error=f;e.writeOperation.bind(e)(g,h,b);h.Location||e._removeOperationFromTheList.bind(e)(g)}},function(f){a&&(f.Name=a);k&&(f.progressMonitor=k);e.writeOperation.bind(e)(g,
f,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,k){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var e=this;b.then(function(a){e._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){k?e._serviceRegistry.getService("orion.page.message").setProgressMessage(""):e.setProgressResult.bind(e)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,k){this._operations[b]=a;this._operationDeferrds[b]=k;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(e){e.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/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(m,n){function l(b,d,a){return b[d].apply(b,a)}function f(b){this._location=b}function b(){var b=new n;b.reject(m["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 d=b.getServiceReferences("orion.core.operation"),
a=0;a<d.length;a++){var k=b.getService(d[a]);this._services[a]=k;k=d[a].getProperty("pattern")||".*";"^"!==k[0]&&(k="^"+k);this._patterns[a]=RegExp(k)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new f(a)}}f.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};f.prototype.constructor=f;h.prototype={getOperations:function(){var b=
new n;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;b.resolve(d._operations)});return b},getOperation:function(b){return l(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,a=0;a<this._services.length;a++){var k=this._patterns[a],e=new n;b[a]=e.promise;l(this._services[a],"removeCompletedOperations").then(function(a){return function(e){Array.isArray(e)&&
d.getOperations.bind(d)().then(function(b){for(var d=b.keys(),g=0;g<d.length;g++){var f=d[g];k.test(f)&&0>e.indexOf(f)&&b.remove(f)}a.resolve()})}}(e),function(a){return function(e){a.reject(e)}}(e))}return n.all(b)},removeOperation:function(b){var d=this;return l(this._getService(b),"removeOperation",arguments).then(function(a){d.getOperations.bind(d)().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(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(m,n){function l(f){this._init(f)}l.prototype={_init:function(f){var b=f.parent,h=this,b=n.node(b);if(!b)throw m["no parent"];if(!f.model)throw m["no tree model"];if(!f.renderer)throw m["no renderer"];this._parent=b;this._treeModel=f.model;this._onComplete=f.onComplete;this._renderer=f.renderer;this._showRoot=void 0===f.showRoot?!1:f.showRoot;this._indent=void 0===f.indent?16:f.indent;this._onCollapse=f.onCollapse;
this._labelColumnIndex=void 0===f.labelColumnIndex?0:f.labelColumnIndex;this._id=void 0===f.id?"treetable":f.id;this._tableStyle=f.tableStyle;this._tableElement=f.tableElement||"table";this._tableBodyElement=f.tableBodyElement||"tbody";this._tableRowElement=f.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(f,
b){n.empty(this._parent);var h=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(h);var g=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(g);g.id=this._id;this._tableStyle&&g.classList.add(this._tableStyle);this._renderer.initTable(g,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===f.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(f,b);g.appendChild(this._bodyElement);h.appendChild(g);this._parent.appendChild(h);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(f,b,h){for(var g=0;g<f.length;g++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(f[g]);d._depth=b;d._item=f[g];this._renderer.render(f[g],d);var a=this._indent*b;d.childNodes[Math.min(d.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(d,f[g]);h?(this._bodyElement.insertBefore(d,h.nextSibling),h&&(h=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(f,b,h){var g=this._treeModel.getId(f),d;if(g===this._id)this._removeChildRows(g),this._generateChildren(b,0),this._rowsChanged();else if(g===
this._treeModel.getId(this._root)&&f.removeAll)this._removeAllRows(),this._generateChildren(b,0),this._rowsChanged();else{var a=n.node(g);a?(a._item=f,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()):(d=this,this._renderer.updateExpandVisuals(a,"progress"),b=this._treeModel.getChildren(a._item,function(b){d.destroyed||(d._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,d._generateChildren(b,a._depth+1,a),d._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(m["could not find table row "]+g)}},getItem:function(f){var b=n.node(f);return b&&b._item?b._item:f},toggle:function(f){var b=n.node(f);b&&(b._expanded?this.collapse(f):this.expand(f))},isExpanded:function(f){f="string"===typeof f?f:this._treeModel.getId(f);return(f=n.node(f))?f._expanded:!1},expand:function(f,b,h){f="string"===typeof f?f:this._treeModel.getId(f);var g=n.node(f);if(g){var d=
this;g._expanded?b&&b.apply(d,h):(this._renderer.updateExpandVisuals(g,"progress"),this._treeModel.getChildren(g._item,function(a){d.destroyed||(d._renderer.updateExpandVisuals(g,!0),g._expanded||(g._expanded=!0,d._generateChildren(a,g._depth+1,g),d._rowsChanged()),b&&b.apply(d,h))}))}},_removeChildRows:function(f){for(var b=f===this._id,h=!1,g=-1,d=[],a=n.$$array(".treeTableRow",this._parent),k=0;k<a.length;k++){var e=a[k];if(h)break;b?e._depth>g?d.push(e):h=!0:e.id===f&&(b=!0,g=e._depth)}for(f=
0;f<d.length;f++)b=d[f],b.parentNode.removeChild(b)},_removeAllRows:function(){for(var f=n.$$array(".treeTableRow",this._parent),b=0;b<f.length;b++)f[b].parentNode.removeChild(f[b])},collapse:function(f){f="string"===typeof f?f:this._treeModel.getId(f);var b=n.node(f);if(b){if(!b._expanded)return;b._expanded=!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(f);this._rowsChanged()}this._onCollapse&&this._onCollapse(b._item)},getIndent:function(){return this._indent}};l.prototype.constructor=
l;return{TableTree:l}});
define("orion/treeModelIterator",[],function(){var m={};m.TreeModelIterator=function(){function m(l,f){this.firstLevelChildren=l;this.reset();this._init(f)}m.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 f=this._getChildren(l),f=f&&0<f.length;this.isExpanded&&f&&(f=this.isExpanded(l));return f},_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 f=this._diveIn(this._cursor);
if(!f){if(l&&this._expandable(this._cursor)&&this.forceExpandFunc){var b=this;return this.forceExpandFunc(this._cursor,"first",function(f){f&&b.setCursor(f)})}(f=this._findSibling(this._cursor,!0))&&this.setCursor(f)}return f},_backward:function(l){if(!this._cursor)return null;var f=this._findSibling(this._cursor,!1);f&&f!==this._cursor.parent&&(f=this._drillToLast(f));if(l&&f&&this._expandable(f)&&this.forceExpandFunc&&f!==this._cursor.parent){var b=this;return this.forceExpandFunc(f,"last",function(f){f&&
b.setCursor(f)})}f&&this.setCursor(f);return f},_findSibling:function(l,f){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&&!f?b?null:l.parent:g===h.length-1&&f?b?null:this._findSibling(l.parent,f):f?h[g+1]:h[g-1];return null},_inParentChain:function(l,f){for(var b=l.parent;b;){if(b===f)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,f,b){this.setCursor(f);var h=[];for(h.push(f);;){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,f){var b=this.cursor(),
h=this._scan(!0,l,f);h||(h=this._scan(!1,l,f));this.setCursor(b);return h},iterate:function(l,f){return l?this._forward(f):this._backward(f)},iterateOnTop:function(l,f){var b=this._findSibling(this._getTopLevelParent(this.cursor()),l);b?this.setCursor(b):f&&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 m}();return m});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(m,n,l){var f={},b=-1!==navigator.userAgent.indexOf("iPad"),h=-1!==window.navigator.platform.indexOf("Mac");f.ExplorerNavHandler=function(){function g(b,a,k){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 e=this;this._modelIterator=
new n.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:k.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return e.explorer.renderer.isExpandable(a)}:function(a){return e.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,d){return e.explorer.forceExpandFunc(a,b,d)}:void 0});this._init(k);(!k||!1!==k.setFocus)&&b.focus();k=function(a){if(l.isFormElement(a.target)||e.explorer.preventDefaultFunc&&e.explorer.preventDefaultFunc(a,
e._modelIterator.cursor()))return!0;if(a.keyCode===m.KEY.DOWN)return e.onDownArrow(a);if(a.keyCode===m.KEY.UP)return e.onUpArrow(a);if(a.keyCode===m.KEY.RIGHT)return e.onRightArrow(a);if(a.keyCode===m.KEY.LEFT)return e.onLeftArrow(a);if(a.keyCode===m.KEY.SPACE)return e.onSpace(a);if(a.keyCode===m.KEY.ENTER)return e.onEnter(a)};b.addEventListener("keydown",k,!1);this._listeners.push({type:"keydown",listener:k});k=function(a){if(e.explorer.onFocus)e.explorer.onFocus(!1);else e.toggleCursor(null,!1)};
b.addEventListener("blur",k,!1);this._listeners.push({type:"blur",listener:k});k=function(a){if(e.explorer.onFocus)e.explorer.onFocus(!0);else e.toggleCursor(null,!0)};b.addEventListener("focus",k,!1);this._listeners.push({type:"focus",listener:k});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):m.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:m.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 k=this;this.explorer.selection&&this.explorer.selection.getSelections(function(e){k._clearSelection(a);for(var g=0;g<e.length;g++)k._selections.push(e[g]);0<k._selections.length?k.cursorOn(k._selections[0],
!0,!1,b):k.cursorOn(null,!1,!1,b);k._shiftSelectionAnchor&&0<=k._inSelection(k._shiftSelectionAnchor)||(k._shiftSelectionAnchor=null)})},refreshModel:function(b,a,k,e){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():k&&(this.topIterationNodes=k);this._modelIterator.setTree(this.topIterationNodes);!e&&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,k){"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)),k&&(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 k=this._getGridChildren(b);if(k&&1<k.length||
0===a&&k){0!==a&&this.toggleCursor(b,!1);var e=this._currentColumn,g=!0,e=e+a;0>e?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():g=!1),e=g?k.length-1:this._currentColumn):e>=k.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():g=!1),e=g?0:this._currentColumn);this._currentColumn=e;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,k;b&&b!==a&&"grid"!==(k=b.getAttribute("role"))&&"tree"!==k&&"treegrid"!==k;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var k=this.getRowDiv(b),e=this.getCurrentGrid(b);e?(k&&(a?k.classList.add("treeIterationCursorRow"):k.classList.remove("treeIterationCursorRow")),e.domNode&&(k=this.getAriaContainerElement(e.domNode),
a?(e.domNode.classList.add("treeIterationCursor"),k&&k.setAttribute("aria-activedescendant",e.domNode.id)):e.domNode.classList.remove("treeIterationCursor"))):k&&(a?k.classList.add("treeIterationCursorRow_Dotted"):k.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,k,e){var g,f;if(b||a){if(f===this._modelIterator.cursor())return;g=this._modelIterator.cursor();f=b;this._modelIterator.setCursor(f)}else g=this._modelIterator.prevCursor(),
f=this._modelIterator.cursor();if(g!==f||a)if(this.toggleCursor(g,!1),!a||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((b=this.getRowDiv())&&!e){e=b.parentNode;for(a=document.documentElement;e&&e!==a;){var h=window.getComputedStyle(e,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;e=e.parentNode}e&&(a=!0,b.offsetTop<=e.scrollTop?(a=!1,void 0===k&&(k=!1)):b.offsetTop+b.offsetHeight>=e.scrollTop+e.clientHeight&&(a=!1,void 0===k&&(k=!0)),a||b.scrollIntoView(!k))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(g,
f)}},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:m.node(b)},iterate:function(b,a,k,e){var g=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(e){e=this.currentModel();for((g=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,k);g&&g.isNotSelectable;)(g=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,k);g||(this.cursorOn(e,!0,!1,!0),this._setCursorOnItem(b,k))}else(g=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,k)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(k){(k=this.getRowDiv(k))&&(a?k.classList.add(b):k.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var k=this._inSelection(this._modelIterator.prevCursor()),
e=this._inSelection(this._modelIterator.cursor());0<=k&&0<=e?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var k=this.getRowDiv(b);if(k){var e=m.node(this.explorer.renderer.getCheckBoxId(k.id)),g=a?!e.checked:!0;if(g!==e.checked)this.explorer.renderer.onCheck(k,e,g,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var k=this.getRowDiv(b);k&&(0>this._inSelection(b)?k.classList.add("checkedRow"):k.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var k=this._getGridChildren(b);if(k)for(var e=0;e<k.length;e++)if(a.target===k[e].domNode)return!0;return!1},onClick:function(d,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(d)))m.stop(a);else{var k=m.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));if(a.target!==k&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(d,a)))if(this.cursorOn(d,!0,!1,!0),b)this.setSelection(d,!0);else if(this._ctrlKeyOn(a))this.setSelection(d,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(k=this._modelIterator.scan(this._shiftSelectionAnchor,d)){this._clearSelection(!0);for(var e=0;e<k.length;e++)this.setSelection(k[e],!0)}}else this.setSelection(d,!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(),k=this._getGridChildren(a);return k&&1<k.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 k=document.createEvent("MouseEvents");k.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(k)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(k=this.explorer.renderer.getRowActionElement(this.model.getId(a)),k.href&&(this._ctrlKeyOn(b)?window.open(k.href):window.location.href=k.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}();f.ExplorerNavDict=function(){function b(d){this._dict={};this._model=d}b.prototype={addRow:function(b,a){var k=this._model.getId(b);this._dict[k]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var k=this._model.getId(b);return this._dict[k]?(!this._dict[k].gridChildren&&a&&(this._dict[k].gridChildren=[]),this._dict[k].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 f});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(m,n,l,f,b,h){var g={};g.Explorer=function(){function d(a,b,e,d){this.registry=a;this.renderer=e;this.selection=b;this.commandService=d;this.renderer&&(this.renderer.explorer=this);this.myTree=null}d.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,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,e){var d=null;if(a=this.getRow(a)){var d=a.parentNode,g=document.createElement("tr");g.id=b+"placeHolderRow";g.classList.add("navRow");var f=document.createElement("td");f.id=b+"placeHolderCol";f.classList.add("navColumn");g.appendChild(f);
e?d.insertBefore(g,a.nextSibling):d.insertBefore(g,a);f.style.paddingLeft=a.firstChild.style.paddingLeft;d={wrapperNode:g,refNode:f,destroyFunction:function(){try{g&&g.parentNode&&g.parentNode.removeChild(g)}catch(a){}}}}return d},getRow:function(a){if(a=this.model.getId(a))return l.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 d=a.length,g=0;g<d;g++)b._expandRecursively(a[g])})})}},createTree:function(a,d,e){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var g=a+"innerTree",
h=l.node(g);h&&l.empty(h);d&&(d.rootId=g);this.model=d;this._parentId=a;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new f.TableTree({id:g,model:d,parent:a,onComplete:e?e.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:e?!!e.showRoot:!1,indent:e?e.indent:void 0,onCollapse:e?e.onCollapse:void 0,navHandlerFactory:e?e.navHandlerFactory:void 0,
tableElement:e?e.tableElement:void 0,tableBodyElement:e?e.tableBodyElement:void 0,tableRowElement:e?e.tableRowElement:void 0});this.renderer._initializeUIState();"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 e=a.getSelection(),d=0;d<e.length;d++){var g=a.getRowDiv(e[d]);g&&g.parentNode&&
(g=this.getNavDict().getValue(this.model.getId(e[d])),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 d=this;this.model.getRoot(function(b){b instanceof Array?d.getNavHandler().refreshModel(d.getNavDict(),d.model,b):b.children&&b.children instanceof Array&&d.getNavHandler().refreshModel(d.getNavDict(),d.model,b.children);a&&a.setFocus&&d.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();g.createExplorerCommands=function(b,a){function k(b){return"function"===
typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var e=new h.Command({tooltip:m["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return k(a)},callback:function(a){a.items.expandAll()}}),g=new h.Command({tooltip:m["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return k(a)},callback:function(a){a.items.collapseAll()}});
b.addCommand(e);b.addCommand(g)};g.ExplorerModel=function(){function b(a,d,e){this.rootPath=a;this.fetchItems=d;this.idPrefix=e||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(e){b.root=e;a(e)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(e){a.Children=e;b(e)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,e=0;e<a.length;e++)b=a[e].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(e):b+a[e];return b}};return b}();g.ExplorerFlatModel=function(){function b(a,d,e){this.rootPath=a;this.fetchItems=d;this.root=e}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(e){b.root=e;a(e)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};
return b}();g.ExplorerRenderer=function(){function b(a,d){this.explorer=d;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;l.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,e,d,g){e=e||"tool";var f=document.createElement("td");f.id=b.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,e,null,g&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var e=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;this.getCheckedFunc&&(d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on")));e.appendChild(d);var g=this;d.addEventListener("click",function(e){g.onCheck(b,e.target,e.target.checked?!1:!0,!0,!1,a)},!1);return e}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,e,d,g,f){(b.checked=e)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,e,d,f);this.explorer.getNavHandler()&&
g&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),e=this.explorer.getNavHandler();if(e&&(b&&"cursorOnly"!==e.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var d=[],e=0;e<a.length;e++){var g=b.getValue(a[e]);if(g&&(g.rowDomNode&&g.model)&&(d.push(g.model),this._highlightSelection&&g.rowDomNode.classList.add("checkedRow"),g=l.node(this.getCheckBoxId(g.rowDomNode.id))))g.checked=!0,g.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,e=window.sessionStorage[a+"expanded"];"string"===typeof e&&(e=0<e.length?JSON.parse(e):null);var d;if(e)for(d=0;d<e.length;d++)if(l.node(e[d])){this._expanded.push(e[d]);var g=this;this.tableTree.expand(e[d],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 e=l.node(this.expandCollapseImageId(a.id));e&&(e.classList.remove(this._expandImageClass),e.classList.remove(this._collapseImageClass),e.classList.remove(this._progressImageClass),e.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,e,d){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(e){var f=document.createElement("span");b.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(e)}var h=this;g.onclick=function(b){if(!h.explorer.getNavHandler().isDisabled(a)){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(a.id);else for(var e in h._expanded)if(h._expanded[e]===
a.id){h._expanded.splice(e,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)}};return g},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(l.$(".sectionTreeTable",this.tableNode.parentNode)||l.$(".treetable",this.tableNode.parentNode))&&l.$$array(".treeTableRow",this.tableNode).forEach(function(a,
b){var e=!(b%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",d="lightSectionTreeTableRow"===e?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(e);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=l.$$array(".treeTableRow"),b=0;b<a.length;b++){var e=a[b],d=l.node(e.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,e._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,d){this._init(a);this.explorer=d}b.prototype=new g.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),e=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&e.appendChild(this.initCheckboxColumn(a));for(var d=0,g=this.getCellHeaderElement(d);g;)0<
g.innerHTML.length&&g.classList.add("navColumn"),e.appendChild(g),g=this.getCellHeaderElement(++d);b.appendChild(e);0<d&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var e=this.explorer.getNavDict();if(e){"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");e.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,
b)},!1)}if(e=this.getCheckboxColumn(a,b))e.classList.add("checkColumn"),b.appendChild(e)}for(var e=0,g=this.getCellElement(e,a,b);g;)b.appendChild(g),0===e?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(++e,a,b)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,b,e){};return b}();
g.SimpleFlatModel=function(){function b(a,d,e){this.items=a;this.getKey=e;this.idPrefix=d;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="",e=0;e<a.length;e++)b=a[e].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(e):b+a[e];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(m,n,l,f){function b(b,a,g){return 0<b?1===b?a+" ":b+" "+g+" ":""}function h(d){d=new Date(d);var a=(new Date).getTime()-d.getTime();d=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*d,g=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*g,e=Math.floor(a/1E3/60/60/24),a=a-864E5*e,f=Math.floor(a/1E3/60/60),h=Math.floor((a-36E5*f)/1E3/60),a=b(d,"a year","years"),l=
b(g,"a month","months"),r=b(e,"a day","days"),m=b(f,"an hour","hours"),h=b(h,"a minute","minutes"),t="";a?t=0<d?a:a+l:l?t=0<g?l:l+r:r?t=0<e?r:r+m:m?t=0<f?m:m+h:h&&(t=h);return t?t+"ago":"Just now"}function g(b){this._parentDomNode=l.node(b.parent);this._commitInfo=b.commitInfo}m.mixin(g.prototype,{destroy:function(){},_simpleMessage:function(b){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var g=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");g&&0<g.length&&(a=g[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 g=(new URL("commit",window.location.href)).href,g=decodeURIComponent(g);a.href=(new n(g+"{/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 g=
this,e=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);e.query.set("contributorUserId",b);f("GET",e.href,{timeout:15E3}).then(function(b){b=JSON.parse(b.response);a.src=b.photoURI},function(){g._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 g=this._commitInfo.Author&&this._commitInfo.Author.Date?h(this._commitInfo.Author.Date):"",e=this._simpleMessage(-1),f=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",q=b;q||(q="Commit");q="Last "+q;if(a){var x=document.createElement("div"),r=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,r):this._useOtherPhotoURL(r);r.classList.add("commitInfoAvatar");x.appendChild(r)}else x=
document.createElement("div"),x.classList.add("commitInfoLabelContainer"),x.appendChild(document.createTextNode(q.toUpperCase()));this._parentDomNode.appendChild(x);x=document.createElement("div");x.classList.add("commitInfoMessageContainer");r=document.createElement("div");r.classList.add("commitInfoAutorContainer");var m=document.createDocumentFragment(),t=document.createElement("span");t.appendChild(document.createTextNode(f));t.classList.add("navColumnBold");a?(f=document.createElement("span"),
f.appendChild(document.createTextNode(q)),f.classList.add("navColumnBold"),m.textContent=g?"${0} by ${1} "+g+".":"${0} by ${1}.",g=[f,t]):(m.textContent=g?"by ${0} "+g+".":"by ${0}.",g=[t]);l.processDOMNodes(m,g);r.appendChild(m);x.appendChild(r);g=document.createElement("div");g.classList.add("commitInfoMessageTextContainer");g.appendChild(this._generateMessageNode(e));x.appendChild(g);this._parentDomNode.appendChild(x)}});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(m,n,l,f,b,h,g,d,a){function k(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 e(a,e,d,f,p,l,m,C,s){e=h.clone(e);
var A;if(e.Directory)A=document.createElement("a"),A.className="navlinkonpage",f=!a?q:new g(a+"#{,resource,params*}"),A.href=f.expand({resource:e.ChildrenLocation}),e.Name&&A.appendChild(document.createTextNode(e.Name));else{p||(p=b.getOpenWithCommands(d));A=document.createElement("a");A.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){A[a]=l[a]});var B=null,E=null;if(B=C?C.holderDom:A)E=document.createElement("span"),E.className="core-sprite-file modelDecorationSprite thumbnail",
B.appendChild(E);e.Name&&A.appendChild(document.createTextNode(e.Name));var D=e.Location;m&&"object"===typeof m&&(e.params={},h.mixin(e.params,m));(a=b.getOpenWithCommand(d,e,p))&&(D=a.hrefCallback({items:e}));n.when(f.getFileContentType(e),function(a){if(B){var b=B,d=E;if(a){var g,f=a.imageClass,p=a.image;f?(g=document.createElement("span"),g.className+=f,g.classList.add("thumbnail")):p&&(g=document.createElement("img"),g.src=p,g.classList.add("thumbnail"));g&&b.replaceChild(g,d)}}A.href=D;s&&"function"===
typeof s.updateFileNode&&s.updateFileNode(e,A,k(a))})}A.addEventListener("click",function(){x=e}.bind(this),!1);return A}function p(a,b,e,d){this.explorer=b;this.commandService=e;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var q=new g("#{,resource,params*}"),x;p.prototype=new l.SelectionRenderer;p.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};p.prototype.tableCallback=function(a){a.setAttribute("aria-label",
m.Navigator);a.setAttribute("role","presentation")};p.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};p.prototype.emptyCallback=function(b){var e=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var g=document.createElement("div");g.classList.add("noFile");g.textContent=m.NoFile;var k=document.createElement("span");k.appendChild(document.createTextNode(m.File));a.processDOMNodes(g,[k]);d.appendChild(g);e.appendChild(d);b.appendChild(e)};
p.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};p.prototype.getCommitRenderer=function(a,b){return new d.CommitInfoRenderer({parent:a,commitInfo:b})};p.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};p.prototype.setTarget=function(a){this.target=a};p.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};p.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=e(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};p.prototype.updateFileNode=function(a,b,e){};p.prototype.showFolderLinks=!0;p.prototype.getCellElement=function(a,d,g){var k=d.LastCommit?2:1,p=d.LastCommit?3:2,h=d.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),k=document.createElement("span"),k.id=g.id+"MainCol",k.setAttribute("role","presentation"),a.appendChild(k),a.setAttribute("role","presentation"),k.className="mainNavColumn",d.Directory?(this.getExpandImage(g,k),p=this.createFolderNode(d),k.appendChild(p),this.explorer._makeDropTarget(d,p),this.explorer._makeDropTarget(d,g)):(this.openWithCommands||(this.openWithCommands=b.getOpenWithCommands(this.commandService)),p=e("",d,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),k.appendChild(p)),p&&(p.id=g.id+"NameLink",1===p.nodeType&&(f.addNavGrid(this.explorer.getNavDict(),d,p),p.setAttribute("role","link"),p.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,k,d,this.explorer,"tool",null,!0),a;case k:if(this.oneColumn)return null;g=document.createElement("td");d.LocalTimeStamp&&(g.textContent=this.getDisplayTime(d.LocalTimeStamp));return g;case p:if(this.oneColumn)return null;
g=document.createElement("td");!d.Directory&&"number"===typeof d.Length&&(d=parseInt(d.Length,10)/1024,g.textContent=Math.ceil(d).toLocaleString()+" KB");g.style.textAlign="right";return g;case h:if(this.oneColumn||!d.LastCommit)return null;g=document.createElement("td");this.getCommitRenderer(g,d.LastCommit).renderSimple(60);return g}};p.prototype.constructor=p;return{NavigatorRenderer:p,isImage:k,getClickedItem:function(){return x},createLink:e}});
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(m,n,l,f,b,h,g,d,a){function k(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function e(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new k(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}k.prototype.makeRenderFunction=function(e,k,h,r,v){var t=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||d.createOpenWithCommands(t,e,u);var w=this;return function(d,t,C,s){a.when(w.openWithCommands,function(a){if(C)l.empty(k),a=document.createElement("div"),a.appendChild(document.createTextNode(m["Search failed."])),k.appendChild(a),"function"===typeof r&&r(k);else{var B=
function(){function a(b,e){var d=e.folderName?e.folderName:e.path,s=document.createElement("span");s.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");s.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(s)}var b={};return function(e,d){var s=d.name;if(b.hasOwnProperty(s)){a(e,d);var g=b[s];"function"===typeof g&&(b[s]=null,g())}else b[s]=function(){a(e,d)}}}(),E=!1;l.empty(k);if(d&&0<d.length){var D=document.createElement("table");D.setAttribute("role","presentation");for(var G=0;G<d.length;G++){var J=
d[G],F;E||(E=!0,h&&(F=D.insertRow(0).insertCell(0),F.textContent=h));F=D.insertRow(-1).insertCell(0);F.colspan=2;v&&v(F);var w={Name:J.name,Directory:J.directory,Location:J.path||J.location},H=null;"number"===typeof J.LineNumber&&(H={},H.line=J.LineNumber);if(s&&s.keyword&&!s.nameSearch){var L=b.generateSearchHelper(s),H=H||{};H.find=L.inFileQuery.searchStr;H.regEx=L.inFileQuery.wildCard?!0:void 0}w=g.createLink(n.toUrl("edit/edit.html"),w,u,e,a,{"aria-describedby":(J.folderName?J.folderName:J.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},H);J.LineNumber&&w.appendChild(document.createTextNode(" (Line "+J.LineNumber+")"));F.appendChild(w);B(F,J)}k.appendChild(D);"function"===typeof r&&r(k)}!E&&t&&(a=f.formatMessage(m["No matches found for ${0}"],t),l.empty(k),k.appendChild(document.createTextNode(a)),"function"===typeof r&&r(k))}})}};e.prototype={search:function(a,e,d){var g=function(a){for(var d=[],g=0;g<a.response.docs.length;g++){var k=a.response.docs[g],f=k.Location,p=b.path2FolderName(k.Path?
k.Path:k.Location,k.Name),s=p?p:f;(e?0<=s.indexOf(e):1)&&d.push({name:k.Name,path:f,folderName:p,directory:k.Directory,lineNumber:k.LineNumber})}return d};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){d(g(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var e=a.keyword,e=e.substring(e.indexOf("}")+1),e=e.substring(e.indexOf(":")+1);d(g(b),e,null,a)},function(a){d(null,
null,a,null)})}catch(k){"string"===typeof k&&-1<k.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){d(g(b),null,null,a)}):"string"===typeof k&&-1<k.indexOf("search")&&!a.nameSearch?(new h.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){d(g(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(k)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);l.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var e="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?d="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(d=a);d?(this.setLocationbyURL(d.Location),e=d.Name,this._childrenLocation=d.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
e=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);d=l.node("search");e||(e="");if(d&&d.placeholder){d.value="";var g=f.formatMessage(m["Search ${0}"],e);d.placeholder=30<g.length?g.substring(0,27)+"...":f.formatMessage(m["Search ${0}"],e)}d&&d.title&&(d.title=m["Type a keyword or wild card to search in "]+e)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,e,d){e=e?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:e,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:e,sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,fileNamePatterns:d&&d.fileNamePatterns?d.fileNamePatterns:void 0,keyword:a,replace:d?d.replace:void 0}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(m,n){var l={root:n};Object.keys(m).forEach(function(f){"undefined"===typeof l[f]&&(l[f]=m[f])});return l});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(m,n,l,f){var b={};b.CompareCommandFactory=function(){function b(g){this.setOptions(g,!0)}b.prototype={setOptions:function(b,d){d&&(this.options={});this.options||(this.options={});b&&Object.keys(b).forEach(function(a){this.options[a]=b[a]}.bind(this))},getOptions:function(){return this.options},initCommands:function(b){var d=this.options.commandSpanId,a=this.options.commandService;
if(a&&d){var k=new n.Command({name:m["Copy current change from right to left"],tooltip:m["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===b.type&&!b.getImageMode()&&b.options.newFile&&!b.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),e=new n.Command({name:m["Copy current change from left to right"],tooltip:m["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===b.type&&!b.getImageMode()&&b.options.oldFile&&!b.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),f=new n.Command({tooltip:m["Switch to unified diff"],name:m.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"twoWay"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),
h=new n.Command({tooltip:m["Switch to side by side diff"],name:m["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"inline"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),x=new n.Command({name:m["Next diff block"],tooltip:m["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!b.getImageMode()},
callback:function(a){a.items.nextDiff()}}),r=new n.Command({name:m["Previous diff block"],tooltip:m["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!b.getImageMode()},callback:function(a){a.items.prevDiff()}}),v=new n.Command({name:m["Next diff change"],tooltip:m["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!b.getImageMode()},
callback:function(a){a.items.nextChange()}}),t=new n.Command({name:m["Previous diff change"],tooltip:m["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!b.getImageMode()},callback:function(a){a.items.prevChange(a)}});a.addCommand(k);a.addCommand(e);a.addCommand(h);a.addCommand(f);a.addCommand(x);a.addCommand(r);a.addCommand(v);a.addCommand(t);a.registerCommandContribution(d,"orion.compare.toggle2Inline",
108);a.registerCommandContribution(d,"orion.compare.toggle2TwoWay",109);a.registerCommandContribution(d,"orion.compare.copyToLeft",110,null,!1,new l.KeyBinding(37,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.copyToRight",111,null,!1,new l.KeyBinding(39,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.nextDiff",112,null,!1,new l.KeyBinding(40,!0));a.registerCommandContribution(d,"orion.compare.prevDiff",113,null,!1,new l.KeyBinding(38,!0));b.options.wordLevelNav?(a.registerCommandContribution(d,
"orion.compare.nextChange",114,null,!1,new l.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!1,new l.KeyBinding(38,!0,!0))):(a.registerCommandContribution(d,"orion.compare.nextChange",114,null,!0,new l.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!0,new l.KeyBinding(38,!0,!0)))}},renderCommands:function(b){var d=this.options.commandSpanId,a=this.options.commandService;a&&d&&(f.empty(f.node(d)),this.options.gridRenderer&&
this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),a.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):(a.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
a.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):a.renderCommands(d,d,b,b,"tool",null))}};return b}();return b});
define("orion/compare/compareUtils",["orion/URITemplate"],function(m){var n=n||{};n.compareUtils=n.compareUtils||{};n.compareUtils.lookUpMapper=function(l,f,b){for(var h=0,g=0;g<l.length;g++){var d=l[g][f];0===d&&(d=1);if(b>=h&&b<h+d)return{mapperIndex:g,startFrom:h};if(g===l.length-1)break;h+=l[g][f]}return{mapperIndex:l.length-1,startFrom:h}};n.compareUtils.lookUpLineIndex=function(l,f,b){if(0===b)return 0;for(var h=0,g=0;g<b;g++)h+=l[g][f];return h};n.compareUtils.updateMapper=function(l,f,b,h,
g){if(h!==g&&(0<h||0<g)){var d=n.compareUtils.lookUpMapper(l,f,b);if(!(0>d.mapperIndex)){if(0<h){var a=b-d.startFrom;for(b=d.mapperIndex;b<l.length;b++){a=l[b][f]-a;if(h<=a){l[b][f]-=h;break}l[b][f]-=a;h-=a;a=0}}0<g&&(l[d.mapperIndex][f]+=g)}}};n.compareUtils.overlapMapper=function(l,f,b,h,g){l=b+l[f]-1;l<b&&(l=b);g<h&&(g=h);return l<h||g<b?!1:!0};n.compareUtils.findFirstDiff=function(l,f,b,h){for(var g=0,d=null,a=0;a<l.length&&!(g>h)&&(!n.compareUtils.overlapMapper(l[a],f,g,b,h)||!(d={mapperIndex:a,
startFrom:g},0!==l[a][2]));a++)g+=l[a][f];return d};n.compareUtils.matchMapper=function(l,f,b,h){if(0===l.length)return b;var g=b+Math.round((h-b)/3),d=n.compareUtils.findFirstDiff(l,f,b,h),a=0===l[d.mapperIndex][f]?d.startFrom:d.startFrom+l[d.mapperIndex][f]-1,k=n.compareUtils.lookUpLineIndex(l,1-f,d.mapperIndex),e=d.startFrom-b;return 0===l[d.mapperIndex][2]?k-e:g>=d.startFrom&&g<=a?k-Math.round((h-b)/3):g<d.startFrom?k-e:(0===l[d.mapperIndex][1-f]?k:k+l[d.mapperIndex][1-f]-1)-(a-b)};n.compareUtils.getMapperLineCount=
function(l){for(var f=0,b=0;b<l.length;b++)f+=Math.max(l[b][0],l[b][1]);return f};n.compareUtils.getAnnotationIndex=function(l,f){for(var b=0;b<l.length;b++)if(l[b][0]===f)return b;return-1};n.compareUtils.getAnnotationMapperIndex=function(l,f){return l[f][1]};n.compareUtils.getAnnotationIndexByMapper=function(l,f){for(var b=0;b<l.length;b++)if(l[b][1]===f)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};n.compareUtils.isMapperConflict=function(l,f){return 0>f||!l[f][3]?!1:
1===l[f][3]};n.compareUtils.mergeDiffBlocks=function(l,f,b,h,g,d){for(var a=0;a<f.length;a++){var k=f[a][0],e=b[f[a][1]];if(0<e[0]){for(var p="",q=0;q<e[0];q++)p=p+h[e[2]-1+q].substring(g)+d;e=l.getLineCount();k>=e&&(k=l.getLineEnd(e-1),q=l.getLineEnd(e-1,!0),k===q?(l.setText(d,k,k),k=e):k=e-1);k=l.getLineStart(k);l.setText(p,k,k)}}};n.compareUtils.generateCompareHref=function(l,f){var b=require.toUrl("compare/compare.html");f.conflict||(f.conflict=void 0);f.readonly||(f.readonly=void 0);return(new m(b+
"#{,resource,params*}")).expand({resource:l,params:f})};n.compareUtils.generateCompareTreeHref=function(l,f){var b=require.toUrl("compare-tree/compare-tree.html");return(new m(b+"#{,resource,params*}")).expand({resource:l,params:f})};return n.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(m,n){function l(b,f,g){var d=new n;b[f].apply(b,g).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d}function f(b,f){var g=b.getServiceReferences("orion.core.diff"),d,a=g;if(f){a=[];for(d=0;d<g.length;++d)f(g[d])&&a.push(g[d])}var k=[],e=[];for(d=0;d<a.length;++d)k[d]=RegExp(a[d].getProperty("pattern")||".*"),e[d]=b.getService(a[d]);this._getService=function(a){if(-1===a.indexOf("://")){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<k.length;++b)if(k[b].test(a))return e[b];throw m["No Matching DiffService for location:"]+a;}}f.prototype={getDiffContent:function(b){return l(this._getService(b),"getDiffContent",arguments)},getDiffFileURI:function(b){return l(this._getService(b),"getDiffFileURI",arguments)}};return{DiffProvider:f}});
define("orion/compare/diffParser",[],function(){var m=m||{};m.DiffParser=function(){function m(f,b){this._lineDelimiter=f?f:l?"\r\n":"\n";this._diffLineDelimiter=b?b:this._lineDelimiter;this._DEBUG=!1}var l=-1!==window.navigator.platform.indexOf("Win");m.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(f){this._diffLineDelimiter=this._lineDelimiter=f},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(f,b,h,g){this._init();if(""===b)return{outPutFile:f,mapper:[]};this._oFileContents=""===f?[]:f.split(this._lineDelimiter);this._diffContents=b.split(this._diffLineDelimiter);b=this._diffContents.length;this._hunkRanges=[];for(var d=0;d<b;d++){var a=this._parseHunkRange(d);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return{outPutFile:f,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(f=0;f<this._hunkRanges.length;f++)this._parseHunkBlock(f);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(h);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));g||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var f=0;f<this._deltaMap.length;f++)if(console.log(JSON.stringify(this._deltaMap[f])),
0<this._deltaMap[f][2]){console.log("    **Diff content on change/add: \n");for(var b=0;b<this._deltaMap[f][0];b++)console.log("    "+this._diffContents[this._deltaMap[f][2]+b-1])}},_logNewFile:function(){for(var f=0;f<this._nFileContents.length;f++)console.log(this._nFileContents[f])},_createBlock:function(f,b,h,g){g===h&&" "===f||(h=[h,g-h,"s"],"-"===f?h[2]="r":"+"===f?h[2]="a":"c"===f&&(h[2]="c"),b.push(h))},_createMinusBlock:function(f,b,h){var g=this._oBlocks.length;0===g||f!==this._oBlocks[g-
1][0]?(this._oBlocks.push([0===f?1:f,h]),this._nBlocks.push([b,0,-2])):this._oBlocks[g-1][1]+=h},_createPlusBlock:function(f,b,h,g){var d=this._nBlocks.length;0===d||b!==this._nBlocks[d-1][0]?(this._oBlocks.push([0===f?1:f,0]),this._nBlocks.push([b,h,g])):(this._nBlocks[d-1][1]+=h,this._nBlocks[d-1][2]=g)},_parseHunkBlock:function(f){for(var b=" ",h=this._hunkRanges[f][0]+1,g=f===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[f+1][0],d=0,a=0,k=this._hunkRanges[f][1],e=this._hunkRanges[f][3],
p=h,q=h;q<g;q++)if(0!==this._diffContents[q].length){var l=this._diffContents[q][0];if("\\"===l&&("\\ No newline at end of file"===this._diffContents[q].substring(0,this._diffContents[q].length-1)||"\\ No newline at end of file"===this._diffContents[q]))"-"===b?this._oNewLineAtEnd=!1:" "===b?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,q>h&&"\r"===this._diffContents[q-1][this._diffContents[q-1].length-1]&&(this._diffContents[q-1]=this._diffContents[q-1].substring(0,this._diffContents[q-
1].length-1));else{switch(l){case "-":case "+":case " ":break;default:continue}if(b!==l){"+"===l&&(p=q);switch(b){case " ":k=this._hunkRanges[f][1]+d;e=this._hunkRanges[f][3]+a;break;case "-":this._createMinusBlock(k,e,this._hunkRanges[f][1]+d-k);break;case "+":this._createPlusBlock(k,e,this._hunkRanges[f][3]+a-e,p)}b=l}switch(l){case "-":d++;break;case "+":a++;break;case " ":d++,a++}}}switch(b){case "-":this._createMinusBlock(k,e,this._hunkRanges[f][1]+d-k);break;case "+":this._createPlusBlock(k,
e,this._hunkRanges[f][3]+a-e,p)}},_detectConflictes:function(f,b){if(0>f)return!1;for(var h=f+b,g=f;g<h;g++){var d=this._diffContents[g];if(-1<d.indexOf("\x3c\x3c\x3c\x3c\x3c")||-1<d.indexOf("\x3e\x3e\x3e\x3e\x3e"))return!0}return!1},_buildMap:function(f){var b=this._oBlocks.length,h=this._oFileContents.length,g=0,d;d=1;for(var a=0;a<b;a++)d=this._oBlocks[a][0]-d,0<d&&(this._deltaMap.push([d,d,0]),g+=d),f&&this._detectConflictes(this._nBlocks[a][2],this._nBlocks[a][1])?this._deltaMap.push([this._nBlocks[a][1],
this._oBlocks[a][1],this._nBlocks[a][2]+1,1]):this._deltaMap.push([this._nBlocks[a][1],this._oBlocks[a][1],this._nBlocks[a][2]+1]),g+=this._oBlocks[a][1],d=this._oBlocks[a][0]+this._oBlocks[a][1];0<h-d&&(this._deltaMap.push([h-d+1,h-d+1,0]),g+=h-d+1);g<h&&(d=h-g,f=this._deltaMap[this._deltaMap.length-1],0===f[2]?(f[0]+=d,f[1]+=d):-1===f[2]?this._deltaMap.push([d,d,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([d,d,0]):(this._nNewLineAtEnd&&(f[0]+=d),this._oNewLineAtEnd&&(f[1]+=
d)))},_buildNewFile:function(){var f=1,b=!1,h=this._deltaMap.length,g,d;for(g=0;g<h;g++){b=!1;if(0===this._deltaMap[g][2]){for(d=0;d<this._deltaMap[g][0];d++)this._nFileContents.push(this._oFileContents[f+d-1]);b=!0}else if(0<this._deltaMap[g][2])for(d=0;d<this._deltaMap[g][0];d++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+d-1].substring(1));f+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!b&&this._nFileContents.push("")},_converHRangeBody:function(f,b){if(f){var h=parseInt(f,10);
b.push(0<=h?h:1)}else b.push(1)},_parseHunkRange:function(f){var b=this._diffContents[f],h=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,g=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(b),d=null;if(g&&5===g.length)d=[f],this._converHRangeBody(g[1],d),this._converHRangeBody(g[2],d),this._converHRangeBody(g[3],d),this._converHRangeBody(g[4],d);else if((g=h.exec(b))&&5===g.length)d=[f],this._converHRangeBody(g[3],d),this._converHRangeBody(g[4],
d),this._converHRangeBody(g[1],d),this._converHRangeBody(g[2],d);return d}};return m}();return m});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(m){var n=n||{};n.CompareRuler=function(){function l(f,b,h){this._location=f||"left";this._overview=b||"page";this._rulerStyle=h;this._editor=null;var g=this;this._listener={onModelChanged:function(b){g._onModelChanged(b)}}}l.prototype={setView:function(f){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=f;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(f){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(f){},isAnnotationTypeVisible:function(f){return!1},removeAnnotationType:function(f){},setAnnotationModel:function(f){},getAnnotations:function(f,b){for(var h=[],g=f;g<b;g++){var d=this.getStyle(g);d&&(h[g]={html:this.getHTML(g),style:d})}return h},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return l}();n.LineNumberCompareRuler=function(){function l(f,b,h,g,d,a){n.CompareRuler.call(this,h,"page",g);this._diffNavigator=f;this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=a||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}l.prototype=new n.CompareRuler;l.prototype.getStyle=function(f){return void 0===f?this._rulerStyle:this._evenStyle};l.prototype.getHTML=function(f){var b=
this._editor.getModel(),h=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);return!h?"":-1===f?b.getLineCount():h.getLineNumber?(f=h.getLineNumber(f),-1===f?"":f+1):f+1};l.prototype._onModelChanged=function(f){var b=f.start,h=this._editor.getModel();f=h.getLineCount();var g=(f+"").length;this._numOfDigits!==g&&(this._numOfDigits=g,b=h.getLineAtOffset(b),this._editor.redrawLines(b,f,this))};return l}();n.CompareOverviewRuler=function(){function l(f,b,h,g){this._diffNavigator=h;this._onClick=
g;n.CompareRuler.call(this,f,"document",b)}l.prototype=new n.CompareRuler;l.prototype.getStyle=function(f){var b,h;if(void 0===f)b=this._rulerStyle||{},h=b.style||(b.style={}),h.lineHeight="1px",h.fontSize="1px",h.width="14px";else if(b=-1!==f?{styleClass:"annotationOverview breakpoint"}:{},h=b.style||(b.style={}),h.cursor="pointer",h.width="8px",h.left="2px",0<=f){var g;if(this._diffNavigator&&this._diffNavigator.getFeeder())g=this._diffNavigator.getFeeder().getDiffBlocks();else return null;f=m.getAnnotationIndex(g,
f);if(-1===f)return null;g=m.getAnnotationMapperIndex(g,f);var d;d=this._diffNavigator.getMapper();if(g=m.isMapperConflict(d,g))h.border="1px #FF0000 solid";f===this._diffNavigator.getCurrentBlockIndex()&&(h.backgroundColor=g?"red":"blue");f=this._diffNavigator.getFeeder().getDiffBlockH(f);g=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>f)return null;d=this._editor.getClientArea();f=Math.floor(d.height*f/g);2>f&&(f=2);h.height=f+"px"}else return null;return b};l.prototype.setDiffNavigator=
function(f){this._diffNavigator=f};l.prototype.getHTML=function(f){return"\x26nbsp;"};l.prototype.onClick=function(f,b){void 0!==f&&this._onClick(f,this)};l.prototype._onModelChanged=function(f){0<this._editor.getModel().getLineCount()&&this._editor.redrawLines(0,1,this)};return l}();n.CompareCurveRuler=function(){function l(f){this._canvasDiv=f;this._mapper=void 0}l.prototype={init:function(f,b,h,g){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=f;this._leftEditor=b;this._rightEditor=
h;this._leftTextView=b.getTextView();this._rightTextView=h.getTextView();this._diffNavigator=g;this.render()},matchPositionFrom:function(f){var b=f?this._leftTextView:this._rightTextView,h=f?this._rightTextView:this._leftTextView,g=b.getTopIndex(),b=b.getBottomIndex();f=m.matchMapper(this._mapper,f?0:1,g,b);h.setTopIndex(f)},copyTo:function(f){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();if(b&&("word"===b.type?!b.copied&&!b.parent.copied:!b.copied)){var h=f?this._rightTextView.getText(b.oldA.start,
b.oldA.end):this._leftTextView.getText(b.newA.start,b.newA.end),g=f?b.newA:b.oldA;(f?this._leftTextView:this._rightTextView).setText(h,g.start,g.end);b.copied=!0}}},render:function(){if(this._mapper){var f=this._canvasDiv.getContext("2d");f.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);f.strokeStyle="#AAAAAA";f.lineWidth=1;f.beginPath();var b=this._leftTextView.getTopIndex(),h=this._leftTextView.getBottomIndex(),g=this._rightTextView.getTopIndex(),d=this._rightTextView.getBottomIndex();
this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var a=0,k=0,e=!1,p=0;p<this._mapper.length;p++){if(0!==this._mapper[p][2])if(m.overlapMapper(this._mapper[p],0,a,b,h)||m.overlapMapper(this._mapper[p],1,k,g,d))this._renderCurve(p,a,k,this._canvasDiv,f,b,h,g,d),e=!0;else if(e)break;a+=this._mapper[p][0];k+=this._mapper[p][1]}f.stroke()}},_renderCurve:function(f,b,h,g,d,a,k,e,p){a=this._mapper[f];b=this._leftTextView.getLinePixel(b+a[0]/2)+a[0]%
2*this._leftLineH/3-this._leftTextView.getTopPixel();h=this._rightTextView.getLinePixel(h+a[1]/2)+a[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel();g=g.parentNode.clientWidth;f===this._diffNavigator.getCurrentMapperIndex()?(d.stroke(),d.strokeStyle="#000",d.lineWidth=1,d.beginPath(),d.moveTo(0,b),d.bezierCurveTo(g/3,b,0.666*g,h,g,h),d.stroke(),d.strokeStyle="#AAAAAA",d.lineWidth=1,d.beginPath()):(d.moveTo(0,b),d.bezierCurveTo(g/3,b,0.666*g,h,g,h),d.stroke())},onChanged:function(f,b){var h=
b?this._rightIniting:this._leftIniting;if(f.removedLineCount!==f.addedLineCount){var g=b?this._rightTextView:this._leftTextView;h||m.updateMapper(this._mapper,b?1:0,g.getModel().getLineAtOffset(f.start),f.removedLineCount,f.addedLineCount);(0<f.removedLineCount||0<f.addedLineCount)&&this.render()}b?this._rightIniting=!1:this._leftIniting=!1;return h}};return l}();return n});
define("orion/editor/i18n",{load:function(m,n,l,f){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+m],function(b){l(b)}):n(["orion/editor/config"],function(b){l(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(m,n){var l={root:n},f;for(f in m)m.hasOwnProperty(f)&&"undefined"===typeof l[f]&&(l[f]=m[f]);return l});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(m,n,l){function f(b,f){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(f)}f.prototype={destroy:function(){},find:function(b){1<this._text.length&&(this._text=[this._text.join("")]);var f=b.string,g=b.regex,d=f,a="",k=b.caseInsensitive;if(d)if(g){if(f=n.parse(d))d=f.pattern,a=f.flags}else d=f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),k&&(d=d.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var e=null,p;if(d){var f=b.reverse,q=b.wrap,g=b.wholeWord,l=b.start||0;b=b.end;var m=null!==b&&void 0!==b;-1===a.indexOf("g")&&(a+="g");-1===a.indexOf("m")&&(a+="m");k&&-1===a.indexOf("i")&&(a+="i");g&&(d="\\b"+d+"\\b");var v=this._text[0],t,u,w=0;m&&(k=l<b?l:b,v=v.substring(k,l<b?b:l),w=k);var z=RegExp(d,a);f?p=function(){var a=null;for(z.lastIndex=0;;){u=z.lastIndex;t=z.exec(v);if(u===z.lastIndex)return null;if(t){if(!(t.index+w<l)){if(!q||a)break;l=v.length+w}a={start:t.index+
w,end:z.lastIndex+w}}else break}a&&(l=a.start);return a}:(m||(z.lastIndex=l),p=function(){for(;;){u=z.lastIndex;t=z.exec(v);if(u===z.lastIndex)break;if(t)return{start:t.index+w,end:z.lastIndex+w};if(!(0!==u&&q))break}return null});e=p()}return{next:function(){var a=e;a&&(e=p());return a},hasNext:function(){return null!==e}}},getCharCount:function(){for(var b=0,f=0;f<this._text.length;f++)b+=this._text[f].length;return b},getLine:function(b,f){var g=this.getLineCount();if(!(0<=b&&b<g))return null;
var d=this._lineOffsets[b];if(b+1<g){g=this.getText(d,this._lineOffsets[b+1]);if(f)return g;for(var d=g.length,a;10===(a=g.charCodeAt(d-1))||13===a;)d--;return g.substring(0,d)}return this.getText(d)},getLineAtOffset:function(b){var f=this.getCharCount();if(!(0<=b&&b<=f))return-1;var g=this.getLineCount();if(b===f)return g-1;var d,a,k=this._lastLineIndex;if(0<=k&&k<g&&(d=this._lineOffsets[k],a=k+1<g?this._lineOffsets[k+1]:f,d<=b&&b<a))return k;for(var e=g,p=-1;1<e-p;)if(k=Math.floor((e+p)/2),d=this._lineOffsets[k],
a=k+1<g?this._lineOffsets[k+1]:f,b<=d)e=k;else if(b<a){e=k;break}else p=k;return this._lastLineIndex=e},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,f){var g=this.getLineCount();if(!(0<=b&&b<g))return-1;if(b+1<g){g=this._lineOffsets[b+1];if(f)return g;for(var d=this.getText(Math.max(this._lineOffsets[b],g-2),g),a=d.length,k;10===(k=d.charCodeAt(a-1))||13===k;)a--;return g-(d.length-a)}return this.getCharCount()},
getLineStart:function(b){return!(0<=b&&b<this.getLineCount())?-1:this._lineOffsets[b]},getText:function(b,f){void 0===b&&(b=0);void 0===f&&(f=this.getCharCount());if(b===f)return"";for(var g=0,d=0,a;d<this._text.length;){a=this._text[d].length;if(b<=g+a)break;g+=a;d++}for(var k=g,e=d;d<this._text.length;){a=this._text[d].length;if(f<=g+a)break;g+=a;d++}if(e===d)return this._text[e].substring(b-k,f-g);k=this._text[e].substring(b-k);g=this._text[d].substring(0,f-g);return k+this._text.slice(e+1,d).join("")+
g},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b,f){"auto"===b&&(b=void 0,1<this.getLineCount()&&(b=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=b?b:l.platformDelimiter;if(f){var g=this.getLineCount();if(1<g){for(var d=Array(g),a=0;a<g;a++)d[a]=this.getLine(a);this.setText(d.join(this._lineDelimiter))}}},setText:function(b,f,g){void 0===b&&(b="");void 0===f&&(f=0);void 0===g&&(g=
this.getCharCount());if(!(f===g&&""===b)){for(var d=this.getLineAtOffset(f),a=this.getLineAtOffset(g),k=f,e=g-f,p=a-d,q=b.length,l=0,m=this.getLineCount(),v=0,n=0,u=0,w=[];;){-1!==v&&v<=u&&(v=b.indexOf("\r",u));-1!==n&&n<=u&&(n=b.indexOf("\n",u));if(-1===n&&-1===v)break;u=-1!==v&&-1!==n?v+1===n?n+1:(v<n?v:n)+1:-1!==v?v+1:n+1;w.push(f+u);l++}this.onChanging({type:"Changing",text:b,start:k,removedCharCount:e,addedCharCount:q,removedLineCount:p,addedLineCount:l});0===w.length&&(u=this.getLineStart(d),
a=a+1<m?this.getLineStart(a+1):this.getCharCount(),f!==u&&(b=this.getText(u,f)+b,f=u),g!==a&&(b+=this.getText(g,a),g=a));u=q-e;for(a=d+p+1;a<m;a++)this._lineOffsets[a]+=u;if(5E4>w.length)d=[d+1,p].concat(w),Array.prototype.splice.apply(this._lineOffsets,d);else{u=d+1;this._lineOffsets.splice(u,p);for(m=0;m<w.length;m+=5E4)d=[u,0].concat(w.slice(m,Math.min(w.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,d),u+=5E4}for(u=m=0;u<this._text.length;){a=this._text[u].length;if(f<=m+a)break;
m+=a;u++}d=m;for(w=u;u<this._text.length;){a=this._text[u].length;if(g<=m+a)break;m+=a;u++}a=this._text[u];f=this._text[w].substring(0,f-d);g=a.substring(g-m);w=[w,u-w+1];f&&w.push(f);b&&w.push(b);g&&w.push(g);Array.prototype.splice.apply(this._text,w);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:k,removedCharCount:e,addedCharCount:q,removedLineCount:p,addedLineCount:l})}}};m.EventTarget.addMixin(f.prototype);return{TextModel:f}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(m,n){function l(b){b&&(this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function f(b){l.call(this,b)}l.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var f=[],g=this._keyBindings,d=0;d<g.length;d++)g[d].actionID===b&&f.push(g[d].keyBinding);return f},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 f=this._keyBindingIndex,g=this._matchingKeyBindings||this._keyBindings,d=[],a=0;a<g.length;a++){var k=g[a],e=k.keyBinding.match(b,f);if(!0===e)return this._keyBindingIndex=0,this._matchingKeyBindings=null,k.actionID;"number"===typeof e&&d.push(k)}if(0===d.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(b,f){for(var g=this._keyBindings,
d=0;d<g.length;d++){var a=g[d];if(a.keyBinding.equals(b)){f?a.actionID=f:a.predefined?a.actionID="noop":g.splice(d,1);return}}f&&g.push({keyBinding:b,actionID:f})},setView:function(b){this._view=b}};f.prototype=new l;f.prototype.createKeyBindings=function(){var b=m.KeyBinding,f=[];f.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});f.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});f.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});f.push({actionID:"charNext",
keyBinding:new b(39),predefined:!0});n.isMac?(f.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),f.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),f.push({actionID:"wordPrevious",
keyBinding:new b(37,null,null,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),f.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),f.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),f.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),f.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,!0),predefined:!0}),f.push({actionID:"scrollPageDown",
keyBinding:new b(40,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(f.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new b(34),predefined:!0}),
f.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),f.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),f.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(f.push({actionID:"lineUp",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"lineDown",
keyBinding:new b(40,!0),predefined:!0}));n.isWindows&&(f.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),f.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));f.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});f.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});f.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});f.push({actionID:"selectCharNext",keyBinding:new b(39,null,!0),
predefined:!0});f.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});f.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});n.isMac?(f.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new b(39,null,!0,!0),predefined:!0}),
f.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),f.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineStart",
keyBinding:new b(38,null,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(n.isLinux&&(f.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),f.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),f.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",
keyBinding:new b(37,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));f.push({actionID:"undo",keyBinding:new m.KeyBinding("z",!0),predefined:!0});n.isMac?f.push({actionID:"redo",keyBinding:new m.KeyBinding("z",!0,!0),predefined:!0}):f.push({actionID:"redo",keyBinding:new m.KeyBinding("y",!0),predefined:!0});
f.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});f.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});f.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});f.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});f.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
f.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});f.push({actionID:"enter",keyBinding:new b(13),predefined:!0});f.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});f.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});f.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});n.isMac&&(f.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
predefined:!0}),f.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));f.push({actionID:"toggleWrapMode",keyBinding:new m.KeyBinding("w",!0,!1,!0)});f.push({actionID:"toggleOverwriteMode",keyBinding:new m.KeyBinding(45)});if(!n.isFirefox){var g=n.isMac&&n.isChrome;f.push({actionID:"noop",keyBinding:new b("u",!g,!1,!1,g),predefined:!0});f.push({actionID:"noop",keyBinding:new b("i",!g,!1,!1,g),predefined:!0});f.push({actionID:"noop",keyBinding:new b("b",!g,!1,!1,g),predefined:!0})}n.isFirefox&&
(f.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),f.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),f.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));n.isMac&&(f.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
!1,!0),predefined:!0}),f.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(f.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(f.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return f};return{KeyMode:l,DefaultKeyMode:f}});
define("orion/editor/util",[],function(){return{contains:function(m,n){if(!n)return!1;if(!m.compareDocumentPosition){for(var l=n;l;){if(m===l)return!0;l=l.parentNode}return!1}return m===n||0!==(m.compareDocumentPosition(n)&16)},addEventListener:function(m,n,l,f){"function"===typeof m.addEventListener?m.addEventListener(n,l,!0===f):m.attachEvent("on"+n,l)},removeEventListener:function(m,n,l,f){"function"===typeof m.removeEventListener?m.removeEventListener(n,l,!0===f):m.detachEvent("on"+n,l)},Animation:function(){function m(m){this.options=
m}m.prototype.play=function(){var m="number"===typeof this.options.duration?this.options.duration:350,l=this.options.easing||this.defaultEasing,f=this.options.onAnimate||function(){},b=this.options.curve[0],h=this.options.curve[1],g=h-b,d=-1,a,k=this;this.interval=this.options.window.setInterval(function(){d=-1===d?(new Date).getTime():d;var e=((new Date).getTime()-d)/m;1>e?(e=l(e),a=b+e*g,f(a)):(f(h),k.stop())},"number"===typeof this.options.rate?this.options.rate:20)};m.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};m.prototype.defaultEasing=function(m){return Math.sin(m*(Math.PI/2))};return m}()}});
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(m,n,l,f,b,h,g){function d(a,b,e){if(e){b.className="";e=b.attributes;for(var d=e.length;0<d--;)(!g.isIE||9<=g.isIE||9>g.isIE&&e[d].specified)&&b.removeAttribute(e[d].name)}if(a){a.styleClass&&(b.className=a.styleClass);if(e=a.style)for(var f in e)e.hasOwnProperty(f)&&(b.style[f]=e[f]);if(a=a.attributes)for(var k in a)a.hasOwnProperty(k)&&
b.setAttribute(k,a[k])}}function a(a){return a instanceof Array?a.slice(0):a}function k(a,b){if(!a)return b;if(!b)return a;for(var e in b)b.hasOwnProperty(e)&&(a.hasOwnProperty(e)||(a[e]=b[e]));return a}function e(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 d=0;d<a.length;d++)if(!e(a[d],b[d]))return!1;return!0}if(!(a instanceof
Object)||!(b instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)&&(!b.hasOwnProperty(d)||!e(a[d],b[d])))return!1;for(d in b)if(!a.hasOwnProperty(d))return!1;return!0}function p(a,b,e){for(var d=0,g=0,f=0,k=a.length;f<k;){-1!==d&&d<=f&&(d=a.indexOf("\r",f));-1!==g&&g<=f&&(g=a.indexOf("\n",f));var p=f,h;if(-1===g&&-1===d){b(a.substring(f));break}-1!==d&&-1!==g?d+1===g?(h=d,f=g+1):(h=d<g?d:g,f=(d<g?d:g)+1):-1!==d?(h=d,f=d+1):(h=g,f=g+1);b(a.substring(p,h));e()}}function q(a){var b,e,d,g,f=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;f.getComputedStyle?(a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),e=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),g=a.getPropertyValue("padding-bottom")):a.currentStyle&&(b=a.currentStyle.paddingLeft,e=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,g=a.currentStyle.paddingBottom);return{left:parseInt(b,10)||0,top:parseInt(e,10)||0,right:parseInt(d,10)||0,bottom:parseInt(g,10)||0}}function x(a){var b,
e,d,g,f=a._trim;if(!f){var f=q(a),k=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;k.getComputedStyle?(g=k.getComputedStyle(a,null),b=g.getPropertyValue("border-left-width"),e=g.getPropertyValue("border-top-width"),d=g.getPropertyValue("border-right-width"),g=g.getPropertyValue("border-bottom-width")):a.currentStyle&&(b=a.currentStyle.borderLeftWidth,e=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,g=a.currentStyle.borderBottomWidth);b=parseInt(b,10)||0;e=parseInt(e,10)||
0;d=parseInt(d,10)||0;g=parseInt(g,10)||0;f.left+=b;f.top+=e;f.right+=d;f.bottom+=g;a._trim=f}return f}function r(a,b,e,d){function g(b){if(b.animationName===k){var e=b.target;"function"===typeof e.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){e.__DOMReady()},0)}}function f(a,b){for(var e=["","-webkit-","-moz-","-ms-","-o-"],d="",g="body ."+a+" {\n",s=0;s<e.length;s++)d+="@"+e[s]+"keyframes "+b+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",g+=e[s]+"animation-duration: 0.001s;\n"+
e[s]+"animation-name: "+b+";\n";return d+(g+"}")}e="_"+e+"DOMReady";b.className=b.className?b.className+" "+e:e;b.__DOMReady=d;d=e+"Style";if(!a.getElementById(d)){var k=e+"Animation";z(a,"animationstart",g,!1);z(a,"MSAnimationStart",g,!1);z(a,"webkitAnimationStart",g,!1);b=a.createElement("style");b.id=d;d=a.getElementsByTagName("head")[0]||a.documentElement;b.appendChild(a.createTextNode(f(e,k)));d.insertBefore(b,d.firstChild)}}function v(a,b,e){this.start=a;this.end=b;this.caret=e}function t(a){this.left=
a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function u(a,b,e){this.view=a;this.lineIndex=b;this._lineDiv=e}function w(a){this._init(a||{})}var z=h.addEventListener,y=h.removeEventListener,C=h.Animation;v.prototype={clone:function(){return new v(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}};t.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};
u.prototype={create:function(a,b){if(!this._lineDiv){var e=this._lineDiv=this._createLine(a,b,this.lineIndex);e._line=this;return e}},_createLine:function(a,b,f){var k=this.view,p=k._model,h=p.getLine(f),q=p.getLineStart(f),l={type:"LineStyle",textView:k,lineIndex:f,lineText:h,lineStart:q};k.onLineStyle(l);var m=a.ownerDocument,p=b||g.createElement(m,"div");if(!b||!e(b.viewStyle,l.style))d(l.style,p,b),b&&(b._trim=null),p.viewStyle=l.style,p.setAttribute("role","presentation");p.lineIndex=f;if(b&&
p.viewLineText===h&&e(l.ranges,p.viewRanges))return p;p.viewRanges=l.ranges;p.viewLineText=h;f=[];this._createRanges(l.ranges,h,0,h.length,q,{tabOffset:0,ranges:f});l=" ";!k._fullSelection&&9>g.isIE&&(l="\ufeff");k={text:l,style:k._metrics.largestFontStyle,ignoreChars:1};0===f.length||!f[f.length-1].style||"div"!==f[f.length-1].style.tagName?f.push(k):f.splice(f.length-1,0,k);var x,r,v,n=l=0;if(g.isFirefox&&2E3<h.length){b&&(p.innerHTML="",b.lineWidth=void 0);b=m.createDocumentFragment();for(h=0;h<
f.length;h++)k=f[h],q=k.text,x=k.style,x=this._createSpan(p,q,x,k.ignoreChars),b.appendChild(x);p.appendChild(b)}else{var t,u;if(b){if(r=b.modelChangedEvent)0===r.removedLineCount&&0===r.addedLineCount?(u=r.start-q,t=r.addedCharCount-r.removedCharCount):u=-1,b.modelChangedEvent=void 0;r=b.firstChild}for(h=0;h<f.length;h++){k=f[h];q=k.text;l+=q.length;x=k.style;if(r)if(v=r.firstChild.data,m=r.viewStyle,v===q&&e(x,m)){n+=v.length;r._rectsCache=void 0;x=r=r.nextSibling;continue}else for(;r;){if(-1!==
u){m=l;m>=u&&(m-=t);v=(v=r.firstChild.data)?v.length:0;if(n+v>m)break;n+=v}m=r.nextSibling;p.removeChild(r);r=m}x=this._createSpan(p,q,x,k.ignoreChars);r?p.insertBefore(x,r):p.appendChild(x);b&&(b.lineWidth=void 0)}if(b)for(t=x?x.nextSibling:null;t;)m=t.nextSibling,b.removeChild(t),t=m}p.parentNode||a.appendChild(p);return p},_createRanges:function(a,b,d,g,f,k){if(!(d>g)){if(a)for(var p=0;p<a.length;p++){var h=a[p];if(!(h.end<f+d)){var q=Math.max(f+d,h.start)-f;if(q>g)break;var l=Math.min(f+g,h.end)-
f;if(q<=l){q=Math.max(d,q);l=Math.min(g,l);d<q&&this._createRange(b,d,q,null,k);if(!h.style||!h.style.unmergeable)for(;p+1<a.length&&a[p+1].start-f===l&&e(h.style,a[p+1].style);)h=a[p+1],l=Math.min(f+g,h.end)-f,p++;this._createRange(b,q,l,h.style,k);d=l}}}d<g&&this._createRange(b,d,g,null,k)}},_createRange:function(a,b,e,d,g){if(!(b>e)){var f=this.view._customTabSize;if(f&&8!==f)for(var k=a.indexOf("\t",b);-1!==k&&k<e;){b<k&&(b={text:a.substring(b,k),style:d},g.ranges.push(b),g.tabOffset+=b.text.length);
b=f-g.tabOffset%f;if(0<b){for(var p="\u00a0",h=1;h<b;h++)p+=" ";b={text:p,style:d,ignoreChars:b-1};g.ranges.push(b);g.tabOffset+=b.text.length}b=k+1;if(b===e)return;k=a.indexOf("\t",b)}b<=e&&(b={text:a.substring(b,e),style:d},g.ranges.push(b),g.tabOffset+=b.text.length)}},_createSpan:function(a,b,e,f){var k=this.view,p="span";e&&e.tagName&&(p=e.tagName.toLowerCase());var h="a"===p;h&&(this.hasLink=!0);h&&!k._linksVisible&&(p="span");h=a.ownerDocument;a=g.createElement(a.ownerDocument,p);a.appendChild(h.createTextNode(e&&
e.text?e.text:b));e&&e.html?(a.innerHTML=e.html,a.ignore=!0):e&&e.node&&(a.appendChild(e.node),a.ignore=!0);d(e,a);if("a"===p){var q=k._getWindow();z(a,"click",function(a){return k._handleLinkClick(a?a:q.event)},!1)}a.viewStyle=e;f&&(a.ignoreChars=f);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var e=this._ensureCreated(),d=this.view;if(void 0===a)return this._getLineBoundingClientRect(e,
!0);var f=d._model,k=e.ownerDocument,p=this.lineIndex,h=null;if(a<f.getLineEnd(p)){var q=f.getLineStart(p);this.forEach(function(b){var f=b.firstChild,p=this._nodeLength(b);if(q+p>a){var A=a-q;if(1===f.length)h=new t(b.getBoundingClientRect());else if(d._isRangeRects)p=k.createRange(),p.setStart(f,A),p.setEnd(f,A+1),h=new t(p.getBoundingClientRect());else if(g.isIE)p=k.body.createTextRange(),p.moveToElementText(b),p.collapse(),(f=0===A&&8===g.isIE)&&(A=1),p.moveEnd("character",A+1),p.moveStart("character",
A),h=new t(p.getBoundingClientRect()),f&&(h.left=b.getClientRects()[0].left);else{var l=f.data;b.removeChild(f);b.appendChild(k.createTextNode(l.substring(0,A)));var m=g.createElement(k,"span");m.appendChild(k.createTextNode(l.substring(A,A+1)));b.appendChild(m);b.appendChild(k.createTextNode(l.substring(A+1)));h=new t(m.getBoundingClientRect());b.innerHTML="";b.appendChild(f);this._createdDiv||(b=d._getSelection(),(q<=b.start&&b.start<q+p||q<=b.end&&b.end<q+p)&&d._updateDOMSelection())}g.isIE&&(A=
e.ownerDocument.defaultView||e.ownerDocument.parentWindow,b=A.screen.logicalXDPI/A.screen.deviceXDPI,A=A.screen.logicalYDPI/A.screen.deviceYDPI,h.left*=b,h.right*=b,h.top*=A,h.bottom*=A);return!1}q+=p;return!0})}f=this.getBoundingClientRect();h||(d._wrapMode?(p=this.getClientRects(),h=p[p.length-1],h.left=h.right,h.left+=f.left,h.top+=f.top,h.right+=f.left,h.bottom+=f.top):(h=new t(f),h.left=h.right));if(b||void 0===b)h.left-=f.left,h.top-=f.top,h.right-=f.left,h.bottom-=f.top;return h},forEach:function(a){for(var b=
this._ensureCreated().firstChild;b;){var e=b.nextSibling;if(!b.ignore&&!a.call(this,b))break;b=e}},_getClientRects:function(a,b){var e,d,g,f;if(!a._rectsCache){e=a.getClientRects();d=Array(e.length);for(f=0;f<e.length;f++)g=d[f]=new t(e[f]),g.left-=b.left,g.top-=b.top,g.right-=b.left,g.bottom-=b.top;a._rectsCache=d}e=a._rectsCache;d=[e.length];for(f=0;f<e.length;f++)d[f]=new t(e[f]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var b=[],e=this._ensureCreated().getBoundingClientRect();
this.forEach(function(a){a=this._getClientRects(a,e);for(var d=0;d<a.length;d++){var g=a[d],f,k;if(g.top!==g.bottom){var s=g.top+(g.bottom-g.top)/2;for(f=0;f<b.length&&!(k=b[f],k.top<=s&&s<k.bottom);f++);f===b.length?b.push(g):(g.left<k.left&&(k.left=g.left),g.top<k.top&&(k.top=g.top),g.right>k.right&&(k.right=g.right),g.bottom>k.bottom&&(k.bottom=g.bottom))}}return!0});return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,b){var e=new t(a.getBoundingClientRect());if(!this.view._wrapMode){e.right=
e.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;d&&(d=d.getBoundingClientRect(),e.right=d.right+x(a).right)}b&&(d=x(a),e.left+=d.left,e.right-=d.right);return e},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;var b=this.getClientRects();a=this.getBoundingClientRect(a);a=a.top+(a.bottom-a.top)/2;for(var e=0;e<b.length;e++)if(b[e].top<=a&&a<b[e].bottom)return e;return b.length-
1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(this.lineIndex);var b=this.getClientRects();return this.getOffset(b[a].left+1,b[a].top+1)},_nodeLength:function(a){if(!a||a.ignore)return 0;var b=a.firstChild.length;a.ignoreChars&&(b-=a.ignoreChars);return b},getModelOffset:function(a,b){if(!a)return 0;var e=0;this.forEach(function(d){var g=d.firstChild;if(g===a)return d.ignoreChars&&(e-=d.ignoreChars),e+=b,!1;d.ignoreChars&&(e-=d.ignoreChars);e+=g.data.length;
return!0});return Math.max(0,e)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var b=0,e,d,g=this.view._model,f=g.getLineStart(this.lineIndex),k=a-f,p=g.getLineEnd(this.lineIndex)-f;this.forEach(function(a){var g=a.firstChild,f=this._nodeLength(a);if(f+b>k||b+f>=p)return e=g,d=k-b,a.ignoreChars&&(0<f&&d===f)&&(d+=a.ignoreChars),!1;b+=f;return!0});return{node:e,offset:d}},getText:function(a){var b="",e=0;this.forEach(function(d){var g;if(d.ignoreChars){g=d.lastChild;for(var f=
0,k=[],p=-1;g;){var h=g.data;if(h)for(var q=h.length-1;0<=q;q--){var l=h.substring(q,q+1);f<d.ignoreChars&&(" "===l||"\ufeff"===l)?f++:k.push("\u00a0"===l?"\t":l)}a===g&&(p=k.length);g=g.previousSibling}k=k.reverse().join("");-1!==p&&(e=b.length+k.length-p);b+=k}else for(g=d.firstChild;g;)a===g&&(e=b.length),b+=g.data,g=g.nextSibling;return!0});return{text:b,offset:e}},getOffset:function(a,b){function e(d,B,q){var r=d.firstChild,E=x._nodeLength(d),v=l.ownerDocument,n=v.defaultView||v.parentWindow,
t=g.isIE?n.screen.logicalXDPI/n.screen.deviceXDPI:1,u=g.isIE?n.screen.logicalYDPI/n.screen.deviceYDPI:1,w,z,y,n=q.left+m.left,C,I;if(g.isIE||f._isRangeRects){for(var v=f._isRangeRects?v.createRange():v.body.createTextRange(),K=E,T=-1;1<K-T;){var S=Math.floor((K+T)/2);q=T+1;w=S===E-1&&d.ignoreChars?r.length:S+1;C=0===q&&8===g.isIE;f._isRangeRects?(v.setStart(r,q),v.setEnd(r,w)):(C&&(q=1),v.moveToElementText(d),v.move("character",q),v.moveEnd("character",w-q));I=v.getClientRects();for(var X=!1,R=0;R<
I.length;R++)if(q=I[R],w=(C?n:q.left)*t-m.left,y=q.right*t-m.left,z=q.top*u-m.top,q=q.bottom*u-m.top,w<=a&&a<y&&(!f._wrapMode||z<=b&&b<q)){X=!0;break}X?K=S:T=S}B+=K;q=K;w=K===E-1&&d.ignoreChars?r.length:Math.min(K+1,r.length);f._isRangeRects?(v.setStart(r,q),v.setEnd(r,w)):(v.moveToElementText(d),v.move("character",q),v.moveEnd("character",w-q));I=v.getClientRects();E=!1;0<I.length&&(q=I[0],w=(C?n:q.left)*t-m.left,y=q.right*t-m.left,E=a>w+(y-w)/2);d=B-h;r=k.getLine(p);t=r.charCodeAt(d);55296<=t&&
56319>=t&&E?d<r.length&&(t=r.charCodeAt(d+1),56320<=t&&57343>=t&&(B+=1)):56320<=t&&(57343>=t&&!E)&&0<d&&(t=r.charCodeAt(d-1),55296<=t&&56319>=t&&(B-=1));E&&B++}else{t=[];for(C=0;C<E;C++)t.push("\x3cspan\x3e"),C===E-1?t.push(r.data.substring(C)):t.push(r.data.substring(C,C+1)),t.push("\x3c/span\x3e");d.innerHTML=t.join("");for(t=d.firstChild;t;){q=t.getBoundingClientRect();w=q.left-m.left;y=q.right-m.left;if(w<=a&&a<y){a>w+(y-w)/2&&B++;break}B++;t=t.nextSibling}x._createdDiv||(d.innerHTML="",d.appendChild(r),
d=f._getSelection(),(B<=d.start&&d.start<B+E||B<=d.end&&d.end<B+E)&&f._updateDOMSelection())}return B}function d(e){if(e.ignore)return null;e=x._getClientRects(e,m);for(var g=0;g<e.length;g++){var k=e[g];if(k.left<=a&&a<k.right&&(!f._wrapMode||k.top<=b&&b<k.bottom))return k}return null}var f=this.view,k=f._model,p=this.lineIndex,h=k.getLineStart(p),q=k.getLineEnd(p);if(h===q)return h;var l=this._ensureCreated(),m=this.getBoundingClientRect(),x=this,r,v;if(f._wrapMode){r=this.getClientRects();b<r[0].top&&
(b=r[0].top);for(var n=0;n<r.length&&!(v=r[n],v.top<=b&&b<v.bottom);n++);a<v.left&&(a=v.left);a>v.right&&(a=v.right-1)}else 0>a&&(a=0),a>m.right-m.left&&(a=m.right-m.left);var t,u;if(this._lastHitChild&&this._lastHitChild.parentNode){if(t=this._lastHitOffset,u=this._lastHitChild,v=d(u),!v){r=t;for(var n=t+this._nodeLength(u),w=u.previousSibling,z=u.nextSibling;w||z;){if(w){r-=this._nodeLength(w);if(v=d(w)){u=w;t=r;break}w=w.previousSibling}if(z){if(v=d(z)){u=z;t=n;break}n+=this._nodeLength(z);z=z.nextSibling}}}}else t=
h,this.forEach(function(a){u=a;if(v=d(u))return!1;t+=this._nodeLength(u);return!0});u&&v&&(this._lastHitChild=u,this._lastHitOffset=t,t=e(u,t,v));return Math.min(q,Math.max(h,t))},getNextOffset:function(a,b){if("line"===b.unit){var e=this.view._model,d=e.getLineAtOffset(a);if(0<b.count)return b.count--,e.getLineEnd(d);b.count++;return e.getLineStart(d)}return"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit?this._getNextOffset_W3C(a,b):g.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,
b)},_getNextOffset_W3C:function(a,b){function e(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function d(a){return 32===a||9===a}var g=this.view._model,f=g.getLineAtOffset(a),k=g.getLine(f),p=g.getLineStart(f),g=g.getLineEnd(f),f=k.length,h=a-p,q,l=0>b.count?-1:1;if("word"===b.unit||"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit)for(var m,x,r;0!==b.count;){if(0<b.count){if(h===f)return g;q=k.charCodeAt(h);m=e(q);x=!m&&!d(q);for(h++;h<f;){q=k.charCodeAt(h);
if("wordWS"!==b.unit&&"wordendWS"!==b.unit){r=e(q);if("wordend"===b.unit){if(!r&&m)break}else if(r&&!m)break;q=!r&&!d(q)}else q=!d(q);if("wordend"===b.unit||"wordendWS"===b.unit){if(!q&&x)break}else if(q&&!x)break;x=q;m=r;h++}}else{if(0===h)return p;h--;q=k.charCodeAt(h);m=e(q);for(x=!m&&!d(q);0<h;){q=k.charCodeAt(h-1);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){r=e(q);if("wordend"===b.unit){if(r&&!m)break}else if(!r&&m)break;q=!r&&!d(q)}else q=!d(q);if("wordend"===b.unit||"wordendWS"===b.unit){if(q&&
!x)break}else if(!q&&x)break;x=q;m=r;h--}}b.count-=l}else for(;0!==b.count&&0<=h+l&&h+l<=f;)h+=l,q=k.charCodeAt(h),56320<=q&&57343>=q&&0<h&&(q=k.charCodeAt(h-1),55296<=q&&56319>=q&&(h+=l)),b.count-=l;return p+h},_getNextOffset_IE:function(a,b){var e=this._ensureCreated(),d=this.view._model,g=this.lineIndex,f=0,k;k=d.getLineStart(g);var p=d.getLine(g),h=d.getLineStart(g),q=e.ownerDocument,l=0>b.count?-1:1;if(a===d.getLineEnd(g)){for(e=e.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;
if(!e)return k;f=q.body.createTextRange();f.moveToElementText(e);k=f.text.length;f.moveEnd(b.unit,l);f=a+f.text.length-k}else if(a===k&&0>b.count)f=k;else for(e=e.firstChild;e;){d=this._nodeLength(e);if(k+d>a){f=q.body.createTextRange();if(a===k&&0>b.count){for(k=e.previousSibling;k&&(!k.firstChild||!k.firstChild.length);)k=k.previousSibling;f.moveToElementText(k?k:e.previousSibling)}else f.moveToElementText(e),f.collapse(),f.moveEnd("character",a-k);k=f.text.length;f.moveEnd(b.unit,l);f=a+f.text.length-
k;break}k=d+k;e=e.nextSibling}k=f-h;c=p.charCodeAt(k);56320<=c&&57343>=c&&0<k&&(c=p.charCodeAt(k-1),55296<=c&&56319>=c&&(k+=l));b.count-=l;return k+h},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var b=this;this.forEach(function(e){var d=e.viewStyle;d&&(d.tagName&&"a"===d.tagName.toLowerCase())&&a.replaceChild(b._createSpan(a,e.firstChild.data,d),e);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};w.prototype={addKeyMode:function(a,
b){var e=this._keyModes;void 0!==b?e.splice(b,0,a):e.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var e=this._rulers;if(void 0!==b){var d,g;for(g=d=0;d<e.length&&g<b;d++)a.getLocation()===e[d].getLocation()&&g++;e.splice(g,0,a);b=g}else e.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,e=this._model,d=this._clientDiv;if(!d)return{width:a,height:b};var f=d.style.width;g.isWebkit&&(d.style.width="0x7fffffffpx");for(var e=e.getLineCount(),
k=0;k<e;k++){var p=this._getLine(k),h=p.getBoundingClientRect(),a=Math.max(a,h.right-h.left),b=b+(h.bottom-h.top);p.destroy()}g.isWebkit&&(d.style.width=f);d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,b,e){if(this._clientDiv){var d=this._getScroll(),g=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();"document"===b&&(void 0!==a.x&&(a.x+=-d.x+f.left+g.left),void 0!==a.y&&(a.y+=
-d.y+f.top+g.top));"document"===e&&(void 0!==a.x&&(a.x+=d.x-f.left-g.left),void 0!==a.y&&(a.y+=d.y-f.top-g.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],e=this._actions,d;for(d in e)e.hasOwnProperty(d)&&(a||!e[d].defaultHandler)&&b.push(d);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],e=this._keyModes,d=0;d<e.length;d++)b=b.concat(e[d].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},
getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model;a=Math.min(Math.max(0,a),b.getCharCount());var b=b.getLineAtOffset(a),e=this._getLine(b);a=e.getBoundingClientRect(a);e.destroy();e=a.left;b=this._getLinePixel(b)+a.top;return{x:e,y:b}},getNextOffset:function(a,b){var e=new v(a,a,!1);this._doMove(b,e);return e.getCaret()},
getOptions:function(){var b;if(0===arguments.length)b=this._defaultOptions();else if(1===arguments.length){if(b=arguments[0],"string"===typeof b)return a(this["_"+b])}else{b={};for(var e in arguments)arguments.hasOwnProperty(e)&&(b[arguments[e]]=void 0)}for(var d in b)b.hasOwnProperty(d)&&(b[d]=a(this["_"+d]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var e=this._getLineIndex(b),d=this._getLine(e),e=d.getOffset(a,b-this._getLinePixel(e));
d.destroy();return e},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,
b,e){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(e))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(e)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},
onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},
onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},
redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(0<this._redrawCount))for(var e=this.getRulers(),d=0;d<e.length;d++)this.redrawLines(a,b,e[d])},redrawLines:function(a,b,e){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===b&&(b=this._model.getLineCount()),a!==b)){var d=this._clientDiv;if(d){if(e)for(d=this._getRulerParent(e).firstChild;d&&d._ruler!==e;)d=d.nextSibling;e?d.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!e||"page"===e.getOverview())for(d=d.firstChild;d;){var g=d.lineIndex;a<=g&&g<b&&(d.lineChanged=!0);d=d.nextSibling}!e&&(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,b){if(!(0<this._redrawCount)){var e=this._model;void 0===a&&(a=0);void 0===b&&(b=e.getCharCount());var d=e.getLineAtOffset(a),e=e.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(d,e)}},removeKeyMode:function(a){for(var b=this._keyModes,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,e){if(a){var d=this._actions,g=d[a];g||(g=d[a]={});g.handler=b;void 0!==e&&(g.actionDescription=
e)}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,e){var d=this._model.getCharCount();a=Math.max(0,Math.min(a,d));a=new v(a,a,!1);this._setSelection(a,void 0===b||b,!0,e)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",
this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),e=this._model.getCharCount(),d=a.getLineCount(),g=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:e,addedCharCount:g,removedLineCount:b,addedLineCount:d};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:e,addedCharCount:g,removedLineCount:b,addedLineCount:d};this.onModelChanged(f);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(b){var d=this._defaultOptions(),g;for(g in b)if(b.hasOwnProperty(g)){var f=b[g];if(!e(this["_"+g],f)){var k=d[g]?d[g].update:null;k?k.call(this,f):this["_"+g]=a(f)}}},setSelection:function(a,b,e,d){var g=a>b;if(g){var f=a;a=b;b=f}f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));a=new v(a,b,g);this._setSelection(a,
void 0===e||e,!0,d)},setText:function(a,b,e){var d=void 0===b&&void 0===e;void 0===b&&(b=0);void 0===e&&(e=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:b,end:e,_code:!0},!d);d&&(this._columnX=-1,this._setSelection(new v(0,0,!1),!0),13>g.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(a,b){return this._showCaret(a?!1:!0,b,a)},update:function(a,b){this._clientDiv&&((a||this._metrics.invalid)&&this._updateStyle(),void 0===b||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){13>g.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var b=this._overlayDiv||this._clientDiv;9>g.isIE&&(b=
this._viewDiv);for(var e=a.target?a.target:a.srcElement;e;){if(b===e||e.className&&-1!==e.className.indexOf("textViewFind"))return;e=e.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&(13>g.isFirefox&&1===a.which)&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),
this._ignoreBlur=!1)},_handleBlur:function(a){this._cancelCheckSelection();if(!this._ignoreBlur){this._commitIME();this._hasFocus=!1;if(9>g.isIE&&!this._getSelection().isEmpty()){a=this._rootDiv;var b=g.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),b=
this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){0<b.rangeCount&&b.removeAllRanges();break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleCompositionStart:function(a){this._ignoreEvent(a)||(this._startIME(),this._mutationObserver&&
(this._mutationObserver.disconnect(),this._mutationObserver=null))},_handleCompositionEnd:function(a){this._ignoreEvent(a)||this._commitIME(a.data)},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){g.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),b=b.defaultPrevented):g.isMac&&(g.isFirefox&&0===a.button)&&(b=!0);if(b)return a.preventDefault&&
a.preventDefault(),!1;this._contextMenuOpen=!0;g.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))}},_handleCopy:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||
(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(13>g.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&
a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));13>g.isFirefox&&(this._fixCaret(),"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=
!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(g.isWebkit||b)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(g.isWebkit||b)return b&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=
!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(a){this._hasFocus=!0;g.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display=
"block");this._selDiv1&&(a=this._highlightRGB,this._selDiv1.style.background=a,this._selDiv2.style.background=a,this._selDiv3.style.background=a);if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){g.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=
!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;b=!0;g.isSafari&&g.isMac&&a.ctrlKey&&(b=!1,a.keyCode=129);b&&this._startIME()}else b||this._commitIME();if((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&
(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(g.isMac&&g.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=g.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),
b.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;b=!1;if(g.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(g.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=g.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<b))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(g.isMac?
a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},_handleLinkClick:function(a){if(!(g.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),e=!0,d=b;if(g.isIE||g.isFirefox&&!this._overlayDiv)d=
this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var f=this;b.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}1===this._clickCount?(e=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!g.isOpera||12.16<=g.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==
(a.target||a.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var b=a.which;b||(4===a.button&&(b=2),2===a.button&&(b=3),1===a.button&&(b=1));var e=2!==b&&a.timeStamp?a.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),k=Math.abs(this._lastMouseY-a.clientY),p=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=e;this._lastMouseButton=b;1===b&&(this._isMouseDown=!0,p&&d<=this._clickTime&&
f<=this._clickDist&&k<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(e=this._createMouseEvent("MouseDown",a),this.onMouseDown(e),e.defaultPrevented)){a.preventDefault();return}if(1===b&&this._handleMouse(a)&&(9<=g.isIE||g.isOpera||g.isChrome||g.isSafari||g.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();g.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(g.isMac?a.metaKey:a.ctrlKey));this._checkOverlayScroll();if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===a.button&&0!==(this._clickCount&1)&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){b=a.clientX;a=a.clientY;var d=this._getViewPadding(),
f=this._viewDiv.getBoundingClientRect(),k=this._getClientWidth(),p=this._getClientHeight(),e=f.left+d.left,h=f.top+d.top,k=f.left+d.left+k,d=f.top+d.top+p;a<h?this._doAutoScroll("up",b,a-h):a>d?this._doAutoScroll("down",b,a-d):b<e&&!this._wrapMode?this._doAutoScroll("left",b-e,a):b>k&&!this._wrapMode?this._doAutoScroll("right",b-k,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){var b=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(b===
a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var e=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:e.x,y:e.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible){if(b&&this._isMouseDown){if(-1!==this._dragOffset){var e=this._getSelection();e.extend(this._dragOffset);e.collapse();this._setSelection(e,!0,!0);this._dragOffset=-1}this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null)}b&&g.isFirefox&&(this._updateDOMSelection(),a.preventDefault())}},_handleMouseWheel:function(a){var b=this._getLineHeight(),e=0,d=0;g.isIE||g.isOpera?d=-a.wheelDelta/40*b:g.isFirefox?"wheel"===a.type?a.deltaMode?(e=Math.max(-256,
Math.min(256,a.deltaX))*b,d=Math.max(-256,Math.min(256,a.deltaY))*b):(e=a.deltaX,d=a.deltaY):(b=g.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?e=b:d=b):g.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,e=0!==a.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==a.wheelDeltaY%120?1:40>d?40/(40-d):40,e=Math.ceil(-a.wheelDeltaX/e),-1<e&&0>e&&(e=-1),0<e&&1>e&&(e=1),d=Math.ceil(-a.wheelDeltaY/d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(e=-a.wheelDeltaX,
d=8*(-a.wheelDeltaY/120)*b);if(g.isSafari||g.isChrome&&g.isMac){for(b=a.target;b&&void 0===b.lineIndex;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(g.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();
b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(a){a=this._rootDiv.clientWidth;var 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(),e(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,e=b.lineIndex;b&&!b._ruler;)void 0===e&&void 0!==b.lineIndex&&(e=b.lineIndex),b=b.parentNode;var d=b?b._ruler:null;if(void 0===e&&d&&"document"===d.getOverview()){var e=this._getClientHeight(),g=this._model.getLineCount(),f=this._getViewPadding(),k=this._viewDiv.getBoundingClientRect(),e=Math.floor((a.clientY-k.top-this._metrics.scrollWidth)*g/(e+f.top+f.bottom-2*this._metrics.scrollWidth));0<=e&&e<g||(e=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(e,
a);break;case "dblclick":if(d.onDblClick)d.onDblClick(e,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(e,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(e,a);break;case "mouseout":if(d.onMouseOut){for(g=a.relatedTarget;g&&g!==this._rootDiv;){if(g===b)return;g=g.parentNode}d.onMouseOut(e,a)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var a=this._getScroll(!1),b=this._hScroll,e=this._vScroll;if(b!==a.x||e!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),
this._update(e===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:e},newValue:a})},_handleSelectStart:function(a){var b=this._contextMenuOpen;this._contextMenuOpen=!1;if(b)this._checkSelectionChange=!0;else if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var e;e="DIV"===a.tagName?a:a.parentNode.parentNode;return!e._line?0:e._line.getModelOffset(a,b)}},_updateSelectionFromDOM:function(){if(!g.isIOS&&!g.isAndroid&&!this._checkSelectionChange)return!1;
var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),e=this._getModelOffset(a.focusNode,a.focusOffset),d=this._getSelection();if(void 0===b||void 0===e||d.start===b&&d.end===e)return!1;if(this._checkSelectionChange){var d=this._getLineNext(),f=this._getLinePrevious();if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===f.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===
f.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)b=0,e=this.getModel().getCharCount()}this._setSelection(new v(b,e),!1,!1);this._checkSelectionChange=!1;return!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){this._selPollTimer&&(this._getWindow().clearTimeout(this._selPollTimer),this._selPollTimer=null)},_pollSelectionChange:function(a){var b=
this,e=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=e.setTimeout(function(){b._selPollTimer=null;b._clientDiv&&!b._updateSelectionFromDOM()&&a&&b._pollSelectionChange(a)},100)},_handleSelectionChange:function(a){-1===this._imeOffset&&(g.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||
b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var e=b.anchorNode;e&&void 0===e.lineIndex;)e=e.parentNode;if(e){var d=this._model,f=e.lineIndex,k=d.getLine(f),p=k,h=0,d=d.getLineStart(f);0<b.rangeCount&&(b.getRangeAt(0).deleteContents(),f=e.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(f),h=this._getDOMText(e,f),p=h.text,h=h.offset,f.parentNode.removeChild(f));e.lineRemoved=!0;for(e=0;k.charCodeAt(e)===p.charCodeAt(e)&&e<h;)e++;b=k.length-1;for(f=p.length-
k.length;k.charCodeAt(b)===p.charCodeAt(b+f)&&b+f>=h+a.data.length;)b--;b++;k=p.substring(e,b+f);this._ignoreQueueUpdate=g.isSafari;this._modifyContent({text:k,start:e+d,end:b+d,_ignoreDOMSelection:!0,_ignoreDOMSelection1:g.isChrome},!0);this._ignoreQueueUpdate=!1}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null);var e=a.touches;if(1===e.length){var e=e[0],d=e.clientX,f=e.clientY;this._touchStartX=d;this._touchStartY=f;if(g.isAndroid&&(f<e.pageY-b.pageYOffset||d<e.pageX-b.pageXOffset))d=e.pageX-b.pageXOffset,f=e.pageY-b.pageYOffset;b=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(1===b.length){b=b[0];this._touchCurrentX=b.clientX;
this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var e=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,b=0;if(e._touching)a=e._touchStartX-e._touchCurrentX,b=e._touchStartY-e._touchCurrentY,e._touchSpeedX=a/10,e._touchSpeedY=b/10,e._touchStartX=e._touchCurrentX,e._touchStartY=e._touchCurrentY;else{if(0.1>Math.abs(e._touchSpeedX)&&
0.1>Math.abs(e._touchSpeedY)){e._vScrollDiv.style.display="none";e._hScrollDiv.style.display="none";d.clearInterval(e._touchScrollTimer);e._touchScrollTimer=null;return}a=10*e._touchSpeedX;b=10*e._touchSpeedY;e._touchSpeedX*=0.95;e._touchSpeedY*=0.95}e._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,e,d=this._keyModes;for(e=d.length-1;0<=e;e--)if(b=d[e],"function"===typeof b.match&&
(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var e=this._model,d=b.getCaret(),f=e.getLineAtOffset(d);a.count||(a.count=1);for(;0!==a.count;){var g=e.getLineStart(f);if(0>a.count&&d===g)if(0<f)"character"===a.unit&&a.count++,f--,b.extend(e.getLineEnd(f));else break;else if(0<a.count&&d===e.getLineEnd(f))if(f+1<e.getLineCount())"character"===a.unit&&a.count--,f++,b.extend(e.getLineStart(f));else break;else{var k=!1;a.expandTab&&("character"===a.unit&&0===(d-
g)%this._tabSize)&&(g=e.getText(g,d),k=!/[^ ]/.test(g));k?(b.extend(d-this._tabSize),a.count+=0>a.count?1:-1):(g=this._getLine(f),b.extend(g.getNextOffset(d,a)),g.destroy())}d=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();b.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,b));this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var e=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":e=e.toLowerCase();break;case "capitalize":e=e.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<e.length;b++){var d=e[b],f=d.toLowerCase(),d=f!==d?f:d.toUpperCase();a+=d}e=a;break;default:e=e.toUpperCase()}this._doContent(e);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var e=this._model,d=e.getLineAtOffset(b.end);b.end<e.getLineEnd(d)&&(e=this._getLine(d),
b.extend(e.getNextOffset(b.getCaret(),{unit:"character",count:1})),e.destroy())}return this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._setClipboardText(b,a)):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=
this._getSelection();!b.isEmpty()&&!a.select?b.end=b.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,b));a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),
e=this._model,d;if(a.ctrl)b.extend(e.getCharCount()),d=function(){};else{var f=b.getCaret(),g=e.getLineAtOffset(f);if(this._wrapMode){var k=this._getLine(g),f=k.getLineIndex(f),f=f===k.getLineCount()-1?e.getLineEnd(g):k.getLineStart(f+1)-1;k.destroy()}else a.count&&0<a.count&&(g=Math.min(g+a.count-1,e.getLineCount()-1)),f=e.getLineEnd(g);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doEnter:function(a){var b=this._model,e=this._getSelection();this._doContent(b.getLineDelimiter());
a&&a.noCursor&&(e.end=e.start,this._setSelection(e,!0));return!0},_doHome:function(a){var b=this._getSelection(),e=this._model,d;if(a.ctrl)b.extend(0),d=function(){};else{var f=b.getCaret(),g=e.getLineAtOffset(f);this._wrapMode?(e=this._getLine(g),f=e.getLineIndex(f),f=e.getLineStart(f),e.destroy()):f=e.getLineStart(g);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doLineDown:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),k=
this._getLine(f),p=this._columnX,h=1,q=!1;if(-1===p||a.wholeLine||a.select&&g.isIE)p=a.wholeLine?b.getLineEnd(f+1):d,p=k.getBoundingClientRect(p).left;(d=k.getLineIndex(d))<k.getLineCount()-1?h=k.getClientRects(d+1).top+1:(d=b.getLineCount()-1,q=f===d,a.count&&0<a.count?f=Math.min(f+a.count,d):f++);d=!1;if(q){if(a.select||g.isMac||g.isLinux)e.extend(b.getCharCount()),d=!0}else k.lineIndex!==f&&(k.destroy(),k=this._getLine(f)),e.extend(k.getOffset(p,h)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,
!0,!0));this._columnX=p;k.destroy();return!0},_doLineUp:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),k=this._getLine(f),p=this._columnX,h=!1,q;if(-1===p||a.wholeLine||a.select&&g.isIE)p=a.wholeLine?b.getLineStart(f-1):d,p=k.getBoundingClientRect(p).left;0<(d=k.getLineIndex(d))?q=k.getClientRects(d-1).top+1:(h=0===f,h||(a.count&&0<a.count?f=Math.max(f-a.count,0):f--,q=this._getLineHeight(f)-1));d=!1;if(h){if(a.select||g.isMac||g.isLinux)e.extend(0),d=!0}else k.lineIndex!==
f&&(k.destroy(),k=this._getLine(f)),e.extend(k.getOffset(p,q)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=p;k.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,e=this._model,d=this._getSelection(),f=d.getCaret(),k=e.getLineAtOffset(f),p=e.getLineCount(),h=this._getScroll(),e=this._getClientHeight(),q,l;if(this._lineHeight){q=this._columnX;h=this._getBoundsAtOffset(f);if(-1===q||a.select&&g.isIE)q=h.left;f=this._getLineIndex(h.top+e);
l=this._getLine(f);k=this._getLinePixel(f);f=l.getOffset(q,h.top+e-k);e=l.getBoundingClientRect(f);l.destroy();d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=q},e.top+k-h.top);return!0}if(k<p-1){var m=this._getLineHeight(),x=Math.min(p-k-1,Math.floor(e/m)),x=Math.max(1,x);q=this._columnX;if(-1===q||a.select&&g.isIE)l=this._getLine(k),q=l.getBoundingClientRect(f).left,l.destroy();l=this._getLine(k+x);d.extend(l.getOffset(q,0));l.destroy();a.select||d.collapse();
a=p*m;f=h.y+x*m;f+e>a&&(f=a-e);this._setSelection(d,!0,!0,function(){b._columnX=q},f-h.y)}return!0},_doPageUp:function(a){var b=this,e=this._model,d=this._getSelection(),f=d.getCaret(),k=e.getLineAtOffset(f),p=this._getScroll(),h=this._getClientHeight(),q;if(this._lineHeight){q=this._columnX;p=this._getBoundsAtOffset(f);if(-1===q||a.select&&g.isIE)q=p.left;f=this._getLineIndex(p.bottom-h);e=this._getLine(f);k=this._getLinePixel(f);f=e.getOffset(q,p.bottom-h-k);h=e.getBoundingClientRect(f);e.destroy();
d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=q},h.top+k-p.top);return!0}if(0<k){var l=this._getLineHeight(),h=Math.max(1,Math.min(k,Math.floor(h/l)));q=this._columnX;if(-1===q||a.select&&g.isIE)e=this._getLine(k),q=e.getBoundingClientRect(f).left,e.destroy();e=this._getLine(k-h);d.extend(e.getOffset(q,this._getLineHeight(k-h)-1));e.destroy();a.select||d.collapse();a=Math.max(0,p.y-h*l);this._setSelection(d,!0,!0,function(){b._columnX=q},a-p.y)}return!0},_doPaste:function(a){var b=
this;return null!==this._getClipboardText(a,function(a){a&&(g.isLinux&&2===b._lastMouseButton&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})},_doScroll:function(a){var b=a.type,e=this._model,d=e.getLineCount();a=this._getClientHeight();var f=this._getLineHeight(),d=d*f,g=this._getScroll().y,k;switch(b){case "textStart":k=0;break;case "textEnd":k=d-a;break;case "pageDown":k=g+a;break;case "pageUp":k=g-a;break;case "lineDown":k=
g+f;break;case "lineUp":k=g-f;break;case "centerLine":b=this._getSelection(),k=e.getLineAtOffset(b.start),e=(e.getLineAtOffset(b.end)-k+1)*f,k=k*f-a/2+e/2}void 0!==k&&(k=Math.min(Math.max(0,k),d-a),this._scrollViewAnimated(0,k-g,function(){}));return!0},_doSelectAll:function(a){a=this._model;var b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(a){if(this._tabMode&&!this._readonly){a="\t";if(this._expandTab){var b=this._model;a=this._getSelection().getCaret();
var e=b.getLineAtOffset(a),b=b.getLineStart(e);a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ")}this._doContent(a);return!0}},_doShiftTab:function(a){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(a){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(a){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(a){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),f=a.getLineCount(),k=a.getLineAtOffset(d),p;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),p=Math.max(0,Math.min(f-1,k+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)p=this._getLineIndex(e.y),k=this._getLine(k),e.x+=k.getBoundingClientRect(d,!1).left,k.destroy();
0===p&&(g.isMac||g.isLinux)?b.extend(0):p===f-1&&(g.isMac||g.isLinux)?b.extend(a.getCharCount()):(k=this._getLine(p),b.extend(k.getOffset(e.x,e.y-this._getLinePixel(p))),k.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),e=0;if(a){a=
0;for(var d=(new Date).getTime(),f=0;e<b&&!(this._lineHeight[e]||(a++,f||(f=e),this._lineHeight[e]=this._calculateLineHeight(e)),e++,100<(new Date).getTime()-d););this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(e!==b){var g=this;this._calculateLHTimer=a.setTimeout(function(){g._calculateLHTimer=null;g._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){a=this._getLine(a);
var b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument,e=g.createElement(b,"div");e.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);d(f.style,e);e.style.position="fixed";e.style.left="-1000px";var k=g.createElement(b,"span");k.appendChild(b.createTextNode(" "));e.appendChild(k);var p=g.createElement(b,"span");p.style.fontStyle=
"italic";p.appendChild(b.createTextNode(" "));e.appendChild(p);var h=g.createElement(b,"span");h.style.fontWeight="bold";h.appendChild(b.createTextNode(" "));e.appendChild(h);f=g.createElement(b,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(b.createTextNode(" "));e.appendChild(f);a.appendChild(e);var l=e.getBoundingClientRect(),k=k.getBoundingClientRect(),p=p.getBoundingClientRect(),h=h.getBoundingClientRect(),f=f.getBoundingClientRect(),k=k.bottom-k.top,p=p.bottom-p.top,
h=h.bottom-h.top,m=f.bottom-f.top,r=0,f=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);p>k&&(r=1);h>p&&(r=2);m>h&&(r=3);var v;0!==r&&(v={style:{}},0!==(r&1)&&(v.style.fontStyle="italic"),0!==(r&2)&&(v.style.fontWeight="bold"));k=x(e);a.removeChild(e);m=q(this._viewDiv);e=g.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=m.left+"px";e.style.paddingTop=m.top+"px";e.style.paddingRight=m.right+"px";e.style.paddingBottom=m.bottom+"px";e.style.width="100px";e.style.height=
"100px";m=g.createElement(b,"div");m.style.width="100%";m.style.height="100%";e.appendChild(m);a.appendChild(e);r=e.getBoundingClientRect();p=m.getBoundingClientRect();h=0;this._singleMode||(e.style.overflow="hidden",m.style.height="200px",h=e.clientWidth,e.style.overflow="scroll",h-=e.clientWidth);a.removeChild(e);m={left:p.left-r.left,top:p.top-r.top,right:r.right-p.right,bottom:r.bottom-p.bottom};p=r=0;if(!f&&(this._wrapOffset||this._marginOffset))e=g.createElement(b,"div"),e.style.position="fixed",
e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1+(g.isWebkit?0:1)).join(" "),a.appendChild(e),r=e.getBoundingClientRect(),r=Math.ceil(r.right-r.left),e.innerHTML=Array(this._marginOffset+1).join(" "),p=e.getBoundingClientRect(),p=Math.ceil(p.right-p.left),a.removeChild(e);return{lineHeight:l,largestFontStyle:v,lineTrim:k,viewPadding:m,scrollWidth:h,wrapWidth:r,marginWidth:p,invalid:f}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var b=
this._getSelection();if(b.isEmpty())return!1;"next"===a?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(a){if(-1!==this._imeOffset){var b=this._model,e=b.getLineAtOffset(this._imeOffset),d=b.getLineStart(e),f=this._getLineNode(e);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var k=this._getDOMText(f).text,b=b.getLine(e),d=this._imeOffset-d,b=d+k.length-b.length;d!==b&&(a=k.substring(d,b))}a&&(!this._doContent(a)&&!g.isWebkit)&&(f.lineRemoved=!0,this._queueUpdate());
this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new l.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(k(b,{select:!1}))},actionDescription:{name:m.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(k(b,{select:!1}))},actionDescription:{name:m.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(k(b,{select:!1,ctrl:!1}))},actionDescription:{name:m.lineStart}},
lineEnd:{defaultHandler:function(b){return a._doEnd(k(b,{select:!1,ctrl:!1}))},actionDescription:{name:m.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(k(b,{select:!1,unit:"character"}))},actionDescription:{name:m.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(k(b,{select:!1,unit:"character"}))},actionDescription:{name:m.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(k(b,{select:!1}))},actionDescription:{name:m.pageUp}},
pageDown:{defaultHandler:function(b){return a._doPageDown(k(b,{select:!1}))},actionDescription:{name:m.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(k(b,{type:"pageUp"}))},actionDescription:{name:m.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(k(b,{type:"pageDown"}))},actionDescription:{name:m.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(k(b,{type:"lineUp"}))},actionDescription:{name:m.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(k(b,
{type:"lineDown"}))},actionDescription:{name:m.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(k(b,{select:!1,unit:"word"}))},actionDescription:{name:m.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(k(b,{select:!1,unit:"word"}))},actionDescription:{name:m.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(k(b,{select:!1,ctrl:!0}))},actionDescription:{name:m.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(k(b,
{select:!1,ctrl:!0}))},actionDescription:{name:m.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(k(b,{type:"textStart"}))},actionDescription:{name:m.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(k(b,{type:"textEnd"}))},actionDescription:{name:m.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(k(b,{type:"centerLine"}))},actionDescription:{name:m.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(k(b,
{select:!0}))},actionDescription:{name:m.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(k(b,{select:!0}))},actionDescription:{name:m.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(k(b,{select:!0,wholeLine:!0}))},actionDescription:{name:m.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(k(b,{select:!0,wholeLine:!0}))},actionDescription:{name:m.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(k(b,
{select:!0,ctrl:!1}))},actionDescription:{name:m.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(k(b,{select:!0,ctrl:!1}))},actionDescription:{name:m.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(k(b,{select:!0,unit:"character"}))},actionDescription:{name:m.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(k(b,{select:!0,unit:"character"}))},actionDescription:{name:m.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(k(b,
{select:!0}))},actionDescription:{name:m.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(k(b,{select:!0}))},actionDescription:{name:m.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(k(b,{select:!0,unit:"word"}))},actionDescription:{name:m.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(k(b,{select:!0,unit:"word"}))},actionDescription:{name:m.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(k(b,
{select:!0,ctrl:!0}))},actionDescription:{name:m.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(k(b,{select:!0,ctrl:!0}))},actionDescription:{name:m.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(k(b,{unit:"character"}))},actionDescription:{name:m.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(k(b,{unit:"character"}))},actionDescription:{name:m.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(k(b,
{unit:"word"}))},actionDescription:{name:m.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(k(b,{unit:"word"}))},actionDescription:{name:m.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(k(b,{unit:"line"}))},actionDescription:{name:m.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(k(b,{unit:"line"}))},actionDescription:{name:m.deleteLineEnd}},tab:{defaultHandler:function(b){return a._doTab()},actionDescription:{name:m.tab}},
shiftTab:{defaultHandler:function(b){return a._doShiftTab()},actionDescription:{name:m.shiftTab}},enter:{defaultHandler:function(b){return a._doEnter()},actionDescription:{name:m.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(k(b,{noCursor:!0}))},actionDescription:{name:m.enterNoCursor}},selectAll:{defaultHandler:function(b){return a._doSelectAll()},actionDescription:{name:m.selectAll}},copy:{defaultHandler:function(b){return a._doCopy()},actionDescription:{name:m.copy}},cut:{defaultHandler:function(b){return a._doCut()},
actionDescription:{name:m.cut}},paste:{defaultHandler:function(b){return a._doPaste()},actionDescription:{name:m.paste}},uppercase:{defaultHandler:function(b){return a._doCase(k(b,{type:"upper"}))},actionDescription:{name:m.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(k(b,{type:"lower"}))},actionDescription:{name:m.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(k(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:m.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(k(b,
{type:"reverse"}))},actionDescription:{name:m.reversecase}},toggleOverwriteMode:{defaultHandler:function(b){return a._doOverwriteMode()},actionDescription:{name:m.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(b){return a._doTabMode()},actionDescription:{name:m.toggleTabMode}},toggleWrapMode:{defaultHandler:function(b){return a._doWrapMode()},actionDescription:{name:m.toggleWrapMode}}}},_createRulerParent:function(a,b){var e=g.createElement(a,"div");e.className=b;e.tabIndex=-1;e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.display="none";e.setAttribute("aria-hidden","true");this._rootDiv.appendChild(e);return e},_createRuler:function(a,b){if(this._clientDiv){var e=this._getRulerParent(a);if(e){if(e!==this._marginDiv||this._marginOffset)e.style.display="block";var d=g.createElement(e.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position=
"relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===b||0>b||b>=e.children.length)e.appendChild(d);else{for(var f=e.firstChild;f&&0<b--;)f=f.nextSibling;e.insertBefore(d,f)}}}},_createView:function(){function a(){k._rootDiv&&(k.update(!0),k._metrics.invalid&&k._getWindow().setTimeout(function(){a()},100))}if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var e=b.ownerDocument,d=g.createElement(e,"div");this._rootDiv=
d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);this._leftDiv=this._createRulerParent(e,"textviewLeftRuler");b=g.createElement(e,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline=
"none";b.style.background="transparent";d.appendChild(b);var f=this._createRulerParent(e,"textviewRightRuler");this._rightDiv=f;f.style.right="0px";this._scrollDiv=f=g.createElement(e,"div");f.style.margin="0px";f.style.borderWidth="0px";f.style.padding="0px";b.appendChild(f);(this._marginDiv=this._createRulerParent(e,"textviewMarginRuler")).style.zIndex="4";!g.isIE&&!g.isIOS&&(this._clipDiv=b=g.createElement(e,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth=
"0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.height="1px",f.style.top="-1000px",f.style.background="transparent",b.appendChild(f));this._setFullSelection(this._fullSelection,!0);b=g.createElement(e,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";
b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(g.isIOS||g.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(g.isIOS||g.isAndroid)this._vScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline=
"none",f.style.zIndex="3",f.style.width="8px",f.style.display="none",d.appendChild(f),this._hScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.height="8px",f.style.display="none",d.appendChild(f);g.isFirefox&&!b.setCapture&&(this._overlayDiv=
f=g.createElement(e,"div"),f.style.position=b.style.position,f.style.borderWidth=b.style.borderWidth,f.style.margin=b.style.margin,f.style.padding=b.style.padding,f.style.cursor="text",f.style.zIndex="2",(this._clipDiv||d).appendChild(f));b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,
!0);this._hookEvents();b=this._rulers;for(f=0;f<b.length;f++)this._createRuler(b[f]);this._update();var k=this;r(e,d,"textview",a)}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,
update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value: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 e=
b.firstChild;e;){if(e._ruler===a){e._ruler=void 0;b.removeChild(e);if(0===b.children.length&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}e=e.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);
this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,e){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=e;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);
this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var e=this._model;e.getBaseModel&&(a=e.mapOffset(a),b=e.mapOffset(b),e=e.getBaseModel());return e.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();
var e=this._clientDiv.getBoundingClientRect();a.bottom>e.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a));a=b.getBoundingClientRect(a);var e=this._getLinePixel(b.lineIndex);a.top+=e;a.bottom+=e;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var e=this._model.getLineDelimiter(),d,f,k=this._getWindow(),h=k.clipboardData;!h&&a&&(h=a.clipboardData);if(h)return d=[],f=h.getData(g.isIE?"Text":"text/plain"),p(f,function(a){d.push(a)},function(){d.push(e)}),f=d.join(""),b&&b(f),f;if(g.isFirefox){this._ignoreFocus=!0;var q=this._clipboardDiv,h=this._rootDiv.ownerDocument;q||(this._clipboardDiv=q=g.createElement(h,"div"),q.style.position="fixed",q.style.whiteSpace="pre",
q.style.left="-1000px",this._rootDiv.appendChild(q));q.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";q.firstChild.focus();var l=this,m=function(){var a=l._getTextFromElement(q);q.innerHTML="";d=[];p(a,function(a){d.push(a)},function(){d.push(e)});return d.join("")},x=!1;this._ignorePaste=!0;if(!g.isLinux||2!==this._lastMouseButton)try{x=h.execCommand("paste",!1,null)}catch(r){x=1<q.childNodes.length||q.firstChild&&0<q.firstChild.childNodes.length}this._ignorePaste=!1;if(!x){if(a)return k.setTimeout(function(){l.focus();
(f=m())&&b&&b(f);l._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(f=m())&&b&&b(f);return f}return""},_getDOMText:function(a,b){return a._line.getText(b)},_getTextFromElement:function(a){var b=a.ownerDocument,e=b.defaultView;if(!e.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);a=e.getSelection();var e=[],d;for(d=0;d<a.rangeCount;d++)e.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);
b=a.toString();a.removeAllRanges();for(d=0;d<e.length;d++)a.addRange(e[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new u(this,a)},_getLineHeight:function(a,b){if(void 0!==a&&this._lineHeight){var e=this._lineHeight[a];if(e)return e;if(b||void 0===b)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=
this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&(-1===a.lineIndex||!a._line);)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&(-1===a.lineIndex||!a._line);)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;
if(a>b)for(;b<a;b++)e+=this._getLineHeight(b);else for(b-=1;b>=a;b--)e-=this._getLineHeight(b);return e}return this._getLineHeight()*a},_getLineIndex:function(a){var b,e=0,d=this._model.getLineCount();if(this._lineHeight){var e=this._getTopIndex(),f=-this._topIndexY+this._getScroll().y;if(a!==f)if(a<f)for(;a<f&&0<e;)a+=this._getLineHeight(--e);else for(b=this._getLineHeight(e);a-b>=f&&e<d-1;)a-=b,b=this._getLineHeight(++e)}else b=this._getLineHeight(),e=Math.floor(a/b);return Math.max(0,Math.min(d-
1,e))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();var e=this._getViewPadding(),
d=this._viewDiv.getBoundingClientRect();a.top<d.top+e.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(b){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);var b=this._handlers=[],e=this._clientDiv,d=this._viewDiv,f=this._rootDiv,k=this._overlayDiv||e,p=e.ownerDocument,h=this._getWindow(),q=g.isIE?p:h;b.push({target:h,type:"resize",handler:function(b){return a._handleResize(b?b:h.event)}});b.push({target:e,type:"blur",handler:function(b){return a._handleBlur(b?b:h.event)}});b.push({target:e,type:"focus",handler:function(b){return a._handleFocus(b?b:h.event)}});b.push({target:d,type:"focus",handler:function(a){e.focus()}});
b.push({target:d,type:"scroll",handler:function(b){return a._handleScroll(b?b:h.event)}});b.push({target:e,type:"textInput",handler:function(b){return a._handleTextInput(b?b:h.event)}});b.push({target:e,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:h.event)}});b.push({target:e,type:"keypress",handler:function(b){return a._handleKeyPress(b?b:h.event)}});b.push({target:e,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:h.event)}});g.isIE&&b.push({target:p,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?
b:h.event)}});b.push({target:e,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:h.event)}});b.push({target:e,type:"copy",handler:function(b){return a._handleCopy(b?b:h.event)}});b.push({target:e,type:"cut",handler:function(b){return a._handleCut(b?b:h.event)}});b.push({target:e,type:"paste",handler:function(b){return a._handlePaste(b?b:h.event)}});b.push({target:p,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:h.event)}});if(g.isIOS||g.isAndroid)b.push({target:e,
type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:h.event)}}),b.push({target:e,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:h.event)}}),b.push({target:e,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:h.event)}});else{b.push({target:e,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:h.event)}});b.push({target:e,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:h.event)}});b.push({target:e,type:"mouseover",
handler:function(b){return a._handleMouseOver(b?b:h.event)}});b.push({target:e,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:h.event)}});b.push({target:q,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:h.event)}});b.push({target:q,type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:h.event)}});b.push({target:f,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:h.event)}});b.push({target:f,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?
b:h.event)}});b.push({target:k,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:h.event)}});b.push({target:k,type:"drag",handler:function(b){return a._handleDrag(b?b:h.event)}});b.push({target:k,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:h.event)}});b.push({target:k,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:h.event)}});b.push({target:k,type:"dragover",handler:function(b){return a._handleDragOver(b?b:h.event)}});b.push({target:k,type:"dragleave",
handler:function(b){return a._handleDragLeave(b?b:h.event)}});b.push({target:k,type:"drop",handler:function(b){return a._handleDrop(b?b:h.event)}});b.push({target:this._clientDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:h.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:h.event)}});if(g.isFirefox&&
(!g.isWindows||15<=g.isFirefox))(d=h.MutationObserver||h.MozMutationObserver)?(this._mutationObserver=new d(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:h.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:h.event)}}),b.push({target:this._clientDiv,type:"compositionend",handler:function(b){return a._handleCompositionEnd(b?b:h.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:h.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:h.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:h.event)}}),b.push({target:this._overlayDiv,
type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:h.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:h.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(d=0;d<b.length;d++)f=b[d],z(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,b){if(a){var e=this,d=this._getWindow();g.isIE&&b.push({target:a,type:"selectstart",
handler:function(){return!1}});b.push({target:a,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return e._handleMouseWheel(a?a:d.event)}});b.push({target:a,type:"click",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"dblclick",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mousemove",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mouseover",handler:function(a){e._handleRulerEvent(a?
a:d.event)}});b.push({target:a,type:"mouseout",handler:function(a){e._handleRulerEvent(a?a:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var b=a.parent;"string"===typeof b&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new n.TextModel;var e=this._defaultOptions(),
d;for(d in e)e.hasOwnProperty(d)&&(this["_"+d]=void 0!==a[d]?a[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new v(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!g.isIE||9<=g.isIE)&&"function"===typeof b.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=
this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_checkOverlayScroll:function(){if(g.isMac&&g.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var a=this._viewDiv,b=
this._isOverOverlayScroll();a.style.pointerEvents=b.vertical||b.horizontal?"":"none"}},_isOverOverlayScroll:function(){if(!(200>(new Date).getTime()-this._lastScrollTime))return{};var a=this._viewDiv.getBoundingClientRect(),b=this._lastMouseMoveX,e=this._lastMouseMoveY;return{vertical:a.top<=e&&e<a.bottom&&a.right-15<=b&&b<a.right,horizontal:a.bottom-15<=e&&e<a.bottom&&a.left<=b&&b<a.right}},_modifyContent:function(a,b){if(this._readonly&&!a._code)return!1;a.type="Verify";this.onVerify(a);if(null===
a.text||void 0===a.text)return!1;var e=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),e.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}if(b){e=this._getSelection();e.setCaret(a.start+a.text.length);try{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!0),this._setSelection(e,!0)}finally{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!1)}}this.onModify({type:"Modify"});return!0},_onModelChanged:function(a){a.type="ModelChanged";
this.onModelChanged(a);a.type="Changed";var b=a.start,e=a.addedCharCount,d=a.removedCharCount,f=a.addedLineCount,g=a.removedLineCount,k=this._getSelection();k.end>b&&(k.end>b&&k.start<b+d?k.setCaret(b+e):(k.start+=e-d,k.end+=e-d),this._setSelection(k,!1,!1));b=this._model.getLineAtOffset(b);for(e=this._getLineNext();e;)d=e.lineIndex,b<=d&&d<=b+g&&(b===d&&!e.modelChangedEvent&&!e.lineRemoved?(e.modelChangedEvent=a,e.lineChanged=!0):(e.lineRemoved=!0,e.lineChanged=!1,e.modelChangedEvent=null)),d>b+
g&&(e.lineIndex=d+f-g,e._line.lineIndex=e.lineIndex),e=this._getLineNext(e);this._lineHeight&&(a=[b,g].concat(Array(f)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(b<=this._maxLineIndex&&this._maxLineIndex<=b+g)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=
this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==b)for(var e=a;e<b;e++)this._lineHeight[e]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=
-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new v(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>g.isFirefox&&this._fixCaret()}},_scrollViewAnimated:function(a,b,e){var d=this._getWindow();if(e&&this._scrollAnimation){var f=this;this._animation=new C({window:d,
duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);f._scrollView(0,a);b-=a},onEnd:function(){f._animation=null;f._scrollView(a,b);e&&d.setTimeout(e,0)}});this._animation.play()}else this._scrollView(a,b),e&&d.setTimeout(e,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var e=this._viewDiv;a&&(e.scrollLeft+=a);b&&(e.scrollTop+=b)},_setClipboardText:function(a,b){var e,d=this._getWindow(),f=d.clipboardData;!f&&b&&(f=b.clipboardData);if(f&&(e=[],p(a,function(a){e.push(a)},
function(){e.push(g.platformDelimiter)}),f.setData(g.isIE?"Text":"text/plain",e.join(""))||21<g.isFirefox))return!0;var k=this._parent.ownerDocument,h=g.createElement(k,"pre");h.style.position="fixed";h.style.left="-1000px";p(a,function(a){h.appendChild(k.createTextNode(a))},function(){h.appendChild(g.createElement(k,"br"))});h.appendChild(k.createTextNode(" "));this._clientDiv.appendChild(h);f=k.createRange();f.setStart(h.firstChild,0);f.setEndBefore(h.lastChild);var q=d.getSelection();0<q.rangeCount&&
q.removeAllRanges();q.addRange(f);var l=this,f=function(){h&&h.parentNode===l._clientDiv&&l._clientDiv.removeChild(h);l._updateDOMSelection()},q=!1;this._ignoreCopy=!0;try{q=k.execCommand("copy",!1,null)}catch(m){}this._ignoreCopy=!1;if(!q&&b)return d.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,b,e,d,f){this._setDOMFullSelection(a,b,e,d);a=a._line.getNodeOffset(b);e=e._line.getNodeOffset(d);d=this._getWindow();b=this._parent.ownerDocument;if(d.getSelection){var k=d.getSelection();
d=b.createRange();d.setStart(a.node,a.offset);d.setEnd(e.node,e.offset);if(this._hasFocus&&(k.anchorNode!==a.node||k.anchorOffset!==a.offset||k.focusNode!==e.node||k.focusOffset!==e.offset||k.anchorNode!==e.node||k.anchorOffset!==e.offset||k.focusNode!==a.node||k.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=e.node,this._focusOffset=e.offset,this._ignoreSelect=!1,0<k.rangeCount&&k.removeAllRanges(),k.addRange(d),this._ignoreSelect=!0;this._cursorDiv&&
(d=b.createRange(),f?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(e.node,e.offset),d.setEnd(e.node,e.offset)),f=d.getClientRects()[0],a=this._cursorDiv.parentNode,e=a.getBoundingClientRect(),f&&e&&(this._cursorDiv.style.top=f.top-e.top+a.scrollTop+"px",this._cursorDiv.style.left=f.left-e.left+a.scrollLeft+"px"))}else b.selection&&this._hasFocus&&(f=b.body,d=g.createElement(b,"div"),f.appendChild(d),f.removeChild(d),d=f.createTextRange(),d.moveToElementText(a.node.parentNode),
d.moveStart("character",a.offset),f=f.createTextRange(),f.moveToElementText(e.node.parentNode),f.moveStart("character",e.offset),d.setEndPoint("EndToStart",f),this._ignoreSelect=!1,d.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,b,e,d){if(this._selDiv1){var f=this._selDiv1;f.style.width="0px";f.style.height="0px";f=this._selDiv2;f.style.width="0px";f.style.height="0px";f=this._selDiv3;f.style.width="0px";f.style.height="0px";if(!(a===e&&b===d)){var g=this._getViewPadding(),k=this._clientDiv.getBoundingClientRect(),
p=this._viewDiv.getBoundingClientRect(),f=p.left+g.left,h=k.right,g=p.top+g.top,q=k.bottom,p=k=0;this._clipDiv?(p=this._clipDiv.getBoundingClientRect(),k=p.left-this._clipDiv.scrollLeft):(p=this._rootDiv.getBoundingClientRect(),k=p.left);p=p.top;this._ignoreDOMSelection=!0;var l=(new u(this,a.lineIndex,a)).getBoundingClientRect(b,!1),m=l.left;b=(new u(this,e.lineIndex,e)).getBoundingClientRect(d,!1);var x=b.left;this._ignoreDOMSelection=!1;var r=this._selDiv1,m=Math.min(h,Math.max(f,m)),v=Math.min(q,
Math.max(g,l.top)),n=h;d=Math.min(q,Math.max(g,l.bottom));r.style.left=m-k+"px";r.style.top=v-p+"px";r.style.width=Math.max(0,n-m)+"px";r.style.height=Math.max(0,d-v)+"px";a.lineIndex===e.lineIndex?(n=Math.min(x,h),r.style.width=Math.max(0,n-m)+"px"):(l=Math.min(q,Math.max(g,b.top)),x=Math.min(h,Math.max(f,x)),g=Math.min(q,Math.max(g,b.bottom)),q=this._selDiv3,q.style.left=f-k+"px",q.style.top=l-p+"px",q.style.width=Math.max(0,x-f)+"px",q.style.height=Math.max(0,g-l)+"px",1<Math.abs(a.lineIndex-e.lineIndex)&&
(a=this._selDiv2,a.style.left=f-k+"px",a.style.top=d-p+"px",a.style.width=Math.max(0,h-f)+"px",a.style.height=Math.max(0,l-d)+"px"))}}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;g.isIE&&a&&(this._hadFocus=this._hasFocus);var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&
!a&&b.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;)a._line.updateLinks(),a=this._getLineNext(a);this._updateDOMSelection()}},_setSelection:function(a,b,e,d,f){if(a){this._columnX=-1;void 0===e&&(e=!0);var g=this._selection;this._selection=a;!1!==b&&this._showCaret(!1,d,b,f);e&&this._updateDOMSelection();if(!g.equals(a))this.onSelection({type:"Selection",oldValue:{start:g.start,end:g.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,
b,e,d){var f=this._model,g=this._getSelection();b=this.convert({x:a,y:b},"page","document");a=this._getLineIndex(b.y);if(1===this._clickCount){f=this._getLine(a);a=f.getOffset(b.x,b.y-this._getLinePixel(a));f.destroy();if(d&&!e&&g.start<=a&&a<g.end)return this._dragOffset=a,!1;g.extend(a);e||g.collapse()}else 0===(this._clickCount&1)?(f=this._getLine(a),a=f.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(e=this._doubleClickSelection.start,d=
f.getNextOffset(a,{unit:"wordend",count:1})):(e=f.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(e=f.getNextOffset(a,{unit:"word",count:-1}),d=f.getNextOffset(e,{unit:"wordend",count:1})),f.destroy()):this._doubleClickSelection?(d=f.getLineAtOffset(this._doubleClickSelection.start),a>=d?(e=f.getLineStart(d),d=f.getLineEnd(a)):(e=f.getLineStart(a),d=f.getLineEnd(d))):(e=f.getLineStart(a),d=f.getLineEnd(a)),g.setCaret(e),g.extend(d);this._setSelection(g,!0,!0);return!0},
_setFullSelection:function(a,b){this._fullSelection=a;g.isWebkit&&(this._fullSelection=!0);var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!g.isIOS){var d=e.ownerDocument;this._highlightRGB=g.isWebkit?"transparent":"Highlight";var f=g.createElement(d,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width=
"0px";f.style.height="0px";f.style.zIndex="0";e.appendChild(f);var k=g.createElement(d,"div");this._selDiv2=k;k.style.position="absolute";k.style.borderWidth="0px";k.style.margin="0px";k.style.padding="0px";k.style.outline="none";k.style.background=this._highlightRGB;k.style.width="0px";k.style.height="0px";k.style.zIndex="0";e.appendChild(k);this._selDiv3=d=g.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";
d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(g.isFirefox&&g.isMac){e=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;
case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;f.style.background=e;k.style.background=e;d.style.background=e}b||this._updateDOMSelection()}}else this._selDiv1&&(e.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(e.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(e.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=
a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=this._viewDiv,b=g.createElement(a.ownerDocument,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="\x26nbsp;";a.appendChild(b);
this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(a,b){this._wrapOffset=a;b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":
"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;g.isOpera?e&&(e.style.OTabSize=this._tabSize+""):537.1<=g.isWebkit?e&&(e.style.tabSize=this._tabSize+""):4<=g.isFirefox?e&&(e.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",
this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var e="textview",d=this._theme.getThemeClass();d&&(e+=" "+d);this._themeClass&&d!==this._themeClass&&(e+=" "+this._themeClass);this._rootDiv.className=e;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var e=this._clientDiv;this._wrapMode?(e.style.whiteSpace=
"pre-wrap",e.style.wordWrap="break-word"):(e.style.whiteSpace="pre",e.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,e,d){if(this._clientDiv&&!(0<this._redrawCount)&&!this._ignoreDOMSelection){var f=this._model,g=this._getSelection(),k=this._getScroll(),p=g.getCaret(),h=g.start,q=g.end,l=f.getLineAtOffset(h),m=f.getLineAtOffset(q),x=Math.max(Math.max(h,f.getLineStart(m)),q-1),f=this._getClientWidth(),r=this._getClientHeight(),
v=f/4,n=this._getBoundsAtOffset(p===h?h:x),t=n.left,u=n.right,w=n.top,z=n.bottom,y=0,C="object"===typeof e;if((a||C)&&!g.isEmpty())n=this._getBoundsAtOffset(p===q?h:x),y=(n.bottom>z?n.bottom:z)-(n.top<w?n.top:w),a&&(n.top===w?p===h?u=t+Math.min(n.right-t,f):t=u-Math.min(u-n.left,f):p===h?z=w+Math.min(n.bottom-w,r):w=z-Math.min(z-n.top,r));a=0;t<k.x&&(a=Math.min(t-k.x,-v));u>k.x+f&&(a=Math.max(u-k.x-f,v));g=0;w<k.y?g=w-k.y:z>k.y+r&&(g=z-k.y-r);d&&(0<d?0<g&&(g=Math.max(g,d)):0>g&&(g=Math.min(g,d)));
d=C&&"always"===e.scrollPolicy;if(0!==a||0!==g||d)return C?(d=0<g,0===g&&(g=w-k.y),k=e.viewAnchor,w=e.selectionAnchor,e=Math.min(Math.max(0,e.viewAnchorOffset||0)),g="top"===k?g+Math.floor(d?(1-e)*r:-e*r):"bottom"===k?g+Math.floor(d?e*r:-(1-e)*r):"center"===k?g+Math.floor(d?r/2+e*r:r/2-(1-e)*r):g+Math.floor(d?e*r:-e*r),l!==m&&("top"===w&&p!==h?g+=Math.floor(-y):"bottom"===w&&p!==q?g+=Math.floor(y):"center"===w&&(g+=Math.floor(y/2)))):0!==g&&"number"===typeof e&&(0>e&&(e=0),1<e&&(e=1),g+=Math.floor(0<
g?e*r:-e*r)),this._scrollViewAnimated(a,g,b),r!==this._getClientHeight()||f!==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,e=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),
f=this._getLineNext();if(f){var g=this._getLinePrevious(),k;e<f.lineIndex?(e=f,k=b.getLineStart(f.lineIndex)):e>g.lineIndex?(e=g,k=b.getLineStart(g.lineIndex)):(e=this._getLineNode(e),k=a.start);d<f.lineIndex?(d=f,b=b.getLineStart(f.lineIndex)):d>g.lineIndex?(d=g,b=b.getLineStart(g.lineIndex)):(d=this._getLineNode(d),b=a.end);this._setDOMSelection(e,k,d,b,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=
null,a=!1);var b=this._clientDiv,e=this._viewDiv;if(b){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,f=this._getScroll(!1),k=this._getViewPadding(),p=d.getLineCount(),h=this._getLineHeight(),q=!1,l=!1,m=!1,x=this._metrics.scrollWidth;this._wrapMode&&(b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var r,v,n,t,w=0,z=0,y;if(this._lineHeight){for(;z<p;){y=this._getLineHeight(z);if(w+y>f.y)break;w+=y;z++}r=z;
v=Math.max(0,r-1);n=d=f.y-w;0<r&&(d+=this._getLineHeight(r-1))}else t=Math.max(0,f.y)/h,r=Math.floor(t),v=Math.max(0,r-1),d=Math.round((t-v)*h),n=Math.round((t-r)*h);this._topIndexY=n;t=this._rootDiv;var C=t.clientWidth,P=t.clientHeight;if(a){h=0;this._leftDiv&&(r=this._leftDiv.getBoundingClientRect(),h=r.right-r.left);r=this._getClientWidth();t=this._getClientHeight();l=r;this._wrapMode?this._metrics.wrapWidth&&(l=this._metrics.wrapWidth):l=Math.max(this._maxLineWidth,l);for(;z<p;)y=this._getLineHeight(z,
!1),w+=y,z++;p=w}else{t=this._getClientHeight();n=Math.min(r+Math.floor((t+n)/h),p-1);var f=Math.min(n+1,p-1),M;for(y=b.firstChild;y;){M=y.lineIndex;var N=y.nextSibling;if(!(v<=M&&M<=f)||y.lineRemoved||-1===y.lineIndex)this._mouseWheelLine===y?(y.style.display="none",y.lineIndex=-1):b.removeChild(y);y=N}y=this._getLineNext();var N=e.ownerDocument,O=N.createDocumentFragment();for(M=v;M<=f;M++)!y||y.lineIndex>M?(new u(this,M)).create(O,null):(O.firstChild&&(b.insertBefore(O,y),O=N.createDocumentFragment()),
y&&y.lineChanged&&(y=(new u(this,M)).create(O,y),y.lineChanged=!1),y=this._getLineNext(y));O.firstChild&&b.insertBefore(O,y);g.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");y=this._getLineNext();M=t+d;for(O=!1;y;)v=y.lineWidth,void 0===v&&(N=y._line.getBoundingClientRect(),v=y.lineWidth=Math.ceil(N.right-N.left),N=N.bottom-N.top,this._lineHeight?this._lineHeight[y.lineIndex]=N:0!==h&&(0!==N&&Math.ceil(h)!==Math.ceil(N))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=
N)),this._lineHeight&&!O&&(M-=this._lineHeight[y.lineIndex],0>M&&(n=y.lineIndex,O=!0)),this._wrapMode||(v>=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=y.lineIndex),this._checkMaxLineIndex===y.lineIndex&&(this._checkMaxLineIndex=-1)),y.lineIndex===r&&(this._topChild=y),y.lineIndex===n&&(this._bottomChild=y),y=this._getLineNext(y);-1!==this._checkMaxLineIndex&&(M=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=M&&M<p&&(h=new u(this,M),N=h.getBoundingClientRect(),v=N.right-N.left,
v>=this._maxLineWidth&&(this._maxLineWidth=v,this._maxLineIndex=M),h.destroy()));for(;z<p;)y=this._getLineHeight(z,z<=n),w+=y,z++;p=w;this._updateRuler(this._leftDiv,r,f,P);this._updateRuler(this._rightDiv,r,f,P);this._updateRuler(this._marginDiv,r,f,P);h=0;this._leftDiv&&(r=this._leftDiv.getBoundingClientRect(),h=r.right-r.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-f.left);e.style.left=h+"px";e.style.right=f+"px";f=this._scrollDiv;f.style.height=p+"px";r=this._getClientWidth();
!this._singleMode&&!this._wrapMode&&(w=q=t,(z="scroll"===e.style.overflowX)?q+=x:w-=x,y=n=r,(v="scroll"===e.style.overflowY)?n+=x:y-=x,t=q,r=n,p>t&&(m=!0,r=y),this._maxLineWidth>r&&(l=!0,t=w,p>t&&(m=!0,r=y)),z!==l&&(e.style.overflowX=l?"scroll":"hidden"),v!==m&&(e.style.overflowY=m?"scroll":"hidden"),q=z!==l||v!==m);m=r;this._wrapMode?this._metrics.wrapWidth&&(m=this._metrics.wrapWidth):m=Math.max(this._maxLineWidth,m);l=m;if((!g.isIE||9<=g.isIE)&&this._maxLineWidth>r)m+=k.right+k.left;f.style.width=
m+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=m+"px");f=this._getScroll(!1)}this._vScrollDiv&&(m=t-8,w=Math.max(15,Math.ceil(Math.min(1,m/(p+k.top+k.bottom))*m)),this._vScrollDiv.style.left=h+r-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*m/p))+"px",this._vScrollDiv.style.height=w+"px");!this._wrapMode&&this._hScrollDiv&&(m=r-8,w=Math.max(15,Math.ceil(Math.min(1,m/(this._maxLineWidth+k.left+k.right))*m)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(f.x*
m/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=t-9+"px",this._hScrollDiv.style.width=w+"px");z=f.x;w=this._clipDiv;m=this._overlayDiv;if(n=this._marginDiv)n.style.left=-z+h+this._metrics.marginWidth+k.left+"px",n.style.bottom=("scroll"===e.style.overflowX?x:0)+"px";w?(w.scrollLeft=z,w.scrollTop=0,e=h+k.left,x=k.top,a=r,h=t,z=0,n=-d,0===f.x&&(e-=k.left,a+=k.left,z=k.left),f.x+r===l&&(a+=k.right),0===f.y&&(x-=k.top,h+=k.top,n+=k.top),f.y+t===p&&(h+=k.bottom),w.style.left=e+"px",w.style.top=
x+"px",w.style.right=C-a-e+"px",w.style.bottom=P-h-x+"px",b.style.left=z+"px",b.style.top=n+"px",b.style.width=l+"px",b.style.height=t+d+"px",m&&(m.style.left=b.style.left,m.style.top=b.style.top,m.style.width=b.style.width,m.style.height=b.style.height)):(e=z,x=d,C=z+r,P=d+t,0===e&&(e-=k.left),0===x&&(x-=k.top),C===l&&(C+=k.right),f.y+t===p&&(P+=k.bottom),b.style.clip="rect("+x+"px,"+C+"px,"+P+"px,"+e+"px)",b.style.left=-z+h+k.left+"px",b.style.width=(this._wrapMode||g.isWebkit?l:r+z)+"px",a||(b.style.top=
-d+k.top+"px",b.style.height=t+d+"px"),m&&(m.style.clip=b.style.clip,m.style.left=b.style.left,m.style.width=b.style.width,a||(m.style.top=b.style.top,m.style.height=b.style.height)));this._updateDOMSelection();q&&(b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,b,e,f){if(a){var k=
this._parent.ownerDocument,p=this._getLineHeight(),h=this._getViewPadding();for(a=a.firstChild;a;){var q=a._ruler,l=p,m=q.getOverview();"page"===m&&(l+=this._topIndexY);a.style.top=-l+"px";a.style.height=f+l+"px";a.rulerChanged&&d(q.getRulerStyle(),a);var r,x=a.firstChild;x?(r=x,x=x.nextSibling):(r=g.createElement(k,"div"),r.style.visibility="hidden",a.appendChild(r));var v;if(a.rulerChanged&&r){l=-1;if(v=q.getWidestAnnotation())d(v.style,r),v.html&&(r.innerHTML=v.html);r.lineIndex=l;r.style.height=
p+h.top+"px"}var n;if("page"===m){for(q=q.getAnnotations(b,e+1);x;)l=x.lineIndex,v=x.nextSibling,(!(b<=l&&l<=e)||x.lineChanged)&&a.removeChild(x),x=v;x=a.firstChild.nextSibling;n=k.createDocumentFragment();for(l=b;l<=e;l++)if(!x||x.lineIndex>l){r=g.createElement(k,"div");if(v=q[l])d(v.style,r),v.html&&(r.innerHTML=v.html),r.annotation=v;r.lineIndex=l;r.style.height=this._getLineHeight(l)+"px";n.appendChild(r)}else n.firstChild&&(a.insertBefore(n,x),n=k.createDocumentFragment()),x&&(x=x.nextSibling);
n.firstChild&&a.insertBefore(n,x)}else{v=this._getClientHeight();l=this._model.getLineCount();x=v+h.top+h.bottom-2*this._metrics.scrollWidth;m=p*l<x?p:x/l;if(a.rulerChanged){for(v=a.childNodes.length;1<v;)a.removeChild(a.lastChild),v--;q=q.getAnnotations(0,l);n=k.createDocumentFragment();for(var t in q)l=t>>>0,0>l||(r=g.createElement(k,"div"),v=q[t],d(v.style,r),r.style.position="absolute",r.style.top=this._metrics.scrollWidth+p+Math.floor(l*m)+"px",v.html&&(r.innerHTML=v.html),r.annotation=v,r.lineIndex=
l,n.appendChild(r));a.appendChild(n)}else if(a._oldTrackHeight!==x)for(r=a.firstChild?a.firstChild.nextSibling:null;r;)r.style.top=this._metrics.scrollWidth+p+Math.floor(r.lineIndex*m)+"px",r=r.nextSibling;a._oldTrackHeight=x}a.rulerChanged=!1;a=a.nextSibling}}},_updateStyleSheet:function(){var a="";g.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");g.isFirefox&&(g.isMac&&this._highlightRGB&&"Highlight"!==this._highlightRGB)&&(a+="\n.textview ::-moz-selection {background: "+
this._highlightRGB+";}");if(a){var b=this._clientDiv.ownerDocument,e=b.getElementById("_textviewStyle");if(e)e.removeChild(e.firstChild),e.appendChild(b.createTextNode(a));else{e=g.createElement(b,"style");e.id="_textviewStyle";var d=b.getElementsByTagName("head")[0]||b.documentElement;e.appendChild(b.createTextNode(a));d.insertBefore(e,d.firstChild)}}},_updateStyle:function(a){!a&&g.isIE&&(this._rootDiv.style.lineHeight="normal");var b=this._metrics=this._calculateMetrics();this._variableLineHeight&&
(this._variableLineHeight=!1,this._resetLineHeight());this._rootDiv.style.lineHeight=g.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();if(g.isMac&&g.isWebkit){var e=this._viewDiv;!b.invalid&&0===b.scrollWidth?(e.style.pointerEvents="none",e.style.zIndex="2"):(e.style.pointerEvents="",e.style.zIndex="")}a||(this.redraw(),this._resetLineWidth())}};f.EventTarget.addMixin(w.prototype);return{TextView:w}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(m,n){function l(f){this._model=f;this._projections=[];var b=this;this._listener={onChanged:function(f){b._onChanged(f)},onChanging:function(f){b._onChanging(f)}};f.addEventListener("postChanged",this._listener.onChanged);f.addEventListener("preChanging",this._listener.onChanging)}l.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(f){if(f){var b=this._model,h=this._projections;f._lineIndex=b.getLineAtOffset(f.start);f._lineCount=b.getLineAtOffset(f.end)-f._lineIndex;var g=f.text;g||(g="");f._model="string"===typeof g?new m.TextModel(g,b.getLineDelimiter()):g;var b=this.mapOffset(f.start,!0),g=f.end-f.start,d=f._lineCount,a=f._model.getCharCount(),k=f._model.getLineCount()-1,e={type:"Changing",text:f._model.getText(),
start:b,removedCharCount:g,addedCharCount:a,removedLineCount:d,addedLineCount:k};this.onChanging(e);e=this._binarySearch(h,f.start);h.splice(e,0,f);this.onChanged({type:"Changed",start:b,removedCharCount:g,addedCharCount:a,removedLineCount:d,addedLineCount:k})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(f,b){var h=this._projections,g=0,d,a;if(b){for(d=0;d<h.length;d++){a=h[d];if(a.start>f)break;if(a.end>f)return-1;g+=
a._model.getCharCount()-(a.end-a.start)}return f+g}for(d=0;d<h.length;d++){a=h[d];if(a.start>f-g)break;var k=a._model.getCharCount();if(a.start+k>f-g)return-1;g+=k-(a.end-a.start)}return f-g},removeProjection:function(f){this._removeProjection(f)},_removeProjection:function(f,b){var h,g=0;for(h=0;h<this._projections.length;h++){var d=this._projections[h];if(d===f){f=d;break}g+=d._model.getCharCount()-(d.end-d.start)}if(h<this._projections.length){var d=this._model,g=f.start+g,a=f.end-f.start,k=f._lineCount,
e=f._model.getCharCount(),p=f._model.getLineCount()-1;b||(d={type:"Changing",text:d.getText(f.start,f.end),start:g,removedCharCount:e,addedCharCount:a,removedLineCount:p,addedLineCount:k},this.onChanging(d));this._projections.splice(h,1);if(!b)this.onChanged({type:"Changed",start:g,removedCharCount:e,addedCharCount:a,removedLineCount:p,addedLineCount:k})}},_binarySearch:function(f,b){for(var h=f.length,g=-1,d;1<h-g;)d=Math.floor((h+g)/2),b<=f[d].start?h=d:g=d;return h},getCharCount:function(){for(var f=
this._model.getCharCount(),b=this._projections,h=0;h<b.length;h++)var g=b[h],f=f+(g._model.getCharCount()-(g.end-g.start));return f},getLine:function(f,b){if(0>f)return null;var h=this._model,g=this._projections,d=0,a=[],k=0,e,p,q;for(e=0;e<g.length;e++){q=g[e];if(q._lineIndex>=f-d)break;p=q._model.getLineCount()-1;if(q._lineIndex+p>=f-d){k=f-(q._lineIndex+d);if(k<p)return q._model.getLine(k,b);a.push(q._model.getLine(p))}k=q.end;d+=p-q._lineCount}for(k=Math.max(k,h.getLineStart(f-d));e<g.length;e++){q=
g[e];if(q._lineIndex>f-d)break;a.push(h.getText(k,q.start));p=q._model.getLineCount()-1;if(q._lineIndex+p>f-d)return a.push(q._model.getLine(0,b)),a.join("");a.push(q._model.getText());k=q.end;d+=p-q._lineCount}g=h.getLineEnd(f-d,b);k<g&&a.push(h.getText(k,g));return a.join("")},getLineAtOffset:function(f){for(var b=this._model,h=this._projections,g=0,d=0,a=0;a<h.length;a++){var k=h[a];if(k.start>f-g)break;var e=k._model.getCharCount();if(k.start+e>f-g){h=f-(k.start+g);d+=k._model.getLineAtOffset(h);
g+=h;break}d+=k._model.getLineCount()-1-k._lineCount;g+=e-(k.end-k.start)}return b.getLineAtOffset(f-g)+d},getLineCount:function(){for(var f=this._projections,b=this._model.getLineCount(),h=0;h<f.length;h++)var g=f[h],b=b+(g._model.getLineCount()-1-g._lineCount);return b},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(f,b){if(0>f)return-1;for(var h=this._model,g=this._projections,d=0,a=0,k=0;k<g.length;k++){var e=g[k];if(e._lineIndex>f-d)break;var p=e._model.getLineCount()-
1;if(e._lineIndex+p>f-d)return e._model.getLineEnd(f-(e._lineIndex+d),b)+e.start+a;a+=e._model.getCharCount()-(e.end-e.start);d+=p-e._lineCount}return h.getLineEnd(f-d,b)+a},getLineStart:function(f){if(0>f)return-1;for(var b=this._model,h=this._projections,g=0,d=0,a=0;a<h.length;a++){var k=h[a];if(k._lineIndex>=f-g)break;var e=k._model.getLineCount()-1;if(k._lineIndex+e>=f-g)return k._model.getLineStart(f-(k._lineIndex+g))+k.start+d;d+=k._model.getCharCount()-(k.end-k.start);g+=e-k._lineCount}return b.getLineStart(f-
g)+d},getText:function(f,b){void 0===f&&(f=0);var h=this._model,g=this._projections,d=0,a=[],k,e,p;for(k=0;k<g.length;k++){e=g[k];if(e.start>f-d)break;p=e._model.getCharCount();if(e.start+p>f-d){if(void 0!==b&&e.start+p>b-d)return e._model.getText(f-(e.start+d),b-(e.start+d));a.push(e._model.getText(f-(e.start+d)));f=e.end+d+p-(e.end-e.start)}d+=p-(e.end-e.start)}var q=f-d;if(void 0!==b){for(;k<g.length;k++){e=g[k];if(e.start>b-d)break;a.push(h.getText(q,e.start));p=e._model.getCharCount();if(e.start+
p>b-d)return a.push(e._model.getText(0,b-(e.start+d))),a.join("");a.push(e._model.getText());q=e.end;d+=p-(e.end-e.start)}a.push(h.getText(q,b-d))}else{for(;k<g.length;k++)e=g[k],a.push(h.getText(q,e.start)),a.push(e._model.getText()),q=e.end;a.push(h.getText(q))}return a.join("")},_onChanged:function(f){f=this._change;var b=f.baseStart,h=f.baseEnd,g,d,a=this._projections;for(g=0;g<a.length&&!(d=a[g],d.end>b);g++);var k=g;for(g=0;g<a.length&&!(d=a[g],d.start>=h);g++);var e=g,p=this._model,b=f.baseText.length-
(h-b);for(g=e;g<a.length;g++)d=a[g],d.start+=b,d.end+=b,d._lineIndex=p.getLineAtOffset(d.start);d=a.splice(k,e-k);for(g=0;g<d.length;g++)d[g].annotation&&d[g].annotation._expand();this.onChanged({type:"Changed",start:f.start,removedCharCount:f.removedCharCount,addedCharCount:f.addedCharCount,removedLineCount:f.removedLineCount,addedLineCount:f.addedLineCount});this._change=void 0},_onChanging:function(f){var b=!!this._change,h=this._change||{},g=f.start,d=g+f.removedCharCount;h.baseStart=g;h.baseEnd=
d;h.baseText=f.text;h.addedLineCount=f.addedLineCount;if(!b){this._change=h;h.text=f.text;var a=this._projections,k,e,p;f=function(b){for(k=e=0;e<a.length;e++){p=a[e];if(p.start>b)break;if(p.end>b)return-1;k+=p._model.getCharCount()-(p.end-p.start)}return b+k};h.start=f(g);-1===h.start&&(h.text=this._model.getText(p.start,g)+h.text,h.addedLineCount+=this._model.getLineAtOffset(g)-this._model.getLineAtOffset(p.start),h.start=p.start+k);h.end=f(d);-1===h.end&&(h.text+=this._model.getText(d,p.end),h.addedLineCount+=
this._model.getLineAtOffset(p.end)-this._model.getLineAtOffset(d),h.end=p.start+k)}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(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},
setLineDelimiter:function(f){this._model.setLineDelimiter(f)},setText:function(f,b,h){function g(b){for(a=k=0;k<d.length;k++){e=d[k];if(e.start>b-a)break;var f=e._model.getCharCount();if(e.start+f>b-a)return-1;a+=f-(e.end-e.start)}return b-a}this._change={text:f||"",start:b||0,end:void 0===h?this.getCharCount():h};var d=this._projections,a,k,e,p,q;f=g(this._change.start);-1===f&&(p={projection:e,start:this._change.start-(e.start+a)},f=e.end);b=g(this._change.end);-1===b&&(q={projection:e,end:this._change.end-
(e.start+a)},b=e.start);p&&q&&p.projection===q.projection?e._model.setText(this._change.text,p.start,q.end):(this._model.setText(this._change.text,f,b),p&&(e=p.projection,e._model.setText("",p.start)),q&&(e=q.projection,e._model.setText("",0,q.end),e.start=e.end,e._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(l.prototype);return{ProjectionTextModel:l}});
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(m,n,l,f,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(d){if(!this._tooltipDiv){var a=
this._tooltipDiv=h.createElement(d,"div");a.tabIndex=0;a.className="textviewTooltip";a.setAttribute("aria-live","assertive");a.setAttribute("aria-atomic","true");var f=this._tooltipContents=h.createElement(d,"div");a.appendChild(f);d.body.appendChild(a);var e=this;b.addEventListener(a,"mouseover",function(a){e._hideDelay&&(a=e._getWindow(),e._delayedHideTimeout&&(a.clearTimeout(e._delayedHideTimeout),e._delayedHideTimeout=null),e._hideTimeout&&(a.clearTimeout(e._hideTimeout),e._hideTimeout=null),
e._nextTarget=null)},!1);b.addEventListener(a,"mouseout",function(d){d=d.relatedTarget||d.toElement;!(d===a||e._hasFocus())&&(!d||!b.contains(a,d))&&e._hide()},!1);b.addEventListener(a,"keydown",function(a){27===a.keyCode&&e._hide()},!1);b.addEventListener(d,"mousedown",this._mouseDownHandler=function(d){e.isVisible()&&(b.contains(a,d.target||d.srcElement)||e._hide())},!0);this._view.addEventListener("Destroy",function(){e.destroy()});this._hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;
return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var d=this._tooltipDiv.parentNode;d&&d.removeChild(this._tooltipDiv);b.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var d=this._tooltipDiv;return!d?!1:b.contains(d,d.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 e=
this;b=e._getWindow();e._showTimeout&&(b.clearTimeout(e._showTimeout),e._showTimeout=null);0===a?e.show(!0):e._showTimeout=b.setTimeout(function(){e._showTimeout=null;e.show(!0)},a?a:e._showDelay)}},show:function(b){if(this._target){var a=this._target.getTooltipInfo();if(a){var g=this._tooltipDiv,e=this._tooltipContents;g.style.left=g.style.right=g.style.width=g.style.height=e.style.width=e.style.height="auto";var p=a.contents;p instanceof Array&&(p=this._getAnnotationContents(p));if("string"===typeof p)e.innerHTML=
p;else if(this._isNode(p))e.appendChild(p);else if(p instanceof f.ProjectionTextModel){var h=this._view,l=h.getOptions();l.wrapMode=!1;l.parent=e;var m=l.themeClass;m?((m=m.replace("tooltipTheme",""))&&(m=" "+m),m="tooltipTheme"+m):m="tooltipTheme";l.themeClass=m;l=this._contentsView=new n.TextView(l);l.addEventListener("LineStyle",function(a){h.onLineStyle(a)});l.setModel(p);p=l.computeSize();e.style.width=p.width+"px";e.style.height=p.height+"px";l.resize()}else return;e=g.ownerDocument.documentElement;
"right"===a.anchor?(p=e.clientWidth-a.x,g.style.right=p+"px"):(p=parseInt(this._getNodeStyle(g,"padding-left","0"),10),p+=parseInt(this._getNodeStyle(g,"border-left-width","0"),10),p=a.x-p,g.style.left=p+"px");g.style.maxWidth=e.clientWidth-p-10+"px";p=parseInt(this._getNodeStyle(g,"padding-top","0"),10);p+=parseInt(this._getNodeStyle(g,"border-top-width","0"),10);p=a.y-p;g.style.top=p+"px";g.style.maxHeight=e.clientHeight-p-10+"px";g.style.opacity="1";g.style.visibility="visible";if(b){var v=this,
t=this._getWindow();v._hideTimeout=t.setTimeout(function(){v._hideTimeout=null;var a=parseFloat(v._getNodeStyle(g,"opacity","1"));v._fadeTimeout=t.setInterval(function(){"visible"===g.style.visibility&&0<a?(a-=0.1,g.style.opacity=a):v._hide()},v._fadeDelay/10)},v._autoHideDelay)}}}},_getAnnotationContents:function(d){function a(a,b){var e=u.getLineStart(u.getLineAtOffset(a)),d=u.getLineEnd(u.getLineAtOffset(b),!0);return u.getText(e,d)}function g(e){var d=e.title,f=h.createElement(r,"div");f.className=
"tooltipRow";e.html&&(f.innerHTML=e.html,f.lastChild&&b.addEventListener(f.lastChild,"click",function(a){a=e.start;var b=e.end;n.getBaseModel&&(a=n.mapOffset(a,!0),b=n.mapOffset(b,!0));v.setSelection(a,b,1/3,function(){l._hide()})},!1),f.appendChild(r.createTextNode("\u00a0")));d||(d=a(e.start,e.end));"function"===typeof d&&(d=e.title());if("string"===typeof d){var k=h.createElement(r,"span");k.appendChild(r.createTextNode(d));d=k}f.appendChild(d);return f}for(var e,p=[],q=0;q<d.length;q++)e=d[q],
""!==e.title&&!e.groupAnnotation&&p.push(e);d=p;if(0===d.length)return null;var l=this,r=this._tooltipDiv.ownerDocument,v=this._view,n=v.getModel(),u=n.getBaseModel?n.getBaseModel():n;if(1===d.length){e=d[0];if(void 0!==e.title)return e=g(e),e.firstChild&&((d=e.firstChild.className)&&(d+=" "),e.firstChild.className=d+"single"),e;d=new f.ProjectionTextModel(u);p=u.getLineStart(u.getLineAtOffset(e.start));q=u.getCharCount();e.end!==q&&d.addProjection({start:e.end,end:q});0<p&&d.addProjection({start:0,
end:p});return d}p=h.createElement(r,"div");e=h.createElement(r,"em");e.appendChild(r.createTextNode(m.multipleAnnotations));p.appendChild(e);for(q=0;q<d.length;q++)e=d[q],(e=g(e))&&p.appendChild(e);return p},_getNodeStyle:function(b,a,f){var e;if(b&&(e=b.style[a],!e))if(b.currentStyle){for(e=0;-1!==(e=a.indexOf("-",e));)a=a.substring(0,e)+a.substring(e+1,e+2).toUpperCase()+a.substring(e+2);e=b.currentStyle[a]}else e=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(a):null;
return e||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(m,n){function l(){}function f(a,b,d){this.start=a;this.end=b;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function b(a,b){var d=a.lastIndexOf("."),d=a.substring(d+1),f={title:m[d],style:{styleClass:"annotation "+d},html:"\x3cdiv class\x3d'annotationHTML "+d+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+d}};b?f.lineStyle=
{styleClass:"annotationLine "+d}:f.rangeStyle={styleClass:"annotationRange "+d};l.registerType(a,f)}function h(){}function g(a,b,d,f,g){var k;void 0===f&&(f=-1);void 0===g&&(g=a.length);for(;1<g-f;)if(k=Math.floor((g+f)/2),b<=a[k].start)g=k;else if(d&&b<a[k].end){g=k;break}else f=k;return g}function d(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 d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},
onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}f.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 d=b.next();d!==this&&d.type===l.ANNOTATION_FOLDING&&a.call(this,d)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};l.ANNOTATION_ERROR="orion.annotation.error";l.ANNOTATION_WARNING="orion.annotation.warning";l.ANNOTATION_TASK="orion.annotation.task";l.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";l.ANNOTATION_BOOKMARK="orion.annotation.bookmark";
l.ANNOTATION_FOLDING="orion.annotation.folding";l.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";l.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";l.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";l.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";l.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";l.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";l.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";l.ANNOTATION_SELECTED_LINKED_GROUP=
"orion.annotation.selectedLinkedGroup";l.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";l.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";l.ANNOTATION_BLAME="orion.annotation.blame";l.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var k={};l.registerType=function(a,b){var d=b;"function"!==typeof d&&(d=function(a,b,e){this.start=a;this.end=b;void 0!==e&&(this.title=e)},d.prototype=b);d.prototype.type=a;k[a]=d;return a};l.createAnnotation=function(a,b,d,f){return new (this.getType(a))(b,
d,f)};l.getType=function(a){return k[a]};b(l.ANNOTATION_ERROR);b(l.ANNOTATION_WARNING);b(l.ANNOTATION_TASK);b(l.ANNOTATION_BREAKPOINT);b(l.ANNOTATION_BOOKMARK);b(l.ANNOTATION_CURRENT_BRACKET);b(l.ANNOTATION_MATCHING_BRACKET);b(l.ANNOTATION_CURRENT_SEARCH);b(l.ANNOTATION_MATCHING_SEARCH);b(l.ANNOTATION_READ_OCCURRENCE);b(l.ANNOTATION_WRITE_OCCURRENCE);b(l.ANNOTATION_SELECTED_LINKED_GROUP);b(l.ANNOTATION_CURRENT_LINKED_GROUP);b(l.ANNOTATION_LINKED_GROUP);b(l.ANNOTATION_CURRENT_LINE,!0);b(l.ANNOTATION_BLAME,
!0);b(l.ANNOTATION_CURRENT_BLAME,!0);l.registerType(l.ANNOTATION_FOLDING,f);h.addMixin=function(a){var b=h.prototype,d;for(d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};h.prototype={addAnnotationType:function(a,b){this._annotationTypes||(this._annotationTypes=[]);var d=b-1;void 0==b||!(0<=d&&d<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(d,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,d){a=a.getAnnotations(b,d);for(d=[];a.hasNext();)b=a.next(),0!==this.getAnnotationTypePriority(b.type)&&d.push(b);var f=this;d.sort(function(a,b){return f.getAnnotationTypePriority(a.type)-f.getAnnotationTypePriority(b.type)});return d},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}}};d.prototype={addAnnotation:function(a){if(a){var b=this._annotations,d=g(b,a.start);b.splice(d,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var d=this._annotations,f,g=0,k;k=void 0===a&&void 0===b?function(){return g<d.length?d[g++]:null}:function(){for(;g<d.length;){var f=d[g++];if(a===f.start||(a>f.start?a<f.end:f.start<b))return f;
if(f.start>=b)break}return null};f=k();return{next:function(){var a=f;a&&(f=k());return a},hasNext:function(){return null!==f}}},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,d,f;if(a){d=[];for(f=b.length-1;0<=f;f--){var g=b[f];g.type===a&&(b.splice(f,1),d.splice(0,0,g),g._annotationModel=null)}}else d=b;this.onChanged({type:"Changed",
removed:d,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 d=this._annotations,f,k,h,l=[];if(a)for(f=a.length-1;0<=f;f--)h=a[f],k=this._getAnnotationIndex(h),0>k||(h._annotationModel=null,d.splice(k,1),l.splice(0,0,h));b||(b=[]);for(f=0;f<b.length;f++)h=b[f],k=g(d,h.start),h._annotationModel=
this,d.splice(k,0,h);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,d=g(b,a.start);d<b.length&&b[d].start===a.start;){if(b[d]===a)return d;d++}return-1},_onChanged:function(a){var b=a.start,d=a.addedCharCount,f=a.removedCharCount,g=this._annotations,
k=b+f;if(0<g.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};d-=f;for(f=0;f<g.length;f++){var h=g[f];h.start>=k?(h._oldStart=h.start,h._oldEnd=h.end,h.start+=d,h.end+=d,a.changed.push(h)):h.end<=b||(h.start<b&&k<h.end?(h._oldStart=h.start,h._oldEnd=h.end,h.end+=d,a.changed.push(h)):(g.splice(f,1),a.removed.push(h),h._annotationModel=null,h.expand&&h.expand(),f--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};n.EventTarget.addMixin(d.prototype);
a.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+(" "+b.styleClass):b.styleClass;var d;b.tagName&&!a.tagName&&(a.tagName=b.tagName);if(b.style)for(d in a.style||
(a.style={}),b.style)a.style[d]||(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)a.attributes[d]||(a.attributes[d]=b.attributes[d])}return a},_mergeStyleRanges:function(a,b){a||(a=[]);for(var d,f=g(a,b.start,!0);f<a.length&&b;f++){var k=a[f];if(b.end<=k.start)break;if(!(b.start>=k.end)){d=this._mergeStyle({},k.style);d=this._mergeStyle(d,b.style);var h=[];h.push(f,1);b.start<k.start&&h.push({start:b.start,end:k.start,style:b.style});b.start>k.start&&h.push({start:k.start,
end:b.start,style:k.style});h.push({start:Math.max(k.start,b.start),end:Math.min(k.end,b.end),style:d});b.end<k.end&&h.push({start:b.end,end:k.end,style:k.style});b=b.end>k.end?{start:k.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,h)}}b&&(d=this._mergeStyle({},b.style),a.splice(f,0,{start:b.start,end:b.end,style:d}));return a},_onAnnotationModelChanged:function(a){function b(a,e){k.getBaseModel&&(a=k.mapOffset(a,!0),e=k.mapOffset(e,!0));-1!==a&&-1!==e&&f.redrawRange(a,e)}function d(a,
e){for(var f=0;f<a.length;f++)if(g.isAnnotationTypeVisible(a[f].type)){var k=a[f];b(k.start,k.end);e&&(void 0!==k._oldStart&&k._oldEnd)&&b(k._oldStart,k._oldEnd)}}var f=this._view;if(f){var g=this,k=f.getModel();d(a.added);d(a.removed);d(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,d=a.textView.getModel(),f=b.getTextModel(),g=a.lineStart,k=a.lineStart+a.lineText.length;f!==d&&(g=d.mapOffset(g),k=d.mapOffset(k));for(b=b.getAnnotations(g,
k);b.hasNext();)if(g=b.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var k=g.start,h=g.end;f!==d&&(k=d.mapOffset(k,!0),h=d.mapOffset(h,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:k,end:h,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:f,AnnotationType:l,AnnotationTypeList:h,AnnotationModel:d,AnnotationStyler:a}});
define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(m,n,l,f,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 d(a){a=a||{};g.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var a=f.AnnotationType;g.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(a,b){return this.getModel().getText(a,b)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(a){this.checkDirty()},reportStatus:function(a,b,d){this._statusReporter&&this._statusReporter(a,b,d)},resize:function(){},setDirty:function(a){this._dirty!==a&&(this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"}))},
_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,b,d,f){this._title=a;f||(b?this.reportStatus(b,"error"):null!==d&&(void 0!==d&&"string"===typeof d)&&this._setModelText(d),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:d,contentsSaved:f})},setText:function(a,b,d){this.getModel().setText(a,b,d)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(g.prototype);d.prototype=new g;
b.mixin(d.prototype,{destroy:function(){g.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=a,this._annotationRuler){var d=this._textView;a?d.addRuler(this._annotationRuler,0):d.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=
a,this._foldingRuler){var d=this._textView;d.getModel().getBaseModel&&(a?d.addRuler(this._foldingRuler):d.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var d=this._textView;a?d.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):d.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=
a,this._overviewRuler){var d=this._textView;a?d.addRuler(this._overviewRuler):d.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(a=d.mapOffset(a,b));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,b=a.getSelection(),
a=a.getModel();a.getBaseModel&&(b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end));return b},_expandOffset:function(b){var e=this._textView.getModel(),d=this._annotationModel;if(d&&e.getBaseModel)for(b=d.getAnnotations(b,b+1);b.hasNext();)e=b.next(),e.type===a.ANNOTATION_FOLDING&&e.expand&&e.expand()},setCaretOffset:function(a,b,d){var f=this._textView,g=f.getModel();g.getBaseModel&&(this._expandOffset(a),a=g.mapOffset(a,!0));f.setCaretOffset(a,b,d)},setText:function(a,b,d){var f=this._textView,
g=f.getModel();g.getBaseModel&&(void 0!==b&&(this._expandOffset(b),b=g.mapOffset(b,!0)),void 0!==d&&(this._expandOffset(d),d=g.mapOffset(d,!0)));f.setText(a,b,d)},setSelection:function(a,b,d,f){var g=this._textView,h=g.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));g.setSelection(a,b,d,f)},moveSelection:function(a,b,d,f){var g=this._textView;this.setSelection(a,b||a,1/3,function(){(void 0===f||f)&&g.focus();d&&d()})},_getTooltipInfo:function(a,
b){var d=this._textView,f=this.getAnnotationModel();if(!f)return null;var g=this._annotationStyler;if(!g)return null;var h=d.getOffsetAtLocation(a,b);if(-1===h)return null;h=this.mapOffset(h);g=g.getAnnotationsByType(f,h,h+1);f=[];for(h=0;h<g.length;h++)g[h].rangeStyle&&f.push(g[h]);if(0===f.length)return null;d=d.convert({x:a,y:b},"document","page");return{contents:f,anchor:"left",x:d.x+10,y:d.y+20}},_highlightCurrentLine:function(b,e){var d=this._annotationModel;if(d){var f=this._textView;if(!f.getOptions("singleMode")){var g=
f.getModel(),h=e?g.getLineAtOffset(e.start):-1,l=g.getLineAtOffset(b.start),f=b.start===b.end,m=!e||e.start===e.end,n=g.getLineStart(l),w=g.getLineEnd(l);g.getBaseModel&&(n=g.mapOffset(n),w=g.mapOffset(w));g=this._currentLineAnnotation;if(!(h===l&&m&&f&&g&&g.start===n&&g.end===w)){var h=g?[g]:null,z;f&&(g=a.createAnnotation(a.ANNOTATION_CURRENT_LINE,n,w),z=[g]);this._currentLineAnnotation=g;d.replaceAnnotations(h,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,e=this._textView,d=this;this._listener={onModelChanged:function(a){d.checkDirty()},onMouseOver:function(a){d._listener.onMouseMove(a)},onMouseMove:function(a){var b=
l.Tooltip.getTooltip(e);b&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,b.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var b=l.Tooltip.getTooltip(e);b&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,
b.setTarget(null))},onScroll:function(a){(a=l.Tooltip.getTooltip(e))&&a.setTarget(null,0,0)},onSelection:function(a){d._updateCursorStatus();d._highlightCurrentLine(a.newValue,a.oldValue)}};e.addEventListener("ModelChanged",this._listener.onModelChanged);e.addEventListener("Selection",this._listener.onSelection);e.addEventListener("MouseOver",this._listener.onMouseOver);e.addEventListener("MouseOut",this._listener.onMouseOut);e.addEventListener("MouseMove",this._listener.onMouseMove);e.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var f;if(f="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(b,this._undoStack,this._contentAssist))this._textActions=f.textActions,this._linkedMode=f.linkedMode,this._sourceCodeActions=f.sourceCodeActions}f=function(e,d){if(void 0!==e&&-1!==e){for(var f=this.getView().getModel(),g=this.getAnnotationModel(),h=b.mapOffset(f.getLineStart(e)),
f=b.mapOffset(f.getLineEnd(e)),p=g.getAnnotations(h,f),q=null;p.hasNext();){var l=p.next();if(l.type===a.ANNOTATION_BOOKMARK){q=l;break}}q?g.removeAnnotation(q):(q=a.createAnnotation(a.ANNOTATION_BOOKMARK,h,f),q.title=void 0,g.addAnnotation(q))}};if(this._annotationFactory){var h=e.getModel();h.getBaseModel&&(h=h.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(h))if(h=this._annotationStyler=this._annotationFactory.createAnnotationStyler(e,this._annotationModel))h.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),
h.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(a.ANNOTATION_ERROR),h.addAnnotationType(a.ANNOTATION_WARNING),h.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_LINE),h.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_SELECTED_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_CURRENT_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_LINKED_GROUP),
h.addAnnotationType("orion.annotation.highlightError");var h=this._annotationFactory.createAnnotationRulers(this._annotationModel),m=this._annotationRuler=h.annotationRuler;m&&(m.onDblClick=f,m.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),m.addAnnotationType(a.ANNOTATION_ERROR),m.addAnnotationType(a.ANNOTATION_WARNING),m.addAnnotationType(a.ANNOTATION_TASK),m.addAnnotationType(a.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(m=this._overviewRuler=h.overviewRuler)m.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),m.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),m.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),m.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),m.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),m.addAnnotationType(a.ANNOTATION_ERROR),m.addAnnotationType(a.ANNOTATION_WARNING),m.addAnnotationType(a.ANNOTATION_TASK),m.addAnnotationType(a.ANNOTATION_BOOKMARK),m.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),
m.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),m.addAnnotationType(a.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
void 0===this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(a.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:e});g.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;a&&(a.destroy(),
this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),
g.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var a=this.getModel(),b=this.getCaretOffset(),d=a.getLineAtOffset(b),a=a.getLineStart(d),b=b-a,a=this.getKeyModes(),f=0;f<a.length;f++){var g=a[f];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(h.formatMessage(m.lineColumn,d+1,b+1))},showAnnotations:function(b,e,d,f){var g=this._annotationModel;if(g){for(var h=[],l=[],m=g.getTextModel(),n=g.getAnnotations(),w;n.hasNext();)w=n.next(),-1!==e.indexOf(w.type)&&
w.creatorID===this&&h.push(w);if(b)for(e=0;e<b.length;e++)if(w=b[e]){if(d)w=d(w);else{var z;"number"===typeof w.line?(z=m.getLineStart(w.line-1),n=z+w.start-1,z=z+w.end-1):(n=w.start,z=w.end);var y=f(w);if(!y)continue;w=a.createAnnotation(y,n,z,w.description)}w.creatorID=this;l.push(w)}g.replaceAnnotations(h,l)}},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(d){var e=this._blameRGB,g=this.getTextView().getOptions("parent").ownerDocument;if(!e){var q=h.createElement(g,"div");q.className="annotation blame";g.body.appendChild(q);var l=(g.defaultView||g.parentWindow).getComputedStyle(q).getPropertyValue("background-color");
q.parentNode.removeChild(q);var q=l.indexOf("("),r=l.indexOf(")"),l=l.substring(q+1,r);this._blameRGB=e=l.split(",").slice(0,3)}var n=function(){var a=f.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},t=function(){var a=h.createElement(g,"div");a.className="tooltipTitle";var b=
this.blame.Message.indexOf("\n");-1===b&&(b=this.blame.Message.length);var e=h.createElement(g,"a");e.href=this.blame.CommitLink;e.appendChild(g.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(e);a.appendChild(h.createElement(g,"br"));a.appendChild(g.createTextNode(h.formatMessage(m.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},u=this.getModel();this.showAnnotations(d,[a.ANNOTATION_BLAME,a.ANNOTATION_CURRENT_BLAME],function(d){var g=u.getLineStart(d.Start-1),
k=u.getLineEnd(d.End-1,!0),g=f.AnnotationType.createAnnotation(a.ANNOTATION_BLAME,g,k,t),k=e.slice(0);k.push(d.Shade);g.style=b.mixin({},g.style);g.style.style=b.mixin({},g.style.style);g.style.style.backgroundColor="rgba("+k.join()+")";g.groupId=d.Name;g.groupType=a.ANNOTATION_CURRENT_BLAME;g.createGroupAnnotation=n;g.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+d.AuthorImage+'"/\x3e';g.blame=d;return g})},showSelection:function(a,b,d,f,g){"number"===typeof a?("number"!==typeof b&&(b=
a),this.moveSelection(a,b)):"number"===typeof d&&(a=this.getModel().getLineStart(d-1),"number"===typeof f&&(a+=f),"number"!==typeof g&&(g=0),this.moveSelection(a,a+g))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,d,f,h){g.prototype.setInput.call(this,a,b,d,f);this._textView&&(!f&&!h)&&this._textView.focus()},onGotoLine:function(a,b,d,f){if(this._textView){var g=
this.getModel();a=Math.max(0,Math.min(a,g.getLineCount()-1));var h=g.getLineStart(a),l=0;void 0===d&&(d=0);"string"===typeof b?(a=g.getLine(a).indexOf(b),-1!==a&&(l=a,d=l+b.length)):(l=b,b=g.getLineEnd(a)-h,l=Math.min(l,b),d=Math.min(d,b));this.moveSelection(h+l,h+d,f)}}});return{BaseEditor:g,Editor:d}});
define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(m,n,l,f,b,h,g){function d(a){var d=a.getTextView();l.KeyMode.call(this,d);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";d.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));d.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var f=this;this._listener={onVerify:function(a){var e=f.editor,d=e.getModel(),g=e.mapOffset(a.start),e=e.mapOffset(a.end),d=d.getText(g,e);if((d=f._prefix.match(RegExp("^"+b.escape(d),"i")))&&0<d.length)f._prefix+=a.text,f._success=!0,f._status(),f.find(f._forward,!0),a.text=null},onSelection:function(){f._ignoreSelection||f.setActive(!1)}}}function a(a,b,d){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 f=this;this._listeners={onEditorFocus:function(a){f._removeCurrentAnnotation(a)}};this.setOptions(d)}}var k={};d.prototype=new l.KeyMode;h.mixin(d.prototype,{createKeyBindings:function(){var a=n.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 d=this._prefix;if(0===d.length)return!1;var f=this.editor,g=f.getModel(),g=a?this._success?b?this._start:f.getCaretOffset()+
1:0:this._success?b?this._start:f.getCaretOffset():g.getCharCount()-1;(d=f.getModel().find({string:d,start:g,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next())?(b||(this._start=g),this._ignoreSelection=this._success=!0,f.moveSelection(a?d.start:d.end,a?d.end:d.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?m.incrementalFindStr:m.incrementalFindStrNotFound:this._success?m.incrementalFindReverseStr:m.incrementalFindReverseStrNotFound;a=g.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
k.IncrementalFind=d;a.prototype={find:function(a,b,d){this.setOptions({reverse:!a});var f=this.getFindString(),g;b&&(f=b.findString||f,g=b.count);a=this.getOptions();this.setOptions(b);b=d?this._startOffset:this.getStartOffset();if((g=this._doFind(f,b,g))&&!d)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="",d=!1,f=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var k=a.substring(g,g+1);if(d){switch(k){case "R":b+=f;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+k}d=!1}else"\\"===k?d=!0:b+=k}d&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,d=this._processReplaceString(this.getReplaceString()),f=b.getSelection().start;if(b=b.getModel().find({string:a,start:f,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,d=b.getTextView();b.reportStatus(m.replacingAll);var f=this._processReplaceString(this.getReplaceString()),k=this;window.setTimeout(function(){for(var h=0,l=0;;){var n=k._doFind(a,h,null,!0);if(!n)break;l++;1===l&&(d.setRedraw(!1),k.startUndo());k._doReplace(n.start,n.end,a,f);h=k.getStartOffset()}0<
l&&(k.endUndo(),d.setRedraw(!0));0<h?b.reportStatus(g.formatMessage(m.replacedMatches,l)):b.reportStatus(m.nothingReplaced,"error");k._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(f.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,d){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:d?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,d,g){d=d||1;var k=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,l;if(this._regex)try{l=this._find(a,b,g)}catch(n){k.reportStatus(n.message,
"error");return}else l=this._find(a,b,g);for(a=0;a<d&&l.hasNext();a++)h=l.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(m.notFound,"error");if(this.isVisible()){d=f.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(l=k.getAnnotationModel())l.removeAnnotations(d),h&&l.addAnnotation(f.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var w=this;this._timer=window.setTimeout(function(){w._markAllOccurrences();
w._timer=null},500)}}this._findCallback?this._findCallback(h):h&&k.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,d,f){var g=this._editor;this._regex&&(f=g.getText(a,b).replace(RegExp(d,this._caseInsensitive?"i":""),f));g.setText(f,a,b);g.setSelection(a,a+f.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=f.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(),g=[],k;d.hasNext();){var h=d.next();h.type===b&&g.push(h)}if(this.isVisible()){d=
this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(k=[];d.hasNext();)h=d.next(),k.push(f.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(g,k)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(a){(a=
this._editor.getAnnotationModel())&&a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};k.Find=a;return k});
define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(m,n,l,f,b){function h(b,d,a){n.Find.call(this,b,d,a)}h.prototype=new n.Find;l.mixin(h.prototype,{getFindString:function(){var b=this._findInput;return!b?n.Find.prototype.getFindString.call(this):b.value},getReplaceString:function(){var b=this._replaceInput;return!b?n.Find.prototype.getReplaceString(this):b.value},hide:function(){var b=this.isVisible();n.Find.prototype.hide.call(this);
b&&(this._rootDiv.className="textViewFind")},show:function(b){n.Find.prototype.show.call(this,b);var d=b.findString;b=b.replaceString;var a=this._findInput;a||(this._create(),a=this._findInput);d&&(a.value=d);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,d=this._editor.getTextView(),a=d.getOptions("parent").ownerDocument,k=b.createElement(a,"div");k.className="textViewFind";f.addEventListener(k,
"keydown",function(a){g._handleKeyDown(a)});this._rootDiv=k;this._createContents(a,k);d._rootDiv.insertBefore(k,d._rootDiv.firstChild)},_createContents:function(g,d){var a=this,k=b.createElement(g,"input");k.className="textViewFindInput";this._findInput=k;k.type="text";k.placeholder=m.findWith;f.addEventListener(k,"input",function(b){return a._handleInput(b)});d.appendChild(k);k=b.createElement(g,"span");a._createButton(g,k,m.next,function(){a.find(!0)});a._createButton(g,k,m.previous,function(){a.find(!1)});
d.appendChild(k);a._editor.getTextView().getOptions("readonly")||(k=b.createElement(g,"input"),k.className="textViewReplaceInput",this._replaceInput=k,k.type="text",k.placeholder=m.replaceWith,d.appendChild(k),k=b.createElement(g,"span"),a._createButton(g,k,m.replace,function(){a.replace()}),a._createButton(g,k,m.replaceAll,function(){a.replaceAll()}),d.appendChild(k));k=b.createElement(g,"span");a._createButton(g,k,m.regex,function(b){a._toggle("regex",b.target)},this._regex,m.regexTooltip);a._createButton(g,
k,m.caseInsensitive,function(b){a._toggle("caseInsensitive",b.target)},this._caseInsensitive,m.caseInsensitiveTooltip);a._createButton(g,k,m.wholeWord,function(b){a._toggle("wholeWord",b.target)},this._wholeWord,m.wholeWordTooltip);d.appendChild(k);k=a._createButton(g,d,"",function(){a.hide()});k.className="textViewFindCloseButton";k.title=m.closeTooltip},_createButton:function(b,d,a,k,e,h){var q=b.createElement("button");this._checked(e,q);h&&(q.title=h);f.addEventListener(q,"click",function(a){k.call(this,
a)},!1);a&&q.appendChild(b.createTextNode(a));d.appendChild(q);return q},_toggle:function(b,d){var a={};a[b]=!this["_"+b];this.setOptions(a);this._checked(a[b],d)},_checked:function(b,d){d.className="textViewFindButton";b&&(d.className+=" checked")},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(f){var d,a=(b.isMac?f.metaKey:f.ctrlKey)&&!f.altKey&&!f.shiftKey;a&&70===f.keyCode&&(d=!0);if((b.isMac?f.metaKey:f.ctrlKey)&&!f.altKey&&75===f.keyCode||
13===f.keyCode)13===f.keyCode?this.find(this._reverse?f.shiftKey:!f.shiftKey):this.find(!f.shiftKey),d=!0;a&&82===f.keyCode&&(this.replace(),d=!0);27===f.keyCode&&(this.hide(),d=!0);return d?(f.stopPropagation&&f.stopPropagation(),f.preventDefault&&f.preventDefault(),f.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(m,n,l,f,b,h,g){function d(a,e,d){this.editor=a;this.undoStack=e;this._incrementalFind=new b.IncrementalFind(a);this._find=d?d:new h.FindUI(a,e);this._lastEditLocation=null;this.init()}function a(a,b,e,d){this.editor=a;this.undoStack=b;this.contentAssist=e;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var k=l.AnnotationType,e={};d.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:m.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:m.redo});a.setKeyBinding(new n.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();this._find.show({findString:this.editor.getText(a.start,a.end)});return!0}return!1}.bind(this),{name:m.find});a.setKeyBinding(new n.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
(this._find.find(!0,a),!0):!1}.bind(this),{name:m.findNext});a.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:m.findPrevious});a.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:m.incrementalFind});a.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:m.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:m.unindentLines});a.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:m.moveLinesUp});a.setKeyBinding(new n.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:m.moveLinesDown});a.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:m.copyLinesUp});a.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:m.copyLinesDown});a.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:m.deleteLines});a.setKeyBinding(new n.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:m.gotoLine});a.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:m.nextAnnotation});a.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:m.prevAnnotation});a.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:m.expand});a.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:m.collapse});a.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:m.expandAll});a.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:m.collapseAll});a.setKeyBinding(new n.KeyBinding("q",!g.isMac,!1,!1,g.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:m.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineStart(d),d=b.getLineEnd(e,!0),g=b.getLineCount(),k="",f=b.getText(f,d);e===g-1&&(f=(k=b.getLineDelimiter())+f);a.setText(f,d,d);a.setSelection(d+k.length,d+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-
1:e.end),d=b.getLineStart(d),f=b.getLineEnd(e,!0),g=b.getLineCount(),k="",f=b.getText(d,f);e===g-1&&(f+=k=b.getLineDelimiter());a.setText(f,d,d);a.setSelection(d,d+f.length-k.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=1;a&&a.count&&(e=a.count);var d=b.getSelection(),f=b.getModel(),g=f.getLineAtOffset(d.start);a=f.getLineStart(g);e=d.start!==d.end||1===e?f.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(g+e-1,f.getLineCount()-
1);e=f.getLineEnd(e,!0);b.setText("",a,e);return!0},expandAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var d=b.getModel(),f=b.getCaretOffset(),g=d.getLineAtOffset(f),f=d.getLineStart(g),g=d.getLineEnd(g,!0);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g),d.getBaseModel());for(var k,e=e.getAnnotations(f,g);!k&&e.hasNext();)d=e.next(),d.type===l.AnnotationType.ANNOTATION_FOLDING&&(k=d);k&&a!==k.expanded&&(a?k.expand():(b.setCaretOffset(k.start),k.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,e=b.getTextView(),b=b.getAnnotationModel();if(!b)return!0;var d=b.getAnnotations();for(e.setRedraw(!1);d.hasNext();)b=d.next(),b.type===l.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());e.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),g=e.getLineAtOffset(d.end>
d.start?d.end-1:d.end);if(f!==g){var k=[];k.push("");for(var h=f;h<=g;h++)k.push(e.getLine(h,!0));h=e.getLineStart(f);e=e.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(k.join(b),h,e);a.setSelection(h===d.start?d.start:d.start+b.length,d.end+(g-f+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(m.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),f=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),g=b.getLineCount();if(f===g-1)return!0;var d=b.getLineStart(d),e=b.getLineEnd(f,!0),k=b.getLineEnd(f+1,!0)-(e-d),h=0;f!==g-2?b=b.getText(d,e):(f=b.getLineEnd(f),
b=b.getText(f,e)+b.getText(d,f),h+=e-f);this.startUndo();a.setText("",d,e);a.setText(b,k,k);a.setSelection(k+h,k+h+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start);if(0===d)return!0;var f=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),g=b.getLineCount(),e=b.getLineStart(d-1),k=b.getLineStart(d),h=b.getLineEnd(f,!0),l=b.getText(k,h),m=0;f===g-1&&(f=b.getLineEnd(d-
1),d=b.getLineEnd(d-1,!0),l+=b.getText(f,d),k=f,m=d-f);this.startUndo();a.setText("",k,h);a.setText(l,e,e);a.setSelection(e,e+l.length-m);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===k.ANNOTATION_MATCHING_BRACKET||a.type===k.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var e=this.editor,d=e.getAnnotationModel();if(!d)return!0;var g=e.getOverviewRuler()||e.getAnnotationStyler();if(!g)return!0;for(var h=e.getModel(),l=e.getCaretOffset(),
m=d.getAnnotations(a?l:0,a?h.getCharCount():l),n=null;m.hasNext();){var y=m.next();if(a){if(y.start<=l)continue}else if(y.start>=l)continue;if(!b(y)&&(n=y,a))break}if(n){for(var C=[n],m=d.getAnnotations(n.start,n.start);m.hasNext();)y=m.next(),y!==n&&!b(y)&&C.push(y);var s=e.getTextView(),A=h.getLineAtOffset(n.start),B=f.Tooltip.getTooltip(s);if(!B)return e.moveSelection(n.start),!0;e.moveSelection(n.start,n.start,function(){B.setTarget({getTooltipInfo:function(){var a=s.convert({x:s.getLocationAtOffset(n.start).x,
y:s.getLocationAtOffset(h.getLineStart(A)).y},"document","page");return{contents:C,x:a.x,y:a.y+Math.floor(1.33*s.getLineHeight(A))}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),g=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),k=b.getOptions("tabSize"),h=Array(k+1).join(" "),l=[],m=b=0,n=f;n<=g;n++){var s=e.getLine(n,!0);if(e.getLineStart(n)!==
e.getLineEnd(n))if(0===s.indexOf("\t"))s=s.substring(1),b++;else if(0===s.indexOf(h))s=s.substring(k),b+=k;else return!0;n===f&&(m=b);l.push(s)}f=e.getLineStart(f);k=e.getLineEnd(g,!0);e=e.getLineStart(g);a.setText(l.join(""),f,k);g=f===d.start?d.start:d.start-m;d=Math.max(g,d.end-b+(d.end===e+1&&d.start!==d.end?1:0));a.setSelection(g,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};e.TextActions=
d;a.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:m.trimTrailingWhitespaces});a.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:m.toggleLineComment});a.setKeyBinding(new n.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:m.addBlockComment});a.setKeyBinding(new n.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:m.removeBlockComment});a.setKeyBinding(new n.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var e=a.getSelection();if(e.start===e.end){for(var d=a.getModel(),f=d.getLineAtOffset(e.start),
g=d.getLine(f,!1),k=d.getLineStart(f),h=0,l=e.start-k,m;h<l&&(32===(m=g.charCodeAt(h))||9===m);)h++;var k=g.substring(0,h),b=b.getOptions("tabSize","expandTab"),n=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),s=/^[\s]*\/\*[\*]*[\s]*$/,A=/^[\s]*\*/,B=/\*\/[\s]*$/,E=g.substring(0,l),D=g.substring(l),G;if(this.smartIndentation&&123===g.charCodeAt(G=E.trimRight().length-1))return d=l-G-1,D=D.length-D.trimLeft().length,g=125===g.charCodeAt(l+D)?b+k+n+b+k:b+k+n,a.setText(g,e.start-
d,e.end+D),a.setCaretOffset(e.start+b.length+k.length+n.length-d),!0;if(this.autoCompleteComments&&!B.test(E)&&(s.test(E)||A.test(E))){if(h=s.exec(E)){g=b+k+" * ";g=B.test(D)?g+D.substring(0,D.length-2).trim():g+D.trim();if(d.getLineCount()===f+1||!A.test(d.getLine(f+1)))g+=b+k+" */";a.setText(g,e.start,e.end+D.length);a.setCaretOffset(e.start+b.length+k.length+3);return!0}if(h=A.exec(E))for(f-=1;0<=f;f--){h=d.getLine(f,!1);if(s.test(h))return B.test(D)||47===g.charCodeAt(l)?(g=b+k+"*"+D,k=e.start+
b.length+k.length+1):(g=b+k+"* "+D,k=e.start+b.length+k.length+2),a.setText(g,e.start,e.end+D.length),a.setCaretOffset(k),!0;if(!A.test(h))break}}else{if(B.test(E)&&32===k.charCodeAt(k.length-1))return g=b+k.substring(0,k.length-1),a.setText(g,e.start,e.end),a.setCaretOffset(e.start+g.length),!0;if(0<h){for(h=l;h<g.length&&(32===(m=g.charCodeAt(h++))||9===m);)e.end++;a.setText(d.getLineDelimiter()+k,e.start,e.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=this._findEnclosingComment(b,e.start,e.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;b=b.getText(e.start,e.end);if(0===b.length)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),f=b.length;a.setText("/*"+b+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(f-d));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var e=this.editor;if(e.getTextView().getOptions("readonly"))return!1;var d=e.getSelection(),f=e.getModel(),g=e.getCaretOffset()===f.getCharCount()?"":f.getText(d.start,d.start+1).trim(),k=/^$|[)}\]>]/;return d.start===d.end&&k.test(g)?(e.setText(a+b,d.start,d.start),e.setCaretOffset(d.start+1),!0):d.start!==d.end?(f=f.getText(d.start,d.end),e.setText(a+f+b,d.start,d.end),e.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel(),f=b.getCaretOffset(),g=0===f?"":d.getText(e.start-1,e.start).trim(),k=f===d.getCharCount()?"":d.getText(e.start,e.start+1).trim(),f=/^"$|^'$/,h=/\w/,l=/^$|[)}\]>]/;if(e.start!==e.end){d=d.getText(e.start,e.end);if(f.test(d))return!1;b.setText(a+d+a,e.start,e.end);b.setSelection(e.start+1,e.end+1)}else{if(k!==a){if(g===a||f.test(k)||h.test(g)||!l.test(k))return!1;b.setText(a+a,e.start,e.start)}b.setCaretOffset(e.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],e=0;e<a.positions.length;++e)b[e]={positions:[{offset:a.positions[e].offset,length:a.positions[e].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var e=a.getModel(),d=a.getCaretOffset(),f=0===d?"":e.getText(b.start-1,b.start),e=d===e.getCharCount()?"":e.getText(b.start,b.start+1);("("===f&&")"===e||"["===f&&"]"===e||"{"===f&&"}"===e||"\x3c"===f&&"\x3e"===e||'"'===f&&'"'===e||"'"===f&&"'"===e)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,e){var d=a.getLineAtOffset(b),
f=a.getLineAtOffset(e),g,k,h,l,m,n;for(g=d;0<=g&&!(k=a.getLine(g),h=g===d?b-a.getLineStart(d):k.length,l=k.lastIndexOf("/*",h),k=k.lastIndexOf("*/",h),k>l);g--)if(-1!==l){m=a.getLineStart(g)+l;break}for(g=f;g<a.getLineCount()&&!(k=a.getLine(g),h=g===f?e-a.getLineStart(f):0,l=k.indexOf("/*",h),k=k.indexOf("*/",h),-1!==l&&l<k);g++)if(-1!==k){n=a.getLineStart(g)+k;break}return{commentStart:m,commentEnd:n}},lineStart:function(){for(var a=this.editor,b=a.getModel(),e=a.getCaretOffset(),d=b.getLineAtOffset(e),
f=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var g=b.charCodeAt(d);if(!(32===g||9===g))break}d+=f;return e!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getText(e.start,e.end),f,g,k;for(k=0;k<d.length;k++)if("/*"===d.substring(k,k+2)){f=e.start+k;break}for(;k<d.length;k++)if("*/"===d.substring(k,k+2)){g=e.start+k;break}if(void 0!==f&&void 0!==g)a.setText(b.getText(f+
2,g),f,g+2),a.setSelection(f,g);else{d=this._findEnclosingComment(b,e.start,e.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(e.start-2,e.end-2)}return!0},toggleLineComment:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;for(var e=this.lineComment||"//",d=a.getModel(),f=a.getSelection(),g=d.getLineAtOffset(f.start),k=d.getLineAtOffset(f.end>f.start?
f.end-1:f.end),h=!0,l=[],m,n=g;n<=k;n++){var s=d.getLine(n,!0);m=s.indexOf(e);l.push(m);if(!h||-1===m)h=!1;else if(0!==m){for(h=0;h<m;h++){var A=s.charCodeAt(h);if(!(32===A||9===A))break}h=h===m}}n=e.length;s=d.getLineStart(g);b.setRedraw(!1);this.startUndo();if(h){for(h=l.length-1;0<=h;h--)m=l[h]+d.getLineStart(g+h),a.setText("",m,m+n);d=d.getLineStart(k);e=s===f.start?f.start:f.start-n;f=f.end-n*(k-g+1)+(f.end===d+1?n:0)}else{for(h=l.length-1;0<=h;h--)m=d.getLineStart(g+h),a.setText(e,m,m);e=s===
f.start?f.start:f.start+n;f=f.end+n*(k-g+1)}this.endUndo();b.setRedraw(!0);a.setSelection(e,f);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),e=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,f=b.getLineCount(),g=0;g<f;g++){var k=b.getLine(g),h=d.exec(k);if(h){var l=b.getLineStart(g),k=h[0].length,h=l+h.index;b.setText("",h,h+k);e.start>h&&(e.start=Math.max(h,e.start-k));e.start!==e.end&&e.end>h&&(e.end=Math.max(h,
e.end-k))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(e.start,e.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(e.start,e.start+1))===a?(b.setCaretOffset(e.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};e.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 e});
define("orion/editor/undoStack",[],function(){function m(f,b,h,g,d){this.model=f;this.offset=b;this.text=h;this.previousText=g;this.type=d}function n(f){this.owner=f;this.changes=[]}function l(f,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(f.getModel){var g=f.getModel();g.getBaseModel&&(g=g.getBaseModel());this.model=g;this.setView(f)}else this.shared=!0,this.model=f;this.model.addEventListener("Changing",
this._listener.onChanging)}m.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(f,b){this._doUndoRedo(this.offset,this.previousText,this.text,f,b);return!0},redo:function(f,b){this._doUndoRedo(this.offset,this.text,this.previousText,f,b);return!0},merge:function(f,b,h,g,d){if(g===this.type){if(1===g&&f===
this.offset+this.text.length)return this.text+=b,!0;if(-1===g&&d===this.offset)return this.offset=f,this.previousText=h+this.previousText,!0;if(-1===g&&f===this.offset)return this.previousText+=h,!0}return!1},_doUndoRedo:function(f,b,h,g,d){this.model.setText(b,f,f+h.length);d&&g&&(h=g.getModel(),h!==this.model&&(f=h.mapOffset(f,!0)),g.setSelection(f,f+b.length))}};n.prototype={getRedoChanges:function(){for(var f=[],b=0;b<this.changes.length;b++)f=f.concat(this.changes[b].getRedoChanges());return f},
getUndoChanges:function(){for(var f=[],b=this.changes.length-1;0<=b;b--)f=f.concat(this.changes[b].getUndoChanges());return f},add:function(f){this.changes.push(f)},end:function(f){f&&(this.endSelection=f.getSelection(),this.endCaret=f.getCaretOffset());(f=this.owner)&&f.end&&f.end()},undo:function(f,b){1<this.changes.length&&f&&f.setRedraw(!1);for(var h=this.changes.length-1;0<=h;h--)this.changes[h].undo(f,!1);1<this.changes.length&&f&&f.setRedraw(!0);if(b&&f){var h=this.startSelection.start,g=this.startSelection.end;
f.setSelection(this.startCaret?h:g,this.startCaret?g:h)}(h=this.owner)&&h.undo&&h.undo();return 0<this.changes.length},redo:function(f,b){1<this.changes.length&&f&&f.setRedraw(!1);for(var h=0;h<this.changes.length;h++)this.changes[h].redo(f,!1);(1<this.changes.length,f)&&f.setRedraw(!0);if(b&&f){var h=this.endSelection.start,g=this.endSelection.end;f.setSelection(this.endCaret?h:g,this.endCaret?g:h)}(h=this.owner)&&h.redo&&h.redo();return 0<this.changes.length},merge:function(f,b,h,g,d){var a=this.changes.length;
return 0<a?this.changes[a-1].merge(f,b,h,g,d):!1},start:function(f){f&&(this.startSelection=f.getSelection(),this.startCaret=f.getCaretOffset());(f=this.owner)&&f.start&&f.start()}};l.prototype={destroy:function(){this._onDestroy()},add:function(f){this.compoundChange?this.compoundChange.add(f):(this.stack.splice(this.index,this.stack.length-this.index,f),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 f=[],b=this.index;b<this.stack.length;b++)f=f.concat(this.stack[b].getRedoChanges());
return f},getUndoChanges:function(){this._commitUndo();for(var f=[],b=this.index;0<=b;b--)f=f.concat(this.stack[b].getUndoChanges());return f},undo:function(){this._commitUndo();var f;f=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;f=this.stack[--this.index]}while(!(f=f.undo(this.view,!0)));this._ignoreUndo=!1;return f},redo:function(){this._commitUndo();var f;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;f=this.stack[this.index++]}while(!f.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(f){this.view!==f&&(this.view&&f.removeEventListener("Destroy",this._listener.onDestroy),(this.view=f)&&f.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(f){this._commitUndo();f=new n(f);this.add(f);this.compoundChange=f;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(f){(!f||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(f){if(!this._ignoreUndo){var b=f.text,h=f.start,g=f.addedCharCount,d=f.removedCharCount;f=h+d;var a=0;0===g&&1===d?a=-1:1===g&&0===d&&(a=1);g=this.stack.length;d=this.model.getText(h,f);(!(0<g&&this.index===g)||!this.stack[g-1].merge(h,b,d,a,f))&&this.add(new m(this.model,
h,b,d,a))}}};return{UndoStack:l}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(m,n,l,f){function b(a,b,d,f){this._location=b||"left";this._overview=d||"page";this._rulerStyle=f;this._view=null;var g=this;this._listener={onTextModelChanged:function(a){g._onTextModelChanged(a)},onAnnotationModelChanged:function(a){g._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function h(a,e,d,f,g){b.call(this,a,e,"page",d);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function g(a,e,d){b.call(this,a,e,"page",d)}function d(a,e,d){b.call(this,a,e,"document",d)}function a(a,b,d){g.call(this,a,b,d)}b.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var f=this._view.getModel(),g=f.getLineStart(a),h=f.getLineEnd(b-1),l=f;f.getBaseModel&&(l=f.getBaseModel(),g=f.mapOffset(g),h=f.mapOffset(h));for(var m=[],d=this.getAnnotationsByType(d,g,h),g=0;g<
d.length;g++)for(var h=d[g],n=l.getLineAtOffset(h.start),w=l.getLineAtOffset(Math.max(h.start,h.end-1)),z=n;z<=w;z++){var y=z;if(f!==l){y=l.getLineStart(z);y=f.mapOffset(y,!0);if(-1===y)continue;y=f.getLineAtOffset(y)}if(a<=y&&y<b){var C=this._mergeAnnotation(m[y],h,z-n,w-n+1);C&&(m[y]=C)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var s in m)m[s]._multiple&&(m[s].html+=this._multiAnnotationOverlay.html);return m},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a,b){if(void 0!==a){var d=this._view,f=d.getModel(),g=f,h=f.getLineStart(a),m=h,n=h,u=this._annotationModel;if(u){d=d.getSelection();n=f.getLineEnd(a,!0);h<=d.start&&d.start<n&&(h=d.start);f.getBaseModel&&(h=f.mapOffset(h),
n=f.mapOffset(n),g=f.getBaseModel());for(var w,n=u.getAnnotations(h,n),u=null;!w&&n.hasNext();)d=n.next(),this.isAnnotationTypeVisible(d.type)&&(u=d,d.start<=h||(w=d));u&&void 0!==u.groupId&&(this._currentClickGroup=this._currentClickGroup===u.groupId?null:u.groupId,this._setCurrentGroup(a));w&&g.getLineAtOffset(w.start)===g.getLineAtOffset(h)?(h=w.start,n=w.end):n=h=m;f.getBaseModel&&(h=f.mapOffset(h,!0),n=f.mapOffset(n,!0))}(f=l.Tooltip.getTooltip(this._view))&&f.setTarget(null);this._view.setSelection(n,
h,1/3,function(){})}},onDblClick:function(a,b){},onMouseMove:function(a,b){var d=l.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var f=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return f._getTooltipInfo(f._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(a,b){this._currentClickGroup||this._setCurrentGroup(-1);var d=l.Tooltip.getTooltip(this._view);
d&&d.setTarget(null)},_getTooltipInfo:function(a,b){if(void 0!==a){var d=this._view,f=d.getModel(),g=this._annotationModel,h=[];if(g){var h=f.getLineStart(a),l=f.getLineEnd(a);f.getBaseModel&&(h=f.mapOffset(h),l=f.mapOffset(l));h=this.getAnnotationsByType(g,h,l)}g=this._getTooltipContents(a,h);if(!g)return null;g={contents:g,anchor:this.getLocation()};h=d.getClientArea();"document"===this.getOverview()?h.y=d.convert({y:b},"view","document").y:h.y=d.getLocationAtOffset(f.getLineStart(a)).y;d.convert(h,
"document","page");g.x=h.x;g.y=h.y;"right"===g.anchor&&(g.x+=h.width);return g}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var e=0;e<a.length;e++)if(g.isAnnotationTypeVisible(a[e].type)){var k=a[e].start,h=a[e].end;f.getBaseModel&&(k=f.mapOffset(k,!0),h=f.mapOffset(h,!0));-1!==k&&-1!==h&&d.redrawLines(f.getLineAtOffset(k),f.getLineAtOffset(Math.max(k,h-1))+1,g)}}var d=this._view;if(d){var f=d.getModel(),g=this,h=f.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,f.getBaseModel&&(a=f.mapOffset(a,!0)),a=f.getLineAtOffset(a),d.redrawLines(a,h,g)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d,f){a||(a={});0===d&&(a.html&&b.html?(b.html!==a.html&&(!a._multiple&&this._multiAnnotation)&&(a.html=this._multiAnnotation.html),a._multiple=!0):a.html=b.html);a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+(" "+b.styleClass):b.styleClass;var d;if(b.style)for(d in a.style||(a.style={}),b.style)void 0===a.style[d]&&(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)void 0===a.attributes[d]&&(a.attributes[d]=b.attributes[d])}return a},_setCurrentGroup:function(a){var b=this._annotationModel,d=null,f=b.getTextModel(),g,h=this._currentGroupAnnotation;if(-1!==a){var l=f.getLineStart(a),m=f.getLineEnd(a);f.getBaseModel&&(l=f.mapOffset(l),m=f.mapOffset(m));
for(g=b.getAnnotations(l,m);g.hasNext();)if(f=g.next(),this.isAnnotationTypeVisible(f.type)&&f.start<=l&&f.end>=m&&void 0!==f.groupId){d=f;break}if(h&&d&&h.groupId===d.groupId)return}this._currentGroupAnnotation=null;h&&b.removeAnnotations(h.groupType);if(d&&-1!==a){this._currentGroupAnnotation=d;g=b.getAnnotations();for(a=[];g.hasNext();)f=g.next(),delete f.groupAnnotation,f.groupId===d.groupId&&(f=f.createGroupAnnotation(),a.push(f));b.replaceAnnotations(null,a)}}};n.AnnotationTypeList.addMixin(b.prototype);
h.prototype=new b;h.prototype.getAnnotations=function(a,e){for(var d=b.prototype.getAnnotations.call(this,a,e),f=this._view.getModel(),g=a;g<e;g++){var h=g&1?this._oddStyle:this._evenStyle,l=g;f.getBaseModel&&(l=f.getLineStart(l),l=f.getBaseModel().getLineAtOffset(f.mapOffset(l)));d[g]||(d[g]={});d[g].html=this._firstLine+l+"";d[g].style||(d[g].style=h)}return d};h.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};h.prototype.setFirstLine=
function(a){this._firstLine=void 0!==a?a:1};h.prototype._onTextModelChanged=function(a){var b=a.start;a=this._view.getModel();var d=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),d=(this._firstLine+d-1+"").length;this._numOfDigits!==d&&(this._numOfDigits=d,b=a.getLineAtOffset(b),this._view.redrawLines(b,a.getLineCount(),this))};g.prototype=new b;d.prototype=new b;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
d.prototype._getTooltipContents=function(a,e){if(0===e.length){var d=this._view.getModel(),g=a;d.getBaseModel&&(g=d.getLineStart(g),g=d.getBaseModel().getLineAtOffset(d.mapOffset(g)));return f.formatMessage(m.line,g+1)}return b.prototype._getTooltipContents.call(this,a,e)};d.prototype._mergeAnnotation=function(a,b,d,f){if(0===d)return a||(a={html:"\x26nbsp;",style:{style:{height:3*f+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle)),a};a.prototype=new g;a.prototype.onClick=function(a,b){if(void 0!==
a){var d=this._annotationModel;if(d){var f=this._view.getModel(),g=f.getLineStart(a),h=f.getLineEnd(a,!0);f.getBaseModel&&(g=f.mapOffset(g),h=f.mapOffset(h),f=f.getBaseModel());for(var m,d=d.getAnnotations(g,h);!m&&d.hasNext();)h=d.next(),this.isAnnotationTypeVisible(h.type)&&f.getLineAtOffset(h.start)===f.getLineAtOffset(g)&&(m=h);m&&((f=l.Tooltip.getTooltip(this._view))&&f.setTarget(null),m.expanded?m.collapse():m.expand())}}};a.prototype._getTooltipContents=function(a,b){if(0<b.length){var d=this._view.getModel(),
f=d.getLineStart(a);d.getBaseModel&&(f=d.mapOffset(f),d=d.getBaseModel());for(var f=d.getLineAtOffset(f),h=0;h<b.length;h++){var l=b[h];if(this.isAnnotationTypeVisible(l.type)&&d.getLineAtOffset(l.start)===f){if(b[h].expanded)break;return g.prototype._getTooltipContents.call(this,a,[l])}}}return null};a.prototype._onAnnotationModelChanged=function(a){function b(a){for(l=0;l<a.length;l++)if(h.isAnnotationTypeVisible(a[l].type)){var e=a[l].start;f.getBaseModel&&(e=f.mapOffset(e,!0));-1!==e&&(n=Math.min(n,
f.getLineAtOffset(e)))}}if(a.textModelChangedEvent)g.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var f=d.getModel(),h=this,l,m=f.getLineCount(),n=m;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();for(l=0;l<a.length;l++)d.redrawLines(n,m,a[l])}}};return{Ruler:b,AnnotationRuler:g,LineNumberRuler:h,OverviewRuler:d,FoldingRuler:a}});
define("orion/editor/textDND",["orion/util"],function(m){function n(l,f){this._view=l;this._undoStack=f;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(f){b._onDragStart(f)},onDragEnd:function(f){b._onDragEnd(f)},onDragEnter:function(f){b._onDragEnter(f)},onDragOver:function(f){b._onDragOver(f)},onDrop:function(f){b._onDrop(f)},onDestroy:function(f){b._onDestroy(f)}};l.addEventListener("DragStart",this._listener.onDragStart);l.addEventListener("DragEnd",
this._listener.onDragEnd);l.addEventListener("DragEnter",this._listener.onDragEnter);l.addEventListener("DragOver",this._listener.onDragOver);l.addEventListener("Drop",this._listener.onDrop);l.addEventListener("Destroy",this._listener.onDestroy)}n.prototype={destroy:function(){var l=this._view;l&&(l.removeEventListener("DragStart",this._listener.onDragStart),l.removeEventListener("DragEnd",this._listener.onDragEnd),l.removeEventListener("DragEnter",this._listener.onDragEnter),l.removeEventListener("DragOver",
this._listener.onDragOver),l.removeEventListener("Drop",this._listener.onDrop),l.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(l){this.destroy()},_onDragStart:function(l){var f=this._view,b=f.getSelection(),f=f.getModel();f.getBaseModel&&(b.start=f.mapOffset(b.start),b.end=f.mapOffset(b.end),f=f.getBaseModel());if(f=f.getText(b.start,b.end))this._dragSelection=b,l.event.dataTransfer.effectAllowed="copyMove",l.event.dataTransfer.setData("Text",f)},_onDragEnd:function(l){if(this._dragSelection){var f=
this._view,b=l.event.dataTransfer.dropEffect;if(!m.isFirefox&&("none"!==b||this._dropText))b=l.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(l="move"===b)&&f.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,h=this._dropOffset;l&&(h>=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));f.setText(b,h,h);f.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(l){var f=l.event.dataTransfer.types,b=!this._view.getOptions("readonly");b&&f&&(b=f.contains?f.contains("text/plain")||f.contains("Text"):-1!==f.indexOf("text/plain")||-1!==f.indexOf("Text"));b?m.isFirefox||(this._dropEffect=l.event.dataTransfer.dropEffect=(m.isMac?l.event.altKey:l.event.ctrlKey)?"copy":
"move"):l.event.dataTransfer.dropEffect="none"},_onDrop:function(l){var f=this._view,b=l.event.dataTransfer.getData("Text");b&&(m.isFirefox||(l.event.dataTransfer.dropEffect=this._dropEffect),l=f.getOffsetAtLocation(l.x,l.y),this._dragSelection?(this._dropOffset=l,this._dropText=b):(f.setText(b,l,l),f.setSelection(l,l+b.length)))}};return{TextDND:n}});
define("orion/editor/templates",[],function(){function m(l,f,b,h){this.prefix=l;this.description=f;this.template=b;this.name=h;this._parse()}function n(l,f){this._keywords=l||[];this._templates=[];this.addTemplates(f||[])}m.prototype={getProposal:function(l,f,b){l=f-l.length;f={};var h,g=void 0!==b.delimiter?b.delimiter:"\n";b.indentation&&(g+=b.indentation);var d=void 0!==b.tab?b.tab:"\t",a=0,k=this.variables,e=this.segments;b=[];for(var p=0;p<e.length;p++){var m=e[p],n=k[m];if(void 0!==n)switch(m){case "${tab}":m=
d;break;case "${delimiter}":m=g;break;case "${cursor}":m="";h=a;break;default:var r=f[m];r||(r=f[m]={data:n.data,positions:[]});m=n.substitution;r.data&&r.data.values&&(m=r.data.values[0]);r.positions.push({offset:l+a,length:m.length})}b.push(m);a+=m.length}var g=[],v;for(v in f)f.hasOwnProperty(v)&&g.push(f[v]);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,f=[],b={},h,g=0,l=l.replace(/\n/g,"${delimiter}"),l=l.replace(/\t/g,"${tab}");l.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(d,a,k){var e=d.substring(2,d.length-1);a=d;var m=e,q=null,n=m.indexOf(":");-1!==n&&(m=m.substring(0,n),a="${"+m+"}",q=JSON.parse(e.substring(n+1).replace("\\}","}").trim()));(e=b[a])||(e=b[a]={});e.substitution=m;q&&(e.data=q);(h=l.substring(g,k))&&f.push(h);f.push(a);g=k+d.length;return m});(h=l.substring(g,l.length))&&f.push(h);this.segments=
f;this.variables=b}};n.prototype={addTemplates:function(l){for(var f=this.getTemplates(),b=0;b<l.length;b++)f.push(new m(l[b].prefix,l[b].description,l[b].template,l[b].name))},initialize:function(){},computeProposals:function(l,f,b){var h=this.getPrefix(l,f,b),g=[];this.isValid(h,l,f,b)&&(g=g.concat(this.getTemplateProposals(h,f,b)),g=g.concat(this.getKeywordProposals(h)));return g},getKeywords:function(){return this._keywords},getKeywordProposals:function(l){var f=[],b=this.getKeywords();if(b){for(var h=
0;h<b.length;h++)0===b[h].indexOf(l)&&f.push({proposal:b[h].substring(l.length),description:b[h],style:"noemphasis_keyword"});0<f.length&&f.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return f},getPrefix:function(l,f,b){return b.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(l,f,b){for(var h=[],g=this.getTemplates(),d=0;d<g.length;d++){var a=g[d];a.match(l)&&(a=a.getProposal(l,f,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,f){if(!(f.overwrite=f.proposal.substring(0,l.length)!==l))f.proposal=f.proposal.substring(l.length)},isValid:function(l,f,b,h){return!0}};return{Template:m,TemplateContentAssist:n}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(m,n,l,f,b,h){function g(a,b,e){var d=a.getTextView();l.KeyMode.call(this,d);this.editor=a;this.undoStack=b;this.contentAssist=e;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(a){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),e=this.linkedModeModel,d,f;e;)if(d=this._getPositionChanged(e,b,b+a.removedCharCount),f=d.position,void 0===f||f.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){e=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var g,k=0;k<d.length;++k){g=d[k];f=g.position;var h=f.offset<=b&&b<=f.offset+f.length;h&&!g.ansestor?(f.offset+=e,
f.length+=a,e+=a):(f.offset+=e,g.ansestor&&h&&(f.length+=a));g.escape&&(g.model.escapePosition=f.offset)}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,e=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),f=this.linkedModeModel,g,k;f;)if(g=this._getPositionChanged(f,e,d),k=g.position,void 0===k||k.model!==f)this.exitLinkedMode(!1),f=this.linkedModeModel;else break;if(f){var h=this._compoundChange;h?h.owner.model===f&&h.owner.group===k.group||
(this.endUndo(),this.startUndo()):this.startUndo();f.selectedGroupIndex=k.group;var h=0,l=a.text.length-(d-e);g=g.positions;for(var m,e=e-k.position.offset,p=d-k.position.offset,n=0;n<g.length;++n)m=g[n],d=m.position,m.oldOffset=d.offset,m.model===f&&m.group===k.group?(d.offset+=h,d.length+=l,h+=l):(d.offset+=h,m.ansestor&&(d.length+=k.count*l)),m.escape&&(m.model.escapePosition=d.offset);this.ignoreVerify=!0;for(n=g.length-1;0<=n;n--)m=g[n],m.model===f&&m.group===k.group&&b.setText(a.text,m.oldOffset+
e,m.oldOffset+p);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(g)}}}.bind(this)}}var d={};g.prototype=new l.KeyMode;h.mixin(g.prototype,{createKeyBindings:function(){var a=n.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(m.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 e=this.editor,d=e.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(m.linkedModeExited,null,!0);a&&e.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 d=this.linkedModeModel;if(d){d.selectedGroupIndex=a;a=d.groups[a];var e=a.positions[0],f=this.editor;f.setSelection(e.offset,e.offset+e.length);if(d=this.contentAssist)d.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new b.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
f.getSelection();return a.start===a.end&&(a=f.getCaretOffset(),e.offset<=a&&a<=e.offset+e.length)?f.getText(e.offset,a):""},d.offset=e.offset,d.deactivate(),d.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,d.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,b,e){for(var d=b.groups,f=0;f<d.length;f++)for(var g=d[f].positions,h=0;h<g.length;h++){var l=g[h];e&&(l={offset:l.offset+e,length:l.length});l={index:h,group:f,count:g.length,model:b,
position:l};a.push(l);b.nextModel&&b.nextModel.parentGroup===f&&(l.ansestor=!0,this._getModelPositions(a,b.nextModel,(e||0)+g[h].offset-g[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,e){var d;a=this._getSortedPositions(a);for(var f=a.length-1;0<=f;f--){var g=a[f].position;if(g.offset<=b&&e<=g.offset+g.length){d=a[f];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var e=[],d=[],g=b.getAnnotations(),h;g.hasNext();)switch(h=g.next(),h.type){case f.AnnotationType.ANNOTATION_LINKED_GROUP:case f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.push(h)}if(g=
this.linkedModeModel){a=a||this._getSortedPositions(g);for(var l=0;l<a.length;l++)if(h=a[l],h.model===g){var m=f.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===g.selectedGroupIndex&&(m=0===h.index?f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=f.AnnotationType.createAnnotation(m,h.offset,h.offset+h.length,"");d.push(h)}}b.replaceAnnotations(e,d)}}});d.LinkedMode=g;return d});
define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(m,n,l,f,b,h){function g(){}function d(){}function a(){}function k(){}function e(){}function p(){}var q={};g.prototype={createKeyBindings:function(a,b,e,d){d=new m.TextActions(a,b,d);var f=new h.LinkedMode(a,b,e);a=new m.SourceCodeActions(a,b,e,f);return{textActions:d,linkedMode:f,sourceCodeActions:a}}};q.KeyBindingsFactory=
g;d.prototype={createUndoStack:function(a){a=a.getTextView();return new n.UndoStack(a,200)}};q.UndoFactory=d;a.prototype={createLineNumberRuler:function(a){return new l.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};q.LineNumberRulerFactory=a;k.prototype={createFoldingRuler:function(a){return new l.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};q.FoldingRulerFactory=k;e.prototype={createAnnotationModel:function(a){return new f.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new f.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new l.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new l.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};q.AnnotationFactory=e;p.prototype={createTextDND:function(a,e){return new b.TextDND(a.getTextView(),e)}};q.TextDNDFactory=p;return q});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(m,n,l,f){return f.mixin({},m,n,l)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'\x3cdiv id\x3d"topWidget_id" style\x3d"height:100%;width:100%;position:relative"\x3e\n\t\x3cdiv class\x3d"leftPanelLayout "\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"left_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"left_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent" id\x3d"left_editor_id"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"left_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\t\x3cdiv class\x3d"split compareSplitLayout"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"rightPanelLayout"\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"right_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"right_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent"  id\x3d"right_editor_wrapper_id"\x3e\n\t\t\t\x3cdiv class\x3d"canvasContainer"\x3e\n\t\t\t\t\x3ccanvas id\x3d"diff_canvas_id" class\x3d"compareCanvas" width\x3d"46" height\x3d"3000"\x3e\x3c/canvas\x3e\n\t\t\t\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"compareEditorParentWithCanvas" id\x3d"right_editor_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"right_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(m,n,l){var f=f||{};f.TwoWayCompareUIFactory=function(){function b(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}b.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=m.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=m.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=m.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=m.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftActionDiv=m.node("left_action_id");this._leftActionDiv.id=b+"left_action_id";this._rightActionDiv=m.node("right_action_id");this._rightActionDiv.id=
b+"right_action_id";this._leftTitleDiv=m.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=m.node("right_title_id");this._rightTitleDiv.id=b+"right_title_id";this._leftStatusDiv=m.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=m.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=m.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var b=m.$(".split",this._topWidgetDiv);b.id=this._splitterId;var f=m.$(".leftPanelLayout",this._topWidgetDiv),d=m.$(".rightPanelLayout",this._topWidgetDiv);b&&(f&&d)&&(this._splitter=new n.Splitter({node:b,sidePanel:f,mainPanel:d}))},buildUI:function(){m.node(this._parentDivID).innerHTML=l;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return m.$(".leftPanelLayout",
this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(b){return b?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return b}();return f});
var JsDiff=function(){function m(b){for(var a=[],f=0;f<b.length;f++)b[f]&&a.push(b[f]);return a}function n(b){b=b.replace(/&/g,"\x26amp;");b=b.replace(/</g,"\x26lt;");b=b.replace(/>/g,"\x26gt;");return b=b.replace(/"/g,"\x26quot;")}var l=function(b){this.ignoreWhitespace=b};l.prototype={diff:function(b,a){if(a==b)return[{value:a}];if(!a)return[{value:b,removed:!0}];if(!b)return[{value:a,added:!0}];a=this.tokenize(a);b=this.tokenize(b);var f=a.length,e=b.length,g=f+e,h=[{newPos:-1,components:[]}],
l=this.extractCommon(h[0],a,b,0);if(h[0].newPos+1>=f&&l+1>=e)return h[0].components;for(var m=1;m<=g;m++)for(var n=-1*m;n<=m;n+=2){var t;t=h[n-1];var u=h[n+1],l=(u?u.newPos:0)-n;t&&(h[n-1]=void 0);var w=t&&t.newPos+1<f,z=u&&0<=l&&l<e;if(!w&&!z)h[n]=void 0;else{!w||z&&t.newPos<u.newPos?(t={newPos:u.newPos,components:u.components.slice(0)},this.pushComponent(t.components,b[l],void 0,!0)):(t={newPos:t.newPos,components:t.components.slice(0)},t.newPos++,this.pushComponent(t.components,a[t.newPos],!0,
void 0));l=this.extractCommon(t,a,b,n);if(t.newPos+1>=f&&l+1>=e)return t.components;h[n]=t}}},pushComponent:function(b,a,f,e){var g=b[b.length-1];g&&g.added===f&&g.removed===e?b[b.length-1]={value:this.join(g.value,a),added:f,removed:e}:b.push({value:a,added:f,removed:e})},extractCommon:function(b,a,f,e){var g=a.length,h=f.length,l=b.newPos;for(e=l-e;l+1<g&&e+1<h&&this.equals(a[l+1],f[e+1]);)l++,e++,this.pushComponent(b.components,a[l],void 0,void 0);b.newPos=l;return e},equals:function(b,a){var f=
/\S/;return this.ignoreWhitespace&&!f.test(b)&&!f.test(a)?!0:b==a},join:function(b,a){return b+a},tokenize:function(b){return b}};var f=new l,b=new l(!1);b.tokenize=function(b){return m(b.split(/(\s+|\b)/))};var h=new l(!0);h.tokenize=function(b){return m(b.split(/([{}:;,]|\s+)/))};var g=new l;g.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,a){return f.diff(b,a)},diffWords:function(d,a){return b.diff(d,a)},diffLines:function(b,a){return g.diff(b,a)},diffCss:function(b,a){return h.diff(b,
a)},createPatch:function(b,a,f,e,h){var l=[];l.push("Index: "+b);l.push("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");l.push("--- "+b+"\t"+e);l.push("+++ "+b+"\t"+h);b=g.diff(a,f);b.push({value:"",lines:[]});f=a=0;e=[];for(var m=h=1,n=0;n<b.length;n++){var v=b[n],t=v.lines||
v.value.replace(/\n$/,"").split("\n");v.lines=t;if(v.added||v.removed){if(!a){var u=b[n-1];a=h;f=m;u&&(e.push.apply(e,u.lines.slice(-4).map(function(a){return" "+a})),a-=4,f-=4)}e.push.apply(e,t.map(function(a){return(v.added?"+":"-")+a}));v.added?m+=t.length:h+=t.length}else a&&(8>=t.length&&n<b.length-1?e.push.apply(e,t.map(function(a){return" "+a})):(u=Math.min(t.length,4),l.push("@@ -"+a+","+(h-a+u)+" +"+f+","+(m-f+u)+" @@"),l.push.apply(l,e),l.push.apply(l,t.slice(0,u).map(function(a){return" "+
a})),f=a=0,e=[])),h+=t.length,m+=t.length}1<b.length&&!/\n$/.test(b[b.length-2].value)&&l.push("\\ No newline at end of file\n");return l.join("\n")},convertChangesToXML:function(b){for(var a=[],f=0;f<b.length;f++){var e=b[f];e.added?a.push("\x3cins\x3e"):e.removed&&a.push("\x3cdel\x3e");a.push(n(e.value));e.added?a.push("\x3c/ins\x3e"):e.removed&&a.push("\x3c/del\x3e")}return a.join("")}}}();"undefined"!==typeof module&&(module.exports=JsDiff);
"function"===typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(m){var n=n||{};n.JSDiffAdapter=function(){function l(){}l.prototype={_specialLine:function(f,b,h){return b.value===f&&h!==f},adapt:function(f,b,h){h||(h="\n");var g=f.split(h),d=b.split(h),a=""===g[g.length-1],d=""===d[d.length-1],k=m.diffLines(f,b);f=[];b=[];for(var e=0,l=0,q=-1,n=0,r=!0,v=h,t=0;t<k.length;t++){var u=k[t],w=u.lines||u.value.split(h),z=w.length,y=0;1<w.length&&""===w[w.length-1]&&z--;1<z&&!r&&""===w[0]&&(z--,y++);u.lines=
w;if(!u.added&&!u.removed){if(!this._specialLine(h,u,v)){if(e||l)f.push([e,l,q]),l=e=0,q=-1,n+=l;f.push([z,z,0]);n+=z}}else if(u.added){-1===q&&(q=b.length+1);e+=z;for(r=y;r<z+y;r++)b.push(u.lines[r])}else l+=z;r=!1;1<w.length&&""===w[w.length-1]&&(r=!0);v=u.value?u.value[u.value.length-1]:h}if(e||l)f.push([e,l,q]),n+=l;n<g.length&&1<g.length&&(h=f[f.length-1],0===h[2]?(h[0]+=1,h[1]+=1):-1===h[2]?f.push([1,1,0]):a===d?f.push([1,1,0]):(d&&(h[0]+=1),a&&(h[1]+=1)));return{mapper:f,changContents:{array:b,
index:0}}},adaptCharDiff:function(f,b,h){f=h?m.diffWords(f,b):m.diffChars(f,b);b=[];for(var g=h=0,d=0,a=0,k=0;k<f.length;k++){var e=f[k];if(!e.added&&!e.removed){if(0<d||0<a)b.push([g,g+d,h,h+a]),g+=d,h+=a,a=d=0;g+=e.value.length;h+=e.value.length}else e.added?d+=e.value.length:a+=e.value.length}(0<d||0<a)&&b.push([g,g+d,h,h+a]);return b}};return l}();return n});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(m,n,l,f){var b={},h,g,d,a,k,e,p,q,x,r,v,t,u,w,z,y;b.DiffTreeNavigator=function(){function b(a,e,d,f,g,k){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,e,d,f,g,k)}h="orion.annotation.diff.addedBlock";g="orion.annotation.diff.currentAddedBlock";d="orion.annotation.diff.deletedBlock";a="orion.annotation.diff.currentDeletedBlock";
k="orion.annotation.diff.blockTop";e="orion.annotation.diff.currentBlockTop";p="orion.annotation.diff.blockConflict";q="orion.annotation.diff.currentBlockConflict";x="orion.annotation.diff.addedWord";r="orion.annotation.diff.currentAddedWord";v="orion.annotation.diff.deletedWord";t="orion.annotation.diff.currentDeletedWord";u="orion.annotation.diff.emptyDeletedWordLeft";w="orion.annotation.diff.emptyDeletedWordRight";z="orion.annotation.diff.emptyAddedWordLeft";y="orion.annotation.diff.emptyAddedWordRight";
l.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});l.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});l.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});l.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});l.AnnotationType.registerType(k,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
l.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});l.AnnotationType.registerType(p,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});l.AnnotationType.registerType(q,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});l.AnnotationType.registerType(x,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});l.AnnotationType.registerType(r,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});l.AnnotationType.registerType(v,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});l.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});l.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});l.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
l.AnnotationType.registerType(z,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});l.AnnotationType.registerType(y,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});b.prototype={initAll:function(a,b,e,d,f,g,k){this._charOrWordDiff=a?a:"word";b&&(this._initialized=!0);this.editorWrapper=[{editor:b,diffFeeder:d},{editor:e,diffFeeder:f}];this._curveRuler=k;(this._overviewRuler=g)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||0===b.length)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var e=new f.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var g=this.generatePairWordAnnotations(d,a,e);g&&(d.children=g)}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new m.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,e,d,f){if(this.editorWrapper[b].annoTypes)for(var g=0;g<this.editorWrapper[b].annoTypes.length;g++)this.editorWrapper[b].annoTypes[g].type===e&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,f?f:this.editorWrapper[b].annoTypes[g].list,d?this.editorWrapper[b].annoTypes[g].normal:this.editorWrapper[b].annoTypes[g].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var e=this.iterator.cursor();"block"===e.type&&(e.children&&0<e.children.length)&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(0>a||a>=this._root.children.length||0===this._root.children.length)a=0;void 0!==b&&0<=b&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,e){if(e===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){e=
this._root.children[d];var f=0===a?e.oldA:e.newA;if(b>=f.start&&b<=f.end){d=e;if(e.children&&0<e.children.length)for(f=0;f<e.children.length;f++){var g=e.children[f],k=0===a?g.oldA:g.newA;if(b>=k.start&&b<=k.end){d=g;break}}return d}}return null}},gotoChange:function(a,b){for(var e=0;e<this.editorWrapper.length;e++){var d=this._hitDiffAnnotation(e,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;
var a=this.iterator.cursor();return!a?-1:"block"===a.type?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return"block"===a.type?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||0===b.length)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,e,d){if(b&&e&&(a=a.getAnnotationModel())){for(var f=
a.getAnnotations(),g=[];d&&f.hasNext();){var k=f.next();k.type===e&&g.push(k)}a.replaceAnnotations(g,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var e=this.iterator.cursor();if(e){var d,f,g={start:e.oldA.start,end:e.oldA.end},k={start:e.newA.start,end:e.newA.end};"word"===e.type?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(g,
this.editorWrapper[0].editor.getTextView().getModel()),f=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(k,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(e.index),f=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(e.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (l.AnnotationType.getType(d.current))(g.start,g.end)],d,!0);f&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (l.AnnotationType.getType(f.current))(k.start,
k.end)],f,!0);a?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(e.oldA.start,e.oldA.end,!0),this.editorWrapper[1].editor.setSelection(e.newA.start,e.newA.end,!0),this.autoSelecting=!1):b&&(this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(e.oldA.start,e.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(e.newA.start,e.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(a,
b){var e=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:e,newA:d}},generatePairWordAnnotations:function(a,b,e){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),f=this.editorWrapper[1].diffFeeder.getTextOnBlock(b);b=null;var g=0,k=0;if(d&&f&&d.text&&f.text&&5E3>=d.text.length&&5E3>=f.text.length)b=e.adaptCharDiff(d.text,f.text,"word"===this._charOrWordDiff),k=f.start,g=d.start;else return null;e=[];d=[];this.generateWordDiffAnnotations(0,
e,g,b,2,3);this.generateWordDiffAnnotations(1,d,k,b,0,1);b=[];for(g=0;g<e.length;g++)b.push({parent:a,index:g,type:"word",oldA:e[g],newA:d[g]});return b},getAnnoModelList:function(a,b,e){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===e)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,b){var e=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),
d=this.getAnnoModelList(a,"block",e.normal),f=this.editorWrapper[a].diffFeeder.getCharRange(b),e=l.AnnotationType.createAnnotation(e.normal,f.start,f.end);d&&d.push(e);return e},generateWordDiffAnnotations:function(a,b,e,d,f,g){if(d){var k=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1});a=this.getAnnoModelList(a,"word",k.normal);for(var h=0;h<d.length;h++){var m=l.AnnotationType.createAnnotation(k.normal,d[h][f]+e,d[h][g]+e);a.push(m);b.push(m)}}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var e=a.getLineHeight(),d=a.getClientArea(),e=Math.floor(d.height/e/3);a.setTopIndex(0<b-e?b-e:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();0!==b.length&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=n.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&(a=0>a?0:n.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a),this.gotoBlock(a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return b}();b.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:r,normal:x,list:[]}):a.push({type:"word",
current:t,normal:v,list:[]});a.push({type:"word",current:u});a.push({type:"word",current:w});a.push({type:"word",current:z});a.push({type:"word",current:y})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:x}:{current:this._repositionEmptyWord(a,b),normal:v}:this._isAddedSide()?{current:r,normal:x}:{current:t,normal:v}},_repositionEmptyWord:function(a,b){var e=b.getLineAtOffset(a.start),d=b.getLineStart(e),f=b.getLineEnd(e);
if(d!==f){if(a.start===f)return a.start--,this._isAddedSide()?y:w;a.end++}else if(0<e&&(e--,d=b.getLineStart(e),f=b.getLineEnd(e),d!==f))return a.start=f-1,a.end=f,this._isAddedSide()?y:w;return this._isAddedSide()?z:u},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return-1===a?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var b=this._diffBlocks[a][0],e=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1;a=this._textModel.getLineStart(b);if(e<b)return{start:a,end:a};b=this._textModel.getLineEnd(e,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return 0===this._mapper.length}};return a}();b.TwoWayDiffBlockFeeder=function(){function f(a,b,e,d){this._mapperColumnIndex=e;this._reverseAnnotation=d;this.init(a,b)}f.prototype=new b.DiffBlockFeeder;f.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex};f.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var e=0,d=0;d<this._mapper.length;d++)0!==
this._mapper[d][2]&&this._diffBlocks.push([e,d]),e+=this._mapper[d][this._mapperColumnIndex]}};f.prototype.getBlockAnnoTypes=function(b){this._isAddedSide()?b.push({type:"block",normal:h,current:g,list:[]}):b.push({type:"block",normal:d,current:a,list:[]});b.push({type:"block",normal:k,current:e,list:[]});b.push({type:"block",normal:p,current:q,list:[]})};f.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||0===this._diffBlocks.length||this._diffBlocks.length<=b)return null;b=this._diffBlocks[b][1];
return 0===this._mapper[b][this._mapperColumnIndex]?{normal:k,current:e}:n.isMapperConflict(this.getMapper(),b)?{normal:p,current:q}:this._isAddedSide()?{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:d,current:a,list:[]}};return f}();b.inlineDiffBlockFeeder=function(){function e(a,b){this._mapperColumnIndex=b;this.init(a)}e.prototype=new b.DiffBlockFeeder;e.prototype.setModel=function(a){this._textModel=a};e.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=
[];this._gapBlocks=[];for(var b=a=0,e=0;e<this._mapper.length;e++){if(0!==this._mapper[e][2]){if(this._isAddedSide()){var d=a+this._mapper[e][1];this._diffBlocks.push([d,e]);this._gapBlocks.push([d,d+this._mapper[e][0],b])}else this._diffBlocks.push([a,e]),this._gapBlocks.push([a,a+this._mapper[e][1],b]);a+=this._mapper[e][0]+this._mapper[e][1]}else this._gapBlocks.push([a,a+this._mapper[e][this._mapperColumnIndex],b]),a+=this._mapper[e][this._mapperColumnIndex];b+=this._mapper[e][this._mapperColumnIndex]}}};
e.prototype.getBlockAnnoTypes=function(b){this._isAddedSide()?b.push({type:"block",normal:h,current:g,list:[]}):b.push({type:"block",normal:d,current:a,list:[]});b.push({type:"block",normal:p,current:q,list:[]})};e.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||0===this._diffBlocks.length)return null;b=this._diffBlocks[b][1];return 0===this._mapper[b][this._mapperColumnIndex]?{current:r,normal:x}:n.isMapperConflict(this.getMapper(),b)?{normal:p,current:q}:this._isAddedSide()?
{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:d,current:a,list:[]}};e.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};e.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return e}();
return b});
define("orion/compare/compareView","i18n!orion/compare/nls/messages orion/Deferred orion/webui/littlelib orion/compare/diffParser orion/compare/compareRulers orion/editor/editor orion/editor/editorFeatures orion/keyBinding orion/editor/textView orion/compare/compareUIFactory orion/compare/compareUtils orion/compare/jsdiffAdapter orion/compare/diffTreeNavigator".split(" "),function(m,n,l,f,b,h,g,d,a,k,e,p,q,x,r,v){var t={};t.CompareView=function(){function a(){this._diffParser=new f.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(a,b){return"\n"},_generateMapper:function(a,b,e,d,f){var g=this._getLineDelim(a,e);this._diffParser.setLineDelim(g);if(this.options.mapper&&this.options.toggler)return{delim:g,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if("string"===typeof b&&"string"===typeof a)return a=(new p.JSDiffAdapter).adapt(a,b,g),this.options.toggler&&
(this.options.mapper=a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents),{delim:g,mapper:a.mapper,output:b,diffArray:a.changContents};b=this._diffParser.parse(a,e,d,f);a=this._diffParser.getDiffArray();this.options.toggler&&(this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a);return{delim:g,mapper:b.mapper,output:b.outPutFile,diffArray:a}},_loadImageFile:function(a,b,e){var d=document.createElement("img");d.src=a;var f=new n;
d.onload=function(){b.appendChild(d);if(e){var a=document.createElement("hr");b.appendChild(a)}f.resolve(d.height)};d.onerror=function(){f.resolve(0)};return f},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&0<this.options.highlighters.length&&!(1>a.length||2<a.length))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],2===a.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));n.all(a,function(a){return{_error:a}}).then(function(a){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this));if(a.newFileOnRight){var e=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=e}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},
prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(a){},initImageMode:function(){}};return a}();t.TwoWayCompareView=function(){function e(a){this.setOptions(a,!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
this._uiFactory||(this._uiFactory=new k.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI());this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new b.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}e.prototype=new t.CompareView;e.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return m["There are unsaved changes."]}.bind(this)};
e.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(a){a.destroy()}),this._editors=null);this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};e.prototype.getImageMode=function(){return this._imageMode};e.prototype.getEditors=function(){return this._editors};e.prototype.gotoDiff=
function(a,b,e){e=e?this._editors[1].getTextView():this._editors[0].getTextView();a=e.getModel().getLineStart(a)+b;this._diffNavigator.gotoDiff(a,e)};e.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};e.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};e.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};e.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};e.prototype._createEditor=function(b,e,d,f,k){var l=
"undefined"===typeof f.readonly?!0:f.readonly,p=function(){var b=new a.TextView({parent:e,readonly:l,tabSize:4});this._viewLoadedCounter++;2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var d=this.getSplitter();d&&d.addResizeListener(function(a){if(a){var e=!1;(e=this._uiFactory.isLeftPane(a)?k:!k)&&b.resize()}}.bind(this));return b}.bind(this),q=f.keyBindingFactory;q||(q=new g.KeyBindingsFactory);var n=null;if(d)var r="",n=function(a,b){d&&
(r=b?m["ERROR: "]+a:a,d.textContent=""+r)};p=new h.Editor({textViewFactory:p,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,keyBindingFactory:q,statusReporter:n,domNode:e});p.installTextView();p.setInput(null,null,f.Content?f.Content:b);p.setOverviewRulerVisible(!1);var x=p.getTextView();x.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=
x.getCaretOffset(),this._diffNavigator.gotoDiff(a,x))}.bind(this));x.getModel().addEventListener("Changed",function(a){this._curveRuler.onChanged(a,!k)||(this.options.mapper=null)}.bind(this));k?x.addEventListener("Scroll",function(a){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):x.addEventListener("Scroll",function(a){this._curveRuler&&this._curveRuler.render()}.bind(this));return p};e.prototype.destroy=function(){this._editors&&
(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};e.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),e=new b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);
this._editors[0].getTextView().addRuler(e);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};e.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new n).resolve(a>b?a:
b)})})}var e=this.options.oldFile.Content,d=this.options.newFile.Content,f=this.options.diffContent;"string"===typeof d?f=this._generateMapper(e,d,f,this.options.hasConflicts):(f=this._generateMapper(e,d,f,this.options.hasConflicts),d=f.output);var g=new q.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),f.mapper,1,this.options.newFileOnRight),k=new q.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),f.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editors[0],this._editors[1],g,k,this._overviewRuler,this._curveRuler);this._curveRuler.init(f.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),this._editors[0].setInput(this.options.oldFile.Name,null,e));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;e=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+
5;return a>e?a:e};e.prototype.refreshTitle=function(a,b){if(1===a){var e=this._uiFactory.getTitleDiv(!0);e&&(l.empty(e),e.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(e=this._uiFactory.getTitleDiv(!1))l.empty(e),e.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return e}();t.InlineCompareView=function(){function d(a){this.setOptions(a,
!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}d.prototype=new t.CompareView;d.prototype.addRulers=function(){this._textView&&!this._hasRuler&&(this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0)};d.prototype.removeRulers=function(){this._textView&&this._hasRuler&&
(this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1)};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(e){var d=l.node(this._editorDiv),f=function(){return new a.TextView({parent:d,
readonly:!0,tabSize:4})}.bind(this);this._editor=new h.Editor({textViewFactory:f,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,e);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._rulerNew=new b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&
this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=this._textView.getCaretOffset(),this._diffNavigator.gotoDiff(a,this._textView))}.bind(this))};d.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null);l.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};d.prototype.getImageMode=function(){return this._imageMode};d.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),0<b.length)){var b=
b[0][0],e=a.getLineHeight(),d=a.getClientArea(),e=Math.floor(d.height/e/3);a.setTopIndex(0<b-e?b-e:0)}};d.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var a=this;return this._loadImageFile(this.options.newFile.URL,l.node(this._editorDiv),!0).then(function(b){return a._loadImageFile(a.options.oldFile.URL,l.node(a._editorDiv)).then(function(a){return(new n).resolve(b+a+20)})})}var b=this.options.oldFile.Content,d=this.options.newFile.Content,
f=this._generateMapper(b,d,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);"string"!==typeof d&&(d=f.output);this._textView.getModel().setText(b);b=new q.inlineDiffBlockFeeder(f.mapper,1);d=new q.inlineDiffBlockFeeder(f.mapper,0);e.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),f.mapper,f.diffArray.array,f.diffArray.index,this._diffParser._lineDelimiter);b.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editor,this._editor,b,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();f=this._textView.getTopIndex();this._textView.redrawLines(f,f+1,this._overviewRuler);this._textView.redrawLines(f,f+1,this._rulerOrigin);this._textView.redrawLines(f,f+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=function(a){this._conflcit=a};return d}();t.toggleableCompareView=function(){function a(b,e){e&&(e.toggler=this);this._widget="inline"===b?new t.InlineCompareView(e):new t.TwoWayCompareView(e)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;
if(!this._imageMode){var b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();l.empty(l.node(a.parentDivId));this._widget="inline"===this._widget.type?new t.TwoWayCompareView(a):new t.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return t});
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(m){var n="break case class catch continue const debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" ");m=m.grammars;m.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",
end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},
{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"}]});return{id:m[m.length-1].id,grammars:m,keywords:n}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(m){var n="abstract boolean break byte case catch char class continue default do double else extends false final finally float for if implements import instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try void volatile while".split(" ");m=m.grammars;m.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+
n.join("|")+")\\b",name:"keyword.control.java"}]});return{id:m[m.length-1].id,grammars:m,keywords:n}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(m){var n="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");m=
m.grammars;m.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},
{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+n.join("|")+")\\b",name:"keyword.control.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});
return{id:m[m.length-1].id,grammars:m,keywords:n}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(m,n,l,f){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 d(){b.call(this,null,!1)}function a(a,f,l){this.commentStart="/*";this.commentEnd="*/";var m=[];switch(f){case "java":m=e;break;
case "js":m=k;break;case "css":m=p}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new b(m,this.whitespacesVisible);this._firstScanner=new d;this._commentScanner=new g(this.whitespacesVisible);this._whitespaceScanner=new h;"css"===f&&(this._scanner.isCSS=!0,this._firstScanner.isCSS=!0);this.view=a;this.annotationModel=l;this._bracketAnnotations=void 0;var q=this;this._listener=
{onChanged:function(a){q._onModelChanged(a)},onDestroy:function(a){q._onDestroy(a)},onLineStyle:function(a){q._onLineStyle(a)},onMouseDown:function(a){q._onMouseDown(a)},onSelection:function(a){q._onSelection(a)}};f=a.getModel();f.getBaseModel&&(f=f.getBaseModel());f.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 k=n.keywords,e=l.keywords,p=f.keywords,q={styleClass:"comment"},x={styleClass:"comment"},r={styleClass:"comment block documentation"},v={styleClass:"keyword other documentation markup"},t={styleClass:"keyword other documentation task"},u={styleClass:"keyword other documentation tag"},w={styleClass:"string"},z={styleClass:"constant numeric"},y={styleClass:"keyword"},C={styleClass:"punctuation separator space",
unmergeable:!0},s={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,e=this.offset-1;if(!b&&48<=a&&57>=a){var d=b=!1,f=!1,g=a;do if(a=this._read(),46===a&&!b)b=!0;else if(101===a&&!d)b=d=!0,a=this._read(),45!==a&&this._unread(a);else if(120===a&&48===g&&2===this.offset-e)b=d=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){e=this.text.substring(e,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===e)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}}};d.prototype=new b(null);d.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};a.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
b){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,e,d,f){var g;void 0===d&&(d=-1);void 0===f&&(f=a.length);for(;1<f-d;)if(g=Math.floor((f+d)/2),b<=a[g].start)f=g;else if(e&&b<a[g].end){f=g;break}else d=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(m.AnnotationType.ANNOTATION_FOLDING);for(var e=[],d=a.getBaseModel(),f=this.comments,g=0;g<f.length;g++){var k=f[g];(k=this._createFoldingAnnotation(a,d,k.start,k.end))&&e.push(k)}b.replaceAnnotations(null,e)}}}},_createFoldingAnnotation:function(a,b,e,d){var f=b.getLineAtOffset(e);b=b.getLineAtOffset(d);return f===b?null:new (m.AnnotationType.getType(m.AnnotationType.ANNOTATION_FOLDING))(e,d,a)},_computeTasks:function(a,b,e){if(this.detectTasks){var d=
this.annotationModel;if(d){var f=this.view.getModel(),g=f;f.getBaseModel&&(g=f.getBaseModel());for(var k=d.getAnnotations(b,e),f=[],h=m.AnnotationType.ANNOTATION_TASK;k.hasNext();){var l=k.next();l.type===h&&f.push(l)}k=[];l=this._commentScanner;l.setText(g.getText(b,e));for(var p;p=l.nextToken();){var q=l.getStartOffset()+b;14===p&&(p=g.getLineEnd(g.getLineAtOffset(q)),6!==a&&(p=Math.min(p,e-this.commentEnd.length)),k.push(m.AnnotationType.createAnnotation(h,q,p,g.getText(q,p))))}d.replaceAnnotations(f,
k)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,e=b.getModel(),b=b.getSelection();if(b.start===b.end&&e.getLineAtOffset(b.start)===a)return A}return null},_getStyles:function(a,b,e){a.getBaseModel&&(e=a.mapOffset(e));for(var d=e+b.length,f=[],g=e,k=this.comments,h=this._binarySearch(k,e,!0);h<k.length&&!(k[h].start>=d);h++){var l=k[h].start,m=k[h].end;g<l&&this._parse(b.substring(g-e,l-e),g,f);var p=k[h].type,q;switch(p){case 8:q=r;break;case 7:q=x;break;case 5:q=w}g=Math.max(g,
l);l=Math.min(d,m);(8===p||7===p)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(g-e,l-e),g,f,q,p):5===p&&this.whitespacesVisible?this._parseString(b.substring(g-e,l-e),g,f,w):f.push({start:g,end:l,style:q});g=m}g<d&&this._parse(b.substring(g-e,d-e),g,f);if(a.getBaseModel)for(b=0;b<f.length;b++)e=f[b].end-f[b].start,f[b].start=a.mapOffset(f[b].start,!0),f[b].end=f[b].start+e;return f},_parse:function(a,b,e){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var f=
d.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(d.getData(),f,e,w);continue}else g=w;break;case 8:this._parseComment(d.getData(),f,e,r,a);continue;case 6:this._parseComment(d.getData(),f,e,q,a);continue;case 7:this._parseComment(d.getData(),f,e,x,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=s);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=C)}e.push({start:f,end:d.getOffset()+b,
style:g})}},_parseComment:function(a,b,e,d,f){var g=this._commentScanner;g.setText(a);for(g.setType(f);a=g.nextToken();){f=g.getStartOffset()+b;var k=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(k=s);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(k=C);break;case 12:k=v;break;case 13:k=u;break;case 14:k=t;break;default:this.detectHyperlinks&&(k=this._detectHyperlinks(g.getData(),f,e,k))}k&&e.push({start:f,end:g.getOffset()+b,style:k})}},_parseString:function(a,b,e,d){var f=
this._whitespaceScanner;for(f.setText(a);a=f.nextToken();){var g=f.getStartOffset()+b,k=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(k=s);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(k=C)}k&&e.push({start:g,end:f.getOffset()+b,style:k})}},_detectHyperlinks:function(a,b,e,d){var f=null,g;if(0<(g=a.indexOf("://"))){for(var f=a,k=g;0<k;){g=f.charCodeAt(k-1);if(!(97<=g&&122>=g||65<=g&&90>=g||45===g||48<=g&&57>=g))break;k--}if(0<k&&(g="\"\"''(){}[]\x3c\x3e".indexOf(f.substring(k-
1,k)),-1!==g&&0===(g&1)&&-1!==(g=f.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(g+1,g+2))))){var h=g;g=this._clone(d);g.tagName="a";g.attributes={href:f.substring(k,h)};e.push({start:b,end:b+k,style:d});e.push({start:b+k,end:b+h,style:g});e.push({start:b+h,end:b+a.length,style:d});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(d),g.tagName="a",g.attributes={href:f},g):d},_clone:function(a){if(!a)return a;
var b={},e;for(e in a)a.hasOwnProperty(e)&&(b[e]=a[e]);return b},_findComments:function(a,b){b=b||0;var e=this._firstScanner,d;e.setText(a);for(var f=[];d=e.nextToken();)(7===d||8===d||5===d)&&f.push({start:e.getStartOffset()+b,end:e.getOffset()+b,type:d}),(6===d||7===d||8===d)&&this._computeTasks(d,e.getStartOffset()+b,e.getOffset()+b);return f},_findMatchingBracket:function(a,b){var e="{}()[]\x3c\x3e",d=a.getText(b,b+1),f=e.indexOf(d,0);if(-1===f)return-1;var g;g=f&1?e.substring(f-1,f):e.substring(f+
1,f+2);for(var k=a.getLineAtOffset(b),e=a.getLine(k),h=a.getLineStart(k),l=a.getLineEnd(k),e=this._findBrackets(d,g,e,h,h,l),l=0;l<e.length;l++)if(h=0<=e[l]?1:-1,e[l]*h-1===b){var m=1;if(f&1){for(l--;0<=l;l--)if(h=0<=e[l]?1:-1,m+=h,0===m)return e[l]*h-1;for(k-=1;0<=k;){e=a.getLine(k);h=a.getLineStart(k);l=a.getLineEnd(k);e=this._findBrackets(d,g,e,h,h,l);for(f=e.length-1;0<=f;f--)if(h=0<=e[f]?1:-1,m+=h,0===m)return e[f]*h-1;k--}}else{for(l++;l<e.length;l++)if(h=0<=e[l]?1:-1,m+=h,0===m)return e[l]*
h-1;k+=1;for(f=a.getLineCount();k<f;){e=a.getLine(k);h=a.getLineStart(k);l=a.getLineEnd(k);e=this._findBrackets(d,g,e,h,h,l);for(l=0;l<e.length;l++)if(h=0<=e[l]?1:-1,m+=h,0===m)return e[l]*h-1;k++}}break}return-1},_findBrackets:function(a,b,e,d,f,g){var k=[];a=a.charCodeAt(0);b=b.charCodeAt(0);for(var h=f,l=this._scanner,m,p=this.comments,q=this._binarySearch(p,f,!0);q<p.length&&!(p[q].start>=g);q++){m=p[q].start;var n=p[q].end;if(h<m)for(l.setText(e.substring(h-f,m-f));m=l.nextToken();)m===a?k.push(l.getStartOffset()+
h-f+d+1):m===b&&k.push(-(l.getStartOffset()+h-f+d+1));h=n}if(h<g)for(l.setText(e.substring(h-f,g-f));m=l.nextToken();)m===a?k.push(l.getStartOffset()+h-f+d+1):m===b&&k.push(-(l.getStartOffset()+h-f+d+1));return k},_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,e=a.newValue,d=this.view;a=d.getModel();var f;
if(this.highlightCaretLine){var g=a.getLineAtOffset(b.start);f=a.getLineAtOffset(e.start);var k=e.start===e.end,b=b.start===b.end;g===f&&b&&k||(b&&d.redrawLines(g,g+1),(g!==f||!b)&&k&&d.redrawLines(f,f+1))}if(this.annotationModel){var b=this._bracketAnnotations,h,l;if(e.start===e.end&&0<(l=d.getCaretOffset()))l-=1,a.getBaseModel&&(l=a.mapOffset(l),a=a.getBaseModel()),a=this._findMatchingBracket(a,l),-1!==a&&(h=[m.AnnotationType.createAnnotation(m.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),
m.AnnotationType.createAnnotation(m.AnnotationType.ANNOTATION_CURRENT_BRACKET,l,l+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this.view,e=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(0<d){var f=d-1,g=e;e.getBaseModel&&(f=e.mapOffset(f),g=e.getBaseModel());f=this._findMatchingBracket(g,f);-1!==f&&(a.preventDefault(),a=f,e.getBaseModel&&(a=e.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=
a.start,e=a.removedCharCount,d=a.addedCharCount-e,f=this.view;a=f.getModel();var g=a.getBaseModel?a.getBaseModel():a,e=b+e,k=g.getCharCount(),h=this.comments.length,l=g.getLineStart(g.getLineAtOffset(b)),p=this._binarySearch(this.comments,l,!0),q=this._binarySearch(this.comments,e,!1,p-1,h);p<h&&this.comments[p].start<=l&&l<this.comments[p].end?(l=this.comments[p].start,l>b&&(l+=d)):l=p===h&&0<h&&k-d===this.comments[h-1].end?this.comments[h-1].start:l;var n;q<h?(n=this.comments[q].end,n>b&&(n+=d),
q+=1):(q=h,n=k);for(var k=g.getText(l,n),r,k=this._findComments(k,l),h=p;h<this.comments.length;h++)r=this.comments[h],r.start>b&&(r.start+=d),r.start>b&&(r.end+=d);var x=q-p!==k.length;if(!x)for(h=0;h<k.length;h++){r=this.comments[p+h];var s=k[h];if(r.start!==s.start||r.end!==s.end||r.type!==s.type){x=!0;break}}h=[p,q-p].concat(k);Array.prototype.splice.apply(this.comments,h);x&&(h=l,r=n,a!==g&&(h=a.mapOffset(h,!0),r=a.mapOffset(r,!0)),f.redrawRange(h,r));if(this.foldingEnabled&&g!==a&&this.annotationModel){f=
this.annotationModel;p=f.getAnnotations(l,n);l=[];for(n=[];p.hasNext();)if(r=p.next(),r.type===m.AnnotationType.ANNOTATION_FOLDING){n.push(r);for(h=0;h<k.length&&!(r.start===k[h].start&&r.end===k[h].end);h++);h===k.length?(l.push(r),r.expand()):(h=r.start,q=r.end,h>b&&(h-=d),q>b&&(q-=d),h<=b&&(b<q&&h<=e&&e<q)&&(h=g.getLineAtOffset(r.start),q=g.getLineAtOffset(r.end),h!==q?r.expanded||r.expand():f.removeAnnotation(r)))}b=[];for(h=0;h<k.length;h++){r=k[h];for(d=0;d<n.length&&!(n[d].start===r.start&&
n[d].end===r.end);d++);d===n.length&&(r=this._createFoldingAnnotation(a,g,r.start,r.end))&&b.push(r)}f.replaceAnnotations(l,b)}}};return{TextStyler:a}});
define("orion/editor/textStyler",["orion/editor/annotations","orion/editor/eventTarget"],function(m,n){function l(a,b){this._patternManager=new f(a,b)}function f(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,e,d,f,g,h){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.name=b;this.typeId=e;this.styler=
d;this.parent=g;h&&h(this);this._subBlocks=d.computeBlocks(f,f.getText(this.start,this.end),this,this.start,null,null,null)}function h(a){this._styler=a}function g(a,b,e){this._highlightCaretLine=this._whitespacesVisible=this._spacesVisible=this._tabsVisible=!1;this._detectTasks=this._foldingEnabled=!0;this._view=a;this._annotationModel=b;this._stylerAdapter=e;this._stylerAdapter.setStyler(this);this._accessor=new h(this);this._bracketAnnotations;var d=this;this._listener={onChanged:function(a){d._onModelChanged(a)},
onDestroy:function(a){d._onDestroy(a)},onLineStyle:function(a){d._onLineStyle(a)},onMouseDown:function(a){d._onMouseDown(a)},onSelection:function(a){d._onSelection(a)}};e=a.getModel();e.getBaseModel&&(e=e.getBaseModel());e.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);
var f=e.getCharCount();this._rootBlock=this._stylerAdapter.createBlock({start:0,contentStart:0,end:f,contentEnd:f},this,e,null);b&&(f=[],b.removeAnnotations(m.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),a.getModel(),f),this._detectTasks&&(b.removeAnnotations(m.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,e,f)),b.replaceAnnotations([],f));a.redrawLines()}var d=function(a,b,e,d,f){var g;void 0===d&&(d=-1);void 0===f&&(f=a.length);for(;1<
f-d;)if(g=Math.floor((f+d)/2),b<=a[g].start)f=g;else if(e&&b<a[g].end){f=g;break}else d=g;return f};l.prototype={blockSpansBeyondEnd:function(a){return a.pattern.regexEnd===this._eolRegex},computeBlocks:function(a,b,e,d,f,g,h){if(!b)return[];var l=[],m=[];f=f||0;g=g||Infinity;h=h||Infinity;e.blockPatterns.forEach(function(a){var e=this._findMatch(a.regexBegin||a.regex,b,f);e&&m.push({result:e,pattern:a})}.bind(this));if(!m.length)return l;m.sort(function(a,b){return a.result.index<b.result.index?
-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var n=0;0<m.length;){var w=m[0];m.splice(0,1);if(g<w.result.index)break;if(!(w.result.index<n)){var n=d+w.result.index,z=w.result.index,y=null,C=w.pattern.regexEnd;if(C){var z=z+w.result[0].length,s=w.pattern,A=this._substituteCaptureValues(C,w.result);A!==C&&(s={pattern:s.pattern,regexBegin:s.regexBegin,regexEnd:A},C=A);for(A=z;!y;){A=this._findMatch(C,b,A);A||(this._eolRegex.lastIndex=0,A=this._eolRegex.exec(b),
s={pattern:s.pattern,regexBegin:s.regexBegin,regexEnd:this._eolRegex});var B=this.createBlock({start:n,end:d+A.index+A[0].length,contentStart:d+z,contentEnd:d+A.index},e.styler,a,e,s),E=B.getBlocks();if(!E.length||E[E.length-1].end<=A.index+d)y=B;A=A.index+A[0].length}}else y=this.createBlock({start:n,end:n+w.result[0].length,contentStart:n,contentEnd:n+w.result[0].length},e.styler,a,e,w.pattern);l.push(y);if(l.length===h||g<=y.end)break;n=y.end-d}this._updateMatch(w,b,m,n,g)}return l},computeStyle:function(a,
b,e){if(!a.pattern)return null;var f={start:a.start,end:a.end,style:a.pattern.pattern.name};if(a.contentStart<=e&&e<a.contentEnd)return a.pattern.pattern.contentName?{start:a.contentStart,end:a.contentEnd,style:a.pattern.pattern.contentName}:f;var g,h;if(e<a.contentStart){h=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures;if(!h)return f;g=a.pattern.regexBegin;b=b.getText(a.start,a.contentStart);a=a.start}else{h=a.pattern.pattern.endCaptures||a.pattern.pattern.captures;if(!h)return f;g=
a.pattern.regexEnd;b=b.getText(a.contentEnd,a.end);a=a.contentEnd}g.lastIndex=0;if(g=g.exec(b))if(b=[],this._getCaptureStyles(g,h,a,b),(h=b[d(b,e,!0)])&&h.start<=e&&e<h.end)return h;return f},createBlock:function(a,d,e,f,g){return new b(a,g?g.pattern.name:null,g?g.pattern.id:null,d,e,f,function(a){a.pattern=g;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,e,d){var f;if(a.pattern.regexEnd&&(f=this._findMatch(a.pattern.regexEnd,b,0)))(b=a.pattern.pattern.endCaptures||a.pattern.pattern.captures)?this._getCaptureStyles(f,b,e-f[0].length,d):a.pattern.pattern.name&&d.push({start:e-f[0].length,end:e,style:a.pattern.pattern.name});return f?f[0]:null},getBlockStartStyle:function(a,b,e,d){var f;if(a.pattern.regexBegin&&(f=this._findMatch(a.pattern.regexBegin,b,0)))(b=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures)?
this._getCaptureStyles(f,b,e,d):d.push({start:e,end:e+f[0].length,style:a.pattern.pattern.name});return f?f[0]:null},getBracketMatch:function(a,b){for(var e,d=Object.keys(a.enclosurePatterns),f=0;f<d.length;f++){var g=a.enclosurePatterns[d[f]],h=this._findMatch(g.regex,b,0);if(h&&0===h.index){e=g;break}}if(!e)return null;f=!1;-1!==e.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)?(f=!0,d=e.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN,this._PUNCTUATION_SECTION_END)):d=e.pattern.name.replace(this._PUNCTUATION_SECTION_END,
this._PUNCTUATION_SECTION_BEGIN);return!a.enclosurePatterns[d]?null:{beginName:e.pattern.name,endName:d,atStart:f}},parse:function(a,b,e,d,f){if(a&&(e=e.linePatterns)){var g=[];e.forEach(function(b){var e=b.regex||b.regexBegin;e.oldLastIndex=e.lastIndex;(e=this._findMatch(e,a,0))&&g.push({result:e,pattern:b})}.bind(this));g.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 h=0;0<g.length;){var l=
g[0];g.splice(0,1);if(!(l.result.index<h)){var m=l.result.index,n,w=[];if(l.pattern.regex){h=l.result;n=m+h[0].length;n={start:b+m,end:b+n,style:l.pattern.pattern.name};if(!f){l.pattern.pattern.captures&&this._getCaptureStyles(h,l.pattern.pattern.captures,b+m,w);w.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(m=0;m<w.length-1;m++)if(w[m+1].start<w[m].end){var z={start:w[m+1].end,end:w[m].end,style:w[m].style};w[m].end=w[m+1].start;w.splice(m+2,0,z)}}this._mergeStyles(n,w,
d)}else h=l.pattern.regexEnd,h=this._substituteCaptureValues(h,l.result),h=this._findMatch(h,a,l.result.index+l.result[0].length),h||(this._eolRegex.lastIndex=0,h=this._eolRegex.exec(a)),n=h.index+h[0].length,d.push({start:b+m,end:b+n,style:l.pattern.pattern.name});h=h.index+h[0].length}this._updateMatch(l,a,g,h)}e.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},setStyler:function(){},verifyBlock:function(a,b,e,d){var f=null,g=[];e.parent.blockPatterns.forEach(function(a){var e=
this._findMatch(a.regexBegin||a.regex,b,0);e&&g.push({result:e,pattern:a})}.bind(this));g.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(!g.length||0!==g[0].result.index||g[0].pattern.pattern.id!==e.pattern.pattern.id)f=!1;else{var h=g[0],l=h.pattern.regexEnd;if(l){for(var l=this._substituteCaptureValues(l,h.result),h=h.result[0].length,m=this._findMatch(l,b,
h);null===f&&m&&e.start+m.index!==e.contentEnd+d;){var n=this.computeBlocks(a,b,e,e.start,h,m.index+1,null);!n.length||n[n.length-1].end<=e.start+m.index?f=!1:n.length?(h=n[n.length-1].end-e.start,m=this._findMatch(l,b,h)):m=null}m||(this._eolRegex.lastIndex=0,m=this._eolRegex.exec(b),f=e.start+m.index===e.end+d)}else f=e.start+h.result[0].length===e.end+d}return null!==f?f:!0},_findMatch:function(a,b,e,d){var f=e,g=a.lastIndex;this._linebreakRegex.lastIndex=e;e=this._linebreakRegex.exec(b);var h,
l;a.lastIndex=0;if(e){for(l=e.index;0<=--l&&!(h=b.charAt(l),h===this._NEWLINE||h===this._CR););h=b.substring(l+1,e.index+e[1].length);a.lastIndex=l=e.index-l-1}for(;e&&e.index<b.length;){var m;if(d){var n=a.lastIndex;a.test(h)&&(a.lastIndex=n,m=a.exec(h))}else m=a.exec(h);if(m)return m.index+=f,m.index-=l,a.lastIndex=g,m;l=0;f+=e[0].length;if(e=this._linebreakRegex.exec(b))h=e[1],a.lastIndex=0}a.lastIndex=g;return null},_getCaptureStyles:function(a,b,e,d){if(b[0])d.push({start:e,end:e+a[0].length,
style:b[0].name});else for(var f=0,g=1;g<a.length;g++)if(a[g]){var h=b[g];if(h){var l=e+f;d.push({start:l,end:l+a[g].length,style:h.name})}f+=a[g].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 e=a.getPatterns(b.pattern?b.pattern.pattern:null),d=function(a){a="string"===typeof a?a:a.match;var b=this._ignoreCaseRegex.exec(a),
e=this._FLAGS;b&&(a=a.substring(b[0].length),e+="i");return RegExp(a,e)}.bind(this),f=-1,g=0;e.forEach(function(a){var e;if(a.match&&!a.begin&&!a.end){if(e={regex:d(a.match),pattern:a},b.linePatterns.push(e),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]=e}else!a.match&&(a.begin&&a.end)&&(f=g,e={regexBegin:d(a.begin),regexEnd:d(a.end),pattern:a},b.linePatterns.push(e));
g++}.bind(this));b.blockPatterns=b.linePatterns.slice(0,f+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,e){var d=a.start;b.forEach(function(b){d<=b.start&&e.push({start:d,end:b.start,style:a.style});e.push(b);d=b.end});d<a.end&&e.push({start:d,end:a.end,style:a.style})},_substituteCaptureValues:function(a,b){var e=a.toString();this._captureReferenceRegex.lastIndex=
0;if(!this._captureReferenceRegex.test(e))return a;this._captureReferenceRegex.lastIndex=0;for(var d=this._captureReferenceRegex.exec(e);d;)e=e.replace(d[0],b[d[1]]||""),this._captureReferenceRegex.lastIndex=0,d=this._captureReferenceRegex.exec(e);return RegExp(e.substring(1,e.length-1-this._FLAGS.length),this._FLAGS)},_updateMatch:function(a,b,e,d,f){var g=a.pattern.regex?a.pattern.regex:a.pattern.regexBegin;f=f||Infinity;if((b=this._findMatch(g,b,d,!0))&&b.index<f){a.result=b;for(f=0;f<e.length;f++)if(b.index<
e[f].result.index||b.index===e[f].result.index&&a.pattern.pattern.index<e[f].pattern.pattern.index){e.splice(f,0,a);return}e.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"};f.prototype={getPatterns:function(a){a?(a="string"===typeof a?a:a.qualifiedId,a+="#"):a=this._rootId+"#"+this._NO_ID;var b=[0],e={},d=RegExp("^"+a+"[^#]+$");
this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,e):(a.index=b[0]++,e[a.id]=a))}.bind(this));var f=[];Object.keys(e).forEach(function(a){f.push(e[a])});return f},_addPattern:function(a,b,e){a.parentId=e;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(e){this._addPattern(a[e],e,b)}.bind(this))},_processInclude:function(a,b,e){var d,f=a.include.indexOf("#");d=0===f?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===f?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,e):e[a.id]||(a.index=b[0]++,e[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(e){a<=e.end&&e.adjustBounds(a,b)})},getBlocks:function(){return this._subBlocks},getBlockAtIndex:function(a){return d(this.getBlocks(),a,!0)},isRenderingWhitespace:function(){return this.styler._isRenderingWhitespace()}};h.prototype={getStyles:function(a){return this._styler.getStyles(a)}};
g.prototype={computeBlocks:function(a,b,e,d,f,g,h){return this._stylerAdapter.computeBlocks(a,b,e,d,f,g,h)},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=[],e=this._view.getModel();e.getBaseModel&&(e=e.getBaseModel());var f=this._findBlock(this._rootBlock,a),g=e.getLineAtOffset(a),h=e.getLine(g),l=[];this._stylerAdapter.parse(h,e.getLineStart(g),f,l);for((g=l[d(l,a,!0)])&&(g.start<=a&&a<g.end)&&b.push(g);f;)(g=
this._stylerAdapter.computeStyle(f,e,a))&&b.splice(0,0,g),f=f.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,e){if(b.getBaseModel){var d=b.getBaseModel();a.forEach(function(a){var f=this._createFoldingAnnotation(b,d,a.start,a.end);f&&e.push(f);this._computeFolding(a.getBlocks(),b,e)}.bind(this))}},_computeTasks:function(a,b,e,d,f){d=d||a.start;f=f||a.end;if(a.start<=
f&&d<=a.end&&this._annotationModel){var g=m.AnnotationType.ANNOTATION_TASK;if(a.name&&0===a.name.indexOf("comment")){var h=[];this._stylerAdapter.parse(b.getText(a.contentStart,a.end),a.contentStart,a,h,!0);for(var l=0;l<h.length;l++)"meta.annotation.task.todo"===h[l].style&&(d<=h[l].start&&h[l].end<=f)&&e.push(m.AnnotationType.createAnnotation(g,h[l].start,h[l].end,b.getText(h[l].start,h[l].end)))}a.getBlocks().forEach(function(a){this._computeTasks(a,b,e,d,f)}.bind(this))}},_createFoldingAnnotation:function(a,
b,e,d){var f=b.getLineAtOffset(e),g=b.getLineAtOffset(d);return f===g||f+1===g&&b.getLineStart(g)===b.getLineEnd(g)?null:new (m.AnnotationType.getType(m.AnnotationType.ANNOTATION_FOLDING))(e,d,a)},_findBlock:function(a,b){var e=a.getBlocks();if(!e.length)return a;var f=d(e,b,!0);return f<e.length&&e[f].start<=b&&b<e[f].end?this._findBlock(e[f],b):a},_findBrackets:function(a,b,e,f,g){for(var h=[],l=[],m=f,n=b.getBlocks(),u=d(n,f,!0);u<n.length&&!(n[u].start>=g);u++){var w=n[u].start,z=n[u].end;m<w&&
(this._stylerAdapter.parse(e.substring(m-f,w-f),m,b,l),l.forEach(function(b){0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1))}),l=[]);m=z}m<g&&(this._stylerAdapter.parse(e.substring(m-f,g-f),m,b,l),l.forEach(function(b){b.style&&(0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1)))}));return h},_findMatchingBracket:function(a,b,e){var d=a.getLineAtOffset(e),f=a.getLineEnd(d),g=a.getText(e,f),
g=this._stylerAdapter.getBracketMatch(b,g);if(!g)return-1;for(var h=a.getLine(d),l=a.getLineStart(d),f=this._findBrackets(g,b,h,l,f),m=0;m<f.length;m++)if(h=0<=f[m]?1:-1,f[m]*h-1===e){e=1;if(g.atStart){for(m++;m<f.length;m++)if(h=0<=f[m]?1:-1,e+=h,0===e)return f[m]*h-1;d+=1;for(m=a.getLineCount();d<m;){h=a.getLine(d);l=a.getLineStart(d);f=a.getLineEnd(d);f=this._findBrackets(g,b,h,l,f);for(l=0;l<f.length;l++)if(h=0<=f[l]?1:-1,e+=h,0===e)return f[l]*h-1;d++}}else{for(m--;0<=m;m--)if(h=0<=f[m]?1:-1,
e+=h,0===e)return f[m]*h-1;for(d-=1;0<=d;){h=a.getLine(d);l=a.getLineStart(d);f=a.getLineEnd(d);f=this._findBrackets(g,b,h,l,f);for(m=f.length-1;0<=m;m--)if(h=0<=f[m]?1:-1,e+=h,0===e)return f[m]*h-1;d--}}break}return-1},_getLineStyle:function(a){if(this._highlightCaretLine){var b=this._view.getModel(),e=this._view.getSelection();if(e.start===e.end&&b.getLineAtOffset(e.start)===a)return this._caretLineStyle}return null},_getStyles:function(a,b,e,f){b.getBaseModel&&(f=b.mapOffset(f));for(var g=f+e.length,
h=[],l=f,m=a.getBlocks(),n=d(m,f,!0);n<m.length&&!(m[n].start>=g);n++){var u=m[n].start,w=m[n].end;l<u&&this._stylerAdapter.parse(e.substring(l-f,u-f),l,a,h);var z=Math.max(l,u);z===u&&(u=this._stylerAdapter.getBlockStartStyle(m[n],e.substring(z-f),z,h))&&(z+=u.length);var u=Math.min(g,w),y=[];u===w&&(l=e.substring(u-l-(m[n].end-m[n].contentEnd)),(l=this._stylerAdapter.getBlockEndStyle(m[n],l,u,y))&&(u-=l.length));var l=this._getStyles(m[n],b,e.substring(z-f,u-f),z),C=this._stylerAdapter.getBlockContentStyleName(m[n]);
if(C){var s=z;l.forEach(function(a){a.start-s&&h.push({start:s,end:a.start,style:C});a.mergeable&&(a.style+=","+C);h.push(a);s=a.end});u-s&&h.push({start:s,end:u,style:C})}else h=h.concat(l);h=h.concat(y);l=w}l<g&&this._stylerAdapter.parse(e.substring(l-f,g-f),l,a,h);if(b.getBaseModel)for(a=0;a<h.length;a++)e=h[a].end-h[a].start,h[a].start=b.mapOffset(h[a].start,!0),h[a].end=h[a].start+e;return h},_isRenderingWhitespace:function(){return this._whitespacesVisible&&(this._tabsVisible||this._spacesVisible)},
_onDestroy:function(){this.destroy()},_onLineStyle:function(a){a.textView===this._view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(this._rootBlock,a.textView.getModel(),a.lineText,a.lineStart);a.ranges.forEach(function(a){a.style&&(a.style={styleClass:a.style.replace(/\./g," ")})});this._isRenderingWhitespace()&&(this._spacesVisible&&this._spliceStyles(this._spacePattern,a.ranges,a.lineText,a.lineStart),this._tabsVisible&&this._spliceStyles(this._tabPattern,a.ranges,a.lineText,
a.lineStart))},_onModelChanged:function(a){var b=a.start,e=a.removedCharCount;a=a.addedCharCount-e;var f=this._view.getModel(),g=f.getBaseModel?f.getBaseModel():f,e=b+e,h=g.getCharCount(),l=g.getLineStart(g.getLineAtOffset(b)),n=this._findBlock(this._rootBlock,b),t,u,w,z,y,C,s;do{w=n.parent;if(!t&&w&&(y=g.getText(n.start,Math.min(h,n.end+a+1)),!this._stylerAdapter.verifyBlock(g,y,n,a))){n=w;continue}u=n.getBlocks();var A=u.length,B=d(u,l,!0),E=d(u,e,!1,B-1,A);t=!1;if(B&&u.length&&u[B-1].end===b){y=
g.getText(u[B-1].start,Math.min(h,b+1));var D=this.computeBlocks(g,y,n,u[B-1].start,null,null,null);D.length&&D[0].end!==u[B-1].end&&(B--,t=!0)}B<A&&u[B].start<=l&&(l<u[B].end||t)?(s=u[B].start,s>b&&(s+=a)):B===A&&0<A&&n.end-a===u[A-1].end?(s=u[--B].start,s>b&&(s+=a)):s=Math.max(l,n.contentStart);C=E<A?u[E].end:n.contentEnd;b<=C&&(C+=a);C=Math.min(C,h-1);y=g.getText(s,C+1);D=this.computeBlocks(g,y,n,s,null,null,null);if(E<A){if(D.length&&D[D.length-1].end===C&&D[D.length-1].typeId===u[E].typeId)break;
if(D.length&&this._stylerAdapter.blockSpansBeyondEnd(D[D.length-1])){E++;for(var G=D[D.length-1].getBlocks(),G=(G.length?G[G.length-1]:D[D.length-1]).typeId;E<A;){if(u[E].typeId===G){var J=u[E].end+a,J=Math.min(J,h-1);y=g.getText(s,J+1);y=this.computeBlocks(g,y,n,s,null,null,null);if(y.length&&y[y.length-1].end===J){C=J;D=y;break}}E++}if(E<A)break}}else if(!D.length||D[D.length-1].end<=n.contentEnd+a)break;if(!w){C=h;E=A;y=g.getText(s,C);D=this.computeBlocks(g,y,n,s,null,null,null);break}n=w;z=!0}while(1);
this._rootBlock.adjustBounds(b,a);E=Math.min(E+1,A);z||(z=E-B!==D.length);if(!z)for(A=0;A<D.length;A++)if(t=u[B+A],h=D[A],t.start!==h.start||t.end!==h.end||t.typeId!==h.typeId){z=!0;break}!u.length&&!D.length?this.dispatchEvent({type:"BlocksChanged",old:[n],"new":[n]}):this.dispatchEvent({type:"BlocksChanged",old:u.slice(B,E),"new":D});B=[B,E-B].concat(D);Array.prototype.splice.apply(u,B);z&&(u=s,z=C,f!==g&&(u=f.mapOffset(u,!0),z=f.mapOffset(z,!0)),this._view.redrawRange(u,z));if(this._annotationModel){u=
[];var F=[],I=[];z=this._annotationModel.getAnnotations(s,C);B=this._foldingEnabled&&g!==f;for(E=n.parent||n;z.hasNext();)D=z.next(),B&&D.type===m.AnnotationType.ANNOTATION_FOLDING?(I.push(D),t=this._findBlock(E,D.start),!t||!(D.start===t.start&&D.end===t.end)?(u.push(D),D.expand()):(t=D.start,A=D.end,t>b&&(t-=a),A>b&&(A-=a),t<=b&&(b<A&&t<=e&&e<A)&&(t=g.getLineAtOffset(D.start),A=g.getLineAtOffset(D.end),t!==A?D.expanded||D.expand():u.push(D)))):D.type===m.AnnotationType.ANNOTATION_TASK&&n.start<=
D.start&&D.end<=n.end&&u.push(D);B&&E.getBlocks().forEach(function(a){this._updateFolding(a,g,f,I,F,s,C)}.bind(this));this._detectTasks&&this._computeTasks(n,g,F,s,C);this._annotationModel.replaceAnnotations(u,F)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this._view.getModel(),e=this._view.getOffsetAtLocation(a.x,a.y);if(0<e){var d=e-1,f=b;b.getBaseModel&&(d=b.mapOffset(d),f=b.getBaseModel());var g=this._findBlock(this._rootBlock,d),d=this._findMatchingBracket(f,g,d);-1!==d&&(a.preventDefault(),
a=d,b.getBaseModel&&(a=b.mapOffset(a,!0)),e>a&&(e--,a++),this._view.setSelection(a,e))}}},_onSelection:function(a){var b=a.oldValue,e=a.newValue;a=this._view.getModel();var d;if(this._highlightCaretLine){var f=a.getLineAtOffset(b.start);d=a.getLineAtOffset(e.start);var g=e.start===e.end,b=b.start===b.end;f===d&&b&&g||(b&&this._view.redrawLines(f,f+1),(f!==d||!b)&&g&&this._view.redrawLines(d,d+1))}if(this._annotationModel){var b=this._bracketAnnotations,h,l;if(e.start===e.end&&0<(l=this._view.getCaretOffset()))l-=
1,a.getBaseModel&&(l=a.mapOffset(l),a=a.getBaseModel()),e=this._findBlock(this._rootBlock,l),a=this._findMatchingBracket(a,e,l),-1!==a&&(h=[m.AnnotationType.createAnnotation(m.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),m.AnnotationType.createAnnotation(m.AnnotationType.ANNOTATION_CURRENT_BRACKET,l,l+1)]);this._bracketAnnotations=h;this._annotationModel.replaceAnnotations(b,h)}},_spliceStyles:function(a,b,e,d){for(var f=a.regex,g=f.lastIndex=0,h=f.exec(e);h;){for(h=d+h.index;g<b.length&&!(h<
b[g].end);)g++;var l={start:h,end:h+1,style:a.style};if(g<b.length&&b[g].start<=h){var m={start:h+1,end:b[g].end,style:b[g].style};b[g].end=h;b.splice(g+1,0,m);b.splice(g+1,0,l);g+=2}else b.splice(g,0,l),g++;h=f.exec(e)}},_updateFolding:function(a,b,e,f,g,h,l){h=h||a.start;l=l||a.end;if(!a.doNotFold&&a.start<=l&&h<=a.end){var m=d(f,a.start,!0);m<f.length&&f[m].start===a.start&&f[m].end===a.end||(m=this._createFoldingAnnotation(e,b,a.start,a.end))&&g.push(m);a.getBlocks().forEach(function(a){this._updateFolding(a,
b,e,f,g,h,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}}};n.EventTarget.addMixin(g.prototype);return{TextStyler:g,Block:b,createPatternBasedAdapter:function(a,b){return new l(a,b)}}});
define("orion/editor/textMateStyler",["orion/regex"],function(m){function n(b){var f;if(b instanceof Array){f=Array(b.length);for(var g=0;g<b.length;g++)f[g]=n(b[g])}else for(g in f={},b)if(Object.prototype.hasOwnProperty.call(b,g)){var d=b[g];f[g]="object"===typeof d&&null!==d?n(d):d}return f}function l(b,f,g){this.initialize(b);this.grammar=n(f);this.externalGrammars=g?n(g):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var f={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="",d;b=f.processGlobalFlag("x",b,function(a){for(var b="",d=!1,f=a.length,g=0;g<f;){var h=a.charAt(g);if(!d&&"#"===h)for(;g<f&&"\r"!==h&&"\n"!==h;)h=a.charAt(++g);
else if(!d&&/\s/.test(h))for(;g<f&&/\s/.test(h);)h=a.charAt(++g);else"\\"===h?(b+=h,/\s/.test(a.charAt(g+1))||(b+=a.charAt(g+1),g+=1)):("["===h?d=!0:"]"===h&&(d=!1),b+=h),g+=1}return b});b=f.processGlobalFlag("i",b,function(a){g+="i";return a});for(d=0;d<this.unsupported.length;d++){var a;(a=this.unsupported[d].regex.exec(b))&&h(this.unsupported[d].func(a),a)}return RegExp(b,g)},processGlobalFlag:function(b,f,g){var d="(?"+b+")";b="(?"+b+":";if(f.substring(0,d.length)===d)return g(f.substring(d.length));
if(f.substring(0,b.length)===b){for(var d=0,a=f.length,k=-1,e=0;e<a&&-1===k;e++)switch(f.charAt(e)){case "\\":e++;break;case "(":d++;break;case ")":d--,0===d&&(k=e)}d=k;if(d<f.length-1)throw Error("Only a "+b+") group that encloses the entire regex is supported in: "+f);return g(f.substring(b.length,d))}return f},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,f,g){g="undefined"===typeof g?!0:!1;b=b.source.split(/(\\\d+)/g);for(var d=[],a=0;a<b.length;a++){var k=
b[a],e=/\\(\d+)/.exec(k);e?(k=f[e[1]]||"",d.push(g?m.escape(k):k)):d.push(k)}return RegExp(d.join(""))},groupify:function(b,f){for(var g=b.source,d=g.length,a=[],k=0,e=[],l=1,m=1,n=[],r={},v={},t=0;t<d;t++){var u=a[a.length-1],w=g.charAt(t);switch(w){case "(":4===u&&(a.pop(),n.push(")"),e[e.length-1].end=t);var z=t+2<d?g.charAt(t+1)+""+g.charAt(t+2):null;if("?:"===z||"?\x3d"===z||"?!"===z){var y;"?:"===z?y=1:(y=3,k++);a.push(y);e.push({start:t,end:-1,type:y});n.push(w);n.push(z);t+=z.length}else a.push(2),
e.push({start:t,end:-1,type:2,oldNum:l,num:m}),n.push(w),0===k&&(v[m]=null),r[l]=m,l++,m++;break;case ")":u=a.pop();3===u&&k--;e[e.length-1].end=t;n.push(w);break;case "*":case "+":case "?":case "}":var C=w,s=g.charAt(t-1),z=t-1;if("}"===w){for(y=t-1;"{"!==g.charAt(y)&&0<=y;y--);s=g.charAt(y-1);z=y-1;C=g.substring(y,t+1)}y=e[e.length-1];if(")"===s&&(2===y.type||4===y.type)){n.splice(y.start,0,"(");n.push(C);n.push(")");w={start:y.start,end:n.length-1,type:4,num:y.num};for(s=0;s<e.length;s++)if(u=
e[s],(2===u.type||4===u.type)&&u.start>=y.start&&u.end<=z)u.start+=1,u.end+=1,u.num+=1,2===u.type&&(r[u.oldNum]=u.num);e.push(w);m++;break}default:"|"!==w&&(2!==u&&4!==u)&&0===k&&(a.push(4),e.push({start:t,end:-1,type:4,num:m}),n.push("("),v[m]=null,m++),n.push(w),"\\"===w&&(w=g.charAt(t+1),n.push(w),t+=1)}}for(;a.length;)a.pop(),n.push(")");g=RegExp(n.join(""));d={};f=f||r;for(var A in f)f.hasOwnProperty(A)&&(d[A]="\\"+f[A]);g=this.getSubstitutedRegex(g,d,!1);return[g,r,v]},complexCaptures:function(b){if(!b)return!1;
for(var f in b)if(b.hasOwnProperty(f)&&"0"!==f)return!0;return!1}};l.prototype={initialize:function(b){this.textView=b;this.textView.stylerOptions=this;var f=this;this._listener={onModelChanged:function(b){f.onModelChanged(b)},onDestroy:function(b){f.onDestroy(b)},onLineStyle:function(b){f.onLineStyle(b)},onStorage:function(b){f.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 f=b.pop();if(!f._resolvedRule||!f._typedRule)if(f._resolvedRule=
this._resolve(f),f._typedRule=this._createTypedRule(f),this.addStyles(f.name),this.addStyles(f.contentName),this.addStylesForCaptures(f.captures),this.addStylesForCaptures(f.beginCaptures),this.addStylesForCaptures(f.endCaptures),f._resolvedRule!==f&&b.push(f._resolvedRule),f.patterns)for(var g=0;g<f.patterns.length;g++)b.push(f.patterns[g])}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var f=b.split("."),g=0;g<f.length;g++)this._styles[b].push(f.slice(0,g+1).join("-"))}},
addStylesForCaptures:function(b){for(var f in b)b.hasOwnProperty(f)&&this.addStyles(b[f].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=f.toRegExp(b.begin);this.endRegex=f.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=f.hasBackReference(this.endRegex);var g=f.complexCaptures(b.captures);b=f.complexCaptures(b.beginCaptures)||
f.complexCaptures(b.endCaptures);if(this.isComplex=g||b)g=f.groupify(this.beginRegex),this.beginRegex=g[0],this.beginOld2New=g[1],this.beginConsuming=g[2],g=f.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=f.toRegExp(b.match);if(this.isComplex=f.complexCaptures(b.captures))b=f.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 f=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(f=this.grammar.repository&&this.grammar.repository[b.substring(1)],!f)throw Error("Couldn't find included rule "+
b+" in grammar repository");}else if("$self"===b)f=this.grammar;else{if("$base"===b)throw Error('Include "$base" is not supported');f=this._allGrammars[b];if(!f)for(var g=0;g<this.externalGrammars.length;g++){var d=this.externalGrammars[g];if(d.scopeName===b){this.preprocess(d);f=this._allGrammars[b]=d;break}}}}return f},ContainerNode:function(){function b(b,f){this.parent=b;this.rule=f;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,d){this.parent=b;this.rule=g;this.children=[];this.setStart(d);this.endMatch=this.end=null;this.endRegexSubstituted=g.endRegexHasBackRef?f.getSubstitutedRegex(g.endRegex,d):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,f){if(f)for(var g=f.length;0<
g;)b.push(f[--g])},exec:function(b,f,g){if(f=b.exec(f))f.index+=g;b.lastIndex=0;return f},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,f,g){if(b instanceof this.BeginEndNode){var d=b.rule;b=b.endRegexSubstituted||d.endRegex;return!b?null:this.exec(b,f,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 f=b.addedCharCount,
g=b.removedCharCount;b=b.start;if(this._tree){var d=this.textView.getModel(),a=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(b)-1),k=this.getFirstDamaged(d,d),d=-1===d?0:d,f=k?this.parse(k,!0,d,b,f,g):a;this.textView.redrawRange(d,f)}else this.initialParse()},getFirstDamaged:function(b,f){if(0>b)return this._tree;for(var g=[this._tree],d=null;g.length;){var a=g.pop();if(!a.parent||this.isDamaged(a,b,f)){a instanceof this.BeginEndNode&&(d=a);for(var k=0;k<a.children.length;k++)g.push(a.children[k])}}return d||
this._tree},isDamaged:function(b,f,g){return b.start<=g&&b.end>f},parse:function(b,f,g,d,a,k){var e=this.textView.getModel(),l=e.getLineStart(e.getLineCount()-1),m=e.getCharCount(),n=this.getInitialExpected(b,g),r=-1;f&&(b.repaired=!0,b.endNeedsUpdate=!0,r=(r=b.children[b.children.length-1])?e.getLineEnd(e.getLineAtOffset(r.end+(a-k))):-1,d=e.getLineEnd(e.getLineAtOffset(d+k)),r=Math.max(r,d));r=-1===r?m:r;d=n;for(var v=b,t=!1,u=g,w=-1;v&&(!f||u<r);){var z=this.getNextMatch(e,v,u);z||(u=u>=l?m:e.getLineStart(e.getLineAtOffset(u)+
1));var y=z&&z.match,C=z&&z.rule,s=z&&z.isEnd;if(z&&z.isSub)u=this.afterMatch(y),C instanceof this.BeginEndRule&&(t=!0,f&&C===d.rule&&v===d.parent?(v=d,v.setStart(y),v.repaired=!0,v.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(f&&(this.prune(v,d),f=!1),y=new this.BeginEndNode(v,C,y),v.addChild(y),v=y));else if(s||u===m)v instanceof this.BeginEndNode&&(y?(t=!0,w=Math.max(w,v.end),v.setEnd(y),u=this.afterMatch(y),f&&v===d&&v.parent===d.parent?(v.repaired=!0,delete v.endNeedsUpdate,d=this.getNextExpected(d,
"end")):f&&(this.prune(v,d),f=!1)):(v.setEnd(m),delete v.endNeedsUpdate)),v=v.parent;f&&(u>=r&&!t)&&(this.prune(b,n),f=!1)}this.removeUnrepairedChildren(b,f,g);this.cleanup(f,b,g,r,m,a,k);return f?Math.max(w,u):u},removeUnrepairedChildren:function(b,f,g){if(f){f=b.children;for(var d=-1,a=0;a<f.length;a++){var k=f[a];if(!k.repaired&&this.isDamaged(k,g,Number.MAX_VALUE)){d=a;break}}-1!==d&&(b.children.length=d)}},cleanup:function(b,f,g,d,a,k,e){if(b){b=k-e;a=this.getIntersecting(d-b+1,a);f=this.getIntersecting(g,
d);for(g=0;g<a.length;g++)d=a[g],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(b),d.shiftStart(b));for(g=0;g<f.length;g++)d=f[g],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(b),delete d.endNeedsUpdate,delete d.repaired}else{f=this.getIntersecting(g,d);for(g=0;g<f.length;g++)delete f[g].repaired}},getNextMatch:function(b,f,g,d){var a=b.getLineAtOffset(g),a=b.getLineEnd(a),k=b.getText(g,a),e=[],l=[];b=[];a=[];for(this.push(e,f.rule.subrules);e.length;){var m=e.length?e.pop():null,m=m&&m._resolvedRule._typedRule;
if(m instanceof this.ContainerRule&&-1===l.indexOf(m))l.push(m),this.push(e,m.subrules);else if(!m||!d||m.matchRegex){var n=m&&this.exec(m.matchRegex||m.beginRegex,k,g);n&&(b.push(n),a.push(m))}}e=Number.MAX_VALUE;l=-1;for(m=0;m<b.length;m++)n=b[m],n.index<e&&(e=n.index,l=m);if(!d&&(g=this.getEndMatch(f,k,g)))if(d=f.rule.applyEndPatternLast,-1===l||g.index<e||!d&&g.index===e)return{isEnd:!0,rule:f.rule,match:g};return-1===l?null:{isSub:!0,rule:a[l],match:b[l]}},getInitialExpected:function(b,f){var g,
d;if(b===this._tree)for(g=0;g<b.children.length;g++){if(d=b.children[g],d.start>=f)return d}else if(b instanceof this.BeginEndNode&&b.endMatch){var a=b.endMatch.index;for(g=0;g<b.children.length&&!(d=b.children[g],d.start>=f);g++);if(d&&d.start<a)return d}return b},getNextExpected:function(b,f){if("begin"===f){var g=b.children[0];return g?g:b}if("end"===f&&(g=b.parent)){var d=g.children[g.children.indexOf(b)+1];return d?d:g}return null},prune:function(b,f){f.parent===b?b.children.length=f.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 f=b.lineStart,g=this.textView.getModel(),d=g.getLineEnd(b.lineIndex),a=g.getLineEnd(g.getLineAtOffset(f)-1),a=this.getFirstDamaged(a,a),f=this.getLineScope(g,a,f,d);b.ranges=this.toStyleRanges(f);b.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(b,f,g,d){for(var a=g,k=this.getInitialExpected(f,
g),e=[],l=[];f&&a<d;){var m=this.getNextMatch(b,f,a);if(!m)break;var n=m&&m.match,r=m&&m.rule,v=m&&m.isSub,m=m&&m.isEnd;n.index!==a&&l.push({start:a,end:n.index,node:f});v?(a=this.afterMatch(n),r instanceof this.BeginEndRule?(this.addBeginScope(e,n,r),f=k,k=this.getNextExpected(k,"begin")):this.addMatchScope(e,n,r)):m&&(a=this.afterMatch(n),this.addEndScope(e,n,r),k=this.getNextExpected(k,"end"),f=f.parent)}a<d&&l.push({start:a,end:d,node:f});b=this.getInheritedLineScope(l,g,d);return e.concat(b)},
getInheritedLineScope:function(b,f,g){f=[];for(g=0;g<b.length;g++)for(var d=b[g],a=d.node;a;){var k=a.rule.rule,e=k.name;if(k=k.contentName||e){this.addScopeRange(f,d.start,d.end,k);break}a=a.parent}return f},addBeginScope:function(b,f,g){var d=g.rule;this.addCapturesScope(b,f,d.beginCaptures||d.captures,g.isComplex,g.beginOld2New,g.beginConsuming)},addEndScope:function(b,f,g){var d=g.rule;this.addCapturesScope(b,f,d.endCaptures||d.captures,g.isComplex,g.endOld2New,g.endConsuming)},addMatchScope:function(b,
f,g){var d=g.rule,a=d.name;(d=d.captures)?this.addCapturesScope(b,f,d,g.isComplex,g.matchOld2New,g.matchConsuming):this.addScope(b,f,a)},addScope:function(b,f,g){g&&b.push({start:f.index,end:this.afterMatch(f),scope:g})},addScopeRange:function(b,f,g,d){d&&b.push({start:f,end:g,scope:d})},addCapturesScope:function(b,f,g,d,a,k){if(g)if(d){d={1:0};for(var e=0,l=1;void 0!==f[l];l++)void 0!==k[l]&&(e+=f[l].length),void 0!==f[l+1]&&(d[l+1]=e);k=f.index;for(e=1;g[e];e++){var l=g[e].name,m=a[e],n=k+d[m];
"undefined"!==typeof f[m]&&this.addScopeRange(b,n,n+f[m].length,l)}}else this.addScope(b,f,g[0]&&g[0].name)},getIntersecting:function(b,f){for(var g=[],d=this._tree?[this._tree]:[];d.length;){var a=d.pop(),k=!1;a instanceof this.ContainerNode?k=!0:this.isDamaged(a,b,f)&&(k=!0,g.push(a));if(k)for(var k=a.children.length,e=0;e<k;e++)d.push(a.children[e])}return g.reverse()},toStyleRanges:function(b){for(var f=[],g=0;g<b.length;g++){var d=b[g],a=this._styles[d.scope];if(!a)throw Error("styles not found for "+
d.scope);a=a.join(" ");f.push({start:d.start,end:d.end,style:{styleClass:a}})}return f}};return{RegexUtil:f,TextMateStyler:l}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(m,n){function l(f){return-1!==f.getProperty("objectClass").indexOf(b)&&"highlighter"===f.getProperty("type")}function f(b,d,a){this.initialize(b,d,a);this.lineStyles=[]}var b="orion.edit.highlighter",h=b+" service must be an event emitter";n.AnnotationType.registerType("orion.annotation.highlightError",{title:m.syntaxError,html:"\x3cdiv class\x3d'annotationHTML error'\x3e\x3c/div\x3e",rangeStyle:{styleClass:"annotationRange error"}});
f.prototype={initialize:function(f,d,a){this.textView=f;this.serviceRegistry=d;this.annotationModel=a;this.services=[];var k=this;this.listener={onModelChanging:function(a){k.onModelChanging(a)},onModelChanged:function(a){k.onModelChanged(a)},onDestroy:function(a){k.onDestroy(a)},onLineStyle:function(a){k.onLineStyle(a)},onStyleReady:function(a){k.onStyleReady(a)},onServiceAdded:function(a){k.onServiceAdded(a.serviceReference,k.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){k.onServiceRemoved(a.serviceReference,
k.serviceRegistry.getService(a.serviceReference))}};f.addEventListener("ModelChanging",this.listener.onModelChanging);f.addEventListener("ModelChanged",this.listener.onModelChanged);f.addEventListener("Destroy",this.listener.onDestroy);f.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);f=d.getServiceReferences(b);for(a=0;a<f.length;a++){var e=f[a];l(e)&&this.addServiceListener(d.getService(e))}},
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 d=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var d=b.lineStyles||b.style;b=Number.MAX_VALUE;var a=-1,f=this.textView.getModel(),e;for(e in d)Object.prototype.hasOwnProperty.call(d,e)&&(this.lineStyles[e]=d[e],b=Math.min(b,e),a=Math.max(a,e));b=Math.max(b,0);a=Math.min(a,f.getLineCount());if(d=this.annotationModel){for(var h=d.getAnnotations(f.getLineStart(b),f.getLineEnd(a)),l=[];h.hasNext();){var m=h.next();"orion.annotation.highlightError"===m.type&&l.push(m)}h=[];for(m=b;m<=a;m++){e=m;var r=this.lineStyles[e],r=r&&
r.errors;e=f.getLineStart(e);if(r)for(var v=0;v<r.length;v++){var t=r[v];h.push(n.AnnotationType.createAnnotation("orion.annotation.highlightError",t.start+e,t.end+e))}}d.replaceAnnotations(l,h)}this.textView.redrawLines(b,a+1)},onLineStyle:function(b){var d=this.lineStyles[b.lineIndex];if(d)if(d.ranges){for(var d=d.ranges,a=b.lineStart,f=d.length,e=[],h=0;h<f;h++){var l=d[h];e.push({start:l.start+a,end:l.end+a,style:l.style})}b.ranges=e}else d.style&&(b.style=d.style)},_getEmptyStyle:function(b){for(var d=
[],a=0;a<b;a++)d.push(null);return d},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var d=this.services[b];if(d.setContentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(b,d){l(b)&&this.addServiceListener(d)},onServiceRemoved:function(b,
d){-1!==this.services.indexOf(d)&&this.removeServiceListener(d)},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 d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else"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 f});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(m,n,l,f,b){function h(a,g,e,h,q,x,r){function v(a,d){var f=a.getProperty("contentType")||a.getProperty("contentTypes"),h=a.getProperty("fileTypes");return f?b.when(g.isSomeExtensionOf(e,f)).then(function(b){return b?a:null}):d&&h&&-1!==h.indexOf(d)?(f=new b,f.resolve(a),f):null}function t(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new m.TextStyler(h,"js",q);break;case "text/x-java-source":b=new m.TextStyler(h,"java",q);break;case "text/css":b=new m.TextStyler(h,"css",q)}return b}if(!d){var u=t(e);if(u)return x=new b,x.resolve(u),x}d&&!this.orionGrammars&&(this.orionGrammars={});u=x&&x.split(".").pop().toLowerCase();x=a.getServiceReferences("orion.edit.highlighter");for(var w=[],z=[],y=0;y<x.length;y++){var C=x[y],s=C.getProperty("type");"grammar"===s||!d&&"undefined"===typeof s?w.push(C.getProperty("grammar")):"highlighter"!==
s&&(s=C.getProperty("id"))&&!this.orionGrammars[s]&&(this.orionGrammars[s]={id:s,contentTypes:C.getProperty("contentTypes"),patterns:C.getProperty("patterns"),repository:C.getProperty("repository")});(C=v(C,u))&&z.push(C)}return b.all(z,function(a){return{_error:a}}).then(function(b){for(var g,k=b.length-1;0<=k;k--){var m=b[k];if(m&&!m._error&&(r||"highlighter"!==m.getProperty("type"))){g=m;break}}var s;if(g)if(b=g.getProperty("type"),"highlighter"===b)s=new f(h,a,q),s.setContentType(e);else if("grammar"===
b||!d&&"undefined"===typeof b)g=g.getProperty("grammar"),s=new l.TextMateStyler(h,g,w);else if(d){s=[];for(var t in this.orionGrammars)s.push(this.orionGrammars[t]);g=new n.createPatternBasedAdapter(s,g.getProperty("id"));s=new n.TextStyler(h,q,g)}return s})}function g(a,b){this.serviceRegistry=a;this.contentTypeService=b;this.styler=null}var d=1;g.prototype={setup:function(a,b,e,d,f){f="undefined"===typeof f?!0:f;this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var g=this;
return h(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,b,e,d,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:h,SyntaxHighlighter:g}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(m){function n(l,f,b){m.attach(this);this._binderFunc=f;this.setInputField(l);(l=b?b.group:null)||(l=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=l+"__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(f){this._bind(f);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})}n.prototype._removeListeners=function(l){l&&l.forEach(function(f){f.evtTarget.removeEventListener(f.type,f.handler,!1)})};n.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};n.prototype.hasValueOf=function(l){return this._dataList.some(function(f){return f.value===l})};n.prototype.setInputField=function(l){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=l;"string"===typeof this._inputField&&(this._inputField=document.getElementById(this._inputField));l=function(f){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(f){this.onKeyDown(f)}.bind(this);this._inputField.addEventListener("keydown",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:l});l=function(f){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",l);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:l});l=function(f){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})};n.prototype.onKeyDown=function(l){if(this._dismissed)return!0;var f=l.charCode||l.keyCode;if(13===f){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===f||38===f)&&this._proposalList&&0<this._proposalList.length)return l.preventDefault(),this._walk(40===f),l.stopPropagation(),!1;if(27===f)return l.preventDefault(),this._dismiss(),!1;if(46===f&&-1<this._proposalIndex&&this._onDelete)return l.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),l.stopPropagation(),!1}return!0};n.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};n.prototype._bind=function(l){this._dataList=l};n.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};n.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
n.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());this._completionUIContainer||(this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer));this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());this._completionUL||(this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL");this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};n.prototype._createProposalLink=function(l,f,b,h){var g=
document.createElement("a");g.href=require.toUrl(f);g.appendChild(this._createBoldText(l,b,h));return g};n.prototype._createBoldText=function(l,f,b,h){if(0>f)return document.createTextNode(l);h=h?h:document.createElement("span");var g;0!==f&&(g=document.createTextNode(l.substring(0,f)),h.appendChild(g));var d=document.createElement("b");h.appendChild(d);g=document.createTextNode(l.substring(f,f+b));d.appendChild(g);f+b<l.length&&(g=document.createTextNode(l.substring(f+b)),h.appendChild(g));return h};
n.prototype._proposeOnCategory=function(l,f){if(0!==f.length){var b;if(l){b=document.createElement("li");b.className="inputCompletionLICategory";var h=document.createTextNode(l);b.appendChild(h);this._completionUL.appendChild(b)}f.forEach(function(f){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=f.item;
var d;if("string"===typeof f.item.value){var a=document.createElement("table");a.style.width="100%";a.style.tableLayout="fixed";a.style.borderSpacing="0";var k=document.createElement("tr");k.style.width=this._inputField.offsetWidth+"px";a.appendChild(k);var e=document.createElement("td");e.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(f.item.value,f.boldIndex,f.boldLength);e.appendChild(h);e.style.overflow="hidden";k.appendChild(e);this._onDelete&&(d=document.createElement("button"),
d.classList.add("inputCompletionDismissButton"),d.classList.add("layoutRight"),d.classList.add("core-sprite-close"),d.classList.add("imageSprite"),d.style.display="none",d.style.margin="0 0 0",d.title=this._deleteToolTips,d.onclick=function(a){a.stopPropagation();this._onDelete(f.item.value,this);this._resetIndexAfterDeletion()}.bind(this),e=document.createElement("td"),e.classList.add("inputCompletionLIRightTD"),e.appendChild(d),k.appendChild(e));b.appendChild(a)}else f.item.value.name&&"link"===
f.item.value.type&&b.appendChild(this._createProposalLink(f.item.value.name,f.item.value.value,f.boldIndex,f.boldLength));this._completionUL.appendChild(b);this._proposalList.push({item:f.item,domNode:b,deleteBtn:d})}.bind(this))}};n.prototype._domNode2Index=function(l){if(this._proposalList)for(var f=0;f<this._proposalList.length;f++)if(this._proposalList[f].domNode===l)return f;return-1};n.prototype._highlight=function(l,f){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=f?"inputCompletionLISelected":"inputCompletionLINormal",h&&(h.style.display=f?"":"none"),f&&g&&(b.offsetTop<this._completionUIContainer.scrollTop?b.scrollIntoView(!0):b.offsetTop+b.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&b.scrollIntoView(!1)))};n.prototype._selectProposal=function(l,f){var b=l;isNaN(b)&&(b=this._domNode2Index(l));if(b!==this._proposalIndex||
f)this._highlight(this._proposalIndex,!1),this._proposalIndex=b,this._highlight(this._proposalIndex,!0)};n.prototype._dismiss=function(l,f){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)&&(f?window.open(l.value):window.location.href=l.value),this._completionUIContainer.style.display="none")};n.prototype._show=function(){if(this._proposalList&&
0<this._proposalList.length){for(var l=0,f=0,b=this._inputField;b;)l+=b.offsetLeft,f+=b.offsetTop,b=b.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=f+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=l+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display=
"none"};n.prototype._walk=function(l){l=this._proposalIndex+(l?1:-1);-1>l?l=this._proposalList.length-1:l>=this._proposalList.length&&(l=-1);this._selectProposal(l)};n.prototype._proposeOnList=function(l,f,b){var h="",g=[],d=f?f.length:0;l.forEach(function(a){if("category"===a.type)this._proposeOnCategory(h,g),h=a.label,g=[];else{var k=!0,e=-1;if(f&&b){var l;"string"===typeof a.value?l=a.value.toLowerCase():a.value.name&&(l=a.value.name.toLowerCase());e=l.indexOf(f);0>e?k=!1:this._proposeFromStart&&
(k=0===e)}k&&g.push({item:a,boldIndex:e,boldLength:d})}}.bind(this));this._proposeOnCategory(h,g)};n.prototype._proposeOn=function(l){this._completionUL.textContent="";var f=l?l.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,f,!0);this._extendedProvider&&f?this._extendedProvider(l,function(b){b&&b.forEach(function(b){this._proposeOnList(b.proposals,b.filterForMe?f:l,b.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};n.prototype.constructor=n;return{InputCompletion:n}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages orion/editor/find orion/commands orion/objects orion/searchUtils orion/inputCompletion/inputCompletion orion/webui/littlelib".split(" "),function(m,n,l,f,b,h,g){function d(a,b,e,d,f){n.Find.call(this,a,d,f);this._serviceRegistry=b;this._commandService=e}d.prototype=new n.Find;f.mixin(d.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?n.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?n.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();n.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){n.Find.prototype.show.call(this,a);var b=a.findString;this._addRecentfind(b);a=a.replaceString;var e=document.getElementById("localSearchFindWith");e||(this._createActionTable(),e=document.getElementById("localSearchFindWith"));
b&&(e.value=b);a&&(document.getElementById("localSearchReplaceWith").value=a);window.setTimeout(function(){e.select();e.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw\x3d\x3d",this._replaceInfo.title=m["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=m["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 e=document.createElement("input");e.type="text";e.name=m["Find:"];e.className="parameterInput";e.id="localSearchFindWith";
e.placeholder=m["Find With"];e.oninput=function(b){return a._handleInput(b)};e.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(e);a._initCompletion(e);a._createButton(m.Next,b,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(m.Previous,b,function(){a._addRecentfind(a.getFindString());a.find(!1)});var d=a._editor.getTextView().getOptions("readonly");if(!d){var f=document.createElement("input");f.type="text";f.name=m["ReplaceWith:"];f.className="parameterInput";
f.id="localSearchReplaceWith";f.placeholder=m["Replace With"];f.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(f);a._replaceInfo=a._createInfoImage(null,b,null);a._showReplaceInfo();a._createButton(m.Replace,b,function(){a.replace()});a._createButton(m["Replace All"],b,function(){a.replaceAll()})}f=document.createElement("div");b.appendChild(f);f.classList.add("findOptionsDiv");var g=l.createDropdownMenu(f,m.Options,null,"dismissButton",null,!0);g.menuButton.classList.add("parameterInlineButton");
l.createCheckedMenuItem(g.menu,m["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});g.dropdown.close(!0)});l.createCheckedMenuItem(g.menu,m["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});g.dropdown.close(!0);a.find(!0)});l.createCheckedMenuItem(g.menu,m["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});g.dropdown.close(!0)});l.createCheckedMenuItem(g.menu,m["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});
g.dropdown.close(!0)});l.createCheckedMenuItem(g.menu,m["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});g.dropdown.close(!0);a.find(!0)});a._regExBox=l.createCheckedMenuItem(g.menu,m["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});g.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});d||l.createCheckedMenuItem(g.menu,m["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});g.dropdown.close(!0)});
return e},function(){a.hide()})},_storeRecentFind:function(a,b,e){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){d.put("recentFind",a);b&&window.setTimeout(function(){b.dispatchEvent({type:"inputDataListChanged",deleting:e})}.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 e;
b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){for(e in b)if(b[e].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(e){var d;e=e.get("recentFind");"string"===typeof e&&(e=JSON.parse(e));if(e)for(d in e)if(e[d].name===a){e.splice(d,
1);this._storeRecentFind(e,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 d=[];b.forEach(function(a){d.push({type:"proposal",label:a.name,value:a.name})});a(d)}})}.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:m["Click or use delete key to delete the search term"]})}},_createButton:function(a,b,e){var d=document.createElement("button");d.addEventListener("click",e.bind(this),!1);var f=this;d.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&f.hide()});d.appendChild(document.createTextNode(a));d.className="dismissButton parameterInlineButton";b.appendChild(d)},_createInfoImage:function(a,b,
e){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:d}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(m){var n=Object.create(null);m.getServiceReferences("orion.edit.context").forEach(function(l){var f=m.getService(l);Object.keys(f).forEach(function(b){"function"===typeof f[b]&&(n[b]=f[b].bind(f))})});return n},getOptions:function(m){var n=Object.create(null);m.getServiceReferences("orion.edit.context").forEach(function(l){l.getPropertyKeys().forEach(function(f){"service.id"!==f&&("service.names"!==f&&"objectClass"!==
f)&&(n[f]=l.getProperty(f))})});return n}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(m,n,l,f){function b(b,f){for(var d=f.getFileMetadata(),a=b.getServiceReferences("orion.edit.blamer"),k=0;k<a.length;k++){var e=a[k],l={};l.validationProperties=e.getProperty("validationProperties");l.forceSingleItem=!0;l=m._makeValidator(l,b);if(l.validationFunction.bind(l)(d))return b.getService(e)}return null}return{isVisible:function(f,g){return!!b(f,g)&&!!f.getService("orion.core.blame")},
getBlame:function(h,g){var d=b(h,g);if(d){var a=function(a){for(var b=n.getOrionHome(),d=0;d<a.length;d++){var f=a[d],g=new l(f.CommitLink),k={};k.OrionHome=b;f.CommitLink=g.expand(k)}h.getService("orion.core.blame")._setAnnotations(a)};if(d.computeBlame){var k={metadata:g.getFileMetadata()};d.computeBlame(f.getEditorContext(h),k).then(a)}else d.doBlame(g.getInput()).then(a)}}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages orion/i18nUtil orion/webui/littlelib orion/webui/dialogs/OpenResourceDialog orion/widgets/input/DropDownMenu orion/Deferred orion/URITemplate orion/commands orion/keyBinding orion/commandRegistry orion/extensionCommands orion/contentTypes orion/searchUtils orion/PageUtil orion/PageLinks orion/editor/annotations orion/blamer orion/regex orion/util orion/edit/editorContext".split(" "),function(m,n,l,f,b,h,g,d,a,k,e,p,q,x,r,v,t,u,w,z){function y(a){var b=
new g(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||r.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 I(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",I,!1);e.parentNode&&e.parentNode.removeChild(e)}},!1);return e}function C(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 s={},A=null;s.createDelegatedUI=y;C.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(e){var f=this,g=new d.Command({imageClass:"core-sprite-wrench",tooltip:m.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return e.installed},callback:function(a){var d=g.settingsDropDown;if(!d||
d.isDestroyed())d=g.settingsDropDown=new b(a.domNode.parentNode,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){d.focus()},onHide:function(){e.focus()}}),d.updateContent=f.localSettings.show.bind(f.localSettings),a=d.getContentNode(),a.tabIndex=a.style.marginTop=0;d.click()}});this.commandService.addCommand(g);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new a.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(b){var e=
new d.Command({name:m.Undo,id:"orion.undo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().undo()}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new a.KeyBinding("z",!0));e=new d.Command({name:m.Redo,id:"orion.redo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().redo()}});
this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,w.isMac?new a.KeyBinding("z",!0,!0):new a.KeyBinding("y",!0))},_generateSearchFilesCommand:function(b){var e=this;if(e._searcher){var g=!1,k=new d.Command({name:m.searchFiles,tooltip:m.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return b.installed},callback:function(a){if(!g){a=
b.getSelection();a=b.getText(a.start,a.end);var d=e.serviceRegistry.getService("orion.page.progress"),k=new f.OpenResourceDialog({searcher:e._searcher,progress:d,searchRenderer:e._searcher.defaultRenderer,nameSearch:!1,title:m.searchFiles,message:m.searchTerm,initialText:a,onHide:function(){g=!1;b.focus()}});window.setTimeout(function(){g=!0;k.show(l.node(e.toolbarId))},0)}}});this.commandService.addCommand(k);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",
1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("h",!0))}},_generateSaveCommand:function(b,e){var f=this,g=e?e:"orion.save",k=new d.Command({name:m.Save,tooltip:m.saveFile,id:g,visibleWhen:function(){return!b.installed||f.inputManager.getReadOnly()?!1:!0},callback:function(a){f.inputManager.save();return!0}});this.commandService.addCommand(k);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",k.callback,k))},_generateGotoLineCommnand:function(b){var e=this,f=new k.ParametersDescription([new k.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new k.CommandParameter("line","number","Line:",a.toString())]}),
f=new d.Command({name:m.gotoLine,tooltip:m.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return b.installed},parameters:f,callback:function(a){var e=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=e.getLineAtOffset(b.getCaretOffset()),(a=prompt(m.gotoLinePrompt,a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("l",!w.isMac,!1,!1,w.isMac),new k.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;e.commandService.runCommand("orion.gotoLine");return!0},f)},_generateFindCommnand:function(b){var e=this,f=new k.ParametersDescription([new k.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var a=b.getSelection(),d="";a.end>a.start&&(d=b.getModel().getText(a.start,a.end),e._localSearcher&&e._localSearcher.getOptions().regex&&(d=u.escape(d)));return[new k.CommandParameter("find","text","Find:",d)]}),f=new d.Command({name:m.Find,tooltip:m.Find,id:"orion.editor.find",visibleWhen:function(){return b.installed},parameters:f,callback:function(a){if(e._localSearcher){var d="",f=null,g=b.getSelection();g.end>g.start&&a.parameters.valueFor("useEditorSelection")?(d=b.getModel().getText(g.start,
g.end),e._localSearcher.getOptions().regex&&(d=u.escape(d))):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),f=x.matchResourceParameters(),q.convertFindURLBinding(f));f?(e._localSearcher.setOptions({regex:f.regEx,caseInsensitive:!f.caseSensitive}),a={},f.atLine&&(a.start=b.getModel().getLineStart(f.atLine-1)),e._localSearcher.show({findString:d,replaceString:f.replaceWith}),e._localSearcher.find(!0,a)):e._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(f);
this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("f",!0),new k.URLBinding("find","find"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("find",function(a){if(a)return e._localSearcher.show(a),!0;e.commandService.runCommand("orion.editor.find",null,null,new k.ParametersDescription([new k.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},f)},_generateBlame:function(b){var e=this,f=new d.Command({name:m.Blame,tooltip:m.BlameTooltip,id:"orion.edit.blame",parameters:new k.ParametersDescription([new k.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!b.installed?!1:t.isVisible(e.serviceRegistry,e.inputManager)},callback:function(a){for(var d=!1,f=b.getAnnotationModel().getAnnotations();f.hasNext();)if(f.next().type===v.AnnotationType.ANNOTATION_BLAME){d=!0;
break}d=!d;a.parameters&&a.parameters.valueFor("blame")&&(d="true"===a.parameters.valueFor("blame"));d?t.getBlame(e.serviceRegistry,e.inputManager):b.showBlame([])}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new a.KeyBinding("b",!0,!0),new k.URLBinding("blame","blame"))},_generateEditCommands:function(b){function f(b){if(!b)return null;var e=new a.KeyBinding;a.KeyBinding.apply(e,b);return e}function g(a,
b){!b&&(a&&"undefined"!==typeof a.HTML)&&delete a.HTML;var e=k.serviceRegistry.getService("orion.page.message");e?e.setProgressResult(a):window.console.log(a)}var k=this,q=this.toolbarId,s=this.serviceRegistry,r=s.getServiceReferences("orion.edit.command"),t=this.inputManager,u=s.getService("orion.page.progress"),v=function(a,e,f){var h=f.visibleWhen;f.visibleWhen=function(a){return!b.installed||k.inputManager.getReadOnly()?!1:!h||h(a)};f.callback=function(d){b=this;var f=b.getSelection?b.getSelection():
{start:0,end:0};d=b.getModel();var k=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())},h;e.execute?(d={contentType:t.getContentType(),input:t.getInput()},h=z.getEditorContext(s),h.openDelegatedUI=y,h.setStatus=g,d=e.execute(h,d),h=null):(d=e.run(d.getText(f.start,f.end),d.getText(),
f,t.getInput()),h=function(b){if(b&&b.uriTemplate){var e={};e.uriTemplate=b.uriTemplate;e.params=t.getFileMetadata();e.id=a.id;e.width=b.width;e.height=b.height;e.done=k;e.status=g;y(e)}else b&&(b.Status||b.status)?g(b.Status||b.status):k(b)});u.showWhile(d,n.formatMessage(m.running,a.name)).then(h);return!0};f.callback=f.callback.bind(b);return new d.Command(f)};h.when(function(a){if(A)return A;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new p.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));
return b.getContentTypes().then(function(a){return A=a})}(this.serviceRegistry),function(){var a=[],d=100;r.forEach(function(g){var h=g.getProperty("editor");if(!h||!(b.id&&h!==b.id)){for(var l=k.serviceRegistry.getService(g),m={},h=g.getPropertyKeys(),n=0;n<h.length;n++)m[h[n]]=g.getProperty(h[n]);m.forceSingleItem=!0;g=e._createCommandOptions(m,g,k.serviceRegistry,A,!1,function(a){return t.getFileMetadata()});a.push(g);g.then(function(a){a=v(m,l,a);k.commandService.addCommand(a);k.commandService.registerCommandContribution(k.toolbarId,
a.id,d,"orion.menuBarToolsGroup",m.bindingOnly,f(m.key))});d++}});h.all(a,function(a){return{_error:a}}).then(function(a){if(a=t.getFileMetadata()){var e=l.node(q);e&&(k.commandService.destroy(e),k.commandService.renderCommands(e.id,e,a,b,"button"));if(e=l.node("pageNavigationActions"))k.commandService.destroy(e),k.commandService.renderCommands(e.id,e,b,b,"button")}})})}};s.EditorCommandFactory=C;return s});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(m,n,l,f,b,h,g){function d(a){this._document=a.document||document;this._timeout=a.timeout;a=["keypress","keydown","keyup"];for(var d=function(a){this._resetTimer()}.bind(this),f=0;f<a.length;f++)this._document.addEventListener(a[f],d,!0);b.attach(this)}function a(a,b){if(a){if(!b.Severity){var d=b,f={Severity:"Error",
Message:m.noResponse};if("Cancel"===d.name)b={Severity:"Warning",Message:d.name,Cancel:!0};else{if(0===d.status)f.Cancel=!0;else if(d.responseText){d=d.responseText;try{var g=JSON.parse(d);f.Severity=g.Severity||f.Severity;f.Message=g.Message||f.Message}catch(k){f.Message=d}}else try{f.Message=JSON.stringify(d)}catch(h){}b=f}}a.setProgressResult(b)}else window.console.log(b)}function k(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=[]}d.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;this._timer&&(a.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(a){return this.dispatchEvent(a)},
setTimeout:function(a){this._timeout=a;this._resetTimer()}};h.mixin(k.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):(new f).resolve(a)},_read:function(a){var b=this.cachedMetadata||n.getClickedItem();if(b&&b.Location===a&&b.Parents&&b.Attributes&&b.ETag)return(new f).resolve(b);var d=this.fileClient,g=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return d.read.apply(d,
[a].concat(g))})},load:function(){var b=this.getInput();if(b){var d=this.fileClient,g=this._parsedLocation.resource,k=this.progressService,h=function(a,b,d){return!k?a:k.progress(a,l.formatMessage(b,d))},n=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&h(d.read(g,!0),m.ReadingMetadata,b).then(function(a){this._fileMetadata&&(this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)&&(this._fileMetadata=a,(!n.isDirty()||window.confirm(m.loadOutOfSync))&&
h(d.read(g),m.Reading,b).then(function(a){n.setInput(b,null,a);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var t=g;if(0===t.indexOf("/gitapi/commit/")){var u=t.indexOf("/file"),w=t.indexOf("?",u);-1===w&&(w=t.length);t=t.substring(u,w);this._readonly=!0}var z=window.setTimeout(function(){z=null;this.reportStatus(l.formatMessage(m.Fetching,b))}.bind(this),800),y=function(){this.reportStatus("");z&&window.clearTimeout(z)}.bind(this),C=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(t,!0),m.ReadingMetadata,t).then(function(a){a?a.Directory?f.when(a.Children||h(d.fetchChildren(a.ChildrenLocation),m.Reading,b),function(d){y();a.Children=d;this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),C):this._isText(a)?h(d.read(g,!1,!0),m.Reading,b).then(function(d){y();"string"!==typeof d&&(this._acceptPatch=d.acceptPatch,d=d.result);this._setInputContents(this._parsedLocation,
b,d,a)}.bind(this),C):h(d._getService(g).readBlob(g),m.Reading,b).then(function(d){y();this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),C):C({responseText:l.formatMessage(m.ReadingMetadataError,t)})}.bind(this),C)}}},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,d=a.removedCharCount,f=a.start,g=a.start+d,k=
0;0===a.addedCharCount?k=-1:0===d&&(k=1);if(0<b&&k===this.previousChangeType){b=this._unsavedChanges[b-1];if(0===d&&f===b.end+b.text.length){b.text+=a.text;return}if(0===a.addedCharCount&&g===b.start){b.start=f;return}}this.previousChangeType=k;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){k===A.getInput()&&(A.getFileMetadata().ETag=a.ETag,f.setInput(k,
null,h,!0));A.reportStatus("");g&&s&&s.setProgressResult({Message:m.Saved,Severity:"Normal"});A.afterSave&&A.afterSave();A._saving=!1}function d(b){A.reportStatus("");a(s,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 k=this.getInput();this.reportStatus(m["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});f.markClean();var h=f.getText(),n=h;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var u=this._unsavedChanges,w=0,z=0;z<u.length;z++)w+=u[z].text.length;h.length>w&&(n={diff:u})}this._unsavedChanges=[];this._errorSaving=!1;var u={ETag:this.getFileMetadata().ETag},y=this._parsedLocation.resource,n=this.fileClient.write(y,n,u),C=this.progressService,s=null;this.serviceRegistry&&(s=this.serviceRegistry.getService("orion.page.message"));C&&(n=C.progress(n,l.formatMessage(m.savingFile,k)));var A=this;n.then(b,function(a){412===a.status?window.confirm(m.saveOutOfSync)?
(a=A.fileClient.write(y,h),C&&(a=C.progress(a,l.formatMessage(m.savingFile,k))),a.then(b,d)):A._saving=!1:d(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new d({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=g.hash()),"string"===typeof a)){var b=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var d=g.matchResourceParameters(a),f=this._parsedLocation||{};if(b&&b.isDirty()){var k=this._location;if(f.resource!==d.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(m.confirmUnsavedChanges)){window.location.hash=k;return}}b=b&&f.editor!==d.editor;this._location=a;this._parsedLocation=d;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=d.resource)?
a===this._input?b?(this.reportStatus(""),this._setInputContents(d,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(d):(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,d,f,g){var k,h=!1;f?(this._fileMetadata=f,this.setTitle(f.Location||String(f)),this.setContentType(this.contentTypeRegistry.getFileContentType(f)),k=f.Name,h=f.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),k=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:k,title:b,contentType:this.getContentType(),metadata:f,location:window.location,contents:d};this.dispatchEvent(f);this.editor=l=f.editor;h||(l&&(l.getModel&&l.getModel())&&l.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),g||
l.setInput(b,null,d),l&&(l.getTextView&&l.getTextView())&&l.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),this._unsavedChanges=[],this.processParameters(a))}});return{handleError:a,InputManager:k}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages require orion/Deferred orion/webui/littlelib orion/compare/compareUtils orion/compare/diffProvider orion/compare/compareView orion/highlight orion/fileClient orion/globalCommands orion/commands orion/keyBinding orion/searchAndReplace/textSearcher orion/editorCommands orion/objects orion/inputManager orion/editor/editorFeatures orion/URL-shim".split(" "),function(m,n,l,f,b,h,g,d,a,k,e,p,q,x,r,v,t){function u(a){this._syntaxHighlither=
new d.SyntaxHighlighter(a)}n={};n.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new h.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var d=this;return l.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&2===e.length&&e[0]&&e[1]){var f=e[0];e=e[1];return(new l).resolve({oldFile:{URL:a,Name:d._resolveFileName(a),Type:f},newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diffContent:d._diffContent})}f=
a?d._resolveFileName(a):"";e=b?d._resolveFileName(b):"";return(new l).resolve({oldFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:e,Type:null},diffContent:d._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a,d){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,d){this._hasConflicts=d;if(b)return this._resolveTwoFiles(b,a);if(this._diffProvider){var e=this;return e._diffProvider.getDiffContent(a).then(function(b,d){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;return e._resolveComplexFileURL(a)},function(){})}console.log("A diff provider is needed for compound diff URL")}};return a}();u.prototype={highlight:function(a,b,d){return this._syntaxHighlither.setup(b,d.getTextView(),null,a,!1)}};n.ResourceComparer=
function(){function d(b,e,f,k){this._registry=b;this._commandService=e;this._fileClient=new a.FileClient(b);this._fileClient=new a.FileClient(b);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(f,!0);this._compareView=f.toggleable?new g.toggleableCompareView("inline"===f.type?"inline":"twoWay",k):"inline"===f.type?new g.inlineCompareView(k):new g.TwoWayCompareView(k);this._compareView.getWidget().setOptions({extCmdHolder:this});
k.highlighters||this._compareView.getWidget().setOptions({highlighters:[new u(b),new u(b)]});k.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(f.readonlyRight)}});k.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(f.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(m["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(d){a.manager.setDirty(b.isDirty())})}}.bind(this))}d.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?"undefined"===typeof a?!1:a:"undefined"===typeof a?!0:a},_getFileOptions:function(a){return 1===a?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new v.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];!this.options.toggleable&&(this._compareView.getWidget()._uiFactory&&"twoWay"===this._compareView.getWidget().type)&&(this._checkReadonly(this.options.readonlyRight)||(this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId())),this._checkReadonly(this.options.readonly,!0)||(this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))));var a=this;this._inputManagers.forEach(function(b){b.manager&&(this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(d,e,f,g){e=new q.TextSearcher(d,a._registry,a._commandService,f);f=(new t.KeyBindingsFactory).createKeyBindings(d,f,g,e);(new x.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:e})).generateSimpleEditorCommands(d,1===b.manager._editorIndex?"orion.compare.save.left":"orion.compare.save.right");return f})}.bind(this))},_initInputManager:function(a,b,d){var e=this;r.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:d,getInput:function(){return this.filePath},setDirty:function(a){var b=e._compareView.getWidget().getEditors(),d=a;b&&2===b.length&&(d=b[0].isDirty()||b[1].isDirty());k.setDirtyIndicator(d);
e._compareView.getWidget().refreshTitle&&e._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return e._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a,b){this._parsedLocation={resource:a};e._progress.progress(e._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=f.node(this._actionBarId);if(b){e._commandService.destroy(b);var d=this._editorIndex;
e._commandService.renderCommands(b.id,b,e._compareView.getWidget().getEditors()[d],e._compareView.getWidget().getEditors()[d],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){"*"===a.charAt(0)?k.setDirtyIndicator(!0):k.setDirtyIndicator(!1)},afterSave:function(){var a=e._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();e._getFileOptions(this._editorIndex).Content=
a;e._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=b.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;
prompt(m["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return b.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,b=new e.Command({tooltip:m["Generate link of the current diff"],
name:m["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),d=new e.Command({tooltip:m["Open the compare page"],name:m.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.registerCommandContribution(a,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new p.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return l.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,d){404===b.status&&(a.Content="");return a}.bind(this))},start:function(){if(this.options.resource){if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);b=a._isImage(b.newFile.Type);var d=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)d.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)d.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new l).resolve(a+5)})):
a._getFilesContents(d.diffContent?[d.oldFile]:[d.oldFile,d.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var d=a._getFileOptions(b.manager._editorIndex),e=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=d.URL;b.manager.setInput(d.URL,e)}});return(new l).resolve(b)}.bind(a))})}console.log("A diff provider is needed for Complex diff URL")}}};return d}();return n});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/ThemeVersion"],function(m,n,l){function f(){}function b(){this.styles=[];var a=new f;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.constant="blue";a.tag="darkorange";
a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=d;a.rightRuler="#DDDDDD";a.leftRuler="#DDDDDD";this.styles.push(a);a=new f;a.name="Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="#CCCCCC";a.lineNumberEven="#CCCCCC";a.lineNumber="#CCCCCC";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=d;a.rightRuler="#EEEEEE";a.leftRuler="#EEEEEE";
a.constant="darkOrchid";this.styles.push(a);a=new f;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="white";a.leftRuler="white";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);
a=new f;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="darkgrey";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new f;a.name="Tierra";a.annotationRuler="moccasin";
a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new f;a.name="Nimbus";a.annotationRuler="#232323";a.background="#333333";a.comment="darkseagreen";a.keyword=
"darkorange";a.text="#DDDDDD";a.string="cornflowerblue";a.overviewRuler="#232323";a.lineNumberOdd="#555555";a.lineNumberEven="#555555";a.lineNumber="#555555";a.currentLine="dimgrey";a.tag="darkorange";a.attribute="cadetBlue";a.rightRuler="#3a3a3a";a.leftRuler="#3a3a3a";a.fontFamily=g;a.fontSize=d;a.constant="#01B199";this.styles.push(a);a=new f;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler=
"#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.rightRuler="#9e937b";a.leftRuler="#9e937b";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new f;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#f6b8b6";a.lineNumberEven="#f6b8b6";
a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.rightRuler="#fbdfde";a.leftRuler="#fbdfde";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a)}function h(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", monospace',d="10pt";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:l}};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(f){}};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 f;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=n.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:m["Line Numbers"],label:"1",x:b+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:m.Background,x:b+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:m.Strings,label:"'text/javascript'",x:b+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",
name:m.Foreground,label:"\x3d",x:b+124,y:d+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:m["Current Line"],x:b+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:m["HTML Attribute"],label:"type",x:b+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:m["Overview Ruler"],x:b+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:m.Comments,label:"/* comment */",
x:b+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3cscript",x:b+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3e",x:b+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m.Strings,label:"'Result'",x:b+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:m.Foreground,label:"multiply(a,b){",x:b+120,y:d+
60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m.Keywords,label:"function",x:b+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m.Keywords,label:"var",x:b+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m.Foreground,label:"output \x3d ",x:b+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m.Foreground,label:";",x:b+205,y:d+80,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"TEXT",name:m.Keywords,label:"var",x:b+95,y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m.Foreground,label:"result \x3d a*b;",x:b+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m.Keywords,label:"return",x:b+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m.Foreground,label:"output + result;",x:b+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:m.Foreground,label:"}",x:b+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3c/script\x3e",x:b+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3cstyle",x:b+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Attribute"],label:"type",x:b+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",
name:m.Foreground,label:"\x3d",x:b+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m.Strings,label:"'text/css'",x:b+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3e",x:b+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Class Name"],label:".some-class",x:b+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Class Name"],
label:"{",x:b+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Attribute"],label:"color:",x:b+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Value"],label:"#123456",x:b+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Text"],label:";",x:b+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m["CSS Class Name"],label:"}",x:b+
75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:m["HTML Tag"],label:"\x3c/style\x3e",x:b+55,y:d+280,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:m["Annotation Ruler"],x:b,y:d,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var f=0;16>f;f++)a.shapes.push({type:"TEXT",name:m["Line Numbers"],label:f+1,x:b+20,y:d+20*f+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:b,
getStyles:h}});
define("compare/compare","orion/browserCompatibility orion/bootstrap orion/status orion/progress orion/operationsClient orion/commandRegistry orion/fileClient orion/searchClient orion/globalCommands orion/compare/compareCommands orion/compare/resourceComparer orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/compare/compareUtils orion/contentTypes orion/PageUtil i18n!orion/compare/nls/messages".split(" "),function(m,n,l,f,b,h,g,d,a,k,e,p,q,x,r,v,t){n.startup().then(function(m){var n=m.serviceRegistry;
m=m.preferences;var x=new h.CommandRegistry({}),y=new g.FileClient(n);new r.ContentTypeRegistry(n);var y=new d.Searcher({serviceRegistry:n,commandService:x,fileService:y}),C=new b.OperationsClient(n);new l.StatusReportingService(n,C,"statusPane","notifications","notificationArea");new f.ProgressService(n,C,x);(new p.ThemePreferences(m,new q.ThemeData)).apply();a.generateBanner("orion-compare",n,x,m,y);a.setPageTarget({task:t.Compare,serviceRegistry:n,commandService:x});var s=new e.DefaultDiffProvider(n),
A=new k.CompareCommandFactory({commandService:x,commandSpanId:"pageNavigationActions"}),B=function(){var a=v.matchResourceParameters();(new e.ResourceComparer(n,x,{readonly:"true"===a.readonly,readonlyRight:"undefined"===typeof a.readonlyRight||"true"===a.readonlyRight,generateLink:!0,hasConflicts:"true"===a.conflict,diffProvider:s,resource:a.resource,compareTo:a.compareTo},{parentDivId:"compareContainer",commandProvider:A,showTitle:!0,showLineStatus:!0,blockNumber:"undefined"===typeof a.block?1:
a.block,changeNumber:"undefined"===typeof a.change?0:a.change})).start()};B();window.addEventListener("hashchange",function(){B()},!1)})});
//@ sourceMappingURL=compare.js.map