/*

 Copyright (c) 2011 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
 RequireJS i18n 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2004, 2011, The Dojo Foundation and others. All Rights Reserved.
 Available via Academic Free License >= 2.1 OR the modified BSD license.
 see: http://dojotoolkit.org/license for details

 Contributors:
 Dojo Foundation: _handleOnChange function, and cookie management code
 IBM Corporation: Initial API and implementation of the remainder of the script

 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
*/
(function(){function d(a,b,c){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var f=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,h;h=f[g++];)console[h]||function(){var t=h+"";console[t]="log"in console?function(){var v=Array.apply({},arguments);v.unshift(t+":");console.log(v.join(" "))}:function(){};console[t]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var i=a;if(typeof b=="undefined")b={_scopeName:"dijit"};if(typeof c=="undefined")c={_scopeName:"dojox"};if(!i._scopeArgs)i._scopeArgs=[a,b,c];i.global=this;i.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var j in f)i.config[j]=f[j];a.locale=i.config.locale;j="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:j?+j[0]:NaN,toString:function(){with(i.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",i.version.toString());var l,n,p={};for(g in{toString:1}){l=[];break}a._extraNames=l=l||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];n=l.length;a._mixin=function(t,v){var r,u,q;for(r in v){u=v[r];
if(!(r in t)||t[r]!==u&&(!(r in p)||p[r]!==u))t[r]=u}if(n&&v)for(q=0;q<n;++q){r=l[q];u=v[r];if(!(r in t)||t[r]!==u&&(!(r in p)||p[r]!==u))t[r]=u}return t};a.mixin=function(t){t||(t={});for(var v=1,r=arguments.length;v<r;v++)i._mixin(t,arguments[v]);return t};a._getProp=function(t,v,r){r=r||i.global;for(var u=0,q;r&&(q=t[u]);u++){if(u==0&&i._scopeMap[q])q=i._scopeMap[q];r=q in r?r[q]:v?(r[q]={}):undefined}return r};a.setObject=function(t,v,r){var u=t.split(".");t=u.pop();return(r=i._getProp(u,true,
r))&&t?(r[t]=v):undefined};a.getObject=function(t,v,r){return i._getProp(t.split("."),v,r)};a.exists=function(t,v){return i.getObject(t,false,v)!==undefined};a.eval=function(t){return i.global.eval?i.global.eval(t):eval(t)};i.deprecated=i.experimental=function(){}})();return{dojo:a,dijit:b,dojox:c}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=d();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var e=d();dojo=e.dojo;dijit=e.dijit;dojox=e.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(d,e){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],b,c;for(b=0;b<a.length;){c=a[b++];e[c]=function(t){return function(){console.warn("dojo."+t+" not available when using an AMD loader.")}}(c)}var f=function(t){var v=[],r;for(r=0;r<t.length;)v.push(t[r++]);
return v},g=function(t,v){return v?typeof v=="string"?function(){t[v]()}:function(){v.call(t)}:t};e.ready=e.addOnLoad=function(t,v){d.ready(v?g(t,v):t)};e.addOnLoad(function(){e.postLoad=e.config.afterOnLoad=true});if(a=e.config.addOnLoad)e.addOnLoad[a instanceof Array?"apply":"call"](e,a);var h=e._loaders=[],i=function(){var t=h.slice(0);for(Array.prototype.splice.apply(h,[0,h.length]);t.length;)t.shift().call()};h.unshift=function(){Array.prototype.unshift.apply(h,f(arguments));d.ready(i)};h.splice=
function(){Array.prototype.splice.apply(h,f(arguments));d.ready(i)};var j=e._unloaders=[];e.unloaded=function(){for(;j.length;)j.pop().call()};e._onto=function(t,v,r){t.push(r?g(v,r):v)};e._modulesLoaded=function(){};e.loadInit=function(t){t()};var l=function(t){return t.replace(/\./g,"/")};e.getL10nName=function(t,v,r){r=r?r.toLowerCase():e.locale;t="i18n!"+l(t);return/root/i.test(r)?t+"/nls/"+v:t+"/nls/"+r+"/"+v};e.requireLocalization=function(t,v,r){if(d.vendor!="altoviso.com")r=!r||r.toLowerCase()===
e.locale?"root":r;return d(e.getL10nName(t,v,r))};e.i18n={getLocalization:e.requireLocalization,normalizeLocale:function(t){t=t?t.toLowerCase():e.locale;if(t=="root")t="ROOT";return t}};var n=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,p=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;e._Url=function(){for(var t=arguments,v=[t[0]],r=1;r<t.length;r++)if(t[r]){var u=new e._Url(t[r]+"");v=new e._Url(v[0]+"");if(u.path==""&&!u.scheme&&!u.authority&&!u.query){if(u.fragment!=
null)v.fragment=u.fragment;u=v}else if(!u.scheme){u.scheme=v.scheme;if(!u.authority){u.authority=v.authority;if(u.path.charAt(0)!="/"){v=(v.path.substring(0,v.path.lastIndexOf("/")+1)+u.path).split("/");for(var q=0;q<v.length;q++)if(v[q]==".")if(q==v.length-1)v[q]="";else{v.splice(q,1);q--}else if(q>0&&!(q==1&&v[0]=="")&&v[q]==".."&&v[q-1]!="..")if(q==v.length-1){v.splice(q,1);v[q-1]=""}else{v.splice(q-1,2);q-=2}u.path=v.join("/")}}}v=[];u.scheme&&v.push(u.scheme,":");u.authority&&v.push("//",u.authority);
v.push(u.path);u.query&&v.push("?",u.query);u.fragment&&v.push("#",u.fragment)}this.uri=v.join("");r=this.uri.match(n);this.scheme=r[2]||(r[1]?"":null);this.authority=r[4]||(r[3]?"":null);this.path=r[5];this.query=r[7]||(r[6]?"":null);this.fragment=r[9]||(r[8]?"":null);if(this.authority!=null){r=this.authority.match(p);this.user=r[3]||null;this.password=r[4]||null;this.host=r[6]||r[7];this.port=r[9]||null}};e._Url.prototype.toString=function(){return this.uri};e.moduleUrl=function(t,v){if(!t)return null;
t=l(t)+(v?"/"+v:"");v="";var r=t.match(/(.+)(\.[^\/]*)$/);if(r){t=r[1];v=r[2]}return new e._Url(d.nameToUrl(t,v))};return e});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(d){if(typeof window!="undefined"){d.isBrowser=true;d._name="browser";(function(){var a=d;if(document&&document.getElementsByTagName)for(var b=document.getElementsByTagName("script"),c=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<b.length;f++){var g=b[f].getAttribute("src");if(g){var h=g.match(c);if(h){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,h.index);if(b=b[f].getAttribute("djConfig")||b[f].getAttribute("data-dojo-config")){b=
eval("({ "+b+" })");for(var i in b)d.config[i]=b[i]}break}}}a.baseUrl=a.config.baseUrl;i=navigator;b=i.userAgent;c=i.appVersion;f=parseFloat(c);if(b.indexOf("Opera")>=0)a.isOpera=f;if(b.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=c.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;a.isMac=c.indexOf("Macintosh")>=0;if((g=Math.max(c.indexOf("WebKit"),c.indexOf("Safari"),0))&&!d.isChrome){a.isSafari=parseFloat(c.split("Version/")[1]);
if(!a.isSafari||parseFloat(c.substr(g+7))<=419.3)a.isSafari=2}if(b.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(b.split("Firefox/")[1]||b.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(c.split("MSIE ")[1])||undefined;if((b=document.documentMode)&&b!=5&&Math.floor(a.isIE)!=b)a.isIE=b}if(d.isIE&&window.location.protocol==="file:")d.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
d.config.locale||(a.isIE?i.userLanguage:i.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var r,u;if(!d.isIE||!d.config.ieForceActiveXXhr)try{r=new XMLHttpRequest}catch(q){}if(!r)for(var x=0;x<3;++x){var z=a._XMLHTTP_PROGIDS[x];try{r=new ActiveXObject(z)}catch(C){u=C}if(r){a._XMLHTTP_PROGIDS=[z];break}}if(!r)throw new Error("XMLHTTP not available: "+u);return r};a._isDocumentOk=function(r){r=r.status||0;var u=location.protocol;
return r>=200&&r<300||r==304||r==1223||!r&&(u=="file:"||u=="chrome:"||u=="chrome-extension:"||u=="app:")};var j=window.location+"";var l=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(r,u){var q=a._xhrObj();if(!l&&d._Url)r=(new d._Url(j,r)).toString();if(a.config.cacheBust){r+="";r+=(r.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}q.open("GET",r,false);try{q.send(null);if(!a._isDocumentOk(q)){var x=Error("Unable to load "+r+" status:"+q.status);
x.status=q.status;x.responseText=q.responseText;throw x;}}catch(z){if(u)return null;throw z;}return q.responseText};var n=window,p=function(r,u){var q=n.attachEvent||n.addEventListener;r=n.attachEvent?r:r.substring(2);q(r,function(){u.apply(n,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var r=a._windowUnloaders;r.length;)r.pop()();a=null};var t=0;a.addOnWindowUnload=function(r,u){a._onto(a._windowUnloaders,r,u);if(!t){t=1;p("onunload",a.windowUnloaded)}};var v=0;a.addOnUnload=
function(r,u){a._onto(a._unloaders,r,u);if(!v){v=1;p("onbeforeunload",d.unloaded)}}})();d._initFired=false;d._loadInit=function(){if(d._scrollIntervalId){clearInterval(d._scrollIntervalId);d._scrollIntervalId=0}if(!d._initFired){d._initFired=true;!d.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",d._loadInit);d._inFlightCount==0&&d._modulesLoaded()}};if(!d.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",d._loadInit,false);window.addEventListener("load",
d._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",d._loadInit);if(!d.config.skipIeDomLoaded&&self===self.top)d._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");d._loadInit()}}catch(a){}},30)}if(d.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],b=0,c=1,f=document.createStyleSheet();if(d.isIE>=8){b=
1;c=a.length}for(;b<c;++b)f.addRule("v\\:"+a[b],"behavior:url(#default#VML); display:inline-block")})()}catch(e){}}(function(){var a=d.config.modulePaths;if(a)for(var b in a)d.registerModulePath(b,a[b])})();d.config.isDebug&&d.require("dojo._firebug.firebug");if(d.config.debugAtAllCosts){d.require("dojo._base._loader.loader_debug");d.require("dojo.i18n")}return d});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(d){return dojo=d});
define("dojo/_base/lang",["dojo/lib/kernel"],function(d){(function(){var e=Object.prototype.toString;d.isString=function(i){return typeof i=="string"||i instanceof String};d.isArray=function(i){return i&&(i instanceof Array||typeof i=="array")};d.isFunction=function(i){return e.call(i)==="[object Function]"};d.isObject=function(i){return i!==undefined&&(i===null||typeof i=="object"||d.isArray(i)||d.isFunction(i))};d.isArrayLike=function(i){return i&&i!==undefined&&!d.isString(i)&&!d.isFunction(i)&&
!(i.tagName&&i.tagName.toLowerCase()=="form")&&(d.isArray(i)||isFinite(i.length))};d.isAlien=function(i){return i&&!d.isFunction(i)&&/\{\s*\[native code\]\s*\}/.test(String(i))};d.extend=function(i){for(var j=1,l=arguments.length;j<l;j++)d._mixin(i.prototype,arguments[j]);return i};d._hitchArgs=function(i,j){var l=d._toArray(arguments,2),n=d.isString(j);return function(){var p=d._toArray(arguments),t=n?(i||d.global)[j]:j;return t&&t.apply(i||this,l.concat(p))}};d.hitch=function(i,j){if(arguments.length>
2)return d._hitchArgs.apply(d,arguments);if(!j){j=i;i=null}if(d.isString(j)){i=i||d.global;if(!i[j])throw['dojo.hitch: scope["',j,'"] is null (scope="',i,'")'].join("");return function(){return i[j].apply(i,arguments||[])}}return!i?j:function(){return j.apply(i,arguments||[])}};d.delegate=d._delegate=function(){function i(){}return function(j,l){i.prototype=j;j=new i;i.prototype=null;l&&d._mixin(j,l);return j}}();var a=function(i,j,l){return(l||[]).concat(Array.prototype.slice.call(i,j||0))},b=function(i,
j,l){l=l||[];for(j=j||0;j<i.length;j++)l.push(i[j]);return l};d._toArray=d.isIE?function(i){return(i.item?b:a).apply(this,arguments)}:a;d.partial=function(){return d.hitch.apply(d,[null].concat(d._toArray(arguments)))};var c=d._extraNames,f=c.length,g={};d.clone=function(i){if(!i||typeof i!="object"||d.isFunction(i))return i;if(i.nodeType&&"cloneNode"in i)return i.cloneNode(true);if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i);var j,l,n,p;if(d.isArray(i)){j=
[];l=0;for(n=i.length;l<n;++l)l in i&&j.push(d.clone(i[l]))}else j=i.constructor?new i.constructor:{};for(p in i){n=i[p];if(!(p in j)||j[p]!==n&&(!(p in g)||g[p]!==n))j[p]=d.clone(n)}if(f)for(l=0;l<f;++l){p=c[l];n=i[p];if(!(p in j)||j[p]!==n&&(!(p in g)||g[p]!==n))j[p]=n}return j};d.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var h=/\{([^\}]+)\}/g;d.replace=function(i,j,l){return i.replace(l||h,d.isFunction(j)?j:function(n,
p){return d.getObject(p,false,j)})}})();return d});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var e=function(b,c,f){return[typeof b=="string"?b.split(""):b,c||d.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(b,c,f,g){var h=e(c,g,f);c=h[0];f=0;for(g=c.length;f<g;++f){var i=!!h[2].call(h[1],c[f],f,c);if(b^i)return i}return b};d.mixin(d,{indexOf:function(b,c,f,g){var h=1,i=b.length||0,j=0;if(g){j=i-1;h=i=-1}if(f!=undefined)j=f;if(g&&j>i||j<i)for(;j!=i;j+=h)if(b[j]==c)return j;
return-1},lastIndexOf:function(b,c,f){return d.indexOf(b,c,f,true)},forEach:function(b,c,f){if(b&&b.length){var g=e(b,f,c);b=g[0];c=0;for(f=b.length;c<f;++c)g[2].call(g[1],b[c],c,b)}},every:function(b,c,f){return a(true,b,c,f)},some:function(b,c,f){return a(false,b,c,f)},map:function(b,c,f,g){var h=e(b,f,c);b=h[0];c=g?new g:[];f=0;for(g=b.length;f<g;++f)c.push(h[2].call(h[1],b[f],f,b));return c},filter:function(b,c,f){var g=e(b,f,c);b=g[0];c=[];f=0;for(var h=b.length;f<h;++f)g[2].call(g[1],b[f],f,
b)&&c.push(b[f]);return c}})})();return d});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(d){(function(){function e(m,o){throw new Error("declare"+(o?" "+o:"")+": "+m);}function a(m,o){for(var s=[],w=[{cls:0,refs:[]}],y={},B=1,A=m.length,E=0,G,M,H,N,L;E<A;++E){if(G=m[E])x.call(G)!="[object Function]"&&e("mixin #"+E+" is not a callable constructor.",o);else e("mixin #"+E+" is unknown. Did you use dojo.require to pull it in?",o);M=G._meta?G._meta.bases:[G];H=0;for(G=M.length-1;G>=0;--G){N=M[G].prototype;
if(!N.hasOwnProperty("declaredClass"))N.declaredClass="uniqName_"+C++;N=N.declaredClass;if(!y.hasOwnProperty(N)){y[N]={count:0,refs:[],cls:M[G]};++B}N=y[N];if(H&&H!==N){N.refs.push(H);++H.count}H=N}++H.count;w[0].refs.push(H)}for(;w.length;){H=w.pop();s.push(H.cls);for(--B;L=H.refs,L.length==1;){H=L[0];if(!H||--H.count){H=0;break}s.push(H.cls);--B}if(H){E=0;for(A=L.length;E<A;++E){H=L[E];--H.count||w.push(H)}}}B&&e("can't build consistent linearization",o);G=m[0];s[0]=G?G._meta&&G===s[s.length-G._meta.bases.length]?
G._meta.bases.length:1:0;return s}function b(m,o,s){var w,y,B,A,E,G,M,H=this._inherited=this._inherited||{};if(typeof m=="string"){w=m;m=o;o=s}s=0;A=m.callee;(w=w||A.nom)||e("can't deduce a name to call inherited()",this.declaredClass);E=this.constructor._meta;B=E.bases;M=H.p;if(w!=k){if(H.c!==A){M=0;G=B[0];E=G._meta;if(E.hidden[w]!==A){(y=E.chains)&&typeof y[w]=="string"&&e("calling chained method with inherited: "+w,this.declaredClass);do{E=G._meta;y=G.prototype;if(E&&(y[w]===A&&y.hasOwnProperty(w)||
E.hidden[w]===A))break}while(G=B[++M]);M=G?M:-1}}if(G=B[++M]){y=G.prototype;if(G._meta&&y.hasOwnProperty(w))s=y[w];else{A=q[w];do{y=G.prototype;if((s=y[w])&&(G._meta?y.hasOwnProperty(w):s!==A))break}while(G=B[++M])}}s=G&&s||q[w]}else{if(H.c!==A){M=0;if((E=B[0]._meta)&&E.ctor!==A){y=E.chains;if(!y||y.constructor!=="manual")e("calling chained constructor with inherited",this.declaredClass);for(;G=B[++M];)if((E=G._meta)&&E.ctor===A)break;M=G?M:-1}}for(;G=B[++M];)if(s=(E=G._meta)?E.ctor:G)break;s=G&&
s}H.c=s;H.p=M;if(s)return o===true?s:s.apply(this,o||m)}function c(m,o){if(typeof m=="string")return this.inherited(m,o,true);return this.inherited(m,true)}function f(m){for(var o=this.constructor._meta.bases,s=0,w=o.length;s<w;++s)if(o[s]===m)return true;return this instanceof m}function g(m,o){var s,w=0,y=r._extraNames.length;for(s in o)if(s!=k&&o.hasOwnProperty(s))m[s]=o[s];for(;w<y;++w){s=r._extraNames[w];if(s!=k&&o.hasOwnProperty(s))m[s]=o[s]}}function h(m,o){var s,w,y=0,B=r._extraNames.length;
for(s in o){w=o[s];if((w!==q[s]||!(s in q))&&s!=k){if(x.call(w)=="[object Function]")w.nom=s;m[s]=w}}for(;y<B;++y){s=r._extraNames[y];w=o[s];if((w!==q[s]||!(s in q))&&s!=k){if(x.call(w)=="[object Function]")w.nom=s;m[s]=w}}return m}function i(m){h(this.prototype,m);return this}function j(m,o){return function(){var s=arguments,w=s,y=s[0],B,A;A=m.length;var E;if(!(this instanceof s.callee))return v(s);if(o&&(y&&y.preamble||this.preamble)){E=new Array(m.length);E[0]=s;for(B=0;;){if(y=s[0])if(y=y.preamble)s=
y.apply(this,s)||s;y=m[B].prototype;if(y=y.hasOwnProperty("preamble")&&y.preamble)s=y.apply(this,s)||s;if(++B==A)break;E[B]=s}}for(B=A-1;B>=0;--B){y=m[B];if(y=(A=y._meta)?A.ctor:y)y.apply(this,E?E[B]:s)}(y=this.postscript)&&y.apply(this,w)}}function l(m,o){return function(){var s=arguments,w=s,y=s[0];if(!(this instanceof s.callee))return v(s);if(o){if(y)if(y=y.preamble)w=y.apply(this,w)||w;(y=this.preamble)&&y.apply(this,w)}m&&m.apply(this,s);(y=this.postscript)&&y.apply(this,s)}}function n(m){return function(){var o=
arguments,s=0,w,y;if(!(this instanceof o.callee))return v(o);for(;w=m[s];++s)if(w=(y=w._meta)?y.ctor:w){w.apply(this,o);break}(w=this.postscript)&&w.apply(this,o)}}function p(m,o,s){return function(){var w,y,B=0,A=1;if(s){B=o.length-1;A=-1}for(;w=o[B];B+=A){y=w._meta;(w=(y?y.hidden:w.prototype)[m])&&w.apply(this,arguments)}}}function t(m){z.prototype=m.prototype;m=new z;z.prototype=null;return m}function v(m){var o=m.callee,s=t(o);o.apply(s,m);return s}var r=d,u=r._mixin,q=Object.prototype,x=q.toString,
z=new Function,C=0,k="constructor";r.declare=function(m,o,s){if(typeof m!="string"){s=o;o=m;m=""}s=s||{};var w,y,B,A,E,G,M,H=1,N=o;if(x.call(o)=="[object Array]"){G=a(o,m);B=G[0];H=G.length-B;o=G[H]}else{G=[0];if(o)if(x.call(o)=="[object Function]"){B=o._meta;G=G.concat(B?B.bases:o)}else e("base class is not a callable constructor.",m);else o!==null&&e("unknown base class. Did you use dojo.require to pull it in?",m)}if(o)for(y=H-1;;--y){w=t(o);if(!y)break;B=G[y];(B._meta?g:u)(w,B.prototype);A=new Function;
A.superclass=o;A.prototype=w;o=w.constructor=A}else w={};h(w,s);B=s.constructor;if(B!==q.constructor){B.nom=k;w.constructor=B}for(y=H-1;y;--y)if((B=G[y]._meta)&&B.chains)M=u(M||{},B.chains);if(w["-chains-"])M=u(M||{},w["-chains-"]);B=!M||!M.hasOwnProperty(k);G[0]=A=M&&M.constructor==="manual"?n(G):G.length==1?l(s.constructor,B):j(G,B);A._meta={bases:G,hidden:s,chains:M,parents:N,ctor:s.constructor};A.superclass=o&&o.prototype;A.extend=i;A.prototype=w;w.constructor=A;w.getInherited=c;w.inherited=b;
w.isInstanceOf=f;if(m){w.declaredClass=m;r.setObject(m,A)}if(M)for(E in M)if(w[E]&&typeof M[E]=="string"&&E!=k){B=w[E]=p(E,G,M[E]==="after");B.nom=E}return A};r.safeMixin=h})();return d.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(d){d._listener={getDispatcher:function(){return function(){var e=Array.prototype,a=arguments.callee,b=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var c;b=[].concat(b);for(c in b)c in e||b[c].apply(this,arguments);return a}},add:function(e,a,b){e=e||d.global;var c=e[a];if(!c||!c._listeners){var f=d._listener.getDispatcher();f.target=c;f._listeners=[];c=e[a]=f}return c._listeners.push(b)},remove:function(e,a,b){(e=(e||
d.global)[a])&&e._listeners&&b--&&delete e._listeners[b]}};d.connect=function(){var e=arguments,a=[],b=0;a.push(d.isString(e[0])?null:e[b++],e[b++]);var c=e[b+1];a.push(d.isString(c)||d.isFunction(c)?e[b++]:null,e[b++]);for(c=e.length;b<c;b++)a.push(e[b]);return d._connect.apply(this,a)};d._connect=function(e,a,b,c){var f=d._listener;b=f.add(e,a,d.hitch(b,c));return[e,a,b,f]};d.disconnect=function(e){if(e&&e[0]!==undefined){d._disconnect.apply(this,e);delete e[0]}};d._disconnect=function(e,a,b,c){c.remove(e,
a,b)};d._topics={};d.subscribe=function(e,a,b){return[e,d._listener.add(d._topics,e,d.hitch(a,b))]};d.unsubscribe=function(e){e&&d._listener.remove(d._topics,e[0],e[1])};d.publish=function(e,a){if(e=d._topics[e])e.apply(this,a||[])};d.connectPublisher=function(e,a,b){var c=function(){d.publish(e,arguments)};return b?d.connect(a,b,c):d.connect(a,c)};return d.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var e=function(){},a=Object.freeze||function(){},b=function(){var c,f,g,h,i=false,j=function(){};return function(l){if(i)if(c){f.next={task:l,next:null};f=f.next}else f=c={task:l,next:null};else{i=true;do try{for(;l;){l();if(g){if(c)f.next=g;else c=g;f=h}if(c){g=c.next;h=f;l=c.task;c=f=null}else l=null}i=false}catch(n){l=j;console.error(n)}while(i)}}}();d.Deferred=function(c){function f(v){if(i)throw new Error("This deferred has already been resolved");
h=v;i=true;b(g)}function g(){for(var v;!v&&n;){var r=n;n=n.next;if(v=r.progress==e)i=false;var u=j?r.error:r.resolved;if(u)try{var q=u(h);if(q&&typeof q.then==="function")q.then(d.hitch(r.deferred,"resolve"),d.hitch(r.deferred,"reject"),d.hitch(r.deferred,"progress"));else{u=v&&q===undefined;if(v&&!u)j=q instanceof Error;r.deferred[u&&j?"reject":"resolve"](u?h:q)}}catch(x){r.deferred.reject(x)}else j?r.deferred.reject(h):r.deferred.resolve(h)}}var h,i,j,l,n,p=this.promise={};this.resolve=this.callback=
function(v){this.fired=0;this.results=[v,null];f(v)};this.reject=this.errback=function(v){j=true;this.fired=1;f(v);this.results=[null,v];if(!v||v.log!==false)(d.config.deferredOnError||function(r){console.error(r)})(v)};this.progress=function(v){for(var r=n;r;){var u=r.progress;u&&u(v);r=r.next}};this.addCallbacks=function(v,r){this.then(v,r,e);return this};this.then=p.then=function(v,r,u){var q=u==e?this:new d.Deferred(p.cancel);v={resolved:v,error:r,progress:u,deferred:q};if(n)l=l.next=v;else n=
l=v;i&&b(g);return q.promise};var t=this;this.cancel=p.cancel=function(){if(!i){var v=c&&c(t);if(!i){v instanceof Error||(v=new Error(v));v.log=false;t.reject(v)}}};a(p)};d.extend(d.Deferred,{addCallback:function(){return this.addCallbacks(d.hitch.apply(d,arguments))},addErrback:function(){return this.addCallbacks(null,d.hitch.apply(d,arguments))},addBoth:function(){var c=d.hitch.apply(d,arguments);return this.addCallbacks(c,c)},fired:-1})})();d.when=function(e,a,b,c){if(e&&typeof e.then==="function")return e.then(a,
b,c);return a(e)};return d.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(d){d.fromJson=function(e){return eval("("+e+")")};d._escapeString=function(e){return('"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};d.toJsonIndentStr="\t";d.toJson=function(e,a,b){if(e===undefined)return"undefined";var c=typeof e;if(c=="number"||c=="boolean")return e+"";if(e===null)return"null";if(d.isString(e))return d._escapeString(e);var f=
arguments.callee,g;b=b||"";var h=a?b+d.toJsonIndentStr:"";g=e.__json__||e.json;if(d.isFunction(g)){g=g.call(e);if(e!==g)return f(g,a,h)}if(e.nodeType&&e.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var i=a?"\n":"";if(d.isArray(e))return"["+d.map(e,function(p){p=f(p,a,h);if(typeof p!="string")p="undefined";return i+h+p}).join(","+g)+i+b+"]";if(c=="function")return null;c=[];var j;for(j in e){var l,n;if(typeof j=="number")l='"'+j+'"';else if(typeof j=="string")l=d._escapeString(j);
else continue;n=f(e[j],a,h);typeof n=="string"&&c.push(i+h+l+":"+g+n)}return"{"+c.join(","+g)+i+b+"}"};return d});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(d){(function(){d.Color=function(e){e&&this.setColor(e)};d.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};d.extend(d.Color,
{r:255,g:255,b:255,a:1,_set:function(e,a,b,c){this.r=e;this.g=a;this.b=b;this.a=c},setColor:function(e){if(d.isString(e))d.colorFromString(e,this);else if(d.isArray(e))d.colorFromArray(e,this);else{this._set(e.r,e.g,e.b,e.a);e instanceof d.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+d.map(["r","g","b"],function(e){e=this[e].toString(16);return e.length<
2?"0"+e:e},this).join("")},toCss:function(e){var a=this.r+", "+this.g+", "+this.b;return(e?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});d.blendColors=function(e,a,b,c){var f=c||new d.Color;d.forEach(["r","g","b","a"],function(g){f[g]=e[g]+(a[g]-e[g])*b;if(g!="a")f[g]=Math.round(f[g])});return f.sanitize()};d.colorFromRgb=function(e,a){return(e=e.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&d.colorFromArray(e[1].split(/\s*,\s*/),a)};d.colorFromHex=function(e,
a){var b=a||new d.Color,c=e.length==4?4:8,f=(1<<c)-1;e=Number("0x"+e.substr(1));if(isNaN(e))return null;d.forEach(["b","g","r"],function(g){var h=e&f;e>>=c;b[g]=c==4?17*h:h});b.a=1;return b};d.colorFromArray=function(e,a){a=a||new d.Color;a._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};d.colorFromString=function(e,a){var b=d.Color.named[e];return b&&d.colorFromArray(b,a)||d.colorFromRgb(e,a)||d.colorFromHex(e,a)}})();return d.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(d){d.doc=window.document||null;d.body=function(){return d.doc.body||d.doc.getElementsByTagName("body")[0]};d.setContext=function(e,a){d.global=e;d.doc=a};d.withGlobal=function(e,a,b,c){var f=d.global;try{d.global=e;return d.withDoc.call(null,e.document,a,b,c)}finally{d.global=f}};d.withDoc=function(e,a,b,c){var f=d.doc,g=d._bodyLtr,h=d.isQuirks;try{d.doc=e;delete d._bodyLtr;d.isQuirks=d.doc.compatMode=="BackCompat";if(b&&typeof a=="string")a=
b[a];return a.apply(b,c||[])}finally{d.doc=f;delete d._bodyLtr;if(g!==undefined)d._bodyLtr=g;d.isQuirks=h}};return d});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(d){(function(){var e=d._event_listener={add:function(i,j,l){if(i){j=e._normalizeEventName(j);l=e._fixCallback(j,l);if(!d.isIE&&(j=="mouseenter"||j=="mouseleave")){var n=l;j=j=="mouseenter"?"mouseover":"mouseout";l=function(p){if(!d.isDescendant(p.relatedTarget,i))return n.call(this,p)}}i.addEventListener(j,l,false);return l}},remove:function(i,j,l){if(i){j=e._normalizeEventName(j);if(!d.isIE&&(j=="mouseenter"||j=="mouseleave"))j=
j=="mouseenter"?"mouseover":"mouseout";i.removeEventListener(j,l,false)}},_normalizeEventName:function(i){return i.slice(0,2)=="on"?i.slice(2):i},_fixCallback:function(i,j){return i!="keypress"?j:function(l){return j.call(this,e._fixEvent(l,this))}},_fixEvent:function(i){switch(i.type){case "keypress":e._setKeyChar(i);break}return i},_setKeyChar:function(i){i.keyChar=i.charCode>=32?String.fromCharCode(i.charCode):"";i.charOrCode=i.keyChar||i.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};d.fixEvent=function(i,j){return e._fixEvent(i,j)};d.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=d._listener;d._connect=function(i,j,l,n,p){p=i&&(i.nodeType||i.attachEvent||i.addEventListener)?p?2:1:0;l=[d._listener,e,a][p].add(i,j,d.hitch(l,n));return[i,j,l,p]};d._disconnect=function(i,j,l,n){[d._listener,e,a][n].remove(i,j,l)};d.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:d.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:d.isMac&&!d.isAIR?d.isSafari?91:224:17};var b=d.isMac?"metaKey":"ctrlKey";d.isCopyKey=function(i){return i[b]};d.mouseButtons=d.isIE<9||d.isIE&&d.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(i,j){return i.button&j},isLeft:function(i){return i.button&1},isMiddle:function(i){return i.button&4},isRight:function(i){return i.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(i,j){return i.button==j},isLeft:function(i){return i.button==
0},isMiddle:function(i){return i.button==1},isRight:function(i){return i.button==2}};if(d.isIE){var c=function(i,j){try{return i.keyCode=j}catch(l){return 0}},f=d._listener,g=d._ieListenersName="_"+d._scopeName+"_listeners";if(!d.config._allow_leaks){a=f=d._ie_listener={handlers:[],add:function(i,j,l){i=i||d.global;var n=i[j];if(!n||!n[g]){var p=d._getIeDispatcher();p.target=n&&h.push(n)-1;p[g]=[];n=i[j]=p}return n[g].push(h.push(l)-1)},remove:function(i,j,l){j=(i=(i||d.global)[j])&&i[g];if(i&&j&&
l--){delete h[j[l]];delete j[l]}}};var h=f.handlers}d.mixin(e,{add:function(i,j,l){if(i){j=e._normalizeEventName(j);if(j=="onkeypress"){var n=i.onkeydown;if(!n||!n[g]||!n._stealthKeydownHandle){var p=e.add(i,"onkeydown",e._stealthKeyDown);n=i.onkeydown;n._stealthKeydownHandle=p;n._stealthKeydownRefs=1}else n._stealthKeydownRefs++}return f.add(i,j,e._fixCallback(l))}},remove:function(i,j,l){j=e._normalizeEventName(j);f.remove(i,j,l);if(j=="onkeypress"){j=i.onkeydown;if(--j._stealthKeydownRefs<=0){f.remove(i,
"onkeydown",j._stealthKeydownHandle);delete j._stealthKeydownHandle}}},_normalizeEventName:function(i){return i.slice(0,2)!="on"?"on"+i:i},_nop:function(){},_fixEvent:function(i,j){if(!i)i=(j&&(j.ownerDocument||j.document||j).parentWindow||window).event;if(!i)return i;i.target=i.srcElement;i.currentTarget=j||i.srcElement;i.layerX=i.offsetX;i.layerY=i.offsetY;j=(j=i.srcElement)&&j.ownerDocument||document;j=d.isIE<6||j.compatMode=="BackCompat"?j.body:j.documentElement;var l=d._getIeDocumentElementOffset();
i.pageX=i.clientX+d._fixIeBiDiScrollLeft(j.scrollLeft||0)-l.x;i.pageY=i.clientY+(j.scrollTop||0)-l.y;if(i.type=="mouseover")i.relatedTarget=i.fromElement;if(i.type=="mouseout")i.relatedTarget=i.toElement;if(d.isIE<9||d.isQuirks){i.stopPropagation=e._stopPropagation;i.preventDefault=e._preventDefault}return e._fixKeys(i)},_fixKeys:function(i){switch(i.type){case "keypress":var j="charCode"in i?i.charCode:i.keyCode;if(j==10){j=0;i.keyCode=13}else if(j==13||j==27)j=0;else if(j==3)j=99;i.charCode=j;e._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var j=i.currentTarget.onkeypress;if(j&&j[g]){var l=i.keyCode,n=(l!=13||d.isIE>=9&&!d.isQuirks)&&l!=32&&l!=27&&(l<48||l>90)&&(l<96||l>111)&&(l<186||l>192)&&(l<219||l>222);if(n||i.ctrlKey){n=n?0:l;if(i.ctrlKey)if(l==3||l==13)return;else if(n>95&&n<106)n-=48;else if(!i.shiftKey&&n>=65&&n<=90)n+=32;else n=e._punctMap[n]||n;l=e._synthesizeEvent(i,{type:"keypress",faux:true,charCode:n});j.call(i.currentTarget,l);if(d.isIE<9||d.isIE&&d.isQuirks)i.cancelBubble=
l.cancelBubble;i.returnValue=l.returnValue;c(i,l.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&c(this,0);this.returnValue=false}});d.stopEvent=d.isIE<9||d.isQuirks?function(i){i=i||window.event;e._stopPropagation.call(i);e._preventDefault.call(i)}:d.stopEvent}e._synthesizeEvent=function(i,j){j=d.mixin({},i,j);e._setKeyChar(j);j.preventDefault=function(){i.preventDefault()};j.stopPropagation=function(){i.stopPropagation()};
return j};d.isOpera&&d.mixin(e,{_fixEvent:function(i){switch(i.type){case "keypress":var j=i.which;if(j==3)j=99;j=j<41&&!i.shiftKey?0:j;if(i.ctrlKey&&!i.shiftKey&&j>=65&&j<=90)j+=32;return e._synthesizeEvent(i,{charCode:j})}return i}});if(d.isWebKit){e._add=e.add;e._remove=e.remove;d.mixin(e,{add:function(i,j,l){if(i){var n=e._add(i,j,l);if(e._normalizeEventName(j)=="keypress")n._stealthKeyDownHandle=e._add(i,"keydown",function(p){var t=p.keyCode,v=t!=13&&t!=32&&(t<48||t>90)&&(t<96||t>111)&&(t<186||
t>192)&&(t<219||t>222);if(v||p.ctrlKey){v=v?0:t;if(p.ctrlKey)if(t==3||t==13)return;else if(v>95&&v<106)v-=48;else if(!p.shiftKey&&v>=65&&v<=90)v+=32;else v=e._punctMap[v]||v;t=e._synthesizeEvent(p,{type:"keypress",faux:true,charCode:v});l.call(p.currentTarget,t)}});return n}},remove:function(i,j,l){if(i){l._stealthKeyDownHandle&&e._remove(i,"keydown",l._stealthKeyDownHandle);e._remove(i,j,l)}},_fixEvent:function(i){switch(i.type){case "keypress":if(i.faux)return i;var j=i.charCode;j=j>=32?j:0;return e._synthesizeEvent(i,
{charCode:j,faux:true})}return i}})}})();if(d.isIE){d._ieDispatcher=function(e,a){var b=Array.prototype,c=d._ie_listener.handlers,f=e.callee,g=f[d._ieListenersName];f=(f=c[f.target])&&f.apply(a,e);g=[].concat(g);for(var h in g){var i=c[g[h]];!(h in b)&&i&&i.apply(a,e)}return f};d._getIeDispatcher=function(){return new Function(d._scopeName+"._ieDispatcher(arguments, this)")};d._event_listener._fixCallback=function(e){var a=d._event_listener._fixEvent;return function(b){return e.call(this,a(b,this))}}}return d.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(d){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}d.byId=d.isIE?function(a,b){if(typeof a!="string")return a;var c=b||d.doc;if((b=c.getElementById(a))&&(b.attributes.id.value==a||b.id==a))return b;else{var f=c.all[a];if(!f||f.nodeName)f=[f];for(var g=0;b=f[g++];)if(b.attributes&&b.attributes.id&&b.attributes.id.value==a||b.id==a)return b}}:function(a,b){return(typeof a=="string"?(b||d.doc).getElementById(a):
a)||null};(function(){var a=d.byId,b=null,c;d.addOnWindowUnload(function(){b=null});d._destroyElement=d.destroy=function(D){D=a(D);try{var F=D.ownerDocument;if(!b||c!=F){b=F.createElement("div");c=F}b.appendChild(D.parentNode?D.parentNode.removeChild(D):D);b.innerHTML=""}catch(J){}};d.isDescendant=function(D,F){try{D=a(D);for(F=a(F);D;){if(D==F)return true;D=D.parentNode}}catch(J){}return false};d.setSelectable=function(D,F){D=a(D);if(d.isMozilla)D.style.MozUserSelect=F?"":"none";else if(d.isKhtml||
d.isWebKit)D.style.KhtmlUserSelect=F?"auto":"none";else if(d.isIE){F=D.unselectable=F?"":"on";d.query("*",D).forEach("item.unselectable = '"+F+"'")}};var f=function(D,F){var J=F.parentNode;J&&J.insertBefore(D,F)},g=function(D,F){var J=F.parentNode;if(J)J.lastChild==F?J.appendChild(D):J.insertBefore(D,F.nextSibling)};d.place=function(D,F,J){F=a(F);if(typeof D=="string")D=/^\s*</.test(D)?d._toDom(D,F.ownerDocument):a(D);if(typeof J=="number"){var Q=F.childNodes;!Q.length||Q.length<=J?F.appendChild(D):
f(D,Q[J<0?0:J])}else switch(J){case "before":f(D,F);break;case "after":g(D,F);break;case "replace":F.parentNode.replaceChild(D,F);break;case "only":d.empty(F);F.appendChild(D);break;case "first":if(F.firstChild){f(D,F.firstChild);break}default:F.appendChild(D)}return D};d.boxModel="content-box";if(d.isIE)d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var h;h=d.isWebKit?function(D){var F;if(D.nodeType==1){var J=D.ownerDocument.defaultView;F=J.getComputedStyle(D,null);if(!F&&
D.style){D.style.display="";F=J.getComputedStyle(D,null)}}return F||{}}:d.isIE?function(D){return D.nodeType==1?D.currentStyle:{}}:function(D){return D.nodeType==1?D.ownerDocument.defaultView.getComputedStyle(D,null):{}};d.getComputedStyle=h;d._toPixelValue=d.isIE?function(D,F){if(!F)return 0;if(F=="medium")return 4;if(F.slice&&F.slice(-2)=="px")return parseFloat(F);with(D){D=style.left;var J=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=F;F=style.pixelLeft}catch(Q){F=0}style.left=
D;runtimeStyle.left=J}return F}:function(D,F){return parseFloat(F)||0};var i=d._toPixelValue,j=function(D,F){try{return D.filters.item("DXImageTransform.Microsoft.Alpha")}catch(J){return F?{}:null}};d._getOpacity=d.isIE<9?function(D){try{return j(D).Opacity/100}catch(F){return 1}}:function(D){return h(D).opacity};d._setOpacity=d.isIE<9?function(D,F){var J=F*100,Q=F==1;D.style.zoom=Q?"":1;if(j(D))j(D,1).Opacity=J;else{if(Q)return F;D.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
J+")"}j(D,1).Enabled=!Q;D.nodeName.toLowerCase()=="tr"&&d.query("> td",D).forEach(function(T){d._setOpacity(T,F)});return F}:function(D,F){return D.style.opacity=F};var l={left:true,top:true},n=/margin|padding|width|height|max|min|offset/,p=function(D,F,J){F=F.toLowerCase();if(d.isIE){if(J=="auto"){if(F=="height")return D.offsetHeight;if(F=="width")return D.offsetWidth}if(F=="fontweight")switch(J){case 700:return"bold";case 400:default:return"normal"}}F in l||(l[F]=n.test(F));return l[F]?i(D,J):J},
t=d.isIE?"styleFloat":"cssFloat",v={cssFloat:t,styleFloat:t,"float":t};d.style=function(D,F,J){var Q=a(D),T=arguments.length,U=F=="opacity";F=v[F]||F;if(T==3)return U?d._setOpacity(Q,J):(Q.style[F]=J);if(T==2&&U)return d._getOpacity(Q);U=h(Q);if(T==2&&typeof F!="string"){for(var W in F)d.style(D,W,F[W]);return U}return T==1?U:p(Q,F,U[F]||Q.style[F])};d._getPadExtents=function(D,F){F=F||h(D);var J=i(D,F.paddingLeft),Q=i(D,F.paddingTop);return{l:J,t:Q,w:J+i(D,F.paddingRight),h:Q+i(D,F.paddingBottom)}};
d._getBorderExtents=function(D,F){F=F||h(D);var J=F.borderLeftStyle!="none"?i(D,F.borderLeftWidth):0,Q=F.borderTopStyle!="none"?i(D,F.borderTopWidth):0;return{l:J,t:Q,w:J+(F.borderRightStyle!="none"?i(D,F.borderRightWidth):0),h:Q+(F.borderBottomStyle!="none"?i(D,F.borderBottomWidth):0)}};d._getPadBorderExtents=function(D,F){var J=F||h(D);F=d._getPadExtents(D,J);D=d._getBorderExtents(D,J);return{l:F.l+D.l,t:F.t+D.t,w:F.w+D.w,h:F.h+D.h}};d._getMarginExtents=function(D,F){F=F||h(D);var J=i(D,F.marginLeft),
Q=i(D,F.marginTop),T=i(D,F.marginRight);D=i(D,F.marginBottom);if(d.isWebKit&&F.position!="absolute")T=J;return{l:J,t:Q,w:J+T,h:Q+D}};d._getMarginBox=function(D,F){var J=F||h(D);F=d._getMarginExtents(D,J);var Q=D.offsetLeft-F.l,T=D.offsetTop-F.t,U=D.parentNode;if(d.isMoz){var W=parseFloat(J.left);J=parseFloat(J.top);if(!isNaN(W)&&!isNaN(J)){Q=W;T=J}else if(U&&U.style){W=h(U);if(W.overflow!="visible"){U=d._getBorderExtents(U,W);Q+=U.l;T+=U.t}}}else if(d.isOpera||d.isIE>7&&!d.isQuirks)if(U){U=d._getBorderExtents(U);
Q-=U.l;T-=U.t}return{l:Q,t:T,w:D.offsetWidth+F.w,h:D.offsetHeight+F.h}};d._getMarginSize=function(D,F){D=a(D);F=d._getMarginExtents(D,F||h(D));D=D.getBoundingClientRect();return{w:D.right-D.left+F.w,h:D.bottom-D.top+F.h}};d._getContentBox=function(D,F){var J=F||h(D);F=d._getPadExtents(D,J);J=d._getBorderExtents(D,J);var Q=D.clientWidth;if(Q){D=D.clientHeight;J.w=J.h=0}else{Q=D.offsetWidth;D=D.offsetHeight}if(d.isOpera){F.l+=J.l;F.t+=J.t}return{l:F.l,t:F.t,w:Q-F.w-J.w,h:D-F.h-J.h}};d._getBorderBox=
function(D,F){var J=F||h(D);F=d._getPadExtents(D,J);D=d._getContentBox(D,J);return{l:D.l-F.l,t:D.t-F.t,w:D.w+F.w,h:D.h+F.h}};d._setBox=function(D,F,J,Q,T,U){U=U||"px";D=D.style;if(!isNaN(F))D.left=F+U;if(!isNaN(J))D.top=J+U;if(Q>=0)D.width=Q+U;if(T>=0)D.height=T+U};d._isButtonTag=function(D){return D.tagName=="BUTTON"||D.tagName=="INPUT"&&(D.getAttribute("type")||"").toUpperCase()=="BUTTON"};d._usesBorderBox=function(D){var F=D.tagName;return d.boxModel=="border-box"||F=="TABLE"||d._isButtonTag(D)};
d._setContentSize=function(D,F,J,Q){if(d._usesBorderBox(D)){Q=d._getPadBorderExtents(D,Q);if(F>=0)F+=Q.w;if(J>=0)J+=Q.h}d._setBox(D,NaN,NaN,F,J)};d._setMarginBox=function(D,F,J,Q,T,U){var W=U||h(D);U=d._usesBorderBox(D)?r:d._getPadBorderExtents(D,W);if(d.isWebKit)if(d._isButtonTag(D)){var aa=D.style;if(Q>=0&&!aa.width)aa.width="4px";if(T>=0&&!aa.height)aa.height="4px"}W=d._getMarginExtents(D,W);if(Q>=0)Q=Math.max(Q-U.w-W.w,0);if(T>=0)T=Math.max(T-U.h-W.h,0);d._setBox(D,F,J,Q,T)};var r={l:0,t:0,w:0,
h:0};d.marginBox=function(D,F){D=a(D);var J=h(D);return!F?d._getMarginBox(D,J):d._setMarginBox(D,F.l,F.t,F.w,F.h,J)};d.contentBox=function(D,F){D=a(D);var J=h(D);return!F?d._getContentBox(D,J):d._setContentSize(D,F.w,F.h,J)};d._docScroll=function(){var D=d.global;return"pageXOffset"in D?{x:D.pageXOffset,y:D.pageYOffset}:(D=d.isQuirks?d.doc.body:d.doc.documentElement,{x:d._fixIeBiDiScrollLeft(D.scrollLeft||0),y:D.scrollTop||0})};d._isBodyLtr=function(){return"_bodyLtr"in d?d._bodyLtr:(d._bodyLtr=(d.body().dir||
d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};d._getIeDocumentElementOffset=function(){var D=d.doc.documentElement;if(d.isIE<8){var F=D.getBoundingClientRect(),J=F.left;F=F.top;if(d.isIE<7){J+=D.clientLeft;F+=D.clientTop}return{x:J<0?0:J,y:F<0?0:F}}else return{x:0,y:0}};d._fixIeBiDiScrollLeft=function(D){var F=d.isIE;if(F&&!d._isBodyLtr()){var J=d.isQuirks,Q=J?d.doc.body:d.doc.documentElement;if(F==6&&!J&&d.global.frameElement&&Q.scrollHeight>Q.clientHeight)D+=Q.clientLeft;return F<8||
J?D+Q.clientWidth-Q.scrollWidth:-D}return D};d._abs=d.position=function(D,F){D=a(D);var J=d.body(),Q=J.parentNode;D=D.getBoundingClientRect();D={x:D.left,y:D.top,w:D.right-D.left,h:D.bottom-D.top};if(d.isIE){Q=d._getIeDocumentElementOffset();D.x-=Q.x+(d.isQuirks?J.clientLeft+J.offsetLeft:0);D.y-=Q.y+(d.isQuirks?J.clientTop+J.offsetTop:0)}else if(d.isFF==3){J=h(Q);D.x-=i(Q,J.marginLeft)+i(Q,J.borderLeftWidth);D.y-=i(Q,J.marginTop)+i(Q,J.borderTopWidth)}if(F){F=d._docScroll();D.x+=F.x;D.y+=F.y}return D};
d.coords=function(D,F){D=a(D);var J=h(D);J=d._getMarginBox(D,J);F=d.position(D,F);J.x=F.x;J.y=F.y;return J};var u={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},q={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},x={innerHTML:1,className:1,htmlFor:d.isIE,value:1},z=function(D){return q[D.toLowerCase()]||D},C=function(D,F){return(D=D.getAttributeNode&&D.getAttributeNode(F))&&
D.specified};d.hasAttr=function(D,F){var J=F.toLowerCase();return x[u[J]||F]||C(a(D),q[J]||F)};var k={},m=0,o=d._scopeName+"attrid",s={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};d.attr=function(D,F,J){D=a(D);var Q=arguments.length;if(Q==2&&typeof F!="string"){for(var T in F)d.attr(D,T,F[T]);return D}var U=F.toLowerCase();T=u[U]||F;var W=x[T];U=q[U]||F;if(Q==3){if(T=="style"&&typeof J!="string")d.style(D,J);else if(T=="innerHTML")if(d.isIE&&D.tagName.toLowerCase()in s){d.empty(D);
D.appendChild(d._toDom(J,D.ownerDocument))}else D[T]=J;else if(d.isFunction(J)){Q=d.attr(D,o);if(!Q){Q=m++;d.attr(D,o,Q)}k[Q]||(k[Q]={});if(W=k[Q][T])d.disconnect(W);else try{delete D[T]}catch(aa){}k[Q][T]=d.connect(D,T,J)}else if(W||typeof J=="boolean")D[T]=J;else D.setAttribute(U,J);return D}J=D[T];if(W&&typeof J!="undefined")return J;if(T!="href"&&(typeof J=="boolean"||d.isFunction(J)))return J;return C(D,U)?D.getAttribute(U):null};d.removeAttr=function(D,F){a(D).removeAttribute(z(F))};d.getNodeProp=
function(D,F){D=a(D);var J=F.toLowerCase(),Q=u[J]||F;if(Q in D&&Q!="href")return D[Q];F=q[J]||F;return C(D,F)?D.getAttribute(F):null};d.create=function(D,F,J,Q){var T=d.doc;if(J){J=a(J);T=J.ownerDocument}if(typeof D=="string")D=T.createElement(D);F&&d.attr(D,F);J&&d.place(D,J,Q);return D};d.empty=d.isIE?function(D){D=a(D);for(var F;F=D.lastChild;)d.destroy(F)}:function(D){a(D).innerHTML=""};var w={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},y=/<\s*([\w\:]+)/,B={},A=0,E="__"+d._scopeName+"ToDomId";for(var G in w)if(w.hasOwnProperty(G)){var M=w[G];M.pre=G=="option"?'<select multiple="multiple">':"<"+M.join("><")+">";M.post="</"+M.reverse().join("></")+">"}d._toDom=function(D,F){F=F||d.doc;var J=F[E];if(!J){F[E]=J=++A+"";B[J]=F.createElement("div")}D+="";var Q=D.match(y),T=Q?Q[1].toLowerCase():"";J=B[J];if(Q&&w[T]){Q=
w[T];J.innerHTML=Q.pre+D+Q.post;for(D=Q.length;D;--D)J=J.firstChild}else J.innerHTML=D;if(J.childNodes.length==1)return J.removeChild(J.firstChild);for(D=F.createDocumentFragment();F=J.firstChild;)D.appendChild(F);return D};var H="className";d.hasClass=function(D,F){return(" "+a(D)[H]+" ").indexOf(" "+F+" ")>=0};var N=/\s+/,L=[""],P={},S=function(D){if(typeof D=="string"||D instanceof String)if(D.indexOf(" ")<0){L[0]=D;return L}else return D.split(N);return D||""};d.addClass=function(D,F){D=a(D);
F=S(F);var J=D[H],Q;J=J?" "+J+" ":" ";Q=J.length;for(var T=0,U=F.length,W;T<U;++T)if((W=F[T])&&J.indexOf(" "+W+" ")<0)J+=W+" ";if(Q<J.length)D[H]=J.substr(1,J.length-2)};d.removeClass=function(D,F){D=a(D);var J;if(F!==undefined){F=S(F);J=" "+D[H]+" ";for(var Q=0,T=F.length;Q<T;++Q)J=J.replace(" "+F[Q]+" "," ");J=d.trim(J)}else J="";if(D[H]!=J)D[H]=J};d.replaceClass=function(D,F,J){D=a(D);P.className=D.className;d.removeClass(P,J);d.addClass(P,F);if(D.className!==P.className)D.className=P.className};
d.toggleClass=function(D,F,J){if(J===undefined)J=!d.hasClass(D,F);d[J?"addClass":"removeClass"](D,F)}})();return d});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(d){(function(){var e=Array.prototype,a=e.slice,b=e.concat,c=function(t,v,r){t.sort||(t=a.call(t,0));r=r||this._NodeListCtor||d._NodeListCtor;t.constructor=r;d._mixin(t,r.prototype);t._NodeListCtor=r;return v?t._stash(v):t},f=function(t,v,r){v=[0].concat(a.call(v,0));r=r||d.global;return function(u){v[0]=u;return t.apply(r,v)}},g=function(t,v){return function(){this.forEach(f(t,
arguments,v));return this}},h=function(t,v){return function(){return this.map(f(t,arguments,v))}},i=function(t,v,r){return function(){var u=arguments,q=f(t,u,r);if(v.call(r||d.global,u))return this.map(q);this.forEach(q);return this}},j=function(t){return t.length==1&&typeof t[0]=="string"},l=function(t){var v=t.parentNode;v&&v.removeChild(t)};d.NodeList=function(){return c(Array.apply(null,arguments))};var n=d._NodeListCtor=d.NodeList,p=n.prototype;n._wrap=p._wrap=c;n._adaptAsMap=h;n._adaptAsForEach=
g;n._adaptAsFilter=function(t,v){return function(){return this.filter(f(t,arguments,v))}};n._adaptWithCondition=i;d.forEach(["slice","splice"],function(t){var v=e[t];p[t]=function(){return this._wrap(v.apply(this,arguments),t=="slice"?this:null)}});d.forEach(["indexOf","lastIndexOf","every","some"],function(t){var v=d[t];p[t]=function(){return v.apply(d,[this].concat(a.call(arguments,0)))}});d.forEach(["attr","style"],function(t){p[t]=i(d[t],j)});d.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(t){p[t]=g(d[t])});d.extend(d.NodeList,{_normalize:function(t,v){var r=t.parse===true?true:false;if(typeof t.template=="string"){var u=t.templateFunc||d.string&&d.string.substitute;t=u?u(t.template,t):t}u=typeof t;if(u=="string"||u=="number"){t=d._toDom(t,v&&v.ownerDocument);t=t.nodeType==11?d._toArray(t.childNodes):[t]}else if(d.isArrayLike(t))d.isArray(t)||(t=d._toArray(t));else t=[t];if(r)t._runParse=true;return t},_cloneNode:function(t){return t.cloneNode(true)},
_place:function(t,v,r,u){if(!(v.nodeType!=1&&r=="only")){v=v;for(var q,x=t.length,z=x-1;z>=0;z--){var C=u?this._cloneNode(t[z]):t[z];if(t._runParse&&d.parser&&d.parser.parse){q||(q=v.ownerDocument.createElement("div"));q.appendChild(C);d.parser.parse(q);for(C=q.firstChild;q.firstChild;)q.removeChild(q.firstChild)}z==x-1?d.place(C,v,r):v.parentNode.insertBefore(C,v);v=C}}},_stash:function(t){this._parent=t;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var t=
d.isArray(this)?this:a.call(this,0),v=d.map(arguments,function(r){return r&&!d.isArray(r)&&(typeof NodeList!="undefined"&&r.constructor===NodeList||r.constructor===this._NodeListCtor)?a.call(r,0):r});return this._wrap(b.apply(t,v),this)},map:function(t,v){return this._wrap(d.map(this,t,v),this)},forEach:function(t,v){d.forEach(this,t,v);return this},coords:h(d.coords),position:h(d.position),place:function(t,v){var r=d.query(t)[0];return this.forEach(function(u){d.place(u,r,v)})},orphan:function(t){return(t?
d._filterQueryResult(this,t):this).forEach(l)},adopt:function(t,v){return d.query(t).place(this[0],v)._stash(this)},query:function(t){if(!t)return this;var v=this.map(function(r){return d.query(t,r).filter(function(u){return u!==undefined})});return this._wrap(b.apply([],v),this)},filter:function(t){var v=arguments,r=this,u=0;if(typeof t=="string"){r=d._filterQueryResult(this,v[0]);if(v.length==1)return r._stash(this);u=1}return this._wrap(d.filter(r,v[u],v[u+1]),this)},addContent:function(t,v){t=
this._normalize(t,this[0]);for(var r=0,u;u=this[r];r++)this._place(t,u,v,r>0);return this},instantiate:function(t,v){var r=d.isFunction(t)?t:d.getObject(t);v=v||{};return this.forEach(function(u){new r(v,u)})},at:function(){var t=new this._NodeListCtor;d.forEach(arguments,function(v){if(v<0)v=this.length+v;this[v]&&t.push(this[v])},this);return t._stash(this)}});n.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];d.forEach(n.events,function(t){var v="on"+t;p[v]=function(r,u){return this.connect(v,r,u)}})})();return d.NodeList});
(function(){var d=function(a){var b=a.trim,c=a.forEach,f=a._NodeListCtor=a.NodeList,g=function(){return a.doc},h=(a.isWebKit||a.isMozilla)&&g().compatMode=="BackCompat",i=g().firstChild.children?"children":"childNodes",j=false,l=function(){return true},n=function(K){K+=">~+".indexOf(K.slice(-1))>=0?" * ":" ";for(var I=function(oa,pa){return b(K.slice(oa,pa))},O=[],R=-1,V=-1,X=-1,$=-1,Y=-1,ba=-1,ha=-1,ja="",ia="",ma,ga=0,qa=K.length,ea=null,ka=null,ra=function(){if(ha>=0){var oa=ha==ga?null:I(ha,ga);
ea[">~+".indexOf(oa)<0?"tag":"oper"]=oa;ha=-1}},sa=function(){if(ba>=0){ea.id=I(ba,ga).replace(/\\/g,"");ba=-1}},ta=function(){if(Y>=0){ea.classes.push(I(Y+1,ga).replace(/\\/g,""));Y=-1}},na=function(){sa();ra();ta()},ua=function(){na();$>=0&&ea.pseudos.push({name:I($+1,ga)});ea.loops=ea.pseudos.length||ea.attrs.length||ea.classes.length;ea.oquery=ea.query=I(ma,ga);ea.otag=ea.tag=ea.oper?null:ea.tag||"*";if(ea.tag)ea.tag=ea.tag.toUpperCase();if(O.length&&O[O.length-1].oper){ea.infixOper=O.pop();ea.query=
ea.infixOper.query+" "+ea.query}O.push(ea);ea=null};ja=ia,ia=K.charAt(ga),ga<qa;ga++)if(ja!="\\"){if(!ea){ma=ga;ea={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return j?this.otag:this.tag}};ha=ga}if(R>=0)if(ia=="]"){if(ka.attr)ka.matchFor=I(X||R+1,ga);else ka.attr=I(R+1,ga);if(R=ka.matchFor)if(R.charAt(0)=='"'||R.charAt(0)=="'")ka.matchFor=R.slice(1,-1);ea.attrs.push(ka);ka=null;R=X=-1}else{if(ia=="="){X="|~^$*".indexOf(ja)>=0?ja:"";ka.type=X+ia;ka.attr=
I(R+1,ga-X.length);X=ga+1}}else if(V>=0){if(ia==")"){if($>=0)ka.value=I(V+1,ga);$=V=-1}}else if(ia=="#"){na();ba=ga+1}else if(ia=="."){na();Y=ga}else if(ia==":"){na();$=ga}else if(ia=="["){na();R=ga;ka={}}else if(ia=="("){if($>=0){ka={name:I($+1,ga),value:null};ea.pseudos.push(ka)}V=ga}else ia==" "&&ja!=ia&&ua()}return O},p=function(K,I){if(!K)return I;if(!I)return K;return function(){return K.apply(window,arguments)&&I.apply(window,arguments)}},t=function(K,I){I=I||[];K&&I.push(K);return I},v=function(K){return 1==
K.nodeType},r=function(K,I){if(!K)return"";if(I=="class")return K.className||"";if(I=="for")return K.htmlFor||"";if(I=="style")return K.style.cssText||"";return(j?K.getAttribute(I):K.getAttribute(I,2))||""},u={"*=":function(K,I){return function(O){return r(O,K).indexOf(I)>=0}},"^=":function(K,I){return function(O){return r(O,K).indexOf(I)==0}},"$=":function(K,I){return function(O){O=" "+r(O,K);return O.lastIndexOf(I)==O.length-I.length}},"~=":function(K,I){var O=" "+I+" ";return function(R){return(" "+
r(R,K)+" ").indexOf(O)>=0}},"|=":function(K,I){var O=" "+I+"-";return function(R){R=" "+r(R,K);return R==I||R.indexOf(O)==0}},"=":function(K,I){return function(O){return r(O,K)==I}}},q=typeof g().firstChild.nextElementSibling=="undefined",x=!q?"nextElementSibling":"nextSibling",z=!q?"previousElementSibling":"previousSibling",C=q?v:l,k=function(K){for(;K=K[z];)if(C(K))return false;return true},m=function(K){for(;K=K[x];)if(C(K))return false;return true},o=function(K){var I=K.parentNode,O=0,R=I[i],
V=K._i||-1,X=I._l||-1;if(!R)return-1;R=R.length;if(X==R&&V>=0&&X>=0)return V;I._l=R;V=-1;for(I=I.firstElementChild||I.firstChild;I;I=I[x])if(C(I)){I._i=++O;if(K===I)V=O}return V},s=function(K){return!(o(K)%2)},w=function(K){return o(K)%2},y={checked:function(){return function(K){return!!("checked"in K?K.checked:K.selected)}},"first-child":function(){return k},"last-child":function(){return m},"only-child":function(){return function(K){if(!k(K))return false;if(!m(K))return false;return true}},empty:function(){return function(K){var I=
K.childNodes;for(K=K.childNodes.length-1;K>=0;K--){var O=I[K].nodeType;if(O===1||O==3)return false}return true}},contains:function(K,I){K=I.charAt(0);if(K=='"'||K=="'")I=I.slice(1,-1);return function(O){return O.innerHTML.indexOf(I)>=0}},not:function(K,I){K=n(I)[0];I={el:1};if(K.tag!="*")I.tag=1;if(!K.classes.length)I.classes=1;var O=A(K,I);return function(R){return!O(R)}},"nth-child":function(K,I){K=parseInt;if(I=="odd")return w;else if(I=="even")return s;if(I.indexOf("n")!=-1){I=I.split("n",2);
var O=I[0]?I[0]=="-"?-1:K(I[0]):1,R=I[1]?K(I[1]):0,V=0,X=-1;if(O>0)if(R<0)R=R%O&&O+R%O;else{if(R>0){if(R>=O)V=R-R%O;R%=O}}else if(O<0){O*=-1;if(R>0){X=R;R%=O}}if(O>0)return function(Y){Y=o(Y);return Y>=V&&(X<0||Y<=X)&&Y%O==R};else I=R}var $=K(I);return function(Y){return o(Y)==$}}},B=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(K){var I=K.toLowerCase();if(I=="class")K="className";return function(O){return j?O.getAttribute(K):O[K]||O[I]}}:function(K){return function(I){return I&&I.getAttribute&&I.hasAttribute(K)}},
A=function(K,I){if(!K)return l;I=I||{};var O=null;"el"in I||(O=p(O,v));if(!("tag"in I))if(K.tag!="*")O=p(O,function(R){return R&&R.tagName==K.getTag()});"classes"in I||c(K.classes,function(R,V){var X=new RegExp("(?:^|\\s)"+R+"(?:\\s|$)");O=p(O,function($){return X.test($.className)});O.count=V});"pseudos"in I||c(K.pseudos,function(R){var V=R.name;if(y[V])O=p(O,y[V](V,R.value))});"attrs"in I||c(K.attrs,function(R){var V,X=R.attr;if(R.type&&u[R.type])V=u[R.type](X,R.matchFor);else if(X.length)V=B(X);
if(V)O=p(O,V)});if(!("id"in I))if(K.id)O=p(O,function(R){return!!R&&R.id==K.id});O||"default"in I||(O=l);return O},E=function(K){return function(I,O,R){for(;I=I[x];)if(!(q&&!v(I))){if((!R||da(I,R))&&K(I))O.push(I);break}return O}},G=function(K){return function(I,O,R){for(I=I[x];I;){if(C(I)){if(R&&!da(I,R))break;K(I)&&O.push(I)}I=I[x]}return O}},M=function(K){K=K||l;return function(I,O,R){for(var V=0,X=I[i];I=X[V++];)if(C(I)&&(!R||da(I,R))&&K(I,V))O.push(I);return O}},H=function(K,I){for(K=K.parentNode;K;){if(K==
I)break;K=K.parentNode}return!!K},N={},L=function(K){var I=N[K.query];if(I)return I;var O=K.infixOper;O=O?O.oper:"";var R=A(K,{el:1}),V="*"==K.tag,X=g().getElementsByClassName;if(O){X={el:1};if(V)X.tag=1;R=A(K,X);if("+"==O)I=E(R);else if("~"==O)I=G(R);else if(">"==O)I=M(R)}else if(K.id){R=!K.loops&&V?l:A(K,{el:1,id:1});I=function(Y,ba){var ha=a.byId(K.id,Y.ownerDocument||Y);if(ha&&R(ha))if(9==Y.nodeType)return t(ha,ba);else if(H(ha,Y))return t(ha,ba)}}else if(X&&/\{\s*\[native code\]\s*\}/.test(String(X))&&
K.classes.length&&!h){R=A(K,{el:1,classes:1,id:1});var $=K.classes.join(" ");I=function(Y,ba,ha){ba=t(0,ba);for(var ja,ia=0,ma=Y.getElementsByClassName($);ja=ma[ia++];)R(ja,Y)&&da(ja,ha)&&ba.push(ja);return ba}}else if(!V&&!K.loops)I=function(Y,ba,ha){ba=t(0,ba);for(var ja=0,ia=Y.getElementsByTagName(K.getTag());Y=ia[ja++];)da(Y,ha)&&ba.push(Y);return ba};else{R=A(K,{el:1,tag:1,id:1});I=function(Y,ba,ha){ba=t(0,ba);for(var ja,ia=0,ma=Y.getElementsByTagName(K.getTag());ja=ma[ia++];)R(ja,Y)&&da(ja,
ha)&&ba.push(ja);return ba}}return N[K.query]=I},P=function(K,I){K=t(K);for(var O,R,V=I.length,X,$,Y=0;Y<V;Y++){$=[];O=I[Y];R=K.length-1;if(R>0){X={};$.nozip=true}R=L(O);for(var ba=0;O=K[ba];ba++)R(O,$,X);if(!$.length)break;K=$}return $},S={},D={},F=function(K){var I=n(b(K));if(I.length==1){var O=L(I[0]);return function(R){if(R=O(R,new f))R.nozip=true;return R}}return function(R){return P(R,I)}},J=navigator.userAgent;J=a.isWebKit&&J.indexOf("WebKit/")>0&&parseFloat(J.split("WebKit/")[1])>528;var Q=
a.isIE?"commentStrip":"nozip",T=!!g().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||J),U=/n\+\d|([^ ])?([>~+])([^ =])?/g,W=function(K,I,O,R){return O?(I?I+" ":"")+O+(R?" "+R:""):K},aa=function(K,I){K=K.replace(U,W);if(T){var O=D[K];if(O&&!I)return O}if(O=S[K])return O;O=K.charAt(0);var R=-1==K.indexOf(" ");if(K.indexOf("#")>=0&&R)I=true;if(T&&!I&&">~+".indexOf(O)==-1&&(!a.isIE||K.indexOf(":")==-1)&&!(h&&K.indexOf(".")>=0)&&K.indexOf(":contains")==-1&&K.indexOf(":checked")==-1&&K.indexOf("|=")==
-1){var V=">~+".indexOf(K.charAt(K.length-1))>=0?K+" *":K;return D[K]=function($){try{if(!(9==$.nodeType||R))throw"";var Y=$.querySelectorAll(V);Y[Q]=true;return Y}catch(ba){return aa(K,true)($)}}}else{var X=K.split(/\s*,\s*/);return S[K]=X.length<2?F(K):function($){for(var Y=0,ba=[],ha;ha=X[Y++];)ba=ba.concat(F(ha)($));return ba}}},Z=0,ca=a.isIE?function(K){return j?K.getAttribute("_uid")||K.setAttribute("_uid",++Z)||Z:K.uniqueID}:function(K){return K._uid||(K._uid=++Z)},da=function(K,I){if(!I)return 1;
K=ca(K);if(!I[K])return I[K]=1;return 0},fa="_zipIdx",la=function(K){if(K&&K.nozip)return f._wrap?f._wrap(K):K;var I=new f;if(!K||!K.length)return I;K[0]&&I.push(K[0]);if(K.length<2)return I;Z++;if(a.isIE&&j){var O=Z+"";K[0].setAttribute(fa,O);for(var R=1,V;V=K[R];R++){K[R].getAttribute(fa)!=O&&I.push(V);V.setAttribute(fa,O)}}else if(a.isIE&&K.commentStrip)try{for(R=1;V=K[R];R++)v(V)&&I.push(V)}catch(X){}else{if(K[0])K[0][fa]=Z;for(R=1;V=K[R];R++){K[R][fa]!=Z&&I.push(V);V[fa]=Z}}return I};a.query=
function(K,I){f=a._NodeListCtor;if(!K)return new f;if(K.constructor==f)return K;if(typeof K!="string")return new f(K);if(typeof I=="string"){I=a.byId(I);if(!I)return new f}I=I||g();var O=I.ownerDocument||I.documentElement;j=I.contentType&&I.contentType=="application/xml"||a.isOpera&&(I.doctype||O.toString()=="[object XMLDocument]")||!!O&&(a.isIE?O.xml:I.xmlVersion||O.xmlVersion);if((K=aa(K)(I))&&K.nozip&&!f._wrap)return K;return la(K)};a.query.pseudos=y;a._filterQueryResult=function(K,I,O){var R=
new a._NodeListCtor,V=n(I);V=V.length==1&&!/[^\w#\.]/.test(I)?A(V[0]):function(Y){return dojo.query(I,O).indexOf(Y)!=-1};for(var X=0,$;$=K[X];X++)V($)&&R.push($);return R}},e=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var g=f.length-1;g>=0;g--)if(/\S/.test(f.charAt(g))){f=f.substring(0,g+1);break}return f},forEach:function(f,g,h){if(f&&f.length)for(var i=0,j=f.length;i<j;++i)g.call(h||window,f[i],i,f)},byId:function(f,g){return typeof f=="string"?(g||document).getElementById(f):
f},doc:document,NodeList:Array};var a=navigator,b=a.userAgent;a=a.appVersion;var c=parseFloat(a);acme.isOpera=b.indexOf("Opera")>=0?c:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?c:undefined;acme.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;if((b=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(b+7))<=419.3)acme.isSafari=
2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||undefined;Array._wrap=function(f){return f};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){d(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");d(this.queryPortability||this.acme||dojo)}else d(this.queryPortability||
this.acme||e())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(d){(function(){function e(q,x,z){if(z!==null){var C=q[x];if(typeof C=="string")q[x]=[C,z];else if(a.isArray(C))C.push(z);else q[x]=z}}var a=d,b=a.config;d.fieldToObject=function(q){var x=null;if(q=a.byId(q)){var z=q.name,C=(q.type||"").toLowerCase();if(z&&C&&!q.disabled)if(C=="radio"||C=="checkbox"){if(q.checked)x=q.value}else if(q.multiple){x=[];a.query("option",q).forEach(function(k){k.selected&&
x.push(k.value)})}else x=q.value}return x};d.formToObject=function(q){var x={};a.forEach(d.byId(q).elements,function(z){var C=z.name,k=(z.type||"").toLowerCase();if(C&&k&&"file|submit|image|reset|button|".indexOf(k)==-1&&!z.disabled){e(x,C,a.fieldToObject(z));if(k=="image")x[C+".x"]=x[C+".y"]=x[C].x=x[C].y=0}});return x};d.objectToQuery=function(q){var x=encodeURIComponent,z=[],C={};for(var k in q){var m=q[k];if(m!=C[k]){var o=x(k)+"=";if(a.isArray(m))for(var s=0;s<m.length;s++)z.push(o+x(m[s]));
else z.push(o+x(m))}}return z.join("&")};d.formToQuery=function(q){return a.objectToQuery(a.formToObject(q))};d.formToJson=function(q,x){return a.toJson(a.formToObject(q),x)};d.queryToObject=function(q){var x={};q=q.split("&");var z=decodeURIComponent;a.forEach(q,function(C){if(C.length){var k=C.split("=");C=z(k.shift());k=z(k.join("="));if(typeof x[C]=="string")x[C]=[x[C]];if(a.isArray(x[C]))x[C].push(k);else x[C]=k}});return x};d._blockAsync=false;var c=a._contentHandlers=d.contentHandlers={text:function(q){return q.responseText},
json:function(q){return a.fromJson(q.responseText||null)},"json-comment-filtered":function(q){d.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");q=q.responseText;var x=q.indexOf("/*"),z=q.lastIndexOf("*/");if(x==-1||z==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(q.substring(x+2,z))},javascript:function(q){return a.eval(q.responseText)},xml:function(q){var x=q.responseXML;if(a.isIE&&(!x||!x.documentElement)){var z=function(C){return"MSXML"+C+".DOMDocument"};z=["Microsoft.XMLDOM",z(6),z(4),z(3),z(2)];a.some(z,function(C){try{var k=new ActiveXObject(C);k.async=false;k.loadXML(q.responseText);x=k}catch(m){return false}return true})}return x},"json-comment-optional":function(q){return q.responseText&&/^[^{\[]*\/\*/.test(q.responseText)?c["json-comment-filtered"](q):
c.json(q)}};d._ioSetArgs=function(q,x,z,C){var k={args:q,url:q.url},m=null;if(q.form){m=a.byId(q.form);var o=m.getAttributeNode("action");k.url=k.url||(o?o.value:null);m=a.formToObject(m)}o=[{}];m&&o.push(m);q.content&&o.push(q.content);q.preventCache&&o.push({"dojo.preventCache":(new Date).valueOf()});k.query=a.objectToQuery(a.mixin.apply(null,o));k.handleAs=q.handleAs||"text";var s=new a.Deferred(x);s.addCallbacks(z,function(A){return C(A,s)});var w=q.load;w&&a.isFunction(w)&&s.addCallback(function(A){return w.call(q,
A,k)});var y=q.error;y&&a.isFunction(y)&&s.addErrback(function(A){return y.call(q,A,k)});var B=q.handle;B&&a.isFunction(B)&&s.addBoth(function(A){return B.call(q,A,k)});if(b.ioPublish&&a.publish&&k.args.ioPublish!==false){s.addCallbacks(function(A){a.publish("/dojo/io/load",[s,A]);return A},function(A){a.publish("/dojo/io/error",[s,A]);return A});s.addBoth(function(A){a.publish("/dojo/io/done",[s,A]);return A})}s.ioArgs=k;return s};var f=function(q){q.canceled=true;var x=q.ioArgs.xhr,z=typeof x.abort;
if(z=="function"||z=="object"||z=="unknown")x.abort();q=q.ioArgs.error;if(!q){q=new Error("xhr cancelled");q.dojoType="cancel"}return q},g=function(q){q=c[q.ioArgs.handleAs](q.ioArgs.xhr);return q===undefined?null:q},h=function(q,x){x.ioArgs.args.failOk||console.error(q);return q},i=null,j=[],l=0,n=function(q){if(l<=0){l=0;if(b.ioPublish&&a.publish&&(!q||q&&q.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},p=function(){var q=(new Date).getTime();if(!a._blockAsync)for(var x=0,z;x<j.length&&
(z=j[x]);x++){var C=z.dfd,k=function(){if(!C||C.canceled||!z.validCheck(C)){j.splice(x--,1);l-=1}else if(z.ioCheck(C)){j.splice(x--,1);z.resHandle(C);l-=1}else if(C.startTime)if(C.startTime+(C.ioArgs.args.timeout||0)<q){j.splice(x--,1);var o=new Error("timeout exceeded");o.dojoType="timeout";C.errback(o);C.cancel();l-=1}};if(d.config.debugAtAllCosts)k.call(this);else try{k.call(this)}catch(m){C.errback(m)}}n(C);if(!j.length){clearInterval(i);i=null}};d._ioCancelAll=function(){try{a.forEach(j,function(x){try{x.dfd.cancel()}catch(z){}})}catch(q){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(q){if(b.ioPublish&&a.publish&&q.ioArgs.args.ioPublish!==false){l||a.publish("/dojo/io/start");l+=1;a.publish("/dojo/io/send",[q])}};a._ioWatch=function(q,x,z,C){var k=q.ioArgs.args;if(k.timeout)q.startTime=(new Date).getTime();j.push({dfd:q,validCheck:x,ioCheck:z,resHandle:C});i||(i=setInterval(p,50));k.sync&&p()};var t="application/x-www-form-urlencoded",v=function(q){return q.ioArgs.xhr.readyState},r=function(q){return 4==q.ioArgs.xhr.readyState},
u=function(q){var x=q.ioArgs.xhr;if(a._isDocumentOk(x))q.callback(q);else{var z=new Error("Unable to load "+q.ioArgs.url+" status:"+x.status);z.status=x.status;z.responseText=x.responseText;q.errback(z)}};d._ioAddQueryToUrl=function(q){if(q.query.length){q.url+=(q.url.indexOf("?")==-1?"?":"&")+q.query;q.query=null}};d.xhr=function(q,x,z){var C=a._ioSetArgs(x,f,g,h),k=C.ioArgs,m=k.xhr=a._xhrObj(k.args);if(!m){C.cancel();return C}if("postData"in x)k.query=x.postData;else if("putData"in x)k.query=x.putData;
else if("rawBody"in x)k.query=x.rawBody;else if(arguments.length>2&&!z||"POST|PUT".indexOf(q.toUpperCase())==-1)a._ioAddQueryToUrl(k);m.open(q,k.url,x.sync!==true,x.user||undefined,x.password||undefined);if(x.headers)for(var o in x.headers)if(o.toLowerCase()==="content-type"&&!x.contentType)x.contentType=x.headers[o];else x.headers[o]&&m.setRequestHeader(o,x.headers[o]);m.setRequestHeader("Content-Type",x.contentType||t);if(!x.headers||!("X-Requested-With"in x.headers))m.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(C);if(d.config.debugAtAllCosts)m.send(k.query);else try{m.send(k.query)}catch(s){k.error=s;C.cancel()}a._ioWatch(C,v,r,u);return C};d.xhrGet=function(q){return a.xhr("GET",q)};d.rawXhrPost=d.xhrPost=function(q){return a.xhr("POST",q,true)};d.rawXhrPut=d.xhrPut=function(q){return a.xhr("PUT",q,true)};d.xhrDelete=function(q){return a.xhr("DELETE",q)}})();return d.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(d){(function(){var e=d._mixin;d._Line=function(h,i){this.start=h;this.end=i};d._Line.prototype.getValue=function(h){return(this.end-this.start)*h+this.start};d.Animation=function(h){e(this,h);if(d.isArray(this.curve))this.curve=new d._Line(this.curve[0],this.curve[1])};d._Animation=d.Animation;d.extend(d.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var h=this._percent,i=this.easing;return i?i(h):h},_fire:function(h,i){i=i||[];if(this[h])if(d.config.debugAtAllCosts)this[h].apply(this,i);else try{this[h].apply(this,i)}catch(j){console.error("exception in animation handler for:",h);console.error(j)}return this},play:function(h,i){var j=this;j._delayTimer&&j._clearTimer();if(i){j._stopTimer();j._active=j._paused=false;j._percent=0}else if(j._active&&!j._paused)return j;j._fire("beforeBegin",[j.node]);h=h||j.delay;var l=d.hitch(j,
"_play",i);if(h>0){j._delayTimer=setTimeout(l,h);return j}l();return j},_play:function(){var h=this;h._delayTimer&&h._clearTimer();h._startTime=(new Date).valueOf();if(h._paused)h._startTime-=h.duration*h._percent;h._active=true;h._paused=false;var i=h.curve.getValue(h._getStep());if(!h._percent){if(!h._startRepeatCount)h._startRepeatCount=h.repeat;h._fire("onBegin",[i])}h._fire("onPlay",[i]);h._cycle();return h},pause:function(){var h=this;h._delayTimer&&h._clearTimer();h._stopTimer();if(!h._active)return h;
h._paused=true;h._fire("onPause",[h.curve.getValue(h._getStep())]);return h},gotoPercent:function(h,i){var j=this;j._stopTimer();j._active=j._paused=true;j._percent=h;i&&j.play();return j},stop:function(h){var i=this;i._delayTimer&&i._clearTimer();if(!i._timer)return i;i._stopTimer();if(h)i._percent=1;i._fire("onStop",[i.curve.getValue(i._getStep())]);i._active=i._paused=false;return i},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var h=
this;if(h._active){var i=((new Date).valueOf()-h._startTime)/h.duration;if(i>=1)i=1;h._percent=i;if(h.easing)i=h.easing(i);h._fire("onAnimate",[h.curve.getValue(i)]);if(h._percent<1)h._startTimer();else{h._active=false;if(h.repeat>0){h.repeat--;h.play(null,true)}else if(h.repeat==-1)h.play(null,true);else if(h._startRepeatCount){h.repeat=h._startRepeatCount;h._startRepeatCount=0}h._percent=0;h._fire("onEnd",[h.node]);!h.repeat&&h._stopTimer()}}return h},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,b=null,c={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(c,"run",this,"_cycle");a++}b||(b=setInterval(d.hitch(c,"run"),this.rate))},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(b);b=null;a=0}}});var f=d.isIE?function(h){var i=h.style;if(!i.width.length&&d.style(h,"width")=="auto")i.width="auto"}:function(){};d._fade=function(h){h.node=d.byId(h.node);
var i=e({properties:{}},h);h=i.properties.opacity={};h.start=!("start"in i)?function(){return+d.style(i.node,"opacity")||0}:i.start;h.end=i.end;h=d.animateProperty(i);d.connect(h,"beforeBegin",d.partial(f,i.node));return h};d.fadeIn=function(h){return d._fade(e({end:1},h))};d.fadeOut=function(h){return d._fade(e({end:0},h))};d._defaultEasing=function(h){return 0.5+Math.sin((h+1.5)*Math.PI)/2};var g=function(h){this._properties=h;for(var i in h){var j=h[i];if(j.start instanceof d.Color)j.tempColor=
new d.Color}};g.prototype.getValue=function(h){var i={};for(var j in this._properties){var l=this._properties[j],n=l.start;if(n instanceof d.Color)i[j]=d.blendColors(n,l.end,h,l.tempColor).toCss();else d.isArray(n)||(i[j]=(l.end-n)*h+n+(j!="opacity"?l.units||"px":0))}return i};d.animateProperty=function(h){var i=h.node=d.byId(h.node);if(!h.easing)h.easing=d._defaultEasing;h=new d.Animation(h);d.connect(h,"beforeBegin",h,function(){var j={};for(var l in this.properties){if(l=="width"||l=="height")this.node.display=
"block";var n=this.properties[l];if(d.isFunction(n))n=n(i);n=j[l]=e({},d.isObject(n)?n:{end:n});if(d.isFunction(n.start))n.start=n.start(i);if(d.isFunction(n.end))n.end=n.end(i);var p=l.toLowerCase().indexOf("color")>=0,t=function(v,r){var u={height:v.offsetHeight,width:v.offsetWidth}[r];if(u!==undefined)return u;u=d.style(v,r);return r=="opacity"?+u:p?u:parseFloat(u)};if("end"in n){if(!("start"in n))n.start=t(i,l)}else n.end=t(i,l);if(p){n.start=new d.Color(n.start);n.end=new d.Color(n.end)}else n.start=
l=="opacity"?+n.start:parseFloat(n.start)}this.curve=new g(j)});d.connect(h,"onAnimate",d.hitch(d,"style",h.node));return h};d.anim=function(h,i,j,l,n,p){return d.animateProperty({node:h,duration:j||d.Animation.prototype.duration,properties:i,easing:l,onEnd:n}).play(p||0)}})();return d.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(d){return d});
define("orion/serviceregistry",["dojo"],function(d){function e(g,h,i){this.serviceId=g;this.name=h;this.properties=i}function a(g,h,i){this.serviceId=g;this.serviceReference=h;this.internalRegistry=i}function b(g,h,i){this.serviceId=g;this.implementation=h;this.internalRegistry=i;var j;for(j in h)if(typeof h[j]==="function")this[j]=function(l){return function(){if(i.isRegistered(g)){var n=new d.Deferred;try{var p=h[l].apply(h,Array.prototype.slice.call(arguments));d.when(p,d.hitch(n,n.resolve),d.hitch(n,
n.reject),d.hitch(n,n.progress))}catch(t){n.reject(t)}return n}throw new Error("Service was unregistered");}}(j)}function c(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new c;var g=this;this.internalRegistry={isRegistered:function(h){return g._entries[h]?true:false},unregisterService:function(h){var i=g._entries[h];if(i){for(var j=i.reference,l=g._namedReferences[j.getName()],n=0;n<l.length;n++)if(l[n]===j){if(l.length===1)delete g._namedReferences[j.getName()];
else l.splice(n,1);break}g._entries[h]=null;g._serviceEventTarget.dispatchEvent("serviceRemoved",j,i.service)}},dispatchEvent:function(h,i){var j=g._entries[h];j&&j.eventTarget.dispatchEvent.apply(j.eventTarget,[i].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(h,i,j){(h=g._entries[h])&&h.eventTarget.addEventListener(i,j)},removeEventListener:function(h,i,j){(h=g._entries[h])&&h.eventTarget.removeEventListener(i,j)}}}e.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var g=[],h;for(h in this.properties)this.properties.hasOwnProperty(h)&&g.push(h);return g},getProperty:function(g){return this.properties[g]}};e.prototype.constructor=e;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(g){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,g].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;b.prototype={addEventListener:function(g,h){this.internalRegistry.addEventListener(this.serviceId,g,h)},removeEventListener:function(g,h){this.internalRegistry.removeEventListener(this.serviceId,g,h)}};b.prototype.constructor=b;c.prototype={dispatchEvent:function(g){var h=this._namedlisteners[g];if(h)for(var i=0;i<h.length;i++)try{var j=Array.prototype.slice.call(arguments,1);h[i].apply(null,j)}catch(l){console.log(l)}},addEventListener:function(g,h){this._namedlisteners[g]=
this._namedlisteners[g]||[];this._namedlisteners[g].push(h)},removeEventListener:function(g,h){var i=this._namedlisteners[g];if(i)for(var j=0;j<i.length;j++)if(i[j]===h){if(i.length===1)delete this._namedlisteners[g];else i.splice(j,1);break}}};c.prototype.constructor=c;f.prototype={getService:function(g){var h;if(typeof g==="string"){if(this._namedReferences[g])for(var i=0;i<this._namedReferences[g].length;i++)if(h=this._entries[this._namedReferences[g][i].getServiceId()].service)break}else h=this._entries[g.getServiceId()].service;
return h},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:[];g=[];for(var h=0;h<this._entries.length;h++)this._entries[h]&&g.push(this._entries[h].reference);return g},registerService:function(g,h,i){var j=this._entries.length;i=new e(j,g,i);h=new b(j,h,this.internalRegistry);this._namedReferences[g]=this._namedReferences[g]||[];this._namedReferences[g].push(i);this._entries.push({reference:i,service:h,eventTarget:new c});this._serviceEventTarget.dispatchEvent("serviceAdded",
i,h);return new a(j,i,this.internalRegistry)},addEventListener:function(g,h){this._serviceEventTarget.addEventListener(g,h)},removeEventListener:function(g,h){this._serviceEventTarget.removeEventListener(g,h)}};f.prototype.constructor=f;return{ServiceReference:e,ServiceRegistration:a,Service:b,EventTarget:c,ServiceRegistry:f}});define("dijit",["dojo"],function(d){return dijit=d._dijit||{}});
define("orion/commonHTMLFragments",["require"],function(d){var e='<div id="staticBanner" class="layoutBlock topRowBanner"><a id="home" class="layoutLeft logo" href="'+d.toUrl("index.html")+'"><img src="'+d.toUrl("images/orion-small-lightondark.gif")+'" alt="Orion Logo"/></a><div id="primaryNav" class="layoutLeft primaryNav"></div><div id="userMenu" class="layoutRight textless"></div><div id="userInfo" class="layoutRight primaryNav"></div><div class="layoutRight primaryNav">|</div></div><div id="titleArea" class="layoutBlock titleArea"><div id="pageTitle" class="layoutLeft pageTitle"></div><input type="search" id="search" placeholder="Search" title="Type a keyword or wild card to search in root" class="layoutRight searchbox"><div id="relatedLinks" class="layoutRight pageNav"></div><div id="extras" class="layoutRight pageNav"><div id="globalActions" class="pageNav"></div><span id="pageFavorite" tabindex="0" role="button" aria-label="Add this page to the favorites list" class="imageSprite core-sprite-favorite_sml"></span></div><div id="dimension" class="clear dimension"></div><div id="location" class="clear currentLocation"></div></div>';
d='<div class="layoutLeft pageActions" id="pageActions"></div><div class="layoutLeft pageActions" id="selectionTools"></div><img class="layoutRight progressPane" src="'+d.toUrl("images/none.png")+'" id="progressPane"></img><div class="layoutRight status" id="statusPane"></div><div class="layoutRight pageActions" id="pageNavigationActions"></div><div id="notificationArea" class="layoutLeft layoutBlock slideContainer"><div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div><div class="layoutRight"><span tabindex: "0" role: "button" class="layoutRight core-sprite-close imageSprite" id="closeNotifications"></span></div></div><div id="parameterArea" class="layoutBlock slideParameters slideContainer"><span id="pageParameterArea" class="slide"><span id="pageCommandParameters" class="parameters"></span><span id="pageCommandDismiss" class="parametersDismiss"></span></span></div>';
return{topHTMLFragment:e,bottomHTMLFragment:'<div class="layoutBlock"><div class="footerBlock">Orion is in Beta. Please try it out but BEWARE your data may be lost.</div><div class="footerRightBlock"><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=0.4" target="_blank">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php" target="_blank">Copyright Agent</a></div></div>',
toolbarHTMLFragment:d}});
define("dojo/hash",["dojo"],function(d){(function(){function e(n,p){p=n.indexOf(p);return p>=0?n.substring(p+1):""}function a(){return e(location.href,"#")}function b(){d.publish("/dojo/hashchange",[a()])}function c(){if(a()!==h){h=a();b()}}function f(n){if(i)if(i.isTransitioning())setTimeout(d.hitch(null,f,n),l);else{var p=i.iframe.location.href,t=p.indexOf("?");i.iframe.location.replace(p.substring(0,t)+"?"+n)}else{location.replace("#"+n);!j&&c()}}function g(){function n(){h=a();v=x?h:e(z.href,
"?");r=false;u=null}var p=document.createElement("iframe"),t=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html");d.config.useXDomain&&!d.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");p.id="dojo-hash-iframe";p.src=t+"?"+a();p.style.display="none";document.body.appendChild(p);this.iframe=d.global["dojo-hash-iframe"];
var v,r,u,q,x,z=this.iframe.location;this.isTransitioning=function(){return r};this.pollLocation=function(){if(!x)try{var C=e(z.href,"?");if(document.title!=q)q=this.iframe.document.title=document.title}catch(k){x=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var m=a();if(r&&h===m)if(x||C===u){n();b()}else{setTimeout(d.hitch(this,this.pollLocation),0);return}else if(!(h===m&&(x||v===C)))if(h!==m){h=m;r=true;u=m;p.src=t+"?"+u;x=false;setTimeout(d.hitch(this,this.pollLocation),
0);return}else if(!x){location.href="#"+z.search.substring(1);n();b()}setTimeout(d.hitch(this,this.pollLocation),l)};n();setTimeout(d.hitch(this,this.pollLocation),l)}d.hash=function(n,p){if(!arguments.length)return a();if(n.charAt(0)=="#")n=n.substring(1);if(p)f(n);else location.href="#"+n;return n};var h,i,j,l=d.config.hashPollFrequency||100;d.addOnLoad(function(){if("onhashchange"in d.global&&(!d.isIE||d.isIE>=8&&document.compatMode!="BackCompat"))j=d.connect(d.global,"onhashchange",b);else if(document.addEventListener){h=
a();setInterval(c,l)}else if(document.attachEvent)i=new g})})();return d.hash});
(function(){var d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=[];define("text",["require","exports","module"],function(){var c,f,g;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(h,i){var j=c.createXhr();j.open("GET",h,true);j.onreadystatechange=function(){j.readyState===4&&i(j.responseText)};j.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){g=require.nodeRequire("fs");f=function(h,i){i(g.readFileSync(h,"utf8"))}}else if(typeof Packages!=="undefined")f=function(h,i){var j=new java.io.File(h);h=java.lang.System.getProperty("line.separator");j=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(j),"utf-8"));var l,n,p="";try{l=new java.lang.StringBuffer;if((n=j.readLine())&&n.length()&&n.charAt(0)===65279)n=n.substring(1);for(l.append(n);(n=j.readLine())!==null;){l.append(h);l.append(n)}p=
String(l.toString())}finally{j.close()}i(p)};return c={version:"0.24.0",strip:function(h){if(h){h=h.replace(e,"");var i=h.match(a);if(i)h=i[1]}else h="";return h},jsEscape:function(h){return h.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var h,i,j;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(i=0;i<3;i++){j=d[i];try{h=new ActiveXObject(j)}catch(l){}if(h){d=
[j];break}}if(!h)throw new Error("require.getXhr(): XMLHttpRequest not available");return h},get:f,load:function(h,i,j,l){var n=false,p=h.indexOf("."),t=h.substring(0,p),v=h.substring(p+1,h.length);p=v.indexOf("!");if(p!==-1){n=v.substring(p+1,v.length);n=n==="strip";v=v.substring(0,p)}i=i.nameToUrl(t,"."+v);c.get(i,function(r){r=n?c.strip(r):r;if(l.isBuild&&l.inlineText)b[h]=r;j(r)})},write:function(h,i,j){if(i in b){var l=c.jsEscape(b[i]);j("define('"+h+"!"+i+"', function () { return '"+l+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(d,e){e.getObject("i18n",true,e);e.i18n.getLocalization=e.i18n.getLocalization||function(a,b,c){c=e.i18n.normalizeLocale(c);var f=c.split("-"),g=[a,"nls",b].join(".");if(typeof e.global.require!=="undefined"){var h=d("i18n!"+[a.replace(/\./g,"/"),"nls",b].join("/"));(e._loadedModules[g]=e._loadedModules[g]||{})[f.join("_")]=h.root||h}if(g=e._loadedModules[g]){var i;for(h=f.length;h>0;h--){var j=f.slice(0,h).join("_");if(g[j]){i=g[j];break}}if(!i)i=g.ROOT;
if(i){a=function(){};a.prototype=i;return new a}}throw new Error("Bundle not found: "+b+" in "+a+" , locale="+c);};e.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():e.locale;if(a=="root")a="ROOT";return a};e.i18n._requireLocalization=function(a,b,c,f){c=e.i18n.normalizeLocale(c);var g=[a,"nls",b].join("."),h="";if(f){for(var i=f.split(","),j=0;j<i.length;j++)if(c.indexOf(i[j])==0)if(i[j].length>h.length)h=i[j];h||(h="ROOT")}i=f?h:c;var l=e._loadedModules[g];j=null;if(l){if(e.config.localizationComplete&&
l._built)return;j=i.replace(/-/g,"_");j=e._loadedModules[g+"."+j]}if(!j){l=e.provide(g);var n=e._getModuleSymbols(a).concat("nls").join("/"),p;e.i18n._searchLocalePath(i,f,function(t){var v=t.replace(/-/g,"_"),r=g+"."+v,u=false;if(e._loadedModules[r])u=true;else{e.provide(r);r=[n];t!="ROOT"&&r.push(t);r.push(b);t=r.join("/")+".js";u=e._loadPath(t,null,function(q){q=q.root||q;var x=function(){};x.prototype=p;l[v]=new x;for(var z in q)l[v][z]=q[z]})}if(u&&l[v])p=l[v];else l[v]=p;if(f)return true})}if(f&&
c!=h)l[c.replace(/-/g,"_")]=l[h.replace(/-/g,"_")]};(function(){var a=e.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var b=e.i18n._requireLocalization;e.i18n._requireLocalization=function(c,f,g,h){b(c,f,g,h);if(!g)for(g=0;g<a.length;g++)b(c,f,a[g],h)}}})();e.i18n._searchLocalePath=function(a,b,c){a=e.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var g=f.length;g>0;g--)a.push(f.slice(0,g).join("-"));a.push(false);b&&a.reverse();for(b=a.length-1;b>=0;b--)if(c(a[b]||"ROOT"))break};e.i18n._preloadLocalizations=
function(a,b){function c(h){h=e.i18n.normalizeLocale(h);e.i18n._searchLocalePath(h,true,function(i){for(var j=0;j<b.length;j++)if(b[j]==i){e.require(a+"_"+i);return true}return false})}c();for(var f=e.config.extraLocale||[],g=0;g<f.length;g++)c(f[g])};return e.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(d){d.getObject("window",true,d);d.window.getBox=function(){var e=d.doc.compatMode=="BackCompat"?d.body():d.doc.documentElement,a=d._docScroll();return{w:e.clientWidth,h:e.clientHeight,l:a.x,t:a.y}};d.window.get=function(e){if(d.isIE&&window!==document.parentWindow){e.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=e._parentWindow;e._parentWindow=null;return a}return e.parentWindow||e.defaultView};d.window.scrollIntoView=function(e,
a){try{e=d.byId(e);var b=e.ownerDocument||d.doc,c=b.body||d.body(),f=b.documentElement||c.parentNode,g=d.isIE,h=d.isWebKit;if((!(d.isMoz||g||h||d.isOpera)||e==c||e==f)&&typeof e.scrollIntoView!="undefined")e.scrollIntoView(false);else{var i=b.compatMode=="BackCompat",j=g>=9&&e.ownerDocument.parentWindow.frameElement?f.clientHeight>0&&f.clientWidth>0&&(c.clientHeight==0||c.clientWidth==0||c.clientHeight>f.clientHeight||c.clientWidth>f.clientWidth)?f:c:i?c:f;b=h?c:j;var l=j.clientWidth,n=j.clientHeight,
p=!d._isBodyLtr(),t=a||d.position(e),v=e.parentNode;a=function(y){return g<=6||g&&i?false:d.style(y,"position").toLowerCase()=="fixed"};if(!a(e))for(;v;){if(v==c)v=b;var r=d.position(v),u=a(v);if(v==b){r.w=l;r.h=n;if(b==f&&g&&p)r.x+=b.offsetWidth-r.w;if(r.x<0||!g)r.x=0;if(r.y<0||!g)r.y=0}else{var q=d._getPadBorderExtents(v);r.w-=q.w;r.h-=q.h;r.x+=q.l;r.y+=q.t;var x=v.clientWidth,z=r.w-x;if(x>0&&z>0){r.w=x;r.x+=p&&(g||v.clientLeft>q.l)?z:0}x=v.clientHeight;z=r.h-x;if(x>0&&z>0)r.h=x}if(u){if(r.y<0){r.h+=
r.y;r.y=0}if(r.x<0){r.w+=r.x;r.x=0}if(r.y+r.h>n)r.h=n-r.y;if(r.x+r.w>l)r.w=l-r.x}var C=t.x-r.x,k=t.y-Math.max(r.y,0),m=C+t.w-r.w,o=k+t.h-r.h;if(m*C>0){var s=Math[C<0?"max":"min"](C,m);if(p&&(g==8&&!i||g>=9))s=-s;t.x+=v.scrollLeft;v.scrollLeft+=s;t.x-=v.scrollLeft}if(o*k>0){t.y+=v.scrollTop;v.scrollTop+=Math[k<0?"max":"min"](k,o);t.y-=v.scrollTop}v=v!=b&&!u&&v.parentNode}}}catch(w){console.error("scrollIntoView: "+w);e.scrollIntoView(false)}};return d.window});
define("dijit/_base/manager",["dojo","dijit"],function(d,e){d.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,b){b=b||d.global;var c=0,f;for(f in this._hash)a.call(b,this._hash[f],c++,this._hash);return this},
filter:function(a,b){b=b||d.global;var c=new e.WidgetSet,f=0,g;for(g in this._hash){var h=this._hash[g];a.call(b,h,f++,this._hash)&&c.add(h)}return c},byId:function(a){return this._hash[a]},byClass:function(a){var b=new e.WidgetSet,c,f;for(c in this._hash){f=this._hash[c];f.declaredClass==a&&b.add(f)}return b},toArray:function(){var a=[];for(var b in this._hash)a.push(this._hash[b]);return a},map:function(a,b){return d.map(this.toArray(),a,b)},every:function(a,b){b=b||d.global;var c=0,f;for(f in this._hash)if(!a.call(b,
this._hash[f],c++,this._hash))return false;return true},some:function(a,b){b=b||d.global;var c=0,f;for(f in this._hash)if(a.call(b,this._hash[f],c++,this._hash))return true;return false}});(function(){e.registry=new e.WidgetSet;var a=e.registry._hash,b=d.attr,c=d.hasAttr,f=d.style;e.byId=function(j){return typeof j=="string"?a[j]:j};var g={};e.getUniqueId=function(j){var l;do l=j+"_"+(j in g?++g[j]:(g[j]=0));while(a[l]);return e._scopeName=="dijit"?l:e._scopeName+"_"+l};e.findWidgets=function(j){function l(p){for(p=
p.firstChild;p;p=p.nextSibling)if(p.nodeType==1){var t=p.getAttribute("widgetId");if(t)(t=a[t])&&n.push(t);else l(p)}}var n=[];l(j);return n};e._destroyAll=function(){e._curFocus=null;e._prevFocus=null;e._activeStack=[];d.forEach(e.findWidgets(d.body()),function(j){if(!j._destroyed)if(j.destroyRecursive)j.destroyRecursive();else j.destroy&&j.destroy()})};d.isIE&&d.addOnWindowUnload(function(){e._destroyAll()});e.byNode=function(j){return a[j.getAttribute("widgetId")]};e.getEnclosingWidget=function(j){for(;j;){var l=
j.getAttribute&&j.getAttribute("widgetId");if(l)return a[l];j=j.parentNode}return null};var h=e._isElementShown=function(j){var l=f(j);return l.visibility!="hidden"&&l.visibility!="collapsed"&&l.display!="none"&&b(j,"type")!="hidden"};e.hasDefaultTabStop=function(j){switch(j.nodeName.toLowerCase()){case "a":return c(j,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var l;try{var n=j.contentDocument;if("designMode"in n&&n.designMode==
"on")return true;l=n.body}catch(p){try{l=j.contentWindow.document.body}catch(t){return false}}return l.contentEditable=="true"||l.firstChild&&l.firstChild.contentEditable=="true";default:return j.contentEditable=="true"}};var i=e.isTabNavigable=function(j){return b(j,"disabled")?false:c(j,"tabIndex")?b(j,"tabIndex")>=0:e.hasDefaultTabStop(j)};e._getTabNavigable=function(j){function l(C){return C&&C.tagName.toLowerCase()=="input"&&C.type&&C.type.toLowerCase()=="radio"&&C.name&&C.name.toLowerCase()}
function n(C){return x[l(C)]||C}var p,t,v,r,u,q,x={},z=function(C){d.query("> *",C).forEach(function(k){if(!(d.isIE&&k.scopeName!=="HTML"||!h(k))){if(i(k)){var m=b(k,"tabIndex");if(!c(k,"tabIndex")||m==0){p||(p=k);t=k}else if(m>0){if(!v||m<r){r=m;v=k}if(!u||m>=q){q=m;u=k}}m=l(k);if(d.attr(k,"checked")&&m)x[m]=k}k.nodeName.toUpperCase()!="SELECT"&&z(k)}})};h(j)&&z(j);return{first:n(p),last:n(t),lowest:n(v),highest:n(u)}};e.getFirstInTabbingOrder=function(j){j=e._getTabNavigable(d.byId(j));return j.lowest?
j.lowest:j.first};e.getLastInTabbingOrder=function(j){j=e._getTabNavigable(d.byId(j));return j.last?j.last:j.highest};e.defaultDuration=d.config.defaultDuration||200})();return e});
define("dojo/Stateful",["dojo"],function(d){d.declare("dojo.Stateful",null,{postscript:function(e){e&&d.mixin(this,e)},get:function(e){return this[e]},set:function(e,a){if(typeof e==="object"){for(var b in e)this.set(b,e[b]);return this}b=this[e];this[e]=a;this._watchCallbacks&&this._watchCallbacks(e,b,a);return this},watch:function(e,a){var b=this._watchCallbacks;if(!b){var c=this;b=this._watchCallbacks=function(g,h,i,j){var l=function(n){if(n){n=n.slice();for(var p=0,t=n.length;p<t;p++)try{n[p].call(c,
g,h,i)}catch(v){console.error(v)}}};l(b["_"+g]);j||l(b["*"])}}if(!a&&typeof e==="function"){a=e;e="*"}else e="_"+e;var f=b[e];if(typeof f!=="object")f=b[e]=[];f.push(a);return{unwatch:function(){f.splice(d.indexOf(f,a),1)}}}});return d.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(d,e){(function(){d.declare("dijit._WidgetBase",d.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,b){this.create(a,b)},create:function(a,b){this.srcNodeRef=
d.byId(b);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;d._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=e.getUniqueId(this.declaredClass.replace(/\./g,"_"));e.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(c,f){if(f.params&&c in f.params||f[c])f.set(c,f[c])};for(var b in this.attributeMap)a(b,this);d.forEach(this._getSetterAttributes(),function(c){c in this.attributeMap||a(c,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var b=a._setterAttrs=[],c,f=a.prototype;for(var g in f)if(d.isFunction(f[g])&&(c=g.match(/^_set([a-zA-Z]*)Attr$/))&&
c[1])b.push(c[1].charAt(0).toLowerCase()+c[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||d.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(d.map(a,function(b){return b+"Rtl"})));d.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var b=d.forEach,c=d.unsubscribe;b(this._connects,function(f){b(f,d.disconnect)});b(this._subscribes,function(f){c(f)});b(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);e.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?d.removeAttr(this.domNode,
"widgetId"):d.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||d.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){d.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var b=this[this.attributeMap.style||"domNode"];if(d.isObject(a))d.style(b,
a);else if(b.style.cssText)b.style.cssText+="; "+a;else b.style.cssText=a;this._set("style",a)},_attrToDom:function(a,b){var c=this.attributeMap[a];d.forEach(d.isArray(c)?c:[c],function(f){var g=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(d.isFunction(b))b=d.hitch(this,b);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;d.attr(g,f,b);break;case "innerText":g.innerHTML="";g.appendChild(d.doc.createTextNode(b));break;case "innerHTML":g.innerHTML=
b;break;case "class":d.replaceClass(g,b,this[a]);break}},this)},get:function(a){var b=this._getAttrNames(a);return this[b.g]?this[b.g]():this[a]},set:function(a,b){if(typeof a==="object"){for(var c in a)this.set(c,a[c]);return this}c=this._getAttrNames(a);if(this[c.s])var f=this[c.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,b);this._set(a,b)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];
var c=a.charAt(0).toUpperCase()+a.substr(1);return b[a]={n:a+"Node",s:"_set"+c+"Attr",g:"_get"+c+"Attr"}},_set:function(a,b){var c=this[a];this[a]=b;this._watchCallbacks&&this._created&&b!==c&&this._watchCallbacks(a,c,b)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?d.query("[widgetId]",this.containerNode).map(e.byNode):[]},getChildren:function(){return this.containerNode?e.findWidgets(this.containerNode):
[]},connect:function(a,b,c){a=[d._connect(a,b,this,c)];this._connects.push(a);return a},disconnect:function(a){for(var b=0;b<this._connects.length;b++)if(this._connects[b]==a){d.forEach(a,d.disconnect);this._connects.splice(b,1);return}},subscribe:function(a,b){a=d.subscribe(a,this,b);this._subscribes.push(a);return a},unsubscribe:function(a){for(var b=0;b<this._subscribes.length;b++)if(this._subscribes[b]==a){d.unsubscribe(a);this._subscribes.splice(b,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":d._isBodyLtr()},placeAt:function(a,b){a.declaredClass&&a.addChild?a.addChild(this,b):d.place(this.domNode,a,b);return this}})})();return e._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(d,e){d.mixin(e,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return e.getBookmark().isCollapsed},getBookmark:function(){var a,b,c=d.doc.selection,f=e._curFocus;if(d.global.getSelection){if(c=d.global.getSelection())if(c.isCollapsed){if(a=f?f.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!f.type||f.type.toLowerCase()=="text")){c={start:f.selectionStart,end:f.selectionEnd,node:f,pRange:true};
return{isCollapsed:c.end<=c.start,mark:c}}}a={isCollapsed:true};if(c.rangeCount)a.mark=c.getRangeAt(0).cloneRange()}else{b=c.getRangeAt(0);a={isCollapsed:false,mark:b.cloneRange()}}}else if(c){a=f?f.tagName:"";a=a.toLowerCase();if(f&&a&&(a=="button"||a=="textarea"||a=="input"))if(c.type&&c.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{b=c.createRange();return{isCollapsed:b.text&&b.text.length?false:true,mark:{range:b,pRange:true}}}a={};try{b=c.createRange();a.isCollapsed=!(c.type==
"Text"?b.htmlText.length:b.length)}catch(g){a.isCollapsed=true;return a}if(c.type.toUpperCase()=="CONTROL")if(b.length){a.mark=[];c=0;for(f=b.length;c<f;)a.mark.push(b.item(c++))}else{a.isCollapsed=true;a.mark=null}else a.mark=b.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var b=d.doc;if(a=a.mark)if(d.global.getSelection){var c=d.global.getSelection();if(c&&c.removeAllRanges)if(a.pRange){c=a.node;c.selectionStart=
a.start;c.selectionEnd=a.end}else{c.removeAllRanges();c.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(b.selection&&a){var f;if(a.pRange)f=a.range;else if(d.isArray(a)){f=b.body.createControlRange();d.forEach(a,function(g){f.addElement(g)})}else{f=b.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,b){a=!e._curFocus||a&&d.isDescendant(e._curFocus,a.domNode)?e._prevFocus:e._curFocus;return{node:a,bookmark:a==e._curFocus&&d.withGlobal(b||
d.global,e.getBookmark),openedForWindow:b}},focus:function(a){if(a){var b="node"in a?a.node:a,c=a.bookmark;a=a.openedForWindow;var f=c?c.isCollapsed:false;if(b){var g=b.tagName.toLowerCase()=="iframe"?b.contentWindow:b;if(g&&g.focus)try{g.focus()}catch(h){}e._onFocusNode(b)}if(c&&d.withGlobal(a||d.global,e.isCollapsed)&&!f){a&&a.focus();try{d.withGlobal(a||d.global,e.moveToBookmark,null,[c])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return e.registerWin(a.contentWindow,a)},unregisterIframe:function(a){e.unregisterWin(a)},
registerWin:function(a,b){var c=function(l){e._justMouseDowned=true;setTimeout(function(){e._justMouseDowned=false},0);d.isIE&&l&&l.srcElement&&l.srcElement.parentNode==null||e._onTouchNode(b||l.target||l.srcElement,"mouse")},f=d.isIE?a.document.documentElement:a.document;if(f)if(d.isIE){a.document.body.attachEvent("onmousedown",c);var g=function(l){l.srcElement.tagName.toLowerCase()!="#document"&&e.isTabNavigable(l.srcElement)?e._onFocusNode(b||l.srcElement):e._onTouchNode(b||l.srcElement)};f.attachEvent("onactivate",
g);var h=function(l){e._onBlurNode(b||l.srcElement)};f.attachEvent("ondeactivate",h);return function(){a.document.detachEvent("onmousedown",c);f.detachEvent("onactivate",g);f.detachEvent("ondeactivate",h);f=null}}else{f.body.addEventListener("mousedown",c,true);var i=function(l){e._onFocusNode(b||l.target)};f.addEventListener("focus",i,true);var j=function(l){e._onBlurNode(b||l.target)};f.addEventListener("blur",j,true);return function(){f.body.removeEventListener("mousedown",c,true);f.removeEventListener("focus",
i,true);f.removeEventListener("blur",j,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){e._prevFocus=e._curFocus;e._curFocus=null;if(!e._justMouseDowned){e._clearActiveWidgetsTimer&&clearTimeout(e._clearActiveWidgetsTimer);e._clearActiveWidgetsTimer=setTimeout(function(){delete e._clearActiveWidgetsTimer;e._setStack([]);e._prevFocus=null},100)}},_onTouchNode:function(a,b){if(e._clearActiveWidgetsTimer){clearTimeout(e._clearActiveWidgetsTimer);delete e._clearActiveWidgetsTimer}var c=
[];try{for(;a;){var f=d.attr(a,"dijitPopupParent");if(f)a=e.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===d.body())break;a=d.window.get(a.ownerDocument).frameElement}else{var g=a.getAttribute&&a.getAttribute("widgetId"),h=g&&e.byId(g);h&&!(b=="mouse"&&h.get("disabled"))&&c.unshift(g);a=a.parentNode}}}catch(i){}e._setStack(c,b)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){e._onTouchNode(a);if(a!=e._curFocus){if(e._curFocus)e._prevFocus=e._curFocus;e._curFocus=a;d.publish("focusNode",
[a])}}},_setStack:function(a,b){var c=e._activeStack;e._activeStack=a;for(var f=0;f<Math.min(c.length,a.length);f++)if(c[f]!=a[f])break;for(var g,h=c.length-1;h>=f;h--)if(g=e.byId(c[h])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(b);d.publish("widgetBlur",[g,b])}for(h=f;h<a.length;h++)if(g=e.byId(a[h])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(b);d.publish("widgetFocus",[g,b])}}});d.addOnLoad(function(){var a=e.registerWin(window);d.isIE&&
d.addOnWindowUnload(function(){e.unregisterWin(a);a=null})});return e});
define("dojo/AdapterRegistry",["dojo"],function(d){d.AdapterRegistry=function(e){this.pairs=[];this.returnWrappers=e||false};d.extend(d.AdapterRegistry,{register:function(e,a,b,c,f){this.pairs[f?"unshift":"push"]([e,a,b,c])},match:function(){for(var e=0;e<this.pairs.length;e++){var a=this.pairs[e];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(e){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
e){this.pairs.splice(a,1);return true}return false}});return d.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(d,e){e.getViewport=function(){return d.window.getBox()};e.placeOnScreen=function(a,b,c,f){c=d.map(c,function(g){var h={corner:g,pos:{x:b.x,y:b.y}};if(f){h.pos.x+=g.charAt(1)=="L"?f.x:-f.x;h.pos.y+=g.charAt(0)=="T"?f.y:-f.y}return h});return e._place(a,c)};e._place=function(a,b,c,f){var g=d.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")d.body().appendChild(a);var h=null;
d.some(b,function(j){var l=j.corner,n=j.pos,p=0,t={w:l.charAt(1)=="L"?g.l+g.w-n.x:n.x-g.l,h:l.charAt(1)=="T"?g.t+g.h-n.y:n.y-g.t};if(c){p=c(a,j.aroundCorner,l,t,f);p=typeof p=="undefined"?0:p}var v=a.style,r=v.display,u=v.visibility;v.visibility="hidden";v.display="";var q=d.marginBox(a);v.display=r;v.visibility=u;v=Math.max(g.l,l.charAt(1)=="L"?n.x:n.x-q.w);r=Math.max(g.t,l.charAt(0)=="T"?n.y:n.y-q.h);u=Math.min(g.l+g.w,l.charAt(1)=="L"?v+q.w:n.x);n=Math.min(g.t+g.h,l.charAt(0)=="T"?r+q.h:n.y);u=
u-v;n=n-r;p+=q.w-u+(q.h-n);if(h==null||p<h.overflow)h={corner:l,aroundCorner:j.aroundCorner,x:v,y:r,w:u,h:n,overflow:p,spaceAvailable:t};return!p});h.overflow&&c&&c(a,h.aroundCorner,h.corner,h.spaceAvailable,f);b=d._isBodyLtr();var i=a.style;i.top=h.y+"px";i[b?"left":"right"]=(b?h.x:g.w-h.x-h.w)+"px";return h};e.placeOnScreenAroundNode=function(a,b,c,f){b=d.byId(b);b=d.position(b,true);return e._placeOnScreenAroundRect(a,b.x,b.y,b.w,b.h,c,f)};e.placeOnScreenAroundRectangle=function(a,b,c,f){return e._placeOnScreenAroundRect(a,
b.x,b.y,b.width,b.height,c,f)};e._placeOnScreenAroundRect=function(a,b,c,f,g,h,i){var j=[];for(var l in h)j.push({aroundCorner:l,corner:h[l],pos:{x:b+(l.charAt(1)=="L"?0:f),y:c+(l.charAt(0)=="T"?0:g)}});return e._place(a,j,i,{w:f,h:g})};e.placementRegistry=new d.AdapterRegistry;e.placementRegistry.register("node",function(a,b){return typeof b=="object"&&typeof b.offsetWidth!="undefined"&&typeof b.offsetHeight!="undefined"},e.placeOnScreenAroundNode);e.placementRegistry.register("rect",function(a,
b){return typeof b=="object"&&"x"in b&&"y"in b&&"width"in b&&"height"in b},e.placeOnScreenAroundRectangle);e.placeOnScreenAroundElement=function(){return e.placementRegistry.match.apply(e.placementRegistry,arguments)};e.getPopupAroundAlignment=function(a,b){var c={};d.forEach(a,function(f){switch(f){case "after":c[b?"BR":"BL"]=b?"BL":"BR";break;case "before":c[b?"BL":"BR"]=b?"BR":"BL";break;case "below-alt":b=!b;case "below":c[b?"BL":"BR"]=b?"TL":"TR";c[b?"BR":"BL"]=b?"TR":"TL";break;case "above-alt":b=
!b;case "above":default:c[b?"TL":"TR"]=b?"BL":"BR";c[b?"TR":"TL"]=b?"BR":"BL";break}});return c};return e});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(d,e){e.getDocumentWindow=function(a){return d.window.get(a)};return e});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(d,e){e.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var b=a.declaredClass?a._popupWrapper:a.parentNode&&d.hasClass(a.parentNode,"dijitPopup"),c=a.domNode||a;if(!b){b=d.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},d.body());b.appendChild(c);c=c.style;c.display="";c.visibility="";c.position="";c.top="0px";if(a.declaredClass){a._popupWrapper=
b;d.connect(a,"destroy",function(){d.destroy(b);delete a._popupWrapper})}}return b},moveOffScreen:function(a){a=this._createWrapper(a);d.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);d.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,b=a.length-1;b>0&&a[b].parent===a[b-1].widget;b--);return a[b]},open:function(a){for(var b=this._stack,c=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():d._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),g=a.around,h=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;b.length&&(!a.parent||!d.isDescendant(a.parent.domNode,b[b.length-1].widget.domNode));)e.popup.close(b[b.length-1].widget);var i=this._createWrapper(c);d.attr(i,{id:h,style:{zIndex:this._beginZIndex+b.length},"class":"dijitPopup "+(c.baseClass||c["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(d.isIE||d.isMoz)if(!c.bgIframe)c.bgIframe=
new e.BackgroundIframe(i);f=g?e.placeOnScreenAroundElement(i,g,f,c.orient?d.hitch(c,"orient"):null):e.placeOnScreen(i,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);i.style.display="";i.style.visibility="visible";c.domNode.style.visibility="visible";g=[];g.push(d.connect(i,"onkeypress",this,function(j){if(j.charOrCode==d.keys.ESCAPE&&a.onCancel){d.stopEvent(j);a.onCancel()}else if(j.charOrCode===d.keys.TAB){d.stopEvent(j);(j=this.getTopPopup())&&j.onCancel&&j.onCancel()}}));c.onCancel&&
g.push(d.connect(c,"onCancel",a.onCancel));g.push(d.connect(c,c.onExecute?"onExecute":"onChange",this,function(){var j=this.getTopPopup();j&&j.onExecute&&j.onExecute()}));b.push({widget:c,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});c.onOpen&&c.onOpen(f);return f},close:function(a){for(var b=this._stack;a&&d.some(b,function(h){return h.widget==a})||!a&&b.length;){var c=b.pop(),f=c.widget,g=c.onClose;f.onClose&&f.onClose();d.forEach(c.handlers,d.disconnect);
f&&f.domNode&&this.hide(f);g&&g()}}};e._frames=new (function(){var a=[];this.pop=function(){var b;if(a.length){b=a.pop();b.style.display=""}else{if(d.isIE<9){b="<iframe src='"+(d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";b=d.doc.createElement(b)}else{b=d.create("iframe");b.src='javascript:""';b.className="dijitBackgroundIframe";d.style(b,"opacity",0.1)}b.tabIndex=
-1;e.setWaiRole(b,"presentation")}return b};this.push=function(b){b.style.display="none";a.push(b)}});e.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(d.isIE||d.isMoz){var b=this.iframe=e._frames.pop();a.appendChild(b);if(d.isIE<7||d.isQuirks){this.resize(a);this._conn=d.connect(a,"onresize",this,function(){this.resize(a)})}else d.style(b,{width:"100%",height:"100%"})}};d.extend(e.BackgroundIframe,{resize:function(a){this.iframe&&d.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){d.disconnect(this._conn);this._conn=null}if(this.iframe){e._frames.push(this.iframe);delete this.iframe}}});return e.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(d,e){e.scrollIntoView=function(a,b){d.window.scrollIntoView(a,b)};return e.scrollIntoView});
define("dojo/uacss",["dojo"],function(d){(function(){var e=d.doc.documentElement,a=d.isIE,b=d.isOpera,c=Math.floor,f=d.isFF,g=d.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:c(a)==6,dj_ie7:c(a)==7,dj_ie8:c(a)==8,dj_ie9:c(a)==9,dj_quirks:d.isQuirks,dj_iequirks:a&&d.isQuirks,dj_opera:b,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:c(f)==3};a["dj_"+g]=true;var h="";for(var i in a)if(a[i])h+=i+" ";e.className=d.trim(e.className+" "+h);d._loaders.unshift(function(){if(!d._isBodyLtr()){var j=
"dj_rtl dijitRtl "+h.replace(/ /g,"-rtl ");e.className=d.trim(e.className+" "+j)}})})();return d});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(d,e){return e});
define("dijit/_base/typematic",["dojo","dijit"],function(d,e){e.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(d.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,b,c,f,g,h,i,j){if(g!=this._obj){this.stop();
this._initialDelay=i||500;this._subsequentDelay=h||0.9;this._minDelay=j||10;this._obj=g;this._evt=a;this._node=c;this._count=this._currentTimeout=-1;this._callback=d.hitch(b,f);this._fireEventAndReload();this._evt=d.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,b,c,f,g,h,i){if(b.keyCode){b.charOrCode=b.keyCode;d.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(b.charCode){b.charOrCode=String.fromCharCode(b.charCode);d.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[d.connect(a,"onkeypress",this,function(j){if(j.charOrCode==b.charOrCode&&(b.ctrlKey===undefined||b.ctrlKey==j.ctrlKey)&&(b.altKey===undefined||b.altKey==j.altKey)&&(b.metaKey===undefined||b.metaKey==(j.metaKey||false))&&(b.shiftKey===undefined||b.shiftKey==j.shiftKey)){d.stopEvent(j);e.typematic.trigger(j,
c,a,f,b,g,h,i)}else e.typematic._obj==b&&e.typematic.stop()}),d.connect(a,"onkeyup",this,function(){e.typematic._obj==b&&e.typematic.stop()})]},addMouseListener:function(a,b,c,f,g,h){var i=d.connect;return[i(a,"mousedown",this,function(j){d.stopEvent(j);e.typematic.trigger(j,b,a,c,a,f,g,h)}),i(a,"mouseup",this,function(j){d.stopEvent(j);e.typematic.stop()}),i(a,"mouseout",this,function(j){d.stopEvent(j);e.typematic.stop()}),i(a,"mousemove",this,function(j){j.preventDefault()}),i(a,"dblclick",this,
function(j){d.stopEvent(j);if(d.isIE){e.typematic.trigger(j,b,a,c,a,f,g,h);setTimeout(d.hitch(this,e.typematic.stop),50)}})]},addListener:function(a,b,c,f,g,h,i,j){return this.addKeyListener(b,c,f,g,h,i,j).concat(this.addMouseListener(a,f,g,h,i,j))}};return e.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(d,e){e.wai={onload:function(){var a=d.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif"))+'");'}},d.body()),b=d.getComputedStyle(a);if(b){var c=b.backgroundImage;d[b.borderTopColor==b.borderRightColor||c!=null&&(c=="none"||c=="url(invalid-url:)")?"addClass":"removeClass"](d.body(),
"dijit_a11y");if(d.isIE)a.outerHTML="";else d.body().removeChild(a)}}};if(d.isIE||d.isMoz)d._loaders.unshift(e.wai.onload);d.mixin(e,{hasWaiRole:function(a,b){a=this.getWaiRole(a);return b?a.indexOf(b)>-1:a.length>0},getWaiRole:function(a){return d.trim((d.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,b){d.attr(a,"role",b)},removeWaiRole:function(a,b){var c=d.attr(a,"role");if(c)if(b){b=d.trim((" "+c+" ").replace(" "+b+" "," "));d.attr(a,"role",b)}else a.removeAttribute("role")},
hasWaiState:function(a,b){return a.hasAttribute?a.hasAttribute("aria-"+b):!!a.getAttribute("aria-"+b)},getWaiState:function(a,b){return a.getAttribute("aria-"+b)||""},setWaiState:function(a,b,c){a.setAttribute("aria-"+b,c)},removeWaiState:function(a,b){a.removeAttribute("aria-"+b)}});return e});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(d,e){return e._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(d,e){d.connect(d,"_connect",function(a,b){a&&d.isFunction(a._onConnect)&&a._onConnect(b)});e._connectOnUseEventHandler=function(){};e._lastKeyDownNode=null;d.isIE?function(){var a=function(b){e._lastKeyDownNode=b.srcElement};d.doc.attachEvent("onkeydown",a);d.addOnWindowUnload(function(){d.doc.detachEvent("onkeydown",a)})}():d.doc.addEventListener("keydown",function(a){e._lastKeyDownNode=a.target},true);(function(){d.declare("dijit._Widget",
e._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:e._connectOnUseEventHandler,onDblClick:e._connectOnUseEventHandler,onKeyDown:e._connectOnUseEventHandler,onKeyPress:e._connectOnUseEventHandler,onKeyUp:e._connectOnUseEventHandler,onMouseDown:e._connectOnUseEventHandler,onMouseMove:e._connectOnUseEventHandler,onMouseOut:e._connectOnUseEventHandler,
onMouseOver:e._connectOnUseEventHandler,onMouseLeave:e._connectOnUseEventHandler,onMouseEnter:e._connectOnUseEventHandler,onMouseUp:e._connectOnUseEventHandler,create:function(){this._deferredConnects=d.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==e._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&d.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,b){d.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,b)},attr:function(a){if(d.config.isDebug){var b=
arguments.callee._ach||(arguments.callee._ach={}),c=(arguments.callee.caller||"unknown caller").toString();if(!b[c]){d.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+c,"","2.0");b[c]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,b,c){var f=d._connect,g=this.inherited(arguments,[a,b=="ondijitclick"?"onclick":b,c]);if(b=="ondijitclick")if(d.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var h=d.hitch(this,c);g.push(f(a,"onkeydown",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){e._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),f(a,"onkeyup",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&i.target==e._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){e._lastKeyDownNode=null;return h(i)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return e._Widget});
define("dojo/string",["dojo"],function(d){d.getObject("string",true,d);d.string.rep=function(e,a){if(a<=0||!e)return"";for(var b=[];;){a&1&&b.push(e);if(!(a>>=1))break;e+=e}return b.join("")};d.string.pad=function(e,a,b,c){b||(b="0");e=String(e);a=d.string.rep(b,Math.ceil((a-e.length)/b.length));return c?e+a:a+e};d.string.substitute=function(e,a,b,c){c=c||d.global;b=b?d.hitch(c,b):function(f){return f};return e.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,g,h){f=d.getObject(g,false,
a);if(h)f=d.getObject(h,false,c).call(c,f,g);return b(f,g).toString()})};d.string.trim=String.prototype.trim?d.trim:function(e){e=e.replace(/^\s+/,"");for(var a=e.length-1;a>=0;a--)if(/\S/.test(e.charAt(a))){e=e.substring(0,a+1);break}return e};return d.string});
define("dojo/date/stamp",["dojo"],function(d){d.getObject("date.stamp",true,d);d.date.stamp.fromISOString=function(e,a){if(!d.date.stamp._isoRegExp)d.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var b=d.date.stamp._isoRegExp.exec(e);e=null;if(b){b.shift();b[1]&&b[1]--;if(b[6])b[6]*=1E3;if(a){a=new Date(a);d.forEach(d.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(g){return a["get"+
g]()}),function(g,h){b[h]=b[h]||g})}e=new Date(b[0]||1970,b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0);if(b[0]<100)e.setFullYear(b[0]||1970);var c=0,f=b[7]&&b[7].charAt(0);if(f!="Z"){c=(b[8]||0)*60+(Number(b[9])||0);if(f!="-")c*=-1}if(f)c-=e.getTimezoneOffset();c&&e.setTime(e.getTime()+c*6E4)}return e};d.date.stamp.toISOString=function(e,a){var b=function(h){return h<10?"0"+h:h};a=a||{};var c=[],f=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=e[f+"FullYear"]();g=["0000".substr((g+"").length)+
g,b(e[f+"Month"]()+1),b(e[f+"Date"]())].join("-")}c.push(g);if(a.selector!="date"){g=[b(e[f+"Hours"]()),b(e[f+"Minutes"]()),b(e[f+"Seconds"]())].join(":");f=e[f+"Milliseconds"]();if(a.milliseconds)g+="."+(f<100?"0":"")+b(f);if(a.zulu)g+="Z";else if(a.selector!="time"){e=e.getTimezoneOffset();a=Math.abs(e);g+=(e>0?"-":"+")+b(Math.floor(a/60))+":"+b(a%60)}c.push(g)}return c.join("T")};return d.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(d){d.parser=new (function(){function e(i){if(f.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(f.isFunction(i))return"function";if(f.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof f._Url)return"url";return"object"}function a(i,j){switch(j){case "string":return i;case "number":return i.length?Number(i):NaN;case "boolean":return typeof i=="boolean"?i:i.toLowerCase()!=
"false";case "function":if(f.isFunction(i)){i=i.toString();i=f.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):f.getObject(i,false)||new Function(i)}catch(l){return new Function}case "array":return i?i.split(/\s*,\s*/):[];case "date":switch(i){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(i)}case "url":return f.baseUrl+i;default:return f.fromJson(i)}}function b(i,j){for(var l in i)if(l.charAt(0)!=
"_")l in g||(j[l]=e(i[l]));return j}function c(i,j){var l=h[i];if(l){if(!j&&!l.params)l.params=b(l.cls.prototype,{})}else{i=f.getObject(i);l=null;if(!i)return null;j||(l=b(i.prototype,{}));l={cls:i,params:l}}return l}var f=d,g={},h={};f.connect(f,"extend",function(){h={}});this._functionFromScript=function(i,j){var l="",n="";(j=i.getAttribute(j+"args")||i.getAttribute("args"))&&f.forEach(j.split(/\s*,\s*/),function(p,t){l+="var "+p+" = arguments["+t+"]; "});(j=i.getAttribute("with"))&&j.length&&f.forEach(j.split(/\s*,\s*/),
function(p){l+="with("+p+"){";n+="}"});return new Function(l+i.innerHTML+n)};this.instantiate=function(i,j,l){var n=[];j=j||{};l=l||{};var p=(l.scope||f._scopeName)+"Type",t="data-"+(l.scope||f._scopeName)+"-";f.forEach(i,function(v){if(v){var r,u,q,x,z,C;if(v.node){r=v.node;u=v.type;C=v.fastpath;x=(q=v.clsInfo||u&&c(u,C))&&q.cls;z=v.scripts}else{r=v;z=(x=(q=(u=p in j?j[p]:r.getAttribute(p))&&c(u))&&q.cls)&&(x._noScript||x.prototype._noScript)?[]:f.query("> script[type^='dojo/']",r)}if(!q)throw new Error("Could not load class '"+
u);var k={};l.defaults&&f._mixin(k,l.defaults);v.inherited&&f._mixin(k,v.inherited);if(C){if((q=r.getAttribute(t+"props"))&&q.length)try{q=f.fromJson.call(l.propsThis,"{"+q+"}");f._mixin(k,q)}catch(m){throw new Error(m.toString()+" in data-dojo-props='"+q+"'");}if(q=r.getAttribute(t+"attach-point"))k.dojoAttachPoint=q;if(q=r.getAttribute(t+"attach-event"))k.dojoAttachEvent=q;d.mixin(k,j)}else{v=r.attributes;for(var o in q.params){u=o in j?{value:j[o],specified:true}:v.getNamedItem(o);if(!(!u||!u.specified&&
(!d.isIE||o.toLowerCase()!="value"))){u=u.value;switch(o){case "class":u="className"in j?j.className:r.className;break;case "style":u="style"in j?j.style:r.style&&r.style.cssText}var s=q.params[o];k[o]=typeof u=="string"?a(u,s):u}}}var w=[],y=[];f.forEach(z,function(A){r.removeChild(A);var E=A.getAttribute(t+"event")||A.getAttribute("event"),G=A.getAttribute("type");A=f.parser._functionFromScript(A,t);if(E)if(G=="dojo/connect")w.push({event:E,func:A});else k[E]=A;else y.push(A)});var B=(z=x.markupFactory||
x.prototype&&x.prototype.markupFactory)?z(k,r,x):new x(k,r);n.push(B);(x=r.getAttribute(t+"id")||r.getAttribute("jsId"))&&f.setObject(x,B);f.forEach(w,function(A){f.connect(B,A.event,null,A.func)});f.forEach(y,function(A){A.call(B)})}});j._started||f.forEach(n,function(v){if(!l.noStart&&v&&d.isFunction(v.startup)&&!v._started&&(!v.getParent||!v.getParent()))v.startup()});return n};this.parse=function(i,j){function l(r,u){var q=d.clone(r.inherited);d.forEach(["dir","lang"],function(o){var s=r.node.getAttribute(o);
if(s)q[o]=s});for(var x=r.clsInfo&&!r.clsInfo.cls.prototype._noScript?r.scripts:null,z=!r.clsInfo||!r.clsInfo.cls.prototype.stopParser||j&&j.template,C=r.node.firstChild;C;C=C.nextSibling)if(C.nodeType==1){var k,m=z&&C.getAttribute(p+"type");k=m?m:z&&C.getAttribute(n);m=m==k;if(k){k={type:k,fastpath:m,clsInfo:c(k,m),node:C,scripts:[],inherited:q};u.push(k);l(k,u)}else if(x&&C.nodeName.toLowerCase()=="script")(k=C.getAttribute("type"))&&/^dojo\/\w/i.test(k)&&x.push(C);else z&&l({node:C,inherited:q},
u)}}if(!j&&i&&i.rootNode){j=i;i=j.rootNode}else i=i;i=i?d.byId(i):d.body();j=j||{};var n=(j.scope||f._scopeName)+"Type",p="data-"+(j.scope||f._scopeName)+"-",t={};if(j&&j.inherited)for(var v in j.inherited)if(j.inherited[v])t[v]=j.inherited[v];v=[];l({node:i,inherited:t},v);return this.instantiate(v,j&&j.template?{template:true}:null,j)}});(function(){var e=function(){d.config.parseOnLoad&&d.parser.parse()};d.getObject("dijit.wai.onload")===d._loaders[0]?d._loaders.splice(1,0,e):d._loaders.unshift(e)})();
return d.parser});
define("dojo/cache",["dojo"],function(d){var e={};d.cache=function(a,b,c){if(typeof a=="string")var f=d.moduleUrl(a,b);else{f=a;c=b}f=f.toString();var g=c;if(c!=undefined&&!d.isString(c))g="value"in c?c.value:undefined;c=c&&c.sanitize?true:false;if(typeof g=="string")g=e[f]=c?d.cache._sanitize(g):g;else if(g===null)delete e[f];else{if(!(f in e)){g=undefined;if(d.isFunction(require)&&d.isString(a))try{var h=(a?a.replace(/\./g,"/")+"/":"")+b;g=require("text!"+h)}catch(i){}if(typeof g==="undefined")g=
d._getText(f);e[f]=c?d.cache._sanitize(g):g}g=e[f]}return g};d.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[1]}else a="";return a};return d.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(d,e){d.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var b=this.declaredClass,c=this;return d.string.substitute(a,this,function(f,g){if(g.charAt(0)=="!")f=d.getObject(g.substr(1),false,c);if(typeof f==
"undefined")throw new Error(b+" template:"+g);if(f==null)return"";return g.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=e._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),b;if(d.isString(a)){b=d._toDom(this._stringRepl(a));if(b.nodeType!=1)throw new Error("Invalid template: "+a);}else b=a.cloneNode(true);this.domNode=b;this.inherited(arguments);this._attachTemplateNodes(b);if(this.widgetsInTemplate){a=this._startupWidgets=
d.parser.parse(b,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=e.findWidgets(b);this._attachTemplateNodes(a,function(c,f){return c[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var b=this.containerNode;if(a&&b)for(;a.hasChildNodes();)b.appendChild(a.firstChild)},_attachTemplateNodes:function(a,b){b=b||function(n,p){return n.getAttribute(p)};for(var c=d.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=d.isArray(a)?0:-1;f<c.length;f++){var g=f==-1?a:c[f];if(!(this.widgetsInTemplate&&(b(g,"dojoType")||b(g,"data-dojo-type")))){var h=b(g,"dojoAttachPoint")||b(g,"data-dojo-attach-point");if(h)for(var i=h.split(/\s*,\s*/);h=i.shift();){if(d.isArray(this[h]))this[h].push(g);else this[h]=g;this._attachPoints.push(h)}if(h=b(g,"dojoAttachEvent")||b(g,"data-dojo-attach-event")){i=h.split(/\s*,\s*/);for(var j=d.trim;h=i.shift();)if(h){var l=null;if(h.indexOf(":")!=-1){l=h.split(":");h=j(l[0]);l=j(l[1])}else h=
j(h);l||(l=h);this._attachEvents.push(this.connect(g,h,l))}}(h=b(g,"waiRole"))&&e.setWaiRole(g,h);(h=b(g,"waiState"))&&d.forEach(h.split(/\s*,\s*/),function(n){if(n.indexOf("-")!=-1){n=n.split("-");e.setWaiState(g,n[0],n[1])}})}}},startup:function(){d.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){d.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];d.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});e._Templated._templateCache={};e._Templated.getCachedTemplate=function(a,b,c){var f=e._Templated._templateCache,g=b||a,h=f[g];if(h){try{if(!h.ownerDocument||h.ownerDocument==d.doc)return h}catch(i){}d.destroy(h)}b||(b=d.cache(a,{sanitize:true}));b=d.string.trim(b);if(c||b.match(/\$\{([^\}]+)\}/g))return f[g]=b;else{a=d._toDom(b);if(a.nodeType!=1)throw new Error("Invalid template: "+b);return f[g]=a}};d.isIE&&d.addOnWindowUnload(function(){var a=
e._Templated._templateCache;for(var b in a){var c=a[b];typeof c=="object"&&d.destroy(c);delete a[b]}});d.extend(e._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return e._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(d,e){d.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);d.forEach(["onmouseenter","onmouseleave","onmousedown"],function(b){this.connect(this.domNode,b,"_cssMouseEvent")},this);d.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(b){this.watch(b,d.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var b=this.connect(d.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(b)});break}},_setStateClass:function(){function a(i){b=
b.concat(d.map(b,function(j){return j+i}),"dijit"+i)}var b=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var c=this.stateNode||this.domNode,f={};d.forEach(c.className.split(" "),function(i){f[i]=true});"_stateClasses"in this&&d.forEach(this._stateClasses,
function(i){delete f[i]});d.forEach(b,function(i){f[i]=true});var g=[];for(var h in f)g.push(h);c.className=g.join(" ");this._stateClasses=b},_trackMouseState:function(a,b){function c(){var l="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;d.toggleClass(a,b+"Hover",f&&!g&&!l);d.toggleClass(a,b+"Active",g&&!l);d.toggleClass(a,b+"Focused",h&&!l)}var f=false,g=false,h=false,i=this,j=d.hitch(this,"connect",a);j("onmouseenter",function(){f=true;c()});j("onmouseleave",function(){g=f=false;c()});
j("onmousedown",function(){g=true;c()});j("onmouseup",function(){g=false;c()});j("onfocus",function(){h=true;c()});j("onblur",function(){h=false;c()});this.watch("disabled",c);this.watch("readOnly",c)}});return e._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(d,e){d.declare("dijit.form._FormWidget",[e._Widget,e._Templated,e._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:d.delegate(e._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);d.attr(this.focusNode,"disabled",a);this.valueNode&&d.attr(this.valueNode,"disabled",a);e.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
d.forEach(d.isArray(a)?a:[a],function(b){b=this[b];d.isWebKit||e.hasDefaultTabStop(b)?b.setAttribute("tabIndex","-1"):b.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){d.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&d.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&d.style(this.domNode,"display")!="none"},focus:function(){this.disabled||e.focus(this.focusNode)},compare:function(a,b){return typeof a=="number"&&typeof b=="number"?isNaN(a)&&isNaN(b)?0:a-b:a>b?1:a<b?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,b){if(this._lastValueReported==undefined&&(b===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||b||b===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(d.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){d.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){d.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&d.mouseButtons.isLeft(a)&&this.isFocusable())var b=this.connect(d.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(b)})}});d.declare("dijit.form._FormValueWidget",
e.form._FormWidget,{readOnly:false,attributeMap:d.delegate(e.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){d.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(d.isIE<9||d.isIE&&d.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,b){this._handleOnChange(a,b)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==d.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var b;if(d.isIE){a.preventDefault();b=document.createEventObject();b.keyCode=d.keys.ESCAPE;b.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
b)}}},_layoutHackIE7:function(){if(d.isIE==7)for(var a=this.domNode,b=a.parentNode,c=a.firstChild||a,f=c.style.filter,g=this;b&&b.clientHeight==0;){(function(){var h=g.connect(b,"onscroll",function(){g.disconnect(h);c.style.filter=(new Date).getMilliseconds();setTimeout(function(){c.style.filter=f},0)})})();b=b.parentNode}}});return e.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(d,e){d.declare("dijit.form.TextBox",e.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:d.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:d.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:d.delegate(e.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==e.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=d.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
b,c){var f;if(a!==undefined){f=this.filter(a);if(typeof c!="string")c=f!==null&&(typeof f!="number"||!isNaN(f))?this.filter(this.format(f,this.constraints)):""}if(c!=null&&c!=undefined&&(typeof c!="number"||!isNaN(c))&&this.textbox.value!=c){this.textbox.value=c;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[f,b])},displayedValue:"",getDisplayedValue:function(){d.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){d.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case d.keys.SHIFT:case d.keys.ALT:case d.keys.CTRL:case d.keys.TAB:return}if(this.intermediateChanges){var b=this;setTimeout(function(){b._handleOnChange(b.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){d.isIE&&setTimeout(d.hitch(this,function(){var a=d.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var b=this.domNode.getElementsByTagName("INPUT");if(b)for(var c=0;c<b.length;c++)b[c].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(d.isMoz||d.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=d.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(b){return b.substring(0,1).toUpperCase()+b.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&d.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var b;if(d.isIE){b=d.doc.selection.createRange();b=b.parentElement()==this.textbox&&
b.text.length==0}else b=this.textbox.selectionStart==this.textbox.selectionEnd;b&&e.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});e.selectInputText=function(a,b,c){var f=d.global,g=d.doc;a=d.byId(a);if(isNaN(b))b=0;if(isNaN(c))c=a.value?a.value.length:0;e.focus(a);if(g.selection&&d.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",b);a.moveEnd("character",c-b);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(b,c)};return e.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(d,e){d.declare("dijit._MasterTooltip",[e._Widget,e._Templated],{duration:e.defaultDuration,templateString:d.cache("dijit","templates/Tooltip.html"),postCreate:function(){d.body().appendChild(this.domNode);this.bgIframe=new e.BackgroundIframe(this.domNode);this.fadeIn=d.fadeIn({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onShow")});this.fadeOut=d.fadeOut({node:this.domNode,
duration:this.duration,onEnd:d.hitch(this,"_onHide")})},show:function(a,b,c,f){if(!(this.aroundNode&&this.aroundNode===b)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;e.placeOnScreenAroundElement(this.domNode,b,e.getPopupAroundAlignment(c&&c.length?c:e.Tooltip.defaultPosition,!f),d.hitch(this,"orient"));d.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=b}}},orient:function(a,b,c,
f,g){this.connectorNode.style.top="";var h=f.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[b+"-"+c];this.domNode.style.width="auto";var i=d.contentBox(this.domNode),j=Math.min(Math.max(h,1),i.w),l=j<i.w;this.domNode.style.width=j+"px";if(l){this.containerNode.style.overflow=
"auto";l=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(l>j){l=l+d.style(this.domNode,"paddingLeft")+d.style(this.domNode,"paddingRight");this.domNode.style.width=l+"px"}}if(c.charAt(0)=="B"&&b.charAt(0)=="B"){a=d.marginBox(a);b=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-g.h/2-b/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-b/2,0),a.h-b)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,i.w-h)},_onShow:function(){if(d.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});e.showTooltip=function(a,b,c,f){if(!e._masterTT)e._masterTT=
new e._MasterTooltip;return e._masterTT.show(a,b,c,f)};e.hideTooltip=function(a){if(!e._masterTT)e._masterTT=new e._MasterTooltip;return e._masterTT.hide(a)};d.declare("dijit.Tooltip",e._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){d.forEach(this._connections||[],function(c){d.forEach(c,d.hitch(this,"disconnect"))},this);var b=d.isArrayLike(a)?a:a?[a]:[];this._connections=d.map(b,function(c){return(c=d.byId(c))?[this.connect(c,"onmouseenter","_onTargetMouseEnter"),
this.connect(c,"onmouseleave","_onTargetMouseLeave"),this.connect(c,"onfocus","_onTargetFocus"),this.connect(c,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=b},addTarget:function(a){a=a.id||a;d.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=d.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
d.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;d.forEach(d.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var b=a.target;this._showTimer=setTimeout(d.hitch(this,function(){this.open(b)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}e.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){e.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});e.Tooltip.defaultPosition=["after","before"];return e.Tooltip});
(function(){function d(b,c,f,g,h,i){if(c[b]){f.push(b);if(c[b]===true||c[b]===1)g.push(h+b+"/"+i)}}function e(b,c,f,g,h){c=g+c+"/"+h;require._fileExists(b.nameToUrl(c,null))&&f.push(c)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(b,c,f,g){g=g||{};var h=a.exec(b),i=h[1],j=h[4],l=h[5],n=j.split("-"),p=[],t={},v,r,u="";if(h[5]){i=h[1];b=i+l}else{b=b;l=h[4];j=g.locale||(g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());n=j.split("-")}if(g.isBuild){p.push(b);e(c,"root",p,i,l);for(v=0;r=n[v];v++){u+=(u?"-":"")+r;e(c,u,p,i,l)}c(p);f()}else c([b],function(q){var x=[];d("root",q,x,p,i,l);for(v=0;r=n[v];v++){u+=(u?"-":"")+r;d(u,q,x,p,i,l)}c(p,function(){var z,C;for(z=x.length-1;z>-1&&(r=x[z]);z--){C=q[r];if(C===true||C===1)C=c(i+r+"/"+l);require.mixin(t,C)}f(t)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(d,e){d.declare("dijit.form.ValidationTextBox",e.form.TextBox,{templateString:d.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,b){return(new RegExp("^(?:"+this.regExpGen(b)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,b)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var b="",c=this.disabled||this.isValid(a);if(c)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),g=!c&&a&&this._isValidSubset();this._set("state",c?"":((!this._hasBeenBlurred||a)&&f||g)&&this._maskValidSubsetError?
"Incomplete":"Error");e.setWaiState(this.focusNode,"invalid",c?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&g;b=this.getErrorMessage(a)}else if(this.state=="Incomplete"){b=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)b=this.getPromptMessage(a);this.set("message",b);return c},displayMessage:function(a){e.hideTooltip(this.domNode);a&&this._focused&&e.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var b="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":b+=f;break;case ")":b+="|$)";break;
default:b+="(?:"+f+"|$)";break}});try{"".search(b)}catch(c){b=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+b+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=d.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);e.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});d.declare("dijit.form.MappedTextBox",e.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=d.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});d.declare("dijit.form.RangeBoundTextBox",e.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,b){return("min"in b?this.compare(a,b.min)>=0:true)&&("max"in b?this.compare(a,b.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),b=false,c=false;if("min"in this.constraints){b=this.constraints.min;b=this.compare(a,typeof b=="number"&&b>=0&&a!=0?0:b);b=typeof b=="number"&&b<0}if("max"in this.constraints){c=this.constraints.max;c=this.compare(a,typeof c!="number"||c>0?c:0);c=typeof c=="number"&&c>0}return b||c},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var b=this.get("value");if(b!==null&&b!==""&&b!==undefined&&(typeof b!="number"||!isNaN(b))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=d.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?e.setWaiState(this.focusNode,"valuemin",this.constraints.min):e.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?e.setWaiState(this.focusNode,"valuemax",this.constraints.max):e.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){e.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return e.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(d,e){function a(q){var x="",z=navigator.platform.indexOf("Mac")!==-1;if(q.mod1)x+=z?"Cmd+":"Ctrl+";if(q.mod2)x+="Shift+";if(q.mod3)x+="Alt+";if(q.mod4&&z)x+="Ctrl+";if(q.alphaKey)return x+q.alphaKey;for(var C in d.keys)if(typeof(d.keys[C]==="number"))if(d.keys[C]===q.keyCode)return x+C;var k;switch(q.keyCode){case 59:k=q.mod2?":":";";break;case 61:k=q.mod2?"+":"=";break;case 188:k=q.mod2?"<":",";break;case 190:k=
q.mod2?">":".";break;case 191:k=q.mod2?"?":"/";break;case 192:k=q.mod2?"~":"`";break;case 219:k=q.mod2?"{":"[";break;case 220:k=q.mod2?"|":"\\";break;case 221:k=q.mod2?"}":"]";break;case 222:k=q.mod2?'"':"'";break}if(k)return x+k;return x+String.fromCharCode(q.keyCode)}function b(q,x){q.startup();if(typeof x==="string"){var z=d.byId(x);if(!z)if(z=e.byId(x))z=z.domNode;x=z?z:null}if(x){x=d.position(x);q._setStyleAttr("left:"+(x.x+16)+"px !important;");q._setStyleAttr("top:"+(x.y+16)+"px !important;")}q.show()}
function c(q,x,z,C,k,m,o,s,w){o=function(B){return function(A){var E=e.byId(q),G=E.get("value");if(B&&A.keyCode===d.keys.ESCAPE){z&&d.style(x,"display","inline");E.destroyRecursive();m&&m()}else if(!(B&&A.keyCode!==d.keys.ENTER)){if(!E.isValid()||!w&&G===C)z&&d.style(x,"display","inline");else k(G);E.destroyRecursive();m&&m()}}};var y=new e.form.ValidationTextBox({id:q,required:true,value:C||""});d.place(y.domNode,x,"after");d.addClass(y.domNode,"userEditBoxPrompt");z&&d.style(x,"display","none");
d.connect(y,"onKeyDown",o(true));d.connect(y,"onBlur",o(false));window.setTimeout(function(){y.focus();if(C){var B=d.byId(q),A=s?C.indexOf(s):-1;A>0?e.selectInputText(B,0,A):B.select()}},0)}function f(q){var x=window.navigator.platform.indexOf("Mac")!==-1;return x&&q.metaKey||!x&&q.ctrlKey}function g(q,x){if(x&&f(x))window.open(q);else window.location=q}function h(q){if(!q)return q;var x=window.location.href.split("#")[0];x=x.substring(0,x.length-window.location.pathname.length);if(q.indexOf(x)===
0)return q.substring(x.length);return q}function i(q){if(!q)return q;var x=window.location.href.split("#")[0];return x.substring(0,x.length-window.location.pathname.length)+q}function j(q){return this.makeRelative(q).indexOf("/workspace")===0}function l(q,x){q.children=x;for(var z in x)x[z].parent=q;q.children.sort(function(C,k){var m=C.Directory;if(m!==k.Directory)return m?-1:1;C=C.Name&&C.Name.toLowerCase();k=k.Name&&k.Name.toLowerCase();if(C<k)return-1;if(C>k)return 1;return 0})}function n(q,x){q.Parents&&
q.Parents.length===0&&x.getService("orion.core.preference").getPreferences("/window/recent").then(function(z){var C=z.get("projects");if(typeof C==="string")C=JSON.parse(C);var k=[];if(C&&C.length&&C.length>0)for(var m=0;m<C.length;m++)C[m].location!==q.ChildrenLocation&&C[m].name!==q.Name&&k.push(C[m]);k.push({name:q.Name,location:q.ChildrenLocation});if(k.length>5)k=k.slice(-5,k.length);z.put("projects",k)})}function p(q){return typeof q.textContent!=="undefined"?q.textContent:q.innerText}function t(q){return p(document.createTextNode(q))}
function v(q,x){if(typeof q.textContent!=="undefined")q.textContent=x;else q.innerText=x}function r(q,x,z,C,k,m,o,s){k=k||x+"heading";m=m||x+"commands";d.place('<div class="toolComposite" id="'+x+'"><div class="layoutLeft" id="'+x+'"><span style: "inline-block;" id="'+k+'">'+z+'</span></div><div class="layoutRight sectionActions" id="'+m+'"></div><div id="'+q.id+'slideContainer" class="layoutBlock slideParameters slideContainer"><span id="'+q.id+'slideOut" class="slide"><span id="'+q.id+'pageCommandParameters" class="parameters"></span><span id="'+
q.id+'pageCommandDismiss" class="parametersDismiss"></span></span></div></div>',q,"last");C?d.addClass(x,"auxpaneHeading"):d.addClass(x,"paneHeading");o&&o.renderCommands(d.byId(m),"dom",s,s,"button");return d.byId(x)}function u(q){if(typeof q==="string")q=d.byId(q);for(;q;){var x=e.byId(q.id);if(x&&typeof x.layout==="function"){x.layout();return}q=q.parentNode}}return{getUserKeyString:a,openDialog:b,getUserText:c,openInNewWindow:f,followLink:g,makeRelative:h,makeFullPath:i,isAtRoot:j,processNavigatorParent:l,
rememberSuccessfulTraversal:n,getText:p,safeText:t,setText:v,createPaneHeading:r,forceLayout:u}});
define("orion/PageUtil",["require","exports","module"],function(){function d(e){e=e||window.location.toString();var a={resource:""},b=e.indexOf("#");if(b!==-1){e=e.substring(b+1);if(e.length!==0){e=e.split(",");a.resource=decodeURIComponent(e[0]);for(b=1;b<e.length;b++){var c=e[b].split("="),f=decodeURIComponent(c[0]);c=c.length===2?decodeURIComponent(c[1]):null;if(c!==null&&f!=="resource")a[f]=c}}}return a}return{matchResourceParameters:d}});define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(d,e){d.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,b){var c=this.containerNode;if(b&&typeof b=="number"){var f=this.getChildren();if(f&&f.length>=b){c=f[b-1].domNode;b="after"}}d.place(a.domNode,c,b);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){d.forEach(this.getChildren(),function(b){b.destroyRecursive(a)})},_getSiblingOfChild:function(a,b){a=a.domNode;b=b>0?"nextSibling":"previousSibling";do a=a[b];while(a&&(a.nodeType!=1||!e.byNode(a)));return a&&e.byNode(a)},getIndexOfChild:function(a){return d.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return e._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(d,e){d.declare("dijit._KeyNavContainer",e._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,b){var c=this._keyNavCodes={},f=d.hitch(this,this.focusPrev),g=d.hitch(this,this.focusNext);d.forEach(a,function(h){c[h]=f});d.forEach(b,function(h){c[h]=g});c[d.keys.HOME]=d.hitch(this,"focusFirstChild");c[d.keys.END]=d.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){d.forEach(this.getChildren(),d.hitch(this,"_startupChild"))},addChild:function(a){e._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,b){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(b?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();d.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&d.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var b=this._keyNavCodes[a.charOrCode];if(b){b();d.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
b){if(a)a=this._getSiblingOfChild(a,b);for(var c=this.getChildren(),f=0;f<c.length;f++){a||(a=c[b>0?0:c.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,b)}return null}});return e._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(d,e){d.declare("dijit._Contained",null,{getParent:function(){var a=e.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var b=this.domNode;do b=b[a+"Sibling"];while(b&&b.nodeType!=1);return b&&e.byNode(b)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return e._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(d,e){d.declare("dijit.MenuItem",[e._Widget,e._Templated,e._Contained,e._CssStateMixin],{templateString:d.cache("dijit","templates/MenuItem.html"),attributeMap:d.delegate(e._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";d.attr(this.containerNode,"id",a);if(this.accelKeyNode){d.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}e.setWaiState(this.domNode,"labelledby",a);d.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);d.stopEvent(a)},onClick:function(){},focus:function(){try{d.isIE==8&&this.containerNode.focus();e.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){d.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){d.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){d.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){e.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;d.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return e.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(d,e){d.declare("dijit.PopupMenuItem",e.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=d.query("*",this.srcNodeRef);e.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.popup=e.byNode(a)}d.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&d.style(this.arrowWrapper,"visibility","");e.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return e.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(d,e){d.declare("dijit.CheckedMenuItem",e.MenuItem,{templateString:d.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){d.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);e.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return e.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(d,e){d.declare("dijit.MenuSeparator",[e._Widget,e._Templated,e._Contained],{templateString:d.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);d.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return e.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(d,e){d.declare("dijit._MenuBase",[e._Widget,e._Templated,e._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){d.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(d.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var b=a.popup;if(b){this._stopPendingCloseTimer(b);b._pendingClose_timer=setTimeout(function(){b._pendingClose_timer=null;if(b.parentMenu)b.parentMenu.currentPopup=
null;e.popup.close(b)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,b){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(b)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var b=a.popup;if(!b.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);e.popup.close(this.currentPopup)}b.parentMenu=this;b.from_item=a;var c=this;e.popup.open({parent:this,
popup:b,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){c.focusChild(a);c._cleanUp();a._setSelected(true);c.focusedChild=a},onExecute:d.hitch(this,"_cleanUp")});this.currentPopup=b;b.connect(b.domNode,"onmouseenter",d.hitch(c,"_onPopupHover"));if(b.focus)b._focus_timer=setTimeout(d.hitch(b,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;d.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;d.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){e._curFocus&&d.isDescendant(e._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();e.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});d.declare("dijit.Menu",e._MenuBase,{constructor:function(){this._bindings=[]},templateString:d.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(d.body()):d.forEach(this.targetNodeIds,this.bindDomNode,this);var a=d.keys,b=this.isLeftToRight();this._openSubMenuKey=b?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=b?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
d.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else d.stopEvent(a);break}},_iframeContentWindow:function(a){return d.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&d.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&d.doc.frames[a.name]&&d.doc.frames[a.name].document||
null},bindDomNode:function(a){a=d.byId(a);var b;if(a.tagName.toLowerCase()=="iframe"){var c=a,f=this._iframeContentWindow(c);b=d.withGlobal(f,d.body)}else b=a==d.body()?d.doc.documentElement:a;var g={node:a,iframe:c};d.attr(a,"_dijitMenu"+this.id,this._bindings.push(g));var h=d.hitch(this,function(i){return[d.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(j){d.stopEvent(j);this._scheduleOpen(j.target,c,{x:j.pageX,y:j.pageY})}),d.connect(i,"onkeydown",this,function(j){if(j.shiftKey&&
j.keyCode==d.keys.F10){d.stopEvent(j);this._scheduleOpen(j.target,c)}})]});g.connects=b?h(b):[];if(c){g.onloadHandler=d.hitch(this,function(){var i=this._iframeContentWindow(c);b=d.withGlobal(i,d.body);g.connects=h(b)});c.addEventListener?c.addEventListener("load",g.onloadHandler,false):c.attachEvent("onload",g.onloadHandler)}},unBindDomNode:function(a){var b;try{b=d.byId(a)}catch(c){return}a="_dijitMenu"+this.id;if(b&&d.hasAttr(b,a)){var f=d.attr(b,a)-1,g=this._bindings[f];d.forEach(g.connects,d.disconnect);
var h=g.iframe;if(h)h.removeEventListener?h.removeEventListener("load",g.onloadHandler,false):h.detachEvent("onload",g.onloadHandler);d.removeAttr(b,a);delete this._bindings[f]}},_scheduleOpen:function(a,b,c){if(!this._openTimer)this._openTimer=setTimeout(d.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:b,coords:c})}),1)},_openMyself:function(a){function b(){l.refocus&&e.focus(n);e.popup.close(l)}var c=a.target,f=a.iframe;if(a=a.coords){if(f){c=d.position(f,true);var g=
this._iframeContentWindow(f);g=d.withGlobal(g,"_docScroll",d);var h=d.getComputedStyle(f),i=d._toPixelValue,j=(d.isIE&&d.isQuirks?0:i(f,h.paddingLeft))+(d.isIE&&d.isQuirks?i(f,h.borderLeftWidth):0);f=(d.isIE&&d.isQuirks?0:i(f,h.paddingTop))+(d.isIE&&d.isQuirks?i(f,h.borderTopWidth):0);a.x+=c.x+j-g.x;a.y+=c.y+f-g.y}}else{a=d.position(c,true);a.x+=10;a.y+=10}var l=this,n=e.getFocus(this);e.popup.open({popup:this,x:a.x,y:a.y,onExecute:b,onCancel:b,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);e.popup.close(this)}},uninitialize:function(){d.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return e.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(d,e){d.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){d.stopEvent(a);this._docHandler=this.connect(d.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var b=this.dropDown,c=false;if(a&&this._opened){var f=d.position(this._buttonNode,true);if(!(a.pageX>=f.x&&a.pageX<=f.x+f.w)||!(a.pageY>=f.y&&a.pageY<=f.y+f.h)){for(f=a.target;f&&!c;)if(d.hasClass(f,"dijitPopup"))c=true;else f=f.parentNode;if(c){f=a.target;if(b.onItemClick){for(var g;f&&!(g=e.byNode(f));)f=f.parentNode;g&&g.onClick&&g.getParent&&g.getParent().onItemClick(g,a)}return}}}this._opened&&b.focus&&b.autoFocus!==false&&window.setTimeout(d.hitch(b,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&d.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";d.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var b=this.dropDown,c=a.target;if(b&&this._opened&&b.handleKey)if(b.handleKey(a)===false){d.stopEvent(a);return}if(b&&this._opened&&a.charOrCode==d.keys.ESCAPE){this.closeDropDown();d.stopEvent(a)}else if(!this._opened&&(a.charOrCode==d.keys.DOWN_ARROW||(a.charOrCode==d.keys.ENTER||a.charOrCode==" ")&&((c.tagName||"").toLowerCase()!=="input"||c.type&&c.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;d.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(d.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(e._curFocus&&this.dropDown&&d.isDescendant(e._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(d.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,b=a.domNode,c=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(b.style.width)this._explicitDDWidth=true;if(b.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var g={display:"",visibility:"hidden"};if(!this._explicitDDWidth)g.width="";if(!this._explicitDDHeight)g.height="";d.style(b,g);g=this.maxHeight;if(g==-1){g=d.window.getBox();var h=d.position(c,false);g=Math.floor(Math.max(h.y,g.h-(h.y+h.h)))}a.startup&&
!a._started&&a.startup();e.popup.moveOffScreen(a);h=d._getMarginSize(b);var i=g&&h.h>g;d.style(b,{overflowX:"hidden",overflowY:i?"auto":"hidden"});if(i){h.h=g;if("w"in h)h.w+=16}else delete h.h;if(this.forceWidth)h.w=c.offsetWidth;else if(this.autoWidth)h.w=Math.max(h.w,c.offsetWidth);else delete h.w;d.isFunction(a.resize)?a.resize(h):d.marginBox(b,h)}a=e.popup.open({parent:this,popup:a,around:c,orient:e.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){d.attr(f._popupStateNode,"popupActive",false);d.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});d.attr(this._popupStateNode,"popupActive","true");d.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();e.popup.close(this.dropDown);this._opened=false}}});
return e._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(d,e){d.declare("dijit.form.Button",e.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:d.cache("dijit.form","templates/Button.html"),attributeMap:d.delegate(e.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var b=this.domNode;b.parentNode;b=b.parentNode){var c=e.byNode(b);if(c&&typeof c._onSubmit=="function"){c._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);d.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&d.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){d.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=d.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){d.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});d.declare("dijit.form.DropDownButton",[e.form.Button,e._Container,e._HasDropDown],{baseClass:"dijitDropDownButton",templateString:d.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
d.query("*",this.srcNodeRef);e.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=e.byNode(a);delete this.dropDownContainer}this.dropDown&&e.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var b=d.connect(a,"onLoad",this,function(){d.disconnect(b);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});d.declare("dijit.form.ComboButton",e.form.DropDownButton,{templateString:d.cache("dijit.form","templates/ComboButton.html"),attributeMap:d.mixin(d.clone(e.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){e.focus(this._popupStateNode);d.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){e.focus(this.titleNode);d.stopEvent(a)}},focus:function(a){this.disabled||e.focus(a=="start"?this.titleNode:this._popupStateNode)}});
d.declare("dijit.form.ToggleButton",e.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:d.mixin(d.clone(e.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,b){this._set("checked",a);d.attr(this.focusNode||this.domNode,"checked",a);e.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,b)},setChecked:function(a){d.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return e.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(d,e){return e.form.DropDownButton});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(d,e){d.declare("dijit.layout._LayoutWidget",[e._Widget,e._Container,e._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(d.isIE?
this.domNode:d.global,"onresize",function(){this.resize()})}}},resize:function(a,b){var c=this.domNode;if(a){d.marginBox(c,a);if(a.t)c.style.top=a.t+"px";if(a.l)c.style.left=a.l+"px"}b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(c),b);a=d.getComputedStyle(c);var f=d._getMarginExtents(c,a),g=d._getBorderExtents(c,a);b=this._borderBox={w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)};f=d._getPadExtents(c,a);this._contentBox={l:d._toPixelValue(c,a.paddingLeft),t:d._toPixelValue(c,a.paddingTop),
w:b.w-f.w,h:b.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){d.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){d.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});e.layout.marginBox2contentBox=function(a,b){var c=d.getComputedStyle(a),f=d._getMarginExtents(a,
c),g=d._getPadBorderExtents(a,c);return{l:d._toPixelValue(a,c.paddingLeft),t:d._toPixelValue(a,c.paddingTop),w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)}};(function(){var a=function(c){return c.substring(0,1).toUpperCase()+c.substring(1)},b=function(c,f){var g=c.resize?c.resize(f):d.marginBox(c.domNode,f);if(g)d.mixin(c,g);else{d.mixin(c,d.marginBox(c.domNode));d.mixin(c,f)}};e.layout.layoutChildren=function(c,f,g,h,i){f=d.mixin({},f);d.addClass(c,"dijitLayoutContainer");g=d.filter(g,function(j){return j.region!=
"center"&&j.layoutAlign!="client"}).concat(d.filter(g,function(j){return j.region=="center"||j.layoutAlign=="client"}));d.forEach(g,function(j){var l=j.domNode,n=j.region||j.layoutAlign,p=l.style;p.left=f.l+"px";p.top=f.t+"px";p.position="absolute";d.addClass(l,"dijitAlign"+a(n));l={};if(h&&h==j.id)l[j.region=="top"||j.region=="bottom"?"h":"w"]=i;if(n=="top"||n=="bottom"){l.w=f.w;b(j,l);f.h-=j.h;if(n=="top")f.t+=j.h;else p.top=f.t+f.h+"px"}else if(n=="left"||n=="right"){l.h=f.h;b(j,l);f.w-=j.w;if(n==
"left")f.l+=j.w;else p.left=f.l+f.w+"px"}else if(n=="client"||n=="center")b(j,f)})}})();return e.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(d,e){d.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){d.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=e._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(d.isIE?this.domNode:d.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=d.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),b=a.filter(function(f){return d.hasAttr(f,"data-dojo-type")||d.hasAttr(f,"dojoType")||d.hasAttr(f,"widgetId")}),c=d.filter(b.map(e.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==b.length&&c.length==1)this._singleChild=c[0];else delete this._singleChild;d.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,b){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,b)},_scheduleLayout:function(a,b){if(this._isShown())this._layout(a,b);else{this._needLayout=true;this._changeSize=a;this._resultSize=b}},_layout:function(a,b){a&&d.marginBox(this.domNode,
a);var c=this.containerNode;if(c===this.domNode){b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(c),b);this._contentBox=e.layout.marginBox2contentBox(c,b)}else this._contentBox=d.contentBox(c);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||d.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else d.forEach(this.getChildren(),
function(b){b.resize&&b.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,b=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!d.hasClass(a,"dijitHidden")&&b&&b.style&&b.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return e.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(d){d.getObject("html",true,d);(function(){var e=0;d.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};d.html._emptyNode=d.empty;d.html._setNodeContent=function(a,b){d.empty(a);if(b){if(typeof b=="string")b=d._toDom(b,a.ownerDocument);if(!b.nodeType&&d.isArrayLike(b))for(var c=b.length,f=0;f<b.length;f=c==b.length?f+1:0)d.place(b[f],a,"last");else d.place(b,a,"last")}return a};d.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:d._scopeName,startup:true,constructor:function(a,b){d.mixin(this,a||{});b=this.node=d.byId(this.node||b);if(!this.id)this.id=["Setter",b?b.id||b.tagName:"",e++].join("_")},set:function(a,b){if(undefined!==a)this.content=a;b&&this._mixin(b);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=d.html._setNodeContent(a,this.content)}catch(b){var c=this.onContentError(b);try{a.innerHTML=c}catch(f){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+f.message,f)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){d.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}d.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(d.isString(a)){if(this.cleanContent)a=d.html._secureForInnerHtml(a);
if(this.extractContent){var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var b={},c;for(c in a)c in b||(this[c]=a[c])},_parse:function(){var a=this.node;try{var b={};d.forEach(["dir","lang","textDir"],
function(f){if(this[f])b[f]=this[f]},this);this.parseResults=d.parser.parse({rootNode:a,noStart:!this.startup,inherited:b,scope:this.parserScope})}catch(c){this._onError("Content",c,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,b,c){a=this["on"+a+"Error"].call(this,b);if(c)console.error(c,b);else a&&d.html._setNodeContent(this.node,a,true)}});d.html.set=function(a,b,c){if(undefined==b){console.warn("dojo.html.set: no cont argument provided, using empty string");b=""}return c?(new d.html._ContentSetter(d.mixin(c,
{content:b,node:a}))).set():d.html._setNodeContent(a,b,true)}})();return d.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(d,e){d.declare("dijit.layout.ContentPane",[e._Widget,e.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:d._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:d.delegate(e._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,b){if((!a||!a.template)&&b&&!("href"in a)&&!("content"in a)){var c=d.doc.createDocumentFragment();for(b=d.byId(b);b.firstChild;)c.appendChild(b.firstChild);a=d.delegate(a,{content:c})}this.inherited(arguments,[a,b])},postMixInProperties:function(){this.inherited(arguments);var a=d.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=d.string.substitute(this.loadingMessage,a);this.errorMessage=d.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";d.attr(this.domNode,"role")||e.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&d.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&d.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){d.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){d.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,b={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};d.isObject(this.ioArgs)&&d.mixin(b,this.ioArgs);var c=this._xhrDfd=(this.ioMethod||d.xhrGet)(b);c.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return f});c.addErrback(function(f){c.canceled||a._onError("Download",f);delete a._xhrDfd;return f});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(b){console.error("Error "+this.widgetId+" running custom onLoad code: "+b.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive()});if(a){d.forEach(a.parseResults,
function(b){b.destroyRecursive&&b.domNode&&b.domNode.parentNode==d.body()&&b.destroyRecursive()});delete a.parseResults}d.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,b){this.destroyDescendants();var c=this._contentSetter;if(!(c&&c instanceof d.html._ContentSetter))c=this._contentSetter=new d.html._ContentSetter({node:this.containerNode,_onError:d.hitch(this,this._onError),onContentError:d.hitch(this,function(g){g=this.onContentError(g);try{this.containerNode.innerHTML=
g}catch(h){console.error("Fatal "+this.id+" could not change content due to "+h.message,h)}})});var f=d.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});c.set(d.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!b){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,b,c){this.onLoadDeferred.errback(b);a=this["on"+a+"Error"].call(this,b);if(c)console.error(c,b);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return e.layout.ContentPane});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(d,e){d.declare("dijit.form._FormMixin",null,{state:"",reset:function(){d.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return d.every(d.map(this.getDescendants(),function(b){b._hasBeenBlurred=true;var c=b.disabled||!b.validate||b.validate();if(!c&&!a){d.window.scrollIntoView(b.containerNode||b.domNode);b.focus();a=true}return c}),function(b){return b})},setValues:function(a){d.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var b={};d.forEach(this.getDescendants(),function(h){if(h.name)(b[h.name]||(b[h.name]=[])).push(h)});for(var c in b)if(b.hasOwnProperty(c)){var f=b[c],g=d.getObject(c,false,a);if(g!==undefined){d.isArray(g)||(g=[g]);if(typeof f[0].checked=="boolean")d.forEach(f,function(h){h.set("value",d.indexOf(g,h.value)!=-1)});else f[0].multiple?f[0].set("value",g):d.forEach(f,function(h,
i){h.set("value",g[i])})}}},getValues:function(){d.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};d.forEach(this.getDescendants(),function(b){var c=b.name;if(!(!c||b.disabled)){var f=b.get("value");if(typeof b.checked=="boolean")if(/Radio/.test(b.declaredClass))if(f!==false)d.setObject(c,f,a);else{f=d.getObject(c,false,a);f===undefined&&d.setObject(c,null,a)}else{b=d.getObject(c,false,a);
if(!b){b=[];d.setObject(c,b,a)}f!==false&&b.push(f)}else{b=d.getObject(c,false,a);if(typeof b!="undefined")d.isArray(b)?b.push(f):d.setObject(c,[b,f],a);else d.setObject(c,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=d.map(this._descendants,function(b){return b.get("state")||""});return d.indexOf(a,"Error")>=0?"Error":d.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){d.forEach(this._childConnections||
[],d.hitch(this,"disconnect"));d.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var b=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(h,i){b[h]=i}:d.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var c=this._childConnections=[],f=this._childWatches=[];d.forEach(d.filter(this._descendants,function(h){return h.validate}),function(h){d.forEach(["state","disabled"],function(i){f.push(h.watch(i,function(){b.set("state",
b._getState())}))})});var g=function(){b._onChangeDelayTimer&&clearTimeout(b._onChangeDelayTimer);b._onChangeDelayTimer=setTimeout(function(){delete b._onChangeDelayTimer;b._set("value",b.get("value"))},10)};d.forEach(d.filter(this._descendants,function(h){return h.onChange}),function(h){c.push(b.connect(h,"onChange",g));f.push(h.watch("disabled",g))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,b,c){this.onValidStateChange(c=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return e.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(d,e){d.declare("dijit._DialogMixin",null,{attributeMap:e._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=e._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return e._DialogMixin});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(d,e){d.declare("dijit.TooltipDialog",[e.layout.ContentPane,e._Templated,e.form._FormMixin,e._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:d.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=a;
this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,b,c){a="dijitTooltipAB"+(c.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(c.charAt(0)=="T"?"Below":"Above");d.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);e.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var b=a.target,c=d.keys;a.charOrCode===c.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==c.ESCAPE){setTimeout(d.hitch(this,"onCancel"),0);d.stopEvent(a)}else if(b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){f||e.focus(this._lastFocusItem);d.stopEvent(a)}else if(b==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){f||e.focus(this._firstFocusItem);d.stopEvent(a)}else a.charOrCode===
c.TAB&&a.stopPropagation()}});return e.TooltipDialog});
define("orion/commands",["require","dojo","dijit","orion/util","orion/PageUtil","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip","dijit/TooltipDialog"],function(d,e,a,b,c){function f(u,q,x,z,C){this.commandService=u;this.handler=q;this.items=x;this.userData=z;this.command=C;if(C.parameters)this.parameters=C.parameters.makeCopy();this.id=C.id}function g(u){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups=
{};this._ungrouped={};this._topics={};this._activeBindings={};this._urlBindings={};this._init(u);this._parameterCollector=null}function h(u,q,x){e.addClass(q,"commandImage");var z;if(u.imageClass){z=e.create("span",{},q,"last");e.addClass(z,u.spriteClass);e.addClass(z,u.imageClass)}else{z=new Image;z.alt=u.name;z.name=x;z.id=x;z.src=u.image;e.place(z,q,"last")}return z}function i(u){this._init(u)}function j(u,q,x,z,C){this.keyCode=typeof u==="string"?u.toUpperCase().charCodeAt(0):u;this.mod1=q!==
undefined&&q!==null?q:false;this.mod2=x!==undefined&&x!==null?x:false;this.mod3=z!==undefined&&z!==null?z:false;this.mod4=C!==undefined&&C!==null?C:false}function l(u,q){this.token=u;this.parameterName=q}function n(u,q,x,z){this.name=u;this.type=q;this.label=x;this.value=z}function p(u,q,x){this._storeParameters(u);this.options=q;this.optionsRequested=false;this.getParameters=x}f.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()}};f.prototype.constructor=
f;var t=e.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}}),v=e.declare(a.Tooltip,{constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},_onUnHover:function(){if(this._showTimer){window.clearTimeout(this._showTimer);delete this._showTimer}this.polling=false;this.close()},_onHover:function(){this.inherited(arguments);this.polling=true;this.pollForMissingTarget()},pollForMissingTarget:function(){this.polling&&window.setTimeout(e.hitch(this,
function(){if(this._stillInDocument(this._connectNode))this.pollForMissingTarget();else{this.polling=false;this.close()}}),1E3)},_stillInDocument:function(u){for(;u;){if(u===window.document)return true;u=u.parentNode}return false},postMixInProperties:function(){this.inherited(arguments);this.options.commandParent&&a.byId(this.options.commandParent.id)&&e.connect(this.options.commandParent,"onClose",e.hitch(this,function(){this.close()}))}});g.prototype={_init:function(u){this._registry=u.serviceRegistry;
this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=u.selection;e.connect(window.document,"onkeydown",e.hitch(this,function(q){q=q||window.event;var x=q.target.nodeName.toLowerCase();if(x==="input")switch(q.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(x===
"textarea")return;this._processKey(q)}))},_processKey:function(u){function q(m){if(window.document.all)m.keyCode=0;else{m.preventDefault();m.stopPropagation()}}for(var x in this._activeBindings)if(this._activeBindings[x]&&this._activeBindings[x].keyBinding&&this._activeBindings[x].command)if(this._activeBindings[x].keyBinding.match(u)){var z=this._activeBindings[x],C=z.invocation;if(C){var k=z.command;if(k.hrefCallback){q(u);u=k.hrefCallback.call(C.handler||window,C);u.then?u.then(function(m){window.open(m)}):
window.open(u);return}else if(k.callback){q(u);window.setTimeout(e.hitch(this,function(){C.parameters&&this.collectsParameters()?this._collectParameters(C):k.callback.call(C.handler||window,C)}),0);return}}}},processURL:function(u){for(var q in this._urlBindings)if(this._urlBindings[q]&&this._urlBindings[q].urlBinding&&this._urlBindings[q].command){var x=this._urlBindings[q].urlBinding.match(u);if(x){var z=this._urlBindings[q],C=z.command,k=z.invocation;if(k&&k.parameters&&C.callback){k.parameters.setValue(x.parameterName,
x.parameterValue);window.setTimeout(e.hitch(this,function(){this._collectParameters(k)}),0);return}}}},findCommand:function(u){return this._objectScope[u]||this._domScope[u]||this._globalScope[u]},runCommand:function(u){var q=this._urlBindings[u];q&&q.command&&q.command.callback&&window.setTimeout(e.hitch(this,function(){this._collectParameters(q.invocation)}),0)},getSelectionService:function(){return this._selection},setParameterCollector:function(u){this._parameterCollector=u},openParameterCollector:function(u,
q){if(this._parameterCollector){this._parameterCollector.close();this._parameterCollector.open(u,q)}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_collectParameters:function(u){var q=false;if(this._parameterCollector){u.parameters.updateParameters(u);q=u.parameters.hasParameters()?this._parameterCollector.collectParameters(u):false}if(!q&&u.parameters.hasParameters()){var x=new a.TooltipDialog({onBlur:function(){a.popup.close(x)}}),
z=e.create("div"),C=this._parameterCollector.getFillFunction(u,function(){a.popup.close(x)})(z);x.set("content",z);z=(z=a.byId(u.domParent.id))?e.position(z.eclipseScopeId,true):e.position(u.domNode,true);if(z.x&&z.y&&z.w){a.popup.open({popup:x,x:z.x+z.w-8,y:z.y+8});window.setTimeout(function(){C.focus();C.select()},0);q=true}}if(!q){u.parameters=null;u.command.callback.call(u.handler,u)}},showKeyBindings:function(u){for(var q in this._activeBindings)this._activeBindings[q]&&this._activeBindings[q].keyBinding&&
this._activeBindings[q].command&&e.place('<span role="listitem">'+b.getUserKeyString(this._activeBindings[q].keyBinding)+" = "+this._activeBindings[q].command.name+"<br></span>",u,"last")},addCommand:function(u,q){switch(q){case "dom":this._domScope[u.id]=u;break;case "object":this._objectScope[u.id]=u;break;case "global":this._globalScope[u.id]=u;break;default:throw"unrecognized command scope "+q;}},addCommandGroup:function(u,q,x,z,C){var k=this._namedGroups;if(z)k=this._createEntryForPath(z);if(k[u]){if(x)k[u].title=
x;if(q)k[u].position=q;if(C)k[u].scopeId=C}else{k[u]={title:x,position:q,children:{},scopeId:C};k.sortedCommands=null}},_createEntryForPath:function(u){var q=this._namedGroups;if(u){u=u.split("/");for(var x=0;x<u.length;x++)if(u[x].length>1){q[u[x]]||(q[u[x]]={position:0,children:{}});q=q[u[x]].children}}return q},registerCommandContribution:function(u,q,x,z,C,k,m){z=!x&&!z?this._ungrouped:this._createEntryForPath(z);z[u]={scopeId:x,position:q};if(k)if(q=this._domScope[u]||this._globalScope[u])this._activeBindings[u]=
{command:q,keyBinding:k,bindingOnly:C};if(m)if(q=this._domScope[u]||this._globalScope[u])this._urlBindings[u]={command:q,urlBinding:m,bindingOnly:C};z.sortedCommands=null},_isLastChildSeparator:function(u,q){if(q==="tool"||q==="button")return u.childNodes.length>0&&e.hasClass(u.childNodes[u.childNodes.length-1],"commandSeparator");if(q==="menu"){u=u.getChildren();return u.length>0&&u[u.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(u,q,x,z,C,k,m,o,s){if(typeof u==="string")u=
e.byId(u);if(u){if(!u.id||u.id==="")window.console.log("renderCommands: "+q+","+C+">> WARNING: command parent must have an id")}else throw"no parent";if(x){var w;if(q==="object"){w=this._objectScope;this._render(this._ungrouped,u,q,x,z,C,k,m,w,o,s)}else if(q==="dom")w=this._domScope;else if(q==="global")w=this._globalScope;else throw"Unrecognized command scope "+q;this._render(this._namedGroups,u,q,x,z,C,k,m,w,o,s);if(C==="tool"||C==="button")this._isLastChildSeparator(u,C)&&u.removeChild(u.childNodes[u.childNodes.length-
1]);else if(C==="menu")if(this._isLastChildSeparator(u,C)){x=u.getChildren()[u.getChildren().length-1];u.removeChild(x);x.destroy()}if(q==="dom"||q==="global")b.forceLayout(u)}else{var y=this;this._selection&&this._selection.getSelections(function(B){y.renderCommands(u,q,B,z,C,k,m,o,s)})}},_render:function(u,q,x,z,C,k,m,o,s,w,y){var B=u.sortedCommands;if(!B){B=[];for(var A in u){var E=u[A];if(E&&typeof E.position==="number"){E.id=A;B.push(E)}}B.sort(function(S,D){return S.position-D.position});u.sortedCommands=
B}for(u=0;u<B.length;u++){var G,M;if(B[u].children){A=B[u];if(!(A.scopeId&&q.id!==A.scopeId)){var H;if(k==="tool"||k==="button")if(A.title){G=new a.Menu({style:"display: none;"});G.eclipseScopeId=q.eclipseScopeId||q.id;this._render(B[u].children,G,x,z,C,"menu",m,o,s,w);H=G.getChildren();if(this._isLastChildSeparator(G,"menu")){E=H[H.length-1];G.removeChild(E);E.destroy();H=G.getChildren()}if(H.length>0){E=H[0].eclipseCommand;if(H.length>1){G=new a.form.DropDownButton({label:A.title==="*"?"Actions":
A.title,showLabel:A.title!=="*",dropDown:G});e.addClass(G.domNode,"commandMenu");e.destroy(G.valueNode);if(A.title==="*"){e.addClass(G.domNode,"textless");new v({connectId:[G.domNode],label:"Actions menu",position:["above","left","right","below"],commandParent:q,commandService:this})}E._setupActivateVisuals(G.domNode,G.focusNode,w,y);e.place(G.domNode,q,"last")}else{G=k+E.id+u;M=new f(this,C,z,o,E);k==="button"?E._addButton(q,m,G,M,w,y):E._addTool(q,m,G,M,w,y)}}}else{var N;if(q.childNodes.length>
0&&!this._isLastChildSeparator(q,k))N=this.generateSeparatorImage(q);this._render(B[u].children,q,x,z,C,k,m,o,s,w,y);if(q.childNodes.length>0)if(q.childNodes[q.childNodes.length-1]!==N)N=this.generateSeparatorImage(q)}else if(A.title){E=new a.Menu;this._render(B[u].children,E,x,z,C,k,m,o,s,w,y);E.getChildren().length>0&&q.addChild(new a.PopupMenuItem({label:A.title,popup:E}))}else{var L;if(q.getChildren().length>0&&!this._isLastChildSeparator(q,k)){L=new a.MenuSeparator;q.addChild(L)}this._render(B[u].children,
q,x,z,C,k,m,o,s,w,y);A=q.getChildren();if(A[A.length-1]!==L){L=new a.MenuSeparator;q.addChild(L)}}}}else{E=(A=s[B[u].id])?true:false;H=H=null;if(A){if(x==="dom"||x==="global")E=k==="tool"||k==="button"?q.id===B[u].scopeId:k==="menu"?q.eclipseScopeId===B[u].scopeId:false;else if(x==="object")E=!B[u].scopeId;var P=E&&(x==="global"||x==="dom");M=new f(this,C,z,o,A);M.domParent=q;G=E&&(A.visibleWhen?A.visibleWhen(z):true);if(P&&this._activeBindings[A.id]&&this._activeBindings[A.id].keyBinding){H=this._activeBindings[A.id];
H.invocation=G?M:null;if(H.bindingOnly)E=false}if(P&&this._urlBindings[A.id]&&this._urlBindings[A.id].urlBinding){H=this._urlBindings[A.id];H.invocation=G?M:null;if(H.bindingOnly)E=false}E=E&&G}if(E)if(A.choiceCallback){E=new a.Menu({style:"display: none;"});if(k==="tool"||k==="button"){G=new a.form.DropDownButton({label:A.name,dropDown:E});if(A.image){e.addClass(G.iconNode,"commandImage");G.iconNode.src=A.image}e.place(G.domNode,q,"last");G.eclipseCommand=A;G.eclipseChoices=E;e.connect(G,"onClick",
G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,z,C,o)})}else if(k==="menu"){G=new a.PopupMenuItem({label:A.name,popup:E});q.addChild(G);G.eclipseCommand=A;G.eclipseChoices=E;e.connect(q,"_openPopup",G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,z,C,o)})}}else if(k==="tool"){G="tool"+A.id+u;A._addTool(q,m,G,M,w,y)}else if(k==="button"){G="button"+A.id+u;A._addButton(q,m,G,M,w,y)}else k==="menu"&&A._addMenuItem(q,M,w,y)}}},whenHidden:function(u,q){u=
typeof u==="string"?u:u.id;if(!this.hidden)this.hidden={};if(this.hidden[u])this.hidden[u].push(q);else this.hidden[u]=[q]},generateSeparatorImage:function(u){u=e.create("span",null,u,"last");e.addClass(u,"core-sprite-sep");e.addClass(u,"imageSprite");e.addClass(u,"commandSeparator");return u}};g.prototype.constructor=g;i.prototype={_init:function(u){this.id=u.id;this.name=u.name;this.tooltip=u.tooltip||u.name;this.callback=u.callback;this.hrefCallback=u.hrefCallback;this.choiceCallback=u.choiceCallback;
this.image=u.image||d.toUrl("images/none.png");this.imageClass=u.imageClass;this.spriteClass=u.spriteClass||"commandSprite";this.visibleWhen=u.visibleWhen;this.parameters=u.parameters},_addTool:function(u,q,x,z,C,k){z.handler=z.handler||this;var m,o;if(this.hrefCallback){m=this._makeLink(z);if(!m)return}else{m=e.create("span",{tabindex:"0",role:"button"});if(q||!this.hasImage()){q=window.document.createTextNode(this.name);e.place(q,m,"last");e.addClass(m,"commandMissingImageButton commandButton")}else{o=
h(this,m,x);this._addAccessibleLabel(m)}this._hookCallback(m,z);this._setupActivateVisuals(m,m,C,k,o?"commandImageOver":"commandButtonOver")}z.domNode=m;z.domParent=u;this.tooltip&&new v({connectId:[m],label:this.tooltip,position:["above","left","right","below"],commandParent:u,commandService:z.commandService});e.place(m,u,"last")},_addButton:function(u,q,x,z,C,k){z.handler=z.handler||this;if(this.hrefCallback){q=this._makeLink(z);if(!q)return}else{q=e.create("span",{tabindex:"0",role:"button"});
this._hookCallback(q,z);var m;if(this.name){e.place(window.document.createTextNode(this.name),q,"last");e.addClass(q,"commandButton");m="commandButtonOver"}else{h(this,q,x);m="commandImageOver";this._addAccessibleLabel(q)}this._setupActivateVisuals(q,q,C,k,m)}q.id=x;this.tooltip&&new v({connectId:[q],label:this.tooltip,position:["above","left","right","below"],commandParent:u,commandService:z.commandService});z.domParent=u;z.domNode=q;e.place(q,u,"last")},_addMenuItem:function(u,q){q.domParent=u.domNode;
var x=new t({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new v({connectId:[x.domNode],label:this.tooltip,commandParent:u,commandService:q.commandService});if(this.hrefCallback){var z=this.hrefCallback.call(q.handler,q);if(z)if(z.then)z.then(e.hitch(this,function(C){x.set("label","<a href='"+C+"'>"+this.name+"</a>")}));else if(z)x.set("label","<a href='"+z+"'>"+this.name+"</a>");else return}else if(this.callback)x.onClick=
this.parameters&&q.collectsParameters()?e.hitch(this,function(){q.commandService._collectParameters(q)}):e.hitch(this,function(){this.callback.call(q.handler,q)});x.eclipseCommand=this;u.addChild(x);if(this.imageClass)e.addClass(x.iconNode,this.spriteClass);else if(this.image){e.addClass(x.iconNode,"commandMenuItem");x.iconNode.src=this.image}q.domNode=x.domNode},_makeLink:function(u){var q=e.create("a",{tabindex:"0"});e.addClass(q,"commandLink");e.place(window.document.createTextNode(this.name),
q,"last");u=this.hrefCallback.call(u.handler,u);if(u.then)u.then(function(x){q.href=x});else if(u)q.href=u;else return null;return q},_hookCallback:function(u,q){e.connect(u,"onclick",this,function(){if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);else this.callback&&this.callback.call(q.handler,q)});e.connect(u,"onkeypress",this,function(x){if(x.keyCode===e.keys.ENTER||x.keyCode===e.keys.SPACE)if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);
else this.callback&&this.callback.call(q.handler,q)})},_addAccessibleLabel:function(u){var q=this.name||this.tooltip;q&&e.attr(u,"aria-label",q)},_setupActivateVisuals:function(u,q,x,z,C){z&&e.addClass(u,z);var k=function(){C&&e.addClass(this,C);x&&e.addClass(this,x);z&&e.removeClass(this,z)},m=function(){C&&e.removeClass(this,C);x&&e.removeClass(this,x);z&&e.addClass(this,z)};e.connect(u,"onmouseover",u,k);e.connect(q,"onfocus",u,k);e.connect(u,"onmouseout",u,m);e.connect(q,"onblur",u,m)},populateChoicesMenu:function(u,
q,x,z){u.focusedChild=null;e.forEach(u.getChildren(),function(m){u.removeChild(m);m.destroy()});x=this.getChoices(q,x,z);for(z=0;z<x.length;z++){var C=x[z],k;if(C.name){k=new a.MenuItem({label:C.name,iconClass:C.imageClass,onClick:this.makeChoiceCallback(C,q)});if(C.imageClass)e.addClass(k.iconNode,C.spriteClass||"commandSprite");else if(C.image){e.addClass(k.iconNode,"commandImage");k.iconNode.src=C.image}}else k=new a.MenuSeparator;u.addChild(k)}},getChoices:function(u,q,x){if(this.choiceCallback)return this.choiceCallback.call(q,
u,x);return null},makeChoiceCallback:function(u,q){return function(x){u.callback&&u.callback.call(u,q,x)}},hasImage:function(){return this.imageClass||this.image!==d.toUrl("images/none.png")}};i.prototype.constructor=i;var r=window.navigator.platform.indexOf("Mac")!==-1;j.prototype={match:function(u){if(this.keyCode===u.keyCode){if(this.mod1!==(r?u.metaKey:u.ctrlKey))return false;if(this.mod2!==u.shiftKey)return false;if(this.mod3!==u.altKey)return false;if(r&&this.mod4!==u.ctrlKey)return false;return true}return false},
equals:function(u){if(!u)return false;if(this.keyCode!==u.keyCode)return false;if(this.mod1!==u.mod1)return false;if(this.mod2!==u.mod2)return false;if(this.mod3!==u.mod3)return false;if(this.mod4!==u.mod4)return false;return true}};j.prototype.constructor=j;l.prototype={match:function(u){u=c.matchResourceParameters(u);if(typeof u[this.token]!=="undefined"){this.parameterValue=u[this.token];return this}return null}};l.prototype.constructor=l;n.prototype={optionsRequested:function(){return this.optionsRequested}};
n.prototype.constructor=n;p.prototype={_storeParameters:function(u){this.parameterTable=null;if(u){this.parameterTable={};for(var q=0;q<u.length;q++)this.parameterTable[u[q].name]=u[q]}},updateParameters:function(u){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(u))},hasParameters:function(){return this.parameterTable!==null},parameterNamed:function(u){return this.parameterTable[u]},valueFor:function(u){if(u=this.parameterTable[u])return u.value;return null},setValue:function(u,
q){if(u=this.parameterTable[u])u.value=q},forEach:function(u){for(var q in this.parameterTable)this.parameterTable[q].type&&this.parameterTable[q].name&&u(this.parameterTable[q])},makeCopy:function(){var u=[];this.forEach(function(q){q=new n(q.name,q.type,q.label,q.value);u.push(q)});return new p(u,this.options,this.getParameters)}};p.prototype.constructor=p;return{CommandService:g,CommandKeyBinding:j,Command:i,CommandInvocation:f,CommandMenuItem:t,URLBinding:l,ParametersDescription:p,CommandParameter:n,
CommandTooltip:v}});
define("orion/parameterCollectors",["require","dojo","dijit","orion/commands","orion/util","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(d,e,a,b,c){function f(){this._activeContainer=null}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&e.empty(this._activeElements.parameterArea);if(this._activeElements.parameterContainer){e.removeClass(this._activeElements.parameterContainer,"slideActive");e.removeClass(this._activeElements.slideContainer,"slideContainerActive")}this._activeElements.dismissArea&&
e.empty(this._activeElements.dismissArea);this._activeElements.commandNode&&e.removeClass(this._activeElements.commandNode,"activeCommand");c.forceLayout(this._activeElements.parameterContainer);if(this._oldFocusNode){this._oldFocusNode.focus();this._oldFocusNode=null}}this._activeElements=null},_findParameterElements:function(g){var h={},i=null;if(typeof g==="string")g=e.byId(g);for(var j=g;j;){if(e.hasClass(j,"toolComposite")){i=j;break}j=j.parentNode}if(e.hasClass(g,"commandMarker"))h.commandNode=
g;if(i){h.slideContainer=e.query(".slideParameters",i)[0];h.parameterContainer=e.query(".slide",i)[0];h.parameterArea=e.query(".parameters",i)[0];h.dismissArea=e.query(".parametersDismiss",i)[0]}return h},open:function(g,h){if(typeof g==="string")g=e.byId(g);this.close();this._activeElements=null;if((this._activeElements=this._findParameterElements(g))&&this._activeElements.parameterArea&&this._activeElements.slideContainer&&this._activeElements.parameterContainer){var i=h(this._activeElements.parameterArea);
g=e.query("#closebox",this._activeElements.parameterArea);if(g.length===0){g=e.create("span",{id:"closebox",role:"button",tabindex:"0"},this._activeElements.dismissArea||this._activeElements.parameterArea,"last");e.addClass(g,"imageSprite");e.addClass(g,"core-sprite-close");e.addClass(g,"dismiss");g.title="Close";e.connect(g,"onclick",e.hitch(this,function(){this.close(this._activeElements)}));e.connect(g,"onkeypress",e.hitch(this,function(j){j.keyCode===e.keys.ENTER&&this.close(this._activeElements)}))}e.addClass(this._activeElements.slideContainer,
"slideContainerActive");e.addClass(this._activeElements.parameterContainer,"slideActive");c.forceLayout(this._activeElements.parameterContainer);if(i){this._oldFocusNode=window.document.activeElement;window.setTimeout(function(){i.focus();i.select()},0)}this._activeElements.commandNode&&e.addClass(this._activeElements.commandNode,"activeCommand");return true}return false},_collectAndCall:function(g,h){e.query("input",h).forEach(function(i){i.type!=="button"&&g.parameters.setValue(i.parameterName,
i.value)});g.command.callback&&g.command.callback.call(g.handler,g)},collectParameters:function(g){if(g.parameters){g.domNode&&e.addClass(g.domNode,"commandMarker");return this.open(g.domNode||g.domParent,this.getFillFunction(g))}return false},getFillFunction:function(g,h){return e.hitch(this,function(i){var j=null,l=e.hitch(this,function(){h?h():this.close(g.domNode)}),n=e.hitch(this,function(v){v.keyCode===e.keys.ENTER&&this._collectAndCall(g,i);if(v.keyCode===e.keys.ESCAPE||v.keyCode===e.keys.ENTER){l();
e.stopEvent(v)}});g.parameters.forEach(function(v){v.label&&e.place(document.createTextNode(v.label),i,"last");var r=e.create("input",{type:v.type},i,"last");e.addClass(r,"parameterInput");e.addClass(r,"parameterInput"+v.type);r.setAttribute("speech","speech");r.setAttribute("x-webkit-speech","x-webkit-speech");r.parameterName=v.name;j||(j=r);if(v.value)r.value=v.value;e.connect(r,"onkeypress",n)});var p=function(v){v._collectAndCall(g,i);l()};if(g.parameters.options){g.parameters.optionsRequested=
false;var t=e.create("span",{role:"button",tabindex:"0"},i,"last");e.place(window.document.createTextNode("More"),t,"last");e.addClass(t,"dismiss");e.connect(t,"onclick",e.hitch(this,function(){g.parameters.optionsRequested=true;p(this)}));e.connect(t,"onkeypress",e.hitch(this,function(v){if(v.keyCode===e.keys.ENTER){g.parameters.optionsRequested=true;p(this)}}))}spacer=e.create("span",null,i,"last");e.addClass(spacer,"dismiss");t=e.create("span",{role:"button",tabindex:"0"},i,"last");e.place(window.document.createTextNode("Submit"),
t,"last");e.addClass(t,"dismiss");e.connect(t,"onclick",e.hitch(this,function(){p(this)}));e.connect(t,"onkeypress",e.hitch(this,function(v){v.keyCode===e.keys.ENTER&&p(this)}));spacer=e.create("span",null,i,"last");e.addClass(spacer,"dismiss");t=e.create("span",{id:"closebox",role:"button",tabindex:"0"},i,"last");e.addClass(t,"imageSprite");e.addClass(t,"core-sprite-close");e.addClass(t,"dismiss");t.title="Close";e.connect(t,"onclick",e.hitch(this,function(){l()}));e.connect(t,"onkeypress",e.hitch(this,
function(v){v.keyCode===e.keys.ENTER&&l()}));return j})}};f.prototype.constructor=f;return{CommandParameterCollector:f}});define("orion/editor/regex",[],function(){function d(a){return a.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function e(a){if(a=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(a))return{pattern:a[1],flags:a[2]};return null}return{escape:d,parse:e}});
define("orion/contentTypes",[],function(){function d(a){function b(j,l,n,p){n=l.filename.indexOf(n)>=0;var t=l.extension.indexOf(p)>=0;if(n||t)if(!j||n&&j.extension.indexOf(p)>=0)return l;return j}for(var c=a&&a.split(".").pop(),f=this.getContentTypes(),g=null,h=0;h<f.length;h++){var i=f[h];if(b(g,i,a,c)===i)g=i}return g}function e(a){function b(c){function f(n){if(n===null||typeof n==="undefined")return[];return n instanceof Array?n:[n]}c=c.getServiceReferences("orion.file.contenttype");for(var g=
{},h=0;h<c.length;h++)for(var i=f(c[h].getProperty("contentTypes")),j=0;j<i.length;j++){var l=i[j];g[l.id]||(g[l.id]={id:l.id,name:l.name,image:l.image,"extends":l["extends"],extension:f(l.extension),filename:f(l.filename)})}return g}this.serviceRegistry=a;this.map=b(a);a.registerService("orion.file.contenttypes",this)}e.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return d.call(this,a.Name)},getFilenameContentType:function(a){return d.call(this,a)},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a=typeof a==="string"?this.getContentType(a):a;b=typeof b==="string"?this.getContentType(b):b;if(!a||!b)return false;if(a.id===b.id)return true;else{a=a;for(var c={};a&&(a=this.getContentType(a["extends"]));){if(a.id===b.id)return true;if(c[a.id])throw new Error("Cycle: "+a.id);c[a.id]=true}}return false},
isSomeExtensionOf:function(a,b){for(var c=0;c<b.length;c++)if(this.isExtensionOf(a,b[c]))return true;return false}};return{ContentTypeService:e}});
define("orion/URITemplate",["require","exports","module"],function(){function d(l){this._text=l}function e(l,n){if(n==="U")return encodeURIComponent(l).replace(/[!'()*]/g,function(p){return"%"+p.charCodeAt(0).toString(16).toUpperCase()});if(n==="U+R")return encodeURI(l).replace(/%5B/g,"[").replace(/%5D/g,"]");if(n==="U+R-,")return encodeURI(l).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+n);}function a(l,n,p){for(var t=[],v=0;v<l.length;v++)typeof l[v]!==
"undefined"&&t.push(e(l[v],n));return t.join(p)}function b(l,n,p,t){for(var v=Object.keys(l),r=[],u=0;u<v.length;u++)typeof l[v[u]]!=="undefined"&&r.push(e(v[u],n)+p+e(l[v[u]],n));return r.join(t)}function c(l){for(var n=[],p=l.split(","),t=0;t<p.length;t++){var v=p[t].match(j);if(v===null)throw new Error("Bad VarSpec: "+l);n.push({name:v[1],explode:!!v[2],prefix:v[3]?parseInt(v[3],10):-1})}return n}function f(l){if(l.length===0)throw new Error("Invalid Expression: 0 length expression");if(this._operator=
i[l[0]])l=l.substring(1);else this._operator=i.NUL;this._varSpecList=c(l)}function g(l){for(var n=[],p=0,t=l.indexOf("{",p);t!==-1;){n.push(new d(l.substring(p,t)));p=l.indexOf("}",t+1);if(p===-1)throw new Error("Invalid template: "+l);n.push(new f(l.substring(t+1,p)));p=p+1;t=l.indexOf("{",p)}n.push(new d(l.substring(p)));return n}function h(l){this._templateComponents=g(l)}var i={NUL:{first:"",sep:",",named:false,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:false,ifemp:"",allow:"U+R"},".":{first:".",
sep:",",named:false,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:false,ifemp:"",allow:"U"},";":{first:";",sep:";",named:true,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:true,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:true,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:false,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:false,ifemp:"",allow:"U+R-,"}},j=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;d.prototype=
{expand:function(){return encodeURI(this._text)}};f.prototype={expand:function(l){for(var n=[],p=0;p<this._varSpecList.length;p++){var t=this._varSpecList[p],v=t.name,r=l[v],u=typeof r;if(u!=="undefined"&&r!==null){var q=n.length===0?this._operator.first:this._operator.sep;if(u==="string"){if(this._operator.named){q+=e(v,"U+R");q+=r.length===0?this._operator.ifemp:"="}if(t.prefix!==-1&&t.prefix<r.length)r=r.substring(0,t.prefix);q+=e(r,this._operator.allow)}else if(Array.isArray(r))if(t.explode)q+=
a(r,this._operator.allow,this._operator.sep);else{if(this._operator.named){q+=e(v,"U+R");q+=r.length===0?this._operator.ifemp:"="}q+=a(r,this._operator.allow,",")}else if(u==="object")if(t.explode)q+=b(r,this._operator.allow,"=",this._operator.sep);else{if(this._operator.named){q+=e(v,"U+R");q+=Object.keys(r).length===0?this._operator.ifemp:"="}q+=b(r,this._operator.allow,",",",")}else throw new Error("bad param type: "+v+" : "+u);n.push(q)}}return n.join("")}};h.prototype={expand:function(l){for(var n=
[],p=0;p<this._templateComponents.length;p++)n.push(this._templateComponents[p].expand(l));return n.join("")}};return h});define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(d){d.getObject("dnd",true,d);d.dnd.getCopyKeyState=d.isCopyKey;d.dnd._uniqueId=0;d.dnd.getUniqueId=function(){var e;do e=d._scopeName+"Unique"+ ++d.dnd._uniqueId;while(d.byId(e));return e};d.dnd._empty={};d.dnd.isFormElement=function(e){e=e.target;if(e.nodeType==3)e=e.parentNode;return" button textarea input select option ".indexOf(" "+e.tagName.toLowerCase()+" ")>=0};return d.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(d){d.getObject("dnd",true,d);d.dnd.getViewport=d.window.getBox;d.dnd.V_TRIGGER_AUTOSCROLL=32;d.dnd.H_TRIGGER_AUTOSCROLL=32;d.dnd.V_AUTOSCROLL_VALUE=16;d.dnd.H_AUTOSCROLL_VALUE=16;d.dnd.autoScroll=function(e){var a=d.window.getBox(),b=0,c=0;if(e.clientX<d.dnd.H_TRIGGER_AUTOSCROLL)b=-d.dnd.H_AUTOSCROLL_VALUE;else if(e.clientX>a.w-d.dnd.H_TRIGGER_AUTOSCROLL)b=d.dnd.H_AUTOSCROLL_VALUE;if(e.clientY<d.dnd.V_TRIGGER_AUTOSCROLL)c=-d.dnd.V_AUTOSCROLL_VALUE;
else if(e.clientY>a.h-d.dnd.V_TRIGGER_AUTOSCROLL)c=d.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(b,c)};d.dnd._validNodes={div:1,p:1,td:1};d.dnd._validOverflow={auto:1,scroll:1};d.dnd.autoScrollNodes=function(e){for(var a=e.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in d.dnd._validNodes){var b=d.getComputedStyle(a);if(b.overflow.toLowerCase()in d.dnd._validOverflow){var c=d._getContentBox(a,b);b=d.position(a,true);var f=Math.min(d.dnd.H_TRIGGER_AUTOSCROLL,c.w/2),g=Math.min(d.dnd.V_TRIGGER_AUTOSCROLL,
c.h/2),h=e.pageX-b.x,i=e.pageY-b.y,j=b=0;if(d.isWebKit||d.isOpera){h+=d.body().scrollLeft;i+=d.body().scrollTop}if(h>0&&h<c.w)if(h<f)b=-f;else if(h>c.w-f)b=f;if(i>0&&i<c.h)if(i<g)j=-g;else if(i>c.h-g)j=g;c=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=b;a.scrollTop+=j;if(c!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(l){a=null}}d.dnd.autoScroll(e)};return d.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(d){d.declare("dojo.dnd.Mover",null,{constructor:function(e,a,b){this.node=d.byId(e);var c=a.touches?a.touches[0]:a;this.marginBox={l:c.pageX,t:c.pageY};this.mouseButton=a.button;a=this.host=b;e=e.ownerDocument;this.events=[d.connect(e,"onmousemove",this,"onFirstMove"),d.connect(e,"ontouchmove",this,"onFirstMove"),d.connect(e,"onmousemove",this,"onMouseMove"),d.connect(e,"ontouchmove",this,"onMouseMove"),d.connect(e,
"onmouseup",this,"onMouseUp"),d.connect(e,"ontouchend",this,"onMouseUp"),d.connect(e,"ondragstart",d.stopEvent),d.connect(e.body,"onselectstart",d.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(e){d.dnd.autoScroll(e);var a=this.marginBox,b=e.touches?e.touches[0]:e;this.host.onMove(this,{l:a.l+b.pageX,t:a.t+b.pageY},e);d.stopEvent(e)},onMouseUp:function(e){if(d.isWebKit&&d.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button)this.destroy();d.stopEvent(e)},onFirstMove:function(e){var a=
this.node.style,b,c=this.host;switch(a.position){case "relative":case "absolute":b=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=d.marginBox(this.node);b=d.doc.body;var f=d.getComputedStyle(b),g=d._getMarginBox(b,f);f=d._getContentBox(b,f);b=a.l-(f.l-g.l);a=a.t-(f.t-g.t);break}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;c&&c.onFirstMove&&c.onFirstMove(this,e);d.disconnect(this.events.shift());d.disconnect(this.events.shift())},
destroy:function(){d.forEach(this.events,d.disconnect);var e=this.host;e&&e.onMoveStop&&e.onMoveStop(this);this.events=this.node=this.host=null}});return d.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(d){d.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(e,a){this.node=d.byId(e);a||(a={});this.handle=a.handle?d.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:d.dnd.Mover;this.events=[d.connect(this.handle,"onmousedown",this,"onMouseDown"),d.connect(this.handle,"ontouchstart",this,"onMouseDown"),d.connect(this.handle,
"ondragstart",this,"onSelectStart"),d.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(e,a){return new d.dnd.Moveable(a,e)},destroy:function(){d.forEach(this.events,d.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(e){if(!(this.skip&&d.dnd.isFormElement(e))){if(this.delay){this.events.push(d.connect(this.handle,"onmousemove",this,"onMouseMove"),d.connect(this.handle,"ontouchmove",this,"onMouseMove"),d.connect(this.handle,"onmouseup",this,
"onMouseUp"),d.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=e.touches?e.touches[0]:e;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(e);d.stopEvent(e)}},onMouseMove:function(e){var a=e.touches?e.touches[0]:e;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e)}d.stopEvent(e)},onMouseUp:function(e){for(var a=0;a<2;++a)d.disconnect(this.events.pop());d.stopEvent(e)},onSelectStart:function(e){if(!this.skip||
!d.dnd.isFormElement(e))d.stopEvent(e)},onDragDetected:function(e){new this.mover(this.node,e,this)},onMoveStart:function(e){d.publish("/dnd/move/start",[e]);d.addClass(d.body(),"dojoMove");d.addClass(this.node,"dojoMoveItem")},onMoveStop:function(e){d.publish("/dnd/move/stop",[e]);d.removeClass(d.body(),"dojoMove");d.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(e,a){this.onMoving(e,a);var b=e.node.style;b.left=a.l+"px";b.top=a.t+"px";this.onMoved(e,a)},onMoving:function(){},
onMoved:function(){}});return d.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(d){d.declare("dojo.dnd.move.constrainedMoveable",d.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(e,a){return new d.dnd.move.constrainedMoveable(a,e)},constructor:function(e,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(e){var a=this.constraintBox=this.constraints.call(this,e);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){e=d._getMarginSize(e.node);a.r-=e.w;
a.b-=e.h}},onMove:function(e,a){var b=this.constraintBox,c=e.node.style;this.onMoving(e,a);a.l=a.l<b.l?b.l:b.r<a.l?b.r:a.l;a.t=a.t<b.t?b.t:b.b<a.t?b.b:a.t;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(e,a)}});d.declare("dojo.dnd.move.boxConstrainedMoveable",d.dnd.move.constrainedMoveable,{box:{},markupFactory:function(e,a){return new d.dnd.move.boxConstrainedMoveable(a,e)},constructor:function(e,a){var b=a&&a.box;this.constraints=function(){return b}}});d.declare("dojo.dnd.move.parentConstrainedMoveable",
d.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(e,a){return new d.dnd.move.parentConstrainedMoveable(a,e)},constructor:function(e,a){var b=a&&a.area;this.constraints=function(){var c=this.node.parentNode,f=d.getComputedStyle(c),g=d._getMarginBox(c,f);if(b=="margin")return g;var h=d._getMarginExtents(c,f);g.l+=h.l;g.t+=h.t;g.w-=h.w;g.h-=h.h;if(b=="border")return g;h=d._getBorderExtents(c,f);g.l+=h.l;g.t+=h.t;g.w-=h.w;g.h-=h.h;if(b=="padding")return g;h=d._getPadExtents(c,f);g.l+=
h.l;g.t+=h.t;g.w-=h.w;g.h-=h.h;return g}}});d.dnd.constrainedMover=d.dnd.move.constrainedMover;d.dnd.boxConstrainedMover=d.dnd.move.boxConstrainedMover;d.dnd.parentConstrainedMover=d.dnd.move.parentConstrainedMover;return d.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(d){(function(){var e=d.dnd.Moveable.prototype.onMove;d.declare("dojo.dnd.TimedMoveable",d.dnd.Moveable,{timeout:40,constructor:function(a,b){b||(b={});if(b.timeout&&typeof b.timeout=="number"&&b.timeout>=0)this.timeout=b.timeout},markupFactory:function(a,b){return new d.dnd.TimedMoveable(b,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);e.call(this,a,a._leftTop)}d.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,b){a._leftTop=b;if(!a._timer){var c=this;a._timer=setTimeout(function(){a._timer=null;e.call(c,a,a._leftTop)},this.timeout)}}})})();return d.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(d){d.declare("dojo.fx.Toggler",null,{node:null,showFunc:d.fadeIn,hideFunc:d.fadeOut,showDuration:200,hideDuration:200,constructor:function(e){var a=this;d.mixin(a,e);a.node=e.node;a._showArgs=d.mixin({},e);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=d.mixin({},e);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);d.connect(a.showAnim,"beforeBegin",d.hitch(a.hideAnim,
"stop",true));d.connect(a.hideAnim,"beforeBegin",d.hitch(a.showAnim,"stop",true))},show:function(e){return this.showAnim.play(e||0)},hide:function(e){return this.hideAnim.play(e||0)}});return d.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(d){(function(){var e={_fire:function(c,f){if(this[c])this[c].apply(this,f||[]);return this}},a=function(c){this._index=-1;this._animations=c||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};d.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(c,f){if(!this._current)this._current=this._animations[this._index=0];if(!f&&this._current.status()=="playing")return this;var g=d.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),h=d.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),i=d.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);d.disconnect(g);d.disconnect(h);d.disconnect(i)});this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&d.disconnect(this._onEndCtx);this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var c=d.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);d.disconnect(c)});this._current.pause()}return this},gotoPercent:function(c,f){this.pause();var g=this.duration*c;this._current=null;d.some(this._animations,function(h){if(h.duration<=g){this._current=h;return true}g-=h.duration;return false});this._current&&this._current.gotoPercent(g/this._current.duration,f);return this},stop:function(c){if(this._current){if(c){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var f=d.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);d.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onEndCtx&&d.disconnect(this._onEndCtx)}});d.extend(a,e);d.fx.chain=function(c){return new a(c)};
var b=function(c){this._animations=c||[];this._connects=[];this.duration=this._finished=0;d.forEach(c,function(g){var h=g.duration;if(g.delay)h+=g.delay;if(this.duration<h)this.duration=h;this._connects.push(d.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var f=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){f._connects.push(d.connect(f._pseudoAnimation,g,function(){f._fire(g,
arguments)}))})};d.extend(b,{_doAction:function(c,f){d.forEach(this._animations,function(g){g[c].apply(g,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(c,f){var g=this._pseudoAnimation;g[c].apply(g,f)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(c,f){var g=
this.duration*c;d.forEach(this._animations,function(h){h.gotoPercent(h.duration<g?1:g/h.duration,f)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){d.forEach(this._connects,d.disconnect)}});d.extend(b,e);d.fx.combine=function(c){return new b(c)};d.fx.wipeIn=function(c){var f=c.node=d.byId(c.node),g=f.style,h;c=d.animateProperty(d.mixin({properties:{height:{start:function(){h=
g.overflow;g.overflow="hidden";if(g.visibility=="hidden"||g.display=="none"){g.height="1px";g.display="";g.visibility="";return 1}else{var i=d.style(f,"height");return Math.max(i,1)}},end:function(){return f.scrollHeight}}}},c));d.connect(c,"onEnd",function(){g.height="auto";g.overflow=h});return c};d.fx.wipeOut=function(c){var f=(c.node=d.byId(c.node)).style,g;c=d.animateProperty(d.mixin({properties:{height:{end:1}}},c));d.connect(c,"beforeBegin",function(){g=f.overflow;f.overflow="hidden";f.display=
""});d.connect(c,"onEnd",function(){f.overflow=g;f.height="auto";f.display="none"});return c};d.fx.slideTo=function(c){var f=null,g=null,h=function(i){return function(){var j=d.getComputedStyle(i),l=j.position;f=l=="absolute"?i.offsetTop:parseInt(j.top)||0;g=l=="absolute"?i.offsetLeft:parseInt(j.left)||0;if(l!="absolute"&&l!="relative"){j=d.position(i,true);f=j.y;g=j.x;i.style.position="absolute";i.style.top=f+"px";i.style.left=g+"px"}}}(c.node=d.byId(c.node));h();c=d.animateProperty(d.mixin({properties:{top:c.top||
0,left:c.left||0}},c));d.connect(c,"beforeBegin",c,h);return c}})();return d.fx});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(d,e){d.declare("dijit.DialogUnderlay",[e._Widget,e._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){d.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){d.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,b=this.domNode.style;b.display="none";var c=d.window.getBox();b.top=c.t+"px";b.left=c.l+"px";a.width=c.w+"px";a.height=c.h+"px";b.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new e.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return e.DialogUnderlay});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(d,e){d.declare("dijit._DialogBase",[e._Templated,e.form._FormMixin,e._DialogMixin,e._CssStateMixin],{templateString:d.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:d.delegate(e._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:e.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=d.i18n.getLocalization("dijit","common");d.mixin(this,a);this.inherited(arguments)},
postCreate:function(){d.style(this.domNode,{display:"none",position:"absolute"});d.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);e.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
d.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=d.isIE==6?new d.dnd.TimedMoveable(a,{handle:this.titleBar}):new d.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=d.subscribe("/dnd/move/stop",this,"_endDrag")}else d.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":d.map(this["class"].split(/\s/),function(b){return b+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else d.style(this.containerNode,{width:"auto",height:"auto"});var a=d._getMarginSize(this.domNode),b=d.window.getBox();if(a.w>=b.w||a.h>=b.h){var c=Math.min(a.w,Math.floor(b.w*0.75));a=Math.min(a.h,Math.floor(b.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:c,h:a})}else d.style(this.containerNode,{width:c+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!d.hasClass(d.body(),"dojoMove")){var a=this.domNode,b=d.window.getBox(),c=this._relativePosition,f=c?null:d._getBorderBox(a),g=Math.floor(b.l+(c?c.x:(b.w-f.w)/2));b=Math.floor(b.t+(c?c.y:(b.h-f.h)/2));d.style(a,{left:g+"px",top:b+"px"})}},_onKey:function(a){if(a.charOrCode){var b=d.keys,c=a.target;a.charOrCode===b.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===b.TAB){f||e.focus(this._lastFocusItem);d.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===b.TAB&&!a.shiftKey){f||e.focus(this._firstFocusItem);d.stopEvent(a)}else{for(;c;){if(c==this.domNode||d.hasClass(c,"dijitPopup"))if(a.charOrCode==b.ESCAPE)this.onCancel();else return;c=c.parentNode}if(a.charOrCode!==b.TAB)d.stopEvent(a);else if(!d.isOpera)try{this._firstFocusItem.focus()}catch(g){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(d.connect(window,"onscroll",this,"layout"));this._modalconnects.push(d.connect(window,"onresize",this,function(){var b=d.window.getBox();if(!this._oldViewport||b.h!=this._oldViewport.h||b.w!=this._oldViewport.w){this.layout();this._oldViewport=b}}));this._modalconnects.push(d.connect(this.domNode,
"onkeypress",this,"_onKey"));d.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=d.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:d.hitch(this,function(){e._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:d.hitch(this,function(){if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
e.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=d.fadeOut({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,function(){this.domNode.style.display="none";e._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;d.forEach(this._modalconnects,d.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){e._underlay&&e._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&d.unsubscribe(this._dndListener);d.forEach(this._modalconnects,d.disconnect);e._DialogLevelManager.hide(this);this.inherited(arguments)}});d.declare("dijit.Dialog",[e.layout.ContentPane,e._DialogBase],{});e._DialogLevelManager={show:function(a,b){var c=e._dialogStack;c[c.length-1].focus=e.getFocus(a);var f=e._underlay;if(!f||f._destroyed)f=e._underlay=new e.DialogUnderlay(b);else f.set(a.underlayAttrs);var g=
c[c.length-1].dialog?c[c.length-1].zIndex+2:950;c.length==1&&f.show();d.style(e._underlay.domNode,"zIndex",g-1);d.style(a.domNode,"zIndex",g);c.push({dialog:a,underlayAttrs:b,zIndex:g})},hide:function(a){var b=e._dialogStack;if(b[b.length-1].dialog==a){b.pop();var c=b[b.length-1];if(b.length==1)e._underlay._destroyed||e._underlay.hide();else{d.style(e._underlay.domNode,"zIndex",c.zIndex-1);e._underlay.set(c.underlayAttrs)}if(a.refocus){b=c.focus;if(!b||c.dialog&&!d.isDescendant(b.node,c.dialog.domNode)){c.dialog._getFocusItems(c.dialog.domNode);
b=c.dialog._firstFocusItem}try{e.focus(b)}catch(f){}}}else{c=d.indexOf(d.map(b,function(g){return g.dialog}),a);c!=-1&&b.splice(c,1)}},isTop:function(a){var b=e._dialogStack;return b[b.length-1].dialog==a}};e._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return e.Dialog});define("text!dijit/form/templates/CheckBox.html",function(){return'<div class="dijit dijitReset dijitInline" role="presentation"\n\t><input\n\t \t${!nameAttrSetting} type="${type}" ${checkedAttrSetting}\n\t\tclass="dijitReset dijitCheckBoxInput"\n\t\tdojoAttachPoint="focusNode"\n\t \tdojoAttachEvent="onclick:_onClick"\n/></div>'});
define("dijit/form/ToggleButton",["dojo","dijit","dijit/form/Button"],function(d,e){return e.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(d,e){d.declare("dijit.form.CheckBox",e.form.ToggleButton,{templateString:d.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:d.delegate(e.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);d.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,b){if(typeof a=="string"){this._set("value",a);d.attr(this.focusNode,"value",a);a=true}this._created&&this.set("checked",a,b)},_getValueAttr:function(){return this.checked?this.value:false},_setLabelAttr:undefined,postMixInProperties:function(){if(this.value=="")this.value="on";this.checkedAttrSetting=this.checked?"checked":"";this.inherited(arguments)},_fillContent:function(){},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||
false);this._set("value",this.params.value||"on");d.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&d.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&d.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){d.stopEvent(a);return false}return this.inherited(arguments)}});d.declare("dijit.form.RadioButton",e.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var b=this;d.query("INPUT[type=radio]",this.focusNode.form||d.doc).forEach(function(c){if(c.name==b.name&&c!=b.focusNode&&c.form==b.focusNode.form)(c=e.getEnclosingWidget(c))&&c.checked&&c.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return e.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(d,e){d.declare("dijit.form.Form",[e._Widget,e._Templated,e.form._FormMixin,e.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:d.delegate(e._Widget.prototype.attributeMap,
{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){this.nameAttrSetting=this.name?"name='"+this.name+"'":"";this.inherited(arguments)},execute:function(){},onExecute:function(){},_setEncTypeAttr:function(a){this.encType=a;d.attr(this.domNode,"encType",a);if(d.isIE)this.domNode.encoding=a},postCreate:function(){if(d.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var a=this.srcNodeRef.attributes.getNamedItem("encType");a&&!a.specified&&typeof a.value==
"string"&&this.set("encType",a.value)}this.inherited(arguments)},reset:function(a){var b={returnValue:true,preventDefault:function(){this.returnValue=false},stopPropagation:function(){},currentTarget:a?a.target:this.domNode,target:a?a.target:this.domNode};this.onReset(b)!==false&&b.returnValue&&this.inherited(arguments,[])},onReset:function(){return true},_onReset:function(a){this.reset(a);d.stopEvent(a);return false},_onSubmit:function(a){var b=e.form.Form.prototype;if(this.execute!=b.execute||this.onExecute!=
b.onExecute){d.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&d.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return e.form.Form});
define("dojo/data/util/filter",["dojo"],function(d){d.getObject("data.util.filter",true,d);d.data.util.filter.patternToRegExp=function(e,a){for(var b="^",c=null,f=0;f<e.length;f++){c=e.charAt(f);switch(c){case "\\":b+=c;f++;b+=e.charAt(f);break;case "*":b+=".*";break;case "?":b+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":b+="\\";default:b+=c}}b+="$";return a?new RegExp(b,"mi"):new RegExp(b,"m")};return d.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(d){d.getObject("data.util.sorter",true,d);d.data.util.sorter.basicComparator=function(e,a){var b=-1;if(e===null)e=undefined;if(a===null)a=undefined;if(e==a)b=0;else if(e>a||e==null)b=1;return b};d.data.util.sorter.createSortFunction=function(e,a){function b(n,p,t,v){return function(r,u){r=v.getValue(r,n);u=v.getValue(u,n);return p*t(r,u)}}for(var c=[],f,g=a.comparatorMap,h=d.data.util.sorter.basicComparator,i=0;i<e.length;i++){f=e[i];var j=f.attribute;
if(j){f=f.descending?-1:1;var l=h;if(g){if(typeof j!=="string"&&"toString"in j)j=j.toString();l=g[j]||h}c.push(b(j,f,l,a))}}return function(n,p){for(var t=0;t<c.length;){var v=c[t++](n,p);if(v!==0)return v}return 0}};return d.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(d){d.getObject("data.util.simpleFetch",true,d);d.data.util.simpleFetch.fetch=function(e){e=e||{};if(!e.store)e.store=this;var a=this,b=function(f,g){if(g.onError)g.onError.call(g.scope||d.global,f,g)},c=function(f,g){var h=g.abort||null,i=false,j=g.start?g.start:0,l=g.count&&g.count!==Infinity?j+g.count:f.length;g.abort=function(){i=true;h&&h.call(g)};var n=g.scope||d.global;if(!g.store)g.store=a;g.onBegin&&g.onBegin.call(n,
f.length,g);g.sort&&f.sort(d.data.util.sorter.createSortFunction(g.sort,a));if(g.onItem)for(var p=j;p<f.length&&p<l;++p){var t=f[p];i||g.onItem.call(n,t,g)}if(g.onComplete&&!i){p=null;g.onItem||(p=f.slice(j,l));g.onComplete.call(n,p,g)}};this._fetchItems(e,c,b);return e};return d.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(d){d.declare("dojo.data.ItemFileReadStore",null,{constructor:function(e){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=e.url;this._jsonData=e.data;this.data=null;this._datatypeMap=e.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return d.date.stamp.fromISOString(a)}});
this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(e.urlPreventCache!==undefined)this.urlPreventCache=e.urlPreventCache?true:false;if(e.hierarchical!==undefined)this.hierarchical=e.hierarchical?true:false;if(e.clearOnClose)this.clearOnClose=true;if("failOk"in e)this.failOk=e.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(e){if(!this.isItem(e))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(e){if(typeof e!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(e,a,b){e=this.getValues(e,a);return e.length>0?e[0]:b},getValues:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);
return(e[a]||[]).slice(0)},getAttributes:function(e){this._assertIsItem(e);var a=[];for(var b in e)b!==this._storeRefPropName&&b!==this._itemNumPropName&&b!==this._rootItemPropName&&b!==this._reverseRefMap&&a.push(b);return a},hasAttribute:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);return a in e},containsValue:function(e,a,b){var c=undefined;if(typeof b==="string")c=d.data.util.filter.patternToRegExp(b,false);return this._containsValue(e,a,b,c)},_containsValue:function(e,a,b,c){return d.some(this.getValues(e,
a),function(f){if(f!==null&&!d.isObject(f)&&c){if(f.toString().match(c))return true}else if(b===f)return true})},isItem:function(e){if(e&&e[this._storeRefPropName]===this)if(this._arrayOfAllItems[e[this._itemNumPropName]]===e)return true;return false},isItemLoaded:function(e){return this.isItem(e)},loadItem:function(e){this._assertIsItem(e.item)},getFeatures:function(){return this._features},getLabel:function(e){if(this._labelAttr&&this.isItem(e))return this.getValue(e,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(e,a,b){var c=this,f=function(j,l){var n=[],p,t;if(j.query){var v;p=j.queryOptions?j.queryOptions.ignoreCase:false;var r={};for(t in j.query){v=j.query[t];if(typeof v==="string")r[t]=d.data.util.filter.patternToRegExp(v,p);else if(v instanceof RegExp)r[t]=v}for(p=0;p<l.length;++p){var u=true,q=l[p];if(q===null)u=false;else for(t in j.query){v=j.query[t];c._containsValue(q,t,v,r[t])||(u=false)}u&&n.push(q)}}else for(p=0;p<l.length;++p){t=l[p];t!==null&&n.push(t)}a(n,
j)};if(this._loadFinished)f(e,this._getItemsArray(e.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){d.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e,
filter:f});else{this._loadInProgress=true;var g=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});g.addCallback(function(j){try{c._getItemsFromLoadedData(j);c._loadFinished=true;c._loadInProgress=false;f(e,c._getItemsArray(e.queryOptions));c._handleQueuedFetches()}catch(l){c._loadFinished=true;c._loadInProgress=false;b(l,e)}});g.addErrback(function(j){c._loadInProgress=false;b(j,e)});var h=null;if(e.abort)h=e.abort;e.abort=function(){g&&
g.fired===-1&&g.cancel();h&&h.call(e)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;f(e,this._getItemsArray(e.queryOptions))}catch(i){b(i,e)}else b(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),e)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var e=0;e<this._queuedFetches.length;e++){var a=this._queuedFetches[e],b=a.args;(a=a.filter)?
a(b,this._getItemsArray(b.queryOptions)):this.fetchItemByIdentity(b)}this._queuedFetches=[]}},_getItemsArray:function(e){if(e&&e.deep)return this._arrayOfAllItems;return this._arrayOfTopLevelItems},close:function(){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null)&&this.data==null)console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch");
this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[]}},_getItemsFromLoadedData:function(e){function a(r){return r!==null&&typeof r==="object"&&(!d.isArray(r)||c)&&!d.isFunction(r)&&(r.constructor==Object||d.isArray(r))&&typeof r._reference==="undefined"&&typeof r._type==="undefined"&&typeof r._value==="undefined"&&f.hierarchical}function b(r){f._arrayOfAllItems.push(r);for(var u in r){var q=r[u];
if(q)if(d.isArray(q))for(var x=0;x<q.length;++x){var z=q[x];a(z)&&b(z)}else a(q)&&b(q)}}var c=false,f=this;this._labelAttr=e.label;var g,h;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=e.items;for(g=0;g<this._arrayOfTopLevelItems.length;++g){h=this._arrayOfTopLevelItems[g];if(d.isArray(h))c=true;b(h);h[this._rootItemPropName]=true}var i={},j;for(g=0;g<this._arrayOfAllItems.length;++g){h=this._arrayOfAllItems[g];for(j in h){if(j!==this._rootItemPropName){var l=h[j];if(l!==null)d.isArray(l)||
(h[j]=[l]);else h[j]=[null]}i[j]=j}}for(;i[this._storeRefPropName];)this._storeRefPropName+="_";for(;i[this._itemNumPropName];)this._itemNumPropName+="_";for(;i[this._reverseRefMap];)this._reverseRefMap+="_";if(i=e.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=i;for(g=0;g<this._arrayOfAllItems.length;++g){h=this._arrayOfAllItems[g];e=h[i];e=e[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,e))if(this._jsonFileUrl)throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+
this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+i+"].  Value collided: ["+e+"]");else{if(this._jsonData)throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+i+"].  Value collided: ["+e+"]");}else this._itemsByIdentity[e]=h}}else this._features["dojo.data.api.Identity"]=Number;for(g=0;g<this._arrayOfAllItems.length;++g){h=this._arrayOfAllItems[g];h[this._storeRefPropName]=
this;h[this._itemNumPropName]=g}for(g=0;g<this._arrayOfAllItems.length;++g){h=this._arrayOfAllItems[g];for(j in h){e=h[j];for(i=0;i<e.length;++i){l=e[i];if(l!==null&&typeof l=="object"){if("_type"in l&&"_value"in l){var n=l._type,p=this._datatypeMap[n];if(p)if(d.isFunction(p))e[i]=new p(l._value);else if(d.isFunction(p.deserialize))e[i]=p.deserialize(l._value);else throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+n+"'");}if(l._reference){l=l._reference;if(d.isObject(l))for(n=0;n<this._arrayOfAllItems.length;++n){p=this._arrayOfAllItems[n];var t=true;for(var v in l)if(p[v]!=l[v])t=false;if(t)e[i]=p}else e[i]=this._getItemByIdentity(l);if(this.referenceIntegrity){l=e[i];this.isItem(l)&&this._addReferenceToMap(l,h,j)}}else this.isItem(l)&&this.referenceIntegrity&&this._addReferenceToMap(l,
h,j)}}}}},_addReferenceToMap:function(){},getIdentity:function(e){var a=this._features["dojo.data.api.Identity"];if(a===Number)return e[this._itemNumPropName];else if(e=e[a])return e[0];return null},fetchItemByIdentity:function(e){var a,b;if(this._loadFinished){a=this._getItemByIdentity(e.identity);if(e.onItem){b=e.scope?e.scope:d.global;e.onItem.call(b,a)}}else{var c=this;if(this._jsonFileUrl!==this._ccUrl){d.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e});else{this._loadInProgress=true;b=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});b.addCallback(function(f){var g=e.scope?e.scope:d.global;try{c._getItemsFromLoadedData(f);
c._loadFinished=true;c._loadInProgress=false;a=c._getItemByIdentity(e.identity);e.onItem&&e.onItem.call(g,a);c._handleQueuedFetches()}catch(h){c._loadInProgress=false;e.onError&&e.onError.call(g,h)}});b.addErrback(function(f){c._loadInProgress=false;if(e.onError)e.onError.call(e.scope?e.scope:d.global,f)})}else if(this._jsonData){c._getItemsFromLoadedData(c._jsonData);c._jsonData=null;c._loadFinished=true;a=c._getItemByIdentity(e.identity);if(e.onItem){b=e.scope?e.scope:d.global;e.onItem.call(b,a)}}}},
_getItemByIdentity:function(e){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,e))a=this._itemsByIdentity[e];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,e))a=this._arrayOfAllItems[e];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var e=this._features["dojo.data.api.Identity"];return e===Number?null:[e]},_forceLoad:function(){var e=this;if(this._jsonFileUrl!==this._ccUrl){d.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl){var a=d.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(b){try{if(e._loadInProgress!==true&&!e._loadFinished){e._getItemsFromLoadedData(b);e._loadFinished=true}else if(e._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(c){console.log(c);throw c;}});a.addErrback(function(b){throw b;})}else if(this._jsonData){e._getItemsFromLoadedData(e._jsonData);e._jsonData=null;e._loadFinished=true}}});d.extend(d.data.ItemFileReadStore,d.data.util.simpleFetch);return d.data.ItemFileReadStore});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(d,e){d.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);d.connect(this,"onKeyPress",d.hitch(this,function(a){a.keyCode===d.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(d.hitch(this,function(){if(d.isDescendant(e._curFocus,
this.domNode))e._curFocus=null;if(d.isDescendant(e._prevFocus,this.domNode))e._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!orion/widgets/templates/NewItemDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemNameLabel" for="${id}_itemName" style="padding-right: 10">${itemNameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 30em; text-align: left;">\n\t\t\t\t\t<input dojoType="dijit.form.ValidationTextBox" dojoAttachPoint="itemName" id="${id}_itemName" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemURLLabel" for="itemURL" style="padding-right: 10">Server Path:</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; width: 40em; text-align: left; padding:5;">\n\t\t\t\t\t<input dojoAttachPoint="itemURL" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo1">\n\t\t\t\t<div style="display: table-cell;"></div>\n\t\t\t\t<div style="display: table-cell;">\n\t\t\t\t\t<input dojoAttachPoint="createCheckbox" id="${id}_createCheckbox" dojoType="dijit.form.CheckBox" checked="checked" value="on" type="checkbox">\n\t\t\t\t\t<label dojoAttachPoint="createCheckboxLabel" for="${id}_createCheckbox">Create if doesn\'t exist</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="newItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/NewItemDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/CheckBox","dijit/form/Form","dijit/form/ValidationTextBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/NewItemDialog.html"],function(d,e){d.declare("orion.widgets.NewItemDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/NewItemDialog.html"),constructor:function(a){this.options=
a||{};this.options.advanced=this.options.advanced||false},postMixInProperties:function(){this.inherited(arguments);this.itemNameLabelText=this.options.label||"Name:"},postCreate:function(){this.inherited(arguments);if(this.options.advanced){this.itemAdvancedInfo.style.display="table-row";this.itemAdvancedInfo1.style.display="table-row";d.connect(this.itemURL,"onkeyup",null,d.hitch(this,this.onURLChange))}else{this.itemAdvancedInfo.style.display="none";this.itemAdvancedInfo1.style.display="none"}},
execute:function(){var a,b;this.newItemButton.focus();if(this.options.advanced){a=this.itemURL.value.replace(/^\s+|\s+$/g,"");b=this.createCheckbox.get("disabled")?false:this.createCheckbox.get("checked")}this.options.func(this.itemName.value,a&&a!==""?a:undefined,b)},onURLChange:function(){var a=this.itemURL.value;if(a.match(/^file:\/\//))this.createCheckbox.set("disabled",false);else a.match(/^[a-zA-Z][a-zA-Z]+:\/\/.+/)?this.createCheckbox.set("disabled",true):this.createCheckbox.set("disabled",
false)}})});define("text!dijit/templates/TreeNode.html",function(){return'<div class="dijitTreeNode" role="presentation"\n\t><div dojoAttachPoint="rowNode" class="dijitTreeRow" role="presentation" dojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick"\n\t\t><img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" role="presentation"\n\t\t/><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" role="presentation"\n\t\t></span\n\t\t><span dojoAttachPoint="contentNode"\n\t\t\tclass="dijitTreeContent" role="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" role="presentation"\n\t\t\t/><span dojoAttachPoint="labelNode" class="dijitTreeLabel" role="treeitem" tabindex="-1" aria-selected="false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer" role="presentation" style="display: none;"></div>\n</div>'});
define("text!dijit/templates/Tree.html",function(){return'<div class="dijitTree dijitTreeContainer" role="tree"\n\tdojoAttachEvent="onkeypress:_onKeyPress">\n\t<div class="dijitInline dijitTreeIndent" style="position: absolute; top: -9999px" dojoAttachPoint="indentDetector"></div>\n</div>'});
define("dojo/DeferredList",["dojo"],function(d){d.DeferredList=function(e,a,b,c){var f=[];d.Deferred.call(this);var g=this;e.length===0&&!a&&this.resolve([0,[]]);var h=0;d.forEach(e,function(i,j){function l(n,p){f[j]=[n,p];h++;h===e.length&&g.resolve(f)}i.then(function(n){a?g.resolve([j,n]):l(true,n)},function(n){b?g.reject(n):l(false,n);if(c)return null;throw n;})})};d.DeferredList.prototype=new d.Deferred;d.DeferredList.prototype.gatherResults=function(e){e=new d.DeferredList(e,false,true,false);
e.addCallback(function(a){var b=[];d.forEach(a,function(c){b.push(c[1])});return b});return e};return d.DeferredList});
define("dojo/regexp",["dojo"],function(d){d.getObject("regexp",true,d);d.regexp.escapeString=function(e,a){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(b){if(a&&a.indexOf(b)!=-1)return b;return"\\"+b})};d.regexp.buildGroupRE=function(e,a,b){if(!(e instanceof Array))return a(e);for(var c=[],f=0;f<e.length;f++)c.push(a(e[f]));return d.regexp.group(c.join("|"),b)};d.regexp.group=function(e,a){return"("+(a?"?:":"")+e+")"};return d.regexp});
define("dojo/cookie",["dojo","dojo/regexp"],function(d){d.cookie=function(e,a,b){var c=document.cookie;if(arguments.length==1){var f=c.match(new RegExp("(?:^|; )"+d.regexp.escapeString(e)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{b=b||{};c=b.expires;if(typeof c=="number"){var g=new Date;g.setTime(g.getTime()+c*24*60*60*1E3);c=b.expires=g}if(c&&c.toUTCString)b.expires=c.toUTCString();a=encodeURIComponent(a);c=e+"="+a;for(f in b){c+="; "+f;g=b[f];if(g!==true)c+="="+g}document.cookie=
c}};d.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return d.cookie});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(d,e){d.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){d.mixin(this,a);this.connects=[];a=this.store;if(!a.getFeatures()["dojo.data.api.Identity"])throw new Error("dijit.Tree: store must support dojo.data.Identity");if(a.getFeatures()["dojo.data.api.Notification"])this.connects=this.connects.concat([d.connect(a,
"onNew",this,"onNewItem"),d.connect(a,"onDelete",this,"onDeleteItem"),d.connect(a,"onSet",this,"onSetItem")])},destroy:function(){d.forEach(this.connects,d.disconnect)},getRoot:function(a,b){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:d.hitch(this,function(c){if(c.length!=1)throw new Error(this.declaredClass+": query "+d.toJson(this.query)+" returned "+c.length+" items, but must return exactly one item");this.root=c[0];a(this.root)}),onError:b})},mayHaveChildren:function(a){return d.some(this.childrenAttrs,
function(b){return this.store.hasAttribute(a,b)},this)},getChildren:function(a,b,c){var f=this.store;if(f.isItemLoaded(a)){for(var g=[],h=0;h<this.childrenAttrs.length;h++){var i=f.getValues(a,this.childrenAttrs[h]);g=g.concat(i)}var j=0;this.deferItemLoadingUntilExpand||d.forEach(g,function(n){f.isItemLoaded(n)||j++});j==0?b(g):d.forEach(g,function(n,p){f.isItemLoaded(n)||f.loadItem({item:n,onItem:function(t){g[p]=t;--j==0&&b(g)},onError:c})})}else{var l=d.hitch(this,arguments.callee);f.loadItem({item:a,
onItem:function(n){l(n,b,c)},onError:c})}},isItem:function(a){return this.store.isItem(a)},fetchItemByIdentity:function(a){this.store.fetchItemByIdentity(a)},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return this.labelAttr?this.store.getValue(a,this.labelAttr):this.store.getLabel(a)},newItem:function(a,b,c){var f={parent:b,attribute:this.childrenAttrs[0]},g;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(h){if(h)this.pasteItem(h,null,b,true,c);else(g=this.store.newItem(a,f))&&c!=undefined&&this.pasteItem(g,b,b,false,c)}});else(g=this.store.newItem(a,f))&&c!=undefined&&this.pasteItem(g,b,b,false,c)},pasteItem:function(a,b,c,f,g){var h=this.store,i=this.childrenAttrs[0];b&&d.forEach(this.childrenAttrs,function(l){if(h.containsValue(b,l,a)){if(!f){var n=d.filter(h.getValues(b,l),function(p){return p!=a});h.setValues(b,l,n)}i=l}});if(c)if(typeof g=="number"){var j=h.getValues(c,i).slice();
j.splice(g,0,a);h.setValues(c,i,j)}else h.setValues(c,i,h.getValues(c,i).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,b){b&&this.getChildren(b.item,d.hitch(this,function(c){this.onChildrenChange(b.item,c)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,b){d.indexOf(this.childrenAttrs,b)!=-1?this.getChildren(a,d.hitch(this,function(c){this.onChildrenChange(a,c)})):this.onChange(a)}});return e.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(d,e){d.declare("dijit.tree.ForestStoreModel",e.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(a){this.root={store:this,root:true,id:a.rootId,label:a.rootLabel,children:a.rootChildren}},mayHaveChildren:function(a){return a===this.root||this.inherited(arguments)},getChildren:function(a,b,c){if(a===this.root)this.root.children?b(this.root.children):this.store.fetch({query:this.query,
onComplete:d.hitch(this,function(f){this.root.children=f;b(f)}),onError:c});else this.inherited(arguments)},isItem:function(a){return a===this.root?true:this.inherited(arguments)},fetchItemByIdentity:function(a){if(a.identity==this.root.id){var b=a.scope?a.scope:d.global;a.onItem&&a.onItem.call(b,this.root)}else this.inherited(arguments)},getIdentity:function(a){return a===this.root?this.root.id:this.inherited(arguments)},getLabel:function(a){return a===this.root?this.root.label:this.inherited(arguments)},
newItem:function(a,b){if(b===this.root){this.onNewRootItem(a);return this.store.newItem(a)}else return this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(a,b,c,f,g){if(b===this.root)f||this.onLeaveRoot(a);e.tree.TreeStoreModel.prototype.pasteItem.call(this,a,b===this.root?null:b,c===this.root?null:c,f,g);c===this.root&&this.onAddToRoot(a)},onAddToRoot:function(a){console.log(this,": item ",a," added to root")},onLeaveRoot:function(a){console.log(this,": item ",a," removed from root")},
_requeryTop:function(){var a=this.root.children||[];this.store.fetch({query:this.query,onComplete:d.hitch(this,function(b){this.root.children=b;if(a.length!=b.length||d.some(a,function(c,f){return b[f]!=c}))this.onChildrenChange(this.root,b)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){d.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return e.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(d){d.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(e,a){this.node=d.byId(e);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&d.byId(a.dropParent);this.map={};this.current=null;this.containerState="";d.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[d.connect(this.node,"onmouseover",this,"onMouseOver"),d.connect(this.node,
"onmouseout",this,"onMouseOut"),d.connect(this.node,"ondragstart",this,"onSelectStart"),d.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(e){return this.map[e]},setItem:function(e,a){this.map[e]=a},delItem:function(e){delete this.map[e]},forInItems:function(e,a){a=a||d.global;var b=this.map,c=d.dnd._empty;for(var f in b)f in c||e.call(a,b[f],f,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return d.query("> .dojoDndItem",this.parent)},
sync:function(){var e={};this.getAllNodes().forEach(function(a){if(a.id){var b=this.getItem(a.id);if(b){e[a.id]=b;return}}else a.id=d.dnd.getUniqueId();b=a.getAttribute("dndType");var c=a.getAttribute("dndData");e[a.id]={data:c||a.innerHTML,type:b?b.split(/\s*,\s*/):["text"]}},this);this.map=e;return this},insertNodes:function(e,a,b){if(this.parent.firstChild)if(a){if(!b)b=this.parent.firstChild}else{if(b)b=b.nextSibling}else b=null;if(b)for(a=0;a<e.length;++a){var c=this._normalizedCreator(e[a]);
this.setItem(c.node.id,{data:c.data,type:c.type});this.parent.insertBefore(c.node,b)}else for(a=0;a<e.length;++a){c=this._normalizedCreator(e[a]);this.setItem(c.node.id,{data:c.data,type:c.type});this.parent.appendChild(c.node)}return this},destroy:function(){d.forEach(this.events,d.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(e,a){e._skipStartup=true;return new d.dnd.Container(a,e)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var e=this.parent.getElementsByTagName("tbody");if(e&&e.length)this.parent=e[0]}}this.defaultCreator=d.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(e){for(var a=e.relatedTarget;a;){if(a==this.node)break;try{a=a.parentNode}catch(b){a=null}}if(!a){this._changeState("Container","Over");this.onOverEvent()}a=this._getChildByEvent(e);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(e){for(e=
e.relatedTarget;e;){if(e==this.node)return;try{e=e.parentNode}catch(a){e=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(e){if(!this.skipForm||!d.dnd.isFormElement(e))d.stopEvent(e)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(e,a){var b="dojoDnd"+e;e=e.toLowerCase()+"State";d.replaceClass(this.node,b+a,b+this[e]);this[e]=a},_addItemClass:function(e,a){d.addClass(e,
"dojoDndItem"+a)},_removeItemClass:function(e,a){d.removeClass(e,"dojoDndItem"+a)},_getChildByEvent:function(e){if(e=e.target)for(var a=e.parentNode;a;e=a,a=e.parentNode)if(a==this.parent&&d.hasClass(e,"dojoDndItem"))return e;return null},_normalizedCreator:function(e,a){e=(this.creator||this.defaultCreator).call(this,e,a);if(!d.isArray(e.type))e.type=["text"];if(!e.node.id)e.node.id=d.dnd.getUniqueId();d.addClass(e.node,"dojoDndItem");return e}});d.dnd._createNode=function(e){if(!e)return d.dnd._createSpan;
return function(a){return d.create(e,{innerHTML:a})}};d.dnd._createTrTd=function(e){var a=d.create("tr");d.create("td",{innerHTML:e},a);return a};d.dnd._createSpan=function(e){return d.create("span",{innerHTML:e})};d.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};d.dnd._defaultCreator=function(e){e=e.tagName.toLowerCase();var a=e=="tbody"||e=="thead"?d.dnd._createTrTd:d.dnd._createNode(d.dnd._defaultCreatorNodes[e]);return function(b,c){var f=b&&d.isObject(b),g;if(f&&b.tagName&&b.nodeType&&
b.getAttribute){g=b.getAttribute("dndData")||b.innerHTML;f=(f=b.getAttribute("dndType"))?f.split(/\s*,\s*/):["text"];b=b}else{g=f&&b.data?b.data:b;f=f&&b.type?b.type:["text"];b=(c=="avatar"?d.dnd._createSpan:a)(String(g))}if(!b.id)b.id=d.dnd.getUniqueId();return{node:b,data:g,type:f}}};return d.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(d,e){d.getObject("tree",true,d);e.tree._compareNodes=function(a,b){if(a===b)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-b.sourceIndex;else if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(b)&2?1:-1;else if(document.createRange){var c=doc.createRange();c.setStartBefore(a);a=doc.createRange();a.setStartBefore(b);return c.compareBoundaryPoints(c.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};d.declare("dijit.tree._dndContainer",null,{constructor:function(a,b){this.tree=a;this.node=a.domNode;d.mixin(this,b);this.map={};this.current=null;this.containerState="";d.addClass(this.node,"dojoDndContainer");this.events=[d.connect(this.node,"onmouseenter",this,"onOverEvent"),d.connect(this.node,"onmouseleave",this,"onOutEvent"),d.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
d.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),d.connect(this.node,"ondragstart",d,"stopEvent"),d.connect(this.node,"onselectstart",d,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){d.forEach(this.events,d.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,b){var c="dojoDnd"+a;a=a.toLowerCase()+"State";d.replaceClass(this.node,c+b,c+this[a]);
this[a]=b},_addItemClass:function(a,b){d.addClass(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){d.removeClass(a,"dojoDndItem"+b)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return e.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(d,e){d.declare("dijit.tree._dndSelector",e.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;e.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(d.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),d.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),d.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],b=this.selection;for(var c in b)a.push(b[c]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,b){this.setSelection(this.getSelectedTreeNodes().concat([a]));if(b)this.anchor=a;return a},removeTreeNode:function(a){this.setSelection(this._setDifference(this.getSelectedTreeNodes(),[a]));return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},
setSelection:function(a){var b=this.getSelectedTreeNodes();d.forEach(this._setDifference(b,a),d.hitch(this,function(c){c.setSelected(false);this.anchor==c&&delete this.anchor;delete this.selection[c.id]}));d.forEach(this._setDifference(a,b),d.hitch(this,function(c){c.setSelected(true);this.selection[c.id]=c}));this._updateSelectionProperties()},_setDifference:function(a,b){d.forEach(b,function(c){c.__exclude__=true});a=d.filter(a,function(c){return!c.__exclude__});d.forEach(b,function(c){delete c.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),b=[],c=[];d.forEach(a,function(f){c.push(f);b.push(f.getTreePath())});a=d.map(c,function(f){return f.item});this.tree._set("paths",b);this.tree._set("path",b[0]||[]);this.tree._set("selectedNodes",c);this.tree._set("selectedNode",c[0]||null);this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onMouseDown:function(a){if(!(!this.current||this.tree.isExpandoNode(a.target,this.current)))if(a.button!=
d.mouseButtons.RIGHT){d.stopEvent(a);var b=this.current,c=d.isCopyKey(a),f=b.id;if(!this.singular&&!a.shiftKey&&this.selection[f])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(b,c,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,d.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,b,c){if(this.singular)if(this.anchor==a&&b)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(c&&this.anchor){c=this.anchor;if(e.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){b=c;a=a}else{b=a;a=c}for(nodes=[];b!=a;){nodes.push(b);b=this.tree._getNextNode(b)}nodes.push(a);this.setSelection(nodes)}else if(this.selection[a.id]&&b)this.removeTreeNode(a);else if(b)this.addTreeNode(a,true);else{this.setSelection([a]);this.anchor=a}},forInSelectedItems:function(a,b){b=b||d.global;for(var c in this.selection)a.call(b,this.getItem(c),c,this)}});return e.tree._dndSelector});
define("dijit/Tree",["dojo","dijit","text!dijit/templates/TreeNode.html","text!dijit/templates/Tree.html","dojo/fx","dojo/DeferredList","dijit/_Widget","dijit/_Templated","dijit/_Container","dijit/_Contained","dijit/_CssStateMixin","dojo/cookie","dijit/tree/TreeStoreModel","dijit/tree/ForestStoreModel","dijit/tree/_dndSelector"],function(d,e){d.declare("dijit._TreeNode",[e._Widget,e._Templated,e._Container,e._Contained,e._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:d.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:d.delegate(e._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&e.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var b=Math.max(a,0)*this.tree._nodePixelIndent+"px";d.style(this.domNode,"backgroundPosition",b+" 0px");d.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",b);d.forEach(this.getChildren(),function(c){c.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="LOADING";this._setExpando(true)},unmarkProcessing:function(){this._setExpando(false)},_updateItemClasses:function(a){var b=this.tree,c=b.model;if(b._v10Compat&&
a===c.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,b,c){var f="_"+b+"Class";b=b+"Node";var g=this[f];this[f]=this.tree["get"+c+"Class"](a,this.isExpanded);d.replaceClass(this[b],this[f]||"",g||"");d.style(this[b],this.tree["get"+c+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?d.addClass(this.domNode,"dijitTreeIsRoot"):
d.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var b=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],c=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;d.replaceClass(this.expandoNode,b[a],b);this.expandoNodeText.innerHTML=c[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;e.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)e.setWaiRole(this.containerNode,"group");d.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","true");var a,b=d.fx.wipeIn({node:this.containerNode,duration:e.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new d.Deferred(function(){b.stop()});b.play();return a},collapse:function(){if(this.isExpanded){if(this._expandDeferred){this._expandDeferred.cancel();
delete this._expandDeferred}this.isExpanded=false;e.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","false");d.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=d.fx.wipeOut({node:this.containerNode,duration:e.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var b=this.tree,c=b.model,f=[];d.forEach(this.getChildren(),
function(g){e._Container.prototype.removeChild.call(this,g)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;d.forEach(a,function(g){var h=c.getIdentity(g),i=b._itemNodesMap[h],j;if(i)for(var l=0;l<i.length;l++)if(i[l]&&!i[l].getParent()){j=i[l];j.set("indent",this.indent+1);break}if(!j){j=this.tree._createTreeNode({item:g,tree:b,isExpandable:c.mayHaveChildren(g),label:b.getLabel(g),tooltip:b.getTooltip(g),dir:b.dir,lang:b.lang,indent:this.indent+1});if(i)i.push(j);else b._itemNodesMap[h]=
[j]}this.addChild(j);if(this.tree.autoExpand||this.tree._state(g))f.push(b._expandNode(j))},this);d.forEach(this.getChildren(),function(g){g._updateLayout()})}else this.isExpandable=false;this._setExpando&&this._setExpando(false);this._updateItemClasses(this.item);if(this==b.rootNode)if(a=this.tree.showRoot?this:this.getChildren()[0]){a.setFocusable(true);b.lastFocused=a}else b.domNode.setAttribute("tabIndex","0");return new d.DeferredList(f)},getTreePath:function(){for(var a=this,b=[];a&&a!==this.tree.rootNode;){b.unshift(a.item);
a=a.getParent()}b.unshift(this.tree.rootNode.item);return b},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(){this.inherited(arguments);var a=this.getChildren();if(a.length==0){this.isExpandable=false;this.collapse()}d.forEach(a,function(b){b._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){e.setWaiState(this.labelNode,"selected",a);
d.toggleClass(this.rowNode,"dijitTreeRowSelected",a)},setFocusable:function(a){this.labelNode.setAttribute("tabIndex",a?"0":"-1")},_onClick:function(a){this.tree._onClick(this,a)},_onDblClick:function(a){this.tree._onDblClick(this,a)},_onMouseEnter:function(a){this.tree._onNodeMouseEnter(this,a)},_onMouseLeave:function(a){this.tree._onNodeMouseLeave(this,a)}});d.declare("dijit.Tree",[e._Widget,e._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:d.cache("dijit","templates/Tree.html"),persist:true,autoExpand:false,dndController:"dijit.tree._dndSelector",dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,
b){d.publish(this.id,[d.mixin({tree:this,event:a},b||{})])},postMixInProperties:function(){this.tree=this;if(this.autoExpand)this.persist=false;this._itemNodesMap={};if(!this.cookieName)this.cookieName=this.id+"SaveStateCookie";this._loadDeferred=new d.Deferred;this.inherited(arguments)},postCreate:function(){this._initState();this.model||this._store2model();this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,
"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(d.isString(this.dndController))this.dndController=d.getObject(this.dndController);for(var a={},b=0;b<this.dndParams.length;b++)if(this[this.dndParams[b]])a[this.dndParams[b]]=this[this.dndParams[b]];this.dndController=new this.dndController(this,a)}},_store2model:function(){this._v10Compat=true;d.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+
"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};if(this.params.mayHaveChildren)a.mayHaveChildren=d.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=d.hitch(this,function(b,c,f){this.getItemChildren(this._v10Compat&&b===this.model.root?null:b,c,f)});this.model=new e.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(d.hitch(this,function(a){var b=this.rootNode=this.tree._createTreeNode({item:a,
tree:this,isExpandable:true,label:this.label||this.getLabel(a),indent:this.showRoot?0:-1});if(!this.showRoot){b.rowNode.style.display="none";e.setWaiRole(this.domNode,"presentation");e.setWaiRole(b.labelNode,"presentation");e.setWaiRole(b.containerNode,"tree")}this.domNode.appendChild(b.domNode);a=this.model.getIdentity(a);if(this._itemNodesMap[a])this._itemNodesMap[a].push(b);else this._itemNodesMap[a]=[b];b._updateLayout();this._expandNode(b).addCallback(d.hitch(this,function(){this._loadDeferred.callback(true);
this.onLoad()}))}),function(a){console.error(this,": error loading root: ",a)})},getNodesByItem:function(a){if(!a)return[];return[].concat(this._itemNodesMap[d.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var b=this;this._loadDeferred.addCallback(d.hitch(this,function(){var c=d.map(a,function(g){return!g||d.isString(g)?g:b.model.getIdentity(g)}),f=[];d.forEach(c,function(g){f=f.concat(b._itemNodesMap[g]||
[])});this.set("selectedNodes",f)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function b(g,h,i){var j=g.shift(),l=d.filter(h,function(n){return n.getIdentity()==j})[0];if(l)g.length?f._expandNode(l).addCallback(function(){b(g,l.getChildren(),i)}):i.callback(l);else i.errback("Could not expand path at "+j)}function c(g){f.set("selectedNodes",d.map(d.filter(g,function(h){return h[0]}),function(h){return h[1]}))}var f=this;return(new d.DeferredList(d.map(a,
function(g){var h=new d.Deferred;g=d.map(g,function(i){return d.isString(i)?i:f.model.getIdentity(i)});g.length?f._loadDeferred.addCallback(function(){b(g,[f.rootNode],h)}):h.errback("Empty path");return h}))).addCallback(c)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(d.hitch(this,function(){this.dndController.setSelection(a)}))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(a){return this.model.getLabel(a)},
getIconClass:function(a,b){return!a||this.model.mayHaveChildren(a)?b?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onKeyPress:function(a){if(!a.altKey){var b=d.keys,c=e.getEnclosingWidget(a.target);if(c){var f=a.charOrCode;if(typeof f=="string"&&f!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:c,
key:f.toLowerCase()});d.stopEvent(a)}}else{if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}var g=this._keyHandlerMap;if(!g){g={};g[b.ENTER]="_onEnterKey";g[b.SPACE]=g[" "]="_onEnterKey";g[this.isLeftToRight()?b.LEFT_ARROW:b.RIGHT_ARROW]="_onLeftArrow";g[this.isLeftToRight()?b.RIGHT_ARROW:b.LEFT_ARROW]="_onRightArrow";g[b.UP_ARROW]="_onUpArrow";g[b.DOWN_ARROW]="_onDownArrow";g[b.HOME]="_onHomeKey";g[b.END]="_onEndKey";this._keyHandlerMap=g}if(this._keyHandlerMap[f]){this[this._keyHandlerMap[f]]({node:c,
item:c.item,evt:a});d.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,d.isCopyKey(a.evt),a.evt.shiftKey);this.onClick(a.item,a.node,a.evt)},_onDownArrow:function(a){(a=this._getNextNode(a.node))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a){a=a.node;var b=a.getPreviousSibling();if(b)for(a=b;a.isExpandable&&a.isExpanded&&a.hasChildren();){a=a.getChildren();a=a[a.length-1]}else{b=a.getParent();!this.showRoot&&
b===this.rootNode||(a=b)}a&&a.isTreeNode&&this.focusNode(a)},_onRightArrow:function(a){a=a.node;if(a.isExpandable&&!a.isExpanded)this._expandNode(a);else if(a.hasChildren())(a=a.getChildren()[0])&&a.isTreeNode&&this.focusNode(a)},_onLeftArrow:function(a){a=a.node;if(a.isExpandable&&a.isExpanded)this._collapseNode(a);else(a=a.getParent())&&a.isTreeNode&&!(!this.showRoot&&a===this.rootNode)&&this.focusNode(a)},_onHomeKey:function(){var a=this._getRootOrFirstNode();a&&this.focusNode(a)},_onEndKey:function(){for(var a=
this.rootNode;a.isExpanded;){a=a.getChildren();a=a[a.length-1]}a&&a.isTreeNode&&this.focusNode(a)},multiCharSearchDuration:250,_onLetterKeyNav:function(a){var b=this._curSearch;if(b){b.pattern+=a.key;clearTimeout(b.timer)}else b=this._curSearch={pattern:a.key,startNode:a.node};var c=this;b.timer=setTimeout(function(){delete c._curSearch},this.multiCharSearchDuration);a=b.startNode;do(a=this._getNextNode(a))||(a=this._getRootOrFirstNode());while(a!==b.startNode&&a.label.toLowerCase().substr(0,b.pattern.length)!=
b.pattern);a&&a.isTreeNode&&a!==b.startNode&&this.focusNode(a)},isExpandoNode:function(a,b){return d.isDescendant(a,b.expandoNode)},_onClick:function(a,b){var c=this.isExpandoNode(b.target,a);if(this.openOnClick&&a.isExpandable||c)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onClick(a.item,a,b);this.focusNode(a)}d.stopEvent(b)},_onDblClick:function(a,b){var c=b.target;c=c==a.expandoNode||c==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
c)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onDblClick(a.item,a,b);this.focusNode(a)}d.stopEvent(b)},_onExpandoClick:function(a){a=a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];else{for(;a&&a.isTreeNode;){var b=a.getNextSibling();
if(b)return b;a=a.getParent()}return null}},_getRootOrFirstNode:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_collapseNode:function(a){a._expandNodeDeferred&&delete a._expandNodeDeferred;if(a.isExpandable)if(a.state!="LOADING"){a.collapse();this.onClose(a.item,a);if(a.item){this._state(a.item,false);this._saveState()}}},_expandNode:function(a,b){if(a._expandNodeDeferred&&!b)return a._expandNodeDeferred;b=this.model;var c=a.item,f=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var g=a._expandNodeDeferred=new d.Deferred;b.getChildren(c,function(h){a.unmarkProcessing();h=a.setChildItems(h);var i=f._expandNode(a,true);h.addCallback(function(){i.addCallback(function(){g.callback()})})},function(h){console.error(f,": error loading root children: ",h)});break;default:g=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(c){this._state(c,true);this._saveState()}}return g},focusNode:function(a){e.focus(a.labelNode)},_onNodeFocus:function(a){if(a&&a!=this.lastFocused){this.lastFocused&&
!this.lastFocused._destroyed&&this.lastFocused.setFocusable(false);a.setFocusable(true);this.lastFocused=a}},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var b=this._itemNodesMap[this.model.getIdentity(a)];if(b){var c=this.getLabel(a),f=this.getTooltip(a);d.forEach(b,function(g){g.set({item:a,label:c,tooltip:f});g._updateItemClasses(a)})}},_onItemChildrenChange:function(a,b){(a=this._itemNodesMap[this.model.getIdentity(a)])&&d.forEach(a,function(c){c.setChildItems(b)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var b=this._itemNodesMap[a];if(b){d.forEach(b,function(c){this.dndController.removeTreeNode(c);var f=c.getParent();f&&f.removeChild(c);c.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=d.cookie(this.cookieName);this._openedItemIds={};a&&d.forEach(a.split(","),function(b){this._openedItemIds[b]=true},this)}},_state:function(a,b){if(!this.persist)return false;var c=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[c];if(b)this._openedItemIds[c]=true;else delete this._openedItemIds[c]},_saveState:function(){if(this.persist){var a=[];for(var b in this._openedItemIds)a.push(b);d.cookie(this.cookieName,a.join(","),{expires:365})}},destroy:function(){if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!d.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&d.marginBox(this.domNode,a);this._nodePixelIndent=d._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new e._TreeNode(a)}});return e.Tree});define("text!orion/widgets/templates/_ExplorerTreeNode.html",function(){return'<div class="dijitTreeNode" waiRole="presentation">\n\t<div dojoAttachPoint="rowNode" class="dijitTreeRow"\n\t\twaiRole="presentation"\n\t\tdojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick">\n\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" />\n\t\t<span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation"></span>\n\t\t<span dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" waiRole="presentation" />\n\t\t\t<!-- labelNode\'s innerText will be label string --\>\n\t\t\t<span dojoAttachPoint="labelNode" class="dijitTreeLabel" wairole="treeitem" tabindex="-1" waiState="selected-false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t\t<a href="" dojoAttachPoint="followLink"><img src="${_blankGif}" alt="" dojoAttachPoint="followNode" class="dijitIcon dijitTreeIcon follow" waiRole="link"></a>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer"\n\t\twaiRole="presentation" style="display: none;">\n\t</div>\n</div>'});
define("orion/widgets/ExplorerTree",["dojo","dijit","dijit/Tree","text!orion/widgets/templates/_ExplorerTreeNode.html"],function(d,e){d.declare("orion.widgets._ExplorerTreeNode",[e._TreeNode],{templateString:d.cache("orion","widgets/templates/_ExplorerTreeNode.html"),_updateItemClasses:function(a){this.inherited(arguments);this._applyClassAndStyle(a,"follow","Follow");typeof this.tree.updateFollowLink==="function"&&this.tree.updateFollowLink(a,this.followLink)}});d.declare("orion.widgets.ExplorerTree",
[e.Tree],{selectedNodes:{},postCreate:function(){d.connect(this,"onMouseDown",this._eatSelectionEvent);d.connect(this.domNode,"onselectstart",this._eatSelectionEvent);this.inherited(arguments)},getFollowClass:function(){},getFollowStyle:function(){},updateFollowLink:function(){},onFollowClick:function(){},getSelectedItems:function(){var a=[];this._forEachSelectedNode(function(b,c){a.push(c.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(b,c){a.push(c)});
return a},_forEachSelectedNode:function(a){var b=this.selectedNodes;for(var c in b)b.hasOwnProperty(c)&&a(c,b[c])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(d.isCopyKey(a)||a.shiftKey)d.stopEvent(a)},_onClick:function(a,b){var c=b.target,f=c===a.expandoNode||c===a.expandoNodeText;c=c===a.followNode;if(d.isCopyKey(b)){this._toggleSelectNode(a);this.focusNode(a)}else if(b.shiftKey){if(this.selectedNode){this._selectRange(this.selectedNode,
a);this.focusNode(a)}}else{if(c)this.onFollowClick(a.item,a,b);else if(this.openOnClick&&a.isExpandable||f)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onClick(a.item,a,b);this.focusNode(a)}!f&&!c&&this._selectNode(a)}c||d.stopEvent(b)},_onItemDelete:function(a){var b=this._itemNodesMap[this.model.getIdentity(a)];if(b){var c=this;d.forEach(b,function(f){c._removeFromSelection(f)})}this.inherited(arguments)},_getVisibleAncestor:function(a){if(!a)return null;
for(var b=a.getParent();b&&!(b.isExpandable&&b.isExpanded);){a=b;b=b.getParent()}return a},_toggleSelectNode:function(a){if(this.selectedNodes[a.get("id")]){a.setSelected(false);this._removeFromSelection(a)}else{a.setSelected(true);this._addToSelection(a)}},_addToSelection:function(a){this.selectedNodes[a.get("id")]=a},_removeFromSelection:function(a){delete this.selectedNodes[a.get("id")]},_selectRange:function(a,b){function c(h,i){var j=[];h=h;do{j.push(h);h=f._getNextNode(h)}while(h&&h!==i);if(h===
i){j.push(i);return j}return null}a=this._getVisibleAncestor(a);b=this._getVisibleAncestor(b);if(a&&b)if(a===b)this._selectNode(a);else{var f=this,g=c(a,b);if(g)this._selectNodes(g.reverse(),true);else(g=c(b,a))?this._selectNodes(g,true):console.debug("Warning: couldn't select range from "+a.label+" to "+b.label)}},_selectNode:function(a){this._selectNodes(a?[a]:null)},_selectNodes:function(a){this._forEachSelectedNode(function(f,g){g._destroyed||g.setSelected(false)});this.selectedNodes={};if(a)for(var b=
0;b<a.length;b++){var c=a[b];c.setSelected(true);this._addToSelection(c);this.selectedNode=c}}})});define("text!orion/widgets/templates/DirectoryPrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="messageCell">\n\t\t\t\t\t<div style="display: table-cell;"><div style="width: 25em; padding-bottom: 5px;">${message}</div></div>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseDirectoryExplorerTree" class="explorerTreeClass" id="${id}_browseDirectoryExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div> \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="directoryBrowserButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/widgets/DirectoryPrompterDialog",["dojo","dijit","orion/util","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/DirectoryPrompterDialog.html"],function(d,e,a){d.declare("orion.widgets.DirectoryPrompterDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/DirectoryPrompterDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.buttonOk="OK";this.message=this.options.message||""},postCreate:function(){this.inherited(arguments);this.loadFolderList("/");this.message||d.style(this.messageCell,{display:"none"})},loadFolderList:function(b){b=a.makeRelative(b);this.treeRoot.Location=b;this.options.fileClient.loadWorkspace(b).then(d.hitch(this,function(c){for(var f in c)this.treeRoot[f]=
c[f];a.processNavigatorParent(this.treeRoot,c.Children);this.createTree()}))},createTree:function(){var b=new orion.widgets.DirectoryTreeModel(this.options.serviceRegistry,this.treeRoot,this.options.fileClient);this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:b,showRoot:false,persist:true,openOnClick:false,getLabel:function(c){return c.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();d.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
execute:function(){var b=this.treeWidget.getSelectedItems();this.onHide();this.options.func(b[0])}});orion.widgets.DirectoryTreeModel=function(){function b(c,f,g){this.registry=c;this.root=f;this.fileClient=g}b.prototype={destroy:function(){},getRoot:function(c){c(this.root)},mayHaveChildren:function(){return true},getChildren:function(c,f){if(c.children)f(c.children);else if(c.Directory!==undefined&&c.Directory===false)f([]);else c.Location?this.fileClient.fetchChildren(c.ChildrenLocation).then(d.hitch(this,
function(g){for(var h=[],i=0;i<g.length;i++)g[i].Directory&&h.push(g[i]);a.processNavigatorParent(c,h);f(h)})):f([])},getIdentity:function(c){return c.Name?c.Location:"ROOT"},getLabel:function(c){return c.Name},onChildrenChange:function(){}};return b}()});define("dojox",["dojo"],function(d){return dojox=d._dojox||{}});
define("dojox/form/uploader/Base",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(d,e){d.declare("dojox.form.uploader.Base",[e._Widget,e._Templated],{getForm:function(){if(!this.form)for(var a=this.domNode;a&&a.tagName&&a!==document.body;){if(a.tagName.toLowerCase()=="form"){this.form=a;break}a=a.parentNode}return this.form},getUrl:function(){if(this.uploadUrl)this.url=this.uploadUrl;if(this.url)return this.url;if(this.getForm())this.url=this.form.action;
return this.url},connectForm:function(){this.url=this.getUrl();if(!this._fcon&&this.getForm()){this._fcon=true;this.connect(this.form,"onsubmit",function(a){d.stopEvent(a);this.submit(d.formToObject(this.form))})}},supports:function(a){if(!this._hascache){this._hascache={testDiv:d.create("div"),testInput:d.create("input",{type:"file"}),xhr:window.XMLHttpRequest?new XMLHttpRequest:{}};d.style(this._hascache.testDiv,"opacity",0.7)}switch(a){case "FormData":return!!window.FormData;case "sendAsBinary":return!!this._hascache.xhr.sendAsBinary;
case "opacity":return d.style(this._hascache.testDiv,"opacity")==0.7;case "multiple":if(this.force=="flash"||this.force=="iframe")return false;a=d.attr(this._hascache.testInput,"multiple");return a===true||a===false}return false},getMimeType:function(){return"application/octet-stream"},getFileType:function(a){return a.substring(a.lastIndexOf(".")+1).toUpperCase()},convertBytes:function(a){var b=Math.round(a/1024*1E5)/1E5,c=Math.round(a/1048576*1E5)/1E5,f=Math.round(a/1073741824*1E5)/1E5,g=a;if(b>
1)g=b.toFixed(1)+" kb";if(c>1)g=c.toFixed(1)+" mb";if(f>1)g=f.toFixed(1)+" gb";return{kb:b,mb:c,gb:f,bytes:a,value:g}}})});
define("dojox/form/Uploader",["dojo","dijit","dojox","dojox/form/uploader/Base"],function(d,e,a){d.declare("dojox.form.Uploader",[a.form.uploader.Base],{uploadOnSelect:false,tabIndex:0,multiple:false,label:"Upload...",url:"",name:"uploadedfile",flashFieldName:"",uploadType:"form",_nameIndex:0,widgetsInTemplate:true,templateString:'<div class="dojoxFileInput"><div dojoType="dijit.form.Button" dojoAttachPoint="button">${label}</div></div>',postMixInProperties:function(){this._inputs=[];this._getButtonStyle(this.srcNodeRef);
this.inherited(arguments)},postCreate:function(){var b=false,c=this._getNodePosition(this.domNode);if(!this.btnSize.w||!this.btnSize.h){d.body().appendChild(this.domNode);this._getButtonStyle(this.domNode);b=true}this._setButtonStyle();b&&d.place(this.domNode,c.node,c.pos);this.inherited(arguments)},onChange:function(){},onBegin:function(){},onProgress:function(){},onComplete:function(){this.reset()},onCancel:function(){},onAbort:function(){},onError:function(){},upload:function(){},submit:function(){},
reset:function(){this._disconnectButton();d.forEach(this._inputs,d.destroy,d);this._inputs=[];this._nameIndex=0;this._createInput()},getFileList:function(){var b=[];this.supports("multiple")?d.forEach(this.inputNode.files,function(c,f){b.push({index:f,name:c.name,size:c.size,type:c.type})},this):d.forEach(this._inputs,function(c,f){b.push({index:f,name:c.value.substring(c.value.lastIndexOf("\\")+1),size:0,type:c.value.substring(c.value.lastIndexOf(".")+1)})},this);return b},_getValueAttr:function(){return this.getFileList()},
_setValueAttr:function(){console.error("Uploader value is read only")},_getDisabledAttr:function(){return this._disabled},_setDisabledAttr:function(b){if(this._disabled!=b){this.button.set("disabled",b);d.style(this.inputNode,"display",b?"none":"block")}},_getNodePosition:function(b){if(b.previousSibling)return{node:b.previousSibling,pos:"after"};return{node:b.nextSibling,pos:"before"}},_getButtonStyle:function(b){this.btnSize=b?d.marginBox(b):{w:80,h:25}},_setButtonStyle:function(){var b=true;if(!this.domNode.parentNode||
!this.domNode.parentNode.tagName){document.body.appendChild(this.domNode);b=false}d.style(this.domNode,{width:this.btnSize.w+"px",height:this.btnSize.h+4+"px",overflow:"hidden",position:"relative"});this.inputNodeFontSize=Math.max(2,Math.max(Math.ceil(this.btnSize.w/60),Math.ceil(this.btnSize.h/15)));this._createInput();d.style(this.button.domNode,{margin:"0px",display:"block",verticalAlign:"top"});d.style(this.button.domNode.firstChild,{margin:"0px",display:"block"});b||document.body.removeChild(this.domNode)},
_createInput:function(){if(this._inputs.length){d.style(this.inputNode,{top:"500px"});this._disconnectButton();this._nameIndex++}var b;b=this.supports("multiple")?this.name+"s[]":this.name+(this.multiple?this._nameIndex:"");this.inputNode=d.create("input",{type:"file",name:b,className:"dojoxInputNode"},this.domNode,"first");this.supports("multiple")&&this.multiple&&d.attr(this.inputNode,"multiple",true);this._inputs.push(this.inputNode);d.style(this.inputNode,{fontSize:this.inputNodeFontSize+"em"});
b=d.marginBox(this.inputNode);d.style(this.inputNode,{position:"absolute",top:"-2px",left:"-"+(b.w-this.btnSize.w-2)+"px",opacity:0});this._connectButton()},_connectButton:function(){this._cons=[];var b=d.hitch(this,function(f){this._cons.push(d.connect(this.inputNode,f,this,function(){this.button._cssMouseEvent({type:f})}))});b("mouseover");b("mouseout");b("mousedown");this._cons.push(d.connect(this.inputNode,"change",this,function(f){this.onChange(this.getFileList(f));!this.supports("multiple")&&
this.multiple&&this._createInput()}));this.button.set("tabIndex",-1);if(this.tabIndex>-1){this.inputNode.tabIndex=this.tabIndex;var c=d.style(this.button.domNode.firstChild,"border");this._cons.push(d.connect(this.inputNode,"focus",this,function(){d.style(this.button.domNode.firstChild,"border","1px dashed #ccc")}));this._cons.push(d.connect(this.inputNode,"blur",this,function(){d.style(this.button.domNode.firstChild,"border",c)}))}},_disconnectButton:function(){d.forEach(this._cons,d.disconnect,
d)}});(function(){a.form.UploaderOrg=a.form.Uploader;var b=[a.form.UploaderOrg];a.form.addUploaderPlugin=function(c){b.push(c);d.declare("dojox.form.Uploader",b,{})}})()});
define("dojox/form/uploader/FileList",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(d,e,a){d.declare("dojox.form.uploader.FileList",[a.form.uploader.Base],{uploaderId:"",uploader:null,headerIndex:"#",headerType:"Type",headerFilename:"File Name",headerFilesize:"Size",_upCheckCnt:0,rowAmt:0,templateString:'<div class="dojoxUploaderFileList"><div dojoAttachPoint="progressNode" class="dojoxUploaderFileListProgress"><div dojoAttachPoint="percentBarNode" class="dojoxUploaderFileListProgressBar"></div><div dojoAttachPoint="percentTextNode" class="dojoxUploaderFileListPercentText">0%</div></div><table class="dojoxUploaderFileListTable"><tr class="dojoxUploaderFileListHeader"><th class="dojoxUploaderIndex">${headerIndex}</th><th class="dojoxUploaderIcon">${headerType}</th><th class="dojoxUploaderFileName">${headerFilename}</th><th class="dojoxUploaderFileSize">${headerFilesize}</th></tr><tr ><td colSpan="4" class="dojoxUploaderFileListContainer" dojoAttachPoint="containerNode"><table class="dojoxUploaderFileListContent" dojoAttachPoint="listNode"></table></td><tr></table><div>',
postCreate:function(){this.setUploader();this.hideProgress()},reset:function(){for(var b=0;b<this.rowAmt;b++)this.listNode.deleteRow(0);this.rowAmt=0},setUploader:function(){if(!this.uploaderId&&!this.uploader)console.warn("uploaderId not passed to UploaderFileList");else if(this.uploaderId&&!this.uploader)this.uploader=e.byId(this.uploaderId);else if(this._upCheckCnt>4){console.warn("uploader not found for ID ",this.uploaderId);return}if(this.uploader){this.connect(this.uploader,"onChange","_onUploaderChange");
this.connect(this.uploader,"reset","reset");this.connect(this.uploader,"onBegin",function(){this.showProgress(true)});this.connect(this.uploader,"onProgress","_progress");this.connect(this.uploader,"onComplete",function(){setTimeout(d.hitch(this,function(){this.hideProgress(true)}),1250)})}else{this._upCheckCnt++;setTimeout(d.hitch(this,"setUploader"),250)}},hideProgress:function(b){this._hideShowProgress(b?{ani:true,endDisp:"none",beg:15,end:0}:{endDisp:"none",ani:false})},showProgress:function(b){this._hideShowProgress(b?
{ani:true,endDisp:"block",beg:0,end:15}:{endDisp:"block",ani:false})},_progress:function(b){this.percentTextNode.innerHTML=b.percent;d.style(this.percentBarNode,"width",b.percent)},_hideShowProgress:function(b){var c=this.progressNode,f=function(){d.style(c,"display",b.endDisp)};if(b.ani){d.style(c,"display","block");d.animateProperty({node:c,properties:{height:{start:b.beg,end:b.end,units:"px"}},onEnd:f}).play()}else f()},_onUploaderChange:function(b){this.reset();d.forEach(b,function(c,f){this._addRow(f+
1,this.getFileType(c.name),c.name,c.size)},this)},_addRow:function(b,c,f,g){var h,i=this.listNode.insertRow(-1);h=i.insertCell(-1);d.addClass(h,"dojoxUploaderIndex");h.innerHTML=b;h=i.insertCell(-1);d.addClass(h,"dojoxUploaderIcon");h.innerHTML=c;h=i.insertCell(-1);d.addClass(h,"dojoxUploaderFileName");h.innerHTML=f;h=i.insertCell(-1);d.addClass(h,"dojoxUploaderSize");h.innerHTML=this.convertBytes(g).value;this.rowAmt++}})});
define("dojo/io/iframe",["dojo"],function(d){d.getObject("io",true,d);d.io.iframe={create:function(e,a,b){if(window[e])return window[e];if(window.frames[e])return window.frames[e];var c=null;b=b;if(!b){d.config.useXDomain&&!d.config.dojoBlankHtmlUrl&&console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");b=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo",
"resources/blank.html")}c=d.place('<iframe id="'+e+'" name="'+e+'" src="'+b+'" onload="'+a+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',d.body());return window[e]=c},setSrc:function(e,a,b){try{if(b){var c;if(c=d.isIE||d.isWebKit?e.contentWindow.document:e.contentWindow)c.location.replace(a);else e.location=a}else if(d.isWebKit)e.location=a;else frames[e.name].location=a}catch(f){console.log("dojo.io.iframe.setSrc: ",f)}},doc:function(e){return e.contentDocument||
e.name&&e.document&&d.doc.getElementsByTagName("iframe")[e.name].contentWindow&&d.doc.getElementsByTagName("iframe")[e.name].contentWindow.document||e.name&&d.doc.frames[e.name]&&d.doc.frames[e.name].document||null},send:function(e){if(!this._frame)this._frame=this.create(this._iframeName,d._scopeName+".io.iframe._iframeOnload();");e=d._ioSetArgs(e,function(a){a.canceled=true;a.ioArgs._callNext()},function(a){var b=null;try{var c=a.ioArgs,f=d.io.iframe,g=f.doc(f._frame),h=c.handleAs;b=g;if(h!="html")if(h==
"xml"){if(d.isIE<9||d.isIE&&d.isQuirks){d.query("a",f._frame.contentWindow.document.documentElement).orphan();var i=f._frame.contentWindow.document.documentElement.innerText;i=i.replace(/>\s+</g,"><");i=d.trim(i);b=d._contentHandlers.xml({responseText:i})}}else{b=g.getElementsByTagName("textarea")[0].value;if(h=="json")b=d.fromJson(b);else if(h=="javascript")b=d.eval(b)}}catch(j){b=j}finally{c._callNext()}return b},function(a,b){b.ioArgs._hasError=true;b.ioArgs._callNext();return a});e.ioArgs._callNext=
function(){if(!this._calledNext){this._calledNext=true;d.io.iframe._currentDfd=null;d.io.iframe._fireNextRequest()}};this._dfdQueue.push(e);this._fireNextRequest();d._ioWatch(e,function(a){return!a.ioArgs._hasError},function(a){return!!a.ioArgs._finished},function(a){a.ioArgs._finished?a.callback(a):a.errback(new Error("Invalid dojo.io.iframe request state"))});return e},_currentDfd:null,_dfdQueue:[],_iframeName:d._scopeName+"IoIframe",_fireNextRequest:function(){try{if(!(this._currentDfd||this._dfdQueue.length==
0)){do var e=this._currentDfd=this._dfdQueue.shift();while(e&&e.canceled&&this._dfdQueue.length);if(!e||e.canceled)this._currentDfd=null;else{var a=e.ioArgs,b=a.args;a._contentToClean=[];var c=d.byId(b.form),f=b.content||{};if(c){if(f){var g=function(v,r){d.create("input",{type:"hidden",name:v,value:r},c);a._contentToClean.push(v)};for(var h in f){var i=f[h];if(d.isArray(i)&&i.length>1){var j;for(j=0;j<i.length;j++)g(h,i[j])}else if(c[h])c[h].value=i;else g(h,i)}}var l=c.getAttributeNode("action"),
n=c.getAttributeNode("method"),p=c.getAttributeNode("target");if(b.url){a._originalAction=l?l.value:null;if(l)l.value=b.url;else c.setAttribute("action",b.url)}if(!n||!n.value)if(n)n.value=b.method?b.method:"post";else c.setAttribute("method",b.method?b.method:"post");a._originalTarget=p?p.value:null;if(p)p.value=this._iframeName;else c.setAttribute("target",this._iframeName);c.target=this._iframeName;d._ioNotifyStart(e);c.submit()}else{g=b.url+(b.url.indexOf("?")>-1?"&":"?")+a.query;d._ioNotifyStart(e);
this.setSrc(this._frame,g,true)}}}}catch(t){e.errback(t)}},_iframeOnload:function(){var e=this._currentDfd;if(e){e=e.ioArgs;var a=d.byId(e.args.form);if(a){for(var b=e._contentToClean,c=0;c<b.length;c++)for(var f=b[c],g=0;g<a.childNodes.length;g++){var h=a.childNodes[g];if(h.name==f){d.destroy(h);break}}e._originalAction&&a.setAttribute("action",e._originalAction);if(e._originalTarget){a.setAttribute("target",e._originalTarget);a.target=e._originalTarget}}e._finished=true}else this._fireNextRequest()}};
return d.io.iframe});
define("dojox/form/uploader/plugins/HTML5",["dojo","dijit","dojox","dojox/form/Uploader"],function(d,e,a){d.declare("dojox.form.uploader.plugins.HTML5",[],{errMsg:"Error uploading files. Try checking permissions",uploadType:"html5",postCreate:function(){this.connectForm();this.inherited(arguments);this.uploadOnSelect&&this.connect(this,"onChange","upload")},upload:function(b){this.onBegin(this.getFileList());if(this.supports("FormData"))this.uploadWithFormData(b);else this.supports("sendAsBinary")&&this.sendAsBinary(b)},
submit:function(b){b=b?b.tagName?b:this.getForm():this.getForm();b=d.formToObject(b);console.log("form data:",b);this.upload(b)},sendAsBinary:function(b){if(this.getUrl()){var c="---------------------------"+(new Date).getTime(),f=this.createXhr();f.setRequestHeader("Content-Type","multipart/form-data; boundary="+c);(b=this._buildRequestBody(b,c))?f.sendAsBinary(b):this.onError(this.errMsg)}else console.error("No upload url found.",this)},uploadWithFormData:function(b){if(this.getUrl()){var c=new FormData;
d.forEach(this.inputNode.files,function(g){c.append(this.name+"s[]",g)},this);if(b)for(var f in b)c.append(f,b[f]);this.createXhr().send(c)}else console.error("No upload url found.",this)},_xhrProgress:function(b){if(b.lengthComputable){var c={bytesLoaded:b.loaded,bytesTotal:b.total,type:b.type,timeStamp:b.timeStamp};if(b.type=="load"){c.percent="100%";c.decimal=1}else{c.decimal=b.loaded/b.total;c.percent=Math.ceil(b.loaded/b.total*100)+"%"}this.onProgress(c)}},createXhr:function(){var b=new XMLHttpRequest,
c;b.upload.addEventListener("progress",d.hitch(this,"_xhrProgress"),false);b.addEventListener("load",d.hitch(this,"_xhrProgress"),false);b.addEventListener("error",d.hitch(this,function(f){this.onError(f);clearInterval(c)}),false);b.addEventListener("abort",d.hitch(this,function(f){this.onAbort(f);clearInterval(c)}),false);b.onreadystatechange=d.hitch(this,function(){if(b.readyState===4){console.info("COMPLETE");clearInterval(c);this.onComplete(d.eval(b.responseText))}});b.open("POST",this.getUrl());
c=setInterval(d.hitch(this,function(){}),250);return b},_buildRequestBody:function(b,c){var f="";c="--"+c;var g=[];d.forEach(this.inputNode.files,function(i,j){i=this.name+"s[]";var l=this.inputNode.files[j].fileName,n;try{n=this.inputNode.files[j].getAsBinary()+"\r\n";f+=c+"\r\n";f+="Content-Disposition: form-data; ";f+='name="'+i+'"; ';f+='filename="'+l+'"\r\n';f+="Content-Type: "+this.getMimeType()+"\r\n\r\n";f+=n}catch(p){g.push({index:j,name:l})}},this);if(g.length)if(g.length>=this.inputNode.files.length){this.onError({message:this.errMsg,
filesInError:g});f=false}if(!f)return false;if(b)for(var h in b){f+=c+"\r\n";f+="Content-Disposition: form-data; ";f+='name="'+h+'"\r\n\r\n';f+=b[h]+"\r\n"}f+=c+"--\r\n";return f}});a.form.addUploaderPlugin(a.form.uploader.plugins.HTML5)});
define("dojox/form/uploader/plugins/IFrame",["dojo","dijit","dojox","dojo/io/iframe","dojox/form/uploader/plugins/HTML5","dojox/form/Uploader"],function(d,e,a){d.declare("dojox.form.uploader.plugins.IFrame",[],{force:"",postMixInProperties:function(){this.inherited(arguments);if(!this.supports("multiple"))this.uploadType="iframe"},upload:function(b){if(!this.supports("multiple")||this.force=="iframe"){this.uploadIFrame(b);d.stopEvent(b)}},uploadIFrame:function(){this.getUrl();d.io.iframe.send({url:this.getUrl(),
form:this.form,handleAs:"json",error:d.hitch(this,function(b){console.error("HTML Upload Error:"+b.message)}),load:d.hitch(this,function(b){this.onComplete(b)})})}});a.form.addUploaderPlugin(a.form.uploader.plugins.IFrame)});define("text!dijit/templates/ProgressBar.html",function(){return'<div class="dijitProgressBar dijitProgressBarEmpty" role="progressbar"\n\t><div  dojoAttachPoint="internalProgress" class="dijitProgressBarFull"\n\t\t><div class="dijitProgressBarTile" role="presentation"></div\n\t\t><span style="visibility:hidden">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint="labelNode" class="dijitProgressBarLabel" id="${id}_label"></div\n\t><img dojoAttachPoint="indeterminateHighContrastImage" class="dijitProgressBarIndeterminateHighContrastImage" alt=""\n/></div>'});
define("dojo/cldr/nls/number",{root:{scientificFormat:"#E0","currencySpacing-afterCurrency-currencyMatch":"[:letter:]",infinity:"\u221e",list:";",percentSign:"%",minusSign:"-","currencySpacing-beforeCurrency-surroundingMatch":"[:digit:]","decimalFormat-short":"000T","currencySpacing-afterCurrency-insertBetween":"\u00a0",nan:"NaN",nativeZeroDigit:"0",plusSign:"+","currencySpacing-afterCurrency-surroundingMatch":"[:digit:]","currencySpacing-beforeCurrency-currencyMatch":"[:letter:]",currencyFormat:"\u00a4\u00a0#,##0.00",
perMille:"\u2030",group:",",percentFormat:"#,##0%",decimalFormat:"#,##0.###",decimal:".",patternDigit:"#","currencySpacing-beforeCurrency-insertBetween":"\u00a0",exponential:"E"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true});
define("dojo/cldr/nls/en/number",{group:",",percentSign:"%",exponential:"E",scientificFormat:"#E0",percentFormat:"#,##0%",list:";",infinity:"\u221e",patternDigit:"#",minusSign:"-",decimal:".",nan:"NaN",nativeZeroDigit:"0",perMille:"\u2030",decimalFormat:"#,##0.###",currencyFormat:"\u00a4#,##0.00;(\u00a4#,##0.00)",plusSign:"+","decimalFormat-short":"000T"});
define("dojo/number",["dojo","dojo/i18n","i18n!dojo/cldr/nls/number","dojo/string","dojo/regexp"],function(d){d.getObject("number",true,d);d.number.format=function(e,a){a=d.mixin({},a||{});var b=d.i18n.normalizeLocale(a.locale);b=d.i18n.getLocalization("dojo.cldr","number",b);a.customs=b;b=a.pattern||b[(a.type||"decimal")+"Format"];if(isNaN(e)||Math.abs(e)==Infinity)return null;return d.number._applyPattern(e,b,a)};d.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;d.number._applyPattern=function(e,
a,b){b=b||{};var c=b.customs.group,f=b.customs.decimal;a=a.split(";");var g=a[0];a=a[e<0?1:0]||"-"+g;if(a.indexOf("%")!=-1)e*=100;else if(a.indexOf("\u2030")!=-1)e*=1E3;else if(a.indexOf("\u00a4")!=-1){c=b.customs.currencyGroup||c;f=b.customs.currencyDecimal||f;a=a.replace(/\u00a4{1,3}/,function(i){return b[["symbol","currency","displayName"][i.length-1]]||b.currency||""})}else if(a.indexOf("E")!=-1)throw new Error("exponential notation not supported");var h=d.number._numberPatternRE;g=g.match(h);
if(!g)throw new Error("unable to find a number expression in pattern: "+a);if(b.fractional===false)b.places=0;return a.replace(h,d.number._formatAbsolute(e,g[0],{decimal:f,group:c,places:b.places,round:b.round}))};d.number.round=function(e,a,b){b=10/(b||10);return(b*+e).toFixed(a)/b};(0.9).toFixed()==0&&function(){var e=d.number.round;d.number.round=function(a,b,c){var f=Math.pow(10,-b||0),g=Math.abs(a);if(!a||g>=f||g*Math.pow(10,b+1)<5)f=0;return e(a,b,c)+(a>0?f:-f)}}();d.number._formatAbsolute=
function(e,a,b){b=b||{};if(b.places===true)b.places=0;if(b.places===Infinity)b.places=6;a=a.split(".");var c=typeof b.places=="string"&&b.places.indexOf(","),f=b.places;if(c)f=b.places.substring(c+1);else if(!(f>=0))f=(a[1]||[]).length;b.round<0||(e=d.number.round(e,f,b.round));e=String(Math.abs(e)).split(".");var g=e[1]||"";if(a[1]||b.places){if(c)b.places=b.places.substring(0,c);c=b.places!==undefined?b.places:a[1]&&a[1].lastIndexOf("0")+1;if(c>g.length)e[1]=d.string.pad(g,c,"0",true);if(f<g.length)e[1]=
g.substr(0,f)}else e[1]&&e.pop();f=a[0].replace(",","");c=f.indexOf("0");if(c!=-1){c=f.length-c;if(c>e[0].length)e[0]=d.string.pad(e[0],c);if(f.indexOf("#")==-1)e[0]=e[0].substr(e[0].length-c)}f=a[0].lastIndexOf(",");var h,i;if(f!=-1){h=a[0].length-f-1;a=a[0].substr(0,f);f=a.lastIndexOf(",");if(f!=-1)i=a.length-f-1}a=[];for(f=e[0];f;){c=f.length-h;a.push(c>0?f.substr(c):f);f=c>0?f.slice(0,c):"";if(i){h=i;delete i}}e[0]=a.reverse().join(b.group||",");return e.join(b.decimal||".")};d.number.regexp=
function(e){return d.number._parseInfo(e).regexp};d.number._parseInfo=function(e){e=e||{};var a=d.i18n.normalizeLocale(e.locale);a=d.i18n.getLocalization("dojo.cldr","number",a);var b=e.pattern||a[(e.type||"decimal")+"Format"],c=a.group,f=a.decimal,g=1;if(b.indexOf("%")!=-1)g/=100;else if(b.indexOf("\u2030")!=-1)g/=1E3;else{var h=b.indexOf("\u00a4")!=-1;if(h){c=a.currencyGroup||c;f=a.currencyDecimal||f}}a=b.split(";");a.length==1&&a.push("-"+a[0]);a=d.regexp.buildGroupRE(a,function(i){i="(?:"+d.regexp.escapeString(i,
".")+")";return i.replace(d.number._numberPatternRE,function(j){var l={signed:false,separator:e.strict?c:[c,""],fractional:e.fractional,decimal:f,exponent:false};j=j.split(".");var n=e.places;if(j.length==1&&g!=1)j[1]="###";if(j.length==1||n===0)l.fractional=false;else{if(n===undefined)n=e.pattern?j[1].lastIndexOf("0")+1:Infinity;if(n&&e.fractional==undefined)l.fractional=true;if(!e.places&&n<j[1].length)n+=","+j[1].length;l.places=n}j=j[0].split(",");if(j.length>1){l.groupSize=j.pop().length;if(j.length>
1)l.groupSize2=j.pop().length}return"("+d.number._realNumberRegexp(l)+")"})},true);if(h)a=a.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g,function(i,j,l,n){i=d.regexp.escapeString(e[["symbol","currency","displayName"][l.length-1]]||e.currency||"");j=j?"[\\s\\xa0]":"";n=n?"[\\s\\xa0]":"";if(!e.strict){if(j)j+="*";if(n)n+="*";return"(?:"+j+i+n+")?"}return j+i+n});return{regexp:a.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:c,decimal:f,factor:g}};d.number.parse=function(e,a){a=d.number._parseInfo(a);e=(new RegExp("^"+
a.regexp+"$")).exec(e);if(!e)return NaN;var b=e[1];if(!e[1]){if(!e[2])return NaN;b=e[2];a.factor*=-1}b=b.replace(new RegExp("["+a.group+"\\s\\xa0]","g"),"").replace(a.decimal,".");return b*a.factor};d.number._realNumberRegexp=function(e){e=e||{};if(!("places"in e))e.places=Infinity;if(typeof e.decimal!="string")e.decimal=".";if(!("fractional"in e)||/^0/.test(e.places))e.fractional=[true,false];if(!("exponent"in e))e.exponent=[true,false];if(!("eSigned"in e))e.eSigned=[true,false];var a=d.number._integerRegexp(e),
b=d.regexp.buildGroupRE(e.fractional,function(f){var g="";if(f&&e.places!==0){g="\\"+e.decimal;if(e.places==Infinity)g="(?:"+g+"\\d+)?";else g+="\\d{"+e.places+"}"}return g},true),c=d.regexp.buildGroupRE(e.exponent,function(f){if(f)return"([eE]"+d.number._integerRegexp({signed:e.eSigned})+")";return""});a=a+b;if(b)a="(?:(?:"+a+")|(?:"+b+"))";return a+c};d.number._integerRegexp=function(e){e=e||{};if(!("signed"in e))e.signed=[true,false];if("separator"in e){if(!("groupSize"in e))e.groupSize=3}else e.separator=
"";var a=d.regexp.buildGroupRE(e.signed,function(c){return c?"[-+]":""},true),b=d.regexp.buildGroupRE(e.separator,function(c){if(!c)return"(?:\\d+)";c=d.regexp.escapeString(c);if(c==" ")c="\\s";else if(c=="\u00a0")c="\\s\\xa0";var f=e.groupSize,g=e.groupSize2;if(g){c="(?:0|[1-9]\\d{0,"+(g-1)+"}(?:["+c+"]\\d{"+g+"})*["+c+"]\\d{"+f+"})";return f-g>0?"(?:"+c+"|(?:0|[1-9]\\d{0,"+(f-1)+"}))":c}return"(?:0|[1-9]\\d{0,"+(f-1)+"}(?:["+c+"]\\d{"+f+"})*)"},true);return a+b};return d.number});
define("dijit/ProgressBar",["dojo","dijit","text!dijit/templates/ProgressBar.html","dojo/fx","dojo/number","dijit/_Widget","dijit/_Templated"],function(d,e){d.declare("dijit.ProgressBar",[e._Widget,e._Templated],{progress:"0",value:"",maximum:100,places:0,indeterminate:false,label:"",name:"",templateString:d.cache("dijit","templates/ProgressBar.html"),_indeterminateHighContrastImagePath:d.moduleUrl("dijit","themes/a11y/indeterminate_progress.gif"),postMixInProperties:function(){this.inherited(arguments);
if(!("value"in this.params))this.value=this.indeterminate?Infinity:this.progress},buildRendering:function(){this.inherited(arguments);this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString());this.update()},update:function(a){d.mixin(this,a||{});a=this.internalProgress;var b=this.domNode,c=1;if(this.indeterminate){e.removeWaiState(b,"valuenow");e.removeWaiState(b,"valuemin");e.removeWaiState(b,"valuemax")}else{if(String(this.progress).indexOf("%")!=
-1){c=Math.min(parseFloat(this.progress)/100,1);this.progress=c*this.maximum}else{this.progress=Math.min(this.progress,this.maximum);c=this.progress/this.maximum}e.setWaiState(b,"describedby",this.labelNode.id);e.setWaiState(b,"valuenow",this.progress);e.setWaiState(b,"valuemin",0);e.setWaiState(b,"valuemax",this.maximum)}this.labelNode.innerHTML=this.report(c);d.toggleClass(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);a.style.width=c*100+"%";this.onChange()},_setValueAttr:function(a){this._set("value",
a);a==Infinity?this.update({indeterminate:true}):this.update({indeterminate:false,progress:a})},_setLabelAttr:function(a){this._set("label",a);this.update()},_setIndeterminateAttr:function(a){this.indeterminate=a;this.update()},report:function(a){return this.label?this.label:this.indeterminate?"&nbsp;":d.number.format(a,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}});return e.ProgressBar});define("text!orion/widgets/templates/ImportDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\n\t\t<form method="post" id="importDialog.myForm"\n\t\t\tenctype="multipart/form-data" >\n\t\t\t<fieldset>\n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\tFile:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: top;">\n\t\t\t\t\t\t\t<div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="importDialog.uploader"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input name="uploadedfile" multiple="false" type="file" id="importDialog.uploader" force="iframe"\n\t\t\t\t\t\t\t\tdojoType="dojox.form.Uploader" style="height: 20px" label="Browse..." >\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="submit" label="Finish" value="OK" dojoType="dijit.form.Button"\n\t\t\t\t\t\t\t\tstyle="padding: 20 0 10 0; float: right; clear: both;"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n</div>'});
define("orion/widgets/ImportDialog",["dojo","dijit","dojox","dijit/Dialog","dojo/data/ItemFileReadStore","dojox/form/Uploader","dojox/form/uploader/FileList","dojox/form/uploader/plugins/IFrame","dijit/form/Button","dijit/ProgressBar","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/ImportDialog.html"],function(d,e){d.declare("orion.widgets.ImportDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/ImportDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="Import from zip"},postCreate:function(){this.inherited(arguments);d.byId("importDialog.myForm").action=this.options.importLocation;d.byId("importDialog.uploader").url=this.options.importLocation;d.connect(e.byId("importDialog.uploader"),"onError",d.hitch(this,function(){setTimeout(d.hitch(this,function(){this.hide()}),2E3)}));d.connect(e.byId("importDialog.uploader"),
"onComplete",d.hitch(this,function(){setTimeout(d.hitch(this,function(){this.hide();this.options.func()}),2E3)}))}})});define("text!dijit/form/templates/DropDownBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}"\n\trole="combobox"\n\t><div class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer\'\n\t\tdojoAttachPoint="_buttonNode, _popupStateNode" role="presentation"\n\t\t><input class="dijitReset dijitInputField dijitArrowButtonInner" value="&#9660; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class=\'dijitReset dijitInputInner\' ${!nameAttrSetting} type="text" autocomplete="off"\n\t\t\tdojoAttachPoint="textbox,focusNode" role="textbox" aria-haspopup="true"\n\t/></div\n></div>'});
define("dijit/form/nls/ComboBox",{root:{previousMessage:"Previous choices",nextMessage:"More choices"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ComboBox",["dojo","dijit","text!dijit/form/templates/DropDownBox.html","dojo/window","dojo/regexp","dojo/data/util/simpleFetch","dojo/data/util/filter","dijit/_CssStateMixin","dijit/form/_FormWidget","dijit/form/ValidationTextBox","dijit/_HasDropDown","i18n!dijit/form/nls/ComboBox"],function(d,e){d.declare("dijit.form.ComboBoxMixin",e._HasDropDown,{item:null,pageSize:Infinity,store:null,fetchProperties:{},query:{},autoComplete:true,highlightMatch:"first",searchDelay:100,searchAttr:"name",
labelAttr:"",labelType:"text",queryExpr:"${0}*",ignoreCase:true,hasDownArrow:true,templateString:d.cache("dijit.form","templates/DropDownBox.html"),baseClass:"dijitTextBox dijitComboBox",dropDownClass:"dijit.form._ComboBoxMenu",cssStateNodes:{_buttonNode:"dijitDownArrowButton"},maxHeight:-1,_stopClickEvents:false,_getCaretPos:function(a){var b=0;if(typeof a.selectionStart=="number")b=a.selectionStart;else if(d.isIE){var c=d.doc.selection.createRange().duplicate();a=a.createTextRange();c.move("character",
0);a.move("character",0);try{a.setEndPoint("EndToEnd",c);b=String(a.text).replace(/\r/g,"").length}catch(f){}}return b},_setCaretPos:function(a,b){b=parseInt(b);e.selectInputText(a,b,b)},_setDisabledAttr:function(a){this.inherited(arguments);e.setWaiState(this.domNode,"disabled",a)},_abortQuery:function(){if(this.searchTimer){clearTimeout(this.searchTimer);this.searchTimer=null}if(this._fetchHandle){this._fetchHandle.abort&&this._fetchHandle.abort();this._fetchHandle=null}},_onInput:function(a){if(!this.searchTimer&&
(a.type=="paste"||a.type=="input")&&this._lastInput!=this.textbox.value)this.searchTimer=setTimeout(d.hitch(this,function(){this._onKey({charOrCode:229})}),100);this.inherited(arguments)},_onKey:function(a){var b=a.charOrCode;if(!(a.altKey||(a.ctrlKey||a.metaKey)&&b!="x"&&b!="v"||b==d.keys.SHIFT)){var c=false,f=this.dropDown,g=d.keys,h=null;this._prev_key_backspace=false;this._abortQuery();this.inherited(arguments);if(this._opened)h=f.getHighlightedOption();switch(b){case g.PAGE_DOWN:case g.DOWN_ARROW:case g.PAGE_UP:case g.UP_ARROW:this._opened&&
this._announceOption(h);d.stopEvent(a);break;case g.ENTER:if(h)if(h==f.nextButton){this._nextSearch(1);d.stopEvent(a);break}else{if(h==f.previousButton){this._nextSearch(-1);d.stopEvent(a);break}}else{this._setBlurValue();this._setCaretPos(this.focusNode,this.focusNode.value.length)}if(this._opened||this._fetchHandle)a.preventDefault();case g.TAB:b=this.get("displayedValue");if(f&&(b==f._messages.previousMessage||b==f._messages.nextMessage))break;h&&this._selectOption();if(this._opened){this._lastQuery=
null;this.closeDropDown()}break;case " ":if(h){d.stopEvent(a);this._selectOption();this.closeDropDown()}else c=true;break;case g.DELETE:case g.BACKSPACE:c=this._prev_key_backspace=true;break;default:c=typeof b=="string"||b==229}if(c){this.item=undefined;this.searchTimer=setTimeout(d.hitch(this,"_startSearchFromInput"),1)}}},_autoCompleteText:function(a){var b=this.focusNode;e.selectInputText(b,b.value.length);var c=this.ignoreCase?"toLowerCase":"substr";if(a[c](0).indexOf(this.focusNode.value[c](0))==
0){c=this._getCaretPos(b);if(c+1>b.value.length){b.value=a;e.selectInputText(b,c)}}else{b.value=a;e.selectInputText(b)}},_openResultList:function(a,b){this._fetchHandle=null;if(!(this.disabled||this.readOnly||b.query[this.searchAttr]!=this._lastQuery)){var c=this.dropDown._highlighted_option&&d.hasClass(this.dropDown._highlighted_option,"dijitMenuItemSelected");this.dropDown.clearResultList();if(!a.length&&!this._maxOptions)this.closeDropDown();else{b._maxOptions=this._maxOptions;a=this.dropDown.createOptions(a,
b,d.hitch(this,"_getMenuLabelFromItem"));this._showResultList();if(b.direction){if(1==b.direction)this.dropDown.highlightFirstOption();else-1==b.direction&&this.dropDown.highlightLastOption();c&&this._announceOption(this.dropDown.getHighlightedOption())}else this.autoComplete&&!this._prev_key_backspace&&!/^[*]+$/.test(b.query[this.searchAttr])&&this._announceOption(a[1])}}},_showResultList:function(){this.closeDropDown(true);this.displayMessage("");this.openDropDown();e.setWaiState(this.domNode,"expanded",
"true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return false},closeDropDown:function(){this._abortQuery();if(this._opened){this.inherited(arguments);e.setWaiState(this.domNode,"expanded","false");e.removeWaiState(this.focusNode,"activedescendant")}},_setBlurValue:function(){var a=this.get("displayedValue"),b=this.dropDown;if(b&&(a==b._messages.previousMessage||a==b._messages.nextMessage))this._setValueAttr(this._lastValueReported,true);else if(typeof this.item=="undefined"){this.item=
null;this.set("displayedValue",a)}else{this.value!=this._lastValueReported&&e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);this._refreshState()}},_onBlur:function(){this.closeDropDown();this.inherited(arguments)},_setItemAttr:function(a,b,c){c||(c=this.store.getValue(a,this.searchAttr));var f=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):c;this._set("item",a);e.form.ComboBox.superclass._setValueAttr.call(this,f,b,c)},_announceOption:function(a){if(a){var b;
if(a==this.dropDown.nextButton||a==this.dropDown.previousButton){b=a.innerHTML;this.item=undefined;this.value=""}else{b=this.store.getValue(a.item,this.searchAttr).toString();this.set("item",a.item,false,b)}this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);e.setWaiState(this.focusNode,"activedescendant",d.attr(a,"id"));this._autoCompleteText(b)}},_selectOption:function(a){a&&this._announceOption(a.target);this.closeDropDown();this._setCaretPos(this.focusNode,this.focusNode.value.length);
e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true)},_startSearchAll:function(){this._startSearch("")},_startSearchFromInput:function(){this._startSearch(this.focusNode.value.replace(/([\\\*\?])/g,"\\$1"))},_getQueryString:function(a){return d.string.substitute(this.queryExpr,[a])},_startSearch:function(a){if(!this.dropDown){var b=this.id+"_popup";this.dropDown=new (d.getObject(this.dropDownClass,false))({onChange:d.hitch(this,this._selectOption),id:b,dir:this.dir});e.removeWaiState(this.focusNode,
"activedescendant");e.setWaiState(this.textbox,"owns",b)}b=d.clone(this.query);this._lastInput=a;this._lastQuery=b[this.searchAttr]=this._getQueryString(a);this.searchTimer=setTimeout(d.hitch(this,function(c,f){this.searchTimer=null;c={queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:c,onBegin:d.hitch(this,"_setMaxOptions"),onComplete:d.hitch(this,"_openResultList"),onError:function(g){f._fetchHandle=null;console.error("dijit.form.ComboBox: "+g);f.closeDropDown()},start:0,count:this.pageSize};
d.mixin(c,f.fetchProperties);this._fetchHandle=f.store.fetch(c);this._nextSearch=this.dropDown.onPage=d.hitch(this,function(g,h){g.start+=g.count*h;g.direction=h;this._fetchHandle=this.store.fetch(g);this.focus()},this._fetchHandle)},b,this),this.searchDelay)},_setMaxOptions:function(a){this._maxOptions=a},_getValueField:function(){return this.searchAttr},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){this.store=new e.form._ComboBoxDataStore(this.srcNodeRef);
if(!("value"in this.params)){var a=this.item=this.store.fetchSelectedItem();if(a){var b=this._getValueField();this.value=this.store.getValue(a,b)}}}this.inherited(arguments)},postCreate:function(){var a=d.query('label[for="'+this.id+'"]');if(a.length){a[0].id=this.id+"_label";e.setWaiState(this.domNode,"labelledby",a[0].id)}this.inherited(arguments)},_setHasDownArrowAttr:function(a){this.hasDownArrow=a;this._buttonNode.style.display=a?"":"none"},_getMenuLabelFromItem:function(a){a=this.labelFunc(a,
this.store);var b=this.labelType;if(this.highlightMatch!="none"&&this.labelType=="text"&&this._lastInput){a=this.doHighlight(a,this._escapeHtml(this._lastInput));b="html"}return{html:b=="html",label:a}},doHighlight:function(a,b){var c=(this.ignoreCase?"i":"")+(this.highlightMatch=="all"?"g":""),f=this.queryExpr.indexOf("${0}");b=d.regexp.escapeString(b);return this._escapeHtml(a).replace(new RegExp((f==0?"^":"")+"("+b+")"+(f==this.queryExpr.length-4?"$":""),c),'<span class="dijitComboBoxHighlightMatch">$1</span>')},
_escapeHtml:function(a){return a=String(a).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;")},reset:function(){this.item=null;this.inherited(arguments)},labelFunc:function(a,b){return b.getValue(a,this.labelAttr||this.searchAttr).toString()}});d.declare("dijit.form._ComboBoxMenu",[e._Widget,e._Templated,e._CssStateMixin],{templateString:"<ul class='dijitReset dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' style='overflow: \"auto\"; overflow-x: \"hidden\";'><li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton' role='option'></li><li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton' role='option'></li></ul>",
_messages:null,baseClass:"dijitComboBoxMenu",postMixInProperties:function(){this.inherited(arguments);this._messages=d.i18n.getLocalization("dijit.form","ComboBox",this.lang)},buildRendering:function(){this.inherited(arguments);this.previousButton.innerHTML=this._messages.previousMessage;this.nextButton.innerHTML=this._messages.nextMessage},_setValueAttr:function(a){this.value=a;this.onChange(a)},onChange:function(){},onPage:function(){},onClose:function(){this._blurOptionNode()},_createOption:function(a,
b){var c=d.create("li",{"class":"dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl"),role:"option"});b=b(a);if(b.html)c.innerHTML=b.label;else c.appendChild(d.doc.createTextNode(b.label));if(c.innerHTML=="")c.innerHTML="&nbsp;";c.item=a;return c},createOptions:function(a,b,c){this.previousButton.style.display=b.start==0?"none":"";d.attr(this.previousButton,"id",this.id+"_prev");d.forEach(a,function(g,h){g=this._createOption(g,c);d.attr(g,"id",this.id+h);this.domNode.insertBefore(g,
this.nextButton)},this);var f=false;if(b._maxOptions&&b._maxOptions!=-1)if(b.start+b.count<b._maxOptions)f=true;else{if(b.start+b.count>b._maxOptions&&b.count==a.length)f=true}else if(b.count==a.length)f=true;this.nextButton.style.display=f?"":"none";d.attr(this.nextButton,"id",this.id+"_next");return this.domNode.childNodes},clearResultList:function(){for(;this.domNode.childNodes.length>2;)this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);this._blurOptionNode()},
_onMouseDown:function(a){d.stopEvent(a)},_onMouseUp:function(a){if(!(a.target===this.domNode||!this._highlighted_option))if(a.target==this.previousButton){this._blurOptionNode();this.onPage(-1)}else if(a.target==this.nextButton){this._blurOptionNode();this.onPage(1)}else{for(a=a.target;!a.item;)a=a.parentNode;this._setValueAttr({target:a},true)}},_onMouseOver:function(a){if(a.target!==this.domNode){a=a.target;if(!(a==this.previousButton||a==this.nextButton))for(;!a.item;)a=a.parentNode;this._focusOptionNode(a)}},
_onMouseOut:function(a){a.target!==this.domNode&&this._blurOptionNode()},_focusOptionNode:function(a){if(this._highlighted_option!=a){this._blurOptionNode();this._highlighted_option=a;d.addClass(this._highlighted_option,"dijitMenuItemSelected")}},_blurOptionNode:function(){if(this._highlighted_option){d.removeClass(this._highlighted_option,"dijitMenuItemSelected");this._highlighted_option=null}},_highlightNextOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.nextSibling;
a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightFirstOption()}else{a=this.domNode.firstChild;this._focusOptionNode(a.style.display=="none"?a.nextSibling:a)}d.window.scrollIntoView(this._highlighted_option)},highlightFirstOption:function(){var a=this.domNode.firstChild,b=a.nextSibling;this._focusOptionNode(b.style.display=="none"?a:b);d.window.scrollIntoView(this._highlighted_option)},highlightLastOption:function(){this._focusOptionNode(this.domNode.lastChild.previousSibling);d.window.scrollIntoView(this._highlighted_option)},
_highlightPrevOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.previousSibling;a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightLastOption()}else{a=this.domNode.lastChild;this._focusOptionNode(a.style.display=="none"?a.previousSibling:a)}d.window.scrollIntoView(this._highlighted_option)},_page:function(a){var b=0,c=this.domNode.scrollTop,f=d.style(this.domNode,"height");for(this.getHighlightedOption()||this._highlightNextOption();b<f;){if(a){if(!this.getHighlightedOption().previousSibling||
this._highlighted_option.previousSibling.style.display=="none")break;this._highlightPrevOption()}else{if(!this.getHighlightedOption().nextSibling||this._highlighted_option.nextSibling.style.display=="none")break;this._highlightNextOption()}var g=this.domNode.scrollTop;b+=(g-c)*(a?-1:1);c=g}},pageUp:function(){this._page(true)},pageDown:function(){this._page(false)},getHighlightedOption:function(){var a=this._highlighted_option;return a&&a.parentNode?a:null},handleKey:function(a){switch(a.charOrCode){case d.keys.DOWN_ARROW:this._highlightNextOption();
return false;case d.keys.PAGE_DOWN:this.pageDown();return false;case d.keys.UP_ARROW:this._highlightPrevOption();return false;case d.keys.PAGE_UP:this.pageUp();return false;default:return true}}});d.declare("dijit.form.ComboBox",[e.form.ValidationTextBox,e.form.ComboBoxMixin],{_setValueAttr:function(a,b,c){this._set("item",null);a||(a="");e.form.ValidationTextBox.prototype._setValueAttr.call(this,a,b,c)}});d.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(a){this.root=a;if(a.tagName!=
"SELECT"&&a.firstChild){a=d.query("select",a);if(a.length>0)a=a[0];else{this.root.innerHTML="<SELECT>"+this.root.innerHTML+"</SELECT>";a=this.root.firstChild}this.root=a}d.query("> option",a).forEach(function(b){b.innerHTML=d.trim(b.innerHTML)})},getValue:function(a,b){return b=="value"?a.value:a.innerText||a.textContent||""},isItemLoaded:function(){return true},getFeatures:function(){return{"dojo.data.api.Read":true,"dojo.data.api.Identity":true}},_fetchItems:function(a,b){if(!a.query)a.query={};
if(!a.query.name)a.query.name="";if(!a.queryOptions)a.queryOptions={};var c=d.data.util.filter.patternToRegExp(a.query.name,a.queryOptions.ignoreCase),f=d.query("> option",this.root).filter(function(g){return(g.innerText||g.textContent||"").match(c)});a.sort&&f.sort(d.data.util.sorter.createSortFunction(a.sort,this));b(f,a)},close:function(){},getLabel:function(a){return a.innerHTML},getIdentity:function(a){return d.attr(a,"value")},fetchItemByIdentity:function(a){var b=d.query("> option[value='"+
a.identity+"']",this.root)[0];a.onItem(b)},fetchSelectedItem:function(){var a=this.root,b=a.selectedIndex;return typeof b=="number"?d.query("> option:nth-child("+(b!=-1?b+1:1)+")",a)[0]:null}});d.extend(e.form._ComboBoxDataStore,d.data.util.simpleFetch);return e.form.ComboBox});define("text!orion/widgets/templates/SFTPConnectionDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoType="dojo.data.ItemFileReadStore" data="sftpConnectionStoreData" jsId="sftpConnectionStore">\n\t</div>\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="locationLabel" for="${id}_sftpPath" style="padding-right: 10">${locationLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<div dojoType="dijit.form.ComboBox" store="sftpConnectionStore" style="display: inline-block; width: 88%;" dojoAttachPoint="sftpConnectionList" searchAttr="name">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div dojoType="dijit.form.DropDownButton">\n\t\t\t\t\t    <span>New</span>\n\t\t\t    \t\t<div dojoType="dijit.TooltipDialog">\n\t\t\t\t\t\t\t<div style="display: table">\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpHostLabel" for="${id}_sftpHost" style="padding-right: 10">${sftpHostLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpHost" id="${id}_sftpHost" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpPathLabel" for="${id}_sftpPath" style="padding-right: 10">${sftpPathLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpPath" id="${id}_sftpPath" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\t\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpUserLabel" for="${id}_sftpUser" style="padding-right: 10">${sftpUserLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpUser" id="${id}_sftpUser" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<button dojoAttachPoint="addSFTPConnection" type="submit" dojoType="dijit.form.Button" style="padding: 20 0 10 0; float: right; clear: both;">Add</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- End inner table--\>\n\t\t\t    \t\t</div><!-- End TooltipDialog --\>\n\t\t\t    \t</div><!-- End DropDownButton --\>\n\t\t\t\t</div><!-- End table cell --\>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="sftpPasswordLabel" for="${id}_sftpPassword" style="padding-right: 10">${sftpPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="sftpPassword" id="${id}_sftpPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<p>If the same file exists in both the source and destination:</p>\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteCancel" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteCancel" checked value="overwriteCancel" />\n\t\t\t\t    <label for="radioOne">Cancel the transfer</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteAll" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteAll"/>\n\t\t\t\t    <label for="radioOne">Always overwrite destination</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteOlder" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteOlder"/>\n\t\t\t\t    <label for="radioOne">Overwrite if source is newer</label>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="sftpConnectionButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t</div><!-- End table --\>\n\t</div><!-- End dijitDialogPaneContent --\>\n</div>'});
define("orion/widgets/SFTPConnectionDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/ComboBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/SFTPConnectionDialog.html"],function(d,e){localStorage.getItem("orion.sftpConnections")||localStorage.setItem("orion.sftpConnections",JSON.stringify({identifier:"name",label:"name",items:[]}));window.sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"));d.declare("orion.widgets.SFTPConnectionDialog",
[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/SFTPConnectionDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="SFTP Transfer";this.sftpHostLabelText="Remote host:";this.sftpPathLabelText="Remote path:";this.sftpUserLabelText="User name:";this.sftpPasswordLabelText="Password:";this.buttonOk="Start Transfer";this.locationLabelText=
"Location:";sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"))},postCreate:function(){this.inherited(arguments);d.connect(this.addSFTPConnection,"onClick",null,d.hitch(this,this.onAddConnection))},execute:function(){var a=this.sftpConnectionList.value.split("@");if(a.length===2){var b=a[0],c=a[1].indexOf("/");if(!(c<=0)){var f=a[1].substring(0,c);a=a[1].substring(c);this.options.func(f,a,b,this.sftpPassword.value,this._computeOverwriteValue())}}},_computeOverwriteValue:function(){if(this.overwriteCancel.checked)return"no-overwrite";
else if(this.overwriteOlder.checked)return"overwrite-older";return""},onAddConnection:function(){for(var a={name:this.sftpUser.value+"@"+this.sftpHost.value+this.sftpPath.value},b=JSON.parse(localStorage.getItem("orion.sftpConnections")),c=false,f=0;f<b.items.length;f++)if(b.items[f].name===a.name){c=true;break}if(!c){b.items.unshift(a);localStorage.setItem("orion.sftpConnections",JSON.stringify(b));this.sftpConnectionList.set("value",a.name)}}})});
define("orion/extensionCommands",["require","dojo","orion/util","orion/commands","orion/editor/regex","orion/contentTypes","orion/URITemplate","orion/widgets/NewItemDialog","orion/widgets/DirectoryPrompterDialog","orion/widgets/ImportDialog","orion/widgets/SFTPConnectionDialog"],function(d,e,a,b,c,f,g){var h={};h._cloneItemWithoutChildren=function i(j){if(j===null||typeof j!=="object")return j;var l=j.constructor();for(var n in j)if(n!=="children"&&n!=="Children")l[n]=i(j[n]);return l};h._createOpenWithCommands=
function(i,j){function l(){for(var w=i.getServiceReferences("orion.edit.editor"),y=[],B=0;B<w.length;B++){var A=w[B],E=A.getProperty("id");y.push({id:E,name:A.getProperty("name"),uriTemplate:new g(A.getProperty("orionTemplate")||A.getProperty("uriTemplate"))})}return y}function n(w,y){w=w.map(function(B){return c.escape(B)});y=y.map(function(B){return c.escape(B)});w=w.length&&"(*\\.("+w.join("|")+")$)";y=y.length&&"(^("+y.join("|")+")$)";return w&&y?w+"|"+y:w?w:y?y:null}function p(w,y){w=w.getServiceReferences("orion.navigate.openWith");
for(var B=[],A=0;A<w.length;A++){var E=w[A];if(E.getProperty("editor")===y.id){E=E.getProperty("contentType");if(E instanceof Array)B=B.concat(E);else E!==null&&typeof E!=="undefined"&&B.push(E)}}return B}function t(w){for(w=w.getServiceReferences("orion.navigate.openWith.default");0<w.length;)return{editor:w[0].getProperty("editor")};return null}for(var v=l(),r=t(i),u=[],q=0;q<v.length;q++){var x=v[q],z=r&&r.editor===x.id,C=p(i,x);if(C.length){for(var k=[],m=[],o=0;o<C.length;o++){var s=j[C[o]];
if(s){k=k.concat(s.extension);m=m.concat(s.filename)}}C=x.uriTemplate;k={Directory:false,Name:n(k,m)};x={name:x.name||x.id,id:"eclipse.openWithCommand."+x.id,tooltip:x.name,validationProperties:k,href:true,forceSingleItem:true,isEditor:z?"default":"editor"};z={run:e.hitch(C,C.expand)};u.push({properties:x,service:z})}}return u};h._makeValidationFunction=function(i,j){function l(t){for(var v="^",r=0;r<t.length;r++){var u=t.charAt(r);switch(u){case "?":v+=".";break;case "*":v+=".*";break;default:v+=
u}}v+="$";return new RegExp(v)}function n(t,v,r){var u,q;if(v.indexOf(":")>=0){u=l(v.substring(0,v.indexOf(":")));var x=v.substring(v.indexOf(":")+1);for(q in t)if(u.test(q))if(n(t[q],x,r))return true}u=l(v);for(q in t)if(u.test(q))if(typeof r==="string"){if(l(r).test(t[q]))return true}else if(r===t[q])return true;return false}function p(t,v){for(var r in v)if(!n(t,r,v[r]))return false;return true}return e.hitch(i,function(t){if(typeof j==="function")t=j(t);if(e.isArray(t)){if((this.forceSingleItem||
this.href)&&t.length!==1)return false;if(!this.forceSingleItem&&t.length<1)return false}else t=[t];if(!this.validationProperties)return true;for(var v in t)if(!p(t[v],this.validationProperties))return false;return true})};h._createCommandOptions=function(i,j,l,n,p){var t={name:i.name,image:i.image,id:i.id||i.name,tooltip:i.tooltip,isEditor:i.isEditor};t.visibleWhen=h._makeValidationFunction(i,p);if(n)if(i.href)t.hrefCallback=e.hitch(i,function(v){v=e.isArray(v.items)?v.items[0]:v.items;v=h._cloneItemWithoutChildren(v);
if(j.run)return j.run(v);else if(l)return l.getService(j).run(v)});else t.callback=e.hitch(i,function(v){var r;if(this.forceSingleItem){v=e.isArray()?v.items[0]:v.items;r=h._cloneItemWithoutChildren(v)}else if(e.isArray(v.items)){r=[];for(var u=0;u<v.items.length;u++)r.push(h._cloneItemWithoutChildren(v.items[u]))}else r=h._cloneItemWithoutChildren(v.items);if(j.run)j.run(r);else l&&l.getService(j).run(r)});return t};h.getOpenWithCommands=function(i){var j=[];for(var l in i._objectScope){var n=i._objectScope[l];
n.isEditor&&j.push(n)}return j};return h});
define("orion/textview/keyBinding",[],function(){function d(a,b,c,f,g){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=b!==undefined&&b!==null?b:false;this.mod2=c!==undefined&&c!==null?c:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=g!==undefined&&g!==null?g:false}var e=window.navigator.platform.indexOf("Mac")!==-1;d.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(e?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;
if(this.mod3!==a.altKey)return false;if(e&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return{KeyBinding:d}});
define("orion/favorites",["require","dojo","orion/util"],function(d,e,a){function b(c){this._favorites=[];this._searches=[];this._init(c);this._initializeFavorites()}b.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this._serviceRegistration.dispatchEvent("favoritesChanged",{navigator:this._favorites,search:this._searches,registry:this._registry})},makeFavorites:function(c){c=
e.isArray(c)?c:[c];for(var f=0;f<c.length;f++){var g=c[f],h=g.ChildrenLocation?g.ChildrenLocation:g.Location;h=a.makeRelative(h);this.addFavorite(g.Name,h,g.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,false,true)},addFavorite:function(c,f,g,h){this._favorites.push({name:c,path:f,directory:g,isFavorite:true,isExternalResource:h});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var f in this._favorites)if(this._favorites[f].path===
c){this._favorites.splice(f,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,f){var g=false;for(var h in this._favorites)if(this._favorites[h].path===c){var i=this._favorites[h];if(i.name!==f){i.name=f;g=true}}if(g){this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(c,f){this._searches.push({name:c,query:f,isSearch:true});this._searches.sort(this._sorter);this._storeSearches();
this._notifyListeners()},hasFavorite:function(c){for(var f in this._favorites)if(this._favorites[f].path===c)return true;return false},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var f;if(!c)return this._favorites;var g="";for(f=0;f<c.length;f++){var h=c.charAt(f);g+=h==="*"?".*":h==="?"?".?":this._SPECIAL_CHARS.indexOf(h)>=0?"\\"+h:h}g+=".*";c=new RegExp(g);g=[];for(f in this._favorites)this._favorites[f].name.search(c)===0&&g.push(this._favorites[f]);return g},removeSearch:function(c){for(var f in this._searches)if(this._searches[f].query===
c){this._searches.splice(f,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(c,f){var g=false;for(var h in this._searches)if(this._searches[h].query===c){var i=this._searches[h];if(i.name!==f){i.name=f;g=true}}if(g){this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()}},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var g,
h=f.get("navigate");if(typeof h==="string")h=JSON.parse(h);if(h)for(g in h){h[g].isFavorite=true;c._favorites.push(h[g])}f=f.get("search");if(typeof f==="string")f=JSON.parse(f);if(f)for(g in f){f[g].isSearch=true;c._searches.push(f[g])}c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("navigate",c)})},_storeSearches:function(){var c=this._searches;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("search",c)})},_sorter:function(c,f){c=c.name.toLowerCase();f=f.name.toLowerCase();return c>f?1:c<f?-1:0},getFavorites:function(){return{navigator:this._favorites,search:this._searches}}};b.prototype.constructor=b;return{FavoritesService:b}});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["require","dojo","dijit","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/OpenResourceDialog.html"],function(d,e,a){return e.declare("orion.widgets.OpenResourceDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,searcher:null,searchRenderer:null,favService:null,
constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searcher=(this.options=arguments[0])&&this.options.searcher;if(!this.searcher)throw new Error("Missing required argument: searcher");this.searchRenderer=this.options&&this.options.searchRenderer;if(!this.searchRenderer||typeof this.searchRenderer.makeRenderFunction!=="function")throw new Error("Missing required argument: searchRenderer");this.favService=this.options.favoriteService;if(!this.favService)throw new Error("Missing required argument: favService");
},postMixInProperties:function(){this.options.title=this.options.title||"Find File Named";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(b){if(b.keyCode===
e.keys.ENTER&&this.results){b=e.query("a",this.results);if(b.length>0){window.open(b[0].href);this.hide()}}});e.connect(this,"onKeyPress",this,function(b){var c,f,g,h,i;g=function(l,n,p){return n<l.length-1?l[n+1]:p};var j=function(l,n,p){return n>0?l[n-1]:p};if(b.keyCode===e.keys.DOWN_ARROW||b.keyCode===e.keys.UP_ARROW){f=e.query("a",this.results);c=e.query("a",this.favresults);h=a.getFocus();i=f.indexOf(h.node);h=c.indexOf(h.node);if(b.keyCode===e.keys.DOWN_ARROW)if(h>=0)a.focus(g(c,h,f.length>
0?f[0]:c[0]));else if(i>=0)a.focus(g(f,i,c.length>0?c[0]:f[0]));else{if(f.length>0||c.length>0)a.focus(g(c,-1,f[0]))}else if(h>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(j(c,h,g))}else if(i>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(j(f,i,c.length>0?c[c.length-1]:g))}else if(f.length>0)a.focus(f[f.length-1]);else c.length>0&&a.focus(c[c.length-1]);e.stopEvent(b)}});e.connect(this,"onMouseUp",function(b){b.target.focus()});this.populateFavorites()},populateFavorites:function(){e.place("<div>Populating favorites&#x2026;</div>",
this.favresults,"only");this.favService.getFavorites().then(this.showFavorites());this.favService.addEventListener("favoritesChanged",this.showFavorites())},showFavorites:function(){var b=this;return function(c){if(c.navigator)c=c.navigator;b.searchRenderer.makeRenderFunction(b.favresults,false,e.hitch(b,b.decorateResult),b.showFavoritesImage)(c);c&&c.length>0&&e.place("<hr/>",b.favresults,"last")}},showFavoritesImage:function(b){var c=new Image;e.addClass(c,"commandSprite");e.addClass(c,"core-sprite-makeFavorite");
e.addClass(c,"commandImage");c.src=d.toUrl("images/none.png");c.title="Favorite";b.appendChild(c);e.style(c,"verticalAlign","middle")},checkSearch:function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();if(b-this.time>this.SEARCH_DELAY){this.time=b;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},doSearch:function(){var b=this.resourceName&&this.resourceName.get("value"),c=this.showFavorites();this.favService.queryFavorites(b).then(function(g){c(g)});if(b){e.place("<div>Searching&#x2026;</div>",
this.results,"only");var f=this;setTimeout(function(){var g=f.searcher.createSearchQuery(null,b,"Name"),h=f.searchRenderer.makeRenderFunction(f.results,false,e.hitch(f,f.decorateResult));f.searcher.search(g,false,h)},0)}},decorateResult:function(b){var c=this;e.query("a",b).forEach(function(f){e.connect(f,"onmouseup",function(g){!e.mouseButtons.isMiddle(g)&&!e.isCopyKey(g)&&c.hide()});e.connect(f,"onkeyup",c,function(g){g.keyCode===e.keys.ENTER&&c.hide()})})},show:function(){this.inherited(arguments);
this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);this.inherited(arguments)}})});define("text!orion/widgets/templates/LoginDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="width: 300px; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0.45em">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td style="text-align: left; vertical-align: top;">\n\t\t\t\t\t\t<h2 dojoAttachPoint="emptyListInfo" class="LoginWindowLeft">No authentication required.</h2>\n\t\t\t\t\t\t<table dojoAttachPoint="authenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="authenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table dojoAttachPoint="otherUnauthenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="otherUnauthenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style="text-align: right; vertical-align: top; padding-right: 2px; margin: 0">\n\t\t\t\t\t\t<span dojoAttachPoint="closeLink" role="button" title="Close"></span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/LoginDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/LoginDialog.html"],function(d,e,a){e.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},postCreate:function(){this.inherited(arguments);var b=
this;e.addClass(this.closeLink,"imageSprite");e.addClass(this.closeLink,"core-sprite-close");e.connect(this.closeLink,"onmouseover",this.closeLink,function(){b.closeLink.style.cursor="pointer"});e.connect(this.closeLink,"onmouseout",this.closeLink,function(){b.closeLink.style.cursor="default"});e.connect(this.closeLink,"onclick",function(){e.hitch(b,b.closeDialog)()})},setPendingAuthentication:function(b){for(var c in this.unauthenticatedServices)delete this.unauthenticatedServices[c].pending;for(c in b)if(this.unauthenticatedServices[b[c].SignInKey])this.unauthenticatedServices[b[c].SignInKey].pending=
true;else if(this.authenticatedServices[b[c].SignInKey]){this.unauthenticatedServices[b[c].SignInKey]=this.authenticatedServices[b[c].SignInKey];this.unauthenticatedServices[b[c].SignInKey].pending=true;delete this.authenticatedServices[b[c].SignInKey]}else this.unauthenticatedServices[b[c].SignInKey]={label:b[c].label,SignInLocation:b[c].SignInLocation,pending:true};this.renderUnauthenticatedServices();this.renderAuthenticatedServices()},authenticatedService:function(b){if(this.unauthenticatedServices[b]&&
!this.unauthenticatedServices[b].authService){this.authenticatedServices[b]=this.unauthenticatedServices[b];delete this.unauthenticatedServices[b]}},addUserItem:function(b,c,f,g){if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:f,data:g}}else{this.authenticatedServices[b]&&delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:f,pending:this.unauthenticatedServices[b].pending}:
{authService:c,label:f}}e.hitch(this,this.renderAuthenticatedServices)();e.hitch(this,this.renderUnauthenticatedServices)()},renderAuthenticatedServices:function(){e.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var b=this,c=true;for(var f in this.authenticatedServices){if(!c){var g=e.create("tr",null,this.authenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},
g)}c=false;g=e.create("tr",{className:"navTableHeading"});var h=this.authenticatedServices[f].authService,i=e.create("td",null,g,"only"),j=e.create("h2",null,i,"only");if(h)if(h.getAuthForm)e.hitch(b,function(p,t){h.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(v){if(b.authenticatedServices[t].label)p.innerHTML=b.authenticatedServices[t].label+"<br>";p.innerHTML+=b.getHostname(v)})})(j,f);else j.innerHTML=this.authenticatedServices[f].label?this.authenticatedServices[f].label:
f;else{var l=this.authenticatedServices[f].SignInLocation;if(this.authenticatedServices[f].label)j.innerHTML=this.authenticatedServices[f].label+"<br>";j.innerHTML+=this.getHostname(l)}e.addClass(i,"LoginWindowLeft");i=e.create("td",{style:"text-align: right"},g,"last");e.addClass(i,"LoginWindowRight");j=this.authenticatedServices[f].data;h=this.authenticatedServices[f].authService;if(!h){e.place(g,this.authenticatedList,"last");return}j.Location&&e.create("a",{href:d.toUrl("profile/user-profile.html")+
"#"+j.Location,innerHTML:"Profile"},i,"last");e.place(document.createTextNode(" "),i,"last");if(h.logout){var n=e.create("a",{innerHTML:"Sign out"},i,"last");e.connect(n,"onmouseover",n,function(){n.style.cursor="pointer"});e.connect(n,"onmouseout",n,function(){n.style.cursor="default"});e.connect(n,"onclick",e.hitch(b,function(p,t){return function(){p.logout().then(e.hitch(b,function(){this.addUserItem(t,p,this.authenticatedServices[t].label);this.isSingleService()&&this.closeDialog();localStorage.removeItem(t)}))}})(h,
f))}e.place(g,this.authenticatedList,"last");i="N/A";if(j&&j.lastlogintimestamp)i=e.date.locale.format(new Date(j.lastlogintimestamp),{formatLength:"short"});j=j.Name&&j.Name.replace(/^\s+|\s+$/g,"")!==""?j.Name:j.login;g=e.create("tr");i=j.length>40?e.create("td",{innerHTML:j.substring(0,30)+"... logged in since "+i,colspan:2,title:j+" logged in since "+i},g,"only"):e.create("td",{innerHTML:j+" logged in since "+i,colspan:2},g,"only");e.addClass(i,"LoginWindowLeft");e.addClass(i,"LoginWindowRight");
e.addClass(i,"LoginWindowComment");e.place(g,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){this.emptyListInfo.style.display=this.unauthenticatedServices.length===0&&this.authenticatedServices.length===0?"":"none";e.empty(this.otherUnauthenticatedList);var b=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var c=true;for(var f in this.unauthenticatedServices){if(!c||!this.isEmpty(this.authenticatedServices)){var g=e.create("tr",
null,this.otherUnauthenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},g)}c=false;g=e.create("tr",{className:"navTableHeading"});var h=e.create("td",null,g,"only");e.addClass(h,"LoginWindowLeft");var i=e.create("h2",null,h,"only");h=e.create("td",{style:"text-align: right"},g,"last");e.addClass(h,"LoginWindowRight");var j=this.unauthenticatedServices[f].authService;
if(j)if(j.getAuthForm)e.hitch(b,function(p,t){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(v){v.indexOf("?")==-1?e.create("a",{target:"_blank",href:v+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},p,"last"):e.create("a",{target:"_blank",href:v+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},p,"last");if(b.unauthenticatedServices[t].label)i.innerHTML=b.unauthenticatedServices[t].label+
"<br>";i.innerHTML+=b.getHostname(v)})})(h,f);else{if(j.login){e.place(document.createTextNode(this.unauthenticatedServices[f].label?this.unauthenticatedServices[f].label:f),i,"only");var l=e.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},h,"last");e.connect(l,"onmouseover",l,function(){l.style.cursor="pointer"});e.connect(l,"onmouseout",l,function(){l.style.cursor="default"});e.connect(l,"onclick",e.hitch(b,function(p){return function(){p.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){b.isSingleService()&&
a.popup.hide&&a.popup.hide(b);a.popup.close(b)})}})(j))}}else{var n=this.unauthenticatedServices[f].SignInLocation;n.indexOf("?")==-1?e.create("a",{target:"_blank",href:n+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+f,innerHTML:"Sign in"},h,"last"):e.create("a",{target:"_blank",href:n+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+f,innerHTML:"Sign in"},h,"last");if(this.unauthenticatedServices[f].label)i.innerHTML=this.unauthenticatedServices[f].label+
"<br>";i.innerHTML+=this.getHostname(n)}e.place(g,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[f].pending){g=e.create("tr");h=e.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},g,"only");e.addClass(h,"LoginWindowLeft");e.addClass(h,"LoginWindowRight");e.create("img",{src:d.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},h,"first");e.place(g,this.otherUnauthenticatedList,"last")}}},
isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(b){for(var c in b)if(b.hasOwnProperty(c))return false;return true},length:function(b){var c=0;for(var f in b)b.hasOwnProperty(f)&&c++;return c},getHostname:function(b){var c=document.createElement("img");c.src=b;b=c.src;c.src=null;return b.match(/^(?:f|ht)tp(?:s)?:\/\/([^\/]+)/im)[1].toString()},closeDialog:function(){a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/widgets/UserMenu",["require","dojo","dijit","orion/util","dijit/Menu"],function(d,e,a){e.declare("orion.widgets.UserMenu",[a.Menu],{widgetsInTemplate:false,id:"userMenu",postCreate:function(){this.inherited(arguments)},constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)>0},length:function(b){var c=0;for(var f in b)b.hasOwnProperty(f)&&c++;return c},_renderAuthenticatedService:function(b,c,f){var g=this,h=this.authenticatedServices[b].authService;if(h&&h.logout)this.addChild(new a.MenuItem({label:f?"Sign Out "+f:"Sign Out",onClick:e.hitch(this,function(i,j){return function(){i.logout().then(e.hitch(g,function(){this.addUserItem(j,i,this.authenticatedServices[j].label);localStorage.removeItem(j)}))}})(h,b)}),c)},_renderUnauthenticatedService:function(b,
c,f){var g=this,h=this.unauthenticatedServices[b].authService;if(h)if(h.getAuthForm)e.hitch(g,function(j){h.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(l){l+=l.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+j:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+j;g.addChild(new a.MenuItem({label:f?"<a target='_blank' href="+l+">Sign In To "+f+"</a>":"<a target='_blank' href="+l+">Sign In</a>",onKeyDown:function(n){n.keyCode===
13&&window.open(l)},_onClick:function(n){this.getParent().onItemClick(this,n)}}),c)})})(b);else{if(h.login)this.addChild(new a.MenuItem({label:f?"Sign In To "+f:"Sign In",onClick:e.hitch(g,function(j){return function(){j.login(eclipse.globalCommandUtils.notifyAuthenticationSite)}})(h)}),c)}else{var i=this.unauthenticatedServices[b].SignInLocation;i+=i.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+b:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+
"?key="+b;this.addChild(new a.MenuItem({label:f?"<a target='_blank' href="+i+">Sign In To "+f+"</a>":"<a target='_blank' href="+i+">Sign In</a>",onKeyDown:function(j){j.keyCode===13&&window.open(i)},_onClick:function(j){this.getParent().onItemClick(this,j)}}),c)}},renderServices:function(){for(var b=this.getChildren(),c=0;c<b.length;c++)this.removeChild(b[c]);if(this.isSingleService())for(c in this.authenticatedServices)this._renderAuthenticatedService(c,0);this.addChild(new a.MenuItem({label:"<a href="+
d.toUrl("settings/settings.html")+">Settings</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=d.toUrl("settings/settings.html")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.addChild(new a.MenuItem({label:"<a href="+d.toUrl("operations/list.html")+">Background Operations</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=d.toUrl("operations/list.html")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.addChild(new a.MenuSeparator);this.addChild(new a.MenuItem({label:"<a href="+
d.toUrl("help/index.jsp")+">Help</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=d.toUrl("help/index.jsp")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.keyAssistFunction&&this.addChild(new a.MenuItem({label:"Keyboard Help",onClick:this.keyAssistFunction}));this.addChild(new a.MenuItem({label:"<a href='"+d.toUrl("help/about.html")+"'>About Orion</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=d.toUrl("help/about.html")},_onClick:function(f){this.getParent().onItemClick(this,
f)}}))},getUserLabel:function(b){if(b.data){var c=b.data.Name&&b.data.Name.replace(/^\s+|\s+$/g,"")!==""?b.data.Name:b.data.login;if(c.length>40)c=c.substring(0,30)+"...";c+=" ("+b.label+")";return c}else return b.label},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,c,f,g){var h=this;if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:f,data:g}}else{this.authenticatedServices[b]&&
delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:f,pending:this.unauthenticatedServices[b].pending}:{authService:c,label:f}}e.hitch(this,this.renderServices)();if(e.byId("userInfo"))if(this.isSingleService()&&g){f=b=g.Name&&g.Name.replace(/^\s+|\s+$/g,"")!==""?g.Name:g.login;if(f.length>40)f=f.substring(0,30)+"...";e.create("a",{innerHTML:f,href:d.toUrl("profile/user-profile.html")+"#"+g.Location,title:"View profile of "+b,style:"margin-right: 0px"},
e.byId("userInfo"),"only")}else if(this.isSingleService()&&!g)if(c.getAuthForm)e.hitch(this,function(j){c.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(l){l+=l.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+j:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+j;e.create("a",{innerHTML:"Sign In",href:l,title:"Sign In",style:"margin-right: 0px",target:"_blank"},e.byId("userInfo"),"only")})})(b);else{if(c.login){var i=
e.create("a",{innerHTML:"Sign In",title:"Sign In",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(i,"onmouseover",i,function(){i.style.cursor="pointer"});e.connect(i,"onmouseout",i,function(){i.style.cursor="default"});e.connect(i,"onclick",function(){c.login(eclipse.globalCommandUtils.notifyAuthenticationSite)})}}else if(this.hasServices()){i=e.create("a",{innerHTML:"Profiles",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(i,"onmouseover",i,function(){i.style.cursor=
"pointer"});e.connect(i,"onmouseout",i,function(){i.style.cursor="default"});e.connect(i,"onclick",function(){try{a.popup.open({popup:h.options.loginDialog,around:e.byId("userInfo")})}catch(j){}a.focus(h.options.loginDialog.domNode)})}else e.empty(e.byId("userInfo"))}})});
define("orion/globalCommands",["require","dojo","dijit","orion/commonHTMLFragments","orion/commands","orion/parameterCollectors","orion/extensionCommands","orion/util","orion/textview/keyBinding","orion/favorites","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog","orion/widgets/LoginDialog","orion/widgets/UserMenu"],function(d,e,a,b,c,f,g,h,i,j){function l(L){var P=document.createElement("a");P.href=L;return P.href}function n(L,P){if(L.getLabel)return L.getLabel();
else{L=new e.Deferred;L.callback(P.properties.name);return L}}function p(){return E}function t(L){(L=L.getService("orion.page.progress"))&&e.hitch(L,L.init)("progressPane")}function v(L){var P=L.getServiceReferences("orion.core.auth");E=[];var S=e.byId("userMenu");if(S){if(!a.byId("logins")){var D=new a.form.DropDownButton({id:"logins",dropDown:A,label:"Options",showLabel:false,alt:"Options"});e.place(D.domNode,S,"only");D.valueNode&&e.destroy(D.valueNode)}for(S=0;S<P.length;S++){D=P[S];var F=L.getService(D);
e.hitch(this,function(J,Q){n(J,Q).then(function(T){J.getKey().then(function(U){E.push(U);J.getUser().then(function(W){B.addUserItem(U,J,T,W);A.addUserItem(U,J,T,W)},function(){B.addUserItem(U,J,T);A.addUserItem(U,J,T,jsonData)});window.addEventListener("storage",function(){if(y[U]!==localStorage.getItem(U)){y[U]=localStorage.getItem(U);J.getUser().then(function(W){B.addUserItem(U,J,T,W);A.addUserItem(U,J,T,W)},function(){B.addUserItem(U,J,T);A.addUserItem(U,J,T)})}},false)})})})(F,D)}}}function r(L){B.setPendingAuthentication(L);
var P;for(P in L)if(L.hasOwnProperty(P)){if(e.byId("userInfo").innerHTML)try{a.popup.open({popup:B,around:e.byId("userInfo")})}catch(S){}else window.setTimeout(function(){try{a.popup.open({popup:B,around:e.byId("userInfo")})}catch(D){}},500);return}a.popup.hide&&a.popup.hide(B);a.popup.close(B)}function u(L){B.authenticatedService(L)}function q(L,P,S,D,F,J,Q){L.closeParameterCollector();if(J=e.byId("pageActions")){e.empty(J);(J=L.renderCommands(J,"dom",S||P,P,"button"))&&J.then?J.then(function(){L.processURL(window.location.href)}):
L.processURL(window.location.href)}if(!Q)if(J=e.byId("pageNavigationActions")){e.empty(J);L.renderCommands(J,"dom",F||S||P,D||P,"button")}}function x(){if(e.byId("relatedLinks")){if(G){G.focusedChild=null;e.forEach(G.getChildren(),function(L){G.removeChild(L);L.destroy()});G.destroy()}return G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"})}}function z(L,P){G||(G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"}));L._addMenuItem(G,P);L=a.byId("related");if((P=e.byId("relatedLinks"))&&
!L){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:G});e.place(L.domNode,P,"only");h.forceLayout(P)}}function C(L,P,S,D,F){var J=L.getServiceReferences("orion.page.link.related");if(!(J.length<=0)){var Q=e.byId("relatedLinks");if(Q){for(var T=x(),U=false,W=0;W<J.length;W++){for(var aa={},Z=J[W].getPropertyNames(),ca=0;ca<Z.length;ca++)aa[Z[ca]]=J[W].getProperty(Z[ca]);if(aa.id)if(e.indexOf(S,aa.id)<0){Z=D.findCommand(aa.id);if(!Z){var da=L.getServiceReferences("orion.navigate.command");
for(ca=0;ca<da.length;ca++)if(da[ca].getProperty("id")===aa.id){aa={};Z=da[ca].getPropertyNames();for(var fa=0;fa<Z.length;fa++)aa[Z[fa]]=da[ca].getProperty(Z[fa]);ca=g._createCommandOptions(aa,da[ca],L,true);Z=new c.Command(ca);break}}if(Z)if(!Z.visibleWhen||Z.visibleWhen(P)){U=true;ca=new c.CommandInvocation(D,P,P,null,Z);Z._addMenuItem(T,ca)}else typeof F==="function"&&window.setTimeout(e.hitch(Z,function(){e.when(F(),e.hitch(this,function(la){la&&P===M&&this.visibleWhen(la)&&z(this,new c.CommandInvocation(D,
la,la,null,this))}))}),0)}}(L=a.byId("related"))&&L.destroy();if(U){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:T});e.place(L.domNode,Q,"only")}h.forceLayout(Q)}}}function k(L,P,S){var D=e.byId("globalActions");if(D){e.empty(D);S=(S=e.isArray(S)?S[0]:S)||P||{};L.renderCommands(D,"global",S,P,"tool")}}function m(L){H=L}function o(L,P,S,D,F){M=L;C(P,L,H,S,D);N=F}function s(L,P,S,D,F,J,Q,T){function U(){var I=P.getService("orion.core.favorite");if(!I){I=new j.FavoritesService({serviceRegistry:P});
I=P.getService("orion.core.favorite")}if(N&&N.Location)I.hasFavorite(N.ChildrenLocation||N.Location).then(function(R){if(R)P.getService("orion.page.message").setMessage(N.Name+" is already a favorite.",2E3);else{I.makeFavorites([N]);P.getService("orion.page.message").setMessage(N.Name+" has been added to the favorites list.",2E3)}});else{var O=window.location.pathname+window.location.hash;I.hasFavorite(O).then(function(R){if(R)P.getService("orion.page.message").setMessage(O+" is already a favorite.",
2E3);else{I.addFavoriteUrl(O);P.getService("orion.page.message").setMessage(O+" has been added to the favorites list.",2E3)}})}}var W,aa=e.byId(L);if(!aa)throw"could not find banner parent, id was "+L;e.place(b.topHTMLFragment,aa,"only");if(L=e.byId("pageToolbar")){e.place(b.toolbarHTMLFragment,L,"only");e.addClass(L,"toolComposite")}else{L=e.create("div",{id:"pageToolbar","class":"toolbar toolComposite layoutBlock"},"titleArea","after");e.place(b.toolbarHTMLFragment,L,"only")}S.setParameterCollector(new f.CommandParameterCollector);
e.place('<div id="keyAssist" style="display: none" class="keyAssistFloat" role="list" aria-atomic="true" aria-live="assertive"></div>',document.body,"last");if(L=e.byId("primaryNav")){D=P.getServiceReferences("orion.page.link");for(var Z=0;Z<D.length;Z++){W={};for(var ca=D[Z].getPropertyNames(),da=0;da<ca.length;da++)W[ca[da]]=D[Z].getProperty(ca[da]);if(W.href&&W.name){ca=e.create("a",{href:W.href},L,"last");W=document.createTextNode(W.name);e.place(W,ca,"only")}}}var fa=e.byId("search");if(!fa)throw"failed to generate HTML for banner";
e.connect(fa,"onkeypress",function(I){if(I.charOrCode===e.keys.ENTER)if(F){if(fa.value.length>0){I=F.createSearchQuery(fa.value);window.location=d.toUrl("search/search.html")+"#"+I}}else window.alert("Can't search: no search service is available")});if(L=e.byId("pageTitle")){W=document.createTextNode(document.title);e.place(W,L,"last")}if(L=e.byId("pageFavorite")){e.addClass(L,"commandButton");e.connect(L,"onclick",this,function(){U()});e.connect(L,"onkeypress",this,function(I){if(I.keyCode===e.keys.ENTER||
I.keyCode===e.keys.SPACE)U()});e.connect(L,"onmouseover",L,function(){e.addClass(this,"commandButtonOver")});e.connect(L,"onfocus",L,function(){e.addClass(this,"commandButtonOver")});e.connect(L,"onmouseout",L,function(){e.removeClass(this,"commandButtonOver")});e.connect(L,"onblur",L,function(){e.removeClass(this,"commandButtonOver")});new c.CommandTooltip({connectId:[L],label:"Add this page to the favorites list",position:["below","left","right","above"],commandParent:aa,commandService:S})}L=new c.Command({name:"Make Favorite",
tooltip:"Add to the favorites list",imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(I){I=e.isArray(I)?I:[I];for(var O=0;O<I.length;O++)if(!I[O].Location)return false;return true},callback:function(I){I=e.isArray(I.items)?I.items:[I.items];for(var O=P.getService("orion.core.favorite"),R=function($){return function(Y){Y?P.getService("orion.page.message").setMessage($.Name+" is already a favorite.",2E3):O.makeFavorites($)}},V=0;V<I.length;V++){var X=I[V];O.hasFavorite(X.ChildrenLocation||
X.Location).then(R(X))}}});S.addCommand(L,"dom");var la=function(I,O,R){var V=O.getService("orion.core.favorite");if(!V){V=new j.FavoritesService({serviceRegistry:O});V=O.getService("orion.core.favorite")}var X=new orion.widgets.OpenResourceDialog({searcher:I,searchRenderer:I.defaultRenderer,favoriteService:V});R&&e.connect(X,"onHide",function(){R.getTextView().focus()});window.setTimeout(function(){X.show()},0)};L=new c.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",
id:"eclipse.openResource",callback:function(){la(F,P,Q)}});if(Q){Q.getTextView().setKeyBinding(new i.KeyBinding("f",true,true,false),"Find File Named...");Q.getTextView().setAction("Find File Named...",function(){la(F,P,Q);return true})}S.addCommand(L,"global");S.registerCommandContribution("eclipse.openResource",100,"globalActions",null,true,new c.CommandKeyBinding("f",true,true));L=new c.Command({name:"Toggle banner and footer",tooltip:"Hide or show the page banner and footer",id:"orion.toggleTrim",
callback:function(){var I=a.byId(aa.parentNode.id);if(I){var O=e.byId("footer");if(aa.style.display==="none"){aa.style.display="block";O.style.display="block"}else{aa.style.display="none";O.style.display="none"}I.layout()}return true}});S.addCommand(L,"global");S.registerCommandContribution("orion.toggleTrim",100,"globalActions",null,true,new c.CommandKeyBinding("m",true,true));if(Q){Q.getTextView().setKeyBinding(new c.CommandKeyBinding("m",true,true),"Toggle Trim");Q.getTextView().setAction("Toggle Trim",
L.callback)}var K=e.byId("keyAssist");e.connect(document,"onkeypress",e.hitch(this,function(I){if(I.charOrCode===e.keys.ESCAPE)K.style.display="none"}));e.connect(document,"onclick",e.hitch(this,function(I){if((I=I.target||I.originalTarget||I.srcElement)&&I.id!=="keyAssist")K.style.display="none"}));Q&&Q.getTextView().addEventListener("MouseDown",function(){K.style.display="none"});T&&T.addHandler({isActive:function(){return K.style.display==="block"},cancel:function(){if(this.isActive()){K.style.display=
"none";return true}return false}});T=new c.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){if(K.style.display==="none"){e.empty(K);if(Q){e.place("<h2>Editor</h2>",K,"last");for(var I=Q.getTextView().getActions(false),O=0;O<I.length;O++)for(var R=I[O],V=Q.getTextView().getKeyBindings(R),X=0;X<V.length;X++)e.place('<span role="listitem">'+h.getUserKeyString(V[X])+" = "+R+"<br></span>",K,"last")}e.place("<h2>Global</h2>",
K,"last");S.showKeyBindings(K);K.style.display="block"}else K.style.display="none";return true}});S.addCommand(T,"global");S.registerCommandContribution("eclipse.keyAssist",100,"globalActions",null,true,new c.CommandKeyBinding(191,false,true));if(Q){L=window.navigator.platform.indexOf("Mac")!==-1;Q.getTextView().setKeyBinding(new c.CommandKeyBinding(191,false,true,!L,L),"Show Keys");Q.getTextView().setAction("Show Keys",T.callback)}A.setKeyAssist(T.callback);k(S,J,M);if(e.indexOf(H,"eclipse.openWith")<
0)(J=P.getService("orion.file.contenttypes"))&&J.getContentTypesMap().then(function(I){I=g._createOpenWithCommands(P,I);for(var O=0;O<I.length;O++){var R=I[O].properties,V=g._createCommandOptions(R,I[O].service,P,true);V=new c.Command(V);V.isEditor=R.isEditor;S.addCommand(V,"object");S.addCommandGroup("eclipse.openWith",1E3,"Open With");S.registerCommandContribution(V.id,O,null,"eclipse.openWith")}});v(P);if(b.bottomHTMLFragment)(J=e.byId("footer"))&&e.place(b.bottomHTMLFragment,J,"only");t(P);h.forceLayout(aa.parentNode);
e.subscribe("/dojo/hashchange",S,function(){S.processURL(window.location.href)})}var w=l(d.toUrl("auth/NotifyAuthentication.html")),y={},B=new orion.widgets.LoginDialog,A=new orion.widgets.UserMenu({loginDialog:B}),E=[],G,M,H=[],N=null;return{generateUserInfo:v,generateRelatedLinks:C,generateDomCommandsInBanner:q,generateBanner:s,notifyAuthenticationSite:w,setPendingAuthentication:r,getAuthenticationIds:p,setPageTarget:o,setPageCommandExclusions:m,authenticatedService:u}});
define("dojo/date",["dojo"],function(d){d.getObject("date",true,d);d.date.getDaysInMonth=function(e){var a=e.getMonth();if(a==1&&d.date.isLeapYear(e))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};d.date.isLeapYear=function(e){e=e.getFullYear();return!(e%400)||!(e%4)&&!!(e%100)};d.date.getTimezoneName=function(e){var a=e.toString(),b="",c=a.indexOf("(");if(c>-1)b=a.substring(++c,a.indexOf(")"));else{c=/([A-Z\/]+) \d{4}$/;if(a=a.match(c))b=a[1];else{a=e.toLocaleString();c=/ ([A-Z\/]+)$/;
if(a=a.match(c))b=a[1]}}return b=="AM"||b=="PM"?"":b};d.date.compare=function(e,a,b){e=new Date(+e);a=new Date(+(a||new Date));if(b=="date"){e.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(b=="time"){e.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(e>a)return 1;if(e<a)return-1;return 0};d.date.add=function(e,a,b){var c=new Date(+e),f=false,g="Date";switch(a){case "day":break;case "weekday":var h;if(a=b%5){a=a;h=parseInt(b/5)}else{a=b>0?5:-5;h=b>0?(b-5)/5:(b+5)/5}var i=e.getDay(),j=0;if(i==6&&b>0)j=1;
else if(i==0&&b<0)j=-1;i=i+a;if(i==0||i==6)j=b>0?2:-2;b=7*h+a+j;break;case "year":g="FullYear";f=true;break;case "week":b*=7;break;case "quarter":b*=3;case "month":f=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&c["set"+g](c["get"+g]()+b);f&&c.getDate()<e.getDate()&&c.setDate(0);return c};d.date.difference=function(e,a,b){a=a||new Date;b=b||"day";var c=a.getFullYear()-e.getFullYear(),f=1;switch(b){case "quarter":e=e.getMonth();a=a.getMonth();e=Math.floor(e/3)+
1;a=Math.floor(a/3)+1;a+=c*4;f=a-e;break;case "weekday":c=Math.round(d.date.difference(e,a,"day"));b=parseInt(d.date.difference(e,a,"week"));f=c%7;if(f==0)c=b*5;else{var g=0,h=e.getDay();a=a.getDay();b=parseInt(c/7);f=c%7;e=new Date(e);e.setDate(e.getDate()+b*7);e=e.getDay();if(c>0)switch(true){case h==6:g=-1;break;case h==0:g=0;break;case a==6:g=-1;break;case a==0:g=-2;break;case e+f>5:g=-2}else if(c<0)switch(true){case h==6:g=0;break;case h==0:g=1;break;case a==6:g=2;break;case a==0:g=1;break;case e+
f<0:g=2}c+=g;c-=b*2}f=c;break;case "year":f=c;break;case "month":f=a.getMonth()-e.getMonth()+c*12;break;case "week":f=parseInt(d.date.difference(e,a,"day")/7);break;case "day":f/=24;case "hour":f/=60;case "minute":f/=60;case "second":f/=1E3;case "millisecond":f*=a.getTime()-e.getTime()}return Math.round(f)};return d.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(d){d.getObject("cldr.supplemental",true,d);d.cldr.supplemental.getFirstDayOfWeek=function(e){e={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[d.cldr.supplemental._region(e)];return e===undefined?
1:e};d.cldr.supplemental._region=function(e){e=d.i18n.normalizeLocale(e);e=e.split("-");var a=e[1];if(a){if(a.length==4)a=e[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[e[0]];return a};d.cldr.supplemental.getWeekend=function(e){var a=d.cldr.supplemental._region(e);e={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(e===undefined)e=6;if(a===undefined)a=0;return{start:e,end:a}};return d.cldr.supplemental});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(d){d.getObject("date.locale",true,d);(function(){function e(c,f,g,h){return h.replace(/([a-z])\1*/ig,function(i){var j,l,n=i.charAt(0);i=i.length;var p=["abbr","wide","narrow"];switch(n){case "G":j=f[i<4?"eraAbbr":"eraNames"][c.getFullYear()<0?0:1];break;case "y":j=c.getFullYear();switch(i){case 1:break;case 2:if(!g.fullYear){j=String(j);j=j.substr(j.length-
2);break}default:l=true}break;case "Q":case "q":j=Math.ceil((c.getMonth()+1)/3);l=true;break;case "M":j=c.getMonth();if(i<3){j=j+1;l=true}else{n=["months-format",p[i-3]].join("-");j=f[n][j]}break;case "w":j=d.date.locale._getWeekOfYear(c,0);l=true;break;case "d":j=c.getDate();l=true;break;case "D":j=d.date.locale._getDayOfYear(c);l=true;break;case "E":j=c.getDay();if(i<3){j=j+1;l=true}else{n=["days-format",p[i-3]].join("-");j=f[n][j]}break;case "a":j=c.getHours()<12?"am":"pm";j=g[j]||f["dayPeriods-format-wide-"+
j];break;case "h":case "H":case "K":case "k":l=c.getHours();switch(n){case "h":j=l%12||12;break;case "H":j=l;break;case "K":j=l%12;break;case "k":j=l||24;break}l=true;break;case "m":j=c.getMinutes();l=true;break;case "s":j=c.getSeconds();l=true;break;case "S":j=Math.round(c.getMilliseconds()*Math.pow(10,i-3));l=true;break;case "v":case "z":if(j=d.date.locale._getZone(c,true,g))break;i=4;case "Z":j=d.date.locale._getZone(c,false,g);j=[j<=0?"+":"-",d.string.pad(Math.floor(Math.abs(j)/60),2),d.string.pad(Math.abs(j)%
60,2)];if(i==4){j.splice(0,0,"GMT");j.splice(3,0,":")}j=j.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+h);}if(l)j=d.string.pad(j,i);return j})}function a(c,f,g,h){var i=function(n){return n};f=f||i;g=g||i;h=h||i;var j=c.match(/(''|[^'])+/g),l=c.charAt(0)=="'";d.forEach(j,function(n,p){if(n){j[p]=(l?g:f)(n.replace(/''/g,"'"));l=!l}else j[p]=""});return h(j.join(""))}function b(c,f,g,h){h=d.regexp.escapeString(h);g.strict||(h=h.replace(" a"," ?a"));return h.replace(/([a-z])\1*/ig,
function(i){var j;j=i.charAt(0);var l=i.length,n="",p="";if(g.strict){if(l>1)n="0{"+(l-1)+"}";if(l>2)p="0{"+(l-2)+"}"}else{n="0?";p="0{0,2}"}switch(j){case "y":j="\\d{2,4}";break;case "M":j=l>2?"\\S+?":"1[0-2]|"+n+"[1-9]";break;case "D":j="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+p+"[1-9][0-9]|"+n+"[1-9]";break;case "d":j="3[01]|[12]\\d|"+n+"[1-9]";break;case "w":j="[1-4][0-9]|5[0-3]|"+n+"[1-9]";break;case "E":j="\\S+";break;case "h":j="1[0-2]|"+n+"[1-9]";break;case "k":j="1[01]|"+n+"\\d";break;case "H":j=
"1\\d|2[0-3]|"+n+"\\d";break;case "K":j="1\\d|2[0-4]|"+n+"[1-9]";break;case "m":case "s":j="[0-5]\\d";break;case "S":j="\\d{"+l+"}";break;case "a":l=g.am||f["dayPeriods-format-wide-am"];n=g.pm||f["dayPeriods-format-wide-pm"];j=l+"|"+n;if(!g.strict){if(l!=l.toLowerCase())j+="|"+l.toLowerCase();if(n!=n.toLowerCase())j+="|"+n.toLowerCase();if(j.indexOf(".")!=-1)j+="|"+j.replace(/\./g,"")}j=j.replace(/\./g,"\\.");break;default:j=".*"}c&&c.push(i);return"("+j+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}d.date.locale._getZone=
function(c,f){return f?d.date.getTimezoneName(c):c.getTimezoneOffset()};d.date.locale.format=function(c,f){f=f||{};var g=d.i18n.normalizeLocale(f.locale),h=f.formatLength||"short";g=d.date.locale._getGregorianBundle(g);var i=[];c=d.hitch(this,e,c,g,f);if(f.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",c);var j;if(f.selector!="date")(j=f.timePattern||g["timeFormat-"+h])&&i.push(a(j,c));if(f.selector!="time")(j=f.datePattern||g["dateFormat-"+h])&&i.push(a(j,c));return i.length==1?i[0]:
g["dateTimeFormat-"+h].replace(/\{(\d+)\}/g,function(l,n){return i[n]})};d.date.locale.regexp=function(c){return d.date.locale._parseInfo(c).regexp};d.date.locale._parseInfo=function(c){c=c||{};var f=d.i18n.normalizeLocale(c.locale);f=d.date.locale._getGregorianBundle(f);var g=c.formatLength||"short",h=c.datePattern||f["dateFormat-"+g],i=c.timePattern||f["timeFormat-"+g];g=c.selector=="date"?h:c.selector=="time"?i:f["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(l,n){return[i,h][n]});var j=[];
return{regexp:a(g,d.hitch(this,b,j,f,c)),tokens:j,bundle:f}};d.date.locale.parse=function(c,f){var g=/[\u200E\u200F\u202A\u202E]/g,h=d.date.locale._parseInfo(f),i=h.tokens,j=h.bundle;c=(new RegExp("^"+h.regexp.replace(g,"")+"$",h.strict?"":"i")).exec(c&&c.replace(g,""));if(!c)return null;var l=["abbr","wide","narrow"],n=[1970,0,1,0,0,0,0],p="";c=d.every(c,function(v,r){if(!r)return true;r=i[r-1];var u=r.length;switch(r.charAt(0)){case "y":if(u!=2&&f.strict)n[0]=v;else if(v<100){v=Number(v);u=""+(new Date).getFullYear();
r=u.substring(0,2)*100;u=Math.min(Number(u.substring(2,4))+20,99);n[0]=v<u?r+v:r-100+v}else{if(f.strict)return false;n[0]=v}break;case "M":if(u>2){r=j["months-format-"+l[u-3]].concat();if(!f.strict){v=v.replace(".","").toLowerCase();r=d.map(r,function(x){return x.replace(".","").toLowerCase()})}v=d.indexOf(r,v);if(v==-1)return false}else v--;n[1]=v;break;case "E":case "e":r=j["days-format-"+l[u-3]].concat();if(!f.strict){v=v.toLowerCase();r=d.map(r,function(x){return x.toLowerCase()})}v=d.indexOf(r,
v);if(v==-1)return false;break;case "D":n[1]=0;case "d":n[2]=v;break;case "a":r=f.am||j["dayPeriods-format-wide-am"];u=f.pm||j["dayPeriods-format-wide-pm"];if(!f.strict){var q=/\./g;v=v.replace(q,"").toLowerCase();r=r.replace(q,"").toLowerCase();u=u.replace(q,"").toLowerCase()}if(f.strict&&v!=r&&v!=u)return false;p=v==u?"p":v==r?"a":"";break;case "K":if(v==24)v=0;case "h":case "H":case "k":if(v>23)return false;n[3]=v;break;case "m":n[4]=v;break;case "s":n[5]=v;break;case "S":n[6]=v}return true});
g=+n[3];if(p==="p"&&g<12)n[3]=g+12;else if(p==="a"&&g==12)n[3]=0;g=new Date(n[0],n[1],n[2],n[3],n[4],n[5],n[6]);f.strict&&g.setFullYear(n[0]);var t=i.join("");h=t.indexOf("d")!=-1;t=t.indexOf("M")!=-1;if(!c||t&&g.getMonth()>n[1]||h&&g.getDate()>n[2])return null;if(t&&g.getMonth()<n[1]||h&&g.getDate()<n[2])g=d.date.add(g,"hour",1);return g}})();(function(){var e=[];d.date.locale.addCustomFormats=function(a,b){e.push({pkg:a,name:b})};d.date.locale._getGregorianBundle=function(a){var b={};d.forEach(e,
function(c){c=d.i18n.getLocalization(c.pkg,c.name,a);b=d.mixin(b,c)},this);return b}})();d.date.locale.addCustomFormats("dojo.cldr","gregorian");d.date.locale.getNames=function(e,a,b,c){var f;c=d.date.locale._getGregorianBundle(c);e=[e,b,a];if(b=="standAlone"){b=e.join("-");f=c[b];if(f[0]==1)f=undefined}e[1]="format";return(f||c[e.join("-")]).concat()};d.date.locale.isWeekend=function(e,a){a=d.cldr.supplemental.getWeekend(a);e=(e||new Date).getDay();if(a.end<a.start){a.end+=7;if(e<a.start)e+=7}return e>=
a.start&&e<=a.end};d.date.locale._getDayOfYear=function(e){return d.date.difference(new Date(e.getFullYear(),0,1,e.getHours()),e)+1};d.date.locale._getWeekOfYear=function(e,a){if(arguments.length==1)a=0;var b=(new Date(e.getFullYear(),0,1)).getDay(),c=(b-a+7)%7;c=Math.floor((d.date.locale._getDayOfYear(e)+c-1)/7);b==a&&c++;return c};return d.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(d,e,a){function b(g,h){if(g.status===403){if(typeof c==="undefined")c=new e.Dialog({title:"Forbidden access"});var i=g.message;if(g.responseText)i=JSON.parse(g.responseText).Message||g.message;c.set("content",i);c.show()}else if(g.status===401)try{var j=JSON.parse(g.responseText);if(!j.SignInKey)return j;var l=localStorage.getItem(j.SignInKey),n=function(){var v=localStorage.getItem(j.SignInKey);
if(l!==v){window.removeEventListener("storage",n,false);delete f[j.SignInKey];a.setPendingAuthentication(f);a.authenticatedService(j.SignInKey);h&&h()}};window.addEventListener("storage",n,false);if(j.SignInKey){f[j.SignInKey]=j;a.setPendingAuthentication(f)}}catch(p){}else try{return JSON.parse(g.responseText)}catch(t){return{Message:g.Message,HttpCode:g.status}}}var c,f={};d.addOnLoad(function(){window.dojo=d;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:b}});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(d,e,a){function b(j,l){this._name=j;this._providers=l;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function c(j,l){return{get:function(n,p){if(l===0)return null;n=localStorage.getItem(j+n);if(n===null)return null;n=JSON.parse(n);if(p||l===-1||n._expires&&n._expires>(new Date).getTime()){delete n._expires;return n}return null},set:function(n,p){if(l!==0){if(l!==-1)p._expires=(new Date).getTime()+
1E3*l;if(Object.keys(p).length===0)localStorage.removeItem(j+n);else{var t=JSON.stringify(p);localStorage.setItem(j+n,t);delete p._expires}}},remove:function(n){localStorage.removeItem(j+n)}}}function f(j){this._currentPromises={};this._cache=new c("/orion/preferences/user",0);this._service=null;this.available=function(){if(!this._service){var l=j.getServiceReferences("orion.core.preference.provider");if(l.length>0)this._service=j.getService(l[0])}return!!this._service}}function g(j){this._location=
j;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function h(){this._cache=new c("/orion/preferences/local",-1)}function i(j,l){this._userProvider=new f(j);this._localProvider=new h;l=l||"defaults.pref";if(l.indexOf("://")===-1)l=d.toUrl(l);this._defaultsProvider=new g(l);this._serviceRegistration=j.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var j=[],l=0;l<this._stores.length;++l){var n=this._stores[l];this._dirty.indexOf(n)!==-1&&
j.push(this._providers[l].put(this._name,n))}this._dirty=[];return new e.DeferredList(j)},_scheduleFlush:function(j){this._dirty.indexOf(j)===-1&&this._dirty.push(j);if(!this._flushPending){this._flushPending=true;window.setTimeout(e.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var j=0;j<this._stores.length;++j){var l=this._stores[j];for(var n in l)if(l.hasOwnProperty(n)&&typeof this._cached[n]===
"undefined")this._cached[n]=l[n]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(j){return this._getCached()[j]},put:function(j,l){if(this._stores.length!==0){var n=this._stores[0];if(n[j]!==l){n[j]=l;this._cached=null;this._scheduleFlush(n)}}},remove:function(j){for(var l=0;l<this._stores.length;++l){var n=this._stores[l];if(n.hasOwnProperty(j)){delete n[j];this._cached=null;this._scheduleFlush(n);return true}}return false},clear:function(){for(var j=0;j<
this._stores.length;++j){this._stores[j]={};this._scheduleFlush(this._stores[j])}this._cached=null},sync:function(j){if(this._flushPending){this._flushPending=false;return this._flush()}for(var l=this,n=[],p=0;p<this._providers.length;++p)n.push(this._providers[p].get(this._name,j).then(function(t){return function(v){l._stores[t]=v}}(p)));return(new e.DeferredList(n)).then(function(){l._cached=null;l._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(j,l){if(this._currentPromises[j])return this._currentPromises[j];
var n=new e.Deferred,p=null;if(l)this._cache.remove(j);else p=this._cache.get(j);if(p!==null)n.resolve(p);else{this._currentPromises[j]=n;var t=this;this._service.get(j).then(function(v){t._cache.set(j,v);delete t._currentPromises[j];n.resolve(v)},function(v){if(v.status===401){delete t._currentPromises[j];n.resolve({});a.handleAuthenticationError(v,function(){t.get(j)})}else if(v.status===404){v={};t._cache.set(j,v);delete t._currentPromises[j];n.resolve(v)}else{delete t._currentPromises[j];n.resolve(t._cache.get(j,
true)||{})}})}return n},put:function(j,l){var n=new e.Deferred;this._cache.set(j,l);var p=this;this._service.put(j,l).then(function(){n.resolve()},function(t){t.status===401?a.handleAuthenticationError(t,function(){p._service.put(j,l).then(function(){n.resolve()},function(){n.resolve()})}):n.resolve()});return n}};g.prototype={get:function(j,l){if(this._currentPromise)return this._currentPromise;var n=new e.Deferred,p=null;if(l)this._cache.remove(j);else p=this._cache.get(j);if(p!==null)n.resolve(p);
else{this._currentPromise=n;var t=this;e.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(v){t._cache.set(j,v[j]||{});t._currentPromise=null;n.resolve(v[j]||{})},error:function(v,r){if(r.xhr.status===401){t._currentPromise=null;n.resolve({});n=new e.Deferred;t._currentPromise=n;var u=this;a.handleAuthenticationError(r.xhr,function(){e.xhrGet(u)})}else if(r.xhr.status===404){t._cache.set(j,{});t._currentPromise=null;n.resolve({})}else{t._currentPromise=
null;v=t._cache.get(j,true);v!==null?n.resolve(v[j]||{}):n.resolve({})}}})}return n},put:function(){var j=new e.Deferred;j.resolve();return j}};h.prototype={get:function(j){var l=new e.Deferred;j=this._cache.get(j);j!==null?l.resolve(j):l.resolve({});return l},put:function(j,l){var n=new e.Deferred;this._cache.set(j,l);n.resolve();return n}};i.DEFAULT_SCOPE=1;i.LOCAL_SCOPE=2;i.USER_SCOPE=4;i.prototype={getPreferences:function(j,l){if(!l||typeof l!=="number"||l>7||l<1)l=i.DEFAULT_SCOPE|i.LOCAL_SCOPE|
i.USER_SCOPE;var n=[];i.USER_SCOPE&l&&this._userProvider.available()&&n.push(this._userProvider);i.LOCAL_SCOPE&l&&n.push(this._localProvider);i.DEFAULT_SCOPE&l&&n.push(this._defaultsProvider);var p=new b(j,n);return p.sync().then(function(){return p})}};return{PreferencesService:i}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(d,e){var a=a||{};a.Plugin=function(b,c,f){function g(x,z,C,k){if(!n)throw new Error("plugin not connected");var m=r++;u[String(m)]=k;f.postMessage({id:m,serviceId:x,method:z,params:C},n)}function h(x){var z={};if(x.methods)for(var C=0;C<x.methods.length;C++){var k=x.methods[C];z[k]=function(m){return function(){var o=Array.prototype.slice.call(arguments),s=new d.Deferred;l._load().then(function(){g(x.serviceId,
m,o,s)});return s.promise}}(k)}return z}function i(){var x=c.services;if(x)for(var z=0;z<x.length;z++){var C=x[z],k=h(C);q[C.serviceId]=f.registerService(C.type,k,C.properties)}}function j(x){try{if(x.method)if("plugin"===x.method){if(c){if(JSON.stringify(c)!==JSON.stringify(x.params[0])){for(var z in q)if(q.hasOwnProperty(z)){q[z].unregister();delete q[z]}c=x.params[0];i();f.updatePlugin(l)}}else{c=x.params[0];i()}if(!v){v=true;p.resolve(l)}if(t){t.resolve(l);t=null}}else if("dispatchEvent"===x.method){var C=
q[x.serviceId];C.dispatchEvent.apply(C,x.params)}else if("progress"===x.method){var k=u[String(x.requestId)];k.progress.apply(k,x.params)}else throw new Error("Bad response method: "+x.method);else{k=u[String(x.id)];delete u[String(x.id)];x.error?k.reject(x.error):k.resolve(x.result)}}catch(m){console.log(m)}}var l=this,n=null,p=new d.Deferred,t=null,v=false,r=0,u={},q={};this.getLocation=function(){return b};this.getData=function(){return c};this.uninstall=function(){for(var x in q)if(q.hasOwnProperty(x)){q[x].unregister();
delete q[x]}if(n){f.disconnect(n);n=null}f.uninstallPlugin(this)};this.getServiceReferences=function(){var x=[],z;for(z in q)q.hasOwnProperty(z)&&x.push(q[z].getServiceReference());return x};this.update=function(){if(!v)return this._load();var x;if(t===null){x=t=new d.Deferred;f.disconnect(n);n=f.connect(b,j);setTimeout(function(){t===x&&t.reject(new Error("Load timeout for plugin: "+b))},15E3)}return t};this._load=function(x){if(!n){n=f.connect(b,j);setTimeout(function(){if(!v){if(!x){c={};f.updatePlugin(l)}p.reject(new Error("Load timeout for plugin: "+
b))}},15E3)}return p.promise};if(typeof b!=="string")throw new Error("invalid url:"+b);c&&i()};a.PluginRegistry=function(b,c,f){function g(r){if(r.indexOf("://")===-1){var u=document.createElement("a");u.href=r;return u.href}return r}function h(r){delete l["plugin."+r.getLocation()]}function i(r){r.getData()._expires=(new Date).getTime()+36E5;l["plugin."+r.getLocation()]=JSON.stringify(r.getData())}function j(r){r=g(r);for(var u=0,q=n.length;u<q;u++){var x=n[u];if(r===x.getLocation())return x}return null}
var l=c||localStorage||{},n=[],p=[],t=new e.EventTarget;addEventListener("message",function(r){for(var u=0,q=r.source;u<p.length;u++)if(q===p[u].target){if(typeof p[u].useStructuredClone==="undefined")p[u].useStructuredClone=typeof r.data!=="string";p[u].handler(p[u].useStructuredClone?r.data:JSON.parse(r.data));break}},false);var v={registerService:d.hitch(b,b.registerService),connect:function(r,u){var q=document.createElement("iframe");q.id=r;q.name=r;if(!f){q.style.display="none";q.style.visibility=
"hidden"}q.src=r;document.body.appendChild(q);r={iframe:q,target:q.contentWindow,handler:u,url:r};p.push(r);return r},disconnect:function(r){for(var u=0;u<p.length;u++)if(r===p[u]){p.splice(u,1);try{document.body.removeChild(r.iframe)}catch(q){}break}},uninstallPlugin:function(r){h(r);for(var u=0;u<n.length;u++)if(r===n[u]){n.splice(u,1);t.dispatchEvent("pluginRemoved",r);break}},updatePlugin:function(r){i(r);t.dispatchEvent("pluginUpdated",r)},postMessage:function(r,u){u.target.postMessage(u.useStructuredClone?
r:JSON.stringify(r),u.url)}};this.startup=function(r){for(var u=[],q=0;q<r.length;++q){var x=r[q];x=g(x);var z="plugin."+x,C=l[z]?JSON.parse(l[z]):null;if(C&&C._expires&&C._expires>(new Date).getTime()){if(j(x)===null){delete C._expires;n.push(new a.Plugin(x,C,v))}}else{l[z]="{}";x=new a.Plugin(x,{},v);n.push(x);u.push(x._load(false))}}return new d.DeferredList(u)};this.shutdown=function(){for(var r=0;r<p.length;r++)try{document.body.removeChild(p[r].iframe)}catch(u){}};this.installPlugin=function(r,
u){r=g(r);var q=new d.Deferred,x=j(r);if(x)if(x.getData())q.resolve(x);else{var z=function(C){if(C.getLocation()===r){q.resolve(C);t.removeEventListener("pluginAdded",z)}};t.addEventListener("pluginAdded",z)}else{x=new a.Plugin(r,u,v);n.push(x);if(x.getData()){i(x);t.dispatchEvent("pluginAdded",x);q.resolve(x)}else x._load(true).then(function(){i(x);t.dispatchEvent("pluginAdded",x);q.resolve(x)},function(C){q.reject(C)})}return q.promise};this.getPlugins=function(){for(var r=[],u=0;u<n.length;u++)n[u].getData()&&
r.push(n[u]);return r};this.getPlugin=function(r){if((r=j(r))&&r.getData())return r;return null};this.addEventListener=function(r,u){t.addEventListener(r,u)};this.removeEventListener=function(r,u){t.removeEventListener(r,u)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(d,e,a,b,c){function f(){var g=new a.ServiceRegistry,h=new b.PreferencesService(g),i=new c.PluginRegistry(g);return h.getPreferences("/plugins").then(function(j){j=j.keys();for(var l=0;l<j.length;++l)if(j[l].indexOf("://")===-1)j[l]=d.toUrl(j[l]);return i.startup(j)}).then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>0)return h.getPreferences("/plugins",
h.USER_SCOPE).then(function(j){j=j.keys();for(var l=0;l<j.length;++l)if(j[l].indexOf("://")===-1)j[l]=d.toUrl(j[l]);return i.startup(j)})}).then(function(){e.addOnWindowUnload(function(){i.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:h,pluginRegistry:i}})}return{startup:f}});
define("orion/status",["require","dojo","orion/util"],function(d,e,a){function b(c,f,g,h,i){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=f;this.notificationContainerDomId=i;this.domId=g;this.progressDomId=h||g;this._hookedClose=false}b.prototype={_init:function(){var c=e.byId("closeNotifications");if(c&&!this._hookedClose){e.connect(c,"onclick",this,function(){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,
"slideContainerActive")});e.connect(c,"onkeypress",this,function(f){if(f.keyCode===e.keys.ENTER||f.keyCode===e.keys.SPACE){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,"slideContainerActive")}})}},setMessage:function(c,f){this._init();e.place(window.document.createTextNode(c),this.domId,"only");if(typeof f==="number"){var g=this;window.setTimeout(function(){var h=e.byId(g.domId);(typeof h.textContent==="string"?h.textContent:h.innerText)===c&&e.place(window.document.createTextNode(""),
g.domId,"only")},f)}},setErrorMessage:function(c){this._init();var f=c.responseText||c.message||c;try{f=JSON.parse(f)}catch(g){}c=f.Message||f;var h="red";if(f.Severity)switch(f.Severity){case "Warning":h="#FFCC00";break;case "Error":h="red";break;case "Info":case "Ok":h="green";break}f=e.create("span",{style:{color:h}});e.place(window.document.createTextNode(c),f);e.place(f,this.domId,"only")},setProgressMessage:function(c){this._init();var f=e.create("span",{"class":"imageSprite core-sprite-progress"});
e.place(f,this.progressDomId,"only");e.place(window.document.createTextNode(c),this.progressDomId,"last");e.addClass(this.notificationContainerDomId,"progressNormal");c.length>0?e.addClass(this.notificationContainerDomId,"slideContainerActive"):e.removeClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},setProgressResult:function(c){c=c.responseText||c;try{c=JSON.parse(c)}catch(f){}this._init();var g=c.Message||c,h="imageSprite core-sprite-info",
i="progressInfo",j="progressWarning progressError progressNormal";if(c.Severity)switch(c.Severity){case "Warning":h="imageSprite core-sprite-warning";i="progressWarning";j="progressInfo progressError progressNormal";break;case "Error":h="imageSprite core-sprite-error";i="progressError";j="progressWarning progressInfo progressNormal";break}h=e.create("span",{"class":h});e.place(h,this.progressDomId,"only");if(c.HTML)e.place(g,this.progressDomId,"last");else{e.place(window.document.createTextNode("   "+
g),this.progressDomId,"last");if(i&&this.progressDomId!==this.domId){e.addClass(this.notificationContainerDomId,i);e.removeClass(this.notificationContainerDomId,j)}}e.addClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},showWhile:function(c,f){var g=this;g.setProgressMessage(f);return c.then(function(h){if(h&&h.Location&&h.Message&&h.Running)return e.hitch(g,g._doProgressWhile)(h);g.setProgressMessage("");h&&h.Result&&g.setProgressResult(h.Result);
return h})},_doProgressWhile:function(c){var f=new e.Deferred,g=this;window.setTimeout(function(){g._operationsClient.getOperation(c.Location).then(function(h){f.callback(h)})},2E3);return this.showWhile(f,c.Message)}};b.prototype.constructor=b;return{StatusReportingService:b}});define("text!orion/widgets/templates/OperationsDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="padding: 0.5em; min-width: 300px;">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><h2>Recent operations</h2></td>\n\t\t\t\t\t<td style="text-align: right;"><a dojoAttachPoint="allOperationsLink">All Operations</a></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<span dojoAttachPoint="operationsExist">\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="myOperationsListEmpty">No operations running on this page.</span>\n\t\t\t\t<table dojoAttachPoint="myOperationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="otherOperations"><br>Operations from other pages:</span>\n\t\t\t\t<table dojoAttachPoint="operationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t</span>\n\t\t\t<span class="secondaryColumn" dojoAttachPoint="operationsDontExist">No operations running.</span>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/OperationsDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/OperationsDialog.html"],function(d,e,a){e.declare("orion.widgets.OperationsDialog",[a.TooltipDialog],{widgetsInTemplate:true,closable:true,templateString:e.cache("orion","widgets/templates/OperationsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this._operations=[];this._myOperations=[]},postCreate:function(){this.inherited(arguments);
this.allOperationsLink.href=d.toUrl("operations/list.html");this._setOperationsVisibility()},setOperations:function(b,c){this._operations=[];c=c||{};this._myOperations=[];if(b.Children)for(var f=0;f<b.Children.length;f++)c[b.Children[f].Id]?this._myOperations.push(b.Children[f]):this._operations.push(b.Children[f]);this._operations.sort(function(g,h){return parseInt(h.Modified)-parseInt(g.Modified)});this._myOperations.sort(function(g,h){return parseInt(h.Modified)-parseInt(g.Modified)});this._renderOperations()},
parseProgressResult:function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(c){}var f={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==f.Message)f.DetailedMessage=b.DetailedMessage;return f},_renderOperations:function(){this._renderOperationsTable(this.myOperationsList,this._myOperations);this._renderOperationsTable(this.operationsList,this._operations)},_renderOperationsTable:function(b,c){e.empty(b);for(var f=0;f<c.length;f++){var g=c[f],h=e.create("tr"),
i=e.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:g.Name},h);i=e.create("div",null,i,"only");link=e.create("span",{innerHTML:g.Name,className:"primaryColumn"},i,"last");e.place(document.createTextNode(g.Name),link,"only");var j=e.create("span",null,i,"first");e.addClass(j,"imageSprite");var l=this.parseProgressResult(g.Result);switch(l.Severity){case "Warning":e.addClass(j,"core-sprite-warning");break;case "Error":e.addClass(j,"core-sprite-error");break;default:if(g.Running===
true)e.addClass(j,"core-sprite-start");else if(g.Canceled===true)e.addClass(j,"core-sprite-stop");else g.Failed===true?e.addClass(j,"core-sprite-error"):e.addClass(j,"core-sprite-ok")}if(l.Message||g.Message){g=l.Message||g.Message;if(l.DetailedMessage&&l.DetailedMessage!=="")g+=": "+l.DetailedMessage;e.create("br",null,i,"last");e.create("span",{className:"secondaryColumn",style:"margin-left: 18px;",innerHTML:g},i,"last")}e.place(h,b,"last")}this._setOperationsVisibility()},_setOperationsVisibility:function(){this.operationsList.style.display=
this._operations.length>0?"":"none";this.otherOperations.style.display=this._operations.length>0?"":"none";this.myOperationsList.style.display=this._myOperations.length>0?"":"none";this.myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.operationsDontExist.style.display=this._operations.length+this._myOperations.length>0?"none":"";this.operationsExist.style.display=this._operations.length+this._myOperations.length>0?"":"none"},_onBlur:function(){this.inherited(arguments);
a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/progress",["require","dojo","orion/globalCommands","orion/widgets/OperationsDialog"],function(d,e,a){function b(c,f){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.progress",this);this._operationsClient=f;this._initDone=false;this._topicListeners={};this._myOperations={};this._lastIconClass=this._lastOperation=null}b.prototype={init:function(c){if(!this._progressPane){this._progressPane=e.byId(c);this._operationsDialog=new orion.widgets.OperationsDialog;
e.connect(this._progressPane,"onclick",e.hitch(this,this._openOperationsPopup));var f=this;if(new Date-this.getLastListUpdate()>3E5)this._operationsClient.getRunningOperations().then(function(g){e.hitch(f,f._loadOperationsList)(g);window.setTimeout(function(){e.hitch(f,f._checkOperationsChanges())},5E3)},function(g){console.error(g)});else{e.hitch(f,f._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')));window.setTimeout(function(){e.hitch(f,f._checkOperationsChanges())},
5E3)}window.addEventListener("storage",function(g){a.getAuthenticationIds().indexOf(g.key)>=0&&f._operationsClient.getRunningOperations().then(function(h){e.hitch(f,f._loadOperationsList)(h)},function(h){console.error(h)})},false);window.addEventListener("storage",function(g){if(g.key==="orionOperations")e.hitch(f,f._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')))})}},_loadOperationsList:function(c){c.lastClientDate=new Date;if(c.lastClientDate-this.getLastListUpdate()>
3E5){localStorage.setItem("orionOperations",JSON.stringify(c));this._generateOperationsInfo(c)}},getLastListUpdate:function(){var c=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}');return c.lastClientDate?new Date(c.lastClientDate):new Date(0)},_markOperationAsFailed:function(c,f,g){c.Message="Operation status is unknown";c.Running=false;c.Failed=true;c.Result={HttpCode:g?g.xhr.staus:500,Severity:f,Message:f.Message?f.Message:f};this.writeOperation(c)},_checkOperationsChanges:function(){for(var c=
this,f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=[],h=[],i=0;i<f.Children.length;i++){var j=f.Children[i];if(j.Running==true&&new Date-new Date(j.lastClientDate?j.lastClientDate:0)>5E3){var l=this._operationsClient.getOperation(j.Location);h.push(l);e.hitch(this,function(n){l.then(function(p){p.lastClientDate=new Date;e.hitch(c,c.writeOperation)(p)},function(p,t){if(p.status==404){g.push(n);return p}e.hitch(c,c._markOperationAsFailed(f.Children[n],p,t))})})(i)}if(!j.Running&&
new Date-new Date(j.lastClientDate?j.lastClientDate:0)>3E5)g.push(i)}(new e.DeferredList(h)).addBoth(function(){if(g.length>0){f.lastClientDate=new Date;for(var n=g.length-1;n>=0;n--)f.Children.splice(g[n],1);localStorage.setItem("orionOperations",JSON.stringify(f));e.hitch(c,c._generateOperationsInfo)(f)}window.setTimeout(function(){e.hitch(c,c._checkOperationsChanges())},5E3)})},_openOperationsPopup:function(){try{dijit.popup.open({popup:this._operationsDialog,around:this._progressPane})}catch(c){}dijit.focus(this._operationsDialog.domNode)},
_switchIconTo:function(c){this._lastIconClass&&e.removeClass(this._progressPane,this._lastIconClass);this._lastIconClass=c;e.addClass(this._progressPane,this._lastIconClass)},_generateOperationsInfo:function(c){this._operationsDialog.setOperations(c,this._myOperations);if(!c.Children||c.Children.length==0){this._switchIconTo("progressPane_empty");this._progressPane.title="Operations"}else{for(var f="",g=0;g<c.Children.length;g++){var h=c.Children[g];if(this._myOperations[h.Id])if(h.Running==true){f=
"running";break}}if(f===""&&this._lastOperation!=null)if(this._lastOperation.Result)switch(this._operationsDialog.parseProgressResult(this._lastOperation.Result).Severity){case "Warning":if(f!=="error")f="warning";break;case "Error":f="error"}switch(f){case "running":this._progressPane.title="Operations running";this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title="Some operations finished with warning";this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=
"Some operations finished with error";this._switchIconTo("progressPane_error");break;default:this._progressPane.title="Operations";this._switchIconTo("progressPane_operations")}}},followOperation:function(c,f,g){if(c.Id)this._myOperations[c.Id]=true;var h=f?f:new e.Deferred;this.writeOperation(c);var i=this;if(c&&c.Location&&c.Running==true)window.setTimeout(function(){i._operationsClient.getOperation(c.Location).then(function(j){e.hitch(i,i.followOperation(j,h,c.Location))},function(j,l){e.hitch(i,
i.setProgressResult)({Severity:"Error",Message:j});e.hitch(i,i._markOperationAsFailed(c,j,l));h.errback(j,l)})},2E3);else if(c&&c.Result){i._serviceRegistry.getService("orion.page.message").setProgressMessage("");f=this._operationsDialog.parseProgressResult(c.Result).Severity;if(f=="Error"||f=="Warning"){c.Result.failedOperation={Location:g,Id:c.Id,Name:c.Name};h.callback(c);setTimeout(function(){i._myOperations[c.Id]&&e.hitch(i,i._openOperationsPopup)()},10)}else h.callback(c);!c.Failed&&c.Idempotent==
true&&window.setTimeout(function(){e.hitch(i,i.removeOperation)(g,c.Id)},5E3)}return h},removeOperation:function(c,f){that=this;if(f){if(this._lastOperation!=null&&this._lastOperation.Id===f)this._lastOperation=null;delete this._myOperations[f]}e.hitch(that._operationsClient,that._operationsClient.removeOperation)(c).then(function(){e.hitch(that,that.removeOperationFromTheList)(f)})},removeOperationFromTheList:function(c){if(this._lastOperation!=null&&this._lastOperation.Id===c)this._lastOperation=
null;delete this._myOperations[c];for(var f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<f.Children.length;g++){var h=f.Children[g];if(h.Id&&h.Id===c){f.Children.splice(g,1);break}}localStorage.setItem("orionOperations",JSON.stringify(f));this._generateOperationsInfo(f)},removeCompletedOperations:function(){for(var c=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),f=c.Children.length-1;f>=0;f--)c.Children[f].Running||c.Children.splice(f,1);
localStorage.setItem("orionOperations",JSON.stringify(c));this._generateOperationsInfo(c)},setProgressResult:function(c){this._serviceRegistry.getService("orion.page.message").setProgressResult(c)},showWhile:function(c,f){f&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(f);var g=this;return c.then(function(h){if(h&&h.Location&&h.Message&&h.Running)return e.hitch(g,g.followOperation)(h,null,h.Location);g._serviceRegistry.getService("orion.page.message").setProgressMessage("");
return h},function(h){e.hitch(g,g.setProgressResult)(h);return h})},followTopic:function(c,f){this._topicListeners[c]||(this._topicListeners[c]=[]);this._topicListeners[c].push(f)},writeOperation:function(c){this._lastOperation=c=JSON.parse(JSON.stringify(c));for(var f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<f.Children.length;g++){var h=f.Children[g];if(h.Id&&h.Id===c.Id){f.Children.splice(g,1);break}}!c.Running&&!c.Failed&&delete c.Result;c.lastClientDate=new Date;
f.Children.push(c);f.lastClientDate=new Date;localStorage.setItem("orionOperations",JSON.stringify(f));this._generateOperationsInfo(f)}};b.prototype.constructor=b;return{ProgressService:b}});define("orion/dialogs",[],function(){function d(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.page.dialog",this)}d.prototype={confirm:function(e,a){a(window.confirm(e))},openFiles:function(){}};d.prototype.constructor=d;return{DialogService:d}});
define("orion/selection",["dojo"],function(d){function e(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.selection",this);this._selections=[]}e.prototype={getSelection:function(a){a(this._getSingleSelection())},getSelections:function(a){a(this._selections)},_getSingleSelection:function(){if(this._selections&&this._selections.length>0)return this._selections[0];return null},setSelections:function(a){this._selections=d.isArray(a)?a:a?[a]:null;this._serviceRegistration.dispatchEvent("selectionChanged",
this._getSingleSelection(),this._selections)}};e.prototype.constructor=e;return{Selection:e}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(d,e){function a(f,g,h){if(!f[g])throw g+" is not supportted in this file system";var i=new d.Deferred;f[g].apply(f,h).then(function(j){i.callback(j)},function(j){j.status===401?e.handleAuthenticationError(j,function(){f[g].apply(f,h).then(function(l){i.callback(l)},function(l){i.errback(l)})}):i.errback(j)});return i}function b(f,g,h,i){if(!f.readBlob)throw"source file service does not support binary read";if(!h.writeBlob)throw"target file service does not support binary write";
if(g[g.length-1]!=="/")return a(f,"readBlob",[g]).then(function(n){return a(h,"writeBlob",[i,n])});var j=i.substring(0,i.length-1),l=decodeURIComponent(j.substring(j.lastIndexOf("/")+1));j=j.substring(0,j.lastIndexOf("/")+1);return a(h,"createFolder",[j,l]).then(function(){},function(){}).then(function(){if(g.indexOf("/")===0)g+="?depth=1";return a(f,"fetchChildren",[g]).then(function(n){for(var p=[],t=0;t<n.length;++t){var v=n[t].Location,r=v;if(n[t].Directory)r=v.substring(0,v.length-1);r=decodeURIComponent(r.substring(r.lastIndexOf("/")+
1));r=i+encodeURIComponent(r);if(n[t].Directory)r+="/";p[t]=b(f,v,h,r)}return new d.DeferredList(p)})})}function c(f,g){function h(u){var q=new d.Deferred;q.reject("No Matching FileService for location:"+u);return q}var i=f.getServiceReferences("orion.core.file"),j=i;if(g){j=[];for(var l=0;l<i.length;++l)g(i[l])&&j.push(i[l])}var n=[],p=[],t=[],v=[],r={fetchChildren:function(){var u=new d.Deferred;u.resolve(v);return u},createWorkspace:function(){var u=new d.Deferred;u.reject("no file service");return u},
loadWorkspaces:function(){var u=new d.Deferred;u.reject("no file service");return u},loadWorkspace:function(){var u=new d.Deferred;window.setTimeout(function(){u.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"File Servers",Location:"/",Children:v,ChildrenLocation:"/"})},100);return u},search:h,createProject:h,createFolder:h,createFile:h,deleteFile:h,moveFile:h,copyFile:h,read:h,write:h};for(g=0;g<j.length;++g){v[g]={Directory:true,Length:0,LocalTimeStamp:0,Location:j[g].getProperty("top"),
ChildrenLocation:j[g].getProperty("top"),Name:j[g].getProperty("Name")};i=j[g].getProperty("pattern")||".*";if(i[0]!=="^")i="^"+i;n[g]=new RegExp(i);p[g]=f.getService(j[g]);t[g]=j[g].getProperty("Name")}this._getServiceIndex=function(u){if(u==="/")return-1;else if(!u||u.length&&u.length===0)return 0;for(var q=0;q<n.length;++q)if(n[q].test(u))return q;throw"No Matching FileService for location:"+u;};this._getService=function(u){u=this._getServiceIndex(u);return u===-1?r:p[u]};this._getServiceName=
function(u){u=this._getServiceIndex(u);return u===-1?r.Name:t[u]}}c.prototype={fileServiceName:function(f){return this._getServiceName(f)},fetchChildren:function(f){return a(this._getService(f),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(f){return a(this._getService(f),"loadWorkspace",arguments)},createProject:function(f){return a(this._getService(f),
"createProject",arguments)},createFolder:function(f){return a(this._getService(f),"createFolder",arguments)},createFile:function(f){return a(this._getService(f),"createFile",arguments)},deleteFile:function(f){return a(this._getService(f),"deleteFile",arguments)},moveFile:function(f,g,h){var i=this._getService(f),j=this._getService(g);if(i===j)return a(i,"moveFile",arguments);var l=f[f.length-1]==="/",n=g;if(n[n.length-1]!=="/")n+="/";if(h)n+=encodeURIComponent(h);else{var p=f;if(l)p=p.substring(0,
p.length-1);n+=p.substring(p.lastIndexOf("/")+1)}if(l&&n[n.length-1]!=="/")n+="/";return b(i,f,j,n).then(function(){return a(i,"deleteFile",[f])})},copyFile:function(f,g){var h=this._getService(f),i=this._getService(g);if(h===i)return a(h,"copyFile",arguments);var j=f[f.length-1]==="/",l=g;if(l[l.length-1]!=="/")l+="/";var n=f;if(j)n=n.substring(0,n.length-1);l+=n.substring(n.lastIndexOf("/")+1);if(j&&l[l.length-1]!=="/")l+="/";return b(h,f,i,l)},read:function(f){return a(this._getService(f),"read",
arguments)},write:function(f){return a(this._getService(f),"write",arguments)},remoteImport:function(f){return a(this._getService(f),"remoteImport",arguments)},remoteExport:function(f){return a(this._getService(f),"remoteExport",arguments)},search:function(f){return a(this._getService(f),"search",arguments)}};c.prototype.constructor=c;return{FileClient:c}});
define("orion/operationsClient",["dojo","orion/auth","dojo/DeferredList"],function(d,e){function a(l,n,p){var t=new d.Deferred;l[n].apply(l,p).then(function(v){t.callback(v)},function(v){v.status===401?e.handleAuthenticationError(v,function(){l[n].apply(l,p).then(function(r){t.callback(r)},function(r){t.errback(r)})}):t.errback(v)});return t}function b(l,n){return a(l,"getOperations",[n])}function c(l){this._location=l}function f(){var l=new d.Deferred;l.errback("No Matching OperationService for location:"+
this._location);return l}function g(l){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];for(var n=l.getServiceReferences("orion.core.operation"),p=0;p<n.length;p++){var t=l.getService(n[p]);this._services[p]=t;t=n[p].getProperty("pattern")||".*";if(t[0]!=="^")t="^"+t;this._patterns[p]=new RegExp(t)}this._getService=function(v){if(!v)return this._services[0];for(var r=0;r<this._patterns.length;++r)if(this._patterns[r].test(v))return this._services[r];return new c(v)}}
function h(l){if(l.length===1){if(l[0][0])return l[0][1];console.error(l[0][1]);return{Children:[]}}for(var n={Children:[]},p=0;p<l.length;p++)if(l[p][0]){if(l[p][1]&&l[p][1].Children)n.Children=n.Children.concat(l[p][1].Children)}else console.error(l[p][1]);return n}function i(l,n,p){var t=this,v={Longpolling:true};if(p)v.LongpollingId=p;a(l,"getOperations",[v]).then(function(r){if(!(p&&t._currentLongpollingIds.indexOf(p)<0)){n(r,p);if(r.LongpollingId){t._currentLongpollingIds.push(r.LongpollingId);
d.hitch(t,i)(l,n,r.LongpollingId)}else d.hitch(t,i)(l,n,p)}},function(r){p&&t._currentLongpollingIds.indexOf(p)<0||("timeout"===r.dojoType?d.hitch(t,i)(l,n,p):setTimeout(function(){d.hitch(t,i)(l,n,p)},2E3))})}function j(l){for(var n=0;n<this._operationListeners.length;n++)this._operationListeners[n](l)}c.prototype={getOperation:f,getOperations:f,removeCompletedOperations:f,removeOperation:f,cancelOperation:f};c.prototype.constructor=c;g.prototype={getOperations:function(){var l=new d.Deferred,n=
[];if(this._services.length<1){l.errback("No operations services registered.");return l}for(var p=0;p<this._services.length;p++)n[p]=b(this._services[p]);(new d.DeferredList(n)).then(function(t){l.resolve(h(t))});return l},getRunningOperations:function(){var l=new d.Deferred,n=[];if(this._services.length<1){l.errback("No operations services registered.");return l}for(var p=0;p<this._services.length;p++)n[p]=b(this._services[p],{RunningOnly:true});(new d.DeferredList(n)).then(function(t){l.resolve(h(t))});
return l},getOperation:function(l){return a(this._getService(l),"getOperation",arguments)},removeCompletedOperations:function(){var l=[];if(this._services.length<1){result.errback("No operations services registered.");return result}for(var n=0;n<this._services.length;n++)l[n]=a(this._services[n],"removeCompletedOperations");return new d.DeferredList(l)},removeOperation:function(l){return a(this._getService(l),"removeOperation",arguments)},cancelOperation:function(l){return a(this._getService(l),"cancelOperation",
arguments)},addOperationChangeListener:function(l){this._operationListeners.push(l);if(this._operationListeners.length===1){if(this._services.length<1)throw"No operations services registered.";for(l=0;l<this._services.length;l++)d.hitch(this,i)(this._services[l],d.hitch(this,j))}},removeOperationChangeListener:function(l){for(var n=0;n<this._operationListeners.length;n++)if(this._operationListeners[n]===l){this._operationListeners.splice(n,1);break}if(this._operationListeners.length===0)this._currentLongpollingIds=
[]},resetChangeListeners:function(){this._currentLongpollingIds=[];if(this._services.length<1)throw"No operations services registered.";for(var l=0;l<this._services.length;l++)d.hitch(this,i)(this._services[l],d.hitch(this,j))}};g.prototype.constructor=g;return{OperationsClient:g}});
define("orion/searchUtils",["require","dojo","orion/editor/regex"],function(d,e,a){var b=b||{};b.searchUtils=b.searchUtils||{};b.searchUtils.parseQueryStr=function(c){var f=c.indexOf("?"),g=c.indexOf("q=");if(f<g&&g>0)c=c.substring(f+1);f=c.split("&");c={queryStr:c,start:0,rows:10,sort:"Path asc",replace:null};for(g=0;g<f.length;g++){var h=f[g].indexOf("q="),i=f[g].indexOf("replace=");if(h>=0)b.searchUtils.parseLocationAndSearchStr(f[g].substring(h+2),c);else if(i>=0)c.replace=f[g].substring(i+8);
else{h=f[g].split("=");if(h.length===2)if(h[0]==="rows")c.rows=parseInt(h[1]);else if(h[0]==="start")c.start=parseInt(h[1]);else if(h[0]==="sort")c.sort=h[1]}}return c};b.searchUtils.copyQueryParams=function(c,f){return{sort:c.sort,rows:c.rows,start:c.start,searchStr:c.searchStr,location:c.location,replace:f?c.replace:null}};b.searchUtils.generateSearchHref=function(c){return d.toUrl("search/search.html")+"#"+b.searchUtils.generateSearchQuery(c)};b.searchUtils.generateSearchQuery=function(c){var f=
"Path asc",g=40,h=0,i="",j="",l="";if(c){if(c.sort)f=c.sort;if(c.rows)g=c.rows;if(c.start)h=c.start;if(c.searchStr){i=c.searchStr;i=i.split(" ").join("")}if(c.location){j=c.location;if(j.length>0&&j[j.length-1]!=="*")j+="*";if(j!=="")j="+Location:"+j}if(c.replace!==null&&c.replace!==undefined)l="&replace="+c.replace}return"?sort="+f+"&rows="+g+"&start="+h+"&q="+i+j+l};b.searchUtils.parseLocationAndSearchStr=function(c,f){var g=c.indexOf("+Location:")>-1;f.location="";f.searchStr=c;if(g){c=c.split("+Location:");
if(c.length===2){g=c[1];if(g.length>0&&g[g.length-1]==="*")g=g.substring(0,g.length-1);f.location=g;f.searchStr=c[0].split(" ").join("")}}f.searchStrTitle=f.searchStr.split("\\").join("");f.inFileQuery=b.searchUtils.generateInFileQuery(f.searchStr)};b.searchUtils.generateInFileQuery=function(c){var f={},g=c.indexOf("*")>-1,h=c.indexOf("?")>-1;if(g)c=c.split("*").join(".*");if(h)c=c.split("?").join(".");if(!g&&!h){f.searchStr=c.split("\\").join("").toLowerCase();f.wildCard=false}else{f.searchStr=c.toLowerCase();
if(g=a.parse("/"+f.searchStr+"/")){c=g.pattern;g=g.flags;g+=g.indexOf("i")===-1?"i":"";f.regExp={pattern:c,flags:g};f.wildCard=true}}f.searchStrLength=f.searchStr.length;return f};b.searchUtils.replaceRegEx=function(c,f,g){return c.replace(new RegExp(f.pattern,f.flags),g)};b.searchUtils.replaceStringLiteral=function(c,f,g){f=a.parse("/"+f+"/gim");return b.searchUtils.replaceRegEx(c,f,g)};b.searchUtils.searchOnelineLiteral=function(c,f,g){var h;h=0;for(var i=false,j=[];;){h=f.indexOf(c.searchStr,h);
if(h<0)break;else{j.push({startIndex:h});i=true;if(g)break;h=h+c.searchStrLength}}if(i)return j;return null};b.searchUtils.findRegExp=function(c,f,g,h){if(!f)return null;g=g||"";g+=(g.indexOf("g")===-1?"g":"")+(g.indexOf("m")===-1?"m":"");var i=null;return(i=(new RegExp(f,g)).exec(c.substring(h)))&&{startIndex:i.index+h,length:i[0].length}};b.searchUtils.searchOnelineRegEx=function(c,f,g){for(var h=0,i=false,j=[];;)if(h=b.searchUtils.findRegExp(f,c.regExp.pattern,c.regExp.flags,h)){j.push(h);i=true;
if(g)break;h=h.startIndex+h.length}else break;if(i)return j;return null};b.searchUtils.generateNewContents=function(c,f,g,h,i){if(g&&c){var j;j=f.length>0?true:false;for(var l=0;l<c.length;l++){for(var n=c[l],p=false,t=false,v=[],r,u=0,q=0;q<g.children.length;q++)if(g.children[q].lineNumber-1===l){u=q;for(p=0;p<g.children[q].matches.length;p++)g.children[q+p].checked!==false&&v.push(p);t=v.length>0;r=g.children[q].matches;p=true;break}if(p){if(t){v=b.searchUtils.replaceCheckedMatches(n,h,r,v,i);n=
v.replacedStr;for(p=0;p<g.children[u].matches.length;p++)g.children[u+p].newMatches=v.newMatches}else{n=n;for(p=0;p<g.children[u].matches.length;p++)g.children[u+p].newMatches=g.children[u+p].matches}if(j)f[l]=n;else f.push(n)}else j||f.push(n)}}};b.searchUtils.generateMatchContext=function(c,f,g){var h=[],i=c*2+1,j;if(f.length<=i){j=0;c=f.length-1}else{j=g-c;if(j<0){j=0;c=j+i-1}else{c=g+c;if(c>f.length-1){c=f.length-1;j=c-i+1}}}for(i=j;i<=c;i++)h.push({context:f[i],current:i===g});return h};b.searchUtils.searchWithinFile=
function(c,f,g,h,i){g=g.split(h);if(i)f.contents=g;if(f){f.children=[];for(var j=h=0;j<g.length;j++){var l=g[j];if(l&&l.length>0){var n=l.toLowerCase();if(n=c.wildCard?b.searchUtils.searchOnelineRegEx(c,n):b.searchUtils.searchOnelineLiteral(c,n)){var p=j+1;if(i)for(var t=0;t<n.length;t++){var v=t+1;v={parent:f,checked:f.checked,type:"detail",matches:n,lineNumber:p,matchNumber:v,name:l,location:f.location+"-"+p+"-"+v};f.children.push(v)}else{v={parent:f,context:b.searchUtils.generateMatchContext(2,
g,j),checked:f.checked,type:"detail",matches:n,lineNumber:p,name:l,linkLocation:f.linkLocation+",line="+p,location:f.location+"-"+p};f.children.push(v)}h+=n.length}}}f.totalMatches=h}};b.searchUtils.replaceCheckedMatches=function(c,f,g,h,i){i=i;for(var j=0,l="",n=[],p=0;p<g.length;p++){if(j!==g[p].startIndex)l+=c.substring(j,g[p].startIndex);if(g[p].length)i=g[p].length;j=false;for(var t=0;t<h.length;t++)if(h[t]===p){j=true;break}if(j){n.push({startIndex:l.length,length:f.length});l+=f}else{n.push({startIndex:l.length,
length:i});l+=c.substring(g[p].startIndex,g[p].startIndex+i)}j=g[p].startIndex+i}if(j<c.length-1)l+=c.substring(j);return{replacedStr:l,newMatches:n}};b.searchUtils.fullPathNameByMeta=function(c){var f=c.length,g="";if(f>0)for(f=f-1;f>-1;f--)g=g+(g===""?"":"/")+c[f].Name;return g};b.searchUtils.path2FolderName=function(c,f,g){return c.substring(0,c.length-f.length-(g?0:1))};return b.searchUtils});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(d,e){d.declare("dijit.layout.BorderContainer",e.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var b=a.region;if(b){this.inherited(arguments);d.addClass(a.domNode,this.baseClass+"Pane");var c=this.isLeftToRight();if(b=="leading")b=c?"left":"right";if(b=="trailing")b=c?"right":"left";if(b!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=d.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");c=new f({id:a.id+"_splitter",container:this,child:a,region:b,live:this.liveSplitters});c.isSplitter=
true;a._splitterWidget=c;d.place(c.domNode,a.domNode,"after");c.startup()}a.region=b}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var b=a.region,c=a._splitterWidget;if(c){c.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();d.removeClass(a.domNode,this.baseClass+"Pane");d.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
d.style(a.domNode,b=="top"||b=="bottom"?"width":"height","auto")},getChildren:function(){return d.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return d.filter(this.getChildren(),function(b){return b.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=d.getComputedStyle(a);this.pe=d._getPadExtents(a,this.cs);this.pe.r=d._toPixelValue(a,this.cs.paddingRight);this.pe.b=d._toPixelValue(a,this.cs.paddingBottom);
d.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,b){if(this._borderBox&&this._borderBox.h){var c=d.map(this.getChildren(),function(g,h){return{pane:g,weight:[g.region=="center"?Infinity:0,g.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(g.region)?1:-1),h]}},this);c.sort(function(g,h){g=g.weight;h=h.weight;for(var i=0;i<g.length;i++)if(g[i]!=h[i])return g[i]-h[i];return 0});var f=[];d.forEach(c,function(g){g=g.pane;f.push(g);g._splitterWidget&&f.push(g._splitterWidget)});
e.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},f,a,b)}},destroyRecursive:function(){d.forEach(this.getChildren(),function(a){var b=a._splitterWidget;b&&b.destroy();delete a._splitterWidget});this.inherited(arguments)}});d.extend(e._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});d.declare("dijit.layout._Splitter",[e._Widget,e._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=d.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",b=d.marginBox(this.child.domNode)[a],c=d.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=d.marginBox(c.domNode)[a];return Math.min(this.child.maxSize,b+a)},_startDrag:function(a){if(!this.cover){this.cover=d.doc.createElement("div");d.addClass(this.cover,"dijitSplitterCover");d.place(this.cover,this.child.domNode,"after")}d.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
d.addClass(this.domNode,"dijitSplitterShadow");d.place(this.fake,this.domNode,"after")}d.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)d.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var b=this._factor,c=this.horizontal,f=c?"pageY":"pageX",g=a[f],h=this.domNode.style;c=c?"h":"w";var i=d.marginBox(this.child.domNode)[c],j=this._computeMaxSize(),l=this.child.minSize||20;c=this.region;var n=c==
"top"||c=="bottom"?"top":"left",p=parseInt(h[n],10),t=this._resize,v=d.hitch(this.container,"_layoutChildren",this.child.id);c=d.doc;this._handlers=(this._handlers||[]).concat([d.connect(c,"onmousemove",this._drag=function(r,u){r=r[f]-g;var q=b*r+i,x=Math.max(Math.min(q,j),l);if(t||u)v(x);h[n]=r+p+b*(x-q)+"px"}),d.connect(c,"ondragstart",d.stopEvent),d.connect(d.body(),"onselectstart",d.stopEvent),d.connect(c,"onmouseup",this,"_stopDrag")]);d.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";d.toggleClass(this.domNode,"dijitSplitterHover",a);d.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&d.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);d.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)d.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){d.forEach(this._handlers,d.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var b=this.horizontal,c=1,f=d.keys;switch(a.charOrCode){case b?f.UP_ARROW:f.LEFT_ARROW:c*=-1;case b?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}b=d._getMarginSize(this.child.domNode)[b?"h":"w"]+this._factor*c;this.container._layoutChildren(this.child.id,Math.max(Math.min(b,this._computeMaxSize()),
this.child.minSize));d.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});d.declare("dijit.layout._Gutter",[e._Widget,e._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return e.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchUtils","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,e,a,b,c,f){function g(h){this.registry=h.serviceRegistry;this._commandService=h.commandService;(this._fileService=h.fileService)||console.error("No file service on search client")}g.prototype={search:function(h,i,j){i=f.parseQueryStr(h);try{this._fileService.search(i.location,h).then(function(n){var p=n.responseHeader.params.q;
p=p.substring(p.indexOf("}")+1);j(function(t){for(var v=[],r=0;r<t.response.docs.length;r++){var u=t.response.docs[r];v.push({name:u.Name,path:u.Location,folderName:f.path2FolderName(u.Path,u.Name),directory:u.Directory,lineNumber:u.LineNumber})}return v}(n),p)})}catch(l){this.registry.getService("orion.page.message").setErrorMessage(l)}},handleError:function(h,i){console.error(h);var j=document.createTextNode(h);e.place(j,i,"only");return h},setLocationByMetaData:function(h,i){var j="",l=null;if(i&&
h&&h.Parents&&h.Parents.length>0)l=i.index==="last"?h.Parents[h.Parents.length-1]:h.Parents[0];else if(h&&h.Directory&&h.Location&&h.Parents)l=h;if(l){this.setLocationByURL(l.Location);j=l.Name}else if(h)j=this._fileService.fileServiceName(h&&h.Location);if((h=e.byId("search"))&&h.placeholder)h.placeholder=j.length>23?"Search "+j.substring(0,20)+"...":"Search "+j;if(h&&h.title)h.title="Type a keyword or wild card to search in "+j},setLocationByURL:function(h){this.location=h},createSearchQuery:function(h,
i,j,l){j||(j="Path");j+=" asc";if(i){h=/\*$/.test(i)?"":"*";return f.generateSearchQuery({sort:j,rows:100,start:0,searchStr:"Name:"+this._luceneEscape(i,true)+h})}return f.generateSearchQuery({sort:j,rows:40,start:0,searchStr:this._luceneEscape(h,true),location:l?"":this.location})},_luceneEscape:function(h,i){var j="";i='+-&|!(){}[]^"~:\\'+(!i?"*?":"");for(var l=0;l<h.length;l++){var n=h.charAt(l);if(i.indexOf(n)>=0)j+="\\";j+=n}return j},defaultRenderer:{makeRenderFunction:function(h,i,j,l){function n(p,
t){var v=function(){function m(w,y){w.appendChild(document.createTextNode(" - "+(y.folderName?y.folderName:y.path)+" "))}function o(w,y){var B=y.name;if(s.hasOwnProperty(B)){m(w,y);var A=s[B];if(typeof A==="function"){s[B]=null;A()}}else s[B]=function(){m(w,y)}}var s={};return o}(),r=false;e.empty(h);if(p&&p.length>0){for(var u=document.createElement("table"),q=0;q<p.length;q++){var x=p[q],z;if(!r){r=true;if(i){z=u.insertRow(0).insertCell(0);z.innerHTML=i}}z=u.insertRow(-1).insertCell(0);z.colspan=
2;l&&l(z);var C=document.createElement("a");e.place(document.createTextNode(x.name),C);x.LineNumber&&e.place(document.createTextNode(" (Line "+x.LineNumber+")"),C);var k=x.location;if(x.isExternalResource)k=x.path;else{k=x.directory?d.toUrl("navigate/table.html")+"#"+x.path:d.toUrl("edit/edit.html")+"#"+x.path;if(k==="#")k=""}C.setAttribute("href",k);e.style(C,"verticalAlign","middle");z.appendChild(C);v(z,x)}e.place(u,h,"last");typeof j==="function"&&j(h)}if(!r)if(t){p=e.place("<div>No matches found for </div>",
h,"only");p=e.create("b",null,p,"last");e.place(document.createTextNode(t),p,"only");typeof j==="function"&&j(h)}}return n}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/treetable",["dojo"],function(d){function e(a){this._init(a)}e.prototype={_init:function(a){var b=a.parent,c=this;if(typeof b==="string")b=d.byId(b);if(!b)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=b;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===undefined?false:a.showRoot;this._indent=a.indent===undefined?16:a.indent;this._onCollapse=a.onCollapse;this._labelColumnIndex=a.labelColumnIndex===undefined?
0:a.labelColumnIndex;this._id=a.id===undefined?"treetable":a.id;this._tableStyle=a.tableStyle;this._root=this._treeModel.getRoot(function(f){if(this._showRoot){f._depth=0;this._generate([f],0)}else c._treeModel.getChildren(f,function(g){c._generate(g,0)})})},_generate:function(a,b){d.empty(this._parent);var c=document.createElement("table");c.id=this._id;this._tableStyle&&d.addClass(c,this._tableStyle);this._renderer.initTable(c,this);var f=document.createElement("tbody");f.id=this._id+"tbody";this._generateChildren(a,
b,f,"last");c.appendChild(f);this._parent.appendChild(c);this._rowsChanged()},_generateChildren:function(a,b,c,f){for(var g in a){var h=document.createElement("tr");h.id=this._treeModel.getId(a[g]);h._depth=b;h._item=a[g];this._renderer.render(a[g],h);d.style(h.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*b+"px");d.place(h,c,f);if(f==="after")c=h}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},
refresh:function(a,b,c,f,g,h){var i=this._treeModel.getId(a),j;if(i===this._id){this._removeChildRows(i);this._generateChildren(b,0,d.byId(i+"tbody"),"last");this._rowsChanged()}else{var l=d.byId(i);if(l){l._item=a;if(l&&(c||l._expanded)){l._expanded=true;this._removeChildRows(i);this._renderer.updateExpandVisuals(l,true);if(b){this._generateChildren(b,l._depth+1,l,"after");this._rowsChanged();if(f&&g){a=d.byId(f);d.addClass(a,g);h&&d.removeClass(a,h)}}else{j=this;b=this._treeModel.getChildren(l._item,
function(n){j._generateChildren(n,l._depth+1,l,"after");j._rowsChanged()})}}else this._renderer.updateExpandVisuals(l,false)}else console.log("could not find table row "+i)}},refreshAndExpand:function(a,b,c,f,g){this.refresh(a,b,true,c,f,g)},getItem:function(a){if(typeof a==="string"){var b=d.byId(a);if(b)return b._item}if(a._item)return a._item;return a},toggle:function(a,b,c,f){var g=d.byId(a);if(g)if(g._expanded){this.collapse(a);if(b){a=d.byId(b);d.addClass(a,f);d.removeClass(a,c)}}else{this.expand(a);
if(b){a=d.byId(b);d.addClass(a,c);d.removeClass(a,f)}}},isExpanded:function(a){if(a=d.byId(a))return a._expanded;return false},expand:function(a,b,c){a=typeof a==="string"?a:this._treeModel.getId(a);var f=d.byId(a);if(f)if(!f._expanded){f._expanded=true;var g=this;this._renderer.updateExpandVisuals(f,true);this._treeModel.getChildren(f._item,function(h){g._generateChildren(h,f._depth+1,f,"after");g._rowsChanged();b&&b.apply(this,c)})}},_removeChildRows:function(a){d.byId(this._id);var b=a===this._id,
c=false,f=-1,g=[];d.query(".treeTableRow").forEach(function(j){if(!c)if(b)if(j._depth>f)g.push(j);else c=true;else if(j.id===a){b=true;f=j._depth}});for(var h in g){var i=g[h];i.parentNode.removeChild(i)}},collapse:function(a){a=typeof a==="string"?a:this._treeModel.getId(a);var b=d.byId(a);if(b){if(!b._expanded)return;b._expanded=false;this._renderer.updateExpandVisuals(b,false);this._removeChildRows(a);this._rowsChanged()}this._onCollapse&&this._onCollapse(b._item)}};e.prototype.constructor=e;return{TableTree:e}});
define("orion/explorer",["require","dojo","orion/treetable"],function(d,e,a){var b={};b.Explorer=function(){function c(f,g,h){this.registry=f;this.renderer=h;this.selection=g;this.myTree=null}c.prototype={changedItem:function(f,g){e.hitch(this.myTree,this.myTree.refreshAndExpand)(f,g)},updateCommands:function(f){this.myTree&&e.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(f))},makeNewItemPlaceHolder:function(f,g,h){f=this.getRow(f);if(h){f=f.childNodes[h];e.place("<br><span id='"+
g+"placeHolderRow'></span>",f,"last");if(h=e.byId(g+"placeHolderRow"))return{tempNode:h,refNode:h}}if(f){e.place("<tr id='"+g+"placeHolderRow'><td id='"+g+"placeHolderCol'></td>",f,"after");h=e.byId(g+"placeHolderRow");f=e.byId(g+"placeHolderCol");if(h&&f)return{tempNode:h,refNode:f}}return null},getRow:function(f){if(f=this.model.getId(f))return e.byId(f)},createTree:function(f,g,h){var i=f+"innerTree",j=e.byId(i);j&&e.destroy(j);if(g)g.rootId=i;this.model=g;this.myTree=new a.TableTree({id:i,model:g,
showRoot:false,parent:f,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,indent:h?h.indent:undefined,onCollapse:h?h.onCollapse:undefined,tableStyle:"mainPadding"});this.renderer._initializeUIState()},getRootPath:function(){if(this.model&&this.model.root)return this.model.root.Location;return null},_lastHash:null,checkbox:this.checkbox||true};return c}();b.ExplorerModel=function(){function c(f,g){this.rootPath=f;this.fetchItems=g}c.prototype={destroy:function(){},getRoot:function(f){this.fetchItems(this.rootPath).then(e.hitch(this,
function(g){this.root=g;f(g)}))},getChildren:function(f,g){if(f.Children)g(f.Children);else f.ChildrenLocation?this.fetchItems(f.ChildrenLocation).then(e.hitch(this,function(h){f.Children=h;g(h)})):g([])},getId:function(f){if(f.Location===this.root.Location)return this.rootId;f=f.Location.replace(/[\\\/]/g,"");for(var g="",h=0;h<f.length;h++)g+=f[h].match(/[^\.\:\-\_0-9A-Za-z]/g)?f.charCodeAt(h):f[h];return g}};return c}();b.ExplorerFlatModel=function(){function c(f,g,h){this.rootPath=f;this.fetchItems=
g;this.root=h}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(f){this.root?f(this.root):this.fetchItems(this.rootPath).then(e.hitch(this,function(g){this.root=g;f(g)}))};c.prototype.getChildren=function(f,g){f===this.root?g(this.root):g([])};return c}();b.ExplorerRenderer=function(){function c(f,g){this.explorer=g;this._init(f);this._expandImageClass="core-sprite-twistie_open";this._collapseImageClass="core-sprite-twistie_closed";this._twistieSpriteClass="modelDecorationSprite"}c.prototype=
{getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(f,g){this.tableTree=g;e.empty(f);e.addClass(f,"treetable");this.renderTableHeader(f)},getActionsColumn:function(f,g,h,i){h=h||"tool";var j=this.explorer.registry.getService("orion.page.command"),l=document.createElement("td");l.id=g.id+"actionswrapper";i&&e.addClass(l,i);j.renderCommands(l,"object",f,this.explorer,h,false,null,"commandActiveItem","commandInactiveItem");return l},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(f,g){if(this._useCheckboxSelection){var h=document.createElement("td"),i=document.createElement("span");i.id=this.getCheckBoxId(g.id);e.addClass(i,"core-sprite-check selectionCheckmarkSprite");i.itemId=g.id;if(this.getCheckedFunc){i.checked=this.getCheckedFunc(f);this._highlightSelection&&e.toggleClass(g,"checkedRow",i.checked);e.toggleClass(i,"core-sprite-check_on",i.checked)}h.appendChild(i);e.connect(i,"onclick",e.hitch(this,function(j){this.onCheck(g,j.target,j.target.checked?
false:true,true)}));return h}},getCheckBoxId:function(f){return f+"selectedState"},onCheck:function(f,g,h,i){g.checked=h;this._highlightSelection&&f&&e.toggleClass(f,"checkedRow",h);e.toggleClass(g,"core-sprite-check_on",h);this.onCheckedFunc&&this.onCheckedFunc(g.itemId,h,i);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},_storeSelections:function(){var f=this.getSelectedIds(),g=this._getUIStatePreferencePath();if(g&&window.sessionStorage)window.sessionStorage[g+
"selection"]=JSON.stringify(f)},_restoreSelections:function(f){f=window.sessionStorage[f+"selection"];if(typeof f==="string")f=f.length>0?JSON.parse(f):null;var g;if(f)for(g=0;g<f.length;g++){var h=e.byId(f[g]);if(h){this._highlightSelection&&e.addClass(h,"checkedRow");if(h=e.byId(this.getCheckBoxId(h.id))){h.checked=true;e.addClass(h,"core-sprite-check_on")}}}f=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(f)},_storeExpansions:function(f){window.sessionStorage[f+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(f){var g=false,h=window.sessionStorage[f+"expanded"];if(typeof h==="string")h=h.length>0?JSON.parse(h):null;var i;if(h)for(i=0;i<h.length;i++)if(e.byId(h[i])){this._expanded.push(h[i]);this.tableTree.expand(h[i],e.hitch(this,function(){this._restoreSelections(f)}));g=true}return!g},_getUIStatePreferencePath:function(){if(this.explorer){var f=this.explorer.getRootPath();if(this._cachePrefix&&f)return"/"+this._cachePrefix+"/"+f.replace(/[^\.\:\-\_0-9A-Za-z]/g,
"")+"/uiState"}return null},expandCollapseImageId:function(f){return f+"__expand"},updateExpandVisuals:function(f,g){if(f=e.byId(this.expandCollapseImageId(f.id))){e.addClass(f,g?this._expandImageClass:this._collapseImageClass);e.removeClass(f,g?this._collapseImageClass:this._expandImageClass)}},getExpandImage:function(f,g,h,i){var j=e.create("span",{id:this.expandCollapseImageId(f.id)},g,"last");e.addClass(j,this._twistieSpriteClass);e.addClass(j,this._collapseImageClass);if(h){g=e.create("span",
null,g,"last");e.addClass(g,i||"imageSprite");e.addClass(g,h)}j.onclick=e.hitch(this,function(){this.tableTree.toggle(f.id,this.expandCollapseImageId(f.id),this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(f.id))this._expanded.push(f.id);else for(var l in this._expanded)if(this._expanded[l]===f.id){this._expanded.splice(l,1);break}(l=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(l)});return j},render:function(f,g){g.cellSpacing="8px";this.renderRow(f,
g)},getSelected:function(){var f=[];e.query(".core-sprite-check_on").forEach(e.hitch(this,function(g){f.push(this.tableTree.getItem(g.parentNode.parentNode))}));return f},getSelectedIds:function(){var f=[];e.query(".core-sprite-check_on").forEach(e.hitch(this,function(g){f.push(g.parentNode.parentNode.id)}));return f},rowsChanged:function(){this._decorateAlternatingLines&&e.query(".treeTableRow").forEach(function(f,g){if(g%2){e.addClass(f,"darkTreeTableRow");e.removeClass(f,"lightTreeTableRow")}else{e.addClass(f,
"lightTreeTableRow");e.removeClass(f,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var f=this.explorer.registry;e.query(".treeTableRow").forEach(function(g){var h=e.byId(g.id+"actionswrapper");e.empty(h);f.getService("orion.page.command").renderCommands(h,"object",g._item,this.explorer,"tool")})},_init:function(f){if(f){this._useCheckboxSelection=f.checkbox===undefined?false:f.checkbox;this._colums=f.colums||[];
this._cachePrefix=f.cachePrefix;this.getCheckedFunc=f.getCheckedFunc;this.onCheckedFunc=f.onCheckedFunc;this._highlightSelection=true;if(f.highlightSelection===false)this._highlightSelection=false;this._decorateAlternatingLines=true;if(f.decorateAlternatingLines===false)this._decorateAlternatingLines=false}},_initializeUIState:function(){this._expanded=[];var f=this._getUIStatePreferencePath();f&&window.sessionStorage&&this._restoreExpansions(f)&&this._restoreSelections(f)}};return c}();b.SelectionRenderer=
function(){function c(f,g){this._init(f);this.explorer=g}c.prototype=new b.ExplorerRenderer;c.prototype.renderTableHeader=function(f){var g=document.createElement("thead"),h=document.createElement("tr");e.addClass(g,"navTableHeading");this._useCheckboxSelection&&h.appendChild(this.initCheckboxColumn(f));for(var i=0,j=this.getCellHeaderElement(i);j;){j.innerHTML.length>0&&e.addClass(j,"navColumn");h.appendChild(j);j=this.getCellHeaderElement(++i)}g.appendChild(h);f.appendChild(g)};c.prototype.renderRow=
function(f,g){e.style(g,"verticalAlign","baseline");e.addClass(g,"treeTableRow");var h=this.getCheckboxColumn(f,g);if(h){e.addClass(h,"checkColumn");g.appendChild(h)}h=0;for(var i=this.getCellElement(h,f,g);i;){g.appendChild(i);e.addClass(i,"secondaryColumn");i=this.getCellElement(++h,f,g)}};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();return b});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(d,e){function a(f,g,h){var i=new d.Deferred;f[g].apply(f,h).then(function(j){i.callback(j)},function(j){j.status===401||j.status===403?e.handleAuthenticationError(j,function(){f[g].apply(f,h).then(function(l){i.callback(l)},function(l){i.errback(l)})}):i.errback(j)});return i}function b(f){if(f.indexOf("://")===-1){var g=document.createElement("a");g.href=f;return g.href}return f}function c(f,g){var h=f.getServiceReferences("orion.core.diff"),
i=h;if(g){i=[];for(var j=0;j<h.length;++j)g(h[j])&&i.push(h[j])}var l=[],n=[];for(j=0;j<i.length;++j){l[j]=new RegExp(i[j].getProperty("pattern")||".*");n[j]=f.getService(i[j])}this._getService=function(p){p=b(p);for(var t=0;t<l.length;++t)if(l[t].test(p))return n[t];throw"No Matching DiffService for location:"+p;}}c.prototype={getDiffContent:function(f){return a(this._getService(f),"getDiffContent",arguments)},getDiffFileURI:function(f){return a(this._getService(f),"getDiffFileURI",arguments)}};
return{DiffProvider:c}});
define("orion/compare/diff-parser",[],function(){var d=d||{};d.DiffParser=function(){function e(b,c){this._lineDelimiter=b?b:a?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=false}var a=navigator.platform.indexOf("Win")!==-1;e.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=
1},setLineDelim:function(b){this._diffLineDelimiter=this._lineDelimiter=b},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(b,c,f,g){this._init();if(c==="")return{outPutFile:b,mapper:[]};this._oFileContents=b===""?[]:b.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<c;h++){var i=this._parseHunkRange(h);i&&this._hunkRanges.push(i)}if(0===this._hunkRanges.length)return{outPutFile:b,
mapper:[]};if(this._DEBUG){console.log("***Diff contents: \n");for(b=0;b<this._diffContents.length;b++)console.log(this._diffContents[b]);console.log("***Hunk ranges: \n");console.log(JSON.stringify(this._hunkRanges))}for(b=0;b<this._hunkRanges.length;b++)this._parseHunkBlock(b);if(this._DEBUG){console.log("***Original Hunk range blocks: \n");console.log(JSON.stringify(this._oBlocks));console.log("***New Hunk range blocks: \n");console.log(JSON.stringify(this._nBlocks))}this._buildMap(f);if(this._DEBUG){console.log("***New Line at end of file(original): \n");
console.log(JSON.stringify(this._oNewLineAtEnd));console.log("***New Line at end of file(new): \n");console.log(JSON.stringify(this._nNewLineAtEnd));console.log("***Mapper: \n");this._logMap();console.log("***Total line number in original file: "+this._oFileContents.length)}if(g===undefined||!g)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var b=0;b<this._deltaMap.length;b++){console.log(JSON.stringify(this._deltaMap[b]));
if(this._deltaMap[b][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[b][0];c++)console.log("    "+this._diffContents[this._deltaMap[b][2]+c-1])}}},_logNewFile:function(){for(var b=0;b<this._nFileContents.length;b++)console.log(this._nFileContents[b])},_createBlock:function(b,c,f,g){if(!(g===f&&b===" ")){f=[f,g-f,"s"];if(b==="-")f[2]="r";else if(b==="+")f[2]="a";else if(b==="c")f[2]="c";c.push(f)}},_createMinusBlock:function(b,c,f){var g=this._oBlocks.length;
if(g===0||b!==this._oBlocks[g-1][0]){this._oBlocks.push([b===0?1:b,f]);this._nBlocks.push([c,0,-2])}else this._oBlocks[g-1][1]+=f},_createPlusBlock:function(b,c,f,g){var h=this._nBlocks.length;if(h===0||c!==this._nBlocks[h-1][0]){this._oBlocks.push([b===0?1:b,0]);this._nBlocks.push([c,f,g])}else{this._nBlocks[h-1][1]+=f;this._nBlocks[h-1][2]=g}},_parseHunkBlock:function(b){for(var c=" ",f=this._hunkRanges[b][0]+1,g=b===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[b+1][0],h=
0,i=0,j=this._hunkRanges[b][1],l=this._hunkRanges[b][3],n=f,p=f;p<g;p++)if(0!==this._diffContents[p].length){var t=this._diffContents[p][0];if(t==="\\")if("\\ No newline at end of file"===this._diffContents[p].substring(0,this._diffContents[p].length-1)||"\\ No newline at end of file"===this._diffContents[p]){if(c==="-")this._oNewLineAtEnd=false;else if(c===" ")this._oNewLineAtEnd=this._nNewLineAtEnd=false;else this._nNewLineAtEnd=false;if(p>f&&this._diffContents[p-1][this._diffContents[p-1].length-
1]==="\r")this._diffContents[p-1]=this._diffContents[p-1].substring(0,this._diffContents[p-1].length-1);continue}switch(t){case "-":case "+":case " ":break;default:continue}if(c!==t){if(t==="+")n=p;switch(c){case " ":j=this._hunkRanges[b][1]+h;l=this._hunkRanges[b][3]+i;break;case "-":this._createMinusBlock(j,l,this._hunkRanges[b][1]+h-j);break;case "+":this._createPlusBlock(j,l,this._hunkRanges[b][3]+i-l,n);break;default:}c=t}switch(t){case "-":h++;break;case "+":i++;break;case " ":h++;i++;break}}switch(c){case "-":this._createMinusBlock(j,
l,this._hunkRanges[b][1]+h-j);break;case "+":this._createPlusBlock(j,l,this._hunkRanges[b][3]+i-l,n);break}},_detectConflictes:function(b,c){if(b<0)return false;c=b+c;for(b=b;b<c;b++){var f=this._diffContents[b];if(f.indexOf("<<<<<")>-1||f.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(b){for(var c=this._oBlocks.length,f=this._oFileContents.length,g=0,h=1,i=0;i<c;i++){h=this._oBlocks[i][0]-h;if(h>0){this._deltaMap.push([h,h,0]);g+=h}b&&this._detectConflictes(this._nBlocks[i][2],
this._nBlocks[i][1])?this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1,1]):this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1]);g+=this._oBlocks[i][1];h=this._oBlocks[i][0]+this._oBlocks[i][1]}if(0<f-h){this._deltaMap.push([f-h+1,f-h+1,0]);g+=f-h+1}if(g<f){h=f-g;b=this._deltaMap[this._deltaMap.length-1];if(b[2]===0){b[0]+=h;b[1]+=h}else if(b[2]===-1)this._deltaMap.push([h,h,0]);else if(this._nNewLineAtEnd===this._oNewLineAtEnd)this._deltaMap.push([h,
h,0]);else{if(this._nNewLineAtEnd)b[0]+=h;if(this._oNewLineAtEnd)b[1]+=h}}},_buildNewFile:function(){for(var b=1,c=false,f=this._deltaMap.length,g=0;g<f;g++){c=false;if(this._deltaMap[g][2]===0){for(var h=0;h<this._deltaMap[g][0];h++)this._nFileContents.push(this._oFileContents[b+h-1]);c=true}else if(this._deltaMap[g][2]>0)for(h=0;h<this._deltaMap[g][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+h-1].substring(1));b+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},
_parseHRangeBody:function(b,c){if(0<b.indexOf(",")){var f=b.split(",");b=parseInt(f[0]);f=parseInt(f[1]);c.push(b>=0?b:1);c.push(f>=0?f:1)}else{b=parseInt(b);c.push(b>=0?b:1);c.push(1)}},_parseHunkRange:function(b){var c=this._diffContents[b];if(!(8>c.length))if("@@"===c.substring(0,2)){c=c.substring(2);var f=c.indexOf("@@");if(!(f<0)){c=c.substring(0,f);f=c.indexOf("-");var g=c.indexOf("+");if(!(f<0||g<0)){b=[b];if(f<g){c=c.substring(f+1).split("+");this._parseHRangeBody(c[0],b);this._parseHRangeBody(c[1],
b)}else{c=c.substring(g+1).split("-");this._parseHRangeBody(c[1],b);this._parseHRangeBody(c[0],b)}return b}}}}};return e}();return d});
define("orion/compare/compareUtils",[],function(){var d=d||{};d.compareUtils=d.compareUtils||{};d.compareUtils.lookUpMapper=function(e,a,b){for(var c=0,f=0;f<e.length;f++){var g=e[f][a];if(g===0)g=1;if(b>=c&&b<c+g)return{mapperIndex:f,startFrom:c};if(f===e.length-1)break;c+=e[f][a]}return{mapperIndex:e.length-1,startFrom:c}};d.compareUtils.lookUpLineIndex=function(e,a,b){if(b===0)return 0;for(var c=0,f=0;f<b;f++)c+=e[f][a];return c};d.compareUtils.updateMapper=function(e,a,b,c,f){if(c!==f)if(c>0||
f>0){var g=d.compareUtils.lookUpMapper(e,a,b);if(!(g.mapperIndex<0)){if(c>0){c=c;var h=b-g.startFrom;for(b=g.mapperIndex;b<e.length;b++){h=e[b][a]-h;if(c<=h){e[b][a]-=c;break}e[b][a]-=h;c-=h;h=0}}if(f>0)e[g.mapperIndex][a]+=f}}};d.compareUtils.overlapMapper=function(e,a,b,c,f){e=b+e[a]-1;if(e<b)e=b;if(f<c)f=c;if(e<c||f<b)return false;return true};d.compareUtils.findFirstDiff=function(e,a,b,c){for(var f=0,g=undefined,h=0;h<e.length;h++){if(f>c)break;if(d.compareUtils.overlapMapper(e[h],a,f,b,c)){g=
{mapperIndex:h,startFrom:f};if(e[h][2]!==0)break}f+=e[h][a]}return g};d.compareUtils.matchMapper=function(e,a,b,c){if(e.length===0)return b;var f=b+Math.round((c-b)/3),g=d.compareUtils.findFirstDiff(e,a,b,c),h=e[g.mapperIndex][a]===0?g.startFrom:g.startFrom+e[g.mapperIndex][a]-1,i=d.compareUtils.lookUpLineIndex(e,1-a,g.mapperIndex),j=g.startFrom-b;if(e[g.mapperIndex][2]===0)return i-j;if(f>=g.startFrom&&f<=h)return i-Math.round((c-b)/3);if(f<g.startFrom)return i-j;return(e[g.mapperIndex][1-a]===0?
i:i+e[g.mapperIndex][1-a]-1)-(h-b)};d.compareUtils.getMapperLineCount=function(e){for(var a=0,b=0;b<e.length;b++)a+=Math.max(e[b][0],e[b][1]);return a};d.compareUtils.findNextDiff=function(e,a){var b=0;if(a>=0&&a<e.length-1)b=a+1;for(var c=b;c<e.length;c++)if(e[c][2]!==0)return c;for(c=0;c<b;c++)if(e[c][2]!==0)return c;return a};d.compareUtils.getAnnotationIndex=function(e,a){for(var b=0;b<e.length;b++)if(e[b][0]===a)return b;return-1};d.compareUtils.getAnnotationMapperIndex=function(e,a){return e[a][1]};
d.compareUtils.getAnnotationIndexByMapper=function(e,a){for(var b=0;b<e.length;b++)if(e[b][1]===a)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};d.compareUtils.isMapperConflict=function(e,a){if(a<0)return false;if(!e[a][3])return false;return e[a][3]===1};return d.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(d){var e=e||{};e.CompareRuler=function(){function a(b,c,f){this._location=b||"left";this._overview=c||"page";this._rulerStyle=f;this._editor=null;var g=this;this._listener={onModelChanged:function(h){g._onModelChanged(h)}}}a.prototype={setView:function(b){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=b;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return false},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(b,c){var f=[];for(b=b;b<c;b++){var g=this.getStyle(b);if(g)f[b]={html:this.getHTML(b),style:g}}return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();e.LineNumberCompareRuler=function(){function a(b,c,f,g,h){e.CompareRuler.call(this,c,"page",f);this._oddStyle=g||{style:{backgroundColor:"white"}};this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}a.prototype=new e.CompareRuler;a.prototype.getStyle=function(b){return b===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(b){var c=this._editor.getModel();
if(b===-1)return c.getLineCount();else{if(c.getLineNumber){b=c.getLineNumber(b,this._mapperColumnIndex);if(b===-1)return"";return b+1}return b+1}};a.prototype._onModelChanged=function(b){b=b.start;var c=this._editor.getModel(),f=c.getLineCount(),g=(f+"").length;if(this._numOfDigits!==g){this._numOfDigits=g;this._editor.redrawLines(c.getLineAtOffset(b),f,this)}};return a}();e.CompareAnnotation=function(){function a(){this._currentAnnotationIndex=0}a.prototype={init:function(b,c){this._mapper=b;this._editor=
c;this._currentAnnotationIndex=0},getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},getCurrentMapperIndex:function(){var b=this._editor.getModel().getAnnotations();return b.length===0?-1:b[this._currentAnnotationIndex][1]},matchPositionFromAnnotation:function(b){var c=b;if(b===-1)c=0;else{c=this._editor.getModel();c=d.getAnnotationIndex(c.getAnnotations(),b)}this._currentAnnotationIndex=c},gotoDiff:function(b){this._currentAnnotationIndex=b},nextDiff:function(){var b=this._editor.getModel().getAnnotations();
if(b.length!==0)if(b.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=0;else this._currentAnnotationIndex+=1},prevDiff:function(){var b=this._editor.getModel().getAnnotations();if(b.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=b.length-1;else this._currentAnnotationIndex-=1}};return a}();e.CompareOverviewRuler=function(){function a(b,c){e.CompareRuler.call(this,b,"document",c)}a.prototype=new e.CompareRuler;a.prototype.getStyle=function(b){var c,
f;if(b===undefined){c=this._rulerStyle||{};f=c.style||(c.style={});f.lineHeight="1px";f.fontSize="1px";f.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};f=c.style||(c.style={});f.cursor="pointer";f.width="8px";f.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=g.getAnnotationH(b);g=g.getLineCount();var h=this._editor.getClientArea();b=Math.floor(h.height*b/g);if(b<2)b=2;f.height=b+"px"}else f.height="3px"}return c};a.prototype.getHTML=function(){return"&nbsp;"};
a.prototype.onClick=function(b){if(b!==undefined){var c=this._editor.getLineHeight(),f=this._editor.getClientArea();c=Math.floor(f.height/c/3);this._editor.setTopIndex(b-c>0?b-c:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();e.TwoWayCompareOverviewRuler=function(){function a(b,c,f,g){this._compareAnnotaion=f;this._onClick=g;e.CompareRuler.call(this,b,"document",c)}a.prototype=new e.CompareRuler;a.prototype.getStyle=
function(b){var c,f;if(b===undefined){c=this._rulerStyle||{};f=c.style||(c.style={});f.lineHeight="1px";f.fontSize="1px";f.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};f=c.style||(c.style={});f.cursor="pointer";f.width="8px";f.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=d.getAnnotationIndex(g.getAnnotations(),b);if(b===-1)return null;var h=d.getAnnotationMapperIndex(g.getAnnotations(),b);if(h=d.isMapperConflict(g.getMapper(),h))f.border=
"1px #FF0000 solid";if(b===this._compareAnnotaion.getCurrentAnnotationIndex())f.backgroundColor=h?"red":"blue";b=g.getAnnotationH(b);g=g.getAnnotationLineCount();h=this._editor.getClientArea();g=Math.floor(h.height*b/g);if(g<2)g=2;f.height=g+"px"}else f.height="3px"}return c};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(b){b!==undefined&&this._onClick(b,this)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,
1,this)};return a}();e.CompareMatchRenderer=function(){function a(b){this._canvasDiv=b;this._mapper=undefined;this._initialized=false;this._annotation=new e.CompareAnnotation}a.prototype={init:function(b,c,f){this._initialized=true;this._mapper=b;this._leftEditor=c;this._rightEditor=f;this._annotation.init(b,f);this.render()},getAnnotation:function(){return this._annotation},getCurrentAnnotationIndex:function(){return this._annotation.getCurrentAnnotationIndex()},getCurrentMapperIndex:function(){return this._annotation.getCurrentMapperIndex()},
setOverviewRuler:function(b){this._overviewRuler=b},_setEditorPosition:function(b,c){var f=b.getLineHeight(),g=b.getClientArea();f=Math.floor(g.height/f/3);b.setTopIndex(c-f>0?c-f:0)},_findBaseLine:function(b){var c=b.getLineHeight(),f=b.getClientArea();c=Math.floor(f.height/c/3);return b.getTopIndex()+c},matchPositionFrom:function(b){var c=b?this._leftEditor:this._rightEditor,f=b?this._rightEditor:this._leftEditor,g=c.getTopIndex();c=c.getBottomIndex();b=d.matchMapper(this._mapper,b?0:1,g,c);f.setTopIndex(b)},
matchPositionFromAnnotation:function(b){if(this._initialized){this._annotation.matchPositionFromAnnotation(b);this.positionAnnotation(this._annotation.getCurrentAnnotationIndex())}},positionAnnotation:function(b){var c=this._rightEditor.getModel().getAnnotations();if(c.length!==0){this._setEditorPosition(this._rightEditor,c[b][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(c[b][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();b=this._rightEditor.getTopIndex();
this._rightEditor.redrawLines(b,b+1,this._overviewRuler)}},gotoDiff:function(b){this._annotation.gotoDiff(b);b=this._rightEditor.getTopIndex();this._leftEditor.redrawRange();this._rightEditor.redrawRange();this._rightEditor.redrawLines(b,b+1,this._overviewRuler)},nextDiff:function(){this._annotation.nextDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());this.render()},prevDiff:function(){this._annotation.prevDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());
this.render()},getMapperTextRange:function(b,c,f){var g=b.getModel().getLineIndexFromMapper(c);c=g+this._mapper[c][f]-1;g=b.getModel().getLineStart(g);b=b.getModel().getLineEnd(c,true);return{start:g,end:b}},copyToLeft:function(){var b=this.getCurrentMapperIndex(),c=this.getMapperTextRange(this._rightEditor,b,1);b=this.getMapperTextRange(this._leftEditor,b,0);this._leftEditor.setText(this._rightEditor.getText(c.start,c.end),b.start,b.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},
render:function(){if(this._mapper){var b=this._canvasDiv.getContext("2d");b.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);b.strokeStyle="#AAAAAA";b.lineWidth=1;b.beginPath();var c=this._leftEditor.getTopIndex(),f=this._leftEditor.getBottomIndex(),g=this._rightEditor.getTopIndex(),h=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var i=0,j=0,l=false,n=0;n<this._mapper.length;n++){if(this._mapper[n][2]!==
0)if(d.overlapMapper(this._mapper[n],0,i,c,f)||d.overlapMapper(this._mapper[n],1,j,g,h)){this._renderCurve(n,i,j,this._canvasDiv,b,c,f,g,h);l=true}else if(l)break;i+=this._mapper[n][0];j+=this._mapper[n][1]}b.stroke()}},_renderCurve:function(b,c,f,g,h){var i=this._mapper[b];c=this._leftEditor.getLinePixel(c+i[0]/2)+i[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();f=this._rightEditor.getLinePixel(f+i[1]/2)+i[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();g=g.parentNode.clientWidth;
if(b===this.getCurrentMapperIndex()){h.stroke();h.strokeStyle="#000";h.lineWidth=1;h.beginPath();h.moveTo(0,c);h.bezierCurveTo(g/3,c,g*0.666,f,g,f);h.stroke();h.strokeStyle="#AAAAAA";h.lineWidth=1;h.beginPath()}else{h.moveTo(0,c);h.bezierCurveTo(g/3,c,g*0.666,f,g,f);h.stroke()}},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)if(b.removedLineCount>0||b.addedLineCount>0)this.render()}};return a}();return e});
define("orion/textview/eventTarget",[],function(){function d(){}d.addMixin=function(e){var a=d.prototype;for(var b in a)if(a.hasOwnProperty(b))e[b]=a[b]};d.prototype={addEventListener:function(e,a,b){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[e];c||(c=this._eventTypes[e]={level:0,listeners:[]});c.listeners.push({listener:a,useCapture:b})},dispatchEvent:function(e){if(this._eventTypes){var a=e.type,b=this._eventTypes[a];if(b){var c=b.listeners;try{b.level++;if(c)for(var f=0,g=
c.length;f<g;f++)if(c[f]){var h=c[f].listener;if(typeof h==="function")h.call(this,e);else h.handleEvent&&typeof h.handleEvent==="function"&&h.handleEvent(e)}}finally{b.level--;if(b.compact&&b.level===0){for(e=c.length-1;e>=0;e--)c[e]||c.splice(e,1);c.length===0&&delete this._eventTypes[a];b.compact=false}}}}},isListening:function(e){if(!this._eventTypes)return false;return this._eventTypes[e]!==undefined},removeEventListener:function(e,a,b){if(this._eventTypes){var c=this._eventTypes[e];if(c){for(var f=
c.listeners,g=0,h=f.length;g<h;g++){var i=f[g];if(i&&i.listener===a&&i.useCapture===b){if(c.level!==0){f[g]=null;c.compact=true}else f.splice(g,1);break}}f.length===0&&delete this._eventTypes[e]}}}};return{EventTarget:d}});
define("orion/compare/compare-inline-model",["orion/textview/eventTarget"],function(d){var e=e||{};e.CompareTextModel=function(){function a(b,c,f){this._model=b;this._mapperColumnIndex=c.columnIndex;this._mapper=c.mapper;var g=this;this._listener={onChanging:function(h){g.onChanging(h)},onChanged:function(h){g.onChanged(h)}};b.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Changed",this._listener.onChanged);this._lineFeeder=f;this.init()}navigator.platform.indexOf("Win");
a.prototype={init:function(b,c){if(b)this._mapper=b;b=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,c);this._dummyLBlock=b.gapBlocks;this._dummyLNumber=b.gapNumber},_getDummyCharCountAt:function(b,c){if(b.blockNumber<0)return 0;for(var f=0,g=0;g<=b.blockNumber;g++){if(g>=this._dummyLBlock.length)break;for(var h=g===b.blockNumber?b.stopAtDelta:this._dummyLBlock[g][1]-1,i=0;i<=h;i++){var j=c?this._lineFeeder.getLineAt(this._dummyLBlock,g,i,true):this._lineFeeder.getLineAt(this._dummyLBlock,
g,i,!(g===b.blockNumber&&i===h));f+=j.length}}return f},lookUpRealIndex:function(b){for(var c=0,f=0,g=0;g<this._dummyLBlock.length;g++){var h=this._dummyLBlock[g][0],i=h+this._dummyLBlock[g][1]-1;if(b<h)break;if(b>=h&&b<=i)return{lineIndex:-1,gapsBefore:c+b-h,lastGapInfo:{blockNumber:g,stopAtDelta:b-h}};f=this._dummyLBlock[g][1];c+=f}return{lineIndex:b-c,gapsBefore:c,lastGapInfo:{blockNumber:g-1,stopAtDelta:f-1}}},getLineType:function(b){return this._lineFeeder.getLineType(b,this._mapperColumnIndex)},
getMapper:function(){return this._mapper},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(b){return this._lineFeeder.getAnnotationH(b)},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(b,c){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(b,c);return this.lookUpRealIndex(b).lineIndex},getCharCount:function(){var b=this._model.getCharCount();if(this._dummyLBlock.length>0)b+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-
1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-1][1]-1},true);return b},getLine:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return null;b=this.lookUpRealIndex(b);return b.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,b.lastGapInfo.blockNumber,b.lastGapInfo.stopAtDelta,c):this._model.getLine(b.lineIndex,c)},getLineAtOffset:function(b){if(!(0<=b&&b<=this.getCharCount()))return-1;for(var c=this.getLineCount(),f=0,g=0;f<c;){var h=this.lookUpRealIndex(f);if(h.lineIndex<
0)g+=this._lineFeeder.getLineAt(this._dummyLBlock,h.lastGapInfo.blockNumber,h.lastGapInfo.stopAtDelta,true).length;else{h=this._model.getLine(h.lineIndex,true);g+=h?h.length:0}f++;if(g>b)break}if(f>c)return c-1;return f-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;var g=this.lookUpRealIndex(b);f=0;if(g.lineIndex<0){f+=this._getDummyCharCountAt(g.lastGapInfo,
c);b=b-g.gapsBefore;if(b>0)f+=this._model.getLineEnd(b-1,true)}else{f+=this._getDummyCharCountAt(g.lastGapInfo,true);f+=this._model.getLineEnd(g.lineIndex,c)}return f},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;if(b===0)return 0;return this.getLineEnd(b-1,true)},getText:function(b,c){if(b===c)return this._model.getText(b,c);if(b===undefined)b=0;if(c===undefined)c=this.getCharCount();var f=this.getLineAtOffset(b),g=this.getLineAtOffset(c),h=this.getLineStart(f),i=this.getLineEnd(g,
true),j=this.getLine(f,true);if(!j)return this._model.getText(b,c);if(f===g)return j.substring(b-h,j.length-i+c);h=j.substring(b-h);j=this.getLine(g,true);if(!j)return this._model.getText(b,c);b=j.substring(0,j.length-i+c);c="";for(f=f+1;f<g;f++)c+=this.getLine(f,true);return h+c+b},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b){this._model.setText(b,0,this._model.getCharCount())}};
d.EventTarget.addMixin(a.prototype);return a}();e.DiffLineFeeder=function(){function a(b,c){if(b){this._diffLinesArray=b.array;this._diffLinesArrayIndex=b.index}this._lineDelimeter=c;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(b,c,f){var g=[];this._mapper=b;if(f){this._diffLinesArray=f.array;this._diffLinesArrayIndex=f.index}this._annotations=[];f=b=0;for(var h=1-c,i=0,j=0;j<this._mapper.length;j++){i=this._mapper[j][2]===0?this._mapper[j][c]:this._mapper[j][c]+
this._mapper[j][h];if(this._mapper[j][2]>0){var l=this._mapper[j][c];b+=l;g.push([f+this._mapper[j][h],l,this._mapper[j][2]])}this._mapper[j][2]!==0&&this._annotations.push([f,j,i]);f+=i}return{gapBlocks:g,gapNumber:b}},getLineAt:function(b,c,f,g){c=b[c][2];c+=f-1;f=this._diffLinesArray[c];f===undefined&&console.log(b);f=f.substring(this._diffLinesArrayIndex);if(g)return f+this._lineDelimeter;return f},getLineType:function(b,c){for(var f=0,g=1-c,h=0,i=0;i<this._mapper.length;i++){h=this._mapper[i][2]===
0?this._mapper[i][c]:this._mapper[i][c]+this._mapper[i][g];if(b>=f&&b<f+h){if(this._mapper[i][2]===0)return{type:"unchnaged",mapperIndex:i};else if(this._mapper[i][2]<0)return{type:"removed",mapperIndex:i};else if(this._mapper[i][1]===0)return{type:"added",mapperIndex:i};else if(b<this._mapper[i][g]+f)return{type:"removed",mapperIndex:i};return{type:"added",mapperIndex:i}}f+=h}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(b,c){if(this._mapper.length===0)return b;for(var f=0,g=0,
h=1-c,i=0,j=0;j<this._mapper.length;j++){i=this._mapper[j][2]===0?this._mapper[j][c]:this._mapper[j][c]+this._mapper[j][h];if(b>=f&&b<f+i){h=b-f;if(this._mapper[j][2]===0)return g+h;else if(this._mapper[j][2]<0)return c===0?-1:g+h;else if(this._mapper[j][1]===0)return c===0?g+h:-1;else if(b<this._mapper[j][1]+f)return c===0?-1:g+h;return c===0?g+h-this._mapper[j][1]:-1}f+=i;g+=this._mapper[j][c]}return b},getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};
return a}();e.GapLineFeeder=function(){function a(b){this._lineDelimeter=b;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(b,c){var f=[];this._mapper=b;this._annotations=[];for(var g=b=0,h=1-c,i=0;i<this._mapper.length;i++){if(this._mapper[i][c]<this._mapper[i][h]){var j=this._mapper[i][h]-this._mapper[i][c];b+=j;f.push([g+this._mapper[i][c],j,1])}j=Math.max(this._mapper[i][h],this._mapper[i][c]);this._mapper[i][2]!==0&&this._annotations.push([g,i,j]);
g+=j}return{gapBlocks:f,gapNumber:b}},getLineAt:function(b,c,f,g){if(g)return this._lineDelimeter;return""},getLineType:function(b,c){for(var f=0,g=1-c,h=0;h<this._mapper.length;h++){var i=Math.max(this._mapper[h][c],this._mapper[h][g]);if(b>=f&&b<f+i){if(this._mapper[h][2]===0)return"unchnaged";else if(this._mapper[h][2]<0)return"removed";else if(this._mapper[h][1]===0)return"added";else if(b<this._mapper[h][c]+f)return"changed";return"changed_gap"}f+=Math.max(this._mapper[h][c],this._mapper[h][g])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};return a}();return e});
define("orion/compare/compare-2way-model",["orion/compare/compareUtils","orion/textview/eventTarget"],function(d,e){var a=a||{};a.TwoWayCompareModel=function(){function b(c,f){this._model=c;this._mapperColumnIndex=f.columnIndex;this._mapper=f.mapper;var g=this;this._listener={onChanging:function(h){g.onChanging(h)},onChanged:function(h){g.onChanged(h)}};c.addEventListener("Changing",this._listener.onChanging);c.addEventListener("Changed",this._listener.onChanged);this.init()}navigator.platform.indexOf("Win");
b.prototype={init:function(c){this._initing=true;if(c){this._mapper=c;this._annotations=undefined}},getMapper:function(){return this._mapper},getLineType:function(c){var f=d.lookUpMapper(this._mapper,this._mapperColumnIndex,c);if(f.mapperIndex>-1)if(this._mapper[f.mapperIndex][2]!==0){var g=this._mapper[f.mapperIndex][this._mapperColumnIndex];if(g===0)return{type:"top-only",mapperIndex:f.mapperIndex};if(g===1)return{type:"oneline",mapperIndex:f.mapperIndex};if(c===f.startFrom)return{type:"top",mapperIndex:f.mapperIndex};
if(c===f.startFrom+g-1)return{type:"bottom",mapperIndex:f.mapperIndex};return{type:"middle",mapperIndex:f.mapperIndex}}return{type:"unchanged",mapperIndex:f.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var c=0,f=0;f<this._mapper.length;f++){this._mapper[f][2]!==0&&this._annotations.push([c,f]);c+=this._mapper[f][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(c){this.getAnnotations();
c=this._annotations[c][1];return c===-1?0:this._mapper[c][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(c){return c},getLineIndexFromMapper:function(c){return d.lookUpLineIndex(this._mapper,this._mapperColumnIndex,c)},lookUpMapper:function(c){return d.lookUpMapper(this._mapper,this._mapperColumnIndex,c)},updateMapper:function(c,f,g,h,i){h!==i&&d.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(c),h,i)},getCharCount:function(){return this._model.getCharCount()},
getLine:function(c,f){return this._model.getLine(c,f)},getLineAtOffset:function(c){return this._model.getLineAtOffset(c)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},getLineEnd:function(c,f){return this._model.getLineEnd(c,f)},getLineStart:function(c){return this._model.getLineStart(c)},setText:function(c,f,g){this._model.setText(c,f,g)},getText:function(c,
f){return this._model.getText(c,f)},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){if(this._initing)this._initing=false;else this.updateMapper(c.start,c.removedCharCount,c.addedCharCount,c.removedLineCount,c.addedLineCount);return this.dispatchEvent(c)}};e.EventTarget.addMixin(b.prototype);return b}();return a});
define("orion/editor/nls/messages",{root:{currentLine:"Current Line",incrementalFind:"Incremental find: {0}",incrementalFindNotFound:"Incremental find: {0} (not found)",find:"Find...",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFindKey:"Incremental Find",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",
gotoLinePrompty:"Goto Line:",lastEdit:"Last Edit Location",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line {0} : Col {1}",formatMessage:function(d){var e=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})}},"pt-br":true});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,e,a){function b(c,f){this.editor=c;this.textView=c.getTextView();this.contentAssistPanel=document.getElementById(f);this.active=false;this.prefix="";this.filteredProviders=[];this.proposals=[];var g=this;this.contentAssistListener={onModelChanging:function(h){g.ignoreNextChange=g.isIgnorable(h)},onModelChanged:function(h){g.ignoreNextChange?g.cancel():g.showContentAssist(true,
h);g.ignoreNextChange=false},onScroll:function(){g.cancel()},onMouseUp:function(h){h.event.target.parentElement!==g.contentAssistPanel&&g.cancel()}};this.init()}b.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new e.KeyBinding(" ",false,false,false,true):new e.KeyBinding(" ",true),d.contentAssist);this.textView.setAction(d.contentAssist,function(){this.showContentAssist(true);return true}.bind(this))},cancel:function(){this.showContentAssist(false)},
isActive:function(){return this.active},isIgnorable:function(c){var f=c.removedCharCount>0&&c.addedCharCount===0,g=this.textView;g=c.start+1<=g.getModel().getCharCount()&&/^\s*$/.test(g.getText(c.start,c.start+1));return c.removedLineCount>0||f&&g},lineUp:function(){if(this.contentAssistPanel){var c=this.getSelectedNode();c===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(c.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var c=
this.getSelectedNode();c===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(c.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var c=this.getSelectedProposal();if(c===null)return false;this.ignoreNextChange=true;this.cancel();this.dispatchEvent({type:"accept",data:{proposal:c,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()}});return true},
setSelected:function(c){for(var f=this.contentAssistPanel.childNodes,g=0;g<f.length;g++){var h=f[g];if(h.className==="selected")h.className="";if(h===c){h.className="selected";h.focus();if(h.offsetTop<this.contentAssistPanel.scrollTop)h.scrollIntoView(true);else h.offsetTop+h.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&h.scrollIntoView(false)}}},getSelectedNode:function(){var c=this.getSelectedIndex();return c===-1?null:this.contentAssistPanel.childNodes[c]},
getSelectedIndex:function(){for(var c=this.contentAssistPanel.childNodes,f=0;f<c.length;f++)if(c[f].className==="selected")return f;return-1},getSelectedProposal:function(){var c=this.getSelectedIndex();return c===-1?null:this.proposals[c]},click:function(c){this.setSelected(c.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(c,f){if(this.contentAssistPanel){this.dispatchEvent({type:c?"show":"hide",data:null});if(c){var g=f?f.start+f.addedCharCount:this.textView.getCaretOffset();
c=g;for(var h;c>0&&(97<=(h=this.textView.getText(c-1,c).charCodeAt(0))&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57);)c--;this.prefix=this.textView.getText(c,g);h=this.textView.getText();c=this.textView.getSelection();c.offset=g;this.getKeywords(this.prefix,h,c).then(function(i){this.proposals=[];for(var j=0;j<i.length;j++){var l=i[j];if(!(l===null||l===undefined))if(this.matchesPrefix(l)||this.matchesPrefix(l.proposal))this.proposals.push(l)}if(this.proposals.length===0)this.cancel();else{i=this.textView.getLocationAtOffset(g);
i.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(j=0;j<this.proposals.length;j++)this.createDiv(this.getDisplayString(this.proposals[j]),j===0,this.contentAssistPanel);this.textView.convert(i,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=i.x+"px";this.contentAssistPanel.style.top=i.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;j=document.documentElement.clientWidth;if(i.y+
this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=i.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(i.x+this.contentAssistPanel.offsetWidth>j)this.contentAssistPanel.style.left=j-this.contentAssistPanel.offsetWidth+"px";if(!this.listenerAdded){this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.addEventListener("ModelChanged",this.contentAssistListener.onModelChanged);
this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll);this.textView.addEventListener("MouseUp",this.contentAssistListener.onMouseUp)}this.listenerAdded=true;this.contentAssistPanel.onclick=this.click.bind(this);this.active=true}}.bind(this))}else{if(this.listenerAdded){this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.contentAssistListener.onModelChanged);this.textView.removeEventListener("Scroll",
this.contentAssistListener.onScroll);this.textView.removeEventListener("MouseUp",this.contentAssistListener.onMouseUp);this.listenerAdded=false}this.active=false;this.contentAssistPanel.style.display="none";this.contentAssistPanel.onclick=null}}},createDiv:function(c,f,g){var h=document.createElement("div");if(f)h.className="selected";c=document.createTextNode(c);h.appendChild(c,h);g.appendChild(h)},getDisplayString:function(c){if(typeof c==="string")return c;if(c.description&&typeof c.description===
"string")return c.description;return c.proposal},matchesPrefix:function(c){return typeof c==="string"&&c.substr(0,this.prefix.length)===this.prefix},getKeywords:function(c,f,g){function h(u){if(u)j=j.concat(u);++l===p.length&&n.done(j)}function i(){++l===p.length&&n.done(j)}for(var j=[],l=0,n=new this.Promise,p=this.filteredProviders,t=0;t<p.length;t++){var v=p[t],r=v.getKeywords;if(typeof v.computeProposals==="function")r=v.computeProposals;(v=r.apply(v,[c,f,g]))&&v.then?v.then(h,i):h(v)}return n},
Promise:function(){function c(){}c.prototype.then=function(f){this.callback=f;if(this.result){var g=this;setTimeout(function(){g.callback(g.result)},0)}};c.prototype.done=function(f){this.result=f;this.callback&&this.callback(this.result)};return c}(),setProviders:function(c){this.filteredProviders=c}};a.EventTarget.addMixin(b.prototype);return{ContentAssist:b}});
define("orion/textview/undoStack",[],function(){function d(b,c,f){this.offset=b;this.text=c;this.previousText=f}function e(){this.changes=[]}function a(b,c){this.view=b;this.size=c!==undefined?c:100;this.reset();c=b.getModel();if(c.getBaseModel)c=c.getBaseModel();this.model=c;var f=this;this._listener={onChanging:function(g){f._onChanging(g)},onDestroy:function(g){f._onDestroy(g)}};c.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Destroy",this._listener.onDestroy)}d.prototype=
{undo:function(b,c){this._doUndoRedo(this.offset,this.previousText,this.text,b,c)},redo:function(b,c){this._doUndoRedo(this.offset,this.text,this.previousText,b,c)},_doUndoRedo:function(b,c,f,g,h){var i=g.getModel();if(i.mapOffset&&g.annotationModel){var j=i.mapOffset(b,true);if(j<0)for(var l=g.annotationModel.getAnnotations(b,b+1);l.hasNext();){var n=l.next();if(n.type==="orion.annotation.folding"){n.expand();j=i.mapOffset(b,true);break}}if(j<0)return;b=j}g.setText(c,b,b+f.length);h&&g.setSelection(b,
b+c.length)}};e.prototype={add:function(b){this.changes.push(b)},end:function(b){this.endSelection=b.getSelection();this.endCaret=b.getCaretOffset()},undo:function(b,c){for(var f=this.changes.length-1;f>=0;f--)this.changes[f].undo(b,false);if(c){c=this.startSelection.start;f=this.startSelection.end;b.setSelection(this.startCaret?c:f,this.startCaret?f:c)}},redo:function(b,c){for(var f=0;f<this.changes.length;f++)this.changes[f].redo(b,false);if(c){c=this.endSelection.start;f=this.endSelection.end;
b.setSelection(this.endCaret?c:f,this.endCaret?f:c)}},start:function(b){this.startSelection=b.getSelection();this.startCaret=b.getCaretOffset()}};a.prototype={add:function(b){if(this.compoundChange)this.compoundChange.add(b);else{this.stack.splice(this.index,this.stack.length-this.index,b);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===
this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=undefined},getSize:function(){var b=this.index,c=this.stack.length;this._undoStart!==undefined&&b++;return{undo:b,redo:c-b}},undo:function(){this._commitUndo();if(this.index<=0)return false;var b=this.stack[--this.index];this._ignoreUndo=true;b.undo(this.view,true);this._ignoreUndo=
false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var b=this.stack[this.index++];this._ignoreUndo=true;b.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=undefined;this._undoText="";this._undoType=0;this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var b=new e;this.add(b);this.compoundChange=b;this.compoundChange.start(this.view)},
_commitUndo:function(){if(this._undoStart!==undefined){this._undoType===-1?this.add(new d(this._undoStart,"",this._undoText)):this.add(new d(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText="";this._undoType=0}},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(b){var c=b.text,f=b.start,g=b.removedCharCount;b=b.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==
undefined&&!(b===1&&g===0&&this._undoType===1&&f===this._undoStart+this._undoText.length||b===0&&g===1&&this._undoType===-1&&(f+1===this._undoStart||f===this._undoStart)))this._commitUndo();if(!this.compoundChange)if(b===1&&g===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=c;this._undoType=1;return}else if(b===0&&g===1){c=this._undoText.length>0&&this._undoStart===f;this._undoStart=f;this._undoType=-1;if(c)this._undoText+=this.model.getText(f,f+g);else this._undoText=this.model.getText(f,
f+g)+this._undoText;return}this.add(new d(f,c,this.model.getText(f,f+g)))}}};return{UndoStack:a}});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/extensionCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(d,e,a,b,c,f){var g={};g.EditorCommandFactory=function(){function h(i,j,l,n,p,t,v){this.serviceRegistry=i;this.commandService=j;this.fileClient=l;this.inputManager=n;this.toolbarId=p;this.pageNavId=v;this.isReadOnly=t}h.prototype={generateEditorCommands:function(i){function j(x){var z=new c.KeyBinding;c.KeyBinding.apply(z,x);return z}
if(!this.isReadOnly){i.getTextView().setKeyBinding(new c.KeyBinding("s",true),"Save");this.inputManager.onSave?i.getTextView().setAction("Save",d.hitch(this,function(){var x=i.getText();this.inputManager.onSave(this.inputManager.getInput(),x,d.hitch(this,function(){i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(z){z.log=true}));return true})):i.getTextView().setAction("Save",d.hitch(this,function(){var x=i.getText(),
z={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),x,z).then(d.hitch(this,function(C){this.inputManager.getFileMetadata().ETag=C.ETag;i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(C){if(C.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&this.fileClient.write(this.inputManager.getInput(),x).then(d.hitch(this,function(k){this.inputManager.getFileMetadata().ETag=
k.ETag;i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else C.log=true}));return true}));this.commandService.addCommand(new e.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(x){x.items.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,
"orion.editorActions.unlabeled",false,new e.CommandKeyBinding("s",true));var l=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],false);this.commandService.addCommand(new e.Command({name:"Go to Line",tooltip:"Go to specified line number",id:"orion.gotoLine",parameters:l,callback:function(x){var z=i.getModel();if(x.parameters&&x.parameters.valueFor("line"))x=x.parameters.valueFor("line");else{x=z.getLineAtOffset(i.getCaretOffset());if(x=prompt("Go to line:",x+1))x=parseInt(x,
10)}x&&i.onGotoLine(x-1,0)}}),"dom");this.commandService.registerCommandContribution("orion.gotoLine",1,this.pageNavId,null,true,new e.CommandKeyBinding("l",true),new e.URLBinding("gotoLine","line"));i.getTextView().setKeyBinding(new c.KeyBinding("l",true),"gotoLine");i.getTextView().setAction("gotoLine",d.hitch(this,function(){this.commandService.runCommand("orion.gotoLine");return true}));this.commandService.addCommandGroup("orion.editorActions.contributed",101,null,null,this.toolbarId);l=this.serviceRegistry.getServiceReferences("orion.edit.command");
for(var n=this.inputManager,p=function(x,z,C){C.callback=d.hitch(i,function(k){i=k?k.items||this:this;var m=i.getSelection();k=i.getModel();var o=k.getText();z.run(k.getText(m.start,m.end),o,m,n.getInput()).then(function(s){if(s&&s.text){i.setText(s.text);if(s.selection){i.setSelection(s.selection.start,s.selection.end);i.getTextView().focus()}}else if(typeof s==="string"){i.setText(s,m.start,m.end);i.setSelection(m.start,m.start+s.length);i.getTextView().focus()}});return true});return new e.Command(C)},
t=0;t<l.length;t++){for(var v=this.serviceRegistry.getService(l[t]),r={},u=l[t].getPropertyNames(),q=0;q<u.length;q++)r[u[q]]=l[t].getProperty(u[q]);r.forceSingleItem=true;v=p(r,v,b._createCommandOptions(r,l[t],this.serviceRegistry,false,function(){return n.getFileMetadata()}));this.commandService.addCommand(v,"dom");this.commandService.registerCommandContribution(v.id,t,this.toolbarId,"orion.editorActions.contributed");a.generateDomCommandsInBanner(this.commandService,i);if(r.key){u=i.getTextView();
u.setKeyBinding(j(r.key),v.id);u.setAction(v.id,v.callback)}}}}};return h}();g.UndoCommandFactory=function(){function h(i,j,l){this.serviceRegistry=i;this.commandService=j;this.toolbarId=l}h.prototype={createUndoStack:function(i){var j=new f.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){j.undo();return true});this.commandService.addCommand(new e.Command({name:"Undo",id:"orion.undo",callback:function(n){n.items.getTextView().invokeAction("Undo")}}),
"dom");var l=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",true,true):new c.KeyBinding("y",true);i.getTextView().setKeyBinding(l,"Redo");i.getTextView().setAction("Redo",function(){j.redo();return true});this.commandService.addCommand(new e.Command({name:"Redo",id:"orion.redo",callback:function(n){n.items.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",true,new e.CommandKeyBinding("z",
true));this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,"orion.editorActions.unlabeled",true,l);return j}};return h}();return g});define("orion/textview/nls/messages",{root:{multipleAnnotations:"Multiple annotations:",line:"Line: {0}",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",formatMessage:function(d){var e=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})}},"pt-br":true,"fr-fr":true});
define("orion/textview/textModel",["orion/textview/eventTarget"],function(d){function e(b,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(c)}var a=window.navigator.platform.indexOf("Win")!==-1;e.prototype={getCharCount:function(){for(var b=0,c=0;c<this._text.length;c++)b+=this._text[c].length;return b},getLine:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return null;var g=this._lineOffsets[b];if(b+1<f){b=this.getText(g,this._lineOffsets[b+
1]);if(c)return b;c=b.length;for(var h;(h=b.charCodeAt(c-1))===10||h===13;)c--;return b.substring(0,c)}else return this.getText(g)},getLineAtOffset:function(b){var c=this.getCharCount();if(!(0<=b&&b<=c))return-1;var f=this.getLineCount();if(b===c)return f-1;var g,h,i=this._lastLineIndex;if(0<=i&&i<f){g=this._lineOffsets[i];h=i+1<f?this._lineOffsets[i+1]:c;if(g<=b&&b<h)return i}for(var j=f,l=-1;j-l>1;){i=Math.floor((j+l)/2);g=this._lineOffsets[i];h=i+1<f?this._lineOffsets[i+1]:c;if(b<=g)j=i;else if(b<
h){j=i;break}else l=i}return this._lastLineIndex=j},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;if(b+1<f){f=this._lineOffsets[b+1];if(c)return f;b=this.getText(Math.max(this._lineOffsets[b],f-2),f);c=b.length;for(var g;(g=b.charCodeAt(c-1))===10||g===13;)c--;return f-(b.length-c)}else return this.getCharCount()},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;
return this._lineOffsets[b]},getText:function(b,c){if(b===undefined)b=0;if(c===undefined)c=this.getCharCount();if(b===c)return"";for(var f=0,g=0,h;g<this._text.length;){h=this._text[g].length;if(b<=f+h)break;f+=h;g++}for(var i=f,j=g;g<this._text.length;){h=this._text[g].length;if(c<=f+h)break;f+=h;g++}f=f;g=g;if(j===g)return this._text[j].substring(b-i,c-f);b=this._text[j].substring(b-i);c=this._text[g].substring(0,c-f);return b+this._text.slice(j+1,g).join("")+c},onChanging:function(b){return this.dispatchEvent(b)},
onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){if(b==="auto"){b=undefined;if(this.getLineCount()>1)b=this.getText(this.getLineEnd(0),this.getLineEnd(0,true))}this._lineDelimiter=b?b:a?"\r\n":"\n"},setText:function(b,c,f){if(b===undefined)b="";if(c===undefined)c=0;if(f===undefined)f=this.getCharCount();if(!(c===f&&b==="")){for(var g=this.getLineAtOffset(c),h=this.getLineAtOffset(f),i=c,j=f-c,l=h-g,n=b.length,p=0,t=this.getLineCount(),v=0,r=0,u=0,q=[];;){if(v!==-1&&
v<=u)v=b.indexOf("\r",u);if(r!==-1&&r<=u)r=b.indexOf("\n",u);if(r===-1&&v===-1)break;u=v!==-1&&r!==-1?v+1===r?r+1:(v<r?v:r)+1:v!==-1?v+1:r+1;q.push(c+u);p++}this.onChanging({type:"Changing",text:b,start:i,removedCharCount:j,addedCharCount:n,removedLineCount:l,addedLineCount:p});if(q.length===0){v=this.getLineStart(g);h=h+1<t?this.getLineStart(h+1):this.getCharCount();if(c!==v){b=this.getText(v,c)+b;c=v}if(f!==h){b+=this.getText(f,h);f=h}}h=n-j;for(v=g+l+1;v<t;v++)this._lineOffsets[v]+=h;g=[g+1,l].concat(q);
Array.prototype.splice.apply(this._lineOffsets,g);for(h=q=0;h<this._text.length;){v=this._text[h].length;if(c<=q+v)break;q+=v;h++}t=q;for(g=h;h<this._text.length;){v=this._text[h].length;if(f<=q+v)break;q+=v;h++}q=q;h=h;v=this._text[h];c=this._text[g].substring(0,c-t);f=v.substring(f-q);g=[g,h-g+1];c&&g.push(c);b&&g.push(b);f&&g.push(f);Array.prototype.splice.apply(this._text,g);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:i,removedCharCount:j,addedCharCount:n,removedLineCount:l,
addedLineCount:p})}}};d.EventTarget.addMixin(e.prototype);return{TextModel:e}});
define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,e,a){function b(k,m,o,s){typeof k.addEventListener==="function"?k.addEventListener(m,o,s===true):k.attachEvent("on"+m,o)}function c(k,m,o,s){typeof k.removeEventListener==="function"?k.removeEventListener(m,o,s===true):k.detachEvent("on"+m,o)}function f(k,m,o){this.start=k;this.end=m;this.caret=o}function g(k){this._init(k)}var h=navigator.userAgent,i;if(document.selection&&
window.ActiveXObject&&/MSIE/.test(h))i=document.documentMode?document.documentMode:7;var j=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||undefined,l=h.indexOf("Opera")!==-1,n=h.indexOf("Chrome")!==-1,p=h.indexOf("Safari")!==-1&&!n,t=h.indexOf("WebKit")!==-1,v=h.indexOf("iPad")!==-1,r=navigator.platform.indexOf("Mac")!==-1,u=navigator.platform.indexOf("Win")!==-1,q=navigator.platform.indexOf("Linux")!==-1,x=typeof window.document.documentElement.addEventListener==="function",z=(!i||
i>=9)&&typeof window.document.createRange().getBoundingClientRect==="function",C=u?"\r\n":"\n";f.prototype={clone:function(){return new f(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(k){if(this.caret)this.start=k;else this.end=k;if(this.start>this.end){k=this.start;this.start=this.end;this.end=k;this.caret=!this.caret}},setCaret:function(k){this.end=this.start=k;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(k){return this.caret===k.caret&&this.start===k.start&&this.end===k.end}};g.prototype={addRuler:function(k){this._rulers.push(k);k.setView(this);this._createRuler(k);this._updatePage()},computeSize:function(){var k=0,m=0,o=this._model,s=this._clientDiv;if(!s)return{width:k,height:m};var w=s.style.width;
if(t)s.style.width=(524287).toString()+"px";for(var y=o.getLineCount(),B=this._frameDocument,A=0;A<y;A++){var E=this._getLineNode(A),G=null;if(!E||E.lineChanged||E.lineRemoved)E=G=this._createLine(s,null,B,A,o);E=this._getLineBoundingClientRect(E);k=Math.max(k,E.right-E.left);m+=E.bottom-E.top;G&&s.removeChild(G)}if(t)s.style.width=w;o=this._getViewPadding();k+=o.right-o.left;m+=o.bottom-o.top;return{width:k,height:m}},convert:function(k,m,o){if(this._clientDiv){var s=this._getScroll(),w=this._getViewPadding(),
y=this._frame.getBoundingClientRect(),B=this._viewDiv.getBoundingClientRect();switch(m){case "document":if(k.x!==undefined)k.x+=-s.x+B.left+w.left;if(k.y!==undefined)k.y+=-s.y+B.top+w.top;break;case "page":if(k.x!==undefined)k.x+=-y.left;if(k.y!==undefined)k.y+=-y.top;break}switch(o){case "document":if(k.x!==undefined)k.x+=s.x-B.left-w.left;if(k.y!==undefined)k.y+=s.y-B.top-w.top;break;case "page":if(k.x!==undefined)k.x+=y.left;if(k.y!==undefined)k.y+=y.top;break}return k}},destroy:function(){for(var k=
0;k<this._rulers.length;k++)this._rulers[k].setView(null);this.rulers=null;this._destroyFrame();this.onDestroy({type:"Destroy"});this._actions=this._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){if(this._clientDiv){this._updateDOMSelection();if(v)this._textArea.focus();else{l&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},hasFocus:function(){return this._hasFocus},getActions:function(k){for(var m=
[],o=this._actions,s=0;s<o.length;s++)!k&&o[s].defaultHandler||m.push(o[s].name);return m},getBottomIndex:function(k){if(!this._clientDiv)return 0;return this._getBottomIndex(k)},getBottomPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var k=this._getScroll();return{x:k.x,y:k.y,width:this._getClientWidth(),
height:this._getClientHeight()}},getHorizontalPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().x},getKeyBindings:function(k){for(var m=[],o=this._keyBindings,s=0;s<o.length;s++)o[s].name===k&&m.push(o[s].keyBinding);return m},getLineHeight:function(){if(!this._clientDiv)return 0;return this._getLineHeight()},getLinePixel:function(k){if(!this._clientDiv)return 0;k=Math.min(Math.max(0,k),this._model.getLineCount());return this._getLineHeight()*k},getLocationAtOffset:function(k){if(!this._clientDiv)return{x:0,
y:0};var m=this._model;k=Math.min(Math.max(0,k),m.getCharCount());m=m.getLineAtOffset(k);var o=this._getScroll(),s=this._viewDiv.getBoundingClientRect(),w=this._getViewPadding();k=this._getOffsetToX(k)+o.x-s.left-w.left;m=this.getLinePixel(m);return{x:k,y:m}},getOptions:function(){var k;if(arguments.length===0)k=this._defaultOptions();else if(arguments.length===1){k=arguments[0];if(typeof k==="string")return this._clone(this["_"+k]);k=k}else{k={};for(var m in arguments)if(arguments.hasOwnProperty(m))k[arguments[m]]=
undefined}for(var o in k)if(k.hasOwnProperty(o))k[o]=this._clone(this["_"+o]);return k},getModel:function(){return this._model},getOffsetAtLocation:function(k,m){if(!this._clientDiv)return 0;var o=this._getScroll(),s=this._viewDiv.getBoundingClientRect(),w=this._getViewPadding();m=this._getYToLine(m-o.y);k+=-o.x+s.left+w.left;return this._getXToOffset(m,k)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var k=this._getSelection();return{start:k.start,end:k.end}},getText:function(k,
m){return this._model.getText(k,m)},getTopIndex:function(k){if(!this._clientDiv)return 0;return this._getTopIndex(k)},getTopPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y},invokeAction:function(k,m){if(this._clientDiv){for(var o=this._actions,s=0;s<o.length;s++){var w=o[s];if(w.name&&w.name===k){if(!m&&w.userHandler)if(w.userHandler())return;if(w.defaultHandler)return w.defaultHandler();return false}}return false}},isLoaded:function(){return!!this._clientDiv},onContextMenu:function(k){return this.dispatchEvent(k)},
onDragStart:function(k){return this.dispatchEvent(k)},onDrag:function(k){return this.dispatchEvent(k)},onDragEnd:function(k){return this.dispatchEvent(k)},onDragEnter:function(k){return this.dispatchEvent(k)},onDragOver:function(k){return this.dispatchEvent(k)},onDragLeave:function(k){return this.dispatchEvent(k)},onDrop:function(k){return this.dispatchEvent(k)},onDestroy:function(k){return this.dispatchEvent(k)},onLineStyle:function(k){return this.dispatchEvent(k)},onLoad:function(k){return this.dispatchEvent(k)},
onModelChanged:function(k){return this.dispatchEvent(k)},onModelChanging:function(k){return this.dispatchEvent(k)},onModify:function(k){return this.dispatchEvent(k)},onMouseDown:function(k){return this.dispatchEvent(k)},onMouseUp:function(k){return this.dispatchEvent(k)},onMouseMove:function(k){return this.dispatchEvent(k)},onMouseOver:function(k){return this.dispatchEvent(k)},onMouseOut:function(k){return this.dispatchEvent(k)},onSelection:function(k){return this.dispatchEvent(k)},onScroll:function(k){return this.dispatchEvent(k)},
onVerify:function(k){return this.dispatchEvent(k)},onUnload:function(k){return this.dispatchEvent(k)},onFocus:function(k){return this.dispatchEvent(k)},onBlur:function(k){return this.dispatchEvent(k)},redraw:function(){if(!(this._redrawCount>0)){for(var k=this._model.getLineCount(),m=this.getRulers(),o=0;o<m.length;o++)this.redrawLines(0,k,m[o]);this.redrawLines(0,k)}},redrawLines:function(k,m,o){if(!(this._redrawCount>0)){if(k===undefined)k=0;if(m===undefined)m=this._model.getLineCount();if(k!==
m){var s=this._clientDiv;if(s){if(o)for(var w=(o.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,y=0;y<w.length;y++)if(w[y].firstChild._ruler===o){s=w[y].firstChild;break}if(o)s.rulerChanged=true;if(!o||o.getOverview()==="page")for(s=s.firstChild;s;){w=s.lineIndex;if(k<=w&&w<m)s.lineChanged=true;s=s.nextSibling}if(!o)if(k<=this._maxLineIndex&&this._maxLineIndex<m){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},
redrawRange:function(k,m){if(!(this._redrawCount>0)){var o=this._model;if(k===undefined)k=0;if(m===undefined)m=o.getCharCount();var s=o.getLineAtOffset(k);k=o.getLineAtOffset(Math.max(k,m-1))+1;this.redrawLines(s,k)}},removeRuler:function(k){for(var m=this._rulers,o=0;o<m.length;o++)if(m[o]===k){m.splice(o,1);k.setView(null);this._destroyRuler(k);this._updatePage();break}},setAction:function(k,m){if(k){for(var o=this._actions,s=0;s<o.length;s++){var w=o[s];if(w.name===k){w.userHandler=m;return}}o.push({name:k,
userHandler:m})}},setKeyBinding:function(k,m){for(var o=this._keyBindings,s=0;s<o.length;s++){var w=o[s];if(w.keyBinding.equals(k)){if(m)w.name=m;else if(w.predefined)w.name=null;else{k=w.name;o.splice(s,1);for(s=0;s<o.length&&k!==o[s].name;)s++;if(s===o.length){o=this._actions;for(s=0;s<o.length;s++)if(o[s].name===k)o[s].defaultHandler||o.splice(s,1)}}return}}m&&o.push({keyBinding:k,name:m})},setCaretOffset:function(k,m){var o=this._model.getCharCount();k=Math.max(0,Math.min(k,o));this._setSelection(new f(k,
k,false),m===undefined||m)},setHorizontalPixel:function(k){if(this._clientDiv){k=Math.max(0,k);this._scrollView(k-this._getScroll().x,0)}},setRedraw:function(k){if(k)--this._redrawCount===0&&this.redraw();else this._redrawCount++},setModel:function(k){if(k)if(k!==this._model){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);var m=this._model.getLineCount(),o=this._model.getCharCount(),s=k.getLineCount(),
w=k.getCharCount(),y={type:"ModelChanging",text:k.getText(),start:0,removedCharCount:o,addedCharCount:w,removedLineCount:m,addedLineCount:s};this.onModelChanging(y);this._model=k;y={type:"ModelChanged",start:0,removedCharCount:o,addedCharCount:w,removedLineCount:m,addedLineCount:s};this.onModelChanged(y);this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);this._reset();this._updatePage()}},setOptions:function(k){var m=
this._defaultOptions(),o=false,s,w=this._clientDiv;if(w)for(s in k)if(k.hasOwnProperty(s))if(m[s].recreate){o=true;break}var y=false;for(s in k)if(k.hasOwnProperty(s)){var B=k[s];if(!this._compare(this["_"+s],B)){y=true;if(!o){var A=m[s].update;if(w&&A){if(A.call(this,B))o=true;continue}}this["_"+s]=this._clone(B)}}if(y)if(o){this._frame.parentNode.removeChild(this._frame);this._parent.appendChild(this._frame)}},setSelection:function(k,m,o){var s=k>m;if(s){var w=k;k=m;m=w}w=this._model.getCharCount();
k=Math.max(0,Math.min(k,w));m=Math.max(0,Math.min(m,w));this._setSelection(new f(k,m,s),o===undefined||o)},setText:function(k,m,o){var s=m===undefined&&o===undefined;if(m===undefined)m=0;if(o===undefined)o=this._model.getCharCount();this._modifyContent({text:k,start:m,end:o,_code:true},!s);if(s){this._columnX=-1;this._setSelection(new f(0,0,false),true);j&&this._fixCaret()}},setTopIndex:function(k){if(this._clientDiv){var m=this._model;if(m.getCharCount()!==0){m=m.getLineCount();var o=this._getLineHeight(),
s=Math.max(1,Math.min(m,Math.floor(this._getClientHeight()/o)));if(k<0)k=0;else if(k>m-s)k=m-s;this._scrollView(0,k*o-this._getScroll().y)}}},setTopPixel:function(k){if(this._clientDiv){var m=this._getLineHeight(),o=this._getClientHeight(),s=this._model.getLineCount();k=Math.min(Math.max(0,k),m*s-o);this._scrollView(0,k-this._getScroll().y)}},showSelection:function(){return this._showCaret(true)},_handleBodyMouseDown:function(k){if(!k)k=window.event;if(j&&k.which===1){this._clientDiv.contentEditable=
false;this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=true}for(var m=l||j&&!this._overlayDiv?this._clientDiv:this._overlayDiv||this._viewDiv,o=k.target?k.target:k.srcElement;o;){if(m===o)return;o=o.parentNode}k.preventDefault&&k.preventDefault();k.stopPropagation&&k.stopPropagation();if(!x){m.setCapture();setTimeout(function(){m.releaseCapture()},0)}},_handleBodyMouseUp:function(k){if(!k)k=window.event;if(j&&k.which===1){this._clientDiv.contentEditable=true;(this._overlayDiv||this._clientDiv).draggable=
false;this._fixCaret();this._ignoreBlur=false}},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=false;if(i<9)if(!this._getSelection().isEmpty()){var k=this._frameDocument,m=k.createElement("DIV");k=k.body;k.appendChild(m);k.removeChild(m)}if(j||i)if(this._selDiv1){m=i?"transparent":"#AFAFAF";this._selDiv1.style.background=m;this._selDiv2.style.background=m;this._selDiv3.style.background=m}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleContextMenu:function(k){if(!k)k=window.event;
j&&this._lastMouseButton===3&&k.timeStamp-this._lastMouseTime<=this._clickTime&&this._updateDOMSelection();if(this.isListening("ContextMenu")){var m=this._createMouseEvent("ContextMenu",k);m.screenX=k.screenX;m.screenY=k.screenY;this.onContextMenu(m)}k.preventDefault&&k.preventDefault();return false},_handleCopy:function(k){if(!this._ignoreCopy){if(!k)k=window.event;if(this._doCopy(k)){k.preventDefault&&k.preventDefault();return false}}},_handleCut:function(k){if(!k)k=window.event;if(this._doCut(k)){k.preventDefault&&
k.preventDefault();return false}},_handleDOMAttrModified:function(k){if(!k)k=window.event;for(var m=false,o=this._parent;o;){if(o===k.target){m=true;break}o=o.parentNode}if(m){k=this._getVisible();if(k==="visible")this._createView();else k==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(k){if(!k)k=window.event;this._lastMouseTime=k.timeStamp?k.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(k)}},
_handleDragStart:function(k){if(!k)k=window.event;if(j){var m=this;setTimeout(function(){m._clientDiv.contentEditable=true;m._clientDiv.draggable=false;m._ignoreBlur=false},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1){this._isMouseDown=false;this.onDragStart(this._createMouseEvent("DragStart",k));this._dragOffset=-1}else{k.preventDefault&&k.preventDefault();return false}},_handleDrag:function(k){if(!k)k=window.event;this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",
k))},_handleDragEnd:function(k){if(!k)k=window.event;this._dropTarget=false;this._dragOffset=-1;this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",k));if(j){this._fixCaret();k.dataTransfer.dropEffect==="none"&&!k.dataTransfer.mozUserCancelled&&this._fixCaret()}},_handleDragEnter:function(k){if(!k)k=window.event;var m=true;this._dropTarget=true;if(this.isListening("DragEnter")){m=false;this.onDragEnter(this._createMouseEvent("DragEnter",k))}if(t||m){k.preventDefault&&k.preventDefault();
return false}},_handleDragOver:function(k){if(!k)k=window.event;var m=true;if(this.isListening("DragOver")){m=false;this.onDragOver(this._createMouseEvent("DragOver",k))}if(t||m){if(m)k.dataTransfer.dropEffect="none";k.preventDefault&&k.preventDefault();return false}},_handleDragLeave:function(k){if(!k)k=window.event;this._dropTarget=false;this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",k))},_handleDrop:function(k){if(!k)k=window.event;this._dropTarget=false;this.isListening("Drop")&&
this.onDrop(this._createMouseEvent("Drop",k));k.preventDefault&&k.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;i&&this._updateDOMSelection();if(j||i)if(this._selDiv1){var k=this._hightlightRGB;this._selDiv1.style.background=k;this._selDiv2.style.background=k;this._selDiv3.style.background=k}this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(k){if(!k)k=window.event;if(v){if(k.keyCode===8){this._doBackspace({});
k.preventDefault()}}else{switch(k.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(k.keyCode===229){if(this._readonly){k.preventDefault&&k.preventDefault();return false}var m=true;if(p&&r)if(k.ctrlKey)m=false;m&&this._startIME()}else this._commitIME();if((r||q)&&j<4||l){this._keyDownEvent=k;return true}if(this._doAction(k)){if(k.preventDefault)k.preventDefault();else{k.cancelBubble=true;k.returnValue=false;k.keyCode=0}return false}}},_handleKeyPress:function(k){if(!k)k=
window.event;if(r&&t)if(63232<=k.keyCode&&k.keyCode<=63487||k.keyCode===13||k.keyCode===8){k.preventDefault&&k.preventDefault();return false}if((r||q)&&j<4||l)if(this._doAction(this._keyDownEvent)){k.preventDefault&&k.preventDefault();return false}var m=r?k.metaKey:k.ctrlKey;if(k.charCode!==undefined)if(m)switch(k.charCode){case 99:case 118:case 120:return true}m=false;if(r){if(k.ctrlKey||k.metaKey)m=true}else if(j){if(k.ctrlKey||k.altKey)m=true}else if(k.ctrlKey^k.altKey)m=true;if(!m){m=l?k.which:
k.charCode!==undefined?k.charCode:k.keyCode;if(m>31){this._doContent(String.fromCharCode(m));k.preventDefault&&k.preventDefault();return false}}},_handleKeyUp:function(k){if(!k)k=window.event;(r?k.metaKey:k.ctrlKey)||this._setLinksVisible(false);k.keyCode===13&&this._commitIME()},_handleLinkClick:function(k){if(!k)k=window.event;if(!(r?k.metaKey:k.ctrlKey)){k.preventDefault&&k.preventDefault();return false}},_handleLoad:function(){var k=this._getVisible();if(k==="visible"||k==="hidden"&&t)this._createView()},
_handleMouse:function(k){var m=true,o=this._frameWindow;if(i||j&&!this._overlayDiv)o=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=true;var s=this;setTimeout(function(){s.focus();s._ignoreFocus=false},0)}if(this._clickCount===1)(m=this._setSelectionTo(k.clientX,k.clientY,k.shiftKey,!l&&this.isListening("DragStart")))&&this._setGrab(o);else{x&&this._setGrab(o);this._doubleClickSelection=null;this._setSelectionTo(k.clientX,k.clientY,k.shiftKey);this._doubleClickSelection=
this._getSelection()}return m},_handleMouseDown:function(k){if(!k)k=window.event;this.isListening("MouseDown")&&this.onMouseDown(this._createMouseEvent("MouseDown",k));if(this._linksVisible)if((k.target||k.srcElement).tagName!=="A")this._setLinksVisible(false);else return;this._commitIME();var m=k.which;if(!m){if(k.button===4)m=2;if(k.button===2)m=3;if(k.button===1)m=1}var o=m!==2&&k.timeStamp?k.timeStamp:(new Date).getTime(),s=o-this._lastMouseTime,w=Math.abs(this._lastMouseX-k.clientX),y=Math.abs(this._lastMouseY-
k.clientY),B=this._lastMouseButton===m;this._lastMouseX=k.clientX;this._lastMouseY=k.clientY;this._lastMouseTime=o;this._lastMouseButton=m;if(m===1){this._isMouseDown=true;if(B&&s<=this._clickTime&&w<=this._clickDist&&y<=this._clickDist)this._clickCount++;else this._clickCount=1;if(this._handleMouse(k)&&(l||n||j&&!this._overlayDiv)){this._hasFocus||this.focus();k.preventDefault()}}},_handleMouseOver:function(k){if(!k)k=window.event;this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",
k))},_handleMouseOut:function(k){if(!k)k=window.event;this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",k))},_handleMouseMove:function(k){if(!k)k=window.event;if(this.isListening("MouseMove"))for(var m=this._overlayDiv||this._clientDiv,o=k.target?k.target:k.srcElement;o;){if(m===o){this.onMouseMove(this._createMouseEvent("MouseMove",k));break}o=o.parentNode}if(!this._dropTarget){m=this._linksVisible||this._lastMouseMoveX!==k.clientX||this._lastMouseMoveY!==k.clientY;
this._lastMouseMoveX=k.clientX;this._lastMouseMoveY=k.clientY;this._setLinksVisible(m&&!this._isMouseDown&&(r?k.metaKey:k.ctrlKey));if(!x){if(k.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&k.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(k,this._clickCount)}}if(!(!this._isMouseDown||this._dragOffset!==-1)){m=k.clientX;o=k.clientY;if(n)if(k.currentTarget!==this._frameWindow){k=this._frame.getBoundingClientRect();m-=k.left;o-=k.top}var s=this._getViewPadding(),
w=this._viewDiv.getBoundingClientRect(),y=this._getClientWidth(),B=this._getClientHeight();k=w.left+s.left;var A=w.top+s.top;y=w.left+s.left+y;s=w.top+s.top+B;w=this._model;B=w.getLineAtOffset(this._getSelection().getCaret());if(o<A&&B!==0)this._doAutoScroll("up",m,o-A);else if(o>s&&B!==w.getLineCount()-1)this._doAutoScroll("down",m,o-s);else if(m<k)this._doAutoScroll("left",m-k,o);else if(m>y)this._doAutoScroll("right",m-y,o);else{this._endAutoScroll();this._setSelectionTo(m,o,true);i&&this._frameDocument.body.getBoundingClientRect()}}}},
_createMouseEvent:function(k,m){var o=this._getScroll(),s=this._viewDiv.getBoundingClientRect(),w=this._getViewPadding();return{type:k,event:m,x:m.clientX+o.x-s.left-w.left,y:m.clientY+o.y-s.top}},_handleMouseUp:function(k){if(!k)k=window.event;this.isListening("MouseUp")&&this.onMouseUp(this._createMouseEvent("MouseUp",k));if(!this._linksVisible)if(k.which?k.button===0:k.button===1){if(this._dragOffset!==-1){var m=this._getSelection();m.extend(this._dragOffset);m.collapse();this._setSelection(m,
true,true);this._dragOffset=-1}this._isMouseDown=false;this._endAutoScroll();x&&this._setGrab(null);j&&k.preventDefault()}},_handleMouseWheel:function(k){if(!k)k=window.event;var m=this._getLineHeight(),o=0,s=0;if(j){m=r?k.detail*3:Math.max(-256,Math.min(256,k.detail))*m;if(k.axis===k.HORIZONTAL_AXIS)o=m;else s=m}else if(r){s=o=40;if(k.wheelDeltaX%120!==0)o=1;if(k.wheelDeltaY%120!==0)s=1;o=-k.wheelDeltaX/o;if(-1<o&&o<0)o=-1;if(0<o&&o<1)o=1;s=-k.wheelDeltaY/s;if(-1<s&&s<0)s=-1;if(0<s&&s<1)s=1}else{o=
-k.wheelDeltaX;s=-k.wheelDeltaY/120*8*m}if(p){for(m=k.target;m&&m.lineIndex===undefined;)m=m.parentNode;this._mouseWheelLine=m}m=this._getScroll();this._scrollView(o,s);o=this._getScroll();if(p)this._mouseWheelLine=null;if(m.x!==o.x||m.y!==o.y){k.preventDefault&&k.preventDefault();return false}},_handlePaste:function(k){if(!this._ignorePaste){if(!k)k=window.event;if(this._doPaste(k)){if(i){var m=this;this._ignoreFocus=true;setTimeout(function(){m._updateDOMSelection();this._ignoreFocus=false},0)}k.preventDefault&&
k.preventDefault();return false}}},_handleResize:function(){var k=this._frameDocument.documentElement,m=k.clientWidth;k=k.clientHeight;if(this._frameWidth!==m||this._frameHeight!==k){this._frameWidth=m;this._frameHeight=k;i<9?this._queueUpdatePage():this._updatePage()}},_handleRulerEvent:function(k){if(!k)k=window.event;var m=k.target?k.target:k.srcElement,o=m.lineIndex;for(m=m;m&&!m._ruler;){if(o===undefined&&m.lineIndex!==undefined)o=m.lineIndex;m=m.parentNode}m=m?m._ruler:null;if(o===undefined&&
m&&m.getOverview()==="document"){o=v?0:17;var s=this._getClientHeight(),w=this._model.getLineCount(),y=this._getViewPadding();o=Math.floor((k.clientY-o)*w/(s+y.top+y.bottom-2*o));0<=o&&o<w||(o=undefined)}if(m)switch(k.type){case "click":m.onClick&&m.onClick(o,k);break;case "dblclick":m.onDblClick&&m.onDblClick(o,k);break;case "mousemove":m.onMouseMove&&m.onMouseMove(o,k);break;case "mouseover":m.onMouseOver&&m.onMouseOver(o,k);break;case "mouseout":m.onMouseOut&&m.onMouseOut(o,k);break}},_handleScroll:function(){var k=
this._getScroll(),m=this._hScroll,o=this._vScroll;if(m!==k.x||o!==k.y){this._hScroll=k.x;this._vScroll=k.y;this._commitIME();this._updatePage(o===k.y);this.onScroll({type:"Scroll",oldValue:{x:m,y:o},newValue:k})}},_handleSelectStart:function(k){if(!k)k=window.event;if(this._ignoreSelect){k&&k.preventDefault&&k.preventDefault();return false}},_handleUnload:function(){this._frameLoaded=false;this._destroyView()},_handleInput:function(k){var m=this._textArea;this._doContent(m.value);m.selectionStart=
m.selectionEnd=0;m.value="";k.preventDefault()},_handleTextInput:function(k){this._doContent(k.data);k.preventDefault()},_touchConvert:function(k){var m=this._frame.getBoundingClientRect(),o=this._parentDocument.body;return{left:k.clientX-m.left-o.scrollLeft,top:k.clientY-m.top-o.scrollTop}},_handleTextAreaClick:function(k){k=this._touchConvert(k);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(k.left,k.top,false);this._textArea.focus()},_handleTouchStart:function(k){var m=
k.touches,o,s;this._touchMoved=false;this._touchStartScroll=undefined;if(m.length===1){o=m[0];s=o.pageY;this._touchStartX=o.pageX;this._touchStartY=s;this._touchStartTime=k.timeStamp;this._touchStartScroll=this._getScroll();k=this._getSelection();s=this._touchConvert(m[0]);this._touchGesture="none";if(!k.isEmpty())if(this._hitOffset(k.end,s.left,s.top))this._touchGesture="extendEnd";else if(this._hitOffset(k.start,s.left,s.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){m=this._textArea;
m.value="";m.style.left="-1000px";m.style.top="-1000px";m.style.width="3000px";m.style.height="3000px"}}else if(m.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}s=this._touchConvert(m[0]);o=this._getXToOffset(this._getYToLine(s.top),s.left);s=this._touchConvert(m[1]);m=this._getXToOffset(this._getYToLine(s.top),s.left);k=this._getSelection();k.setCaret(o);k.extend(m);this._setSelection(k,true,true)}},_handleTouchMove:function(k){this._touchMoved=
true;var m=k.touches,o;if(m.length===1){m=m[0];var s=m.pageX,w=m.pageY,y=this._touchStartX-s,B=this._touchStartY-w;o=this._touchConvert(m);m=this._getSelection();if(this._touchGesture==="none")this._touchGesture=k.timeStamp-this._touchStartTime<200&&(Math.abs(y)>5||Math.abs(B)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(m.end,o.left,o.top)?"extendEnd":this._hitOffset(m.start,o.left,o.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=
s;this._touchStartY=w;this._scrollView(y,B);break;case "extendStart":case "extendEnd":this._clickCount=1;o=this._getXToOffset(this._getYToLine(o.top),o.left);m.setCaret(this._touchGesture==="extendStart"?m.end:m.start);m.extend(o);if(o>=m.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(o<=m.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(m,true,true);break;case "caret":this._setSelectionTo(o.left,o.top,false);break}}else if(m.length===
2){o=this._touchConvert(m[0]);s=this._getXToOffset(this._getYToLine(o.top),o.left);o=this._touchConvert(m[1]);o=this._getXToOffset(this._getYToLine(o.top),o.left);m=this._getSelection();m.setCaret(s);m.extend(o);this._setSelection(m,true,true)}k.preventDefault()},_handleTouchEnd:function(k){var m=this;if(!this._touchMoved)if(k.touches.length===0&&k.changedTouches.length===1){var o=this._touchConvert(k.changedTouches[0]),s=this._textArea;s.value="";s.style.left="-1000px";s.style.top="-1000px";s.style.width=
"3000px";s.style.height="3000px";setTimeout(function(){m._clickCount=1;m._ignoreDOMSelection=false;m._setSelectionTo(o.left,o.top,false)},300)}k.touches.length===0&&setTimeout(function(){var w=m._getSelection(),y=m._model.getText(w.start,w.end),B=m._textArea;B.value=y;B.selectionStart=0;B.selectionEnd=y.length;if(!w.isEmpty()){y=m._touchDiv.getBoundingClientRect();w=m._getOffsetBounds(w.start);B.style.left=y.width/2+"px";B.style.top=(w.top>40?w.top-30:w.top+30)+"px"}},0)},_doAction:function(k){for(var m=
this._keyBindings,o=0;o<m.length;o++){var s=m[o];if(s.keyBinding.match(k)){if(s.name){k=this._actions;for(m=0;m<k.length;m++){o=k[m];if(o.name===s.name){if(o.userHandler){if(!o.userHandler())if(o.defaultHandler)o.defaultHandler();else return false}else o.defaultHandler&&o.defaultHandler();break}}}return true}}return false},_doBackspace:function(k){var m=this._getSelection();if(m.isEmpty()){var o=this._model,s=m.getCaret(),w=o.getLineAtOffset(s),y=o.getLineStart(w);if(s===y)w>0&&m.extend(o.getLineEnd(w-
1));else{w=false;if(this._expandTab&&k.unit==="character"&&(s-y)%this._tabSize===0)w=!/[^ ]/.test(o.getText(y,s));w?m.extend(s-this._tabSize):m.extend(this._getOffset(s,k.unit,-1))}}this._modifyContent({text:"",start:m.start,end:m.end},true);return true},_doContent:function(k){var m=this._getSelection();this._modifyContent({text:k,start:m.start,end:m.end,_ignoreDOMSelection:true},true)},_doCopy:function(k){var m=this._getSelection();if(!m.isEmpty())return this._setClipboardText(this._getBaseText(m.start,
m.end),k);return true},_doCursorNext:function(k){if(!k.select)if(this._clearSelection("next"))return true;var m=this._model,o=this._getSelection(),s=o.getCaret(),w=m.getLineAtOffset(s);if(s===m.getLineEnd(w))w+1<m.getLineCount()&&o.extend(m.getLineStart(w+1));else o.extend(this._getOffset(s,k.unit,1));k.select||o.collapse();this._setSelection(o,true);return true},_doCursorPrevious:function(k){if(!k.select)if(this._clearSelection("previous"))return true;var m=this._model,o=this._getSelection(),s=o.getCaret(),
w=m.getLineAtOffset(s);if(s===m.getLineStart(w))w>0&&o.extend(m.getLineEnd(w-1));else o.extend(this._getOffset(s,k.unit,-1));k.select||o.collapse();this._setSelection(o,true);return true},_doCut:function(k){var m=this._getSelection();if(!m.isEmpty()){m=this._getBaseText(m.start,m.end);this._doContent("");return this._setClipboardText(m,k)}return true},_doDelete:function(k){var m=this._getSelection();if(m.isEmpty()){var o=this._model,s=m.getCaret(),w=o.getLineAtOffset(s);if(s===o.getLineEnd(w))w+1<
o.getLineCount()&&m.extend(o.getLineStart(w+1));else m.extend(this._getOffset(s,k.unit,1))}this._modifyContent({text:"",start:m.start,end:m.end},true);return true},_doEnd:function(k){var m=this._getSelection(),o=this._model;if(k.ctrl)m.extend(o.getCharCount());else{var s=o.getLineAtOffset(m.getCaret());m.extend(o.getLineEnd(s))}k.select||m.collapse();this._setSelection(m,true);return true},_doEnter:function(k){var m=this._model,o=this._getSelection();this._doContent(m.getLineDelimiter());if(k&&k.noCursor){o.end=
o.start;this._setSelection(o)}return true},_doHome:function(k){var m=this._getSelection(),o=this._model;if(k.ctrl)m.extend(0);else{var s=o.getLineAtOffset(m.getCaret());m.extend(o.getLineStart(s))}k.select||m.collapse();this._setSelection(m,true);return true},_doLineDown:function(k){var m=this._model,o=this._getSelection(),s=o.getCaret(),w=m.getLineAtOffset(s);if(w+1<m.getLineCount()){var y=this._getScroll().x,B=this._columnX;if(B===-1||k.wholeLine||k.select&&i)B=this._getOffsetToX(k.wholeLine?m.getLineEnd(w+
1):s)+y;o.extend(this._getXToOffset(w+1,B-y));k.select||o.collapse();this._setSelection(o,true,true);this._columnX=B}return true},_doLineUp:function(k){var m=this._model,o=this._getSelection(),s=o.getCaret(),w=m.getLineAtOffset(s);if(w>0){var y=this._getScroll().x,B=this._columnX;if(B===-1||k.wholeLine||k.select&&i)B=this._getOffsetToX(k.wholeLine?m.getLineStart(w-1):s)+y;o.extend(this._getXToOffset(w-1,B-y));k.select||o.collapse();this._setSelection(o,true,true);this._columnX=B}return true},_doPageDown:function(k){var m=
this._model,o=this._getSelection(),s=o.getCaret(),w=m.getLineAtOffset(s),y=m.getLineCount();if(w<y-1){m=this._getScroll();var B=this._getClientHeight(),A=this._getLineHeight(),E=Math.floor(B/A),G=Math.min(y-w-1,E);G=Math.max(1,G);E=this._columnX;if(E===-1||k.select&&i)E=this._getOffsetToX(s)+m.x;o.extend(this._getXToOffset(w+G,E-m.x));k.select||o.collapse();k=y*A;s=m.y+G*A;if(s+B>k)s=k-B;this._setSelection(o,true,true,s-m.y);this._columnX=E}return true},_doPageUp:function(k){var m=this._model,o=this._getSelection(),
s=o.getCaret(),w=m.getLineAtOffset(s);if(w>0){m=this._getScroll();var y=this._getClientHeight(),B=this._getLineHeight();y=Math.floor(y/B);var A=Math.max(1,Math.min(w,y));y=this._columnX;if(y===-1||k.select&&i)y=this._getOffsetToX(s)+m.x;o.extend(this._getXToOffset(w-A,y-m.x));k.select||o.collapse();k=Math.max(0,m.y-A*B);this._setSelection(o,true,true,k-m.y);this._columnX=y}return true},_doPaste:function(k){var m=this;return this._getClipboardText(k,function(o){if(o){q&&m._lastMouseButton===2&&(new Date).getTime()-
m._lastMouseTime<=m._clickTime&&m._setSelectionTo(m._lastMouseX,m._lastMouseY);m._doContent(o)}})!==null},_doScroll:function(k){var m=k.type,o=this._model,s=o.getLineCount();k=this._getClientHeight();var w=this._getLineHeight();s=s*w;var y=this._getScroll().y,B;switch(m){case "textStart":B=0;break;case "textEnd":B=s-k;break;case "pageDown":B=y+k;break;case "pageUp":B=y-k;break;case "centerLine":m=this._getSelection();B=o.getLineAtOffset(m.start);o=(o.getLineAtOffset(m.end)-B+1)*w;B=B*w-k/2+o/2;break}if(B!==
undefined){B=Math.min(Math.max(0,B),s-k);this._scrollView(0,B-y)}},_doSelectAll:function(){var k=this._model,m=this._getSelection();m.setCaret(0);m.extend(k.getCharCount());this._setSelection(m,false);return true},_doTab:function(){var k="\t";if(this._expandTab){var m=this._model;k=this._getSelection().getCaret();var o=m.getLineAtOffset(k);m=m.getLineStart(o);k=(new Array(this._tabSize-(k-m)%this._tabSize+1)).join(" ")}this._doContent(k);return true},_applyStyle:function(k,m,o){if(o){o=m.attributes;
for(var s=o.length;s-- >0;)o[s].specified&&m.removeAttributeNode(o[s])}if(k){if(k.styleClass)m.className=k.styleClass;if(o=k.style)for(var w in o)if(o.hasOwnProperty(w))m.style[w]=o[w];if(k=k.attributes)for(var y in k)k.hasOwnProperty(y)&&m.setAttribute(y,k[y])}},_autoScroll:function(){var k=this._getSelection(),m,o=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var s=this._autoScrollY/this._getLineHeight();s=s<0?Math.floor(s):Math.ceil(s);m=this._model.getLineAtOffset(k.getCaret());
m=Math.max(0,Math.min(this._model.getLineCount()-1,m+s))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){m=this._getYToLine(this._autoScrollY);o+=this._getOffsetToX(k.getCaret())}k.extend(this._getXToOffset(m,o));this._setSelection(k,true)},_autoScrollTimer:function(){this._autoScroll();var k=this;this._autoScrollTimerID=setTimeout(function(){k._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateMetrics:function(){var k=this._clientDiv,m=this._frameDocument,o=m.createElement("DIV"),
s={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(s);this._applyStyle(s.style,o);o.style.position="fixed";o.style.left="-1000px";s=m.createElement("SPAN");s.appendChild(m.createTextNode(" "));o.appendChild(s);var w=m.createElement("SPAN");w.style.fontStyle="italic";w.appendChild(m.createTextNode(" "));o.appendChild(w);var y=m.createElement("SPAN");y.style.fontWeight="bold";y.appendChild(m.createTextNode(" "));o.appendChild(y);var B=m.createElement("SPAN");
B.style.fontWeight="bold";B.style.fontStyle="italic";B.appendChild(m.createTextNode(" "));o.appendChild(B);k.appendChild(o);m=o.getBoundingClientRect();s=s.getBoundingClientRect();w=w.getBoundingClientRect();y=y.getBoundingClientRect();var A=B.getBoundingClientRect();B=w.bottom-w.top;y=y.bottom-y.top;w=A.bottom-A.top;A=0;m=m.bottom-m.top;if(B>s.bottom-s.top)A=1;if(y>B)A=2;if(w>y)A=3;var E;if(A!==0){E={style:{}};if((A&1)!==0)E.style.fontStyle="italic";if((A&2)!==0)E.style.fontWeight="bold"}s=this._getLineTrim(o);
k.removeChild(o);return{lineHeight:m,largestFontStyle:E,lineTrim:s,viewPadding:this._calculatePadding()}},_calculatePadding:function(){var k=this._frameDocument,m=this._clientDiv,o=this._getPadding(this._viewDiv),s=k.createElement("DIV");s.style.position="fixed";s.style.left="-1000px";s.style.paddingLeft=o.left+"px";s.style.paddingTop=o.top+"px";s.style.paddingRight=o.right+"px";s.style.paddingBottom=o.bottom+"px";s.style.width="100px";s.style.height="100px";o=k.createElement("DIV");o.style.width=
"100%";o.style.height="100%";s.appendChild(o);m.appendChild(s);k=s.getBoundingClientRect();o=o.getBoundingClientRect();m.removeChild(s);return o={left:o.left-k.left,top:o.top-k.top,right:k.right-o.right,bottom:k.bottom-o.bottom}},_clearSelection:function(k){var m=this._getSelection();if(m.isEmpty())return false;if(k==="next")m.start=m.end;else m.end=m.start;this._setSelection(m,true);return true},_clone:function(k){if(k instanceof Array)return k.slice(0);return k},_compare:function(k,m){if(k===m)return true;
if(k&&!m||!k&&m)return false;if(k&&k.constructor===String||m&&m.constructor===String)return false;if(k instanceof Array||m instanceof Array){if(!(k instanceof Array&&m instanceof Array))return false;if(k.length!==m.length)return false;for(var o=0;o<k.length;o++)if(!this._compare(k[o],m[o]))return false;return true}if(!(k instanceof Object)||!(m instanceof Object))return false;for(o in k)if(k.hasOwnProperty(o)){if(!m.hasOwnProperty(o))return false;if(!this._compare(k[o],m[o]))return false}for(o in m)if(!k.hasOwnProperty(o))return false;
return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var k=this._model,m=k.getLineAtOffset(this._imeOffset),o=k.getLineStart(m),s=this._getDOMText(m);k=k.getLine(m);o=this._imeOffset-o;k=o+s.length-k.length;o!==k&&this._doContent(s.substring(o,k));this._imeOffset=-1}},_convertDelimiter:function(k,m,o){for(var s=0,w=0,y=0,B=k.length;y<B;){if(s!==-1&&s<=y)s=k.indexOf("\r",y);if(w!==-1&&w<=y)w=k.indexOf("\n",y);var A=y,E;if(w===-1&&s===-1){m(k.substring(y));
break}if(s!==-1&&w!==-1)if(s+1===w){E=s;y=w+1}else{E=s<w?s:w;y=(s<w?s:w)+1}else if(s!==-1){E=s;y=s+1}else{E=w;y=w+1}m(k.substring(A,E));o()}},_createActions:function(){var k=e.KeyBinding,m=this._keyBindings=[];m.push({name:"lineUp",keyBinding:new k(38),predefined:true});m.push({name:"lineDown",keyBinding:new k(40),predefined:true});m.push({name:"charPrevious",keyBinding:new k(37),predefined:true});m.push({name:"charNext",keyBinding:new k(39),predefined:true});if(r){m.push({name:"scrollPageUp",keyBinding:new k(33),
predefined:true});m.push({name:"scrollPageDown",keyBinding:new k(34),predefined:true});m.push({name:"pageUp",keyBinding:new k(33,null,null,true),predefined:true});m.push({name:"pageDown",keyBinding:new k(34,null,null,true),predefined:true});m.push({name:"lineStart",keyBinding:new k(37,true),predefined:true});m.push({name:"lineEnd",keyBinding:new k(39,true),predefined:true});m.push({name:"wordPrevious",keyBinding:new k(37,null,null,true),predefined:true});m.push({name:"wordNext",keyBinding:new k(39,
null,null,true),predefined:true});m.push({name:"scrollTextStart",keyBinding:new k(36),predefined:true});m.push({name:"scrollTextEnd",keyBinding:new k(35),predefined:true});m.push({name:"textStart",keyBinding:new k(38,true),predefined:true});m.push({name:"textEnd",keyBinding:new k(40,true),predefined:true});m.push({name:"scrollPageUp",keyBinding:new k(38,null,null,null,true),predefined:true});m.push({name:"scrollPageDown",keyBinding:new k(40,null,null,null,true),predefined:true});m.push({name:"lineStart",
keyBinding:new k(37,null,null,null,true),predefined:true});m.push({name:"lineEnd",keyBinding:new k(39,null,null,null,true),predefined:true});m.push({name:"lineStart",keyBinding:new k(38,null,null,true),predefined:true});m.push({name:"lineEnd",keyBinding:new k(40,null,null,true),predefined:true})}else{m.push({name:"pageUp",keyBinding:new k(33),predefined:true});m.push({name:"pageDown",keyBinding:new k(34),predefined:true});m.push({name:"lineStart",keyBinding:new k(36),predefined:true});m.push({name:"lineEnd",
keyBinding:new k(35),predefined:true});m.push({name:"wordPrevious",keyBinding:new k(37,true),predefined:true});m.push({name:"wordNext",keyBinding:new k(39,true),predefined:true});m.push({name:"textStart",keyBinding:new k(36,true),predefined:true});m.push({name:"textEnd",keyBinding:new k(35,true),predefined:true})}if(j&&q){m.push({name:"lineUp",keyBinding:new k(38,true),predefined:true});m.push({name:"lineDown",keyBinding:new k(40,true),predefined:true})}m.push({name:"selectLineUp",keyBinding:new k(38,
null,true),predefined:true});m.push({name:"selectLineDown",keyBinding:new k(40,null,true),predefined:true});m.push({name:"selectCharPrevious",keyBinding:new k(37,null,true),predefined:true});m.push({name:"selectCharNext",keyBinding:new k(39,null,true),predefined:true});m.push({name:"selectPageUp",keyBinding:new k(33,null,true),predefined:true});m.push({name:"selectPageDown",keyBinding:new k(34,null,true),predefined:true});if(r){m.push({name:"selectLineStart",keyBinding:new k(37,true,true),predefined:true});
m.push({name:"selectLineEnd",keyBinding:new k(39,true,true),predefined:true});m.push({name:"selectWordPrevious",keyBinding:new k(37,null,true,true),predefined:true});m.push({name:"selectWordNext",keyBinding:new k(39,null,true,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(36,null,true),predefined:true});m.push({name:"selectTextEnd",keyBinding:new k(35,null,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(38,true,true),predefined:true});m.push({name:"selectTextEnd",
keyBinding:new k(40,true,true),predefined:true});m.push({name:"selectLineStart",keyBinding:new k(37,null,true,null,true),predefined:true});m.push({name:"selectLineEnd",keyBinding:new k(39,null,true,null,true),predefined:true});m.push({name:"selectLineStart",keyBinding:new k(38,null,true,true),predefined:true});m.push({name:"selectLineEnd",keyBinding:new k(40,null,true,true),predefined:true})}else{if(q){m.push({name:"selectWholeLineUp",keyBinding:new k(38,true,true),predefined:true});m.push({name:"selectWholeLineDown",
keyBinding:new k(40,true,true),predefined:true})}m.push({name:"selectLineStart",keyBinding:new k(36,null,true),predefined:true});m.push({name:"selectLineEnd",keyBinding:new k(35,null,true),predefined:true});m.push({name:"selectWordPrevious",keyBinding:new k(37,true,true),predefined:true});m.push({name:"selectWordNext",keyBinding:new k(39,true,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(36,true,true),predefined:true});m.push({name:"selectTextEnd",keyBinding:new k(35,true,
true),predefined:true})}m.push({name:"deletePrevious",keyBinding:new k(8),predefined:true});m.push({name:"deletePrevious",keyBinding:new k(8,null,true),predefined:true});m.push({name:"deleteNext",keyBinding:new k(46),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,true),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,true,true),predefined:true});m.push({name:"deleteWordNext",keyBinding:new k(46,true),predefined:true});m.push({name:"tab",keyBinding:new k(9),
predefined:true});m.push({name:"enter",keyBinding:new k(13),predefined:true});m.push({name:"enter",keyBinding:new k(13,null,true),predefined:true});m.push({name:"selectAll",keyBinding:new k("a",true),predefined:true});if(r){m.push({name:"deleteNext",keyBinding:new k(46,null,true),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,null,null,true),predefined:true});m.push({name:"deleteWordNext",keyBinding:new k(46,null,null,true),predefined:true})}if(!j){var o=r&&n;m.push({name:null,
keyBinding:new k("u",!o,false,false,o),predefined:true});m.push({name:null,keyBinding:new k("i",!o,false,false,o),predefined:true});m.push({name:null,keyBinding:new k("b",!o,false,false,o),predefined:true})}if(j){m.push({name:"copy",keyBinding:new k(45,true),predefined:true});m.push({name:"paste",keyBinding:new k(45,null,true),predefined:true});m.push({name:"cut",keyBinding:new k(46,null,true),predefined:true})}if(r){m.push({name:"lineStart",keyBinding:new k("a",false,false,false,true),predefined:true});
m.push({name:"lineEnd",keyBinding:new k("e",false,false,false,true),predefined:true});m.push({name:"lineUp",keyBinding:new k("p",false,false,false,true),predefined:true});m.push({name:"lineDown",keyBinding:new k("n",false,false,false,true),predefined:true});m.push({name:"charPrevious",keyBinding:new k("b",false,false,false,true),predefined:true});m.push({name:"charNext",keyBinding:new k("f",false,false,false,true),predefined:true});m.push({name:"deletePrevious",keyBinding:new k("h",false,false,false,
true),predefined:true});m.push({name:"deleteNext",keyBinding:new k("d",false,false,false,true),predefined:true});m.push({name:"deleteLineEnd",keyBinding:new k("k",false,false,false,true),predefined:true});if(j){m.push({name:"scrollPageDown",keyBinding:new k("v",false,false,false,true),predefined:true});m.push({name:"deleteLineStart",keyBinding:new k("u",false,false,false,true),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k("w",false,false,false,true),predefined:true})}else{m.push({name:"pageDown",
keyBinding:new k("v",false,false,false,true),predefined:true});m.push({name:"centerLine",keyBinding:new k("l",false,false,false,true),predefined:true});m.push({name:"enterNoCursor",keyBinding:new k("o",false,false,false,true),predefined:true})}}var s=this;this._actions=[{name:"lineUp",defaultHandler:function(){return s._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return s._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return s._doHome({select:false,
ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return s._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return s._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return s._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return s._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return s._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return s._doScroll({type:"pageUp"})}},
{name:"scrollPageDown",defaultHandler:function(){return s._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return s._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return s._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return s._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return s._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return s._doScroll({type:"textStart"})}},
{name:"scrollTextEnd",defaultHandler:function(){return s._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return s._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return s._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return s._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return s._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return s._doLineDown({select:true,
wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return s._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return s._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return s._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return s._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return s._doPageUp({select:true})}},
{name:"selectPageDown",defaultHandler:function(){return s._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return s._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return s._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return s._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return s._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",
defaultHandler:function(){return s._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return s._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return s._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return s._doDelete({unit:"word"})}},{name:"deleteLineStart",defaultHandler:function(){return s._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return s._doDelete({unit:"line"})}},
{name:"tab",defaultHandler:function(){return s._doTab()}},{name:"enter",defaultHandler:function(){return s._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return s._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return s._doSelectAll()}},{name:"copy",defaultHandler:function(){return s._doCopy()}},{name:"cut",defaultHandler:function(){return s._doCut()}},{name:"paste",defaultHandler:function(){return s._doPaste()}}]},_createLine:function(k,m,o,s,w){var y=w.getLine(s),
B=w.getLineStart(s),A={type:"LineStyle",textView:this,lineIndex:s,lineText:y,lineStart:B};this.onLineStyle(A);w=m||o.createElement("DIV");if(!m||!this._compare(m.viewStyle,A.style)){this._applyStyle(A.style,w,m);if(m)m._trim=null;w.viewStyle=A.style;w.setAttribute("role","presentation")}w.lineIndex=s;s=[];this._createRanges(A.ranges,y,0,y.length,B,{tabOffset:0,ranges:s});y=" ";if(!this._fullSelection&&i<9)y="\ufeff";if(t)y="\u200c";s.push({text:y,style:this._metrics.largestFontStyle,ignoreChars:1});
var E,G,M,H,N,L;A=y=0;var P,S;if(m){if(M=m.modelChangedEvent){if(M.removedLineCount===0&&M.addedLineCount===0){S=M.start-B;P=M.addedCharCount-M.removedCharCount}else S=-1;m.modelChangedEvent=undefined}M=m.firstChild}for(B=0;B<s.length;B++){E=s[B];N=E.text;y+=N.length;G=E.style;if(M){L=M.firstChild.data;H=M.viewStyle;if(L===N&&this._compare(G,H)){A+=L.length;M._rectsCache=undefined;E=M=M.nextSibling;continue}else for(;M;){if(S!==-1){H=y;if(H>=S)H-=P;L=M.firstChild.data.length;if(A+L>H)break;A+=L}H=
M.nextSibling;w.removeChild(M);M=H}}E=this._createSpan(w,o,N,G,E.ignoreChars);M?w.insertBefore(E,M):w.appendChild(E);if(m)m.lineWidth=undefined}if(m)for(k=E?E.nextSibling:null;k;){H=k.nextSibling;m.removeChild(k);k=H}else k.appendChild(w);return w},_createRanges:function(k,m,o,s,w,y){if(!(o>=s)){if(k)for(var B=0;B<k.length;B++){var A=k[B];if(!(A.end<=w+o)){var E=Math.max(w+o,A.start)-w;if(E>=s)break;var G=Math.min(w+s,A.end)-w;if(E<G){E=Math.max(o,E);G=Math.min(s,G);for(o<E&&this._createRange(m,o,
E,null,y);B+1<k.length&&k[B+1].start-w===G&&this._compare(A.style,k[B+1].style);){A=k[B+1];G=Math.min(w+s,A.end)-w;B++}this._createRange(m,E,G,A.style,y);o=G}}}o<s&&this._createRange(m,o,s,null,y)}},_createRange:function(k,m,o,s,w){if(!(m>=o)){var y=this._customTabSize;if(y&&y!==8)for(var B=k.indexOf("\t",m);B!==-1&&B<o;){if(m<B){m={text:k.substring(m,B),style:s};w.ranges.push(m);w.tabOffset+=m.text.length}m=y-w.tabOffset%y;if(m>0){for(var A="\u00a0",E=1;E<m;E++)A+=" ";m={text:A,style:s,ignoreChars:m-
1};w.ranges.push(m);w.tabOffset+=m.text.length}m=B+1;B=k.indexOf("\t",m)}if(m<o){m={text:k.substring(m,o),style:s};w.ranges.push(m);w.tabOffset+=m.text.length}}},_createSpan:function(k,m,o,s,w){var y=s&&s.tagName==="A";if(y)k.hasLink=true;k=y&&this._linksVisible?"A":"SPAN";y=m.createElement(k);y.appendChild(m.createTextNode(o));this._applyStyle(s,y);if(k==="A"){var B=this;b(y,"click",function(A){return B._handleLinkClick(A)},false)}y.viewStyle=s;if(w)y.ignoreChars=w;return y},_createRuler:function(k){if(this._clientDiv){var m=
this._frameDocument,o=m.body,s=k.getLocation(),w=s==="left"?this._leftDiv:this._rightDiv;if(!w){w=m.createElement("DIV");w.style.overflow="hidden";w.style.MozUserSelect="none";w.style.WebkitUserSelect="none";i&&w.attachEvent("onselectstart",function(){return false});w.style.position="absolute";w.style.top="0px";w.style.cursor="default";o.appendChild(w);if(s==="left"){this._leftDiv=w;w.className="viewLeftRuler"}else{this._rightDiv=w;w.className="viewRightRuler"}o=m.createElement("TABLE");w.appendChild(o);
o.cellPadding="0px";o.cellSpacing="0px";o.border="0px";o.insertRow(0);var y=this;b(w,"click",function(B){y._handleRulerEvent(B)});b(w,"dblclick",function(B){y._handleRulerEvent(B)});b(w,"mousemove",function(B){y._handleRulerEvent(B)});b(w,"mouseover",function(B){y._handleRulerEvent(B)});b(w,"mouseout",function(B){y._handleRulerEvent(B)})}m=m.createElement("DIV");m._ruler=k;m.rulerChanged=true;m.style.position="relative";k=w.firstChild.rows[0];k=k.insertCell(k.cells.length);k.vAlign="top";k.appendChild(m)}},
_createFrame:function(){if(!this.frame){for(var k=this._parent;k.hasChildNodes();)k.removeChild(k.lastChild);var m=k.ownerDocument;this._parentDocument=m;var o=m.createElement("IFRAME");this._frame=o;o.frameBorder="0px";o.style.border="0px";o.style.width="100%";o.style.height="100%";o.scrolling="no";var s=this;s._frameLoaded=false;this._loadHandler=function(w){s._frameLoaded=true;s._sync?s._handleLoad(w):setTimeout(function(){s._handleLoad(w)},0)};b(o,"load",this._loadHandler,!!j);if(!t)b(m,"DOMAttrModified",
this._attrModifiedHandler=function(w){s._frameLoaded&&s._handleDOMAttrModified(w)});k.appendChild(o);this._sync&&this._handleLoad()}},_getFrameHTML:function(){var k=[];k.push("<!DOCTYPE html>");k.push("<html>");k.push("<head>");i<9&&k.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");k.push("<style>");k.push(".viewContainer {font-family: monospace; font-size: 10pt;}");k.push(".view {padding: 1px 2px;}");k.push(".viewContent {}");k.push("</style>");if(this._stylesheet)for(var m=
typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,o=0;o<m.length;o++){var s=m[o],w=this._isLinkURL(s);if(w&&this._sync)try{var y=new XMLHttpRequest;y.overrideMimeType&&y.overrideMimeType("text/css");y.open("GET",s,false);y.send(null);s=y.responseText;w=false}catch(B){}if(w){k.push("<link rel='stylesheet' type='text/css' ");i<9&&k.push("onload='window' ");k.push("href='");k.push(s);k.push("'></link>")}else{k.push("<style>");k.push(s);k.push("</style>")}}k.push("<script>");k.push("var waitForStyleSheets = true;");
k.push("<\/script>");k.push("</head>");k.push("<body spellcheck='false'></body>");k.push("</html>");return k.join("")},_createView:function(){if(!this._frameDocument){var k=this._frameWindow=this._frame.contentWindow,m=this._frameDocument=k.document,o=this;m.open("text/html","replace");m.write(o._getFrameHTML());m.close();o._windowLoadHandler=function(){m.readyState==="complete"&&o._createContent()};b(k,"load",o._windowLoadHandler);if(this._sync)this._createContent();else{this._createViewTimer=function(){o._clientDiv||
(m.readyState==="complete"?o._createContent():setTimeout(o._createViewTimer,10))};setTimeout(this._createViewTimer,10)}}},_createContent:function(){if(!this._clientDiv){var k=this._parent,m=this._parentDocument,o=this._frameDocument,s=o.body;this._setThemeClass(this._themeClass,true);s.style.margin="0px";s.style.borderWidth="0px";s.style.padding="0px";if(v){var w=m.createElement("DIV");this._touchDiv=w;w.style.position="absolute";w.style.border="0px";w.style.padding="0px";w.style.margin="0px";w.style.zIndex=
"2";w.style.overflow="hidden";w.style.background="transparent";w.style.WebkitUserSelect="none";k.appendChild(w);this._textArea=k=m.createElement("TEXTAREA");k.style.position="absolute";k.style.whiteSpace="pre";k.style.left="-1000px";k.tabIndex=1;k.autocapitalize="off";k.autocorrect="off";k.className="viewContainer";k.style.background="transparent";k.style.color="transparent";k.style.border="0px";k.style.padding="0px";k.style.margin="0px";k.style.borderRadius="0px";k.style.WebkitAppearance="none";
k.style.WebkitTapHighlightColor="transparent";w.appendChild(k)}if(j){this._clipboardDiv=w=o.createElement("DIV");w.style.position="fixed";w.style.whiteSpace="pre";w.style.left="-1000px";s.appendChild(w)}w=o.createElement("DIV");w.className="view";this._viewDiv=w;w.id="viewDiv";w.tabIndex=-1;w.style.overflow="auto";w.style.position="absolute";w.style.top="0px";w.style.borderWidth="0px";w.style.margin="0px";w.style.MozOutline="none";w.style.outline="none";w.setAttribute("role","application");s.appendChild(w);
this._scrollDiv=k=o.createElement("DIV");k.id="scrollDiv";k.style.margin="0px";k.style.borderWidth="0px";k.style.padding="0px";w.appendChild(k);if(j){this._clipDiv=m=o.createElement("DIV");m.id="clipDiv";m.style.position="fixed";m.style.overflow="hidden";m.style.margin="0px";m.style.borderWidth="0px";m.style.padding="0px";k.appendChild(m);var y=o.createElement("DIV");this._clipScrollDiv=y;y.id="clipScrollDiv";y.style.position="absolute";y.style.height="1px";y.style.top="-1000px";m.appendChild(y)}this._setFullSelection(this._fullSelection,
true);m=o.createElement("DIV");m.className="viewContent";this._clientDiv=m;m.id="clientDiv";m.style.whiteSpace="pre";m.style.position=this._clipDiv?"absolute":"fixed";m.style.borderWidth="0px";m.style.margin="0px";m.style.padding="0px";m.style.MozOutline="none";m.style.outline="none";m.style.zIndex="1";if(v)m.style.WebkitTapHighlightColor="transparent";(this._clipDiv||k).appendChild(m);if(j&&!m.setCapture){this._overlayDiv=o=o.createElement("DIV");o.id="overlayDiv";o.style.position=m.style.position;
o.style.borderWidth=m.style.borderWidth;o.style.margin=m.style.margin;o.style.padding=m.style.padding;o.style.cursor="text";o.style.zIndex="2";(this._clipDiv||k).appendChild(o)}if(!v)m.contentEditable="true";m.setAttribute("role","textbox");m.setAttribute("aria-multiline","true");o=this._metrics=this._calculateMetrics();if(i)s.style.lineHeight=o.lineHeight-(o.lineTrim.top+o.lineTrim.bottom)+"px";this._setTabSize(this._tabSize,true);this._hookEvents();s=this._rulers;for(o=0;o<s.length;o++)this._createRuler(s[o]);
this._updatePage();s=this._hScroll;o=this._vScroll;this._vScroll=this._hScroll=0;if(s>0||o>0){w.scrollLeft=s;w.scrollTop=o}this.onLoad({type:"Load"})}},_defaultOptions:function(){return{parent:{value:undefined,recreate:true,update:null},model:{value:undefined,recreate:false,update:this.setModel},readonly:{value:false,recreate:false,update:null},fullSelection:{value:true,recreate:false,update:this._setFullSelection},tabSize:{value:8,recreate:false,update:this._setTabSize},expandTab:{value:false,recreate:false,
update:null},stylesheet:{value:[],recreate:false,update:this._setStyleSheet},themeClass:{value:undefined,recreate:false,update:this._setThemeClass},sync:{value:false,recreate:false,update:null}}},_destroyFrame:function(){var k=this._frame;if(k){if(this._loadHandler){c(k,"load",this._loadHandler,!!j);this._loadHandler=null}if(this._attrModifiedHandler){c(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}k.parentNode.removeChild(k);this._frame=null}},_destroyRuler:function(k){var m=
k.getLocation()==="left"?this._leftDiv:this._rightDiv;if(m){m=m.firstChild.rows[0];for(var o=m.cells,s=0;s<o.length;s++)if(o[s].firstChild._ruler===k)break;if(s!==o.length){m.cells[s]._ruler=undefined;m.deleteCell(s)}}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();if(this._windowLoadHandler){c(this._frameWindow,"load",this._windowLoadHandler);this._windowLoadHandler=null}if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}for(var k=this._frameDocument.body;k.hasChildNodes();)k.removeChild(k.lastChild);if(this._touchDiv){this._parent.removeChild(this._touchDiv);this._touchDiv=null}this._selDiv3=this._selDiv2=this._selDiv1=null;this._insertedSelRule=false;this._frameWindow=this._frameDocument=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._clipboardDiv=
this._textArea=null;this.onUnload({type:"Unload"})}},_doAutoScroll:function(k,m,o){this._autoScrollDir=k;this._autoScrollX=m;this._autoScrollY=o;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_fixCaret:function(){var k=this._clientDiv;if(k){var m=this._hasFocus;this._ignoreFocus=true;m&&k.blur();k.contentEditable=false;k.contentEditable=true;m&&k.focus();
this._ignoreFocus=false}},_getBaseText:function(k,m){var o=this._model;if(o.getBaseModel){k=o.mapOffset(k);m=o.mapOffset(m);o=o.getBaseModel()}return o.getText(k,m)},_getBorder:function(k){var m,o,s,w;if(this._frameWindow.getComputedStyle){k=this._frameWindow.getComputedStyle(k,null);m=k.getPropertyValue("border-left-width");o=k.getPropertyValue("border-top-width");s=k.getPropertyValue("border-right-width");w=k.getPropertyValue("border-bottom-width")}else if(k.currentStyle){m=k.currentStyle.borderLeftWidth;
o=k.currentStyle.borderTopWidth;s=k.currentStyle.borderRightWidth;w=k.currentStyle.borderBottomWidth}return{left:parseInt(m,10)||0,top:parseInt(o,10)||0,right:parseInt(s,10)||0,bottom:parseInt(w,10)||0}},_getBoundsAtOffset:function(k){var m=this._model,o=this._frameDocument,s=this._clientDiv,w=m.getLineAtOffset(k),y,B=this._getLineNode(w);B||(B=y=this._createLine(s,null,o,w,m));var A=null;if(k<m.getLineEnd(w)){m=m.getLineStart(w);for(w=B.firstChild;w;){var E=w.firstChild,G=E.length;if(w.ignoreChars)G-=
w.ignoreChars;if(m+G>k){A=k-m;if(z){o=o.createRange();o.setStart(E,A);o.setEnd(E,A+1);A=o.getBoundingClientRect()}else if(i){o=o.body.createTextRange();o.moveToElementText(w);o.collapse();o.moveEnd("character",A+1);o.moveStart("character",A);A=o.getBoundingClientRect()}else{k=E.data;w.removeChild(E);w.appendChild(o.createTextNode(k.substring(0,A)));var M=o.createElement("SPAN");M.appendChild(o.createTextNode(k.substring(A,A+1)));w.appendChild(M);w.appendChild(o.createTextNode(k.substring(A+1)));A=
M.getBoundingClientRect();w.innerHTML="";w.appendChild(E);if(!y){o=this._getSelection();if(m<=o.start&&o.start<m+G||m<=o.end&&o.end<m+G)this._updateDOMSelection()}}if(i){o=window.screen.logicalXDPI;m=window.screen.deviceXDPI;A.left=A.left*o/m;A.right=A.right*o/m}break}m+=G;w=w.nextSibling}}if(!A){B=this._getLineBoundingClientRect(B);A={left:B.right,right:B.right}}y&&s.removeChild(y);return A},_getBottomIndex:function(k){var m=this._bottomChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=
m.getBoundingClientRect();var o=this._clientDiv.getBoundingClientRect();if(k.bottom>o.bottom)m=this._getLinePrevious(m)||m}return m.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var k=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-k.top-k.bottom)},_getClientWidth:function(){var k=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-k.left-k.right)},_getClipboardText:function(k,m){var o=this._model.getLineDelimiter(),s,w;if(this._frameWindow.clipboardData){s=[];w=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(w,function(H){s.push(H)},function(){s.push(o)});w=s.join("");m&&m(w);return w}if(j){this._ignoreFocus=true;var y=this._frameDocument,B=this._clipboardDiv;B.innerHTML="<pre contenteditable=''></pre>";B.firstChild.focus();var A=this,E=function(){var H=A._getTextFromElement(B);
B.innerHTML="";s=[];A._convertDelimiter(H,function(N){s.push(N)},function(){s.push(o)});return s.join("")},G=false;this._ignorePaste=true;if(!q||this._lastMouseButton!==2)try{G=y.execCommand("paste",false,null)}catch(M){G=B.childNodes.length>1||B.firstChild&&B.firstChild.childNodes.length>0}this._ignorePaste=false;if(!G)if(k){setTimeout(function(){A.focus();(w=E())&&m&&m(w);A._ignoreFocus=false},0);return null}else{this.focus();this._ignoreFocus=false;return""}this.focus();this._ignoreFocus=false;
(w=E())&&m&&m(w);return w}if(k&&k.clipboardData){s=[];w=k.clipboardData.getData("text/plain");this._convertDelimiter(w,function(H){s.push(H)},function(){s.push(o)});(w=s.join(""))&&m&&m(w);return w}return""},_getDOMText:function(k){k=this._getLineNode(k).firstChild;for(var m="";k;){for(var o=k.firstChild;o;){if(k.ignoreChars)for(var s=0;s<o.length;s++){var w=o.data.substring(s,s+1);if(w!==" ")m+=w}else m+=o.data;o=o.nextSibling}k=k.nextSibling}return m},_getTextFromElement:function(k){var m=k.ownerDocument,
o=m.defaultView;if(!o.getSelection)return k.innerText||k.textContent;m=m.createRange();m.selectNode(k);k=o.getSelection();o=[];var s;for(s=0;s<k.rangeCount;s++)o.push(k.getRangeAt(s));this._ignoreSelect=true;k.removeAllRanges();k.addRange(m);m=k.toString();k.removeAllRanges();for(s=0;s<o.length;s++)k.addRange(o[s]);this._ignoreSelect=false;return m},_getViewPadding:function(){return this._metrics.viewPadding},_getLineTrim:function(k){var m=k._trim;if(!m){m=this._getPadding(k);var o=this._getBorder(k);
m.left+=o.left;m.top+=o.top;m.right+=o.right;m.bottom+=o.bottom;k._trim=m}return m},_getLineBoundingClientRect:function(k,m){var o=k.getBoundingClientRect();o={left:o.left,top:o.top,right:o.left,bottom:o.bottom};for(var s=k.lastChild;s&&s.ignoreChars===s.firstChild.length;)s=s.previousSibling;if(s){s=s.getBoundingClientRect();o.right=s.right+this._getLineTrim(k).right}if(m){k=this._getLineTrim(k);o.left+=k.left;o.right-=k.right}return o},_getLineHeight:function(){return this._metrics.lineHeight},
_getLineNode:function(k){for(var m=this._clientDiv.firstChild;m;){if(k===m.lineIndex)return m;m=m.nextSibling}},_getLineNext:function(k){for(k=k?k.nextSibling:this._clientDiv.firstChild;k&&k.lineIndex===-1;)k=k.nextSibling;return k},_getLinePrevious:function(k){for(k=k?k.previousSibling:this._clientDiv.lastChild;k&&k.lineIndex===-1;)k=k.previousSibling;return k},_getOffset:function(k,m,o){if(m==="line"){m=this._model;k=m.getLineAtOffset(k);if(o>0)return m.getLineEnd(k);return m.getLineStart(k)}if(m===
"wordend")return this._getOffset_W3C(k,m,o);return i?this._getOffset_IE(k,m,o):this._getOffset_W3C(k,m,o)},_getOffset_W3C:function(k,m,o){function s(H){return 33<=H&&H<=47||58<=H&&H<=64||91<=H&&H<=94||H===96||123<=H&&H<=126}function w(H){return H===32||H===9}if(m==="word"||m==="wordend"){var y=this._model,B=y.getLineAtOffset(k),A=y.getLine(B),E=y.getLineStart(B);B=y.getLineEnd(B);y=A.length;k=k-E;var G,M;if(o>0){if(k===y)return B;G=A.charCodeAt(k);M=s(G);o=!M&&!w(G);for(k++;k<y;){G=A.charCodeAt(k);
B=s(G);if(m==="wordend"){if(!B&&M)break}else if(B&&!M)break;G=!B&&!w(G);if(m==="wordend"){if(!G&&o)break}else if(G&&!o)break;o=G;M=B;k++}}else{if(k===0)return E;k--;G=A.charCodeAt(k);M=s(G);for(o=!M&&!w(G);0<k;){G=A.charCodeAt(k-1);B=s(G);if(m==="wordend"){if(B&&!M)break}else if(!B&&M)break;G=!B&&!w(G);if(m==="wordend"){if(G&&!o)break}else if(!G&&o)break;o=G;M=B;k--}}return E+k}return k+o},_getOffset_IE:function(k,m,o){var s=this._frameDocument,w=this._model,y=w.getLineAtOffset(k),B=this._clientDiv,
A,E=this._getLineNode(y);E||(E=A=this._createLine(B,null,s,y,w));var G=0,M;M=w.getLineStart(y);if(k===w.getLineEnd(y)){s=s.body.createTextRange();s.moveToElementText(E.lastChild);M=s.text.length;s.moveEnd(m,o);G=k+s.text.length-M}else if(k===M&&o<0)G=M;else for(E=E.firstChild;E;){w=E.firstChild.length;if(E.ignoreChars)w-=E.ignoreChars;if(M+w>k){s=s.body.createTextRange();if(k===M&&o<0)s.moveToElementText(E.previousSibling);else{s.moveToElementText(E);s.collapse();s.moveEnd("character",k-M)}M=s.text.length;
s.moveEnd(m,o);G=k+s.text.length-M;break}M=w+M;E=E.nextSibling}A&&B.removeChild(A);return G},_getOffsetToX:function(k){return this._getBoundsAtOffset(k).left},_getPadding:function(k){var m,o,s,w;if(this._frameWindow.getComputedStyle){k=this._frameWindow.getComputedStyle(k,null);m=k.getPropertyValue("padding-left");o=k.getPropertyValue("padding-top");s=k.getPropertyValue("padding-right");w=k.getPropertyValue("padding-bottom")}else if(k.currentStyle){m=k.currentStyle.paddingLeft;o=k.currentStyle.paddingTop;
s=k.currentStyle.paddingRight;w=k.currentStyle.paddingBottom}return{left:parseInt(m,10)||0,top:parseInt(o,10)||0,right:parseInt(s,10)||0,bottom:parseInt(w,10)||0}},_getScroll:function(){var k=this._viewDiv;return{x:k.scrollLeft,y:k.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(k){var m=this._topChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=m.getBoundingClientRect();var o=this._getViewPadding(),s=this._viewDiv.getBoundingClientRect();if(k.top<
s.top+o.top)m=this._getLineNext(m)||m}return m.lineIndex},_getXToOffset:function(k,m){function o(aa){var Z,ca,da,fa;if(!aa._rectsCache){Z=aa.getClientRects();ca=[Z.length];for(da=0;da<Z.length;da++){fa=Z[da];ca[da]={left:fa.left-M+L,top:fa.top,right:fa.right-M+L,bottom:fa.bottom}}aa._rectsCache=ca}Z=aa._rectsCache;ca=[Z.length];for(da=0;da<Z.length;da++){fa=Z[da];ca[da]={left:fa.left-L,top:fa.top,right:fa.right-L,bottom:fa.bottom}}return ca}var s=this._model,w=s.getLineStart(k),y=s.getLineEnd(k);
if(w===y)return w;var B=this._frameDocument,A=this._clientDiv,E,G=this._getLineNode(k);G||(G=E=this._createLine(A,null,B,k,s));k=this._getLineBoundingClientRect(G,true);if(m<k.left)m=k.left;if(m>k.right)m=k.right;var M=0,H;if(i<9){H=G.getClientRects();s=H[0].left;for(var N=1;N<H.length;N++)s=Math.min(H[N].left,s);M=s-k.left-this._getLineTrim(G).left}var L=this._getScroll().x,P=i?window.screen.logicalXDPI:1,S=i?window.screen.deviceXDPI:1;k=w;s=G.firstChild;a:for(;s;){N=s.firstChild;G=N.length;if(s.ignoreChars)G-=
s.ignoreChars;H=o(s);for(var D=0;D<H.length;D++){var F=H[D];if(F.left<=m&&m<F.right){if(i||z){B=z?B.createRange():B.body.createTextRange();D=G;for(var J=-1;D-J>1;){var Q=Math.floor((D+J)/2);H=J+1;F=Q===G-1&&s.ignoreChars?N.length:Q+1;if(z){B.setStart(N,H);B.setEnd(N,F)}else{B.moveToElementText(s);B.move("character",H);B.moveEnd("character",F-H)}H=B.getClientRects();for(var T=false,U=0;U<H.length;U++){F=H[U];var W=F.right*P/S-M;if(F.left*P/S-M<=m&&m<W){T=true;break}}if(T)D=Q;else J=Q}k+=D;H=D;F=D===
G-1&&s.ignoreChars?N.length:Math.min(D+1,N.length);if(z){B.setStart(N,H);B.setEnd(N,F)}else{B.moveToElementText(s);B.move("character",H);B.moveEnd("character",F-H)}F=B.getClientRects()[0];m>F.left*P/S-M+(F.right-F.left)*P/S/2&&k++}else{H=[];for(P=0;P<G;P++){H.push("<span>");P===G-1?H.push(N.data.substring(P)):H.push(N.data.substring(P,P+1));H.push("</span>")}s.innerHTML=H.join("");for(H=s.firstChild;H;){F=H.getBoundingClientRect();if(F.left<=m&&m<F.right){m>F.left+(F.right-F.left)/2&&k++;break}k++;
H=H.nextSibling}if(!E){s.innerHTML="";s.appendChild(N);m=this._getSelection();if(k<=m.start&&m.start<k+G||k<=m.end&&m.end<k+G)this._updateDOMSelection()}}break a}}k+=G;s=s.nextSibling}E&&A.removeChild(E);return Math.min(y,Math.max(w,k))},_getYToLine:function(k){var m=this._getViewPadding(),o=this._viewDiv.getBoundingClientRect();k-=o.top+m.top;m=this._getLineHeight();k=Math.floor((k+this._getScroll().y)/m);m=this._model.getLineCount();return Math.max(0,Math.min(m-1,k))},_getOffsetBounds:function(k){var m=
this._model.getLineAtOffset(k),o=this._getLineHeight(),s=this._getScroll(),w=this._getViewPadding(),y=this._viewDiv.getBoundingClientRect();k=this._getBoundsAtOffset(k);m=m*o-s.y+y.top+w.top;return{left:k.left,top:m,right:k.right,bottom:m+o}},_getVisible:function(){for(var k=this._parent,m=k.ownerDocument;k!==m;){var o;if(i<9)o=k.currentStyle&&k.currentStyle.display==="none";else o=(o=m.defaultView.getComputedStyle(k,null))&&o.getPropertyValue("display")==="none";if(o)return"hidden";k=k.parentNode;
if(!k)return"disconnected"}return"visible"},_hitOffset:function(k,m,o){var s=this._getOffsetBounds(k);k=s.left;var w=s.right,y=s.top;s=s.bottom;k-=20;y-=20;w+=20;s+=20;return k<=m&&m<=w&&y<=o&&o<=s},_hookEvents:function(){var k=this;this._modelListener={onChanging:function(A){k._onModelChanging(A)},onChanged:function(A){k._onModelChanged(A)}};this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);var m=this._clientDiv,
o=this._viewDiv,s=this._frameDocument.body,w=this._handlers=[],y=i<9?this._frame:this._frameWindow,B=v?this._textArea:i||j?this._clientDiv:this._frameWindow;w.push({target:this._frameWindow,type:"unload",handler:function(A){return k._handleUnload(A)}});w.push({target:y,type:"resize",handler:function(A){return k._handleResize(A)}});w.push({target:B,type:"blur",handler:function(A){return k._handleBlur(A)}});w.push({target:B,type:"focus",handler:function(A){return k._handleFocus(A)}});w.push({target:o,
type:"scroll",handler:function(A){return k._handleScroll(A)}});if(v){m=this._touchDiv;s=this._textArea;w.push({target:s,type:"keydown",handler:function(A){return k._handleKeyDown(A)}});w.push({target:s,type:"input",handler:function(A){return k._handleInput(A)}});w.push({target:s,type:"textInput",handler:function(A){return k._handleTextInput(A)}});w.push({target:s,type:"click",handler:function(A){return k._handleTextAreaClick(A)}});w.push({target:m,type:"touchstart",handler:function(A){return k._handleTouchStart(A)}});
w.push({target:m,type:"touchmove",handler:function(A){return k._handleTouchMove(A)}});w.push({target:m,type:"touchend",handler:function(A){return k._handleTouchEnd(A)}})}else{o=this._overlayDiv||this._clientDiv;y=i?m:this._frameWindow;w.push({target:m,type:"keydown",handler:function(A){return k._handleKeyDown(A)}});w.push({target:m,type:"keypress",handler:function(A){return k._handleKeyPress(A)}});w.push({target:m,type:"keyup",handler:function(A){return k._handleKeyUp(A)}});w.push({target:m,type:"selectstart",
handler:function(A){return k._handleSelectStart(A)}});w.push({target:m,type:"contextmenu",handler:function(A){return k._handleContextMenu(A)}});w.push({target:m,type:"copy",handler:function(A){return k._handleCopy(A)}});w.push({target:m,type:"cut",handler:function(A){return k._handleCut(A)}});w.push({target:m,type:"paste",handler:function(A){return k._handlePaste(A)}});w.push({target:m,type:"mousedown",handler:function(A){return k._handleMouseDown(A)}});w.push({target:m,type:"mouseover",handler:function(A){return k._handleMouseOver(A)}});
w.push({target:m,type:"mouseout",handler:function(A){return k._handleMouseOut(A)}});w.push({target:y,type:"mouseup",handler:function(A){return k._handleMouseUp(A)}});w.push({target:y,type:"mousemove",handler:function(A){return k._handleMouseMove(A)}});w.push({target:s,type:"mousedown",handler:function(A){return k._handleBodyMouseDown(A)}});w.push({target:s,type:"mouseup",handler:function(A){return k._handleBodyMouseUp(A)}});w.push({target:o,type:"dragstart",handler:function(A){return k._handleDragStart(A)}});
w.push({target:o,type:"drag",handler:function(A){return k._handleDrag(A)}});w.push({target:o,type:"dragend",handler:function(A){return k._handleDragEnd(A)}});w.push({target:o,type:"dragenter",handler:function(A){return k._handleDragEnter(A)}});w.push({target:o,type:"dragover",handler:function(A){return k._handleDragOver(A)}});w.push({target:o,type:"dragleave",handler:function(A){return k._handleDragLeave(A)}});w.push({target:o,type:"drop",handler:function(A){return k._handleDrop(A)}});if(n){w.push({target:this._parentDocument,
type:"mousemove",handler:function(A){return k._handleMouseMove(A)}});w.push({target:this._parentDocument,type:"mouseup",handler:function(A){return k._handleMouseUp(A)}})}i&&w.push({target:this._frameDocument,type:"activate",handler:function(A){return k._handleDocFocus(A)}});j&&w.push({target:this._frameDocument,type:"focus",handler:function(A){return k._handleDocFocus(A)}});if(!i&&!l)w.push({target:this._viewDiv,type:j?"DOMMouseScroll":"mousewheel",handler:function(A){return k._handleMouseWheel(A)}});
j&&!u&&w.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(A){return k._handleDataModified(A)}});if(this._overlayDiv){w.push({target:this._overlayDiv,type:"mousedown",handler:function(A){return k._handleMouseDown(A)}});w.push({target:this._overlayDiv,type:"mouseover",handler:function(A){return k._handleMouseOver(A)}});w.push({target:this._overlayDiv,type:"mouseout",handler:function(A){return k._handleMouseOut(A)}});w.push({target:this._overlayDiv,type:"contextmenu",handler:function(A){return k._handleContextMenu(A)}})}x||
w.push({target:this._clientDiv,type:"dblclick",handler:function(A){return k._handleDblclick(A)}})}for(m=0;m<w.length;m++){s=w[m];b(s.target,s.type,s.handler,s.capture)}},_init:function(k){var m=k.parent;if(typeof m==="string")m=window.document.getElementById(m);if(!m)throw"no parent";k.parent=m;k.model=k.model||new d.TextModel;m=this._defaultOptions();for(var o in m)if(m.hasOwnProperty(o))this["_"+o]=k[o]!==undefined?k[o]:m[o].value;this._rulers=[];this._selection=new f(0,0,false);this._linksVisible=
false;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._ignoreFocus=false;this._dragOffset=this._columnX=-1;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=false;this._doubleClickSelection=null;this._vScroll=this._hScroll=
0;this._imeOffset=-1;this._createActions();this._createFrame()},_isLinkURL:function(k){return k.toLowerCase().lastIndexOf(".css")===k.length-4},_modifyContent:function(k,m){if(!(this._readonly&&!k._code)){k.type="Verify";this.onVerify(k);if(!(k.text===null||k.text===undefined)){var o=this._model;try{if(k._ignoreDOMSelection)this._ignoreDOMSelection=true;o.setText(k.text,k.start,k.end)}finally{if(k._ignoreDOMSelection)this._ignoreDOMSelection=false}if(m){m=this._getSelection();m.setCaret(k.start+k.text.length);
this._setSelection(m,true)}this.onModify({type:"Modify"})}}},_onModelChanged:function(k){k.type="ModelChanged";this.onModelChanged(k);k.type="Changed";var m=k.start,o=k.addedCharCount,s=k.removedCharCount,w=k.addedLineCount,y=k.removedLineCount,B=this._getSelection();if(B.end>m){if(B.end>m&&B.start<m+s)B.setCaret(m+o);else{B.start+=o-s;B.end+=o-s}this._setSelection(B,false,false)}m=this._model.getLineAtOffset(m);for(o=this._getLineNext();o;){s=o.lineIndex;if(m<=s&&s<=m+y)if(m===s&&!o.modelChangedEvent&&
!o.lineRemoved){o.modelChangedEvent=k;o.lineChanged=true}else{o.lineRemoved=true;o.lineChanged=false;o.modelChangedEvent=null}if(s>m+y)o.lineIndex=s+w-y;o=this._getLineNext(o)}if(m<=this._maxLineIndex&&this._maxLineIndex<=m+y){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(k){k.type="ModelChanging";this.onModelChanging(k);k.type="Changing"},_queueUpdatePage:function(){if(!this._updateTimer){var k=this;this._updateTimer=
setTimeout(function(){k._updateTimer=null;k._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new f(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var k=this._clientDiv;if(k){for(var m=k.firstChild;m;){m.lineRemoved=true;m=m.nextSibling}if(j){this._ignoreFocus=false;(m=this._hasFocus)&&k.blur();k.contentEditable=false;k.contentEditable=
true;m&&k.focus();this._ignoreFocus=false}}},_resizeTouchDiv:function(){for(var k=this._viewDiv.getBoundingClientRect(),m=this._frame.getBoundingClientRect(),o=this._frame;o;){if(o.style&&o.style.top)break;o=o.parentNode}var s=m.top;if(o)s-=o.getBoundingClientRect().top;else s+=this._parentDocument.body.scrollTop;for(o=this._frame;o;){if(o.style&&o.style.left)break;o=o.parentNode}m=m.left;if(o)m-=o.getBoundingClientRect().left;else m+=this._parentDocument.body.scrollLeft;o=this._touchDiv;o.style.left=
m+k.left+"px";o.style.top=s+k.top+"px";o.style.width=k.width+"px";o.style.height=k.height+"px"},_scrollView:function(k,m){this._ensureCaretVisible=false;var o=this._viewDiv;if(k)o.scrollLeft+=k;if(m)o.scrollTop+=m},_setClipboardText:function(k,m){var o;if(this._frameWindow.clipboardData){o=[];this._convertDelimiter(k,function(E){o.push(E)},function(){o.push(C)});return this._frameWindow.clipboardData.setData("Text",o.join(""))}if(n||j||!m){var s=this._frameWindow,w=this._frameDocument,y=w.createElement("PRE");
y.style.position="fixed";y.style.left="-1000px";this._convertDelimiter(k,function(E){y.appendChild(w.createTextNode(E))},function(){y.appendChild(w.createElement("BR"))});y.appendChild(w.createTextNode(" "));this._clientDiv.appendChild(y);k=w.createRange();k.setStart(y.firstChild,0);k.setEndBefore(y.lastChild);s=s.getSelection();s.rangeCount>0&&s.removeAllRanges();s.addRange(k);var B=this;s=function(){y&&y.parentNode===B._clientDiv&&B._clientDiv.removeChild(y);B._updateDOMSelection()};k=false;this._ignoreCopy=
true;try{k=w.execCommand("copy",false,null)}catch(A){}this._ignoreCopy=false;if(!k)if(m){setTimeout(s,0);return false}s();return true}if(m&&m.clipboardData){o=[];this._convertDelimiter(k,function(E){o.push(E)},function(){o.push(C)});return m.clipboardData.setData("text/plain",o.join(""))}},_setDOMSelection:function(k,m,o,s){for(var w=this._frameWindow,y=this._frameDocument,B,A,E,G,M=0,H=k.firstChild,N,L,P=this._model.getLine(k.lineIndex).length;H;){N=H.firstChild;L=N.length;if(H.ignoreChars)L-=H.ignoreChars;
if(M+L>m||M+L>=P){B=N;A=m-M;if(H.ignoreChars&&L>0&&A===L)A+=H.ignoreChars;break}M+=L;H=H.nextSibling}M=0;H=o.firstChild;for(var S=this._model.getLine(o.lineIndex).length;H;){N=H.firstChild;L=N.length;if(H.ignoreChars)L-=H.ignoreChars;if(L+M>s||M+L>=S){E=N;G=s-M;if(H.ignoreChars&&L>0&&G===L)G+=H.ignoreChars;break}M+=L;H=H.nextSibling}this._setDOMFullSelection(k,m,P,o,s,S);if(!v)if(w.getSelection){y=y.createRange();y.setStart(B,A);y.setEnd(E,G);E=w.getSelection();this._ignoreSelect=false;E.rangeCount>
0&&E.removeAllRanges();E.addRange(y);this._ignoreSelect=true}else if(y.selection){w=y.body;y=y.createElement("DIV");w.appendChild(y);w.removeChild(y);y=w.createTextRange();y.moveToElementText(B.parentNode);y.moveStart("character",A);B=w.createTextRange();B.moveToElementText(E.parentNode);B.moveStart("character",G);y.setEndPoint("EndToStart",B);this._ignoreSelect=false;y.select();this._ignoreSelect=true}},_setDOMFullSelection:function(k,m,o,s,w,y){var B=this._model;if(this._selDiv1){var A,E;A=this._getLineBoundingClientRect(k);
if(m===0)E=A.left;else if(m>=o)E=A.right;else{this._ignoreDOMSelection=true;E=this._getBoundsAtOffset(B.getLineStart(k.lineIndex)+m).left;this._ignoreDOMSelection=false}if((o=this._textArea)&&v){o.selectionStart=o.selectionEnd=0;var G=this._frame.getBoundingClientRect(),M=this._touchDiv.getBoundingClientRect(),H=this._viewDiv.getBoundingClientRect();o.style.left=!(H.left<=E&&E<=H.left+H.width&&H.top<=A.top&&A.top<=H.top+H.height)||!(k===s&&m===w)?"-1000px":E-4+G.left-M.left+"px";o.style.top=A.top+
G.top-M.top+"px";o.style.width="6px";o.style.height=A.bottom-A.top+"px"}o=this._selDiv1;o.style.width="0px";o.style.height="0px";o=this._selDiv2;o.style.width="0px";o.style.height="0px";o=this._selDiv3;o.style.width="0px";o.style.height="0px";if(!(k===s&&m===w)){G=v?2:0;M=G+"px blue solid";var N=this._getViewPadding();H=this._clientDiv.getBoundingClientRect();var L=this._viewDiv.getBoundingClientRect();m=L.left+N.left;o=H.right;L=L.top+N.top;var P=H.bottom;N=H=0;if(this._clipDiv){N=this._clipDiv.getBoundingClientRect();
H=N.left-this._clipDiv.scrollLeft;N=N.top}var S=this._getLineBoundingClientRect(s);if(w===0)w=S.left;else if(w>=y)w=S.right;else{this._ignoreDOMSelection=true;w=this._getBoundsAtOffset(B.getLineStart(s.lineIndex)+w).left;this._ignoreDOMSelection=false}y=this._selDiv1;E=Math.min(o,Math.max(m,E));B=Math.min(P,Math.max(L,A.top));var D=o;A=Math.min(P,Math.max(L,A.bottom));y.style.left=E-H+"px";y.style.top=B-N+"px";y.style.width=Math.max(0,D-E)+"px";y.style.height=Math.max(0,A-B)+(v?1:0)+"px";if(v){y.style.borderLeft=
M;y.style.borderRight="0px"}if(k===s){D=Math.min(w,o);y.style.width=Math.max(0,D-E-G*2)+"px";if(v)y.style.borderRight=M}else{k=Math.min(P,Math.max(L,S.top));s=Math.min(o,Math.max(m,w));E=Math.min(P,Math.max(L,S.bottom));w=this._selDiv3;w.style.left=m-H+"px";w.style.top=k-N+"px";w.style.width=Math.max(0,s-m-G)+"px";w.style.height=Math.max(0,E-k)+"px";if(v)w.style.borderRight=M;if(k-A>0){s=this._selDiv2;s.style.left=m-H+"px";s.style.top=A-N+"px";s.style.width=Math.max(0,o-m)+"px";s.style.height=Math.max(0,
k-A)+(v?1:0)+"px"}}}}},_setGrab:function(k){if(k!==this._grabControl)if(k){k.setCapture&&k.setCapture();this._grabControl=k}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(k){if(this._linksVisible!==k){this._linksVisible=k;if(i&&k)this._hadFocus=this._hasFocus;var m=this._clientDiv;m.contentEditable=!k;this._hadFocus&&!k&&m.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=k?"-1":"1";k=this._frameDocument;for(m=this._getLineNext();m;){if(m.hasLink)for(var o=
m.firstChild;o;){var s=o.nextSibling,w=o.viewStyle;w&&w.tagName==="A"&&m.replaceChild(this._createSpan(m,k,o.firstChild.data,w),o);o=s}m=this._getLineNext(m)}}},_setSelection:function(k,m,o,s){if(k){this._columnX=-1;if(o===undefined)o=true;var w=this._selection;if(!w.equals(k)){this._selection=k;this.onSelection({type:"Selection",oldValue:{start:w.start,end:w.end},newValue:{start:k.start,end:k.end}})}if(m)o=!this._showCaret(false,s);o&&this._updateDOMSelection()}},_setSelectionTo:function(k,m,o,s){var w=
this._model,y=this._getSelection();m=this._getYToLine(m);if(this._clickCount===1){w=this._getXToOffset(m,k);if(s&&!o)if(y.start<=w&&w<y.end){this._dragOffset=w;return false}y.extend(w);o||y.collapse()}else{if((this._clickCount&1)===0){w=this._getXToOffset(m,k);if(this._doubleClickSelection)if(w>=this._doubleClickSelection.start){o=this._doubleClickSelection.start;w=this._getOffset(w,"wordend",+1)}else{o=this._getOffset(w,"word",-1);w=this._doubleClickSelection.end}else{o=this._getOffset(w,"word",
-1);w=this._getOffset(o,"wordend",+1)}}else if(this._doubleClickSelection){s=w.getLineAtOffset(this._doubleClickSelection.start);if(m>=s){o=w.getLineStart(s);w=w.getLineEnd(m)}else{o=w.getLineStart(m);w=w.getLineEnd(s)}}else{o=w.getLineStart(m);w=w.getLineEnd(m)}y.setCaret(o);y.extend(w)}this._setSelection(y,true,true);return true},_setStyleSheet:function(k){var m=this._stylesheet;m instanceof Array||(m=[m]);this._stylesheet=k;k instanceof Array||(k=[k]);for(var o=this._frameDocument,s=o.styleSheets,
w=o.getElementsByTagName("head")[0],y=false,B=0,A,E;B<k.length;){if(B>=m.length)break;A=k[B];E=m[B];if(A!==E)if(this._isLinkURL(A))return true;else{y=s[B+1];y=y.ownerNode;E=o.createElement("STYLE");A=o.createTextNode(A);E.appendChild(A);w.replaceChild(E,y);y=true}B++}if(B<m.length)for(;B<m.length;){A=m[B];if(this._isLinkURL(A))return true;else{y=s[B+1];y=y.ownerNode;w.removeChild(y);y=true}B++}else for(;B<k.length;){A=k[B];if(this._isLinkURL(A))return true;else{E=o.createElement("STYLE");A=o.createTextNode(A);
E.appendChild(A);w.appendChild(E);y=true}B++}y&&this._updateStyle();return false},_setFullSelection:function(k,m){this._fullSelection=k;if(i<9)this._fullSelection=false;if(t)this._fullSelection=true;var o=this._clipDiv||this._scrollDiv;if(o)if(!v&&!this._fullSelection){if(this._selDiv1){o.removeChild(this._selDiv1);this._selDiv1=null}if(this._selDiv2){o.removeChild(this._selDiv2);this._selDiv2=null}if(this._selDiv3){o.removeChild(this._selDiv3);this._selDiv3=null}}else if(!this._selDiv1&&(v||this._fullSelection&&
!t)){k=this._frameDocument;this._hightlightRGB="Highlight";var s=k.createElement("DIV");this._selDiv1=s;s.id="selDiv1";s.style.position=this._clipDiv?"absolute":"fixed";s.style.borderWidth="0px";s.style.margin="0px";s.style.padding="0px";s.style.MozOutline="none";s.style.outline="none";s.style.background=this._hightlightRGB;s.style.width="0px";s.style.height="0px";s.style.zIndex="0";o.appendChild(s);var w=k.createElement("DIV");this._selDiv2=w;w.id="selDiv2";w.style.position=this._clipDiv?"absolute":
"fixed";w.style.borderWidth="0px";w.style.margin="0px";w.style.padding="0px";w.style.MozOutline="none";w.style.outline="none";w.style.background=this._hightlightRGB;w.style.width="0px";w.style.height="0px";w.style.zIndex="0";o.appendChild(w);var y=k.createElement("DIV");this._selDiv3=y;y.id="selDiv3";y.style.position=this._clipDiv?"absolute":"fixed";y.style.borderWidth="0px";y.style.margin="0px";y.style.padding="0px";y.style.MozOutline="none";y.style.outline="none";y.style.background=this._hightlightRGB;
y.style.width="0px";y.style.height="0px";y.style.zIndex="0";o.appendChild(y);if(j&&r){o=this._frameWindow.getComputedStyle(y,null).getPropertyValue("background-color");switch(o){case "rgb(119, 141, 168)":o="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":o="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":o="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":o="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":o="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":o="rgb(194, 249, 144)";break;
case "rgb(140, 78, 184)":o="rgb(232, 184, 255)";break;default:o="rgb(180, 213, 255)";break}this._hightlightRGB=o;s.style.background=o;w.style.background=o;y.style.background=o;if(!this._insertedSelRule){k.styleSheets[0].insertRule("::-moz-selection {background: "+o+"; }",0);this._insertedSelRule=true}}m||this._updateDOMSelection()}},_setTabSize:function(k,m){this._tabSize=k;this._customTabSize=undefined;k=this._clientDiv;if(l){if(k)k.style.OTabSize=this._tabSize+""}else if(j>=4){if(k)k.style.MozTabSize=
this._tabSize+""}else if(this._tabSize!==8){this._customTabSize=this._tabSize;m||this.redrawLines()}},_setThemeClass:function(k,m){this._themeClass=k;if(k=this._frameDocument){var o="viewContainer";if(this._themeClass)o+=" "+this._themeClass;k.body.className=o;m||this._updateStyle()}},_showCaret:function(k,m){if(this._clientDiv){var o=this._model,s=this._getSelection(),w=this._getScroll(),y=s.getCaret(),B=s.start,A=s.end,E=o.getLineAtOffset(B),G=o.getLineAtOffset(A),M=Math.max(Math.max(B,o.getLineStart(G)),
A-1),H=this._getViewPadding(),N=this._getClientWidth(),L=H.left;H=H.left+N;var P=this._getBoundsAtOffset(y===B?B:M),S=P.left,D=P.right,F=N/4;if(k&&!s.isEmpty()&&E===G){P=this._getBoundsAtOffset(y===A?B:M);if(N-F>(y===B?P.right-S:D-P.left)){if(S>P.left)S=P.left;if(D<P.right)D=P.right}}s=this._viewDiv.getBoundingClientRect();S-=s.left;D-=s.left;s=0;if(S<L)s=Math.min(S-L,-F);if(D>H)s=Math.min(this._scrollDiv.scrollWidth-w.x-N,Math.max(D-H,F));L=0;S=this._getTopIndex(true);D=this._getBottomIndex(true);
o=o.getLineAtOffset(y);H=this._getClientHeight();if(!(S<=o&&o<=D)){S=this._getLineHeight();k=k?(G-E)*S:0;L=o*S;L-=w.y;if(L+S>H){L-=H-S;if(y===B&&B!==A)L+=Math.min(H-S,k)}else if(y===A)L-=Math.min(H-S,k);if(m)if(m>0){if(L>0)L=Math.max(L,m)}else if(L<0)L=Math.min(L,m)}if(s!==0||L!==0){this._scrollView(s,L);if(H!==this._getClientHeight()||N!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===-1){var k=this._getSelection();
k.isEmpty()||this._modifyContent({text:"",start:k.start,end:k.end},true);this._imeOffset=k.start}},_unhookEvents:function(){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);this._modelListener=null;for(var k=0;k<this._handlers.length;k++){var m=this._handlers[k];c(m.target,m.type,m.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var k=this._getSelection(),
m=this._model,o=m.getLineAtOffset(k.start),s=m.getLineAtOffset(k.end),w=this._getLineNext();if(w){var y=this._getLinePrevious(),B;if(o<w.lineIndex){B=w;o=0}else if(o>y.lineIndex){B=y;o=0}else{B=this._getLineNode(o);o=k.start-m.getLineStart(o)}if(s<w.lineIndex){w=w;k=0}else if(s>y.lineIndex){w=y;k=0}else{w=this._getLineNode(s);k=k.end-m.getLineStart(s)}this._setDOMSelection(B,o,w,k)}}},_updatePage:function(k){if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=
null;k=false}var m=this._clientDiv;if(m){var o=this._model,s=this._getScroll(),w=this._getViewPadding(),y=o.getLineCount(),B=this._getLineHeight(),A=Math.max(0,s.y)/B,E=Math.floor(A),G=Math.max(0,E-1),M=Math.round((A-G)*B),H=this._partialY=Math.round((A-E)*B);A=y*B;var N,L;if(k){N=this._getClientWidth();L=this._getClientHeight();o=this._leftDiv?this._leftDiv.scrollWidth:0;E=Math.max(this._maxLineWidth,N)}else{var P=this._frameDocument;s=this._getFrameWidth();L=this._getFrameHeight();P.body.style.width=
s+"px";P.body.style.height=L+"px";N=this._viewDiv;N.style.height=Math.max(0,L-w.top-w.bottom)+"px";L=this._getClientHeight();B=Math.floor((L+H)/B);B=Math.min(E+B,y-1);for(var S=Math.min(B+1,y-1),D=m.firstChild;D;){H=D.lineIndex;var F=D.nextSibling;if(!(G<=H&&H<=S)||D.lineRemoved||D.lineIndex===-1)if(this._mouseWheelLine===D){D.style.display="none";D.lineIndex=-1}else m.removeChild(D);D=F}D=this._getLineNext();F=P.createDocumentFragment();for(H=G;H<=S;H++)if(!D||D.lineIndex>H)this._createLine(F,null,
P,H,o);else{if(F.firstChild){m.insertBefore(F,D);F=P.createDocumentFragment()}if(D&&D.lineChanged){D=this._createLine(F,D,P,H,o);D.lineChanged=false}D=this._getLineNext(D)}F.firstChild&&m.insertBefore(F,D);if(t)m.style.width=(524287).toString()+"px";for(D=this._getLineNext();D;){G=D.lineWidth;if(G===undefined){G=this._getLineBoundingClientRect(D);G=D.lineWidth=G.right-G.left}if(G>=this._maxLineWidth){this._maxLineWidth=G;this._maxLineIndex=D.lineIndex}if(D.lineIndex===E)this._topChild=D;if(D.lineIndex===
B)this._bottomChild=D;if(this._checkMaxLineIndex===D.lineIndex)this._checkMaxLineIndex=-1;D=this._getLineNext(D)}if(this._checkMaxLineIndex!==-1){H=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=H&&H<y){o=this._createLine(m,null,P,H,o);G=this._getLineBoundingClientRect(o);G=G.right-G.left;if(G>=this._maxLineWidth){this._maxLineWidth=G;this._maxLineIndex=H}m.removeChild(o)}}this._updateRuler(this._leftDiv,E,B);this._updateRuler(this._rightDiv,E,B);o=this._leftDiv?this._leftDiv.scrollWidth:
0;E=this._rightDiv?this._rightDiv.scrollWidth:0;N.style.left=o+"px";N.style.width=Math.max(0,s-o-E-w.left-w.right)+"px";if(this._rightDiv)this._rightDiv.style.left=s-E+"px";s=this._scrollDiv;s.style.height=A+"px";N=this._getClientWidth();E=y=Math.max(this._maxLineWidth,N);if(!i||i>=9)y+=w.right;s.style.width=y+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=y+"px";s=this._getScroll();y=L+w.top+w.bottom;this._updateRulerSize(this._leftDiv,y);this._updateRulerSize(this._rightDiv,y)}H=s.x;
B=this._clipDiv;y=this._overlayDiv;if(B){B.scrollLeft=H;G=o+w.left;P=w.top;k=N;o=L;H=0;D=-M;if(s.x===0){G-=w.left;k+=w.left;H=w.left}if(s.x+N===E)k+=w.right;if(s.y===0){P-=w.top;o+=w.top;D+=w.top}if(s.y+L===A)o+=w.bottom;B.style.left=G+"px";B.style.top=P+"px";B.style.width=k+"px";B.style.height=o+"px";m.style.left=H+"px";m.style.top=D+"px";m.style.width=E+"px";m.style.height=L+M+"px";if(y){y.style.left=m.style.left;y.style.top=m.style.top;y.style.width=m.style.width;y.style.height=m.style.height}}else{G=
H;P=M;B=H+N;D=M+L;if(G===0)G-=w.left;if(P===0)P-=w.top;if(B===E)B+=w.right;if(s.y+L===A)D+=w.bottom;m.style.clip="rect("+P+"px,"+B+"px,"+D+"px,"+G+"px)";m.style.left=-H+o+w.left+"px";m.style.width=(t?E:N+H)+"px";if(!k){m.style.top=-M+w.top+"px";m.style.height=L+M+"px"}if(y){y.style.clip=m.style.clip;y.style.left=m.style.left;y.style.width=m.style.width;if(!k){y.style.top=m.style.top;y.style.height=m.style.height}}}this._updateDOMSelection();m=this._ensureCaretVisible;this._ensureCaretVisible=false;
if(L!==this._getClientHeight()){this._updatePage();m&&this._showCaret()}if(v){var J=this;setTimeout(function(){J._resizeTouchDiv()},0)}}}},_updateRulerSize:function(k,m){if(k){for(var o=this._partialY,s=this._getLineHeight(),w=k.firstChild.rows[0].cells,y=0;y<w.length;y++){var B=w[y].firstChild,A=s;if(B._ruler.getOverview()==="page")A+=o;B.style.top=-A+"px";B.style.height=m+A+"px"}k.style.height=m+"px"}},_updateRuler:function(k,m,o){if(k){k=k.firstChild.rows[0].cells;for(var s=this._getLineHeight(),
w=this._frameDocument,y=this._getViewPadding(),B=0;B<k.length;B++){var A=k[B].firstChild,E=A._ruler;A.rulerChanged&&this._applyStyle(E.getRulerStyle(),A);var G,M=A.firstChild;if(M){G=M;M=M.nextSibling}else{G=w.createElement("DIV");G.style.visibility="hidden";A.appendChild(G)}var H,N;if(A.rulerChanged)if(G){H=-1;if(N=E.getWidestAnnotation()){this._applyStyle(N.style,G);if(N.html)G.innerHTML=N.html}G.lineIndex=H;G.style.height=s+y.top+"px"}var L,P;if(E.getOverview()==="page"){for(E=E.getAnnotations(m,
o+1);M;){H=M.lineIndex;N=M.nextSibling;if(!(m<=H&&H<=o)||M.lineChanged)A.removeChild(M);M=N}M=A.firstChild.nextSibling;P=w.createDocumentFragment();for(H=m;H<=o;H++)if(!M||M.lineIndex>H){L=w.createElement("DIV");if(N=E[H]){this._applyStyle(N.style,L);if(N.html)L.innerHTML=N.html;L.annotation=N}L.lineIndex=H;L.style.height=s+"px";P.appendChild(L)}else{if(P.firstChild){A.insertBefore(P,M);P=w.createDocumentFragment()}if(M)M=M.nextSibling}P.firstChild&&A.insertBefore(P,M)}else{M=v?0:17;N=this._getClientHeight();
H=this._model.getLineCount();G=N+y.top+y.bottom-2*M;var S;S=s*H<G?s:G/H;if(A.rulerChanged){for(N=A.childNodes.length;N>1;){A.removeChild(A.lastChild);N--}E=E.getAnnotations(0,H);P=w.createDocumentFragment();for(var D in E){H=D>>>0;if(!(H<0)){L=w.createElement("DIV");N=E[D];this._applyStyle(N.style,L);L.style.position="absolute";L.style.top=M+s+Math.floor(H*S)+"px";if(N.html)L.innerHTML=N.html;L.annotation=N;L.lineIndex=H;P.appendChild(L)}}A.appendChild(P)}else if(A._oldTrackHeight!==G)for(L=A.firstChild?
A.firstChild.nextSibling:null;L;){L.style.top=M+s+Math.floor(L.lineIndex*S)+"px";L=L.nextSibling}A._oldTrackHeight=G}A.rulerChanged=false}}},_updateStyle:function(){var k=this._frameDocument;if(i)k.body.style.lineHeight="normal";var m=this._metrics=this._calculateMetrics();if(i)k.body.style.lineHeight=m.lineHeight-(m.lineTrim.top+m.lineTrim.bottom)+"px";this.redraw()}};a.EventTarget.addMixin(g.prototype);return{TextView:g}});
define("orion/textview/projectionTextModel",["orion/textview/textModel","orion/textview/eventTarget"],function(d,e){function a(b){this._model=b;this._projections=[]}a.prototype={addProjection:function(b){if(b){var c=this._model,f=this._projections;b._lineIndex=c.getLineAtOffset(b.start);b._lineCount=c.getLineAtOffset(b.end)-b._lineIndex;var g=b.text;g||(g="");b._model=typeof g==="string"?new d.TextModel(g,c.getLineDelimiter()):g;c=this.mapOffset(b.start,true);g=b.end-b.start;var h=b._lineCount,i=
b._model.getCharCount(),j=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:b._model.getText(),start:c,removedCharCount:g,addedCharCount:i,removedLineCount:h,addedLineCount:j});var l=this._binarySearch(f,b.start);f.splice(l,0,b);this.onChanged({type:"Changed",start:c,removedCharCount:g,addedCharCount:i,removedLineCount:h,addedLineCount:j})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,c){var f=this._projections,
g=0,h;if(c){for(c=0;c<f.length;c++){h=f[c];if(h.start>b)break;if(h.end>b)return-1;g+=h._model.getCharCount()-(h.end-h.start)}return b+g}for(c=0;c<f.length;c++){h=f[c];if(h.start>b-g)break;var i=h._model.getCharCount();if(h.start+i>b-g)return-1;g+=i-(h.end-h.start)}return b-g},removeProjection:function(b){var c,f=0;for(c=0;c<this._projections.length;c++){var g=this._projections[c];if(g===b){b=g;break}f+=g._model.getCharCount()-(g.end-g.start)}if(c<this._projections.length){g=this._model;f=b.start+
f;var h=b.end-b.start,i=b._lineCount,j=b._model.getCharCount(),l=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:g.getText(b.start,b.end),start:f,removedCharCount:j,addedCharCount:h,removedLineCount:l,addedLineCount:i});this._projections.splice(c,1);this.onChanged({type:"Changed",start:f,removedCharCount:j,addedCharCount:h,removedLineCount:l,addedLineCount:i})}},_binarySearch:function(b,c){for(var f=b.length,g=-1,h;f-g>1;){h=Math.floor((f+g)/2);if(c<=b[h].start)f=h;else g=h}return f},
getCharCount:function(){for(var b=this._model.getCharCount(),c=this._projections,f=0;f<c.length;f++){var g=c[f];b+=g._model.getCharCount()-(g.end-g.start)}return b},getLine:function(b,c){if(b<0)return null;var f=this._model,g=this._projections,h=0,i=[],j=0,l,n,p;for(l=0;l<g.length;l++){p=g[l];if(p._lineIndex>=b-h)break;n=p._model.getLineCount()-1;if(p._lineIndex+n>=b-h){j=b-(p._lineIndex+h);if(j<n)return p._model.getLine(j,c);else i.push(p._model.getLine(n))}j=p.end;h+=n-p._lineCount}for(j=Math.max(j,
f.getLineStart(b-h));l<g.length;l++){p=g[l];if(p._lineIndex>b-h)break;i.push(f.getText(j,p.start));n=p._model.getLineCount()-1;if(p._lineIndex+n>b-h){i.push(p._model.getLine(0,c));return i.join("")}i.push(p._model.getText());j=p.end;h+=n-p._lineCount}b=f.getLineEnd(b-h,c);j<b&&i.push(f.getText(j,b));return i.join("")},getLineAtOffset:function(b){for(var c=this._model,f=this._projections,g=0,h=0,i=0;i<f.length;i++){var j=f[i];if(j.start>b-g)break;var l=j._model.getCharCount();if(j.start+l>b-g){f=b-
(j.start+g);h+=j._model.getLineAtOffset(f);g+=f;break}h+=j._model.getLineCount()-1-j._lineCount;g+=l-(j.end-j.start)}return c.getLineAtOffset(b-g)+h},getLineCount:function(){for(var b=this._projections,c=this._model.getLineCount(),f=0;f<b.length;f++){var g=b[f];c+=g._model.getLineCount()-1-g._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){if(b<0)return-1;for(var f=this._model,g=this._projections,h=0,i=0,j=0;j<g.length;j++){var l=g[j];
if(l._lineIndex>b-h)break;var n=l._model.getLineCount()-1;if(l._lineIndex+n>b-h)return l._model.getLineEnd(b-(l._lineIndex+h),c)+l.start+i;i+=l._model.getCharCount()-(l.end-l.start);h+=n-l._lineCount}return f.getLineEnd(b-h,c)+i},getLineStart:function(b){if(b<0)return-1;for(var c=this._model,f=this._projections,g=0,h=0,i=0;i<f.length;i++){var j=f[i];if(j._lineIndex>=b-g)break;var l=j._model.getLineCount()-1;if(j._lineIndex+l>=b-g)return j._model.getLineStart(b-(j._lineIndex+g))+j.start+h;h+=j._model.getCharCount()-
(j.end-j.start);g+=l-j._lineCount}return c.getLineStart(b-g)+h},getText:function(b,c){if(b===undefined)b=0;var f=this._model,g=this._projections,h=0,i=[],j,l,n;for(j=0;j<g.length;j++){l=g[j];if(l.start>b-h)break;n=l._model.getCharCount();if(l.start+n>b-h)if(c!==undefined&&l.start+n>c-h)return l._model.getText(b-(l.start+h),c-(l.start+h));else{i.push(l._model.getText(b-(l.start+h)));b=l.end+h+n-(l.end-l.start)}h+=n-(l.end-l.start)}b=b-h;if(c!==undefined){for(;j<g.length;j++){l=g[j];if(l.start>c-h)break;
i.push(f.getText(b,l.start));n=l._model.getCharCount();if(l.start+n>c-h){i.push(l._model.getText(0,c-(l.start+h)));return i.join("")}i.push(l._model.getText());b=l.end;h+=n-(l.end-l.start)}i.push(f.getText(b,c-h))}else{for(;j<g.length;j++){l=g[j];i.push(f.getText(b,l.start));i.push(l._model.getText());b=l.end}i.push(f.getText(b))}return i.join("")},_onChanging:function(b,c,f,g,h,i){for(var j=this._model,l=this._projections,n,p=0,t,v=c+f;n<l.length;n++){f=l[n];if(f.start>c)break;p+=f._model.getCharCount()-
(f.end-f.start)}c=c+p;for(var r=n;n<l.length;n++){f=l[n];if(f.start>v)break;p+=f._model.getCharCount()-(f.end-f.start);t+=f._model.getLineCount()-1-f._lineCount}f=v+p;p=n;this.onChanging(c,f-c,g,h+t,i);l.splice(l,p-r);for(b=b.length-(f-c);n<l.length;n++){f=l[n];f.start+=b;f.end+=b;f._lineIndex=j.getLineAtOffset(f.start)}},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,
c,f){if(b===undefined)b="";if(c===undefined)c=0;var g=c,h=f,i=this._model,j=this._projections,l=0,n=0,p,t,v,r,u,q=0;for(p=0;p<j.length;p++){t=j[p];if(t.start>c-l)break;v=t._model.getCharCount();if(t.start+v>c-l)if(f!==undefined&&t.start+v>f-l){t._model.setText(b,c-(t.start+l),f-(t.start+l));return}else{q=t._model.getLineCount()-1-t._model.getLineAtOffset(c-(t.start+l));r={projection:t,start:c-(t.start+l)};c=t.end+l+v-(t.end-t.start)}n+=t._model.getLineCount()-1-t._lineCount;l+=v-(t.end-t.start)}c=
c-l;var x=p;q=i.getLineAtOffset(c)+n-q;if(f!==undefined)for(;p<j.length;p++){t=j[p];if(t.start>f-l)break;v=t._model.getCharCount();if(t.start+v>f-l){n+=t._model.getLineAtOffset(f-(t.start+l));v=f-(t.start+l);f=t.end+l;u={projection:t,end:v};break}n+=t._model.getLineCount()-1-t._lineCount;l+=v-(t.end-t.start)}else{for(;p<j.length;p++){t=j[p];n+=t._model.getLineCount()-1-t._lineCount;l+=t._model.getCharCount()-(t.end-t.start)}f=h=i.getCharCount()+l}f=f-l;p=p;t=i.getLineAtOffset(f)+n;h=h-g;n=t-q;q=b.length;
for(var z=v=t=l=0;;){if(t!==-1&&t<=z)t=b.indexOf("\r",z);if(v!==-1&&v<=z)v=b.indexOf("\n",z);if(v===-1&&t===-1)break;z=t!==-1&&v!==-1?t+1===v?v+1:(t<v?t:v)+1:t!==-1?t+1:v+1;l++}this.onChanging({type:"Changing",text:b,start:g,removedCharCount:h,addedCharCount:q,removedLineCount:n,addedLineCount:l});i.setText(b,c,f);if(r){t=r.projection;t._model.setText("",r.start)}if(u){t=u.projection;t._model.setText("",0,u.end);t.start=t.end;t._lineCount=0}j.splice(x,p-x);b=b.length-(f-c);for(p=p;p<j.length;p++){t=
j[p];t.start+=b;t.end+=b;t._lineIndex=i.getLineAtOffset(t.start)}this.onChanged({type:"Changed",start:g,removedCharCount:h,addedCharCount:q,removedLineCount:n,addedLineCount:l})}};e.EventTarget.addMixin(a.prototype);return{ProjectionTextModel:a}});
define("orion/textview/tooltip",["i18n!orion/textview/nls/messages","orion/textview/textView","orion/textview/textModel","orion/textview/projectionTextModel"],function(d,e,a,b){function c(f){this._view=f;this._create(f._parent.ownerDocument);f.addEventListener("Destroy",this,this.destroy)}c.getTooltip=function(f){if(!f._tooltip)f._tooltip=new c(f);return f._tooltip};c.prototype={_create:function(f){if(!this._domNode){this._document=f;var g=this._domNode=f.createElement("DIV");g.className="viewTooltip";
var h=this._viewParent=f.createElement("DIV");g.appendChild(h);h=this._htmlParent=f.createElement("DIV");g.appendChild(h);f.body.appendChild(g);this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var f=this._domNode.parentNode;f&&f.removeChild(this._domNode);this._domNode=null}},hide:function(){this._contentsView&&this._contentsView.setModel(this._emptyModel);if(this._viewParent){this._viewParent.style.left=
"-10000px";this._viewParent.style.position="fixed";this._viewParent.style.visibility="hidden"}if(this._htmlParent){this._htmlParent.style.left="-10000px";this._htmlParent.style.position="fixed";this._htmlParent.style.visibility="hidden";this._htmlParent.innerHTML=""}if(this._domNode)this._domNode.style.visibility="hidden";if(this._showTimeout){clearTimeout(this._showTimeout);this._showTimeout=null}if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}if(this._fadeTimeout){clearInterval(this._fadeTimeout);
this._fadeTimeout=null}},isVisible:function(){return this._domNode&&this._domNode.style.visibility==="visible"},setTarget:function(f){if(this.target!==f){this._target=f;this.hide();if(f){var g=this;g._showTimeout=setTimeout(function(){g.show(true)},1E3)}}},show:function(f){if(this._target){var g=this._target.getTooltipInfo();if(g){var h=this._domNode;h.style.left=h.style.right=h.style.width=h.style.height="auto";var i=g.contents,j;if(i instanceof Array)i=this._getAnnotationContents(i);if(typeof i===
"string")(j=this._htmlParent).innerHTML=i;else if(i instanceof Node)(j=this._htmlParent).appendChild(i);else if(i instanceof b.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new a.TextModel("");j=this._contentsView=new e.TextView({model:this._emptyModel,parent:this._viewParent,tabSize:4,sync:true,stylesheet:["/orion/textview/tooltip.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"]});j._clientDiv.contentEditable=false;var l=this._view;j.addEventListener("LineStyle",
{onLineStyle:function(p){l.onLineStyle(p)}}.onLineStyle)}j=this._contentsView;j.setModel(i);i=j.computeSize();j=this._viewParent;j.style.width=i.width+20+"px";j.style.height=i.height+"px"}else return;j.style.left="auto";j.style.position="static";j.style.visibility="visible";i=parseInt(this._getNodeStyle(h,"padding-left","0"),10);i+=parseInt(this._getNodeStyle(h,"border-left-width","0"),10);if(g.anchor==="right"){j=parseInt(this._getNodeStyle(h,"padding-right","0"),10);j+=parseInt(this._getNodeStyle(h,
"border-right-width","0"),10);h.style.right=h.ownerDocument.body.getBoundingClientRect().right-g.x+i+j+"px"}else h.style.left=g.x-i+"px";i=parseInt(this._getNodeStyle(h,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(h,"border-top-width","0"),10);h.style.top=g.y-i+"px";h.style.maxWidth=g.maxWidth+"px";h.style.maxHeight=g.maxHeight+"px";h.style.opacity="1";h.style.visibility="visible";if(f){var n=this;n._hideTimeout=setTimeout(function(){var p=parseFloat(n._getNodeStyle(h,"opacity","1"));n._fadeTimeout=
setInterval(function(){if(h.style.visibility==="visible"&&p>0){p-=0.1;h.style.opacity=p}else n.hide()},50)},5E3)}}}},_getAnnotationContents:function(f){function g(p,t){p=i.getLineStart(i.getLineAtOffset(p));t=i.getLineEnd(i.getLineAtOffset(t),true);return i.getText(p,t)}if(f.length===0)return null;var h=this._view.getModel(),i=h.getBaseModel?h.getBaseModel():h,j;if(f.length===1){h=f[0];if(h.title){j=h.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div>"+h.html+"&nbsp;<span style='vertical-align:middle;'>"+
j+"</span><div>"}else{f=new b.ProjectionTextModel(i);j=i.getLineStart(i.getLineAtOffset(h.start));f.addProjection({start:h.end,end:f.getCharCount()});f.addProjection({start:0,end:j});return f}}else{for(var l="<div><em>"+d.multipleAnnotations+"</em></div>",n=0;n<f.length;n++){h=f[n];(j=h.title)||(j=g(h.start,h.end));j=j.replace(/</g,"&lt;").replace(/>/g,"&gt;");l+="<div>"+h.html+"&nbsp;<span style='vertical-align:middle;'>"+j+"</span><div>"}return l}},_getNodeStyle:function(f,g,h){var i;if(f){i=f.style[g];
if(!i)if(f.currentStyle){i=0;for(g=g;(i=g.indexOf("-",i))!==-1;)g=g.substring(0,i)+g.substring(i+1,i+2).toUpperCase()+g.substring(i+2);i=f.currentStyle[g]}else i=(f=f.ownerDocument.defaultView.getComputedStyle(f,null))?f.getPropertyValue(g):null}return i||h}};return{Tooltip:c}});
define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget","orion/textview/tooltip"],function(d,e,a,b){function c(g){this._textViewFactory=g.textViewFactory;this._undoStackFactory=g.undoStackFactory;this._textDNDFactory=g.textDNDFactory;this._annotationFactory=g.annotationFactory;this._foldingRulerFactory=g.foldingRulerFactory;this._lineNumberRulerFactory=g.lineNumberRulerFactory;this._contentAssistFactory=g.contentAssistFactory;this._keyBindingFactory=
g.keyBindingFactory;this._statusReporter=g.statusReporter;this._domNode=g.domNode;this._syntaxHighlightProviders=g.syntaxHighlightProviders;this._foldingRuler=this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}var f;c.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",currentBracketType:"orion.annotation.currentBracket",matchingBracketType:"orion.annotation.matchingBracket",
currentLineType:"orion.annotation.currentLine",highlightErrorType:"orion.annotation.highlightError",getTextView:function(){return this._textView},reportStatus:function(g,h){this._statusReporter?this._statusReporter(g,h):window.alert(h==="error"?"ERROR: "+g:g)},getModel:function(){var g=this._textView.getModel();if(g.getBaseModel)g=g.getBaseModel();return g},mapOffset:function(g,h){var i=this._textView.getModel();if(i.getBaseModel)g=i.mapOffset(g,h);return g},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var g=this._textView,h=g.getSelection();g=g.getModel();if(g.getBaseModel){h.start=g.mapOffset(h.start);h.end=g.mapOffset(h.end)}return h},getText:function(g,h){var i=this._textView.getModel();if(i.getBaseModel)i=i.getBaseModel();return i.getText(g,h)},_expandOffset:function(g){var h=this._textView.getModel(),i=this._annotationModel;if(i&&h.getBaseModel)for(g=i.getAnnotations(g,g+1);g.hasNext();){h=g.next();if(h.type==="orion.annotation.folding")if(h.expand){h.expand();i.modifyAnnotation(h)}}},
setCaretOffset:function(g){var h=this._textView,i=h.getModel();if(i.getBaseModel){this._expandOffset(g);g=i.mapOffset(g,true)}h.setCaretOffset(g)},setText:function(g,h,i){var j=this._textView,l=j.getModel();if(l.getBaseModel){if(h!==undefined){this._expandOffset(h);h=l.mapOffset(h,true)}if(i!==undefined){this._expandOffset(i);i=l.mapOffset(i,true)}}j.setText(g,h,i)},setFoldingEnabled:function(g){this._foldingEnabled=g;this._updateFoldingRuler()},_updateFoldingRuler:function(){var g=this._textView;
if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&g.getModel().getBaseModel&&this._foldingEnabled){g.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);g.addRuler(this._foldingRuler)}}else if(this._foldingRuler){g.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(g,h,i){var j=this._textView,l=j.getModel();if(l.getBaseModel){this._expandOffset(g);
this._expandOffset(h);g=l.mapOffset(g,true);h=l.mapOffset(h,true)}j.setSelection(g,h,i)},moveSelection:function(g,h,i){h=h||g;var j=this._textView;this.setSelection(g,h,false);h=j.getTopPixel();var l=j.getBottomPixel();g=this.getModel().getLineAtOffset(g);g=j.getLinePixel(g);if(g<h||g>l){l=Math.max(0,g-Math.floor((g<h?3:1)*(l-h)/4));(new f.Animation({node:j,duration:300,curve:[h,l],onAnimate:function(n){j.setTopPixel(Math.floor(n))},onEnd:function(){j.showSelection();j.focus();i&&i()}})).play()}else{j.showSelection();
j.focus();i&&i()}},isDirty:function(){return this._dirty},setDirty:function(g){if(this._dirty!==g){this._dirty=g;this.onDirtyChanged({type:"DirtyChanged"})}},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(g,h){var i=this._textView,j=this.getAnnotationModel();if(!j)return null;var l=this._annotationStyler;if(!l)return null;var n=i.getOffsetAtLocation(g,h);if(n===-1)return null;n=this.mapOffset(n);l=l.getAnnotationsByType(j,n,n+1);j=[];for(n=0;n<l.length;n++)l[n].rangeStyle&&
j.push(l[n]);if(j.length===0)return null;g=i.convert({x:g,y:h},"document","page");return{contents:j,anchor:"left",x:g.x+10,y:g.y+20}},getAnnotationModel:function(){return this._annotationModel},doFind:function(g,h,i,j){var l=this.getText();if(i){g=g.toLowerCase();l=l.toLowerCase()}if(j){l=l.split("").reverse().join("");g=g.split("").reverse().join("");h=l.length-h-1;h=l.indexOf(g,h);if(h!==-1)return{index:l.length-g.length-h,length:g.length}}else{h=l.indexOf(g,h);if(h!==-1)return{index:h,length:g.length}}return null},
doFindRegExp:function(g,h,i,j){if(!g)return null;h=h||"";h+=(h.indexOf("g")===-1?"g":"")+(h.indexOf("m")===-1?"m":"");g=new RegExp(g,h);h=this.getText();var l=null,n=null;if(j)for(;;)if((l=g.exec(h))&&l.index<=i)n={index:l.index,length:l[0].length};else return n;else return(l=g.exec(h.substring(i)))&&{index:l.index+i,length:l[0].length}},_highlightCurrentLine:function(g,h){var i=this._annotationModel;if(i){var j=this._textView.getModel(),l=h?j.getLineAtOffset(h.start):-1,n=j.getLineAtOffset(g.start);
g=g.start===g.end;h=!h||h.start===h.end;if(!(l===n&&h&&g)){l=this._currentLineAnnotation?[this._currentLineAnnotation]:null;this._currentLineAnnotation=null;var p;if(g){p=j.getLineStart(n);n=j.getLineEnd(n);if(j.getBaseModel){p=j.mapOffset(p);n=j.mapOffset(n)}this._currentLineAnnotation={start:p,end:n,type:this.currentLineType,title:d.currentLine,html:"<div class='annotationHTML currentLine'></div>",overviewStyle:{styleClass:"annotationOverview currentLine"},lineStyle:{styleClass:"annotationLine currentLine"}};
p=[this._currentLineAnnotation]}i.replaceAnnotations(l,p)}}},highlightAnnotations:function(){if(this._annotationStyler){this._annotationStyler.destroy();this._annotationStyler=null}if(this._annotationFactory){this._annotationStyler=this._annotationFactory.createAnnotationStyler(this.getTextView(),this._annotationModel);this._annotationStyler.addAnnotationType(this.errorType);this._annotationStyler.addAnnotationType(this.warningType);this._annotationStyler.addAnnotationType(this.matchingBracketType);
this._annotationStyler.addAnnotationType(this.currentBracketType);this._annotationStyler.addAnnotationType(this.currentLineType);this._annotationStyler.addAnnotationType(this.highlightErrorType)}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory){this._contentAssist=this._contentAssistFactory(this);
this._keyModes.push(this._contentAssist)}var g=this,h=this._textView,i=this;this._listener={onModelChanged:function(){i.checkDirty()},onMouseOver:function(l){i._listener.onMouseMove(l)},onMouseMove:function(l){var n=b.Tooltip.getTooltip(h);n&&n.setTarget({x:l.x,y:l.y,getTooltipInfo:function(){return i._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(){var l=b.Tooltip.getTooltip(h);l&&l.setTarget(null)},onSelection:function(l){i._updateCursorStatus();i._highlightCurrentLine(l.newValue,l.oldValue)}};
h.addEventListener("ModelChanged",this._listener.onModelChanged);h.addEventListener("Selection",this._listener.onSelection);h.addEventListener("MouseOver",this._listener.onMouseOver);h.addEventListener("MouseOut",this._listener.onMouseOut);h.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);h.setKeyBinding(new e.KeyBinding(27),"Cancel Current Mode");h.setAction("Cancel Current Mode",function(){for(var l=
false,n=0;n<this._keyModes.length;n++)if(this._keyModes[n].isActive())l=this._keyModes[n].cancel()||l;return l}.bind(this));h.setAction("lineUp",function(){for(var l=0;l<this._keyModes.length;l++)if(this._keyModes[l].isActive())return this._keyModes[l].lineUp();return false}.bind(this));h.setAction("lineDown",function(){for(var l=0;l<this._keyModes.length;l++)if(this._keyModes[l].isActive())return this._keyModes[l].lineDown();return false}.bind(this));h.setAction("enter",function(){for(var l=0;l<
this._keyModes.length;l++)if(this._keyModes[l].isActive())return this._keyModes[l].enter();return false}.bind(this));if(this._annotationFactory){var j=h.getModel();if(j.getBaseModel)j=j.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(j);j=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=j.annotationRuler;this._annotationRuler.onClick=function(l){if(l!==undefined)if(l!==-1){var n=h.getModel(),p=this.getAnnotationModel(),
t=g.mapOffset(n.getLineStart(l));l=g.mapOffset(n.getLineEnd(l));for(l=p.getAnnotations(t,l);l.hasNext();){p=l.next();if(this.isAnnotationTypeVisible(p.type)){l=g.getModel();g.onGotoLine(l.getLineAtOffset(t),p.start-t,p.end-t);break}}}};this._overviewRuler=j.overviewRuler;this._overviewRuler.onClick=function(l){if(l!==undefined){l=h.getModel().getLineStart(l);g.moveSelection(g.mapOffset(l))}};this._annotationRuler.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"});this._annotationRuler.addAnnotationType(this.errorType);
this._annotationRuler.addAnnotationType(this.warningType);this._annotationRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.errorType);this._overviewRuler.addAnnotationType(this.warningType);this._overviewRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.matchingBracketType);this._overviewRuler.addAnnotationType(this.currentBracketType);this._overviewRuler.addAnnotationType(this.currentLineType);h.addRuler(this._annotationRuler);h.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);h.addRuler(this._lineNumberRuler)}this._updateFoldingRuler();this.dispatchEvent({type:"TextViewInstalled",textView:h})},_updateCursorStatus:function(){var g=this.getModel(),h=this.getCaretOffset(),i=g.getLineAtOffset(h);g=g.getLineStart(i);h=h-g;for(g=0;g<this._keyModes.length;g++){var j=this._keyModes[g];if(j.isActive()&&j.isStatusActive&&j.isStatusActive())return}this.reportStatus(d.formatMessage(d.lineColumn,i+1,h+1))},showProblems:function(g){var h=
this._annotationModel;if(h){for(var i=[],j=[],l=h.getTextModel(),n=h.getAnnotations(0,l.getCharCount()),p;n.hasNext();){p=n.next();if(p.type===this.errorType||p.type===this.warningType)i.push(p)}if(g)for(n=0;n<g.length;n++)if(p=g[n]){var t=p.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),v=l.getLineStart(p.line-1),r=p.severity;p={type:this[r+"Type"],start:v+p.start-1,end:v+p.end,title:t,html:"<div class='annotationHTML "+r+"'></div>",style:{styleClass:"annotation "+r},overviewStyle:{styleClass:"annotationOverview "+
r},rangeStyle:{styleClass:"annotationRange "+r}};j.push(p)}h.replaceAnnotations(i,j)}},showSelection:function(g,h,i,j,l){if(typeof g==="number"){if(typeof h!=="number")h=g;this.moveSelection(g,h)}else if(typeof i==="number"){g=this.getModel().getLineStart(i-1);if(typeof j==="number")g+=j;if(typeof l!=="number")l=0;this.moveSelection(g,g+l)}},setInput:function(g,h,i,j){this._title=g;if(this._textView)if(j){this._undoStack.markClean();this.checkDirty()}else{if(h)this._textView.setText(h);else if(i!==
null&&i!==undefined){this._textView.setText(i);this._textView.getModel().setLineDelimiter("auto");this._highlightCurrentLine(this._textView.getSelection())}this._undoStack.reset();this.checkDirty();this._textView.focus()}this.onInputChanged({type:"InputChanged",title:g,message:h,contents:i,contentsSaved:j})},onInputChanged:function(g){return this.dispatchEvent(g)},onGotoLine:function(g,h,i){if(this._textView){var j=this.getModel(),l=j.getLineStart(g),n=0;if(i===undefined)i=0;if(typeof h==="string"){g=
j.getLine(g).indexOf(h);if(g!==-1){n=g;i=n+h.length}}else{n=h;h=j.getLineEnd(g)-l;n=Math.min(n,h);i=Math.min(i,h)}this.moveSelection(l+n,l+i)}},onDirtyChanged:function(g){return this.dispatchEvent(g)},getTitle:function(){return this._title}};a.EventTarget.addMixin(c.prototype);f={Animation:function(){function g(h){this.options=h}g.prototype.play=function(){function h(){u=u===-1?(new Date).getTime():u;var q=((new Date).getTime()-u)/i;if(q<1){q=j(q);v=p+q*t;l(v)}else{clearInterval(r);n()}}var i=typeof this.options.duration===
"number"?this.options.duration:350,j=this.options.easing||this.defaultEasing,l=this.options.onAnimate||function(){},n=this.options.onEnd||function(){},p=this.options.curve[0],t=this.options.curve[1]-p,v,r,u=-1;r=setInterval(h,typeof this.options.rate==="number"?this.options.rate:20)};g.prototype.defaultEasing=function(h){return Math.sin(h*(Math.PI/2))};return g}(),bind:function(g){var h=this,i=Array.prototype.slice.call(arguments,1);if(i.length)return function(){return arguments.length?h.apply(g,
i.concat(Array.prototype.slice.call(arguments))):h.apply(g,i)};return function(){return arguments.length?h.apply(g,arguments):h.call(g)}}};if(!Function.prototype.bind)Function.prototype.bind=f.bind;return{Editor:c,util:f}});
define("orion/textview/annotations",["orion/textview/eventTarget"],function(d){function e(f,g,h,i,j,l,n,p){this.type=g;this.start=h;this.end=i;this._projectionModel=f;this._expandedHTML=this.html=j;this._expandedStyle=this.style=l;this._collapsedHTML=n;this._collapsedStyle=p;this.expanded=true}function a(){}function b(f){this._annotations=[];var g=this;this._listener={onChanged:function(h){g._onChanged(h)}};this.setTextModel(f)}function c(f,g){this._view=f;this._annotationModel=g;var h=this;this._listener=
{onDestroy:function(i){h._onDestroy(i)},onLineStyle:function(i){h._onLineStyle(i)},onChanged:function(i){h._onAnnotationModelChanged(i)}};f.addEventListener("Destroy",this._listener.onDestroy);f.addEventListener("LineStyle",this._listener.onLineStyle);g.addEventListener("Changed",this._listener.onChanged)}e.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var f=this._projectionModel,g=f.getBaseModel();this._projection=
{start:g.getLineStart(g.getLineAtOffset(this.start)+1),end:g.getLineEnd(g.getLineAtOffset(this.end),true)};f.addProjection(this._projection)}},expand:function(){if(!this.expanded){this.expanded=true;this.html=this._expandedHTML;this.style=this._expandedStyle;this._projectionModel.removeProjection(this._projection)}}};a.addMixin=function(f){var g=a.prototype;for(var h in g)if(g.hasOwnProperty(h))f[h]=g[h]};a.prototype={addAnnotationType:function(f){if(!this._annotationTypes)this._annotationTypes=[];
this._annotationTypes.push(f)},getAnnotationTypePriority:function(f){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===f)return g+1;return 0},getAnnotationsByType:function(f,g,h){f=f.getAnnotations(g,h);for(h=[];f.hasNext();){g=f.next();this.getAnnotationTypePriority(g.type)!==0&&h.push(g)}var i=this;h.sort(function(j,l){return i.getAnnotationTypePriority(j.type)-i.getAnnotationTypePriority(l.type)});return h},isAnnotationTypeVisible:function(f){return this.getAnnotationTypePriority(f)!==
0},removeAnnotationType:function(f){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===f){this._annotationTypes.splice(g,1);break}}};b.prototype={addAnnotation:function(f){if(f){var g=this._annotations,h=this._binarySearch(g,f.start);g.splice(h,0,f);this.onChanged({type:"Changed",added:[f],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(f,g){var h=this._annotations,i,j=0,l=function(){for(;j<h.length;){var n=
h[j++];if(f===n.start||(f>n.start?f<n.end:n.start<g))return n;if(n.start>=g)break}return null};i=l();return{next:function(){var n=i;if(n)i=l();return n},hasNext:function(){return i!==null}}},modifyAnnotation:function(f){if(f)this._getAnnotationIndex(f)<0||this.onChanged({type:"Changed",added:[],removed:[],changed:[f]})},onChanged:function(f){return this.dispatchEvent(f)},removeAnnotations:function(f){var g=this._annotations,h,i;if(f){h=[];for(i=g.length-1;i>=0;i--){var j=g[i];j.type===f&&g.splice(i,
1);h.splice(0,0,j)}}else h=g;this.onChanged({type:"Changed",removed:h,added:[],changed:[]})},removeAnnotation:function(f){if(f){f=this._getAnnotationIndex(f);f<0||this.onChanged({type:"Changed",removed:this._annotations.splice(f,1),added:[],changed:[]})}},replaceAnnotations:function(f,g){var h=this._annotations,i,j,l,n=[];if(f)for(i=f.length-1;i>=0;i--){l=f[i];j=this._getAnnotationIndex(l);if(!(j<0)){h.splice(j,1);n.splice(0,0,l)}}g||(g=[]);for(i=0;i<g.length;i++){l=g[i];j=this._binarySearch(h,l.start);
h.splice(j,0,l)}this.onChanged({type:"Changed",removed:n,added:g,changed:[]})},setTextModel:function(f){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=f)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(f,g){for(var h=f.length,i=-1,j;h-i>1;){j=Math.floor((h+i)/2);if(g<=f[j].start)h=j;else i=j}return h},_getAnnotationIndex:function(f){for(var g=this._annotations,h=this._binarySearch(g,f.start);h<g.length&&g[h].start===
f.start;){if(g[h]===f)return h;h++}return-1},_onChanged:function(f){var g=f.start,h=f.removedCharCount,i=this._annotations,j=g+h;if(0<i.length){var l={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:f};f=f.addedCharCount-h;for(h=0;h<i.length;h++){var n=i[h];if(n.start>=j){n.start+=f;n.end+=f;l.changed.push(n)}else if(!(n.end<=g))if(n.start<g&&j<n.end){n.end+=f;l.changed.push(n)}else{i.splice(h,1);l.removed.push(n);h--}}if(l.added.length>0||l.removed.length>0||l.changed.length>
0)this.onChanged(l)}}};d.EventTarget.addMixin(b.prototype);c.prototype={destroy:function(){var f=this._view;if(f){f.removeEventListener("Destroy",this._listener.onDestroy);f.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}(f=this._annotationModel)&&f.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(f,g){if(g){f||(f={});if(f.styleClass&&g.styleClass&&f.styleClass!==g.styleClass)f.styleClass+=" "+g.styleClass;else f.styleClass=g.styleClass;var h;
if(g.style){if(!f.style)f.style={};for(h in g.style)f.style[h]||(f.style[h]=g.style[h])}if(g.attributes){if(!f.attributes)f.attributes={};for(h in g.attributes)f.attributes[h]||(f.attributes[h]=g.attributes[h])}}return f},_mergeStyleRanges:function(f,g){if(f)for(var h=0;h<f.length;h++){var i=f[h];if(g.end<=i.start)break;if(!(g.start>=i.end)){var j=this._mergeStyle({},i.style);j=this._mergeStyle(j,g.style);if(g.start<=i.start&&g.end>=i.end)f[h]={start:i.start,end:i.end,style:j};else if(g.start>i.start&&
g.end<i.end){f.splice(h,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:g.end,style:j},{start:g.end,end:i.end,style:i.style});h+=2}else if(g.start>i.start){f.splice(h,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:i.end,style:j});h+=1}else if(g.end<i.end){f.splice(h,1,{start:i.start,end:g.end,style:j},{start:g.end,end:i.end,style:i.style});h+=1}}}},_onAnnotationModelChanged:function(f){function g(l){for(var n=0;n<l.length;n++)if(i.isAnnotationTypeVisible(l[n].type)){var p=
l[n].start,t=l[n].end;if(j.getBaseModel){p=j.mapOffset(p,true);t=j.mapOffset(t,true)}p!==-1&&t!==-1&&h.redrawRange(p,t)}}if(!f.textModelChangedEvent){var h=this._view;if(h){var i=this,j=h.getModel();g(f.added);g(f.removed);g(f.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(f){var g=this._annotationModel,h=this._view.getModel(),i=g.getTextModel(),j=f.lineStart,l=f.lineStart+f.lineText.length;if(i!==h){j=h.mapOffset(j);l=h.mapOffset(l)}for(g=g.getAnnotations(j,l);g.hasNext();){j=
g.next();if(this.isAnnotationTypeVisible(j.type)){if(j.rangeStyle){l=j.start;var n=j.end;if(i!==h){l=h.mapOffset(l,true);n=h.mapOffset(n,true)}this._mergeStyleRanges(f.ranges,{start:l,end:n,style:j.rangeStyle})}if(j.lineStyle){f.style=this._mergeStyle({},f.style);f.style=this._mergeStyle(f.style,j.lineStyle)}}}}};a.addMixin(c.prototype);return{FoldingAnnotation:e,AnnotationTypeList:a,AnnotationModel:b,AnnotationStyler:c}});
define("orion/textview/rulers",["i18n!orion/textview/nls/messages","orion/textview/annotations","orion/textview/tooltip"],function(d,e,a){function b(i,j,l,n){this._location=j||"left";this._overview=l||"page";this._rulerStyle=n;this._view=null;var p=this;this._listener={onTextModelChanged:function(t){p._onTextModelChanged(t)},onAnnotationModelChanged:function(t){p._onAnnotationModelChanged(t)}};this.setAnnotationModel(i)}function c(i,j,l,n,p){b.call(this,i,j,"page",l);this._oddStyle=n||{style:{backgroundColor:"white"}};
this._evenStyle=p||{style:{backgroundColor:"white"}};this._numOfDigits=0}function f(i,j,l){b.call(this,i,j,"page",l)}function g(i,j,l){b.call(this,i,j,"document",l)}function h(i,j,l){f.call(this,i,j,l)}b.prototype={getAnnotations:function(i,j){var l=this._annotationModel;if(!l)return[];var n=this._view.getModel(),p=n.getLineStart(i),t=n.getLineEnd(j-1),v=n;if(n.getBaseModel){v=n.getBaseModel();p=n.mapOffset(p);t=n.mapOffset(t)}var r=[];l=this.getAnnotationsByType(l,p,t);for(p=0;p<l.length;p++){t=
l[p];for(var u=v.getLineAtOffset(t.start),q=v.getLineAtOffset(Math.max(t.start,t.end-1)),x=u;x<=q;x++){var z=x;if(n!==v){z=v.getLineStart(x);z=n.mapOffset(z,true);if(z===-1)continue;z=n.getLineAtOffset(z)}if(i<=z&&z<j){var C=this._mergeAnnotation(r[z],t,x-u,q-u+1);if(C)r[z]=C}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var k in r)if(r[k]._multiple)r[k].html+=this._multiAnnotationOverlay.html;return r},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getWidestAnnotation:function(){return null},setAnnotationModel:function(i){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=i)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(i){this._multiAnnotation=i},setMultiAnnotationOverlay:function(i){this._multiAnnotationOverlay=
i},setView:function(i){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=i;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(i,j){var l=a.Tooltip.getTooltip(this._view);if(l)if(!(l.isVisible()&&this._tooltipLineIndex===i)){this._tooltipLineIndex=i;var n=this;l.setTarget({y:j.clientY,getTooltipInfo:function(){return n._getTooltipInfo(n._tooltipLineIndex,
this.y)}})}},onMouseOver:function(i,j){this.onMouseMove(i,j)},onMouseOut:function(){var i=a.Tooltip.getTooltip(this._view);i&&i.setTarget(null)},_getTooltipInfo:function(i,j){if(i!==undefined){var l=this._view,n=l.getModel(),p=this._annotationModel,t=[];if(p){t=n.getLineStart(i);var v=n.getLineEnd(i);if(n.getBaseModel){t=n.mapOffset(t);v=n.mapOffset(v)}t=this.getAnnotationsByType(p,t,v)}p=this._getTooltipContents(i,t);if(!p)return null;p={contents:p,anchor:this.getLocation()};t=l.getClientArea();
t.y=this.getOverview()==="document"?l.convert({y:j},"view","document").y:l.getLocationAtOffset(n.getLineStart(i)).y;l.convert(t,"document","page");p.x=t.x;p.y=t.y;if(p.anchor==="right")p.x+=t.width;p.maxWidth=t.width;p.maxHeight=t.height-(t.y-l._parent.getBoundingClientRect().top);return p}},_getTooltipContents:function(i,j){return j},_onAnnotationModelChanged:function(i){function j(v){for(var r=0;r<v.length;r++)if(p.isAnnotationTypeVisible(v[r].type)){var u=v[r].start,q=v[r].end;if(n.getBaseModel){u=
n.mapOffset(u,true);q=n.mapOffset(q,true)}u!==-1&&q!==-1&&l.redrawLines(n.getLineAtOffset(u),n.getLineAtOffset(Math.max(u,q-1))+1,p)}}var l=this._view;if(l){var n=l.getModel(),p=this,t=n.getLineCount();if(i.textModelChangedEvent){i=i.textModelChangedEvent.start;if(n.getBaseModel)i=n.mapOffset(i,true);i=n.getLineAtOffset(i);l.redrawLines(i,t,p)}else{j(i.added);j(i.removed);j(i.changed)}}},_mergeAnnotation:function(i,j,l){i||(i={});if(l===0)if(i.html&&j.html){if(j.html!==i.html)if(!i._multiple&&this._multiAnnotation)i.html=
this._multiAnnotation.html;i._multiple=true}else i.html=j.html;i.style=this._mergeStyle(i.style,j.style);return i},_mergeStyle:function(i,j){if(j){i||(i={});if(i.styleClass&&j.styleClass&&i.styleClass!==j.styleClass)i.styleClass+=" "+j.styleClass;else i.styleClass=j.styleClass;var l;if(j.style){if(!i.style)i.style={};for(l in j.style)i.style[l]||(i.style[l]=j.style[l])}if(j.attributes){if(!i.attributes)i.attributes={};for(l in j.attributes)i.attributes[l]||(i.attributes[l]=j.attributes[l])}}return i}};
e.AnnotationTypeList.addMixin(b.prototype);c.prototype=new b;c.prototype.getAnnotations=function(i,j){var l=b.prototype.getAnnotations.call(this,i,j),n=this._view.getModel();for(i=i;i<j;i++){var p=i&1?this._oddStyle:this._evenStyle,t=i;if(n.getBaseModel){t=n.getLineStart(t);t=n.getBaseModel().getLineAtOffset(n.mapOffset(t))}l[i]||(l[i]={});l[i].html=t+1+"";if(!l[i].style)l[i].style=p}return l};c.prototype.getWidestAnnotation=function(){var i=this._view.getModel().getLineCount();return this.getAnnotations(i-
1,i)[i-1]};c.prototype._onTextModelChanged=function(i){i=i.start;var j=this._view.getModel(),l=((j.getBaseModel?j.getBaseModel().getLineCount():j.getLineCount())+"").length;if(this._numOfDigits!==l){this._numOfDigits=l;this._view.redrawLines(j.getLineAtOffset(i),j.getLineCount(),this)}};f.prototype=new b;g.prototype=new b;g.prototype.getRulerStyle=function(){var i={style:{lineHeight:"1px",fontSize:"1px"}};return i=this._mergeStyle(i,this._rulerStyle)};g.prototype.onClick=function(i){i!==undefined&&
this._view.setTopIndex(i)};g.prototype._getTooltipContents=function(i,j){if(j.length===0){j=this._view.getModel();i=i;if(j.getBaseModel){i=j.getLineStart(i);i=j.getBaseModel().getLineAtOffset(j.mapOffset(i))}return d.formatMessage(d.line,i+1)}return b.prototype._getTooltipContents.call(this,i,j)};g.prototype._mergeAnnotation=function(i,j,l,n){if(l===0){i=i;if(!i){i={html:"&nbsp;",style:{style:{height:3*n+"px"}}};i.style=this._mergeStyle(i.style,j.overviewStyle)}return i}};h.prototype=new f;h.prototype.onClick=
function(i){if(i!==undefined){var j=this._annotationModel;if(j){var l=this._view.getModel(),n=l.getLineStart(i);i=l.getLineEnd(i,true);if(l.getBaseModel){n=l.mapOffset(n);i=l.mapOffset(i);l=l.getBaseModel()}var p;for(j=j.getAnnotations(n,i);!p&&j.hasNext();){i=j.next();if(this.isAnnotationTypeVisible(i.type))p=i}if(p&&l.getLineAtOffset(p.start)===l.getLineAtOffset(n)){(l=a.Tooltip.getTooltip(this._view))&&l.setTarget(null);p.expanded?p.collapse():p.expand();this._annotationModel.modifyAnnotation(p)}}}};
h.prototype._getTooltipContents=function(i,j){if(j.length===1)if(j[0].expanded)return null;return f.prototype._getTooltipContents.call(this,i,j)};h.prototype._onAnnotationModelChanged=function(i){function j(u){for(t=0;t<u.length;t++)if(p.isAnnotationTypeVisible(u[t].type)){var q=u[t].start;if(n.getBaseModel)q=n.mapOffset(q,true);if(q!==-1)r=Math.min(r,n.getLineAtOffset(q))}}if(i.textModelChangedEvent)f.prototype._onAnnotationModelChanged.call(this,i);else{var l=this._view;if(l){var n=l.getModel(),
p=this,t,v=n.getLineCount(),r=v;j(i.added);j(i.removed);j(i.changed);i=l.getRulers();for(t=0;t<i.length;t++)l.redrawLines(r,v,i[t])}}};return{Ruler:b,AnnotationRuler:f,LineNumberRuler:c,OverviewRuler:g,FoldingRuler:h}});
define("orion/textview/textDND",[],function(){function d(e,a){this._view=e;this._undoStack=a;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(c){b._onDragStart(c)},onDragEnd:function(c){b._onDragEnd(c)},onDragEnter:function(c){b._onDragEnter(c)},onDragOver:function(c){b._onDragOver(c)},onDrop:function(c){b._onDrop(c)},onDestroy:function(c){b._onDestroy(c)}};e.addEventListener("DragStart",this._listener.onDragStart);e.addEventListener("DragEnd",
this._listener.onDragEnd);e.addEventListener("DragEnter",this._listener.onDragEnter);e.addEventListener("DragOver",this._listener.onDragOver);e.addEventListener("Drop",this._listener.onDrop);e.addEventListener("Destroy",this._listener.onDestroy)}d.prototype={destroy:function(){var e=this._view;if(e){e.removeEventListener("DragStart",this._listener.onDragStart);e.removeEventListener("DragEnd",this._listener.onDragEnd);e.removeEventListener("DragEnter",this._listener.onDragEnter);e.removeEventListener("DragOver",
this._listener.onDragOver);e.removeEventListener("Drop",this._listener.onDrop);e.removeEventListener("Destroy",this._listener.onDestroy);this._view=null}},_onDestroy:function(){this.destroy()},_onDragStart:function(e){var a=this._view,b=a.getSelection();a=a.getModel();if(a.getBaseModel){b.start=a.mapOffset(b.start);b.end=a.mapOffset(b.end);a=a.getBaseModel()}if(a=a.getText(b.start,b.end)){this._dragSelection=b;e.event.dataTransfer.effectAllowed="copyMove";e.event.dataTransfer.setData("Text",a)}},
_onDragEnd:function(e){var a=this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(e=e.event.dataTransfer.dropEffect==="move")&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,c=this._dropOffset;if(e)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;a.setText(b,c,c);a.setSelection(c,c+b.length);this._dropText=
null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(e){this._onDragOver(e)},_onDragOver:function(e){var a=e.event.dataTransfer.types;if(a)if(!(a.contains?a.contains("text/plain"):a.indexOf("text/plain")!==-1))e.event.dataTransfer.dropEffect="none"},_onDrop:function(e){var a=this._view,b=e.event.dataTransfer.getData("Text");if(b){e=a.getOffsetAtLocation(e.x,e.y);if(this._dragSelection){this._dropOffset=e;this._dropText=b}else{a.setText(b,
e,e);a.setSelection(e,e+b.length)}}}};return{TextDND:d}});
define("orion/editor/editorFeatures",["i18n!orion/editor/nls/messages","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers","orion/textview/annotations","orion/textview/textDND","orion/editor/regex"],function(d,e,a,b,c,f,g){function h(){}function i(){}function j(){}function l(){}function n(){}function p(r,u,q){this.editor=r;this.textView=r.getTextView();this.undoStack=u;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=
false;this._incrementalFindPrefix="";(this._searcher=q)&&this._searcher.getAdaptor().setEditor(this.editor);this._lastEditLocation=null;this.init()}function t(r,u,q,x){this.editor=r;this.textView=r.getTextView();this.undoStack=u;this.contentAssist=q;this.linkedMode=x;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}function v(r){this.editor=r;this.textView=r.getTextView();this.linkedModeActive=false;this.linkedModePositions=
[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(u){for(var q=false,x=0,z=0;z<this.linkedModePositions.length;++z){var C=this.linkedModePositions[z];if(q)C.offset+=x;else if(u.start>=C.offset&&u.end<=C.offset+C.length){q=C.length;C.length=u.start-C.offset+u.text.length+(C.offset+C.length-u.end);x=C.length-q;q=true}}if(q)this.linkedModeEscapePosition+=x;else this.cancel()}.bind(this)}}h.prototype={createUndoStack:function(r){r=r.getTextView();
var u=new e.UndoStack(r,200);r.setKeyBinding(new a.KeyBinding("z",true),"Undo");r.setAction("Undo",function(){u.undo();return true});var q=navigator.platform.indexOf("Mac")!==-1;r.setKeyBinding(q?new a.KeyBinding("z",true,true):new a.KeyBinding("y",true),"Redo");r.setAction("Redo",function(){u.redo();return true});return u}};i.prototype={createLineNumberRuler:function(r){return new b.LineNumberRuler(r,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};
j.prototype={createFoldingRuler:function(r){return new b.FoldingRuler(r,"left",{styleClass:"ruler folding"})}};l.prototype={createAnnotationModel:function(r){return new c.AnnotationModel(r)},createAnnotationStyler:function(r,u){return new c.AnnotationStyler(r,u)},createAnnotationRulers:function(r){var u=new b.AnnotationRuler(r,"left",{styleClass:"ruler annotations"});r=new b.OverviewRuler(r,"right",{styleClass:"ruler overview"});return{annotationRuler:u,overviewRuler:r}}};n.prototype={createTextDND:function(r,
u){return new f.TextDND(r.getTextView(),u)}};p.prototype={init:function(){var r=this;this._incrementalFindListener={onVerify:function(q){var x=r.editor,z=x.getModel(),C=x.mapOffset(q.start),k=x.mapOffset(q.end);C=z.getText(C,k);z=r._incrementalFindPrefix;if((z=z.match(new RegExp("^"+g.escape(C),"i")))&&z.length>0){z=r._incrementalFindPrefix+=q.text;r.editor.reportStatus(d.formatMessage(d.incrementalFind,z));C=z.toLowerCase()===z;k=x.getSelection().start;if(C=x.doFind(z,k,C)){r._incrementalFindSuccess=
true;r._incrementalFindIgnoreSelection=true;x.moveSelection(C.index,C.index+C.length);r._incrementalFindIgnoreSelection=false}else{x.reportStatus(d.formatMessage(d.incrementalFindNotFound,z),"error");r._incrementalFindSuccess=false}q.text=null}},onSelection:function(){r._incrementalFindIgnoreSelection||r.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(q){if(r.editor.isDirty())r._lastEditLocation=q.start+q.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);
this.textView.setKeyBinding(new a.KeyBinding("f",true),d.find);this.textView.setAction(d.find,function(){if(this._searcher){var q=this.editor,x=q.getSelection(),z="";if(x.end>x.start)z=q.getModel().getText(x.start,x.end);this._searcher.buildToolBar(z);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",true),d.findNext);this.textView.setAction(d.findNext,function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",
true,true),d.findPrevious);this.textView.setAction(d.findPrevious,function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("j",true),d.incrementalFindKey);this.textView.setAction(d.incrementalFindKey,function(){if(this._searcher&&this._searcher.visible())return true;var q=this.editor;if(this._incrementalFindActive){var x=this._incrementalFindPrefix;if(x.length!==0){var z;if(this._searcher)z=this._searcher.findNext(true,
x);else{z=0;if(this._incrementalFindSuccess)z=q.getSelection().start+1;var C=x.toLowerCase()===x;z=q.doFind(x,z,C)}if(z){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(z.index,z.index+z.length);this._incrementalFindIgnoreSelection=false;q.reportStatus(d.formatMessage(d.incrementalFind,x))}else{q.reportStatus(d.formatMessage(d.incrementalFindNotFound,x),"error");this._incrementalFindSuccess=false}}}else{q.setCaretOffset(q.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));
this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var q=this.editor,x=this._incrementalFindPrefix;x=this._incrementalFindPrefix=x.substring(0,x.length-1);if(x.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.setCaretOffset(q.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}q.reportStatus(d.formatMessage(d.incrementalFind,x));var z=q.getCaretOffset();z=q.getModel().getText().lastIndexOf(x,
z-x.length-1);if(z!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(z,z+x.length);this._incrementalFindIgnoreSelection=false}else q.reportStatus(d.formatMessage(d.incrementalFindNotFound,x),"error");return true}return false}.bind(this));this.textView.setAction("tab",function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start),k=x.getLineAtOffset(z.end>z.start?z.end-1:z.end);if(C!==k){var m=[];m.push("");for(var o=C;o<=k;o++)m.push(x.getLine(o,
true));o=x.getLineStart(C);x=x.getLineEnd(k,true);var s=this.textView.getOptions("tabSize","expandTab");s=s.expandTab?(new Array(s.tabSize+1)).join(" "):"\t";q.setText(m.join(s),o,x);q.setSelection(o===z.start?z.start:z.start+s.length,z.end+(k-C+1)*s.length);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),d.unindentLines);this.textView.setAction(d.unindentLines,function(){for(var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start),
k=x.getLineAtOffset(z.end>z.start?z.end-1:z.end),m=this.textView.getOptions("tabSize"),o=(new Array(m+1)).join(" "),s=[],w=0,y=0,B=C;B<=k;B++){var A=x.getLine(B,true);if(x.getLineStart(B)!==x.getLineEnd(B))if(A.indexOf("\t")===0){A=A.substring(1);w++}else if(A.indexOf(o)===0){A=A.substring(m);w+=m}else return true;if(B===C)y=w;s.push(A)}C=x.getLineStart(C);m=x.getLineEnd(k,true);x=x.getLineStart(k);q.setText(s.join(""),C,m);q.setSelection(C===z.start?z.start:z.start-y,z.end-w+(z.end===x+1?1:0));return true}.bind(this));
this.textView.setKeyBinding(new a.KeyBinding(38,false,false,true),d.moveLinesUp);this.textView.setAction(d.moveLinesUp,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start);if(C===0)return true;var k=x.getLineAtOffset(z.end>z.start?z.end-1:z.end),m=x.getLineCount();z=x.getLineStart(C-1);var o=x.getLineStart(C),s=x.getLineEnd(k,true),w=x.getText(o,s),y=0;if(k===m-1){k=x.getLineEnd(C-1);C=x.getLineEnd(C-1,true);w+=x.getText(k,C);o=k;y=C-k}this.startUndo();q.setText("",
o,s);q.setText(w,z,z);q.setSelection(z,z+w.length-y);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,false,false,true),d.moveLinesDown);this.textView.setAction(d.moveLinesDown,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start),k=x.getLineAtOffset(z.end>z.start?z.end-1:z.end),m=x.getLineCount();if(k===m-1)return true;C=x.getLineStart(C);z=x.getLineEnd(k,true);var o=x.getLineEnd(k+1,true)-(z-C),s=0;if(k!==m-2)x=x.getText(C,
z);else{k=x.getLineEnd(k);x=x.getText(k,z)+x.getText(C,k);s+=z-k}this.startUndo();q.setText("",C,z);q.setText(x,o,o);q.setSelection(o+s,o+s+x.length);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(38,true,false,true),d.copyLinesUp);this.textView.setAction(d.copyLinesUp,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start);z=x.getLineAtOffset(z.end>z.start?z.end-1:z.end);C=x.getLineStart(C);var k=x.getLineEnd(z,true),m=x.getLineCount(),
o="";k=x.getText(C,k);if(z===m-1)k+=o=x.getLineDelimiter();q.setText(k,C,C);q.setSelection(C,C+k.length-o.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,true,false,true),d.copyLinesDown);this.textView.setAction(d.copyLinesDown,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start);z=x.getLineAtOffset(z.end>z.start?z.end-1:z.end);var k=x.getLineStart(C);C=x.getLineEnd(z,true);var m=x.getLineCount(),o="";k=x.getText(k,C);if(z===
m-1)k=(o=x.getLineDelimiter())+k;q.setText(k,C,C);q.setSelection(C+o.length,C+k.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("d",true,false,false),d.deleteLines);this.textView.setAction(d.deleteLines,function(){var q=this.editor,x=q.getSelection(),z=q.getModel(),C=z.getLineAtOffset(x.start);x=z.getLineAtOffset(x.end>x.start?x.end-1:x.end);C=z.getLineStart(C);z=z.getLineEnd(x,true);q.setText("",C,z);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("l",
true),d.gotoLine);this.textView.setAction(d.gotoLine,function(){var q=this.editor,x=q.getModel().getLineAtOffset(q.getCaretOffset());if(x=prompt(d.gotoLinePrompty,x+1)){x=parseInt(x,10);q.onGotoLine(x-1,0)}return true}.bind(this));var u=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding("q",!u,false,false,u),d.lastEdit);this.textView.setAction(d.lastEdit,function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return true}.bind(this))},
toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus(d.formatMessage(d.incrementalFind,this._incrementalFindPrefix));this.textView.addEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",
this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},lineUp:function(){if(this._incrementalFindActive){var r=this._incrementalFindPrefix;
if(r.length===0)return false;var u=this.editor,q=u.getModel(),x;x=this._incrementalFindSuccess?u.getCaretOffset()-r.length-1:q.getCharCount()-1;q=q.getText().lastIndexOf(r,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;u.moveSelection(q,q+r.length);this._incrementalFindIgnoreSelection=false;u.reportStatus(d.formatMessage(d.incrementalFind,r))}else{u.reportStatus(d.formatMessage(d.incrementalFindNotFound,r),"error");this._incrementalFindSuccess=false}return true}return false},
lineDown:function(){if(this._incrementalFindActive){var r=this._incrementalFindPrefix;if(r.length===0)return false;var u=this.editor,q=u.getModel(),x=0;if(this._incrementalFindSuccess)x=u.getSelection().start+1;q=q.getText().indexOf(r,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;u.moveSelection(q,q+r.length);this._incrementalFindIgnoreSelection=false;u.reportStatus(d.formatMessage(d.incrementalFind,r))}else{u.reportStatus(d.formatMessage(d.incrementalFindNotFound,
r),"error");this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};t.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function r(q,x,z){var C=q.getLineAtOffset(x),k=q.getLineAtOffset(z),m,o,s,w,y,B;for(m=C;m>=0;m--){o=q.getLine(m);s=m===C?x-q.getLineStart(C):o.length;w=o.lastIndexOf("/*",s);o=o.lastIndexOf("*/",s);if(o>w)break;else if(w!==
-1){y=q.getLineStart(m)+w;break}}for(m=k;m<q.getLineCount();m++){o=q.getLine(m);s=m===k?z-q.getLineStart(k):0;w=o.indexOf("/*",s);o=o.indexOf("*/",s);if(w!==-1&&w<o)break;else if(o!==-1){B=q.getLineStart(m)+o;break}}return{commentStart:y,commentEnd:B}}this.textView.setKeyBinding(new a.KeyBinding(191,true),d.toggleLineComment);this.textView.setAction(d.toggleLineComment,function(){for(var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getLineAtOffset(z.start),k=x.getLineAtOffset(z.end>z.start?
z.end-1:z.end),m=true,o=[],s,w,y=C;y<=k;y++){s=x.getLine(y,true);o.push(s);if(!m||(w=s.indexOf("//"))===-1)m=false;else if(w!==0){var B;for(B=0;B<w;B++){m=s.charCodeAt(B);if(!(m===32||m===9))break}m=B===w}}y=x.getLineStart(C);B=x.getLineEnd(k,true);if(m){for(m=0;m<o.length;m++){s=o[m];w=s.indexOf("//");o[m]=s.substring(0,w)+s.substring(w+2)}o=o.join("");s=x.getLineStart(k);x=y===z.start?z.start:z.start-2;z=z.end-2*(k-C+1)+(z.end===s+1?2:0)}else{o.splice(0,0,"");o=o.join("//");x=y===z.start?z.start:
z.start+2;z=z.end+2*(k-C+1)}q.setText(o,y,B);q.setSelection(x,z);return true}.bind(this));var u=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding(191,true,!u,false,u),d.addBlockComment);this.textView.setAction(d.addBlockComment,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=new RegExp("/\\*|\\*/","g"),k=r(x,z.start,z.end);if(k.commentStart!==undefined&&k.commentEnd!==undefined)return true;x=x.getText(z.start,z.end);if(x.length===0)return true;k=
x.length;x=x.replace(C,"");C=x.length;q.setText("/*"+x+"*/",z.start,z.end);q.setSelection(z.start+2,z.end+2+(C-k));return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(220,true,!u,false,u),d.removeBlockComment);this.textView.setAction(d.removeBlockComment,function(){var q=this.editor,x=q.getModel(),z=q.getSelection(),C=x.getText(z.start,z.end),k,m,o;for(o=0;o<C.length;o++)if(C.substring(o,o+2)==="/*"){k=z.start+o;break}for(;o<C.length;o++)if(C.substring(o,o+2)==="*/"){m=z.start+o;
break}if(k!==undefined&&m!==undefined){q.setText(x.getText(k+2,m),k,m+2);q.setSelection(k,m)}else{C=r(x,z.start,z.end);if(C.commentStart===undefined||C.commentEnd===undefined)return true;x=x.getText(C.commentStart+2,C.commentEnd);q.setText(x,C.commentStart,C.commentEnd+2);q.setSelection(z.start-2,z.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(r){var u=r.data.proposal,q;if(typeof u==="string")q=u;else if(typeof u.proposal==="string")q=u.proposal;this.textView.setText(q,r.data.start,
r.data.end);if(u.positions&&this.linkedMode){r=[];for(q=0;q<u.positions.length;++q)r[q]={positions:[{offset:u.positions[q].offset,length:u.positions[q].length}]};this.linkedMode.enterLinkedMode({groups:r,escapePosition:u.escapePosition})}else u.escapePosition&&this.textView.setCaretOffset(u.escapePosition);return true},cancel:function(){return false},isActive:function(){return true},isStatusActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){var r=
this.editor,u=r.getSelection();if(u.start===u.end){var q=r.getModel(),x=q.getLineAtOffset(u.start),z=q.getLine(x,true),C=q.getLineStart(x);x=0;C=u.start-C;for(var k;x<C&&((k=z.charCodeAt(x))===32||k===9);)x++;if(x>0){var m=z.substring(0,x);for(x=C;x<z.length&&((k=z.charCodeAt(x++))===32||k===9);)u.end++;r.setText(q.getLineDelimiter()+m,u.start,u.end);return true}}return false}};v.prototype={enterLinkedMode:function(r){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=
[];for(var u=0;u<r.groups.length;++u){var q=r.groups[u];this.linkedModePositions[u]={offset:q.positions[0].offset,length:q.positions[0].length}}this.linkedModeEscapePosition=r.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new a.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",
function(){this.linkedModeCurrentPositionIndex=++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-
1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.editor.reportStatus(d.linkedModeEntered)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return true},cancel:function(){if(this.linkedModeActive){this.linkedModeActive=false;this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify);
this.textView.setKeyBinding(new a.KeyBinding(9),"tab");this.textView.setKeyBinding(new a.KeyBinding(9,false,true),null);this.textView.setCaretOffset(this.linkedModeEscapePosition,false);this.editor.reportStatus(d.linkedModeExited)}},selectTextForLinkedModePosition:function(r){this.textView.setSelection(r.offset,r.offset+r.length)}};return{UndoFactory:h,LineNumberRulerFactory:i,FoldingRulerFactory:j,AnnotationFactory:l,TextDNDFactory:n,TextActions:p,SourceCodeActions:t,LinkedMode:v}});
define("orion/breadcrumbs",["require","dojo","orion/util"],function(d,e,a){function b(c){this._init(c)}b.prototype={_init:function(c){var f=c.container;if(typeof f==="string")f=e.byId(f);if(!f)throw"no parent container";this._container=f;e.removeClass(f,"currentLocation");this._id=c.id||"eclipse.breadcrumbs";this._resource=c.resource||null;this._firstSegmentName=c.firstSegmentName;this._makeHref=c.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var c;
if(this._resource&&this._resource.Parents){c=document.createElement("a");if(this._makeHref)this._makeHref(c,"");else c.href=d.toUrl("navigate/table.html")+"#"}else c=document.createElement("span");e.place(document.createTextNode(this._firstSegmentName),c,"only");return c}return null},render:function(){var c=this._container,f=e.byId(this._id);if(f)e.empty(f);else{f=document.createElement("span");f.id=this._id;c.appendChild(f)}var g;if(g=this.getNavigatorRootSegment()){e.addClass(g,"breadcrumb");f.appendChild(g);
if(this._resource&&this._resource.Parents){g=document.createElement("span");e.place(document.createTextNode(" >> "),g,"only");this.path+="/";e.addClass(g,"breadcrumb");f.appendChild(g)}else{g.href="";e.removeClass(g,"breadcrumb");e.addClass(g,"currentLocation");a.forceLayout(c);return}}if(this._resource){if(this._resource.Parents)for(var h=this._resource.Parents,i=h.length;--i>=0;){g=document.createElement("a");e.addClass(g,"breadcrumb");e.place(document.createTextNode(h[i].Name),g,"only");this.path+=
h[i].Name;if(this._makeHref)this._makeHref(g,h[i].ChildrenLocation);else g.href=d.toUrl("navigate/table.html")+"#"+h[i].ChildrenLocation;f.appendChild(g);g=document.createElement("span");e.place(document.createTextNode(" >> "),g,"only");this.path+="/";e.addClass(g,"breadcrumb");f.appendChild(g)}g=document.createElement("span");e.place("<br>"+this._resource.Name,g,"only");e.addClass(g,"currentLocation");this.path+=this._resource.Name;f.appendChild(g)}if(f.childNodes.length===0){g=document.createElement("a");
e.place(document.createTextNode(document.title),g,"only");e.addClass(g,"breadcrumb");e.addClass(g,"currentLocation");f.appendChild(g)}a.forceLayout(c)}};b.prototype.constructor=b;return{BreadCrumbs:b}});
define("orion/compare/gap-model",["orion/textview/eventTarget"],function(d){var e=e||{};e.GapTextModel=function(){function a(b,c,f){this._model=b;this._myIndex=(this._isOriginal=c===undefined?true:c)?1:0;this._reverseIndex=1-this._myIndex;this._map=f;var g=this;this._listener={onChanging:function(h){g.onChanging(h)},onChanged:function(h){g.onChanged(h)}};b.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Changed",this._listener.onChanged);this._init()}navigator.platform.indexOf("Win");
a.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var b=this._gapNumber=0,c=0;c<this._map.length;c++){if(this._map[c][this._myIndex]<this._map[c][this._reverseIndex]){var f=this._map[c][this._reverseIndex]-this._map[c][this._myIndex];this._gapNumber+=f;this._gapBlocks.push([b+this._map[c][this._myIndex],f])}b+=Math.max(this._map[c][this._reverseIndex],this._map[c][this._myIndex])}},lookUpRealIndex:function(b){for(var c=0,f=0;f<this._gapBlocks.length;f++){var g=
this._gapBlocks[f][0],h=this._gapBlocks[f][0]+this._gapBlocks[f][1]-1;if(b<g)break;if(b>=g&&b<=h)return{lineIndex:-1,gapsBefore:c+b-g};c+=this._gapBlocks[f][1]}return{lineIndex:b-c,gapsBefore:c}},getLineType:function(b){for(var c=0,f=0;f<this._map.length;f++){var g=Math.max(this._map[f][this._reverseIndex],this._map[f][this._myIndex]);if(b>=c&&b<c+g){if(this._map[f][2]===0)return"unchnaged";else if(this._map[f][2]<0)return"removed";else if(this._map[f][1]===0)return"added";else if(b<this._map[f][this._myIndex]+
c)return"changed";return"changed_gap"}c+=Math.max(this._map[f][this._reverseIndex],this._map[f][this._myIndex])}return"unchnaged"},getCharCount:function(){var b=this._model.getCharCount();b+=this._gapNumber*this.getLineDelimiter().length;return b},getLine:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return null;b=this.lookUpRealIndex(b);if(b.lineIndex<0){if(c)return this.getLineDelimiter();return""}else return this._model.getLine(b.lineIndex,c)},getLineAtOffset:function(b){if(!(0<=b&&b<=
this.getCharCount()))return-1;for(var c=this.getLineCount(),f=0,g=0;f<c;){var h=this.lookUpRealIndex(f);g+=h.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(h.lineIndex,true).length;f++;if(g>b)break}return f-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;var g=this.lookUpRealIndex(b);f=g.gapsBefore*this.getLineDelimiter().length;
if(g.lineIndex<0){b=b-g.gapsBefore;if(b>0)f+=this._model.getLineEnd(b-1,true);if(c)f+=this.getLineDelimiter().length}else f+=this._model.getLineEnd(g.lineIndex,c);return f},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;var c=this.lookUpRealIndex(b),f=0,g=-1;if(c.lineIndex<0){f=c.gapsBefore;if(b-f>=0)g=b-f-1}else{f=c.gapsBefore;g=c.lineIndex}b=0;b+=this.getLineDelimiter().length*f;if(g>=0)b+=c.lineIndex<0?this._model.getLineEnd(g,true):this._model.getLineStart(g);return b},getText:function(b,
c){return this._model.getText(b,c)},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,c,f){this._model.setText(b,c,f)}};d.EventTarget.addMixin(a.prototype);return a}();return e});
var JsDiff=function(){function d(i){return{newPos:i.newPos,components:i.components.slice(0)}}function e(i){for(var j=[],l=0;l<i.length;l++)i[l]&&j.push(i[l]);return j}function a(i){i=i;i=i.replace(/&/g,"&amp;");i=i.replace(/</g,"&lt;");i=i.replace(/>/g,"&gt;");return i=i.replace(/"/g,"&quot;")}var b=function(i){this.ignoreWhitespace=i};b.prototype={diff:function(i,j){if(j==i)return[{value:j}];if(!j)return[{value:i,removed:true}];if(!i)return[{value:j,added:true}];j=this.tokenize(j);i=this.tokenize(i);
var l=j.length,n=i.length,p=l+n,t=[{newPos:-1,components:[]}],v=this.extractCommon(t[0],j,i,0);if(t[0].newPos+1>=l&&v+1>=n)return t[0].components;for(var r=1;r<=p;r++)for(var u=-1*r;u<=r;u+=2){var q;q=t[u-1];var x=t[u+1];v=(x?x.newPos:0)-u;if(q)t[u-1]=undefined;var z=q&&q.newPos+1<l,C=x&&0<=v&&v<n;if(!z&&!C)t[u]=undefined;else{if(!z||C&&q.newPos<x.newPos){q=d(x);this.pushComponent(q.components,i[v],undefined,true)}else{q=d(q);q.newPos++;this.pushComponent(q.components,j[q.newPos],true,undefined)}v=
this.extractCommon(q,j,i,u);if(q.newPos+1>=l&&v+1>=n)return q.components;else t[u]=q}}},pushComponent:function(i,j,l,n){var p=i[i.length-1];if(p&&p.added===l&&p.removed===n)i[i.length-1]={value:this.join(p.value,j),added:l,removed:n};else i.push({value:j,added:l,removed:n})},extractCommon:function(i,j,l,n){var p=j.length,t=l.length,v=i.newPos;for(n=v-n;v+1<p&&n+1<t&&this.equals(j[v+1],l[n+1]);){v++;n++;this.pushComponent(i.components,j[v],undefined,undefined)}i.newPos=v;return n},equals:function(i,
j){var l=/\S/;return this.ignoreWhitespace&&!l.test(i)&&!l.test(j)?true:i==j},join:function(i,j){return i+j},tokenize:function(i){return i}};var c=new b,f=new b(true);f.tokenize=function(i){return e(i.split(/(\s+|\b)/))};var g=new b(true);g.tokenize=function(i){return e(i.split(/([{}:;,]|\s+)/))};var h=new b;h.tokenize=function(i){return i.split(/^/m)};return{diffChars:function(i,j){return c.diff(i,j)},diffWords:function(i,j){return f.diff(i,j)},diffLines:function(i,j){return h.diff(i,j)},diffCss:function(i,
j){return g.diff(i,j)},createPatch:function(i,j,l,n,p){var t=[];t.push("Index: "+i);t.push("===================================================================");t.push("--- "+i+"\t"+n);t.push("+++ "+i+"\t"+p);i=h.diff(j,l);i.push({value:"",lines:[]});l=j=0;n=[];for(var v=p=1,r=0;r<i.length;r++){var u=i[r],q=u.lines||u.value.replace(/\n$/,"").split("\n");u.lines=q;if(u.added||u.removed){if(!j){var x=i[r-1];j=p;l=v;if(x){n.push.apply(n,x.lines.slice(-4).map(function(z){return" "+z}));j-=4;l-=4}}n.push.apply(n,
q.map(function(z){return(u.added?"+":"-")+z}));if(u.added)v+=q.length;else p+=q.length}else{if(j)if(q.length<=8&&r<i.length-1)n.push.apply(n,q.map(function(z){return" "+z}));else{x=Math.min(q.length,4);t.push("@@ -"+j+","+(p-j+x)+" +"+l+","+(v-l+x)+" @@");t.push.apply(t,n);t.push.apply(t,q.slice(0,x).map(function(z){return" "+z}));l=j=0;n=[]}p+=q.length;v+=q.length}}i.length>1&&!/\n$/.test(i[i.length-2].value)&&t.push("\\ No newline at end of file\n");return t.join("\n")},convertChangesToXML:function(i){for(var j=
[],l=0;l<i.length;l++){var n=i[l];if(n.added)j.push("<ins>");else n.removed&&j.push("<del>");j.push(a(n.value));if(n.added)j.push("</ins>");else n.removed&&j.push("</del>")}return j.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",["require","exports","module"],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(d){var e=e||{};e.JSDiffAdapter=function(){function a(){}a.prototype={adapt:function(b,c){var f=b.split("\n"),g=c.split("\n"),h=f[f.length-1]==="";g=g[g.length-1]==="";var i=d.diffLines(b,c);b=[];c=[];linesRemoved=linesAdded=0;changeIndex=-1;for(var j=0,l=true,n=0;n<i.length;n++){var p=i[n];lines=p.lines||p.value.split("\n");var t=lines.length,v=0;lines.length>1&&lines[lines.length-1]===""&&t--;if(t>1&&!l)if(lines[0]===""){t--;v++}p.lines=
lines;if(!p.added&&!p.removed){if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);linesRemoved=linesAdded=0;changeIndex=-1;j+=linesRemoved}b.push([t,t,0]);j+=t}else if(p.added){if(changeIndex===-1)changeIndex=c.length+1;linesAdded+=t;for(l=v;l<t+v;l++)c.push(p.lines[l])}else linesRemoved+=t;l=false;if(lines.length>1&&lines[lines.length-1]==="")l=true}if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);j+=linesRemoved}if(j<f.length&&f.length>1){f=b[b.length-
1];if(f[2]===0){f[0]+=1;f[1]+=1}else if(f[2]===-1)b.push([1,1,0]);else if(h===g)b.push([1,1,0]);else{if(g)f[0]+=1;if(h)f[1]+=1}}return{mapper:b,changContents:{array:c,index:0}}}};return a}();return e});
define("examples/textview/textStyler",["i18n!orion/textview/nls/messages","orion/textview/annotations"],function(d,e){function a(k,m){this.keywords=k;this.whitespacesVisible=m;this.setText("")}function b(){a.call(this,null,true)}function c(k){a.call(this,null,k)}function f(){a.call(this,null,false)}function g(k,m,o){this.commentStart="/*";this.commentEnd="*/";var s=[];switch(m){case "java":s=i;break;case "js":s=h;break;case "css":s=j;break}this.whitespacesVisible=false;this.detectHyperlinks=true;
this.highlightCaretLine=false;this.detectTasks=this.foldingEnabled=true;this._scanner=new a(s,this.whitespacesVisible);this._firstScanner=new f;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new b;if(m==="css"){this._scanner.isCSS=true;this._firstScanner.isCSS=true}this.view=k;this.annotationModel=o;this._bracketAnnotations=undefined;var w=this;this._listener={onChanged:function(y){w._onModelChanged(y)},onDestroy:function(y){w._onDestroy(y)},onLineStyle:function(y){w._onLineStyle(y)},
onSelection:function(y){w._onSelection(y)}};m=k.getModel();m.getBaseModel?m.getBaseModel().addEventListener("Changed",this._listener.onChanged):k.addEventListener("ModelChanged",this._listener.onChanged);k.addEventListener("Selection",this._listener.onSelection);k.addEventListener("Destroy",this._listener.onDestroy);k.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();k.redrawLines()}var h=["break","case","class","catch","continue","const","debugger",
"default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],i=["abstract","boolean","break","byte","case","catch","char","class","continue","default","do","double","else","extends","false","final","finally","float","for","if","implements",
"import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"],j=["alignment-adjust","alignment-baseline","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility",
"background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat",
"border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group",
"box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust",
"drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex-align","flex-flow","flex-inline-pack","flex-order","flex-pack","float","float-offset","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","grid-columns","grid-rows","hanging-punctuation","height","hyphenate-after","hyphenate-before","hyphenate-character","hyphenate-lines","hyphenate-resource","hyphens","icon","image-orientation",
"image-rendering","image-resolution","inline-box-align","left","letter-spacing","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","mark","mark-after","mark-before","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height",
"min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","phonemes","pitch","pitch-range","play-during","position",
"presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-emphasis","text-height","text-indent","text-justify","text-outline",
"text-shadow","text-transform","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-pitch-range","voice-rate","voice-stress","voice-volume","volume","white-space","white-space-collapse","widows","width","word-break","word-spacing","word-wrap","z-index"],l={styleClass:"token_singleline_comment"},
n={styleClass:"token_multiline_comment"},p={styleClass:"token_doc_comment"},t={styleClass:"token_doc_html_markup"},v={styleClass:"token_task_tag"},r={styleClass:"token_doc_tag"},u={styleClass:"token_string"},q={styleClass:"token_keyword"},x={styleClass:"token_space"},z={styleClass:"token_tab"},C={styleClass:"line_caret"};a.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},
getDataLength:function(){return this.offset-this.startOffset},_default:function(k){var m=this.keywords;switch(k){case 32:case 9:if(this.whitespacesVisible)return k===32?9:8;do k=this._read();while(k===32||k===9);this._unread(k);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return k;default:var o=this.isCSS;if(97<=k&&k<=122||65<=k&&k<=90||k===95||48<=k&&k<=57||45===k&&o){var s=this.offset-1;do k=this._read();while(97<=k&&k<=122||65<=k&&k<=90||k===95||48<=k&&k<=57||45===
k&&o);this._unread(k);if(m.length>0){k=this.text.substring(s,this.offset);for(o=0;o<m.length;o++)if(this.keywords[o]===k)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(k){k!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var k=this._read();switch(k){case -1:return null;case 47:k=this._read();if(!this.isCSS)if(k===47)for(;;){k=this._read();if(k===-1||k===10||k===13){this._unread(k);
return 4}}if(k===42){k=this._read();var m=5;if(k===42)m=6;for(;;){for(;k===42;){k=this._read();if(k===47)return m}if(k===-1){this._unread(k);return m}k=this._read()}}this._unread(k);return 1;case 39:for(;;){k=this._read();switch(k){case 39:return 3;case 13:case 10:case -1:this._unread(k);return 3;case 92:this._read();break}}break;case 34:for(;;){k=this._read();switch(k){case 34:return 3;case 13:case 10:case -1:this._unread(k);return 3;case 92:this._read();break}}break;default:return this._default(k)}}},
setText:function(k){this.text=k;this.startOffset=this.offset=0}};b.prototype=new a(null);b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var k=this._read();switch(k){case -1:return null;case 32:return 9;case 9:return 8;default:do k=this._read();while(!(k===32||k===9||k===-1));this._unread(k);return 1}}};c.prototype=new a(null);c.prototype.setType=function(k){this._type=k};c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var k=this._read();switch(k){case -1:return null;
case 32:case 9:if(this.whitespacesVisible)return k===32?9:8;do k=this._read();while(k===32||k===9);this._unread(k);return 7;case 60:if(this._type===6){do k=this._read();while(!(k===62||k===-1));if(k===62)return 10}return 1;case 64:if(this._type===6){do k=this._read();while(97<=k&&k<=122||65<=k&&k<=90||k===95||48<=k&&k<=57);this._unread(k);return 11}return 1;case 84:if((k=this._read())===79)if((k=this._read())===68)if((k=this._read())===79){k=this._read();if(!(97<=k&&k<=122||65<=k&&k<=90||k===95||
48<=k&&k<=57)){this._unread(k);return 12}}this._unread(k);default:do k=this._read();while(!(k===32||k===9||k===-1||k===60||k===64||k===84));this._unread(k);return 1}}};f.prototype=new a(null);f.prototype._default=function(k){for(;;){k=this._read();switch(k){case 47:case 34:case 39:case -1:this._unread(k);return 1}}};g.prototype={getClassNameForToken:function(k){switch(k){case "singleLineComment":return l.styleClass;case "multiLineComment":return n.styleClass;case "docComment":return p.styleClass;
case "docHtmlComment":return t.styleClass;case "tasktag":return v.styleClass;case "doctag":return r.styleClass;case "string":return u.styleClass;case "keyword":return q.styleClass;case "space":return x.styleClass;case "tab":return z.styleClass;case "caretLine":return C.styleClass}return null},destroy:function(){var k=this.view;if(k){var m=k.getModel();m.getBaseModel?m.getBaseModel().removeEventListener("Changed",this._listener.onChanged):k.removeEventListener("ModelChanged",this._listener.onChanged);
k.removeEventListener("Selection",this._listener.onSelection);k.removeEventListener("Destroy",this._listener.onDestroy);k.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(k){this.highlightCaretLine=k},setWhitespacesVisible:function(k){this.whitespacesVisible=k;this._scanner.whitespacesVisible=k;this._commentScanner.whitespacesVisible=k},setDetectHyperlinks:function(k){this.detectHyperlinks=k},setFoldingEnabled:function(k){this.foldingEnabled=
k},setDetectTasks:function(k){this.detectTasks=k},_binarySearch:function(k,m,o,s,w){var y;if(s===undefined)s=-1;if(w===undefined)w=k.length;for(;w-s>1;){y=Math.floor((w+s)/2);if(m<=k[y].start)w=y;else if(o&&m<k[y].end){w=y;break}else s=y}return w},_computeComments:function(){var k=this.view.getModel();if(k.getBaseModel)k=k.getBaseModel();this.comments=this._findComments(k.getText())},_computeFolding:function(){if(this.foldingEnabled){var k=this.view.getModel();if(k.getBaseModel){var m=this.annotationModel;
if(m){m.removeAnnotations("orion.annotation.folding");for(var o=[],s=k.getBaseModel(),w=this.comments,y=0;y<w.length;y++){var B=w[y];(B=this._createFoldingAnnotation(k,s,B.start,B.end))&&o.push(B)}m.replaceAnnotations(null,o)}}}},_createFoldingAnnotation:function(k,m,o,s){var w=m.getLineAtOffset(o);m=m.getLineAtOffset(s);if(w===m)return null;return new e.FoldingAnnotation(k,"orion.annotation.folding",o,s,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",
{styleClass:"annotation collapsed"})},_computeTasks:function(k,m,o){if(this.detectTasks){var s=this.annotationModel;if(s){var w=this.view.getModel(),y=w;if(w.getBaseModel)y=w.getBaseModel();var B=s.getAnnotations(m,o);for(w=[];B.hasNext();){var A=B.next();A.type==="orion.annotation.task"&&w.push(A)}B=[];A=this._commentScanner;A.setText(y.getText(m,o));for(var E;E=A.nextToken();){var G=A.getStartOffset()+m;if(E===12){E=y.getLineEnd(y.getLineAtOffset(G));if(k!==4)E=Math.min(E,o-this.commentEnd.length);
B.push({start:G,end:E,type:"orion.annotation.task",title:y.getText(G,E),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"},rangeStyle:{styleClass:"annotationRange task"}})}}s.replaceAnnotations(w,B)}}},_getLineStyle:function(k){if(this.highlightCaretLine){var m=this.view,o=m.getModel();m=m.getSelection();if(m.start===m.end&&o.getLineAtOffset(m.start)===k)return C}return null},_getStyles:function(k,m,o){if(k.getBaseModel)o=
k.mapOffset(o);for(var s=o+m.length,w=[],y=o,B=this.comments,A=this._binarySearch(B,o,true);A<B.length;A++){if(B[A].start>=s)break;var E=B[A].start,G=B[A].end;y<E&&this._parse(m.substring(y-o,E-o),y,w);var M=B[A].type===6?p:n;if(this.whitespacesVisible||this.detectHyperlinks){y=Math.max(y,E);E=Math.min(s,G);this._parseComment(m.substring(y-o,E-o),y,w,M,B[A].type)}else w.push({start:E,end:G,style:M});y=G}y<s&&this._parse(m.substring(y-o,s-o),y,w);if(k.getBaseModel)for(m=0;m<w.length;m++){o=w[m].end-
w[m].start;w[m].start=k.mapOffset(w[m].start,true);w[m].end=w[m].start+o}return w},_parse:function(k,m,o){var s=this._scanner;for(s.setText(k);k=s.nextToken();){var w=s.getStartOffset()+m,y=null;switch(k){case 2:y=q;break;case 3:if(this.whitespacesVisible){this._parseString(s.getData(),w,o,u);continue}else y=u;break;case 6:this._parseComment(s.getData(),w,o,p,k);continue;case 4:this._parseComment(s.getData(),w,o,l,k);continue;case 5:this._parseComment(s.getData(),w,o,n,k);continue;case 8:if(this.whitespacesVisible)y=
z;break;case 9:if(this.whitespacesVisible)y=x;break}o.push({start:w,end:s.getOffset()+m,style:y})}},_parseComment:function(k,m,o,s,w){var y=this._commentScanner;y.setText(k);for(y.setType(w);k=y.nextToken();){w=y.getStartOffset()+m;var B=s;switch(k){case 8:if(this.whitespacesVisible)B=z;break;case 9:if(this.whitespacesVisible)B=x;break;case 10:B=t;break;case 11:B=r;break;case 12:B=v;break;default:if(this.detectHyperlinks)B=this._detectHyperlinks(y.getData(),w,o,B)}B&&o.push({start:w,end:y.getOffset()+
m,style:B})}},_parseString:function(k,m,o,s){var w=this._whitespaceScanner;for(w.setText(k);k=w.nextToken();){var y=w.getStartOffset()+m,B=s;switch(k){case 8:if(this.whitespacesVisible)B=z;break;case 9:if(this.whitespacesVisible)B=x;break}B&&o.push({start:y,end:w.getOffset()+m,style:B})}},_detectHyperlinks:function(k,m,o,s){var w=null,y;if((y=k.indexOf("://"))>0){w=k;for(var B=y;B>0;){y=w.charCodeAt(B-1);if(!(97<=y&&y<=122||65<=y&&y<=90||45===y||48<=y&&y<=57))break;B--}if(B>0){y="\"\"''(){}[]<>".indexOf(w.substring(B-
1,B));if(y!==-1&&(y&1)===0&&(y=w.lastIndexOf("\"\"''(){}[]<>".substring(y+1,y+2)))!==-1){var A=y;y=this._clone(s);y.tagName="A";y.attributes={href:w.substring(B,A)};o.push({start:m,end:m+B,style:s});o.push({start:m+B,end:m+A,style:y});o.push({start:m+A,end:m+k.length,style:s});return null}}}else if(k.toLowerCase().indexOf("bug#")===0)w="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(k.substring(4),10);if(w){y=this._clone(s);y.tagName="A";y.attributes={href:w};return y}return s},_clone:function(k){if(!k)return k;
var m={};for(var o in k)if(k.hasOwnProperty(o))m[o]=k[o];return m},_findComments:function(k,m){m=m||0;var o=this._firstScanner;o.setText(k);for(var s=[];k=o.nextToken();){if(k===5||k===6){var w={start:o.getStartOffset()+m,end:o.getOffset()+m,type:k};s.push(w);this._computeTasks(k,o.getStartOffset()+m,o.getOffset()+m)}k===4&&this._computeTasks(k,o.getStartOffset()+m,o.getOffset()+m)}return s},_findMatchingBracket:function(k,m){var o="{}()[]<>",s=k.getText(m,m+1),w=o.indexOf(s,0);if(w===-1)return-1;
var y;y=w&1?o.substring(w-1,w):o.substring(w+1,w+2);var B=k.getLineAtOffset(m);o=k.getLine(B);var A=k.getLineStart(B),E=k.getLineEnd(B);o=this._findBrackets(s,y,o,A,A,E);for(E=0;E<o.length;E++){A=o[E]>=0?1:-1;if(o[E]*A===m){m=1;if(w&1){for(E--;E>=0;E--){A=o[E]>=0?1:-1;m+=A;if(m===0)return o[E]*A}for(B-=1;B>=0;){o=k.getLine(B);A=k.getLineStart(B);E=k.getLineEnd(B);o=this._findBrackets(s,y,o,A,A,E);for(w=o.length-1;w>=0;w--){A=o[w]>=0?1:-1;m+=A;if(m===0)return o[w]*A}B--}}else{for(E++;E<o.length;E++){A=
o[E]>=0?1:-1;m+=A;if(m===0)return o[E]*A}B+=1;for(w=k.getLineCount();B<w;){o=k.getLine(B);A=k.getLineStart(B);E=k.getLineEnd(B);o=this._findBrackets(s,y,o,A,A,E);for(E=0;E<o.length;E++){A=o[E]>=0?1:-1;m+=A;if(m===0)return o[E]*A}B++}}break}}return-1},_findBrackets:function(k,m,o,s,w,y){var B=[];k=k.charCodeAt(0);m=m.charCodeAt(0);for(var A=w,E=this._scanner,G,M=this.comments,H=this._binarySearch(M,w,true);H<M.length;H++){if(M[H].start>=y)break;G=M[H].start;var N=M[H].end;if(A<G)for(E.setText(o.substring(A-
w,G-w));G=E.nextToken();)if(G===k)B.push(E.getStartOffset()+A-w+s);else G===m&&B.push(-(E.getStartOffset()+A-w+s));A=N}if(A<y)for(E.setText(o.substring(A-w,y-w));G=E.nextToken();)if(G===k)B.push(E.getStartOffset()+A-w+s);else G===m&&B.push(-(E.getStartOffset()+A-w+s));return B},_onDestroy:function(){this.destroy()},_onLineStyle:function(k){if(k.textView===this.view)k.style=this._getLineStyle(k.lineIndex);k.ranges=this._getStyles(k.textView.getModel(),k.lineText,k.lineStart)},_onSelection:function(k){var m=
k.oldValue,o=k.newValue,s=this.view;k=s.getModel();var w;if(this.highlightCaretLine){var y=k.getLineAtOffset(m.start);w=k.getLineAtOffset(o.start);var B=o.start===o.end;m=m.start===m.end;if(!(y===w&&m&&B)){m&&s.redrawLines(y,y+1);if((y!==w||!m)&&B)s.redrawLines(w,w+1)}}if(this.annotationModel){m=this._bracketAnnotations;var A,E;if(o.start===o.end&&(E=s.getCaretOffset())>0){E=E-1;if(k.getBaseModel){E=k.mapOffset(E);k=k.getBaseModel()}k=this._findMatchingBracket(k,E);if(k!==-1)A=[{start:k,end:k+1,type:"orion.annotation.matchingBracket",
title:d.matchingBracket,html:"<div class='annotationHTML matchingBracket'></div>",overviewStyle:{styleClass:"annotationOverview matchingBracket"},rangeStyle:{styleClass:"annotationRange matchingBracket"}},{start:E,end:E+1,type:"orion.annotation.currentBracket",title:d.currentBracket,html:"<div class='annotationHTML currentBracket'></div>",overviewStyle:{styleClass:"annotationOverview currentBracket"},rangeStyle:{styleClass:"annotationRange currentBracket"}}]}this._bracketAnnotations=A;this.annotationModel.replaceAnnotations(m,
A)}},_onModelChanged:function(k){var m=k.start,o=k.removedCharCount,s=k.addedCharCount-o,w=this.view;k=w.getModel();var y=k.getBaseModel?k.getBaseModel():k;o=m+o;var B=y.getCharCount(),A=this.comments.length,E=y.getLineStart(y.getLineAtOffset(m)),G=this._binarySearch(this.comments,E,true),M=this._binarySearch(this.comments,o,false,G-1,A);if(G<A&&this.comments[G].start<=E&&E<this.comments[G].end){E=this.comments[G].start;if(E>m)E+=s}else E=G===A&&A>0&&B-s===this.comments[A-1].end?this.comments[A-1].start:
E;var H;if(M<A){H=this.comments[M].end;if(H>m)H+=s;M+=1}else{M=A;H=B}var N;B=this._findComments(y.getText(E,H),E);for(A=G;A<this.comments.length;A++){N=this.comments[A];if(N.start>m)N.start+=s;if(N.start>m)N.end+=s}var L=M-G!==B.length;if(!L)for(A=0;A<B.length;A++){N=this.comments[G+A];var P=B[A];if(N.start!==P.start||N.end!==P.end||N.type!==P.type){L=true;break}}A=[G,M-G].concat(B);Array.prototype.splice.apply(this.comments,A);if(L){A=E;N=H;if(k!==y){A=k.mapOffset(A,true);N=k.mapOffset(N,true)}w.redrawRange(A,
N)}if(this.foldingEnabled&&y!==k&&this.annotationModel){w=this.annotationModel;G=w.getAnnotations(E,H);E=[];for(H=[];G.hasNext();){N=G.next();if(N.type==="orion.annotation.folding"){H.push(N);for(A=0;A<B.length;A++)if(N.start===B[A].start&&N.end===B[A].end)break;if(A===B.length){E.push(N);N.expand()}else{A=N.start;M=N.end;if(A>m)A-=s;if(M>m)M-=s;if(A<=m&&m<M&&A<=o&&o<M){A=y.getLineAtOffset(N.start);M=y.getLineAtOffset(N.end);if(A!==M){if(!N.expanded){N.expand();w.modifyAnnotation(N)}}else w.removeAnnotation(N)}}}}m=
[];for(A=0;A<B.length;A++){N=B[A];for(s=0;s<H.length;s++)if(H[s].start===N.start&&H[s].end===N.end)break;if(s===H.length)(N=this._createFoldingAnnotation(k,y,N.start,N.end))&&m.push(N)}w.replaceAnnotations(E,m)}}};return{TextStyler:g}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(d){function e(b,c,f){this.initialize(b);this.grammar=this.copy(c);this.externalGrammars=f?this.copy(f):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var a={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function c(j,
l){throw new Error('Unsupported regex feature "'+j+'": "'+l[0]+'" at index: '+l.index+" in "+l.input);}function f(j){for(var l="",n=false,p=j.length,t=0;t<p;){var v=j[t];if(!n&&v==="#")for(;t<p&&v!=="\r"&&v!=="\n";)v=j[++t];else if(!n&&/\s/.test(v))for(;t<p&&/\s/.test(v);)v=j[++t];else{if(v==="\\"){l+=v;if(!/\s/.test(j[t+1])){l+=j[t+1];t+=1}}else{if(v==="[")n=true;else if(v==="]")n=false;l+=v}t+=1}}return l}var g="",h;b=a.processGlobalFlag("x",b,function(j){return f(j)});b=a.processGlobalFlag("i",
b,function(j){g+="i";return j});for(h=0;h<this.unsupported.length;h++){var i;if(i=this.unsupported[h].regex.exec(b))c(this.unsupported[h].func(i),i)}return new RegExp(b,g)},processGlobalFlag:function(b,c,f){function g(i,j){var l=0,n=i.length,p=-1;for(j=j;j<n&&p===-1;j++)switch(i[j]){case "\\":j++;break;case "(":l++;break;case ")":l--;if(l===0)p=j;break}return p}var h="(?"+b+")";b="(?"+b+":";if(c.substring(0,h.length)===h)return f(c.substring(h.length));else if(c.substring(0,b.length)===b){h=g(c,0);
if(h<c.length-1)throw new Error("Only a "+b+") group that encloses the entire regex is supported in: "+c);return f(c.substring(b.length,h))}return c},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,c,f){f=typeof f==="undefined"?true:false;b=b.source.split(/(\\\d+)/g);for(var g=[],h=0;h<b.length;h++){var i=b[h],j=/\\(\d+)/.exec(i);if(j){i=c[j[1]]||"";g.push(f?d.escape(i):i)}else g.push(i)}return new RegExp(g.join(""))},groupify:function(b,c){var f=b.source,
g=f.length,h=[],i=0,j=[],l=1,n=1,p=[];b={};for(var t={},v=0;v<g;v++){var r=h[h.length-1],u=f[v];switch(u){case "(":if(r===4){h.pop();p.push(")");j[j.length-1].end=v}var q=v+2<g?f[v+1]+""+f[v+2]:null;if(q==="?:"||q==="?="||q==="?!"){var x;if(q==="?:")x=1;else{x=3;i++}h.push(x);j.push({start:v,end:-1,type:x});p.push(u);p.push(q);v+=q.length}else{h.push(2);j.push({start:v,end:-1,type:2,oldNum:l,num:n});p.push(u);if(i===0)t[n]=null;b[l]=n;l++;n++}break;case ")":r=h.pop();r===3&&i--;j[j.length-1].end=
v;p.push(u);break;case "*":case "+":case "?":case "}":var z=u,C=f[v-1];q=v-1;if(u==="}"){for(x=v-1;f[x]!=="{"&&x>=0;x--);C=f[x-1];q=x-1;z=f.substring(x,v+1)}x=j[j.length-1];if(C===")"&&(x.type===2||x.type===4)){p.splice(x.start,0,"(");p.push(z);p.push(")");u={start:x.start,end:p.length-1,type:4,num:x.num};for(C=0;C<j.length;C++){r=j[C];if(r.type===2||r.type===4)if(r.start>=x.start&&r.end<=q){r.start+=1;r.end+=1;r.num+=1;if(r.type===2)b[r.oldNum]=r.num}}j.push(u);n++;break}default:if(u!=="|"&&r!==
2&&r!==4)if(i===0){h.push(4);j.push({start:v,end:-1,type:4,num:n});p.push("(");t[n]=null;n++}p.push(u);if(u==="\\"){p.push(f[v+1]);v+=1}break}}for(;h.length;){h.pop();p.push(")")}f=new RegExp(p.join(""));g={};c=c||b;for(var k in c)if(c.hasOwnProperty(k))g[k]="\\"+c[k];f=this.getSubstitutedRegex(f,g,false);return[f,b,t]},complexCaptures:function(b){if(!b)return false;for(var c in b)if(b.hasOwnProperty(c))if(c!=="0")return true;return false}};e.prototype={initialize:function(b){this.textView=b;var c=
this;this._listener={onModelChanged:function(f){c.onModelChanged(f)},onDestroy:function(f){c.onDestroy(f)},onLineStyle:function(f){c.onLineStyle(f)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);b.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged);this.textView.removeEventListener("Destroy",
this._listener.onDestroy);this.textView.removeEventListener("LineStyle",this._listener.onLineStyle);this.textView=null}this._listener=this._tree=this._styles=this.grammar=null},copy:function(b){return JSON.parse(JSON.stringify(b))},preprocess:function(b){for(b=[b];b.length!==0;){var c=b.pop();if(!(c._resolvedRule&&c._typedRule)){c._resolvedRule=this._resolve(c);c._typedRule=this._createTypedRule(c);this.addStyles(c.name);this.addStyles(c.contentName);this.addStylesForCaptures(c.captures);this.addStylesForCaptures(c.beginCaptures);
this.addStylesForCaptures(c.endCaptures);c._resolvedRule!==c&&b.push(c._resolvedRule);if(c.patterns)for(var f=0;f<c.patterns.length;f++)b.push(c.patterns[f])}}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var c=b.split("."),f=0;f<c.length;f++)this._styles[b].push(c.slice(0,f+1).join("-"))}},addStylesForCaptures:function(b){for(var c in b)b.hasOwnProperty(c)&&this.addStyles(b[c].name)},ContainerRule:function(){function b(c){this.rule=c;this.subrules=c.patterns}b.prototype.valueOf=
function(){return"aa"};return b}(),BeginEndRule:function(){function b(c){this.rule=c;this.beginRegex=a.toRegExp(c.begin);this.endRegex=a.toRegExp(c.end);this.subrules=c.patterns||[];this.endRegexHasBackRef=a.hasBackReference(this.endRegex);var f=a.complexCaptures(c.captures);c=a.complexCaptures(c.beginCaptures)||a.complexCaptures(c.endCaptures);if(this.isComplex=f||c){f=a.groupify(this.beginRegex);this.beginRegex=f[0];this.beginOld2New=f[1];this.beginConsuming=f[2];f=a.groupify(this.endRegex,this.beginOld2New);
this.endRegex=f[0];this.endOld2New=f[1];this.endConsuming=f[2]}}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(c){this.rule=c;this.matchRegex=a.toRegExp(c.match);if(this.isComplex=a.complexCaptures(c.captures)){c=a.groupify(this.matchRegex);this.matchRegex=c[0];this.matchOld2New=c[1];this.matchConsuming=c[2]}}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?
new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var c=b;if(b.include){if(b.begin||b.end||b.match)throw new Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if(b[0]==="#"){c=this.grammar.repository&&this.grammar.repository[b.substring(1)];if(!c)throw new Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")c=this.grammar;else if(b==="$base")throw new Error('Include "$base" is not supported');else{c=this._allGrammars[b];
if(!c)for(var f=0;f<this.externalGrammars.length;f++){var g=this.externalGrammars[f];if(g.scopeName===b){this.preprocess(g);c=this._allGrammars[b]=g;break}}}}return c},ContainerNode:function(){function b(c,f){this.parent=c;this.rule=f;this.children=[];this.end=this.start=null}b.prototype.addChild=function(c){this.children.push(c)};b.prototype.valueOf=function(){var c=this.rule;return"ContainerNode { "+(c.include||"")+" "+(c.name||"")+(c.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(c,
f,g){this.parent=c;this.rule=f;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=f.endRegexHasBackRef?a.getSubstitutedRegex(f.endRegex,g):null}b.prototype.addChild=function(c){this.children.push(c)};b.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};b.prototype.setStart=function(c){this.start=c.index;this.beginMatch=c};b.prototype.setEnd=function(c){if(c&&typeof c==="object"){this.endMatch=c;this.end=c.index+c[0].length}else{this.endMatch=
null;this.end=c}};b.prototype.shiftStart=function(c){this.start+=c;this.beginMatch.index+=c};b.prototype.shiftEnd=function(c){this.end+=c;if(this.endMatch)this.endMatch.index+=c};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return b}(),push:function(b,c){if(c)for(var f=c.length;f>0;)b.push(c[--f])},exec:function(b,c,f){if(c=b.exec(c))c.index+=f;b.lastIndex=0;return c},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,
c,f){if(b instanceof this.BeginEndNode){var g=b.rule;b=b.endRegexSubstituted||g.endRegex;if(!b)return null;return this.exec(b,c,f)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,false,0)},onModelChanged:function(b){var c=b.addedCharCount,f=b.removedCharCount;b=b.start;if(this._tree){var g=this.textView.getModel(),h=g.getCharCount();g=g.getLineEnd(g.getLineAtOffset(b)-1);var i=this.getFirstDamaged(g,
g);g=g===-1?0:g;c=i?this.parse(i,true,g,b,c,f):h;this.textView.redrawRange(g,c)}else this.initialParse()},getFirstDamaged:function(b,c){if(b<0)return this._tree;for(var f=[this._tree],g=null;f.length;){var h=f.pop();if(!h.parent||this.isDamaged(h,b,c)){if(h instanceof this.BeginEndNode)g=h;for(var i=0;i<h.children.length;i++)f.push(h.children[i])}}return g||this._tree},isDamaged:function(b,c,f){return b.start<=f&&b.end>c},parse:function(b,c,f,g,h,i){var j=this.textView.getModel(),l=j.getLineStart(j.getLineCount()-
1),n=j.getCharCount(),p=this.getInitialExpected(b,f),t=-1;if(c){b.repaired=true;b.endNeedsUpdate=true;t=b.children[b.children.length-1];var v=h-i;t=t?j.getLineEnd(j.getLineAtOffset(t.end+v)):-1;g=j.getLineEnd(j.getLineAtOffset(g+i));t=Math.max(t,g)}t=t===-1?n:t;g=p;var r=b;v=false;for(var u=f,q=-1;r&&(!c||u<t);){var x=this.getNextMatch(j,r,u);x||(u=u>=l?n:j.getLineStart(j.getLineAtOffset(u)+1));var z=x&&x.match,C=x&&x.rule,k=x&&x.isEnd;if(x&&x.isSub){u=this.afterMatch(z);if(C instanceof this.BeginEndRule){v=
true;if(c&&C===g.rule&&r===g.parent){r=g;r.setStart(z);r.repaired=true;r.endNeedsUpdate=true;r=r;g=this.getNextExpected(g,"begin")}else{if(c){this.prune(r,g);c=false}z=new this.BeginEndNode(r,C,z);r.addChild(z);r=z}}}else if(k||u===n){if(r instanceof this.BeginEndNode)if(z){v=true;q=Math.max(q,r.end);r.setEnd(z);u=this.afterMatch(z);if(c&&r===g&&r.parent===g.parent){r.repaired=true;delete r.endNeedsUpdate;g=this.getNextExpected(g,"end")}else if(c){this.prune(r,g);c=false}}else{r.setEnd(n);delete r.endNeedsUpdate}r=
r.parent}if(c&&u>=t&&!v){this.prune(b,p);c=false}}this.removeUnrepairedChildren(b,c,f);this.cleanup(c,b,f,t,n,h,i);return c?Math.max(q,u):u},removeUnrepairedChildren:function(b,c,f){if(c){c=b.children;for(var g=-1,h=0;h<c.length;h++){var i=c[h];if(!i.repaired&&this.isDamaged(i,f,Number.MAX_VALUE)){g=h;break}}if(g!==-1)b.children.length=g}},cleanup:function(b,c,f,g,h,i,j){if(b){b=i-j;h=this.getIntersecting(g-b+1,h);c=this.getIntersecting(f,g);for(f=0;f<h.length;f++){g=h[f];if(!g.repaired&&g instanceof
this.BeginEndNode){g.shiftEnd(b);g.shiftStart(b)}}for(f=0;f<c.length;f++){g=c[f];g.repaired&&g.endNeedsUpdate&&g.shiftEnd(b);delete g.endNeedsUpdate;delete g.repaired}}else{c=this.getIntersecting(f,g);for(f=0;f<c.length;f++)delete c[f].repaired}},getNextMatch:function(b,c,f,g){var h=b.getLineAtOffset(f);h=b.getLineEnd(h);var i=b.getText(f,h),j=[],l=[];b=[];h=[];for(this.push(j,c.rule.subrules);j.length;){var n=j.length?j.pop():null;n=n&&n._resolvedRule._typedRule;if(n instanceof this.ContainerRule&&
l.indexOf(n)===-1){l.push(n);this.push(j,n.subrules)}else if(!(n&&g&&!n.matchRegex)){var p=n&&this.exec(n.matchRegex||n.beginRegex,i,f);if(p){b.push(p);h.push(n)}}}j=Number.MAX_VALUE;l=-1;for(n=0;n<b.length;n++){p=b[n];if(p.index<j){j=p.index;l=n}}if(!g)if(f=this.getEndMatch(c,i,f)){g=c.rule.applyEndPatternLast;if(l===-1||f.index<j||!g&&f.index===j)return{isEnd:true,rule:c.rule,match:f}}return l===-1?null:{isSub:true,rule:h[l],match:b[l]}},getInitialExpected:function(b,c){var f,g;if(b===this._tree)for(f=
0;f<b.children.length;f++){g=b.children[f];if(g.start>=c)return g}else if(b instanceof this.BeginEndNode)if(b.endMatch){var h=b.endMatch.index;for(f=0;f<b.children.length;f++){g=b.children[f];if(g.start>=c)break}if(g&&g.start<h)return g}return b},getNextExpected:function(b,c){if(c==="begin")return(c=b.children[0])?c:b;else if(c==="end")if(c=b.parent)return(b=c.children[c.children.indexOf(b)+1])?b:c;return null},prune:function(b,c){if(c.parent===b)b.children.length=c.getIndexInParent();else if(b instanceof
this.BeginEndNode){b.endMatch=null;b.end=null}if(b.parent)b.parent.children.length=b.getIndexInParent()+1},onLineStyle:function(b){function c(j,l){return j.start-l.start}this._tree||this.initialParse();var f=b.lineStart,g=this.textView.getModel(),h=g.getLineEnd(b.lineIndex),i=g.getLineEnd(g.getLineAtOffset(f)-1);i=this.getFirstDamaged(i,i);f=this.getLineScope(g,i,f,h);b.ranges=this.toStyleRanges(f);b.ranges.sort(c)},getLineScope:function(b,c,f,g){for(var h=f,i=this.getInitialExpected(c,f),j=[],l=
[];c&&h<g;){var n=this.getNextMatch(b,c,h);if(!n)break;var p=n&&n.match,t=n&&n.rule,v=n&&n.isSub;n=n&&n.isEnd;p.index!==h&&l.push({start:h,end:p.index,node:c});if(v){h=this.afterMatch(p);if(t instanceof this.BeginEndRule){this.addBeginScope(j,p,t);c=i;i=this.getNextExpected(i,"begin")}else this.addMatchScope(j,p,t)}else if(n){h=this.afterMatch(p);this.addEndScope(j,p,t);i=this.getNextExpected(i,"end");c=c.parent}}h<g&&l.push({start:h,end:g,node:c});b=this.getInheritedLineScope(l,f,g);return j.concat(b)},
getInheritedLineScope:function(b){for(var c=[],f=0;f<b.length;f++)for(var g=b[f],h=g.node;h;){var i=h.rule.rule,j=i.name;if(i=i.contentName||j){this.addScopeRange(c,g.start,g.end,i);break}h=h.parent}return c},addBeginScope:function(b,c,f){var g=f.rule;this.addCapturesScope(b,c,g.beginCaptures||g.captures,f.isComplex,f.beginOld2New,f.beginConsuming)},addEndScope:function(b,c,f){var g=f.rule;this.addCapturesScope(b,c,g.endCaptures||g.captures,f.isComplex,f.endOld2New,f.endConsuming)},addMatchScope:function(b,
c,f){var g=f.rule,h=g.name;(g=g.captures)?this.addCapturesScope(b,c,g,f.isComplex,f.matchOld2New,f.matchConsuming):this.addScope(b,c,h)},addScope:function(b,c,f){f&&b.push({start:c.index,end:this.afterMatch(c),scope:f})},addScopeRange:function(b,c,f,g){g&&b.push({start:c,end:f,scope:g})},addCapturesScope:function(b,c,f,g,h,i){if(f)if(g){g={1:0};for(var j=0,l=1;c[l]!==undefined;l++){if(i[l]!==undefined)j+=c[l].length;if(c[l+1]!==undefined)g[l+1]=j}i=c.index;for(j=1;f[j];j++){l=f[j].name;var n=h[j],
p=i+g[n];typeof c[n]!=="undefined"&&this.addScopeRange(b,p,p+c[n].length,l)}}else this.addScope(b,c,f[0]&&f[0].name)},getIntersecting:function(b,c){for(var f=[],g=this._tree?[this._tree]:[];g.length;){var h=g.pop(),i=false;if(h instanceof this.ContainerNode)i=true;else if(this.isDamaged(h,b,c)){i=true;f.push(h)}if(i){i=h.children.length;for(var j=0;j<i;j++)g.push(h.children[j])}}return f.reverse()},toStyleRanges:function(b){for(var c=[],f=0;f<b.length;f++){var g=b[f],h=this._styles[g.scope];if(!h)throw new Error("styles not found for "+
g.scope);h=h.join(" ");c.push({start:g.start,end:g.end,style:{styleClass:h}})}return c}};return{RegexUtil:a,TextMateStyler:e}});
define("orion/editor/asyncStyler",["i18n!orion/editor/nls/messages"],function(d){function e(b){return b.getName()==="orion.edit.highlighter"&&b.getProperty("type")==="highlighter"}function a(b,c,f){this.initialize(b,c,f);this.lineStyles=[]}a.prototype={initialize:function(b,c,f){this.textView=b;this.serviceRegistry=c;this.annotationModel=f;this.services=[];var g=this;this.listener={onModelChanging:function(i){g.onModelChanging(i)},onModelChanged:function(i){g.onModelChanged(i)},onDestroy:function(i){g.onDestroy(i)},
onLineStyle:function(i){g.onLineStyle(i)},onStyleReady:function(i){g.onStyleReady(i)},onServiceAdded:function(i,j){g.onServiceAdded(i,j)},onServiceRemoved:function(i,j){g.onServiceRemoved(i,j)}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);c.addEventListener("serviceAdded",this.listener.onServiceAdded);
c.addEventListener("serviceRemoved",this.listener.onServiceRemoved);b=c.getServiceReferences("orion.edit.highlighter");for(f=0;f<b.length;f++){var h=b[f];e(h)&&this.addServiceListener(c.getService(h))}},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged);this.textView.removeEventListener("Destroy",this.listener.onDestroy);
this.textView.removeEventListener("LineStyle",this.listener.onLineStyle);this.textView=null}if(this.services){for(var b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);this.services=null}if(this.serviceRegistry){this.serviceRegistry.removeEventListener("serviceAdded",this.listener.onServiceAdded);this.serviceRegistry.removeEventListener("onServiceRemoved",this.listener.onServiceRemoved);this.serviceRegistry=null}this.lineStyles=this.listener=null},onModelChanging:function(b){this.startLine=
this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var c=this.startLine;if(b.addedLineCount||b.removedLineCount)Array.prototype.splice.apply(this.lineStyles,[c,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},onStyleReady:function(b){var c=b.lineStyles||b.style;b=Number.MAX_VALUE;var f=-1,g=this.textView.getModel();for(var h in c)if(c.hasOwnProperty(h)){this.lineStyles[h]=c[h];b=Math.min(b,h);f=Math.max(f,h)}b=Math.max(b,0);f=Math.min(f,g.getLineCount());
if(c=this.annotationModel){for(var i=c.getAnnotations(g.getLineStart(b),g.getLineEnd(f)),j=[];i.hasNext();){var l=i.next();l.type==="orion.annotation.highlightError"&&j.push(l)}i=[];for(l=b;l<=f;l++){h=l;var n=this.lineStyles[h];n=n&&n.errors;h=g.getLineStart(h);if(n)for(var p=0;p<n.length;p++){var t=n[p];i.push({start:t.start+h,end:t.end+h,type:"orion.annotation.highlightError",title:d.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}})}}c.replaceAnnotations(j,
i)}this.textView.redrawLines(b,f+1)},onLineStyle:function(b){function c(g,h){for(var i=g.length,j=[],l=0;l<i;l++){var n=g[l];j.push({start:n.start+h,end:n.end+h,style:n.style})}return j}var f=this.lineStyles[b.lineIndex];if(f)if(f.ranges)b.ranges=c(f.ranges,b.lineStart);else if(f.style)b.style=f.style},_getEmptyStyle:function(b){for(var c=[],f=0;f<b;f++)c.push(null);return c},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var c=this.services[b];
c.setContentType&&c.setContentType(this.contentType)}},onServiceAdded:function(b,c){e(b)&&this.addServiceListener(c)},onServiceRemoved:function(b,c){this.services.indexOf(c)!==-1&&this.removeServiceListener(c)},addServiceListener:function(b){b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady);this.services.push(b);b.setContentType&&this.contentType&&b.setContentType(this.contentType)},removeServiceListener:function(b){b.removeEventListener("orion.edit.highlighter.styleReady",
this.listener.onStyleReady);b=this.services.indexOf(b);b!==-1&&this.services.splice(b,1)}};return{AsyncStyler:a}});
define("examples/textview/textStylerOptions",[],function(){function d(e){this._styler=e;this._view=this._styler.view;var a=this;this._listener={onLoad:function(b){a._onLoad(b)},onStorage:function(b){a._onStorage(b)}};if(this._view){this._view.isLoaded()?this._updateStylesheet():this._view.addEventListener("Load",this._listener.onLoad);window.addEventListener("storage",this._listener.onStorage,false)}}d.prototype={_getSetting:function(e,a){for(var b=JSON.parse(localStorage.getItem("JavaScript Editor")),
c,f=0;f<b.length;f++)if(b[f].label===e)for(var g=0;g<b[f].data.length;g++)if(b[f].data[g].label===a){c=b[f].data[g].value;break}return c},_getStyleSheet:function(e){function a(l,n){if(l=j.getClassNameForToken(l)){var p=i._getSetting(n,"Color");n=i._getSetting(n,"Weight").toLowerCase();b.push("."+e+" ."+l+" {");b.push("\tcolor: "+p+";");b.push("\tfont-weight: "+n+";");b.push("}")}}var b=[];b.push("");var c=this._getSetting("Font","Family").toLowerCase();c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':
"monospace";var f=this._getSetting("Font","Size"),g=this._getSetting("Font","Color"),h=this._getSetting("Font","Background");b.push("."+e+" {");b.push("\tfont-family: "+c+";");b.push("\tfont-size: "+f+";");b.push("\tcolor: "+g+";");b.push("\tbackground-color: "+h+";");b.push("}");b.push("."+e+" .view {");b.push("\tbackground-color: "+h+";");b.push("}");b.push("."+e+" .ruler {");b.push("\tbackground-color: "+h+";");b.push("}");var i=this,j=this._styler;if(j.getClassNameForToken){a("keyword","Keyword Types");
a("string","String Types");a("singleLineComment","Comment Types");a("multiLineComment","Comment Types");a("docComment","Comment Types");a("docHtmlComment","Comment Types")}return b.join("\n")},_updateStylesheet:function(){if(localStorage.getItem("JavaScript Editor")){var e=this._view,a={stylesheet:null,themeClass:null};e.getOptions(a);var b=a.stylesheet;b||(b=[]);b instanceof Array||(b=[b]);for(var c=0;c<b.length;c++)if(b[c].indexOf("/* Orion Editor User Preference CSS (key) */")===0){b.splice(c,
1);break}if(c=a.themeClass){if(c=c.replace("userTheme",""))c+=" ";c+="userTheme"}else c="userTheme";b.push("/* Orion Editor User Preference CSS (key) */"+this._getStyleSheet("userTheme"));a.stylesheet=b;a.themeClass=c;e.setOptions(a)}},_onLoad:function(){this._updateStylesheet();this._view.removeEventListener("Load",this._listener.onLoad)},_onStorage:function(e){e.key==="JavaScript Editor"&&this._updateStylesheet()}};return{TextStylerOptions:d}});
define("orion/highlight",["dojo","examples/textview/textStyler","orion/editor/textMateStyler","orion/editor/asyncStyler","examples/textview/textStylerOptions"],function(d,e,a,b,c){function f(h,i,j,l,n,p){function t(C,k){var m=C.getProperty("contentType"),o=C.getProperty("fileTypes");if(m)return i.isSomeExtensionOf(j,m).then(function(s){return s?C:null});else if(k&&o&&o.indexOf(k)!==-1){k=new d.Deferred;k.callback(C);return k}return null}function v(C){var k=null;switch(C&&C.id){case "text.javascript":case "text.json":k=
new e.TextStyler(l,"js",n);break;case "text.java":k=new e.TextStyler(l,"java",n);break;case "text.css":k=new e.TextStyler(l,"css",n);break}k&&new c.TextStylerOptions(k);return k}var r=v(j);if(r){p=new d.Deferred;p.callback(r);return p}r=p&&p.split(".").pop().toLowerCase();p=h.getServiceReferences("orion.edit.highlighter");for(var u=[],q=[],x=0;x<p.length;x++){var z=p[x];z.getProperty("type")==="grammar"&&u.push(z.getProperty("grammar"));(z=t(z,r))&&q.push(z)}return(new d.DeferredList(q)).then(function(C){for(var k,
m=C.length-1;m>=0;m--){var o=C[m][1];if(o){k=o;break}}var s;if(k){C=k.getProperty("type");if(C==="highlighter"){s=new b.AsyncStyler(l,h,n);s.setContentType(j)}else if(C==="grammar"||typeof C==="undefined"){k=k.getProperty("grammar");s=new a.TextMateStyler(l,k,u)}}return s})}function g(h){this.serviceRegistry=h;this.styler=null}g.prototype={setup:function(h,i,j,l){if(this.styler){this.styler.destroy&&this.styler.destroy();this.styler=null}var n=this;return f(this.serviceRegistry,this.serviceRegistry.getService("orion.file.contenttypes"),
h,i,j,l).then(function(p){return n.styler=p})},getStyler:function(){return this.styler}};return{createStyler:f,SyntaxHighlighter:g}});
define("orion/compare/compare-container",["require","dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-inline-model","orion/compare/compare-2way-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","orion/compare/compareUtils","orion/compare/diff-provider","orion/compare/jsdiffAdapter",
"orion/highlight"],function(d,e,a,b,c,f,g,h,i,j,l,n,p,t,v,r,u,q,x,z){var C={};C.CompareContainer=function(){function k(){this._diffParser=new a.DiffParser}k.prototype={_clearOptions:function(){this._complexURL=this._diffProvider=this._hasConflicts=this._readonly=undefined;this._baseFile={URL:"",Name:"",Type:""};this._newFile={URL:"",Name:"",Type:""};this._onSetTitle=this._onSave=this._diffContent=this._diffURL=undefined},setOptions:function(m,o){o&&this._clearOptions();if(m){this._mapper=m.mapper?
m.mapper:this._mapper;this._readonly=m.readonly!==undefined||m.readonly!==null?m.readonly:this._readonly;this._hasConflicts=m.hasConflicts!==undefined||m.hasConflicts!==null?m.hasConflicts:this._hasConflicts;this._diffProvider=m.diffProvider?m.diffProvider:this._diffProvider;this._complexURL=m.complexURL?m.complexURL:this._complexURL;this._baseFile.URL=m.baseFileURL?m.baseFileURL:this._baseFile.URL;this._baseFile.Name=m.baseFileName?m.baseFileName:this._baseFile.Name;this._baseFile.Type=m.baseFileType?
m.baseFileType:this._baseFile.Type;this._baseFile.Content=m.baseFileContent?m.baseFileContent:this._baseFile.Content;this._newFile.URL=m.newFileURL?m.newFileURL:this._newFile.URL;this._newFile.Name=m.newFileName?m.newFileName:this._newFile.Name;this._newFile.Type=m.newFileType?m.newFileType:this._newFile.Type;this._newFile.Content=m.newFileContent?m.newFileContent:this._newFile.Content;this._diffURL=m.diffURL?m.diffURL:this._diffURL;this._diffContent=m.diffContent?m.diffContent:this._diffContent;
this._onSave=m.onSave?m.onSave:this._onSave;this._callback=m.callback?m.callback:this._callback;this._errorCallback=m.errorCallback?m.errorCallback:this._errorCallback;this._onSetTitle=m.onSetTitle?m.onSetTitle:this._onSetTitle}},clearContent:function(){if(this._baseFile)this._baseFile.Content=null;if(this._newFile)this._newFile.Content=null},_getLineDelim:function(){return"\n"},resolveComplexDiff:function(m){if(this._diffProvider){var o=this;o._diffProvider.provide(o._complexURL,m,o._hasConflicts,
function(s){o._baseFile.URL=s.baseFile&&typeof s.baseFile.URL==="string"?s.baseFile.URL:o._baseFile.URL;o._baseFile.Name=s.baseFile&&typeof s.baseFile.Name==="string"?s.baseFile.Name:o._baseFile.Name;o._baseFile.Type=s.baseFile&&typeof s.baseFile.Type==="object"?s.baseFile.Type:o._baseFile.Type;o._baseFile.Content=s.baseFile&&typeof s.baseFile.Content==="string"?s.baseFile.Content:o._baseFile.Content;o._newFile.URL=s.newFile&&typeof s.newFile.URL==="string"?s.newFile.URL:o._newFile.URL;o._newFile.Name=
s.newFile&&typeof s.newFile.Name==="string"?s.newFile.Name:o._newFile.Name;o._newFile.Type=s.newFile&&typeof s.newFile.Type==="object"?s.newFile.Type:o._newFile.Type;o._newFile.Content=s.newFile&&typeof s.newFile.Content==="string"?s.newFile.Content:o._newFile.Content;o._diffContent=typeof s.diff==="string"?s.diff:o._diffContent;if(m||typeof o._baseFile.Content==="string")o.setEditor(m);else{o._callback&&o._callback(o._baseFile.Name,o._newFile.Name);o.getFileContent([o._baseFile],0)}},o._errorCallback)}else console.log("A diff provider is needed for Complex diff URL")},
resolveDiffByContents:function(m){if(typeof this._baseFile.Content==="string"&&typeof this._newFile.Content==="string"){if(!this._diffContent&&!this._mapper)this._diffContent="";this.setEditor(m);return true}else return false},getFileContent:function(m,o){if(this._fileClient){var s=this;s._fileClient.read(m[o].URL).then(function(w){m[o].Content=w;o<m.length-1?s.getFileContent(m,o+1):s.setEditor()},function(w,y){if(w.status===404){m[o].Content="";o<m.length-1?s.getFileContent(m,o+1):s.setEditor()}else s.errorCallback&&
s.errorCallback(w,y)})}else console.log("A file client is needed for getting file content")},parseMapper:function(m,o,s,w,y){var B=this._getLineDelim(m,s);if(this._mapper)return{delim:B,mapper:this._mapper,output:o,diffArray:o};if(o){m=(new x.JSDiffAdapter).adapt(m,o);return{delim:B,mapper:m.mapper,output:o,diffArray:m.changContents}}else{this._diffParser.setLineDelim(B);o=this._diffParser.parse(m,s,w,y);m=this._diffParser.getDiffArray();return{delim:B,mapper:o.mapper,output:o.outPutFile,diffArray:m}}},
startup:function(m){this._complexURL?this.resolveComplexDiff(m):this.resolveDiffByContents(m)}};return k}();C.DefaultDiffProvider=function(){function k(m){this.serviceRegistry=m;this._diffProvider=new q.DiffProvider(m)}k.prototype={_resolveComplexDiff:function(m,o,s){if(this._diffProvider){var w=this;w._diffProvider.getDiffContent(m).then(function(y){w._diffContent=w._hasConflicts?y.split("diff --git")[1]:y;o?w.callBack({diff:w._diffContent}):w._resolveComplexFileURL(m)},s)}else console.log("A diff provider is needed for compound diff URL")},
_resolveFileName:function(m){return m.split("?")[0]},_getContentType:function(m){m=this._resolveFileName(m);return this.serviceRegistry.getService("orion.file.contenttypes").getFilenameContentType(m)},_resolveComplexFileURL:function(m,o){var s=this;this._diffProvider.getDiffFileURI(m).then(function(w){(new e.DeferredList([s._getContentType(w.Old),s._getContentType(w.New)])).then(function(y){var B=y[0][1];y=y[1][1];s.callBack({baseFile:{URL:w.Old,Name:s._resolveFileName(w.Old),Type:B},newFile:{URL:w.New,
Name:s._resolveFileName(w.New),Type:y},diff:s._diffContent})},o)},o)},provide:function(m,o,s,w,y){this.callBack=w;this._hasConflicts=s;this._resolveComplexDiff(m,o,y)}};return k}();C.DiffStyler=function(){function k(m,o){this._compareMatchRenderer=m;this._textView=o}k.prototype={highlight:function(m){this._textView&&this._textView.removeEventListener("LineStyle",this._lineStyleListener);if(m)this._textView=m;if(this._textView&&!this._textView.getModel().isMapperEmpty())this._textView.addEventListener("LineStyle",
this._lineStyleListener=e.hitch(this,this._onLineStyle))},_onLineStyle:function(m){var o=this._textView,s=m.lineIndex,w=o.getModel().getLineType(s);s=w.type;var y=u.getAnnotationIndexByMapper(o.getModel().getAnnotations(),w.mapperIndex).current;o=u.isMapperConflict(o.getModel().getMapper(),w.mapperIndex);y=y===this._compareMatchRenderer.getCurrentAnnotationIndex();if(s==="top-only"){s=y?"url('"+d.toUrl("images/diff-border-sel.png")+"')":"url('"+d.toUrl("images/diff-border.png")+"')";m.style={style:{backgroundImage:s,
backgroundRepeat:"repeat-x"}}}else if(s!=="unchanged")m.style={styleClass:y?o?"diffConflictSelect":"diffNormalSelect":o?"diffConflict":"diffNormal"}}};return k}();C.TwoWayCompareStyler=function(){function k(m,o){this._syntaxHighlither=new z.SyntaxHighlighter(m);this._diffHighlither=new C.DiffStyler(o)}k.prototype={highlight:function(m,o,s){var w=this;this._syntaxHighlither.setup(o,s,null,m).then(function(){w._diffHighlither.highlight(s)})}};return k}();C.TwoWayCompareContainer=function(){function k(m,
o,s){this._registry=m;this._commandService=this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._uiFactory=o;this._viewLoadedCounter=0;this.setOptions(s,true);var w=this;if(!this._callback)this._callback=function(y,B){if(w._uiFactory.getTitleDivId(true)&&w._uiFactory.getTitleDivId(false)){e.place(document.createTextNode(B),w._uiFactory.getTitleDivId(true),"only");e.place(document.createTextNode(y),w._uiFactory.getTitleDivId(false),"only")}};
if(!this._errorCallback)this._errorCallback=function(y,B){if(w._uiFactory.getTitleDivId(true)&&w._uiFactory.getTitleDivId(false)){y=typeof y.message==="string"?y.message:B.xhr.statusText;e.place(document.createTextNode(y),w._uiFactory.getTitleDivId(true),"only");e.place(document.createTextNode(y),w._uiFactory.getTitleDivId(false),"only");e.style(o.getTitleDivId(true),"color","red");e.style(o.getTitleDivId(false),"color","red")}};this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._rightEditorDivId=
this._uiFactory.getEditorParentDivId(false);this.initCommands();w=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(y){if(y)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},getFileMetadata:function(){return this._fileMetadata},setInput:function(y){this.onSetTitle?this.onSetTitle(y,e.hitch(this,function(B){this.setTitle(B)}),
e.hitch(this,function(B){console.error("Error loading file metadata: "+B.message);this.setTitle(y)})):w._fileClient.read(y,true).then(e.hitch(this,function(B){this._fileMetadata=B;this.setTitle(B.Location)}),e.hitch(this,function(B){console.error("Error loading file metadata: "+B.message);this.setTitle(y)}));this.lastFilePath=y},setTitle:function(y){var B=y.lastIndexOf("/"),A=y;if(B!==-1){A="Compare "+A.substring(B+1);if(y.charAt(0)==="*")A="*"+A}this._lastTitle=A;window.document.title=A;if((B=e.byId("location"))&&
this._fileMetadata){e.empty(B);new n.BreadCrumbs({container:"location",resource:this._fileMetadata});if(y.charAt(0)==="*")e.create("b",null,B,"last").innerHTML="*"}},afterSave:function(){w.startup(true)}};if(this._onSave)this._inputManager.onSave=this._onSave;if(this._onSetTitle)this._inputManager.onSetTitle=this._onSetTitle;this._compareMatchRenderer=new b.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new C.TwoWayCompareStyler(this._registry,
this._compareMatchRenderer));this._highlighter.push(new C.TwoWayCompareStyler(this._registry,this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}k.prototype=new C.CompareContainer;k.prototype.initEditorContainers=function(m,o,s,w,y){this._editorLeft=this.createEditorContainer(o,m,w,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this._readonly,y,this._newFile);l.generateDomCommandsInBanner(this._commandService,this._editorLeft,null,null,null,true);
this._textViewLeft=this._editorLeft.getTextView();this._editorRight=this.createEditorContainer(s,m,w,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,y,this._baseFile);this._textViewRight=this._editorRight.getTextView();var B=this;m=new b.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},B._compareMatchRenderer.getAnnotation(),function(A){B._compareMatchRenderer.matchPositionFromAnnotation(A)});this._textViewRight.addRuler(m);this._compareMatchRenderer.setOverviewRuler(m);
B=this;window.onbeforeunload=function(){if(B._editorLeft.isDirty())return"There are unsaved changes."}};k.prototype.initCommands=function(){var m=this._uiFactory.getCommandSpanId();if(m){var o=this,s=new t.Command({tooltip:"Go to next diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){o.nextDiff()}}),w=new t.Command({tooltip:"Go to previous diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",
callback:function(){o.prevDiff()}}),y=new t.Command({tooltip:"Copy current change from right to left",imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(){o.copyToLeft()}});this._commandService.addCommand(w,"dom");this._commandService.addCommand(s,"dom");this._commandService.addCommand(y,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,m);this._commandService.registerCommandContribution("orion.compare.nextDiff",
2,m);this._readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,m);this._commandService.renderCommands(m,"dom",o,o,"button")}};k.prototype.gotoMatch=function(m,o,s,w,y,B){if(!this.onScroll)this.onScroll=y;if(!this.onLoad)this.onLoad=B;y=this._textViewRight.getModel().getLineStart(m)+o.startIndex;this._editorRight.moveSelection(y,y+(o.length?o.length:w));m=this._textViewLeft.getModel().getLineStart(m)+s.startIndex;this._editorLeft.moveSelection(m,m+(s.length?s.length:
w))};k.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};k.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};k.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};k.prototype.createEditorContainer=function(m,o,s,w,y,B,A,E,G){var M=e.byId(y),H=this;m=new v.TextModel(m,o);var N=new f.TwoWayCompareModel(m,{mapper:s,columnIndex:w}),L="";s=A?new j.UndoFactory:new h.UndoCommandFactory(H._registry,H._commandService,"pageActions");var P=new i.Editor({textViewFactory:function(){var F=
new r.TextView({parent:M,model:N,readonly:A,stylesheet:[d.toUrl("orion/compare/editor.css"),d.toUrl("css/default-theme.css")],tabSize:4});F.addEventListener("Load",function(){H._viewLoadedCounter++;H._viewLoadedCounter===2&&H._compareMatchRenderer.matchPositionFromAnnotation(-1);H.onLoad&&H.onLoad()});return F},undoStackFactory:s,contentAssistFactory:function(F){return new g.ContentAssist(F,"contentassist")},keyBindingFactory:function(F,J,Q,T){if(!A){(new h.EditorCommandFactory(H._registry,H._commandService,
H._fileClient,H._inputManager,"pageActions")).generateEditorCommands(F);var U=new j.TextActions(F,Q);J.push(U);F=new j.SourceCodeActions(F,Q,T);J.push(F)}},statusReporter:function(F,J){if(B){L=J?"ERROR: "+F:F;e.byId(B).innerHTML=""+L}},domNode:M});P.installTextView();if(!A){var S=this._inputManager;P.addEventListener("DirtyChanged",function(){S.setDirty(P.isDirty())})}var D=P.getTextView();if(E&&G&&typeof G.Name==="string"&&typeof G.Type==="string"){P.setInput(G.Name);this._highlighter[w].highlight(G.Name,
G.Type,P)}D.addRuler(new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));D.addEventListener("Selection",function(){var F=D.getModel().getLineAtOffset(D.getCaretOffset());F=u.lookUpMapper(D.getModel().getMapper(),w,F).mapperIndex;F=u.getAnnotationIndexByMapper(D.getModel().getAnnotations(),F);F.current!==-1&&H._compareMatchRenderer.gotoDiff(F.current)});if(w===0){D.getModel().addEventListener("Changed",function(F){H._compareMatchRenderer.onChanged(F)});
D.addEventListener("Scroll",function(){if(H._compareMatchRenderer){H._compareMatchRenderer.matchPositionFrom(true);H._compareMatchRenderer.render()}H.onScroll&&H.onScroll()})}else D.addEventListener("Scroll",function(){H._compareMatchRenderer&&H._compareMatchRenderer.render()});return P};k.prototype.setEditor=function(m){var o=this._baseFile.Content,s=this._newFile.Content,w=this._diffContent;if(s)w=this.parseMapper(o,s,w,this._hasConflicts,true);else{w=this.parseMapper(o,s,w,this._hasConflicts,m);
s=w.output}this._compareMatchRenderer.init(w.mapper,this._textViewLeft,this._textViewRight);if(this._editorLeft)if(m){this._textViewLeft.getModel().init(w.mapper);this._textViewRight.getModel().init(w.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFile.URL;this._textViewLeft.getModel().init(w.mapper);this._textViewRight.getModel().init(w.mapper);this._editorRight.setInput(this._baseFile.Name,null,o);this._highlighter[1].highlight(this._baseFile.Name,
this._baseFile.Type,this._textViewRight);this._editorLeft.setInput(this._newFile.Name,null,s);this._highlighter[0].highlight(this._newFile.Name,this._newFile.Type,this._textViewLeft);this._readonly||this._inputManager.setInput(this._newFile.URL,this._editorLeft)}else this.initEditorContainers(w.delim,s,o,w.mapper,true);this._viewLoadedCounter>1&&this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return k}();C.InlineCompareContainer=function(){function k(m,o,s){this._registry=m;this._commandService=
this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._statusService=this._registry.getService("orion.page.message");this.setOptions(s,true);var w=this;if(!this._callback)this._callback=function(){e.place(document.createTextNode(w._diffTitle),"fileNameInViewer","only");e.style("fileNameInViewer","color","#6d6d6d");w._statusService.setProgressMessage("");e.empty("compare_rightContainerCommands");w._commandService.renderCommands("compare_rightContainerCommands",
"dom",w,w,"button")};if(!this._errorCallback)this._errorCallback=function(y,B){var A=[];A.Severity="Error";A.HTML=false;try{var E=JSON.parse(y.responseText);A.Message=E.DetailedMessage?E.DetailedMessage:E.Message}catch(G){A.Message=typeof y.message==="string"?y.message:B.xhr.statusText}this._statusService.setProgressResult(A);e.empty("compare_rightContainerCommands")};this._annotation=new b.CompareAnnotation;this._editorDivId=o;this.initEditorContainers("","\n",[],[]);this.hasContent=false}k.prototype=
new C.CompareContainer;k.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=true}};k.prototype.removeRulers=function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};k.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],
[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};k.prototype.createEditorContainer=function(m,o,s,w,y,B){var A=e.byId(this._editorDivId),E=this;m=new v.TextModel(m,o);var G=new c.CompareTextModel(m,{mapper:s,columnIndex:0},new c.DiffLineFeeder(w,o));o=new j.UndoFactory;o=new i.Editor({textViewFactory:function(){return new r.TextView({parent:A,model:G,readonly:true,stylesheet:d.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:o,keyBindingFactory:function(){},
statusReporter:function(){},domNode:A});o.installTextView();y&&B&&o.setInput(B.Name);var M=o.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});this._rulerNew=new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});E=this;this._overview=new b.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},E._annotation,
function(H){E._annotation.matchPositionFromAnnotation(H);E.positionAnnotation(H)});M.addEventListener("LineStyle",function(H){E._onLineStyle(H)});M.addEventListener("Selection",function(){var H=M.getModel().getLineAtOffset(M.getCaretOffset());H=M.getModel().getLineType(H).mapperIndex;H=u.getAnnotationIndexByMapper(M.getModel().getAnnotations(),H);if(H.current!==-1){E._annotation.gotoDiff(H.current);H=M.getTopIndex();M.redrawRange();M.redrawLines(H,H+1,E._overview)}});return o};k.prototype.initEditorContainers=
function(m,o,s,w){this._editor=this.createEditorContainer(o,m,s,w,this._newFile);this._textView=this._editor.getTextView()};k.prototype._onLineStyle=function(m){var o=m.lineIndex,s=this._textView.getModel().getLineType(o);o=s.type;s=u.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),s.mapperIndex).current;if(o==="added")m.style=s===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(o==="removed")m.style=s===
this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};k.prototype._initDiffPosition=function(m){var o=m.getModel();if(o&&o.getAnnotations){o=o.getAnnotations();if(o.length>0){o=o[0][0];var s=m.getLineHeight(),w=m.getClientArea();s=Math.floor(w.height/s/3);m.setTopIndex(o-s>0?o-s:0)}}};k.prototype.setDiffTitle=function(m){this._diffTitle=m};k.prototype.setEditor=function(){var m=this._baseFile.Content,o=this._newFile.Content,s=this._diffContent;
this.hasContent=true;o=this.parseMapper(m,o,s,false,o);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(o.mapper,o.diffArray);if(m==="")m=" ";this._textView.setText(m);this._annotation.init(o.mapper,this._textView)}else this.initEditorContainers(o.delim,m,o.mapper,o.diffArray,true);this._initDiffPosition(this._textView)};k.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};
k.prototype.setConflicting=function(m){this._conflcit=m};k.prototype.prevDiff=function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};k.prototype.positionAnnotation=function(m){if(this._textView){var o=this._textView.getLineHeight(),s=this._textView.getClientArea();o=Math.floor(s.height/o/3);this._textView.setTopIndex(m-o>0?m-o:0);this._textView.redrawRange();m=this._textView.getTopIndex();this._textView.redrawLines(m,
m+1,this._overview)}};return k}();return C});define("text!orion/git/widgets/templates/CloneGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t\t<span dojoAttachPoint="Basic">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<label dojoAttachPoint="gitUrlLabel" for="${id}_gitUrl" style="padding-right: 10">${gitUrlLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitUrl" id="${id}_gitUrl" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right;">\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLink" href="javascript:">Choose target location</a>\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLinkHide" href="javascript:" style="display: none">Default target location</a>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<span dojoAttachPoint="Advanced" style="display: none;">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isNewProject" type="radio" name="${id}_newExisting" checked value="new"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitNameLabel" for="${id}_gitName" style="padding-right: 10">${gitNameLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitName" id="${id}_gitName" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isExistingProject" type="radio" name="${id}_newExisting" value="existing"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitPathLabel" for="${id}_gitPath" style="padding-right: 10">${gitPathLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: left; float: right;">\n\t\t\t\t\t\t\t<input dojoAttachPoint="gitPath" id="${id}_gitPath" type="hidden" value="">\n\t\t\t\t\t\t\t<div style="width: 30em; float: left" float="left" dojoAttachPoint="shownGitPath"></div>\n\t\t\t\t\t\t\t<div style="width: 10em; float: right; text-align: right"><a dojoAttachPoint="changeGitPath" href="javascript:">Change...</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/CloneGitRepositoryDialog",["require","dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","orion/widgets/DirectoryPrompterDialog","text!orion/git/widgets/templates/CloneGitRepositoryDialog.html"],function(d,e,a){e.declare("orion.git.widgets.CloneGitRepositoryDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/CloneGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title?this.options.title:"Clone Git Repository";this.gitUrlLabelText="Repository URL:";this.gitPathLabelText="Existing directory:";this.gitNameLabelText="New folder:";this.advancedShown=false},postCreate:function(){var b=this;this.inherited(arguments);if(this.options.url)this.gitUrl.value=this.options.url;if(this.options.advancedOnly){this.Basic.style.display="none";this.Advanced.style.display=
"";setTimeout(function(){b.gitName.focus()},400)}e.connect(this.changeGitPath,"onclick",null,e.hitch(this,this.openDirectoryPickerDialog));e.connect(this.isExistingProject,"onchange",null,e.hitch(this,this.showExistingFolder));e.connect(this.gitName,"onfocus",null,e.hitch(this,this.showNewProject));e.connect(this.advancedLink,"onclick",null,e.hitch(this,this.showAdvanced));e.connect(this.advancedLinkHide,"onclick",null,e.hitch(this,this.hideAdvanced));this.options.alwaysShowAdvanced&&this.showAdvanced()},
execute:function(){if(this.options.func)this.options.func(this.options.advancedOnly?undefined:this.gitUrl.value,this.advancedShown&&this.isNewProject.checked?undefined:this.gitPath.value,this.advancedShown&&!this.isNewProject.checked?undefined:this.gitName.value);delete this.options.func},showAdvanced:function(){this.advancedShown=true;this.Advanced.style.display="";this.advancedLink.style.display="none";this.advancedLinkHide.style.display=""},hideAdvanced:function(){this.advancedShown=false;this.Advanced.style.display=
"none";this.advancedLink.style.display="";this.advancedLinkHide.style.display="none"},showExistingFolder:function(){this.isExistingProject.checked?this.openDirectoryPickerDialog():this.gitName.focus()},showNewProject:function(){this.isNewProject.checked=true},openDirectoryPickerDialog:function(){this.isExistingProject.checked=true;var b=new orion.widgets.DirectoryPrompterDialog({title:"Choose a Folder",serviceRegistry:this.options.serviceRegistry,fileClient:this.options.fileClient,func:e.hitch(this,
function(c){if(c&&c.Location){this.gitPath.value=c.Location;this.shownGitPath.innerHTML="<a href='"+d.toUrl("navigate/table.html")+"#"+c.ChildrenLocation+"'>"+c.Name+"</a>";for(c=c;c.parent&&!c.parent.Projects;){this.shownGitPath.innerHTML="<a href='"+d.toUrl("navigate/table.html")+"#"+c.parent.ChildrenLocation+"'>"+c.parent.Name+"</a>/"+this.shownGitPath.innerHTML;c=c.parent}}})});b.startup();b.show()}})});define("text!orion/git/widgets/templates/InitGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitTargetLabel" for="${id}_gitTarget" style="padding-right: 10">${gitTargetLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitTarget" id="${id}_gitTarget" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t<br><i>This is to be replaced with directory picker dialog</i>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/InitGitRepositoryDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/InitGitRepositoryDialog.html"],function(d,e){d.declare("orion.git.widgets.InitGitRepositoryDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/InitGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Init Git Repository";this.gitTargetLabelText="Target:"},execute:function(){this.options.func&&this.options.func(this.gitTarget.value);delete this.options.func}})});define("text!orion/git/widgets/templates/AddRemoteDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteLabel" for="${id}_gitRemote" style="padding-right: 10">${gitRemoteLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemote" id="${id}_gitRemote" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteURILabel" for="${id}_gitRemoteURI" style="padding-right: 10">${gitRemoteURILabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemoteURI" id="${id}_gitRemoteURI" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/AddRemoteDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/AddRemoteDialog.html"],function(d,e){d.declare("orion.git.widgets.AddRemoteDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/AddRemoteDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Add Remote";this.gitRemoteLabelText="Remote Name:";this.gitRemoteURILabelText="Remote URI:"},execute:function(){this.options.func&&this.options.func(this.gitRemote.value,this.gitRemoteURI.value);delete this.options.func}})});define("text!orion/git/widgets/templates/GitCredentialsDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: none; padding-top: 10px; padding-bottom: 10px;" dojoAttachPoint="gitCredentialsLabel">Provide credentials for: <b dojoAttachPoint="url"></b></div>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshUsernameRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitSshUsernameLabel" for="${id}_gitSshUsername" style="padding-right: 10">${gitSshUsernameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="gitSshUsername" id="${id}_gitSshUsername" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshPasswordRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isSshPassword" type="radio" name="${id}_isSshPassword" checked value="password" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitSshPasswordLabel" for="${id}_gitSshPassword" style="padding-right: 10">${gitSshPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitSshPassword" id="${id}_gitSshPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPrivateKeyRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isPrivateKey" type="radio" name="${id}_isSshPassword" value="privateKey" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitPrivateKeyLabel" for="${id}_gitPrivateKey" style="padding-right: 10">${gitPrivateKeyLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<textarea dojoAttachPoint="gitPrivateKey" id="${id}_gitPrivateKey" style="display: inline-block; width: 98%;" value=""></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitPassphraseLabel" for="${id}_gitPassphrase">${gitPassphraseLabelText}</label>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow_1">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitPassphrase" id="${id}_gitPassphrase" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="okButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">Ok\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/GitCredentialsDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/GitCredentialsDialog.html"],function(d,e){d.declare("orion.git.widgets.GitCredentialsDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/GitCredentialsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title=this.options.title||"Git Credentials";this.gitUrlLabelText="Repository URL:";this.gitSshUsernameLabelText="Username:";this.gitSshPasswordLabelText="Ssh password:";this.gitPrivateKeyLabelText="Private key:";this.gitPassphraseLabelText="Passphrase (optional):";if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase){this.options.username=true;this.options.password=true;this.options.privatekey=true;this.options.passphrase=true}if(this.options.serviceRegistry){this._sshService=
this.options.serviceRegistry.getService("orion.net.ssh");this._progressService=this.options.serviceRegistry.getService("orion.page.progress")}},postCreate:function(){this.inherited(arguments);var a=this;this.options.username||d.style(this.gitSshUsernameRow,"display","none");this.options.password||d.style(this.gitSshPasswordRow,"display","none");this.options.privatekey||d.style(this.gitPrivateKeyRow,"display","none");if(!this.options.passphrase){d.style(this.gitPassphraseRow,"display","none");d.style(this.gitPassphraseRow_1,
"display","none")}if(this.options.errordata&&this.options.errordata.Url){d.style(this.gitCredentialsLabel,"display","block");this.url.innerHTML=this.options.errordata.Url}if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!==""){this.gitSshUsername.value=this.options.errordata.User;d.style(this.gitSshUsernameRow,"display","none");setTimeout(function(){a.gitSshPassword.focus()},400)}d.connect(this.gitSshPassword,"onfocus",null,d.hitch(this,function(){this.isSshPassword.checked=
true}));d.connect(this.gitPrivateKey,"onfocus",null,d.hitch(this,function(){this.isPrivateKey.checked=true}));d.connect(this.gitPassphrase,"onfocus",null,d.hitch(this,function(){this.isPrivateKey.checked=true}))},execute:function(){if(this._sshService){var a=this;this._sshService.getKnownHosts().then(function(b){if(a.options.func)a.options.func({gitSshUsername:a.gitSshUsername.value,gitSshPassword:a.isSshPassword.checked?a.gitSshPassword.value:"",gitPrivateKey:a.isPrivateKey.checked?a.gitPrivateKey.value:
"",gitPassphrase:a.isPrivateKey.checked?a.gitPassphrase.value:"",knownHosts:b});delete a.options.func})}else{this.options.func&&this.options.func({gitSshUsername:this.gitSshUsername.value,gitSshPassword:this.gitSshPassword.value,gitPrivateKey:this.gitPrivateKey.value,gitPassphrase:this.gitPassphrase.value,knownHosts:this.gitSshKnownHosts.value});delete this.options.func}}})});
define("orion/git/git-clones-explorer",["require","dojo","orion/explorer","orion/util"],function(d,e,a,b){var c={};c.GitClonesExplorer=function(){function f(g,h,i,j,l,n){this.parentId=j;this.registry=g;this.selection=h;this.toolbarId=l;this.selectionToolsId=n;this.cloneDetails=i;this.checkbox=false;this.renderer=new c.GitClonesRenderer({checkbox:false},this)}f.prototype=new a.Explorer;f.prototype.getGitLocation=function(g){g=b.makeRelative(g);var h=d.toUrl("gitapi/clone._");h=h.substring(0,h.length-
2);return g[0]==="/"?h+g:h+"/"+g};f.prototype.setDefaultPath=function(g){this.defaultPath=g};f.prototype.displayClonesList=function(g){g=g||this.defaultPath;g=b.makeRelative(g);if(g!==this._lastHash){this._lastHash=g;e.hash(g,true);g=this.getGitLocation(g);e.create("div",null,e.byId(this.parentId),"only").innerHTML="Loading <b>"+g+"</b>...";var h=this.registry.getService("orion.git.provider");this.createTree(this.parentId,new c.GitClonesModel(h,g,h.getGitClone))}};f.prototype.redisplayClonesList=
function(){if(this._lastHash){var g=this.getGitLocation(this._lastHash);e.create("div",null,e.byId(this.parentId),"only").innerHTML="Loading <b>"+g+"</b>...";var h=this.registry.getService("orion.git.provider");this.createTree(this.parentId,new c.GitClonesModel(h,g,h.getGitClone))}};f.prototype.loadCloneDetails=function(g){this.cloneDetails.loadCloneDetails(g.ConfigLocation)};return f}();c.GitClonesModel=function(){function f(g,h,i,j){this.gitClient=g;this.rootPath=h;this.fetchItems=i;this.root=j?
j:null}f.prototype=new a.ExplorerModel;f.prototype.getRoot=function(g){this.root?g(this.root):this.fetchItems(this.rootPath).then(e.hitch(this,function(h){this.root=h;g(h)}))};f.prototype.mayHaveChildren=function(g){if(g.children||g.Children)return true;else if(g.BranchLocation&&g.RemoteLocation)return true;else if(g.GroupNode)return true;else if(g.Type==="Remote")return true;return false};f.prototype.getIdentity=function(g){if(g.Location){g=g.Location;g=g.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}else g=
"ROOT";return g};f.prototype.getChildren=function(g,h){g.children=[];if(g.Children){for(var i=0;i<g.Children.length;i++){g.Children[i].parent=g;g.children[i]=g.Children[i]}h(g.Children)}else if(g.BranchLocation&&g.RemoteLocation){g.children=[{GroupNode:"true",Location:g.BranchLocation,Name:"Branches",parent:g},{GroupNode:"true",Location:g.RemoteLocation,BranchLocation:g.BranchLocation,Name:"Remotes",parent:g},{GroupNode:"true",Location:g.TagLocation,Name:"Tags",parent:g}];h(g.children)}else if(g.GroupNode)this.gitClient.getGitBranch(g.Location).then(e.hitch(this,
function(j){g.children=j.Children;for(var l=0;l<j.Children.length;l++)j.Children[l].parent=g;h(j.Children)}));else g.Type==="Remote"&&this.gitClient.getGitBranch(g.Location).then(e.hitch(this,function(j){g.children=j.Children;for(var l=0;l<j.Children.length;l++)j.Children[l].parent=g;h(j.Children)}))};return f}();c.GitClonesRenderer=function(){function f(g,h){this._init(g);this.explorer=h}f.prototype=new a.SelectionRenderer;f.prototype.getCellHeaderElement=function(g){switch(g){case 0:case 1:return e.create("th",
{style:"height: 8px;"})}};f.prototype.getCellElement=function(g,h,i){switch(g){case 0:var j,l;if(h.BranchLocation&&h.RemoteLocation){j=document.createElement("td");g=i.id+"__expand";g=e.create("div",null,j,"only");this.getExpandImage(i,g,"git-sprite-repository","gitImageSprite");l=e.create("a",{className:"navlinkonpage"},g,"last");e.connect(l,"onclick",l,e.hitch(this,function(){this.explorer.loadCloneDetails(h)}));e.connect(l,"onmouseover",l,function(){l.style.cursor="pointer"});e.connect(l,"onmouseout",
l,function(){l.style.cursor="default"});e.place(document.createTextNode(h.Name),l,"only")}else if(h.GroupNode){j=document.createElement("td");g=i.id+"__expand";g=e.create("div",null,j,"only");h.Name==="Branches"&&this.getExpandImage(i,g,"git-sprite-branches","gitImageSprite");h.Name==="Remotes"&&this.getExpandImage(i,g,"git-sprite-remotes","gitImageSprite");h.Name==="Tags"&&this.getExpandImage(i,g,"git-sprite-tags","gitImageSprite");l=e.create("a",{innerHTML:h.Name,className:"navlinkonpage"},g,"last");
e.place(document.createTextNode(h.Name),l,"only")}else if(h.Type==="Branch"){j=document.createElement("td");g=e.create("div",{style:"margin-left: 10px"},j,"only");l=e.create("a",{innerHTML:h.Name,className:"navlinkonpage"},g,"last");if(h.Current)l.style.fontWeight="bold";e.place(document.createTextNode(h.Name),l,"only");i=e.create("span",null,l,"first");e.addClass(i,"gitImageSprite");e.addClass(i,"git-sprite-branch")}else if(h.Type==="Remote"){j=document.createElement("td");g=i.id+"__expand";g=e.create("div",
null,j,"only");this.getExpandImage(i,g,"git-sprite-remote","gitImageSprite");l=e.create("a",{innerHTML:h.Name,className:"navlinkonpage"},g,"last");!h.PushUrl||h.PushUrl===h.GitUrl?e.place(document.createTextNode(h.Name+" ("+h.GitUrl+")"),l,"only"):e.place(document.createTextNode(h.Name+" (See the configuration for fetch/push urls)"),l,"only")}else if(h.Type==="RemoteTrackingBranch"){j=document.createElement("td");g=e.create("div",{style:"margin-left: 10px"},j,"only");l=e.create("a",{innerHTML:h.Name,
className:"navlinkonpage"},g,"last");e.place(document.createTextNode(h.Name),l,"only");i=e.create("span",null,l,"first");e.addClass(i,"gitImageSprite");e.addClass(i,"git-sprite-branch")}else if(h.Type==="Tag"){j=document.createElement("td");g=e.create("div",{style:"margin-left: 10px"},j,"only");l=e.create("a",{innerHTML:h.Name,className:"navlinkonpage"},g,"last");e.place(document.createTextNode(h.Name),l,"only");i=e.create("span",null,l,"first");e.addClass(i,"gitImageSprite");e.addClass(i,"git-sprite-tag")}return j;
case 1:return this.getActionsColumn(h,i,"tool","actionsColumn")}};return f}();return c});define("text!orion/git/widgets/templates/RemotePrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseRemoteExplorerTree" class="explorerTreeClass" id="${id}_browseRemoteExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="newBranchSection">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t<label for="${id}_newBranch">${newBranchText}</label>\n\t\t\t\t\t<input dojoAttachPoint="newBranch" id="${id}_newBranch" value="" disabled=true/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="RemoteBrowserButton" disabled=true dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/git/widgets/RemotePrompterDialog",["dojo","dijit","orion/util","orion/git/git-clones-explorer","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/RemotePrompterDialog.html"],function(d,e,a,b){d.declare("orion.git.widgets.RemotePrompterDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/RemotePrompterDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.treeRoot=this.options.treeRoot},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.newBranchText="New Branch:";this.buttonOk="OK"},postCreate:function(){this.inherited(arguments);this.loadRemoteChildren(this.treeRoot);d.connect(this.newBranch,"onchange",d.hitch(this,this.validate));if(this.options.hideNewBranch)this.newBranchSection.style.display="none"},
loadRemoteChildren:function(c){this.treeRoot=c;this.createTree(new b.GitClonesModel(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))},createTree:function(c){var f=this.treeWidget=new orion.widgets.ExplorerTree({style:"width:100%; height:100%",model:c,region:"center",showRoot:false,persist:true,openOnClick:false,getLabel:function(h){if(h.Type==="RemoteTrackingBranch"&&!h.Id)return h.Name+" [New branch]";return h.Name},getIconClass:function(h){if(h.BranchLocation&&h.RemoteLocation)return"gitRepoItem";
if(h.GroupNode)return h.Name==="Branch"?"gitBranchesItem":"gitRemotesItem";if(h.Type==="Branch"||h.Type==="RemoteTrackingBranch")return"gitBranchItem";if(h.Type==="Remote")return"gitRemoteItem";return"gitDefaultItem"}}),g=this;this.treeWidget._inheritedSelectNode=this.treeWidget._selectNode;this.treeWidget._selectNode=function(h){f._inheritedSelectNode(h);g.newBranch.disabled=h.item&&h.item.Type==="Remote"?false:true;d.hitch(g,g.validate)()};this.treeWidget.startup();d.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
validate:function(){var c=this.treeWidget.getSelectedItems();if(c.length==1)if(c[0].Type==="RemoteTrackingBranch"){this.RemoteBrowserButton.disabled=false;return}else if(c[0].Type==="Remote")if(this.newBranch.value!=""){this.RemoteBrowserButton.disabled=false;return}this.RemoteBrowserButton.disabled=true},execute:function(){var c=this.treeWidget.getSelectedItems();this.onHide();if(this.options.func)c[0].Type==="RemoteTrackingBranch"?this.options.func(c[0],c[0].parent):this.options.func(null,c[0],
this.newBranch.value);delete this.options.func}})});define("text!orion/git/widgets/templates/ApplyPatchDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\n\t\t<form method="post" id="applyPatchDialog.myForm"\n\t\t\tenctype="multipart/form-data">\n\t\t\t<fieldset>\n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="radio" name="radio" value="urlRadio" id="applyPatchDialog.urlRadio" checked/>URL:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="text" name="url" id="applyPatchDialog.url" style="display: inline-block; width: 98%;"\n\t\t\t\t\t\t\t\tdojoType="dijit.form.ValidationTextBox"\n\t\t\t\t\t\t\t\tregExp="^http(s)*://.+" invalidMessage="Invalid URL."/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="radio" name="radio" value="fileRadio" id="applyPatchDialog.fileRadio"/>File:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: top;">\n\t\t\t\t\t\t\t<div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="applyPatchDialog.uploader"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input name="uploadedfile" multiple="false" type="file" id="applyPatchDialog.uploader" force="iframe"\n\t\t\t\t\t\t\t\tdojoType="dojox.form.Uploader" style="height: 20px" label="Browse..."/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="submit" label="Finish" value="OK" dojoType="dijit.form.Button"\n\t\t\t\t\t\t\t\tstyle="padding: 20 0 10 0; float: right; clear: both;"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n</div>'});
define("orion/git/widgets/ApplyPatchDialog",["dojo","dijit","dojox","dijit/Dialog","dojo/data/ItemFileReadStore","dojox/form/Uploader","dojox/form/uploader/FileList","dojox/form/uploader/plugins/IFrame","dijit/form/Button","dijit/ProgressBar","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/ApplyPatchDialog.html"],function(d,e){d.declare("orion.git.widgets.ApplyPatchDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","git/widgets/templates/ApplyPatchDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="Apply Patch"},postCreate:function(){function a(b){e.byId("files").set("disabled",b);e.byId("applyPatchDialog.uploader").set("disabled",b);e.byId("applyPatchDialog.url").set("disabled",!b)}this.inherited(arguments);d.byId("applyPatchDialog.myForm").action=this.options.diffLocation;d.byId("applyPatchDialog.uploader").url=this.options.diffLocation;a(true);
d.connect(e.byId("applyPatchDialog.urlRadio"),"onclick",d.hitch(this,function(b){b.target.id==="applyPatchDialog.urlRadio"&&a(true)}));d.connect(e.byId("applyPatchDialog.fileRadio"),"onclick",d.hitch(this,function(b){b.target.id==="applyPatchDialog.fileRadio"&&a(false)}));d.connect(e.byId("applyPatchDialog.uploader"),"onError",d.hitch(this,function(){setTimeout(d.hitch(this,function(){this.hide()}),2E3)}));d.connect(e.byId("applyPatchDialog.uploader"),"onComplete",d.hitch(this,function(){setTimeout(d.hitch(this,
function(){this.hide()}),2E3)}))}})});define("text!orion/git/widgets/templates/OpenCommitDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/OpenCommitDialog",["require","dojo","dijit","orion/util","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/OpenCommitDialog.html"],function(d,e,a){return e.declare("orion.git.widgets.OpenCommitDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/OpenCommitDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,constructor:function(){this.inherited(arguments);
this.timeoutId=null;this.time=0;this.options=arguments[0];this.serviceRegistry=this.options.serviceRegistry;if(!this.serviceRegistry)throw new Error("Missing required argument: serviceRegistry");this.repositories=this.options.repositories;if(!this.repositories)throw new Error("Missing required argument: repositories");this.commitName=this.options.commitName},postMixInProperties:function(){this.options.title=this.options.title||"Find Commit";this.selectFile="Type the commit name (sha1):";this.searchPlaceHolder=
"Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(b){if(b.keyCode===e.keys.ENTER&&this.results){b=e.query("a",this.results);if(b.length>0){window.open(b[0].href);this.hide()}}});e.connect(this,"onMouseUp",function(b){b.target.focus()});this.resourceName.set("value",
this.commitName)},checkSearch:function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();if(b-this.time>this.SEARCH_DELAY){this.time=b;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},_findCommitLocation:function(b,c,f){var g=this;if(f==null)f=new e.Deferred;b.length>0?g.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+c+b[0].ContentLocation+"?page=1&pageSize=1",null,null,"Looking for the commit").then(function(h){f.callback(h.Children[0])},
function(){g._findCommitLocation(b.slice(1),c,f)}):f.errback();return f},doSearch:function(){var b=this.resourceName&&this.resourceName.get("value");if(b){e.place("<div>Searching&#x2026;</div>",this.results,"only");var c=this;this.serviceRegistry.getService("orion.page.message").setProgressMessage("Looking for the commit");this._findCommitLocation(this.repositories,b).then(function(f){e.empty(c.results);c.displayCommit(f,c.results)},function(){e.place("<div>No commits found</div>",c.results,"only");
c.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}},displayCommit:function(b,c){c=e.create("div",{style:"padding:10px; max-width:480px"},c);var f=b.Message.split(/(\r?\n|$)/)[0],g=e.create("a",{"class":"gitMainDescription",href:"/git/git-commit.html#"+b.Location+"?page=1&pageSize=1"},c);e.place(document.createTextNode(f),g);e.connect(g,"onclick",g,e.hitch(this,function(){this.hide()}));e.create("div",{style:"padding-top:15px"},c);e.create("span",{"class":"gitSecondaryDescription",
innerHTML:" commit: "+b.Name},c);if(b.Parents&&b.Parents.length>0){e.create("div",null,c);e.place(document.createTextNode("parent: "),c);f=e.create("a",{"class":"gitSecondaryDescription",href:"/git/git-commit.html#"+b.Parents[0].Location+"?page=1&pageSize=1"},c);e.place(document.createTextNode(b.Parents[0].Name),f);e.connect(f,"onclick",f,e.hitch(this,function(){this.hide()}))}e.create("div",{style:"padding-top:15px"},c);if(b.AuthorImage){f=e.create("span",{"class":"git-author-icon-small",style:"margin-bottom:30px"},
c);g=new Image;g.src=b.AuthorImage;g.name=b.AuthorName;g.width=35;g.height=35;e.place(g,f,"first")}e.create("span",{"class":"gitSecondaryDescription",innerHTML:" authored by "+b.AuthorName+" ("+b.AuthorEmail+") on "+e.date.locale.format(new Date(b.Time),{formatLength:"short"})},c);e.create("div",null,c);e.create("span",{"class":"gitSecondaryDescription",innerHTML:"committed by "+b.CommitterName+" ("+b.CommitterEmail+")"},c)},show:function(){this.inherited(arguments);this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);
this.inherited(arguments)}})});
define("orion/git/gitCommands",["require","dojo","orion/commands","orion/util","orion/git/widgets/CloneGitRepositoryDialog","orion/git/widgets/InitGitRepositoryDialog","orion/git/widgets/AddRemoteDialog","orion/git/widgets/GitCredentialsDialog","orion/widgets/NewItemDialog","orion/git/widgets/RemotePrompterDialog","orion/git/widgets/ApplyPatchDialog","orion/git/widgets/OpenCommitDialog"],function(d,e,a,b){var c={};(function(){function f(h){var i;try{i=JSON.parse(h.responseText)}catch(j){i={Result:h.responseText}}i.HttpCode=
h.status;return i}var g=false;c.updateNavTools=function(h,i,j,l,n,p){var t=e.byId(j);if(t)e.empty(t);else throw"could not find toolbar "+j;var v=h.getService("orion.page.command");v.renderCommands(t,"dom",n,i,"button");if(p)if(j=e.byId(p)){e.empty(j);v.renderCommands(j,"dom",n,i,"button",true)}if(l)if(e.byId(l)){e.empty(l);v.renderCommands(l,"dom",null,i,"button")}if(!g){g=true;h.getService("orion.page.selection").addEventListener("selectionChanged",function(r,u){if(r=e.byId(l)){e.empty(r);v.renderCommands(r,
"dom",u,i,"button")}})}};c.getNewItemName=function(h,i,j,l,n,p,t,v){var r,u;if(j)r=e.byId(l);else if(i.makeNewItemPlaceHolder!=null)if(h=i.makeNewItemPlaceHolder(h,l,t)){r=h.refNode;u=h.tempNode}else r=e.byId(l);if(r)b.getUserText(l+"EditBox",r,false,n,e.hitch(this,function(q){if(q){u&&u.parentNode.removeChild(u);p(q)}}),undefined,undefined,undefined,v);else(l=window.prompt(n))&&p(l)};c.handleKnownHostsError=function(h,i,j,l){if(confirm("Would you like to add "+i.KeyType+" key for host "+i.Host+" to continue operation? Key fingerpt is "+
i.HostFingerprint+".")){var n=h.getService("orion.net.ssh");n.addKnownHosts(i.Host+" "+i.KeyType+" "+i.HostKey).then(function(){n.getKnownHosts().then(function(t){j.knownHosts=t;l(j)});if(j.failedOperation){var p=h.getService("orion.page.progress");e.hitch(p,p.removeOperation)(j.failedOperation.Location,j.failedOperation.Id)}})}};c.handleSshAuthenticationError=function(h,i,j,l,n){i=new orion.git.widgets.GitCredentialsDialog({title:n,serviceRegistry:h,func:l,errordata:j.errordata,failedOperation:j.failedOperation});
i.startup();i.show();if(j.failedOperation){h=h.getService("orion.page.progress");e.hitch(h,h.removeOperation)(j.failedOperation.Location,j.failedOperation.Id)}};c.getDefaultSshOptions=function(h,i){var j=new e.Deferred;h=h.getService("orion.net.ssh");var l=i&&!i.optionsRequested?i.valueFor("sshuser"):"",n=i&&!i.optionsRequested?i.valueFor("sshpassword"):"";h.getKnownHosts().then(function(p){j.callback({knownHosts:p,gitSshUsername:l,gitSshPassword:n,gitPrivateKey:"",gitPassphrase:""})});return j};
c.handleProgressServiceResponse=function(h,i,j,l,n,p){if(h&&h.status)h=f(h);if(!h||!h.HttpCode)l&&l(h);else switch(h.HttpCode){case 200:case 201:case 202:l&&l(h.Result);return;case 401:if(h.JsonData)i.errordata=h.JsonData;if(h.failedOperation)i.failedOperation=h.failedOperation;e.hitch(this,c.handleSshAuthenticationError)(j,h.JsonData,i,n,p);return;case 400:if(h.JsonData&&h.JsonData.HostKey){if(h.failedOperation)i.failedOperation=h.failedOperation;e.hitch(this,c.handleKnownHostsError)(j,h.JsonData,
i,n);return}default:i=[];i.Severity="Error";i.HTML=false;try{i.Message=h.DetailedMessage?h.DetailedMessage:h.Message}catch(t){i.Message=error.message}j.getService("orion.page.message").setProgressResult(i);break}};c.gatherSshCredentials=function(h,i,j,l){var n=new e.Deferred,p=function(t){h.getService("orion.net.ssh").getKnownHosts().then(function(v){n.callback({knownHosts:v,gitSshUsername:t.gitSshUsername,gitSshPassword:t.gitSshPassword,gitPrivateKey:t.gitPrivateKey,gitPassphrase:t.gitPassphrase})})};
if(j&&j.HostKey){confirm("Would you like to add "+j.KeyType+" key for host "+j.Host+" to continue operation? Key fingerpt is "+j.HostFingerprint+".")&&h.getService("orion.net.ssh").addKnownHosts(j.Host+" "+j.KeyType+" "+j.HostKey).then(function(){p({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})});return n}if(i){j=i.parameters?i.parameters.valueFor("sshuser"):"";i=i.parameters?i.parameters.valueFor("sshpassword"):"";p({gitSshUsername:j,gitSshPassword:i,gitPrivateKey:"",gitPassphrase:""});
return n}i=new orion.git.widgets.GitCredentialsDialog({title:l,serviceRegistry:h,func:p,errordata:j});i.startup();i.show();return n};c.handleProgressServiceResponse2=function(h,i,j,l){if(h&&h.status)h=f(h);if(!h||!h.HttpCode)j&&j(h);else switch(h.HttpCode){case 200:case 201:case 202:j&&j(h.Result);return;case 401:if(h.failedOperation){i=i.getService("orion.page.progress");e.hitch(i,i.removeOperation)(h.failedOperation.Location,h.failedOperation.Id)}l(h);return;case 400:if(h.JsonData&&h.JsonData.HostKey){if(h.failedOperation){i=
i.getService("orion.page.progress");e.hitch(i,i.removeOperation)(h.failedOperation.Location,h.failedOperation.Id)}l(h);return}default:l=[];l.Severity="Error";l.HTML=false;try{l.Message=h.DetailedMessage?h.DetailedMessage:h.Message}catch(n){l.Message=error.message}i.getService("orion.page.message").setProgressResult(l);break}};c.createFileCommands=function(h,i,j){function l(p){if(!(p.status===401||p.status===403)){var t=[];t.Severity="Error";t.HTML=false;try{var v=JSON.parse(p.responseText);t.Message=
v.DetailedMessage?v.DetailedMessage:v.Message}catch(r){t.Message=p.message}h.getService("orion.page.message").setProgressResult(t)}}var n=new a.Command({name:"Link Repository",imageClass:"core-sprite-link",id:"eclipse.linkRepository",callback:function(p){var t=new orion.widgets.NewItemDialog({title:"Link Repository",label:"Folder name:",func:function(v){var r=h.getService("orion.core.file");r.loadWorkspace("").then(function(u){r.createProject(u.Location,v,p.items.ContentLocation,false).then(function(q){alert("Repository was linked to "+
q.Name);r.read(q.ContentLocation,true).then(function(x){window.location.replace(d.toUrl("navigate/table.html")+"#"+x.ChildrenLocation)})})})},advanced:false});t.startup();t.show()},visibleWhen:function(p){if(p.ContentLocation)return true;return false}});i.addCommand(n,"object");n=new a.Command({name:"Checkout",tooltip:"Checkout the current tag, creating a local branch based on its contents.",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",callback:function(p){function t(){if(v.Repository)return v.Repository.BranchLocation;
for(var r in v.parent.parent.children)if(v.parent.parent.children[r].Name==="Branches")return v.parent.parent.children[r];return v.parent.parent}var v=p.items;c.getNewItemName(v,j,false,p.domNode.id,"tag_"+v.Name,function(r){if(!(!r&&r=="")){var u;u=v.Repository!=null?v.Repository.Location:v.parent.parent.Location;h.getService("orion.git.provider").checkoutTag(u,v.Name,r).then(function(){e.hitch(j,j.changedItem)(t())},l)}},undefined,true)},visibleWhen:function(p){return p.Type==="Tag"}});i.addCommand(n,
"object");n=new a.Command({name:"Checkout",tooltip:"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutBranch",callback:function(p){var t=p.items,v=h.getService("orion.git.provider"),r=h.getService("orion.page.message");r.setProgressMessage("Checking out branch...");t.Type==="Branch"?
v.checkoutBranch(t.CloneLocation,t.Name).then(function(){e.hitch(j,j.changedItem)(t.parent);r.setProgressResult("Ok")},l):v.addBranch(t.Repository!=null?t.Repository.BranchLocation:t.parent.parent.BranchLocation,null,t.Name).then(function(u){v.checkoutBranch(u.CloneLocation,u.Name).then(function(){e.hitch(j,j.changedItem)(t.Repository?t.Repository.BranchLocation:t.parent.parent.parent);r.setProgressResult("Ok")},l)},l)},visibleWhen:function(p){return p.Type==="Branch"||p.Type==="RemoteTrackingBranch"}});
i.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:")],false);n=new a.Command({name:"New Branch",tooltip:"Add a new local branch to the repository",imageClass:"core-sprite-add",id:"eclipse.addBranch",parameters:n,callback:function(p){var t=p.items,v=function(u,q){h.getService("orion.git.provider").addBranch(u,q).then(function(){e.hitch(j,j.changedItem)(t)},l)},r;r=t.Type==="Clone"?t.BranchLocation:t.Location;p.parameters.valueFor("name")&&!p.parameters.optionsRequested?
v(r,p.parameters.valueFor("name")):c.getNewItemName(t,j,false,p.domNode.id,"Branch name",function(u){!u&&u==""||v(r,u)})},visibleWhen:function(p){return p.GroupNode&&p.Name==="Branches"||p.Type==="Clone"&&j.parentId==="artifacts"}});i.addCommand(n,"object");i.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the local branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(p){var t=p.items;confirm("Are you sure you want to delete branch "+
t.Name+"?")&&h.getService("orion.git.provider").removeBranch(t.Location).then(function(){if(j.changedItem)e.hitch(j,j.changedItem)(t.parent);else j.displayBranches&&e.hitch(j,j.displayBranches)(t.ParentLocation,null)},l)},visibleWhen:function(p){return p.Type==="Branch"&&!p.Current}});i.addCommand(n,"object");n=new a.Command({name:"Delete",tooltip:"Delete the remote tracking branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(p){var t=p.items;
confirm("You're going to delete remote branch "+t.Name+" and push the change.\n\nAre you sure?")&&c.getDefaultSshOptions(h).then(function(v){var r=arguments.callee;h.getService("orion.git.provider").doPush(t.Location,"",false,false,null,"Removing remote branch: "+t.Name,v.gitSshUsername,v.gitSshPassword,v.knownHosts,v.gitPrivateKey,v.gitPassphrase).then(function(u){c.handleProgressServiceResponse(u,v,h,function(q){q.Result.Severity=="Ok"&&e.hitch(j,j.changedItem)(t.parent)},r,"Delete Remote Branch")},
function(u){c.handleProgressServiceResponse(u,v,h,function(){},r,"Removing remote branch: "+t.Name)})})},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"}});i.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:"),new a.CommandParameter("url","url","Url:")],false);n=new a.Command({name:"New Remote",tooltip:"Add a new remote to the repository",imageClass:"core-sprite-add",id:"eclipse.addRemote",parameters:n,callback:function(p){var t=p.items,
v=function(u,q,x){h.getService("orion.git.provider").addRemote(u,q,x).then(function(){e.hitch(j,j.changedItem)(t)},l)},r;r=t.Type==="Clone"?t.RemoteLocation:t.Location;if(p.parameters.valueFor("name")&&p.parameters.valueFor("url")&&!p.parameters.optionsRequested)v(r,p.parameters.valueFor("name"),p.parameters.valueFor("url"));else{p=new orion.git.widgets.AddRemoteDialog({func:function(u,q){v(r,u,q)}});p.startup();p.show()}},visibleWhen:function(p){return p.GroupNode&&p.Name==="Remotes"||p.Type==="Clone"&&
j.parentId==="artifacts"}});i.addCommand(n,"object");i.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the remote from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(p){var t=p.items;confirm("Are you sure you want to delete remote "+t.Name+"?")&&h.getService("orion.git.provider").removeRemote(t.Location).then(function(){e.hitch(j,j.changedItem)(t.parent)},l)},visibleWhen:function(p){return p.Type==="Remote"}});i.addCommand(n,"object");
n=new a.Command({name:"Pull",tooltip:"Pull from the repository",imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(p){var t=p.items,v=t.Location;c.getDefaultSshOptions(h).then(function(r){var u=arguments.callee;h.getService("orion.git.provider").doPull(v,false,null,r.gitSshUsername,r.gitSshPassword,r.knownHosts,r.gitPrivateKey,r.gitPassphrase).then(function(q){c.handleProgressServiceResponse(q,r,h,function(){e.xhrGet({url:v,headers:{"Orion-Version":"1"},
postData:e.toJson({GitSshUsername:r.gitSshUsername,GitSshPassword:r.gitSshPassword,GitSshPrivateKey:r.gitPrivateKey,GitSshPassphrase:r.gitPassphrase,GitSshKnownHost:r.knownHosts}),handleAs:"json",timeout:5E3,load:function(x){return x},error:function(x,z){console.error("HTTP status code: ",z.xhr.status);return x}}).then(function(){t.Type==="Clone"&&e.hitch(j,j.changedItem)(t)},l)},u,"Pull Git Repository")},function(q){c.handleProgressServiceResponse(q,r,h,function(){},u,"Pull Git Repository")})})},
visibleWhen:function(p){return p.Type==="Clone"}});i.addCommand(n,"object");n=new a.Command({name:"Git Log",tooltip:"Open the log for the branch",id:"eclipse.openGitLog",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(p){p=p.items;if(p.Type==="RemoteTrackingBranch")return d.toUrl("git/git-log.html")+"#"+p.Location+"?page=1";return d.toUrl("git/git-log.html")+"#"+p.CommitLocation+"?page=1"},visibleWhen:function(p){return p.Type==="Branch"||p.Type==="RemoteTrackingBranch"}});
i.addCommand(n,"object");n=new a.Command({name:"Git Log",tooltip:"Open the log for the repository",id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(p){return d.toUrl("git/git-log.html")+"#"+p.items.CommitLocation+"?page=1"},visibleWhen:function(p){if(!p.CommitLocation||!p.StatusLocation)return false;return true}});i.addCommand(n,"object");n=new a.Command({name:"Git Status",tooltip:"Open the status for the repository",id:"eclipse.openGitStatus",
imageClass:"git-sprite-status",spriteClass:"gitCommandSprite",hrefCallback:function(p){return d.toUrl("git/git-status.html")+"#"+p.items.StatusLocation},visibleWhen:function(p){if(!p.StatusLocation)return false;return true}});i.addCommand(n,"object");n=new a.Command({name:"Show in Navigator",tooltip:"Show the repository folder in the file navigator",id:"eclipse.openCloneContent",hrefCallback:function(p){return d.toUrl("navigate/table.html")+"#"+p.items.ContentLocation+"?depth=1"},visibleWhen:function(p){if(!p.ContentLocation)return false;
return true}});i.addCommand(n,"object");n=new a.Command({name:"Compare With Each Other",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareGitCommits",hrefCallback:function(p){p=p.items;var t=new e.Deferred;h.getService("orion.git.provider").getDiff(p[1].DiffLocation,p[0].Name,function(v,r){t.callback(d.toUrl("compare/compare.html")+"?readonly#"+r.xhr.getResponseHeader("Location"))});return t},visibleWhen:function(p){if(j.isDirectory)return false;if(e.isArray(p)&&
p.length===2&&p[0].Type==="Commit"&&p[1].Type==="Commit")return true;return false}});i.addCommand(n,"dom");n=new a.Command({name:"Compare With Working Tree",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(p){return d.toUrl("compare/compare.html")+"#"+p.items.DiffLocation},visibleWhen:function(p){return p.Type==="Commit"&&!j.isDirectory}});i.addCommand(n,"object");n=new a.Command({name:"Open",id:"eclipse.openGitCommit",hrefCallback:function(p){return d.toUrl("edit/edit.html")+
"#"+p.items.ContentLocation},visibleWhen:function(p){return p.Type==="Commit"&&p.ContentLocation!=null&&!j.isDirectory}});i.addCommand(n,"object");n=new a.Command({name:"Fetch",tooltip:"Fetch from the remote",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(p){var t=p.items,v=t.Location,r=function(q,x){if(q.JsonData.HostKey)u(x,q.JsonData);else if(x){x.parameters=q.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword",
"password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);x.parameters.errorData=q.JsonData;i._collectParameters(x)}else u(null,q.JsonData)},u=function(q,x){c.gatherSshCredentials(h,q,x).then(function(z){var C=h.getService("orion.git.provider");C.doFetch(v,false,null,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(k){c.handleProgressServiceResponse2(k,
h,function(){C.getGitRemote(v).then(function(m){j.parentId==="explorer-tree"&&C.getLog(m.HeadLocation,m.Id,"Getting git incoming changes",function(o){j.renderer.setIncomingCommits(o.Children);j.loadCommitsList(m.CommitLocation+"?page=1",m,true)});e.hitch(j,j.changedItem)(t)},l)},function(m){r(m,q)})},function(k){c.handleProgressServiceResponse2(k,h,function(){},function(m){r(m,q)})})})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;
p.parameters.errorData=null}else u(p)},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||p.Type==="Remote"}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Force Fetch",tooltip:"Fetch from the remote branch into your remote tracking branch overriding its current content",id:"eclipse.orion.git.fetchForce",callback:function(p){if(confirm("You're going to override content of the remote tracking branch. This can cause the branch to lose commits.\n\nAre you sure?")){var t=
p.items,v=t.Location,r=function(q,x){if(q.JsonData.HostKey)u(x,q.JsonData);else if(x){x.parameters=q.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);x.parameters.errorData=q.JsonData;i._collectParameters(x)}else u(null,q.JsonData)},u=function(q,x){c.gatherSshCredentials(h,q,
x).then(function(z){var C=h.getService("orion.git.provider");C.doFetch(v,true,null,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(k){c.handleProgressServiceResponse2(k,h,function(){C.getGitRemote(v).then(function(m){j.parentId==="explorer-tree"&&C.getLog(m.HeadLocation,m.Id,"Getting git incoming changes",function(o){j.renderer.setIncomingCommits(o.Children);j.loadCommitsList(m.CommitLocation+"?page=1",m,true)});e.hitch(j,j.changedItem)(t)},l)},function(m){r(m,
q)})},function(k){c.handleProgressServiceResponse2(k,h,function(){},function(m){r(m,q)})})})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)}},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||p.Type==="Remote"}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(p){var t=p.items;p=h.getService("orion.git.provider");var v=h.getService("orion.page.message");p.doMerge(t.HeadLocation,t.Name).then(function(r){var u=[];if(r.jsonData&&(r.jsonData.Result=="FAST_FORWARD"||r.jsonData.Result=="ALREADY_UP_TO_DATE")){e.query(".treeTableRow").forEach(function(x){e.toggleClass(x,"incomingCommitsdRow",false)});u.Severity="Ok";u.HTML=false;u.Message=r.jsonData.Result;e.hitch(j,j.changedItem)(t)}else if(r.jsonData){var q=
t.HeadLocation.replace("commit/HEAD","status");u.Severity="Warning";u.HTML=true;u.Message="<span>"+r.jsonData.Result+'. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+q+'">Git Status page</a>.<span>'}else if(r.error){q=t.HeadLocation.replace("commit/HEAD","status");u.Severity="Error";if(r.error.responseText&&JSON.parse(r.error.responseText)){r=JSON.parse(r.error.responseText);u.Message=r.DetailedMessage?r.DetailedMessage:r.Message}else u.Message=r.error.message;u.HTML=true;u.Message="<span>"+
u.Message+' Go to <a href="'+d.toUrl("git/git-status.html")+"#"+q+'">Git Status page</a>.<span>'}v.setProgressResult(u)},function(r,u){r=[];var q=t.HeadLocation.replace("commit/HEAD","status");r.Severity="Error";r.HTML=true;r.Message="<span>"+e.fromJson(u.xhr.responseText).DetailedMessage+'. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+q+'">Git Status page</a>.<span>';h.getService("orion.page.message").setProgressResult(r)})},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||
p.Type==="Branch"&&!p.Current}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Rebase",tooltip:"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(p){var t=p.items;h.getService("orion.git.provider").doRebase(t.HeadLocation,
t.Name,"BEGIN",function(v){var r=[],u=t.HeadLocation.replace("commit/HEAD","status");if(v.Result=="OK"||v.Result=="FAST_FORWARD"||v.Result=="UP_TO_DATE"){r.Severity="Ok";r.HTML=false;r.Message=v.Result;e.hitch(j,j.changedItem)(t)}else if(v.Result=="STOPPED"){r.Severity="Warning";r.HTML=true;r.Message="<span>"+v.Result+'. Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(v.Result==
"FAILED_WRONG_REPOSITORY_STATE"){r.Severity="Error";r.HTML=true;r.Message="<span>"+v.Result+'. Repository state is invalid (i.e. already during rebasing). Go to <a href="'+d.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(v.Result=="FAILED_UNMERGED_PATHS"){r.Severity="Error";r.HTML=true;r.Message="<span>"+v.Result+'. Repository contains unmerged paths. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(v.Result=="FAILED_PENDING_CHANGES"){r.Severity=
"Error";r.HTML=true;r.Message="<span>"+v.Result+'. Repository contains pending changes. Please commit or stash them. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else{r.Severity="Warning";r.HTML=true;r.Message="<span>"+v.Result+'. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}h.getService("orion.page.message").setProgressResult(r)},l)},visibleWhen:function(p){this.tooltip="Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of '"+
p.Name+"' and applying each commit again to the updated active branch.";return p.Type==="RemoteTrackingBranch"||p.Type==="Branch"&&!p.Current}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Push All",tooltip:"Push commits and tags from your local branch into the remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(p){var t=p.items,v=e.hash();if(t.toRef)t=t.toRef;var r=function(q,x){if(q.JsonData.HostKey)u(x,
q.JsonData);else if(x){x.parameters=q.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);x.parameters.errorData=q.JsonData;i._collectParameters(x)}else u(null,q.JsonData)},u=function(q,x){c.gatherSshCredentials(h,q,x).then(function(z){var C=h.getService("orion.git.provider");if(t.RemoteLocation.length==
1&&t.RemoteLocation[0].Children.length==1)C.doPush(t.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,"Pushing remote: "+v,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(m){c.handleProgressServiceResponse2(m,h,function(){if(j.parentId==="explorer-tree"){if(!m||!m.HttpCode)e.query(".treeTableRow").forEach(function(o){e.toggleClass(o,"outgoingCommitsdRow",false)})}else e.hitch(j,j.changedItem)()},function(o){r(o,q)})},function(m){c.handleProgressServiceResponse2(m,
h,function(){},function(o){r(o,q)})});else{var k=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:h,gitClient:C,treeRoot:{Children:t.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(m,o){C.doPush(m.Location,"HEAD",true,true,null,"Pushing remote: "+o.Name,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(s){c.handleProgressServiceResponse2(s,h,function(){if(j.parentId==="explorer-tree"){if(!s||!s.HttpCode)e.query(".treeTableRow").forEach(function(w){e.toggleClass(w,
"outgoingCommitsdRow",false)})}else e.hitch(j,j.changedItem)()},function(w){r(w,q)})},function(s){c.handleProgressServiceResponse2(s,h,function(){},function(w){r(w,q)})})})});k.startup();k.show()}})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)},visibleWhen:function(p){return p.toRef?p.RepositoryPath===""&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation:p.Type==="Branch"&&p.Current&&
p.RemoteLocation}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Force Push All",tooltip:"Push commits and tags from your local branch into the remote branch overriding its current content",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(p){if(confirm("You're going to override content of the remote branch. This can cause the remote repository to lose commits.\n\nAre you sure?")){var t=p.items,v=e.hash();if(t.toRef)t=
t.toRef;var r=function(q,x){if(q.JsonData.HostKey)u(x,q.JsonData);else if(x){x.parameters=q.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);x.parameters.errorData=q.JsonData;i._collectParameters(x)}else u(null,q.JsonData)},u=function(q,x){c.gatherSshCredentials(h,q,x).then(function(z){var C=
h.getService("orion.git.provider");if(t.RemoteLocation.length==1&&t.RemoteLocation[0].Children.length==1)C.doPush(t.RemoteLocation[0].Children[0].Location,"HEAD",true,true,null,"Pushing remote: "+v,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(m){c.handleProgressServiceResponse2(m,h,function(){if(j.parentId==="explorer-tree"){if(!m||!m.HttpCode)e.query(".treeTableRow").forEach(function(o){e.toggleClass(o,"outgoingCommitsdRow",false)})}else e.hitch(j,
j.changedItem)()},function(o){r(o,q)})},function(m){c.handleProgressServiceResponse2(m,h,function(){},function(o){r(o,q)})});else{var k=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:h,gitClient:C,treeRoot:{Children:t.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(m,o){C.doPush(m.Location,"HEAD",true,true,null,"Pushing remote: "+o.Name,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(s){c.handleProgressServiceResponse2(s,
h,function(){if(j.parentId==="explorer-tree"){if(!s||!s.HttpCode)e.query(".treeTableRow").forEach(function(w){e.toggleClass(w,"outgoingCommitsdRow",false)})}else e.hitch(j,j.changedItem)()},function(w){r(w,q)})},function(s){c.handleProgressServiceResponse2(s,h,function(){},function(w){r(w,q)})})})});k.startup();k.show()}})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)}},visibleWhen:function(p){if(p.toRef)return p.RepositoryPath===
""&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Switch to Remote",tooltip:"Show the log for the corresponding remote tracking branch",id:"eclipse.orion.git.switchToRemote",hrefCallback:function(p){return d.toUrl("git/git-log.html")+"#"+p.items.toRef.RemoteLocation[0].Children[0].Location+"?page=1"},visibleWhen:function(p){return p.toRef!=null&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation&&
p.toRef.RemoteLocation.length===1&&p.toRef.RemoteLocation[0].Children.length===1}});i.addCommand(n,"dom");n=new a.Command({name:"< Previous Page",tooltip:"Show previous page of git log",id:"eclipse.orion.git.previousLogPage",hrefCallback:function(p){return d.toUrl("git/git-log.html")+"#"+p.items.PreviousLocation},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch"||p.toRef!=null&&p.toRef.Type==="Branch"||p.RepositoryPath!=null)return p.PreviousLocation!==undefined;return false}});i.addCommand(n,
"dom");n=new a.Command({name:"Next Page >",tooltip:"Show next page of git log",id:"eclipse.orion.git.nextLogPage",hrefCallback:function(p){return d.toUrl("git/git-log.html")+"#"+p.items.NextLocation},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch"||p.toRef!=null&&p.toRef.Type==="Branch"||p.RepositoryPath!=null)return p.NextLocation!==undefined;return false}});i.addCommand(n,"dom");n=new a.Command({name:"Switch to Active Local",tooltip:"Show the log for the active local branch",id:"eclipse.orion.git.switchToCurrentLocal",
hrefCallback:function(p){p=p.items;var t=new e.Deferred,v=p.CloneLocation;if(v==null)v=JSON.parse(p.responseText).JsonData.CloneLocation;var r=h.getService("orion.git.provider");e.xhrGet({url:v,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(u){r.getGitClone(u.Children[0].BranchLocation,function(q){e.forEach(q.Children,function(x){x.Current==true&&t.callback(d.toUrl("git/git-log.html")+"#"+x.CommitLocation+"?page=1")})})}});return t},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch")return true;
try{if(JSON.parse(p.responseText).JsonData)return true}catch(t){}return false}});i.addCommand(n,"dom");n=new a.Command({name:"Push to...",tooltip:"Push from your local branch into the selected remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushto",callback:function(p){var t=p.items;p={};for(var v in t.parent.parent.children)if(t.parent.parent.children[v].Name==="Remote")p=t.parent.parent.children[v];v=h.getService("orion.git.provider");p=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",
serviceRegistry:h,gitClient:v,treeRoot:p,func:e.hitch(this,function(r,u,q){console.info("Branch "+r+" remote "+u+" new branch "+q)})});p.startup();p.show()},visibleWhen:function(){return false}});i.addCommand(n,"dom");i.addCommand(n,"object");n=new a.Command({name:"Reset",tooltip:"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(p){var t=
p.items;if(confirm("The content of your active branch will be replaced with "+t.Name+". All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?")){p=h.getService("orion.git.provider");var v=h.getService("orion.page.message");v.setProgressMessage("Resetting index...");p.resetIndex(t.IndexLocation,t.Name).then(function(){var r={};r.Severity="Info";r.HTML=false;r.Message="Ok";e.hitch(j,j.changedItem)(t);v.setProgressResult(r)},function(r){var u={};u.Severity="Error";
u.HTML=false;u.Message=r.message;v.setProgressResult(u)})}},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"}});i.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:")],false);n=new a.Command({name:"Tag",tooltip:"Create a tag for the commit",imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:n,callback:function(p){var t=p.items,v=function(u,q){h.getService("orion.git.provider").doAddTag(u,
q).then(function(){e.hitch(j,j.changedItem)(t)},l)},r=t.Location;p.parameters.valueFor("name")&&!p.parameters.optionsRequested?v(r,p.parameters.valueFor("name")):c.getNewItemName(t,j,false,p.domNode.id,"Tag name",function(u){!u&&u==""||v(r,u)})},visibleWhen:function(p){return p.Type==="Commit"}});i.addCommand(n,"object");i.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the tag from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(p){var t=
p.items;confirm("Are you sure you want to delete tag "+t.Name+"?")&&h.getService("orion.git.provider").doRemoveTag(t.Location).then(function(){e.hitch(j,j.changedItem)(t.parent)},l)},visibleWhen:function(p){return p.Type==="Tag"}});i.addCommand(n,"object");n=new a.Command({name:"Cherry-Pick",tooltip:"Apply the change introduced by the commit to your active branch",id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry_pick",spriteClass:"gitCommandSprite",callback:function(p){var t=p.items,
v=e.hash(),r=h.getService("orion.git.provider");p=t.Location.replace(t.Name,"HEAD");r.doCherryPick(p,t.Name,function(u){var q=[],x=t.Location.replace("commit/"+t.Name,"status");if(u.Result=="OK"){q.Severity="Ok";if(u.HeadUpdated){q.HTML=false;q.Message=u.Result;j.parentId==="explorer-tree"&&e.xhrGet({url:v,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(z){return z},error:function(z,C){console.error("HTTP status code: ",C.xhr.status)}}).then(function(z){z.HeadLocation?r.getLog(z.HeadLocation,
z.Id,"Getting git incoming changes",function(C){j.renderer.setIncomingCommits(C.Children);j.loadCommitsList(z.CommitLocation+"?page=1",z,true)}):r.getLog(v,"HEAD","Getting git outgoing changes",function(C){j.renderer.setOutgoingCommits(C.Children);j.loadCommitsList(v,z,true)})})}else{q.HTML=true;q.Message="<span>Nothing changed.</span>"}}else if(u.Result=="CONFLICTING"){q.Severity="Warning";q.HTML=true;q.Message="<span>"+u.Result+'. Some conflicts occurred. Go to <a href="'+d.toUrl("git/git-status.html")+
"#"+x+'">Git Status page</a>.<span>'}else if(u.Result=="FAILED"){q.Severity="Error";q.HTML=true;q.Message="<span>"+u.Result+'. Go to <a href="'+d.toUrl("git/git-status.html")+"#"+x+'">Git Status page</a>.<span>'}else{q.Severity="Warning";q.HTML=false;q.Message=u.Result}h.getService("orion.page.message").setProgressResult(q)},l)},visibleWhen:function(p){return p.Type==="Commit"}});i.addCommand(n,"object");i.addCommand(n,"dom")};c.createStatusCommands=function(h,i,j,l,n){var p=new a.Command({name:"Fetch",
tooltip:"Fetch from the remote branch into your remote tracking branch",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(t){var v=t.items.Location,r=h.getService("orion.git.provider");c.getDefaultSshOptions(h).then(function(u){var q=arguments.callee;r.doFetch(v,false,null,u.gitSshUsername,u.gitSshPassword,u.knownHosts,u.gitPrivateKey,u.gitPassphrase).then(function(x){c.handleProgressServiceResponse(x,u,h,function(){e.xhrGet({url:v,headers:{"Orion-Version":"1"},
postData:e.toJson({GitSshUsername:u.gitSshUsername,GitSshPassword:u.gitSshPassword,GitSshPrivateKey:u.gitPrivateKey,GitSshPassphrase:u.gitPassphrase,GitSshKnownHost:u.knownHosts}),handleAs:"json",timeout:5E3,load:function(z){return z},error:function(z,C){console.error("HTTP status code: ",C.xhr.status)}}).then(function(z){r.getLog(z.HeadLocation,z.Id,"Getting git incoming changes",function(C){n._gitCommitNavigatorRem.renderer.setIncomingCommits(C.Children);n._gitCommitNavigatorRem.loadCommitsList(z.CommitLocation+
"?page=1&pageSize=5",z,true)})})},q,"Fetch Git Repository")},function(x){c.handleProgressServiceResponse(x,u,h,function(){},q,"Fetch Git Repository")})})},visibleWhen:function(t){return t.Type==="RemoteTrackingBranch"}});i.addCommand(p,"object");i.addCommand(p,"dom");i.registerCommandContribution("eclipse.orion.git.fetch",l+1);p=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",
callback:function(t){t=t.items;var v=h.getService("orion.git.provider"),r=h.getService("orion.page.message");v.doMerge(t.HeadLocation,t.Name).then(function(u){var q=[];if(u.jsonData&&(u.jsonData.Result=="FAST_FORWARD"||u.jsonData.Result=="ALREADY_UP_TO_DATE")){e.query(".treeTableRow").forEach(function(x){e.toggleClass(x,"incomingCommitsdRow",false)});q.Severity="Ok";q.HTML=false;q.Message=u.jsonData.Result;j();r.setProgressResult(q)}else if(u.jsonData){q.Severity="Warning";q.HTML=true;q.Message="<span>"+
u.jsonData.Result+"<span>";r.setProgressResult(q)}else if(u.error){q.Severity="Error";if(u.error.responseText&&JSON.parse(u.error.responseText)){u=JSON.parse(u.error.responseText);q.Message=u.DetailedMessage?u.DetailedMessage:u.Message}else q.Message=u.error.message;q.HTML=true;q.Message="<span>"+q.Message+"<span>";r.setProgressResult(q)}},function(u,q){u=[];u.Severity="Error";u.HTML=true;u.Message="<span>"+e.fromJson(q.xhr.responseText).DetailedMessage+"</span>";r.setProgressResult(u)})},visibleWhen:function(t){return t.Type===
"RemoteTrackingBranch"||t.Type==="Branch"&&!t.Current}});i.addCommand(p,"object");i.addCommand(p,"dom");i.registerCommandContribution("eclipse.orion.git.merge",l+2);p=new a.Command({name:"Push",tooltip:"Push from your local branch into the remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(t){var v=t.items,r=e.hash(),u=h.getService("orion.git.provider");if(v.RemoteLocation.length==1&&v.RemoteLocation[0].Children.length==1)c.getDefaultSshOptions(h).then(function(q){var x=
arguments.callee;u.doPush(v.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,"Pushing remote: "+r,q.gitSshUsername,q.gitSshPassword,q.knownHosts,q.gitPrivateKey,q.gitPassphrase).then(function(z){c.handleProgressServiceResponse(z,q,h,function(C){if(!C||!C.HttpCode){e.query(".treeTableRow").forEach(function(k){e.toggleClass(k,"outgoingCommitsdRow",false)});j()}},x,"Push Git Repository")},function(z){c.handleProgressServiceResponse(z,q,h,function(){},x,"Push Git Repository")})});else{t=
new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:h,gitClient:u,treeRoot:{Children:v.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(q,x){c.getDefaultSshOptions(h).then(function(z){var C=arguments.callee;u.doPush(q.Location,"HEAD",true,false,null,"Pushing remote: "+x,z.gitSshUsername,z.gitSshPassword,z.knownHosts,z.gitPrivateKey,z.gitPassphrase).then(function(k){c.handleProgressServiceResponse(k,z,h,function(m){if(!m||!m.HttpCode){e.query(".treeTableRow").forEach(function(o){e.toggleClass(o,
"outgoingCommitsdRow",false)});j()}},C,"Push Git Repository")})},function(z){c.handleProgressServiceResponse(z,options,h,function(){},func,"Pushing remote: "+x)})})});t.startup();t.show()}},visibleWhen:function(t){return t.Type==="LocalBranch"}});i.addCommand(p,"object");i.addCommand(p,"dom");i.registerCommandContribution("eclipse.orion.git.push",l+3)};c.createGitClonesCommands=function(h,i,j,l,n,p){function t(r){if(!(r.status===401||r.status===403)){var u=[];u.Severity="Error";u.HTML=false;try{var q=
JSON.parse(r.responseText);u.Message=q.DetailedMessage?q.DetailedMessage:q.Message}catch(x){u.Message=r.message}h.getService("orion.page.message").setProgressResult(u)}}function v(r){if(e.isArray(r))r=r.length>1?{}:r[0];return r}l=new a.ParametersDescription([new a.CommandParameter("key","text","Key:"),new a.CommandParameter("value","text","Value:")],false);l=new a.Command({name:"New Configuration Entry",tooltip:"Add a new entry to the repository configuration",imageClass:"core-sprite-add",id:"eclipse.orion.git.addConfigEntryCommand",
parameters:l,callback:function(r){var u=r.items,q=h.getService("orion.git.provider");r.parameters.valueFor("key")&&r.parameters.valueFor("value")&&q.addCloneConfigurationProperty(u.ConfigLocation,r.parameters.valueFor("key"),r.parameters.valueFor("value")).then(function(){e.hitch(j,j.changedItem)(u)},t)}});i.addCommand(l,"dom");l=new a.ParametersDescription([new a.CommandParameter("value","text","Value:")],false);l=new a.Command({name:"Edit",tooltip:"Edit the configuration entry",imageClass:"core-sprite-edit",
id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(r){var u=r.items,q=h.getService("orion.git.provider");r.parameters.valueFor("value")&&q.editCloneConfigurationProperty(u.Location,r.parameters.valueFor("value")).then(function(){e.hitch(j,j.changedItem)(u)},t)},visibleWhen:function(r){return r.Key&&r.Value&&r.Location}});i.addCommand(l,"object");l=new a.Command({name:"Delete",tooltip:"Delete the configuration entry",imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",
callback:e.hitch(this,function(r){var u=r.items;r=h.getService("orion.git.provider");confirm("Are you sure you want to delete "+u.Key+"?")&&r.deleteCloneConfigurationProperty(u.Location).then(function(){e.hitch(j,j.changedItem)(u)},t)}),visibleWhen:function(r){return r.Key&&r.Value&&r.Location}});i.addCommand(l,"object");l=new a.ParametersDescription([new a.CommandParameter("url","url","Repository URL:")],true);l=new a.Command({name:"Clone Repository",tooltip:"Clone an existing Git repository to a folder",
id:"eclipse.cloneGitRepository",parameters:l,callback:function(r){var u=h.getService("orion.git.provider"),q=function(x,z,C){c.getDefaultSshOptions(h).then(function(k){var m=arguments.callee;u.cloneGitRepository(C,x,z,j.defaultPath,k.gitSshUsername,k.gitSshPassword,k.knownHosts,k.gitPrivateKey,k.gitPassphrase).then(function(o){c.handleProgressServiceResponse(o,k,h,function(){j.redisplayClonesList&&e.hitch(j,j.redisplayClonesList)()},m,"Clone Git Repository")},function(o){c.handleProgressServiceResponse(o,
k,h,function(){},m,"Clone Git Repository")})})};if(r.parameters.valueFor("url")&&!r.parameters.optionsRequested)q(r.parameters.valueFor("url"));else{r=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:h,fileClient:p,url:r.parameters.valueFor("url"),alwaysShowAdvanced:r.parameters.optionsRequested,func:q});r.startup();r.show()}},visibleWhen:function(){return true}});i.addCommand(l,"dom");l=new a.ParametersDescription([new a.CommandParameter("folderName","text","New folder:")],true);l=
new a.Command({name:"Init Repository",tooltip:"Create a new Git repository in a new folder",id:"eclipse.initGitRepository",parameters:l,callback:function(r){var u=h.getService("orion.git.provider"),q=function(x,z,C){c.getDefaultSshOptions(h).then(function(k){var m=arguments.callee;u.cloneGitRepository(C,x,z,j.defaultPath).then(function(o){c.handleProgressServiceResponse(o,k,h,function(){j.redisplayClonesList&&e.hitch(j,j.redisplayClonesList)()},m,"Init Git Repository")},function(o){c.handleProgressServiceResponse(o,
k,h,function(){},m,"Init Git Repository")})})};if(r.parameters.valueFor("folderName")&&!r.parameters.optionsRequested)q(null,null,r.parameters.valueFor("folderName"));else{r=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:h,title:"Init Git Repository",fileClient:p,advancedOnly:true,func:q});r.startup();r.show()}},visibleWhen:function(){return true}});i.addCommand(l,"dom");l=new a.Command({name:"Delete",tooltip:"Delete the repository",imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",
visibleWhen:function(r){r=e.isArray(r)?r:[r];if(r.length===0)return false;for(var u=0;u<r.length;u++)if(!r[u].ContentLocation)return false;return true},callback:function(r){var u=r.items;r=h.getService("orion.git.provider");if(e.isArray(u)){if(confirm("Are you sure you want do delete "+u.length+" repositories?"))for(var q=0,x=0;x<u.length;x++)r.removeGitRepository(u[x].Location).then(function(){q++;q>=u.length&&j.redisplayClonesList&&e.hitch(j,j.redisplayClonesList)()},t)}else confirm("Are you sure you want to delete "+
u.Name+"?")&&r.removeGitRepository(u.Location).then(function(){j.redisplayClonesList&&e.hitch(j,j.redisplayClonesList)()},this.displayErrorOnStatus)}});i.addCommand(l,"object");i.addCommand(l,"dom");l=new a.Command({name:"Apply Patch",tooltip:"Apply a patch on the selected repository",id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",callback:function(r){r=v(r.items);r=new orion.git.widgets.ApplyPatchDialog({title:"Apply Patch",diffLocation:r.DiffLocation});
r.startup();r.show()},visibleWhen:function(r){return r.Type==="Clone"}});i.addCommand(l,"object");l=new a.ParametersDescription([new a.CommandParameter("commitName","text","Commit name:")],true);l=new a.Command({name:"Open Commit",tooltip:"Open the commit with the given name",id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:l,callback:function(r){var u=function(z,C,k){if(k==null)k=new e.Deferred;z.length>0?h.getService("orion.git.provider").doGitLog("/gitapi/commit/"+
r.parameters.valueFor("commitName")+z[0].ContentLocation+"?page=1&pageSize=1",null,null,"Looking for the commit").then(function(m){k.callback(m.Children[0].Location)},function(){u(z.slice(1),C,k)}):k.errback();return k},q=function(z){if(r.parameters.optionsRequested)(new orion.git.widgets.OpenCommitDialog({repositories:z,serviceRegistry:h,commitName:r.parameters.valueFor("commitName")})).show();else{h.getService("orion.page.message").setProgressMessage("Looking for the commit");u(z,r.parameters.valueFor("commitName")).then(function(C){C!==
null&&window.open("/git/git-commit.html#"+C+"?page=1&pageSize=1")},function(){var C=[];C.Severity="warning";C.HTML=false;C.Message="No commits found";h.getService("orion.page.message").setProgressResult(C)})}};if(r.items.Type==="Clone"){var x=[r.items];q(x)}else if(r.items.CloneLocation)h.getService("orion.git.provider").getGitClone(r.items.CloneLocation).then(function(z){q(z.Children)});else{x=r.items;q(x)}},visibleWhen:function(r){return r.Type==="Clone"||r.CloneLocation||r.length>1&&r[0].Type===
"Clone"}});i.addCommand(l,"dom");l=new a.Command({name:"Show in GitHub",tooltip:"Show this repository at GitHub",id:"orion.git.gotoGithub",hrefCallback:function(r){r=/github\.com.*\.git/.exec(r.items.GitUrl)[0];r=r.replace(":","/");return"https://"+r.substring(0,r.length-4)},visibleWhen:function(r){return r.GitUrl&&/github\.com.*\.git/.exec(r.GitUrl)}});i.addCommand(l,"dom");l=new a.Command({name:"Show in eclipse.org",tooltip:"Show this repository at eclipse.org",id:"orion.git.gotoEclipseGit",hrefCallback:function(r){r=
r.items;var u=r.GitUrl.indexOf("git.eclipse.org/gitroot");if(u>-1)return"http://git.eclipse.org/c"+r.GitUrl.substr(u+23,r.GitUrl.length)},visibleWhen:function(r){return r.GitUrl&&r.GitUrl.indexOf("git.eclipse.org/gitroot")>-1}});i.addCommand(l,"dom")}})();return c});
define("orion/git/gitCommitExplorer",["dojo","orion/explorer","orion/util","orion/globalCommands","orion/compare/diff-provider","orion/compare/compare-container","orion/breadcrumbs","orion/git/gitCommands"],function(d,e,a,b,c,f,g,h){e={};e.GitCommitExplorer=function(){function i(j,l,n,p,t,v,r){this.parentId=t;this.registry=j;this.commandService=l;this.linkService=n;this.selection=p;this.parentId=t;this.toolbarId=v;this.selectionToolsId=r;this.checkbox=false}i.prototype.handleError=function(j){var l=
{};l.Severity="Error";l.HTML=false;try{var n=JSON.parse(j.responseText);l.Message=n.DetailedMessage?n.DetailedMessage:n.Message}catch(p){l.Message=j.message}this.registry.getService("orion.page.message").setProgressResult(l);if(j.status===404){this.initTitleBar();this.displayCommit()}};i.prototype.changedItem=function(){this.redisplay()};i.prototype.redisplay=function(){this.display(d.hash())};i.prototype.display=function(j){var l=this,n=this.registry.getService("orion.page.message");n.setProgressMessage("Loading...");
this.registry.getService("orion.git.provider").getGitClone(j).then(function(p){if(p.Children.length===0){l.initTitleBar();l.displayCommit()}else if(p.Children.length==1&&p.Children[0].Type==="Commit"){var t=p.Children;l.registry.getService("orion.git.provider").getGitClone(p.CloneLocation).then(function(v){v=v.Children;l.initTitleBar(t[0],v[0]);l.displayCommit(t[0]);l.displayTags(t[0]);l.displayDiffs(t[0]);t[0].CloneLocation=v[0].Location;h.updateNavTools(l.registry,l,"pageActions","selectionTools",
t[0])},function(){d.hitch(l,l.handleError)(error)})}n.setProgressMessage("")},function(p){d.hitch(l,l.handleError)(p)})};i.prototype.initTitleBar=function(j,l){var n=this,p={};if(j){p.Name=j.Name;p.Parents=[];p.Parents[0]={};p.Parents[0].Name=l.Name;p.Parents[0].Location=l.Location;p.Parents[0].ChildrenLocation=l.Location;p.Parents[1]={};p.Parents[1].Name="Repositories";j=j.Name+" on "+l.Name+" - Git"}else{p.Name="";j="Git"}document.title=j;j=d.byId("location");new g.BreadCrumbs({container:j,resource:p,
makeHref:function(t,v){n.makeHref(t,v)}});b.setPageTarget(l,this.registry,this.commandService)};i.prototype.makeHref=function(j,l){j.href="/git/git-repository.html#"+(l?l:"")};i.prototype.displayCommit=function(j){var l=d.byId("table");d.empty(l);var n=d.create("div",{"class":"auxpaneHeading sectionWrapper toolComposite",id:"commitSectionHeader"},l);d.create("span",{"class":"git-decor-icon gitImageSprite git-sprite-modification"},n);d.create("div",{id:"commitSectionTitle","class":"layoutLeft",innerHTML:j?
"Commit Details":"No Commits"},n);d.create("div",{id:"commitSectionActionsArea","class":"layoutRight sectionActions"},n);if(j){d.place('<div class="git-table"><div class="plugin-settings"><list id="commitNode" class="plugin-settings-list"></list></div></div>',l);l=d.byId("commitNode");l=d.create("div",{"class":"git-list-item"},l);l=d.create("div",null,l);l=d.create("div",null,l);n=this._splitCommitMessage(j.Message);var p=d.create("div",null,l);p=d.create("span",{"class":"gitMainDescription"},p);
this.registry.getService("orion.core.textlink").addLinks(n[0],p);d.create("div",{style:"padding-top:15px"},l);if(n[1]!==null){p=d.create("pre",null,l);this.registry.getService("orion.core.textlink").addLinks(n[1],p);d.create("div",{style:"padding-top:15px"},l)}d.create("span",{"class":"gitSecondaryDescription",innerHTML:"commit: "+j.Name},l);if(j.Parents&&j.Parents.length>0){d.create("div",null,l);n=d.create("span",{"class":"gitSecondaryDescription"},l);d.place(document.createTextNode("parent: "),
n);link=d.create("a",{className:"pnavlinkonpage",href:"/git/git-commit.html#"+j.Parents[0].Location+"?page=1&pageSize=1"},n);d.place(document.createTextNode(j.Parents[0].Name),link)}d.create("div",{style:"padding-top:15px"},l);if(j.AuthorImage){n=d.create("span",{"class":"git-author-icon-small"},l);p=new Image;p.src=j.AuthorImage;p.name=j.AuthorName;p.width=35;p.height=35;d.place(p,n,"first")}d.create("span",{"class":"gitSecondaryDescription",innerHTML:"authored by "+j.AuthorName+" ("+j.AuthorEmail+
") on "+d.date.locale.format(new Date(j.Time),{formatLength:"short"})},l);d.create("div",null,l);d.create("span",{"class":"gitSecondaryDescription",innerHTML:"committed by "+j.CommitterName+" ("+j.CommitterEmail+")"},l)}};i.prototype._splitCommitMessage=function(j){var l=false,n=j.split(/(\r?\n|$)/)[0].trim();if(n.length>100){l=n.indexOf(" ",90);n=n.substring(0,l!==-1?l:100);l=true}j=j.substring(n.length+1,j.length).trim();j=j.length>0?l?"..."+j:j:null;n+=l?"...":"";return[n,j]};i.prototype.displayDiffs=
function(j){j=j.Diffs;var l=d.byId("table"),n=d.create("div",{"class":"auxpaneHeading sectionWrapper toolComposite",id:"diffSectionHeader"},l);d.create("div",{id:"diffSectionTitle","class":"layoutLeft",innerHTML:"Diffs"},n);d.create("div",{id:"diffSectionActionsArea","class":"layoutRight sectionActions"},n);d.place('<div class="git-table"><div class="plugin-settings"><list id="diffNode" class="plugin-settings-list"></list></div></div>',l);for(l=0;l<j.length;l++)this.renderDiff(j[l],l)};i.prototype.renderDiff=
function(j,l){var n=d.create("div",{"class":"git-list-item"},d.byId("diffNode"));n=d.create("div",null,n);var p=d.create("div",{style:"float:left"},n),t=j.OldPath;if(j.ChangeType==="ADD")t=j.NewPath;d.create("span",{"class":"gitMainDescription",innerHTML:t+" ("+j.ChangeType+") "},p);this.commandService.renderCommands(d.create("div",{id:"diffActionsArea_"+l,"class":"git-action-area"},n),"object",j,this,"tool",false);n=d.create("div",{"class":"git-list-item"},d.byId("diffNode"));n=d.create("div",null,
n);d.create("div",{id:"diffArea_"+l,style:"height:420px"},n);n={readonly:true,diffProvider:new f.DefaultDiffProvider(this.registry),callback:function(){}};l=new f.InlineCompareContainer(this.registry,"diffArea_"+l,n);l.setOptions({hasConflicts:false,complexURL:j.DiffLocation});l.setDiffTitle("Compare");l.startup()};i.prototype.displayTags=function(j){var l=j.Tags,n=d.byId("table"),p=d.create("div",{"class":"auxpaneHeading sectionWrapper toolComposite",id:"tagSectionHeader"},n);d.create("span",{"class":"git-decor-icon gitImageSprite git-sprite-tag"},
p);d.create("div",{id:"tagSectionTitle","class":"layoutLeft",innerHTML:l&&l.length>0?"Tags:":"No Tags"},p);d.create("div",{id:"tagSectionActionsArea","class":"layoutRight sectionActions"},p);d.place('<div id="tagSectionHeaderslideContainer" class="layoutBlock slideParameters slideContainer"><span id="tagSectionHeaderslideOut" class="slide"><span id="tagSectionHeaderpageCommandParameters" class="parameters"></span><span id="tagSectionHeaderpageCommandDismiss" class="parametersDismiss"></span></span></div>',
p);this.commandService.registerCommandContribution("eclipse.orion.git.addTag",2E3,"tagSectionActionsArea");this.commandService.renderCommands(d.byId("tagSectionActionsArea"),"dom",j,this,"button",false);if(!(!l&&l.length>0)){d.place('<div class="git-table"><div class="plugin-settings"><list id="tagNode" class="plugin-settings-list"></list></div></div>',n);for(j=0;j<l.length&&j<10;j++)this.renderTag(l[j])}};i.prototype.renderTag=function(j){var l=d.create("div",{"class":"git-list-item"},d.byId("tagNode"));
l=d.create("div",null,l);var n=d.create("div",{"class":"stretch"},l);d.create("span",{"class":"gitMainDescription",innerHTML:j.Name},n);d.create("div",null,l);this.commandService.renderCommands(d.create("div",{id:"tagActionsArea","class":"git-action-area"},l),"object",j,this,"tool",false)};return i}();return e});
define("orion/git/gitClient",["require","dojo","orion/auth"],function(d,e,a){var b=b||{};b.GitService=function(){function c(f){if(f){this._serviceRegistry=f;this._serviceRegistration=f.registerService("orion.git.provider",this);this._sshService=f.getService("orion.net.ssh")}}c.prototype={checkGitService:function(){},cloneGitRepository:function(f,g,h,i,j,l,n,p,t){var v=this,r={};if(f)r.Name=f;if(h)r.Path=h;if(g)r.GitUrl=g;r.Location=i;if(j)r.GitSshUsername=j;if(l)r.GitSshPassword=l;if(n)r.GitSshKnownHost=
n;if(p)r.GitSshPrivateKey=p;if(t)r.GitSshPassphrase=t;h=d.toUrl("gitapi/clone/._");h=h.substring(0,h.length-2);var u=new e.Deferred;e.xhrPost({url:h,headers:{"Orion-Version":"1"},postData:e.toJson(r),handleAs:"json",timeout:15E3,load:function(q,x){e.hitch(v,v._getGitServiceResponse)(u,q,x,g?"Cloning repository: "+g:"Initializing repository: "+f)},error:function(q,x){return e.hitch(v,v._handleGitServiceResponseError)(u,this,q,x)}});return u},removeGitRepository:function(f){var g=this,h=new e.Deferred;
e.xhrDelete({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Removing repository")},error:function(i,j){return e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j)}});return h},getDiffContent:function(f,g,h){var i=this,j=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,"Getting git diff",g,h)},
error:function(l,n){return e.hitch(i,i._handleGitServiceResponseError)(j,this,l,n,g,h,e.xhrGet)}});return j},getDiffFileURI:function(f,g,h){var i=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(j,l){e.hitch(service,service._getGitServiceResponse)(i,j,l,"Getting git diff",g,h)},error:function(j,l){e.hitch(service,service._handleGitServiceResponseError)(i,this,j,l,g,h,e.xhrGet)}});return i},getGitStatus:function(f,g,h){var i=
this,j=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,"Getting git status",g,h)},error:function(l,n){e.hitch(i,i._handleGitServiceResponseError)(j,this,l,n,g,h,e.xhrGet)}});return j},stage:function(f,g,h){var i=this,j=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,"Staging",g,h)},error:function(l,
n){e.hitch(i,i._handleGitServiceResponseError)(j,this,l,n,g,h)}});return j},stageMultipleFiles:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Path:g}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Staging",h,i)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},unstageAll:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:15E3,postData:e.toJson({Reset:g}),load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Unstaging",h,i)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},unstage:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:e.toJson({Path:g}),load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Unstaging",h,i)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,
this,n,p,h,i)}});return l},checkoutPath:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Path:g,RemoveUntracked:"true"}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Checking out",h,i)},error:function(n,p){return e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},commitAll:function(f,g,h,i,j){var l=this,n=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},handleAs:"json",
timeout:15E3,postData:h,load:function(p,t){e.hitch(l,l._getGitServiceResponse)(n,p,t,"Committing",i,j)},error:function(p,t){e.hitch(l,l._handleGitServiceResponseError)(n,this,p,t,i,j)}});return n},getGitClone:function(f,g,h){var i=this,j=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,"Getting git repository information",g)},error:function(l,n){e.hitch(i,i._handleGitServiceResponseError)(j,this,l,
n,g,h,e.xhrGet)}});return j},getGitCloneConfig:function(f){var g=this,h=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Getting git repository configuration")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j,null,null,e.xhrGet)}});return h},getGitBranch:function(f){var g=this,h=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,
j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Getting branch information")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j,null,null,e.xhrGet)}});return h},getGitRemote:function(f){var g=this,h=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Getting remote branch information")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j,null,null,e.xhrGet)}});
return h},checkoutBranch:function(f,g){var h=this,i=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Branch:g}),handleAs:"json",timeout:5E3,load:function(j,l){e.hitch(h,h._getGitServiceResponse)(i,j,l,g?"Checking out branch "+g:"Checking out branch")},error:function(j,l){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,l)}});return i},resetIndex:function(f,g){var h=this,i=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({Commit:g,Reset:"HARD"}),
handleAs:"json",timeout:5E3,load:function(j,l){e.hitch(h,h._getGitServiceResponse)(i,j,l,"Resetting index")},error:function(j,l){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,l)}});return i},addBranch:function(f,g,h){var i=this,j={};if(g)j.Name=g;if(h)j.Branch=h;var l=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson(j),handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(i,i._getGitServiceResponse)(l,n,p,g?"Adding branch "+g:"Adding branch")},error:function(n,
p){e.hitch(i,i._handleGitServiceResponseError)(l,this,n,p)}});return l},removeBranch:function(f){var g=this,h=new e.Deferred;e.xhrDelete({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Removing branch")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j)}});return h},addRemote:function(f,g,h){var i=this,j=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Remote:g,RemoteURI:h}),
handleAs:"json",timeout:5E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,g?"Adding remote "+g:"Adding remote")},error:function(l,n){e.hitch(i,i._handleGitServiceResponseError)(j,this,l,n)}});return j},removeRemote:function(f){var g=this,h=new e.Deferred;e.xhrDelete({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Removing remote")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,
j)}});return h},doGitLog:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,i?i:"Generating git log",g)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,g,h,e.xhrGet)}});return l},getDiff:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({New:g}),handleAs:"json",timeout:5E3,load:function(n,
p){e.hitch(j,j._getGitServiceResponse)(l,n,p,g?"Getting git diff for "+g:"Getting git diff",h)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i,e.xhrPost)}});return l},doFetch:function(f,g,h,i,j,l,n,p){var t=this,v=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({Fetch:"true",Force:g,GitSshUsername:i,GitSshPassword:j,GitSshKnownHost:l,GitSshPrivateKey:n,GitSshPassphrase:p}),handleAs:"json",timeout:5E3,load:function(r,u){e.hitch(t,t._getGitServiceResponse)(v,
r,u,"Fetching remote: "+f,h)},error:function(r,u){e.hitch(t,t._handleGitServiceResponseError)(v,this,r,u)}});return v},doPull:function(f,g,h,i,j,l,n,p){var t=this,v=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({Pull:"true",Force:g,GitSshUsername:i,GitSshPassword:j,GitSshKnownHost:l,GitSshPrivateKey:n,GitSshPassphrase:p}),handleAs:"json",timeout:5E3,load:function(r,u){e.hitch(t,t._getGitServiceResponse)(v,r,u,"Pulling : "+f,h)},error:function(r,u){e.hitch(t,t._handleGitServiceResponseError)(v,
this,r,u)}});return v},doMerge:function(f,g){var h=this,i=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({Merge:g}),handleAs:"json",timeout:5E3,load:function(j,l){var n=new e.Deferred;e.hitch(h,h._getGitServiceResponse)(n,j,l,"Merging "+f);n.then(function(p){i.callback({jsonData:p})})},error:function(j,l){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,l)}});return i},doCherryPick:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},
postData:e.toJson({"Cherry-Pick":g}),handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Cherry pick of "+g,h,i)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},doRebase:function(f,g,h,i,j){var l=this,n={};n.Rebase=g;if(h)n.Operation=h;var p=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson(n),handleAs:"json",timeout:5E3,load:function(t,v){e.hitch(l,l._getGitServiceResponse)(p,t,v,g?"Rebase on top of ":
"Rebase"+g,i,j)},error:function(t,v){e.hitch(l,l._handleGitServiceResponseError)(p,this,t,v,i,j)}});return p},doPush:function(f,g,h,i,j,l,n,p,t,v,r){var u=this,q=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({PushSrcRef:g,PushTags:h,Force:i,GitSshUsername:n,GitSshPassword:p,GitSshKnownHost:t,GitSshPrivateKey:v,GitSshPassphrase:r}),handleAs:"json",timeout:5E3,load:function(x,z){e.hitch(u,u._getGitServiceResponse)(q,x,z,l?l:"Pushing repository")},error:function(x,z){e.hitch(u,
u._handleGitServiceResponseError)(q,this,x,z)}});return q},getLog:function(f,g,h,i,j){var l=this,n=new e.Deferred,p=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({New:g}),handleAs:"json",timeout:5E3,load:function(t,v){p.callback(v.xhr.getResponseHeader("Location"))},error:function(t,v){e.hitch(l,l._handleGitServiceResponseError)(p,this,t,v,i,j,e.xhrPost)}});p.then(function(t){e.xhrGet({url:t,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(v,
r){e.hitch(l,l._getGitServiceResponse)(n,v,r,h?h:"Generating git log",i)},error:function(v,r){e.hitch(l,l._handleGitServiceResponseError)(n,this,v,r,i,j,e.xhrGet)}})});return n},getDefaultRemoteBranch:function(f,g,h){var i=this,j=new e.Deferred,l=new e.Deferred;e.xhrGet({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(i,i._getGitServiceResponse)(l,n,p,"Getting remote branches")},error:function(n,p){e.hitch(i,i._handleGitServiceResponseError)(l,this,n,p,g,
h,e.xhrGet)}});l.then(function(n){if(n.Children[0]==null)return null;e.xhrGet({url:n.Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(p,t){e.hitch(i,i._getGitServiceResponse)(j,p,t,"Getting default remote branch",g)},error:function(p,t){e.hitch(i,i._handleGitServiceResponseError)(j,this,p,t,g,h,e.xhrGet)}})});return j},doAddTag:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Name:g}),handleAs:"json",
timeout:5E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Adding tag ..."+g,h)},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},doRemoveTag:function(f){var g=this,h=new e.Deferred;e.xhrDelete({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(i,j){e.hitch(g,g._getGitServiceResponse)(h,i,j,"Removing tag ...")},error:function(i,j){e.hitch(g,g._handleGitServiceResponseError)(h,this,i,j)}});return h},checkoutTag:function(f,
g,h,i,j){var l=this,n=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Tag:g,Branch:h}),handleAs:"json",timeout:5E3,load:function(p,t){e.hitch(l,l._getGitServiceResponse)(n,p,t,"Checking out tag "+g,i,j)},error:function(p,t){e.hitch(l,l._handleGitServiceResponseError)(n,this,p,t,i,j)}});return n},addCloneConfigurationProperty:function(f,g,h,i,j){var l=this,n=new e.Deferred;e.xhrPost({url:f,headers:{"Orion-Version":"1"},postData:e.toJson({Key:g,Value:h}),handleAs:"json",
timeout:15E3,load:function(p,t){e.hitch(l,l._getGitServiceResponse)(n,p,t,"Adding configuration property "+g,i,j)},error:function(p,t){e.hitch(l,l._handleGitServiceResponseError)(n,this,p,t,i,j)}});return n},editCloneConfigurationProperty:function(f,g,h,i){var j=this,l=new e.Deferred;e.xhrPut({url:f,headers:{"Orion-Version":"1"},putData:e.toJson({Value:g}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(l,n,p,"Saving configuration property as "+g,h,i)},error:function(n,
p){e.hitch(j,j._handleGitServiceResponseError)(l,this,n,p,h,i)}});return l},deleteCloneConfigurationProperty:function(f,g,h){var i=this,j=new e.Deferred;e.xhrDelete({url:f,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(l,n){e.hitch(i,i._getGitServiceResponse)(j,l,n,"Deleting configuration property",g,h)},error:function(l,n){e.hitch(i,i._handleGitServiceResponseError)(j,this,l,n,g,h)}});return j},_getGitServiceResponse:function(f,g,h,i,j){var l=this;if(h&&h.xhr.status===202){h=
new e.Deferred;h.callback(g);return this._serviceRegistry.getService("orion.page.progress").showWhile(h,i).then(function(n){n=n.Result.Severity=="Ok"?n.Result.JsonData:n.Result;if(j)typeof j==="function"?j(n):l._serviceRegistration.dispatchEvent(j,n);f.callback(n)})}if(j)typeof j==="function"?j(g,h):l._serviceRegistration.dispatchEvent(j,g);f.callback(g)},_handleGitServiceResponseError:function(f,g,h,i,j,l,n){f||(f=new e.Deferred);if(h.status===401||h.status===403){a.handleAuthenticationError(i.xhr,
function(){n?n(g).then(function(p,t){f.callback(p,t)},function(p,t){l&&l(p,t);f.errback(p,t)}):f.errback(h)})!=null&&f.errback(h);return f}l&&l(h,i);f.errback(h);return f}};return c}();return b});
define("orion/links",[],function(){function d(e){this._init(e)}d.prototype={_init:function(e){this._registry=e.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(e,a,b,c,f){var g=e.search(b);if(g>0){a.appendChild(document.createTextNode(e.substring(0,g)));e=e.substring(g)}b=e.replace(b,"");g=e.substring(0,e.length-b.length);var h=g.split(" ",c);if(h.length===c){e=document.createElement("a");f=f;for(var i=0;i<c;i++)f=f.replace("%"+
(i+1),h[i]);e.setAttribute("href",f);e.innerHTML=g;a.appendChild(e);e=b}return e},addLinks:function(e,a){a=a||document.createElement("div");var b=this._registry.getServiceReferences("orion.core.linkScanner");if(b.length>0){var c=b[0];b=new RegExp(c.getProperty("pattern"),"i");var f=c.getProperty("words");c=c.getProperty("anchor");for(var g=e.search(b);g>=0;){e=this._replaceLink(e,a,b,f,c);g=e.search(b)}}e.length>0&&a.appendChild(document.createTextNode(e));return a}};d.prototype.constructor=d;return{TextLinkService:d}});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(d,e){d.declare("dojox.layout.ToggleSplitter",[e.layout._Splitter],{open:true,closedThreshold:5,openSize:"",_closedSize:"0",templateString:'<div class="dijitSplitter dojoxToggleSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_onMouseDown" tabIndex="0" role="separator"><div dojoAttachPoint="toggleNode" class="dijitSplitterThumb dojoxToggleSplitterIcon"></div></div>',postCreate:function(){this._started=
false;this.inherited(arguments);var a=this.region;d.addClass(this.domNode,"dojoxToggleSplitter"+a.charAt(0).toUpperCase()+a.substring(1));this.connect(this,"onDblClick","_toggleMe")},startup:function(){this.inherited(arguments);var a=this.child.domNode,b=d.style(a,this.horizontal?"height":"width");d.forEach(["toggleSplitterOpen","toggleSplitterClosedThreshold","toggleSplitterOpenSize"],function(c){var f=c.substring(14);f=f.charAt(0).toLowerCase()+f.substring(1);if(c in this.child)this[f]=this.child[c]},
this);if(!this.openSize)this.openSize=this.open?b+"px":"75px";this._openStyleProps=this._getStyleProps(a,true);this._started=true;this.set("open",this.open);return this},_onMouseUp:function(){d.disconnect(this._onMoveHandle);d.disconnect(this._onUpHandle);delete this._onMoveHandle;delete this._onUpHandle;delete this._startPosn},_onPrelimMouseMove:function(a){if(Math.abs((this._startPosn||0)-(this.horizontal?a.clientY:a.clientX))>=3){d.disconnect(this._onMoveHandle);this._startDrag(a)}},_onMouseDown:function(a){if(this.open){if(!this._onUpHandle)this._onUpHandle=
d.connect(d.body(),"onmouseup",this,"_onMouseUp");if(!this._onMoveHandle){this._startPosn=this.horizontal?a.clientY:a.clientX;this._onMoveHandle=d.connect(d.body(),"onmousemove",this,"_onPrelimMouseMove")}}},_handleOnChange:function(){var a=this.child.domNode,b;b=this.horizontal?"height":"width";if(this.open){var c=d.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);c[b]=this._openStyleProps&&this._openStyleProps[b]?this._openStyleProps[b]:this.openSize;d.style(a,
c);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{c=d.getComputedStyle(a);b=this._getStyleProps(a,true,c);c=this._getStyleProps(a,false,c);this._openStyleProps=b;d.style(a,c)}this._setStateClass();this.container._started&&this.container._layoutChildren(this.region)},_getStyleProps:function(a,b,c){c||(c=d.getComputedStyle(a));var f={},g=this.horizontal?"height":"width";f.visibility=b?c.visibility:"hidden";f[g]=b?a.style[g]||c[g]:this._closedSize;var h=["Top","Right","Bottom","Left"];
d.forEach(["padding","margin","border"],function(i){for(var j=0;j<h.length;j++){var l=i+h[j];if(i=="border")i+="Width";if(undefined!==c[l])f[l]=b?c[l]:0}});return f},_setStateClass:function(){if(this.open){d.removeClass(this.domNode,"dojoxToggleSplitterClosed");d.addClass(this.domNode,"dojoxToggleSplitterOpen");d.removeClass(this.toggleNode,"dojoxToggleSplitterIconClosed");d.addClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}else{d.addClass(this.domNode,"dojoxToggleSplitterClosed");d.removeClass(this.domNode,
"dojoxToggleSplitterOpen");d.addClass(this.toggleNode,"dojoxToggleSplitterIconClosed");d.removeClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}},_setOpenAttr:function(a){if(this._started){this.open=a;this._handleOnChange(a,true);this[this.open?"onOpen":"onClose"](this.child)}},onOpen:function(){},onClose:function(){},_toggleMe:function(a){a&&d.stopEvent(a);this.set("open",!this.open)},_onKeyPress:function(){this.inherited(arguments)}});d.extend(e._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(d,e){d.declare("orion.widgets.eWebBorderContainer",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredLeftPaneWidth:function(){var a=this.getSizeCookie();return a<=0?d.position(this.getRightPane()).w*0.25:a},isLeftPaneOpen:function(){var a=this.getSplitter("left");if(a)return a.open;return false},getLeftPane:function(){if(this._left)return this._left;for(var a=
this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&(a[b].region==="leading"||a[b].region==="left"))return this._left=a[b].domNode},getHidingPane:function(){return this.getLeftPane()},getRightPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&a[b].region==="center")return this._center=a[b].domNode},getSizeCookie:function(){var a=this.getSplitter("left");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var b=this.getSplitter("left");
if(b)return b.setSizeCookie(a)},toggleLeftPaneState:function(){var a=this.getSplitter("left");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._left||!this._center)for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&a[b].region==="center")this._center=a[b].domNode;else if(a[b].region&&(a[b].region==="leading"||a[b].region==="left"))this._left=a[b].domNode;var c=this._left,f=this._center,g=d.position(c).w,h=this.isLeftPaneOpen(),
i;i=h?0:this.getPreferredLeftPaneWidth();h||this.toggleLeftPaneState();var j=c.style.overflow,l=f.style.overflow;(new d.Animation({node:c,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(n){c.style.width=g+(i-g)*n/100+"px";c.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:d.hitch(this,function(){f.style.overflow=l;c.style.overflow=j;this.toggleCallback&&this.toggleCallback.apply();h?this.toggleLeftPaneState():this.setSizeCookie(null)})})).play()}});d.declare("orion.widgets.eWebSplitter",
dojox.layout.ToggleSplitter,{postCreate:function(){this.inherited(arguments);this.connect(this.toggleNode,"onmousedown","_onThumbMouseDown");this.connect(this.toggleNode,"onmouseover","_onThumbMouseOver");this.connect(this.domNode,"onmouseover","_onMouseOver");this.connect(this.toggleNode,"onmouseout","_onThumbMouseOut");this._openStateCookieName=this.container.id+"_"+this.region+"_open"},startup:function(){this.inherited(arguments);if(this.container.persist){var a=d.cookie(this._openStateCookieName);
if(a==="true")this.container.getHidingPane().style.width=this.getSizeCookie()+"px";else{a==="false"?this.set("open",false):this.set("open",true);this._handleOnChange()}}else{this.set("open",true);this._handleOnChange()}return this},_handleOnChange:function(){var a=this.child.domNode,b;b=this.horizontal?"height":"width";if(this.open){var c=d.mixin({display:"block",visibility:"visible"},this._openStyleProps);c[b]=this._openStyleProps&&this._openStyleProps[b]?this._openStyleProps[b]:this.openSize;d.style(a,
c);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{c=d.getComputedStyle(a);b=this._getStyleProps(a,true,c);c=this._getStyleProps(a,false,c);this._openStyleProps=b;d.style(a,c)}this._setStateClass();if(this.container._started){a=0;if(this.open&&this.openSize)a=parseInt(this.openSize.replace("px",""),10);this.container._layoutChildren(this.region,a)}},_removeFocusVisual:function(a){d.stopEvent(a)},_onMouseDown:function(a){this.open?this._startDrag(a):this._removeFocusVisual(a)},_onMouseOver:function(){this.domNode.style.cursor=
this.open?"e-resize":"default"},_onThumbMouseDown:function(a){a.stopPropagation();this._removeFocusVisual(a);this.container.toggle()},_onThumbMouseOver:function(){this.toggleNode.style.backgroundColor="#AAAAAA"},_onThumbMouseOut:function(){this.toggleNode.style.backgroundColor="#DDDDDD"},_toggleMe:function(){},getSizeCookie:function(){if(this.container.persist){var a=d.cookie(this._cookieName);if(a)return parseInt(a.replace("px",""),10)}return 0},setSizeCookie:function(){if(this.container.persist)d.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},toggleHidingPaneState:function(){this.set("open",!this.open);this.container.getHidingPane().style.visibility=this.open?"visible":"hidden";if(this.container.persist)d.cookie(this._openStateCookieName,this.open?"true":"false",{expires:365})}});d.declare("orion.widgets.eWebBorderContainerReverse",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredRightPaneWidth:function(){var a=this.getSizeCookie();
return a<=0?d.position(this.getLeftPane()).w*0.25:a},isRightPaneOpen:function(){var a=this.getSplitter("right");if(a)return a.open;return false},getRightPane:function(){if(this._right)return this._right;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&(a[b].region==="trailing"||a[b].region==="right"))return this._right=a[b].domNode},getHidingPane:function(){return this.getRightPane()},getLeftPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&
a[b].region==="center")return this._center=a[b].domNode},getSizeCookie:function(){var a=this.getSplitter("right");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var b=this.getSplitter("right");if(b)return b.setSizeCookie(a)},toggleRightPaneState:function(){var a=this.getSplitter("right");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._right||!this._center)for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&
a[b].region==="center")this._center=a[b].domNode;else if(a[b].region&&(a[b].region==="trailing"||a[b].region==="right"))this._right=a[b].domNode;var c=this._right,f=this._center,g=d.position(c).w,h=this.isRightPaneOpen(),i;i=h?0:this.getPreferredRightPaneWidth();h||this.toggleRightPaneState();var j=c.style.overflow,l=f.style.overflow;(new d.Animation({node:c,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(n){c.style.width=g+(i-g)*n/100+"px";c.style.overflow="hidden";f.style.overflow="hidden";
this.layout()}),onEnd:d.hitch(this,function(){f.style.overflow=l;c.style.overflow=j;this.toggleCallback&&this.toggleCallback.apply();h?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});var eclipse;
define("git/git-commit",["require","dojo","orion/bootstrap","orion/status","orion/progress","orion/commands","orion/dialogs","orion/selection","orion/fileClient","orion/operationsClient","orion/searchClient","orion/globalCommands","orion/git/gitCommitExplorer","orion/git/gitCommands","orion/git/gitClient","orion/links","orion/contentTypes","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(d,e,a,b,c,f,g,h,i,j,l,n,p,t,v,
r,u){a.startup().then(function(q){var x=q.serviceRegistry,z=q.preferences;document.body.style.visibility="visible";e.parser.parse();new g.DialogService(x);new h.Selection(x);q=new f.CommandService({serviceRegistry:x});var C=new j.OperationsClient(x);new b.StatusReportingService(x,C,"statusPane","notifications","notificationArea");new c.ProgressService(x,C);C=new r.TextLinkService({serviceRegistry:x});new v.GitService(x);var k=new i.FileClient(x);new u.ContentTypeService(x);var m=new l.Searcher({serviceRegistry:x,
commandService:q,fileService:k}),o=new p.GitCommitExplorer(x,q,C,null,"artifacts","pageActions");n.generateBanner("banner",x,q,z,m,o);t.createFileCommands(x,q,o,"pageActions","selectionTools");t.createGitClonesCommands(x,q,o,"pageActions","selectionTools",k);q.addCommandGroup("eclipse.gitGroup",100,null,null,"pageActions");q.registerCommandContribution("eclipse.orion.git.cherryPick",100,"pageActions","eclipse.gitGroup");q.registerCommandContribution("eclipse.orion.git.openCommitCommand",102,"pageActions",
"eclipse.gitGroup",true,new f.CommandKeyBinding("h",true,true));q.registerCommandContribution("eclipse.removeTag",1E3);x=new f.Command({name:"Compare",tooltip:"View the side-by-side compare",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.diff.showFullCompare",hrefCallback:function(s){return d.toUrl("compare/compare.html")+"?readonly#"+s.items.DiffLocation},visibleWhen:function(s){return s.Type==="Diff"}});q.addCommand(x,"object");q.registerCommandContribution("eclipse.orion.git.diff.showFullCompare",
1E3);x=new f.Command({name:"Working Directory Version",tooltip:"View the working directory version of the file",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.diff.showCurrent",hrefCallback:function(s){return d.toUrl("edit/edit.html")+"#"+s.items.ContentLocation},visibleWhen:function(s){return s.Type==="Diff"}});q.addCommand(x,"object");q.registerCommandContribution("eclipse.orion.git.diff.showCurrent",2E3);o.display(e.hash());e.subscribe("/dojo/hashchange",
o,function(){o.display(e.hash())})})});