/*

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function h(c,d,e,b,a,k){d[c]&&(e.push(c),(!0===d[c]||1===d[c])&&b.push(a+c+"/"+k))}function m(c,d,e,b,a){d=b+d+"/"+a;require._fileExists(c.toUrl(d+".js"))&&e.push(d)}function f(c,d,e){for(var b in d)d.hasOwnProperty(b)&&(!c.hasOwnProperty(b)||e)?c[b]=d[b]:"object"===typeof d[b]&&f(c[b],d[b],e)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var l=c.config?c.config():{},l=l||{};return{version:"2.0.1+",load:function(c,b,a,k){k=k||{};k.locale&&(l.locale=
k.locale);var g=d.exec(c),n=g[1],p=g[4],u=g[5],r=p.split("-"),s=[],q={},t,v="";g[5]?(n=g[1],c=n+u):(u=g[4],p=l.locale,p||(p=l.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),r=p.split("-"));if(k.isBuild){s.push(c);m(b,"root",s,n,u);for(t=0;t<r.length;t++)k=r[t],v+=(v?"-":"")+k,m(b,v,s,n,u);b(s,function(){a()})}else b([c],function(k){var g=[],c;h("root",k,g,s,n,u);for(t=0;t<r.length;t++)c=r[t],v+=(v?"-":"")+c,h(v,k,g,s,n,u);b(s,function(){var c,
e,p;for(c=g.length-1;-1<c&&g[c];c--){p=g[c];e=k[p];if(!0===e||1===e)e=b(n+p+"/"+u);f(q,e)}a(q)})})}}})})();
define("orion/i18n",[],function(){return{load:function(h,m,f,d){d=d||{};var c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,l=c.exec(h);if(l){if(!m.defined||m.defined(h))try{f(m(h));return}catch(e){}if(d.isBuild||d.isTest)f({});else if(m.specified&&!m.specified("orion/bootstrap"))f({});else{var b=l[1],a=l[3]?l[2]:"",k=l[3]||l[2];m(["orion/bootstrap"],function(g){g.startup().then(function(n){var g=n.serviceRegistry;n=g.getServiceReferences("orion.i18n.message");if(a)n.some(function(a){return h===a.getProperty("name")?
(g.getService(a).getMessageBundle().then(function(a){f(a)},function(){f({})}),!0):!1})||f({});else{var e={},r;n.forEach(function(n){var g=n.getProperty("name");if((l=c.exec(g))&&b===l[1]&&k===(l[3]||l[2]))if(a=l[3]?l[2]:""){if((n=d.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===n.toLowerCase().indexOf(a.toLowerCase()))e[a]=!0,(!m.specified||!m.specified(g))&&define(g,["orion/i18n!"+g],function(a){return a})}else r=n});!m.specified||!m.specified(h)?r?
g.getService(r).getMessageBundle().then(function(a){Object.keys(e).forEach(function(b){"undefined"===typeof a[b]&&(a[b]=e[b])});define(h,[],a);f(a)},function(){define(h,[],e);f(e)}):(define(h,[],e),f(e)):f(e)}})})}}else f(null)}}});
define("orion/sites/nls/root/messages",{OK:"OK","Name:":"Name:",Path:"Path","Mount at (server path)":"Mount at (server path)","Mappings:":"Mappings:","Hostname hint:":"Hostname hint:","Status:":"Status:","Not a valid name":"Not a valid name","Not a valid hostname":"Not a valid hostname","Convert to Self-Hosting":"Convert to Self-Hosting","Enable the site configuration to launch an Orion server running your local client code":"Enable the site configuration to launch an Orion server running your local client code",
Save:"Save","Save the site configuration":"Save the site configuration","Choose folder...":"Choose folder\u2026",ConvertToSelfHostingTitle:"Locate Required Folders",SelectRequiredFoldersSingle:"Locate the following required folder in your workspace.",SelectRequiredFolders:"Locate the following required folders in your workspace.",LocateFolderTitle:"Locate ${0}",FolderPrompt:"${0} (${1}):",orionClientLabel:"Orion client repository","Loading...":"Loading...",Add:"Add","Add a directory mapping to the site configuration":"Add a directory mapping to the site configuration",
"There are unsaved changes. Do you still want to navigate away?":"There are unsaved changes. Do you still want to navigate away?","There are unsaved changes.":"There are unsaved changes.","Service method missing: ":"Service method missing: ","No Matching SiteService for ":"No Matching SiteService for ",Create:"Create","Create a new site configuration":"Create a new site configuration",Edit:"Edit","Edit the site configuration":"Edit the site configuration",Delete:"Delete","Delete the site configuration":"Delete the site configuration",
ConfirmDeleteSingle:"Are you sure you want to delete the site configuration '${0}'?",ConfirmDeleteMultiple:"Are you sure you want to delete these ${0} site configurations?",ViewOnSiteTitle:"View on Site",ViewOnSiteCaption:"Choose a site configuration to view '${0}' on.","Add to site":"Add to site","Add the file to this site":"Add the file to this site",View:"View","View the file on the site":"View the file on the site",Started:"Started at ${0}",Unknown:"Unknown",Name:"Name",Actions:"Actions",Status:"Status",
URL:"URL","New Site":"New Site",WorkspaceFile:"Workspace file: ${0}",WorkspaceFolder:"Workspace folder: ${0}",WorkspaceResourceNotFound:"Workspace resource not found: ${0}",ExternalLinkTo:"External link to ${0}","Move Up":"Move Up","Move Down":"Move Down",HostHint:"HostHint",Start:"Start",Stop:"Stop","Optional; used to determine the URL where a started site can be accessed.":"Optional; used to determine the URL where a started site can be accessed.","Changes you make here won't affect the running site.":"Changes you make here won't affect the running site.",
Stopped:"Stopped",Sites:"Sites",Mappings:"Mappings","SitesExplorer.NoSitesText":"You have no sites. Click ${0} to create a site."});define("orion/sites/nls/messages",["orion/i18n!orion/sites/nls/messages","orion/sites/nls/root/messages"],function(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
(function(h,m){"function"===typeof define&&define.amd?define("orion/Deferred",m):"object"===typeof exports?module.exports=m():(h.orion=h.orion||{},h.orion.Deferred=m())})(this,function(){function h(){for(var b;b=c.shift();)b();l=!1}function m(b){c.push(b);l||(l=!0,e())}function f(b){return function(a){b(a)}}function d(){function b(){for(var a;a=e.shift();){var b=a.deferred,k="fulfilled"===c?"resolve":"reject";a=a[k];if("function"===typeof a)try{var g=a(n),d=g&&("object"===typeof g||"function"===typeof g)&&
g.then;if("function"===typeof d)if(g===b.promise)b.reject(new TypeError);else{var r=g.cancel;"function"===typeof r?b._parentCancel=r.bind(g):delete b._parentCancel;d.call(g,f(b.resolve),f(b.reject),f(b.progress))}else b.resolve(g)}catch(l){b.reject(l)}else b[k](n)}}function a(a){delete r._parentCancel;c="rejected";n=a;e.length&&m(b)}function k(g){function q(a){return function(b){(!c||"assumed"===c)&&a(b)}}delete r._parentCancel;try{var t=g&&("object"===typeof g||"function"===typeof g)&&g.then;if("function"===
typeof t)if(g===r)a(new TypeError);else{c="assumed";var l=g&&g.cancel;if("function"!==typeof l){var f=new d;g=f.promise;try{t(f.resolve,f.reject,f.progress)}catch(h){f.reject(h)}l=g.cancel;t=g.then}n=g;t.call(g,q(k),q(a));r._parentCancel=l.bind(g)}else c="fulfilled",n=g,e.length&&m(b)}catch(A){q(a)(A)}}function g(){var b=r._parentCancel;b?(delete r._parentCancel,b()):c||(b=Error("Cancel"),b.name="Cancel",a(b))}var n,c,e=[],r=this;this.resolve=function(a){c||k(a);return r};this.reject=function(b){c||
a(b);return r};this.progress=function(a){c||e.forEach(function(b){if(b.progress)try{b.progress(a)}catch(k){}});return r.promise};this.cancel=function(){r._parentCancel?setTimeout(g,0):g();return r};this.then=function(a,k,g){var n=new d;n._parentCancel=r.promise.cancel;e.push({resolve:a,reject:k,progress:g,deferred:n});("fulfilled"===c||"rejected"===c)&&m(b);return n.promise};this.promise={then:r.then,cancel:r.cancel}}var c=[],l=!1,e=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(h)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(h)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(h,0)}}();d.all=function(b,a){function k(a,b){e||(c[a]=b,0===--n&&r.resolve(c))}function g(b,g){if(!e){if(a)try{k(b,a(g));return}catch(n){g=n}r.reject(g)}}var n=b.length,c=[],e=!1,r=new d;r.then(void 0,function(){e=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===n?r.resolve(c):b.forEach(function(a,b){a.then(k.bind(void 0,b),g.bind(void 0,b))});return r.promise};d.when=function(b,a,k,g){var n;b&&"function"===typeof b.then||(n=new d,n.resolve(b),b=n.promise);return b.then(a,k,g)};return d});
define("orion/EventTarget",[],function(){function h(){this._namedListeners={}}h.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var f=this._namedListeners[h.type];f&&f.forEach(function(d){try{"function"===typeof d?d(h):d.handleEvent(h)}catch(c){"undefined"!==typeof console&&console.log(c)}});return!h.defaultPrevented},addEventListener:function(h,f){if("function"===typeof f||f.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(f)},
removeEventListener:function(h,f){var d=this._namedListeners[h];if(d)for(var c=0;c<d.length;c++)if(d[c]===f){1===d.length?delete this._namedListeners[h]:d.splice(c,1);break}}};h.prototype.constructor=h;h.attach=function(m){var f=new h;m.dispatchEvent=f.dispatchEvent.bind(f);m.addEventListener=f.addEventListener.bind(f);m.removeEventListener=f.removeEventListener.bind(f)};return h});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(h,m){function f(b,a,k){this._properties=k||{};this._properties["service.id"]=b;this._properties.objectClass=a;this._properties["service.names"]=a}function d(b,a,k){this._serviceId=b;this._serviceReference=a;this._internalRegistry=k}function c(b,a){function k(k){return function(){var g;try{if(!a())throw Error("Service was unregistered");var c=b[k].apply(b,Array.prototype.slice.call(arguments));if(c&&"function"===typeof c.then)return c;
g=new h;g.resolve(c)}catch(e){g=new h,g.reject(e)}return g.promise}}for(var g in b)"function"===typeof b[g]&&(this[g]=k(g))}function l(b,a){this.type=b;this.serviceReference=a}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new m;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var k=b._entries[a];if(!k)throw Error("Service has already been unregistered: "+a);var g=k.reference;b._serviceEventTarget.dispatchEvent(new l("unregistering",
g));b._entries[a]=null;g.getProperty("objectClass").forEach(function(a){for(var k=b._namedReferences[a],c=0;c<k.length;c++)if(k[c]===g){1===k.length?delete b._namedReferences[a]:k.splice(c,1);break}})},modifyService:function(a){var k=b._entries[a];if(!k)throw Error("Service not found while trying to send modified event: "+a);b._serviceEventTarget.dispatchEvent(new l("modified",k.reference))}}}f.prototype={getPropertyKeys:function(){var b=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
b.push(a);return b},getProperty:function(b){return this._properties[b]}};f.prototype.constructor=f;d.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(b){var a=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;
b.objectClass=a.objectClass;b["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;e.prototype={getService:function(b){var a;if("string"===typeof b)(b=this._namedReferences[b])&&b.some(function(b){a=this._entries[b.getProperty("service.id")].service;return!!a},this);else if(b=this._entries[b.getProperty("service.id")])a=b.service;return a||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var a=[];this._entries.forEach(function(b){b&&a.push(b.reference)});return a},registerService:function(b,a,k){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof b?b=[b]:Array.isArray(b)||(b=[]);var g=this._entries.length,n=new f(g,b,k),e=this._namedReferences;b.forEach(function(a){e[a]=e[a]||[];e[a].push(n)});b=new c(a,this._internalRegistry.isRegistered.bind(null,g));this._entries.push({reference:n,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new l("registered",
n));return new d(g,n,b)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};e.prototype.constructor=e;return{ServiceRegistry:e}});
define("orion/xhr",["orion/Deferred"],function(h){function m(f,d,c,l){var e="undefined"!==typeof c.response?c.response:c.responseText,b;try{b=c.status}catch(a){b=0}f={args:d,response:e,responseText:"string"===typeof e?e:null,status:b,url:f,xhr:c};"undefined"!==typeof l&&(f.error=l);return f}return function(f,d,c){c=c||{};var l=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new h,b=c.headers||{},a=c.log||!1,k;"undefined"===typeof b["X-Requested-With"]&&(b["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof c.data&&("POST"===f||"PUT"===f))k=c.data;var g=!1,n=!1;e.promise.then(void 0,function(a){g=!0;!n&&(a instanceof Error&&"Cancel"===a.name)&&l.abort()});l.onabort=function(){n=!0;if(!g){var a=Error("Cancel");a.name="Cancel";e.reject(a)}};l.onload=function(){var b=m(d,c,l);200<=l.status&&400>l.status?e.resolve(b):(e.reject(b),a&&"undefined"!==typeof console&&console.log(Error(l.statusText)))};l.onerror=function(){var b=m(d,c,l);e.reject(b);a&&"undefined"!==typeof console&&console.log(Error(l.statusText))};
l.onprogress=function(a){a.xhr=l;e.progress(a)};try{l.open(f,d,!0);"string"===typeof c.responseType&&(l.responseType=c.responseType);if("number"===typeof c.timeout)if("number"===typeof l.timeout)l.timeout=c.timeout,l.addEventListener("timeout",function(a){e.reject(m(d,c,l,"Timeout exceeded"))});else{var p=setTimeout(function(){e.reject(m(d,c,l,"Timeout exceeded"))},c.timeout);e.promise.then(clearTimeout.bind(null,p),clearTimeout.bind(null,p))}Object.keys(b).forEach(function(a){l.setRequestHeader(a,
b[a])});l.send(k||null)}catch(u){e.reject(m(d,c,l,u))}return e.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(h,m,f){function d(a,b){this._name=a;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function c(a,b){return{get:function(n,c){if(0===b)return null;var e=localStorage.getItem(a+n);if(null===e)return null;e=JSON.parse(e);return c||-1===b||e._expires&&e._expires>(new Date).getTime()?(delete e._expires,e):null},set:function(n,c){if(0!==b)if(-1!==b&&(c._expires=(new Date).getTime()+
1E3*b),0===Object.keys(c).length)localStorage.removeItem(a+n);else{var e=JSON.stringify(c);localStorage.setItem(a+n,e);delete c._expires}},remove:function(b){localStorage.removeItem(a+b)}}}function l(a){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=a.getServiceReferences("orion.core.preference.provider");0<b.length&&(this._service=a.getService(b[0]))}return!!this._service}}function e(a){this._location=
a;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function b(){this._cache=new c("/orion/preferences/local",-1)}function a(a,g){this._userProvider=new l(a);this._localProvider=new b;g=g||"defaults.pref";-1===g.indexOf("://")&&(g=h.toUrl(g));this._defaultsProvider=new e(g);this._serviceRegistration=a.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],b=0;b<this._stores.length;++b){var c=this._stores[b];-1!==this._dirty.indexOf(c)&&
a.push(this._providers[b].put(this._name,c));if(this._pendingDeletes[b]&&0<this._pendingDeletes[b].length){for(c=0;c<this._pendingDeletes[b].length;c++)a.push(this._providers[b].remove(this._name,this._pendingDeletes[b][c]));delete this._pendingDeletes[b]}}this._dirty=[];return m.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){this._flushPending&&(this._flushPending=!1,this._flush())}.bind(this),
0))},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var b=this._stores[a],c;for(c in b)b.hasOwnProperty(c)&&"undefined"===typeof this._cached[c]&&(this._cached[c]=b[c])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(0!==this._stores.length){var c=this._stores[0];c[a]!==b&&(c[a]=b,this._cached=null,this._scheduleFlush(c))}},remove:function(a){for(var b=0;b<
this._stores.length;++b){var c=this._stores[b];if(c.hasOwnProperty(a))return delete c[a],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,c=[],e=0;e<this._providers.length;++e)c.push(this._providers[e].get(this._name,
a).then(function(a){return function(k){b._stores[a]=k}}(e)));return m.all(c).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};l.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var c=new m,e=null;b?this._cache.remove(a):e=this._cache.get(a);if(null!==e)c.resolve(e);else{this._currentPromises[a]=c;var d=this;this._service.get(a).then(function(b){d._cache.set(a,b);delete d._currentPromises[a];c.resolve(b)},function(b){404===b.status?
(b={},d._cache.set(a,b),delete d._currentPromises[a],c.resolve(b)):(delete d._currentPromises[a],c.resolve(d._cache.get(a,!0)||{}))})}return c},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)},remove:function(a,b){var c=this._cache.get(a);delete c[b];this._cache.set(a,c);return this._service.remove(a,b)}};e.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;var c=new m,e=null;b?this._cache.remove(a):e=this._cache.get(a);if(null!==e)c.resolve(e);else{this._currentPromise=
c;var d=this;f("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);d._cache.set(a,b[a]||{});d._currentPromise=null;c.resolve(b[a]||{})},function(b){401===b.xhr.status||404===b.xhr.status?(d._cache.set(a,{}),d._currentPromise=null,c.resolve({})):(d._currentPromise=null,b=d._cache.get(a,!0),null!==b?c.resolve(b[a]||{}):c.resolve({}))})}return c},put:function(a,b){var c=new m;c.resolve();return c},remove:function(a,b){var c=this._cache.get(a);
delete c[b];this.put(a,c)}};b.prototype={get:function(a){var b=new m;a=this._cache.get(a);null!==a?b.resolve(a):b.resolve({});return b},put:function(a,b){var c=new m;this._cache.set(a,b);c.resolve();return c},remove:function(a,b){var c=this._cache.get(a);delete c[b];this.put(a,c)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(b,c,n){if(!c||"number"!==typeof c||7<c||1>c)n=c,c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
n,!1);return 0!==(a.USER_SCOPE&c)?"/orion/preferences/user"+b:0!==(a.LOCAL_SCOPE&c)?"/orion/preferences/local"+b:"/orion/preferences/default"+b},getPreferences:function(b,c){if(!c||"number"!==typeof c||7<c||1>c)c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var n=[];a.USER_SCOPE&c&&this._userProvider.available()&&n.push(this._userProvider);a.LOCAL_SCOPE&c&&n.push(this._localProvider);a.DEFAULT_SCOPE&c&&n.push(this._defaultsProvider);var e=new d(b,n);return e.sync().then(function(){return e})},getSetting:function(a,
b,c){for(var e,d=0;d<a.length;d++)if(a[d].label===b)for(var r=0;r<a[d].data.length;r++)if(a[d].data[r].label===c){e=a[d].data[r].value;break}return e}};return{PreferencesService:a}});
(function(){function h(a){if("string"!==typeof a)throw new TypeError;}function m(a){return a?a.split("\x26"):[]}function f(a){return 0===a.length?"":a.join("\x26")}function d(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function c(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function l(a,b){var c="",k=[],g=0;return{next:function(){c!==a.query&&(c=a.query,k=m(c));if(g<k.length){var n=
d(k[g++]);switch(b){case "keys":return n[0];case "values":return n[1];case "keys+values":return[n[0],n[1]];default:throw new TypeError;}}throw K;}}}function e(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function b(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function k(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function g(c,g){if("string"!==
typeof c)throw new TypeError;c=k(c);var n=r.exec(c);if(!n)return null;var e={};e.scheme=n[1]||"";if(e.scheme&&!q.test(e.scheme))return null;var d=n[2];if(d&&(d=s.exec(d),e.userinfo=d[1],e.host=d[2],e.port=d[3],e.port&&!t.test(e.port)))return null;e.path=n[3];e.query=n[4];e.fragment=n[5];!e.scheme&&g&&(e.scheme=g.scheme,!e.host&&g.host&&(e.userinfo=g.userinfo,e.host=g.host,e.port=g.port,e.pathRelative=!0));e.pathRelative&&(e.path?"/"!==e.path[0]&&(n=/^(.*\/)[^\/]*$/.exec(g.path)[1]||"/",e.path=n+e.path):
e.path=g.path);e.scheme&&(e.scheme=e.scheme.toLowerCase());e.port&&(e.port=b(e.port));e.host&&e.path&&(e.path=a(e.path));return e}function n(a,b){var c;if(b){b=b.href||b;c=g(b);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=g(a,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var k=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?
k:null},enumerable:!0})}try{var p;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(p=new window.URL("http://www.w3.org?q")).protocol&&p.query)return}catch(u){}var r=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,s=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,q=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,x=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,C=/^([^?#\s]*)$/,A=/^([^\s]*)$/,B=/^\S*$/,w=/([^:]*):?(.*)/,K="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),H={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(a){h(a);var b;m(this._url.query).some(function(c){c=d(c);if(c[0]===a)return b=c[1],!0});return b},enumerable:!0},set:{value:function(a,b){h(a);h(b);var k=m(this._url.query);k.some(function(g,n){var e=d(g);if(e[0]===a)return e[1]=b,k[n]=c(e),!0})||k.push(c([a,b]));this._url.query=f(k)},enumerable:!0},has:{value:function(a){h(a);
return m(this._url.query).some(function(b){if(d(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){h(a);var b=m(this._url.query),c=b.filter(function(b){return d(b)[0]!==a});return c.length!==b.length?(this._url.query=f(c),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if("function"!==typeof a)throw new TypeError;var c=l(this._url,"keys+values");try{for(;;){var k=c.next();a.call(b,k[1],k[0],this)}}catch(g){if(g!==K)throw g;
}},enumerable:!0},keys:{value:function(){return l(this._url,"keys")},enumerable:!0},values:{value:function(){return l(this._url,"values")},enumerable:!0},items:{value:function(){return l(this._url,"keys+values")}},size:{get:function(){return m(this._url.query).length},enumerable:!0},getAll:{value:function(a){h(a);var b=[];m(this._url.query).forEach(function(c){c=d(c);c[0]===a&&b.push(c[1])});return b},enumerable:!0},append:{value:function(a,b){h(a);h(b);var k=m(this._url.query);k.push(c([a,b]));this._url.query=
f(k)},enumerable:!0}});Object.defineProperties(n.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){h(a);this._input=a;this._url=g(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){h(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||q.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){h(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=w.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){h(a);if(this._url){var b=
w.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=w.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){h(a);if(this._url){var b=[w.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){h(a);if(this._url&&(a=x.exec(a)))this._url.host=a[1],this._url.port=b(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){h(a);this._url&&v.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===H[this.protocol]&&(a="");return a},set:function(a){h(a);this._url&&t.exec(a)&&(this._url.port=b(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(b){h(b);
this._url&&C.exec(b)&&(this._url.host&&(b&&"/"!==b[0])&&(b="/"+b),this._url.path=b?a(b):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){h(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),A.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){h(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),B.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((p=window.URL||window.webkitURL)&&p.createObjectURL)Object.defineProperty(n,"createObjectURL",{value:p.createObjectURL.bind(p),enumerable:!1}),Object.defineProperty(n,"revokeObjectURL",{value:p.revokeObjectURL.bind(p),enumerable:!1});window.URL=n})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(h,m){function f(a,b){var c=Object.keys(a),k=Object.keys(b);if(c.length!==k.length)return!1;c.sort();k.sort();for(var g=0,e=c.length;g<e;g++){var d=c[g];if(d!==k[g])return!1;var l=a[d],d=b[d];if(l!==d&&JSON.stringify(l)!==JSON.stringify(d))return!1}return!0}function d(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(b){}return a}function c(a){var b=null,c={key:function(c){return(b=
b||Object.keys(a))[c]},getItem:function(b){return a[b]},setItem:function(c,k){a[c]=k;b=null},removeItem:function(c){delete a[c];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}};Object.defineProperty(c,"length",{get:function(){return(b=b||Object.keys(a)).length}});return c}function l(a,b){if(b&&b instanceof XMLHttpRequest){var c,k;try{c=b.status,k=b.statusText}catch(g){c=0,k=""}return{status:c||0,statusText:k}}return b}function e(a){var b=a?JSON.parse(JSON.stringify(a,
l)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function b(a,b){this.type=a;this.plugin=b}function a(a,b){this.__objectId=a;this.__methods=b}function k(c,k,g){function d(a){I&&g.postMessage(a,I)}function s(b){if(!I)return(new h).reject(Error("plugin not connected"));b.id=String(R++);var c=new h;N[b.id]=c;c.then(null,function(a){"active"===z&&(a instanceof Error&&"Cancel"===a.name)&&d({requestId:b.id,method:"cancel",params:a.message?[a.message]:
[]})});var k=Object.prototype.toString;b.params.forEach(function(g,e){if("[object Object]"===k.call(g)&&!(g instanceof a)){var n,d;for(n in g)"[object Function]"===k.call(g[n])&&(d=d||[],d.push(n));if(d){var q=U++;O[q]=g;n=function(){delete O[q]};c.then(n,n);b.params[e]=new a(q,d)}}});g.postMessage(b,I);return c.promise}function q(a,b){a||0===a?d({id:a,result:null,error:b}):console.log(b)}function t(a,b,c,k){k.forEach(function(a,b){if(a&&"undefined"!==typeof a.__objectId){var c={};a.__methods.forEach(function(b){c[b]=
function(){return s({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});k[b]=c}});var g=void 0===typeof a?null:{id:a,result:null,error:null};try{var n=c.apply(b,k);g&&(n&&"function"===typeof n.then?(P[a]=n,n.then(function(b){delete P[a];g.result=b;d(g)},function(b){P[a]&&(delete P[a],g.error=e(b),d(g))},function(){d({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(g.result=n,d(g)))}catch(q){g&&(g.error=e(q),d(g))}}function l(a){try{if(a.method){var b=
a.method,c=a.params||[];if("serviceId"in a){var k=X[a.serviceId];k||q(a.id,"service not found");b in k?t(a.id,k,k[b],c):q(a.id,"method not found")}else if("objectId"in a){var e=O[a.objectId];e||q(a.id,"object not found");b in e?t(a.id,e,e[b],c):q(a.id,"method not found")}else if("requestId"in a){var n=P[a.requestId];n&&("cancel"===b&&n.cancel)&&n.cancel.apply(n,c)}else if("responseId"in a){var d=N[a.responseId];d&&("progress"===b&&d.progress)&&d.progress.apply(d,c)}else if("plugin"===a.method){I.connected();
var p=a.params[0];Q({headers:p.headers,services:p.services}).then(function(){E&&E.resolve(w)})}else if("timeout"===a.method)E&&E.reject(a.error);else throw Error("Bad method: "+a.method);}else{var s=N[String(a.id)];delete N[String(a.id)];if(a.error){var r=g.handleServiceError(w,a.error);s.reject(r)}else s.resolve(a.result)}}catch(f){console.log("Plugin._messageHandler "+f)}}function x(b){var c={};if(b.methods&&(b.methods.forEach(function(a){c[a]=function(){var c={serviceId:b.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===z?s(c):w.start({"transient":!0}).then(function(){return s(c)})}}),c.addEventListener&&c.removeEventListener)){var k=new m,g=U++;O[g]={handleEvent:k.dispatchEvent.bind(k)};var e=new a(g,["handleEvent"]),n=c.addEventListener;c.addEventListener=function(a,b){k._namedListeners[a]||n(a,e);k.addEventListener(a,b)};var d=c.removeEventListener;c.removeEventListener=function(a,b){k.removeEventListener(a,b);k._namedListeners[a]||d(a,e)}}return c}function C(a){var b=JSON.parse(JSON.stringify(a.properties));
b.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);b.objectClass=a;return b}function A(a){var b=x(a),c=C(a),c=g.registerService(a.names||a.type,b,c);J[a.serviceId]={registration:c,proxy:b}}function B(){g.persist(c,{created:K,headers:H,services:F,autostart:y,lastModified:D})}var w=this;k=k||{};var K=k.created||(new Date).getTime(),H=k.headers||{},F=k.services||[],y=k.autostart,D=k.lastModified||0,z="installed",G,E,I,S,J={},R=0,U=0,P={},N={},O={},X={},Q;this._default=!1;this._persist=B;
this._resolve=function(){z="resolved";g.dispatchEvent(new b("resolved",w))};this._getAutostart=function(){return y};this._getCreated=function(){return K};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(H))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return D};this.getServiceReferences=function(){var a=
[];Object.keys(J).forEach(function(b){a.push(J[b].registration.getReference())});return a};this.setParent=function(a){return S!==a?(S=a,w.stop({"transient":!0}).then(function(){if("started"===y)return w.start({"transient":!0});if("lazy"===y)return w.start({lazy:!0,"transient":!0})})):(new h).resolve()};this.getState=function(){return z};this.start=function(a){if("uninstalled"===z)return(new h).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,a));if("active"===
z)return(new h).resolve();if(!a||!a.transient){var k=a&&a.lazy?"lazy":"started";k!==y&&(y=k,B())}k=g.getState();if("starting"!==k&&"active"!==k)return a.transient?(new h).reject(Error("start transient error")):(new h).resolve();if("installed"===z)try{this._resolve()}catch(e){return(new h).reject(e)}"resolved"===z&&F.forEach(function(a){A(a)});if(a&&a.lazy)return"starting"!==z&&(z="starting",g.dispatchEvent(new b("lazy activation",w))),(new h).resolve();var d=new h;G=d;z="starting";g.dispatchEvent(new b("starting",
w));E=new h;I=g.connect(c,l,S);E.then(function(){E=null;z="active";g.dispatchEvent(new b("started",w));G=null;d.resolve()},function(){E=null;z="stopping";g.dispatchEvent(new b("stopping",w));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});g.disconnect(I);I=null;z="resolved";G=null;g.dispatchEvent(new b("stopped",w));d.reject(Error("Failed to load plugin: "+c));w._default&&(D=0,B())});return d.promise};this.stop=function(a){if("uninstalled"===z)return(new h).reject(Error("Plugin is uninstalled"));
if(G)return G.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==y)y="stopped",B();if("active"!==z&&"starting"!==z)return(new h).resolve();G=a=new h;z="stopping";g.dispatchEvent(new b("stopping",w));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});I&&(g.disconnect(I),I=null);z="resolved";G=null;g.dispatchEvent(new b("stopped",w));a.resolve();return a.promise};Q=function(a){if("uninstalled"===z)return(new h).reject(Error("Plugin is uninstalled"));
if(!a)return 0===D&&(D=(new Date).getTime(),B()),g.loadManifest(c).then(Q,function(){w._default&&(D=0,B());console.log("Failed to load plugin: "+c)});var k=H,e=F,d=y;H=a.headers||{};F=a.services||[];y=a.autostart||y;a.lastModified?D=a.lastModified:(D=(new Date).getTime(),B());if(f(H,k)&&f(F,e)&&y===d)return(new h).resolve();if("active"===z||"starting"===z){var q=[];Object.keys(F).forEach(function(a){var b=F[a];q.push(a);var c=J[a];if(c){if(f(b.methods,Object.keys(c.proxy))){a=C(b);var k=c.registration.getReference(),
g={};k.getPropertyKeys().forEach(function(a){g[a]=k.getProperty(a)});f(a,g)||c.registration.setProperties(a);return}c.registration.unregister();delete J[a]}A(b)});Object.keys(J).forEach(function(a){-1===q.indexOf(a)&&(J[a].registration.unregister(),delete J[a])})}"active"===z&&(g.disconnect(I),E=new h,I=g.connect(c,l,S),E.then(function(){E=null},function(){E=null;z="stopping";g.dispatchEvent(new b("stopping"),w);Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});g.disconnect(I);
I=null;z="resolved";g.dispatchEvent(new b("stopped",w))}));return(new h).resolve()};this.update=function(a){return Q(a).then(function(){g.dispatchEvent(new b("updated",w))})};this.uninstall=function(){if("uninstalled"===z)return(new h).reject(Error("Plugin is uninstalled"));if("active"===z||"starting"===z||"stopping"===z)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));g.removePlugin(this);z="uninstalled";g.dispatchEvent(new b("uninstalled",w));return(new h).resolve()}}
var g=/^http[s]?/i;return{Plugin:k,PluginRegistry:function(a,e){function u(a){var b=a.source;l.some(function(c){if(b===c.target){try{var k;if("undefined"===typeof c.useStructuredClone){var g="string"!==typeof a.data;k=g?a.data:JSON.parse(a.data);c.useStructuredClone=g}else k=c.useStructuredClone?a.data:JSON.parse(a.data);c.handler(k)}catch(e){}return!0}})}e=e||{};var r=e.storage||localStorage;r.getItem||(r=c(r));var s="installed",q,t=[],l=[],f=new m,C={},A={registerService:a.registerService.bind(a),
connect:function(a,b,c,k){function g(a){a=Error(a);a.name="timeout";b({method:"timeout",error:a})}var e={handler:b,url:a},n=setTimeout(g.bind(null,"Load timeout for: "+a),k||15E3),d=document.createElement("iframe");d.name=a+"_"+(new Date).getTime();d.src=a;d.onload=function(){clearTimeout(n);n=setTimeout(g.bind(null,"Plugin handshake timeout for: "+a),5E3)};d.sandbox="allow-scripts allow-same-origin";d.style.width=d.style.height="100%";d.frameBorder=0;(c||q).appendChild(d);e.target=d.contentWindow;
e.connected=function(){clearTimeout(n)};e.close=function(){clearTimeout(n);if(d){var a=d.parentNode;a&&a.removeChild(d);d=null}};l.push(e);return e},disconnect:function(a){for(var b=0;b<l.length;b++)if(a===l[b]){l.splice(b,1);try{a.close()}catch(c){}break}},removePlugin:function(a){for(var b=0;b<t.length;b++)if(a===t[b]){t.splice(b,1);break}r.removeItem("plugin."+a.getLocation())},persist:function(a,b){r.setItem("plugin."+a,JSON.stringify(b))},postMessage:function(a,b){b.target.postMessage(b.useStructuredClone?
a:JSON.stringify(a),b.url)},dispatchEvent:function(a){try{f.dispatchEvent(a)}catch(b){console&&console.log("PluginRegistry.dispatchEvent "+b)}},loadManifest:function(a){var b=new h,c=A.connect(a,function(a){c&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],A.disconnect(c),c=null,b.resolve(a)):"timeout"===a.method&&(A.disconnect(c),c=null,b.reject(a.error)))});return b.promise},getState:function(){return s},handleServiceError:function(a,b){if(b&&401===b.status){var c=a.getHeaders(),
k=a.getName()||a.getLocation(),e=document.createElement("span");e.appendChild(document.createTextNode("Authentication required for: "+k+"."));c.login&&(e.appendChild(document.createTextNode(" ")),k=document.createElement("a"),k.target="_blank",k.textContent="Login",k.href=c.login,g.test(k.href)?(e.appendChild(k),e.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+c.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(e)}}if(b.__isError){var n=
b;b=Error(n.message);Object.keys(n).forEach(function(a){b[a]=n[a]});delete b.__isError}return b}};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=A.getState;this.init=function(){if(!("starting"===s||"active"===s||"stopping"===s)){addEventListener("message",u,!1);for(var a=[],b=0,c=r.length;b<c;b++)a.push(r.key(b));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var b=a.substring(7);a=JSON.parse(r.getItem(a));a.created&&t.push(new k(b,a,A))}});t.sort(function(a,b){return a._getCreated()<b._getCreated()?-1:1});e.parent?q=e.parent:(q=document.createElement("div"),e.visible||(q.style.display="none",q.style.visibility="hidden"),document.body.appendChild(q));e.plugins&&Object.keys(e.plugins).forEach(function(a){a=d(a);var b=this.getPlugin(a);b?b._default=!0:(b=e.plugins[a],"object"!==typeof b&&(b={}),b.autostart=b.autostart||e.defaultAutostart||
"lazy",b=new k(a,b,A),b._default=!0,t.push(b))}.bind(this));s="starting"}};this.start=function(){"starting"!==s&&this.init();if("starting"!==s)return(new h).reject("Cannot start framework. Framework is already "+s+".");var a=[],b=(new Date).getTime();t.forEach(function(c){var k=c._getAutostart();0===c.getLastModified()?a.push(c.update().then(function(){if("started"===k)return c.start({"transient":!0});if("lazy"===k)return c.start({lazy:!0,"transient":!0});c._resolve()})):"started"===k?a.push(c.start({"transient":!0})):
"lazy"===k?(a.push(c.start({lazy:!0,"transient":!0})),b>c.getLastModified()+864E5&&c.update()):c._resolve()});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){s="active"})};this.stop=function(){if("starting"!==s&&"active"!==s)return(new h).reject("Cannot stop registry. Registry is already "+s+".");s="stopping";var a=[];t.forEach(function(b){a.push(b.stop({"transient":!0}))});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!e.parent){var a=
q.parentNode;a&&a.removeChild(q)}q=null;removeEventListener("message",u);s="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new h).reject("Cannot uninstall registry")};this.installPlugin=function(a,c){a=d(a);var g=this.getPlugin(a);if(g)return(new h).resolve(g);if(C[a])return C[a];if(c)return g=new k(a,c,A),t.push(g),g._persist(),A.dispatchEvent(new b("installed",g)),(new h).resolve(g);var e=A.loadManifest(a).then(function(c){g=new k(a,
c,A);t.push(g);g._persist();delete C[a];A.dispatchEvent(new b("installed",g));return g},function(b){delete C[a];throw b;});return C[a]=e};this.getPlugins=function(){return t.slice()};this.getPlugin=function(a){var b=null;a=d(a);t.some(function(c){if(a===c.getLocation())return b=c,!0});return b};this.addEventListener=f.addEventListener.bind(f);this.removeEventListener=f.removeEventListener.bind(f);this.resolvePlugins=function(){var a=!0;t.forEach(function(b){a=a&&b._resolve()});return a}}}});
define("orion/objects",[],function(){function h(h){for(var f=Object.prototype.hasOwnProperty,d=1,c=arguments.length;d<c;d++){var l=arguments[d],e;for(e in l)f.call(l,e)&&(h[e]=l[e])}return h}return{clone:function(m){if(Array.isArray(m))return Array.prototype.slice.call(m);var f=Object.create(Object.getPrototypeOf(m));h(f,m);return f},mixin:h,toArray:function(h){return Array.isArray(h)?h:[h]}}});
define("orion/serviceTracker",[],function(){function h(d,c){function l(c){var k=c.getProperty("service.id"),g=this.addingService(c);g&&(b[k]=c,a[k]=g)}function e(c){var k=c.getProperty("service.id"),g=a[k];delete b[k];delete a[k];this.removedService(c,g)}this.serviceRegistry=d;var b={},a={},k=m,g,n;this.close=function(){if(k!==f)throw"Already closed";k=m;d.removeEventListener("registered",g);d.removeEventListener("unregistering",n);n=g=null;var a=this;this.getServiceReferences().forEach(function(b){e.call(a,
b)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(b);return!a.length?null:a.map(function(a){return b[a]})};this.open=function(){if(k!==m)throw"Already open";k=f;var a=this;g=function(b){if(-1!==b.serviceReference.getProperty("objectClass").indexOf(c)&&(l.call(a,b.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(b.serviceReference,a.serviceRegistry.getService(b.serviceReference))};n=function(b){-1!==b.serviceReference.getProperty("objectClass").indexOf(c)&&
e.call(a,b.serviceReference)};d.addEventListener("registered",g);d.addEventListener("unregistering",n);d.getServiceReferences(c).forEach(function(b){l.call(a,b);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(b,d.getService(b))});if("function"===typeof this.onOpen)this.onOpen()}}var m=0,f=1;h.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(d,c){}};return h});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(h,m,f,d){var c=f.PreferencesService,l,e,b,a,k=c.DEFAULT_SCOPE,g="pid",n="/cm/configurations";l=function(a,b,c){function k(a,c,g){c.forEach(function(k,e){try{var n=a[e].getProperty("__plugin__"),d=n&&b.getPlugin(n);(!n||d&&"active"===d.getState())&&c[e].updated(g)}catch(q){"undefined"!==typeof console&&console.log(q)}})}d.call(this,a,"orion.cm.managedservice");var e={},n={},l=function(b){var k=
[];b.plugin.getServiceReferences().forEach(function(b){if(-1!==b.getProperty("objectClass").indexOf("orion.cm.managedservice")){var e=b.getProperty(g);b=a.getService(b);e&&b&&(e=(e=c._find(e))&&e.getProperties(),k.push(b.updated(e)))}});return h.all(k)};this.addingService=function(b){var c=b.getProperty(g),k=a.getService(b);if(!c||!k)return null;e[c]||(e[c]=[]);n[c]||(n[c]=[]);e[c].push(b);n[c].push(k);return k};this.onServiceAdded=function(a,b){var e=a.getProperty(g),e=c._find(e);k([a],[b],e&&e.getProperties())};
this.onOpen=function(){b.addEventListener("started",l)};this.onClose=function(){b.removeEventListener("started",l)};this.notifyUpdated=function(a){var b=a.getPid();k(e[b]||[],n[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();k(e[a]||[],n[a]||[],null)};this.removedService=function(a,b){var c=a.getProperty(g),k=e[c],d=n[c];1<k.length?k.splice(k.indexOf(a),1):delete e[c];1<d.length?d.splice(d.indexOf(b),1):delete n[c]}};f=function(){function a(c,k,g){this.store=new e(this,g);this.configAdmin=
new b(this,this.store);this.tracker=new l(c,k,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(b,c){this.factory=b;this.store=c}a.prototype={_prefName:n,_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}();e=function(){function b(a,c){this.factory=a;this.prefsService=c;this.pref=this.configs=this.defaultConfigs=null;var g=this;this.initPromise=h.all([this.prefsService.getPreferences(n,k),this.prefsService.getPreferences(n)]).then(function(a){var b=a[0];g.pref=a[1];g.defaultConfigs=g._toConfigs(b,!0);g.configs=g._toConfigs(g.pref,!1,b)})}b.prototype={_toConfigs:function(b,
c,k){var e=Object.create(null),n=this;b.keys().forEach(function(d){if(!e[d]){var p=b.get(d),l=k&&k.get(d);"object"===typeof p&&(null!==p&&0<Object.keys(p).length)&&(p[g]=d,e[d]=new a(n.factory,n,p,c,l))}});return e},_init:function(){return this.initPromise},_find:function(a,b){return b===c.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(b){var c=this._find(b),g=this._find(b,k);c||(c=g&&g.getProperties(!0),c=new a(this.factory,this,b,!1,c),this.configs[b]=c);return c},
list:function(){var a=this,b=[];this.pref.keys().forEach(function(c){(c=a._find(c))&&null!==c.getProperties()&&b.push(c)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){var c=b.getProperties(!0)||{},g=this._find(a,k);if(g){var e=g.getProperties(!0);Object.keys(e).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a)&&c[a]===e[a]&&delete c[a]})}this.pref.put(a,c)}};return b}();a=function(){function a(b,c){c=m.clone(c);delete c[g];b.properties=c}
function b(c,k,e,n,d){this.factory=c;this.store=k;this.readOnly=n;if(null!==e&&"object"===typeof e)this.pid=e[g],a(this,e);else if("string"===typeof e)this.pid=e,this.properties=null;else throw Error("Invalid pid/properties "+e);if(d){var l=this;Object.keys(d).forEach(function(a){a===g||Object.prototype.hasOwnProperty.call(l.properties,a)||(l.properties[a]=d[a])})}}b.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 b=null;this.properties&&(b=m.clone(this.properties),a||(b[g]=this.pid));return b},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(b){this._checkReadOnly();this._checkRemoved();a(this,b);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+
this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return b}();return{ConfigurationAdminFactory:f}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(h,m,f,d,c,l){var e;return{startup:function(){if(e)return e;e=new m;var b=new f.ServiceRegistry,a=new d.PreferencesService(b);return a.getPreferences("/plugins").then(function(k){var g={plugins:{}};k.keys().forEach(function(a){var b=h.toUrl(a);g.plugins[b]=k[a]});var n=new c.PluginRegistry(b,g);return n.start().then(function(){if(0<b.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=h.toUrl(a);n.getPlugin(a)||b.push(n.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return m.all(b,function(a){console.log(a)})})}).then(function(){return(new l.ConfigurationAdminFactory(b,n,a)).getConfigurationAdmin().then(b.registerService.bind(b,"orion.cm.configadmin"))}).then(function(){var a=b.getService("orion.core.auth");if(a){var c=a.getUser().then(function(b){if(b)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),k=localStorage.getItem("lastLogin");if(!k||k<(new Date).getTime()-9E5)return c}}).then(function(){var c={serviceRegistry:b,preferences:a,pluginRegistry:n};e.resolve(c);return c})})}}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/util",[],function(){var h=navigator.userAgent,m=-1!==h.indexOf("MSIE")||-1!==h.indexOf("Trident")?document.documentMode:void 0,f=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,d=-1!==h.indexOf("Opera")?parseFloat(h.split("Version/")[1]):void 0,c=parseFloat(h.split("Chrome/")[1])||void 0,l=-1!==h.indexOf("Safari")&&!c,e=parseFloat(h.split("WebKit/")[1])||void 0,b=-1!==h.indexOf("Android"),a=-1!==h.indexOf("iPad"),h=-1!==h.indexOf("iPhone"),k=a||h,g=-1!==navigator.platform.indexOf("Mac"),
n=-1!==navigator.platform.indexOf("Win"),p=-1!==navigator.platform.indexOf("Linux"),u="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:m,isFirefox:f,isOpera:d,isChrome:c,isSafari:l,isWebkit:e,isAndroid:b,isIPad:a,isIPhone:h,
isIOS:k,isMac:g,isWindows:n,isLinux:p,isTouch:u,platformDelimiter:n?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(h){function m(a,b){b||(b=document);return b.querySelectorAll(a)}function f(a){var b=a.tabIndex;0===b&&h.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&&(b=-1);return b}function d(a){if(0<=f(a))return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var c=d(a.childNodes[b]);if(c)return c}return null}function c(a){if(0<=
f(a))return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;0<=b;b--){var g=c(a.childNodes[b]);if(g)return g}return null}function l(a,b){if(3===a.nodeType){var c=e.exec(a.nodeValue);c&&1<c.length&&b(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)l(a.childNodes[c],b)}var e=/\$\{([^\}]+)\}/,b=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:m,$$array:function(a,b){return Array.prototype.slice.call(m(a,b))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var c=a.compareDocumentPosition(b);return Boolean(c&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:d,lastTabbable:c,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){l(a,function(a,c){a.parentNode.replaceChild(document.createTextNode(b[c[1]]||c[1]),a)})},processDOMNodes:function(a,b){l(a,function(a,c){var e=b[c[1]];if(e){var d=document.createRange(),l=c.index;d.setStart(a,l);d.setEnd(a,l+c[0].length);d.deleteContents();d.insertNode(e)}})},addAutoDismiss:function(a,c){function g(a){b.forEach(function(b){var c=!1,k=b.excludeNodes.some(function(b){return document.body.contains(b)?(c=!0,b.contains(a.target)):
!1});if(c&&!k)try{b.dismiss(a)}catch(g){"undefined"!==typeof console&&console&&console.error(g&&g.message)}});b=b.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===b&&(b=[],document.addEventListener("click",g,!0),h.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));b.push({excludeNodes:a,dismiss:c})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),c=0;c<b.length;c++)b[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){b=b.filter(function(b){return a!==b.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(h){var m,f,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e="undefined"!==typeof location&&location.href,b=e&&location.protocol&&location.protocol.replace(/\:/,""),a=e&&location.hostname,k=e&&(location.port||void 0),g=[],n=h.config&&h.config()||{};m={version:"2.0.5",strip:function(a){if(a){a=a.replace(c,"");var b=a.match(l);b&&(a=b[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:n.createXhr||function(){var a,b,c;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(b=0;3>b;b+=1){c=d[b];try{a=new ActiveXObject(c)}catch(k){}if(a){d=[c];break}}return a},parseName:function(a){var b,
c,k=!1,g=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==g&&(!b||1<g)?(b=a.substring(0,g),c=a.substring(g+1,a.length)):b=a;a=c||b;g=a.indexOf("!");-1!==g&&(k="strip"===a.substring(g+1),a=a.substring(0,g),c?c=a:b=a);return{moduleName:b,ext:c,strip:k}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,c,k){var g,e;g=m.xdRegExp.exec(a);if(!g)return!0;a=g[2];g=g[3];g=g.split(":");e=g[1];g=g[0];return(!a||a===b)&&(!g||g.toLowerCase()===c.toLowerCase())&&(!e&&!g||e===k)},finishLoad:function(a,
b,c,k){c=b?m.strip(c):c;n.isBuild&&(g[a]=c);k(c)},load:function(c,g,d,s){if(s.isBuild&&!s.inlineText)d();else{n.isBuild=s.isBuild;var q=m.parseName(c);s=q.moduleName+(q.ext?"."+q.ext:"");var l=g.toUrl(s),f=n.useXhr||m.useXhr;!e||f(l,b,a,k)?m.get(l,function(a){m.finishLoad(c,q.strip,a,d)},function(a){d.error&&d.error(a)}):g([s],function(a){m.finishLoad(q.moduleName+"."+q.ext,q.strip,a,d)})}},write:function(a,b,c,k){g.hasOwnProperty(b)&&(k=m.jsEscape(g[b]),c.asModule(a+"!"+b,"define(function () { return '"+
k+"';});\n"))},writeFile:function(a,b,c,g,k){b=m.parseName(b);var e=b.ext?"."+b.ext:"",n=b.moduleName+e,d=c.toUrl(b.moduleName+e)+".js";m.load(n,c,function(b){b=function(a){return g(d,a)};b.asModule=function(a,b){return g.asModule(a,d,b)};m.write(a,n,b,k)},k)}};if("node"===n.env||!n.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)f=require.nodeRequire("fs"),m.get=function(a,b){var c=f.readFileSync(a,"utf8");0===c.indexOf("\ufeff")&&(c=c.substring(1));b(c)};else if("xhr"===
n.env||!n.env&&m.createXhr())m.get=function(a,b,c,g){var k=m.createXhr(),e;k.open("GET",a,!0);if(g)for(e in g)g.hasOwnProperty(e)&&k.setRequestHeader(e.toLowerCase(),g[e]);if(n.onXhr)n.onXhr(k,a);k.onreadystatechange=function(g){4===k.readyState&&(g=k.status,399<g&&600>g?(g=Error(a+" HTTP status: "+g),g.xhr=k,c(g)):b(k.responseText))};k.send(null)};else if("rhino"===n.env||!n.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)m.get=function(a,b){var c,g,k=new java.io.File(a),e=java.lang.System.getProperty("line.separator"),
k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8")),n="";try{c=new java.lang.StringBuffer;(g=k.readLine())&&(g.length()&&65279===g.charAt(0))&&(g=g.substring(1));for(null!==g&&c.append(g);null!==(g=k.readLine());)c.append(e),c.append(g);n=String(c.toString())}finally{k.close()}b(n)};return m});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(h,m,f){return{slideoutHTMLFragment:function(d){var c=document.createElement("div");c.innerHTML=f;var l=m.$("#slideContainer",c);l.id=d+l.id;l=m.$("#pageCommandParameters",c);l.id=d+l.id;l=m.$("#pageCommandDismiss",c);l.id=d+l.id;return c.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(h){function m(d,c,l,e,b,a){this.type=a||"keydown";this.keyCode="string"===typeof d&&"keydown"===this.type?d.toUpperCase().charCodeAt(0):d;this.mod1=void 0!==c&&null!==c?c:!1;this.mod2=void 0!==l&&null!==l?l:!1;this.mod3=void 0!==e&&null!==e?e:!1;this.mod4=void 0!==b&&null!==b?b:!1}function f(d){this.keys=d}m.prototype={getKeys:function(){return[this]},match:function(d,c){if(void 0!==c){if(0!==c)return!1}else if(d instanceof Array){if(1<d.length)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(h.isOpera?d.which:void 0!==d.charCode?d.charCode:d.keyCode)?this.mod1!==(h.isMac?d.metaKey:d.ctrlKey)||"keydown"===this.type&&this.mod2!==d.shiftKey||this.mod3!==d.altKey||h.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d||this.keyCode!==d.keyCode||this.mod1!==d.mod1||this.mod2!==d.mod2||this.mod3!==d.mod3||this.mod4!==d.mod4||this.type!==d.type?!1:!0}};f.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(d,c){var l=this.keys;if(void 0!==c)return c>l.length?!1:l[c].match(d)?c===l.length-1?!0:c+1:!1;d instanceof Array||(d=[d]);if(d.length>l.length)return!1;var e;for(e=0;e<d.length;e++)if(!l[e].match(d[e]))return!1;return e===l.length?!0:e},equals:function(d){if(!d.keys||d.keys.length!==this.keys.length)return!1;for(var c=0;c<d.keys.length;c++)if(!d.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:m,KeyStroke:m,KeySequence:f}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(h,m,f){function d(c){f.attach(this);this._init(c)}function c(c,b){var a=document.createElement(void 0===b?"span":b);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var k=document.createElement("span");k.appendChild(document.createTextNode(c));k.classList.add("dropdownCommandName");a.appendChild(k);k=document.createElement("li");k.appendChild(a);return k}function l(){var c=document.createElement("li");
c.classList.add("dropdownSeparator");return c}d.prototype={_init:function(c){this._dropdownNode=m.node(c.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=c.populate;this._selectionClass=c.selectionClass;this._parentDropdown=c.parentDropdown;this._positioningNode=c.positioningNode;if(!this._parentDropdown)for(var b=this._dropdownNode.parentNode;b&&document!==b;){if(b.classList&&b.classList.contains("dropdownMenu")){this._parentDropdown=b.dropdown;break}b=b.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=c.triggerNode?c.triggerNode:m.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!c.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(b){a.toggle(b)&&m.stop(b)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.SPACE)a.toggle(),m.stop(b)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(c){var b=this;c.addEventListener("click",function(a){b.toggle(a)&&m.stop(a)},!1)},toggle:function(c){return this.isVisible()?this.close():this.open(c)},isVisible:function(){return this._isVisible},open:function(c){var b=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:c}),m.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?m.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),b=m.$$array(".dropdownSubMenu",this._dropdownNode),m.addAutoDismiss([this._triggerNode].concat(b),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(c),this._focusDropdownNode(),
b=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return b},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(c){if(this.close(!1)&&this._dropdownNode.contains(c.target))for(c=this._parentDropdown;c;)c.close(!1),c=c._parentDropdown},_positionDropdown:function(c){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{c=m.bounds(this._dropdownNode);
var b=m.bounds(document.body);if(c.left+c.width>b.left+b.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-c.width+"px";else{var a=m.bounds(this._boundingNode(this._triggerNode)),k=m.bounds(this._triggerNode);this._dropdownNode.style.left=k.left-a.left-c.width+k.width+"px"}c=c.top+c.height-(b.top+b.height);0<c&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-c)+"px")}},_boundingNode:function(c){var b=window.getComputedStyle(c,null);
return null===b||"absolute"===b.getPropertyValue("position")||!c.parentNode||c===document.body?c:this._boundingNode(c.parentNode)},close:function(c){var b=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),m.setFramesEnabled(!0),c&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),b=!0);return b},getItems:function(){var c=[],b=this;m.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===b._dropdownNode&&c.push(a)});c.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(c){a.dropdown?a.dropdown.open(c):(b._closeSelectedSubmenu(),m.stop(c));b._selectItem(a)}),a._hasDropdownMouseover=!0)});return c},empty:function(){var c=this;m.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===
c._dropdownNode&&b.parentNode.removeChild(b)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(c){if(c.keyCode===m.KEY.UP||c.keyCode===m.KEY.DOWN||c.keyCode===m.KEY.RIGHT||c.keyCode===m.KEY.ENTER||c.keyCode===m.KEY.LEFT){var b=this.getItems();if(b.length&&0<b.length){if(this._selectedItem){var a=b.indexOf(this._selectedItem);0>a&&(a=b.indexOf(this._selectedItem.parentNode));0<=a&&(c.keyCode===m.KEY.UP&&0<a?(a--,this._selectItem(b[a])):c.keyCode===m.KEY.DOWN&&a<b.length-1?(a++,this._selectItem(b[a])):
c.keyCode===m.KEY.ENTER||c.keyCode===m.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):c.keyCode===m.KEY.ENTER&&this._selectedItem.click():c.keyCode===m.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(b[0]);m.stop(c)}}else c.keyCode===
m.KEY.ESCAPE&&(this.close(!0),m.stop(c))},_selectItem:function(c){if(c=c||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=c,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(c){c!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=c)},_closeSelectedSubmenu:function(){for(var c=this._selectedSubmenu;c;)c.close(),
c=c._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&m.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(e,b){var a=c(e,b);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var c=l();this._dropdownNode.appendChild(c);return c}};d.prototype.constructor=d;return{Dropdown:d,appendKeyBindingString:function(c,b){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(b));c.appendChild(a)},
createMenuItem:c,createSeparator:l}});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(h,m){function f(d){this._init(d)}f.prototype={_init:function(d){this._node=m.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=void 0===d.hideDelay?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var c=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(e){e.target===c._node&&(c.show(),m.stop(e))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===d.showDelay?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(e){m.contains(c._node,e.target)&&(c.show(),m.stop(e))},!1);this._leaveHandler=function(e){m.contains(c._node,e.target)&&c.hide()};for(var l=0;l<d.length;l++)this._node.addEventListener(d[l],
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 d=document.createTextNode(this._text);this._tipTextContent.appendChild(d)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var c=this;m.addAutoDismiss([this._tip,this._node],function(){c.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(d){c._timeout&&(window.clearTimeout(c._timeout),c._timeout=null);c._tip.addEventListener("mouseout",function(e){m.contains(c._tip,e.target)&&(c.hide(),m.stop(e))},
!1)},!1))}return this._tip},_positionTip:function(d,c){this._makeTipNode();"left"===d?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var l=this._node,e;for(e=m.bounds(l);l&&!e.width&&!e.height;l=l.parentNode)e=m.bounds(l);var l=m.bounds(this._tipInner),b;switch(d){case "above":b=e.top-l.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":b=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":b=e.top-this._tailSize/2;e=e.left-l.width-
this._tailSize-1;break;default:b=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var a=m.bounds(document.documentElement);if(b+l.height>a.height)if(c)b=a.height-l.height-1;else return!1;if(e+l.width>a.width)if(c)e=a.width-l.width-1;else return!1;if(0>e)if(c)e=4;else return!1;if(0>b)if(c)b=4;else return!1;this._tail&&this._tail.previousPosition!==d&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
d),"above"===d||"left"===d?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=d);this._tip.style.top=b+"px";this._tip.style.left=e+"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 d=!1,c=0;!d&&c<this._position.length;)d=this._positionTip(this._position[c]),c++;d||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(d){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===d&&(d=this._hideDelay);var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");
c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},d)}},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 d=["mouseout","click"],c=0;c<d.length;c++)this._node.removeEventListener(d[c],
this._leaveHandler,!1)}}};f.prototype.constructor=f;return{Tooltip:f}});
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(h,m,f,d,c,l,e,b){function a(a){var b=a.invocation;if(b){var c=a.command;if(c.hrefCallback)return a=c.hrefCallback.call(b.handler||window,b),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(b.commandRegistry)return b.commandRegistry._invoke(b),
!0;if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(b.handler||window,b)},0),!0}return!1}function k(b,c){for(var g in c)if(c[g]&&(c[g].keyBinding&&c[g].command)&&c[g].keyBinding.match(b)){var k=c[g],n=k.keyBinding;if((!n.domScope||m.contains(m.node(n.domScope),b.target))&&a(k)){m.stop(b);break}}}function g(){var a={};if(t){var b,c,g;c=Object.keys(v);for(b=0;b<c.length;b++)g=c[b],a[g]=v[g];var k=t();c=Object.keys(k);for(b=0;b<c.length;b++)g=c[b],a[g]=k[g]}else a=
v;return a}function n(a){k(a,g())}function p(a,b){a=a||window.event;if(function(a){if(h.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 c=a.target.nodeName.toLowerCase();if("input"===c)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"===c)return}b?b(a):n(a)}function u(){this._init()}
function r(a,b,c){b.classList.add("commandImage");var g;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(g=document.createElement("span"),b.appendChild(g),g.classList.add(a.spriteClass),g.classList.add(a.imageClass)):(g=new Image,g.alt=a.name,g.name=c,g.id=c,g.src=a.image,b.appendChild(g));return g}function s(a,b,c,g,k){this.commandRegistry=k;this.handler=a;this.items=b;this.userData=c;this.command=g;g.parameters&&(this.parameters=g.parameters.makeCopy());this.id=g.id}function q(a){this._init(a)}
var t=null,v={};u.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(b){return p(b,function(b){var c=a.proxy,g=a.bindings;if(g&&c)for(var k=0;k<g.length;k++)g[k].match(b)&&(c.processKey({type:b.type,keyCode:b.keyCode,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey}),m.stop(b))})})}};window.document.addEventListener("keydown",p,!1);s.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new s(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;a?b.parameters=a.makeCopy():this.parameters&&(b.parameters=this.parameters.makeCopy());return b}};s.prototype.constructor=s;q.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.extraClass=a.extraClass;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,
b,c,g,k){c=this.getChoices(b,c,g);var n=c.some(function(a){return a.checked});c.forEach(function(c){if(c.name){var g=document.createElement("li");a.appendChild(g);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(n){var d=document.createElement("span");d.classList.add("check");d.appendChild(document.createTextNode(c.checked?"\u25cf":""));e.appendChild(d)}d=document.createTextNode(c.name);e.appendChild(d);g.appendChild(e);e.choice=c;e.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);e.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else k._generateMenuSeparator(a)})},getChoices:function(a,b,c){return this.choiceCallback?this.choiceCallback.call(b,a,c):null},makeChoiceCallback:function(a,b){return function(c){a.callback&&a.callback.call(a,b,c)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};q.prototype.constructor=q;return{Command:q,CommandInvocation:s,createDropdownMenu:function(a,b,g,k,n,e,q,p,s){a=m.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=s?l.createContextualFragment(c):l.createContextualFragment(d);m.processTextNodes(l,{ButtonText:b});a.appendChild(l);a=a.lastChild;
var t;s?(s=a.previousSibling,t=s.lastChild):s=a.previousSibling;k?s.classList.add(k):(s.classList.add("orionButton"),s.classList.add("commandButton"));n&&(e||(s.textContent="",s.setAttribute("aria-label",b)),r({spriteClass:"commandSprite",imageClass:n},s,b),s.classList.add("orionButton"));s.dropdown=new f.Dropdown({dropdown:a,populate:g,selectionClass:q,skipTriggerEventListeners:!!t,positioningNode:p});a.dropdown=s.dropdown;return{menuButton:s,menu:a,dropdown:s.dropdown,dropdownArrow:t}},createCheckedMenuItem:function(a,
b,c,g){a=m.node(a);if(!a)throw"no parent node was specified";var k=document.createRange();k.selectNode(a);k=k.createContextualFragment(e);m.processTextNodes(k,{ItemText:b});a.appendChild(k);a=m.$(".checkedMenuItem",a.lastChild);a.checked=c;a.addEventListener("change",g,!1);return a},createCommandItem:function(a,c,g,k,n,e,d){var q;e=e||!c.name&&c.hasImage();if(c.hrefCallback)q=document.createElement("a"),q.id=k,e&&c.hasImage()?r(c,q,k):(q.className="commandLink",q.appendChild(document.createTextNode(c.name))),
d=c.hrefCallback.call(g.handler,g),d.then?d.then(function(a){q.href=a}):q.href=d?d:"#";else{q=document.createElement("button");q.className="orionButton";c.extraClass&&q.classList.add(c.extraClass);e?c.hasImage()?(r(c,q,k),c.name&&q.setAttribute("aria-label",c.name)):(q.classList.add("commandButton"),q.classList.add("commandMissingImageButton"),q.appendChild(document.createTextNode(c.name))):(q.classList.add("commandButton"),k=document.createTextNode(c.name),q.appendChild(k));var p=d||c.callback;p&&
(c.onClick=p,q.addEventListener("click",function(a){p.call(g.handler,g)},!1))}"ul"===a.nodeName.toLowerCase()?(d=document.createElement("li"),a.appendChild(d),a=d):q.classList.add("commandMargins");a.appendChild(q);c.tooltip&&(q.commandTooltip=new b.Tooltip({node:q,text:c.tooltip,position:["above","below","right","left"]}));n&&(v[c.id]={keyBinding:n,command:c,invocation:g});return q},createCommandMenuItem:function(a,c,g,k,e,n){var d,q,p=a.dropdown;if(c.hrefCallback)q=f.createMenuItem(c.name,"a"),
d=q.firstElementChild,e=c.hrefCallback.call(g.handler,g),e.then?e.then(function(a){d.href=a}):d.href=e?e:"#",d.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&d.click()},!1);else{q=f.createMenuItem(c.name);d=q.firstElementChild;var s=e||c.callback;s&&(c.onClick=s,d.addEventListener("click",function(a){p.close(!0);s.call(g.handler,g)},!1),d.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)a.preventDefault(),d.click()},
!1))}c.tooltip&&(d.commandTooltip=new b.Tooltip({node:d,text:c.tooltip,position:["above","below","right","left"]}));n&&f.appendKeyBindingString(d,n);a.appendChild(q);k&&(v[c.id]={keyBinding:k,command:c,invocation:g});return d},executeBinding:a,setKeyBindingProvider:function(a){t=a},localKeyBindings:v,CommandsProxy:u,getKeyBindings:g,processKey:n,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:k}});define("orion/explorers/navigationUtils",[],function(){function h(f,d,c,l){!m&&f&&(f.push({domNode:d}),d.tabIndex=-1,d.style.outline="none")}var m=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(f,d,c){f&&(f=f.getGridNavHolder(d,!0))&&h(f,c)},generateNavGrid:h,removeNavGrid:function(f,d){if(f)for(var c=0;c<f.length;c++)if(f[c].domNode===d){f.splice(c,1);break}}}});
define("orion/PageUtil",[],function(){var h=/^http[s]?/i;return{hash:function(){var h=window.location.href.split("#")[1];return h?"#"+h:""},matchResourceParameters:function(h){h=h||window.location.toString();var f={resource:""},d=h.indexOf("#");if(-1!==d&&(h=h.substring(d+1),0!==h.length)){h=h.split(",");f.resource=decodeURIComponent(h[0]);for(d=1;d<h.length;d++){var c=/([^=]*)(=?)(.*)/.exec(h[d]),l=decodeURIComponent(c[1]||""),c=decodeURIComponent(c[3]||"");""!==l&&"resource"!==l&&(f[l]=c)}}return f},
validateURLScheme:function(m,f){var d=m;if(-1===m.indexOf("://")){var c=document.createElement("a");c.href=m;d=c.href}c=!1;if(c=f?f.some(function(c){return RegExp("^"+c+":","i").test(d)}):h.test(d))return m;console.log("Illegal URL Scheme: '"+m+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(h){function m(d){var c="",l=-1!==navigator.platform.indexOf("Mac");l?(d.mod4&&(c+="\u2303"),d.mod3&&(c+="\u2325"),d.mod2&&(c+="\u21e7"),d.mod1&&(c+="\u2318")):(d.mod1&&(c+="Ctrl+"),d.mod2&&(c+="Shift+"),d.mod3&&(c+="Alt+"));if(d.alphaKey)return c+d.alphaKey;if("keypress"===d.type)return c+d.keyCode;for(var e in h.KEY)if(typeof("number"===h.KEY[e])&&h.KEY[e]===d.keyCode){if(l)switch(h.KEY[e]){case h.KEY.BKSPC:e="\u232b";break;case h.KEY.TAB:e=
"\u21e5";break;case h.KEY.ENTER:e="\u23ce";break;case h.KEY.ESCAPE:e="\u238b";break;case h.KEY.SPACE:e="\u2423";break;case h.KEY.PAGEUP:e="\u21de";break;case h.KEY.PAGEDOWN:e="\u21df";break;case h.KEY.END:e="\u21f2";break;case h.KEY.HOME:e="\u21f1";break;case h.KEY.DEL:e="\u2326"}switch(h.KEY[e]){case h.KEY.DOWN:e="\u2193";break;case h.KEY.UP:e="\u2191";break;case h.KEY.RIGHT:e="\u2192";break;case h.KEY.LEFT:e="\u2190"}return c+e}var b;switch(d.keyCode){case 59:b=d.mod2?":":";";break;case 61:b=d.mod2?
"+":"\x3d";break;case 188:b=d.mod2?"\x3c":",";break;case 190:b=d.mod2?"\x3e":".";break;case 191:b=d.mod2?"?":"/";break;case 192:b=d.mod2?"~":"`";break;case 219:b=d.mod2?"{":"[";break;case 220:b=d.mod2?"|":"\\";break;case 221:b=d.mod2?"}":"]";break;case 222:b=d.mod2?'"':"'"}return b?c+b:112<=d.keyCode&&123>=d.keyCode?c+"F"+(d.keyCode-111):c+String.fromCharCode(d.keyCode)}function f(d){var c=-1!==window.navigator.platform.indexOf("Mac");return c&&d.metaKey||!c&&d.ctrlKey}return{getUserKeyString:function(d){var c=
"";d=d.getKeys();for(var l=0;l<d.length;l++)0!==l&&(c+=" "),c+=m(d[l]);return c},getUserText:function(d){var c=d.id,l=d.refNode,e=d.hideRefNode,b=d.initialText,a=d.onComplete,k=d.onEditDestroy,g=d.selectTo,n=d.isInitialValid;d=d.insertAsChild;var p=!1,f=function(g){return function(d){if(!p){var f=h.node(c),u=f.value;f&&(g&&d.keyCode===h.KEY.ESCAPE?(e&&(l.style.display="inline"),p=!0,f.parentNode.removeChild(f),k&&k()):g&&d.keyCode!==h.KEY.ENTER||(0===u.length||!n&&u===b?e&&(l.style.display="inline"):
(a(u),e&&l.parentNode&&(l.style.display="inline")),p=!0,f.parentNode&&f.parentNode.removeChild(f),k&&k()))}}},r=document.createElement("input");r.id=c;r.value=b||"";d?l.appendChild(r):l.parentNode.insertBefore(r,l.nextSibling);r.classList.add("userEditBoxPrompt");e&&(l.style.display="none");r.addEventListener("keydown",f(!0),!1);r.addEventListener("blur",f(!1),!1);window.setTimeout(function(){r.focus();if(b){var a=h.node(c),k=g?b.indexOf(g):-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:f,followLink:function(d,c){c&&f(c)?window.open(d):window.location=d},createButton:function(d,c){var l=document.createElement("button");l.className="orionButton commandButton commandMargins";l.addEventListener("click",function(e){c();h.stop(e)},!1);d&&l.appendChild(document.createTextNode(d));return l},
createDropdownButton:function(d,c,l){},isFormElement:function(d){switch(d.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","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(h,m,f,d,c,l,e,b,a,k){function g(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function n(a,b){this.token=a;this.parameterName=b}function p(a,b,c){this.event=a;this.handler=b;this.capture=c||!1}function u(a,b,c,g,k,e){this.name=a;this.type=b;this.label=c;this.value=g;this.lines=k||1;this.eventListeners=Array.isArray(e)?e:e?[e]:[]}function r(a,b,c){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=b&&b.clientCollect;this.getParameterElement=b&&b.getParameterElement;
this.getSubmitName=b&&b.getSubmitName}g.prototype={_init:function(a){this._selectionService=a.selection;var b=this;h.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var c=this._urlBindings[b].urlBinding.match(a);if(c){var g=this._urlBindings[b],k=g.command,e=g.invocation;if(e&&e.parameters&&k.callback){e.parameters.setValue(c.parameterName,c.parameterValue);
var n=this;window.setTimeout(function(){n._invoke(e)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,c,g,k,e){if(b){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback)return b=new h.CommandInvocation(c,b,k,a,this),b.domParent=e,this._invoke(b,g)}else if((e=this._urlBindings[a])&&e.command&&e.command.callback)return this._invoke(e.invocation,g)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,b,c){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,b,c))},confirm:function(a,b,c,g,k,e){var n=!1;if(this._parameterCollector&&!k){var d=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,k){var e=document.createElement("span");e.classList.add("parameterPrompt");e.textContent=b;a.appendChild(e);e=document.createElement("button");e.addEventListener("click",function(a){n=!0;d._parameterCollector.close()},
!1);k.appendChild(e);e.appendChild(document.createTextNode(c));e.className="dismissButton";var p=document.createElement("button");p.addEventListener("click",function(a){n=!1;d._parameterCollector.close()},!1);k.appendChild(p);p.appendChild(document.createTextNode(g));p.className="dismissButton";return e},function(){e(n)}))return}n=window.confirm(b);e(n)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b,c){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){b=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a,c),!b)){var g=new e.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});b=
g.contentContainer();b.classList.add("parameterPopup");var k=window.document.activeElement,n=this._parameterCollector.getFillFunction(a,function(){k&&k.focus();g.destroy()},c)(b);g.show();window.setTimeout(function(){n.focus();n.select()},0);b=!0}if(!b)return a.command.callback.call(a.handler||window,a)}else return a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a,
b){this._collectAndInvoke(a,!0,b)},showKeyBindings:function(a){function b(a){return function(){h.executeBinding(a)}}var c={},g,k,e=[],n;for(n in this._activeBindings)(k=this._activeBindings[n])&&(k.keyBinding&&k.command&&(k.command.name||k.command.tooltip))&&e.push(k);e.sort(function(a,b){return(a.command.name||a.command.tooltip).localeCompare(b.command.name||b.command.tooltip)});for(n=0;n<e.length;n++)k=e[n],k.keyBinding.scopeName?(c[k.keyBinding.scopeName]||(c[k.keyBinding.scopeName]=[]),c[k.keyBinding.scopeName].push(k)):
(g=d.getUserKeyString(k.keyBinding),a.createItem(g,k.command.name||k.command.tooltip,b(k)));for(var p in c)c[p].length&&0<c[p].length&&(a.createHeader(p),c[p].forEach(function(c){g=d.getUserKeyString(c.keyBinding);a.createItem(g,c.command.name||c.command.tooltip,b(c))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var c=this;b.forEach(function(b){c._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
b,c,g,k,e,n,d,p,l){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];k&&(a=this._createEntryForPath(a,k));a[b]?(g&&(a[b].title=g),c&&(a[b].position=c),n&&(a[b].imageClass=n),d&&(a[b].tooltip=d),p&&(a[b].selectionClass=p),!0===l?a[b].pretendDefaultActionId=!0:a[b].defaultActionId=l,a[b].emptyGroupMessage=e):(a[b]={title:g,position:c,emptyGroupMessage:e,imageClass:n,tooltip:d,selectionClass:p,defaultActionId:!0===l?null:l,pretendDefaultActionId:!0===
l,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){1<b.length&&(a[b]||(a[b]={position:0,children:{}},a.sortedContributions=null),a=a[b].children)});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,b,c,g,k,e,n){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,g));a[b]={position:c};e&&((c=this._commandList[b])?this._addBinding(c,"key",e,k):this._addPendingBinding(b,"key",e,k));n&&((c=this._commandList[b])?this._addBinding(c,"url",n,k):this._addPendingBinding(b,"url",n,k));a.sortedContributions=null},unregisterCommandContribution:function(a,b,c){if(this._contributionsByScopeId[a]){delete this._commandList[b];delete this._activeBindings[b];delete this._urlBindings[b];delete this._pendingBindings[b];
var g=this._contributionsByScopeId[a];c&&c.split("/").forEach(function(a){1<a.length&&g[a]&&(g=g[a].children)});delete g[b];g.sortedContributions=null}},_addBinding:function(a,b,c,g){if(!a.id)throw Error("No command id: "+a);"key"===b?this._activeBindings[a.id]={command:a,keyBinding:c,bindingOnly:g}:"url"===b&&(this._urlBindings[a.id]={command:a,urlBinding:c,bindingOnly:g})},_addPendingBinding:function(a,b,c,g){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,
binding:c,bindingOnly:g})},_checkForTrailingSeparator:function(a,b,g){var k;if("tool"===b||"button"===b)if((k=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&k.classList.contains("commandSeparator"))return g?(a.removeChild(k),!1):!0;if("menu"===b&&(a=c.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(k=a[a.length-1],g)k.parentNode.parentNode.removeChild(k.parentNode);else return!0;return!1},renderCommands:function(a,b,g,k,e,n,d){if("string"!==
typeof a)throw"a scope id for rendering must be specified";b=c.node(b);if(!b)throw"no parent";var p=this._contributionsByScopeId[a];if(!g&&p){g=p.localSelectionService||this._selectionService;var l=this;g&&g.getSelections(function(c){l.renderCommands(a,b,c,k,e,n)})}else p&&(this._render(p,b,g,k,e||"button",n,d),this._checkForTrailingSeparator(b,e,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&
b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,c,g,k,n,p){var l=a.sortedContributions;if(!l){var l=[],f=!1,u;for(u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var r=a[u];r&&"number"===typeof r.position&&(r.id=u,l.push(r),f=!0)}f&&(l.sort(function(a,b){return a.position-b.position}),a.sortedContributions=l)}var F=0,y=this;l.forEach(function(a){var l;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var f=
a.children;if("tool"===k||"button"===k)if(a.title){var u;a.defaultActionId&&((f=y._commandList[a.defaultActionId])&&(f.visibleWhen?f.visibleWhen(c):1)?(u=new h.CommandInvocation(g,c,n,f,y),u.domParent=b):a.pretendDefaultActionId=!0);f=y._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,u,a.pretendDefaultActionId);p&&m.generateNavGrid(p,f.menuButton);f&&(y._render(a.children,f.menu,c,g,"menu",n,p),y._checkForTrailingSeparator(f.menu,"menu",!0),0===f.menu.childNodes.length?
a.emptyGroupMessage?f.menuButton.emptyGroupTooltip||(f.menuButton.emptyGroupTooltip=new e.Tooltip({node:f.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(p&&m.removeNavGrid(p,f.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(f.menu),a(f.menuButton),a(f.destroyButton)):f.menuButton.style.visibility="visible")}else{var r;0<b.childNodes.length&&!y._checkForTrailingSeparator(b,k)&&(r=y.generateSeparatorImage(b));y._render(f,b,
c,g,k,n,p);0<b.childNodes.length&&b.childNodes[b.childNodes.length-1]!==r&&(r=y.generateSeparatorImage(b))}else if(a.title){if(a=y._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))y._render(f,a.menu,c,g,"menu",n,p),y._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&b.removeChild(a.destroyButton)}else 0<b.childNodes.length&&y._generateMenuSeparator(b),y._render(f,b,c,g,k,n,p),y._generateMenuSeparator(b)}else{var s=y._commandList[a.id],f=s?!0:!1;u=
a=null;if(s){l=new h.CommandInvocation(g,c,n,s,y);l.domParent=b;r=!1;try{r=f&&(s.visibleWhen?s.visibleWhen(c):!0)}catch(w){throw console.log(w),w;}y._activeBindings[s.id]&&y._activeBindings[s.id].keyBinding&&(a=y._activeBindings[s.id],a.invocation=r?l:null,a.bindingOnly&&(f=!1));y._urlBindings[s.id]&&y._urlBindings[s.id].urlBinding&&(u=y._urlBindings[s.id],u.invocation=r?l:null,u.bindingOnly&&(f=!1));f=f&&r}f&&(s.choiceCallback?("tool"===k||"button"===k?(a=b,f=!1,"ul"===b.nodeName.toLowerCase()&&
(a=document.createElement("li"),b.appendChild(a))):(a=b,f=!0),y._createDropdownMenu(a,s.name,f,function(a){s.populateChoicesMenu(a,c,g,n,y)}.bind(s),s.imageClass,s.tooltip||s.title,s.selectionClass,s.positioningNode)):(l.handler=l.handler||this,l.domParent=b,f=function(a){y._invoke(l)},"menu"===k?(u=null,a&&a.keyBinding&&(u=d.getUserKeyString(a.keyBinding)),a=h.createCommandMenuItem(b,s,l,null,f,u)):(a=k+s.id+F,a=h.createCommandItem(b,s,l,a,null,"tool"===k,f)),m.generateNavGrid(p,a),l.domNode=a,F++))}})},
_createDropdownMenu:function(a,b,g,n,d,p,f,u,r,m){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var H,F,y=a;if(g)p=document.createRange(),p.selectNode(a),p=p.createContextualFragment(k),c.processTextNodes(p,{ButtonText:b}),a.appendChild(p),F=a.lastChild,d=F.lastChild,b=d.previousSibling,b.dropdown=new l.Dropdown({dropdown:d,populate:n,parentDropdown:a.dropdown}),d.dropdown=b.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(y=document.createElement("li"),a.appendChild(y),F=y);a=null;d&&
(a="dropdownButtonWithIcon",p=p||b);p=d?p||b:p;var D=h.createDropdownMenu(y,b,n,a,d,!1,f,u,r||m);H=D.dropdownArrow;b=D.menuButton;if(H){r&&(r.domNode=D.menuButton);var z=this;b.onclick=function(a){var b=c.bounds(H);a.clientX>=b.left&&D.dropdown?D.dropdown.toggle(a):z._invoke(r)};D.dropdown&&(b.onkeydown=function(a){c.KEY.DOWN===a.keyCode&&(D.dropdown.toggle(a),c.stop(a))})}d=D.menu;var G;(n=r&&r.command&&(r.command.tooltip||r.command.name))?G=r.command.tooltip||r.command.name:n&&(G=p);G&&(b.commandTooltip=
new e.Tooltip({node:b,text:G,position:["above","below","right","left"]}))}return{menuButton:b,menu:d,dropdown:b.dropdown,destroyButton:F,dropdownArrow:H}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");b.appendChild(c);a.appendChild(b)}},generateSeparatorImage:function(a){var b;b="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};g.prototype.constructor=g;n.prototype={match:function(a){a=f.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};n.prototype.constructor=n;p.prototype.constructor=p;u.prototype={optionsRequested:function(){return this.optionsRequested}};u.prototype.constructor=u;r.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,b){var c=this.parameterTable[a];
c&&(c.value=b)},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=[];this.forEach(function(b){b=new u(b.name,b.type,b.label,b.value,b.lines,b.eventListeners);a.push(b)});var b=new r(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};r.prototype.constructor=r;return{CommandRegistry:g,URLBinding:n,
ParametersDescription:r,CommandParameter:u,CommandEventListener:p}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(h,m,f){function d(c,d){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=d}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&f.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&f.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(c,d,e){"string"===typeof c&&(c=f.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=e;var b=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!b)return!1;this._activeElements.focusNode=b;c=f.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===c.length){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=h.Close;d.appendChild(c);var a=this;c.addEventListener("click",function(b){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);b&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){b.focus();b.select&&b.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,d){f.$$array("input",d).forEach(function(b){"checkbox"===b.type?c.parameters.setValue(b.parameterName,b.checked):"button"!==b.type&&c.parameters.setValue(b.parameterName,b.value.trim())});f.$$array("textArea",d).forEach(function(b){c.parameters.setValue(b.parameterName,b.value.trim())});var e=c.parameters.getParameterElement;e&&c.parameters.forEach(function(b){(b=e(b,d))&&("checkbox"===b.type?
c.parameters.setValue(b.parameterName,b.checked):"button"!==b.type?c.parameters.setValue(b.parameterName,b.value.trim()):"textarea"!==b.type&&c.parameters.setValue(b.parameterName,b.value.trim()))});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c,d){return c.parameters?(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c,null,d))):!1},getFillFunction:function(c,d,e){var b=this;return function(a,k){var g=
null,n=function(){d&&d();b.close()},p=function(g){g.keyCode===f.KEY.ENTER&&(b._collectAndCall(c,a),n(),f.stop(g));g.keyCode===f.KEY.ESCAPE&&("function"===typeof e&&e(),n(),f.stop(g))},u=c.parameters;u.forEach(function(b){var k=u.getParameterElement?u.getParameterElement(b,a):null,e=null;!k&&b.label&&(e=document.createElement("label"),e.classList.add("parameterInput"),e.setAttribute("for",b.name+"parameterCollector"),e.textContent=b.label,a.appendChild(e));var d=b.name+"parameterCollector",e=e||a;
"text"===b.type&&"number"===typeof b.lines&&1<b.lines?(k||(k=document.createElement("textarea"),k.rows=b.lines,k.type="textarea",k.id=d,e.appendChild(k)),p=function(a){a.keyCode===f.KEY.ESCAPE&&(n(),f.stop(a))}):"boolean"===b.type?(k||(k=document.createElement("input"),k.type="checkbox",k.id=d,e.appendChild(k)),b.value&&(k.checked=!0)):(k||(k=document.createElement("input"),k.type=b.type,k.id=d,e.appendChild(k)),b.value&&(k.value=b.value));k.classList.add("parameterInput");k.setAttribute("speech",
"speech");k.setAttribute("x-webkit-speech","x-webkit-speech");k.parameterName=b.name;g||(g=k);0<b.eventListeners.length&&b.eventListeners.forEach(function(a){k.addEventListener(a.event,function(b){return a.handler(b,c)},a.capture)});k.addEventListener("keydown",p,!1)});var r=k;r||(r=document.createElement("span"),r.classList.add("layoutRight"),r.classList.add("parametersDismiss"),a.appendChild(r));var m=function(a,b){var c=document.createElement("button");b.appendChild(c);a&&c.appendChild(document.createTextNode(a));
c.classList.add("dismissButton");return c};c.parameters.hasOptionalParameters()&&(c.parameters.optionsRequested=!1,m(h.More,r).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,a);n()},!1));m(u.getSubmitName?u.getSubmitName(c):h.Submit,r).addEventListener("click",function(){b._collectAndCall(c,a);n()},!1);r=m(null,r);r.id="closebox";r.classList.add("imageSprite");r.classList.add("core-sprite-close");r.title=h.Close;r.addEventListener("click",function(a){n();
"function"===typeof e&&e()},!1);return g}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});define("orion/regex",[],function(){return{escape:function(h){return h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(h){return(h=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(h))?{pattern:h[1],flags:h[2]}:null}}});
define("orion/contentTypes",[],function(){function h(a,b){if("string"!==typeof a)return null;for(var c=a&&a.split(".").pop(),e=null,d=0;d<b.length;d++){var f=b[d],l;a:{l=e;var q=f,h=c,m=0<=q.filename.indexOf(a),x;x=h.toLowerCase();x=-1!==q.extension.indexOf(x);if(m||x){if(!(x=!l))m&&(h=h.toLowerCase(),m=-1!==l.extension.indexOf(h)),x=m;if(x){l=q;break a}}}l===f&&(e=f)}return e}function m(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function f(a){return m(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function d(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:f(a.extension),filename:m(a.filename)}}function c(a){var b=Object.create(null);a.map(d).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a.id)||(b[a.id]=a)});return b}function l(k){if(k&&k.registerService){this.serviceRegistry=k;for(var g=k.getServiceReferences(b).concat(k.getServiceReferences(a)),n=[],d=0;d<g.length;d++)for(var f=m(g[d].getProperty("contentTypes")),l=0;l<f.length;l++)n.push(f[l]);
this.map=c(n);k.registerService(e,this)}else if(Array.isArray(k))this.serviceRegistry=null,this.map=c(k);else throw Error("Invalid parameter");}var e="orion.core.contentTypeRegistry",b="orion.core.contenttype",a="orion.file.contenttype";l.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(a[c]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return h(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return h(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a="string"===typeof a?this.getContentType(a):a;b="string"===typeof b?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;for(var c=a,e={};c&&(c=this.getContentType(c["extends"]));){if(c.id===b.id)return!0;if(e[c.id])throw Error("Cycle: "+c.id);e[c.id]=!0}return!1},isSomeExtensionOf:function(a,b){for(var c=0;c<b.length;c++)if(this.isExtensionOf(a,
b[c]))return!0;return!1}};return{ContentTypeRegistry:l,getFilenameContentType:h}});
define("orion/URITemplate",[],function(){function h(a){this._text=a}function m(a){return a.replace("%25","%")}function f(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(k,m);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function d(a,b,c){for(var k=
[],e=0;e<a.length;e++)"undefined"!==typeof a[e]&&k.push(f(a[e],b));return k.join(c)}function c(a,b,c,k){for(var e=Object.keys(a),d=[],l=0;l<e.length;l++)"undefined"!==typeof a[e[l]]&&d.push(f(e[l],b)+c+f(a[e[l]],b));return d.join(k)}function l(c){if(0===c.length)throw Error("Invalid Expression: 0 length expression");(this._operator=b[c[0]])?c=c.substring(1):this._operator=b.NUL;for(var k=[],e=c.split(","),d=0;d<e.length;d++){var f=e[d].match(a);if(null===f)throw Error("Bad VarSpec: "+c);k.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=k}function e(a){for(var b=[],c=0,k=a.indexOf("{",c);-1!==k;){b.push(new h(a.substring(c,k)));c=a.indexOf("}",k+1);if(-1===c)throw Error("Invalid template: "+a);b.push(new l(a.substring(k+1,c)));c+=1;k=a.indexOf("{",c)}b.push(new h(a.substring(c)));this._templateComponents=b}var b={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;h.prototype={expand:function(a){return encodeURI(this._text)}};
l.prototype={expand:function(a){for(var b=[],k=0;k<this._varSpecList.length;k++){var e=this._varSpecList[k],l=e.name,h=a[l],q=typeof h;if("undefined"!==q&&null!==h){var m=0===b.length?this._operator.first:this._operator.sep;if("string"===q)this._operator.named&&(m+=f(l,"U+R"),m+=0===h.length?this._operator.ifemp:"\x3d"),-1!==e.prefix&&e.prefix<h.length&&(h=h.substring(0,e.prefix)),m+=f(h,this._operator.allow);else if(Array.isArray(h)){if(0===h.length)continue;e.explode?m+=d(h,this._operator.allow,
this._operator.sep):(e=d(h,this._operator.allow,","),this._operator.named&&(m+=f(l,"U+R"),m+=0===e.length?this._operator.ifemp:"\x3d"),m+=e)}else if("object"===q){if(0===Object.keys(h).length)continue;e.explode?m+=c(h,this._operator.allow,"\x3d",this._operator.sep):(e=c(h,this._operator.allow,",",","),this._operator.named&&(m+=f(l,"U+R"),m+=0===e.length?this._operator.ifemp:"\x3d"),m+=e)}else throw Error("bad param type: "+l+" : "+q);b.push(m)}}return b.join("")}};e.prototype={expand:function(a){for(var b=
[],c=0;c<this._templateComponents.length;c++)b.push(this._templateComponents[c].expand(a));return b.join("")}};return e});
define("orion/i18nUtil",["require","orion/Deferred"],function(h,m){function f(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var d={};return{getMessageBundle:function(c){function l(a){a?h(["i18n!"+c],function(a){if(a){var k=c;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+k,JSON.stringify(a));delete a._expires}b.resolve(a)}):e(Error(c))}function e(a){b.reject(a)}
if(d[c])return d[c];var b=new m;d[c]=b;var a=f(c);if(a)return b.resolve(a),b;try{h([c],l,e)}catch(k){h(["orion/i18n!"+c],l,e)}return b},formatMessage:function(c){var d=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(c,b){return d[(b<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(h,m,f,d,c,l,e){function b(){return h.toUrl?(new URL(h.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var b={};a.getPropertyKeys().forEach(function(c){"objectClass"!==c&&("service.names"!==c&&"service.id"!==c&&"__plugin__"!==c)&&(b[c]=a.getProperty(c))});return b}function k(a){return c.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function g(c,g){var e=c.getServiceReferences(g||"orion.page.link"),n=f.matchResourceParameters(window.location.href),p={OrionHome:b(),Location:n.resource},l=[];e.forEach(function(b){b=a(b);if(b.uriTemplate&&(b.nls||b.name)){var c=(new d(b.uriTemplate)).expand(p),c=f.validateURLScheme(c);b.href=c;b.nls?l.push(k(b)):(b.textContent=b.name,l.push((new m).resolve(b)))}});return m.all(l)}function n(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function p(a){this.allPageLinks=a;this.allPageLinks.sort(u)}function u(a,b){var c=a.textContent&&a.textContent.toLowerCase(),k=b.textContent&&b.textContent.toLowerCase();return c<k?-1:c>k?1:0}var r;l.mixin(n.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});l.mixin(p.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var c=document.createElement("a");c.href=b;c.target="_self";c.classList.add("targetSelector");c.textContent=a;return c})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var c;return!r?(c=[],b.getServiceReferences("orion.page.link.category").forEach(function(g){var e=a(g);if(e.id&&(e.name||e.nameKey))e.service=b.getService(g),e.nls?c.push(k(e)):(e.textContent=e.name,c.push((new m).resolve(e)))}),m.all(c).then(function(a){return r=new n(a)})):(new m).resolve(r)},
getPageLinksInfo:function(a,b){return g(a,b).then(function(a){return new p(a)})},getOrionHome:b}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
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(h,m,f,d,c,l,e,b,a,k){function g(a){var b={};a.getPropertyKeys().forEach(function(c){b[c]=a.getProperty(c)});return b}var n={},p=a.getOrionHome();n._cloneItemWithoutChildren=function q(a){if(null===a||"object"!==typeof a)return a;var b=a.constructor(),c;for(c in a)"children"!==c&&"Children"!==
c&&(b[c]=q(a[c]));return b};n._getOpenWithNavCommandExtensions=function(a,b){function c(a,b){for(var k=a.getServiceReferences("orion.navigate.openWith"),g=[],e=[],d=0;d<k.length;d++){var n=k[d];if(n.getProperty("editor")===b.id){var f=n.getProperty("contentType");f instanceof Array?g=g.concat(f):g.push(f||"*/*");n=n.getProperty("excludedContentTypes");n instanceof Array?e=e.concat(n):null!==n&&"undefined"!==typeof n&&e.push(n)}}0===g.length&&(g=null);0===e.length&&(e=null);return{contentTypes:g,excludedContentTypes:e}}
for(var k=function(){for(var b=a.getServiceReferences("orion.edit.editor"),c=[],k=0;k<b.length;k++){var g=b[k],e=g.getProperty("id");c.push({id:e,"default":g.getProperty("default")||!1,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||[]})}return c}(),g=[],e,d=0;d<k.length;d++){var n=k[d],f=c(a,n),f={properties:{name:n.name||n.id,nameKey:n.nameKey,
id:"eclipse.openWithCommand."+n.id,contentType:f.contentTypes,excludedContentTypes:f.excludedContentTypes,uriTemplate:n.uriTemplate,nls:n.nls,forceSingleItem:!0,isEditor:n["default"]?"default":"editor",validationProperties:n.validationProperties},service:{}};"orion.editor"===n.id?e=f:g.push(f)}e&&g.push(e);return g};n._makeValidator=function(a,b,k,g){function e(a,b,c,k,g){var d=!1,n;if("!"===b.charAt(0))return"undefined"===typeof a[b.substring(1)];if("undefined"!==typeof a[b]){if("undefined"===typeof c)n=
a[b],d=!0;else if("string"===typeof c){if(!typeof("string"===a[b]))return!1;if(k.variableName){if(c=RegExp(c).exec(a[b]))d=c[0],n="before"===k.variableMatchPosition?a[b].substring(0,c.index):"after"===k.variableMatchPosition?a[b].substring(c.index+d.length):"only"===k.variableMatchPosition?d:a[b],d=!0}else return RegExp(c).test(a[b])}else a[b]===c&&(n=a[b],d=!0);b=k.variableName;k=k.replacements;if(d&&b&&(g[b]=n,g.itemCached=a,k)){if("string"!==typeof n)return window.console.log("Cannot replace "+
b+", value is not a string: "+n),d;for(a=0;a<k.length;a++){n=!1;if(k[a].pattern){c=k[a].pattern;var f=k[a].replacement||"";g[b]=g[b].replace(RegExp(c),f).replace(RegExp(c),f)}else n=!0;n&&window.console.log("Invalid replacements specified in validation property.  "+k[a])}}return d}return!1}function d(a,b,c,k){var g=c.match,n,f;if(0<=(n=b.indexOf("["))){if(0>(f=b.indexOf("]")))return!1;var p=b.substring(0,n),l;if(!(l=a[p])||!Array.isArray(l))return!1;n=b.substring(n+1,f);n=parseInt(n,10);if(isNaN(n))return!1;
0>n&&(n+=l.length);b=b.substring(f+1);b=p+":"+String(n)+b}return 0<=b.indexOf("|")?(n=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),d(a,n,c,k)?!0:d(a,b,c,k)):0<=b.indexOf(":")?(n=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[n]?d(a[n],b,c,k):!1):e(a,b,g,c,k)}function n(b,k,g){if(g.info.validationProperties)for(var e=0;e<g.info.validationProperties.length;e++){var f=g.info.validationProperties[e];if("undefined"!==typeof f.source){if(!d(b,f.source,f,g))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var e=!0,p=k?c.getFilenameContentType(b.Name,k):null,p=p||{id:"application/octet-stream"};g.info.excludedContentTypes&&k&&(e=g.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==p.id.search(a)?!1:!0}));e&&(g.info.contentType&&k)&&(e=g.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==p.id.search(a)?!0:!1}));return e}return{info:a,validationFunction:function(a){"function"===typeof g&&(a=g.call(this,
a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var b=0;b<a.length;b++)if(!n(a[b],k,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);if(this.info.validationProperties)for(c=0;c<this.info.validationProperties.length;c++){var k=this.info.validationProperties[c];
k.source&&k.variableName&&(this.itemCached===a&&this[k.variableName]||d(a,k.source,k,this),a[k.variableName]?window.console.log("Variable name "+k.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[k.variableName]=this[k.variableName])}b.OrionHome=p;return(new l(this.info.uriTemplate)).expand(b)}return null}}};var u=k.UnnamedCommand;n._createCommandOptions=function(a,b,c,k,g,d){function f(e,p){var l=n._makeValidator(a,c,k,d);e.visibleWhen=
l.validationFunction.bind(l);if(g)if(l.generatesURI.bind(l)())e.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return l.getURI.bind(l)(a)};else{var h=a;e.callback=function(a){var k;if(h.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,k=n._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){k=[];for(var g=0;g<a.items.length;g++)k.push(n._cloneItemWithoutChildren(a.items[g]))}else k=n._cloneItemWithoutChildren(a.items);if(c)var d=c.getService("orion.page.progress");
b.run?d?d.progress(b.run(k),"Running command: "+e.name):b.run(k):c&&(d?d.progress(c.getService(b).run(k),"Running command: "+e.name):c.getService(b).run(k))}}p.resolve(e)}var p=new m;if(a.nls){var l=function(b){var c;b?(c=a.tooltipKey&&b[a.tooltipKey],b=a.nameKey&&b[a.nameKey]||a.name||u,c=c||a.tooltip||""):(b=a.name||a.nameKey||u,c=a.tooltip||a.tooltipKey||"");f({name:b,image:a.image,id:a.id||a.name,tooltip:c,isEditor:a.isEditor,showGlobally:a.showGlobally},p)};e.getMessageBundle(a.nls).then(l,l.bind(this,
null))}else f({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},p);return p};n.getOpenWithCommand=function(a,b,c){var k;a=c||n.getOpenWithCommands(a);for(c=0;c<a.length;c++)if(a[c].visibleWhen(b)){var g="default"===a[c].isEditor;if(!k||g)if(k=a[c],g)break}return k};n.getOpenWithCommands=function(a){var b=[],c;for(c in a._commandList){var k=a._commandList[c];k.isEditor&&b.push(k)}return b};var r;n.createAndPlaceFileCommandsExtension=function(a,
b,c,g,e,d){return n.createFileCommands(a,null,d?"all":void 0,!!d,b).then(function(a){e&&0<a.length&&(b.addCommandGroup(c,"eclipse.openWith",1E3,k.OpenWith,e,null,null,null,"dropdownSelection"),b.addCommandGroup(c,"eclipse.fileCommandExtensions",1E3,k.OpenRelated,e));a.forEach(function(a){var k=null;e&&(k=a.isEditor?e+"/eclipse.openWith":e+"/eclipse.fileCommandExtensions");b.registerCommandContribution(c,a.id,g,k)});return{}})};n.createFileCommands=function(a,b,c,k,g){c=void 0===c?"global":c;k=void 0===
k?!0:k;var e=[];n._cachedFileCommands||n._createCachedFileCommands(a);("all"===c||"global"===c)&&n._cachedFileCommands.forEach(function(a){var b=a.properties;("all"===c||b.forceSingleItem&&b.showGlobally)&&e.push(a)});return m.when(function(){var c=a.getService("orion.core.contentTypeRegistry")||b;return r||m.when(c.getContentTypes(),function(a){return r=a})}(),function(){k&&(n._cachedOpenWithExtensions||(n._cachedOpenWithExtensions=n._getOpenWithNavCommandExtensions(a,r)),e=e.concat(n._cachedOpenWithExtensions),
g._addedOpenWithCommands=k);var b=e.map(function(b){var c=b.properties;b=b.service;var k=g.findCommand(c.id||c.name);return k?(new m).resolve(k):n._createCommandOptions(c,b,a,r,!0).then(function(a){a=new f.Command(a);g.addCommand(a);return a})});return m.all(b,function(a){return{_error:a}}).then(function(a){return a})})};n._createCachedFileCommands=function(a){var b=a.getServiceReferences("orion.navigate.command");n._cachedFileCommands=[];for(var c=0;c<b.length;c++)if("orion.navigateFromMetadata"!==
b[c].getProperty("id")){var k=a.getService(b[c]),e=g(b[c]);n._cachedFileCommands.push({properties:e,service:k})}};n.getFileCommandIds=function(){var a=[];if(n._cachedFileCommands)n._cachedFileCommands.length&&(a=n._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};n.createOpenWithCommands=function(a,b,c){return c&&c._addedOpenWithCommands?(new m).resolve(n.getOpenWithCommands(c)):n.createFileCommands(a,b,
"none",!0,c)};return n});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(h,m){function f(d){this._init(d)}f.prototype={_init:function(d){var c=m.node(d.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this._makeFinalHref=
d.makeFinalHref;this._maxLength=d.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents&&!this._resource.skip){d=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,c):d.href=h.toUrl("edit/edit.html")+"#"+c}else d=document.createElement("span");m.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(d));return c},addSegmentHref:function(d,c){this._makeHref?this._makeHref(d,c.Location,c):d.href=h.toUrl("edit/edit.html")+"#"+c.ChildrenLocation},buildSegments:function(d,c){if(this._resource.Parents){var f=this._resource.Parents.slice(0),e,b;f&&(f=f.slice(0),"reverse"===c&&(f=f.reverse().slice(0)),
f.forEach(function(a){a.skip||(d?(b=d,d=null):b=a.Name,e=this.buildSegment(b),this.path+=a.Name,this.addSegmentHref(e,a),e.include=!1,this.segments.push(e))}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=m.node(this._id))?m.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(d){this.crumbs.appendChild(d)},addTitle:function(d,c){var f=c||document.title;0===this.crumbs.childNodes.length&&(d=document.createElement("span"),d.appendChild(document.createTextNode(f)),
d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,c){if(!this._resource.skip){var f;f=c?c:this._resource.Name;this._makeFinalHref?(d=this.buildSegment(f),this.addSegmentHref(d,this._resource)):(d=document.createElement("span"),d.appendChild(document.createTextNode(f)));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)}},firstSegment:function(d){d&&(this.append(d),this._resource&&this._resource.Parents&&!this._resource.skip?
(d.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(d.href=""),d.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){!0===d.include&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=this._container;d.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(this.finalSegment(d,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(d)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};f.prototype.constructor=f;return{BreadCrumbs:f}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(h,m,f){function d(c){h.attach(this);this._init(c)}d.prototype={_init:function(c){this._tracking=null;this._animationDelay=501;this._closeReversely=c.closeReversely;this.$node=f.node(c.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=f.node(c.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=f.node(c.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=c.vertical||!1;var d=this.$node.classList;d.add("split");d.add(this._vertical?"splitVerticalLayout":"splitLayout");d=this.$sideNode.classList;d.add("hasSplit");d.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");d=this.$mainNode.classList;d.add("hasSplit");d.add(this._vertical?"mainPanelVerticalLayout":"mainPanelLayout");this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");c.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 c.closeByDefault&&(this._closeByDefault=c.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";m.isIOS||m.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(c){c="vertical"===c;c!==this._vertical&&(this._vertical=c,c=this.$node.classList,c.toggle("splitLayout"),c.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",c=this.$sideNode.classList,c.toggle("sidePanelLayout"),c.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",c=this.$mainNode.classList,c.toggle("mainPanelLayout"),c.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(c=this._thumb.classList,c.toggle("splitThumbLayout"),c.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(c){this.addEventListener("resize",function(d){c(d.node)})},_initializeFromStoredSettings:function(){var c=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof c?"closed"===c:this._closeByDefault;var c=f.bounds(this.$node.parentNode),d=f.bounds(this.$node),e;this._vertical?(e=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(e,10),this._splitTop>c.top+c.height-d.height&&
(this._splitTop=c.top+c.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(e=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(e,10),this._splitLeft>c.left+c.width-d.width&&(this._splitLeft=c.left+c.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var c=f.bounds(this.$node),d=f.bounds(this.$node.parentNode);return this.vertical?c.top-d.top:c.left-d.left},
_adjustToSplitPosition:function(c){var d=f.bounds(this.$node),e=f.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(c||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);c=this._splitTop;c=this._splitTop-e.top;this.$sideNode.style.height=c+"px";this.$sideNode.style.display="block";this.$node.style.top=c+"px"}else{this._splitWidth=d.width;if(c||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);c=this._splitLeft;c=this._splitLeft-e.left;this.$sideNode.style.width=c+"px";this.$sideNode.style.display="block";this.$node.style.left=c+"px"}this._resize()},_resize:function(c,d,e){c=c||0;var b=f.bounds(this.$node.parentNode),a=f.bounds(this.$node);this._vertical?(void 0===e&&(e=a.top-b.top),e+=a.height,this.$mainNode.style.top=e+"px"):(void 0===d&&(d=a.left-b.left),d+=a.width,this.$mainNode.style.left=d+"px");var k=this;window.setTimeout(function(){k._notifyResizeListeners(k.$mainNode);
k._notifyResizeListeners(k.$sideNode)},c)},_notifyResizeListeners:function(c){this.dispatchEvent({type:"resize",node:c})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(c,d){c||this._addAnimation();var e=this._splitTop,b=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(e=b=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=f.bounds(this.$node.parentNode),
k=f.bounds(this.$node);this._vertical?e=a.height-k.height:b=a.width-k.width}else e=b=0;this._vertical?(this.$sideNode.style.height=e+"px",this.$node.style.top=e+"px"):(this.$sideNode.style.width=b+"px",this.$node.style.left=b+"px");this._resize(this._animationDelay,b,e);c||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var g=this;window.setTimeout(function(){g._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var c=
this;window.setTimeout(function(){c.$sideNode.classList.remove(c._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");c.$mainNode.classList.remove(c._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");c.$node.classList.remove(c._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(c,d){var e=f.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d;this._splitTop<e.top+5?this._splitTop=e.top+5:this._splitTop>e.top+e.height-5&&(this._splitTop=e.top+
e.height-5);var b=this._splitTop,b=this._splitTop-e.top;this.$node.style.top=b+"px"}else this._splitLeft=c,this._splitLeft<e.left+5?this._splitLeft=e.left+5:this._splitLeft>e.left+e.width-5&&(this._splitLeft=e.left+e.width-5),b=this._splitLeft,b=this._splitLeft-e.left,this.$node.style.left=b+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(c){if(c.target===
this._thumb)return f.stop(c),this._thumbDown();this._tracking||(this._down(c),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),f.setFramesEnabled(!1),f.stop(c))},_mouseMove:function(c){this._tracking&&this._move(c.clientX,c.clientY)},_mouseUp:function(c){this._tracking&&(f.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),f.stop(c))},_touchStart:function(c){if(1===c.touches.length){f.stop(c);if(c.target===
this._thumb)return this._thumbDown();this._down(c);this._touching=!0}},_touchMove:function(c){this._touching&&(c=c.touches,1===c.length&&(c=c[0],this._move(c.clientX,c.clientY)))},_touchEnd:function(c){0===c.touches.length&&(this._touching=!1,this._up())}};d.prototype.constructor=d;return{Splitter:d,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(h,m,f){function d(c){this.commandRegistry=c.commandRegistry;this.create();this._filterString="";this._providers=[]}d.prototype={addProvider:function(c){this._providers.push(c)},create:function(){var c=this._keyAssistDiv=document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");c.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");
d.classList.add("keyAssistInput");d.type="text";d.placeholder=h["Filter bindings"];c.appendChild(d);var e=this._keyAssistContents=document.createElement("div");e.classList.add("keyAssistContents");if(f.isIOS||f.isAndroid)e.style.overflowY="auto";c.appendChild(e);var b=this._keyAssistTable=document.createElement("table");b.tabIndex=0;b.classList.add("keyAssistList");e.appendChild(b);document.body.appendChild(c);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(a){this.filterChanged()}.bind(this));e.addEventListener(f.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&this.hide()}.bind(this));m.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){m.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var c=this._idCount=
this._keyAssistContents.scrollTop=0;c<this._providers.length;c++)this._providers[c].showKeyBindings(this);this.createHeader(h.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(c,d,e){if(this._filterString){var b=this._filterString.toLowerCase(),a;b!==this._filterString?(b=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(d).indexOf(b)&&-1===a(c).indexOf(b)&&-1===a(this._lastHeader).indexOf(b))return}var k=this._keyAssistTable.insertRow(-1);
k.id="keyAssist-keyBinding-"+this._idCount++;k.setAttribute("role","menuitem");k._execute=e;k.classList.add("keyAssistItem");k.addEventListener("click",function(a){this._selectedRow=k;this.execute();a.preventDefault()}.bind(this));e=k.insertCell(-1);e.classList.add("keyAssistName");e.appendChild(document.createTextNode(d));e=k.insertCell(-1);e.classList.add("keyAssistAccel");e.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var d=this._keyAssistTable.insertRow(-1);
d.classList.add("keyAssistSection");var d=d.insertCell(-1),e=document.createElement("h2");e.appendChild(document.createTextNode(c));d.appendChild(e)},execute:function(){window.setTimeout(function(){this.hide();var c=this._selectedRow;this._selectedRow=null;c&&c._execute&&c._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var c=this._keyAssistInput.value;this._filterString!==c&&(this._filterString=
c,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var c=document.activeElement,d=this._keyAssistDiv,c=d===c||0!==(d.compareDocumentPosition(c)&16);d.style.display="none";c&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(c){c=this._providers.indexOf(c);-1!==c&&this._providers.splice(c,
1)},select:function(c){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===d.length)this._selectedIndex=-1;else{var e=this._selectedIndex,e=(e+(c?1:-1))%d.length;0>e&&(e=d.length-1);-1!==this._selectedIndex&&(c=d[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=e;if(-1!==this._selectedIndex){this._selectedRow=c=d[this._selectedIndex];c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();
var d=c.getBoundingClientRect(),b=this._keyAssistContents,a=b.getBoundingClientRect();c.offsetTop<b.scrollTop?0===e?b.scrollTop=0:c.scrollIntoView(!0):d.bottom>a.bottom&&c.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(c){if(40===c.keyCode)this.select(!0);else if(38===c.keyCode)this.select(!1);else if(13===c.keyCode)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var d=0,d=f.isIE||f.isOpera?-c.wheelDelta:f.isFirefox?40*c.detail:-c.wheelDeltaY,e=this._keyAssistContents,b=e.scrollTop;e.scrollTop+=d;if(b!==e.scrollTop)return c.preventDefault&&c.preventDefault(),!1}};return{KeyAssistPanel:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function h(h,f){this._preferences=h;this._themeData=f;var d=f.getThemeStorageInfo();this._themeVersion=d.version;var c=h.listenForChangedSettings(d.storage,2,function(d){d.key===c&&this.apply()}.bind(this))}h.prototype={_initialize:function(h,f,d){var c,l;void 0===this._themeVersion||d.get("version")===this._themeVersion?(c=d.get(h.styleset),(l=d.get("selected"))&&(l=JSON.parse(l))):l=c=null;c||(c=f.getStyles(),d.put(h.styleset,JSON.stringify(c)));
if(!l||void 0===l[h.selectedKey])l=l||{},l[h.selectedKey]=h.defaultTheme,d.put("selected",JSON.stringify(l));d.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(h){var f=this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,f,c);var l=JSON.parse(c.get("selected"));c=JSON.parse(c.get(d.styleset));var e;if(c)for(var b=0;b<c.length;b++)if(c[b].name===l[d.selectedKey]){e=c[b];break}h({style:e,styles:c})}.bind(this))},
setTheme:function(h,f){var d=this._themeData,c=d.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(l){this._initialize(c,d,l);var e=JSON.parse(l.get("selected"));h||(h=e[c.selectedKey]);e[c.selectedKey]=h;l.put("selected",JSON.stringify(e));f?l.put(c.styleset,JSON.stringify(f)):f=JSON.parse(l.get(c.styleset));for(var b=0;b<f.length;b++)if(f[b].name===e[c.selectedKey]){d.processSettings(f[b]);break}l.put("version",this._themeVersion)}.bind(this))},setFontSize:function(h){var f=
this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,f,c);var l=JSON.parse(c.get("selected")),e=JSON.parse(c.get(d.styleset)),b;if(e)for(var a=0;a<e.length;a++)e[a].fontSize=h,e[a].name===l[d.selectedKey]&&(b=e[a]);c.put(d.styleset,JSON.stringify(e));f.processSettings(b)}.bind(this))}};return{ThemePreferences:h}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/editor/eventTarget",[],function(){function h(){}h.addMixin=function(m){var f=h.prototype,d;for(d in f)f.hasOwnProperty(d)&&(m[d]=f[d])};h.prototype={addEventListener:function(h,f,d){this._eventTypes||(this._eventTypes={});var c=this._eventTypes[h];c||(c=this._eventTypes[h]={level:0,listeners:[]});c.listeners.push({listener:f,useCapture:d})},dispatchEvent:function(h){var f=h.type;this._dispatchEvent("pre"+f,h);this._dispatchEvent(f,h);this._dispatchEvent("post"+f,h)},_dispatchEvent:function(h,
f){var d=this._eventTypes?this._eventTypes[h]:null;if(d){var c=d.listeners;try{if(d.level++,c)for(var l=0,e=c.length;l<e;l++)if(c[l]){var b=c[l].listener;"function"===typeof b?b.call(this,f):b.handleEvent&&"function"===typeof b.handleEvent&&b.handleEvent(f)}}finally{if(d.level--,d.compact&&0===d.level){for(l=c.length-1;0<=l;l--)c[l]||c.splice(l,1);0===c.length&&delete this._eventTypes[h];d.compact=!1}}}},isListening:function(h){return!this._eventTypes?!1:void 0!==this._eventTypes[h]},removeEventListener:function(h,
f,d){if(this._eventTypes){var c=this._eventTypes[h];if(c){for(var l=c.listeners,e=0,b=l.length;e<b;e++){var a=l[e];if(a&&a.listener===f&&a.useCapture===d){0!==c.level?(l[e]=null,c.compact=!0):l.splice(e,1);break}}0===l.length&&delete this._eventTypes[h]}}}};return{EventTarget:h}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(h,m,f){function d(c){c=c||{};this._document=c.document||document}var c={};d.getTheme=function(f){f=f||"default";var e=c[f];e||(e=c[f]=new d);return e};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,e){var b=this,a=b._themeClass;b._themeClass=c;this._load(c,e,function(){b.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:b.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,e){function b(b,g,e){g&&(a.push("."+c+" ."+b+" {"),a.push("\t"+(e?"background-color":"color")+": "+g+";"),a.push("}"))}var a=[];a.push("");a.push("."+c+" {");e.fontFamily&&a.push("\tfont-family: "+e.fontFamily+";");e.fontSize&&a.push("\tfont-size: "+e.fontSize+";");e.fontSize&&a.push("\tcolor: "+e.text+";");a.push("}");a.push("."+c+".textview {");e.background&&a.push("\tbackground-color: "+e.background+";");a.push("}");a.push("."+c+" .textviewLeftRuler {");e.leftRuler&&
a.push("\tborder-right: 1px solid "+e.leftRuler+";");a.push("}");a.push("."+c+" .textviewRightRuler {");e.rightRuler&&a.push("\tborder-left: 1px solid "+e.rightRuler+";");a.push("}");b("ruler.annotations",e.annotationRuler,!0);b("ruler.lines",e.annotationRuler,!0);b("ruler.folding",e.annotationRuler,!0);b("ruler.overview",e.overviewRuler,!0);b("rulerLines",e.lineNumber,!1);b("rulerLines.even",e.lineNumberEven,!1);b("rulerLines.odd",e.lineNumberOdd,!1);b("annotationLine.currentLine",e.currentLine,
!0);b("entity-name-tag",e.keyword,!1);b("entity-other-attribute-name",e.attribute,!1);b("string-quoted",e.string,!1);b("meta.annotation.currentLine",e.currentLine,!0);b("keyword",e.keyword,!1);b("string",e.string,!1);b("constant",e.constant,!1);b("comment",e.comment,!1);b("comment.block.documentation",e.comment,!1);b("keyword.other.documentation.markup",e.comment,!1);b("keyword.other.documentation.markup",e.comment,!1);return a.join("\n")},_createStyle:function(c,e,b,a){var k=this._document;c="orion-theme-"+
c;var g=k.getElementById(c);if(g){if(a||g.firstChild.data===e)return;g.removeChild(g.firstChild);g.appendChild(k.createTextNode(e))}else a?(g=f.createElement(k,"link"),g.rel="stylesheet",g.type="text/css",g.href=e,g.addEventListener("load",function(){b()})):(g=f.createElement(k,"style"),g.appendChild(k.createTextNode(e))),g.id=c,(k.getElementsByTagName("head")[0]||k.documentElement).appendChild(g);a||b()},_load:function(c,e,b){if(c)if("string"===typeof e)this._createStyle(c,e,b);else if(e=e.href,
".css"!==e.substring(e.length-4)&&(e+=".css"),/^\//.test(e)||/[a-zA-Z0-9]+:\/\//i.test(e)||!h.toUrl)this._createStyle(c,e,b,!0);else{var a=this;h(["text!"+e],function(k){a._createStyle(c,k,b,!1)})}else b()}};m.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function h(h){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=h;this.classString="."+h+"{ "}h.prototype.className=null;h.prototype.classString=void 0;h.prototype.style=void 0;h.prototype.closeString=" }\n";h.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:h}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(h){function m(){}m.prototype.navbar="white";m.prototype.button="#777777";m.prototype.location="#EFEFEF";m.prototype.selection="#cedce7";m.prototype.sidepanel="#F7F7F7";m.prototype.mainpanel="white";m.prototype.navtext="#bfbfbf";m.prototype.content="#3087B3";m.prototype.search="#444";m.prototype.toolpanel="white";m.prototype.writeNavigationStyle=function(){var f="",d=[],c=new h.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";d.push(c);c=new h.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="16px";c.style.padding="10px";c.style.paddingLeft="6px";c.style.paddingRight="2px";c.style.borderBottom="none";c.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";c.style.zIndex="100";d.push(c);c=new h.ThemeClass("a");c.style.textDecoration="none";c.style.color=
this.content;d.push(c);c=new h.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;c.style.verticalAlign="bottom";d.push(c);c=new h.ThemeClass("primaryNav");c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";d.push(c);c=new h.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign=
"baseline";c.style.textDecoration="none";d.push(c);c=new h.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";d.push(c);for(var l in d)f+=d[l].toString();return f};m.prototype.writeLocationStyle=function(){var f="",d=[],c=new h.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";d.push(c);c=new h.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";d.push(c);c=new h.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";d.push(c);c=new h.ThemeClass("breadcrumbSeparator");c.style.fontSize=
"8pt";c.style.textDecoration="none";c.style.color=this.separator;c.style.fontWeight="bold";d.push(c);c=new h.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color=this.breadcrumb;c.style.textDecoration="none";c.style.textWrap="normal";c.style.lineHeight="10pt";d.push(c);c=new h.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";d.push(c);c=new h.ThemeClass("navlinkonpage");
c.style.color=this.content;c.style.verticalAlign="middle";d.push(c);this.bannerProgress&&(c=new h.ThemeClass("topRowBanner .progressPane_running"),c.style.borderColor=this.bannerProgress,d.push(c));for(var l in d)f+=d[l].toString();return f};m.prototype.writeButtonStyle=function(){var f="",d=[],c=new h.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="middle";c.style.cursor="pointer";
c.style.display="inline-block";c.style.padding="4px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="9pt";c.style.userSelect="none";d.push(c);c=new h.ThemeClass("commandButton:over");c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";d.push(c);c=new h.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";
c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";d.push(c);c=new h.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";d.push(c);for(var l in d)f+=d[l].toString();return f};m.prototype.writeMainStyle=function(){var f="",d=[],c=new h.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height=
"12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding="0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(c);c=new h.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline=
"none";d.push(c);c=new h.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";d.push(c);c=new h.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=this.content;d.push(c);c=new h.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;d.push(c);c=new h.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;d.push(c);c=new h.ThemeClass("mainToolbar");c.style.background=this.toolpanel;d.push(c);
for(var l in d)f+=d[l].toString();return f};m.prototype.render=function(f){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};m.prototype.getSheet=function(f){f.navbar.value?(this.navbar=f.navbar.value,this.button=f.button.value,this.location=f.location.value,this.selection=f.selection.value,this.sidepanel=f.sidepanel.value,this.mainpanel=f.mainpanel.value,this.navtext=f.navtext.value,this.search=
f.search.value,this.content=f.content.value,this.toolpanel=f.toolpanel.value,this.bannerProgress=f.bannerProgress.value):(this.navbar=f.navbar,this.button=f.button,this.location=f.location,this.selection=f.selection,this.sidepanel=f.sidepanel,this.mainpanel=f.mainpanel,this.navtext=f.navtext,this.search=f.search,this.content=f.content,this.toolpanel=f.toolpanel,this.bannerProgress=f.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:m}});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(h,m,f,d){function c(){}function l(){this.styles=[];var b=new c;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";
b.separator="#333";b.bannerProgress="whitesmoke";this.styles.push(b);b=new c;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new c;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";
b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress=
"#F2F2F2";this.styles.push(b);b=new c;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";
b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function e(){return this.styles}c.prototype.name="Orion";c.prototype.navbar="#404648";c.prototype.button="#EFEFEF";c.prototype.location=
"#333";c.prototype.breadcrumb="#3087B3";c.prototype.separator="#333";c.prototype.selection="FEC";c.prototype.sidepanel="#FBFBFB";c.prototype.mainpanel="white";c.prototype.toolpanel="white";c.prototype.navtext="#bfbfbf";c.prototype.content="#3087B3";c.prototype.search="#444";c.prototype.bannerProgress="white";l.prototype.styles=[];l.prototype.getStyles=e;l.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:d}};
l.prototype.getViewData=function(){var b={top:10,left:10,width:350,height:350};b.shapes=[{type:"RECTANGLE",name:h["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:h["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:h["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:h["Tool Panel"],x:150,y:71,width:209,height:30,
family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:h["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:h.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:h["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:h.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},
{type:"TEXT",name:h.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:h.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:h["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:h.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:h["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:h["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:h["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:h["Line Color"],x1:150,
y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:h["Line Color"],x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:h["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:h["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++)b.shapes.push({type:"TEXT",name:h.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)b.shapes.push({type:"TEXT",name:h.Content,label:"Item",
x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)b.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"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};l.prototype.processSettings=function(b){var a=new f.ThemeSheetWriter;(new m.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:l,getStyles:e}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(h){function m(f,d,c){this.elements=c;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===d?(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),h.addAutoDismiss([this.container],this.destroy.bind(this))):f.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}m.prototype.elementNode=null;m.prototype.switchesContainer=null;m.prototype.switches=null;m.prototype.radioButtons=null;m.prototype.chosenSwitch=
null;m.prototype.addElement=function(f){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+f.image+'" id\x3d"'+f.label+'ImageNode" alt\x3d"'+f.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+f.label+'LabelNode" \x3e'+f.label+"\x3c/span\x3e\x3c/span\x3e";d.onmouseover=function(){document.getElementById(f.label+"ImageNode").src=f.secondaryImage;
document.getElementById(f.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};d.onmouseout=function(){document.getElementById(f.label+"ImageNode").src=f.image;document.getElementById(f.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var c=this;d.onclick=function(){c.showMedia(f)};this.elementNode.appendChild(d)};m.prototype.clearElements=function(){this.elementNode.innerHTML=""};m.prototype.showMedia=function(f){this.clearElements();this.addElement(f);
var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+f.media+'" alt\x3d"'+f.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);f=document.getElementById(f.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=f.parentNode;f.className="chosenCircle"};m.prototype.createSwitch=
function(f){var d;d=f?f.label+"switch":"indexSwitch";var c=document.createElement("span");c.className="workingSpan";c.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+d+'"\x3e\x3c/div\x3e';var h=this;c.onclick=f?function(){h.showMedia(f)}:function(){h.initialize();h.chosenSwitch.firstChild.className="circle";h.chosenSwitch=c;h.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(c);return this.radioButtons[this.radioButtons.length]=c};m.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};m.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return m});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(h,m,f,d){function c(){}var l=null;c.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 c=
document.body;this.$frameParent=c;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(c);b=b.createContextualFragment(this.CONTAINERTEMPLATE);c.appendChild(b);this.$frame=c.lastChild;this.title&&f.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=f.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(b){a.hide()},!1);this.$parent=f.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
c=b.createContextualFragment(this.TEMPLATE);this.messages&&f.processTextNodes(c,this.messages);this.$parent.appendChild(c);this.$buttonContainer=f.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===f.KEY.ESCAPE?a.hide():b.keyCode===f.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 c=this;this.buttons.forEach(function(b){var a=d.createButton(b.text,b.callback);b.id&&(a.id=b.id,c["$"+a.id]=a);b.isDefault&&(c._defaultCallback=b.callback,c._defaultButton=a);c.$buttonContainer.appendChild(a)})}},_makeModal:function(c){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!f.contains(b.$frame,a.target);if(c)for(var k=0;k<b.$$modalExclusions.length;k++)if(f.contains(b.$$modalExclusions[k],
a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),f.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);c=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var k=0;k<c.length;k++){for(var g=0;g<this.$$modalExclusions.length;g++)if(f.contains(this.$$modalExclusions[g],c[k])){a=!0;break}!a&&(c[k]!==b.$frame&&c[k].classList&&!c[k].classList.contains("tooltipContainer"))&&
(g=c[k],g.classList.contains("modalBackdrop")||(g.classList.add("modalBackdrop"),this._addedBackdrop.push(g)))}(c=f.lastTabbable(this.$buttonContainer)||f.lastTabbable(this.$parent))&&c.addEventListener("keydown",function(a){if(a.keyCode===f.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();f.stop(a)}},!1)},_addChildDialog:function(c){this.$$modalExclusions.push(c.$frame||c.$parent)},_inModalExclusion:function(c){return this.$$modalExclusions.some(function(b){return c.$frame===b||
c.$parent===b})},_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var a=c.childNodes[b];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(c){!c&&l===this&&(l=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");f.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},0)},show:function(c){if(this.modal)if(this._makeModal(),l){if(!l._inModalExclusion(this)){this.hide(!0);return}}else l=this;"function"===typeof this._beforeShowing&&this._beforeShowing();f.setFramesEnabled(!1);var b=f.bounds(this.$frame),a=f.bounds(document.documentElement),k;c?(k=f.bounds(c),c=k.top+k.height+4,k=k.left+4,c+b.height>a.height&&(c=Math.max(0,a.height-b.height-4)),k+b.width>a.width&&(k=Math.max(0,
a.width-b.width-4))):(k=Math.max(0,(a.width-b.width)/2),c=Math.max(0,(a.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=c+"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 f.firstTabbable(this.$parent)||this._defaultButton||f.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(l===this&&(l=null),f.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(c){c.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)}};c.prototype.constructor=c;return{Dialog:c}});
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(h,m,f,d,c,l,e){function b(a){this._displaySignOut=!0;this._init(a)}b.prototype={_init:function(a){this._dropdownNode=f.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 b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;
return b},_makeMenuItem:function(a,b){var c=e.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&c.classList.add(this._dropDownItemClass);c.addEventListener("click",b,!1);c.addEventListener("keydown",function(a){(a.keyCode===f.KEY.ENTER||a.keyCode===f.KEY.SPACE)&&b()},!1);return c},_renderAuthenticatedService:function(a,b){var c=this,d=this.authenticatedServices[a].authService;if(d&&d.logout&&this._displaySignOut){var e=this._makeMenuItem(h["Sign Out"],
function(){d.logout().then(function(){c.addUserItem(a,d,c.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;0<=b;b--){var k=localStorage.key(b);k&&0===k.indexOf("/orion/preferences/user")&&localStorage.removeItem(k)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(e.parentNode)}},renderServices:function(){function a(a){c[a]||(c[a]=b.createDocumentFragment());return c[a]}
var b=document,c=[],n=this._serviceRegistry;d.getPageLinksInfo(n,"orion.page.link.user").then(function(d){this._dropdown?this._dropdown.empty():this._dropdownNode&&f.empty(this._dropdownNode);d.getAllLinks().forEach(function(c){var g,d;if(c.category&&(d=/user\.(\d+)/.exec(c.category)))g=parseInt(d[1],10);if("number"!==typeof g||isNaN(g))g=1;g=a(g);d=b.createElement("li");var e=b.createElement("a");e.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&e.classList.add(this._dropDownItemClass):
e.classList.add("dropdownMenuItem");e.href=c.href;e.textContent=c.textContent;d.appendChild(e);g.appendChild(d);e.addEventListener("keydown",function(a){(a.keyCode===f.KEY.ENTER||a.keyCode===f.KEY.SPACE)&&e.click()},!1)}.bind(this));this.keyAssistFunction&&(d=this._makeMenuItem(h["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem"),d=d.parentNode,a(0).appendChild(d));
if(d=n.getServiceReferences("orion.page.getstarted")[0])d=d.getProperty("data"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)).parentNode,a(0).appendChild(d);var l=this;c.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<c.length-1&&!this._noSeparator){var k=e.createSeparator();a.appendChild(k)}l._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 c(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,c,d){d?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:c,data:d}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:c,pending:this.unauthenticatedServices[a].pending}:
{authService:b,label:c});this.renderServices()}};b.prototype.constructor=b;return{UserMenu:b}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(h,m,f,d,c,l){function e(a,b,c){var d="";c&&(d="^");if(d=f.parse("/"+d+a.searchStr+"/"))c=d.pattern,d=d.flags,-1===d.indexOf("i")&&!b.caseSensitive&&(d+="i"),a.regExp={pattern:c,flags:d},a.wildCard=!0}var b={ALL_FILE_TYPE:"*.*",doSearch:function(a,c,g,d){a?(c=g,g=!0,"*"===c&&(c=""),""===c&&(g=d&&d.type!==b.ALL_FILE_TYPE),g&&(a=a.createSearchParams(c,!1,
!1,d),a=b.generateSearchHref(a),window.location=a)):window.alert(h["Can't search: no search service is available"])},generateSearchHelper:function(a,c){var g=a.keyword,d=g,f={};a.fileType&&(a.fileType!==b.ALL_FILE_TYPE&&""===g)&&(d="*."+a.fileType);if(a.regEx)f.searchStr=g,e(f,a,c);else{var h=-1<g.indexOf("*"),l=-1<g.indexOf("?");h&&(g=g.split("*").join(".*"));l&&(g=g.split("?").join("."));!h&&!l&&!a.nameSearch?(f.searchStr=a.caseSensitive?g.split("\\").join(""):g.split("\\").join("").toLowerCase(),
f.wildCard=!1):(f.searchStr=a.caseSensitive?g:g.toLowerCase(),e(f,a,c),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:a,inFileQuery:f,displayedSearchTerm:d}},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=b.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var b=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,""),b=a.split("/"));return b},copySearchParams:function(a,b){var c={},d;for(d in a)if(void 0!==a[d]&&null!==a[d]&&(b||"replace"!==d))c[d]=a[d];return c},
generateSearchHref:function(a){var c=m.toUrl("search/search.html");a=b.copySearchParams(a,!0);var g=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new l(c+"#{,resource,params*}")).expand({resource:g,params:a}):(new l(c+"#{,resource}")).expand({resource:g})},generateFindURLBinding:function(a,b,c,d,e){a={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof d?d:void 0,atLine:"number"===typeof c?c:void 0};return e?a:","+
(new l("{,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,b,c){return a.replace(RegExp(b.pattern,b.flags),c)},replaceStringLiteral:function(a,c,g){c=f.parse("/"+c+"/gim");return b.replaceRegEx(a,c,g)},searchOnelineLiteral:function(a,b,c){var d;
d=0;for(var e=!1,f=[];!(d=b.indexOf(a.searchStr,d),0>d);){f.push({startIndex:d,length:a.searchStrLength});e=!0;if(c)break;d+=a.searchStrLength}return e?f:null},findRegExp:function(a,b,c,d){if(!b)return null;c=c||"";c+=(-1===c.indexOf("g")?"g":"")+(-1===c.indexOf("m")?"m":"");var e=null;return(e=RegExp(b,c).exec(a.substring(d)))&&{startIndex:e.index+d,length:e[0].length}},searchOnelineRegEx:function(a,c,d){for(var e=0,f=!1,h=[];;)if(e=b.findRegExp(c,a.regExp.pattern,a.regExp.flags,e)){h.push(e);f=
!0;if(d)break;e=e.startIndex+e.length}else break;return f?h:null},generateNewContents:function(a,c,d,e,f,h){if(e&&c){a||(d.contents=[]);for(var l=0;l<c.length;l++){for(var m=c[l],q=!1,t=!1,v=[],x,C=0,A=0;A<e.children.length;A++)if(e.children[A].lineNumber-1===l){C=A;for(q=0;q<e.children[A].matches.length;q++)!1!==e.children[A+q].checked&&v.push(q);t=0<v.length;x=e.children[A].matches;q=!0;break}if(q){if(t){v=b.replaceCheckedMatches(m,f,x,v,h);m=v.replacedStr;for(q=0;q<e.children[C].matches.length;q++)e.children[C+
q].newMatches=v.newMatches}else for(q=0;q<e.children[C].matches.length;q++)e.children[C+q].newMatches=e.children[C+q].matches;a?d.contents[l]=m:d.contents.push(m)}else a||d.contents.push(m)}}},generateMatchContext:function(a,b,c){var d=[],e=2*a+1,f;b.length<=e?(f=0,a=b.length-1):(f=c-a,0>f?(f=0,a=f+e-1):(a=c+a,a>b.length-1&&(a=b.length-1,f=a-e+1)));for(e=f;e<=a;e++)d.push({context:b[e],current:e===c});return d},splitFile:function(a){for(var b=0,c=0,d=0,e=0,f=[];;){-1!==b&&b<=d&&(b=a.indexOf("\r",
d));-1!==c&&c<=d&&(c=a.indexOf("\n",d));if(-1===c&&-1===b){f.push(a.substring(e));break}var h=1;-1!==b&&-1!==c?b+1===c?(h=2,d=c+1):d=(b<c?b:c)+1:d=-1!==b?b+1:c+1;f.push(a.substring(e,d-h));e=d}return f},searchWithinFile:function(a,c,d,e,f,h){d=b.splitFile(d);f&&(c.contents=d);if(c){c.children=[];for(var l=e=0;l<d.length;l++){var m=d[l];if(m&&0<m.length){var q=h?m:m.toLowerCase();if(q=a.wildCard?b.searchOnelineRegEx(a,q):b.searchOnelineLiteral(a,q)){var t,v=l+1;if(f)for(var x=0;x<q.length;x++)t=x+
1,t={parent:c,checked:c.checked,type:"detail",matches:q,lineNumber:v,matchNumber:t,name:m,location:c.location+"-"+v+"-"+t},c.children.push(t);else t={parent:c,context:b.generateMatchContext(2,d,l),checked:c.checked,type:"detail",matches:q,lineNumber:v,name:m,location:c.location+"-"+v},c.children.push(t);e+=q.length}}}c.totalMatches=e}},replaceCheckedMatches:function(a,b,c,d,e){for(var f=0,h="",l=[],q=0;q<c.length;q++){f!==c[q].startIndex&&(h+=a.substring(f,c[q].startIndex));c[q].length&&(e=c[q].length);
for(var f=!1,m=0;m<d.length;m++)if(d[m]===q){f=!0;break}f?(l.push({startIndex:h.length,length:b.length}),h+=b):(l.push({startIndex:h.length,length:e}),h+=a.substring(c[q].startIndex,c[q].startIndex+e));f=c[q].startIndex+e}f<a.length&&(h+=a.substring(f));return{replacedStr:h,newMatches:l}},fullPathNameByMeta:function(a){var b=a.length,c="";if(0<b)for(b-=1;-1<b;b--)c=c+(""===c?"":"/")+a[b].Name;return c},path2FolderName:function(a,b,c){return a.substring(0,a.length-b.length-(c?0:1))},getOpenSearchPref:function(a,
b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:b})})}};return b});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(h,m,f,d,c,l){function e(b,a,c,e){this.registry=b;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=c;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(c);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))}e.prototype.search=function(b){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var b=this;this._visitRecursively(this._childrenLocation).then(function(){(!b._cancelled||b._reportOnCancel)&&b._reportResult();b._cancelled&&b._HandleStatus({name:"Cancel"})}.bind(b),function(a){b._reportResult();b._HandleStatus(a)}.bind(b))}.bind(this))};e.prototype.searchName=function(b,a){b&&(this._searchParams=
b,this.searchHelper=d.generateSearchHelper(b,!0));a&&(this.onSearchNameComplete=a);var c=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var e=0;e<this.fileSkeleton.length;e++){var n=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,n,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,n,!0))if(c.push(this.fileSkeleton[e]),c.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:c.length,
docs:c}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};e.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var c=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var d=this;b();c.getContentTypes().then(function(b){d.contentTypesCache=b;d._visitRecursively(d._childrenLocation).then(function(){d._buildingSkeleton=!1;a();d.searchHelper&&!d._buildSkeletonOnly&&d.searchName()})})};e.prototype._sort=function(b){b.sort(function(a,
b){var c,e;if("Path asc"===this._searchParams.sort){c=a.Location&&a.Location.toLowerCase();c=d.path2FolderName(c,a.Name&&a.Name.toLowerCase(),!0);e=b.Location&&b.Location.toLowerCase();e=d.path2FolderName(e,b.Name&&b.Name.toLowerCase(),!0);if(c<e)return-1;if(c>e)return 1}return this._sortOnNameSingle(a,b)}.bind(this))};e.prototype._HandleStatus=function(b){this._statusService&&"Cancel"===b.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:h["Search cancelled by user"],
Severity:"Warning"}))};e.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};e.prototype._sortOnNameSingle=function(b,a){var c=b.Name&&b.Name.toLowerCase(),d=a.Name&&a.Name.toLowerCase();return c<d?-1:c>d?1:0};e.prototype._fileNameMatches=function(b){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return b.match(a)}));return a};e.prototype._visitRecursively=function(b){var a=[],d=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(d._progressService?this._progressService.progress(d.fileClient.fetchChildren(b),"Crawling search for children of "+b):d.fileClient.fetchChildren(b)).then(function(b){for(var e=0;e<b.length;e++)if(void 0!==b[e].Directory&&!1===b[e].Directory)if(d._searchOnName)a.push(d._buildSingleSkeleton(b[e]));else if(d._buildSkeletonOnly)a.push(d._buildSingleSkeleton(b[e]));
else{if(!d._cancelled){var f=c.getFilenameContentType(b[e].Name,d.contentTypesCache);if(f&&("text/plain"===f["extends"]||"text/plain"===f.id)&&d._fileNameMatches(b[e].Name))f=d._sniffSearch(b[e]),a.push(f),d._deferredArray.push(f)}}else if(b[e].Location)if(d._cancelled)break;else f=d._visitRecursively(b[e].ChildrenLocation),a.push(f),d._deferredArray.push(f);return l.all(a)})};e.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
d.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};e.prototype._reportSingleHit=function(b){this._cancelled||(b.LastModified=b.LocalTimeStamp,this.fileLocations.push(b),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};e.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};
e.prototype._sniffSearch=function(b){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:f.formatMessage(h["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(b.Location),"Reading file "+b.Location):a.fileClient.read(b.Location)).then(function(c){a._hitOnceWithinFile(c)&&
a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:f.formatMessage(h["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},h.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};e.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();b=new l;b.resolve(this._totalCounter);
return b};e.prototype.constructor=e;return{SearchCrawler:e}});
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(h,m,f,d,c,l,e){function b(a){this._init(a)}b.prototype=new e.Dialog;b.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"'+d.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';b.prototype._init=function(a){this.title=a.title||h["Find File Named"];this.modal=!0;this.messages=h;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new f.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(h["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(h["Missing required argument: searchRenderer"]);this._initialize()};b.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",h["FileName FolderName"]):this.$fileName.setAttribute("placeholder",h.Search);this.$fileName.addEventListener("input",function(a){b._time=+new Date;b._timeoutId&&clearTimeout(b._timeoutId);b._timeoutId=setTimeout(b.checkSearch.bind(b),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var d=c.$("a",b.$results);d&&(c.stop(a),(l.isMac?a.metaKey:a.ctrlKey)?window.open(d.href):(window.location.href=d.href,b.hide()))}},!1);a.addEventListener("keydown",function(a){var d,e,f;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)d=c.$$array("a",b.$results),e=document.activeElement,f=d.indexOf(e),a.keyCode===c.KEY.DOWN?0<=f?(e.classList.remove("treeIterationCursor"),d=f<d.length-1?d[f+1]:d[0],d.focus(),
d.classList.add("treeIterationCursor")):0<d.length&&(d=d[0],d.focus(),d.classList.add("treeIterationCursor")):0<=f?(e.classList.remove("treeIterationCursor"),e=b.$fileName,d=0<f?d[f-1]:e,d.focus(),0<f&&d.classList.add("treeIterationCursor")):0<d.length&&(d[d.length-1].focus(),d[d.length-1].classList.add("treeIterationCursor")),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new m.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(h["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};b.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)};b.prototype._detectFolderKeyword=function(a){var b,c=a,d=null;if(this._nameSearch&&(b=/(\S+)\s*(.*)/,(a=b.exec(a))&&3===a.length))a[1]&&
(c=a[1]),a[2]&&(d=a[2]);return{keyword:c,folderKeyword:d}};b.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._detectFolderKeyword(a),d=this._searcher.createSearchParams(b.keyword,this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?h["Searching..."]:l.formatMessage(h["Searching for occurrences of"],
a)));c.empty(this.$results);this.$results.appendChild(f);this._searcher.search(d,b.folderKeyword,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};b.prototype.decorateResult=function(a){function b(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&d.hide()}var d=this;a=c.$$array("a",a);for(var e=0;e<a.length;e++)a[e].addEventListener("click",b,!1)};b.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};b.prototype._afterHiding=function(){this._onHide&&this._onHide()};
b.prototype.constructor=b;return{OpenResourceDialog:b}});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(h,m){function f(d,c,f){if(d=m.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=f=f||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=f.selectionClass;d=document.createElement("div");d.classList.add("dropdownMenu");d.classList.add("dropdownMenuOpen");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=
d;if(c=m.node(c))this._triggerNode=c;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");f.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(c){c.keyCode===m.KEY.ESCAPE&&this.clearPanel()}.bind(this))}h.mixin(f.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){m.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=m.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",m.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(d){this._dropdownMenu.innerHTML=d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,c){c()},_positionDropdown:function(){this._dropdownMenu.style.right="";var d=m.bounds(this._dropdownMenu),c=m.bounds(document.body);d.left+d.width>c.left+c.width&&(d=m.bounds(this._boundingNode(this._triggerNode)),c=m.bounds(this._triggerNode),this._dropdownMenu.style.right=d.width-(c.left-d.left+c.width)+"px")},_boundingNode:function(d){var c=window.getComputedStyle(d,
null);return null===c||"absolute"===c.getPropertyValue("position")||!d.parentNode||d===document.body?d:this._boundingNode(d.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&&(m.setFramesEnabled(!0),m.empty(this._parent),this._parent=this.select=null)}});return f});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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(h,m,f){function d(c,b,a){if(!c[b])throw b+h[" is not supported in this file system"];return c[b].apply(c,a)}function c(e,b,a,k){if(!e.readBlob)throw h["source file service does not support binary read"];if(!a.writeBlob)throw h["target file service does not support binary write"];if("/"!==b[b.length-1])return d(e,"readBlob",[b]).then(function(b){return d(a,"writeBlob",[k,b])});var g=k.substring(0,
k.length-1),n=decodeURIComponent(g.substring(g.lastIndexOf("/")+1)),g=g.substring(0,g.lastIndexOf("/")+1);return d(a,"createFolder",[g,n]).then(function(){},function(){}).then(function(){return d(e,"fetchChildren",[b]).then(function(b){for(var d=[],g=0;g<b.length;++g){var n=b[g].Location,f=n;b[g].Directory&&(f=n.substring(0,n.length-1));f=decodeURIComponent(f.substring(f.lastIndexOf("/")+1));f=k+encodeURIComponent(f);b[g].Directory&&(f+="/");d[g]=c(e,n,a,f)}return m.all(d)})})}function l(c,b){function a(a){var b=
new m;b.reject(h["No Matching FileService for location:"]+a);return b}var d=c.getServiceReferences("orion.core.file"),g=d;if(b)for(var g=[],n=0;n<d.length;++n)b(d[n])&&g.push(d[n]);for(var l=[],u=[],r=[],s=[],q={fetchChildren:function(){var a=new m;a.resolve(s);return a},createWorkspace:function(){var a=new m;a.reject(h["no file service"]);return a},loadWorkspaces:function(){var a=new m;a.reject(h["no file service"]);return a},loadWorkspace:function(a){var b=new m;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:h["File Servers"],Location:"/",Children:s,ChildrenLocation:"/"})},100);return b},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},d=0;d<g.length;++d)s[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:g[d].getProperty("top"),ChildrenLocation:g[d].getProperty("top"),Name:g[d].getProperty("Name")},n=g[d].getProperty("pattern")||g[d].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==n[0]&&(n=
"^"+n),l[d]=RegExp(n),u[d]=c.getService(g[d]),r[d]=g[d].getProperty("Name"),g[d].getProperty("NameKey")&&g[d].getProperty("nls")&&f.getMessageBundle(g[d].getProperty("nls")).then(function(a,b){s[a].Name=b[g[a].getProperty("NameKey")];r[a]=b[g[a].getProperty("NameKey")]}.bind(this,d));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return u[0]?0:-1;for(var b=0;b<l.length;++b)if(l[b].test(a))return b;throw h["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?q:u[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?q.Name:r[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?q.Location:s[a].Location}}l.prototype={getService:function(c){return this._getService(c)},fileServiceName:function(c){return this._getServiceName(c)},fileServiceRootURL:function(c){return this._getServiceRootURL(c)},fetchChildren:function(c){return d(this._getService(c),"fetchChildren",
arguments)},createWorkspace:function(c){return d(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(c){return d(this._getService(c),"loadWorkspace",arguments)},createProject:function(c,b,a,k){return d(this._getService(c),"createProject",arguments)},createFolder:function(c,b){return d(this._getService(c),"createFolder",arguments)},createFile:function(c,b){return d(this._getService(c),"createFile",
arguments)},deleteFile:function(c){return d(this._getService(c),"deleteFile",arguments)},moveFile:function(e,b,a){var k=this._getService(e),g=this._getService(b);if(k===g)return d(k,"moveFile",arguments);var n="/"===e[e.length-1],f=b;"/"!==f[f.length-1]&&(f+="/");if(a)f+=encodeURIComponent(a);else{var h=e;n&&(h=h.substring(0,h.length-1));f+=h.substring(h.lastIndexOf("/")+1)}n&&"/"!==f[f.length-1]&&(f+="/");return c(k,e,g,f).then(function(){return d(k,"deleteFile",[e])})},copyFile:function(e,b,a){var k=
this._getService(e),g=this._getService(b);if(k===g)return d(k,"copyFile",arguments);var n="/"===e[e.length-1],f=b;"/"!==f[f.length-1]&&(f+="/");if(a)f+=encodeURIComponent(a);else{var h=e;n&&(h=h.substring(0,h.length-1));f+=h.substring(h.lastIndexOf("/")+1)}n&&"/"!==f[f.length-1]&&(f+="/");return c(k,e,g,f)},read:function(c,b){return d(this._getService(c),"read",arguments)},readBlob:function(c){return d(this._getService(c),"readBlob",arguments)},write:function(c,b,a){return d(this._getService(c),"write",
arguments)},remoteImport:function(c,b){return d(this._getService(c),"remoteImport",arguments)},remoteExport:function(c,b){return d(this._getService(c),"remoteExport",arguments)},search:function(c){return d(this._getService(c.resource),"search",arguments)}};l.prototype.constructor=l;return{FileClient:l}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(h,m){function f(f,e){this._parentNode=h.node(f);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=h.node(e);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(d)||c;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var d="sideMenuNavigation",c="open";f.prototype=
{constructor:f.prototype.constructor,setCategories:function(c){this._categoryInfos=c.getCategoryIDs().map(function(d){return c.getCategory(d)}).sort(function(c,b){var a=c.order||100,d=b.order||100;return a<d?-1:d<a?1:c.textContent.localeCompare(b.textContent)})},setPageLinks:function(c){this._categorizedPageLinks={};c.getAllLinks().forEach(function(c){var b=c.category;this._categorizedPageLinks[b]=this._categorizedPageLinks[b]||[];this._categorizedPageLinks[b].push({title:c.textContent,order:c.order||
100,href:c.href})},this)},setRelatedLinks:function(c,d){this._categorizedRelatedLinks={};c.forEach(function(b){var a=b.relatedLink,c=b.command;b=b.invocation;if(!d||-1===d.indexOf(a.id)){var g=a.category;this._categorizedRelatedLinks[g]=this._categorizedRelatedLinks[g]||[];this._categorizedRelatedLinks[g].push({title:c.name,order:a.order||100,href:c.hrefCallback.call(b.handler,b)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var c=new URL(window.location.href);this._currentCategory=c.hash="";Object.keys(this._categorizedPageLinks).some(function(b){if(this._categorizedPageLinks[b].some(function(a){var b=new URL(a.href);a.hash="";return c.href===b.href}))return this._currentCategory=b,!0},this);var d=document.createElement("ul");d.classList.add("sideMenuList");this._categoryInfos.forEach(function(b){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
b.id&&a.classList.add("sideMenuItemActive");a.categoryId=b.id;a.categoryName=b.textContent||b.id;var c=document.createElement("a");c.classList.add("submenu-trigger");if("string"===typeof b.imageDataURI&&0===b.imageDataURI.indexOf("data:image")){var g=document.createElement("img");g.width="16";g.height="16";g.src=b.imageDataURI;c.appendChild(g)}else c.classList.add(b.imageClass||"core-sprite-blank-menu-item");a.appendChild(c);d.appendChild(a);this._categorizedAnchors[b.id]=c},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(d);this._show=f.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(d,"closed");this._contentNode.style.left="0"},toggle:function(){var f=this._contentNode;f&&f.classList.add("content-fixedHeight-animation");this._state="open"===this._state?"closed":"open";this._state===c?localStorage.removeItem(d):localStorage.setItem(d,this._state);this.render()},
_updateCategoryAnchors:function(){var c=[];Object.keys(this._categorizedRelatedLinks).forEach(function(d){("git"===d||d.match(/-scm$/))&&c.push(d)});Object.keys(this._categorizedAnchors).forEach(function(d){var b=this._categorizedAnchors[d],a=[];d===this._currentCategory?(b.parentElement.style.display="",b.href="",b.onclick=function(){return!1},b.title=b.parentElement.categoryName):(this._categorizedPageLinks[d]&&a.push.apply(a,this._categorizedPageLinks[d]),this._categorizedRelatedLinks[d]&&a.push.apply(a,
this._categorizedRelatedLinks[d]),0===a.length||0!==c.length&&("git"===d||d.match(/-scm$/))&&-1===c.indexOf(d)?(b.href="",b.title=b.parentElement.categoryName,b.parentElement.style.display="none"):(b.parentElement.style.display="",a.sort(function(a,b){return a.order<b.order?-1:b.order<a.order?1:a.title.localeCompare(b.title)}),d=a.shift(),b.href=d.href,b.title=d.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var c=m.matchResourceParameters().resource,d=(new URL(c,window.location.href)).href;this._categoryInfos.forEach(function(b){if(b.service&&b.service.getNotifications){var a=this._categorizedAnchors[b.id].parentElement;b.service.getNotifications(d).then(function(b){if(c===m.matchResourceParameters().resource){var d="";b.forEach(function(a){"info"===a.level&&!d?d="info":"warn"===a.level&&(!d||"info"===d)?d="warn":"error"===a.level&&"error"!==d&&(d="error")});d?a.setAttribute("level",d):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return f});
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(h,
m,f,d,c,l,e,b,a,k,g,n,p,u,r,s,q,t,v,x,C,A,B,w,K,H,F,y,D,z,G,E,I,S,J){function R(a,b){if(a.getLabel)return a.getLabel();var c=new B;c.resolve(b.properties.name);return c}function U(a){p.node("progressPane").setAttribute("aria-label",h["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function P(a,b){var c=a.getServiceReferences("orion.core.auth");aa=[];var d=M.createMenuGenerator.apply(this,arguments);if(d)for(var e=0;e<
c.length;e++){var k=c[e],g=a.getService(k);R(g,k).then(function(a){g.getKey().then(function(b){aa.push(b);g.getUser().then(function(c){d.addUserItem(b,g,a,c)},function(c,e){d.addUserItem(b,g,a,e)});window.addEventListener("storage",function(c){$[b]!==localStorage.getItem(b)&&($[b]=localStorage.getItem(b),g.getUser().then(function(c){d.addUserItem(b,g,a,c)},function(c){d.addUserItem(b,g,a)}))},!1)})})}}function N(a){return a}function O(b,c,d,g,k){function n(){if(r)return r;var a=b.getService("orion.core.contentTypeRegistry");
a||(a=new q.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return r=a})}function f(a){for(var b={},c=a.getPropertyKeys(),d,e=0;e<c.length;e++)d=c[e],b[d]=a.getProperty(d);return b}function h(a,b){var c=null;a.some(function(a){return b===a.getProperty("id")?!!(c=a):!1});return c}function l(a){var b=a.command;return!b.visibleWhen||b.visibleWhen(c)?(a.invocation=new e.CommandInvocation(c,c,null,b,g),(new B).resolve(a)):"function"===
typeof k?(u||(u=k()),B.when(u,function(d){if(d&&c===ba&&(!b.visibleWhen||b.visibleWhen(d)))return a.invocation=new e.CommandInvocation(d,d,null,b,g),a})):(new B).resolve()}function p(a,b,c){return c?(new B).resolve({relatedLink:a,command:c}):b.then(function(b){return{relatedLink:a,command:new e.Command(b)}})}var m=arguments,r,u,s=b&&b.getServiceReferences("orion.page.link.related");if(s&&0!==s.length){var t=this;B.when(n(),function(){if(M.beforeGenerateRelatedLinks.apply(t,m)){var c=b.getServiceReferences("orion.navigate.command"),
e=[];s.forEach(function(d){var k=f(d);if(k.id){var n;if((k.nls&&k.nameKey||k.name)&&k.uriTemplate)n=a._createCommandOptions(k,d,b,r,!0),e.push(p(k,n,null));else if(n=h(c,k.id)){var l=f(n);d={};J.mixin(d,l,k);(k=g.findCommand(k.id))?e.push(p(d,null,k)):(n=a._createCommandOptions(l,n,b,r,!0),e.push(p(d,n,null)))}}});B.all(e,N).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return B.all(a.map(l),N).then(function(b){var c=[];b=b.filter(function(b,d){if(b)return!0;
c.push(a[d]);return!1});M.addRelatedLinkCommands.call(t,g,b,c,d);M.afterGenerateRelatedLinks.apply(t,m)})})}})}}function X(a){var b=p.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function Q(a){var b=window.getComputedStyle(a,null);return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:Q(a.parentNode)}function Y(a){var b={},c=null;"string"===typeof a&&(a=p.node(a));a||(a=p.node("pageActions"));for(var d=a;d&&d.classList;){if(d.classList.contains("toolComposite")){c=
d;break}d=d.parentNode}a.classList.contains("commandMarker")&&(b.commandNode=a);c||(c=p.node("pageToolbar"));c&&(b.slideContainer=p.$(".slideParameters",c),b.parameterArea=p.$(".parameters",c),b.dismissArea=p.$(".parametersDismiss",c),b.notifications=p.$("#notificationArea",c),c.parentNode&&(b.toolbarTarget=p.$(".toolbarTarget",c.parentNode),b.toolbarTarget&&(a=p.bounds(b.toolbarTarget),d=p.bounds(Q(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-d.top,b.toolbar=c)));return b}function Z(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var b=p.bounds(a),c=p.bounds(a.parentNode);a.style.left=(c.width-b.width)/2+"px";a.style.top="0"}}l=function(a){var b=document.createElement("a");b.href=a;return b.href}(m.toUrl("auth/NotifyAuthentication.html"));var $={},M={createMenuGenerator:E.createMenuGenerator||function(a,b){if(p.node("userMenu")){var c=p.node("userDropdown"),d=new r.Dropdown({dropdown:c}),c=new w.UserMenu({dropdownNode:c,dropdown:d,
serviceRegistry:a}),d=p.node("userTrigger");new s.Tooltip({node:d,text:h.Options,position:["below","left"]});var d=document.getElementById("userTrigger"),e=d.className;d.className=e+" imageSprite core-sprite-silhouette";c.setKeyAssist(b);return c}},beforeGenerateRelatedLinks:E.beforeGenerateRelatedLinks||function(a,b,c,d,e){return!0},addRelatedLinkCommands:E.addRelatedLinkCommands||function(a,b,c,d){this.sideMenu&&this.sideMenu.setRelatedLinks(b,d)},afterGenerateRelatedLinks:E.afterGenerateRelatedLinks||
function(a,b,c,d,e){},afterSetPageTarget:E.afterSetPageTarget||function(a){},generateNavigationMenu:E.generateNavigationMenu||function(a,b,c,d,e,k,g){if(a=p.node("sideMenu"))b=p.node("centralNavigation"),new s.Tooltip({node:b,text:h.CentralNavTooltip,position:["right"]}),this.sideMenu=new S(a,p.node("pageContent")),b.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=p.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:E.afterGenerateNavigationMenu||
function(a,b,c,d,e,k,g){},afterGenerateBanner:E.afterGenerateBanner||function(a,b,c,d,e,k,g){}},aa=[],ba,W=[],L,V=null,T=null,ca=new c;return{generateBanner:function(a,c,k,g,n,l,q,r){function s(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var b=p.$$array(".targetSelector"),c=0;c<b.length;c++)b[c].target=a}},{pid:"nav.config"})}(new C.ThemePreferences(g,new A.ThemeData)).apply();var t=p.node(a);
if(!t)throw h["could not find banner parent, id was "]+a;var x=document.createRange();x.selectNode(t);x=x.createContextualFragment(F);p.processTextNodes(x,h);t.firstChild?t.insertBefore(x,t.firstChild):t.appendChild(x);t=p.node("home");t.href=m.toUrl("edit/edit.html");t.setAttribute("aria-label",h["Orion Home"]);p.node("progressPane").src=e.NO_IMAGE;if(t=p.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=D+f.slideoutHTMLFragment("mainToolbar");(t=p.node("closeNotifications"))&&t.setAttribute("aria-label",
h["Close notification"]);if(17>=G.isFirefox&&(t=p.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=p.node("footer"))t.innerHTML=y,p.processTextNodes(t,h);k.setParameterCollector(new b.CommandParameterCollector(Y,Z));document.addEventListener("keydown",function(a){a.keyCode===p.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&a.setProgressMessage("")},!1);M.generateNavigationMenu.apply(this,arguments);M.afterGenerateNavigationMenu.apply(this,arguments);t=K.getCategoriesInfo(c);
x=K.getPageLinksInfo(c,"orion.page.link");B.all([t,x]).then(function(a){if(this.sideMenu){var b=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(b);this.sideMenu.render()}}.bind(this));if(t=p.$(".split")){var x=p.$(".sidePanelLayout"),w=p.$(".mainPanelLayout");x&&w&&(V={side:x,main:w},V.splitter=new u.Splitter({node:t,sidePanel:x,mainPanel:w,toggle:!0,closeByDefault:r}),t=new e.Command({name:h["Toggle side panel"],tooltip:h["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){V.splitter.toggleSidePanel()}}),k.addCommand(t),k.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1)))}var z=!1,E=function(a,b){if(!z){var c=b.getService("orion.page.progress"),d=new H.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,onHide:function(){z=!1}});window.setTimeout(function(){z=!0;d.show()},0)}},t=new e.Command({name:h["Find File Named..."],tooltip:h["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){E(n,c)}});k.addCommand(t);k.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));var R=!1,t=function(){if(R)return!1;var a=p.node("banner"),b=p.node("footer"),c=p.node("sideMenu"),d=p.$(".content-fixedHeight"),e="hidden"===a.style.visibility;e?(a.style.visibility="visible",b.style.visibility="visible",d.classList.remove("content-fixedHeight-maximized"),c&&c.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",d.classList.add("content-fixedHeight-maximized"),c&&c.classList.add("sideMenu-maximized"));ca.dispatchEvent({type:"toggleTrim",maximized:!e});return!0};window.orionNoTrim?(t(),R=!0,this.sideMenu.hide()):(t=new e.Command({name:h["Toggle banner and footer"],tooltip:h["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:t}),k.addCommand(t),k.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0)));
t=new e.Command({name:h["System Configuration Details"],tooltip:h["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return m.toUrl("help/about.html")}});k.addCommand(t);k.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));t=new e.Command({name:h["Background Operations"],tooltip:h["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return m.toUrl("operations/list.html")}});k.addCommand(t);
k.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));T=new v.KeyAssistPanel({commandRegistry:k});t=new e.Command({name:h["Show Keys"],tooltip:h["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){T.isVisible()?T.hide():T.show();return!0}});k.addCommand(t);k.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));X(k);P(c,t.callback);U(c);window.addEventListener("hashchange",
function(){k.processURL(window.location.href)},!1);window.setTimeout(function(){s(c)},0);M.afterGenerateBanner.apply(this,arguments)},getToolbarElements:Y,getMainSplitter:function(){return V},getKeyAssist:function(){return T},getGlobalEventTarget:function(){return ca},layoutToolbarElements:Z,setPageTarget:function(a){var b,c,d=a.breadcrumbRootName,e=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(c=(d?d+" ":"")+a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,ba=a.target,O.call(this,e,a.target,W,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,O.call(this,e,{NoTarget:""},W,a.commandService,a.makeAlternate));(L=a.title)||(L=b?b+" - "+a.task:a.task);window.document.title=L;M.afterSetPageTarget.apply(this,arguments);if(b=a.breadCrumbContainer?p.node(a.breadCrumbContainer):p.node("location"))if(p.empty(b),a.staticBreadcrumb)new n.BreadCrumbs({container:b,
rootSegmentName:d});else{var k=e&&new I.FileClient(e),e=a.breadcrumbTarget||a.target,k=k&&e&&e.Location?k.fileServiceRootURL(e.Location):null;new n.BreadCrumbs({container:b,resource:e,rootSegmentName:d,workspaceRootSegmentName:c,workspaceRootURL:k,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){L&&("*"===L.charAt(0)&&!a&&(L=L.substring(1)),a&&"*"!==L.charAt(0)&&(L="*"+L),window.document.title=L);var b=p.node("dirty");b&&(b.textContent=a?"*":"")},
setPageCommandExclusions:function(a){W=a},notifyAuthenticationSite:l}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(h){return{detectValidURL:function(m){for(var f=/\[([^\]]*)\]\(([^\)]+)\)/g,d=f.exec(m),c=[],l=0;d;){if(3===d.length&&0<d[2].length){var e=new URL(d[2]);":"!==e.protocol&&h.validateURLScheme(e.href)&&(d.index>l&&c.push({segmentStr:m.substring(l,d.index)}),c.push({segmentStr:0<d[1].length?d[1]:d[2],urlStr:d[2]}),l=d.index+d[0].length)}d=f.exec(m)}if(0===l)return null;l<m.length&&c.push({segmentStr:m.substring(l)});return c},processURLSegments:function(h,
f){f.forEach(function(d){if(d.urlStr){var c=document.createElement("a");c.href=d.urlStr;c.appendChild(document.createTextNode(d.segmentStr))}else c=document.createElement("span"),c.textContent=d.segmentStr;h.appendChild(c)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(h,m,f,d){function c(c,b,a,d,g){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=g;this.domId=a;this.progressDomId=d||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var l;c.prototype={_init:function(){var c=m.node("closeNotifications");if(c&&
!this._hookedClose){c.style.cursor="pointer";this._hookedClose=!0;var b=m.node(this.notificationContainerDomId);m.addAutoDismiss([b],function(){this._clickToDisMiss&&this.close()}.bind(this));c.addEventListener("click",function(){this.close()}.bind(this));b.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=m.$$("a",b))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var c=m.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&c?(c.innerHTML="",c.classList.remove("cancelButton"),c.classList.add("dismissButton"),c.classList.add("core-sprite-close"),c.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=f.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(c,b,a){this._init();this.currentMessage=c;var d=m.node(this.domId);
if("boolean"===typeof a){var g=d.getAttribute("aria-live");d.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){c===this.currentMessage&&(m.empty(d),d.appendChild(document.createTextNode(c)),window.setTimeout(function(){d.setAttribute("aria-live",g)},100))}.bind(this),100)}else m.empty(d),d.appendChild(document.createTextNode(c));"number"===typeof b&&window.setTimeout(function(){c===this.currentMessage&&(m.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(c){this._clickToDisMiss=
!0;this.currentMessage=c;this._init();var b=c.responseText||c.message||c;if("string"===typeof b)try{b=JSON.parse(b)}catch(a){}c=b.Message||b;var d="red";if(b.Severity)switch(b.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}b=document.createElement("span");b.style.color=d;b.appendChild(document.createTextNode(c));c=m.node(this.domId);m.empty(c);c.appendChild(b)},setProgressMessage:function(c){this._clickToDisMiss=!1;this._init();this.currentMessage=
c;var b=document.createElement("span");b.classList.add("progressIcon");var a=m.node(this.progressDomId);m.empty(a);a.appendChild(b);a.appendChild(document.createTextNode(c));b=m.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(c&&0<c.length)b.classList.add("progressNormal"),b.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();b.classList.remove("notificationShow");b.classList.add("notificationHide")}},
setCancelFunction:function(c){this._cancelFunc=c},setProgressResult:function(c,b){this._clickToDisMiss=!1;this._cancelMsg=b;this.currentMessage=c;var a=c.responseText||c;if("string"===typeof a)try{a=JSON.parse(a)}catch(k){}this._init();var g=a.Message||a.toString(),n=h.UnknownError,f="core-sprite-information",l="progressNormal",r=document.createElement("span");r.classList.add("imageSprite");r.classList.add("progressIcon");var s=[];if(a.Severity)switch(a.Severity){case "Warning":n=h.UnknownWarning;
f="core-sprite-warning";l="progressWarning";s.push("progressInfo");s.push("progressError");s.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":f="core-sprite-error";l="progressError";s.push("progressWarning");s.push("progressInfo");s.push("progressNormal");this._clickToDisMiss=!0;break;default:l="progressNormal",s.push("progressWarning"),s.push("progressError"),s.push("progressNormal")}s.push("notificationHide");r.classList.add(f);var q=m.node(this.progressDomId),f=m.node(this.notificationContainerDomId);
m.empty(q);q.appendChild(r);g===Object.prototype.toString()&&(g=n);a.HTML?(a=document.createElement("span"),a.innerHTML=g,q.appendChild(a)):((n=d.detectValidURL(g))?(g=document.createDocumentFragment(),d.processURLSegments(g,n),Array.prototype.forEach.call(m.$$("a",g),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!b)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
g=document.createTextNode(g)),q.appendChild(g));if(l&&this.progressDomId!==this.domId){f.classList.add(l);for(l=0;l<s.length;l++)f.classList.remove(s[l])}f.classList.add("notificationShow");if(s=m.node("closeNotifications"))this._cancelMsg?(s.classList.add("cancelButton"),s.classList.remove("dismissButton"),s.classList.remove("core-sprite-close"),s.classList.remove("imageSprite"),s.innerHTML=this._cancelMsg):(s.innerHTML="",s.classList.remove("cancelButton"),s.classList.add("dismissButton"),s.classList.add("core-sprite-close"),
s.classList.add("imageSprite"))},showWhile:function(c,b){var a=this;if(b){a.setProgressMessage(b);var d=function(){b===a.currentMessage&&a.setProgressMessage("")};c.then(d,d)}return c},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(c,b){return new l(this,++this._lastProgressId,c,b)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var c="",b=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(b||(c+=", "),c+=this._progressMonitors[a].status,
b=!1);this.setProgressMessage(c)}else this.setProgressMessage("")},_beginProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._renderOngoingMonitors()},_doneProgressMonitor:function(c){delete this._progressMonitors[c.progressId];this._progressMonitors.length--;c.status?this.setProgressResult(c.status):this._renderOngoingMonitors()}};c.prototype.constructor=
c;l=function(c,b,a,d){this.statusService=c;this.progressId=b;if(a){this.deferred=a;this.begin(d);var g=this;a.then(function(a,b){g.done.bind(g)()},function(a,b){g.done.bind(g)()})}};l.prototype.begin=function(c){this.status=c;this.statusService._beginProgressMonitor(this)};l.prototype.done=function(c){this.status=c;this.statusService._doneProgressMonitor(this)};l.prototype.worked=function(c){this.status=c;this.statusService._workedProgressMonitor(this)};l.prototype.constructor=l;return{StatusReportingService:c,
ProgressMonitor:l}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(h,m,f,d){function c(){}c.prototype={_initialize:function(c,e,b,a,k){this._tooltip=new d.Tooltip({node:c,hideDelay:k||0,afterShowing:this._afterShowingFunction(e).bind(this),afterHiding:b,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";c=document.createRange();c.selectNode(this.$parent);c=c.createContextualFragment(this.TEMPLATE);
this.messages&&f.processTextNodes(c,h);this.$parent.appendChild(c);var g=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===f.KEY.ESCAPE&&g.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(c){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.id&&(this["$"+b.id]=b);this._bindElements(b)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var d=
f.firstTabbable(this.$parent);d&&d.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(h,m,f,d){var c={};(function(){var l=!1;c.updateNavTools=function(c,b,a,d,g,n){var p=f.node(d);if(p)b.destroy(p);else throw h["could not find toolbar "]+d;b.renderCommands(d,p,n,a,"button");if(g&&(d=f.node(g)))b.destroy(d),b.renderCommands(g,d,null,a,"button");l||(l=!0,c.getService("orion.page.selection").addEventListener("selectionChanged",function(c){var d=f.node(g);
d&&(b.destroy(d),b.renderCommands(g,d,c.selections,a,"button"))}))};c.createOperationsCommands=function(c,b,a){function k(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var g=new d.Command({name:h["Remove Completed"],tooltip:h["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(c){a.removeCompletedOperations().then(function(a){b.loadOperations.bind(b)()})},visibleWhen:function(a){return!0}});c.addCommand(g);
g=new d.Command({name:h.Remove,tooltip:h["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){c=Array.isArray(c.items)?c.items:[c.items];for(var d=0;d<c.length;d++){var e=c[d];a.removeOperation.bind(a)(e.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!k(a);for(var b in a)if(k(a[b]))return!1;return!0}});c.addCommand(g);
g=new d.Command({name:h.Cancel,tooltip:h["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return k(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!k(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});c.addCommand(g)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(h,m,f,d,c){function l(c){this._options=c}l.prototype=new d.PopupDialog;l.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';l.prototype._init=
function(d){this._myOperations=[];this._operationsDeferreds=[];this._commandService=d.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(d.triggerNode)};l.prototype._bindToDom=function(c){this.$allOperationsLink.href=m.toUrl("operations/list.html");this._setOperationsVisibility()};l.prototype.setOperations=function(c,b){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(c)for(var a in c)this._myOperations.push(c[a]),this._operationsDeferreds.push(b[a]);this._renderOperations()};l.prototype.parseProgressResult=function(c){if(!c)return{};c=c.responseText||c;try{c=JSON.parse(c)}catch(b){}var a={Message:c.Message||c,Severity:c.Severity};c.DetailedMessage&&c.DetailedMessage!==a.Message&&(a.DetailedMessage=c.DetailedMessage);return a};l.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};l.prototype._renderOperationsTable=function(c,b,a){f.empty(c);for(var d=0;d<b.length;d++){var g=b[d],n=document.createElement("tr"),l=document.createElement("td");l.style.paddingLeft="5px";l.style.paddingRight="5px";l.textContent=g.Name;n.appendChild(l);var m=document.createElement("div");l.appendChild(m);l=document.createElement("span");l.style.paddingRight="5px";l.classList.add("imageSprite");switch(g.type){case "Warning":l.classList.add("core-sprite-warning");
l.setAttribute("aria-label",h["Operation resulted in a warning."]);break;case "error":l.classList.add("core-sprite-error");l.setAttribute("aria-label",h["Operation resulted in an error."]);break;case "loadstart":case "progress":l.classList.add("core-sprite-start");l.setAttribute("aria-label",h["Operation is running."]);break;case "abort":l.classList.add("core-sprite-stop");l.setAttribute("aria-label",h["Operation is canceled."]);break;case "load":case "loadend":l.classList.add("core-sprite-ok"),l.setAttribute("aria-label",
"Operation ok.")}m.appendChild(l);l=document.createElement("span");l.classList.add("operationStatus");l.textContent=g.Name;m.appendChild(l);if(g.error){var r=g.error.Message||g.error;g.error.DetailedMessage&&""!==g.error.DetailedMessage&&(r+=": "+g.error.DetailedMessage);l.textContent=r;l.classList.remove("operationStatus");l.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:g,deferred:a[d]},this,"tool");c.appendChild(n)}this._setOperationsVisibility()};
l.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"};l.prototype.constructor=l;return{OperationsDialog:l}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(h,m,f,d,c){function l(b,a){if(!this._progressPane){this._progressPane=d.node(b);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var e=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===d.KEY.ENTER)&&e._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){e._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function e(b,a,c,d){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=d}l.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 c={},d;for(d in b)b[d].progressMonitor||(c[d]=b[d]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var e="";for(d in c){var f=c[d];if(f.type&&("loadstart"===f.type||"progress"===f.type)){e=
"running";break}}""===e&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==e;switch(e){case "running":this._progressPane.title=h["Operations running"];this._progressPane.alt=h["Operations running"];this._progressPane.setAttribute("aria-valuetext",h["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=h["Some operations finished with warning"];this._progressPane.alt=h["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=h["Some operations finished with error"];this._progressPane.alt=h["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(c,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};l.prototype.constructor=l;e.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new l(b,this._commandRegistry))},progress:function(b,a,c){var d=this,e=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(a));b.then(function(f){d._operations[e]&&
(f=d._operations[e],a&&(f.Name=a),d._lastOperation=f,f.type="loadend",c&&(f.progressMonitor=c),d.writeOperation.bind(d)(e,f,b),f.Location||d._removeOperationFromTheList.bind(d)(e))},function(f){if(d._operations[e]){var h=d._operations[e];a&&(h.Name=a);c&&(h.progressMonitor=c);d._lastOperation=h;h.type=f.canceled?"abort":"error";h.error=f;d.writeOperation.bind(d)(e,h,b);h.Location||d._removeOperationFromTheList.bind(d)(e)}},function(f){a&&(f.Name=a);c&&(f.progressMonitor=c);d.writeOperation.bind(d)(e,
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,c){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var d=this;b.then(function(a){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c?d._serviceRegistry.getService("orion.page.message").setProgressMessage(""):d.setProgressResult.bind(d)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,c){this._operations[b]=a;this._operationDeferrds[b]=c;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(a.Location,{Name:a.Name,expires:a.expires})});
a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};e.prototype.constructor=e;return{ProgressService:e}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(h,m){function f(c,b,a){return c[b].apply(c,a)}function d(c){this._location=c}function c(){var c=new m;c.reject(h["No Matching OperationService for location:"]+this._location);return c}function l(c){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=c.getService("orion.core.preference");for(var b=c.getServiceReferences("orion.core.operation"),
a=0;a<b.length;a++){var k=c.getService(b[a]);this._services[a]=k;k=b[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 d(a)}}d.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};d.prototype.constructor=d;l.prototype={getOperations:function(){var c=
new m;if(this._operations)return c.resolve(this._operations),c;var b=this;this._preferenceService.getPreferences("/operations").then(function(a){b._operations=a;c.resolve(b._operations)});return c},getOperation:function(c){return f(this._getService(c),"getOperation",arguments)},removeCompletedOperations:function(){for(var c=[],b=this,a=0;a<this._services.length;a++){var d=this._patterns[a],g=new m;c[a]=g.promise;f(this._services[a],"removeCompletedOperations").then(function(a){return function(c){Array.isArray(c)&&
b.getOperations.bind(b)().then(function(b){for(var e=b.keys(),g=0;g<e.length;g++){var f=e[g];d.test(f)&&0>c.indexOf(f)&&b.remove(f)}a.resolve()})}}(g),function(a){return function(b){a.reject(b)}}(g))}return m.all(c)},removeOperation:function(c){var b=this;return f(this._getService(c),"removeOperation",arguments).then(function(a){b.getOperations.bind(b)().then(function(a){a.remove(c)})},function(a){return a},function(a){return a})}};l.prototype.constructor=l;return{OperationsClient:l}});
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(h,m){var f={root:m};Object.keys(h).forEach(function(d){"undefined"===typeof f[d]&&(f[d]=h[d])});return f});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,m){function f(d){this._init(d)}f.prototype={_init:function(d){var c=d.parent,f=this,c=m.node(c);if(!c)throw h["no parent"];if(!d.model)throw h["no tree model"];if(!d.renderer)throw h["no renderer"];this._parent=c;this._treeModel=d.model;this._onComplete=d.onComplete;this._renderer=d.renderer;this._showRoot=void 0===d.showRoot?!1:d.showRoot;this._indent=void 0===d.indent?16:d.indent;this._onCollapse=d.onCollapse;
this._labelColumnIndex=void 0===d.labelColumnIndex?0:d.labelColumnIndex;this._id=void 0===d.id?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._treeModel.getRoot(function(c){f._root=c;f._showRoot?(c._depth=0,f._generate([c],0)):f._treeModel.getChildren(c,function(b){f.destroyed||f._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,
c){m.empty(this._parent);var f=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(f);var e=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(e);e.id=this._id;this._tableStyle&&e.classList.add(this._tableStyle);this._renderer.initTable(e,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===d.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,c);e.appendChild(this._bodyElement);f.appendChild(e);this._parent.appendChild(f);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(d,c,f){for(var e=0;e<d.length;e++){var b=document.createElement(this._tableRowElement);b.id=this._treeModel.getId(d[e]);b._depth=c;b._item=d[e];this._renderer.render(d[e],b);var a=this._indent*c;b.childNodes[Math.min(b.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(b,d[e]);f?(this._bodyElement.insertBefore(b,f.nextSibling),f&&(f=b)):this._bodyElement.appendChild(b)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,c,f){var e=this._treeModel.getId(d),b;if(e===this._id)this._removeChildRows(e),this._generateChildren(c,0),this._rowsChanged();else if(e===
this._treeModel.getId(this._root)&&d.removeAll)this._removeAllRows(),this._generateChildren(c,0),this._rowsChanged();else{var a=m.node(e);a?(a._item=d,a&&(f||a._expanded)?(this._removeChildRows(e),c?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(c,a._depth+1,a),this._rowsChanged()):(b=this,this._renderer.updateExpandVisuals(a,"progress"),c=this._treeModel.getChildren(a._item,function(c){b.destroyed||(b._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,b._generateChildren(c,a._depth+1,a),b._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(h["could not find table row "]+e)}},getItem:function(d){var c=m.node(d);return c&&c._item?c._item:d},toggle:function(d){var c=m.node(d);c&&(c._expanded?this.collapse(d):this.expand(d))},isExpanded:function(d){d="string"===typeof d?d:this._treeModel.getId(d);return(d=m.node(d))?d._expanded:!1},expand:function(d,c,f){d="string"===typeof d?d:this._treeModel.getId(d);var e=m.node(d);if(e){var b=
this;e._expanded?c&&c.apply(b,f):(this._renderer.updateExpandVisuals(e,"progress"),this._treeModel.getChildren(e._item,function(a){b.destroyed||(b._renderer.updateExpandVisuals(e,!0),e._expanded||(e._expanded=!0,b._generateChildren(a,e._depth+1,e),b._rowsChanged()),c&&c.apply(b,f))}))}},_removeChildRows:function(d){for(var c=d===this._id,f=!1,e=-1,b=[],a=m.$$array(".treeTableRow",this._parent),k=0;k<a.length;k++){var g=a[k];if(f)break;c?g._depth>e?b.push(g):f=!0:g.id===d&&(c=!0,e=g._depth)}for(d=
0;d<b.length;d++)c=b[d],c.parentNode.removeChild(c)},_removeAllRows:function(){for(var d=m.$$array(".treeTableRow",this._parent),c=0;c<d.length;c++)d[c].parentNode.removeChild(d[c])},collapse:function(d){d="string"===typeof d?d:this._treeModel.getId(d);var c=m.node(d);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)},getIndent:function(){return this._indent}};f.prototype.constructor=
f;return{TableTree:f}});
define("orion/treeModelIterator",[],function(){var h={};h.TreeModelIterator=function(){function h(f,d){this.firstLevelChildren=f;this.reset();this._init(d)}h.prototype={_init:function(f){f&&(this.isExpanded=f.isExpanded,this.isExpandable=f.isExpandable,this.forceExpandFunc=f.forceExpandFunc,this.getChildrenFunc=f.getChildrenFunc)},topLevel:function(f){return f.parent?f.parent===this.root:!0},_getChildren:function(f){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(f):f?f.children:
null},_expanded:function(f){if(!f)return!0;var d=this._getChildren(f),d=d&&0<d.length;this.isExpanded&&d&&(d=this.isExpanded(f));return d},_expandable:function(f){return!f?!0:this.isExpandable?this.isExpandable(f):!1},_diveIn:function(f){return this._expanded(f)?(f=this._getChildren(f),this.setCursor(f[0]),this.cursor()):null},_drillToLast:function(f){return this._expanded(f)?(f=this._getChildren(f),this._drillToLast(f[f.length-1])):f},_forward:function(f){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(f&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&c.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(f){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(f&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var c=this;return this.forceExpandFunc(d,"last",function(d){d&&
c.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(f,d){for(var c=this.topLevel(f),h=this._getChildren(f.parent),h=c?this.firstLevelChildren:h,e=0;e<h.length;e++)if(h[e]===f)return 0===e&&!d?c?null:f.parent:e===h.length-1&&d?c?null:this._findSibling(f.parent,d):d?h[e+1]:h[e-1];return null},_inParentChain:function(f,d){for(var c=f.parent;c;){if(c===d)return!0;c=c.parent}return!1},_getTopLevelParent:function(f){if(this.topLevel(f))return f;for(f=f.parent;f;){if(this.topLevel(f))return f;
f=f.parent}return null},_onCollapse:function(f){return this._expanded(f.parent)?f:this._onCollapse(f.parent)},_scan:function(f,d,c){this.setCursor(d);var h=[];for(h.push(d);;){if(this.iterate(f))h.push(this.cursor());else break;if(c===this.cursor())return h}return null},setCursor:function(f){this._prevCursor=this._cursor;this._cursor=f},setTree:function(f){this.firstLevelChildren=f;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(f,d){var c=this.cursor(),
h=this._scan(!0,f,d);h||(h=this._scan(!1,f,d));this.setCursor(c);return h},iterate:function(f,d){return f?this._forward(d):this._backward(d)},iterateOnTop:function(f,d){var c=this._findSibling(this._getTopLevelParent(this.cursor()),f);c?this.setCursor(c):d&&0<this.firstLevelChildren.length&&this.setCursor(f?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(f){return!this._cursor?null:this._inParentChain(this._cursor,f)?(this.setCursor(f),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 h}();return h});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(h,m,f){var d={},c=-1!==navigator.userAgent.indexOf("iPad"),l=-1!==window.navigator.platform.indexOf("Mac");d.ExplorerNavHandler=function(){function d(b,a,c){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 m.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.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,c){return e.explorer.forceExpandFunc(a,b,c)}:void 0});this._init(c);(!c||!1!==c.setFocus)&&b.focus();c=function(a){if(f.isFormElement(a.target)||e.explorer.preventDefaultFunc&&e.explorer.preventDefaultFunc(a,
e._modelIterator.cursor()))return!0;if(a.keyCode===h.KEY.DOWN)return e.onDownArrow(a);if(a.keyCode===h.KEY.UP)return e.onUpArrow(a);if(a.keyCode===h.KEY.RIGHT)return e.onRightArrow(a);if(a.keyCode===h.KEY.LEFT)return e.onLeftArrow(a);if(a.keyCode===h.KEY.SPACE)return e.onSpace(a);if(a.keyCode===h.KEY.ENTER)return e.onEnter(a)};b.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(a){if(e.explorer.onFocus)e.explorer.onFocus(!1);else e.toggleCursor(null,!1)};
b.addEventListener("blur",c,!1);this._listeners.push({type:"blur",listener:c});c=function(a){if(e.explorer.onFocus)e.explorer.onFocus(!0);else e.toggleCursor(null,!0)};b.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});this._parentDiv=b}d.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 l?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):h.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:h.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 c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){c._clearSelection(a);for(var e=0;e<d.length;e++)c._selections.push(d[e]);0<c._selections.length?c.cursorOn(c._selections[0],
!0,!1,b):c.cursorOn(null,!1,!1,b);c._shiftSelectionAnchor&&0<=c._inSelection(c._shiftSelectionAnchor)||(c._shiftSelectionAnchor=null)})},refreshModel:function(b,a,c,d){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():c&&(this.topIterationNodes=c);this._modelIterator.setTree(this.topIterationNodes);!d&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){b=this.model.getId(b);for(var a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){this._selectionPolicy!==
b&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===b)&&this._toggleSelectionClass("disabledRow","readonlySelection"===b),this._selectionPolicy=b,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(b,a,c){"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)),c&&(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 c=this._getGridChildren(b);if(c&&1<c.length||
0===a&&c){0!==a&&this.toggleCursor(b,!1);var d=this._currentColumn,e=!0,d=d+a;0>d?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),d=e?c.length-1:this._currentColumn):d>=c.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),d=e?0:this._currentColumn);this._currentColumn=d;0!==a&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},
getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&0<b.length?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=this._parentDiv,c;b&&b!==a&&"grid"!==(c=b.getAttribute("role"))&&"tree"!==c&&"treegrid"!==c;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var c=this.getRowDiv(b),d=this.getCurrentGrid(b);d?(c&&(a?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),d.domNode&&(c=this.getAriaContainerElement(d.domNode),
a?(d.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",d.domNode.id)):d.domNode.classList.remove("treeIterationCursor"))):c&&(a?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,c,d){var e,f;if(b||a){if(f===this._modelIterator.cursor())return;e=this._modelIterator.cursor();f=b;this._modelIterator.setCursor(f)}else e=this._modelIterator.prevCursor(),
f=this._modelIterator.cursor();if(e!==f||a)if(this.toggleCursor(e,!1),!a||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((b=this.getRowDiv())&&!d){d=b.parentNode;for(a=document.documentElement;d&&d!==a;){var h=window.getComputedStyle(d,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;d=d.parentNode}d&&(a=!0,b.offsetTop<=d.scrollTop?(a=!1,void 0===c&&(c=!1)):b.offsetTop+b.offsetHeight>=d.scrollTop+d.clientHeight&&(a=!1,void 0===c&&(c=!0)),a||b.scrollIntoView(!c))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,
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:h.node(b)},iterate:function(b,a,c,d){var e=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(d){d=this.currentModel();for((e=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,c);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,c);e||(this.cursorOn(d,!0,!1,!0),this._setCursorOnItem(b,c))}else(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,c)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(c){(c=this.getRowDiv(c))&&(a?c.classList.add(b):c.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var c=this._inSelection(this._modelIterator.prevCursor()),
d=this._inSelection(this._modelIterator.cursor());0<=c&&0<=d?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var c=this.getRowDiv(b);if(c){var d=h.node(this.explorer.renderer.getCheckBoxId(c.id)),e=a?!d.checked:!0;if(e!==d.checked)this.explorer.renderer.onCheck(c,d,e,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var c=this.getRowDiv(b);c&&(0>this._inSelection(b)?c.classList.add("checkedRow"):c.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var c=this._getGridChildren(b);if(c)for(var d=0;d<c.length;d++)if(a.target===c[d].domNode)return!0;return!1},onClick:function(b,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(b)))h.stop(a);else{var d=h.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==d&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),c)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(d=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var e=0;e<d.length;e++)this.setSelection(d[e],!0)}}else this.setSelection(b,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!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(),c=this._getGridChildren(a);return c&&1<c.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 c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(c)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(a)),c.href&&(this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.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 d}();d.ExplorerNavDict=function(){function c(b){this._dict={};this._model=b}c.prototype={addRow:function(b,a){var c=this._model.getId(b);this._dict[c]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var c=this._model.getId(b);return this._dict[c]?(!this._dict[c].gridChildren&&a&&(this._dict[c].gridChildren=[]),this._dict[c].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return c}();return d});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(h,m,f,d,c,l){var e={};e.Explorer=function(){function b(a,b,c,d){this.registry=a;this.renderer=c;this.selection=b;this.commandService=d;this.renderer&&(this.renderer.explorer=this);this.myTree=null}b.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,c){var d=null;if(a=this.getRow(a)){var d=a.parentNode,e=document.createElement("tr");e.id=b+"placeHolderRow";e.classList.add("navRow");var f=document.createElement("td");f.id=b+"placeHolderCol";f.classList.add("navColumn");e.appendChild(f);
c?d.insertBefore(e,a.nextSibling):d.insertBefore(e,a);f.style.paddingLeft=a.firstChild.style.paddingLeft;d={wrapperNode:e,refNode:f,destroyFunction:function(){try{e&&e.parentNode&&e.parentNode.removeChild(e)}catch(a){}}}}return d},getRow:function(a){if(a=this.model.getId(a))return f.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 c=a.length,d=0;d<c;d++)b._expandRecursively(a[d])})})}},createTree:function(a,b,e){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var n=a+"innerTree",
h=f.node(n);h&&f.empty(h);b&&(b.rootId=n);this.model=b;this._parentId=a;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:n,model:b,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 c=a.getSelection(),d=0;d<c.length;d++){var e=a.getRowDiv(c[d]);e&&e.parentNode&&
(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&b.push(e.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 c.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();e.createExplorerCommands=function(b,a){function c(b){return"function"===
typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var d=new l.Command({tooltip:h["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.expandAll()}}),e=new l.Command({tooltip:h["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.collapseAll()}});
b.addCommand(d);b.addCommand(e)};e.ExplorerModel=function(){function b(a,b,c){this.rootPath=a;this.fetchItems=b;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return b}};return b}();e.ExplorerFlatModel=function(){function b(a,b,c){this.rootPath=a;this.fetchItems=b;this.root=c}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};
return b}();e.ExplorerRenderer=function(){function b(a,b){this.explorer=b;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;f.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,e){c=c||"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,c,null,e&&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 c=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")));c.appendChild(d);var e=this;d.addEventListener("click",function(c){e.onCheck(b,c.target,c.target.checked?!1:!0,!0,!1,a)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,e,f){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d,f);this.explorer.getNavHandler()&&
e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&(b&&"cursorOnly"!==c.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var d=[],c=0;c<a.length;c++){var e=b.getValue(a[c]);if(e&&(e.rowDomNode&&e.model)&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=f.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.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,c=window.sessionStorage[a+"expanded"];"string"===typeof c&&(c=0<c.length?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(f.node(c[d])){this._expanded.push(c[d]);var e=this;this.tableTree.expand(c[d],function(){e._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 c=f.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,d){var e=document.createElement("span");
e.id=this.expandCollapseImageId(a.id);b.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(c){var f=document.createElement("span");b.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(c)}var h=this;e.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 c in h._expanded)if(h._expanded[c]===
a.id){h._expanded.splice(c,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)}};return e},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||(f.$(".sectionTreeTable",this.tableNode.parentNode)||f.$(".treetable",this.tableNode.parentNode))&&f.$$array(".treeTableRow",this.tableNode).forEach(function(a,
b){var c=!(b%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",d="lightSectionTreeTableRow"===c?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(c);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=f.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],d=f.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();e.SelectionRenderer=function(){function b(a,b){this._init(a);this.explorer=b}b.prototype=new e.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,e=this.getCellHeaderElement(d);e;)0<
e.innerHTML.length&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);b.appendChild(c);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 c=this.explorer.getNavDict();if(c){"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");c.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,
b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c)}for(var c=0,e=this.getCellElement(c,a,b);e;)b.appendChild(e),0===c?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(a)):e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,b,c){};return b}();
e.SimpleFlatModel=function(){function b(a,b,c){this.items=a;this.getKey=c;this.idPrefix=b;this.root={children:a}}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return e});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(h,m,f,d){function c(b,a,c){return 0<b?1===b?a+" ":b+" "+c+" ":""}function l(b){b=new Date(b);var a=(new Date).getTime()-b.getTime();b=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*b,d=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*d,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=c(b,"a year","years"),l=
c(d,"a month","months"),m=c(e,"a day","days"),s=c(f,"an hour","hours"),h=c(h,"a minute","minutes"),q="";a?q=0<b?a:a+l:l?q=0<d?l:l+m:m?q=0<e?m:m+s:s?q=0<f?s:s+h:h&&(q=h);return q?q+"ago":"Just now"}function e(b){this._parentDomNode=f.node(b.parent);this._commitInfo=b.commitInfo}h.mixin(e.prototype,{destroy:function(){},_simpleMessage:function(b){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var c=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");c&&0<c.length&&(a=c[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 c=(new URL("commit",window.location.href)).href,c=decodeURIComponent(c);a.href=(new m(c+"{/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 c=
this,e=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);e.query.set("contributorUserId",b);d("GET",e.href,{timeout:15E3}).then(function(b){b=JSON.parse(b.response);a.src=b.photoURI},function(){c._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 c=this._commitInfo.Author&&this._commitInfo.Author.Date?l(this._commitInfo.Author.Date):"",d=this._simpleMessage(-1),e=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",h=b;h||(h="Commit");h="Last "+h;if(a){var m=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");m.appendChild(r)}else m=
document.createElement("div"),m.classList.add("commitInfoLabelContainer"),m.appendChild(document.createTextNode(h.toUpperCase()));this._parentDomNode.appendChild(m);m=document.createElement("div");m.classList.add("commitInfoMessageContainer");r=document.createElement("div");r.classList.add("commitInfoAutorContainer");var s=document.createDocumentFragment(),q=document.createElement("span");q.appendChild(document.createTextNode(e));q.classList.add("navColumnBold");a?(e=document.createElement("span"),
e.appendChild(document.createTextNode(h)),e.classList.add("navColumnBold"),s.textContent=c?"${0} by ${1} "+c+".":"${0} by ${1}.",c=[e,q]):(s.textContent=c?"by ${0} "+c+".":"by ${0}.",c=[q]);f.processDOMNodes(s,c);r.appendChild(s);m.appendChild(r);c=document.createElement("div");c.classList.add("commitInfoMessageTextContainer");c.appendChild(this._generateMessageNode(d));m.appendChild(c);this._parentDomNode.appendChild(m)}});return{CommitInfoRenderer:e,calculateTime:l}});
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(h,m,f,d,c,l,e,b,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 g(a,b,d,f,g,h,n,A,B){b=l.clone(b);
var w;if(b.Directory)w=document.createElement("a"),w.className="navlinkonpage",f=!a?p:new e(a+"#{,resource,params*}"),w.href=f.expand({resource:b.ChildrenLocation}),b.Name&&w.appendChild(document.createTextNode(b.Name));else{g||(g=c.getOpenWithCommands(d));w=document.createElement("a");w.className="navlink targetSelector";h&&"object"===typeof h&&Object.keys(h).forEach(function(a){w[a]=h[a]});var K=null,H=null;if(K=A?A.holderDom:w)H=document.createElement("span"),H.className="core-sprite-file modelDecorationSprite thumbnail",
K.appendChild(H);b.Name&&w.appendChild(document.createTextNode(b.Name));var F=b.Location;n&&"object"===typeof n&&(b.params={},l.mixin(b.params,n));(a=c.getOpenWithCommand(d,b,g))&&(F=a.hrefCallback({items:b}));m.when(f.getFileContentType(b),function(a){if(K){var c=K,d=H;if(a){var e,f=a.imageClass,g=a.image;f?(e=document.createElement("span"),e.className+=f,e.classList.add("thumbnail")):g&&(e=document.createElement("img"),e.src=g,e.classList.add("thumbnail"));e&&c.replaceChild(e,d)}}w.href=F;B&&"function"===
typeof B.updateFileNode&&B.updateFileNode(b,w,k(a))})}w.addEventListener("click",function(){u=b}.bind(this),!1);return w}function n(a,b,c,d){this.explorer=b;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var p=new e("#{,resource,params*}"),u;n.prototype=new f.SelectionRenderer;n.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};n.prototype.tableCallback=function(a){a.setAttribute("aria-label",
h.Navigator);a.setAttribute("role","presentation")};n.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};n.prototype.emptyCallback=function(b){var c=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=h.NoFile;var f=document.createElement("span");f.appendChild(document.createTextNode(h.File));a.processDOMNodes(e,[f]);d.appendChild(e);c.appendChild(d);b.appendChild(c)};
n.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};n.prototype.getCommitRenderer=function(a,c){return new b.CommitInfoRenderer({parent:a,commitInfo:c})};n.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"}};n.prototype.setTarget=function(a){this.target=a};n.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};n.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=g(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};n.prototype.updateFileNode=function(a,b,c){};n.prototype.showFolderLinks=!0;n.prototype.getCellElement=function(a,b,e){var f=b.LastCommit?2:1,k=b.LastCommit?3:2,h=b.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),f=document.createElement("span"),f.id=e.id+"MainCol",f.setAttribute("role","presentation"),a.appendChild(f),a.setAttribute("role","presentation"),f.className="mainNavColumn",b.Directory?(this.getExpandImage(e,f),k=this.createFolderNode(b),f.appendChild(k),this.explorer._makeDropTarget(b,k),this.explorer._makeDropTarget(b,e)):(this.openWithCommands||(this.openWithCommands=c.getOpenWithCommands(this.commandService)),k=g("",b,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),f.appendChild(k)),k&&(k.id=e.id+"NameLink",1===k.nodeType&&(d.addNavGrid(this.explorer.getNavDict(),b,k),k.setAttribute("role","link"),k.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,"tool",null,!0),a;case f:if(this.oneColumn)return null;e=document.createElement("td");b.LocalTimeStamp&&(e.textContent=this.getDisplayTime(b.LocalTimeStamp));return e;case k:if(this.oneColumn)return null;
e=document.createElement("td");!b.Directory&&"number"===typeof b.Length&&(b=parseInt(b.Length,10)/1024,e.textContent=Math.ceil(b).toLocaleString()+" KB");e.style.textAlign="right";return e;case h:if(this.oneColumn||!b.LastCommit)return null;e=document.createElement("td");this.getCommitRenderer(e,b.LastCommit).renderSimple(60);return e}};n.prototype.constructor=n;return{NavigatorRenderer:n,isImage:k,getClickedItem:function(){return u},createLink:g}});
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(h,m,f,d,c,l,e,b,a){function k(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function g(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(g,k,l,r,s){var q=this.serviceRegistry,t=this.commandRegistry;this.openWithCommands=this.openWithCommands||b.createOpenWithCommands(q,g,t);var v=this;return function(b,q,A,B){a.when(v.openWithCommands,function(a){if(A)f.empty(k),a=document.createElement("div"),a.appendChild(document.createTextNode(h["Search failed."])),k.appendChild(a),"function"===typeof r&&r(k);else{var v=
function(){function a(b,c){var d=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(e)}var b={};return function(c,d){var e=d.name;if(b.hasOwnProperty(e)){a(c,d);var f=b[e];"function"===typeof f&&(b[e]=null,f())}else b[e]=function(){a(c,d)}}}(),H=!1;f.empty(k);if(b&&0<b.length){var F=document.createElement("table");F.setAttribute("role","presentation");for(var y=0;y<b.length;y++){var D=
b[y],z;H||(H=!0,l&&(z=F.insertRow(0).insertCell(0),z.textContent=l));z=F.insertRow(-1).insertCell(0);z.colspan=2;s&&s(z);var G={Name:D.name,Directory:D.directory,Location:D.path||D.location},E=null;"number"===typeof D.LineNumber&&(E={},E.line=D.LineNumber);if(B&&B.keyword&&!B.nameSearch){var I=c.generateSearchHelper(B),E=E||{};E.find=I.inFileQuery.searchStr;E.regEx=I.inFileQuery.wildCard?!0:void 0}G=e.createLink(m.toUrl("edit/edit.html"),G,t,g,a,{"aria-describedby":(D.folderName?D.folderName:D.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},E);D.LineNumber&&G.appendChild(document.createTextNode(" (Line "+D.LineNumber+")"));z.appendChild(G);v(z,D)}k.appendChild(F);"function"===typeof r&&r(k)}!H&&q&&(a=d.formatMessage(h["No matches found for ${0}"],q),f.empty(k),k.appendChild(document.createTextNode(a)),"function"===typeof r&&r(k))}})}};g.prototype={search:function(a,b,d){var e=function(a){for(var d=[],e=0;e<a.response.docs.length;e++){var f=a.response.docs[e],g=f.Location,k=c.path2FolderName(f.Path?
f.Path:f.Location,f.Name),h=k?k:g;(b?0<=h.indexOf(b):1)&&d.push({name:f.Name,path:g,folderName:k,directory:f.Directory,lineNumber:f.LineNumber})}return d};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){d(e(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 c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);d(e(b),c,null,a)},function(a){d(null,
null,a,null)})}catch(f){"string"===typeof f&&-1<f.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){d(e(b),null,null,a)}):"string"===typeof f&&-1<f.indexOf("search")&&!a.nameSearch?(new l.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){d(e(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(f)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);f.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?e="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(e=a);e?(this.setLocationbyURL(e.Location),c=e.Name,this._childrenLocation=e.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);e=f.node("search");c||(c="");if(e&&e.placeholder){e.value="";var g=d.formatMessage(h["Search ${0}"],c);e.placeholder=30<g.length?g.substring(0,27)+"...":d.formatMessage(h["Search ${0}"],c)}e&&e.title&&(e.title=h["Type a keyword or wild card to search in "]+c)},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,c,d){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,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}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/dialogs",[],function(){function h(h){this._serviceRegistry=h;this._serviceRegistration=h.registerService("orion.page.dialog",this)}h.prototype={confirm:function(h,f){f(window.confirm(h))},openFiles:function(h){}};h.prototype.constructor=h;return{DialogService:h}});
define("orion/sites/siteClient",["i18n!orion/sites/nls/messages","require","orion/Deferred","orion/fileClient"],function(h,m,f,d){function c(a,b,c){var d=a[b],e=new f;if("function"!==typeof d)throw h["Service method missing: "]+b;d.apply(a,c).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}function l(a,b){return new d.FileClient(a,function(a){return(a=a.getProperty("top"))&&0===a.indexOf(b)})}function e(a,b,c){this._serviceRegistry=a;this._siteService=b;this._selfHost=c.getProperty("canSelfHost");
this._selfHostConfig=c.getProperty("selfHostingConfig");this._sitePattern=c.getProperty("sitePattern");this._filePattern=c.getProperty("filePattern");this._name=c.getProperty("name");this._id=c.getProperty("id");this._getService=function(){return this._siteService};this._getFilePattern=function(){return this._filePattern};this._getFileClient=function(){return l(this._serviceRegistry,this._getFilePattern())};this._canSelfHost=function(){return this._selfHost}}function b(a,b){a[b]=function(){return c(this._getService(),
b,Array.prototype.slice.call(arguments))}}function a(a,b,c){for(var d=a.getServiceReferences("orion.site"),f=[],l=[],m=[],q=0;q<d.length;q++){var t=d[q].getProperty(b),t="^"!==t[0]?"^"+t:t;f.push(d[q]);l.push(RegExp(t));m.push(a.getService(d[q]))}a:if("/"===c)b=-1;else if(!c||c.length&&0===c.length)b=0;else{for(d=0;d<l.length;d++)if(l[d].test(c)){b=d;break a}throw h["No Matching SiteService for "]+b+": "+c;}return new e(a,m[b],f[b])}e.prototype={getSelfHostingConfig:function(){return this._selfHostConfig},
isFileMapped:function(a,b){if(!a){var c=new f;c.resolve(!1);return c}return this.getURLOnSite(a,b).then(function(a){return null!==a})},mapOnSiteAndStart:function(a,b,c){function d(c,h,n){return e.isFileMapped(a,b).then(function(a){a||n.push({Source:c,Target:h,FriendlyPath:c});a=new f;a.resolve();return a})}var e=this,h="/"+b.Name,l;if(a)"started"===a.HostingStatus.Status&&(a.HostingStatus.Status="stopped"),l=e.toInternalForm(b.Location).then(function(b){return d(h,b,a.Mappings).then(function(){return e.updateSiteConfiguration(a.Location,
a).then(function(a){return e.updateSiteConfiguration(a.Location,{HostingStatus:{Status:"started"}})})})});else{var m=b.Name+" site";l=e.toInternalForm(b.Location).then(function(a){var b=[];return d(h,a,b).then(function(){return e.createSiteConfiguration(m,c,b,null,{Status:"started"}).then(function(a){return a})})})}return l.then(function(a){return e.getURLOnSite(a,b)})}};"createSiteConfiguration getSiteConfigurations deleteSiteConfiguration loadSiteConfiguration updateSiteConfiguration toFileLocation toInternalForm getMappingObject getMappingProposals updateMappingsDisplayStrings parseInternalForm isSelfHostingSite convertToSelfHosting getURLOnSite".split(" ").forEach(function(a){b(e.prototype,
a)});e.prototype.constructor=e;return{forLocation:function(b,c){return a(b,"pattern",c)},forFileLocation:function(b,c){return a(b,"filePattern",c)},getFileClient:l,SiteClient:e}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(h,m){var f;f=h.toUrl?(new URL(h.toUrl("workspace"),window.location.href)).href:(new URL("/",window.location.href)).href;return{makeRelative:function(d){if(!d)return d;var c=window.location.protocol+"//"+window.location.host;return 0===d.indexOf(c)?d.substring(c.length):d},isAtRoot:function(d){return!d?!1:"/workspace"===d?!0:0===(new URL(d,window.location.href)).href.indexOf(f)}}});
define("orion/sites/siteUtils",["require","orion/fileUtils","orion/URITemplate"],function(h,m,f){return{generateEditSiteHref:function(d){var c=h.toUrl("sites/site.html");return(new f(c+"#{,resource,params*}")).expand({resource:m.makeRelative(d.Location)})}}});
define("orion/sites/siteCommands","i18n!orion/sites/nls/messages require orion/commandRegistry orion/commands orion/sites/siteUtils orion/sites/siteClient orion/Deferred orion/i18nUtil".split(" "),function(h,m,f,d,c,l,e,b){function a(a){return a instanceof Array?a:[a]}function k(a){return function(b){if(b instanceof Array&&1===b.length&&!(a instanceof Array))return b[0]}}var g=d.Command,n=b.formatMessage;return{createSiteServiceCommands:function(a,b,e){e=e||{};var g=new d.Command({name:h.Create,tooltip:h["Create a new site configuration"],
id:"orion.site.create",parameters:new f.ParametersDescription([new f.CommandParameter("name","text",h.Name)]),visibleWhen:function(a){return!0},callback:function(b){var d=b.items,f=a.getService(d),d=l.getFileClient(a,d.getProperty("filePattern")),g=b.parameters&&b.parameters.valueFor("name");b=a.getService("orion.page.progress");(b?b.progress(d.loadWorkspaces(),"Loading workspaces"):d.loadWorkspaces()).then(function(a){(a=a&&a[0]&&a[0].Id)&&g&&f.createSiteConfiguration(g,a).then(function(a){e.createCallback(c.generateEditSiteHref(a),
a)},e.errorCallback)})}});b.addCommand(g)},createSiteCommands:function(b,d){var f=b.getService("orion.page.dialog"),m=b.getService("orion.page.progress"),q=new g({name:h.Edit,tooltip:h["Edit the site configuration"],imageClass:"core-sprite-edit",id:"orion.site.edit",visibleWhen:function(a){a instanceof Array&&1===a.length&&(a=a[0]);return a.HostingStatus},hrefCallback:function(a){return c.generateEditSiteHref(a.items instanceof Array?a.items[0]:a.items)}});d.addCommand(q);q=new g({name:h.Start,tooltip:h["Start the site"],
imageClass:"core-sprite-start",id:"orion.site.start",visibleWhen:function(b){return a(b).some(function(a){return a.HostingStatus&&"stopped"===a.HostingStatus.Status})},callback:function(c){var d=a(c.items),f=c.userData;if(f.site&&1<d.length)throw Error("userData.site requires a single site configuration to act upon");d=d.map(function(a){var c=f.site||{};c.HostingStatus={Status:"started"};a=a.Location;return l.forLocation(b,a).updateSiteConfiguration(a,c)});m.showWhile(e.all(d)).then(k(c.items)).then(f.startCallback,
f.errorCallback)}});d.addCommand(q);var t=function(a,c){var d=a?c:{};d.HostingStatus={Status:"stopped"};var e=c.Location;return l.forLocation(b,e).updateSiteConfiguration(e,d)},q=new g({name:h.Stop,tooltip:h["Stop the site"],imageClass:"core-sprite-stop",id:"orion.site.stop",visibleWhen:function(b){return a(b).some(function(a){return a.HostingStatus&&"started"===a.HostingStatus.Status})},callback:function(b){var c=a(b.items),d=b.userData;if(d.site&&1<c.length)throw Error("userData.site requires a single site configuration to act upon");
c=c||[d.site];c=c.map(t.bind(null,!!d.site));m.showWhile(e.all(c)).then(k(b.items)).then(d.stopCallback,d.errorCallback)}});d.addCommand(q);q=new g({name:h.Delete,tooltip:h["Delete the site configuration"],imageClass:"core-sprite-delete",id:"orion.site.delete",visibleWhen:function(b){return 0<a(b).length},callback:function(c){var d=a(c.items),g=c.userData,m=1===d.length?n(h.ConfirmDeleteSingle,d[0].Name):n(h.ConfirmDeleteMultiple,d.length);f.confirm(m,function(a){a&&(a=d.map(function(a){var c=a.HostingStatus&&
"stopped"!==a.HostingStatus.Status?t(!1,a):a;return e.when(c).then(function(){var c=a.Location;return l.forLocation(b,c).deleteSiteConfiguration(c)})}),e.all(a).then(k(c.items)).then(g.deleteCallback,g.errorCallback))})}});d.addCommand(q)},createViewOnSiteCommands:function(a,b,c){var d=a.getService("orion.core.file");b.addCommand(new g({name:h["Add to site"],tooltip:h["Add the file to this site"],id:"orion.site.add-to",imageClass:"core-sprite-add",visibleWhen:function(a){return!a.IsFileRunningOn},
callback:function(b){var c=b.userData.file,e=b.items.SiteConfiguration,f=a.getService("orion.page.progress");return(f?f.progress(d.loadWorkspaces(),"Loading workspaces"):d.loadWorkspaces()).then(function(b){return l.forFileLocation(a,c.Location).mapOnSiteAndStart(e,c,b[0].Id)}).then(b.userData.addToCallback,b.userData.errorCallback)}}));b.addCommand(new g({name:h.View,tooltip:h["View the file on the site"],id:"orion.site.view-on-link",visibleWhen:function(a){return a.IsFileRunningOn},hrefCallback:function(b){var c=
b.userData.file;b=b.items.SiteConfiguration;return l.forFileLocation(a,c.Location).getURLOnSite(b,c)}}))}}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(h,m){function f(d,c){c||(c="orion.page.selection");this._serviceRegistry=d;h.attach(this);this._serviceRegistration=d.registerService(c,this);this._selections=null}f.prototype={getSelection:function(d){var c=this._getSingleSelection();"function"===typeof d&&d(c);return c},getSelections:function(d){var c=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof d&&d(c);return c},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(d){var c=this._selections;Array.isArray(d)?this._selections=0<d.length?d.slice():null:this._selections=d?[d]:null;c!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};f.prototype.constructor=f;return{Selection:f}});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(h,m,f,d,c,l){function e(a,b){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");
var e=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var f=0;f<e.length;f++)this.domNode.classList.add(e[f]);this.domNode.id=b.id;b.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),
this.domNode.tabIndex=0,this.domNode.addEventListener("click",function(a){(a.target===c.titleNode||a.target===c.twistie||a.target===c.domNode)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===h.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1));if(b.iconClass){var l=document.createElement("span");l.classList.add("sectionIcon");this.domNode.appendChild(l);e=Array.isArray(b.iconClass)?b.iconClass:
[b.iconClass];e.forEach(function(a){l.classList.add(a)})}b.headerClass&&(e=Array.isArray(b.headerClass)?b.headerClass:[b.headerClass],e.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleActionsNode=document.createElement("div");this.titleActionsNode.id=b.id+"TitleActionsArea";this.titleActionsNode.classList.add("layoutLeft");this.titleActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleActionsNode);this.titleNode=document.createElement("div");this.titleNode.id=
b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;"function"===typeof b.getItemCount&&(e=document.createElement("div"),e.classList.add("layoutLeft"),e.classList.add("sectionItemCount"),this.domNode.appendChild(e),e.textContent=b.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=b.id+"Progress";
this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.display="none";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);this.titleLeftActionsNode=document.createElement("div");this.titleLeftActionsNode.id=b.id+"LeftTitleActionsArea";this.titleLeftActionsNode.classList.add("layoutLeft");this.titleLeftActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleLeftActionsNode);
e=document.createElement("div");e.id=b.id+"FilterSearchBox";this.domNode.appendChild(e);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");
this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);b.slideout&&(e=d.slideoutHTMLFragment(b.id),f=document.createRange(),f.selectNode(this.domNode),e=f.createContextualFragment(e),
this.domNode.appendChild(e));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);"function"===typeof b.onExpandCollapse&&(this._onExpandCollapse=b.onExpandCollapse);this._preferenceService=b.preferenceService;this._collapse();if(this._preferenceService){var m=
this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(m.id);void 0===a?b.hidden||m._expand():a&&m._expand();m._updateExpandedState(!1)})}else b.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function b(a){this._section=a;this._id=++a._lastMonitor}e.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(a){return this.domNode},getTitleElement:function(a){return this.titleNode},
getActionElement:function(a){return this._toolActionsNode},setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,b,d){this._contentParent.innerHTML="";a.parent||(a.parent=b);this._contentParent.appendChild(a.parent);a.section=this;c.mixin(a,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!h.node(a)){var b=
document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a,b){this.section.actionsNode.style.visibility=a?"":"hidden";void 0===b&&(b=a?null:"cursorOnly");this.renderer.selectionPolicy=b;var c=this.getNavHandler();c&&c.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){h.node(a)&&
this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;!this.selection&&!d&&(this.serviceRegistry||this.registry?(this.selection=
new l.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var b=this.registerCommands();!b||!b.then?a.updateCommands():b.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,c.mixin(a.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,
a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new b(this)},_setMonitorMessage:function(a,b){this._progressNode.style.display="block";this._loading[a]=b;var c="",d;for(d in this._loading)""!==c&&(c+="\n"),c+=this._loading[d];this._progressNode.title=c;this._updateExpandedState(!1)},_monitorDone:function(a){delete this._loading[a];a="";for(var b in this._loading)""!==a&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;""===a&&(this._progressNode.style.display=
"none");this._updateExpandedState(!1)},_changeExpandedState:function(){this.hidden?this._expand():this._collapse();this._updateExpandedState(!0)},_updateExpandedState:function(a){var b=!this.hidden,c=this.working,d=this.twistie,e=this.id;d&&(d.classList.remove(this._expandImageClass),d.classList.remove(this._collapseImageClass),d.classList.remove(this._progressImageClass),d.classList.add(c?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(e,
b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)},_expand:function(){this._contentParent.classList.remove("sectionClosed");this.domNode.classList.remove("sectionClosed");this.hidden=!1},_collapse:function(){this.hidden=!0;this._contentParent.classList.add("sectionClosed");this.domNode.classList.add("sectionClosed")}};e.prototype.constructor=e;b.prototype={begin:function(a){this._section.working=!0;this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this._section.working=!1;this.status=a;this._section._monitorDone(this.id)}};b.prototype.constructor=b;return{Section:e}});
define("orion/sites/siteMappingsTable","i18n!orion/sites/nls/messages orion/commands orion/explorers/explorer orion/i18nUtil orion/Deferred orion/webui/littlelib orion/EventTarget".split(" "),function(h,m,f,d,c,l,e){function b(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function a(a){return a.replace(/[\r\n\t]/g,"")}var k={};k.Model=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.items=d}a.prototype=new f.ExplorerFlatModel;b(a.prototype,{getId:function(a){return a===this.root?
this.rootId:"mapping_"+this.items.indexOf(a)}});return a}();k.Renderer=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.commandService=b.commandService}a.prototype=new f.SelectionRenderer;b(a.prototype,{getCellHeaderElement:function(a){switch(a){case 0:return a=document.createElement("th"),a.textContent=" ",a.classList.add("isValidColumn"),a;case 1:return a=document.createElement("th"),a.textContent=h.Path,a;case 2:return a=document.createElement("th"),a.textContent=h["Mount at (server path)"],
a;case 3:return a=document.createElement("th"),a.textContent=h.Actions,a}},getCellElement:function(a,b,c){var d;switch(a){case 0:return this.getIsValidCell(a,b,c);case 1:return a=document.createElement("td"),c=document.createElement("input"),c.classList.add("pathInput"),c.value="undefined"!==typeof b.FriendlyPath?b.FriendlyPath:b.Target,d=function(a){this.options.onchange(b,"FriendlyPath",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 2:return a=document.createElement("td"),
c=document.createElement("input"),c.classList.add("serverPathInput"),c.value=b.Source,d=function(a){this.options.onchange(b,"Source",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 3:return this.getActionsColumn(b,c)}},getIsValidCell:function(a,b,c){a=b.Target;var e=document.createElement("td"),f,g;if(/^\//.test(a)){var k=this;this.options.siteClient.toFileLocation(a).then(function(a){f=a;var b=document.createElement("span");b.classList.add("validating");l.empty(e);
e.appendChild(b);b.textContent="\u2026";b=k.options.fileClient._getService(a).read(a,!0);k.options.progress&&k.options.progress.progress(b,"Reading metadata of "+a);b.then(function(a){var b=a&&a.Directory;a=b?"core-sprite-folder":"core-sprite-file";b=b?h.WorkspaceFolder:h.WorkspaceFile;g=document.createElement("a");g.href=f;g.target="_new";var c=document.createElement("span");c.className+="imageSprite "+a;c.title=d.formatMessage(b,f);g.appendChild(c);l.empty(e);e.appendChild(g)},function(a){g=document.createElement("a");
g.href=f;g.target="_new";a=document.createElement("span");a.className+="imageSprite core-sprite-error";a.title=d.formatMessage(h.WorkspaceResourceNotFound,f);g.appendChild(a);l.empty(e);e.appendChild(g)})})}else f=a,g=document.createElement("a"),g.href=f,g.target="_new",l.empty(e),a=document.createElement("span"),a.className+="imageSprite core-sprite-link",a.title=d.formatMessage(h.ExternalLinkTo,f),g.appendChild(a),e.appendChild(g);e.classList.add("isValidCell");return e}});return a}();k.MappingsTable=
function(){function d(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.registerCommands();this.siteClient=a.siteClient;this.parentId=a.parentId;this.selection=a.selection;this.renderer=new k.Renderer({checkbox:!1,onchange:this.fieldChanged.bind(this),siteConfiguration:a.siteConfiguration,siteClient:a.siteClient,fileClient:a.fileClient,commandService:this.commandService,progress:a.serviceRegistry.getService("orion.page.progress"),actionScopeId:"siteMappingCommand"},this);
this.myTree=null;this._setSiteConfiguration(a.siteConfiguration);this.setDirty(!1)}d.prototype=Object.create(f.Explorer.prototype);e.attach(d.prototype);b(d.prototype,{_setSiteConfiguration:function(a){this.siteConfiguration=a;this.refresh()},refresh:function(){var a=function(){return(new c).resolve(this.siteConfiguration.Mappings)}.bind(this),b=this;this.siteClient.updateMappingsDisplayStrings(this.siteConfiguration).then(function(c){b.siteConfiguration.Mappings=c.Mappings;b.createTree(b.parentId,
new k.Model(null,a,b.siteConfiguration.Mappings))})},render:function(){this.changedItem(this.siteConfiguration.Mappings,this.siteConfiguration.Mappings)},renderItemRow:function(a,b){if("FriendlyPath"===b){var c=document.getElementById(this.myTree._treeModel.getId(a)),d=l.$(".isValidCell",c),e=l.$$array("td",c).indexOf(d),c=this.renderer.getIsValidCell(e,a,c);d.parentNode.replaceChild(c,d)}},registerCommands:function(){var a=new m.Command({name:h.Delete,imageClass:"core-sprite-delete",id:"orion.site.mappings.remove",
visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in a},callback:function(a){this.deleteMapping(a.items);this.render();this.setDirty(!0)}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.remove",0);a=new m.Command({name:h["Move Up"],imageClass:"core-sprite-move-up",id:"orion.site.mappings.moveUp",visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in a}.bind(this),callback:function(a){var b=
this.getItemIndex(a.items);if(0!==b){var c=this.siteConfiguration.Mappings[b-1];this.siteConfiguration.Mappings[b-1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveUp",1);a=new m.Command({name:h["Move Down"],imageClass:"core-sprite-move-down",id:"orion.site.mappings.moveDown",visibleWhen:function(a){return"Source"in a||"Target"in
a||"FriendlyPath"in a}.bind(this),callback:function(a){var b=this.getItemIndex(a.items);if(b!==this.siteConfiguration.Mappings.length-1){var c=this.siteConfiguration.Mappings[b+1];this.siteConfiguration.Mappings[b+1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveDown",2)},getItemIndex:function(a){return this.siteConfiguration.Mappings.indexOf(a)},
_addMapping:function(b){var c=b.Source,d=b.Target,e=b.FriendlyPath;b.Source=a("string"===typeof c?c:this.getNextMountPoint(e));b.Target=a("string"===typeof d?d:"/");this.mappingExists(c,d)||this.siteConfiguration.Mappings.push(b)},addMapping:function(a){this._addMapping(a);this.render();this.setDirty(!0)},addMappings:function(a){for(var b=0;b<a.length;b++)this.addMapping(a[b]);this.render();this.setDirty(!0)},mappingExists:function(a,b){"object"===typeof a&&"undefined"===typeof b&&(b=a.Target,a=a.Source);
for(var c=this.siteConfiguration.Mappings,d=0;d<c.length;d++)if(c[d].Source===a&&c[d].Target===b)return!0;return!1},getNextMountPoint:function(a){for(var b=this.siteConfiguration.Mappings,c=!1,d=0;d<b.length;d++)if("/"===b[d].Source){c=!0;break}if(!c)return"/";if(!a)return"/web/somePath";a=a.split("/");for(d=a.length-1;0<=d;d--)if(!/\s+/.test(a[d]))return"/"+a[d];return"/web/somePath"},deleteMapping:function(a){a=this.siteConfiguration.Mappings.indexOf(a);-1!==a&&this.siteConfiguration.Mappings.splice(a,
1)},deleteAllMappings:function(){this.siteConfiguration.Mappings.splice(0,this.siteConfiguration.Mappings.length)},fieldChanged:function(b,c,d,e){d=a(d);if(b[c]!==d&&(b[c]=d,"FriendlyPath"===c)){var f=d,g=this;this.siteClient.parseInternalForm(this.siteConfiguration,f).then(function(a){b.Target=a||f;g.renderItemRow(b,c);g.setDirty(!0)})}},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty}});return d}();return k});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(h,m,f,d,c,l,e,b,a){function k(a,b,c,d,e,f){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function g(a){e.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=a.modelEventDispatcher?a.modelEventDispatcher:new e;this.modelEventDispatcher=b;var c=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){b.addEventListener(a,
c._modelListeners[a]=c.modelHandler[a].bind(c))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)c.onLinkClick({type:"linkClick",item:a._item})}};(a=f.node(this.parentId))&&a.addEventListener("click",this._clickListener);var d=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";d.setTarget&&d.setTarget(a)}},
{pid:"nav.config"})}k.prototype=new l.ExplorerModel;b.mixin(k.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var c=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var d=[],e;for(e in b)if(!(b[e].Directory?this.excludeFolders:this.excludeFiles))d.push(b[e]),b[e].parent=a,b[e].Parents||(b[e].Parents=c);b=d}else for(d in b)b[d].parent=a,b[d].Parents||(b[d].Parents=c);a.children=b;a.children.sort(this.sortChildren);return b},sortChildren:function(a,
b){var c=a.Directory;if(c!==b.Directory)return c?-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0},getChildren:function(a,b){var c=this;if(a.children)b(a.children);else if(void 0!==a.Directory&&!1===a.Directory)b([]);else if(a.Children)b(c.processParent(a,a.Children));else if(a.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(a.ChildrenLocation),h["Fetching children of "]+
a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(d){c.destroyed||b(c.processParent(a,d))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=0<this.root.Children.length);return a}});k.prototype.constructor=k;var n,p;g.prototype=Object.create(l.Explorer.prototype);b.mixin(g.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=
f.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);l.Explorer.prototype.destroy.call(this)},onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||b.treeRoot;c[a.Location]=a});return m.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelMove:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var d=
b.treeRoot;if((d.Location||d.ContentLocation)===a.oldValue.Location){var e=b.treeRoot;a=a.newValue;a=a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return m.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:e,newValue:a});b.loadResourceList(a)})}d=(d=a.oldValue.parent)||b.treeRoot;c[d.Location]=d;d=(d=a.parent)||b.treeRoot;c[d.Location]=d;a.oldValue.Directory&&(a.newValue&&b.isExpanded(a.oldValue))&&(c[a.newValue.Location]=a.newValue)});return m.all(Object.keys(c).map(function(a){return b.changedItem(c[a],
!0)}))},onModelDelete:function(a){a=a.items||[a];var b=this,c=b.treeRoot,d;if(a.some(function(a){if(a.oldValue.Location===(c.Location||c.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))d=a.parent;return!0}return!1}))return this.loadResourceList(d);var e={};a.forEach(function(a){a=a.parent;e[a.Location]=a});return m.all(Object.keys(e).map(function(a){return b.changedItem(e[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},
create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},makeNewChildItemPlaceholder:function(a,b,c){var d=new m;this.model.getChildren(a,function(e){var f=null,g=!1;if(e){e.push(b);e.sort(this.model.sortChildren);var f=
e.indexOf(b),h=f+1;e.length>h?f=e[h]:(g=f-1,f=0<=g?e[g]:a,g=!0)}else f=a;e=this.makeNewItemPlaceholder(f,c,g);d.resolve(e)}.bind(this));return d},_makeDropTarget:function(b,e,g){if(this.dragAndDrop){var k=this,l=this.dragAndDrop,v=function(a){n=a.target};g&&(this._oldDragStart&&e.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=v);e.addEventListener("dragstart",v,!1);v=function(a){n=null};g&&(this._oldDragEnd&&e.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
v);e.addEventListener("dragend",v,!1);v=function(a){e.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};g&&(this._oldDragLeave&&e.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=v);e.addEventListener("dragleave",v,!1);v=function(b){if(n)p=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
"copy";e.classList.add("dragOver");f.stop(b)};g&&(this._oldDragEnter&&e.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=v);e.addEventListener("dragenter",v,!1);v=function(b){if(n)p=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";f.stop(b)};g&&!this._oldDragOver&&(e.addEventListener("dragover",
v,!1),this._oldDragOver=v);var x=null,C=null;k.registry&&(x=k.registry.getService("orion.page.progress"),C=k.registry.getService("orion.page.message"));var A=function(a){if(C){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;C.setProgressResult(b)}else window.console.log(a)},B=function(a,e,f,g,k,l){var n=!1,q=c.isAtRoot(e.Location);l?(n=!0,l.entryCount++):a.isDirectory&&(n=!0,l={entryCount:1,deferred:new m},f._makeUploadNode(e,a.name,!0).then(function(a){var b=
function(){a.destroyFunction();q?f.loadResourceList(f.treeRoot.Path,!0):f.changedItem(e)};l.deferred.then(b,b)}));var t=function(){l&&(l.entryCount--,0===l.entryCount&&l.deferred.resolve())},r=function(a){if(C){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;C.setProgressResult(b)}else window.console.log(a);t()};!e.Location&&e.fileMetadata&&(e=e.fileMetadata);if(a.isFile)q?r(h["You cannot copy files directly into the workspace.  Create a folder first."]):
a.file(function(a){if(l){var c=a.name.indexOf(".zip")===a.name.length-4&&window.confirm(d.formatMessage(h["Unzip ${0}?"],a.name));g(e,a,f,c,!1,{error:function(b){b=h["Uploading the following file failed: "]+a.name;C?C.setProgressResult({Severity:"Error",Message:b}):window.console.log(b)},loadend:t},!0)}else f._uploadFile(b,a,!0)}.bind(this));else if(a.isDirectory){var p=a.createReader(),s=function(a){p.readEntries(function(b){for(var c=0;c<b.length;c++)B(b[c],a,f,g,k,l);t()})};q?(x?x.progress(k.createProject(e.ChildrenLocation,
a.name),d.formatMessage(h["Creating ${0}"],a.name)):k.createProject(e.ChildrenLocation,a.name)).then(function(a){(x?x.progress(k.read(a.ContentLocation,!0),h["Loading "]+a.name):k.read(a.ContentLocation,!0)).then(function(a){s(a)},r)},r):(x?x.progress(k.createFolder(e.Location,a.name),d.formatMessage(h["Creating ${0}"],a.name)):k.createFolder(e.Location,a.name)).then(function(a){var c=f.modelEventDispatcher;n||c.dispatchEvent({type:"create",parent:b,newValue:a});s(a)},r)}},v=function(a){var g;e.classList.remove("dragOver");
if(n){g=k.fileClient;for(var m=n,s;m;){if(m._item){s=m._item;break}m=m.parentNode}if(!s)return;var v="copy"===p;g=(v?g.copyFile:g.moveFile).apply(g,[s.Location,b.Location,s.Name]);x&&(m=d.formatMessage(h[v?"Copying ${0}":"Moving ${0}"],s.Location),g=x.showWhile(g,m));g.then(function(a){k.modelEventDispatcher.dispatchEvent({type:v?"copy":"move",oldValue:s,newValue:a,parent:b})},A)}else if(a.dataTransfer.items&&0<a.dataTransfer.items.length)for(g=0;g<a.dataTransfer.items.length;g++)m=null,"function"===
typeof a.dataTransfer.items[g].getAsEntry?m=a.dataTransfer.items[g].getAsEntry():"function"===typeof a.dataTransfer.items[g].webkitGetAsEntry&&(m=a.dataTransfer.items[g].webkitGetAsEntry()),m&&B(m,b,k,l,k.fileClient);else if(a.dataTransfer.files&&0<a.dataTransfer.files.length)for(g=0;g<a.dataTransfer.files.length;g++)m=a.dataTransfer.files[g],!m.size&&!m.type?A(d.formatMessage(h["Did not drop ${0}.  Folder drop is not supported in this browser."],m.name)):c.isAtRoot(b.Location)?A(h["You cannot copy files directly into the workspace.  Create a folder first."]):
k._uploadFile(b,m,!0);f.stop(a)};g&&(this._oldDrop&&e.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=v);e.addEventListener("drop",v,!1)}},_uploadFile:function(a,b,c){var e=a;!e.Location&&e.fileMetadata&&(e=e.fileMetadata);a=function(){this._makeUploadNode(e,b.name,!1).then(function(a){var c=a.refNode,f=a.progressBar,g=a.cancelButton,k=a.destroyFunction,l=this.registry.getService("orion.page.message");a={progress:function(a){var b="";if(a.lengthComputable){b=Math.floor(100*(a.loaded/a.total))+
"%";f.style.width=b;var d=Math.round(a.loaded/1024);a=Math.round(a.total/1024);f.title=h["Upload progress: "]+b+",  "+d+"/"+a+" KB";c.title=f.title}},loadend:function(a){k();this.changedItem(e)}.bind(this),error:function(a){a=h["Uploading the following file failed: "]+b.name;l?l.setProgressResult({Severity:"Error",Message:a}):window.console.log(a)}};var m=b.name.indexOf(".zip")===b.name.length-4&&window.confirm(d.formatMessage(h["Unzip ${0}?"],b.name)),n=this.dragAndDrop(e,b,this,m,!1,a,!0);g.addEventListener("click",
function(){n.abort()})}.bind(this))}.bind(this);c?this.expandItem(e,!1).then(a):a()},_makeUploadNode:function(a,b,c){var d=this.getRow(a).id;return this.makeNewChildItemPlaceholder(a,{Name:b,Directory:c},d).then(function(a){var d=null,e,f;if(a){d={};e=a.refNode;f=a.wrapperNode;e.classList.add("uploadNode");d.refNode=e;d.wrapperNode=f;f=document.createElement("span");f.classList.add("uploadNodeText");f.appendChild(document.createTextNode(b));e.appendChild(f);f=document.createElement("span");f.classList.add("progressBarWrapper");
var g=document.createElement("span");g.classList.add("progressBar");f.appendChild(g);e.appendChild(f);d.progressBar=g;c?(g.classList.add("continuous"),e.title=h["Uploading "]+b,g.title=e.title):(f=document.createElement("button"),f.classList.add("imageSprite"),f.classList.add("core-sprite-delete"),f.classList.add("uploadCancelButton"),f.title=h["Cancel upload"],e.appendChild(f),d.cancelButton=f);d.destroyFunction=a.destroyFunction}return d}.bind(this))},createModel:function(){return new k(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this,d=new m;a.children=a.Children=null;this.model.getChildren(a,function(e){c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,e,b);d.resolve(e)});return d},showItem:function(a,b){var c=new m;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return c.reject();
var d=this.getRow(a);if(d)c.resolve(d._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var c=this.getRow(a);return!c?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new m).reject()}.bind(this)):c._item||a}.bind(this))):void 0===b||b?this.reroot(a):c.reject();return c},expandItem:function(a,b){var c=new m;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):
this.myTree.expand(this.model.getId(a),function(){c.resolve(a)})}.bind(this),c.reject);return c},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(a){return(new m).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return f.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(a){},
loadResourceList:function(a,b,d){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=c.makeRelative(a);if(!b&&a===this._lastPath)return(new m).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),h["Loading "]+a).then(function(b){e.treeRoot.Path=a;"function"===typeof d&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new m).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new m).reject(a)}):(new m).resolve(e.treeRoot)},load:function(a,b,c){var d=f.node(this.parentId),e=f.node("progress");e||(e=document.createElement("div"),e.id="progress",f.empty(d),d.appendChild(e));f.empty(e);var g=setTimeout(function(){f.empty(e);e.appendChild(document.createTextNode(b))},500),h=this;return m.when(a,function(a){clearTimeout(g);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();h.dragAndDrop&&(h._hookedDrag?h._makeDropTarget(h.treeRoot,
d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,d,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser."))));var e=new m;h.createTree(h.parentId,h.model,{onComplete:function(a){e.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:"undefined"===typeof h.setFocus?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return e.then(function(){if("function"===typeof c)try{c()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===typeof h.onchange)h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(g);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new m).reject(a)})},onchange:function(a){}});g.prototype.constructor=g;return{FileExplorer:g,FileModel:k}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages orion/webui/littlelib orion/webui/dialog orion/fileUtils orion/selection orion/explorers/navigationUtils orion/explorers/explorer orion/explorers/explorer-table".split(" "),function(h,m,f,d,c,l,e,b){function a(a,b){this.explorer=b;this._init(a)}function k(a){this._init(a)}a.prototype=new e.SelectionRenderer;a.prototype.constructor=a;a.prototype.getLabelColumnIndex=function(){return 0};a.prototype.getCellElement=
function(a,b,c){a=document.createElement("td");c.appendChild(a);var d=document.createElement("span");d.id=c.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(c,d);d.appendChild(document.createTextNode(b.Name))};k.prototype=new f.Dialog;k.prototype.TEMPLATE='\x3cdiv id\x3d"message" style\x3d"width: 25em; padding-bottom: 5px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"directoryTree" class\x3d"explorerTreeClass" style\x3d"width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"\x3e\x3c/div\x3e';
k.prototype._init=function(a){this.title=a.title||h["Choose a Folder"];this.modal=!0;this.buttons=[{text:h.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};k.prototype._bindToDom=function(a){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
k.prototype.loadFolderList=function(e){e=d.makeRelative(e);this.selection=new c.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new b.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(b){return new a({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},b)}});this.explorer.loadResourceList(e,!0,null)};k.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};k.prototype.constructor=k;return{DirectoryPrompterDialog:k}});define("text!orion/sites/templates/SiteEditor.html",[],function(){return'\x3cdiv class\x3d"siteEditor"\x3e\n\t\x3cdiv class\x3d"sectionTable" role\x3d"region"\x3e\n\t\t\x3cform id\x3d"siteForm" class\x3d"siteForm sectionTableItem"\x3e\n\t\t\t\x3cdiv class\x3d"siteEditorTable"\x3e\n\t\t\t\t\x3cdiv\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"siteConfigNameLabel"\x3e${Name:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell"\x3e\n\t\t\t\t\t\t\x3cinput class\x3d"siteConfigName" required\x3d"required" pattern\x3d"\\s*\\S+\\s*" value\x3d""\x3e\n\t\t\t\t\t\t\x3cdiv class\x3d"nameInvalid"\x3e${Not a valid name}\x3c/div\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\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"hostHintLabel"\x3e${Hostname hint:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell"\x3e\n\t\t\t\t\t\t\x3cinput class\x3d"hostHint" required\x3d"required" pattern\x3d"^(?:\\s*|[A-Za-z0-9-]+)$" value\x3d""\x3e\n\t\t\t\t\t\t\x3cem\x3e${Optional; used to determine the URL where a started site can be accessed.}\x3c/em\x3e\n\t\t\t\t\t\t\x3cdiv class\x3d"hostInvalid"\x3e${Not a valid hostname}\x3c/div\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\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"hostingStatusLabel"\x3e${Status:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell hostingStatusArea"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hostingStatus"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"siteStartedWarning"\x3e\n\t\t\t\t\t\t\t\x3cem\x3e${Changes you make here won\'t affect the running site.}\x3c/em\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\x3c/div\x3e\n\t\t\x3c/form\x3e\n\t\x3c/div\x3e\n\n\t\x3cdiv class\x3d"siteEditorTable"\x3e\n\t\t\x3cdiv class\x3d"mappingsGridTable"\x3e\x3c/div\x3e\n\n\t\t\x3cdiv class\x3d"convertToolbar"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\n\x3c/div\x3e'});
define("text!orion/sites/templates/ConvertToSelfHostingDialog.html",[],function(){return'\x3cdiv\x3e\n\t\x3cstyle\x3e\n\t.form {\n\t\twidth: auto;\n\t\tlist-style-type: none; \n\t\tpadding: 0; \n\t\tmargin: 0;\n\t\t-webkit-padding-start: 0;\n\t\t-webkit-margin-before: 0;\n\t}\n\t.form li {\n\t\tmargin: 0;\n\t}\n\t.msg {\n\t\tclear: both;\n\t\twidth: 25em;\n\t}\n\t.pad1 { padding: 8px 0 0 0; }\n\t.pad2 { padding: 20px 0 0 0; }\n\t.browseButton { margin: 0 5px 0 5px; }\n\t.folderName {\n\t\tfont-weight: bold;\n\t}\n\t.field {\n\t\tfloat: left;\n\t\twidth: 6em;\n\t}\n\t.col { float: left; }\n\t.okButton {\n\t\tfloat: right;\n\t\tclear: both;\n\t}\n\t\x3c/style\x3e\n\t\x3cdiv\x3e\n\t\t\x3cul class\x3d"form"\x3e\n\t\t\t\x3cli class\x3d"msg" id\x3d"selectRequired"\x3e\n\t\t\t\t\x3cdiv\x3e${LabelSelectRequired}\x3c/div\x3e\n\t\t\t\x3c/li\x3e\n\n\t\t\t\x3c!-- Elements are dynamically added here for each required folder. Each folder follows this pattern: --\x3e\n\t\t\t\x3c!--\n\t\t\t\x3cli class\x3d"msg pad2"\x3e\x3cdiv class\x3d"col"\x3eorion.client - Orion client repository:\x3c/div\x3e\x3c/li\x3e\n\t\t\t\x3cli class\x3d"pad1"\x3e\n\t\t\t\t\x3cdiv class\x3d"col"\x3e\n\t\t\t\t\t\x3cbutton class\x3d"browseButton commandButton" type\x3d"button"\x3eBrowse...\x3c/button\x3e\n\t\t\t\t\t\x3cspan class\x3d"folderText"\x3eimpress.js\x3c/span\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\x3c/li\x3e\n\t\t\t--\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/sites/SiteEditor","i18n!orion/sites/nls/messages i18n!orion/widgets/nls/messages orion/commands orion/Deferred orion/section orion/objects orion/sites/siteMappingsTable orion/i18nUtil orion/webui/littlelib orion/EventTarget orion/webui/dialogs/DirectoryPrompterDialog orion/webui/dialog text!orion/sites/templates/SiteEditor.html text!orion/sites/templates/ConvertToSelfHostingDialog.html".split(" "),function(h,m,f,d,c,l,e,b,a,k,g,n,p,u){var r=function(a){this.options=a=a||{};l.mixin(this,
a);this._init(a)};r.prototype=new n.Dialog;l.mixin(r.prototype,{TEMPLATE:u,_init:function(a){this.title=a.title||h["Convert to Self-Hosting"];this.buttons=[{text:h.OK,callback:this.okButtonClicked.bind(this)}];this.modal=!0;this.folders=this.selfHostingConfig.folders;this.messages={};l.mixin(this.messages,h);this.messages.LabelSelectRequired=1===this.folders.length?h.SelectRequiredFoldersSingle:h.SelectRequiredFolders;this._initialize()},_bindToDom:function(){this.$okButton=this.$buttonContainer.firstChild;
this.$okButton.classList.add("disabled");this.browseButtons=[];this.folderTexts=[];this.appendFolderElements();this.updateValidity()},appendFolderElements:function(){var b=this,c=document.createDocumentFragment();this.folders.forEach(function(d,e){var f=document.createElement("li");f.className="msg pad2";var g=document.createElement("div");g.textContent=h.FolderPrompt;var k=document.createElement("span");k.className="folderName";k.textContent=d.name;a.processDOMNodes(g,[k,document.createTextNode(d.label)]);
f.appendChild(g);c.appendChild(f);f=document.createElement("li");f.className="pad1";g=document.createElement("div");g.className="col";k=document.createElement("button");k.className="browseButton commandButton";k.textContent=m["Browse..."];k.type="button";var l=document.createElement("span");l.className="folderText";g.appendChild(k);g.appendChild(l);f.appendChild(g);b.browseButtons.push(k);b.folderTexts.push(l);c.appendChild(f);k.addEventListener("click",b.showChooseFolderDialog.bind(b,e))});b.$selectRequired.parentNode.appendChild(c,
null)},showChooseFolderDialog:function(a){a=new g.DirectoryPrompterDialog({title:b.formatMessage(h.LocateFolderTitle,this.folders[a].name),serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:this.onFolderChosen.bind(this,a)});this._addChildDialog(a);a.show()},onFolderChosen:function(a,b){this.folders[a].folder=b;this.folderTexts[a].textContent=b?b.Name:"";this.updateValidity()},isValid:function(){return this.folders.every(function(a){return a.folder})},updateValidity:function(){this.isValid()?
this.$okButton.classList.remove("disabled"):this.$okButton.classList.add("disabled")},okButtonClicked:function(){this.isValid()&&(this.hide(),"function"===typeof this.options.func&&this.options.func(this.folders))}});var s="/";n=function(a,b){a=a||{};l.mixin(this,a);this.options=a;this.checkOptions(this.options,"serviceRegistry fileClient siteClient commandService statusService progressService".split(" "));this._fileClient=this.options.fileClient;this._siteClient=this.options.siteClient;this._commandService=
this.options.commandService;this._statusService=this.options.statusService;this._progressService=this.options.progressService;this._commandsContainer=this.options.commandsContainer;this.options.location&&this.load(this.options.location);this.node=b||document.createElement("div")};k.attach(n.prototype);l.mixin(n.prototype,{_siteConfiguration:null,_modelListeners:null,mappings:null,_mappingProposals:null,_isSelfHostingSite:!1,_isDirty:!1,_autoSaveTimer:null,show:function(){this.createElements();this.postCreate()},
createElements:function(){this.node.innerHTML=p;a.processTextNodes(this.node,h);this.siteForm=a.$(".siteForm",this.node);this.name=a.$(".siteConfigName",this.node);this.name.id=this.id+"_name";this.nameInvalid=a.$(".nameInvalid",this.node);this.hostHint=a.$(".hostHint",this.node);this.hostHint.id=this.id+"_hostHint";this.hostInvalid=a.$(".hostInvalid",this.node);this.hostingStatus=a.$(".hostingStatus",this.node);this.siteStartedWarning=a.$(".siteStartedWarning",this.node);this.mappingsPlaceholder=
a.$(".mappingsGridTable");this.mappingsPlaceholder.id=this.id+"_mappingsPlaceholder";this.convertToolbar=a.$(".convertToolbar");this.convertToolbar.id=this.id+"_convertToolbar";a.$(".siteConfigNameLabel",this.node).htmlFor=name.id;a.$(".hostHintLabel",this.node).htmlFor=this.hostHint.id},postCreate:function(){var a=this;this.name.addEventListener("input",function(b){a.name.checkValidity()?(a.name.classList.remove("invalid"),a.nameInvalid.classList.remove("visible")):(a.name.classList.add("invalid"),
a.nameInvalid.classList.add("visible"))});this.hostHint.addEventListener("change",function(b){a.hostHint.checkValidity()?(a.hostHint.classList.remove("invalid"),a.hostInvalid.classList.remove("visible")):(a.hostHint.classList.add("invalid"),a.hostInvalid.classList.add("visible"))});var b=this;d.when(this.siteClient._canSelfHost(),function(a){var c=new f.Command({name:h["Convert to Self-Hosting"],tooltip:h["Enable the site configuration to launch an Orion server running your local client code"],imageClass:"core-sprite-add",
id:"orion.site.convert",visibleWhen:function(c){return!!c.Location&&a&&!b._isSelfHostingSite},callback:b.convertToSelfHostedSite.bind(b)});b._commandService.addCommand(c)});this._autoSaveTimer=setTimeout(this.autoSave.bind(this),8E3)},checkOptions:function(a,b){for(var c=0;c<b.length;c++)if("undefined"===typeof a[b[c]])throw Error("options."+b[c]+" is required");},_makeAddMenuChoices:function(a,b,c){function d(a){e.getSiteConfiguration().Mappings.some(function(a){return a.Source===s})||(a.Source=
s);e.mappings.addMapping(a)}b=Array.isArray(b)?b[0]:b;a=a.sort(function(a,b){return a.FriendlyPath.toLowerCase().localeCompare(b.FriendlyPath.toLowerCase())});var e=this,f=function(a){d(this.mapping)};b=a.map(function(a){return{name:a.FriendlyPath,imageClass:"core-sprite-folder",mapping:a,callback:f}});0<a.length&&b.push({});b.push({name:h["Choose folder..."],imageClass:"core-sprite-folder",callback:function(){(new g.DirectoryPrompterDialog({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,
func:function(a){a&&this._siteClient.getMappingObject(this.getSiteConfiguration(),a.Location,a.Name).then(function(a){f.call({mapping:a})})}.bind(this)})).show()}.bind(this)});b.push({name:h.URL,imageClass:"core-sprite-link",callback:function(){d({Source:"/web/somePath",Target:"http://",FriendlyPath:"http://"})}});return b},convertToSelfHostedSite:function(a,c){var e=this._siteClient.getSelfHostingConfig(),f=[];e.folders.forEach(function(a){a.nls&&f.push(b.getMessageBundle(a.nls).then(function(b){a.label=
b[a.labelKey]||a.label||a.labelKey}))});d.all(f,function(a){return a}).then(function(){var a=this;(new r({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,siteClient:this._siteClient,selfHostingConfig:e,func:function(b){b=b.map(function(a){return a.folder.Location});a._siteClient.convertToSelfHosting(a.getSiteConfiguration(),b).then(function(b){a.mappings.deleteAllMappings();a.mappings.addMappings(b.Mappings);a.save()})}})).show()}.bind(this))},load:function(a){var b=new d;this._busyWhile(b,
"Loading...");this._siteClient.loadSiteConfiguration(a).then(function(a){this._setSiteConfiguration(a);this.setDirty(!1);b.resolve(a)}.bind(this),function(a){b.reject(a)});return b},_setSiteConfiguration:function(a){this._detachListeners();this._siteConfiguration=a;if(!this._mappingProposals){var b=this._commandService;this._mappingProposals=this._siteClient.getMappingProposals(a).then(function(a){a=new f.Command({name:h.Add,tooltip:h["Add a directory mapping to the site configuration"],id:"orion.site.mappings.add",
visibleWhen:function(a){return!0},choiceCallback:this._makeAddMenuChoices.bind(this,a)});b.addCommand(a);a=this.titleWrapper.actionsNode;b.registerCommandContribution(a.id,"orion.site.mappings.add",1);b.renderCommands(a.id,a,this.mappings,this,"button")}.bind(this))}this._refreshCommands();this._refreshFields()},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty},_refreshCommands:function(){function a(b){c._onError(b)}function b(a){c._setSiteConfiguration(a);
c.setDirty(!1)}var c=this;this._siteClient.isSelfHostingSite(this.getSiteConfiguration()).then(function(d){c._isSelfHostingSite=d;c._commandService.destroy(c._commandsContainer);c._commandService.renderCommands(c._commandsContainer.id,c._commandsContainer,c._siteConfiguration,{},"button",{site:c._siteConfiguration,startCallback:b,stopCallback:b,errorCallback:a})})},_refreshFields:function(){this.name.setAttribute("value",this._siteConfiguration.Name);this.hostHint.setAttribute("value",this._siteConfiguration.HostHint);
this.mappings?this.mappings._setSiteConfiguration(this._siteConfiguration):(this.titleWrapper=new c.Section(document.getElementById(this.mappingsPlaceholder.id),{id:"workingDirectorySection",title:h.Mappings,content:'\x3cdiv id\x3d"mappingsNode"/\x3e',canHide:!0}),this.mappings=new e.MappingsTable({serviceRegistry:this.serviceRegistry,siteClient:this._siteClient,fileClient:this._fileClient,commandRegistry:this._commandService,selection:null,parentId:"mappingsNode",siteConfiguration:this._siteConfiguration}));
var b=this._siteConfiguration.HostingStatus;if(b&&"started"===b.Status){this.siteStartedWarning.style.display="block";this.hostingStatus.textContent=h.Started;var d=document.createElement("a");d.href=b.URL;d.target="_new";d.textContent=b.URL;a.processDOMNodes(this.hostingStatus,[d])}else b&&"stopped"===b.Status&&(this.siteStartedWarning.style.display="none",this.hostingStatus.textContent=h.Stopped);setTimeout(function(){this._attachListeners(this._siteConfiguration)}.bind(this),0)},_attachListeners:function(a){function b(d,
e){function f(b){b=d.value;var g=a[e];a[e]=b;c.setDirty(g!==b||c.isDirty())}d.addEventListener("input",f);c._modelListeners.push({target:d,type:"input",listener:f})}this._detachListeners();this._modelListeners=this._modelListeners||[];var c=this;b(this.name,h.Name);b(this.hostHint,h.HostHint);var d=function(a){c.setDirty(a.value)};this.mappings.addEventListener("dirty",d);this._modelListeners.push({target:this.mappings,type:"dirty",listener:d})},_detachListeners:function(){if(this._modelListeners){for(var a=
0;a<this._modelListeners.length;a++){var b=this._modelListeners[a];b.target.removeEventListener(b.type,b.listener)}this._modelListeners.splice(0)}},getSiteConfiguration:function(){return this._siteConfiguration},getResource:function(){return this._siteConfiguration&&this._siteConfiguration.Location},save:function(a){a="undefined"===typeof a?!0:a;var b=this._siteConfiguration,c=b.HostingStatus;delete b.HostingStatus;var d=this,e=this._siteClient.updateSiteConfiguration(b.Location,b).then(function(e){d.setDirty(!1);
if(a)return d._setSiteConfiguration(e),e;b.HostingStatus=c;d._refreshCommands();return b});this._busyWhile(e);return!0},autoSave:function(){this.isDirty()&&this.save(!1);setTimeout(this.autoSave.bind(this),8E3)},_busyWhile:function(a,b){a.then(this._onSuccess.bind(this),this._onError.bind(this));this.progressService.showWhile(a,b)},_onSuccess:function(a){this.onSuccess(a)},_onError:function(a){this._statusService.setErrorMessage(a);this.onError(a)},onSuccess:function(a){this.dispatchEvent({type:"success",
deferred:a})},onError:function(a){this.dispatchEvent({type:"error",deferred:a})}});return n});
define("sites/site","require i18n!orion/sites/nls/messages orion/bootstrap orion/status orion/progress orion/commandRegistry orion/fileClient orion/operationsClient orion/searchClient orion/dialogs orion/globalCommands orion/sites/siteClient orion/sites/siteCommands orion/PageUtil orion/sites/SiteEditor".split(" "),function(h,m,f,d,c,l,e,b,a,k,g,n,p,u,r){f.startup().then(function(e){var f=e.serviceRegistry,t=e.preferences;new k.DialogService(f);var v=new b.OperationsClient(f);e=new d.StatusReportingService(f,
v,"statusPane","notifications","notificationArea");var x=new l.CommandRegistry({}),v=new c.ProgressService(f,v,x),C=u.matchResourceParameters().resource,C=n.forLocation(f,C),A=C._getFileClient(),B=new a.Searcher({serviceRegistry:f,commandService:x,fileService:A});g.generateBanner("orion-site",f,x,t,B);var w,K=function(){var a=w&&w.getSiteConfiguration();if(w&&a){var b={Parents:[]};b.Name=a.Name;b.Parents[0]={};b.Parents[0].Name=m.Sites;b.Parents[0].Location="";g.setPageTarget({task:"Edit Site",target:a,
breadcrumbTarget:b,makeBreadcrumbLink:function(a,b){a.href=h.toUrl("sites/sites.html")},serviceRegistry:f,searchService:B,fileService:A,commandService:x});g.setDirtyIndicator(w.isDirty())}},t=function(){var a=u.matchResourceParameters().resource;a&&a!==w.getResource()&&(!w.isDirty()||confirm(m["There are unsaved changes. Do you still want to navigate away?"]))&&w.load(a).then(function(){K()})};window.addEventListener("hashchange",t);w=new r({serviceRegistry:f,fileClient:A,siteClient:C,commandService:x,
statusService:e,progressService:v,commandsContainer:document.getElementById("pageActions"),id:"site-editor"});document.getElementById("site").appendChild(w.node);w.show();w.addEventListener("success",K);w.addEventListener("dirty",K);t();window.onbeforeunload=function(){if(w.isDirty())return m["There are unsaved changes."]};p.createSiteCommands(f,x);x.registerCommandContribution("pageActions","orion.site.start",1);x.registerCommandContribution("pageActions","orion.site.stop",2);x.registerCommandContribution("pageActions",
"orion.site.convert",3)})});
//@ sourceMappingURL=site.js.map