/*

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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) 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) 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) 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) 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) 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, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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) 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
*/
(function(){function d(a,b,c){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,j;j=e[g++];)console[j]||function(){var t=j+"";console[t]="log"in console?function(){var u=Array.apply({},arguments);u.unshift(t+":");console.log(u.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(e=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var k in e)i.config[k]=e[k];a.locale=i.config.locale;k="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:k?+k[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 m,p,w={};for(g in{toString:1}){m=[];break}a._extraNames=m=m||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];p=m.length;a._mixin=function(t,u){var v,x,n;for(v in u){x=u[v];
if(!(v in t)||t[v]!==x&&(!(v in w)||w[v]!==x))t[v]=x}if(p&&u)for(n=0;n<p;++n){v=m[n];x=u[v];if(!(v in t)||t[v]!==x&&(!(v in w)||w[v]!==x))t[v]=x}return t};a.mixin=function(t){t||(t={});for(var u=1,v=arguments.length;u<v;u++)i._mixin(t,arguments[u]);return t};a._getProp=function(t,u,v){v=v||i.global;for(var x=0,n;v&&(n=t[x]);x++){if(x==0&&i._scopeMap[n])n=i._scopeMap[n];v=n in v?v[n]:u?(v[n]={}):undefined}return v};a.setObject=function(t,u,v){var x=t.split(".");t=x.pop();return(v=i._getProp(x,true,
v))&&t?(v[t]=u):undefined};a.getObject=function(t,u,v){return i._getProp(t.split("."),u,v)};a.exists=function(t,u){return i.getObject(t,false,u)!==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 f=d();dojo=f.dojo;dijit=f.dijit;dojox=f.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(d,f){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++];f[c]=function(t){return function(){console.warn("dojo."+t+" not available when using an AMD loader.")}}(c)}var e=function(t){var u=[],v;for(v=0;v<t.length;)u.push(t[v++]);
return u},g=function(t,u){return u?typeof u=="string"?function(){t[u]()}:function(){u.call(t)}:t};f.ready=f.addOnLoad=function(t,u){d.ready(u?g(t,u):t)};f.addOnLoad(function(){f.postLoad=f.config.afterOnLoad=true});if(a=f.config.addOnLoad)f.addOnLoad[a instanceof Array?"apply":"call"](f,a);var j=f._loaders=[],i=function(){var t=j.slice(0);for(Array.prototype.splice.apply(j,[0,j.length]);t.length;)t.shift().call()};j.unshift=function(){Array.prototype.unshift.apply(j,e(arguments));d.ready(i)};j.splice=
function(){Array.prototype.splice.apply(j,e(arguments));d.ready(i)};var k=f._unloaders=[];f.unloaded=function(){for(;k.length;)k.pop().call()};f._onto=function(t,u,v){t.push(v?g(u,v):u)};f._modulesLoaded=function(){};f.loadInit=function(t){t()};var m=function(t){return t.replace(/\./g,"/")};f.getL10nName=function(t,u,v){v=v?v.toLowerCase():f.locale;t="i18n!"+m(t);return/root/i.test(v)?t+"/nls/"+u:t+"/nls/"+v+"/"+u};f.requireLocalization=function(t,u,v){if(d.vendor!="altoviso.com")v=!v||v.toLowerCase()===
f.locale?"root":v;return d(f.getL10nName(t,u,v))};f.i18n={getLocalization:f.requireLocalization,normalizeLocale:function(t){t=t?t.toLowerCase():f.locale;if(t=="root")t="ROOT";return t}};var p=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,w=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;f._Url=function(){for(var t=arguments,u=[t[0]],v=1;v<t.length;v++)if(t[v]){var x=new f._Url(t[v]+"");u=new f._Url(u[0]+"");if(x.path==""&&!x.scheme&&!x.authority&&!x.query){if(x.fragment!=
null)u.fragment=x.fragment;x=u}else if(!x.scheme){x.scheme=u.scheme;if(!x.authority){x.authority=u.authority;if(x.path.charAt(0)!="/"){u=(u.path.substring(0,u.path.lastIndexOf("/")+1)+x.path).split("/");for(var n=0;n<u.length;n++)if(u[n]==".")if(n==u.length-1)u[n]="";else{u.splice(n,1);n--}else if(n>0&&!(n==1&&u[0]=="")&&u[n]==".."&&u[n-1]!="..")if(n==u.length-1){u.splice(n,1);u[n-1]=""}else{u.splice(n-1,2);n-=2}x.path=u.join("/")}}}u=[];x.scheme&&u.push(x.scheme,":");x.authority&&u.push("//",x.authority);
u.push(x.path);x.query&&u.push("?",x.query);x.fragment&&u.push("#",x.fragment)}this.uri=u.join("");v=this.uri.match(p);this.scheme=v[2]||(v[1]?"":null);this.authority=v[4]||(v[3]?"":null);this.path=v[5];this.query=v[7]||(v[6]?"":null);this.fragment=v[9]||(v[8]?"":null);if(this.authority!=null){v=this.authority.match(w);this.user=v[3]||null;this.password=v[4]||null;this.host=v[6]||v[7];this.port=v[9]||null}};f._Url.prototype.toString=function(){return this.uri};f.moduleUrl=function(t,u){if(!t)return null;
t=m(t)+(u?"/"+u:"");u="";var v=t.match(/(.+)(\.[^\/]*)$/);if(v){t=v[1];u=v[2]}return new f._Url(d.nameToUrl(t,u))};return f});
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,e=0;e<b.length;e++){var g=b[e].getAttribute("src");if(g){var j=g.match(c);if(j){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,j.index);if(b=b[e].getAttribute("djConfig")||b[e].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;e=parseFloat(c);if(b.indexOf("Opera")>=0)a.isOpera=e;if(b.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=c.indexOf("Konqueror")>=0?e: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=e;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 v,x;if(!d.isIE||!d.config.ieForceActiveXXhr)try{v=new XMLHttpRequest}catch(n){}if(!v)for(var r=0;r<3;++r){var y=a._XMLHTTP_PROGIDS[r];try{v=new ActiveXObject(y)}catch(A){x=A}if(v){a._XMLHTTP_PROGIDS=[y];break}}if(!v)throw new Error("XMLHTTP not available: "+x);return v};a._isDocumentOk=function(v){v=v.status||0;var x=location.protocol;
return v>=200&&v<300||v==304||v==1223||!v&&(x=="file:"||x=="chrome:"||x=="chrome-extension:"||x=="app:")};var k=window.location+"";var m=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(v,x){var n=a._xhrObj();if(!m&&d._Url)v=(new d._Url(k,v)).toString();if(a.config.cacheBust){v+="";v+=(v.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}n.open("GET",v,false);try{n.send(null);if(!a._isDocumentOk(n)){var r=Error("Unable to load "+v+" status:"+n.status);
r.status=n.status;r.responseText=n.responseText;throw r;}}catch(y){if(x)return null;throw y;}return n.responseText};var p=window,w=function(v,x){var n=p.attachEvent||p.addEventListener;v=p.attachEvent?v:v.substring(2);n(v,function(){x.apply(p,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var v=a._windowUnloaders;v.length;)v.pop()();a=null};var t=0;a.addOnWindowUnload=function(v,x){a._onto(a._windowUnloaders,v,x);if(!t){t=1;w("onunload",a.windowUnloaded)}};var u=0;a.addOnUnload=
function(v,x){a._onto(a._unloaders,v,x);if(!u){u=1;w("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,e=document.createStyleSheet();if(d.isIE>=8){b=
1;c=a.length}for(;b<c;++b)e.addRule("v\\:"+a[b],"behavior:url(#default#VML); display:inline-block")})()}catch(f){}}(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 f=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 f.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 k=1,m=arguments.length;k<m;k++)d._mixin(i.prototype,arguments[k]);return i};d._hitchArgs=function(i,k){var m=d._toArray(arguments,2),p=d.isString(k);return function(){var w=d._toArray(arguments),t=p?(i||d.global)[k]:k;return t&&t.apply(i||this,m.concat(w))}};d.hitch=function(i,k){if(arguments.length>
2)return d._hitchArgs.apply(d,arguments);if(!k){k=i;i=null}if(d.isString(k)){i=i||d.global;if(!i[k])throw['dojo.hitch: scope["',k,'"] is null (scope="',i,'")'].join("");return function(){return i[k].apply(i,arguments||[])}}return!i?k:function(){return k.apply(i,arguments||[])}};d.delegate=d._delegate=function(){function i(){}return function(k,m){i.prototype=k;k=new i;i.prototype=null;m&&d._mixin(k,m);return k}}();var a=function(i,k,m){return(m||[]).concat(Array.prototype.slice.call(i,k||0))},b=function(i,
k,m){m=m||[];for(k=k||0;k<i.length;k++)m.push(i[k]);return m};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,e=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 k,m,p,w;if(d.isArray(i)){k=
[];m=0;for(p=i.length;m<p;++m)m in i&&k.push(d.clone(i[m]))}else k=i.constructor?new i.constructor:{};for(w in i){p=i[w];if(!(w in k)||k[w]!==p&&(!(w in g)||g[w]!==p))k[w]=d.clone(p)}if(e)for(m=0;m<e;++m){w=c[m];p=i[w];if(!(w in k)||k[w]!==p&&(!(w in g)||g[w]!==p))k[w]=p}return k};d.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var j=/\{([^\}]+)\}/g;d.replace=function(i,k,m){return i.replace(m||j,d.isFunction(k)?k:function(p,
w){return d.getObject(w,false,k)})}})();return d});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var f=function(b,c,e){return[typeof b=="string"?b.split(""):b,c||d.global,typeof e=="string"?new Function("item","index","array",e):e]},a=function(b,c,e,g){var j=f(c,g,e);c=j[0];e=0;for(g=c.length;e<g;++e){var i=!!j[2].call(j[1],c[e],e,c);if(b^i)return i}return b};d.mixin(d,{indexOf:function(b,c,e,g){var j=1,i=b.length||0,k=0;if(g){k=i-1;j=i=-1}if(e!=undefined)k=e;if(g&&k>i||k<i)for(;k!=i;k+=j)if(b[k]==c)return k;
return-1},lastIndexOf:function(b,c,e){return d.indexOf(b,c,e,true)},forEach:function(b,c,e){if(b&&b.length){var g=f(b,e,c);b=g[0];c=0;for(e=b.length;c<e;++c)g[2].call(g[1],b[c],c,b)}},every:function(b,c,e){return a(true,b,c,e)},some:function(b,c,e){return a(false,b,c,e)},map:function(b,c,e,g){var j=f(b,e,c);b=j[0];c=g?new g:[];e=0;for(g=b.length;e<g;++e)c.push(j[2].call(j[1],b[e],e,b));return c},filter:function(b,c,e){var g=f(b,e,c);b=g[0];c=[];e=0;for(var j=b.length;e<j;++e)g[2].call(g[1],b[e],e,
b)&&c.push(b[e]);return c}})})();return d});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(d){(function(){function f(l,o){throw new Error("declare"+(o?" "+o:"")+": "+l);}function a(l,o){for(var q=[],s=[{cls:0,refs:[]}],z={},C=1,B=l.length,E=0,G,M,H,N,L;E<B;++E){if(G=l[E])r.call(G)!="[object Function]"&&f("mixin #"+E+" is not a callable constructor.",o);else f("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_"+A++;N=N.declaredClass;if(!z.hasOwnProperty(N)){z[N]={count:0,refs:[],cls:M[G]};++C}N=z[N];if(H&&H!==N){N.refs.push(H);++H.count}H=N}++H.count;s[0].refs.push(H)}for(;s.length;){H=s.pop();q.push(H.cls);for(--C;L=H.refs,L.length==1;){H=L[0];if(!H||--H.count){H=0;break}q.push(H.cls);--C}if(H){E=0;for(B=L.length;E<B;++E){H=L[E];--H.count||s.push(H)}}}C&&f("can't build consistent linearization",o);G=l[0];q[0]=G?G._meta&&G===q[q.length-G._meta.bases.length]?
G._meta.bases.length:1:0;return q}function b(l,o,q){var s,z,C,B,E,G,M,H=this._inherited=this._inherited||{};if(typeof l=="string"){s=l;l=o;o=q}q=0;B=l.callee;(s=s||B.nom)||f("can't deduce a name to call inherited()",this.declaredClass);E=this.constructor._meta;C=E.bases;M=H.p;if(s!=h){if(H.c!==B){M=0;G=C[0];E=G._meta;if(E.hidden[s]!==B){(z=E.chains)&&typeof z[s]=="string"&&f("calling chained method with inherited: "+s,this.declaredClass);do{E=G._meta;z=G.prototype;if(E&&(z[s]===B&&z.hasOwnProperty(s)||
E.hidden[s]===B))break}while(G=C[++M]);M=G?M:-1}}if(G=C[++M]){z=G.prototype;if(G._meta&&z.hasOwnProperty(s))q=z[s];else{B=n[s];do{z=G.prototype;if((q=z[s])&&(G._meta?z.hasOwnProperty(s):q!==B))break}while(G=C[++M])}}q=G&&q||n[s]}else{if(H.c!==B){M=0;if((E=C[0]._meta)&&E.ctor!==B){z=E.chains;if(!z||z.constructor!=="manual")f("calling chained constructor with inherited",this.declaredClass);for(;G=C[++M];)if((E=G._meta)&&E.ctor===B)break;M=G?M:-1}}for(;G=C[++M];)if(q=(E=G._meta)?E.ctor:G)break;q=G&&
q}H.c=q;H.p=M;if(q)return o===true?q:q.apply(this,o||l)}function c(l,o){if(typeof l=="string")return this.inherited(l,o,true);return this.inherited(l,true)}function e(l){for(var o=this.constructor._meta.bases,q=0,s=o.length;q<s;++q)if(o[q]===l)return true;return this instanceof l}function g(l,o){var q,s=0,z=v._extraNames.length;for(q in o)if(q!=h&&o.hasOwnProperty(q))l[q]=o[q];for(;s<z;++s){q=v._extraNames[s];if(q!=h&&o.hasOwnProperty(q))l[q]=o[q]}}function j(l,o){var q,s,z=0,C=v._extraNames.length;
for(q in o){s=o[q];if((s!==n[q]||!(q in n))&&q!=h){if(r.call(s)=="[object Function]")s.nom=q;l[q]=s}}for(;z<C;++z){q=v._extraNames[z];s=o[q];if((s!==n[q]||!(q in n))&&q!=h){if(r.call(s)=="[object Function]")s.nom=q;l[q]=s}}return l}function i(l){j(this.prototype,l);return this}function k(l,o){return function(){var q=arguments,s=q,z=q[0],C,B;B=l.length;var E;if(!(this instanceof q.callee))return u(q);if(o&&(z&&z.preamble||this.preamble)){E=new Array(l.length);E[0]=q;for(C=0;;){if(z=q[0])if(z=z.preamble)q=
z.apply(this,q)||q;z=l[C].prototype;if(z=z.hasOwnProperty("preamble")&&z.preamble)q=z.apply(this,q)||q;if(++C==B)break;E[C]=q}}for(C=B-1;C>=0;--C){z=l[C];if(z=(B=z._meta)?B.ctor:z)z.apply(this,E?E[C]:q)}(z=this.postscript)&&z.apply(this,s)}}function m(l,o){return function(){var q=arguments,s=q,z=q[0];if(!(this instanceof q.callee))return u(q);if(o){if(z)if(z=z.preamble)s=z.apply(this,s)||s;(z=this.preamble)&&z.apply(this,s)}l&&l.apply(this,q);(z=this.postscript)&&z.apply(this,q)}}function p(l){return function(){var o=
arguments,q=0,s,z;if(!(this instanceof o.callee))return u(o);for(;s=l[q];++q)if(s=(z=s._meta)?z.ctor:s){s.apply(this,o);break}(s=this.postscript)&&s.apply(this,o)}}function w(l,o,q){return function(){var s,z,C=0,B=1;if(q){C=o.length-1;B=-1}for(;s=o[C];C+=B){z=s._meta;(s=(z?z.hidden:s.prototype)[l])&&s.apply(this,arguments)}}}function t(l){y.prototype=l.prototype;l=new y;y.prototype=null;return l}function u(l){var o=l.callee,q=t(o);o.apply(q,l);return q}var v=d,x=v._mixin,n=Object.prototype,r=n.toString,
y=new Function,A=0,h="constructor";v.declare=function(l,o,q){if(typeof l!="string"){q=o;o=l;l=""}q=q||{};var s,z,C,B,E,G,M,H=1,N=o;if(r.call(o)=="[object Array]"){G=a(o,l);C=G[0];H=G.length-C;o=G[H]}else{G=[0];if(o)if(r.call(o)=="[object Function]"){C=o._meta;G=G.concat(C?C.bases:o)}else f("base class is not a callable constructor.",l);else o!==null&&f("unknown base class. Did you use dojo.require to pull it in?",l)}if(o)for(z=H-1;;--z){s=t(o);if(!z)break;C=G[z];(C._meta?g:x)(s,C.prototype);B=new Function;
B.superclass=o;B.prototype=s;o=s.constructor=B}else s={};j(s,q);C=q.constructor;if(C!==n.constructor){C.nom=h;s.constructor=C}for(z=H-1;z;--z)if((C=G[z]._meta)&&C.chains)M=x(M||{},C.chains);if(s["-chains-"])M=x(M||{},s["-chains-"]);C=!M||!M.hasOwnProperty(h);G[0]=B=M&&M.constructor==="manual"?p(G):G.length==1?m(q.constructor,C):k(G,C);B._meta={bases:G,hidden:q,chains:M,parents:N,ctor:q.constructor};B.superclass=o&&o.prototype;B.extend=i;B.prototype=s;s.constructor=B;s.getInherited=c;s.inherited=b;
s.isInstanceOf=e;if(l){s.declaredClass=l;v.setObject(l,B)}if(M)for(E in M)if(s[E]&&typeof M[E]=="string"&&E!=h){C=s[E]=w(E,G,M[E]==="after");C.nom=E}return B};v.safeMixin=j})();return d.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(d){d._listener={getDispatcher:function(){return function(){var f=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 f||b[c].apply(this,arguments);return a}},add:function(f,a,b){f=f||d.global;var c=f[a];if(!c||!c._listeners){var e=d._listener.getDispatcher();e.target=c;e._listeners=[];c=f[a]=e}return c._listeners.push(b)},remove:function(f,a,b){(f=(f||
d.global)[a])&&f._listeners&&b--&&delete f._listeners[b]}};d.connect=function(){var f=arguments,a=[],b=0;a.push(d.isString(f[0])?null:f[b++],f[b++]);var c=f[b+1];a.push(d.isString(c)||d.isFunction(c)?f[b++]:null,f[b++]);for(c=f.length;b<c;b++)a.push(f[b]);return d._connect.apply(this,a)};d._connect=function(f,a,b,c){var e=d._listener;b=e.add(f,a,d.hitch(b,c));return[f,a,b,e]};d.disconnect=function(f){if(f&&f[0]!==undefined){d._disconnect.apply(this,f);delete f[0]}};d._disconnect=function(f,a,b,c){c.remove(f,
a,b)};d._topics={};d.subscribe=function(f,a,b){return[f,d._listener.add(d._topics,f,d.hitch(a,b))]};d.unsubscribe=function(f){f&&d._listener.remove(d._topics,f[0],f[1])};d.publish=function(f,a){if(f=d._topics[f])f.apply(this,a||[])};d.connectPublisher=function(f,a,b){var c=function(){d.publish(f,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 f=function(){},a=Object.freeze||function(){},b=function(){var c,e,g,j,i=false,k=function(){};return function(m){if(i)if(c){e.next={task:m,next:null};e=e.next}else e=c={task:m,next:null};else{i=true;do try{for(;m;){m();if(g){if(c)e.next=g;else c=g;e=j}if(c){g=c.next;j=e;m=c.task;c=e=null}else m=null}i=false}catch(p){m=k;console.error(p)}while(i)}}}();d.Deferred=function(c){function e(u){if(i)throw new Error("This deferred has already been resolved");
j=u;i=true;b(g)}function g(){for(var u;!u&&p;){var v=p;p=p.next;if(u=v.progress==f)i=false;var x=k?v.error:v.resolved;if(x)try{var n=x(j);if(n&&typeof n.then==="function")n.then(d.hitch(v.deferred,"resolve"),d.hitch(v.deferred,"reject"),d.hitch(v.deferred,"progress"));else{x=u&&n===undefined;if(u&&!x)k=n instanceof Error;v.deferred[x&&k?"reject":"resolve"](x?j:n)}}catch(r){v.deferred.reject(r)}else k?v.deferred.reject(j):v.deferred.resolve(j)}}var j,i,k,m,p,w=this.promise={};this.resolve=this.callback=
function(u){this.fired=0;this.results=[u,null];e(u)};this.reject=this.errback=function(u){k=true;this.fired=1;e(u);this.results=[null,u];if(!u||u.log!==false)(d.config.deferredOnError||function(v){console.error(v)})(u)};this.progress=function(u){for(var v=p;v;){var x=v.progress;x&&x(u);v=v.next}};this.addCallbacks=function(u,v){this.then(u,v,f);return this};this.then=w.then=function(u,v,x){var n=x==f?this:new d.Deferred(w.cancel);u={resolved:u,error:v,progress:x,deferred:n};if(p)m=m.next=u;else p=
m=u;i&&b(g);return n.promise};var t=this;this.cancel=w.cancel=function(){if(!i){var u=c&&c(t);if(!i){u instanceof Error||(u=new Error(u));u.log=false;t.reject(u)}}};a(w)};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(f,a,b,c){if(f&&typeof f.then==="function")return f.then(a,
b,c);return a(f)};return d.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(d){d.fromJson=function(f){return eval("("+f+")")};d._escapeString=function(f){return('"'+f.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(f,a,b){if(f===undefined)return"undefined";var c=typeof f;if(c=="number"||c=="boolean")return f+"";if(f===null)return"null";if(d.isString(f))return d._escapeString(f);var e=
arguments.callee,g;b=b||"";var j=a?b+d.toJsonIndentStr:"";g=f.__json__||f.json;if(d.isFunction(g)){g=g.call(f);if(f!==g)return e(g,a,j)}if(f.nodeType&&f.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var i=a?"\n":"";if(d.isArray(f))return"["+d.map(f,function(w){w=e(w,a,j);if(typeof w!="string")w="undefined";return i+j+w}).join(","+g)+i+b+"]";if(c=="function")return null;c=[];var k;for(k in f){var m,p;if(typeof k=="number")m='"'+k+'"';else if(typeof k=="string")m=d._escapeString(k);
else continue;p=e(f[k],a,j);typeof p=="string"&&c.push(i+j+m+":"+g+p)}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(f){f&&this.setColor(f)};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(f,a,b,c){this.r=f;this.g=a;this.b=b;this.a=c},setColor:function(f){if(d.isString(f))d.colorFromString(f,this);else if(d.isArray(f))d.colorFromArray(f,this);else{this._set(f.r,f.g,f.b,f.a);f 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(f){f=this[f].toString(16);return f.length<
2?"0"+f:f},this).join("")},toCss:function(f){var a=this.r+", "+this.g+", "+this.b;return(f?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});d.blendColors=function(f,a,b,c){var e=c||new d.Color;d.forEach(["r","g","b","a"],function(g){e[g]=f[g]+(a[g]-f[g])*b;if(g!="a")e[g]=Math.round(e[g])});return e.sanitize()};d.colorFromRgb=function(f,a){return(f=f.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&d.colorFromArray(f[1].split(/\s*,\s*/),a)};d.colorFromHex=function(f,
a){var b=a||new d.Color,c=f.length==4?4:8,e=(1<<c)-1;f=Number("0x"+f.substr(1));if(isNaN(f))return null;d.forEach(["b","g","r"],function(g){var j=f&e;f>>=c;b[g]=c==4?17*j:j});b.a=1;return b};d.colorFromArray=function(f,a){a=a||new d.Color;a._set(Number(f[0]),Number(f[1]),Number(f[2]),Number(f[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};d.colorFromString=function(f,a){var b=d.Color.named[f];return b&&d.colorFromArray(b,a)||d.colorFromRgb(f,a)||d.colorFromHex(f,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(f,a){d.global=f;d.doc=a};d.withGlobal=function(f,a,b,c){var e=d.global;try{d.global=f;return d.withDoc.call(null,f.document,a,b,c)}finally{d.global=e}};d.withDoc=function(f,a,b,c){var e=d.doc,g=d._bodyLtr,j=d.isQuirks;try{d.doc=f;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=e;delete d._bodyLtr;if(g!==undefined)d._bodyLtr=g;d.isQuirks=j}};return d});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(d){(function(){var f=d._event_listener={add:function(i,k,m){if(i){k=f._normalizeEventName(k);m=f._fixCallback(k,m);if(!d.isIE&&(k=="mouseenter"||k=="mouseleave")){var p=m;k=k=="mouseenter"?"mouseover":"mouseout";m=function(w){if(!d.isDescendant(w.relatedTarget,i))return p.call(this,w)}}i.addEventListener(k,m,false);return m}},remove:function(i,k,m){if(i){k=f._normalizeEventName(k);if(!d.isIE&&(k=="mouseenter"||k=="mouseleave"))k=
k=="mouseenter"?"mouseover":"mouseout";i.removeEventListener(k,m,false)}},_normalizeEventName:function(i){return i.slice(0,2)=="on"?i.slice(2):i},_fixCallback:function(i,k){return i!="keypress"?k:function(m){return k.call(this,f._fixEvent(m,this))}},_fixEvent:function(i){switch(i.type){case "keypress":f._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,k){return f._fixEvent(i,k)};d.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=d._listener;d._connect=function(i,k,m,p,w){w=i&&(i.nodeType||i.attachEvent||i.addEventListener)?w?2:1:0;m=[d._listener,f,a][w].add(i,k,d.hitch(m,p));return[i,k,m,w]};d._disconnect=function(i,k,m,p){[d._listener,f,a][p].remove(i,k,m)};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,k){return i.button&k},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,k){return i.button==k},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,k){try{return i.keyCode=k}catch(m){return 0}},e=d._listener,g=d._ieListenersName="_"+d._scopeName+"_listeners";if(!d.config._allow_leaks){a=e=d._ie_listener={handlers:[],add:function(i,k,m){i=i||d.global;var p=i[k];if(!p||!p[g]){var w=d._getIeDispatcher();w.target=p&&j.push(p)-1;w[g]=[];p=i[k]=w}return p[g].push(j.push(m)-1)},remove:function(i,k,m){k=(i=(i||d.global)[k])&&i[g];if(i&&k&&
m--){delete j[k[m]];delete k[m]}}};var j=e.handlers}d.mixin(f,{add:function(i,k,m){if(i){k=f._normalizeEventName(k);if(k=="onkeypress"){var p=i.onkeydown;if(!p||!p[g]||!p._stealthKeydownHandle){var w=f.add(i,"onkeydown",f._stealthKeyDown);p=i.onkeydown;p._stealthKeydownHandle=w;p._stealthKeydownRefs=1}else p._stealthKeydownRefs++}return e.add(i,k,f._fixCallback(m))}},remove:function(i,k,m){k=f._normalizeEventName(k);e.remove(i,k,m);if(k=="onkeypress"){k=i.onkeydown;if(--k._stealthKeydownRefs<=0){e.remove(i,
"onkeydown",k._stealthKeydownHandle);delete k._stealthKeydownHandle}}},_normalizeEventName:function(i){return i.slice(0,2)!="on"?"on"+i:i},_nop:function(){},_fixEvent:function(i,k){if(!i)i=(k&&(k.ownerDocument||k.document||k).parentWindow||window).event;if(!i)return i;i.target=i.srcElement;i.currentTarget=k||i.srcElement;i.layerX=i.offsetX;i.layerY=i.offsetY;k=(k=i.srcElement)&&k.ownerDocument||document;k=d.isIE<6||k.compatMode=="BackCompat"?k.body:k.documentElement;var m=d._getIeDocumentElementOffset();
i.pageX=i.clientX+d._fixIeBiDiScrollLeft(k.scrollLeft||0)-m.x;i.pageY=i.clientY+(k.scrollTop||0)-m.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=f._stopPropagation;i.preventDefault=f._preventDefault}return f._fixKeys(i)},_fixKeys:function(i){switch(i.type){case "keypress":var k="charCode"in i?i.charCode:i.keyCode;if(k==10){k=0;i.keyCode=13}else if(k==13||k==27)k=0;else if(k==3)k=99;i.charCode=k;f._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var k=i.currentTarget.onkeypress;if(k&&k[g]){var m=i.keyCode,p=(m!=13||d.isIE>=9&&!d.isQuirks)&&m!=32&&m!=27&&(m<48||m>90)&&(m<96||m>111)&&(m<186||m>192)&&(m<219||m>222);if(p||i.ctrlKey){p=p?0:m;if(i.ctrlKey)if(m==3||m==13)return;else if(p>95&&p<106)p-=48;else if(!i.shiftKey&&p>=65&&p<=90)p+=32;else p=f._punctMap[p]||p;m=f._synthesizeEvent(i,{type:"keypress",faux:true,charCode:p});k.call(i.currentTarget,m);if(d.isIE<9||d.isIE&&d.isQuirks)i.cancelBubble=
m.cancelBubble;i.returnValue=m.returnValue;c(i,m.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;f._stopPropagation.call(i);f._preventDefault.call(i)}:d.stopEvent}f._synthesizeEvent=function(i,k){k=d.mixin({},i,k);f._setKeyChar(k);k.preventDefault=function(){i.preventDefault()};k.stopPropagation=function(){i.stopPropagation()};
return k};d.isOpera&&d.mixin(f,{_fixEvent:function(i){switch(i.type){case "keypress":var k=i.which;if(k==3)k=99;k=k<41&&!i.shiftKey?0:k;if(i.ctrlKey&&!i.shiftKey&&k>=65&&k<=90)k+=32;return f._synthesizeEvent(i,{charCode:k})}return i}});if(d.isWebKit){f._add=f.add;f._remove=f.remove;d.mixin(f,{add:function(i,k,m){if(i){var p=f._add(i,k,m);if(f._normalizeEventName(k)=="keypress")p._stealthKeyDownHandle=f._add(i,"keydown",function(w){var t=w.keyCode,u=t!=13&&t!=32&&(t<48||t>90)&&(t<96||t>111)&&(t<186||
t>192)&&(t<219||t>222);if(u||w.ctrlKey){u=u?0:t;if(w.ctrlKey)if(t==3||t==13)return;else if(u>95&&u<106)u-=48;else if(!w.shiftKey&&u>=65&&u<=90)u+=32;else u=f._punctMap[u]||u;t=f._synthesizeEvent(w,{type:"keypress",faux:true,charCode:u});m.call(w.currentTarget,t)}});return p}},remove:function(i,k,m){if(i){m._stealthKeyDownHandle&&f._remove(i,"keydown",m._stealthKeyDownHandle);f._remove(i,k,m)}},_fixEvent:function(i){switch(i.type){case "keypress":if(i.faux)return i;var k=i.charCode;k=k>=32?k:0;return f._synthesizeEvent(i,
{charCode:k,faux:true})}return i}})}})();if(d.isIE){d._ieDispatcher=function(f,a){var b=Array.prototype,c=d._ie_listener.handlers,e=f.callee,g=e[d._ieListenersName];e=(e=c[e.target])&&e.apply(a,f);g=[].concat(g);for(var j in g){var i=c[g[j]];!(j in b)&&i&&i.apply(a,f)}return e};d._getIeDispatcher=function(){return new Function(d._scopeName+"._ieDispatcher(arguments, this)")};d._event_listener._fixCallback=function(f){var a=d._event_listener._fixEvent;return function(b){return f.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(f){}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 e=c.all[a];if(!e||e.nodeName)e=[e];for(var g=0;b=e[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 e=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):
e(D,Q[J<0?0:J])}else switch(J){case "before":e(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){e(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 j;j=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=j;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,k=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 k(D).Opacity/100}catch(F){return 1}}:function(D){return j(D).opacity};d._setOpacity=d.isIE<9?function(D,F){var J=F*100,Q=F==1;D.style.zoom=Q?"":1;if(k(D))k(D,1).Opacity=J;else{if(Q)return F;D.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
J+")"}k(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 m={left:true,top:true},p=/margin|padding|width|height|max|min|offset/,w=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 m||(m[F]=p.test(F));return m[F]?i(D,J):J},
t=d.isIE?"styleFloat":"cssFloat",u={cssFloat:t,styleFloat:t,"float":t};d.style=function(D,F,J){var Q=a(D),T=arguments.length,U=F=="opacity";F=u[F]||F;if(T==3)return U?d._setOpacity(Q,J):(Q.style[F]=J);if(T==2&&U)return d._getOpacity(Q);U=j(Q);if(T==2&&typeof F!="string"){for(var W in F)d.style(D,W,F[W]);return U}return T==1?U:w(Q,F,U[F]||Q.style[F])};d._getPadExtents=function(D,F){F=F||j(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||j(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||j(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||j(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||j(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=j(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||j(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||j(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||j(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||j(D);U=d._usesBorderBox(D)?v: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 v={l:0,t:0,w:0,
h:0};d.marginBox=function(D,F){D=a(D);var J=j(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=j(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=j(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=j(D);J=d._getMarginBox(D,J);F=d.position(D,F);J.x=F.x;J.y=F.y;return J};var x={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},n={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},r={innerHTML:1,className:1,htmlFor:d.isIE,value:1},y=function(D){return n[D.toLowerCase()]||D},A=function(D,F){return(D=D.getAttributeNode&&D.getAttributeNode(F))&&
D.specified};d.hasAttr=function(D,F){var J=F.toLowerCase();return r[x[J]||F]||A(a(D),n[J]||F)};var h={},l=0,o=d._scopeName+"attrid",q={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=x[U]||F;var W=r[T];U=n[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 q){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=l++;d.attr(D,o,Q)}h[Q]||(h[Q]={});if(W=h[Q][T])d.disconnect(W);else try{delete D[T]}catch(aa){}h[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 A(D,U)?D.getAttribute(U):null};d.removeAttr=function(D,F){a(D).removeAttribute(y(F))};d.getNodeProp=
function(D,F){D=a(D);var J=F.toLowerCase(),Q=x[J]||F;if(Q in D&&Q!="href")return D[Q];F=n[J]||F;return A(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 s={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"]},z=/<\s*([\w\:]+)/,C={},B=0,E="__"+d._scopeName+"ToDomId";for(var G in s)if(s.hasOwnProperty(G)){var M=s[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=++B+"";C[J]=F.createElement("div")}D+="";var Q=D.match(z),T=Q?Q[1].toLowerCase():"";J=C[J];if(Q&&s[T]){Q=
s[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 f=Array.prototype,a=f.slice,b=f.concat,c=function(t,u,v){t.sort||(t=a.call(t,0));v=v||this._NodeListCtor||d._NodeListCtor;t.constructor=v;d._mixin(t,v.prototype);t._NodeListCtor=v;return u?t._stash(u):t},e=function(t,u,v){u=[0].concat(a.call(u,0));v=v||d.global;return function(x){u[0]=x;return t.apply(v,u)}},g=function(t,u){return function(){this.forEach(e(t,
arguments,u));return this}},j=function(t,u){return function(){return this.map(e(t,arguments,u))}},i=function(t,u,v){return function(){var x=arguments,n=e(t,x,v);if(u.call(v||d.global,x))return this.map(n);this.forEach(n);return this}},k=function(t){return t.length==1&&typeof t[0]=="string"},m=function(t){var u=t.parentNode;u&&u.removeChild(t)};d.NodeList=function(){return c(Array.apply(null,arguments))};var p=d._NodeListCtor=d.NodeList,w=p.prototype;p._wrap=w._wrap=c;p._adaptAsMap=j;p._adaptAsForEach=
g;p._adaptAsFilter=function(t,u){return function(){return this.filter(e(t,arguments,u))}};p._adaptWithCondition=i;d.forEach(["slice","splice"],function(t){var u=f[t];w[t]=function(){return this._wrap(u.apply(this,arguments),t=="slice"?this:null)}});d.forEach(["indexOf","lastIndexOf","every","some"],function(t){var u=d[t];w[t]=function(){return u.apply(d,[this].concat(a.call(arguments,0)))}});d.forEach(["attr","style"],function(t){w[t]=i(d[t],k)});d.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(t){w[t]=g(d[t])});d.extend(d.NodeList,{_normalize:function(t,u){var v=t.parse===true?true:false;if(typeof t.template=="string"){var x=t.templateFunc||d.string&&d.string.substitute;t=x?x(t.template,t):t}x=typeof t;if(x=="string"||x=="number"){t=d._toDom(t,u&&u.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(v)t._runParse=true;return t},_cloneNode:function(t){return t.cloneNode(true)},
_place:function(t,u,v,x){if(!(u.nodeType!=1&&v=="only")){u=u;for(var n,r=t.length,y=r-1;y>=0;y--){var A=x?this._cloneNode(t[y]):t[y];if(t._runParse&&d.parser&&d.parser.parse){n||(n=u.ownerDocument.createElement("div"));n.appendChild(A);d.parser.parse(n);for(A=n.firstChild;n.firstChild;)n.removeChild(n.firstChild)}y==r-1?d.place(A,u,v):u.parentNode.insertBefore(A,u);u=A}}},_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),u=d.map(arguments,function(v){return v&&!d.isArray(v)&&(typeof NodeList!="undefined"&&v.constructor===NodeList||v.constructor===this._NodeListCtor)?a.call(v,0):v});return this._wrap(b.apply(t,u),this)},map:function(t,u){return this._wrap(d.map(this,t,u),this)},forEach:function(t,u){d.forEach(this,t,u);return this},coords:j(d.coords),position:j(d.position),place:function(t,u){var v=d.query(t)[0];return this.forEach(function(x){d.place(x,v,u)})},orphan:function(t){return(t?
d._filterQueryResult(this,t):this).forEach(m)},adopt:function(t,u){return d.query(t).place(this[0],u)._stash(this)},query:function(t){if(!t)return this;var u=this.map(function(v){return d.query(t,v).filter(function(x){return x!==undefined})});return this._wrap(b.apply([],u),this)},filter:function(t){var u=arguments,v=this,x=0;if(typeof t=="string"){v=d._filterQueryResult(this,u[0]);if(u.length==1)return v._stash(this);x=1}return this._wrap(d.filter(v,u[x],u[x+1]),this)},addContent:function(t,u){t=
this._normalize(t,this[0]);for(var v=0,x;x=this[v];v++)this._place(t,x,u,v>0);return this},instantiate:function(t,u){var v=d.isFunction(t)?t:d.getObject(t);u=u||{};return this.forEach(function(x){new v(u,x)})},at:function(){var t=new this._NodeListCtor;d.forEach(arguments,function(u){if(u<0)u=this.length+u;this[u]&&t.push(this[u])},this);return t._stash(this)}});p.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];d.forEach(p.events,function(t){var u="on"+t;w[u]=function(v,x){return this.connect(u,v,x)}})})();return d.NodeList});
(function(){var d=function(a){var b=a.trim,c=a.forEach,e=a._NodeListCtor=a.NodeList,g=function(){return a.doc},j=(a.isWebKit||a.isMozilla)&&g().compatMode=="BackCompat",i=g().firstChild.children?"children":"childNodes",k=false,m=function(){return true},p=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 k?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},w=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},u=function(K){return 1==
K.nodeType},v=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(k?K.getAttribute(I):K.getAttribute(I,2))||""},x={"*=":function(K,I){return function(O){return v(O,K).indexOf(I)>=0}},"^=":function(K,I){return function(O){return v(O,K).indexOf(I)==0}},"$=":function(K,I){return function(O){O=" "+v(O,K);return O.lastIndexOf(I)==O.length-I.length}},"~=":function(K,I){var O=" "+I+" ";return function(R){return(" "+
v(R,K)+" ").indexOf(O)>=0}},"|=":function(K,I){var O=" "+I+"-";return function(R){R=" "+v(R,K);return R==I||R.indexOf(O)==0}},"=":function(K,I){return function(O){return v(O,K)==I}}},n=typeof g().firstChild.nextElementSibling=="undefined",r=!n?"nextElementSibling":"nextSibling",y=!n?"previousElementSibling":"previousSibling",A=n?u:m,h=function(K){for(;K=K[y];)if(A(K))return false;return true},l=function(K){for(;K=K[r];)if(A(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[r])if(A(I)){I._i=++O;if(K===I)V=O}return V},q=function(K){return!(o(K)%2)},s=function(K){return o(K)%2},z={checked:function(){return function(K){return!!("checked"in K?K.checked:K.selected)}},"first-child":function(){return h},"last-child":function(){return l},"only-child":function(){return function(K){if(!h(K))return false;if(!l(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=p(I)[0];I={el:1};if(K.tag!="*")I.tag=1;if(!K.classes.length)I.classes=1;var O=B(K,I);return function(R){return!O(R)}},"nth-child":function(K,I){K=parseInt;if(I=="odd")return s;else if(I=="even")return q;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)==$}}},C=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(K){var I=K.toLowerCase();if(I=="class")K="className";return function(O){return k?O.getAttribute(K):O[K]||O[I]}}:function(K){return function(I){return I&&I.getAttribute&&I.hasAttribute(K)}},
B=function(K,I){if(!K)return m;I=I||{};var O=null;"el"in I||(O=w(O,u));if(!("tag"in I))if(K.tag!="*")O=w(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=w(O,function($){return X.test($.className)});O.count=V});"pseudos"in I||c(K.pseudos,function(R){var V=R.name;if(z[V])O=w(O,z[V](V,R.value))});"attrs"in I||c(K.attrs,function(R){var V,X=R.attr;if(R.type&&x[R.type])V=x[R.type](X,R.matchFor);else if(X.length)V=C(X);
if(V)O=w(O,V)});if(!("id"in I))if(K.id)O=w(O,function(R){return!!R&&R.id==K.id});O||"default"in I||(O=m);return O},E=function(K){return function(I,O,R){for(;I=I[r];)if(!(n&&!u(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[r];I;){if(A(I)){if(R&&!da(I,R))break;K(I)&&O.push(I)}I=I[r]}return O}},M=function(K){K=K||m;return function(I,O,R){for(var V=0,X=I[i];I=X[V++];)if(A(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=B(K,{el:1}),V="*"==K.tag,X=g().getElementsByClassName;if(O){X={el:1};if(V)X.tag=1;R=B(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?m:B(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&&!j){R=B(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=B(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=p(b(K));if(I.length==1){var O=L(I[0]);return function(R){if(R=O(R,new e))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)&&!(j&&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 k?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 e._wrap?e._wrap(K):K;var I=new e;if(!K||!K.length)return I;K[0]&&I.push(K[0]);if(K.length<2)return I;Z++;if(a.isIE&&k){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++)u(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){e=a._NodeListCtor;if(!K)return new e;if(K.constructor==e)return K;if(typeof K!="string")return new e(K);if(typeof I=="string"){I=a.byId(I);if(!I)return new e}I=I||g();var O=I.ownerDocument||I.documentElement;k=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&&!e._wrap)return K;return la(K)};a.query.pseudos=z;a._filterQueryResult=function(K,I,O){var R=
new a._NodeListCtor,V=p(I);V=V.length==1&&!/[^\w#\.]/.test(I)?B(V[0]):function(Y){return dojo.query(I,O).indexOf(Y)!=-1};for(var X=0,$;$=K[X];X++)V($)&&R.push($);return R}},f=function(){acme={trim:function(e){e=e.replace(/^\s+/,"");for(var g=e.length-1;g>=0;g--)if(/\S/.test(e.charAt(g))){e=e.substring(0,g+1);break}return e},forEach:function(e,g,j){if(e&&e.length)for(var i=0,k=e.length;i<k;++i)g.call(j||window,e[i],i,e)},byId:function(e,g){return typeof e=="string"?(g||document).getElementById(e):
e},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(e){return e};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||f())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(d){(function(){function f(n,r,y){if(y!==null){var A=n[r];if(typeof A=="string")n[r]=[A,y];else if(a.isArray(A))A.push(y);else n[r]=y}}var a=d,b=a.config;d.fieldToObject=function(n){var r=null;if(n=a.byId(n)){var y=n.name,A=(n.type||"").toLowerCase();if(y&&A&&!n.disabled)if(A=="radio"||A=="checkbox"){if(n.checked)r=n.value}else if(n.multiple){r=[];a.query("option",n).forEach(function(h){h.selected&&
r.push(h.value)})}else r=n.value}return r};d.formToObject=function(n){var r={};a.forEach(d.byId(n).elements,function(y){var A=y.name,h=(y.type||"").toLowerCase();if(A&&h&&"file|submit|image|reset|button|".indexOf(h)==-1&&!y.disabled){f(r,A,a.fieldToObject(y));if(h=="image")r[A+".x"]=r[A+".y"]=r[A].x=r[A].y=0}});return r};d.objectToQuery=function(n){var r=encodeURIComponent,y=[],A={};for(var h in n){var l=n[h];if(l!=A[h]){var o=r(h)+"=";if(a.isArray(l))for(var q=0;q<l.length;q++)y.push(o+r(l[q]));
else y.push(o+r(l))}}return y.join("&")};d.formToQuery=function(n){return a.objectToQuery(a.formToObject(n))};d.formToJson=function(n,r){return a.toJson(a.formToObject(n),r)};d.queryToObject=function(n){var r={};n=n.split("&");var y=decodeURIComponent;a.forEach(n,function(A){if(A.length){var h=A.split("=");A=y(h.shift());h=y(h.join("="));if(typeof r[A]=="string")r[A]=[r[A]];if(a.isArray(r[A]))r[A].push(h);else r[A]=h}});return r};d._blockAsync=false;var c=a._contentHandlers=d.contentHandlers={text:function(n){return n.responseText},
json:function(n){return a.fromJson(n.responseText||null)},"json-comment-filtered":function(n){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.");n=n.responseText;var r=n.indexOf("/*"),y=n.lastIndexOf("*/");if(r==-1||y==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(n.substring(r+2,y))},javascript:function(n){return a.eval(n.responseText)},xml:function(n){var r=n.responseXML;if(a.isIE&&(!r||!r.documentElement)){var y=function(A){return"MSXML"+A+".DOMDocument"};y=["Microsoft.XMLDOM",y(6),y(4),y(3),y(2)];a.some(y,function(A){try{var h=new ActiveXObject(A);h.async=false;h.loadXML(n.responseText);r=h}catch(l){return false}return true})}return r},"json-comment-optional":function(n){return n.responseText&&/^[^{\[]*\/\*/.test(n.responseText)?c["json-comment-filtered"](n):
c.json(n)}};d._ioSetArgs=function(n,r,y,A){var h={args:n,url:n.url},l=null;if(n.form){l=a.byId(n.form);var o=l.getAttributeNode("action");h.url=h.url||(o?o.value:null);l=a.formToObject(l)}o=[{}];l&&o.push(l);n.content&&o.push(n.content);n.preventCache&&o.push({"dojo.preventCache":(new Date).valueOf()});h.query=a.objectToQuery(a.mixin.apply(null,o));h.handleAs=n.handleAs||"text";var q=new a.Deferred(r);q.addCallbacks(y,function(B){return A(B,q)});var s=n.load;s&&a.isFunction(s)&&q.addCallback(function(B){return s.call(n,
B,h)});var z=n.error;z&&a.isFunction(z)&&q.addErrback(function(B){return z.call(n,B,h)});var C=n.handle;C&&a.isFunction(C)&&q.addBoth(function(B){return C.call(n,B,h)});if(b.ioPublish&&a.publish&&h.args.ioPublish!==false){q.addCallbacks(function(B){a.publish("/dojo/io/load",[q,B]);return B},function(B){a.publish("/dojo/io/error",[q,B]);return B});q.addBoth(function(B){a.publish("/dojo/io/done",[q,B]);return B})}q.ioArgs=h;return q};var e=function(n){n.canceled=true;var r=n.ioArgs.xhr,y=typeof r.abort;
if(y=="function"||y=="object"||y=="unknown")r.abort();n=n.ioArgs.error;if(!n){n=new Error("xhr cancelled");n.dojoType="cancel"}return n},g=function(n){n=c[n.ioArgs.handleAs](n.ioArgs.xhr);return n===undefined?null:n},j=function(n,r){r.ioArgs.args.failOk||console.error(n);return n},i=null,k=[],m=0,p=function(n){if(m<=0){m=0;if(b.ioPublish&&a.publish&&(!n||n&&n.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},w=function(){var n=(new Date).getTime();if(!a._blockAsync)for(var r=0,y;r<k.length&&
(y=k[r]);r++){var A=y.dfd,h=function(){if(!A||A.canceled||!y.validCheck(A)){k.splice(r--,1);m-=1}else if(y.ioCheck(A)){k.splice(r--,1);y.resHandle(A);m-=1}else if(A.startTime)if(A.startTime+(A.ioArgs.args.timeout||0)<n){k.splice(r--,1);var o=new Error("timeout exceeded");o.dojoType="timeout";A.errback(o);A.cancel();m-=1}};if(d.config.debugAtAllCosts)h.call(this);else try{h.call(this)}catch(l){A.errback(l)}}p(A);if(!k.length){clearInterval(i);i=null}};d._ioCancelAll=function(){try{a.forEach(k,function(r){try{r.dfd.cancel()}catch(y){}})}catch(n){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(n){if(b.ioPublish&&a.publish&&n.ioArgs.args.ioPublish!==false){m||a.publish("/dojo/io/start");m+=1;a.publish("/dojo/io/send",[n])}};a._ioWatch=function(n,r,y,A){var h=n.ioArgs.args;if(h.timeout)n.startTime=(new Date).getTime();k.push({dfd:n,validCheck:r,ioCheck:y,resHandle:A});i||(i=setInterval(w,50));h.sync&&w()};var t="application/x-www-form-urlencoded",u=function(n){return n.ioArgs.xhr.readyState},v=function(n){return 4==n.ioArgs.xhr.readyState},
x=function(n){var r=n.ioArgs.xhr;if(a._isDocumentOk(r))n.callback(n);else{var y=new Error("Unable to load "+n.ioArgs.url+" status:"+r.status);y.status=r.status;y.responseText=r.responseText;n.errback(y)}};d._ioAddQueryToUrl=function(n){if(n.query.length){n.url+=(n.url.indexOf("?")==-1?"?":"&")+n.query;n.query=null}};d.xhr=function(n,r,y){var A=a._ioSetArgs(r,e,g,j),h=A.ioArgs,l=h.xhr=a._xhrObj(h.args);if(!l){A.cancel();return A}if("postData"in r)h.query=r.postData;else if("putData"in r)h.query=r.putData;
else if("rawBody"in r)h.query=r.rawBody;else if(arguments.length>2&&!y||"POST|PUT".indexOf(n.toUpperCase())==-1)a._ioAddQueryToUrl(h);l.open(n,h.url,r.sync!==true,r.user||undefined,r.password||undefined);if(r.headers)for(var o in r.headers)if(o.toLowerCase()==="content-type"&&!r.contentType)r.contentType=r.headers[o];else r.headers[o]&&l.setRequestHeader(o,r.headers[o]);l.setRequestHeader("Content-Type",r.contentType||t);if(!r.headers||!("X-Requested-With"in r.headers))l.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(A);if(d.config.debugAtAllCosts)l.send(h.query);else try{l.send(h.query)}catch(q){h.error=q;A.cancel()}a._ioWatch(A,u,v,x);return A};d.xhrGet=function(n){return a.xhr("GET",n)};d.rawXhrPost=d.xhrPost=function(n){return a.xhr("POST",n,true)};d.rawXhrPut=d.xhrPut=function(n){return a.xhr("PUT",n,true)};d.xhrDelete=function(n){return a.xhr("DELETE",n)}})();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 f=d._mixin;d._Line=function(j,i){this.start=j;this.end=i};d._Line.prototype.getValue=function(j){return(this.end-this.start)*j+this.start};d.Animation=function(j){f(this,j);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 j=this._percent,i=this.easing;return i?i(j):j},_fire:function(j,i){i=i||[];if(this[j])if(d.config.debugAtAllCosts)this[j].apply(this,i);else try{this[j].apply(this,i)}catch(k){console.error("exception in animation handler for:",j);console.error(k)}return this},play:function(j,i){var k=this;k._delayTimer&&k._clearTimer();if(i){k._stopTimer();k._active=k._paused=false;k._percent=0}else if(k._active&&!k._paused)return k;k._fire("beforeBegin",[k.node]);j=j||k.delay;var m=d.hitch(k,
"_play",i);if(j>0){k._delayTimer=setTimeout(m,j);return k}m();return k},_play:function(){var j=this;j._delayTimer&&j._clearTimer();j._startTime=(new Date).valueOf();if(j._paused)j._startTime-=j.duration*j._percent;j._active=true;j._paused=false;var i=j.curve.getValue(j._getStep());if(!j._percent){if(!j._startRepeatCount)j._startRepeatCount=j.repeat;j._fire("onBegin",[i])}j._fire("onPlay",[i]);j._cycle();return j},pause:function(){var j=this;j._delayTimer&&j._clearTimer();j._stopTimer();if(!j._active)return j;
j._paused=true;j._fire("onPause",[j.curve.getValue(j._getStep())]);return j},gotoPercent:function(j,i){var k=this;k._stopTimer();k._active=k._paused=true;k._percent=j;i&&k.play();return k},stop:function(j){var i=this;i._delayTimer&&i._clearTimer();if(!i._timer)return i;i._stopTimer();if(j)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 j=
this;if(j._active){var i=((new Date).valueOf()-j._startTime)/j.duration;if(i>=1)i=1;j._percent=i;if(j.easing)i=j.easing(i);j._fire("onAnimate",[j.curve.getValue(i)]);if(j._percent<1)j._startTimer();else{j._active=false;if(j.repeat>0){j.repeat--;j.play(null,true)}else if(j.repeat==-1)j.play(null,true);else if(j._startRepeatCount){j.repeat=j._startRepeatCount;j._startRepeatCount=0}j._percent=0;j._fire("onEnd",[j.node]);!j.repeat&&j._stopTimer()}}return j},_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 e=d.isIE?function(j){var i=j.style;if(!i.width.length&&d.style(j,"width")=="auto")i.width="auto"}:function(){};d._fade=function(j){j.node=d.byId(j.node);
var i=f({properties:{}},j);j=i.properties.opacity={};j.start=!("start"in i)?function(){return+d.style(i.node,"opacity")||0}:i.start;j.end=i.end;j=d.animateProperty(i);d.connect(j,"beforeBegin",d.partial(e,i.node));return j};d.fadeIn=function(j){return d._fade(f({end:1},j))};d.fadeOut=function(j){return d._fade(f({end:0},j))};d._defaultEasing=function(j){return 0.5+Math.sin((j+1.5)*Math.PI)/2};var g=function(j){this._properties=j;for(var i in j){var k=j[i];if(k.start instanceof d.Color)k.tempColor=
new d.Color}};g.prototype.getValue=function(j){var i={};for(var k in this._properties){var m=this._properties[k],p=m.start;if(p instanceof d.Color)i[k]=d.blendColors(p,m.end,j,m.tempColor).toCss();else d.isArray(p)||(i[k]=(m.end-p)*j+p+(k!="opacity"?m.units||"px":0))}return i};d.animateProperty=function(j){var i=j.node=d.byId(j.node);if(!j.easing)j.easing=d._defaultEasing;j=new d.Animation(j);d.connect(j,"beforeBegin",j,function(){var k={};for(var m in this.properties){if(m=="width"||m=="height")this.node.display=
"block";var p=this.properties[m];if(d.isFunction(p))p=p(i);p=k[m]=f({},d.isObject(p)?p:{end:p});if(d.isFunction(p.start))p.start=p.start(i);if(d.isFunction(p.end))p.end=p.end(i);var w=m.toLowerCase().indexOf("color")>=0,t=function(u,v){var x={height:u.offsetHeight,width:u.offsetWidth}[v];if(x!==undefined)return x;x=d.style(u,v);return v=="opacity"?+x:w?x:parseFloat(x)};if("end"in p){if(!("start"in p))p.start=t(i,m)}else p.end=t(i,m);if(w){p.start=new d.Color(p.start);p.end=new d.Color(p.end)}else p.start=
m=="opacity"?+p.start:parseFloat(p.start)}this.curve=new g(k)});d.connect(j,"onAnimate",d.hitch(d,"style",j.node));return j};d.anim=function(j,i,k,m,p,w){return d.animateProperty({node:j,duration:k||d.Animation.prototype.duration,properties:i,easing:m,onEnd:p}).play(w||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 f(g,j,i){this.serviceId=g;this.name=j;this.properties=i}function a(g,j,i){this.serviceId=g;this.serviceReference=j;this.internalRegistry=i}function b(g,j,i){this.serviceId=g;this.implementation=j;this.internalRegistry=i;var k;for(k in j)if(typeof j[k]==="function")this[k]=function(m){return function(){if(i.isRegistered(g)){var p=new d.Deferred;try{var w=j[m].apply(j,Array.prototype.slice.call(arguments));d.when(w,d.hitch(p,p.resolve),d.hitch(p,
p.reject),d.hitch(p,p.progress))}catch(t){p.reject(t)}return p}throw new Error("Service was unregistered");}}(k)}function c(){this._namedlisteners={}}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new c;var g=this;this.internalRegistry={isRegistered:function(j){return g._entries[j]?true:false},unregisterService:function(j){var i=g._entries[j];if(i){for(var k=i.reference,m=g._namedReferences[k.getName()],p=0;p<m.length;p++)if(m[p]===k){if(m.length===1)delete g._namedReferences[k.getName()];
else m.splice(p,1);break}g._entries[j]=null;g._serviceEventTarget.dispatchEvent("serviceRemoved",k,i.service)}},dispatchEvent:function(j,i){var k=g._entries[j];k&&k.eventTarget.dispatchEvent.apply(k.eventTarget,[i].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(j,i,k){(j=g._entries[j])&&j.eventTarget.addEventListener(i,k)},removeEventListener:function(j,i,k){(j=g._entries[j])&&j.eventTarget.removeEventListener(i,k)}}}f.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var g=[],j;for(j in this.properties)this.properties.hasOwnProperty(j)&&g.push(j);return g},getProperty:function(g){return this.properties[g]}};f.prototype.constructor=f;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,j){this.internalRegistry.addEventListener(this.serviceId,g,j)},removeEventListener:function(g,j){this.internalRegistry.removeEventListener(this.serviceId,g,j)}};b.prototype.constructor=b;c.prototype={dispatchEvent:function(g){var j=this._namedlisteners[g];if(j)for(var i=0;i<j.length;i++)try{var k=Array.prototype.slice.call(arguments,1);j[i].apply(null,k)}catch(m){console.log(m)}},addEventListener:function(g,j){this._namedlisteners[g]=
this._namedlisteners[g]||[];this._namedlisteners[g].push(j)},removeEventListener:function(g,j){var i=this._namedlisteners[g];if(i)for(var k=0;k<i.length;k++)if(i[k]===j){if(i.length===1)delete this._namedlisteners[g];else i.splice(k,1);break}}};c.prototype.constructor=c;e.prototype={getService:function(g){var j;if(typeof g==="string"){if(this._namedReferences[g])for(var i=0;i<this._namedReferences[g].length;i++)if(j=this._entries[this._namedReferences[g][i].getServiceId()].service)break}else j=this._entries[g.getServiceId()].service;
return j},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:[];g=[];for(var j=0;j<this._entries.length;j++)this._entries[j]&&g.push(this._entries[j].reference);return g},registerService:function(g,j,i){var k=this._entries.length;i=new f(k,g,i);j=new b(k,j,this.internalRegistry);this._namedReferences[g]=this._namedReferences[g]||[];this._namedReferences[g].push(i);this._entries.push({reference:i,service:j,eventTarget:new c});this._serviceEventTarget.dispatchEvent("serviceAdded",
i,j);return new a(k,i,this.internalRegistry)},addEventListener:function(g,j){this._serviceEventTarget.addEventListener(g,j)},removeEventListener:function(g,j){this._serviceEventTarget.removeEventListener(g,j)}};e.prototype.constructor=e;return{ServiceReference:f,ServiceRegistration:a,Service:b,EventTarget:c,ServiceRegistry:e}});define("dijit",["dojo"],function(d){return dijit=d._dijit||{}});
define("orion/commonHTMLFragments",["require"],function(d){var f='<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:f,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 f(p,w){w=p.indexOf(w);return w>=0?p.substring(w+1):""}function a(){return f(location.href,"#")}function b(){d.publish("/dojo/hashchange",[a()])}function c(){if(a()!==j){j=a();b()}}function e(p){if(i)if(i.isTransitioning())setTimeout(d.hitch(null,e,p),m);else{var w=i.iframe.location.href,t=w.indexOf("?");i.iframe.location.replace(w.substring(0,t)+"?"+p)}else{location.replace("#"+p);!k&&c()}}function g(){function p(){j=a();u=r?j:f(y.href,
"?");v=false;x=null}var w=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");w.id="dojo-hash-iframe";w.src=t+"?"+a();w.style.display="none";document.body.appendChild(w);this.iframe=d.global["dojo-hash-iframe"];
var u,v,x,n,r,y=this.iframe.location;this.isTransitioning=function(){return v};this.pollLocation=function(){if(!r)try{var A=f(y.href,"?");if(document.title!=n)n=this.iframe.document.title=document.title}catch(h){r=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var l=a();if(v&&j===l)if(r||A===x){p();b()}else{setTimeout(d.hitch(this,this.pollLocation),0);return}else if(!(j===l&&(r||u===A)))if(j!==l){j=l;v=true;x=l;w.src=t+"?"+x;r=false;setTimeout(d.hitch(this,this.pollLocation),
0);return}else if(!r){location.href="#"+y.search.substring(1);p();b()}setTimeout(d.hitch(this,this.pollLocation),m)};p();setTimeout(d.hitch(this,this.pollLocation),m)}d.hash=function(p,w){if(!arguments.length)return a();if(p.charAt(0)=="#")p=p.substring(1);if(w)e(p);else location.href="#"+p;return p};var j,i,k,m=d.config.hashPollFrequency||100;d.addOnLoad(function(){if("onhashchange"in d.global&&(!d.isIE||d.isIE>=8&&document.compatMode!="BackCompat"))k=d.connect(d.global,"onhashchange",b);else if(document.addEventListener){j=
a();setInterval(c,m)}else if(document.attachEvent)i=new g})})();return d.hash});
(function(){var d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=/^\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,e,g;if(typeof window!=="undefined"&&window.navigator&&window.document)e=function(j,i){var k=c.createXhr();k.open("GET",j,true);k.onreadystatechange=function(){k.readyState===4&&i(k.responseText)};k.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){g=require.nodeRequire("fs");e=function(j,i){i(g.readFileSync(j,"utf8"))}}else if(typeof Packages!=="undefined")e=function(j,i){var k=new java.io.File(j);j=java.lang.System.getProperty("line.separator");k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8"));var m,p,w="";try{m=new java.lang.StringBuffer;if((p=k.readLine())&&p.length()&&p.charAt(0)===65279)p=p.substring(1);for(m.append(p);(p=k.readLine())!==null;){m.append(j);m.append(p)}w=
String(m.toString())}finally{k.close()}i(w)};return c={version:"0.24.0",strip:function(j){if(j){j=j.replace(f,"");var i=j.match(a);if(i)j=i[1]}else j="";return j},jsEscape:function(j){return j.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 j,i,k;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(i=0;i<3;i++){k=d[i];try{j=new ActiveXObject(k)}catch(m){}if(j){d=
[k];break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j},get:e,load:function(j,i,k,m){var p=false,w=j.indexOf("."),t=j.substring(0,w),u=j.substring(w+1,j.length);w=u.indexOf("!");if(w!==-1){p=u.substring(w+1,u.length);p=p==="strip";u=u.substring(0,w)}i=i.nameToUrl(t,"."+u);c.get(i,function(v){v=p?c.strip(v):v;if(m.isBuild&&m.inlineText)b[j]=v;k(v)})},write:function(j,i,k){if(i in b){var m=c.jsEscape(b[i]);k("define('"+j+"!"+i+"', function () { return '"+m+"';});\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,f){f.getObject("i18n",true,f);f.i18n.getLocalization=f.i18n.getLocalization||function(a,b,c){c=f.i18n.normalizeLocale(c);var e=c.split("-"),g=[a,"nls",b].join(".");if(typeof f.global.require!=="undefined"){var j=d("i18n!"+[a.replace(/\./g,"/"),"nls",b].join("/"));(f._loadedModules[g]=f._loadedModules[g]||{})[e.join("_")]=j.root||j}if(g=f._loadedModules[g]){var i;for(j=e.length;j>0;j--){var k=e.slice(0,j).join("_");if(g[k]){i=g[k];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);};f.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():f.locale;if(a=="root")a="ROOT";return a};f.i18n._requireLocalization=function(a,b,c,e){c=f.i18n.normalizeLocale(c);var g=[a,"nls",b].join("."),j="";if(e){for(var i=e.split(","),k=0;k<i.length;k++)if(c.indexOf(i[k])==0)if(i[k].length>j.length)j=i[k];j||(j="ROOT")}i=e?j:c;var m=f._loadedModules[g];k=null;if(m){if(f.config.localizationComplete&&
m._built)return;k=i.replace(/-/g,"_");k=f._loadedModules[g+"."+k]}if(!k){m=f.provide(g);var p=f._getModuleSymbols(a).concat("nls").join("/"),w;f.i18n._searchLocalePath(i,e,function(t){var u=t.replace(/-/g,"_"),v=g+"."+u,x=false;if(f._loadedModules[v])x=true;else{f.provide(v);v=[p];t!="ROOT"&&v.push(t);v.push(b);t=v.join("/")+".js";x=f._loadPath(t,null,function(n){n=n.root||n;var r=function(){};r.prototype=w;m[u]=new r;for(var y in n)m[u][y]=n[y]})}if(x&&m[u])w=m[u];else m[u]=w;if(e)return true})}if(e&&
c!=j)m[c.replace(/-/g,"_")]=m[j.replace(/-/g,"_")]};(function(){var a=f.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var b=f.i18n._requireLocalization;f.i18n._requireLocalization=function(c,e,g,j){b(c,e,g,j);if(!g)for(g=0;g<a.length;g++)b(c,e,a[g],j)}}})();f.i18n._searchLocalePath=function(a,b,c){a=f.i18n.normalizeLocale(a);var e=a.split("-");a=[];for(var g=e.length;g>0;g--)a.push(e.slice(0,g).join("-"));a.push(false);b&&a.reverse();for(b=a.length-1;b>=0;b--)if(c(a[b]||"ROOT"))break};f.i18n._preloadLocalizations=
function(a,b){function c(j){j=f.i18n.normalizeLocale(j);f.i18n._searchLocalePath(j,true,function(i){for(var k=0;k<b.length;k++)if(b[k]==i){f.require(a+"_"+i);return true}return false})}c();for(var e=f.config.extraLocale||[],g=0;g<e.length;g++)c(e[g])};return f.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 f=d.doc.compatMode=="BackCompat"?d.body():d.doc.documentElement,a=d._docScroll();return{w:f.clientWidth,h:f.clientHeight,l:a.x,t:a.y}};d.window.get=function(f){if(d.isIE&&window!==document.parentWindow){f.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=f._parentWindow;f._parentWindow=null;return a}return f.parentWindow||f.defaultView};d.window.scrollIntoView=function(f,
a){try{f=d.byId(f);var b=f.ownerDocument||d.doc,c=b.body||d.body(),e=b.documentElement||c.parentNode,g=d.isIE,j=d.isWebKit;if((!(d.isMoz||g||j||d.isOpera)||f==c||f==e)&&typeof f.scrollIntoView!="undefined")f.scrollIntoView(false);else{var i=b.compatMode=="BackCompat",k=g>=9&&f.ownerDocument.parentWindow.frameElement?e.clientHeight>0&&e.clientWidth>0&&(c.clientHeight==0||c.clientWidth==0||c.clientHeight>e.clientHeight||c.clientWidth>e.clientWidth)?e:c:i?c:e;b=j?c:k;var m=k.clientWidth,p=k.clientHeight,
w=!d._isBodyLtr(),t=a||d.position(f),u=f.parentNode;a=function(z){return g<=6||g&&i?false:d.style(z,"position").toLowerCase()=="fixed"};if(!a(f))for(;u;){if(u==c)u=b;var v=d.position(u),x=a(u);if(u==b){v.w=m;v.h=p;if(b==e&&g&&w)v.x+=b.offsetWidth-v.w;if(v.x<0||!g)v.x=0;if(v.y<0||!g)v.y=0}else{var n=d._getPadBorderExtents(u);v.w-=n.w;v.h-=n.h;v.x+=n.l;v.y+=n.t;var r=u.clientWidth,y=v.w-r;if(r>0&&y>0){v.w=r;v.x+=w&&(g||u.clientLeft>n.l)?y:0}r=u.clientHeight;y=v.h-r;if(r>0&&y>0)v.h=r}if(x){if(v.y<0){v.h+=
v.y;v.y=0}if(v.x<0){v.w+=v.x;v.x=0}if(v.y+v.h>p)v.h=p-v.y;if(v.x+v.w>m)v.w=m-v.x}var A=t.x-v.x,h=t.y-Math.max(v.y,0),l=A+t.w-v.w,o=h+t.h-v.h;if(l*A>0){var q=Math[A<0?"max":"min"](A,l);if(w&&(g==8&&!i||g>=9))q=-q;t.x+=u.scrollLeft;u.scrollLeft+=q;t.x-=u.scrollLeft}if(o*h>0){t.y+=u.scrollTop;u.scrollTop+=Math[h<0?"max":"min"](h,o);t.y-=u.scrollTop}u=u!=b&&!x&&u.parentNode}}}catch(s){console.error("scrollIntoView: "+s);f.scrollIntoView(false)}};return d.window});
define("dijit/_base/manager",["dojo","dijit"],function(d,f){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,e;for(e in this._hash)a.call(b,this._hash[e],c++,this._hash);return this},
filter:function(a,b){b=b||d.global;var c=new f.WidgetSet,e=0,g;for(g in this._hash){var j=this._hash[g];a.call(b,j,e++,this._hash)&&c.add(j)}return c},byId:function(a){return this._hash[a]},byClass:function(a){var b=new f.WidgetSet,c,e;for(c in this._hash){e=this._hash[c];e.declaredClass==a&&b.add(e)}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,e;for(e in this._hash)if(!a.call(b,
this._hash[e],c++,this._hash))return false;return true},some:function(a,b){b=b||d.global;var c=0,e;for(e in this._hash)if(a.call(b,this._hash[e],c++,this._hash))return true;return false}});(function(){f.registry=new f.WidgetSet;var a=f.registry._hash,b=d.attr,c=d.hasAttr,e=d.style;f.byId=function(k){return typeof k=="string"?a[k]:k};var g={};f.getUniqueId=function(k){var m;do m=k+"_"+(k in g?++g[k]:(g[k]=0));while(a[m]);return f._scopeName=="dijit"?m:f._scopeName+"_"+m};f.findWidgets=function(k){function m(w){for(w=
w.firstChild;w;w=w.nextSibling)if(w.nodeType==1){var t=w.getAttribute("widgetId");if(t)(t=a[t])&&p.push(t);else m(w)}}var p=[];m(k);return p};f._destroyAll=function(){f._curFocus=null;f._prevFocus=null;f._activeStack=[];d.forEach(f.findWidgets(d.body()),function(k){if(!k._destroyed)if(k.destroyRecursive)k.destroyRecursive();else k.destroy&&k.destroy()})};d.isIE&&d.addOnWindowUnload(function(){f._destroyAll()});f.byNode=function(k){return a[k.getAttribute("widgetId")]};f.getEnclosingWidget=function(k){for(;k;){var m=
k.getAttribute&&k.getAttribute("widgetId");if(m)return a[m];k=k.parentNode}return null};var j=f._isElementShown=function(k){var m=e(k);return m.visibility!="hidden"&&m.visibility!="collapsed"&&m.display!="none"&&b(k,"type")!="hidden"};f.hasDefaultTabStop=function(k){switch(k.nodeName.toLowerCase()){case "a":return c(k,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var m;try{var p=k.contentDocument;if("designMode"in p&&p.designMode==
"on")return true;m=p.body}catch(w){try{m=k.contentWindow.document.body}catch(t){return false}}return m.contentEditable=="true"||m.firstChild&&m.firstChild.contentEditable=="true";default:return k.contentEditable=="true"}};var i=f.isTabNavigable=function(k){return b(k,"disabled")?false:c(k,"tabIndex")?b(k,"tabIndex")>=0:f.hasDefaultTabStop(k)};f._getTabNavigable=function(k){function m(A){return A&&A.tagName.toLowerCase()=="input"&&A.type&&A.type.toLowerCase()=="radio"&&A.name&&A.name.toLowerCase()}
function p(A){return r[m(A)]||A}var w,t,u,v,x,n,r={},y=function(A){d.query("> *",A).forEach(function(h){if(!(d.isIE&&h.scopeName!=="HTML"||!j(h))){if(i(h)){var l=b(h,"tabIndex");if(!c(h,"tabIndex")||l==0){w||(w=h);t=h}else if(l>0){if(!u||l<v){v=l;u=h}if(!x||l>=n){n=l;x=h}}l=m(h);if(d.attr(h,"checked")&&l)r[l]=h}h.nodeName.toUpperCase()!="SELECT"&&y(h)}})};j(k)&&y(k);return{first:p(w),last:p(t),lowest:p(u),highest:p(x)}};f.getFirstInTabbingOrder=function(k){k=f._getTabNavigable(d.byId(k));return k.lowest?
k.lowest:k.first};f.getLastInTabbingOrder=function(k){k=f._getTabNavigable(d.byId(k));return k.last?k.last:k.highest};f.defaultDuration=d.config.defaultDuration||200})();return f});
define("dojo/Stateful",["dojo"],function(d){d.declare("dojo.Stateful",null,{postscript:function(f){f&&d.mixin(this,f)},get:function(f){return this[f]},set:function(f,a){if(typeof f==="object"){for(var b in f)this.set(b,f[b]);return this}b=this[f];this[f]=a;this._watchCallbacks&&this._watchCallbacks(f,b,a);return this},watch:function(f,a){var b=this._watchCallbacks;if(!b){var c=this;b=this._watchCallbacks=function(g,j,i,k){var m=function(p){if(p){p=p.slice();for(var w=0,t=p.length;w<t;w++)try{p[w].call(c,
g,j,i)}catch(u){console.error(u)}}};m(b["_"+g]);k||m(b["*"])}}if(!a&&typeof f==="function"){a=f;f="*"}else f="_"+f;var e=b[f];if(typeof e!=="object")e=b[f]=[];e.push(a);return{unwatch:function(){e.splice(d.indexOf(e,a),1)}}}});return d.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(d,f){(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=f.getUniqueId(this.declaredClass.replace(/\./g,"_"));f.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,e){if(e.params&&c in e.params||e[c])e.set(c,e[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,e=a.prototype;for(var g in e)if(d.isFunction(e[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(e){b(e,d.disconnect)});b(this._subscribes,function(e){c(e)});b(this._supportingWidgets||[],function(e){if(e.destroyRecursive)e.destroyRecursive();else e.destroy&&e.destroy()});this.destroyRendering(a);f.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(e){var g=this[e.node||e||"domNode"];switch(e.type||"attribute"){case "attribute":if(d.isFunction(b))b=d.hitch(this,b);e=e.attribute?e.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;d.attr(g,e,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 e=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 e||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(f.byNode):[]},getChildren:function(){return this.containerNode?f.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 f._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(d,f){d.mixin(f,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return f.getBookmark().isCollapsed},getBookmark:function(){var a,b,c=d.doc.selection,e=f._curFocus;if(d.global.getSelection){if(c=d.global.getSelection())if(c.isCollapsed){if(a=e?e.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!e.type||e.type.toLowerCase()=="text")){c={start:e.selectionStart,end:e.selectionEnd,node:e,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=e?e.tagName:"";a=a.toLowerCase();if(e&&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(e=b.length;c<e;)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 e;if(a.pRange)e=a.range;else if(d.isArray(a)){e=b.body.createControlRange();d.forEach(a,function(g){e.addElement(g)})}else{e=b.body.createTextRange();e.moveToBookmark(a)}e.select()}},getFocus:function(a,b){a=!f._curFocus||a&&d.isDescendant(f._curFocus,a.domNode)?f._prevFocus:f._curFocus;return{node:a,bookmark:a==f._curFocus&&d.withGlobal(b||
d.global,f.getBookmark),openedForWindow:b}},focus:function(a){if(a){var b="node"in a?a.node:a,c=a.bookmark;a=a.openedForWindow;var e=c?c.isCollapsed:false;if(b){var g=b.tagName.toLowerCase()=="iframe"?b.contentWindow:b;if(g&&g.focus)try{g.focus()}catch(j){}f._onFocusNode(b)}if(c&&d.withGlobal(a||d.global,f.isCollapsed)&&!e){a&&a.focus();try{d.withGlobal(a||d.global,f.moveToBookmark,null,[c])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return f.registerWin(a.contentWindow,a)},unregisterIframe:function(a){f.unregisterWin(a)},
registerWin:function(a,b){var c=function(m){f._justMouseDowned=true;setTimeout(function(){f._justMouseDowned=false},0);d.isIE&&m&&m.srcElement&&m.srcElement.parentNode==null||f._onTouchNode(b||m.target||m.srcElement,"mouse")},e=d.isIE?a.document.documentElement:a.document;if(e)if(d.isIE){a.document.body.attachEvent("onmousedown",c);var g=function(m){m.srcElement.tagName.toLowerCase()!="#document"&&f.isTabNavigable(m.srcElement)?f._onFocusNode(b||m.srcElement):f._onTouchNode(b||m.srcElement)};e.attachEvent("onactivate",
g);var j=function(m){f._onBlurNode(b||m.srcElement)};e.attachEvent("ondeactivate",j);return function(){a.document.detachEvent("onmousedown",c);e.detachEvent("onactivate",g);e.detachEvent("ondeactivate",j);e=null}}else{e.body.addEventListener("mousedown",c,true);var i=function(m){f._onFocusNode(b||m.target)};e.addEventListener("focus",i,true);var k=function(m){f._onBlurNode(b||m.target)};e.addEventListener("blur",k,true);return function(){e.body.removeEventListener("mousedown",c,true);e.removeEventListener("focus",
i,true);e.removeEventListener("blur",k,true);e=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){f._prevFocus=f._curFocus;f._curFocus=null;if(!f._justMouseDowned){f._clearActiveWidgetsTimer&&clearTimeout(f._clearActiveWidgetsTimer);f._clearActiveWidgetsTimer=setTimeout(function(){delete f._clearActiveWidgetsTimer;f._setStack([]);f._prevFocus=null},100)}},_onTouchNode:function(a,b){if(f._clearActiveWidgetsTimer){clearTimeout(f._clearActiveWidgetsTimer);delete f._clearActiveWidgetsTimer}var c=
[];try{for(;a;){var e=d.attr(a,"dijitPopupParent");if(e)a=f.byId(e).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"),j=g&&f.byId(g);j&&!(b=="mouse"&&j.get("disabled"))&&c.unshift(g);a=a.parentNode}}}catch(i){}f._setStack(c,b)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){f._onTouchNode(a);if(a!=f._curFocus){if(f._curFocus)f._prevFocus=f._curFocus;f._curFocus=a;d.publish("focusNode",
[a])}}},_setStack:function(a,b){var c=f._activeStack;f._activeStack=a;for(var e=0;e<Math.min(c.length,a.length);e++)if(c[e]!=a[e])break;for(var g,j=c.length-1;j>=e;j--)if(g=f.byId(c[j])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(b);d.publish("widgetBlur",[g,b])}for(j=e;j<a.length;j++)if(g=f.byId(a[j])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(b);d.publish("widgetFocus",[g,b])}}});d.addOnLoad(function(){var a=f.registerWin(window);d.isIE&&
d.addOnWindowUnload(function(){f.unregisterWin(a);a=null})});return f});
define("dojo/AdapterRegistry",["dojo"],function(d){d.AdapterRegistry=function(f){this.pairs=[];this.returnWrappers=f||false};d.extend(d.AdapterRegistry,{register:function(f,a,b,c,e){this.pairs[e?"unshift":"push"]([f,a,b,c])},match:function(){for(var f=0;f<this.pairs.length;f++){var a=this.pairs[f];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(f){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
f){this.pairs.splice(a,1);return true}return false}});return d.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(d,f){f.getViewport=function(){return d.window.getBox()};f.placeOnScreen=function(a,b,c,e){c=d.map(c,function(g){var j={corner:g,pos:{x:b.x,y:b.y}};if(e){j.pos.x+=g.charAt(1)=="L"?e.x:-e.x;j.pos.y+=g.charAt(0)=="T"?e.y:-e.y}return j});return f._place(a,c)};f._place=function(a,b,c,e){var g=d.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")d.body().appendChild(a);var j=null;
d.some(b,function(k){var m=k.corner,p=k.pos,w=0,t={w:m.charAt(1)=="L"?g.l+g.w-p.x:p.x-g.l,h:m.charAt(1)=="T"?g.t+g.h-p.y:p.y-g.t};if(c){w=c(a,k.aroundCorner,m,t,e);w=typeof w=="undefined"?0:w}var u=a.style,v=u.display,x=u.visibility;u.visibility="hidden";u.display="";var n=d.marginBox(a);u.display=v;u.visibility=x;u=Math.max(g.l,m.charAt(1)=="L"?p.x:p.x-n.w);v=Math.max(g.t,m.charAt(0)=="T"?p.y:p.y-n.h);x=Math.min(g.l+g.w,m.charAt(1)=="L"?u+n.w:p.x);p=Math.min(g.t+g.h,m.charAt(0)=="T"?v+n.h:p.y);x=
x-u;p=p-v;w+=n.w-x+(n.h-p);if(j==null||w<j.overflow)j={corner:m,aroundCorner:k.aroundCorner,x:u,y:v,w:x,h:p,overflow:w,spaceAvailable:t};return!w});j.overflow&&c&&c(a,j.aroundCorner,j.corner,j.spaceAvailable,e);b=d._isBodyLtr();var i=a.style;i.top=j.y+"px";i[b?"left":"right"]=(b?j.x:g.w-j.x-j.w)+"px";return j};f.placeOnScreenAroundNode=function(a,b,c,e){b=d.byId(b);b=d.position(b,true);return f._placeOnScreenAroundRect(a,b.x,b.y,b.w,b.h,c,e)};f.placeOnScreenAroundRectangle=function(a,b,c,e){return f._placeOnScreenAroundRect(a,
b.x,b.y,b.width,b.height,c,e)};f._placeOnScreenAroundRect=function(a,b,c,e,g,j,i){var k=[];for(var m in j)k.push({aroundCorner:m,corner:j[m],pos:{x:b+(m.charAt(1)=="L"?0:e),y:c+(m.charAt(0)=="T"?0:g)}});return f._place(a,k,i,{w:e,h:g})};f.placementRegistry=new d.AdapterRegistry;f.placementRegistry.register("node",function(a,b){return typeof b=="object"&&typeof b.offsetWidth!="undefined"&&typeof b.offsetHeight!="undefined"},f.placeOnScreenAroundNode);f.placementRegistry.register("rect",function(a,
b){return typeof b=="object"&&"x"in b&&"y"in b&&"width"in b&&"height"in b},f.placeOnScreenAroundRectangle);f.placeOnScreenAroundElement=function(){return f.placementRegistry.match.apply(f.placementRegistry,arguments)};f.getPopupAroundAlignment=function(a,b){var c={};d.forEach(a,function(e){switch(e){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 f});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(d,f){f.getDocumentWindow=function(a){return d.window.get(a)};return f});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(d,f){f.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,e=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,j=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));)f.popup.close(b[b.length-1].widget);var i=this._createWrapper(c);d.attr(i,{id:j,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 f.BackgroundIframe(i);e=g?f.placeOnScreenAroundElement(i,g,e,c.orient?d.hitch(c,"orient"):null):f.placeOnScreen(i,a,e=="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(k){if(k.charOrCode==d.keys.ESCAPE&&a.onCancel){d.stopEvent(k);a.onCancel()}else if(k.charOrCode===d.keys.TAB){d.stopEvent(k);(k=this.getTopPopup())&&k.onCancel&&k.onCancel()}}));c.onCancel&&
g.push(d.connect(c,"onCancel",a.onCancel));g.push(d.connect(c,c.onExecute?"onExecute":"onChange",this,function(){var k=this.getTopPopup();k&&k.onExecute&&k.onExecute()}));b.push({widget:c,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});c.onOpen&&c.onOpen(e);return e},close:function(a){for(var b=this._stack;a&&d.some(b,function(j){return j.widget==a})||!a&&b.length;){var c=b.pop(),e=c.widget,g=c.onClose;e.onClose&&e.onClose();d.forEach(c.handlers,d.disconnect);
e&&e.domNode&&this.hide(e);g&&g()}}};f._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;f.setWaiRole(b,"presentation")}return b};this.push=function(b){b.style.display="none";a.push(b)}});f.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(d.isIE||d.isMoz){var b=this.iframe=f._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(f.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){f._frames.push(this.iframe);delete this.iframe}}});return f.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(d,f){f.scrollIntoView=function(a,b){d.window.scrollIntoView(a,b)};return f.scrollIntoView});
define("dojo/uacss",["dojo"],function(d){(function(){var f=d.doc.documentElement,a=d.isIE,b=d.isOpera,c=Math.floor,e=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(e)==3};a["dj_"+g]=true;var j="";for(var i in a)if(a[i])j+=i+" ";f.className=d.trim(f.className+" "+j);d._loaders.unshift(function(){if(!d._isBodyLtr()){var k=
"dj_rtl dijitRtl "+j.replace(/ /g,"-rtl ");f.className=d.trim(f.className+" "+k)}})})();return d});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(d,f){return f});
define("dijit/_base/typematic",["dojo","dijit"],function(d,f){f.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,e,g,j,i,k){if(g!=this._obj){this.stop();
this._initialDelay=i||500;this._subsequentDelay=j||0.9;this._minDelay=k||10;this._obj=g;this._evt=a;this._node=c;this._count=this._currentTimeout=-1;this._callback=d.hitch(b,e);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,e,g,j,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(k){if(k.charOrCode==b.charOrCode&&(b.ctrlKey===undefined||b.ctrlKey==k.ctrlKey)&&(b.altKey===undefined||b.altKey==k.altKey)&&(b.metaKey===undefined||b.metaKey==(k.metaKey||false))&&(b.shiftKey===undefined||b.shiftKey==k.shiftKey)){d.stopEvent(k);f.typematic.trigger(k,
c,a,e,b,g,j,i)}else f.typematic._obj==b&&f.typematic.stop()}),d.connect(a,"onkeyup",this,function(){f.typematic._obj==b&&f.typematic.stop()})]},addMouseListener:function(a,b,c,e,g,j){var i=d.connect;return[i(a,"mousedown",this,function(k){d.stopEvent(k);f.typematic.trigger(k,b,a,c,a,e,g,j)}),i(a,"mouseup",this,function(k){d.stopEvent(k);f.typematic.stop()}),i(a,"mouseout",this,function(k){d.stopEvent(k);f.typematic.stop()}),i(a,"mousemove",this,function(k){k.preventDefault()}),i(a,"dblclick",this,
function(k){d.stopEvent(k);if(d.isIE){f.typematic.trigger(k,b,a,c,a,e,g,j);setTimeout(d.hitch(this,f.typematic.stop),50)}})]},addListener:function(a,b,c,e,g,j,i,k){return this.addKeyListener(b,c,e,g,j,i,k).concat(this.addMouseListener(a,e,g,j,i,k))}};return f.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(d,f){f.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(f.wai.onload);d.mixin(f,{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 f});
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,f){return f._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(d,f){d.connect(d,"_connect",function(a,b){a&&d.isFunction(a._onConnect)&&a._onConnect(b)});f._connectOnUseEventHandler=function(){};f._lastKeyDownNode=null;d.isIE?function(){var a=function(b){f._lastKeyDownNode=b.srcElement};d.doc.attachEvent("onkeydown",a);d.addOnWindowUnload(function(){d.doc.detachEvent("onkeydown",a)})}():d.doc.addEventListener("keydown",function(a){f._lastKeyDownNode=a.target},true);(function(){d.declare("dijit._Widget",
f._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:f._connectOnUseEventHandler,onDblClick:f._connectOnUseEventHandler,onKeyDown:f._connectOnUseEventHandler,onKeyPress:f._connectOnUseEventHandler,onKeyUp:f._connectOnUseEventHandler,onMouseDown:f._connectOnUseEventHandler,onMouseMove:f._connectOnUseEventHandler,onMouseOut:f._connectOnUseEventHandler,
onMouseOver:f._connectOnUseEventHandler,onMouseLeave:f._connectOnUseEventHandler,onMouseEnter:f._connectOnUseEventHandler,onMouseUp:f._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]!==f._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 e=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 j=d.hitch(this,c);g.push(e(a,"onkeydown",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),e(a,"onkeyup",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&i.target==f._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=null;return j(i)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return f._Widget});
define("dojo/string",["dojo"],function(d){d.getObject("string",true,d);d.string.rep=function(f,a){if(a<=0||!f)return"";for(var b=[];;){a&1&&b.push(f);if(!(a>>=1))break;f+=f}return b.join("")};d.string.pad=function(f,a,b,c){b||(b="0");f=String(f);a=d.string.rep(b,Math.ceil((a-f.length)/b.length));return c?f+a:a+f};d.string.substitute=function(f,a,b,c){c=c||d.global;b=b?d.hitch(c,b):function(e){return e};return f.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(e,g,j){e=d.getObject(g,false,
a);if(j)e=d.getObject(j,false,c).call(c,e,g);return b(e,g).toString()})};d.string.trim=String.prototype.trim?d.trim:function(f){f=f.replace(/^\s+/,"");for(var a=f.length-1;a>=0;a--)if(/\S/.test(f.charAt(a))){f=f.substring(0,a+1);break}return f};return d.string});
define("dojo/date/stamp",["dojo"],function(d){d.getObject("date.stamp",true,d);d.date.stamp.fromISOString=function(f,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(f);f=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,j){b[j]=b[j]||g})}f=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)f.setFullYear(b[0]||1970);var c=0,e=b[7]&&b[7].charAt(0);if(e!="Z"){c=(b[8]||0)*60+(Number(b[9])||0);if(e!="-")c*=-1}if(e)c-=f.getTimezoneOffset();c&&f.setTime(f.getTime()+c*6E4)}return f};d.date.stamp.toISOString=function(f,a){var b=function(j){return j<10?"0"+j:j};a=a||{};var c=[],e=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=f[e+"FullYear"]();g=["0000".substr((g+"").length)+
g,b(f[e+"Month"]()+1),b(f[e+"Date"]())].join("-")}c.push(g);if(a.selector!="date"){g=[b(f[e+"Hours"]()),b(f[e+"Minutes"]()),b(f[e+"Seconds"]())].join(":");e=f[e+"Milliseconds"]();if(a.milliseconds)g+="."+(e<100?"0":"")+b(e);if(a.zulu)g+="Z";else if(a.selector!="time"){f=f.getTimezoneOffset();a=Math.abs(f);g+=(f>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 f(i){if(e.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(e.isFunction(i))return"function";if(e.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof e._Url)return"url";return"object"}function a(i,k){switch(k){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(e.isFunction(i)){i=i.toString();i=e.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):e.getObject(i,false)||new Function(i)}catch(m){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 e.date.stamp.fromISOString(i)}case "url":return e.baseUrl+i;default:return e.fromJson(i)}}function b(i,k){for(var m in i)if(m.charAt(0)!=
"_")m in g||(k[m]=f(i[m]));return k}function c(i,k){var m=j[i];if(m){if(!k&&!m.params)m.params=b(m.cls.prototype,{})}else{i=e.getObject(i);m=null;if(!i)return null;k||(m=b(i.prototype,{}));m={cls:i,params:m}}return m}var e=d,g={},j={};e.connect(e,"extend",function(){j={}});this._functionFromScript=function(i,k){var m="",p="";(k=i.getAttribute(k+"args")||i.getAttribute("args"))&&e.forEach(k.split(/\s*,\s*/),function(w,t){m+="var "+w+" = arguments["+t+"]; "});(k=i.getAttribute("with"))&&k.length&&e.forEach(k.split(/\s*,\s*/),
function(w){m+="with("+w+"){";p+="}"});return new Function(m+i.innerHTML+p)};this.instantiate=function(i,k,m){var p=[];k=k||{};m=m||{};var w=(m.scope||e._scopeName)+"Type",t="data-"+(m.scope||e._scopeName)+"-";e.forEach(i,function(u){if(u){var v,x,n,r,y,A;if(u.node){v=u.node;x=u.type;A=u.fastpath;r=(n=u.clsInfo||x&&c(x,A))&&n.cls;y=u.scripts}else{v=u;y=(r=(n=(x=w in k?k[w]:v.getAttribute(w))&&c(x))&&n.cls)&&(r._noScript||r.prototype._noScript)?[]:e.query("> script[type^='dojo/']",v)}if(!n)throw new Error("Could not load class '"+
x);var h={};m.defaults&&e._mixin(h,m.defaults);u.inherited&&e._mixin(h,u.inherited);if(A){if((n=v.getAttribute(t+"props"))&&n.length)try{n=e.fromJson.call(m.propsThis,"{"+n+"}");e._mixin(h,n)}catch(l){throw new Error(l.toString()+" in data-dojo-props='"+n+"'");}if(n=v.getAttribute(t+"attach-point"))h.dojoAttachPoint=n;if(n=v.getAttribute(t+"attach-event"))h.dojoAttachEvent=n;d.mixin(h,k)}else{u=v.attributes;for(var o in n.params){x=o in k?{value:k[o],specified:true}:u.getNamedItem(o);if(!(!x||!x.specified&&
(!d.isIE||o.toLowerCase()!="value"))){x=x.value;switch(o){case "class":x="className"in k?k.className:v.className;break;case "style":x="style"in k?k.style:v.style&&v.style.cssText}var q=n.params[o];h[o]=typeof x=="string"?a(x,q):x}}}var s=[],z=[];e.forEach(y,function(B){v.removeChild(B);var E=B.getAttribute(t+"event")||B.getAttribute("event"),G=B.getAttribute("type");B=e.parser._functionFromScript(B,t);if(E)if(G=="dojo/connect")s.push({event:E,func:B});else h[E]=B;else z.push(B)});var C=(y=r.markupFactory||
r.prototype&&r.prototype.markupFactory)?y(h,v,r):new r(h,v);p.push(C);(r=v.getAttribute(t+"id")||v.getAttribute("jsId"))&&e.setObject(r,C);e.forEach(s,function(B){e.connect(C,B.event,null,B.func)});e.forEach(z,function(B){B.call(C)})}});k._started||e.forEach(p,function(u){if(!m.noStart&&u&&d.isFunction(u.startup)&&!u._started&&(!u.getParent||!u.getParent()))u.startup()});return p};this.parse=function(i,k){function m(v,x){var n=d.clone(v.inherited);d.forEach(["dir","lang"],function(o){var q=v.node.getAttribute(o);
if(q)n[o]=q});for(var r=v.clsInfo&&!v.clsInfo.cls.prototype._noScript?v.scripts:null,y=!v.clsInfo||!v.clsInfo.cls.prototype.stopParser||k&&k.template,A=v.node.firstChild;A;A=A.nextSibling)if(A.nodeType==1){var h,l=y&&A.getAttribute(w+"type");h=l?l:y&&A.getAttribute(p);l=l==h;if(h){h={type:h,fastpath:l,clsInfo:c(h,l),node:A,scripts:[],inherited:n};x.push(h);m(h,x)}else if(r&&A.nodeName.toLowerCase()=="script")(h=A.getAttribute("type"))&&/^dojo\/\w/i.test(h)&&r.push(A);else y&&m({node:A,inherited:n},
x)}}if(!k&&i&&i.rootNode){k=i;i=k.rootNode}else i=i;i=i?d.byId(i):d.body();k=k||{};var p=(k.scope||e._scopeName)+"Type",w="data-"+(k.scope||e._scopeName)+"-",t={};if(k&&k.inherited)for(var u in k.inherited)if(k.inherited[u])t[u]=k.inherited[u];u=[];m({node:i,inherited:t},u);return this.instantiate(u,k&&k.template?{template:true}:null,k)}});(function(){var f=function(){d.config.parseOnLoad&&d.parser.parse()};d.getObject("dijit.wai.onload")===d._loaders[0]?d._loaders.splice(1,0,f):d._loaders.unshift(f)})();
return d.parser});
define("dojo/cache",["dojo"],function(d){var f={};d.cache=function(a,b,c){if(typeof a=="string")var e=d.moduleUrl(a,b);else{e=a;c=b}e=e.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=f[e]=c?d.cache._sanitize(g):g;else if(g===null)delete f[e];else{if(!(e in f)){g=undefined;if(d.isFunction(require)&&d.isString(a))try{var j=(a?a.replace(/\./g,"/")+"/":"")+b;g=require("text!"+j)}catch(i){}if(typeof g==="undefined")g=
d._getText(e);f[e]=c?d.cache._sanitize(g):g}g=f[e]}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,f){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(e,g){if(g.charAt(0)=="!")e=d.getObject(g.substr(1),false,c);if(typeof e==
"undefined")throw new Error(b+" template:"+g);if(e==null)return"";return g.charAt(0)=="!"?e:e.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=f._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=f.findWidgets(b);this._attachTemplateNodes(a,function(c,e){return c[e]})}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(p,w){return p.getAttribute(w)};for(var c=d.isArray(a)?a:a.all||a.getElementsByTagName("*"),
e=d.isArray(a)?0:-1;e<c.length;e++){var g=e==-1?a:c[e];if(!(this.widgetsInTemplate&&(b(g,"dojoType")||b(g,"data-dojo-type")))){var j=b(g,"dojoAttachPoint")||b(g,"data-dojo-attach-point");if(j)for(var i=j.split(/\s*,\s*/);j=i.shift();){if(d.isArray(this[j]))this[j].push(g);else this[j]=g;this._attachPoints.push(j)}if(j=b(g,"dojoAttachEvent")||b(g,"data-dojo-attach-event")){i=j.split(/\s*,\s*/);for(var k=d.trim;j=i.shift();)if(j){var m=null;if(j.indexOf(":")!=-1){m=j.split(":");j=k(m[0]);m=k(m[1])}else j=
k(j);m||(m=j);this._attachEvents.push(this.connect(g,j,m))}}(j=b(g,"waiRole"))&&f.setWaiRole(g,j);(j=b(g,"waiState"))&&d.forEach(j.split(/\s*,\s*/),function(p){if(p.indexOf("-")!=-1){p=p.split("-");f.setWaiState(g,p[0],p[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)}});f._Templated._templateCache={};f._Templated.getCachedTemplate=function(a,b,c){var e=f._Templated._templateCache,g=b||a,j=e[g];if(j){try{if(!j.ownerDocument||j.ownerDocument==d.doc)return j}catch(i){}d.destroy(j)}b||(b=d.cache(a,{sanitize:true}));b=d.string.trim(b);if(c||b.match(/\$\{([^\}]+)\}/g))return e[g]=b;else{a=d._toDom(b);if(a.nodeType!=1)throw new Error("Invalid template: "+b);return e[g]=a}};d.isIE&&d.addOnWindowUnload(function(){var a=
f._Templated._templateCache;for(var b in a){var c=a[b];typeof c=="object"&&d.destroy(c);delete a[b]}});d.extend(f._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return f._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(d,f){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(k){return k+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,e={};d.forEach(c.className.split(" "),function(i){e[i]=true});"_stateClasses"in this&&d.forEach(this._stateClasses,
function(i){delete e[i]});d.forEach(b,function(i){e[i]=true});var g=[];for(var j in e)g.push(j);c.className=g.join(" ");this._stateClasses=b},_trackMouseState:function(a,b){function c(){var m="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;d.toggleClass(a,b+"Hover",e&&!g&&!m);d.toggleClass(a,b+"Active",g&&!m);d.toggleClass(a,b+"Focused",j&&!m)}var e=false,g=false,j=false,i=this,k=d.hitch(this,"connect",a);k("onmouseenter",function(){e=true;c()});k("onmouseleave",function(){g=e=false;c()});
k("onmousedown",function(){g=true;c()});k("onmouseup",function(){g=false;c()});k("onfocus",function(){j=true;c()});k("onblur",function(){j=false;c()});this.watch("disabled",c);this.watch("readOnly",c)}});return f._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(d,f){d.declare("dijit.form._FormWidget",[f._Widget,f._Templated,f._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:d.delegate(f._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);f.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||f.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||f.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",
f.form._FormWidget,{readOnly:false,attributeMap:d.delegate(f.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){d.attr(this.focusNode,"readOnly",a);f.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,e=c.style.filter,g=this;b&&b.clientHeight==0;){(function(){var j=g.connect(b,"onscroll",function(){g.disconnect(j);c.style.filter=(new Date).getMilliseconds();setTimeout(function(){c.style.filter=e},0)})})();b=b.parentNode}}});return f.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(d,f){d.declare("dijit.form.TextBox",f.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(f.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==f.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 e;if(a!==undefined){e=this.filter(a);if(typeof c!="string")c=e!==null&&(typeof e!="number"||!isNaN(e))?this.filter(this.format(e,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,[e,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&&f.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});f.selectInputText=function(a,b,c){var e=d.global,g=d.doc;a=d.byId(a);if(isNaN(b))b=0;if(isNaN(c))c=a.value?a.value.length:0;f.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 e.getSelection&&a.setSelectionRange&&a.setSelectionRange(b,c)};return f.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,f){d.declare("dijit._MasterTooltip",[f._Widget,f._Templated],{duration:f.defaultDuration,templateString:d.cache("dijit","templates/Tooltip.html"),postCreate:function(){d.body().appendChild(this.domNode);this.bgIframe=new f.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,e){if(!(this.aroundNode&&this.aroundNode===b)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;f.placeOnScreenAroundElement(this.domNode,b,f.getPopupAroundAlignment(c&&c.length?c:f.Tooltip.defaultPosition,!e),d.hitch(this,"orient"));d.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=b}}},orient:function(a,b,c,
e,g){this.connectorNode.style.top="";var j=e.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),k=Math.min(Math.max(j,1),i.w),m=k<i.w;this.domNode.style.width=k+"px";if(m){this.containerNode.style.overflow=
"auto";m=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(m>k){m=m+d.style(this.domNode,"paddingLeft")+d.style(this.domNode,"paddingRight");this.domNode.style.width=m+"px"}}if(c.charAt(0)=="B"&&b.charAt(0)=="B"){a=d.marginBox(a);b=this.connectorNode.offsetHeight;if(a.h>e.h){this.connectorNode.style.top=e.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-j)},_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}}});f.showTooltip=function(a,b,c,e){if(!f._masterTT)f._masterTT=
new f._MasterTooltip;return f._masterTT.show(a,b,c,e)};f.hideTooltip=function(a){if(!f._masterTT)f._masterTT=new f._MasterTooltip;return f._masterTT.hide(a)};d.declare("dijit.Tooltip",f._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}f.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){f.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)}});f.Tooltip.defaultPosition=["after","before"];return f.Tooltip});
(function(){function d(b,c,e,g,j,i){if(c[b]){e.push(b);if(c[b]===true||c[b]===1)g.push(j+b+"/"+i)}}function f(b,c,e,g,j){c=g+c+"/"+j;require._fileExists(b.nameToUrl(c,null))&&e.push(c)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(b,c,e,g){g=g||{};var j=a.exec(b),i=j[1],k=j[4],m=j[5],p=k.split("-"),w=[],t={},u,v,x="";if(j[5]){i=j[1];b=i+m}else{b=b;m=j[4];k=g.locale||(g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());p=k.split("-")}if(g.isBuild){w.push(b);f(c,"root",w,i,m);for(u=0;v=p[u];u++){x+=(x?"-":"")+v;f(c,x,w,i,m)}c(w);e()}else c([b],function(n){var r=[];d("root",n,r,w,i,m);for(u=0;v=p[u];u++){x+=(x?"-":"")+v;d(x,n,r,w,i,m)}c(w,function(){var y,A;for(y=r.length-1;y>-1&&(v=r[y]);y--){A=n[v];if(A===true||A===1)A=c(i+v+"/"+m);require.mixin(t,A)}e(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,f){d.declare("dijit.form.ValidationTextBox",f.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 e=this._isEmpty(this.textbox.value),g=!c&&a&&this._isValidSubset();this._set("state",c?"":((!this._hasBeenBlurred||a)&&e||g)&&this._maskValidSubsetError?
"Incomplete":"Error");f.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(e)b=this.getPromptMessage(a);this.set("message",b);return c},displayMessage:function(a){f.hideTooltip(this.domNode);a&&this._focused&&f.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(e){switch(e.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":b+=e;break;case ")":b+="|$)";break;
default:b+="(?:"+e+"|$)";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);f.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",f.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",f.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?f.setWaiState(this.focusNode,"valuemin",this.constraints.min):f.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?f.setWaiState(this.focusNode,"valuemax",this.constraints.max):f.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){f.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return f.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(d,f){function a(n){var r="",y=navigator.platform.indexOf("Mac")!==-1;if(n.mod1)r+=y?"Cmd+":"Ctrl+";if(n.mod2)r+="Shift+";if(n.mod3)r+="Alt+";if(n.mod4&&y)r+="Ctrl+";if(n.alphaKey)return r+n.alphaKey;for(var A in d.keys)if(typeof(d.keys[A]==="number"))if(d.keys[A]===n.keyCode)return r+A;var h;switch(n.keyCode){case 59:h=n.mod2?":":";";break;case 61:h=n.mod2?"+":"=";break;case 188:h=n.mod2?"<":",";break;case 190:h=
n.mod2?">":".";break;case 191:h=n.mod2?"?":"/";break;case 192:h=n.mod2?"~":"`";break;case 219:h=n.mod2?"{":"[";break;case 220:h=n.mod2?"|":"\\";break;case 221:h=n.mod2?"}":"]";break;case 222:h=n.mod2?'"':"'";break}if(h)return r+h;return r+String.fromCharCode(n.keyCode)}function b(n,r){n.startup();if(typeof r==="string"){var y=d.byId(r);if(!y)if(y=f.byId(r))y=y.domNode;r=y?y:null}if(r){r=d.position(r);n._setStyleAttr("left:"+(r.x+16)+"px !important;");n._setStyleAttr("top:"+(r.y+16)+"px !important;")}n.show()}
function c(n,r,y,A,h,l,o,q,s){o=function(C){return function(B){var E=f.byId(n),G=E.get("value");if(C&&B.keyCode===d.keys.ESCAPE){y&&d.style(r,"display","inline");E.destroyRecursive();l&&l()}else if(!(C&&B.keyCode!==d.keys.ENTER)){if(!E.isValid()||!s&&G===A)y&&d.style(r,"display","inline");else h(G);E.destroyRecursive();l&&l()}}};var z=new f.form.ValidationTextBox({id:n,required:true,value:A||""});d.place(z.domNode,r,"after");d.addClass(z.domNode,"userEditBoxPrompt");y&&d.style(r,"display","none");
d.connect(z,"onKeyDown",o(true));d.connect(z,"onBlur",o(false));window.setTimeout(function(){z.focus();if(A){var C=d.byId(n),B=q?A.indexOf(q):-1;B>0?f.selectInputText(C,0,B):C.select()}},0)}function e(n){var r=window.navigator.platform.indexOf("Mac")!==-1;return r&&n.metaKey||!r&&n.ctrlKey}function g(n,r){if(r&&e(r))window.open(n);else window.location=n}function j(n){if(!n)return n;var r=window.location.href.split("#")[0];r=r.substring(0,r.length-window.location.pathname.length);if(n.indexOf(r)===
0)return n.substring(r.length);return n}function i(n){if(!n)return n;var r=window.location.href.split("#")[0];return r.substring(0,r.length-window.location.pathname.length)+n}function k(n){return this.makeRelative(n).indexOf("/workspace")===0}function m(n,r){n.children=r;for(var y in r)r[y].parent=n;n.children.sort(function(A,h){var l=A.Directory;if(l!==h.Directory)return l?-1:1;A=A.Name&&A.Name.toLowerCase();h=h.Name&&h.Name.toLowerCase();if(A<h)return-1;if(A>h)return 1;return 0})}function p(n,r){n.Parents&&
n.Parents.length===0&&r.getService("orion.core.preference").getPreferences("/window/recent").then(function(y){var A=y.get("projects");if(typeof A==="string")A=JSON.parse(A);var h=[];if(A&&A.length&&A.length>0)for(var l=0;l<A.length;l++)A[l].location!==n.ChildrenLocation&&A[l].name!==n.Name&&h.push(A[l]);h.push({name:n.Name,location:n.ChildrenLocation});if(h.length>5)h=h.slice(-5,h.length);y.put("projects",h)})}function w(n){return typeof n.textContent!=="undefined"?n.textContent:n.innerText}function t(n){return w(document.createTextNode(n))}
function u(n,r){if(typeof n.textContent!=="undefined")n.textContent=r;else n.innerText=r}function v(n,r,y,A,h,l,o,q){h=h||r+"heading";l=l||r+"commands";d.place('<div class="toolComposite" id="'+r+'"><div class="layoutLeft" id="'+r+'"><span style: "inline-block;" id="'+h+'">'+y+'</span></div><div class="layoutRight sectionActions" id="'+l+'"></div><div id="'+n.id+'slideContainer" class="layoutBlock slideParameters slideContainer"><span id="'+n.id+'slideOut" class="slide"><span id="'+n.id+'pageCommandParameters" class="parameters"></span><span id="'+
n.id+'pageCommandDismiss" class="parametersDismiss"></span></span></div></div>',n,"last");A?d.addClass(r,"auxpaneHeading"):d.addClass(r,"paneHeading");o&&o.renderCommands(d.byId(l),"dom",q,q,"button");return d.byId(r)}function x(n){if(typeof n==="string")n=d.byId(n);for(;n;){var r=f.byId(n.id);if(r&&typeof r.layout==="function"){r.layout();return}n=n.parentNode}}return{getUserKeyString:a,openDialog:b,getUserText:c,openInNewWindow:e,followLink:g,makeRelative:j,makeFullPath:i,isAtRoot:k,processNavigatorParent:m,
rememberSuccessfulTraversal:p,getText:w,safeText:t,setText:u,createPaneHeading:v,forceLayout:x}});
define("orion/PageUtil",["require","exports","module"],function(){function d(f){f=f||window.location.toString();var a={resource:""},b=f.indexOf("#");if(b!==-1){f=f.substring(b+1);if(f.length!==0){f=f.split(",");a.resource=decodeURIComponent(f[0]);for(b=1;b<f.length;b++){var c=f[b].split("="),e=decodeURIComponent(c[0]);c=c.length===2?decodeURIComponent(c[1]):null;if(c!==null&&e!=="resource")a[e]=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,f){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 e=this.getChildren();if(e&&e.length>=b){c=e[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||!f.byNode(a)));return a&&f.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 f._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(d,f){d.declare("dijit._KeyNavContainer",f._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,b){var c=this._keyNavCodes={},e=d.hitch(this,this.focusPrev),g=d.hitch(this,this.focusNext);d.forEach(a,function(j){c[j]=e});d.forEach(b,function(j){c[j]=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){f._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(),e=0;e<c.length;e++){a||(a=c[b>0?0:c.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,b)}return null}});return f._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,f){d.declare("dijit._Contained",null,{getParent:function(){var a=f.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&&f.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 f._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(d,f){d.declare("dijit.MenuItem",[f._Widget,f._Templated,f._Contained,f._CssStateMixin],{templateString:d.cache("dijit","templates/MenuItem.html"),attributeMap:d.delegate(f._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"}f.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();f.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){f.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 f.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(d,f){d.declare("dijit.PopupMenuItem",f.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=d.query("*",this.srcNodeRef);f.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=f.byNode(a)}d.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&d.style(this.arrowWrapper,"visibility","");f.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return f.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,f){d.declare("dijit.CheckedMenuItem",f.MenuItem,{templateString:d.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){d.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);f.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 f.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,f){d.declare("dijit.MenuSeparator",[f._Widget,f._Templated,f._Contained],{templateString:d.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);d.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return f.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,f){d.declare("dijit._MenuBase",[f._Widget,f._Templated,f._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;f.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);f.popup.close(this.currentPopup)}b.parentMenu=this;b.from_item=a;var c=this;f.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){f._curFocus&&d.isDescendant(f._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();f.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",f._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,e=this._iframeContentWindow(c);b=d.withGlobal(e,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 j=d.hitch(this,function(i){return[d.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(k){d.stopEvent(k);this._scheduleOpen(k.target,c,{x:k.pageX,y:k.pageY})}),d.connect(i,"onkeydown",this,function(k){if(k.shiftKey&&
k.keyCode==d.keys.F10){d.stopEvent(k);this._scheduleOpen(k.target,c)}})]});g.connects=b?j(b):[];if(c){g.onloadHandler=d.hitch(this,function(){var i=this._iframeContentWindow(c);b=d.withGlobal(i,d.body);g.connects=j(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 e=d.attr(b,a)-1,g=this._bindings[e];d.forEach(g.connects,d.disconnect);
var j=g.iframe;if(j)j.removeEventListener?j.removeEventListener("load",g.onloadHandler,false):j.detachEvent("onload",g.onloadHandler);d.removeAttr(b,a);delete this._bindings[e]}},_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(){m.refocus&&f.focus(p);f.popup.close(m)}var c=a.target,e=a.iframe;if(a=a.coords){if(e){c=d.position(e,true);var g=
this._iframeContentWindow(e);g=d.withGlobal(g,"_docScroll",d);var j=d.getComputedStyle(e),i=d._toPixelValue,k=(d.isIE&&d.isQuirks?0:i(e,j.paddingLeft))+(d.isIE&&d.isQuirks?i(e,j.borderLeftWidth):0);e=(d.isIE&&d.isQuirks?0:i(e,j.paddingTop))+(d.isIE&&d.isQuirks?i(e,j.borderTopWidth):0);a.x+=c.x+k-g.x;a.y+=c.y+e-g.y}}else{a=d.position(c,true);a.x+=10;a.y+=10}var m=this,p=f.getFocus(this);f.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);f.popup.close(this)}},uninitialize:function(){d.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return f.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,f){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 e=d.position(this._buttonNode,true);if(!(a.pageX>=e.x&&a.pageX<=e.x+e.w)||!(a.pageY>=e.y&&a.pageY<=e.y+e.h)){for(e=a.target;e&&!c;)if(d.hasClass(e,"dijitPopup"))c=true;else e=e.parentNode;if(c){e=a.target;if(b.onItemClick){for(var g;e&&!(g=f.byNode(e));)e=e.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(f._curFocus&&this.dropDown&&d.isDescendant(f._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,e=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 j=d.position(c,false);g=Math.floor(Math.max(j.y,g.h-(j.y+j.h)))}a.startup&&
!a._started&&a.startup();f.popup.moveOffScreen(a);j=d._getMarginSize(b);var i=g&&j.h>g;d.style(b,{overflowX:"hidden",overflowY:i?"auto":"hidden"});if(i){j.h=g;if("w"in j)j.w+=16}else delete j.h;if(this.forceWidth)j.w=c.offsetWidth;else if(this.autoWidth)j.w=Math.max(j.w,c.offsetWidth);else delete j.w;d.isFunction(a.resize)?a.resize(j):d.marginBox(b,j)}a=f.popup.open({parent:this,popup:a,around:c,orient:f.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){e.closeDropDown(true)},onCancel:function(){e.closeDropDown(true)},onClose:function(){d.attr(e._popupStateNode,"popupActive",false);d.removeClass(e._popupStateNode,"dijitHasDropDownOpen");e._opened=false}});d.attr(this._popupStateNode,"popupActive","true");d.addClass(e._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();f.popup.close(this.dropDown);this._opened=false}}});
return f._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,f){d.declare("dijit.form.Button",f.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:d.cache("dijit.form","templates/Button.html"),attributeMap:d.delegate(f.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=f.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",[f.form.Button,f._Container,f._HasDropDown],{baseClass:"dijitDropDownButton",templateString:d.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
d.query("*",this.srcNodeRef);f.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=f.byNode(a);delete this.dropDownContainer}this.dropDown&&f.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",f.form.DropDownButton,{templateString:d.cache("dijit.form","templates/ComboButton.html"),attributeMap:d.mixin(d.clone(f.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"]){f.focus(this._popupStateNode);d.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){f.focus(this.titleNode);d.stopEvent(a)}},focus:function(a){this.disabled||f.focus(a=="start"?this.titleNode:this._popupStateNode)}});
d.declare("dijit.form.ToggleButton",f.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:d.mixin(d.clone(f.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);f.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 f.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(d,f){return f.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,f){d.declare("dijit.layout._LayoutWidget",[f._Widget,f._Container,f._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 e=d._getMarginExtents(c,a),g=d._getBorderExtents(c,a);b=this._borderBox={w:b.w-(e.w+g.w),h:b.h-(e.h+g.h)};e=d._getPadExtents(c,a);this._contentBox={l:d._toPixelValue(c,a.paddingLeft),t:d._toPixelValue(c,a.paddingTop),
w:b.w-e.w,h:b.h-e.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)}});f.layout.marginBox2contentBox=function(a,b){var c=d.getComputedStyle(a),e=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-(e.w+g.w),h:b.h-(e.h+g.h)}};(function(){var a=function(c){return c.substring(0,1).toUpperCase()+c.substring(1)},b=function(c,e){var g=c.resize?c.resize(e):d.marginBox(c.domNode,e);if(g)d.mixin(c,g);else{d.mixin(c,d.marginBox(c.domNode));d.mixin(c,e)}};f.layout.layoutChildren=function(c,e,g,j,i){e=d.mixin({},e);d.addClass(c,"dijitLayoutContainer");g=d.filter(g,function(k){return k.region!=
"center"&&k.layoutAlign!="client"}).concat(d.filter(g,function(k){return k.region=="center"||k.layoutAlign=="client"}));d.forEach(g,function(k){var m=k.domNode,p=k.region||k.layoutAlign,w=m.style;w.left=e.l+"px";w.top=e.t+"px";w.position="absolute";d.addClass(m,"dijitAlign"+a(p));m={};if(j&&j==k.id)m[k.region=="top"||k.region=="bottom"?"h":"w"]=i;if(p=="top"||p=="bottom"){m.w=e.w;b(k,m);e.h-=k.h;if(p=="top")e.t+=k.h;else w.top=e.t+e.h+"px"}else if(p=="left"||p=="right"){m.h=e.h;b(k,m);e.w-=k.w;if(p==
"left")e.l+=k.w;else w.left=e.l+e.w+"px"}else if(p=="client"||p=="center")b(k,e)})}})();return f.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(d,f){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=f._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(e){return e.tagName!=="SCRIPT"}),b=a.filter(function(e){return d.hasAttr(e,"data-dojo-type")||d.hasAttr(e,"dojoType")||d.hasAttr(e,"widgetId")}),c=d.filter(b.map(f.byNode),function(e){return e&&
e.domNode&&e.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=f.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 f.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(d){d.getObject("html",true,d);(function(){var f=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,e=0;e<b.length;e=c==b.length?e+1:0)d.place(b[e],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:"",f++].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(e){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+e.message,e)}}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(e){if(this[e])b[e]=this[e]},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,f){d.declare("dijit.layout.ContentPane",[f._Widget,f.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(f._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")||f.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(e){try{a._isDownloaded=true;a._setContent(e,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return e});c.addErrback(function(e){c.canceled||a._onError("Download",e);delete a._xhrDfd;return e});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(j){console.error("Fatal "+this.id+" could not change content due to "+j.message,j)}})});var e=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,e);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 f.layout.ContentPane});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(d,f){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(j){if(j.name)(b[j.name]||(b[j.name]=[])).push(j)});for(var c in b)if(b.hasOwnProperty(c)){var e=b[c],g=d.getObject(c,false,a);if(g!==undefined){d.isArray(g)||(g=[g]);if(typeof e[0].checked=="boolean")d.forEach(e,function(j){j.set("value",d.indexOf(g,j.value)!=-1)});else e[0].multiple?e[0].set("value",g):d.forEach(e,function(j,
i){j.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 e=b.get("value");if(typeof b.checked=="boolean")if(/Radio/.test(b.declaredClass))if(e!==false)d.setObject(c,e,a);else{e=d.getObject(c,false,a);e===undefined&&d.setObject(c,null,a)}else{b=d.getObject(c,false,a);
if(!b){b=[];d.setObject(c,b,a)}e!==false&&b.push(e)}else{b=d.getObject(c,false,a);if(typeof b!="undefined")d.isArray(b)?b.push(e):d.setObject(c,[b,e],a);else d.setObject(c,e,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(j,i){b[j]=i}:d.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var c=this._childConnections=[],e=this._childWatches=[];d.forEach(d.filter(this._descendants,function(j){return j.validate}),function(j){d.forEach(["state","disabled"],function(i){e.push(j.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(j){return j.onChange}),function(j){c.push(b.connect(j,"onChange",g));e.push(j.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 f.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(d,f){d.declare("dijit._DialogMixin",null,{attributeMap:f._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=f._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return f._DialogMixin});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(d,f){d.declare("dijit.TooltipDialog",[f.layout.ContentPane,f._Templated,f.form._FormMixin,f._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);f.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 e=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){e||f.focus(this._lastFocusItem);d.stopEvent(a)}else if(b==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){e||f.focus(this._firstFocusItem);d.stopEvent(a)}else a.charOrCode===
c.TAB&&a.stopPropagation()}});return f.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,f,a,b,c){function e(x,n,r,y,A){this.commandService=x;this.handler=n;this.items=r;this.userData=y;this.command=A;if(A.parameters)this.parameters=A.parameters.makeCopy();this.id=A.id}function g(x){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups=
{};this._ungrouped={};this._topics={};this._activeBindings={};this._urlBindings={};this._init(x);this._parameterCollector=null}function j(x,n,r){f.addClass(n,"commandImage");var y;if(x.imageClass){y=f.create("span",{},n,"last");f.addClass(y,x.spriteClass);f.addClass(y,x.imageClass)}else{y=new Image;y.alt=x.name;y.name=r;y.id=r;y.src=x.image;f.place(y,n,"last")}return y}function i(x){this._init(x)}function k(x,n,r,y,A){this.keyCode=typeof x==="string"?x.toUpperCase().charCodeAt(0):x;this.mod1=n!==
undefined&&n!==null?n:false;this.mod2=r!==undefined&&r!==null?r:false;this.mod3=y!==undefined&&y!==null?y:false;this.mod4=A!==undefined&&A!==null?A:false}function m(x,n){this.token=x;this.parameterName=n}function p(x,n,r,y){this.name=x;this.type=n;this.label=r;this.value=y}function w(x,n,r){this._storeParameters(x);this.options=n;this.optionsRequested=false;this.getParameters=r}e.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()}};e.prototype.constructor=
e;var t=f.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}}),u=f.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(f.hitch(this,
function(){if(this._stillInDocument(this._connectNode))this.pollForMissingTarget();else{this.polling=false;this.close()}}),1E3)},_stillInDocument:function(x){for(;x;){if(x===window.document)return true;x=x.parentNode}return false},postMixInProperties:function(){this.inherited(arguments);this.options.commandParent&&a.byId(this.options.commandParent.id)&&f.connect(this.options.commandParent,"onClose",f.hitch(this,function(){this.close()}))}});g.prototype={_init:function(x){this._registry=x.serviceRegistry;
this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=x.selection;f.connect(window.document,"onkeydown",f.hitch(this,function(n){n=n||window.event;var r=n.target.nodeName.toLowerCase();if(r==="input")switch(n.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(r===
"textarea")return;this._processKey(n)}))},_processKey:function(x){function n(l){if(window.document.all)l.keyCode=0;else{l.preventDefault();l.stopPropagation()}}for(var r in this._activeBindings)if(this._activeBindings[r]&&this._activeBindings[r].keyBinding&&this._activeBindings[r].command)if(this._activeBindings[r].keyBinding.match(x)){var y=this._activeBindings[r],A=y.invocation;if(A){var h=y.command;if(h.hrefCallback){n(x);x=h.hrefCallback.call(A.handler||window,A);x.then?x.then(function(l){window.open(l)}):
window.open(x);return}else if(h.callback){n(x);window.setTimeout(f.hitch(this,function(){A.parameters&&this.collectsParameters()?this._collectParameters(A):h.callback.call(A.handler||window,A)}),0);return}}}},processURL:function(x){for(var n in this._urlBindings)if(this._urlBindings[n]&&this._urlBindings[n].urlBinding&&this._urlBindings[n].command){var r=this._urlBindings[n].urlBinding.match(x);if(r){var y=this._urlBindings[n],A=y.command,h=y.invocation;if(h&&h.parameters&&A.callback){h.parameters.setValue(r.parameterName,
r.parameterValue);window.setTimeout(f.hitch(this,function(){this._collectParameters(h)}),0);return}}}},findCommand:function(x){return this._objectScope[x]||this._domScope[x]||this._globalScope[x]},runCommand:function(x){var n=this._urlBindings[x];n&&n.command&&n.command.callback&&window.setTimeout(f.hitch(this,function(){this._collectParameters(n.invocation)}),0)},getSelectionService:function(){return this._selection},setParameterCollector:function(x){this._parameterCollector=x},openParameterCollector:function(x,
n){if(this._parameterCollector){this._parameterCollector.close();this._parameterCollector.open(x,n)}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_collectParameters:function(x){var n=false;if(this._parameterCollector){x.parameters.updateParameters(x);n=x.parameters.hasParameters()?this._parameterCollector.collectParameters(x):false}if(!n&&x.parameters.hasParameters()){var r=new a.TooltipDialog({onBlur:function(){a.popup.close(r)}}),
y=f.create("div"),A=this._parameterCollector.getFillFunction(x,function(){a.popup.close(r)})(y);r.set("content",y);y=(y=a.byId(x.domParent.id))?f.position(y.eclipseScopeId,true):f.position(x.domNode,true);if(y.x&&y.y&&y.w){a.popup.open({popup:r,x:y.x+y.w-8,y:y.y+8});window.setTimeout(function(){A.focus();A.select()},0);n=true}}if(!n){x.parameters=null;x.command.callback.call(x.handler,x)}},showKeyBindings:function(x){for(var n in this._activeBindings)this._activeBindings[n]&&this._activeBindings[n].keyBinding&&
this._activeBindings[n].command&&f.place('<span role="listitem">'+b.getUserKeyString(this._activeBindings[n].keyBinding)+" = "+this._activeBindings[n].command.name+"<br></span>",x,"last")},addCommand:function(x,n){switch(n){case "dom":this._domScope[x.id]=x;break;case "object":this._objectScope[x.id]=x;break;case "global":this._globalScope[x.id]=x;break;default:throw"unrecognized command scope "+n;}},addCommandGroup:function(x,n,r,y,A){var h=this._namedGroups;if(y)h=this._createEntryForPath(y);if(h[x]){if(r)h[x].title=
r;if(n)h[x].position=n;if(A)h[x].scopeId=A}else{h[x]={title:r,position:n,children:{},scopeId:A};h.sortedCommands=null}},_createEntryForPath:function(x){var n=this._namedGroups;if(x){x=x.split("/");for(var r=0;r<x.length;r++)if(x[r].length>1){n[x[r]]||(n[x[r]]={position:0,children:{}});n=n[x[r]].children}}return n},registerCommandContribution:function(x,n,r,y,A,h,l){y=!r&&!y?this._ungrouped:this._createEntryForPath(y);y[x]={scopeId:r,position:n};if(h)if(n=this._domScope[x]||this._globalScope[x])this._activeBindings[x]=
{command:n,keyBinding:h,bindingOnly:A};if(l)if(n=this._domScope[x]||this._globalScope[x])this._urlBindings[x]={command:n,urlBinding:l,bindingOnly:A};y.sortedCommands=null},_isLastChildSeparator:function(x,n){if(n==="tool"||n==="button")return x.childNodes.length>0&&f.hasClass(x.childNodes[x.childNodes.length-1],"commandSeparator");if(n==="menu"){x=x.getChildren();return x.length>0&&x[x.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(x,n,r,y,A,h,l,o,q){if(typeof x==="string")x=
f.byId(x);if(x){if(!x.id||x.id==="")window.console.log("renderCommands: "+n+","+A+">> WARNING: command parent must have an id")}else throw"no parent";if(r){var s;if(n==="object"){s=this._objectScope;this._render(this._ungrouped,x,n,r,y,A,h,l,s,o,q)}else if(n==="dom")s=this._domScope;else if(n==="global")s=this._globalScope;else throw"Unrecognized command scope "+n;this._render(this._namedGroups,x,n,r,y,A,h,l,s,o,q);if(A==="tool"||A==="button")this._isLastChildSeparator(x,A)&&x.removeChild(x.childNodes[x.childNodes.length-
1]);else if(A==="menu")if(this._isLastChildSeparator(x,A)){r=x.getChildren()[x.getChildren().length-1];x.removeChild(r);r.destroy()}if(n==="dom"||n==="global")b.forceLayout(x)}else{var z=this;this._selection&&this._selection.getSelections(function(C){z.renderCommands(x,n,C,y,A,h,l,o,q)})}},_render:function(x,n,r,y,A,h,l,o,q,s,z){var C=x.sortedCommands;if(!C){C=[];for(var B in x){var E=x[B];if(E&&typeof E.position==="number"){E.id=B;C.push(E)}}C.sort(function(S,D){return S.position-D.position});x.sortedCommands=
C}for(x=0;x<C.length;x++){var G,M;if(C[x].children){B=C[x];if(!(B.scopeId&&n.id!==B.scopeId)){var H;if(h==="tool"||h==="button")if(B.title){G=new a.Menu({style:"display: none;"});G.eclipseScopeId=n.eclipseScopeId||n.id;this._render(C[x].children,G,r,y,A,"menu",l,o,q,s);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:B.title==="*"?"Actions":
B.title,showLabel:B.title!=="*",dropDown:G});f.addClass(G.domNode,"commandMenu");f.destroy(G.valueNode);if(B.title==="*"){f.addClass(G.domNode,"textless");new u({connectId:[G.domNode],label:"Actions menu",position:["above","left","right","below"],commandParent:n,commandService:this})}E._setupActivateVisuals(G.domNode,G.focusNode,s,z);f.place(G.domNode,n,"last")}else{G=h+E.id+x;M=new e(this,A,y,o,E);h==="button"?E._addButton(n,l,G,M,s,z):E._addTool(n,l,G,M,s,z)}}}else{var N;if(n.childNodes.length>
0&&!this._isLastChildSeparator(n,h))N=this.generateSeparatorImage(n);this._render(C[x].children,n,r,y,A,h,l,o,q,s,z);if(n.childNodes.length>0)if(n.childNodes[n.childNodes.length-1]!==N)N=this.generateSeparatorImage(n)}else if(B.title){E=new a.Menu;this._render(C[x].children,E,r,y,A,h,l,o,q,s,z);E.getChildren().length>0&&n.addChild(new a.PopupMenuItem({label:B.title,popup:E}))}else{var L;if(n.getChildren().length>0&&!this._isLastChildSeparator(n,h)){L=new a.MenuSeparator;n.addChild(L)}this._render(C[x].children,
n,r,y,A,h,l,o,q,s,z);B=n.getChildren();if(B[B.length-1]!==L){L=new a.MenuSeparator;n.addChild(L)}}}}else{E=(B=q[C[x].id])?true:false;H=H=null;if(B){if(r==="dom"||r==="global")E=h==="tool"||h==="button"?n.id===C[x].scopeId:h==="menu"?n.eclipseScopeId===C[x].scopeId:false;else if(r==="object")E=!C[x].scopeId;var P=E&&(r==="global"||r==="dom");M=new e(this,A,y,o,B);M.domParent=n;G=E&&(B.visibleWhen?B.visibleWhen(y):true);if(P&&this._activeBindings[B.id]&&this._activeBindings[B.id].keyBinding){H=this._activeBindings[B.id];
H.invocation=G?M:null;if(H.bindingOnly)E=false}if(P&&this._urlBindings[B.id]&&this._urlBindings[B.id].urlBinding){H=this._urlBindings[B.id];H.invocation=G?M:null;if(H.bindingOnly)E=false}E=E&&G}if(E)if(B.choiceCallback){E=new a.Menu({style:"display: none;"});if(h==="tool"||h==="button"){G=new a.form.DropDownButton({label:B.name,dropDown:E});if(B.image){f.addClass(G.iconNode,"commandImage");G.iconNode.src=B.image}f.place(G.domNode,n,"last");G.eclipseCommand=B;G.eclipseChoices=E;f.connect(G,"onClick",
G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,y,A,o)})}else if(h==="menu"){G=new a.PopupMenuItem({label:B.name,popup:E});n.addChild(G);G.eclipseCommand=B;G.eclipseChoices=E;f.connect(n,"_openPopup",G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,y,A,o)})}}else if(h==="tool"){G="tool"+B.id+x;B._addTool(n,l,G,M,s,z)}else if(h==="button"){G="button"+B.id+x;B._addButton(n,l,G,M,s,z)}else h==="menu"&&B._addMenuItem(n,M,s,z)}}},whenHidden:function(x,n){x=
typeof x==="string"?x:x.id;if(!this.hidden)this.hidden={};if(this.hidden[x])this.hidden[x].push(n);else this.hidden[x]=[n]},generateSeparatorImage:function(x){x=f.create("span",null,x,"last");f.addClass(x,"core-sprite-sep");f.addClass(x,"imageSprite");f.addClass(x,"commandSeparator");return x}};g.prototype.constructor=g;i.prototype={_init:function(x){this.id=x.id;this.name=x.name;this.tooltip=x.tooltip||x.name;this.callback=x.callback;this.hrefCallback=x.hrefCallback;this.choiceCallback=x.choiceCallback;
this.image=x.image||d.toUrl("images/none.png");this.imageClass=x.imageClass;this.spriteClass=x.spriteClass||"commandSprite";this.visibleWhen=x.visibleWhen;this.parameters=x.parameters},_addTool:function(x,n,r,y,A,h){y.handler=y.handler||this;var l,o;if(this.hrefCallback){l=this._makeLink(y);if(!l)return}else{l=f.create("span",{tabindex:"0",role:"button"});if(n||!this.hasImage()){n=window.document.createTextNode(this.name);f.place(n,l,"last");f.addClass(l,"commandMissingImageButton commandButton")}else{o=
j(this,l,r);this._addAccessibleLabel(l)}this._hookCallback(l,y);this._setupActivateVisuals(l,l,A,h,o?"commandImageOver":"commandButtonOver")}y.domNode=l;y.domParent=x;this.tooltip&&new u({connectId:[l],label:this.tooltip,position:["above","left","right","below"],commandParent:x,commandService:y.commandService});f.place(l,x,"last")},_addButton:function(x,n,r,y,A,h){y.handler=y.handler||this;if(this.hrefCallback){n=this._makeLink(y);if(!n)return}else{n=f.create("span",{tabindex:"0",role:"button"});
this._hookCallback(n,y);var l;if(this.name){f.place(window.document.createTextNode(this.name),n,"last");f.addClass(n,"commandButton");l="commandButtonOver"}else{j(this,n,r);l="commandImageOver";this._addAccessibleLabel(n)}this._setupActivateVisuals(n,n,A,h,l)}n.id=r;this.tooltip&&new u({connectId:[n],label:this.tooltip,position:["above","left","right","below"],commandParent:x,commandService:y.commandService});y.domParent=x;y.domNode=n;f.place(n,x,"last")},_addMenuItem:function(x,n){n.domParent=x.domNode;
var r=new t({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new u({connectId:[r.domNode],label:this.tooltip,commandParent:x,commandService:n.commandService});if(this.hrefCallback){var y=this.hrefCallback.call(n.handler,n);if(y)if(y.then)y.then(f.hitch(this,function(A){r.set("label","<a href='"+A+"'>"+this.name+"</a>")}));else if(y)r.set("label","<a href='"+y+"'>"+this.name+"</a>");else return}else if(this.callback)r.onClick=
this.parameters&&n.collectsParameters()?f.hitch(this,function(){n.commandService._collectParameters(n)}):f.hitch(this,function(){this.callback.call(n.handler,n)});r.eclipseCommand=this;x.addChild(r);if(this.imageClass)f.addClass(r.iconNode,this.spriteClass);else if(this.image){f.addClass(r.iconNode,"commandMenuItem");r.iconNode.src=this.image}n.domNode=r.domNode},_makeLink:function(x){var n=f.create("a",{tabindex:"0"});f.addClass(n,"commandLink");f.place(window.document.createTextNode(this.name),
n,"last");x=this.hrefCallback.call(x.handler,x);if(x.then)x.then(function(r){n.href=r});else if(x)n.href=x;else return null;return n},_hookCallback:function(x,n){f.connect(x,"onclick",this,function(){if(this.parameters&&n.collectsParameters())n.commandService._collectParameters(n);else this.callback&&this.callback.call(n.handler,n)});f.connect(x,"onkeypress",this,function(r){if(r.keyCode===f.keys.ENTER||r.keyCode===f.keys.SPACE)if(this.parameters&&n.collectsParameters())n.commandService._collectParameters(n);
else this.callback&&this.callback.call(n.handler,n)})},_addAccessibleLabel:function(x){var n=this.name||this.tooltip;n&&f.attr(x,"aria-label",n)},_setupActivateVisuals:function(x,n,r,y,A){y&&f.addClass(x,y);var h=function(){A&&f.addClass(this,A);r&&f.addClass(this,r);y&&f.removeClass(this,y)},l=function(){A&&f.removeClass(this,A);r&&f.removeClass(this,r);y&&f.addClass(this,y)};f.connect(x,"onmouseover",x,h);f.connect(n,"onfocus",x,h);f.connect(x,"onmouseout",x,l);f.connect(n,"onblur",x,l)},populateChoicesMenu:function(x,
n,r,y){x.focusedChild=null;f.forEach(x.getChildren(),function(l){x.removeChild(l);l.destroy()});r=this.getChoices(n,r,y);for(y=0;y<r.length;y++){var A=r[y],h;if(A.name){h=new a.MenuItem({label:A.name,iconClass:A.imageClass,onClick:this.makeChoiceCallback(A,n)});if(A.imageClass)f.addClass(h.iconNode,A.spriteClass||"commandSprite");else if(A.image){f.addClass(h.iconNode,"commandImage");h.iconNode.src=A.image}}else h=new a.MenuSeparator;x.addChild(h)}},getChoices:function(x,n,r){if(this.choiceCallback)return this.choiceCallback.call(n,
x,r);return null},makeChoiceCallback:function(x,n){return function(r){x.callback&&x.callback.call(x,n,r)}},hasImage:function(){return this.imageClass||this.image!==d.toUrl("images/none.png")}};i.prototype.constructor=i;var v=window.navigator.platform.indexOf("Mac")!==-1;k.prototype={match:function(x){if(this.keyCode===x.keyCode){if(this.mod1!==(v?x.metaKey:x.ctrlKey))return false;if(this.mod2!==x.shiftKey)return false;if(this.mod3!==x.altKey)return false;if(v&&this.mod4!==x.ctrlKey)return false;return true}return false},
equals:function(x){if(!x)return false;if(this.keyCode!==x.keyCode)return false;if(this.mod1!==x.mod1)return false;if(this.mod2!==x.mod2)return false;if(this.mod3!==x.mod3)return false;if(this.mod4!==x.mod4)return false;return true}};k.prototype.constructor=k;m.prototype={match:function(x){x=c.matchResourceParameters(x);if(typeof x[this.token]!=="undefined"){this.parameterValue=x[this.token];return this}return null}};m.prototype.constructor=m;p.prototype={optionsRequested:function(){return this.optionsRequested}};
p.prototype.constructor=p;w.prototype={_storeParameters:function(x){this.parameterTable=null;if(x){this.parameterTable={};for(var n=0;n<x.length;n++)this.parameterTable[x[n].name]=x[n]}},updateParameters:function(x){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(x))},hasParameters:function(){return this.parameterTable!==null},parameterNamed:function(x){return this.parameterTable[x]},valueFor:function(x){if(x=this.parameterTable[x])return x.value;return null},setValue:function(x,
n){if(x=this.parameterTable[x])x.value=n},forEach:function(x){for(var n in this.parameterTable)this.parameterTable[n].type&&this.parameterTable[n].name&&x(this.parameterTable[n])},makeCopy:function(){var x=[];this.forEach(function(n){n=new p(n.name,n.type,n.label,n.value);x.push(n)});return new w(x,this.options,this.getParameters)}};w.prototype.constructor=w;return{CommandService:g,CommandKeyBinding:k,Command:i,CommandInvocation:e,CommandMenuItem:t,URLBinding:m,ParametersDescription:w,CommandParameter:p,
CommandTooltip:u}});
define("orion/parameterCollectors",["require","dojo","dijit","orion/commands","orion/util","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(d,f,a,b,c){function e(){this._activeContainer=null}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&f.empty(this._activeElements.parameterArea);if(this._activeElements.parameterContainer){f.removeClass(this._activeElements.parameterContainer,"slideActive");f.removeClass(this._activeElements.slideContainer,"slideContainerActive")}this._activeElements.dismissArea&&
f.empty(this._activeElements.dismissArea);this._activeElements.commandNode&&f.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 j={},i=null;if(typeof g==="string")g=f.byId(g);for(var k=g;k;){if(f.hasClass(k,"toolComposite")){i=k;break}k=k.parentNode}if(f.hasClass(g,"commandMarker"))j.commandNode=
g;if(i){j.slideContainer=f.query(".slideParameters",i)[0];j.parameterContainer=f.query(".slide",i)[0];j.parameterArea=f.query(".parameters",i)[0];j.dismissArea=f.query(".parametersDismiss",i)[0]}return j},open:function(g,j){if(typeof g==="string")g=f.byId(g);this.close();this._activeElements=null;if((this._activeElements=this._findParameterElements(g))&&this._activeElements.parameterArea&&this._activeElements.slideContainer&&this._activeElements.parameterContainer){var i=j(this._activeElements.parameterArea);
g=f.query("#closebox",this._activeElements.parameterArea);if(g.length===0){g=f.create("span",{id:"closebox",role:"button",tabindex:"0"},this._activeElements.dismissArea||this._activeElements.parameterArea,"last");f.addClass(g,"imageSprite");f.addClass(g,"core-sprite-close");f.addClass(g,"dismiss");g.title="Close";f.connect(g,"onclick",f.hitch(this,function(){this.close(this._activeElements)}));f.connect(g,"onkeypress",f.hitch(this,function(k){k.keyCode===f.keys.ENTER&&this.close(this._activeElements)}))}f.addClass(this._activeElements.slideContainer,
"slideContainerActive");f.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&&f.addClass(this._activeElements.commandNode,"activeCommand");return true}return false},_collectAndCall:function(g,j){f.query("input",j).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&&f.addClass(g.domNode,"commandMarker");return this.open(g.domNode||g.domParent,this.getFillFunction(g))}return false},getFillFunction:function(g,j){return f.hitch(this,function(i){var k=null,m=f.hitch(this,function(){j?j():this.close(g.domNode)}),p=f.hitch(this,function(u){u.keyCode===f.keys.ENTER&&this._collectAndCall(g,i);if(u.keyCode===f.keys.ESCAPE||u.keyCode===f.keys.ENTER){m();
f.stopEvent(u)}});g.parameters.forEach(function(u){u.label&&f.place(document.createTextNode(u.label),i,"last");var v=f.create("input",{type:u.type},i,"last");f.addClass(v,"parameterInput");f.addClass(v,"parameterInput"+u.type);v.setAttribute("speech","speech");v.setAttribute("x-webkit-speech","x-webkit-speech");v.parameterName=u.name;k||(k=v);if(u.value)v.value=u.value;f.connect(v,"onkeypress",p)});var w=function(u){u._collectAndCall(g,i);m()};if(g.parameters.options){g.parameters.optionsRequested=
false;var t=f.create("span",{role:"button",tabindex:"0"},i,"last");f.place(window.document.createTextNode("More"),t,"last");f.addClass(t,"dismiss");f.connect(t,"onclick",f.hitch(this,function(){g.parameters.optionsRequested=true;w(this)}));f.connect(t,"onkeypress",f.hitch(this,function(u){if(u.keyCode===f.keys.ENTER){g.parameters.optionsRequested=true;w(this)}}))}spacer=f.create("span",null,i,"last");f.addClass(spacer,"dismiss");t=f.create("span",{role:"button",tabindex:"0"},i,"last");f.place(window.document.createTextNode("Submit"),
t,"last");f.addClass(t,"dismiss");f.connect(t,"onclick",f.hitch(this,function(){w(this)}));f.connect(t,"onkeypress",f.hitch(this,function(u){u.keyCode===f.keys.ENTER&&w(this)}));spacer=f.create("span",null,i,"last");f.addClass(spacer,"dismiss");t=f.create("span",{id:"closebox",role:"button",tabindex:"0"},i,"last");f.addClass(t,"imageSprite");f.addClass(t,"core-sprite-close");f.addClass(t,"dismiss");t.title="Close";f.connect(t,"onclick",f.hitch(this,function(){m()}));f.connect(t,"onkeypress",f.hitch(this,
function(u){u.keyCode===f.keys.ENTER&&m()}));return k})}};e.prototype.constructor=e;return{CommandParameterCollector:e}});define("orion/editor/regex",[],function(){function d(a){return a.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function f(a){if(a=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(a))return{pattern:a[1],flags:a[2]};return null}return{escape:d,parse:f}});
define("orion/contentTypes",[],function(){function d(a){function b(k,m,p,w){p=m.filename.indexOf(p)>=0;var t=m.extension.indexOf(w)>=0;if(p||t)if(!k||p&&k.extension.indexOf(w)>=0)return m;return k}for(var c=a&&a.split(".").pop(),e=this.getContentTypes(),g=null,j=0;j<e.length;j++){var i=e[j];if(b(g,i,a,c)===i)g=i}return g}function f(a){function b(c){function e(p){if(p===null||typeof p==="undefined")return[];return p instanceof Array?p:[p]}c=c.getServiceReferences("orion.file.contenttype");for(var g=
{},j=0;j<c.length;j++)for(var i=e(c[j].getProperty("contentTypes")),k=0;k<i.length;k++){var m=i[k];g[m.id]||(g[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:e(m.extension),filename:e(m.filename)})}return g}this.serviceRegistry=a;this.map=b(a);a.registerService("orion.file.contenttypes",this)}f.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:f}});
define("orion/URITemplate",["require","exports","module"],function(){function d(m){this._text=m}function f(m,p){if(p==="U")return encodeURIComponent(m).replace(/[!'()*]/g,function(w){return"%"+w.charCodeAt(0).toString(16).toUpperCase()});if(p==="U+R")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]");if(p==="U+R-,")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+p);}function a(m,p,w){for(var t=[],u=0;u<m.length;u++)typeof m[u]!==
"undefined"&&t.push(f(m[u],p));return t.join(w)}function b(m,p,w,t){for(var u=Object.keys(m),v=[],x=0;x<u.length;x++)typeof m[u[x]]!=="undefined"&&v.push(f(u[x],p)+w+f(m[u[x]],p));return v.join(t)}function c(m){for(var p=[],w=m.split(","),t=0;t<w.length;t++){var u=w[t].match(k);if(u===null)throw new Error("Bad VarSpec: "+m);p.push({name:u[1],explode:!!u[2],prefix:u[3]?parseInt(u[3],10):-1})}return p}function e(m){if(m.length===0)throw new Error("Invalid Expression: 0 length expression");if(this._operator=
i[m[0]])m=m.substring(1);else this._operator=i.NUL;this._varSpecList=c(m)}function g(m){for(var p=[],w=0,t=m.indexOf("{",w);t!==-1;){p.push(new d(m.substring(w,t)));w=m.indexOf("}",t+1);if(w===-1)throw new Error("Invalid template: "+m);p.push(new e(m.substring(t+1,w)));w=w+1;t=m.indexOf("{",w)}p.push(new d(m.substring(w)));return p}function j(m){this._templateComponents=g(m)}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-,"}},k=/^((?:(?:[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)}};e.prototype={expand:function(m){for(var p=[],w=0;w<this._varSpecList.length;w++){var t=this._varSpecList[w],u=t.name,v=m[u],x=typeof v;if(x!=="undefined"&&v!==null){var n=p.length===0?this._operator.first:this._operator.sep;if(x==="string"){if(this._operator.named){n+=f(u,"U+R");n+=v.length===0?this._operator.ifemp:"="}if(t.prefix!==-1&&t.prefix<v.length)v=v.substring(0,t.prefix);n+=f(v,this._operator.allow)}else if(Array.isArray(v))if(t.explode)n+=
a(v,this._operator.allow,this._operator.sep);else{if(this._operator.named){n+=f(u,"U+R");n+=v.length===0?this._operator.ifemp:"="}n+=a(v,this._operator.allow,",")}else if(x==="object")if(t.explode)n+=b(v,this._operator.allow,"=",this._operator.sep);else{if(this._operator.named){n+=f(u,"U+R");n+=Object.keys(v).length===0?this._operator.ifemp:"="}n+=b(v,this._operator.allow,",",",")}else throw new Error("bad param type: "+u+" : "+x);p.push(n)}}return p.join("")}};j.prototype={expand:function(m){for(var p=
[],w=0;w<this._templateComponents.length;w++)p.push(this._templateComponents[w].expand(m));return p.join("")}};return j});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 f;do f=d._scopeName+"Unique"+ ++d.dnd._uniqueId;while(d.byId(f));return f};d.dnd._empty={};d.dnd.isFormElement=function(f){f=f.target;if(f.nodeType==3)f=f.parentNode;return" button textarea input select option ".indexOf(" "+f.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(f){var a=d.window.getBox(),b=0,c=0;if(f.clientX<d.dnd.H_TRIGGER_AUTOSCROLL)b=-d.dnd.H_AUTOSCROLL_VALUE;else if(f.clientX>a.w-d.dnd.H_TRIGGER_AUTOSCROLL)b=d.dnd.H_AUTOSCROLL_VALUE;if(f.clientY<d.dnd.V_TRIGGER_AUTOSCROLL)c=-d.dnd.V_AUTOSCROLL_VALUE;
else if(f.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(f){for(var a=f.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 e=Math.min(d.dnd.H_TRIGGER_AUTOSCROLL,c.w/2),g=Math.min(d.dnd.V_TRIGGER_AUTOSCROLL,
c.h/2),j=f.pageX-b.x,i=f.pageY-b.y,k=b=0;if(d.isWebKit||d.isOpera){j+=d.body().scrollLeft;i+=d.body().scrollTop}if(j>0&&j<c.w)if(j<e)b=-e;else if(j>c.w-e)b=e;if(i>0&&i<c.h)if(i<g)k=-g;else if(i>c.h-g)k=g;c=a.scrollLeft;e=a.scrollTop;a.scrollLeft+=b;a.scrollTop+=k;if(c!=a.scrollLeft||e!=a.scrollTop)return}}try{a=a.parentNode}catch(m){a=null}}d.dnd.autoScroll(f)};return d.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(d){d.declare("dojo.dnd.Mover",null,{constructor:function(f,a,b){this.node=d.byId(f);var c=a.touches?a.touches[0]:a;this.marginBox={l:c.pageX,t:c.pageY};this.mouseButton=a.button;a=this.host=b;f=f.ownerDocument;this.events=[d.connect(f,"onmousemove",this,"onFirstMove"),d.connect(f,"ontouchmove",this,"onFirstMove"),d.connect(f,"onmousemove",this,"onMouseMove"),d.connect(f,"ontouchmove",this,"onMouseMove"),d.connect(f,
"onmouseup",this,"onMouseUp"),d.connect(f,"ontouchend",this,"onMouseUp"),d.connect(f,"ondragstart",d.stopEvent),d.connect(f.body,"onselectstart",d.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(f){d.dnd.autoScroll(f);var a=this.marginBox,b=f.touches?f.touches[0]:f;this.host.onMove(this,{l:a.l+b.pageX,t:a.t+b.pageY},f);d.stopEvent(f)},onMouseUp:function(f){if(d.isWebKit&&d.isMac&&this.mouseButton==2?f.button==0:this.mouseButton==f.button)this.destroy();d.stopEvent(f)},onFirstMove:function(f){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 e=d.getComputedStyle(b),g=d._getMarginBox(b,e);e=d._getContentBox(b,e);b=a.l-(e.l-g.l);a=a.t-(e.t-g.t);break}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;c&&c.onFirstMove&&c.onFirstMove(this,f);d.disconnect(this.events.shift());d.disconnect(this.events.shift())},
destroy:function(){d.forEach(this.events,d.disconnect);var f=this.host;f&&f.onMoveStop&&f.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(f,a){this.node=d.byId(f);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(f,a){return new d.dnd.Moveable(a,f)},destroy:function(){d.forEach(this.events,d.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(f){if(!(this.skip&&d.dnd.isFormElement(f))){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=f.touches?f.touches[0]:f;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(f);d.stopEvent(f)}},onMouseMove:function(f){var a=f.touches?f.touches[0]:f;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(f);this.onDragDetected(f)}d.stopEvent(f)},onMouseUp:function(f){for(var a=0;a<2;++a)d.disconnect(this.events.pop());d.stopEvent(f)},onSelectStart:function(f){if(!this.skip||
!d.dnd.isFormElement(f))d.stopEvent(f)},onDragDetected:function(f){new this.mover(this.node,f,this)},onMoveStart:function(f){d.publish("/dnd/move/start",[f]);d.addClass(d.body(),"dojoMove");d.addClass(this.node,"dojoMoveItem")},onMoveStop:function(f){d.publish("/dnd/move/stop",[f]);d.removeClass(d.body(),"dojoMove");d.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(f,a){this.onMoving(f,a);var b=f.node.style;b.left=a.l+"px";b.top=a.t+"px";this.onMoved(f,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(f,a){return new d.dnd.move.constrainedMoveable(a,f)},constructor:function(f,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(f){var a=this.constraintBox=this.constraints.call(this,f);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){f=d._getMarginSize(f.node);a.r-=f.w;
a.b-=f.h}},onMove:function(f,a){var b=this.constraintBox,c=f.node.style;this.onMoving(f,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(f,a)}});d.declare("dojo.dnd.move.boxConstrainedMoveable",d.dnd.move.constrainedMoveable,{box:{},markupFactory:function(f,a){return new d.dnd.move.boxConstrainedMoveable(a,f)},constructor:function(f,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(f,a){return new d.dnd.move.parentConstrainedMoveable(a,f)},constructor:function(f,a){var b=a&&a.area;this.constraints=function(){var c=this.node.parentNode,e=d.getComputedStyle(c),g=d._getMarginBox(c,e);if(b=="margin")return g;var j=d._getMarginExtents(c,e);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="border")return g;j=d._getBorderExtents(c,e);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="padding")return g;j=d._getPadExtents(c,e);g.l+=
j.l;g.t+=j.t;g.w-=j.w;g.h-=j.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 f=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);f.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;f.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(f){var a=this;d.mixin(a,f);a.node=f.node;a._showArgs=d.mixin({},f);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=d.mixin({},f);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(f){return this.showAnim.play(f||0)},hide:function(f){return this.hideAnim.play(f||0)}});return d.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(d){(function(){var f={_fire:function(c,e){if(this[c])this[c].apply(this,e||[]);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(e){this.duration+=e.duration;if(e.delay)this.duration+=e.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,e){if(!this._current)this._current=this._animations[this._index=0];if(!e&&this._current.status()=="playing")return this;var g=d.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),j=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(j);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,e){this.pause();var g=this.duration*c;this._current=null;d.some(this._animations,function(j){if(j.duration<=g){this._current=j;return true}g-=j.duration;return false});this._current&&this._current.gotoPercent(g/this._current.duration,e);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 e=d.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);d.disconnect(e)});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,f);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 j=g.duration;if(g.delay)j+=g.delay;if(this.duration<j)this.duration=j;this._connects.push(d.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var e=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){e._connects.push(d.connect(e._pseudoAnimation,g,function(){e._fire(g,
arguments)}))})};d.extend(b,{_doAction:function(c,e){d.forEach(this._animations,function(g){g[c].apply(g,e)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(c,e){var g=this._pseudoAnimation;g[c].apply(g,e)},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,e){var g=
this.duration*c;d.forEach(this._animations,function(j){j.gotoPercent(j.duration<g?1:g/j.duration,e)});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,f);d.fx.combine=function(c){return new b(c)};d.fx.wipeIn=function(c){var e=c.node=d.byId(c.node),g=e.style,j;c=d.animateProperty(d.mixin({properties:{height:{start:function(){j=
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(e,"height");return Math.max(i,1)}},end:function(){return e.scrollHeight}}}},c));d.connect(c,"onEnd",function(){g.height="auto";g.overflow=j});return c};d.fx.wipeOut=function(c){var e=(c.node=d.byId(c.node)).style,g;c=d.animateProperty(d.mixin({properties:{height:{end:1}}},c));d.connect(c,"beforeBegin",function(){g=e.overflow;e.overflow="hidden";e.display=
""});d.connect(c,"onEnd",function(){e.overflow=g;e.height="auto";e.display="none"});return c};d.fx.slideTo=function(c){var e=null,g=null,j=function(i){return function(){var k=d.getComputedStyle(i),m=k.position;e=m=="absolute"?i.offsetTop:parseInt(k.top)||0;g=m=="absolute"?i.offsetLeft:parseInt(k.left)||0;if(m!="absolute"&&m!="relative"){k=d.position(i,true);e=k.y;g=k.x;i.style.position="absolute";i.style.top=e+"px";i.style.left=g+"px"}}}(c.node=d.byId(c.node));j();c=d.animateProperty(d.mixin({properties:{top:c.top||
0,left:c.left||0}},c));d.connect(c,"beforeBegin",c,j);return c}})();return d.fx});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(d,f){d.declare("dijit.DialogUnderlay",[f._Widget,f._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 f.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return f.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,f){d.declare("dijit._DialogBase",[f._Templated,f.form._FormMixin,f._DialogMixin,f._CssStateMixin],{templateString:d.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:d.delegate(f._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:f.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&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);f.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,e=c?null:d._getBorderBox(a),g=Math.floor(b.l+(c?c.x:(b.w-e.w)/2));b=Math.floor(b.t+(c?c.y:(b.h-e.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 e=
this._firstFocusItem==this._lastFocusItem;if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===b.TAB){e||f.focus(this._lastFocusItem);d.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===b.TAB&&!a.shiftKey){e||f.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(){f._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:d.hitch(this,function(){if(this.autofocus&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
f.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";f._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"){f._underlay&&f._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);f._DialogLevelManager.hide(this);this.inherited(arguments)}});d.declare("dijit.Dialog",[f.layout.ContentPane,f._DialogBase],{});f._DialogLevelManager={show:function(a,b){var c=f._dialogStack;c[c.length-1].focus=f.getFocus(a);var e=f._underlay;if(!e||e._destroyed)e=f._underlay=new f.DialogUnderlay(b);else e.set(a.underlayAttrs);var g=
c[c.length-1].dialog?c[c.length-1].zIndex+2:950;c.length==1&&e.show();d.style(f._underlay.domNode,"zIndex",g-1);d.style(a.domNode,"zIndex",g);c.push({dialog:a,underlayAttrs:b,zIndex:g})},hide:function(a){var b=f._dialogStack;if(b[b.length-1].dialog==a){b.pop();var c=b[b.length-1];if(b.length==1)f._underlay._destroyed||f._underlay.hide();else{d.style(f._underlay.domNode,"zIndex",c.zIndex-1);f._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{f.focus(b)}catch(e){}}}else{c=d.indexOf(d.map(b,function(g){return g.dialog}),a);c!=-1&&b.splice(c,1)}},isTop:function(a){var b=f._dialogStack;return b[b.length-1].dialog==a}};f._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return f.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,f){return f.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(d,f){d.declare("dijit.form.CheckBox",f.form.ToggleButton,{templateString:d.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:d.delegate(f.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);d.attr(this.focusNode,"readOnly",a);f.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",f.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=f.getEnclosingWidget(c))&&c.checked&&c.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return f.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(d,f){d.declare("dijit.form.Form",[f._Widget,f._Templated,f.form._FormMixin,f.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:d.delegate(f._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=f.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 f.form.Form});
define("dojo/data/util/filter",["dojo"],function(d){d.getObject("data.util.filter",true,d);d.data.util.filter.patternToRegExp=function(f,a){for(var b="^",c=null,e=0;e<f.length;e++){c=f.charAt(e);switch(c){case "\\":b+=c;e++;b+=f.charAt(e);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(f,a){var b=-1;if(f===null)f=undefined;if(a===null)a=undefined;if(f==a)b=0;else if(f>a||f==null)b=1;return b};d.data.util.sorter.createSortFunction=function(f,a){function b(p,w,t,u){return function(v,x){v=u.getValue(v,p);x=u.getValue(x,p);return w*t(v,x)}}for(var c=[],e,g=a.comparatorMap,j=d.data.util.sorter.basicComparator,i=0;i<f.length;i++){e=f[i];var k=e.attribute;
if(k){e=e.descending?-1:1;var m=j;if(g){if(typeof k!=="string"&&"toString"in k)k=k.toString();m=g[k]||j}c.push(b(k,e,m,a))}}return function(p,w){for(var t=0;t<c.length;){var u=c[t++](p,w);if(u!==0)return u}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(f){f=f||{};if(!f.store)f.store=this;var a=this,b=function(e,g){if(g.onError)g.onError.call(g.scope||d.global,e,g)},c=function(e,g){var j=g.abort||null,i=false,k=g.start?g.start:0,m=g.count&&g.count!==Infinity?k+g.count:e.length;g.abort=function(){i=true;j&&j.call(g)};var p=g.scope||d.global;if(!g.store)g.store=a;g.onBegin&&g.onBegin.call(p,
e.length,g);g.sort&&e.sort(d.data.util.sorter.createSortFunction(g.sort,a));if(g.onItem)for(var w=k;w<e.length&&w<m;++w){var t=e[w];i||g.onItem.call(p,t,g)}if(g.onComplete&&!i){w=null;g.onItem||(w=e.slice(k,m));g.onComplete.call(p,w,g)}};this._fetchItems(f,c,b);return f};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(f){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=f.url;this._jsonData=f.data;this.data=null;this._datatypeMap=f.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(f.urlPreventCache!==undefined)this.urlPreventCache=f.urlPreventCache?true:false;if(f.hierarchical!==undefined)this.hierarchical=f.hierarchical?true:false;if(f.clearOnClose)this.clearOnClose=true;if("failOk"in f)this.failOk=f.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(f){if(!this.isItem(f))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(f){if(typeof f!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(f,a,b){f=this.getValues(f,a);return f.length>0?f[0]:b},getValues:function(f,a){this._assertIsItem(f);this._assertIsAttribute(a);
return(f[a]||[]).slice(0)},getAttributes:function(f){this._assertIsItem(f);var a=[];for(var b in f)b!==this._storeRefPropName&&b!==this._itemNumPropName&&b!==this._rootItemPropName&&b!==this._reverseRefMap&&a.push(b);return a},hasAttribute:function(f,a){this._assertIsItem(f);this._assertIsAttribute(a);return a in f},containsValue:function(f,a,b){var c=undefined;if(typeof b==="string")c=d.data.util.filter.patternToRegExp(b,false);return this._containsValue(f,a,b,c)},_containsValue:function(f,a,b,c){return d.some(this.getValues(f,
a),function(e){if(e!==null&&!d.isObject(e)&&c){if(e.toString().match(c))return true}else if(b===e)return true})},isItem:function(f){if(f&&f[this._storeRefPropName]===this)if(this._arrayOfAllItems[f[this._itemNumPropName]]===f)return true;return false},isItemLoaded:function(f){return this.isItem(f)},loadItem:function(f){this._assertIsItem(f.item)},getFeatures:function(){return this._features},getLabel:function(f){if(this._labelAttr&&this.isItem(f))return this.getValue(f,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(f,a,b){var c=this,e=function(k,m){var p=[],w,t;if(k.query){var u;w=k.queryOptions?k.queryOptions.ignoreCase:false;var v={};for(t in k.query){u=k.query[t];if(typeof u==="string")v[t]=d.data.util.filter.patternToRegExp(u,w);else if(u instanceof RegExp)v[t]=u}for(w=0;w<m.length;++w){var x=true,n=m[w];if(n===null)x=false;else for(t in k.query){u=k.query[t];c._containsValue(n,t,u,v[t])||(x=false)}x&&p.push(n)}}else for(w=0;w<m.length;++w){t=m[w];t!==null&&p.push(t)}a(p,
k)};if(this._loadFinished)e(f,this._getItemsArray(f.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:f,
filter:e});else{this._loadInProgress=true;var g=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});g.addCallback(function(k){try{c._getItemsFromLoadedData(k);c._loadFinished=true;c._loadInProgress=false;e(f,c._getItemsArray(f.queryOptions));c._handleQueuedFetches()}catch(m){c._loadFinished=true;c._loadInProgress=false;b(m,f)}});g.addErrback(function(k){c._loadInProgress=false;b(k,f)});var j=null;if(f.abort)j=f.abort;f.abort=function(){g&&
g.fired===-1&&g.cancel();j&&j.call(f)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;e(f,this._getItemsArray(f.queryOptions))}catch(i){b(i,f)}else b(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),f)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var f=0;f<this._queuedFetches.length;f++){var a=this._queuedFetches[f],b=a.args;(a=a.filter)?
a(b,this._getItemsArray(b.queryOptions)):this.fetchItemByIdentity(b)}this._queuedFetches=[]}},_getItemsArray:function(f){if(f&&f.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(f){function a(v){return v!==null&&typeof v==="object"&&(!d.isArray(v)||c)&&!d.isFunction(v)&&(v.constructor==Object||d.isArray(v))&&typeof v._reference==="undefined"&&typeof v._type==="undefined"&&typeof v._value==="undefined"&&e.hierarchical}function b(v){e._arrayOfAllItems.push(v);for(var x in v){var n=v[x];
if(n)if(d.isArray(n))for(var r=0;r<n.length;++r){var y=n[r];a(y)&&b(y)}else a(n)&&b(n)}}var c=false,e=this;this._labelAttr=f.label;var g,j;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=f.items;for(g=0;g<this._arrayOfTopLevelItems.length;++g){j=this._arrayOfTopLevelItems[g];if(d.isArray(j))c=true;b(j);j[this._rootItemPropName]=true}var i={},k;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];for(k in j){if(k!==this._rootItemPropName){var m=j[k];if(m!==null)d.isArray(m)||
(j[k]=[m]);else j[k]=[null]}i[k]=k}}for(;i[this._storeRefPropName];)this._storeRefPropName+="_";for(;i[this._itemNumPropName];)this._itemNumPropName+="_";for(;i[this._reverseRefMap];)this._reverseRefMap+="_";if(i=f.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=i;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];f=j[i];f=f[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,f))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: ["+f+"]");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: ["+f+"]");}else this._itemsByIdentity[f]=j}}else this._features["dojo.data.api.Identity"]=Number;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];j[this._storeRefPropName]=
this;j[this._itemNumPropName]=g}for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];for(k in j){f=j[k];for(i=0;i<f.length;++i){m=f[i];if(m!==null&&typeof m=="object"){if("_type"in m&&"_value"in m){var p=m._type,w=this._datatypeMap[p];if(w)if(d.isFunction(w))f[i]=new w(m._value);else if(d.isFunction(w.deserialize))f[i]=w.deserialize(m._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 '"+p+"'");}if(m._reference){m=m._reference;if(d.isObject(m))for(p=0;p<this._arrayOfAllItems.length;++p){w=this._arrayOfAllItems[p];var t=true;for(var u in m)if(w[u]!=m[u])t=false;if(t)f[i]=w}else f[i]=this._getItemByIdentity(m);if(this.referenceIntegrity){m=f[i];this.isItem(m)&&this._addReferenceToMap(m,j,k)}}else this.isItem(m)&&this.referenceIntegrity&&this._addReferenceToMap(m,
j,k)}}}}},_addReferenceToMap:function(){},getIdentity:function(f){var a=this._features["dojo.data.api.Identity"];if(a===Number)return f[this._itemNumPropName];else if(f=f[a])return f[0];return null},fetchItemByIdentity:function(f){var a,b;if(this._loadFinished){a=this._getItemByIdentity(f.identity);if(f.onItem){b=f.scope?f.scope:d.global;f.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:f});else{this._loadInProgress=true;b=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});b.addCallback(function(e){var g=f.scope?f.scope:d.global;try{c._getItemsFromLoadedData(e);
c._loadFinished=true;c._loadInProgress=false;a=c._getItemByIdentity(f.identity);f.onItem&&f.onItem.call(g,a);c._handleQueuedFetches()}catch(j){c._loadInProgress=false;f.onError&&f.onError.call(g,j)}});b.addErrback(function(e){c._loadInProgress=false;if(f.onError)f.onError.call(f.scope?f.scope:d.global,e)})}else if(this._jsonData){c._getItemsFromLoadedData(c._jsonData);c._jsonData=null;c._loadFinished=true;a=c._getItemByIdentity(f.identity);if(f.onItem){b=f.scope?f.scope:d.global;f.onItem.call(b,a)}}}},
_getItemByIdentity:function(f){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,f))a=this._itemsByIdentity[f];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,f))a=this._arrayOfAllItems[f];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var f=this._features["dojo.data.api.Identity"];return f===Number?null:[f]},_forceLoad:function(){var f=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(f._loadInProgress!==true&&!f._loadFinished){f._getItemsFromLoadedData(b);f._loadFinished=true}else if(f._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){f._getItemsFromLoadedData(f._jsonData);f._jsonData=null;f._loadFinished=true}}});d.extend(d.data.ItemFileReadStore,d.data.util.simpleFetch);return d.data.ItemFileReadStore});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(d,f){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(f._curFocus,
this.domNode))f._curFocus=null;if(d.isDescendant(f._prevFocus,this.domNode))f._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,f){d.declare("orion.widgets.NewItemDialog",[f.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(f,a,b,c){var e=[];d.Deferred.call(this);var g=this;f.length===0&&!a&&this.resolve([0,[]]);var j=0;d.forEach(f,function(i,k){function m(p,w){e[k]=[p,w];j++;j===f.length&&g.resolve(e)}i.then(function(p){a?g.resolve([k,p]):m(true,p)},function(p){b?g.reject(p):m(false,p);if(c)return null;throw p;})})};d.DeferredList.prototype=new d.Deferred;d.DeferredList.prototype.gatherResults=function(f){f=new d.DeferredList(f,false,true,false);
f.addCallback(function(a){var b=[];d.forEach(a,function(c){b.push(c[1])});return b});return f};return d.DeferredList});
define("dojo/regexp",["dojo"],function(d){d.getObject("regexp",true,d);d.regexp.escapeString=function(f,a){return f.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(b){if(a&&a.indexOf(b)!=-1)return b;return"\\"+b})};d.regexp.buildGroupRE=function(f,a,b){if(!(f instanceof Array))return a(f);for(var c=[],e=0;e<f.length;e++)c.push(a(f[e]));return d.regexp.group(c.join("|"),b)};d.regexp.group=function(f,a){return"("+(a?"?:":"")+f+")"};return d.regexp});
define("dojo/cookie",["dojo","dojo/regexp"],function(d){d.cookie=function(f,a,b){var c=document.cookie;if(arguments.length==1){var e=c.match(new RegExp("(?:^|; )"+d.regexp.escapeString(f)+"=([^;]*)"));return e?decodeURIComponent(e[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=f+"="+a;for(e in b){c+="; "+e;g=b[e];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,f){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 e=this.store;if(e.isItemLoaded(a)){for(var g=[],j=0;j<this.childrenAttrs.length;j++){var i=e.getValues(a,this.childrenAttrs[j]);g=g.concat(i)}var k=0;this.deferItemLoadingUntilExpand||d.forEach(g,function(p){e.isItemLoaded(p)||k++});k==0?b(g):d.forEach(g,function(p,w){e.isItemLoaded(p)||e.loadItem({item:p,onItem:function(t){g[w]=t;--k==0&&b(g)},onError:c})})}else{var m=d.hitch(this,arguments.callee);e.loadItem({item:a,
onItem:function(p){m(p,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 e={parent:b,attribute:this.childrenAttrs[0]},g;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(j){if(j)this.pasteItem(j,null,b,true,c);else(g=this.store.newItem(a,e))&&c!=undefined&&this.pasteItem(g,b,b,false,c)}});else(g=this.store.newItem(a,e))&&c!=undefined&&this.pasteItem(g,b,b,false,c)},pasteItem:function(a,b,c,e,g){var j=this.store,i=this.childrenAttrs[0];b&&d.forEach(this.childrenAttrs,function(m){if(j.containsValue(b,m,a)){if(!e){var p=d.filter(j.getValues(b,m),function(w){return w!=a});j.setValues(b,m,p)}i=m}});if(c)if(typeof g=="number"){var k=j.getValues(c,i).slice();
k.splice(g,0,a);j.setValues(c,i,k)}else j.setValues(c,i,j.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 f.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(d,f){d.declare("dijit.tree.ForestStoreModel",f.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(e){this.root.children=e;b(e)}),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,e,g){if(b===this.root)e||this.onLeaveRoot(a);f.tree.TreeStoreModel.prototype.pasteItem.call(this,a,b===this.root?null:b,c===this.root?null:c,e,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,e){return b[e]!=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 f.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(d){d.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(f,a){this.node=d.byId(f);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(f){return this.map[f]},setItem:function(f,a){this.map[f]=a},delItem:function(f){delete this.map[f]},forInItems:function(f,a){a=a||d.global;var b=this.map,c=d.dnd._empty;for(var e in b)e in c||f.call(a,b[e],e,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return d.query("> .dojoDndItem",this.parent)},
sync:function(){var f={};this.getAllNodes().forEach(function(a){if(a.id){var b=this.getItem(a.id);if(b){f[a.id]=b;return}}else a.id=d.dnd.getUniqueId();b=a.getAttribute("dndType");var c=a.getAttribute("dndData");f[a.id]={data:c||a.innerHTML,type:b?b.split(/\s*,\s*/):["text"]}},this);this.map=f;return this},insertNodes:function(f,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<f.length;++a){var c=this._normalizedCreator(f[a]);
this.setItem(c.node.id,{data:c.data,type:c.type});this.parent.insertBefore(c.node,b)}else for(a=0;a<f.length;++a){c=this._normalizedCreator(f[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(f,a){f._skipStartup=true;return new d.dnd.Container(a,f)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var f=this.parent.getElementsByTagName("tbody");if(f&&f.length)this.parent=f[0]}}this.defaultCreator=d.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(f){for(var a=f.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(f);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(f){for(f=
f.relatedTarget;f;){if(f==this.node)return;try{f=f.parentNode}catch(a){f=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(f){if(!this.skipForm||!d.dnd.isFormElement(f))d.stopEvent(f)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(f,a){var b="dojoDnd"+f;f=f.toLowerCase()+"State";d.replaceClass(this.node,b+a,b+this[f]);this[f]=a},_addItemClass:function(f,a){d.addClass(f,
"dojoDndItem"+a)},_removeItemClass:function(f,a){d.removeClass(f,"dojoDndItem"+a)},_getChildByEvent:function(f){if(f=f.target)for(var a=f.parentNode;a;f=a,a=f.parentNode)if(a==this.parent&&d.hasClass(f,"dojoDndItem"))return f;return null},_normalizedCreator:function(f,a){f=(this.creator||this.defaultCreator).call(this,f,a);if(!d.isArray(f.type))f.type=["text"];if(!f.node.id)f.node.id=d.dnd.getUniqueId();d.addClass(f.node,"dojoDndItem");return f}});d.dnd._createNode=function(f){if(!f)return d.dnd._createSpan;
return function(a){return d.create(f,{innerHTML:a})}};d.dnd._createTrTd=function(f){var a=d.create("tr");d.create("td",{innerHTML:f},a);return a};d.dnd._createSpan=function(f){return d.create("span",{innerHTML:f})};d.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};d.dnd._defaultCreator=function(f){f=f.tagName.toLowerCase();var a=f=="tbody"||f=="thead"?d.dnd._createTrTd:d.dnd._createNode(d.dnd._defaultCreatorNodes[f]);return function(b,c){var e=b&&d.isObject(b),g;if(e&&b.tagName&&b.nodeType&&
b.getAttribute){g=b.getAttribute("dndData")||b.innerHTML;e=(e=b.getAttribute("dndType"))?e.split(/\s*,\s*/):["text"];b=b}else{g=e&&b.data?b.data:b;e=e&&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:e}}};return d.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(d,f){d.getObject("tree",true,d);f.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 f.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(d,f){d.declare("dijit.tree._dndSelector",f.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;f.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(e){c.push(e);b.push(e.getTreePath())});a=d.map(c,function(e){return e.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),e=b.id;if(!this.singular&&!a.shiftKey&&this.selection[e])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(f.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 f.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,f){d.declare("dijit._TreeNode",[f._Widget,f._Templated,f._Container,f._Contained,f._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(f._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&&f.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 e="_"+b+"Class";b=b+"Node";var g=this[e];this[e]=this.tree["get"+c+"Class"](a,this.isExpanded);d.replaceClass(this[b],this[e]||"",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;f.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)f.setWaiRole(this.containerNode,"group");d.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&f.setWaiState(this.tree.domNode,"expanded","true");var a,b=d.fx.wipeIn({node:this.containerNode,duration:f.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;f.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&f.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:f.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var b=this.tree,c=b.model,e=[];d.forEach(this.getChildren(),
function(g){f._Container.prototype.removeChild.call(this,g)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;d.forEach(a,function(g){var j=c.getIdentity(g),i=b._itemNodesMap[j],k;if(i)for(var m=0;m<i.length;m++)if(i[m]&&!i[m].getParent()){k=i[m];k.set("indent",this.indent+1);break}if(!k){k=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(k);else b._itemNodesMap[j]=
[k]}this.addChild(k);if(this.tree.autoExpand||this.tree._state(g))e.push(b._expandNode(k))},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(e)},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){f.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",[f._Widget,f._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,e){this.getItemChildren(this._v10Compat&&b===this.model.root?null:b,c,e)});this.model=new f.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";f.setWaiRole(this.domNode,"presentation");f.setWaiRole(b.labelNode,"presentation");f.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)}),e=[];d.forEach(c,function(g){e=e.concat(b._itemNodesMap[g]||
[])});this.set("selectedNodes",e)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function b(g,j,i){var k=g.shift(),m=d.filter(j,function(p){return p.getIdentity()==k})[0];if(m)g.length?e._expandNode(m).addCallback(function(){b(g,m.getChildren(),i)}):i.callback(m);else i.errback("Could not expand path at "+k)}function c(g){e.set("selectedNodes",d.map(d.filter(g,function(j){return j[0]}),function(j){return j[1]}))}var e=this;return(new d.DeferredList(d.map(a,
function(g){var j=new d.Deferred;g=d.map(g,function(i){return d.isString(i)?i:e.model.getIdentity(i)});g.length?e._loadDeferred.addCallback(function(){b(g,[e.rootNode],j)}):j.errback("Empty path");return j}))).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=f.getEnclosingWidget(a.target);if(c){var e=a.charOrCode;if(typeof e=="string"&&e!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:c,
key:e.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[e]){this[this._keyHandlerMap[e]]({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,e=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var g=a._expandNodeDeferred=new d.Deferred;b.getChildren(c,function(j){a.unmarkProcessing();j=a.setChildItems(j);var i=e._expandNode(a,true);j.addCallback(function(){i.addCallback(function(){g.callback()})})},function(j){console.error(e,": error loading root children: ",j)});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){f.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),e=this.getTooltip(a);d.forEach(b,function(g){g.set({item:a,label:c,tooltip:e});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 e=c.getParent();e&&e.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 f._TreeNode(a)}});return f.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,f){d.declare("orion.widgets._ExplorerTreeNode",[f._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",
[f.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,e=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||e)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)}!e&&!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(e){c._removeFromSelection(e)})}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(j,i){var k=[];j=j;do{k.push(j);j=e._getNextNode(j)}while(j&&j!==i);if(j===
i){k.push(i);return k}return null}a=this._getVisibleAncestor(a);b=this._getVisibleAncestor(b);if(a&&b)if(a===b)this._selectNode(a);else{var e=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(e,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,f,a){d.declare("orion.widgets.DirectoryPrompterDialog",[f.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 e in c)this.treeRoot[e]=
c[e];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,e,g){this.registry=c;this.root=e;this.fileClient=g}b.prototype={destroy:function(){},getRoot:function(c){c(this.root)},mayHaveChildren:function(){return true},getChildren:function(c,e){if(c.children)e(c.children);else if(c.Directory!==undefined&&c.Directory===false)e([]);else c.Location?this.fileClient.fetchChildren(c.ChildrenLocation).then(d.hitch(this,
function(g){for(var j=[],i=0;i<g.length;i++)g[i].Directory&&j.push(g[i]);a.processNavigatorParent(c,j);e(j)})):e([])},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,f){d.declare("dojox.form.uploader.Base",[f._Widget,f._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,e=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(e>1)g=e.toFixed(1)+" gb";return{kb:b,mb:c,gb:e,bytes:a,value:g}}})});
define("dojox/form/Uploader",["dojo","dijit","dojox","dojox/form/uploader/Base"],function(d,f,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,e){b.push({index:e,name:c.name,size:c.size,type:c.type})},this):d.forEach(this._inputs,function(c,e){b.push({index:e,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(e){this._cons.push(d.connect(this.inputNode,e,this,function(){this.button._cssMouseEvent({type:e})}))});b("mouseover");b("mouseout");b("mousedown");this._cons.push(d.connect(this.inputNode,"change",this,function(e){this.onChange(this.getFileList(e));!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,f,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=f.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,e=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:e}).play()}else e()},_onUploaderChange:function(b){this.reset();d.forEach(b,function(c,e){this._addRow(e+
1,this.getFileType(c.name),c.name,c.size)},this)},_addRow:function(b,c,e,g){var j,i=this.listNode.insertRow(-1);j=i.insertCell(-1);d.addClass(j,"dojoxUploaderIndex");j.innerHTML=b;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderIcon");j.innerHTML=c;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderFileName");j.innerHTML=e;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderSize");j.innerHTML=this.convertBytes(g).value;this.rowAmt++}})});
define("dojo/io/iframe",["dojo"],function(d){d.getObject("io",true,d);d.io.iframe={create:function(f,a,b){if(window[f])return window[f];if(window.frames[f])return window.frames[f];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="'+f+'" name="'+f+'" src="'+b+'" onload="'+a+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',d.body());return window[f]=c},setSrc:function(f,a,b){try{if(b){var c;if(c=d.isIE||d.isWebKit?f.contentWindow.document:f.contentWindow)c.location.replace(a);else f.location=a}else if(d.isWebKit)f.location=a;else frames[f.name].location=a}catch(e){console.log("dojo.io.iframe.setSrc: ",e)}},doc:function(f){return f.contentDocument||
f.name&&f.document&&d.doc.getElementsByTagName("iframe")[f.name].contentWindow&&d.doc.getElementsByTagName("iframe")[f.name].contentWindow.document||f.name&&d.doc.frames[f.name]&&d.doc.frames[f.name].document||null},send:function(f){if(!this._frame)this._frame=this.create(this._iframeName,d._scopeName+".io.iframe._iframeOnload();");f=d._ioSetArgs(f,function(a){a.canceled=true;a.ioArgs._callNext()},function(a){var b=null;try{var c=a.ioArgs,e=d.io.iframe,g=e.doc(e._frame),j=c.handleAs;b=g;if(j!="html")if(j==
"xml"){if(d.isIE<9||d.isIE&&d.isQuirks){d.query("a",e._frame.contentWindow.document.documentElement).orphan();var i=e._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(j=="json")b=d.fromJson(b);else if(j=="javascript")b=d.eval(b)}}catch(k){b=k}finally{c._callNext()}return b},function(a,b){b.ioArgs._hasError=true;b.ioArgs._callNext();return a});f.ioArgs._callNext=
function(){if(!this._calledNext){this._calledNext=true;d.io.iframe._currentDfd=null;d.io.iframe._fireNextRequest()}};this._dfdQueue.push(f);this._fireNextRequest();d._ioWatch(f,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 f},_currentDfd:null,_dfdQueue:[],_iframeName:d._scopeName+"IoIframe",_fireNextRequest:function(){try{if(!(this._currentDfd||this._dfdQueue.length==
0)){do var f=this._currentDfd=this._dfdQueue.shift();while(f&&f.canceled&&this._dfdQueue.length);if(!f||f.canceled)this._currentDfd=null;else{var a=f.ioArgs,b=a.args;a._contentToClean=[];var c=d.byId(b.form),e=b.content||{};if(c){if(e){var g=function(u,v){d.create("input",{type:"hidden",name:u,value:v},c);a._contentToClean.push(u)};for(var j in e){var i=e[j];if(d.isArray(i)&&i.length>1){var k;for(k=0;k<i.length;k++)g(j,i[k])}else if(c[j])c[j].value=i;else g(j,i)}}var m=c.getAttributeNode("action"),
p=c.getAttributeNode("method"),w=c.getAttributeNode("target");if(b.url){a._originalAction=m?m.value:null;if(m)m.value=b.url;else c.setAttribute("action",b.url)}if(!p||!p.value)if(p)p.value=b.method?b.method:"post";else c.setAttribute("method",b.method?b.method:"post");a._originalTarget=w?w.value:null;if(w)w.value=this._iframeName;else c.setAttribute("target",this._iframeName);c.target=this._iframeName;d._ioNotifyStart(f);c.submit()}else{g=b.url+(b.url.indexOf("?")>-1?"&":"?")+a.query;d._ioNotifyStart(f);
this.setSrc(this._frame,g,true)}}}}catch(t){f.errback(t)}},_iframeOnload:function(){var f=this._currentDfd;if(f){f=f.ioArgs;var a=d.byId(f.args.form);if(a){for(var b=f._contentToClean,c=0;c<b.length;c++)for(var e=b[c],g=0;g<a.childNodes.length;g++){var j=a.childNodes[g];if(j.name==e){d.destroy(j);break}}f._originalAction&&a.setAttribute("action",f._originalAction);if(f._originalTarget){a.setAttribute("target",f._originalTarget);a.target=f._originalTarget}}f._finished=true}else this._fireNextRequest()}};
return d.io.iframe});
define("dojox/form/uploader/plugins/HTML5",["dojo","dijit","dojox","dojox/form/Uploader"],function(d,f,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(),e=this.createXhr();e.setRequestHeader("Content-Type","multipart/form-data; boundary="+c);(b=this._buildRequestBody(b,c))?e.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 e in b)c.append(e,b[e]);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(e){this.onError(e);clearInterval(c)}),false);b.addEventListener("abort",d.hitch(this,function(e){this.onAbort(e);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 e="";c="--"+c;var g=[];d.forEach(this.inputNode.files,function(i,k){i=this.name+"s[]";var m=this.inputNode.files[k].fileName,p;try{p=this.inputNode.files[k].getAsBinary()+"\r\n";e+=c+"\r\n";e+="Content-Disposition: form-data; ";e+='name="'+i+'"; ';e+='filename="'+m+'"\r\n';e+="Content-Type: "+this.getMimeType()+"\r\n\r\n";e+=p}catch(w){g.push({index:k,name:m})}},this);if(g.length)if(g.length>=this.inputNode.files.length){this.onError({message:this.errMsg,
filesInError:g});e=false}if(!e)return false;if(b)for(var j in b){e+=c+"\r\n";e+="Content-Disposition: form-data; ";e+='name="'+j+'"\r\n\r\n';e+=b[j]+"\r\n"}e+=c+"--\r\n";return e}});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,f,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(f,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(f)||Math.abs(f)==Infinity)return null;return d.number._applyPattern(f,b,a)};d.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;d.number._applyPattern=function(f,
a,b){b=b||{};var c=b.customs.group,e=b.customs.decimal;a=a.split(";");var g=a[0];a=a[f<0?1:0]||"-"+g;if(a.indexOf("%")!=-1)f*=100;else if(a.indexOf("\u2030")!=-1)f*=1E3;else if(a.indexOf("\u00a4")!=-1){c=b.customs.currencyGroup||c;e=b.customs.currencyDecimal||e;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 j=d.number._numberPatternRE;g=g.match(j);
if(!g)throw new Error("unable to find a number expression in pattern: "+a);if(b.fractional===false)b.places=0;return a.replace(j,d.number._formatAbsolute(f,g[0],{decimal:e,group:c,places:b.places,round:b.round}))};d.number.round=function(f,a,b){b=10/(b||10);return(b*+f).toFixed(a)/b};(0.9).toFixed()==0&&function(){var f=d.number.round;d.number.round=function(a,b,c){var e=Math.pow(10,-b||0),g=Math.abs(a);if(!a||g>=e||g*Math.pow(10,b+1)<5)e=0;return f(a,b,c)+(a>0?e:-e)}}();d.number._formatAbsolute=
function(f,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(","),e=b.places;if(c)e=b.places.substring(c+1);else if(!(e>=0))e=(a[1]||[]).length;b.round<0||(f=d.number.round(f,e,b.round));f=String(Math.abs(f)).split(".");var g=f[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)f[1]=d.string.pad(g,c,"0",true);if(e<g.length)f[1]=
g.substr(0,e)}else f[1]&&f.pop();e=a[0].replace(",","");c=e.indexOf("0");if(c!=-1){c=e.length-c;if(c>f[0].length)f[0]=d.string.pad(f[0],c);if(e.indexOf("#")==-1)f[0]=f[0].substr(f[0].length-c)}e=a[0].lastIndexOf(",");var j,i;if(e!=-1){j=a[0].length-e-1;a=a[0].substr(0,e);e=a.lastIndexOf(",");if(e!=-1)i=a.length-e-1}a=[];for(e=f[0];e;){c=e.length-j;a.push(c>0?e.substr(c):e);e=c>0?e.slice(0,c):"";if(i){j=i;delete i}}f[0]=a.reverse().join(b.group||",");return f.join(b.decimal||".")};d.number.regexp=
function(f){return d.number._parseInfo(f).regexp};d.number._parseInfo=function(f){f=f||{};var a=d.i18n.normalizeLocale(f.locale);a=d.i18n.getLocalization("dojo.cldr","number",a);var b=f.pattern||a[(f.type||"decimal")+"Format"],c=a.group,e=a.decimal,g=1;if(b.indexOf("%")!=-1)g/=100;else if(b.indexOf("\u2030")!=-1)g/=1E3;else{var j=b.indexOf("\u00a4")!=-1;if(j){c=a.currencyGroup||c;e=a.currencyDecimal||e}}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(k){var m={signed:false,separator:f.strict?c:[c,""],fractional:f.fractional,decimal:e,exponent:false};k=k.split(".");var p=f.places;if(k.length==1&&g!=1)k[1]="###";if(k.length==1||p===0)m.fractional=false;else{if(p===undefined)p=f.pattern?k[1].lastIndexOf("0")+1:Infinity;if(p&&f.fractional==undefined)m.fractional=true;if(!f.places&&p<k[1].length)p+=","+k[1].length;m.places=p}k=k[0].split(",");if(k.length>1){m.groupSize=k.pop().length;if(k.length>
1)m.groupSize2=k.pop().length}return"("+d.number._realNumberRegexp(m)+")"})},true);if(j)a=a.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g,function(i,k,m,p){i=d.regexp.escapeString(f[["symbol","currency","displayName"][m.length-1]]||f.currency||"");k=k?"[\\s\\xa0]":"";p=p?"[\\s\\xa0]":"";if(!f.strict){if(k)k+="*";if(p)p+="*";return"(?:"+k+i+p+")?"}return k+i+p});return{regexp:a.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:c,decimal:e,factor:g}};d.number.parse=function(f,a){a=d.number._parseInfo(a);f=(new RegExp("^"+
a.regexp+"$")).exec(f);if(!f)return NaN;var b=f[1];if(!f[1]){if(!f[2])return NaN;b=f[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(f){f=f||{};if(!("places"in f))f.places=Infinity;if(typeof f.decimal!="string")f.decimal=".";if(!("fractional"in f)||/^0/.test(f.places))f.fractional=[true,false];if(!("exponent"in f))f.exponent=[true,false];if(!("eSigned"in f))f.eSigned=[true,false];var a=d.number._integerRegexp(f),
b=d.regexp.buildGroupRE(f.fractional,function(e){var g="";if(e&&f.places!==0){g="\\"+f.decimal;if(f.places==Infinity)g="(?:"+g+"\\d+)?";else g+="\\d{"+f.places+"}"}return g},true),c=d.regexp.buildGroupRE(f.exponent,function(e){if(e)return"([eE]"+d.number._integerRegexp({signed:f.eSigned})+")";return""});a=a+b;if(b)a="(?:(?:"+a+")|(?:"+b+"))";return a+c};d.number._integerRegexp=function(f){f=f||{};if(!("signed"in f))f.signed=[true,false];if("separator"in f){if(!("groupSize"in f))f.groupSize=3}else f.separator=
"";var a=d.regexp.buildGroupRE(f.signed,function(c){return c?"[-+]":""},true),b=d.regexp.buildGroupRE(f.separator,function(c){if(!c)return"(?:\\d+)";c=d.regexp.escapeString(c);if(c==" ")c="\\s";else if(c=="\u00a0")c="\\s\\xa0";var e=f.groupSize,g=f.groupSize2;if(g){c="(?:0|[1-9]\\d{0,"+(g-1)+"}(?:["+c+"]\\d{"+g+"})*["+c+"]\\d{"+e+"})";return e-g>0?"(?:"+c+"|(?:0|[1-9]\\d{0,"+(e-1)+"}))":c}return"(?:0|[1-9]\\d{0,"+(e-1)+"}(?:["+c+"]\\d{"+e+"})*)"},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,f){d.declare("dijit.ProgressBar",[f._Widget,f._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){f.removeWaiState(b,"valuenow");f.removeWaiState(b,"valuemin");f.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}f.setWaiState(b,"describedby",this.labelNode.id);f.setWaiState(b,"valuenow",this.progress);f.setWaiState(b,"valuemin",0);f.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 f.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,f){d.declare("orion.widgets.ImportDialog",[f.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(f.byId("importDialog.uploader"),"onError",d.hitch(this,function(){setTimeout(d.hitch(this,function(){this.hide()}),2E3)}));d.connect(f.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,f){d.declare("dijit.form.ComboBoxMixin",f._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(e){}}return b},_setCaretPos:function(a,b){b=parseInt(b);f.selectInputText(a,b,b)},_setDisabledAttr:function(a){this.inherited(arguments);f.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,e=this.dropDown,g=d.keys,j=null;this._prev_key_backspace=false;this._abortQuery();this.inherited(arguments);if(this._opened)j=e.getHighlightedOption();switch(b){case g.PAGE_DOWN:case g.DOWN_ARROW:case g.PAGE_UP:case g.UP_ARROW:this._opened&&
this._announceOption(j);d.stopEvent(a);break;case g.ENTER:if(j)if(j==e.nextButton){this._nextSearch(1);d.stopEvent(a);break}else{if(j==e.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(e&&(b==e._messages.previousMessage||b==e._messages.nextMessage))break;j&&this._selectOption();if(this._opened){this._lastQuery=
null;this.closeDropDown()}break;case " ":if(j){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;f.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;f.selectInputText(b,c)}}else{b.value=a;f.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();f.setWaiState(this.domNode,"expanded",
"true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return false},closeDropDown:function(){this._abortQuery();if(this._opened){this.inherited(arguments);f.setWaiState(this.domNode,"expanded","false");f.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&&f.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 e=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):c;this._set("item",a);f.form.ComboBox.superclass._setValueAttr.call(this,e,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);f.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);
f.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});f.removeWaiState(this.focusNode,
"activedescendant");f.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,e){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){e._fetchHandle=null;console.error("dijit.form.ComboBox: "+g);e.closeDropDown()},start:0,count:this.pageSize};
d.mixin(c,e.fetchProperties);this._fetchHandle=e.store.fetch(c);this._nextSearch=this.dropDown.onPage=d.hitch(this,function(g,j){g.start+=g.count*j;g.direction=j;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 f.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";f.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":""),e=this.queryExpr.indexOf("${0}");b=d.regexp.escapeString(b);return this._escapeHtml(a).replace(new RegExp((e==0?"^":"")+"("+b+")"+(e==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",[f._Widget,f._Templated,f._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,j){g=this._createOption(g,c);d.attr(g,"id",this.id+j);this.domNode.insertBefore(g,
this.nextButton)},this);var e=false;if(b._maxOptions&&b._maxOptions!=-1)if(b.start+b.count<b._maxOptions)e=true;else{if(b.start+b.count>b._maxOptions&&b.count==a.length)e=true}else if(b.count==a.length)e=true;this.nextButton.style.display=e?"":"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,e=d.style(this.domNode,"height");for(this.getHighlightedOption()||this._highlightNextOption();b<e;){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",[f.form.ValidationTextBox,f.form.ComboBoxMixin],{_setValueAttr:function(a,b,c){this._set("item",null);a||(a="");f.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),e=d.query("> option",this.root).filter(function(g){return(g.innerText||g.textContent||"").match(c)});a.sort&&e.sort(d.data.util.sorter.createSortFunction(a.sort,this));b(e,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(f.form._ComboBoxDataStore,d.data.util.simpleFetch);return f.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,f){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",
[f.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 e=a[1].substring(0,c);a=a[1].substring(c);this.options.func(e,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,e=0;e<b.items.length;e++)if(b.items[e].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,f,a,b,c,e,g){var j={};j._cloneItemWithoutChildren=function i(k){if(k===null||typeof k!=="object")return k;var m=k.constructor();for(var p in k)if(p!=="children"&&p!=="Children")m[p]=i(k[p]);return m};j._createOpenWithCommands=
function(i,k){function m(){for(var s=i.getServiceReferences("orion.edit.editor"),z=[],C=0;C<s.length;C++){var B=s[C],E=B.getProperty("id");z.push({id:E,name:B.getProperty("name"),uriTemplate:new g(B.getProperty("orionTemplate")||B.getProperty("uriTemplate"))})}return z}function p(s,z){s=s.map(function(C){return c.escape(C)});z=z.map(function(C){return c.escape(C)});s=s.length&&"(*\\.("+s.join("|")+")$)";z=z.length&&"(^("+z.join("|")+")$)";return s&&z?s+"|"+z:s?s:z?z:null}function w(s,z){s=s.getServiceReferences("orion.navigate.openWith");
for(var C=[],B=0;B<s.length;B++){var E=s[B];if(E.getProperty("editor")===z.id){E=E.getProperty("contentType");if(E instanceof Array)C=C.concat(E);else E!==null&&typeof E!=="undefined"&&C.push(E)}}return C}function t(s){for(s=s.getServiceReferences("orion.navigate.openWith.default");0<s.length;)return{editor:s[0].getProperty("editor")};return null}for(var u=m(),v=t(i),x=[],n=0;n<u.length;n++){var r=u[n],y=v&&v.editor===r.id,A=w(i,r);if(A.length){for(var h=[],l=[],o=0;o<A.length;o++){var q=k[A[o]];
if(q){h=h.concat(q.extension);l=l.concat(q.filename)}}A=r.uriTemplate;h={Directory:false,Name:p(h,l)};r={name:r.name||r.id,id:"eclipse.openWithCommand."+r.id,tooltip:r.name,validationProperties:h,href:true,forceSingleItem:true,isEditor:y?"default":"editor"};y={run:f.hitch(A,A.expand)};x.push({properties:r,service:y})}}return x};j._makeValidationFunction=function(i,k){function m(t){for(var u="^",v=0;v<t.length;v++){var x=t.charAt(v);switch(x){case "?":u+=".";break;case "*":u+=".*";break;default:u+=
x}}u+="$";return new RegExp(u)}function p(t,u,v){var x,n;if(u.indexOf(":")>=0){x=m(u.substring(0,u.indexOf(":")));var r=u.substring(u.indexOf(":")+1);for(n in t)if(x.test(n))if(p(t[n],r,v))return true}x=m(u);for(n in t)if(x.test(n))if(typeof v==="string"){if(m(v).test(t[n]))return true}else if(v===t[n])return true;return false}function w(t,u){for(var v in u)if(!p(t,v,u[v]))return false;return true}return f.hitch(i,function(t){if(typeof k==="function")t=k(t);if(f.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 u in t)if(!w(t[u],this.validationProperties))return false;return true})};j._createCommandOptions=function(i,k,m,p,w){var t={name:i.name,image:i.image,id:i.id||i.name,tooltip:i.tooltip,isEditor:i.isEditor};t.visibleWhen=j._makeValidationFunction(i,w);if(p)if(i.href)t.hrefCallback=f.hitch(i,function(u){u=f.isArray(u.items)?u.items[0]:u.items;u=j._cloneItemWithoutChildren(u);
if(k.run)return k.run(u);else if(m)return m.getService(k).run(u)});else t.callback=f.hitch(i,function(u){var v;if(this.forceSingleItem){u=f.isArray()?u.items[0]:u.items;v=j._cloneItemWithoutChildren(u)}else if(f.isArray(u.items)){v=[];for(var x=0;x<u.items.length;x++)v.push(j._cloneItemWithoutChildren(u.items[x]))}else v=j._cloneItemWithoutChildren(u.items);if(k.run)k.run(v);else m&&m.getService(k).run(v)});return t};j.getOpenWithCommands=function(i){var k=[];for(var m in i._objectScope){var p=i._objectScope[m];
p.isEditor&&k.push(p)}return k};return j});
define("orion/textview/keyBinding",[],function(){function d(a,b,c,e,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=e!==undefined&&e!==null?e:false;this.mod4=g!==undefined&&g!==null?g:false}var f=window.navigator.platform.indexOf("Mac")!==-1;d.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(f?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;
if(this.mod3!==a.altKey)return false;if(f&&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,f,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=
f.isArray(c)?c:[c];for(var e=0;e<c.length;e++){var g=c[e],j=g.ChildrenLocation?g.ChildrenLocation:g.Location;j=a.makeRelative(j);this.addFavorite(g.Name,j,g.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,false,true)},addFavorite:function(c,e,g,j){this._favorites.push({name:c,path:e,directory:g,isFavorite:true,isExternalResource:j});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var e in this._favorites)if(this._favorites[e].path===
c){this._favorites.splice(e,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,e){var g=false;for(var j in this._favorites)if(this._favorites[j].path===c){var i=this._favorites[j];if(i.name!==e){i.name=e;g=true}}if(g){this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(c,e){this._searches.push({name:c,query:e,isSearch:true});this._searches.sort(this._sorter);this._storeSearches();
this._notifyListeners()},hasFavorite:function(c){for(var e in this._favorites)if(this._favorites[e].path===c)return true;return false},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var e;if(!c)return this._favorites;var g="";for(e=0;e<c.length;e++){var j=c.charAt(e);g+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}g+=".*";c=new RegExp(g);g=[];for(e in this._favorites)this._favorites[e].name.search(c)===0&&g.push(this._favorites[e]);return g},removeSearch:function(c){for(var e in this._searches)if(this._searches[e].query===
c){this._searches.splice(e,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(c,e){var g=false;for(var j in this._searches)if(this._searches[j].query===c){var i=this._searches[j];if(i.name!==e){i.name=e;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(e){var g,
j=e.get("navigate");if(typeof j==="string")j=JSON.parse(j);if(j)for(g in j){j[g].isFavorite=true;c._favorites.push(j[g])}e=e.get("search");if(typeof e==="string")e=JSON.parse(e);if(e)for(g in e){e[g].isSearch=true;c._searches.push(e[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(e){e.put("navigate",c)})},_storeSearches:function(){var c=this._searches;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("search",c)})},_sorter:function(c,e){c=c.name.toLowerCase();e=e.name.toLowerCase();return c>e?1:c<e?-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,f,a){return f.declare("orion.widgets.OpenResourceDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.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);f.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(f.hitch(this,this.checkSearch),0)});f.connect(this.resourceName,"onKeyPress",this,function(b){if(b.keyCode===
f.keys.ENTER&&this.results){b=f.query("a",this.results);if(b.length>0){window.open(b[0].href);this.hide()}}});f.connect(this,"onKeyPress",this,function(b){var c,e,g,j,i;g=function(m,p,w){return p<m.length-1?m[p+1]:w};var k=function(m,p,w){return p>0?m[p-1]:w};if(b.keyCode===f.keys.DOWN_ARROW||b.keyCode===f.keys.UP_ARROW){e=f.query("a",this.results);c=f.query("a",this.favresults);j=a.getFocus();i=e.indexOf(j.node);j=c.indexOf(j.node);if(b.keyCode===f.keys.DOWN_ARROW)if(j>=0)a.focus(g(c,j,e.length>
0?e[0]:c[0]));else if(i>=0)a.focus(g(e,i,c.length>0?c[0]:e[0]));else{if(e.length>0||c.length>0)a.focus(g(c,-1,e[0]))}else if(j>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(c,j,g))}else if(i>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(e,i,c.length>0?c[c.length-1]:g))}else if(e.length>0)a.focus(e[e.length-1]);else c.length>0&&a.focus(c[c.length-1]);f.stopEvent(b)}});f.connect(this,"onMouseUp",function(b){b.target.focus()});this.populateFavorites()},populateFavorites:function(){f.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,f.hitch(b,b.decorateResult),b.showFavoritesImage)(c);c&&c.length>0&&f.place("<hr/>",b.favresults,"last")}},showFavoritesImage:function(b){var c=new Image;f.addClass(c,"commandSprite");f.addClass(c,"core-sprite-makeFavorite");
f.addClass(c,"commandImage");c.src=d.toUrl("images/none.png");c.title="Favorite";b.appendChild(c);f.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(f.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){f.place("<div>Searching&#x2026;</div>",
this.results,"only");var e=this;setTimeout(function(){var g=e.searcher.createSearchQuery(null,b,"Name"),j=e.searchRenderer.makeRenderFunction(e.results,false,f.hitch(e,e.decorateResult));e.searcher.search(g,false,j)},0)}},decorateResult:function(b){var c=this;f.query("a",b).forEach(function(e){f.connect(e,"onmouseup",function(g){!f.mouseButtons.isMiddle(g)&&!f.isCopyKey(g)&&c.hide()});f.connect(e,"onkeyup",c,function(g){g.keyCode===f.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,f,a){f.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:f.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;f.addClass(this.closeLink,"imageSprite");f.addClass(this.closeLink,"core-sprite-close");f.connect(this.closeLink,"onmouseover",this.closeLink,function(){b.closeLink.style.cursor="pointer"});f.connect(this.closeLink,"onmouseout",this.closeLink,function(){b.closeLink.style.cursor="default"});f.connect(this.closeLink,"onclick",function(){f.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,e,g){if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:e,data:g}}else{this.authenticatedServices[b]&&delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:e,pending:this.unauthenticatedServices[b].pending}:
{authService:c,label:e}}f.hitch(this,this.renderAuthenticatedServices)();f.hitch(this,this.renderUnauthenticatedServices)()},renderAuthenticatedServices:function(){f.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var b=this,c=true;for(var e in this.authenticatedServices){if(!c){var g=f.create("tr",null,this.authenticatedList);f.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=f.create("tr",{className:"navTableHeading"});var j=this.authenticatedServices[e].authService,i=f.create("td",null,g,"only"),k=f.create("h2",null,i,"only");if(j)if(j.getAuthForm)f.hitch(b,function(w,t){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(u){if(b.authenticatedServices[t].label)w.innerHTML=b.authenticatedServices[t].label+"<br>";w.innerHTML+=b.getHostname(u)})})(k,e);else k.innerHTML=this.authenticatedServices[e].label?this.authenticatedServices[e].label:
e;else{var m=this.authenticatedServices[e].SignInLocation;if(this.authenticatedServices[e].label)k.innerHTML=this.authenticatedServices[e].label+"<br>";k.innerHTML+=this.getHostname(m)}f.addClass(i,"LoginWindowLeft");i=f.create("td",{style:"text-align: right"},g,"last");f.addClass(i,"LoginWindowRight");k=this.authenticatedServices[e].data;j=this.authenticatedServices[e].authService;if(!j){f.place(g,this.authenticatedList,"last");return}k.Location&&f.create("a",{href:d.toUrl("profile/user-profile.html")+
"#"+k.Location,innerHTML:"Profile"},i,"last");f.place(document.createTextNode(" "),i,"last");if(j.logout){var p=f.create("a",{innerHTML:"Sign out"},i,"last");f.connect(p,"onmouseover",p,function(){p.style.cursor="pointer"});f.connect(p,"onmouseout",p,function(){p.style.cursor="default"});f.connect(p,"onclick",f.hitch(b,function(w,t){return function(){w.logout().then(f.hitch(b,function(){this.addUserItem(t,w,this.authenticatedServices[t].label);this.isSingleService()&&this.closeDialog();localStorage.removeItem(t)}))}})(j,
e))}f.place(g,this.authenticatedList,"last");i="N/A";if(k&&k.lastlogintimestamp)i=f.date.locale.format(new Date(k.lastlogintimestamp),{formatLength:"short"});k=k.Name&&k.Name.replace(/^\s+|\s+$/g,"")!==""?k.Name:k.login;g=f.create("tr");i=k.length>40?f.create("td",{innerHTML:k.substring(0,30)+"... logged in since "+i,colspan:2,title:k+" logged in since "+i},g,"only"):f.create("td",{innerHTML:k+" logged in since "+i,colspan:2},g,"only");f.addClass(i,"LoginWindowLeft");f.addClass(i,"LoginWindowRight");
f.addClass(i,"LoginWindowComment");f.place(g,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){this.emptyListInfo.style.display=this.unauthenticatedServices.length===0&&this.authenticatedServices.length===0?"":"none";f.empty(this.otherUnauthenticatedList);var b=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var c=true;for(var e in this.unauthenticatedServices){if(!c||!this.isEmpty(this.authenticatedServices)){var g=f.create("tr",
null,this.otherUnauthenticatedList);f.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=f.create("tr",{className:"navTableHeading"});var j=f.create("td",null,g,"only");f.addClass(j,"LoginWindowLeft");var i=f.create("h2",null,j,"only");j=f.create("td",{style:"text-align: right"},g,"last");f.addClass(j,"LoginWindowRight");var k=this.unauthenticatedServices[e].authService;
if(k)if(k.getAuthForm)f.hitch(b,function(w,t){k.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(u){u.indexOf("?")==-1?f.create("a",{target:"_blank",href:u+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},w,"last"):f.create("a",{target:"_blank",href:u+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},w,"last");if(b.unauthenticatedServices[t].label)i.innerHTML=b.unauthenticatedServices[t].label+
"<br>";i.innerHTML+=b.getHostname(u)})})(j,e);else{if(k.login){f.place(document.createTextNode(this.unauthenticatedServices[e].label?this.unauthenticatedServices[e].label:e),i,"only");var m=f.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},j,"last");f.connect(m,"onmouseover",m,function(){m.style.cursor="pointer"});f.connect(m,"onmouseout",m,function(){m.style.cursor="default"});f.connect(m,"onclick",f.hitch(b,function(w){return function(){w.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){b.isSingleService()&&
a.popup.hide&&a.popup.hide(b);a.popup.close(b)})}})(k))}}else{var p=this.unauthenticatedServices[e].SignInLocation;p.indexOf("?")==-1?f.create("a",{target:"_blank",href:p+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+e,innerHTML:"Sign in"},j,"last"):f.create("a",{target:"_blank",href:p+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+e,innerHTML:"Sign in"},j,"last");if(this.unauthenticatedServices[e].label)i.innerHTML=this.unauthenticatedServices[e].label+
"<br>";i.innerHTML+=this.getHostname(p)}f.place(g,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[e].pending){g=f.create("tr");j=f.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},g,"only");f.addClass(j,"LoginWindowLeft");f.addClass(j,"LoginWindowRight");f.create("img",{src:d.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},j,"first");f.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 e in b)b.hasOwnProperty(e)&&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,f,a){f.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 e in b)b.hasOwnProperty(e)&&c++;return c},_renderAuthenticatedService:function(b,c,e){var g=this,j=this.authenticatedServices[b].authService;if(j&&j.logout)this.addChild(new a.MenuItem({label:e?"Sign Out "+e:"Sign Out",onClick:f.hitch(this,function(i,k){return function(){i.logout().then(f.hitch(g,function(){this.addUserItem(k,i,this.authenticatedServices[k].label);localStorage.removeItem(k)}))}})(j,b)}),c)},_renderUnauthenticatedService:function(b,
c,e){var g=this,j=this.unauthenticatedServices[b].authService;if(j)if(j.getAuthForm)f.hitch(g,function(k){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;g.addChild(new a.MenuItem({label:e?"<a target='_blank' href="+m+">Sign In To "+e+"</a>":"<a target='_blank' href="+m+">Sign In</a>",onKeyDown:function(p){p.keyCode===
13&&window.open(m)},_onClick:function(p){this.getParent().onItemClick(this,p)}}),c)})})(b);else{if(j.login)this.addChild(new a.MenuItem({label:e?"Sign In To "+e:"Sign In",onClick:f.hitch(g,function(k){return function(){k.login(eclipse.globalCommandUtils.notifyAuthenticationSite)}})(j)}),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:e?"<a target='_blank' href="+i+">Sign In To "+e+"</a>":"<a target='_blank' href="+i+">Sign In</a>",onKeyDown:function(k){k.keyCode===13&&window.open(i)},_onClick:function(k){this.getParent().onItemClick(this,k)}}),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(e){if(e.keyCode===13)window.location=d.toUrl("settings/settings.html")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));this.addChild(new a.MenuItem({label:"<a href="+d.toUrl("operations/list.html")+">Background Operations</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("operations/list.html")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));this.addChild(new a.MenuSeparator);this.addChild(new a.MenuItem({label:"<a href="+
d.toUrl("help/index.jsp")+">Help</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("help/index.jsp")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));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(e){if(e.keyCode===13)window.location=d.toUrl("help/about.html")},_onClick:function(e){this.getParent().onItemClick(this,
e)}}))},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,e,g){var j=this;if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:e,data:g}}else{this.authenticatedServices[b]&&
delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:e,pending:this.unauthenticatedServices[b].pending}:{authService:c,label:e}}f.hitch(this,this.renderServices)();if(f.byId("userInfo"))if(this.isSingleService()&&g){e=b=g.Name&&g.Name.replace(/^\s+|\s+$/g,"")!==""?g.Name:g.login;if(e.length>40)e=e.substring(0,30)+"...";f.create("a",{innerHTML:e,href:d.toUrl("profile/user-profile.html")+"#"+g.Location,title:"View profile of "+b,style:"margin-right: 0px"},
f.byId("userInfo"),"only")}else if(this.isSingleService()&&!g)if(c.getAuthForm)f.hitch(this,function(k){c.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;f.create("a",{innerHTML:"Sign In",href:m,title:"Sign In",style:"margin-right: 0px",target:"_blank"},f.byId("userInfo"),"only")})})(b);else{if(c.login){var i=
f.create("a",{innerHTML:"Sign In",title:"Sign In",style:"margin-right: 0px"},f.byId("userInfo"),"only");f.connect(i,"onmouseover",i,function(){i.style.cursor="pointer"});f.connect(i,"onmouseout",i,function(){i.style.cursor="default"});f.connect(i,"onclick",function(){c.login(eclipse.globalCommandUtils.notifyAuthenticationSite)})}}else if(this.hasServices()){i=f.create("a",{innerHTML:"Profiles",style:"margin-right: 0px"},f.byId("userInfo"),"only");f.connect(i,"onmouseover",i,function(){i.style.cursor=
"pointer"});f.connect(i,"onmouseout",i,function(){i.style.cursor="default"});f.connect(i,"onclick",function(){try{a.popup.open({popup:j.options.loginDialog,around:f.byId("userInfo")})}catch(k){}a.focus(j.options.loginDialog.domNode)})}else f.empty(f.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,f,a,b,c,e,g,j,i,k){function m(L){var P=document.createElement("a");P.href=L;return P.href}function p(L,P){if(L.getLabel)return L.getLabel();
else{L=new f.Deferred;L.callback(P.properties.name);return L}}function w(){return E}function t(L){(L=L.getService("orion.page.progress"))&&f.hitch(L,L.init)("progressPane")}function u(L){var P=L.getServiceReferences("orion.core.auth");E=[];var S=f.byId("userMenu");if(S){if(!a.byId("logins")){var D=new a.form.DropDownButton({id:"logins",dropDown:B,label:"Options",showLabel:false,alt:"Options"});f.place(D.domNode,S,"only");D.valueNode&&f.destroy(D.valueNode)}for(S=0;S<P.length;S++){D=P[S];var F=L.getService(D);
f.hitch(this,function(J,Q){p(J,Q).then(function(T){J.getKey().then(function(U){E.push(U);J.getUser().then(function(W){C.addUserItem(U,J,T,W);B.addUserItem(U,J,T,W)},function(){C.addUserItem(U,J,T);B.addUserItem(U,J,T,jsonData)});window.addEventListener("storage",function(){if(z[U]!==localStorage.getItem(U)){z[U]=localStorage.getItem(U);J.getUser().then(function(W){C.addUserItem(U,J,T,W);B.addUserItem(U,J,T,W)},function(){C.addUserItem(U,J,T);B.addUserItem(U,J,T)})}},false)})})})(F,D)}}}function v(L){C.setPendingAuthentication(L);
var P;for(P in L)if(L.hasOwnProperty(P)){if(f.byId("userInfo").innerHTML)try{a.popup.open({popup:C,around:f.byId("userInfo")})}catch(S){}else window.setTimeout(function(){try{a.popup.open({popup:C,around:f.byId("userInfo")})}catch(D){}},500);return}a.popup.hide&&a.popup.hide(C);a.popup.close(C)}function x(L){C.authenticatedService(L)}function n(L,P,S,D,F,J,Q){L.closeParameterCollector();if(J=f.byId("pageActions")){f.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=f.byId("pageNavigationActions")){f.empty(J);L.renderCommands(J,"dom",F||S||P,D||P,"button")}}function r(){if(f.byId("relatedLinks")){if(G){G.focusedChild=null;f.forEach(G.getChildren(),function(L){G.removeChild(L);L.destroy()});G.destroy()}return G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"})}}function y(L,P){G||(G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"}));L._addMenuItem(G,P);L=a.byId("related");if((P=f.byId("relatedLinks"))&&
!L){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:G});f.place(L.domNode,P,"only");j.forceLayout(P)}}function A(L,P,S,D,F){var J=L.getServiceReferences("orion.page.link.related");if(!(J.length<=0)){var Q=f.byId("relatedLinks");if(Q){for(var T=r(),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(f.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(f.hitch(Z,function(){f.when(F(),f.hitch(this,function(la){la&&P===M&&this.visibleWhen(la)&&y(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});f.place(L.domNode,Q,"only")}j.forceLayout(Q)}}}function h(L,P,S){var D=f.byId("globalActions");if(D){f.empty(D);S=(S=f.isArray(S)?S[0]:S)||P||{};L.renderCommands(D,"global",S,P,"tool")}}function l(L){H=L}function o(L,P,S,D,F){M=L;A(P,L,H,S,D);N=F}function q(L,P,S,D,F,J,Q,T){function U(){var I=P.getService("orion.core.favorite");if(!I){I=new k.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=f.byId(L);if(!aa)throw"could not find banner parent, id was "+L;f.place(b.topHTMLFragment,aa,"only");if(L=f.byId("pageToolbar")){f.place(b.toolbarHTMLFragment,L,"only");f.addClass(L,"toolComposite")}else{L=f.create("div",{id:"pageToolbar","class":"toolbar toolComposite layoutBlock"},"titleArea","after");f.place(b.toolbarHTMLFragment,L,"only")}S.setParameterCollector(new e.CommandParameterCollector);
f.place('<div id="keyAssist" style="display: none" class="keyAssistFloat" role="list" aria-atomic="true" aria-live="assertive"></div>',document.body,"last");if(L=f.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=f.create("a",{href:W.href},L,"last");W=document.createTextNode(W.name);f.place(W,ca,"only")}}}var fa=f.byId("search");if(!fa)throw"failed to generate HTML for banner";
f.connect(fa,"onkeypress",function(I){if(I.charOrCode===f.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=f.byId("pageTitle")){W=document.createTextNode(document.title);f.place(W,L,"last")}if(L=f.byId("pageFavorite")){f.addClass(L,"commandButton");f.connect(L,"onclick",this,function(){U()});f.connect(L,"onkeypress",this,function(I){if(I.keyCode===f.keys.ENTER||
I.keyCode===f.keys.SPACE)U()});f.connect(L,"onmouseover",L,function(){f.addClass(this,"commandButtonOver")});f.connect(L,"onfocus",L,function(){f.addClass(this,"commandButtonOver")});f.connect(L,"onmouseout",L,function(){f.removeClass(this,"commandButtonOver")});f.connect(L,"onblur",L,function(){f.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=f.isArray(I)?I:[I];for(var O=0;O<I.length;O++)if(!I[O].Location)return false;return true},callback:function(I){I=f.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 k.FavoritesService({serviceRegistry:O});V=O.getService("orion.core.favorite")}var X=new orion.widgets.OpenResourceDialog({searcher:I,searchRenderer:I.defaultRenderer,favoriteService:V});R&&f.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=f.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=f.byId("keyAssist");f.connect(document,"onkeypress",f.hitch(this,function(I){if(I.charOrCode===f.keys.ESCAPE)K.style.display="none"}));f.connect(document,"onclick",f.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"){f.empty(K);if(Q){f.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++)f.place('<span role="listitem">'+j.getUserKeyString(V[X])+" = "+R+"<br></span>",K,"last")}f.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)}B.setKeyAssist(T.callback);h(S,J,M);if(f.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")}});u(P);if(b.bottomHTMLFragment)(J=f.byId("footer"))&&f.place(b.bottomHTMLFragment,J,"only");t(P);j.forceLayout(aa.parentNode);
f.subscribe("/dojo/hashchange",S,function(){S.processURL(window.location.href)})}var s=m(d.toUrl("auth/NotifyAuthentication.html")),z={},C=new orion.widgets.LoginDialog,B=new orion.widgets.UserMenu({loginDialog:C}),E=[],G,M,H=[],N=null;return{generateUserInfo:u,generateRelatedLinks:A,generateDomCommandsInBanner:n,generateBanner:q,notifyAuthenticationSite:s,setPendingAuthentication:v,getAuthenticationIds:w,setPageTarget:o,setPageCommandExclusions:l,authenticatedService:x}});
define("dojo/date",["dojo"],function(d){d.getObject("date",true,d);d.date.getDaysInMonth=function(f){var a=f.getMonth();if(a==1&&d.date.isLeapYear(f))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};d.date.isLeapYear=function(f){f=f.getFullYear();return!(f%400)||!(f%4)&&!!(f%100)};d.date.getTimezoneName=function(f){var a=f.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=f.toLocaleString();c=/ ([A-Z\/]+)$/;
if(a=a.match(c))b=a[1]}}return b=="AM"||b=="PM"?"":b};d.date.compare=function(f,a,b){f=new Date(+f);a=new Date(+(a||new Date));if(b=="date"){f.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(b=="time"){f.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(f>a)return 1;if(f<a)return-1;return 0};d.date.add=function(f,a,b){var c=new Date(+f),e=false,g="Date";switch(a){case "day":break;case "weekday":var j;if(a=b%5){a=a;j=parseInt(b/5)}else{a=b>0?5:-5;j=b>0?(b-5)/5:(b+5)/5}var i=f.getDay(),k=0;if(i==6&&b>0)k=1;
else if(i==0&&b<0)k=-1;i=i+a;if(i==0||i==6)k=b>0?2:-2;b=7*j+a+k;break;case "year":g="FullYear";e=true;break;case "week":b*=7;break;case "quarter":b*=3;case "month":e=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&c["set"+g](c["get"+g]()+b);e&&c.getDate()<f.getDate()&&c.setDate(0);return c};d.date.difference=function(f,a,b){a=a||new Date;b=b||"day";var c=a.getFullYear()-f.getFullYear(),e=1;switch(b){case "quarter":f=f.getMonth();a=a.getMonth();f=Math.floor(f/3)+
1;a=Math.floor(a/3)+1;a+=c*4;e=a-f;break;case "weekday":c=Math.round(d.date.difference(f,a,"day"));b=parseInt(d.date.difference(f,a,"week"));e=c%7;if(e==0)c=b*5;else{var g=0,j=f.getDay();a=a.getDay();b=parseInt(c/7);e=c%7;f=new Date(f);f.setDate(f.getDate()+b*7);f=f.getDay();if(c>0)switch(true){case j==6:g=-1;break;case j==0:g=0;break;case a==6:g=-1;break;case a==0:g=-2;break;case f+e>5:g=-2}else if(c<0)switch(true){case j==6:g=0;break;case j==0:g=1;break;case a==6:g=2;break;case a==0:g=1;break;case f+
e<0:g=2}c+=g;c-=b*2}e=c;break;case "year":e=c;break;case "month":e=a.getMonth()-f.getMonth()+c*12;break;case "week":e=parseInt(d.date.difference(f,a,"day")/7);break;case "day":e/=24;case "hour":e/=60;case "minute":e/=60;case "second":e/=1E3;case "millisecond":e*=a.getTime()-f.getTime()}return Math.round(e)};return d.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(d){d.getObject("cldr.supplemental",true,d);d.cldr.supplemental.getFirstDayOfWeek=function(f){f={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(f)];return f===undefined?
1:f};d.cldr.supplemental._region=function(f){f=d.i18n.normalizeLocale(f);f=f.split("-");var a=f[1];if(a){if(a.length==4)a=f[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"}[f[0]];return a};d.cldr.supplemental.getWeekend=function(f){var a=d.cldr.supplemental._region(f);f={"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(f===undefined)f=6;if(a===undefined)a=0;return{start:f,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 f(c,e,g,j){return j.replace(/([a-z])\1*/ig,function(i){var k,m,p=i.charAt(0);i=i.length;var w=["abbr","wide","narrow"];switch(p){case "G":k=e[i<4?"eraAbbr":"eraNames"][c.getFullYear()<0?0:1];break;case "y":k=c.getFullYear();switch(i){case 1:break;case 2:if(!g.fullYear){k=String(k);k=k.substr(k.length-
2);break}default:m=true}break;case "Q":case "q":k=Math.ceil((c.getMonth()+1)/3);m=true;break;case "M":k=c.getMonth();if(i<3){k=k+1;m=true}else{p=["months-format",w[i-3]].join("-");k=e[p][k]}break;case "w":k=d.date.locale._getWeekOfYear(c,0);m=true;break;case "d":k=c.getDate();m=true;break;case "D":k=d.date.locale._getDayOfYear(c);m=true;break;case "E":k=c.getDay();if(i<3){k=k+1;m=true}else{p=["days-format",w[i-3]].join("-");k=e[p][k]}break;case "a":k=c.getHours()<12?"am":"pm";k=g[k]||e["dayPeriods-format-wide-"+
k];break;case "h":case "H":case "K":case "k":m=c.getHours();switch(p){case "h":k=m%12||12;break;case "H":k=m;break;case "K":k=m%12;break;case "k":k=m||24;break}m=true;break;case "m":k=c.getMinutes();m=true;break;case "s":k=c.getSeconds();m=true;break;case "S":k=Math.round(c.getMilliseconds()*Math.pow(10,i-3));m=true;break;case "v":case "z":if(k=d.date.locale._getZone(c,true,g))break;i=4;case "Z":k=d.date.locale._getZone(c,false,g);k=[k<=0?"+":"-",d.string.pad(Math.floor(Math.abs(k)/60),2),d.string.pad(Math.abs(k)%
60,2)];if(i==4){k.splice(0,0,"GMT");k.splice(3,0,":")}k=k.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+j);}if(m)k=d.string.pad(k,i);return k})}function a(c,e,g,j){var i=function(p){return p};e=e||i;g=g||i;j=j||i;var k=c.match(/(''|[^'])+/g),m=c.charAt(0)=="'";d.forEach(k,function(p,w){if(p){k[w]=(m?g:e)(p.replace(/''/g,"'"));m=!m}else k[w]=""});return j(k.join(""))}function b(c,e,g,j){j=d.regexp.escapeString(j);g.strict||(j=j.replace(" a"," ?a"));return j.replace(/([a-z])\1*/ig,
function(i){var k;k=i.charAt(0);var m=i.length,p="",w="";if(g.strict){if(m>1)p="0{"+(m-1)+"}";if(m>2)w="0{"+(m-2)+"}"}else{p="0?";w="0{0,2}"}switch(k){case "y":k="\\d{2,4}";break;case "M":k=m>2?"\\S+?":"1[0-2]|"+p+"[1-9]";break;case "D":k="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+w+"[1-9][0-9]|"+p+"[1-9]";break;case "d":k="3[01]|[12]\\d|"+p+"[1-9]";break;case "w":k="[1-4][0-9]|5[0-3]|"+p+"[1-9]";break;case "E":k="\\S+";break;case "h":k="1[0-2]|"+p+"[1-9]";break;case "k":k="1[01]|"+p+"\\d";break;case "H":k=
"1\\d|2[0-3]|"+p+"\\d";break;case "K":k="1\\d|2[0-4]|"+p+"[1-9]";break;case "m":case "s":k="[0-5]\\d";break;case "S":k="\\d{"+m+"}";break;case "a":m=g.am||e["dayPeriods-format-wide-am"];p=g.pm||e["dayPeriods-format-wide-pm"];k=m+"|"+p;if(!g.strict){if(m!=m.toLowerCase())k+="|"+m.toLowerCase();if(p!=p.toLowerCase())k+="|"+p.toLowerCase();if(k.indexOf(".")!=-1)k+="|"+k.replace(/\./g,"")}k=k.replace(/\./g,"\\.");break;default:k=".*"}c&&c.push(i);return"("+k+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}d.date.locale._getZone=
function(c,e){return e?d.date.getTimezoneName(c):c.getTimezoneOffset()};d.date.locale.format=function(c,e){e=e||{};var g=d.i18n.normalizeLocale(e.locale),j=e.formatLength||"short";g=d.date.locale._getGregorianBundle(g);var i=[];c=d.hitch(this,f,c,g,e);if(e.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",c);var k;if(e.selector!="date")(k=e.timePattern||g["timeFormat-"+j])&&i.push(a(k,c));if(e.selector!="time")(k=e.datePattern||g["dateFormat-"+j])&&i.push(a(k,c));return i.length==1?i[0]:
g["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(m,p){return i[p]})};d.date.locale.regexp=function(c){return d.date.locale._parseInfo(c).regexp};d.date.locale._parseInfo=function(c){c=c||{};var e=d.i18n.normalizeLocale(c.locale);e=d.date.locale._getGregorianBundle(e);var g=c.formatLength||"short",j=c.datePattern||e["dateFormat-"+g],i=c.timePattern||e["timeFormat-"+g];g=c.selector=="date"?j:c.selector=="time"?i:e["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(m,p){return[i,j][p]});var k=[];
return{regexp:a(g,d.hitch(this,b,k,e,c)),tokens:k,bundle:e}};d.date.locale.parse=function(c,e){var g=/[\u200E\u200F\u202A\u202E]/g,j=d.date.locale._parseInfo(e),i=j.tokens,k=j.bundle;c=(new RegExp("^"+j.regexp.replace(g,"")+"$",j.strict?"":"i")).exec(c&&c.replace(g,""));if(!c)return null;var m=["abbr","wide","narrow"],p=[1970,0,1,0,0,0,0],w="";c=d.every(c,function(u,v){if(!v)return true;v=i[v-1];var x=v.length;switch(v.charAt(0)){case "y":if(x!=2&&e.strict)p[0]=u;else if(u<100){u=Number(u);x=""+(new Date).getFullYear();
v=x.substring(0,2)*100;x=Math.min(Number(x.substring(2,4))+20,99);p[0]=u<x?v+u:v-100+u}else{if(e.strict)return false;p[0]=u}break;case "M":if(x>2){v=k["months-format-"+m[x-3]].concat();if(!e.strict){u=u.replace(".","").toLowerCase();v=d.map(v,function(r){return r.replace(".","").toLowerCase()})}u=d.indexOf(v,u);if(u==-1)return false}else u--;p[1]=u;break;case "E":case "e":v=k["days-format-"+m[x-3]].concat();if(!e.strict){u=u.toLowerCase();v=d.map(v,function(r){return r.toLowerCase()})}u=d.indexOf(v,
u);if(u==-1)return false;break;case "D":p[1]=0;case "d":p[2]=u;break;case "a":v=e.am||k["dayPeriods-format-wide-am"];x=e.pm||k["dayPeriods-format-wide-pm"];if(!e.strict){var n=/\./g;u=u.replace(n,"").toLowerCase();v=v.replace(n,"").toLowerCase();x=x.replace(n,"").toLowerCase()}if(e.strict&&u!=v&&u!=x)return false;w=u==x?"p":u==v?"a":"";break;case "K":if(u==24)u=0;case "h":case "H":case "k":if(u>23)return false;p[3]=u;break;case "m":p[4]=u;break;case "s":p[5]=u;break;case "S":p[6]=u}return true});
g=+p[3];if(w==="p"&&g<12)p[3]=g+12;else if(w==="a"&&g==12)p[3]=0;g=new Date(p[0],p[1],p[2],p[3],p[4],p[5],p[6]);e.strict&&g.setFullYear(p[0]);var t=i.join("");j=t.indexOf("d")!=-1;t=t.indexOf("M")!=-1;if(!c||t&&g.getMonth()>p[1]||j&&g.getDate()>p[2])return null;if(t&&g.getMonth()<p[1]||j&&g.getDate()<p[2])g=d.date.add(g,"hour",1);return g}})();(function(){var f=[];d.date.locale.addCustomFormats=function(a,b){f.push({pkg:a,name:b})};d.date.locale._getGregorianBundle=function(a){var b={};d.forEach(f,
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(f,a,b,c){var e;c=d.date.locale._getGregorianBundle(c);f=[f,b,a];if(b=="standAlone"){b=f.join("-");e=c[b];if(e[0]==1)e=undefined}f[1]="format";return(e||c[f.join("-")]).concat()};d.date.locale.isWeekend=function(f,a){a=d.cldr.supplemental.getWeekend(a);f=(f||new Date).getDay();if(a.end<a.start){a.end+=7;if(f<a.start)f+=7}return f>=
a.start&&f<=a.end};d.date.locale._getDayOfYear=function(f){return d.date.difference(new Date(f.getFullYear(),0,1,f.getHours()),f)+1};d.date.locale._getWeekOfYear=function(f,a){if(arguments.length==1)a=0;var b=(new Date(f.getFullYear(),0,1)).getDay(),c=(b-a+7)%7;c=Math.floor((d.date.locale._getDayOfYear(f)+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,f,a){function b(g,j){if(g.status===403){if(typeof c==="undefined")c=new f.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 k=JSON.parse(g.responseText);if(!k.SignInKey)return k;var m=localStorage.getItem(k.SignInKey),p=function(){var u=localStorage.getItem(k.SignInKey);
if(m!==u){window.removeEventListener("storage",p,false);delete e[k.SignInKey];a.setPendingAuthentication(e);a.authenticatedService(k.SignInKey);j&&j()}};window.addEventListener("storage",p,false);if(k.SignInKey){e[k.SignInKey]=k;a.setPendingAuthentication(e)}}catch(w){}else try{return JSON.parse(g.responseText)}catch(t){return{Message:g.Message,HttpCode:g.status}}}var c,e={};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,f,a){function b(k,m){this._name=k;this._providers=m;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function c(k,m){return{get:function(p,w){if(m===0)return null;p=localStorage.getItem(k+p);if(p===null)return null;p=JSON.parse(p);if(w||m===-1||p._expires&&p._expires>(new Date).getTime()){delete p._expires;return p}return null},set:function(p,w){if(m!==0){if(m!==-1)w._expires=(new Date).getTime()+
1E3*m;if(Object.keys(w).length===0)localStorage.removeItem(k+p);else{var t=JSON.stringify(w);localStorage.setItem(k+p,t);delete w._expires}}},remove:function(p){localStorage.removeItem(k+p)}}}function e(k){this._currentPromises={};this._cache=new c("/orion/preferences/user",0);this._service=null;this.available=function(){if(!this._service){var m=k.getServiceReferences("orion.core.preference.provider");if(m.length>0)this._service=k.getService(m[0])}return!!this._service}}function g(k){this._location=
k;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function j(){this._cache=new c("/orion/preferences/local",-1)}function i(k,m){this._userProvider=new e(k);this._localProvider=new j;m=m||"defaults.pref";if(m.indexOf("://")===-1)m=d.toUrl(m);this._defaultsProvider=new g(m);this._serviceRegistration=k.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var k=[],m=0;m<this._stores.length;++m){var p=this._stores[m];this._dirty.indexOf(p)!==-1&&
k.push(this._providers[m].put(this._name,p))}this._dirty=[];return new f.DeferredList(k)},_scheduleFlush:function(k){this._dirty.indexOf(k)===-1&&this._dirty.push(k);if(!this._flushPending){this._flushPending=true;window.setTimeout(f.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var k=0;k<this._stores.length;++k){var m=this._stores[k];for(var p in m)if(m.hasOwnProperty(p)&&typeof this._cached[p]===
"undefined")this._cached[p]=m[p]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(k){return this._getCached()[k]},put:function(k,m){if(this._stores.length!==0){var p=this._stores[0];if(p[k]!==m){p[k]=m;this._cached=null;this._scheduleFlush(p)}}},remove:function(k){for(var m=0;m<this._stores.length;++m){var p=this._stores[m];if(p.hasOwnProperty(k)){delete p[k];this._cached=null;this._scheduleFlush(p);return true}}return false},clear:function(){for(var k=0;k<
this._stores.length;++k){this._stores[k]={};this._scheduleFlush(this._stores[k])}this._cached=null},sync:function(k){if(this._flushPending){this._flushPending=false;return this._flush()}for(var m=this,p=[],w=0;w<this._providers.length;++w)p.push(this._providers[w].get(this._name,k).then(function(t){return function(u){m._stores[t]=u}}(w)));return(new f.DeferredList(p)).then(function(){m._cached=null;m._getCached()})},flush:function(){this._flush()}};e.prototype={get:function(k,m){if(this._currentPromises[k])return this._currentPromises[k];
var p=new f.Deferred,w=null;if(m)this._cache.remove(k);else w=this._cache.get(k);if(w!==null)p.resolve(w);else{this._currentPromises[k]=p;var t=this;this._service.get(k).then(function(u){t._cache.set(k,u);delete t._currentPromises[k];p.resolve(u)},function(u){if(u.status===401){delete t._currentPromises[k];p.resolve({});a.handleAuthenticationError(u,function(){t.get(k)})}else if(u.status===404){u={};t._cache.set(k,u);delete t._currentPromises[k];p.resolve(u)}else{delete t._currentPromises[k];p.resolve(t._cache.get(k,
true)||{})}})}return p},put:function(k,m){var p=new f.Deferred;this._cache.set(k,m);var w=this;this._service.put(k,m).then(function(){p.resolve()},function(t){t.status===401?a.handleAuthenticationError(t,function(){w._service.put(k,m).then(function(){p.resolve()},function(){p.resolve()})}):p.resolve()});return p}};g.prototype={get:function(k,m){if(this._currentPromise)return this._currentPromise;var p=new f.Deferred,w=null;if(m)this._cache.remove(k);else w=this._cache.get(k);if(w!==null)p.resolve(w);
else{this._currentPromise=p;var t=this;f.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(u){t._cache.set(k,u[k]||{});t._currentPromise=null;p.resolve(u[k]||{})},error:function(u,v){if(v.xhr.status===401){t._currentPromise=null;p.resolve({});p=new f.Deferred;t._currentPromise=p;var x=this;a.handleAuthenticationError(v.xhr,function(){f.xhrGet(x)})}else if(v.xhr.status===404){t._cache.set(k,{});t._currentPromise=null;p.resolve({})}else{t._currentPromise=
null;u=t._cache.get(k,true);u!==null?p.resolve(u[k]||{}):p.resolve({})}}})}return p},put:function(){var k=new f.Deferred;k.resolve();return k}};j.prototype={get:function(k){var m=new f.Deferred;k=this._cache.get(k);k!==null?m.resolve(k):m.resolve({});return m},put:function(k,m){var p=new f.Deferred;this._cache.set(k,m);p.resolve();return p}};i.DEFAULT_SCOPE=1;i.LOCAL_SCOPE=2;i.USER_SCOPE=4;i.prototype={getPreferences:function(k,m){if(!m||typeof m!=="number"||m>7||m<1)m=i.DEFAULT_SCOPE|i.LOCAL_SCOPE|
i.USER_SCOPE;var p=[];i.USER_SCOPE&m&&this._userProvider.available()&&p.push(this._userProvider);i.LOCAL_SCOPE&m&&p.push(this._localProvider);i.DEFAULT_SCOPE&m&&p.push(this._defaultsProvider);var w=new b(k,p);return w.sync().then(function(){return w})}};return{PreferencesService:i}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(d,f){var a=a||{};a.Plugin=function(b,c,e){function g(r,y,A,h){if(!p)throw new Error("plugin not connected");var l=v++;x[String(l)]=h;e.postMessage({id:l,serviceId:r,method:y,params:A},p)}function j(r){var y={};if(r.methods)for(var A=0;A<r.methods.length;A++){var h=r.methods[A];y[h]=function(l){return function(){var o=Array.prototype.slice.call(arguments),q=new d.Deferred;m._load().then(function(){g(r.serviceId,
l,o,q)});return q.promise}}(h)}return y}function i(){var r=c.services;if(r)for(var y=0;y<r.length;y++){var A=r[y],h=j(A);n[A.serviceId]=e.registerService(A.type,h,A.properties)}}function k(r){try{if(r.method)if("plugin"===r.method){if(c){if(JSON.stringify(c)!==JSON.stringify(r.params[0])){for(var y in n)if(n.hasOwnProperty(y)){n[y].unregister();delete n[y]}c=r.params[0];i();e.updatePlugin(m)}}else{c=r.params[0];i()}if(!u){u=true;w.resolve(m)}if(t){t.resolve(m);t=null}}else if("dispatchEvent"===r.method){var A=
n[r.serviceId];A.dispatchEvent.apply(A,r.params)}else if("progress"===r.method){var h=x[String(r.requestId)];h.progress.apply(h,r.params)}else throw new Error("Bad response method: "+r.method);else{h=x[String(r.id)];delete x[String(r.id)];r.error?h.reject(r.error):h.resolve(r.result)}}catch(l){console.log(l)}}var m=this,p=null,w=new d.Deferred,t=null,u=false,v=0,x={},n={};this.getLocation=function(){return b};this.getData=function(){return c};this.uninstall=function(){for(var r in n)if(n.hasOwnProperty(r)){n[r].unregister();
delete n[r]}if(p){e.disconnect(p);p=null}e.uninstallPlugin(this)};this.getServiceReferences=function(){var r=[],y;for(y in n)n.hasOwnProperty(y)&&r.push(n[y].getServiceReference());return r};this.update=function(){if(!u)return this._load();var r;if(t===null){r=t=new d.Deferred;e.disconnect(p);p=e.connect(b,k);setTimeout(function(){t===r&&t.reject(new Error("Load timeout for plugin: "+b))},15E3)}return t};this._load=function(r){if(!p){p=e.connect(b,k);setTimeout(function(){if(!u){if(!r){c={};e.updatePlugin(m)}w.reject(new Error("Load timeout for plugin: "+
b))}},15E3)}return w.promise};if(typeof b!=="string")throw new Error("invalid url:"+b);c&&i()};a.PluginRegistry=function(b,c,e){function g(v){if(v.indexOf("://")===-1){var x=document.createElement("a");x.href=v;return x.href}return v}function j(v){delete m["plugin."+v.getLocation()]}function i(v){v.getData()._expires=(new Date).getTime()+36E5;m["plugin."+v.getLocation()]=JSON.stringify(v.getData())}function k(v){v=g(v);for(var x=0,n=p.length;x<n;x++){var r=p[x];if(v===r.getLocation())return r}return null}
var m=c||localStorage||{},p=[],w=[],t=new f.EventTarget;addEventListener("message",function(v){for(var x=0,n=v.source;x<w.length;x++)if(n===w[x].target){if(typeof w[x].useStructuredClone==="undefined")w[x].useStructuredClone=typeof v.data!=="string";w[x].handler(w[x].useStructuredClone?v.data:JSON.parse(v.data));break}},false);var u={registerService:d.hitch(b,b.registerService),connect:function(v,x){var n=document.createElement("iframe");n.id=v;n.name=v;if(!e){n.style.display="none";n.style.visibility=
"hidden"}n.src=v;document.body.appendChild(n);v={iframe:n,target:n.contentWindow,handler:x,url:v};w.push(v);return v},disconnect:function(v){for(var x=0;x<w.length;x++)if(v===w[x]){w.splice(x,1);try{document.body.removeChild(v.iframe)}catch(n){}break}},uninstallPlugin:function(v){j(v);for(var x=0;x<p.length;x++)if(v===p[x]){p.splice(x,1);t.dispatchEvent("pluginRemoved",v);break}},updatePlugin:function(v){i(v);t.dispatchEvent("pluginUpdated",v)},postMessage:function(v,x){x.target.postMessage(x.useStructuredClone?
v:JSON.stringify(v),x.url)}};this.startup=function(v){for(var x=[],n=0;n<v.length;++n){var r=v[n];r=g(r);var y="plugin."+r,A=m[y]?JSON.parse(m[y]):null;if(A&&A._expires&&A._expires>(new Date).getTime()){if(k(r)===null){delete A._expires;p.push(new a.Plugin(r,A,u))}}else{m[y]="{}";r=new a.Plugin(r,{},u);p.push(r);x.push(r._load(false))}}return new d.DeferredList(x)};this.shutdown=function(){for(var v=0;v<w.length;v++)try{document.body.removeChild(w[v].iframe)}catch(x){}};this.installPlugin=function(v,
x){v=g(v);var n=new d.Deferred,r=k(v);if(r)if(r.getData())n.resolve(r);else{var y=function(A){if(A.getLocation()===v){n.resolve(A);t.removeEventListener("pluginAdded",y)}};t.addEventListener("pluginAdded",y)}else{r=new a.Plugin(v,x,u);p.push(r);if(r.getData()){i(r);t.dispatchEvent("pluginAdded",r);n.resolve(r)}else r._load(true).then(function(){i(r);t.dispatchEvent("pluginAdded",r);n.resolve(r)},function(A){n.reject(A)})}return n.promise};this.getPlugins=function(){for(var v=[],x=0;x<p.length;x++)p[x].getData()&&
v.push(p[x]);return v};this.getPlugin=function(v){if((v=k(v))&&v.getData())return v;return null};this.addEventListener=function(v,x){t.addEventListener(v,x)};this.removeEventListener=function(v,x){t.removeEventListener(v,x)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(d,f,a,b,c){function e(){var g=new a.ServiceRegistry,j=new b.PreferencesService(g),i=new c.PluginRegistry(g);return j.getPreferences("/plugins").then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=d.toUrl(k[m]);return i.startup(k)}).then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>0)return j.getPreferences("/plugins",
j.USER_SCOPE).then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=d.toUrl(k[m]);return i.startup(k)})}).then(function(){f.addOnWindowUnload(function(){i.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:j,pluginRegistry:i}})}return{startup:e}});
define("orion/status",["require","dojo","orion/util"],function(d,f,a){function b(c,e,g,j,i){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=i;this.domId=g;this.progressDomId=j||g;this._hookedClose=false}b.prototype={_init:function(){var c=f.byId("closeNotifications");if(c&&!this._hookedClose){f.connect(c,"onclick",this,function(){this.setProgressMessage("");f.removeClass(this.notificationContainerDomId,
"slideContainerActive")});f.connect(c,"onkeypress",this,function(e){if(e.keyCode===f.keys.ENTER||e.keyCode===f.keys.SPACE){this.setProgressMessage("");f.removeClass(this.notificationContainerDomId,"slideContainerActive")}})}},setMessage:function(c,e){this._init();f.place(window.document.createTextNode(c),this.domId,"only");if(typeof e==="number"){var g=this;window.setTimeout(function(){var j=f.byId(g.domId);(typeof j.textContent==="string"?j.textContent:j.innerText)===c&&f.place(window.document.createTextNode(""),
g.domId,"only")},e)}},setErrorMessage:function(c){this._init();var e=c.responseText||c.message||c;try{e=JSON.parse(e)}catch(g){}c=e.Message||e;var j="red";if(e.Severity)switch(e.Severity){case "Warning":j="#FFCC00";break;case "Error":j="red";break;case "Info":case "Ok":j="green";break}e=f.create("span",{style:{color:j}});f.place(window.document.createTextNode(c),e);f.place(e,this.domId,"only")},setProgressMessage:function(c){this._init();var e=f.create("span",{"class":"imageSprite core-sprite-progress"});
f.place(e,this.progressDomId,"only");f.place(window.document.createTextNode(c),this.progressDomId,"last");f.addClass(this.notificationContainerDomId,"progressNormal");c.length>0?f.addClass(this.notificationContainerDomId,"slideContainerActive"):f.removeClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},setProgressResult:function(c){c=c.responseText||c;try{c=JSON.parse(c)}catch(e){}this._init();var g=c.Message||c,j="imageSprite core-sprite-info",
i="progressInfo",k="progressWarning progressError progressNormal";if(c.Severity)switch(c.Severity){case "Warning":j="imageSprite core-sprite-warning";i="progressWarning";k="progressInfo progressError progressNormal";break;case "Error":j="imageSprite core-sprite-error";i="progressError";k="progressWarning progressInfo progressNormal";break}j=f.create("span",{"class":j});f.place(j,this.progressDomId,"only");if(c.HTML)f.place(g,this.progressDomId,"last");else{f.place(window.document.createTextNode("   "+
g),this.progressDomId,"last");if(i&&this.progressDomId!==this.domId){f.addClass(this.notificationContainerDomId,i);f.removeClass(this.notificationContainerDomId,k)}}f.addClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},showWhile:function(c,e){var g=this;g.setProgressMessage(e);return c.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return f.hitch(g,g._doProgressWhile)(j);g.setProgressMessage("");j&&j.Result&&g.setProgressResult(j.Result);
return j})},_doProgressWhile:function(c){var e=new f.Deferred,g=this;window.setTimeout(function(){g._operationsClient.getOperation(c.Location).then(function(j){e.callback(j)})},2E3);return this.showWhile(e,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,f,a){f.declare("orion.widgets.OperationsDialog",[a.TooltipDialog],{widgetsInTemplate:true,closable:true,templateString:f.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 e=0;e<b.Children.length;e++)c[b.Children[e].Id]?this._myOperations.push(b.Children[e]):this._operations.push(b.Children[e]);this._operations.sort(function(g,j){return parseInt(j.Modified)-parseInt(g.Modified)});this._myOperations.sort(function(g,j){return parseInt(j.Modified)-parseInt(g.Modified)});this._renderOperations()},
parseProgressResult:function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(c){}var e={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==e.Message)e.DetailedMessage=b.DetailedMessage;return e},_renderOperations:function(){this._renderOperationsTable(this.myOperationsList,this._myOperations);this._renderOperationsTable(this.operationsList,this._operations)},_renderOperationsTable:function(b,c){f.empty(b);for(var e=0;e<c.length;e++){var g=c[e],j=f.create("tr"),
i=f.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:g.Name},j);i=f.create("div",null,i,"only");link=f.create("span",{innerHTML:g.Name,className:"primaryColumn"},i,"last");f.place(document.createTextNode(g.Name),link,"only");var k=f.create("span",null,i,"first");f.addClass(k,"imageSprite");var m=this.parseProgressResult(g.Result);switch(m.Severity){case "Warning":f.addClass(k,"core-sprite-warning");break;case "Error":f.addClass(k,"core-sprite-error");break;default:if(g.Running===
true)f.addClass(k,"core-sprite-start");else if(g.Canceled===true)f.addClass(k,"core-sprite-stop");else g.Failed===true?f.addClass(k,"core-sprite-error"):f.addClass(k,"core-sprite-ok")}if(m.Message||g.Message){g=m.Message||g.Message;if(m.DetailedMessage&&m.DetailedMessage!=="")g+=": "+m.DetailedMessage;f.create("br",null,i,"last");f.create("span",{className:"secondaryColumn",style:"margin-left: 18px;",innerHTML:g},i,"last")}f.place(j,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,f,a){function b(c,e){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.progress",this);this._operationsClient=e;this._initDone=false;this._topicListeners={};this._myOperations={};this._lastIconClass=this._lastOperation=null}b.prototype={init:function(c){if(!this._progressPane){this._progressPane=f.byId(c);this._operationsDialog=new orion.widgets.OperationsDialog;
f.connect(this._progressPane,"onclick",f.hitch(this,this._openOperationsPopup));var e=this;if(new Date-this.getLastListUpdate()>3E5)this._operationsClient.getRunningOperations().then(function(g){f.hitch(e,e._loadOperationsList)(g);window.setTimeout(function(){f.hitch(e,e._checkOperationsChanges())},5E3)},function(g){console.error(g)});else{f.hitch(e,e._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')));window.setTimeout(function(){f.hitch(e,e._checkOperationsChanges())},
5E3)}window.addEventListener("storage",function(g){a.getAuthenticationIds().indexOf(g.key)>=0&&e._operationsClient.getRunningOperations().then(function(j){f.hitch(e,e._loadOperationsList)(j)},function(j){console.error(j)})},false);window.addEventListener("storage",function(g){if(g.key==="orionOperations")f.hitch(e,e._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,e,g){c.Message="Operation status is unknown";c.Running=false;c.Failed=true;c.Result={HttpCode:g?g.xhr.staus:500,Severity:e,Message:e.Message?e.Message:e};this.writeOperation(c)},_checkOperationsChanges:function(){for(var c=
this,e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=[],j=[],i=0;i<e.Children.length;i++){var k=e.Children[i];if(k.Running==true&&new Date-new Date(k.lastClientDate?k.lastClientDate:0)>5E3){var m=this._operationsClient.getOperation(k.Location);j.push(m);f.hitch(this,function(p){m.then(function(w){w.lastClientDate=new Date;f.hitch(c,c.writeOperation)(w)},function(w,t){if(w.status==404){g.push(p);return w}f.hitch(c,c._markOperationAsFailed(e.Children[p],w,t))})})(i)}if(!k.Running&&
new Date-new Date(k.lastClientDate?k.lastClientDate:0)>3E5)g.push(i)}(new f.DeferredList(j)).addBoth(function(){if(g.length>0){e.lastClientDate=new Date;for(var p=g.length-1;p>=0;p--)e.Children.splice(g[p],1);localStorage.setItem("orionOperations",JSON.stringify(e));f.hitch(c,c._generateOperationsInfo)(e)}window.setTimeout(function(){f.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&&f.removeClass(this._progressPane,this._lastIconClass);this._lastIconClass=c;f.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 e="",g=0;g<c.Children.length;g++){var j=c.Children[g];if(this._myOperations[j.Id])if(j.Running==true){e=
"running";break}}if(e===""&&this._lastOperation!=null)if(this._lastOperation.Result)switch(this._operationsDialog.parseProgressResult(this._lastOperation.Result).Severity){case "Warning":if(e!=="error")e="warning";break;case "Error":e="error"}switch(e){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,e,g){if(c.Id)this._myOperations[c.Id]=true;var j=e?e:new f.Deferred;this.writeOperation(c);var i=this;if(c&&c.Location&&c.Running==true)window.setTimeout(function(){i._operationsClient.getOperation(c.Location).then(function(k){f.hitch(i,i.followOperation(k,j,c.Location))},function(k,m){f.hitch(i,
i.setProgressResult)({Severity:"Error",Message:k});f.hitch(i,i._markOperationAsFailed(c,k,m));j.errback(k,m)})},2E3);else if(c&&c.Result){i._serviceRegistry.getService("orion.page.message").setProgressMessage("");e=this._operationsDialog.parseProgressResult(c.Result).Severity;if(e=="Error"||e=="Warning"){c.Result.failedOperation={Location:g,Id:c.Id,Name:c.Name};j.callback(c);setTimeout(function(){i._myOperations[c.Id]&&f.hitch(i,i._openOperationsPopup)()},10)}else j.callback(c);!c.Failed&&c.Idempotent==
true&&window.setTimeout(function(){f.hitch(i,i.removeOperation)(g,c.Id)},5E3)}return j},removeOperation:function(c,e){that=this;if(e){if(this._lastOperation!=null&&this._lastOperation.Id===e)this._lastOperation=null;delete this._myOperations[e]}f.hitch(that._operationsClient,that._operationsClient.removeOperation)(c).then(function(){f.hitch(that,that.removeOperationFromTheList)(e)})},removeOperationFromTheList:function(c){if(this._lastOperation!=null&&this._lastOperation.Id===c)this._lastOperation=
null;delete this._myOperations[c];for(var e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<e.Children.length;g++){var j=e.Children[g];if(j.Id&&j.Id===c){e.Children.splice(g,1);break}}localStorage.setItem("orionOperations",JSON.stringify(e));this._generateOperationsInfo(e)},removeCompletedOperations:function(){for(var c=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),e=c.Children.length-1;e>=0;e--)c.Children[e].Running||c.Children.splice(e,1);
localStorage.setItem("orionOperations",JSON.stringify(c));this._generateOperationsInfo(c)},setProgressResult:function(c){this._serviceRegistry.getService("orion.page.message").setProgressResult(c)},showWhile:function(c,e){e&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(e);var g=this;return c.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return f.hitch(g,g.followOperation)(j,null,j.Location);g._serviceRegistry.getService("orion.page.message").setProgressMessage("");
return j},function(j){f.hitch(g,g.setProgressResult)(j);return j})},followTopic:function(c,e){this._topicListeners[c]||(this._topicListeners[c]=[]);this._topicListeners[c].push(e)},writeOperation:function(c){this._lastOperation=c=JSON.parse(JSON.stringify(c));for(var e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<e.Children.length;g++){var j=e.Children[g];if(j.Id&&j.Id===c.Id){e.Children.splice(g,1);break}}!c.Running&&!c.Failed&&delete c.Result;c.lastClientDate=new Date;
e.Children.push(c);e.lastClientDate=new Date;localStorage.setItem("orionOperations",JSON.stringify(e));this._generateOperationsInfo(e)}};b.prototype.constructor=b;return{ProgressService:b}});define("orion/dialogs",[],function(){function d(f){this._serviceRegistry=f;this._serviceRegistration=f.registerService("orion.page.dialog",this)}d.prototype={confirm:function(f,a){a(window.confirm(f))},openFiles:function(){}};d.prototype.constructor=d;return{DialogService:d}});
define("orion/navoutliner",["require","dojo","orion/util","orion/commands"],function(d,f,a,b){function c(e){var g=e.parent,j=e.toolbar;if(typeof g==="string")g=f.byId(g);if(typeof j==="string")j=f.byId(j);if(!g)throw"no parent";if(!e.serviceRegistry)throw"no service registry";this._parent=g;this._registry=e.serviceRegistry;this._toolbar=j;var i=this,k=e.serviceRegistry;g=new b.Command({name:"Add",tooltip:"Add link as favorite",imageClass:"core-sprite-add",id:"eclipse.addExternalFave",parameters:new b.ParametersDescription([new b.CommandParameter("url",
"text","URL:","")],false),callback:f.hitch(this,function(v){if(v.parameters){var x=v.parameters.valueFor("url");if(x){var n=k.getService("orion.core.favorite");n.hasFavorite(x).then(function(r){r?k.getService("orion.page.message").setMessage(x+" is already a favorite.",2E3):n.addFavoriteUrl(x)})}}})});j=new b.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteFave",visibleWhen:function(v){return v.isFavorite},callback:function(v){window.confirm("Do you want to remove "+v.items.name+
" from favorites?")&&e.serviceRegistry.getService("orion.core.favorite").removeFavorite(v.items.path)}});var m=new b.Command({name:"Rename",imageClass:"core-sprite-rename",id:"eclipse.renameFave",visibleWhen:function(v){return v.isFavorite},callback:f.hitch(this,function(v){this.editFavoriteName(v.items,v.id,v.domNode.id,v.userData)})}),p=new b.Command({name:"Rename",imageClass:"core-sprite-rename",id:"eclipse.renameSearch",visibleWhen:function(v){return v.isSearch},callback:f.hitch(this,function(v){this.editSearchName(v.items,
v.id,v.domNode.id,v.userData)})}),w=new b.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteSearch",visibleWhen:function(v){return v.isSearch},callback:function(v){window.confirm("Do you want to remove "+v.items.name+" from favorites?")&&e.serviceRegistry.getService("orion.core.favorite").removeSearch(v.items.query)}}),t=this._registry.getService("orion.page.command");t.addCommand(j,"object");t.addCommand(m,"object");t.addCommand(p,"object");t.addCommand(w,"object");t.addCommand(g,
"dom");t.addCommandGroup("orion.favorites",100,"*");t.registerCommandContribution("eclipse.renameFave",1,null,"orion.favorites");t.registerCommandContribution("eclipse.deleteFave",2,null,"orion.favorites");t.registerCommandContribution("eclipse.renameSearch",1,null,"orion.favorites");t.registerCommandContribution("eclipse.deleteSearch",2,null,"orion.favorites");t.registerCommandContribution("eclipse.addExternalFave",1,"faveCommands");if(g=this._registry.getService("orion.core.favorite")){var u=this._registry;
g.getFavorites().then(function(v){i.render(v.navigator,v.search,u)});g.addEventListener("favoritesChanged",function(v){i.render(v.navigator,v.search,v.registry)})}}c.prototype={editFavoriteName:function(e,g,j,i){var k=this._registry;g=f.byId("fave"+i);i=f.byId(j).parentNode;f.style(g,"display","none");i=i.childNodes;for(var m=0;m<i.length;m++)f.style(i[m],"display","none");a.getUserText(j+"EditBox",g,true,e.name,function(p){k.getService("orion.core.favorite").renameFavorite(e.path,p)},function(){for(var p=
f.byId(j).parentNode.childNodes,w=0;w<p.length;w++)f.style(p[w],"display","inline")})},editSearchName:function(e,g,j,i){var k=this._registry;g=f.byId("search"+i);i=f.byId(j).parentNode;f.style(g,"display","none");i=i.childNodes;for(var m=0;m<i.length;m++)f.style(i[m],"display","none");a.getUserText(j+"EditBox",g,true,e.name,function(p){k.getService("orion.core.favorite").renameSearch(e.query,p)},function(){for(var p=f.byId(j).parentNode.childNodes,w=0;w<p.length;w++)f.style(p[w],"display","inline")})},
render:function(e,g,j){f.empty(this._parent);if(j){var i=j.getServiceReferences("orion.core.file");if(i.length>1){a.createPaneHeading(this._parent,"fileServerSectionHeading","File Servers",true);var k=f.create("table",{id:"fileSystemTable"});f.addClass(k,"favoritesTable");for(var m=f.create("tbody",null,k),p=0;p<i.length;++p){var w=i[p].getProperty("Name");j=i[p].getProperty("top");if(w&&j){j=d.toUrl("navigate/table.html")+"#"+j;var t=f.create("tr",null,m);t=f.create("td",null,t);j=f.create("a",{href:j},
t);f.addClass(j,"navlinkonpage");w=window.document.createTextNode(w);f.place(w,j,"last")}}f.place(k,this._parent)}}a.createPaneHeading(this._parent,"favoritesHeading","Favorites",true,null,"faveCommands",this._registry.getService("orion.page.command"),this);i=f.create("table",{id:"favoritesTable"});f.addClass(i,"favoritesTable");m=f.create("tbody",null,i);for(t=0;t<e.length;t++){var u=e[t];if(u.isExternalResource)w=u.path;else{w=u.directory?d.toUrl("navigate/table.html")+"#"+u.path:d.toUrl("edit/edit.html")+
"#"+u.path;if(w==="#")w=""}var v=u.directory?"navlinkonpage":"navlink";j="fave"+t;k=f.create("tr");k.id="row"+j;p=f.create("td",null,k,"last");f.style(p,"whiteSpace","nowrap");j=f.create("a",{id:j,href:w,className:v},p,"only");f.place(window.document.createTextNode(u.name),j,"only");j=f.create("span",{id:k.id+"actionsWrapper"},p,"last");this._registry.getService("orion.page.command").renderCommands(j,"object",u,this,"tool",false,t);f.place(k,m,"last")}f.place(i,this._parent,"last");e=f.create("tr",
null,i);e=f.create("td",{colspan:2},e);f.create("span",{id:"spacer"},e);if(g.length>0){a.createPaneHeading(this._parent,"searchesHeading","Searches",true);i=f.create("table",{id:"searchTable"});f.addClass(i,"favoritesTable");m=f.create("tbody",null,i);for(e=0;e<g.length;e++){t=g[e];w=d.toUrl("search/search.html")+"#"+t.query;j="search"+e;k=f.create("tr");k.id="searchRow"+j;p=f.create("td",null,k,"last");j=f.create("a",{id:j,href:w},p,"only");f.place(window.document.createTextNode(t.name),j,"only");
j=f.create("span",{id:k.id+"actionsWrapper"},p,"last");this._registry.getService("orion.page.command").renderCommands(j,"object",t,this,"tool",false,e);f.place(k,m,"last")}f.place(i,this._parent,"last")}}};c.prototype.constructor=c;return{NavigationOutliner:c}});
define("orion/searchUtils",["require","dojo","orion/editor/regex"],function(d,f,a){var b=b||{};b.searchUtils=b.searchUtils||{};b.searchUtils.parseQueryStr=function(c){var e=c.indexOf("?"),g=c.indexOf("q=");if(e<g&&g>0)c=c.substring(e+1);e=c.split("&");c={queryStr:c,start:0,rows:10,sort:"Path asc",replace:null};for(g=0;g<e.length;g++){var j=e[g].indexOf("q="),i=e[g].indexOf("replace=");if(j>=0)b.searchUtils.parseLocationAndSearchStr(e[g].substring(j+2),c);else if(i>=0)c.replace=e[g].substring(i+8);
else{j=e[g].split("=");if(j.length===2)if(j[0]==="rows")c.rows=parseInt(j[1]);else if(j[0]==="start")c.start=parseInt(j[1]);else if(j[0]==="sort")c.sort=j[1]}}return c};b.searchUtils.copyQueryParams=function(c,e){return{sort:c.sort,rows:c.rows,start:c.start,searchStr:c.searchStr,location:c.location,replace:e?c.replace:null}};b.searchUtils.generateSearchHref=function(c){return d.toUrl("search/search.html")+"#"+b.searchUtils.generateSearchQuery(c)};b.searchUtils.generateSearchQuery=function(c){var e=
"Path asc",g=40,j=0,i="",k="",m="";if(c){if(c.sort)e=c.sort;if(c.rows)g=c.rows;if(c.start)j=c.start;if(c.searchStr){i=c.searchStr;i=i.split(" ").join("")}if(c.location){k=c.location;if(k.length>0&&k[k.length-1]!=="*")k+="*";if(k!=="")k="+Location:"+k}if(c.replace!==null&&c.replace!==undefined)m="&replace="+c.replace}return"?sort="+e+"&rows="+g+"&start="+j+"&q="+i+k+m};b.searchUtils.parseLocationAndSearchStr=function(c,e){var g=c.indexOf("+Location:")>-1;e.location="";e.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);e.location=g;e.searchStr=c[0].split(" ").join("")}}e.searchStrTitle=e.searchStr.split("\\").join("");e.inFileQuery=b.searchUtils.generateInFileQuery(e.searchStr)};b.searchUtils.generateInFileQuery=function(c){var e={},g=c.indexOf("*")>-1,j=c.indexOf("?")>-1;if(g)c=c.split("*").join(".*");if(j)c=c.split("?").join(".");if(!g&&!j){e.searchStr=c.split("\\").join("").toLowerCase();e.wildCard=false}else{e.searchStr=c.toLowerCase();
if(g=a.parse("/"+e.searchStr+"/")){c=g.pattern;g=g.flags;g+=g.indexOf("i")===-1?"i":"";e.regExp={pattern:c,flags:g};e.wildCard=true}}e.searchStrLength=e.searchStr.length;return e};b.searchUtils.replaceRegEx=function(c,e,g){return c.replace(new RegExp(e.pattern,e.flags),g)};b.searchUtils.replaceStringLiteral=function(c,e,g){e=a.parse("/"+e+"/gim");return b.searchUtils.replaceRegEx(c,e,g)};b.searchUtils.searchOnelineLiteral=function(c,e,g){var j;j=0;for(var i=false,k=[];;){j=e.indexOf(c.searchStr,j);
if(j<0)break;else{k.push({startIndex:j});i=true;if(g)break;j=j+c.searchStrLength}}if(i)return k;return null};b.searchUtils.findRegExp=function(c,e,g,j){if(!e)return null;g=g||"";g+=(g.indexOf("g")===-1?"g":"")+(g.indexOf("m")===-1?"m":"");var i=null;return(i=(new RegExp(e,g)).exec(c.substring(j)))&&{startIndex:i.index+j,length:i[0].length}};b.searchUtils.searchOnelineRegEx=function(c,e,g){for(var j=0,i=false,k=[];;)if(j=b.searchUtils.findRegExp(e,c.regExp.pattern,c.regExp.flags,j)){k.push(j);i=true;
if(g)break;j=j.startIndex+j.length}else break;if(i)return k;return null};b.searchUtils.generateNewContents=function(c,e,g,j,i){if(g&&c){var k;k=e.length>0?true:false;for(var m=0;m<c.length;m++){for(var p=c[m],w=false,t=false,u=[],v,x=0,n=0;n<g.children.length;n++)if(g.children[n].lineNumber-1===m){x=n;for(w=0;w<g.children[n].matches.length;w++)g.children[n+w].checked!==false&&u.push(w);t=u.length>0;v=g.children[n].matches;w=true;break}if(w){if(t){u=b.searchUtils.replaceCheckedMatches(p,j,v,u,i);p=
u.replacedStr;for(w=0;w<g.children[x].matches.length;w++)g.children[x+w].newMatches=u.newMatches}else{p=p;for(w=0;w<g.children[x].matches.length;w++)g.children[x+w].newMatches=g.children[x+w].matches}if(k)e[m]=p;else e.push(p)}else k||e.push(p)}}};b.searchUtils.generateMatchContext=function(c,e,g){var j=[],i=c*2+1,k;if(e.length<=i){k=0;c=e.length-1}else{k=g-c;if(k<0){k=0;c=k+i-1}else{c=g+c;if(c>e.length-1){c=e.length-1;k=c-i+1}}}for(i=k;i<=c;i++)j.push({context:e[i],current:i===g});return j};b.searchUtils.searchWithinFile=
function(c,e,g,j,i){g=g.split(j);if(i)e.contents=g;if(e){e.children=[];for(var k=j=0;k<g.length;k++){var m=g[k];if(m&&m.length>0){var p=m.toLowerCase();if(p=c.wildCard?b.searchUtils.searchOnelineRegEx(c,p):b.searchUtils.searchOnelineLiteral(c,p)){var w=k+1;if(i)for(var t=0;t<p.length;t++){var u=t+1;u={parent:e,checked:e.checked,type:"detail",matches:p,lineNumber:w,matchNumber:u,name:m,location:e.location+"-"+w+"-"+u};e.children.push(u)}else{u={parent:e,context:b.searchUtils.generateMatchContext(2,
g,k),checked:e.checked,type:"detail",matches:p,lineNumber:w,name:m,linkLocation:e.linkLocation+",line="+w,location:e.location+"-"+w};e.children.push(u)}j+=p.length}}}e.totalMatches=j}};b.searchUtils.replaceCheckedMatches=function(c,e,g,j,i){i=i;for(var k=0,m="",p=[],w=0;w<g.length;w++){if(k!==g[w].startIndex)m+=c.substring(k,g[w].startIndex);if(g[w].length)i=g[w].length;k=false;for(var t=0;t<j.length;t++)if(j[t]===w){k=true;break}if(k){p.push({startIndex:m.length,length:e.length});m+=e}else{p.push({startIndex:m.length,
length:i});m+=c.substring(g[w].startIndex,g[w].startIndex+i)}k=g[w].startIndex+i}if(k<c.length-1)m+=c.substring(k);return{replacedStr:m,newMatches:p}};b.searchUtils.fullPathNameByMeta=function(c){var e=c.length,g="";if(e>0)for(e=e-1;e>-1;e--)g=g+(g===""?"":"/")+c[e].Name;return g};b.searchUtils.path2FolderName=function(c,e,g){return c.substring(0,c.length-e.length-(g?0:1))};return b.searchUtils});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(d,f){d.declare("dijit.layout.BorderContainer",f.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 e=d.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");c=new e({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,j){return{pane:g,weight:[g.region=="center"?Infinity:0,g.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(g.region)?1:-1),j]}},this);c.sort(function(g,j){g=g.weight;j=j.weight;for(var i=0;i<g.length;i++)if(g[i]!=j[i])return g[i]-j[i];return 0});var e=[];d.forEach(c,function(g){g=g.pane;e.push(g);g._splitterWidget&&e.push(g._splitterWidget)});
f.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},e,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(f._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});d.declare("dijit.layout._Splitter",[f._Widget,f._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(e){return e.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,e=c?"pageY":"pageX",g=a[e],j=this.domNode.style;c=c?"h":"w";var i=d.marginBox(this.child.domNode)[c],k=this._computeMaxSize(),m=this.child.minSize||20;c=this.region;var p=c==
"top"||c=="bottom"?"top":"left",w=parseInt(j[p],10),t=this._resize,u=d.hitch(this.container,"_layoutChildren",this.child.id);c=d.doc;this._handlers=(this._handlers||[]).concat([d.connect(c,"onmousemove",this._drag=function(v,x){v=v[e]-g;var n=b*v+i,r=Math.max(Math.min(n,k),m);if(t||x)u(r);j[p]=v+w+b*(r-n)+"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,e=d.keys;switch(a.charOrCode){case b?e.UP_ARROW:e.LEFT_ARROW:c*=-1;case b?e.DOWN_ARROW:e.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",[f._Widget,f._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 f.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,f,a,b,c,e){function g(j){this.registry=j.serviceRegistry;this._commandService=j.commandService;(this._fileService=j.fileService)||console.error("No file service on search client")}g.prototype={search:function(j,i,k){i=e.parseQueryStr(j);try{this._fileService.search(i.location,j).then(function(p){var w=p.responseHeader.params.q;
w=w.substring(w.indexOf("}")+1);k(function(t){for(var u=[],v=0;v<t.response.docs.length;v++){var x=t.response.docs[v];u.push({name:x.Name,path:x.Location,folderName:e.path2FolderName(x.Path,x.Name),directory:x.Directory,lineNumber:x.LineNumber})}return u}(p),w)})}catch(m){this.registry.getService("orion.page.message").setErrorMessage(m)}},handleError:function(j,i){console.error(j);var k=document.createTextNode(j);f.place(k,i,"only");return j},setLocationByMetaData:function(j,i){var k="",m=null;if(i&&
j&&j.Parents&&j.Parents.length>0)m=i.index==="last"?j.Parents[j.Parents.length-1]:j.Parents[0];else if(j&&j.Directory&&j.Location&&j.Parents)m=j;if(m){this.setLocationByURL(m.Location);k=m.Name}else if(j)k=this._fileService.fileServiceName(j&&j.Location);if((j=f.byId("search"))&&j.placeholder)j.placeholder=k.length>23?"Search "+k.substring(0,20)+"...":"Search "+k;if(j&&j.title)j.title="Type a keyword or wild card to search in "+k},setLocationByURL:function(j){this.location=j},createSearchQuery:function(j,
i,k,m){k||(k="Path");k+=" asc";if(i){j=/\*$/.test(i)?"":"*";return e.generateSearchQuery({sort:k,rows:100,start:0,searchStr:"Name:"+this._luceneEscape(i,true)+j})}return e.generateSearchQuery({sort:k,rows:40,start:0,searchStr:this._luceneEscape(j,true),location:m?"":this.location})},_luceneEscape:function(j,i){var k="";i='+-&|!(){}[]^"~:\\'+(!i?"*?":"");for(var m=0;m<j.length;m++){var p=j.charAt(m);if(i.indexOf(p)>=0)k+="\\";k+=p}return k},defaultRenderer:{makeRenderFunction:function(j,i,k,m){function p(w,
t){var u=function(){function l(s,z){s.appendChild(document.createTextNode(" - "+(z.folderName?z.folderName:z.path)+" "))}function o(s,z){var C=z.name;if(q.hasOwnProperty(C)){l(s,z);var B=q[C];if(typeof B==="function"){q[C]=null;B()}}else q[C]=function(){l(s,z)}}var q={};return o}(),v=false;f.empty(j);if(w&&w.length>0){for(var x=document.createElement("table"),n=0;n<w.length;n++){var r=w[n],y;if(!v){v=true;if(i){y=x.insertRow(0).insertCell(0);y.innerHTML=i}}y=x.insertRow(-1).insertCell(0);y.colspan=
2;m&&m(y);var A=document.createElement("a");f.place(document.createTextNode(r.name),A);r.LineNumber&&f.place(document.createTextNode(" (Line "+r.LineNumber+")"),A);var h=r.location;if(r.isExternalResource)h=r.path;else{h=r.directory?d.toUrl("navigate/table.html")+"#"+r.path:d.toUrl("edit/edit.html")+"#"+r.path;if(h==="#")h=""}A.setAttribute("href",h);f.style(A,"verticalAlign","middle");y.appendChild(A);u(y,r)}f.place(x,j,"last");typeof k==="function"&&k(j)}if(!v)if(t){w=f.place("<div>No matches found for </div>",
j,"only");w=f.create("b",null,w,"last");f.place(document.createTextNode(t),w,"only");typeof k==="function"&&k(j)}}return p}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(d,f){function a(e,g,j){if(!e[g])throw g+" is not supportted in this file system";var i=new d.Deferred;e[g].apply(e,j).then(function(k){i.callback(k)},function(k){k.status===401?f.handleAuthenticationError(k,function(){e[g].apply(e,j).then(function(m){i.callback(m)},function(m){i.errback(m)})}):i.errback(k)});return i}function b(e,g,j,i){if(!e.readBlob)throw"source file service does not support binary read";if(!j.writeBlob)throw"target file service does not support binary write";
if(g[g.length-1]!=="/")return a(e,"readBlob",[g]).then(function(p){return a(j,"writeBlob",[i,p])});var k=i.substring(0,i.length-1),m=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=k.substring(0,k.lastIndexOf("/")+1);return a(j,"createFolder",[k,m]).then(function(){},function(){}).then(function(){if(g.indexOf("/")===0)g+="?depth=1";return a(e,"fetchChildren",[g]).then(function(p){for(var w=[],t=0;t<p.length;++t){var u=p[t].Location,v=u;if(p[t].Directory)v=u.substring(0,u.length-1);v=decodeURIComponent(v.substring(v.lastIndexOf("/")+
1));v=i+encodeURIComponent(v);if(p[t].Directory)v+="/";w[t]=b(e,u,j,v)}return new d.DeferredList(w)})})}function c(e,g){function j(x){var n=new d.Deferred;n.reject("No Matching FileService for location:"+x);return n}var i=e.getServiceReferences("orion.core.file"),k=i;if(g){k=[];for(var m=0;m<i.length;++m)g(i[m])&&k.push(i[m])}var p=[],w=[],t=[],u=[],v={fetchChildren:function(){var x=new d.Deferred;x.resolve(u);return x},createWorkspace:function(){var x=new d.Deferred;x.reject("no file service");return x},
loadWorkspaces:function(){var x=new d.Deferred;x.reject("no file service");return x},loadWorkspace:function(){var x=new d.Deferred;window.setTimeout(function(){x.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"File Servers",Location:"/",Children:u,ChildrenLocation:"/"})},100);return x},search:j,createProject:j,createFolder:j,createFile:j,deleteFile:j,moveFile:j,copyFile:j,read:j,write:j};for(g=0;g<k.length;++g){u[g]={Directory:true,Length:0,LocalTimeStamp:0,Location:k[g].getProperty("top"),
ChildrenLocation:k[g].getProperty("top"),Name:k[g].getProperty("Name")};i=k[g].getProperty("pattern")||".*";if(i[0]!=="^")i="^"+i;p[g]=new RegExp(i);w[g]=e.getService(k[g]);t[g]=k[g].getProperty("Name")}this._getServiceIndex=function(x){if(x==="/")return-1;else if(!x||x.length&&x.length===0)return 0;for(var n=0;n<p.length;++n)if(p[n].test(x))return n;throw"No Matching FileService for location:"+x;};this._getService=function(x){x=this._getServiceIndex(x);return x===-1?v:w[x]};this._getServiceName=
function(x){x=this._getServiceIndex(x);return x===-1?v.Name:t[x]}}c.prototype={fileServiceName:function(e){return this._getServiceName(e)},fetchChildren:function(e){return a(this._getService(e),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return a(this._getService(e),"loadWorkspace",arguments)},createProject:function(e){return a(this._getService(e),
"createProject",arguments)},createFolder:function(e){return a(this._getService(e),"createFolder",arguments)},createFile:function(e){return a(this._getService(e),"createFile",arguments)},deleteFile:function(e){return a(this._getService(e),"deleteFile",arguments)},moveFile:function(e,g,j){var i=this._getService(e),k=this._getService(g);if(i===k)return a(i,"moveFile",arguments);var m=e[e.length-1]==="/",p=g;if(p[p.length-1]!=="/")p+="/";if(j)p+=encodeURIComponent(j);else{var w=e;if(m)w=w.substring(0,
w.length-1);p+=w.substring(w.lastIndexOf("/")+1)}if(m&&p[p.length-1]!=="/")p+="/";return b(i,e,k,p).then(function(){return a(i,"deleteFile",[e])})},copyFile:function(e,g){var j=this._getService(e),i=this._getService(g);if(j===i)return a(j,"copyFile",arguments);var k=e[e.length-1]==="/",m=g;if(m[m.length-1]!=="/")m+="/";var p=e;if(k)p=p.substring(0,p.length-1);m+=p.substring(p.lastIndexOf("/")+1);if(k&&m[m.length-1]!=="/")m+="/";return b(j,e,i,m)},read:function(e){return a(this._getService(e),"read",
arguments)},write:function(e){return a(this._getService(e),"write",arguments)},remoteImport:function(e){return a(this._getService(e),"remoteImport",arguments)},remoteExport:function(e){return a(this._getService(e),"remoteExport",arguments)},search:function(e){return a(this._getService(e),"search",arguments)}};c.prototype.constructor=c;return{FileClient:c}});
define("orion/operationsClient",["dojo","orion/auth","dojo/DeferredList"],function(d,f){function a(m,p,w){var t=new d.Deferred;m[p].apply(m,w).then(function(u){t.callback(u)},function(u){u.status===401?f.handleAuthenticationError(u,function(){m[p].apply(m,w).then(function(v){t.callback(v)},function(v){t.errback(v)})}):t.errback(u)});return t}function b(m,p){return a(m,"getOperations",[p])}function c(m){this._location=m}function e(){var m=new d.Deferred;m.errback("No Matching OperationService for location:"+
this._location);return m}function g(m){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];for(var p=m.getServiceReferences("orion.core.operation"),w=0;w<p.length;w++){var t=m.getService(p[w]);this._services[w]=t;t=p[w].getProperty("pattern")||".*";if(t[0]!=="^")t="^"+t;this._patterns[w]=new RegExp(t)}this._getService=function(u){if(!u)return this._services[0];for(var v=0;v<this._patterns.length;++v)if(this._patterns[v].test(u))return this._services[v];return new c(u)}}
function j(m){if(m.length===1){if(m[0][0])return m[0][1];console.error(m[0][1]);return{Children:[]}}for(var p={Children:[]},w=0;w<m.length;w++)if(m[w][0]){if(m[w][1]&&m[w][1].Children)p.Children=p.Children.concat(m[w][1].Children)}else console.error(m[w][1]);return p}function i(m,p,w){var t=this,u={Longpolling:true};if(w)u.LongpollingId=w;a(m,"getOperations",[u]).then(function(v){if(!(w&&t._currentLongpollingIds.indexOf(w)<0)){p(v,w);if(v.LongpollingId){t._currentLongpollingIds.push(v.LongpollingId);
d.hitch(t,i)(m,p,v.LongpollingId)}else d.hitch(t,i)(m,p,w)}},function(v){w&&t._currentLongpollingIds.indexOf(w)<0||("timeout"===v.dojoType?d.hitch(t,i)(m,p,w):setTimeout(function(){d.hitch(t,i)(m,p,w)},2E3))})}function k(m){for(var p=0;p<this._operationListeners.length;p++)this._operationListeners[p](m)}c.prototype={getOperation:e,getOperations:e,removeCompletedOperations:e,removeOperation:e,cancelOperation:e};c.prototype.constructor=c;g.prototype={getOperations:function(){var m=new d.Deferred,p=
[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var w=0;w<this._services.length;w++)p[w]=b(this._services[w]);(new d.DeferredList(p)).then(function(t){m.resolve(j(t))});return m},getRunningOperations:function(){var m=new d.Deferred,p=[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var w=0;w<this._services.length;w++)p[w]=b(this._services[w],{RunningOnly:true});(new d.DeferredList(p)).then(function(t){m.resolve(j(t))});
return m},getOperation:function(m){return a(this._getService(m),"getOperation",arguments)},removeCompletedOperations:function(){var m=[];if(this._services.length<1){result.errback("No operations services registered.");return result}for(var p=0;p<this._services.length;p++)m[p]=a(this._services[p],"removeCompletedOperations");return new d.DeferredList(m)},removeOperation:function(m){return a(this._getService(m),"removeOperation",arguments)},cancelOperation:function(m){return a(this._getService(m),"cancelOperation",
arguments)},addOperationChangeListener:function(m){this._operationListeners.push(m);if(this._operationListeners.length===1){if(this._services.length<1)throw"No operations services registered.";for(m=0;m<this._services.length;m++)d.hitch(this,i)(this._services[m],d.hitch(this,k))}},removeOperationChangeListener:function(m){for(var p=0;p<this._operationListeners.length;p++)if(this._operationListeners[p]===m){this._operationListeners.splice(p,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 m=0;m<this._services.length;m++)d.hitch(this,i)(this._services[m],d.hitch(this,k))}};g.prototype.constructor=g;return{OperationsClient:g}});
define("orion/treetable",["dojo"],function(d){function f(a){this._init(a)}f.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(e){if(this._showRoot){e._depth=0;this._generate([e],0)}else c._treeModel.getChildren(e,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 e=document.createElement("tbody");e.id=this._id+"tbody";this._generateChildren(a,
b,e,"last");c.appendChild(e);this._parent.appendChild(c);this._rowsChanged()},_generateChildren:function(a,b,c,e){for(var g in a){var j=document.createElement("tr");j.id=this._treeModel.getId(a[g]);j._depth=b;j._item=a[g];this._renderer.render(a[g],j);d.style(j.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*b+"px");d.place(j,c,e);if(e==="after")c=j}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},
refresh:function(a,b,c,e,g,j){var i=this._treeModel.getId(a),k;if(i===this._id){this._removeChildRows(i);this._generateChildren(b,0,d.byId(i+"tbody"),"last");this._rowsChanged()}else{var m=d.byId(i);if(m){m._item=a;if(m&&(c||m._expanded)){m._expanded=true;this._removeChildRows(i);this._renderer.updateExpandVisuals(m,true);if(b){this._generateChildren(b,m._depth+1,m,"after");this._rowsChanged();if(e&&g){a=d.byId(e);d.addClass(a,g);j&&d.removeClass(a,j)}}else{k=this;b=this._treeModel.getChildren(m._item,
function(p){k._generateChildren(p,m._depth+1,m,"after");k._rowsChanged()})}}else this._renderer.updateExpandVisuals(m,false)}else console.log("could not find table row "+i)}},refreshAndExpand:function(a,b,c,e,g){this.refresh(a,b,true,c,e,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,e){var g=d.byId(a);if(g)if(g._expanded){this.collapse(a);if(b){a=d.byId(b);d.addClass(a,e);d.removeClass(a,c)}}else{this.expand(a);
if(b){a=d.byId(b);d.addClass(a,c);d.removeClass(a,e)}}},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 e=d.byId(a);if(e)if(!e._expanded){e._expanded=true;var g=this;this._renderer.updateExpandVisuals(e,true);this._treeModel.getChildren(e._item,function(j){g._generateChildren(j,e._depth+1,e,"after");g._rowsChanged();b&&b.apply(this,c)})}},_removeChildRows:function(a){d.byId(this._id);var b=a===this._id,
c=false,e=-1,g=[];d.query(".treeTableRow").forEach(function(k){if(!c)if(b)if(k._depth>e)g.push(k);else c=true;else if(k.id===a){b=true;e=k._depth}});for(var j in g){var i=g[j];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)}};f.prototype.constructor=f;return{TableTree:f}});
define("orion/explorer",["require","dojo","orion/treetable"],function(d,f,a){var b={};b.Explorer=function(){function c(e,g,j){this.registry=e;this.renderer=j;this.selection=g;this.myTree=null}c.prototype={changedItem:function(e,g){f.hitch(this.myTree,this.myTree.refreshAndExpand)(e,g)},updateCommands:function(e){this.myTree&&f.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(e))},makeNewItemPlaceHolder:function(e,g,j){e=this.getRow(e);if(j){e=e.childNodes[j];f.place("<br><span id='"+
g+"placeHolderRow'></span>",e,"last");if(j=f.byId(g+"placeHolderRow"))return{tempNode:j,refNode:j}}if(e){f.place("<tr id='"+g+"placeHolderRow'><td id='"+g+"placeHolderCol'></td>",e,"after");j=f.byId(g+"placeHolderRow");e=f.byId(g+"placeHolderCol");if(j&&e)return{tempNode:j,refNode:e}}return null},getRow:function(e){if(e=this.model.getId(e))return f.byId(e)},createTree:function(e,g,j){var i=e+"innerTree",k=f.byId(i);k&&f.destroy(k);if(g)g.rootId=i;this.model=g;this.myTree=new a.TableTree({id:i,model:g,
showRoot:false,parent:e,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,indent:j?j.indent:undefined,onCollapse:j?j.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(e,g){this.rootPath=e;this.fetchItems=g}c.prototype={destroy:function(){},getRoot:function(e){this.fetchItems(this.rootPath).then(f.hitch(this,
function(g){this.root=g;e(g)}))},getChildren:function(e,g){if(e.Children)g(e.Children);else e.ChildrenLocation?this.fetchItems(e.ChildrenLocation).then(f.hitch(this,function(j){e.Children=j;g(j)})):g([])},getId:function(e){if(e.Location===this.root.Location)return this.rootId;e=e.Location.replace(/[\\\/]/g,"");for(var g="",j=0;j<e.length;j++)g+=e[j].match(/[^\.\:\-\_0-9A-Za-z]/g)?e.charCodeAt(j):e[j];return g}};return c}();b.ExplorerFlatModel=function(){function c(e,g,j){this.rootPath=e;this.fetchItems=
g;this.root=j}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(e){this.root?e(this.root):this.fetchItems(this.rootPath).then(f.hitch(this,function(g){this.root=g;e(g)}))};c.prototype.getChildren=function(e,g){e===this.root?g(this.root):g([])};return c}();b.ExplorerRenderer=function(){function c(e,g){this.explorer=g;this._init(e);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(e,g){this.tableTree=g;f.empty(e);f.addClass(e,"treetable");this.renderTableHeader(e)},getActionsColumn:function(e,g,j,i){j=j||"tool";var k=this.explorer.registry.getService("orion.page.command"),m=document.createElement("td");m.id=g.id+"actionswrapper";i&&f.addClass(m,i);k.renderCommands(m,"object",e,this.explorer,j,false,null,"commandActiveItem","commandInactiveItem");return m},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(e,g){if(this._useCheckboxSelection){var j=document.createElement("td"),i=document.createElement("span");i.id=this.getCheckBoxId(g.id);f.addClass(i,"core-sprite-check selectionCheckmarkSprite");i.itemId=g.id;if(this.getCheckedFunc){i.checked=this.getCheckedFunc(e);this._highlightSelection&&f.toggleClass(g,"checkedRow",i.checked);f.toggleClass(i,"core-sprite-check_on",i.checked)}j.appendChild(i);f.connect(i,"onclick",f.hitch(this,function(k){this.onCheck(g,k.target,k.target.checked?
false:true,true)}));return j}},getCheckBoxId:function(e){return e+"selectedState"},onCheck:function(e,g,j,i){g.checked=j;this._highlightSelection&&e&&f.toggleClass(e,"checkedRow",j);f.toggleClass(g,"core-sprite-check_on",j);this.onCheckedFunc&&this.onCheckedFunc(g.itemId,j,i);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},_storeSelections:function(){var e=this.getSelectedIds(),g=this._getUIStatePreferencePath();if(g&&window.sessionStorage)window.sessionStorage[g+
"selection"]=JSON.stringify(e)},_restoreSelections:function(e){e=window.sessionStorage[e+"selection"];if(typeof e==="string")e=e.length>0?JSON.parse(e):null;var g;if(e)for(g=0;g<e.length;g++){var j=f.byId(e[g]);if(j){this._highlightSelection&&f.addClass(j,"checkedRow");if(j=f.byId(this.getCheckBoxId(j.id))){j.checked=true;f.addClass(j,"core-sprite-check_on")}}}e=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(e)},_storeExpansions:function(e){window.sessionStorage[e+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(e){var g=false,j=window.sessionStorage[e+"expanded"];if(typeof j==="string")j=j.length>0?JSON.parse(j):null;var i;if(j)for(i=0;i<j.length;i++)if(f.byId(j[i])){this._expanded.push(j[i]);this.tableTree.expand(j[i],f.hitch(this,function(){this._restoreSelections(e)}));g=true}return!g},_getUIStatePreferencePath:function(){if(this.explorer){var e=this.explorer.getRootPath();if(this._cachePrefix&&e)return"/"+this._cachePrefix+"/"+e.replace(/[^\.\:\-\_0-9A-Za-z]/g,
"")+"/uiState"}return null},expandCollapseImageId:function(e){return e+"__expand"},updateExpandVisuals:function(e,g){if(e=f.byId(this.expandCollapseImageId(e.id))){f.addClass(e,g?this._expandImageClass:this._collapseImageClass);f.removeClass(e,g?this._collapseImageClass:this._expandImageClass)}},getExpandImage:function(e,g,j,i){var k=f.create("span",{id:this.expandCollapseImageId(e.id)},g,"last");f.addClass(k,this._twistieSpriteClass);f.addClass(k,this._collapseImageClass);if(j){g=f.create("span",
null,g,"last");f.addClass(g,i||"imageSprite");f.addClass(g,j)}k.onclick=f.hitch(this,function(){this.tableTree.toggle(e.id,this.expandCollapseImageId(e.id),this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(e.id))this._expanded.push(e.id);else for(var m in this._expanded)if(this._expanded[m]===e.id){this._expanded.splice(m,1);break}(m=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(m)});return k},render:function(e,g){g.cellSpacing="8px";this.renderRow(e,
g)},getSelected:function(){var e=[];f.query(".core-sprite-check_on").forEach(f.hitch(this,function(g){e.push(this.tableTree.getItem(g.parentNode.parentNode))}));return e},getSelectedIds:function(){var e=[];f.query(".core-sprite-check_on").forEach(f.hitch(this,function(g){e.push(g.parentNode.parentNode.id)}));return e},rowsChanged:function(){this._decorateAlternatingLines&&f.query(".treeTableRow").forEach(function(e,g){if(g%2){f.addClass(e,"darkTreeTableRow");f.removeClass(e,"lightTreeTableRow")}else{f.addClass(e,
"lightTreeTableRow");f.removeClass(e,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var e=this.explorer.registry;f.query(".treeTableRow").forEach(function(g){var j=f.byId(g.id+"actionswrapper");f.empty(j);e.getService("orion.page.command").renderCommands(j,"object",g._item,this.explorer,"tool")})},_init:function(e){if(e){this._useCheckboxSelection=e.checkbox===undefined?false:e.checkbox;this._colums=e.colums||[];
this._cachePrefix=e.cachePrefix;this.getCheckedFunc=e.getCheckedFunc;this.onCheckedFunc=e.onCheckedFunc;this._highlightSelection=true;if(e.highlightSelection===false)this._highlightSelection=false;this._decorateAlternatingLines=true;if(e.decorateAlternatingLines===false)this._decorateAlternatingLines=false}},_initializeUIState:function(){this._expanded=[];var e=this._getUIStatePreferencePath();e&&window.sessionStorage&&this._restoreExpansions(e)&&this._restoreSelections(e)}};return c}();b.SelectionRenderer=
function(){function c(e,g){this._init(e);this.explorer=g}c.prototype=new b.ExplorerRenderer;c.prototype.renderTableHeader=function(e){var g=document.createElement("thead"),j=document.createElement("tr");f.addClass(g,"navTableHeading");this._useCheckboxSelection&&j.appendChild(this.initCheckboxColumn(e));for(var i=0,k=this.getCellHeaderElement(i);k;){k.innerHTML.length>0&&f.addClass(k,"navColumn");j.appendChild(k);k=this.getCellHeaderElement(++i)}g.appendChild(j);e.appendChild(g)};c.prototype.renderRow=
function(e,g){f.style(g,"verticalAlign","baseline");f.addClass(g,"treeTableRow");var j=this.getCheckboxColumn(e,g);if(j){f.addClass(j,"checkColumn");g.appendChild(j)}j=0;for(var i=this.getCellElement(j,e,g);i;){g.appendChild(i);f.addClass(i,"secondaryColumn");i=this.getCellElement(++j,e,g)}};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();return b});
define("orion/treeModelIterator",[],function(){var d={};d.TreeModelIterator=function(){function f(a,b){this.firstLevelChildren=a;this.reset();this._init(b)}f.prototype={_init:function(a){if(a){this.isExpanded=a.isExpanded;this.isExpandable=a.isExpandable;this.forceExpandFunc=a.forceExpandFunc}},topLevel:function(a){return a.parent?a.parent===this.root:true},_expanded:function(a){if(!a)return true;var b=a.children&&a.children.length>0;if(this.isExpanded&&b)b=this.isExpanded(a);return b},_expandable:function(a){if(!a)return true;
if(this.isExpandable)return this.isExpandable(a);return false},_diveIn:function(a){if(this._expanded(a)){this.setCursor(a.children[0]);return this.cursor()}return null},_drillToLast:function(a){if(this._expanded(a))return this._drillToLast(a.children[a.children.length-1]);return a},_forward:function(a){var b=this._diveIn(this._cursor);if(!b){if(a&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(e){mdoel&&c.setCursor(e)})}(b=
this._findSibling(this._cursor,true))&&this.setCursor(b)}return b},_backward:function(a){var b=this._findSibling(this._cursor,false);if(b&&b!==this._cursor.parent)b=this._drillToLast(b);if(a&&b&&this._expandable(b)&&this.forceExpandFunc&&b!==this._cursor.parent)return this.forceExpandFunc(b,"last",function(c){mdoel&&that.setCursor(c)});b&&this.setCursor(b);return b},_findSibling:function(a,b){for(var c=this.topLevel(a),e=c?this.firstLevelChildren:a.parent.children,g=0;g<e.length;g++)if(e[g]===a)return g===
0&&!b?c?null:a.parent:g===e.length-1&&b?c?null:this._findSibling(a.parent,b):b?e[g+1]:e[g-1];return null},_inParentChain:function(a,b){for(a=a.parent;a;){if(a===b)return true;a=a.parent}return false},_onCollapse:function(a){if(this._expanded(a.parent))return a;return this._onCollapse(a.parent)},setCursor:function(a){this._prevCursor=this._cursor;this._cursor=a},setTree:function(a){this.firstLevelChildren=a;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},iterate:function(a,
b){return a?this._forward(b):this._backward(b)},collapse:function(a){if(this._inParentChain(this._cursor,a)){this.setCursor(a);return this._cursor}return null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0){this._cursor=this.firstLevelChildren[0];this.root=this.firstLevelChildren[0].parent}},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return f}();
return d});
define("orion/explorerNavHandler",["orion/treeModelIterator"],function(d){var f={};f.ExplorerNavHandler=function(){function a(b,c){this.explorer=b;this.model=this.explorer.model;this._listeners=[];this._modelIterator=new d.TreeModelIterator([],{isExpanded:dojo.hitch(this,function(g){return this.isExpanded(g)}),isExpandable:this.explorer.renderer.isExpandable?dojo.hitch(this,function(g){return this.explorer.renderer.isExpandable(g)}):dojo.hitch(this,function(g){return this.isExpandable(g)}),forceExpandFunc:this.explorer.forceExpandFunc?
dojo.hitch(this,function(g,j,i){return this.explorer.forceExpandFunc(g,j,i)}):undefined});this._init(c);var e=this._getEventListeningDiv();e.focus();this._listeners.push(dojo.connect(e,"onkeydown",dojo.hitch(this,function(g){if(g.target){if(g.target!==e)return true}else if(g.srcElement)if(g.srcElement!==e)return true;if(this.explorer.preventDefaultFunc&&this.explorer.preventDefaultFunc(g,this._modelIterator.cursor()))return true;if(g.keyCode===dojo.keys.DOWN_ARROW)return this.onUpArrow(g);else if(g.keyCode===
dojo.keys.UP_ARROW)return this.onDownArrow(g);else if(g.keyCode===dojo.keys.RIGHT_ARROW){if(!g.ctrlKey)return this.onRihgtArrow(g)}else if(g.keyCode===dojo.keys.LEFT_ARROW){if(!g.ctrlKey)return this.onLeftArrow(g)}else if(g.keyCode===dojo.keys.SPACE){if(!g.ctrlKey)return this.onSpace(g)}else if(g.keyCode===dojo.keys.ENTER)return this.onEnter(g)})));b=dojo.connect(e,"onblur",dojo.hitch(this,function(){this.explorer.onFocus?this.explorer.onFocus(false):this.toggleCursor(null,false)}));c=dojo.connect(e,
"onfocus",dojo.hitch(this,function(){this.explorer.onFocus?this.explorer.onFocus(true):this.toggleCursor(null,true)}));this._listeners.push(b);this._listeners.push(c)}a.prototype={_init:function(b){if(b){this.preventDefaultFunc=b.preventDefaultFunc;this.postDefaultFunc=b.postDefaultFunc}},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)dojo.disconnect(this._listeners[b])},_getEventListeningDiv:function(){if(this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function")return this.explorer.keyEventListeningDiv();return this.explorer.myTree._parent},isExpandable:function(b){if(!b)return false;return dojo.byId(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?true:false},isExpanded:function(b){if(!b)return false;return this.explorer.myTree.isExpanded(this.model.getId(b))},refreshModel:function(b,c){this.topIterationNodes=[];this.model=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(this.model.root&&
this.model.root.children)this.topIterationNodes=this.model.root.children;this._modelIterator.setTree(this.topIterationNodes);c||this._modelIterator.reset()},toggleCursor:function(b,c){(b=this.getRowDiv(b))&&dojo.toggleClass(b,"treeIterationCursor",c)},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,c,e){e=e===undefined?false:e;var g,j;if(b||c){if(j===this._modelIterator.cursor())return;g=this._modelIterator.cursor();j=b;this._modelIterator.setCursor(j)}else{g=this._modelIterator.prevCursor();
j=this._modelIterator.cursor()}if(!(g===j&&!c)){this.toggleCursor(g,false);if(!(c&&!j)){this.toggleCursor(j,true);(b=this.getRowDiv())&&!this._visible(b)&&b.scrollIntoView(!e);this.explorer.onCursorChanged&&this.explorer.onCursorChanged(g,j)}}},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;return dojo.byId(this.model.getId(b))},iterate:function(b,c,e){if(this.topIterationNodes.length!==0)if(this._modelIterator.iterate(b,c)){this.cursorOn(null,false,b);e&&this._checkRow(this._modelIterator.prevCursor(),
true)}},_checkRow:function(b,c){if(this.explorer.renderer._useCheckboxSelection)if(b=this.getRowDiv(b)){var e=dojo.byId(this.explorer.renderer.getCheckBoxId(b.id));c=c?!e.checked:true;c!==e.checked&&this.explorer.renderer.onCheck(b,e,c,true)}},_visible:function(b){if(b.offsetWidth===0||b.offsetHeight===0)return false;var c=this.explorer.myTree._parent.getClientRects()[0];b=b.getClientRects();for(var e=0,g=b.length;e<g;e++){var j=b[e];if(j.top>=c.top&&j.top<=c.bottom&&j.bottom>=c.top&&j.bottom<=c.bottom)return true}return false},
onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){if(!b.ctrlKey){this.iterate(true,false,b.shiftKey);b.preventDefault();return false}},onDownArrow:function(b){if(!b.ctrlKey){this.iterate(false,false,b.shiftKey);b.preventDefault();return false}},onLeftArrow:function(b){var c=this._modelIterator.cursor();if(!c)return false;if(this.isExpandable(c))if(this.isExpanded(c)){this.explorer.myTree.collapse(c);b.preventDefault();return true}if(this._modelIterator.topLevel(c))this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp();else this.cursorOn(c.parent)},onRihgtArrow:function(b){var c=this._modelIterator.cursor();if(c)if(this.isExpandable(c))if(!this.isExpanded(c)){this.explorer.myTree.expand(c);b.preventDefault();return false}},onSpace:function(b){this._checkRow(null,true);b.preventDefault()},onEnter:function(b){if(this.explorer.renderer.getRowActionElement){var c=this._modelIterator.cursor();if(c){c=this.explorer.renderer.getRowActionElement(this.model.getId(c));
if(c.href)if(b.ctrlKey)window.open(c.href);else window.location.href=c.href}}}};return a}();return f});
define("orion/globalSearch/search-features",["dojo","dijit","dijit/layout/ContentPane","dijit/layout/BorderContainer"],function(d,f){var a=a||{};a.SearchUIFactory=function(){function b(c){this._parentDivID=c.parentDivID}b.prototype={buildUI:function(){this._topWidgetId=this._parentDivID+"_topWidget";this._matchWidgetId=this._parentDivID+"_matches";this._compareWidgetId=this._parentDivID+"_compare";var c=f.byId(this._topWidgetId);c&&c.destroyRecursive();c=d.marginBox(this._parentDivID);c=new f.layout.BorderContainer({id:this._topWidgetId,
width:c.w,height:c.h,region:"center",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});var e=new f.layout.BorderContainer({id:this._matchWidgetId,region:"center",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true}),g=new f.layout.BorderContainer({id:this._compareWidgetId,region:"bottom",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});d.addClass(e.domNode,"topBorder");d.addClass(g.domNode,"bottomBorderReplace");
c.placeAt(this._parentDivID);c.addChild(e);c.addChild(g);c.startup()},destroy:function(){this._topWidgetId=this._parentDivID+"_topWidget";var c=f.byId(this._topWidgetId);c&&c.destroyRecursive()},getMatchDivID:function(){return this._matchWidgetId},getCompareDivID:function(){return this._compareWidgetId}};return b}();return a});
define("orion/compare/compare-features",["dojo","dijit","dijit/layout/ContentPane","dijit/layout/BorderContainer"],function(d,f){var a=a||{};a.TwoWayCompareUIFactory=function(){function b(c){this._parentDivID=c.parentDivID;this._commandSpanId=c.commandSpanId;this._showTitle=c.showTitle;this._leftTitle=c.leftTitle;this._rightTitle=c.rightTitle;this._showLineStatus=c.showLineStatus}b.prototype={_createNoWrapTextDiv:function(c,e,g,j){var i=document.createElement("table");i.width="100%";var k=document.createElement("tr");
i.appendChild(k);var m=document.createElement("td");m.noWrap=true;if(g)m.align=g;k.appendChild(m);g=document.createElement("h2");g.id=c;d.place(document.createTextNode(e),g,"only");m.appendChild(g);if(j&&!this._commandSpanId){this._commandSpanId="compare_rightContainerCommands";m=document.createElement("td");m.id=this._commandSpanId;k.appendChild(m);m.noWrap=true;m.align="right";i.align="right"}return i},_createEditorParentDiv:function(c){c=new f.layout.ContentPane({id:c,region:"center"});d.addClass(c.domNode,
"paneScrolled");d.addClass(c.domNode,"compareEditorParent");return c},_createCompareCanvasDiv:function(c){var e=new f.layout.ContentPane({region:"leading",splitter:false});d.addClass(e.domNode,"canvasContainer");var g=document.createElement("canvas");g.id=c;g.width=46;g.height=3E3;d.toggleClass(g,"compareCanvas",true);e.attr("content",g);return e},_appendDomNode:function(c,e){e.placeAt(c)},_createTileDiv:function(c,e,g){c=this._createNoWrapTextDiv(c,e?e:"Compare...","left",g);e=new f.layout.ContentPane({region:"top"});
d.addClass(e.domNode,"titleContainer");e.attr("content",c);return e},_createStatusDiv:function(c){c=this._createNoWrapTextDiv(c,"Line 0 : Col 0","center");var e=new f.layout.ContentPane({region:"bottom"});d.addClass(e.domNode,"statusContainer");e.attr("content",c);return e},_createLeftEditorParentDiv:function(c,e){return this._createEditorParentDiv(c,e)},_createRightEditorParentDiv:function(c,e){var g=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,
persist:false,splitter:false});d.addClass(g.domNode,"borderContainer");this._appendDomNode(g,this._createCompareCanvasDiv(e));this._appendDomNode(g,this._createEditorParentDiv(c));return g},_createLeftBorder:function(){var c=new f.layout.BorderContainer({region:"leading",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});d.addClass(c.domNode,"leftBorder");if(this._showTitle){this._leftTitleDivId=this._parentDivID+"_left_title_id";this._appendDomNode(c,this._createTileDiv(this._leftTitleDivId,
this._leftTitle,false))}this._leftEditorParentDivId=this._parentDivID+"_left_editor_id";this._appendDomNode(c,this._createLeftEditorParentDiv(this._leftEditorParentDivId));if(this._showLineStatus){this._leftStatusDivId=this._parentDivID+"_left_status_id";this._appendDomNode(c,this._createStatusDiv(this._leftStatusDivId))}return c},_createRightBorder:function(){var c=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,persist:false,splitter:false});d.addClass(c.domNode,
"rightBorder");if(this._showTitle){this._rightTitleDivId=this._parentDivID+"_right_title_id";this._appendDomNode(c,this._createTileDiv(this._rightTitleDivId,this._rightTitle,true))}this._rightEditorParentDivId=this._parentDivID+"_right_editor_id";this._diffCanvasDivId=this._parentDivID+"_diff_canvas_id";this._appendDomNode(c,this._createRightEditorParentDiv(this._rightEditorParentDivId,this._diffCanvasDivId));if(this._showLineStatus){this._rightStatusDivId=this._parentDivID+"_right_status_id";this._appendDomNode(c,
this._createStatusDiv(this._rightStatusDivId))}return c},buildUI:function(){this._topWidgetId=this._parentDivID+"_topWidget";var c=f.byId(this._topWidgetId);c&&c.destroyRecursive();var e=this._createLeftBorder(),g=this._createRightBorder();c=d.marginBox(this._parentDivID);c=new f.layout.BorderContainer({id:this._topWidgetId,width:c.w,height:c.h,region:"center",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});c.placeAt(this._parentDivID);c.addChild(e);c.addChild(g);
c.startup()},getEditorParentDivId:function(c){return c?this._leftEditorParentDivId:this._rightEditorParentDivId},getTitleDivId:function(c){return c?this._leftTitleDivId:this._rightTitleDivId},getStatusDivId:function(c){return c?this._leftStatusDivId:this._rightStatusDivId},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDivId:function(){return this._diffCanvasDivId}};return b}();return a});
define("orion/compare/diff-parser",[],function(){var d=d||{};d.DiffParser=function(){function f(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;f.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,e,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 j=0;j<c;j++){var i=this._parseHunkRange(j);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(e);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,e,g){if(!(g===e&&b===" ")){e=[e,g-e,"s"];if(b==="-")e[2]="r";else if(b==="+")e[2]="a";else if(b==="c")e[2]="c";c.push(e)}},_createMinusBlock:function(b,c,e){var g=this._oBlocks.length;
if(g===0||b!==this._oBlocks[g-1][0]){this._oBlocks.push([b===0?1:b,e]);this._nBlocks.push([c,0,-2])}else this._oBlocks[g-1][1]+=e},_createPlusBlock:function(b,c,e,g){var j=this._nBlocks.length;if(j===0||c!==this._nBlocks[j-1][0]){this._oBlocks.push([b===0?1:b,0]);this._nBlocks.push([c,e,g])}else{this._nBlocks[j-1][1]+=e;this._nBlocks[j-1][2]=g}},_parseHunkBlock:function(b){for(var c=" ",e=this._hunkRanges[b][0]+1,g=b===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[b+1][0],j=
0,i=0,k=this._hunkRanges[b][1],m=this._hunkRanges[b][3],p=e,w=e;w<g;w++)if(0!==this._diffContents[w].length){var t=this._diffContents[w][0];if(t==="\\")if("\\ No newline at end of file"===this._diffContents[w].substring(0,this._diffContents[w].length-1)||"\\ No newline at end of file"===this._diffContents[w]){if(c==="-")this._oNewLineAtEnd=false;else if(c===" ")this._oNewLineAtEnd=this._nNewLineAtEnd=false;else this._nNewLineAtEnd=false;if(w>e&&this._diffContents[w-1][this._diffContents[w-1].length-
1]==="\r")this._diffContents[w-1]=this._diffContents[w-1].substring(0,this._diffContents[w-1].length-1);continue}switch(t){case "-":case "+":case " ":break;default:continue}if(c!==t){if(t==="+")p=w;switch(c){case " ":k=this._hunkRanges[b][1]+j;m=this._hunkRanges[b][3]+i;break;case "-":this._createMinusBlock(k,m,this._hunkRanges[b][1]+j-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[b][3]+i-m,p);break;default:}c=t}switch(t){case "-":j++;break;case "+":i++;break;case " ":j++;i++;break}}switch(c){case "-":this._createMinusBlock(k,
m,this._hunkRanges[b][1]+j-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[b][3]+i-m,p);break}},_detectConflictes:function(b,c){if(b<0)return false;c=b+c;for(b=b;b<c;b++){var e=this._diffContents[b];if(e.indexOf("<<<<<")>-1||e.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(b){for(var c=this._oBlocks.length,e=this._oFileContents.length,g=0,j=1,i=0;i<c;i++){j=this._oBlocks[i][0]-j;if(j>0){this._deltaMap.push([j,j,0]);g+=j}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];j=this._oBlocks[i][0]+this._oBlocks[i][1]}if(0<e-j){this._deltaMap.push([e-j+1,e-j+1,0]);g+=e-j+1}if(g<e){j=e-g;b=this._deltaMap[this._deltaMap.length-1];if(b[2]===0){b[0]+=j;b[1]+=j}else if(b[2]===-1)this._deltaMap.push([j,j,0]);else if(this._nNewLineAtEnd===this._oNewLineAtEnd)this._deltaMap.push([j,
j,0]);else{if(this._nNewLineAtEnd)b[0]+=j;if(this._oNewLineAtEnd)b[1]+=j}}},_buildNewFile:function(){for(var b=1,c=false,e=this._deltaMap.length,g=0;g<e;g++){c=false;if(this._deltaMap[g][2]===0){for(var j=0;j<this._deltaMap[g][0];j++)this._nFileContents.push(this._oFileContents[b+j-1]);c=true}else if(this._deltaMap[g][2]>0)for(j=0;j<this._deltaMap[g][0];j++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+j-1].substring(1));b+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},
_parseHRangeBody:function(b,c){if(0<b.indexOf(",")){var e=b.split(",");b=parseInt(e[0]);e=parseInt(e[1]);c.push(b>=0?b:1);c.push(e>=0?e: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 e=c.indexOf("@@");if(!(e<0)){c=c.substring(0,e);e=c.indexOf("-");var g=c.indexOf("+");if(!(e<0||g<0)){b=[b];if(e<g){c=c.substring(e+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 f}();return d});
define("orion/compare/compareUtils",[],function(){var d=d||{};d.compareUtils=d.compareUtils||{};d.compareUtils.lookUpMapper=function(f,a,b){for(var c=0,e=0;e<f.length;e++){var g=f[e][a];if(g===0)g=1;if(b>=c&&b<c+g)return{mapperIndex:e,startFrom:c};if(e===f.length-1)break;c+=f[e][a]}return{mapperIndex:f.length-1,startFrom:c}};d.compareUtils.lookUpLineIndex=function(f,a,b){if(b===0)return 0;for(var c=0,e=0;e<b;e++)c+=f[e][a];return c};d.compareUtils.updateMapper=function(f,a,b,c,e){if(c!==e)if(c>0||
e>0){var g=d.compareUtils.lookUpMapper(f,a,b);if(!(g.mapperIndex<0)){if(c>0){c=c;var j=b-g.startFrom;for(b=g.mapperIndex;b<f.length;b++){j=f[b][a]-j;if(c<=j){f[b][a]-=c;break}f[b][a]-=j;c-=j;j=0}}if(e>0)f[g.mapperIndex][a]+=e}}};d.compareUtils.overlapMapper=function(f,a,b,c,e){f=b+f[a]-1;if(f<b)f=b;if(e<c)e=c;if(f<c||e<b)return false;return true};d.compareUtils.findFirstDiff=function(f,a,b,c){for(var e=0,g=undefined,j=0;j<f.length;j++){if(e>c)break;if(d.compareUtils.overlapMapper(f[j],a,e,b,c)){g=
{mapperIndex:j,startFrom:e};if(f[j][2]!==0)break}e+=f[j][a]}return g};d.compareUtils.matchMapper=function(f,a,b,c){if(f.length===0)return b;var e=b+Math.round((c-b)/3),g=d.compareUtils.findFirstDiff(f,a,b,c),j=f[g.mapperIndex][a]===0?g.startFrom:g.startFrom+f[g.mapperIndex][a]-1,i=d.compareUtils.lookUpLineIndex(f,1-a,g.mapperIndex),k=g.startFrom-b;if(f[g.mapperIndex][2]===0)return i-k;if(e>=g.startFrom&&e<=j)return i-Math.round((c-b)/3);if(e<g.startFrom)return i-k;return(f[g.mapperIndex][1-a]===0?
i:i+f[g.mapperIndex][1-a]-1)-(j-b)};d.compareUtils.getMapperLineCount=function(f){for(var a=0,b=0;b<f.length;b++)a+=Math.max(f[b][0],f[b][1]);return a};d.compareUtils.findNextDiff=function(f,a){var b=0;if(a>=0&&a<f.length-1)b=a+1;for(var c=b;c<f.length;c++)if(f[c][2]!==0)return c;for(c=0;c<b;c++)if(f[c][2]!==0)return c;return a};d.compareUtils.getAnnotationIndex=function(f,a){for(var b=0;b<f.length;b++)if(f[b][0]===a)return b;return-1};d.compareUtils.getAnnotationMapperIndex=function(f,a){return f[a][1]};
d.compareUtils.getAnnotationIndexByMapper=function(f,a){for(var b=0;b<f.length;b++)if(f[b][1]===a)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};d.compareUtils.isMapperConflict=function(f,a){if(a<0)return false;if(!f[a][3])return false;return f[a][3]===1};return d.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(d){var f=f||{};f.CompareRuler=function(){function a(b,c,e){this._location=b||"left";this._overview=c||"page";this._rulerStyle=e;this._editor=null;var g=this;this._listener={onModelChanged:function(j){g._onModelChanged(j)}}}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 e=[];for(b=b;b<c;b++){var g=this.getStyle(b);if(g)e[b]={html:this.getHTML(b),style:g}}return e},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();f.LineNumberCompareRuler=function(){function a(b,c,e,g,j){f.CompareRuler.call(this,c,"page",e);this._oddStyle=g||{style:{backgroundColor:"white"}};this._evenStyle=j||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}a.prototype=new f.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(),e=c.getLineCount(),g=(e+"").length;if(this._numOfDigits!==g){this._numOfDigits=g;this._editor.redrawLines(c.getLineAtOffset(b),e,this)}};return a}();f.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}();f.CompareOverviewRuler=function(){function a(b,c){f.CompareRuler.call(this,b,"document",c)}a.prototype=new f.CompareRuler;a.prototype.getStyle=function(b){var c,
e;if(b===undefined){c=this._rulerStyle||{};e=c.style||(c.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};e=c.style||(c.style={});e.cursor="pointer";e.width="8px";e.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=g.getAnnotationH(b);g=g.getLineCount();var j=this._editor.getClientArea();b=Math.floor(j.height*b/g);if(b<2)b=2;e.height=b+"px"}else e.height="3px"}return c};a.prototype.getHTML=function(){return"&nbsp;"};
a.prototype.onClick=function(b){if(b!==undefined){var c=this._editor.getLineHeight(),e=this._editor.getClientArea();c=Math.floor(e.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}();f.TwoWayCompareOverviewRuler=function(){function a(b,c,e,g){this._compareAnnotaion=e;this._onClick=g;f.CompareRuler.call(this,b,"document",c)}a.prototype=new f.CompareRuler;a.prototype.getStyle=
function(b){var c,e;if(b===undefined){c=this._rulerStyle||{};e=c.style||(c.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};e=c.style||(c.style={});e.cursor="pointer";e.width="8px";e.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=d.getAnnotationIndex(g.getAnnotations(),b);if(b===-1)return null;var j=d.getAnnotationMapperIndex(g.getAnnotations(),b);if(j=d.isMapperConflict(g.getMapper(),j))e.border=
"1px #FF0000 solid";if(b===this._compareAnnotaion.getCurrentAnnotationIndex())e.backgroundColor=j?"red":"blue";b=g.getAnnotationH(b);g=g.getAnnotationLineCount();j=this._editor.getClientArea();g=Math.floor(j.height*b/g);if(g<2)g=2;e.height=g+"px"}else e.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}();f.CompareMatchRenderer=function(){function a(b){this._canvasDiv=b;this._mapper=undefined;this._initialized=false;this._annotation=new f.CompareAnnotation}a.prototype={init:function(b,c,e){this._initialized=true;this._mapper=b;this._leftEditor=c;this._rightEditor=e;this._annotation.init(b,e);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 e=b.getLineHeight(),g=b.getClientArea();e=Math.floor(g.height/e/3);b.setTopIndex(c-e>0?c-e:0)},_findBaseLine:function(b){var c=b.getLineHeight(),e=b.getClientArea();c=Math.floor(e.height/c/3);return b.getTopIndex()+c},matchPositionFrom:function(b){var c=b?this._leftEditor:this._rightEditor,e=b?this._rightEditor:this._leftEditor,g=c.getTopIndex();c=c.getBottomIndex();b=d.matchMapper(this._mapper,b?0:1,g,c);e.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,e){var g=b.getModel().getLineIndexFromMapper(c);c=g+this._mapper[c][e]-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(),e=this._leftEditor.getBottomIndex(),g=this._rightEditor.getTopIndex(),j=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var i=0,k=0,m=false,p=0;p<this._mapper.length;p++){if(this._mapper[p][2]!==
0)if(d.overlapMapper(this._mapper[p],0,i,c,e)||d.overlapMapper(this._mapper[p],1,k,g,j)){this._renderCurve(p,i,k,this._canvasDiv,b,c,e,g,j);m=true}else if(m)break;i+=this._mapper[p][0];k+=this._mapper[p][1]}b.stroke()}},_renderCurve:function(b,c,e,g,j){var i=this._mapper[b];c=this._leftEditor.getLinePixel(c+i[0]/2)+i[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();e=this._rightEditor.getLinePixel(e+i[1]/2)+i[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();g=g.parentNode.clientWidth;
if(b===this.getCurrentMapperIndex()){j.stroke();j.strokeStyle="#000";j.lineWidth=1;j.beginPath();j.moveTo(0,c);j.bezierCurveTo(g/3,c,g*0.666,e,g,e);j.stroke();j.strokeStyle="#AAAAAA";j.lineWidth=1;j.beginPath()}else{j.moveTo(0,c);j.bezierCurveTo(g/3,c,g*0.666,e,g,e);j.stroke()}},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)if(b.removedLineCount>0||b.addedLineCount>0)this.render()}};return a}();return f});
define("orion/textview/eventTarget",[],function(){function d(){}d.addMixin=function(f){var a=d.prototype;for(var b in a)if(a.hasOwnProperty(b))f[b]=a[b]};d.prototype={addEventListener:function(f,a,b){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[f];c||(c=this._eventTypes[f]={level:0,listeners:[]});c.listeners.push({listener:a,useCapture:b})},dispatchEvent:function(f){if(this._eventTypes){var a=f.type,b=this._eventTypes[a];if(b){var c=b.listeners;try{b.level++;if(c)for(var e=0,g=
c.length;e<g;e++)if(c[e]){var j=c[e].listener;if(typeof j==="function")j.call(this,f);else j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(f)}}finally{b.level--;if(b.compact&&b.level===0){for(f=c.length-1;f>=0;f--)c[f]||c.splice(f,1);c.length===0&&delete this._eventTypes[a];b.compact=false}}}}},isListening:function(f){if(!this._eventTypes)return false;return this._eventTypes[f]!==undefined},removeEventListener:function(f,a,b){if(this._eventTypes){var c=this._eventTypes[f];if(c){for(var e=
c.listeners,g=0,j=e.length;g<j;g++){var i=e[g];if(i&&i.listener===a&&i.useCapture===b){if(c.level!==0){e[g]=null;c.compact=true}else e.splice(g,1);break}}e.length===0&&delete this._eventTypes[f]}}}};return{EventTarget:d}});
define("orion/compare/compare-inline-model",["orion/textview/eventTarget"],function(d){var f=f||{};f.CompareTextModel=function(){function a(b,c,e){this._model=b;this._mapperColumnIndex=c.columnIndex;this._mapper=c.mapper;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};b.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Changed",this._listener.onChanged);this._lineFeeder=e;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 e=0,g=0;g<=b.blockNumber;g++){if(g>=this._dummyLBlock.length)break;for(var j=g===b.blockNumber?b.stopAtDelta:this._dummyLBlock[g][1]-1,i=0;i<=j;i++){var k=c?this._lineFeeder.getLineAt(this._dummyLBlock,g,i,true):this._lineFeeder.getLineAt(this._dummyLBlock,
g,i,!(g===b.blockNumber&&i===j));e+=k.length}}return e},lookUpRealIndex:function(b){for(var c=0,e=0,g=0;g<this._dummyLBlock.length;g++){var j=this._dummyLBlock[g][0],i=j+this._dummyLBlock[g][1]-1;if(b<j)break;if(b>=j&&b<=i)return{lineIndex:-1,gapsBefore:c+b-j,lastGapInfo:{blockNumber:g,stopAtDelta:b-j}};e=this._dummyLBlock[g][1];c+=e}return{lineIndex:b-c,gapsBefore:c,lastGapInfo:{blockNumber:g-1,stopAtDelta:e-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 e=this.getLineCount();if(!(0<=b&&b<e))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(),e=0,g=0;e<c;){var j=this.lookUpRealIndex(e);if(j.lineIndex<
0)g+=this._lineFeeder.getLineAt(this._dummyLBlock,j.lastGapInfo.blockNumber,j.lastGapInfo.stopAtDelta,true).length;else{j=this._model.getLine(j.lineIndex,true);g+=j?j.length:0}e++;if(g>b)break}if(e>c)return c-1;return e-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;var g=this.lookUpRealIndex(b);e=0;if(g.lineIndex<0){e+=this._getDummyCharCountAt(g.lastGapInfo,
c);b=b-g.gapsBefore;if(b>0)e+=this._model.getLineEnd(b-1,true)}else{e+=this._getDummyCharCountAt(g.lastGapInfo,true);e+=this._model.getLineEnd(g.lineIndex,c)}return e},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 e=this.getLineAtOffset(b),g=this.getLineAtOffset(c),j=this.getLineStart(e),i=this.getLineEnd(g,
true),k=this.getLine(e,true);if(!k)return this._model.getText(b,c);if(e===g)return k.substring(b-j,k.length-i+c);j=k.substring(b-j);k=this.getLine(g,true);if(!k)return this._model.getText(b,c);b=k.substring(0,k.length-i+c);c="";for(e=e+1;e<g;e++)c+=this.getLine(e,true);return j+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}();f.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,e){var g=[];this._mapper=b;if(e){this._diffLinesArray=e.array;this._diffLinesArrayIndex=e.index}this._annotations=[];e=b=0;for(var j=1-c,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===0?this._mapper[k][c]:this._mapper[k][c]+
this._mapper[k][j];if(this._mapper[k][2]>0){var m=this._mapper[k][c];b+=m;g.push([e+this._mapper[k][j],m,this._mapper[k][2]])}this._mapper[k][2]!==0&&this._annotations.push([e,k,i]);e+=i}return{gapBlocks:g,gapNumber:b}},getLineAt:function(b,c,e,g){c=b[c][2];c+=e-1;e=this._diffLinesArray[c];e===undefined&&console.log(b);e=e.substring(this._diffLinesArrayIndex);if(g)return e+this._lineDelimeter;return e},getLineType:function(b,c){for(var e=0,g=1-c,j=0,i=0;i<this._mapper.length;i++){j=this._mapper[i][2]===
0?this._mapper[i][c]:this._mapper[i][c]+this._mapper[i][g];if(b>=e&&b<e+j){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]+e)return{type:"removed",mapperIndex:i};return{type:"added",mapperIndex:i}}e+=j}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(b,c){if(this._mapper.length===0)return b;for(var e=0,g=0,
j=1-c,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===0?this._mapper[k][c]:this._mapper[k][c]+this._mapper[k][j];if(b>=e&&b<e+i){j=b-e;if(this._mapper[k][2]===0)return g+j;else if(this._mapper[k][2]<0)return c===0?-1:g+j;else if(this._mapper[k][1]===0)return c===0?g+j:-1;else if(b<this._mapper[k][1]+e)return c===0?-1:g+j;return c===0?g+j-this._mapper[k][1]:-1}e+=i;g+=this._mapper[k][c]}return b},getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};
return a}();f.GapLineFeeder=function(){function a(b){this._lineDelimeter=b;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(b,c){var e=[];this._mapper=b;this._annotations=[];for(var g=b=0,j=1-c,i=0;i<this._mapper.length;i++){if(this._mapper[i][c]<this._mapper[i][j]){var k=this._mapper[i][j]-this._mapper[i][c];b+=k;e.push([g+this._mapper[i][c],k,1])}k=Math.max(this._mapper[i][j],this._mapper[i][c]);this._mapper[i][2]!==0&&this._annotations.push([g,i,k]);
g+=k}return{gapBlocks:e,gapNumber:b}},getLineAt:function(b,c,e,g){if(g)return this._lineDelimeter;return""},getLineType:function(b,c){for(var e=0,g=1-c,j=0;j<this._mapper.length;j++){var i=Math.max(this._mapper[j][c],this._mapper[j][g]);if(b>=e&&b<e+i){if(this._mapper[j][2]===0)return"unchnaged";else if(this._mapper[j][2]<0)return"removed";else if(this._mapper[j][1]===0)return"added";else if(b<this._mapper[j][c]+e)return"changed";return"changed_gap"}e+=Math.max(this._mapper[j][c],this._mapper[j][g])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};return a}();return f});
define("orion/compare/compare-2way-model",["orion/compare/compareUtils","orion/textview/eventTarget"],function(d,f){var a=a||{};a.TwoWayCompareModel=function(){function b(c,e){this._model=c;this._mapperColumnIndex=e.columnIndex;this._mapper=e.mapper;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};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 e=d.lookUpMapper(this._mapper,this._mapperColumnIndex,c);if(e.mapperIndex>-1)if(this._mapper[e.mapperIndex][2]!==0){var g=this._mapper[e.mapperIndex][this._mapperColumnIndex];if(g===0)return{type:"top-only",mapperIndex:e.mapperIndex};if(g===1)return{type:"oneline",mapperIndex:e.mapperIndex};if(c===e.startFrom)return{type:"top",mapperIndex:e.mapperIndex};
if(c===e.startFrom+g-1)return{type:"bottom",mapperIndex:e.mapperIndex};return{type:"middle",mapperIndex:e.mapperIndex}}return{type:"unchanged",mapperIndex:e.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var c=0,e=0;e<this._mapper.length;e++){this._mapper[e][2]!==0&&this._annotations.push([c,e]);c+=this._mapper[e][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,e,g,j,i){j!==i&&d.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(c),j,i)},getCharCount:function(){return this._model.getCharCount()},
getLine:function(c,e){return this._model.getLine(c,e)},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,e){return this._model.getLineEnd(c,e)},getLineStart:function(c){return this._model.getLineStart(c)},setText:function(c,e,g){this._model.setText(c,e,g)},getText:function(c,
e){return this._model.getText(c,e)},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)}};f.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 f=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return f[(b<<0)+1]})}},"pt-br":true});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,f,a){function b(c,e){this.editor=c;this.textView=c.getTextView();this.contentAssistPanel=document.getElementById(e);this.active=false;this.prefix="";this.filteredProviders=[];this.proposals=[];var g=this;this.contentAssistListener={onModelChanging:function(j){g.ignoreNextChange=g.isIgnorable(j)},onModelChanged:function(j){g.ignoreNextChange?g.cancel():g.showContentAssist(true,
j);g.ignoreNextChange=false},onScroll:function(){g.cancel()},onMouseUp:function(j){j.event.target.parentElement!==g.contentAssistPanel&&g.cancel()}};this.init()}b.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new f.KeyBinding(" ",false,false,false,true):new f.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 e=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||e&&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 e=this.contentAssistPanel.childNodes,g=0;g<e.length;g++){var j=e[g];if(j.className==="selected")j.className="";if(j===c){j.className="selected";j.focus();if(j.offsetTop<this.contentAssistPanel.scrollTop)j.scrollIntoView(true);else j.offsetTop+j.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&j.scrollIntoView(false)}}},getSelectedNode:function(){var c=this.getSelectedIndex();return c===-1?null:this.contentAssistPanel.childNodes[c]},
getSelectedIndex:function(){for(var c=this.contentAssistPanel.childNodes,e=0;e<c.length;e++)if(c[e].className==="selected")return e;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,e){if(this.contentAssistPanel){this.dispatchEvent({type:c?"show":"hide",data:null});if(c){var g=e?e.start+e.addedCharCount:this.textView.getCaretOffset();
c=g;for(var j;c>0&&(97<=(j=this.textView.getText(c-1,c).charCodeAt(0))&&j<=122||65<=j&&j<=90||j===95||48<=j&&j<=57);)c--;this.prefix=this.textView.getText(c,g);j=this.textView.getText();c=this.textView.getSelection();c.offset=g;this.getKeywords(this.prefix,j,c).then(function(i){this.proposals=[];for(var k=0;k<i.length;k++){var m=i[k];if(!(m===null||m===undefined))if(this.matchesPrefix(m)||this.matchesPrefix(m.proposal))this.proposals.push(m)}if(this.proposals.length===0)this.cancel();else{i=this.textView.getLocationAtOffset(g);
i.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(k=0;k<this.proposals.length;k++)this.createDiv(this.getDisplayString(this.proposals[k]),k===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;k=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>k)this.contentAssistPanel.style.left=k-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,e,g){var j=document.createElement("div");if(e)j.className="selected";c=document.createTextNode(c);j.appendChild(c,j);g.appendChild(j)},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,e,g){function j(x){if(x)k=k.concat(x);++m===w.length&&p.done(k)}function i(){++m===w.length&&p.done(k)}for(var k=[],m=0,p=new this.Promise,w=this.filteredProviders,t=0;t<w.length;t++){var u=w[t],v=u.getKeywords;if(typeof u.computeProposals==="function")v=u.computeProposals;(u=v.apply(u,[c,e,g]))&&u.then?u.then(j,i):j(u)}return p},
Promise:function(){function c(){}c.prototype.then=function(e){this.callback=e;if(this.result){var g=this;setTimeout(function(){g.callback(g.result)},0)}};c.prototype.done=function(e){this.result=e;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,e){this.offset=b;this.text=c;this.previousText=e}function f(){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 e=this;this._listener={onChanging:function(g){e._onChanging(g)},onDestroy:function(g){e._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,e,g,j){var i=g.getModel();if(i.mapOffset&&g.annotationModel){var k=i.mapOffset(b,true);if(k<0)for(var m=g.annotationModel.getAnnotations(b,b+1);m.hasNext();){var p=m.next();if(p.type==="orion.annotation.folding"){p.expand();k=i.mapOffset(b,true);break}}if(k<0)return;b=k}g.setText(c,b,b+e.length);j&&g.setSelection(b,
b+c.length)}};f.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 e=this.changes.length-1;e>=0;e--)this.changes[e].undo(b,false);if(c){c=this.startSelection.start;e=this.startSelection.end;b.setSelection(this.startCaret?c:e,this.startCaret?e:c)}},redo:function(b,c){for(var e=0;e<this.changes.length;e++)this.changes[e].redo(b,false);if(c){c=this.endSelection.start;e=this.endSelection.end;
b.setSelection(this.endCaret?c:e,this.endCaret?e: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 f;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,e=b.start,g=b.removedCharCount;b=b.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==
undefined&&!(b===1&&g===0&&this._undoType===1&&e===this._undoStart+this._undoText.length||b===0&&g===1&&this._undoType===-1&&(e+1===this._undoStart||e===this._undoStart)))this._commitUndo();if(!this.compoundChange)if(b===1&&g===0){if(this._undoStart===undefined)this._undoStart=e;this._undoText+=c;this._undoType=1;return}else if(b===0&&g===1){c=this._undoText.length>0&&this._undoStart===e;this._undoStart=e;this._undoType=-1;if(c)this._undoText+=this.model.getText(e,e+g);else this._undoText=this.model.getText(e,
e+g)+this._undoText;return}this.add(new d(e,c,this.model.getText(e,e+g)))}}};return{UndoStack:a}});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/extensionCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(d,f,a,b,c,e){var g={};g.EditorCommandFactory=function(){function j(i,k,m,p,w,t,u){this.serviceRegistry=i;this.commandService=k;this.fileClient=m;this.inputManager=p;this.toolbarId=w;this.pageNavId=u;this.isReadOnly=t}j.prototype={generateEditorCommands:function(i){function k(r){var y=new c.KeyBinding;c.KeyBinding.apply(y,r);return y}
if(!this.isReadOnly){i.getTextView().setKeyBinding(new c.KeyBinding("s",true),"Save");this.inputManager.onSave?i.getTextView().setAction("Save",d.hitch(this,function(){var r=i.getText();this.inputManager.onSave(this.inputManager.getInput(),r,d.hitch(this,function(){i.setInput(this.inputManager.getInput(),null,r,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(y){y.log=true}));return true})):i.getTextView().setAction("Save",d.hitch(this,function(){var r=i.getText(),
y={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),r,y).then(d.hitch(this,function(A){this.inputManager.getFileMetadata().ETag=A.ETag;i.setInput(this.inputManager.getInput(),null,r,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(A){if(A.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&this.fileClient.write(this.inputManager.getInput(),r).then(d.hitch(this,function(h){this.inputManager.getFileMetadata().ETag=
h.ETag;i.setInput(this.inputManager.getInput(),null,r,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else A.log=true}));return true}));this.commandService.addCommand(new f.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(r){r.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 f.CommandKeyBinding("s",true));var m=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],false);this.commandService.addCommand(new f.Command({name:"Go to Line",tooltip:"Go to specified line number",id:"orion.gotoLine",parameters:m,callback:function(r){var y=i.getModel();if(r.parameters&&r.parameters.valueFor("line"))r=r.parameters.valueFor("line");else{r=y.getLineAtOffset(i.getCaretOffset());if(r=prompt("Go to line:",r+1))r=parseInt(r,
10)}r&&i.onGotoLine(r-1,0)}}),"dom");this.commandService.registerCommandContribution("orion.gotoLine",1,this.pageNavId,null,true,new f.CommandKeyBinding("l",true),new f.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);m=this.serviceRegistry.getServiceReferences("orion.edit.command");
for(var p=this.inputManager,w=function(r,y,A){A.callback=d.hitch(i,function(h){i=h?h.items||this:this;var l=i.getSelection();h=i.getModel();var o=h.getText();y.run(h.getText(l.start,l.end),o,l,p.getInput()).then(function(q){if(q&&q.text){i.setText(q.text);if(q.selection){i.setSelection(q.selection.start,q.selection.end);i.getTextView().focus()}}else if(typeof q==="string"){i.setText(q,l.start,l.end);i.setSelection(l.start,l.start+q.length);i.getTextView().focus()}});return true});return new f.Command(A)},
t=0;t<m.length;t++){for(var u=this.serviceRegistry.getService(m[t]),v={},x=m[t].getPropertyNames(),n=0;n<x.length;n++)v[x[n]]=m[t].getProperty(x[n]);v.forceSingleItem=true;u=w(v,u,b._createCommandOptions(v,m[t],this.serviceRegistry,false,function(){return p.getFileMetadata()}));this.commandService.addCommand(u,"dom");this.commandService.registerCommandContribution(u.id,t,this.toolbarId,"orion.editorActions.contributed");a.generateDomCommandsInBanner(this.commandService,i);if(v.key){x=i.getTextView();
x.setKeyBinding(k(v.key),u.id);x.setAction(u.id,u.callback)}}}}};return j}();g.UndoCommandFactory=function(){function j(i,k,m){this.serviceRegistry=i;this.commandService=k;this.toolbarId=m}j.prototype={createUndoStack:function(i){var k=new e.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){k.undo();return true});this.commandService.addCommand(new f.Command({name:"Undo",id:"orion.undo",callback:function(p){p.items.getTextView().invokeAction("Undo")}}),
"dom");var m=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",true,true):new c.KeyBinding("y",true);i.getTextView().setKeyBinding(m,"Redo");i.getTextView().setAction("Redo",function(){k.redo();return true});this.commandService.addCommand(new f.Command({name:"Redo",id:"orion.redo",callback:function(p){p.items.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",true,new f.CommandKeyBinding("z",
true));this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,"orion.editorActions.unlabeled",true,m);return k}};return j}();return g});define("orion/textview/nls/messages",{root:{multipleAnnotations:"Multiple annotations:",line:"Line: {0}",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",formatMessage:function(d){var f=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return f[(b<<0)+1]})}},"pt-br":true,"fr-fr":true});
define("orion/textview/textModel",["orion/textview/eventTarget"],function(d){function f(b,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(c)}var a=window.navigator.platform.indexOf("Win")!==-1;f.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 e=this.getLineCount();if(!(0<=b&&b<e))return null;var g=this._lineOffsets[b];if(b+1<e){b=this.getText(g,this._lineOffsets[b+
1]);if(c)return b;c=b.length;for(var j;(j=b.charCodeAt(c-1))===10||j===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 e=this.getLineCount();if(b===c)return e-1;var g,j,i=this._lastLineIndex;if(0<=i&&i<e){g=this._lineOffsets[i];j=i+1<e?this._lineOffsets[i+1]:c;if(g<=b&&b<j)return i}for(var k=e,m=-1;k-m>1;){i=Math.floor((k+m)/2);g=this._lineOffsets[i];j=i+1<e?this._lineOffsets[i+1]:c;if(b<=g)k=i;else if(b<
j){k=i;break}else m=i}return this._lastLineIndex=k},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;if(b+1<e){e=this._lineOffsets[b+1];if(c)return e;b=this.getText(Math.max(this._lineOffsets[b],e-2),e);c=b.length;for(var g;(g=b.charCodeAt(c-1))===10||g===13;)c--;return e-(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 e=0,g=0,j;g<this._text.length;){j=this._text[g].length;if(b<=e+j)break;e+=j;g++}for(var i=e,k=g;g<this._text.length;){j=this._text[g].length;if(c<=e+j)break;e+=j;g++}e=e;g=g;if(k===g)return this._text[k].substring(b-i,c-e);b=this._text[k].substring(b-i);c=this._text[g].substring(0,c-e);return b+this._text.slice(k+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,e){if(b===undefined)b="";if(c===undefined)c=0;if(e===undefined)e=this.getCharCount();if(!(c===e&&b==="")){for(var g=this.getLineAtOffset(c),j=this.getLineAtOffset(e),i=c,k=e-c,m=j-g,p=b.length,w=0,t=this.getLineCount(),u=0,v=0,x=0,n=[];;){if(u!==-1&&
u<=x)u=b.indexOf("\r",x);if(v!==-1&&v<=x)v=b.indexOf("\n",x);if(v===-1&&u===-1)break;x=u!==-1&&v!==-1?u+1===v?v+1:(u<v?u:v)+1:u!==-1?u+1:v+1;n.push(c+x);w++}this.onChanging({type:"Changing",text:b,start:i,removedCharCount:k,addedCharCount:p,removedLineCount:m,addedLineCount:w});if(n.length===0){u=this.getLineStart(g);j=j+1<t?this.getLineStart(j+1):this.getCharCount();if(c!==u){b=this.getText(u,c)+b;c=u}if(e!==j){b+=this.getText(e,j);e=j}}j=p-k;for(u=g+m+1;u<t;u++)this._lineOffsets[u]+=j;g=[g+1,m].concat(n);
Array.prototype.splice.apply(this._lineOffsets,g);for(j=n=0;j<this._text.length;){u=this._text[j].length;if(c<=n+u)break;n+=u;j++}t=n;for(g=j;j<this._text.length;){u=this._text[j].length;if(e<=n+u)break;n+=u;j++}n=n;j=j;u=this._text[j];c=this._text[g].substring(0,c-t);e=u.substring(e-n);g=[g,j-g+1];c&&g.push(c);b&&g.push(b);e&&g.push(e);Array.prototype.splice.apply(this._text,g);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:i,removedCharCount:k,addedCharCount:p,removedLineCount:m,
addedLineCount:w})}}};d.EventTarget.addMixin(f.prototype);return{TextModel:f}});
define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,f,a){function b(h,l,o,q){typeof h.addEventListener==="function"?h.addEventListener(l,o,q===true):h.attachEvent("on"+l,o)}function c(h,l,o,q){typeof h.removeEventListener==="function"?h.removeEventListener(l,o,q===true):h.detachEvent("on"+l,o)}function e(h,l,o){this.start=h;this.end=l;this.caret=o}function g(h){this._init(h)}var j=navigator.userAgent,i;if(document.selection&&
window.ActiveXObject&&/MSIE/.test(j))i=document.documentMode?document.documentMode:7;var k=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||undefined,m=j.indexOf("Opera")!==-1,p=j.indexOf("Chrome")!==-1,w=j.indexOf("Safari")!==-1&&!p,t=j.indexOf("WebKit")!==-1,u=j.indexOf("iPad")!==-1,v=navigator.platform.indexOf("Mac")!==-1,x=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==-1,r=typeof window.document.documentElement.addEventListener==="function",y=(!i||
i>=9)&&typeof window.document.createRange().getBoundingClientRect==="function",A=x?"\r\n":"\n";e.prototype={clone:function(){return new e(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(h){if(this.caret)this.start=h;else this.end=h;if(this.start>this.end){h=this.start;this.start=this.end;this.end=h;this.caret=!this.caret}},setCaret:function(h){this.end=this.start=h;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(h){return this.caret===h.caret&&this.start===h.start&&this.end===h.end}};g.prototype={addRuler:function(h){this._rulers.push(h);h.setView(this);this._createRuler(h);this._updatePage()},computeSize:function(){var h=0,l=0,o=this._model,q=this._clientDiv;if(!q)return{width:h,height:l};var s=q.style.width;
if(t)q.style.width=(524287).toString()+"px";for(var z=o.getLineCount(),C=this._frameDocument,B=0;B<z;B++){var E=this._getLineNode(B),G=null;if(!E||E.lineChanged||E.lineRemoved)E=G=this._createLine(q,null,C,B,o);E=this._getLineBoundingClientRect(E);h=Math.max(h,E.right-E.left);l+=E.bottom-E.top;G&&q.removeChild(G)}if(t)q.style.width=s;o=this._getViewPadding();h+=o.right-o.left;l+=o.bottom-o.top;return{width:h,height:l}},convert:function(h,l,o){if(this._clientDiv){var q=this._getScroll(),s=this._getViewPadding(),
z=this._frame.getBoundingClientRect(),C=this._viewDiv.getBoundingClientRect();switch(l){case "document":if(h.x!==undefined)h.x+=-q.x+C.left+s.left;if(h.y!==undefined)h.y+=-q.y+C.top+s.top;break;case "page":if(h.x!==undefined)h.x+=-z.left;if(h.y!==undefined)h.y+=-z.top;break}switch(o){case "document":if(h.x!==undefined)h.x+=q.x-C.left-s.left;if(h.y!==undefined)h.y+=q.y-C.top-s.top;break;case "page":if(h.x!==undefined)h.x+=z.left;if(h.y!==undefined)h.y+=z.top;break}return h}},destroy:function(){for(var h=
0;h<this._rulers.length;h++)this._rulers[h].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(u)this._textArea.focus();else{m&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},hasFocus:function(){return this._hasFocus},getActions:function(h){for(var l=
[],o=this._actions,q=0;q<o.length;q++)!h&&o[q].defaultHandler||l.push(o[q].name);return l},getBottomIndex:function(h){if(!this._clientDiv)return 0;return this._getBottomIndex(h)},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 h=this._getScroll();return{x:h.x,y:h.y,width:this._getClientWidth(),
height:this._getClientHeight()}},getHorizontalPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().x},getKeyBindings:function(h){for(var l=[],o=this._keyBindings,q=0;q<o.length;q++)o[q].name===h&&l.push(o[q].keyBinding);return l},getLineHeight:function(){if(!this._clientDiv)return 0;return this._getLineHeight()},getLinePixel:function(h){if(!this._clientDiv)return 0;h=Math.min(Math.max(0,h),this._model.getLineCount());return this._getLineHeight()*h},getLocationAtOffset:function(h){if(!this._clientDiv)return{x:0,
y:0};var l=this._model;h=Math.min(Math.max(0,h),l.getCharCount());l=l.getLineAtOffset(h);var o=this._getScroll(),q=this._viewDiv.getBoundingClientRect(),s=this._getViewPadding();h=this._getOffsetToX(h)+o.x-q.left-s.left;l=this.getLinePixel(l);return{x:h,y:l}},getOptions:function(){var h;if(arguments.length===0)h=this._defaultOptions();else if(arguments.length===1){h=arguments[0];if(typeof h==="string")return this._clone(this["_"+h]);h=h}else{h={};for(var l in arguments)if(arguments.hasOwnProperty(l))h[arguments[l]]=
undefined}for(var o in h)if(h.hasOwnProperty(o))h[o]=this._clone(this["_"+o]);return h},getModel:function(){return this._model},getOffsetAtLocation:function(h,l){if(!this._clientDiv)return 0;var o=this._getScroll(),q=this._viewDiv.getBoundingClientRect(),s=this._getViewPadding();l=this._getYToLine(l-o.y);h+=-o.x+q.left+s.left;return this._getXToOffset(l,h)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var h=this._getSelection();return{start:h.start,end:h.end}},getText:function(h,
l){return this._model.getText(h,l)},getTopIndex:function(h){if(!this._clientDiv)return 0;return this._getTopIndex(h)},getTopPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y},invokeAction:function(h,l){if(this._clientDiv){for(var o=this._actions,q=0;q<o.length;q++){var s=o[q];if(s.name&&s.name===h){if(!l&&s.userHandler)if(s.userHandler())return;if(s.defaultHandler)return s.defaultHandler();return false}}return false}},isLoaded:function(){return!!this._clientDiv},onContextMenu:function(h){return this.dispatchEvent(h)},
onDragStart:function(h){return this.dispatchEvent(h)},onDrag:function(h){return this.dispatchEvent(h)},onDragEnd:function(h){return this.dispatchEvent(h)},onDragEnter:function(h){return this.dispatchEvent(h)},onDragOver:function(h){return this.dispatchEvent(h)},onDragLeave:function(h){return this.dispatchEvent(h)},onDrop:function(h){return this.dispatchEvent(h)},onDestroy:function(h){return this.dispatchEvent(h)},onLineStyle:function(h){return this.dispatchEvent(h)},onLoad:function(h){return this.dispatchEvent(h)},
onModelChanged:function(h){return this.dispatchEvent(h)},onModelChanging:function(h){return this.dispatchEvent(h)},onModify:function(h){return this.dispatchEvent(h)},onMouseDown:function(h){return this.dispatchEvent(h)},onMouseUp:function(h){return this.dispatchEvent(h)},onMouseMove:function(h){return this.dispatchEvent(h)},onMouseOver:function(h){return this.dispatchEvent(h)},onMouseOut:function(h){return this.dispatchEvent(h)},onSelection:function(h){return this.dispatchEvent(h)},onScroll:function(h){return this.dispatchEvent(h)},
onVerify:function(h){return this.dispatchEvent(h)},onUnload:function(h){return this.dispatchEvent(h)},onFocus:function(h){return this.dispatchEvent(h)},onBlur:function(h){return this.dispatchEvent(h)},redraw:function(){if(!(this._redrawCount>0)){for(var h=this._model.getLineCount(),l=this.getRulers(),o=0;o<l.length;o++)this.redrawLines(0,h,l[o]);this.redrawLines(0,h)}},redrawLines:function(h,l,o){if(!(this._redrawCount>0)){if(h===undefined)h=0;if(l===undefined)l=this._model.getLineCount();if(h!==
l){var q=this._clientDiv;if(q){if(o)for(var s=(o.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,z=0;z<s.length;z++)if(s[z].firstChild._ruler===o){q=s[z].firstChild;break}if(o)q.rulerChanged=true;if(!o||o.getOverview()==="page")for(q=q.firstChild;q;){s=q.lineIndex;if(h<=s&&s<l)q.lineChanged=true;q=q.nextSibling}if(!o)if(h<=this._maxLineIndex&&this._maxLineIndex<l){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},
redrawRange:function(h,l){if(!(this._redrawCount>0)){var o=this._model;if(h===undefined)h=0;if(l===undefined)l=o.getCharCount();var q=o.getLineAtOffset(h);h=o.getLineAtOffset(Math.max(h,l-1))+1;this.redrawLines(q,h)}},removeRuler:function(h){for(var l=this._rulers,o=0;o<l.length;o++)if(l[o]===h){l.splice(o,1);h.setView(null);this._destroyRuler(h);this._updatePage();break}},setAction:function(h,l){if(h){for(var o=this._actions,q=0;q<o.length;q++){var s=o[q];if(s.name===h){s.userHandler=l;return}}o.push({name:h,
userHandler:l})}},setKeyBinding:function(h,l){for(var o=this._keyBindings,q=0;q<o.length;q++){var s=o[q];if(s.keyBinding.equals(h)){if(l)s.name=l;else if(s.predefined)s.name=null;else{h=s.name;o.splice(q,1);for(q=0;q<o.length&&h!==o[q].name;)q++;if(q===o.length){o=this._actions;for(q=0;q<o.length;q++)if(o[q].name===h)o[q].defaultHandler||o.splice(q,1)}}return}}l&&o.push({keyBinding:h,name:l})},setCaretOffset:function(h,l){var o=this._model.getCharCount();h=Math.max(0,Math.min(h,o));this._setSelection(new e(h,
h,false),l===undefined||l)},setHorizontalPixel:function(h){if(this._clientDiv){h=Math.max(0,h);this._scrollView(h-this._getScroll().x,0)}},setRedraw:function(h){if(h)--this._redrawCount===0&&this.redraw();else this._redrawCount++},setModel:function(h){if(h)if(h!==this._model){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);var l=this._model.getLineCount(),o=this._model.getCharCount(),q=h.getLineCount(),
s=h.getCharCount(),z={type:"ModelChanging",text:h.getText(),start:0,removedCharCount:o,addedCharCount:s,removedLineCount:l,addedLineCount:q};this.onModelChanging(z);this._model=h;z={type:"ModelChanged",start:0,removedCharCount:o,addedCharCount:s,removedLineCount:l,addedLineCount:q};this.onModelChanged(z);this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);this._reset();this._updatePage()}},setOptions:function(h){var l=
this._defaultOptions(),o=false,q,s=this._clientDiv;if(s)for(q in h)if(h.hasOwnProperty(q))if(l[q].recreate){o=true;break}var z=false;for(q in h)if(h.hasOwnProperty(q)){var C=h[q];if(!this._compare(this["_"+q],C)){z=true;if(!o){var B=l[q].update;if(s&&B){if(B.call(this,C))o=true;continue}}this["_"+q]=this._clone(C)}}if(z)if(o){this._frame.parentNode.removeChild(this._frame);this._parent.appendChild(this._frame)}},setSelection:function(h,l,o){var q=h>l;if(q){var s=h;h=l;l=s}s=this._model.getCharCount();
h=Math.max(0,Math.min(h,s));l=Math.max(0,Math.min(l,s));this._setSelection(new e(h,l,q),o===undefined||o)},setText:function(h,l,o){var q=l===undefined&&o===undefined;if(l===undefined)l=0;if(o===undefined)o=this._model.getCharCount();this._modifyContent({text:h,start:l,end:o,_code:true},!q);if(q){this._columnX=-1;this._setSelection(new e(0,0,false),true);k&&this._fixCaret()}},setTopIndex:function(h){if(this._clientDiv){var l=this._model;if(l.getCharCount()!==0){l=l.getLineCount();var o=this._getLineHeight(),
q=Math.max(1,Math.min(l,Math.floor(this._getClientHeight()/o)));if(h<0)h=0;else if(h>l-q)h=l-q;this._scrollView(0,h*o-this._getScroll().y)}}},setTopPixel:function(h){if(this._clientDiv){var l=this._getLineHeight(),o=this._getClientHeight(),q=this._model.getLineCount();h=Math.min(Math.max(0,h),l*q-o);this._scrollView(0,h-this._getScroll().y)}},showSelection:function(){return this._showCaret(true)},_handleBodyMouseDown:function(h){if(!h)h=window.event;if(k&&h.which===1){this._clientDiv.contentEditable=
false;this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=true}for(var l=m||k&&!this._overlayDiv?this._clientDiv:this._overlayDiv||this._viewDiv,o=h.target?h.target:h.srcElement;o;){if(l===o)return;o=o.parentNode}h.preventDefault&&h.preventDefault();h.stopPropagation&&h.stopPropagation();if(!r){l.setCapture();setTimeout(function(){l.releaseCapture()},0)}},_handleBodyMouseUp:function(h){if(!h)h=window.event;if(k&&h.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 h=this._frameDocument,l=h.createElement("DIV");h=h.body;h.appendChild(l);h.removeChild(l)}if(k||i)if(this._selDiv1){l=i?"transparent":"#AFAFAF";this._selDiv1.style.background=l;this._selDiv2.style.background=l;this._selDiv3.style.background=l}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleContextMenu:function(h){if(!h)h=window.event;
k&&this._lastMouseButton===3&&h.timeStamp-this._lastMouseTime<=this._clickTime&&this._updateDOMSelection();if(this.isListening("ContextMenu")){var l=this._createMouseEvent("ContextMenu",h);l.screenX=h.screenX;l.screenY=h.screenY;this.onContextMenu(l)}h.preventDefault&&h.preventDefault();return false},_handleCopy:function(h){if(!this._ignoreCopy){if(!h)h=window.event;if(this._doCopy(h)){h.preventDefault&&h.preventDefault();return false}}},_handleCut:function(h){if(!h)h=window.event;if(this._doCut(h)){h.preventDefault&&
h.preventDefault();return false}},_handleDOMAttrModified:function(h){if(!h)h=window.event;for(var l=false,o=this._parent;o;){if(o===h.target){l=true;break}o=o.parentNode}if(l){h=this._getVisible();if(h==="visible")this._createView();else h==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(h){if(!h)h=window.event;this._lastMouseTime=h.timeStamp?h.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(h)}},
_handleDragStart:function(h){if(!h)h=window.event;if(k){var l=this;setTimeout(function(){l._clientDiv.contentEditable=true;l._clientDiv.draggable=false;l._ignoreBlur=false},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1){this._isMouseDown=false;this.onDragStart(this._createMouseEvent("DragStart",h));this._dragOffset=-1}else{h.preventDefault&&h.preventDefault();return false}},_handleDrag:function(h){if(!h)h=window.event;this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",
h))},_handleDragEnd:function(h){if(!h)h=window.event;this._dropTarget=false;this._dragOffset=-1;this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",h));if(k){this._fixCaret();h.dataTransfer.dropEffect==="none"&&!h.dataTransfer.mozUserCancelled&&this._fixCaret()}},_handleDragEnter:function(h){if(!h)h=window.event;var l=true;this._dropTarget=true;if(this.isListening("DragEnter")){l=false;this.onDragEnter(this._createMouseEvent("DragEnter",h))}if(t||l){h.preventDefault&&h.preventDefault();
return false}},_handleDragOver:function(h){if(!h)h=window.event;var l=true;if(this.isListening("DragOver")){l=false;this.onDragOver(this._createMouseEvent("DragOver",h))}if(t||l){if(l)h.dataTransfer.dropEffect="none";h.preventDefault&&h.preventDefault();return false}},_handleDragLeave:function(h){if(!h)h=window.event;this._dropTarget=false;this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",h))},_handleDrop:function(h){if(!h)h=window.event;this._dropTarget=false;this.isListening("Drop")&&
this.onDrop(this._createMouseEvent("Drop",h));h.preventDefault&&h.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;i&&this._updateDOMSelection();if(k||i)if(this._selDiv1){var h=this._hightlightRGB;this._selDiv1.style.background=h;this._selDiv2.style.background=h;this._selDiv3.style.background=h}this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(h){if(!h)h=window.event;if(u){if(h.keyCode===8){this._doBackspace({});
h.preventDefault()}}else{switch(h.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(h.keyCode===229){if(this._readonly){h.preventDefault&&h.preventDefault();return false}var l=true;if(w&&v)if(h.ctrlKey)l=false;l&&this._startIME()}else this._commitIME();if((v||n)&&k<4||m){this._keyDownEvent=h;return true}if(this._doAction(h)){if(h.preventDefault)h.preventDefault();else{h.cancelBubble=true;h.returnValue=false;h.keyCode=0}return false}}},_handleKeyPress:function(h){if(!h)h=
window.event;if(v&&t)if(63232<=h.keyCode&&h.keyCode<=63487||h.keyCode===13||h.keyCode===8){h.preventDefault&&h.preventDefault();return false}if((v||n)&&k<4||m)if(this._doAction(this._keyDownEvent)){h.preventDefault&&h.preventDefault();return false}var l=v?h.metaKey:h.ctrlKey;if(h.charCode!==undefined)if(l)switch(h.charCode){case 99:case 118:case 120:return true}l=false;if(v){if(h.ctrlKey||h.metaKey)l=true}else if(k){if(h.ctrlKey||h.altKey)l=true}else if(h.ctrlKey^h.altKey)l=true;if(!l){l=m?h.which:
h.charCode!==undefined?h.charCode:h.keyCode;if(l>31){this._doContent(String.fromCharCode(l));h.preventDefault&&h.preventDefault();return false}}},_handleKeyUp:function(h){if(!h)h=window.event;(v?h.metaKey:h.ctrlKey)||this._setLinksVisible(false);h.keyCode===13&&this._commitIME()},_handleLinkClick:function(h){if(!h)h=window.event;if(!(v?h.metaKey:h.ctrlKey)){h.preventDefault&&h.preventDefault();return false}},_handleLoad:function(){var h=this._getVisible();if(h==="visible"||h==="hidden"&&t)this._createView()},
_handleMouse:function(h){var l=true,o=this._frameWindow;if(i||k&&!this._overlayDiv)o=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=true;var q=this;setTimeout(function(){q.focus();q._ignoreFocus=false},0)}if(this._clickCount===1)(l=this._setSelectionTo(h.clientX,h.clientY,h.shiftKey,!m&&this.isListening("DragStart")))&&this._setGrab(o);else{r&&this._setGrab(o);this._doubleClickSelection=null;this._setSelectionTo(h.clientX,h.clientY,h.shiftKey);this._doubleClickSelection=
this._getSelection()}return l},_handleMouseDown:function(h){if(!h)h=window.event;this.isListening("MouseDown")&&this.onMouseDown(this._createMouseEvent("MouseDown",h));if(this._linksVisible)if((h.target||h.srcElement).tagName!=="A")this._setLinksVisible(false);else return;this._commitIME();var l=h.which;if(!l){if(h.button===4)l=2;if(h.button===2)l=3;if(h.button===1)l=1}var o=l!==2&&h.timeStamp?h.timeStamp:(new Date).getTime(),q=o-this._lastMouseTime,s=Math.abs(this._lastMouseX-h.clientX),z=Math.abs(this._lastMouseY-
h.clientY),C=this._lastMouseButton===l;this._lastMouseX=h.clientX;this._lastMouseY=h.clientY;this._lastMouseTime=o;this._lastMouseButton=l;if(l===1){this._isMouseDown=true;if(C&&q<=this._clickTime&&s<=this._clickDist&&z<=this._clickDist)this._clickCount++;else this._clickCount=1;if(this._handleMouse(h)&&(m||p||k&&!this._overlayDiv)){this._hasFocus||this.focus();h.preventDefault()}}},_handleMouseOver:function(h){if(!h)h=window.event;this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",
h))},_handleMouseOut:function(h){if(!h)h=window.event;this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",h))},_handleMouseMove:function(h){if(!h)h=window.event;if(this.isListening("MouseMove"))for(var l=this._overlayDiv||this._clientDiv,o=h.target?h.target:h.srcElement;o;){if(l===o){this.onMouseMove(this._createMouseEvent("MouseMove",h));break}o=o.parentNode}if(!this._dropTarget){l=this._linksVisible||this._lastMouseMoveX!==h.clientX||this._lastMouseMoveY!==h.clientY;
this._lastMouseMoveX=h.clientX;this._lastMouseMoveY=h.clientY;this._setLinksVisible(l&&!this._isMouseDown&&(v?h.metaKey:h.ctrlKey));if(!r){if(h.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&h.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(h,this._clickCount)}}if(!(!this._isMouseDown||this._dragOffset!==-1)){l=h.clientX;o=h.clientY;if(p)if(h.currentTarget!==this._frameWindow){h=this._frame.getBoundingClientRect();l-=h.left;o-=h.top}var q=this._getViewPadding(),
s=this._viewDiv.getBoundingClientRect(),z=this._getClientWidth(),C=this._getClientHeight();h=s.left+q.left;var B=s.top+q.top;z=s.left+q.left+z;q=s.top+q.top+C;s=this._model;C=s.getLineAtOffset(this._getSelection().getCaret());if(o<B&&C!==0)this._doAutoScroll("up",l,o-B);else if(o>q&&C!==s.getLineCount()-1)this._doAutoScroll("down",l,o-q);else if(l<h)this._doAutoScroll("left",l-h,o);else if(l>z)this._doAutoScroll("right",l-z,o);else{this._endAutoScroll();this._setSelectionTo(l,o,true);i&&this._frameDocument.body.getBoundingClientRect()}}}},
_createMouseEvent:function(h,l){var o=this._getScroll(),q=this._viewDiv.getBoundingClientRect(),s=this._getViewPadding();return{type:h,event:l,x:l.clientX+o.x-q.left-s.left,y:l.clientY+o.y-q.top}},_handleMouseUp:function(h){if(!h)h=window.event;this.isListening("MouseUp")&&this.onMouseUp(this._createMouseEvent("MouseUp",h));if(!this._linksVisible)if(h.which?h.button===0:h.button===1){if(this._dragOffset!==-1){var l=this._getSelection();l.extend(this._dragOffset);l.collapse();this._setSelection(l,
true,true);this._dragOffset=-1}this._isMouseDown=false;this._endAutoScroll();r&&this._setGrab(null);k&&h.preventDefault()}},_handleMouseWheel:function(h){if(!h)h=window.event;var l=this._getLineHeight(),o=0,q=0;if(k){l=v?h.detail*3:Math.max(-256,Math.min(256,h.detail))*l;if(h.axis===h.HORIZONTAL_AXIS)o=l;else q=l}else if(v){q=o=40;if(h.wheelDeltaX%120!==0)o=1;if(h.wheelDeltaY%120!==0)q=1;o=-h.wheelDeltaX/o;if(-1<o&&o<0)o=-1;if(0<o&&o<1)o=1;q=-h.wheelDeltaY/q;if(-1<q&&q<0)q=-1;if(0<q&&q<1)q=1}else{o=
-h.wheelDeltaX;q=-h.wheelDeltaY/120*8*l}if(w){for(l=h.target;l&&l.lineIndex===undefined;)l=l.parentNode;this._mouseWheelLine=l}l=this._getScroll();this._scrollView(o,q);o=this._getScroll();if(w)this._mouseWheelLine=null;if(l.x!==o.x||l.y!==o.y){h.preventDefault&&h.preventDefault();return false}},_handlePaste:function(h){if(!this._ignorePaste){if(!h)h=window.event;if(this._doPaste(h)){if(i){var l=this;this._ignoreFocus=true;setTimeout(function(){l._updateDOMSelection();this._ignoreFocus=false},0)}h.preventDefault&&
h.preventDefault();return false}}},_handleResize:function(){var h=this._frameDocument.documentElement,l=h.clientWidth;h=h.clientHeight;if(this._frameWidth!==l||this._frameHeight!==h){this._frameWidth=l;this._frameHeight=h;i<9?this._queueUpdatePage():this._updatePage()}},_handleRulerEvent:function(h){if(!h)h=window.event;var l=h.target?h.target:h.srcElement,o=l.lineIndex;for(l=l;l&&!l._ruler;){if(o===undefined&&l.lineIndex!==undefined)o=l.lineIndex;l=l.parentNode}l=l?l._ruler:null;if(o===undefined&&
l&&l.getOverview()==="document"){o=u?0:17;var q=this._getClientHeight(),s=this._model.getLineCount(),z=this._getViewPadding();o=Math.floor((h.clientY-o)*s/(q+z.top+z.bottom-2*o));0<=o&&o<s||(o=undefined)}if(l)switch(h.type){case "click":l.onClick&&l.onClick(o,h);break;case "dblclick":l.onDblClick&&l.onDblClick(o,h);break;case "mousemove":l.onMouseMove&&l.onMouseMove(o,h);break;case "mouseover":l.onMouseOver&&l.onMouseOver(o,h);break;case "mouseout":l.onMouseOut&&l.onMouseOut(o,h);break}},_handleScroll:function(){var h=
this._getScroll(),l=this._hScroll,o=this._vScroll;if(l!==h.x||o!==h.y){this._hScroll=h.x;this._vScroll=h.y;this._commitIME();this._updatePage(o===h.y);this.onScroll({type:"Scroll",oldValue:{x:l,y:o},newValue:h})}},_handleSelectStart:function(h){if(!h)h=window.event;if(this._ignoreSelect){h&&h.preventDefault&&h.preventDefault();return false}},_handleUnload:function(){this._frameLoaded=false;this._destroyView()},_handleInput:function(h){var l=this._textArea;this._doContent(l.value);l.selectionStart=
l.selectionEnd=0;l.value="";h.preventDefault()},_handleTextInput:function(h){this._doContent(h.data);h.preventDefault()},_touchConvert:function(h){var l=this._frame.getBoundingClientRect(),o=this._parentDocument.body;return{left:h.clientX-l.left-o.scrollLeft,top:h.clientY-l.top-o.scrollTop}},_handleTextAreaClick:function(h){h=this._touchConvert(h);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(h.left,h.top,false);this._textArea.focus()},_handleTouchStart:function(h){var l=
h.touches,o,q;this._touchMoved=false;this._touchStartScroll=undefined;if(l.length===1){o=l[0];q=o.pageY;this._touchStartX=o.pageX;this._touchStartY=q;this._touchStartTime=h.timeStamp;this._touchStartScroll=this._getScroll();h=this._getSelection();q=this._touchConvert(l[0]);this._touchGesture="none";if(!h.isEmpty())if(this._hitOffset(h.end,q.left,q.top))this._touchGesture="extendEnd";else if(this._hitOffset(h.start,q.left,q.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){l=this._textArea;
l.value="";l.style.left="-1000px";l.style.top="-1000px";l.style.width="3000px";l.style.height="3000px"}}else if(l.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}q=this._touchConvert(l[0]);o=this._getXToOffset(this._getYToLine(q.top),q.left);q=this._touchConvert(l[1]);l=this._getXToOffset(this._getYToLine(q.top),q.left);h=this._getSelection();h.setCaret(o);h.extend(l);this._setSelection(h,true,true)}},_handleTouchMove:function(h){this._touchMoved=
true;var l=h.touches,o;if(l.length===1){l=l[0];var q=l.pageX,s=l.pageY,z=this._touchStartX-q,C=this._touchStartY-s;o=this._touchConvert(l);l=this._getSelection();if(this._touchGesture==="none")this._touchGesture=h.timeStamp-this._touchStartTime<200&&(Math.abs(z)>5||Math.abs(C)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(l.end,o.left,o.top)?"extendEnd":this._hitOffset(l.start,o.left,o.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=
q;this._touchStartY=s;this._scrollView(z,C);break;case "extendStart":case "extendEnd":this._clickCount=1;o=this._getXToOffset(this._getYToLine(o.top),o.left);l.setCaret(this._touchGesture==="extendStart"?l.end:l.start);l.extend(o);if(o>=l.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(o<=l.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(l,true,true);break;case "caret":this._setSelectionTo(o.left,o.top,false);break}}else if(l.length===
2){o=this._touchConvert(l[0]);q=this._getXToOffset(this._getYToLine(o.top),o.left);o=this._touchConvert(l[1]);o=this._getXToOffset(this._getYToLine(o.top),o.left);l=this._getSelection();l.setCaret(q);l.extend(o);this._setSelection(l,true,true)}h.preventDefault()},_handleTouchEnd:function(h){var l=this;if(!this._touchMoved)if(h.touches.length===0&&h.changedTouches.length===1){var o=this._touchConvert(h.changedTouches[0]),q=this._textArea;q.value="";q.style.left="-1000px";q.style.top="-1000px";q.style.width=
"3000px";q.style.height="3000px";setTimeout(function(){l._clickCount=1;l._ignoreDOMSelection=false;l._setSelectionTo(o.left,o.top,false)},300)}h.touches.length===0&&setTimeout(function(){var s=l._getSelection(),z=l._model.getText(s.start,s.end),C=l._textArea;C.value=z;C.selectionStart=0;C.selectionEnd=z.length;if(!s.isEmpty()){z=l._touchDiv.getBoundingClientRect();s=l._getOffsetBounds(s.start);C.style.left=z.width/2+"px";C.style.top=(s.top>40?s.top-30:s.top+30)+"px"}},0)},_doAction:function(h){for(var l=
this._keyBindings,o=0;o<l.length;o++){var q=l[o];if(q.keyBinding.match(h)){if(q.name){h=this._actions;for(l=0;l<h.length;l++){o=h[l];if(o.name===q.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(h){var l=this._getSelection();if(l.isEmpty()){var o=this._model,q=l.getCaret(),s=o.getLineAtOffset(q),z=o.getLineStart(s);if(q===z)s>0&&l.extend(o.getLineEnd(s-
1));else{s=false;if(this._expandTab&&h.unit==="character"&&(q-z)%this._tabSize===0)s=!/[^ ]/.test(o.getText(z,q));s?l.extend(q-this._tabSize):l.extend(this._getOffset(q,h.unit,-1))}}this._modifyContent({text:"",start:l.start,end:l.end},true);return true},_doContent:function(h){var l=this._getSelection();this._modifyContent({text:h,start:l.start,end:l.end,_ignoreDOMSelection:true},true)},_doCopy:function(h){var l=this._getSelection();if(!l.isEmpty())return this._setClipboardText(this._getBaseText(l.start,
l.end),h);return true},_doCursorNext:function(h){if(!h.select)if(this._clearSelection("next"))return true;var l=this._model,o=this._getSelection(),q=o.getCaret(),s=l.getLineAtOffset(q);if(q===l.getLineEnd(s))s+1<l.getLineCount()&&o.extend(l.getLineStart(s+1));else o.extend(this._getOffset(q,h.unit,1));h.select||o.collapse();this._setSelection(o,true);return true},_doCursorPrevious:function(h){if(!h.select)if(this._clearSelection("previous"))return true;var l=this._model,o=this._getSelection(),q=o.getCaret(),
s=l.getLineAtOffset(q);if(q===l.getLineStart(s))s>0&&o.extend(l.getLineEnd(s-1));else o.extend(this._getOffset(q,h.unit,-1));h.select||o.collapse();this._setSelection(o,true);return true},_doCut:function(h){var l=this._getSelection();if(!l.isEmpty()){l=this._getBaseText(l.start,l.end);this._doContent("");return this._setClipboardText(l,h)}return true},_doDelete:function(h){var l=this._getSelection();if(l.isEmpty()){var o=this._model,q=l.getCaret(),s=o.getLineAtOffset(q);if(q===o.getLineEnd(s))s+1<
o.getLineCount()&&l.extend(o.getLineStart(s+1));else l.extend(this._getOffset(q,h.unit,1))}this._modifyContent({text:"",start:l.start,end:l.end},true);return true},_doEnd:function(h){var l=this._getSelection(),o=this._model;if(h.ctrl)l.extend(o.getCharCount());else{var q=o.getLineAtOffset(l.getCaret());l.extend(o.getLineEnd(q))}h.select||l.collapse();this._setSelection(l,true);return true},_doEnter:function(h){var l=this._model,o=this._getSelection();this._doContent(l.getLineDelimiter());if(h&&h.noCursor){o.end=
o.start;this._setSelection(o)}return true},_doHome:function(h){var l=this._getSelection(),o=this._model;if(h.ctrl)l.extend(0);else{var q=o.getLineAtOffset(l.getCaret());l.extend(o.getLineStart(q))}h.select||l.collapse();this._setSelection(l,true);return true},_doLineDown:function(h){var l=this._model,o=this._getSelection(),q=o.getCaret(),s=l.getLineAtOffset(q);if(s+1<l.getLineCount()){var z=this._getScroll().x,C=this._columnX;if(C===-1||h.wholeLine||h.select&&i)C=this._getOffsetToX(h.wholeLine?l.getLineEnd(s+
1):q)+z;o.extend(this._getXToOffset(s+1,C-z));h.select||o.collapse();this._setSelection(o,true,true);this._columnX=C}return true},_doLineUp:function(h){var l=this._model,o=this._getSelection(),q=o.getCaret(),s=l.getLineAtOffset(q);if(s>0){var z=this._getScroll().x,C=this._columnX;if(C===-1||h.wholeLine||h.select&&i)C=this._getOffsetToX(h.wholeLine?l.getLineStart(s-1):q)+z;o.extend(this._getXToOffset(s-1,C-z));h.select||o.collapse();this._setSelection(o,true,true);this._columnX=C}return true},_doPageDown:function(h){var l=
this._model,o=this._getSelection(),q=o.getCaret(),s=l.getLineAtOffset(q),z=l.getLineCount();if(s<z-1){l=this._getScroll();var C=this._getClientHeight(),B=this._getLineHeight(),E=Math.floor(C/B),G=Math.min(z-s-1,E);G=Math.max(1,G);E=this._columnX;if(E===-1||h.select&&i)E=this._getOffsetToX(q)+l.x;o.extend(this._getXToOffset(s+G,E-l.x));h.select||o.collapse();h=z*B;q=l.y+G*B;if(q+C>h)q=h-C;this._setSelection(o,true,true,q-l.y);this._columnX=E}return true},_doPageUp:function(h){var l=this._model,o=this._getSelection(),
q=o.getCaret(),s=l.getLineAtOffset(q);if(s>0){l=this._getScroll();var z=this._getClientHeight(),C=this._getLineHeight();z=Math.floor(z/C);var B=Math.max(1,Math.min(s,z));z=this._columnX;if(z===-1||h.select&&i)z=this._getOffsetToX(q)+l.x;o.extend(this._getXToOffset(s-B,z-l.x));h.select||o.collapse();h=Math.max(0,l.y-B*C);this._setSelection(o,true,true,h-l.y);this._columnX=z}return true},_doPaste:function(h){var l=this;return this._getClipboardText(h,function(o){if(o){n&&l._lastMouseButton===2&&(new Date).getTime()-
l._lastMouseTime<=l._clickTime&&l._setSelectionTo(l._lastMouseX,l._lastMouseY);l._doContent(o)}})!==null},_doScroll:function(h){var l=h.type,o=this._model,q=o.getLineCount();h=this._getClientHeight();var s=this._getLineHeight();q=q*s;var z=this._getScroll().y,C;switch(l){case "textStart":C=0;break;case "textEnd":C=q-h;break;case "pageDown":C=z+h;break;case "pageUp":C=z-h;break;case "centerLine":l=this._getSelection();C=o.getLineAtOffset(l.start);o=(o.getLineAtOffset(l.end)-C+1)*s;C=C*s-h/2+o/2;break}if(C!==
undefined){C=Math.min(Math.max(0,C),q-h);this._scrollView(0,C-z)}},_doSelectAll:function(){var h=this._model,l=this._getSelection();l.setCaret(0);l.extend(h.getCharCount());this._setSelection(l,false);return true},_doTab:function(){var h="\t";if(this._expandTab){var l=this._model;h=this._getSelection().getCaret();var o=l.getLineAtOffset(h);l=l.getLineStart(o);h=(new Array(this._tabSize-(h-l)%this._tabSize+1)).join(" ")}this._doContent(h);return true},_applyStyle:function(h,l,o){if(o){o=l.attributes;
for(var q=o.length;q-- >0;)o[q].specified&&l.removeAttributeNode(o[q])}if(h){if(h.styleClass)l.className=h.styleClass;if(o=h.style)for(var s in o)if(o.hasOwnProperty(s))l.style[s]=o[s];if(h=h.attributes)for(var z in h)h.hasOwnProperty(z)&&l.setAttribute(z,h[z])}},_autoScroll:function(){var h=this._getSelection(),l,o=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var q=this._autoScrollY/this._getLineHeight();q=q<0?Math.floor(q):Math.ceil(q);l=this._model.getLineAtOffset(h.getCaret());
l=Math.max(0,Math.min(this._model.getLineCount()-1,l+q))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){l=this._getYToLine(this._autoScrollY);o+=this._getOffsetToX(h.getCaret())}h.extend(this._getXToOffset(l,o));this._setSelection(h,true)},_autoScrollTimer:function(){this._autoScroll();var h=this;this._autoScrollTimerID=setTimeout(function(){h._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateMetrics:function(){var h=this._clientDiv,l=this._frameDocument,o=l.createElement("DIV"),
q={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(q);this._applyStyle(q.style,o);o.style.position="fixed";o.style.left="-1000px";q=l.createElement("SPAN");q.appendChild(l.createTextNode(" "));o.appendChild(q);var s=l.createElement("SPAN");s.style.fontStyle="italic";s.appendChild(l.createTextNode(" "));o.appendChild(s);var z=l.createElement("SPAN");z.style.fontWeight="bold";z.appendChild(l.createTextNode(" "));o.appendChild(z);var C=l.createElement("SPAN");
C.style.fontWeight="bold";C.style.fontStyle="italic";C.appendChild(l.createTextNode(" "));o.appendChild(C);h.appendChild(o);l=o.getBoundingClientRect();q=q.getBoundingClientRect();s=s.getBoundingClientRect();z=z.getBoundingClientRect();var B=C.getBoundingClientRect();C=s.bottom-s.top;z=z.bottom-z.top;s=B.bottom-B.top;B=0;l=l.bottom-l.top;if(C>q.bottom-q.top)B=1;if(z>C)B=2;if(s>z)B=3;var E;if(B!==0){E={style:{}};if((B&1)!==0)E.style.fontStyle="italic";if((B&2)!==0)E.style.fontWeight="bold"}q=this._getLineTrim(o);
h.removeChild(o);return{lineHeight:l,largestFontStyle:E,lineTrim:q,viewPadding:this._calculatePadding()}},_calculatePadding:function(){var h=this._frameDocument,l=this._clientDiv,o=this._getPadding(this._viewDiv),q=h.createElement("DIV");q.style.position="fixed";q.style.left="-1000px";q.style.paddingLeft=o.left+"px";q.style.paddingTop=o.top+"px";q.style.paddingRight=o.right+"px";q.style.paddingBottom=o.bottom+"px";q.style.width="100px";q.style.height="100px";o=h.createElement("DIV");o.style.width=
"100%";o.style.height="100%";q.appendChild(o);l.appendChild(q);h=q.getBoundingClientRect();o=o.getBoundingClientRect();l.removeChild(q);return o={left:o.left-h.left,top:o.top-h.top,right:h.right-o.right,bottom:h.bottom-o.bottom}},_clearSelection:function(h){var l=this._getSelection();if(l.isEmpty())return false;if(h==="next")l.start=l.end;else l.end=l.start;this._setSelection(l,true);return true},_clone:function(h){if(h instanceof Array)return h.slice(0);return h},_compare:function(h,l){if(h===l)return true;
if(h&&!l||!h&&l)return false;if(h&&h.constructor===String||l&&l.constructor===String)return false;if(h instanceof Array||l instanceof Array){if(!(h instanceof Array&&l instanceof Array))return false;if(h.length!==l.length)return false;for(var o=0;o<h.length;o++)if(!this._compare(h[o],l[o]))return false;return true}if(!(h instanceof Object)||!(l instanceof Object))return false;for(o in h)if(h.hasOwnProperty(o)){if(!l.hasOwnProperty(o))return false;if(!this._compare(h[o],l[o]))return false}for(o in l)if(!h.hasOwnProperty(o))return false;
return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var h=this._model,l=h.getLineAtOffset(this._imeOffset),o=h.getLineStart(l),q=this._getDOMText(l);h=h.getLine(l);o=this._imeOffset-o;h=o+q.length-h.length;o!==h&&this._doContent(q.substring(o,h));this._imeOffset=-1}},_convertDelimiter:function(h,l,o){for(var q=0,s=0,z=0,C=h.length;z<C;){if(q!==-1&&q<=z)q=h.indexOf("\r",z);if(s!==-1&&s<=z)s=h.indexOf("\n",z);var B=z,E;if(s===-1&&q===-1){l(h.substring(z));
break}if(q!==-1&&s!==-1)if(q+1===s){E=q;z=s+1}else{E=q<s?q:s;z=(q<s?q:s)+1}else if(q!==-1){E=q;z=q+1}else{E=s;z=s+1}l(h.substring(B,E));o()}},_createActions:function(){var h=f.KeyBinding,l=this._keyBindings=[];l.push({name:"lineUp",keyBinding:new h(38),predefined:true});l.push({name:"lineDown",keyBinding:new h(40),predefined:true});l.push({name:"charPrevious",keyBinding:new h(37),predefined:true});l.push({name:"charNext",keyBinding:new h(39),predefined:true});if(v){l.push({name:"scrollPageUp",keyBinding:new h(33),
predefined:true});l.push({name:"scrollPageDown",keyBinding:new h(34),predefined:true});l.push({name:"pageUp",keyBinding:new h(33,null,null,true),predefined:true});l.push({name:"pageDown",keyBinding:new h(34,null,null,true),predefined:true});l.push({name:"lineStart",keyBinding:new h(37,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(39,true),predefined:true});l.push({name:"wordPrevious",keyBinding:new h(37,null,null,true),predefined:true});l.push({name:"wordNext",keyBinding:new h(39,
null,null,true),predefined:true});l.push({name:"scrollTextStart",keyBinding:new h(36),predefined:true});l.push({name:"scrollTextEnd",keyBinding:new h(35),predefined:true});l.push({name:"textStart",keyBinding:new h(38,true),predefined:true});l.push({name:"textEnd",keyBinding:new h(40,true),predefined:true});l.push({name:"scrollPageUp",keyBinding:new h(38,null,null,null,true),predefined:true});l.push({name:"scrollPageDown",keyBinding:new h(40,null,null,null,true),predefined:true});l.push({name:"lineStart",
keyBinding:new h(37,null,null,null,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(39,null,null,null,true),predefined:true});l.push({name:"lineStart",keyBinding:new h(38,null,null,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(40,null,null,true),predefined:true})}else{l.push({name:"pageUp",keyBinding:new h(33),predefined:true});l.push({name:"pageDown",keyBinding:new h(34),predefined:true});l.push({name:"lineStart",keyBinding:new h(36),predefined:true});l.push({name:"lineEnd",
keyBinding:new h(35),predefined:true});l.push({name:"wordPrevious",keyBinding:new h(37,true),predefined:true});l.push({name:"wordNext",keyBinding:new h(39,true),predefined:true});l.push({name:"textStart",keyBinding:new h(36,true),predefined:true});l.push({name:"textEnd",keyBinding:new h(35,true),predefined:true})}if(k&&n){l.push({name:"lineUp",keyBinding:new h(38,true),predefined:true});l.push({name:"lineDown",keyBinding:new h(40,true),predefined:true})}l.push({name:"selectLineUp",keyBinding:new h(38,
null,true),predefined:true});l.push({name:"selectLineDown",keyBinding:new h(40,null,true),predefined:true});l.push({name:"selectCharPrevious",keyBinding:new h(37,null,true),predefined:true});l.push({name:"selectCharNext",keyBinding:new h(39,null,true),predefined:true});l.push({name:"selectPageUp",keyBinding:new h(33,null,true),predefined:true});l.push({name:"selectPageDown",keyBinding:new h(34,null,true),predefined:true});if(v){l.push({name:"selectLineStart",keyBinding:new h(37,true,true),predefined:true});
l.push({name:"selectLineEnd",keyBinding:new h(39,true,true),predefined:true});l.push({name:"selectWordPrevious",keyBinding:new h(37,null,true,true),predefined:true});l.push({name:"selectWordNext",keyBinding:new h(39,null,true,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(36,null,true),predefined:true});l.push({name:"selectTextEnd",keyBinding:new h(35,null,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(38,true,true),predefined:true});l.push({name:"selectTextEnd",
keyBinding:new h(40,true,true),predefined:true});l.push({name:"selectLineStart",keyBinding:new h(37,null,true,null,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(39,null,true,null,true),predefined:true});l.push({name:"selectLineStart",keyBinding:new h(38,null,true,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(40,null,true,true),predefined:true})}else{if(n){l.push({name:"selectWholeLineUp",keyBinding:new h(38,true,true),predefined:true});l.push({name:"selectWholeLineDown",
keyBinding:new h(40,true,true),predefined:true})}l.push({name:"selectLineStart",keyBinding:new h(36,null,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(35,null,true),predefined:true});l.push({name:"selectWordPrevious",keyBinding:new h(37,true,true),predefined:true});l.push({name:"selectWordNext",keyBinding:new h(39,true,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(36,true,true),predefined:true});l.push({name:"selectTextEnd",keyBinding:new h(35,true,
true),predefined:true})}l.push({name:"deletePrevious",keyBinding:new h(8),predefined:true});l.push({name:"deletePrevious",keyBinding:new h(8,null,true),predefined:true});l.push({name:"deleteNext",keyBinding:new h(46),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,true,true),predefined:true});l.push({name:"deleteWordNext",keyBinding:new h(46,true),predefined:true});l.push({name:"tab",keyBinding:new h(9),
predefined:true});l.push({name:"enter",keyBinding:new h(13),predefined:true});l.push({name:"enter",keyBinding:new h(13,null,true),predefined:true});l.push({name:"selectAll",keyBinding:new h("a",true),predefined:true});if(v){l.push({name:"deleteNext",keyBinding:new h(46,null,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,null,null,true),predefined:true});l.push({name:"deleteWordNext",keyBinding:new h(46,null,null,true),predefined:true})}if(!k){var o=v&&p;l.push({name:null,
keyBinding:new h("u",!o,false,false,o),predefined:true});l.push({name:null,keyBinding:new h("i",!o,false,false,o),predefined:true});l.push({name:null,keyBinding:new h("b",!o,false,false,o),predefined:true})}if(k){l.push({name:"copy",keyBinding:new h(45,true),predefined:true});l.push({name:"paste",keyBinding:new h(45,null,true),predefined:true});l.push({name:"cut",keyBinding:new h(46,null,true),predefined:true})}if(v){l.push({name:"lineStart",keyBinding:new h("a",false,false,false,true),predefined:true});
l.push({name:"lineEnd",keyBinding:new h("e",false,false,false,true),predefined:true});l.push({name:"lineUp",keyBinding:new h("p",false,false,false,true),predefined:true});l.push({name:"lineDown",keyBinding:new h("n",false,false,false,true),predefined:true});l.push({name:"charPrevious",keyBinding:new h("b",false,false,false,true),predefined:true});l.push({name:"charNext",keyBinding:new h("f",false,false,false,true),predefined:true});l.push({name:"deletePrevious",keyBinding:new h("h",false,false,false,
true),predefined:true});l.push({name:"deleteNext",keyBinding:new h("d",false,false,false,true),predefined:true});l.push({name:"deleteLineEnd",keyBinding:new h("k",false,false,false,true),predefined:true});if(k){l.push({name:"scrollPageDown",keyBinding:new h("v",false,false,false,true),predefined:true});l.push({name:"deleteLineStart",keyBinding:new h("u",false,false,false,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h("w",false,false,false,true),predefined:true})}else{l.push({name:"pageDown",
keyBinding:new h("v",false,false,false,true),predefined:true});l.push({name:"centerLine",keyBinding:new h("l",false,false,false,true),predefined:true});l.push({name:"enterNoCursor",keyBinding:new h("o",false,false,false,true),predefined:true})}}var q=this;this._actions=[{name:"lineUp",defaultHandler:function(){return q._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return q._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return q._doHome({select:false,
ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return q._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return q._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return q._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return q._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return q._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return q._doScroll({type:"pageUp"})}},
{name:"scrollPageDown",defaultHandler:function(){return q._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return q._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return q._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return q._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return q._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return q._doScroll({type:"textStart"})}},
{name:"scrollTextEnd",defaultHandler:function(){return q._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return q._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return q._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return q._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return q._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return q._doLineDown({select:true,
wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return q._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return q._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return q._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return q._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return q._doPageUp({select:true})}},
{name:"selectPageDown",defaultHandler:function(){return q._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return q._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return q._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return q._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return q._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",
defaultHandler:function(){return q._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return q._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return q._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return q._doDelete({unit:"word"})}},{name:"deleteLineStart",defaultHandler:function(){return q._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return q._doDelete({unit:"line"})}},
{name:"tab",defaultHandler:function(){return q._doTab()}},{name:"enter",defaultHandler:function(){return q._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return q._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return q._doSelectAll()}},{name:"copy",defaultHandler:function(){return q._doCopy()}},{name:"cut",defaultHandler:function(){return q._doCut()}},{name:"paste",defaultHandler:function(){return q._doPaste()}}]},_createLine:function(h,l,o,q,s){var z=s.getLine(q),
C=s.getLineStart(q),B={type:"LineStyle",textView:this,lineIndex:q,lineText:z,lineStart:C};this.onLineStyle(B);s=l||o.createElement("DIV");if(!l||!this._compare(l.viewStyle,B.style)){this._applyStyle(B.style,s,l);if(l)l._trim=null;s.viewStyle=B.style;s.setAttribute("role","presentation")}s.lineIndex=q;q=[];this._createRanges(B.ranges,z,0,z.length,C,{tabOffset:0,ranges:q});z=" ";if(!this._fullSelection&&i<9)z="\ufeff";if(t)z="\u200c";q.push({text:z,style:this._metrics.largestFontStyle,ignoreChars:1});
var E,G,M,H,N,L;B=z=0;var P,S;if(l){if(M=l.modelChangedEvent){if(M.removedLineCount===0&&M.addedLineCount===0){S=M.start-C;P=M.addedCharCount-M.removedCharCount}else S=-1;l.modelChangedEvent=undefined}M=l.firstChild}for(C=0;C<q.length;C++){E=q[C];N=E.text;z+=N.length;G=E.style;if(M){L=M.firstChild.data;H=M.viewStyle;if(L===N&&this._compare(G,H)){B+=L.length;M._rectsCache=undefined;E=M=M.nextSibling;continue}else for(;M;){if(S!==-1){H=z;if(H>=S)H-=P;L=M.firstChild.data.length;if(B+L>H)break;B+=L}H=
M.nextSibling;s.removeChild(M);M=H}}E=this._createSpan(s,o,N,G,E.ignoreChars);M?s.insertBefore(E,M):s.appendChild(E);if(l)l.lineWidth=undefined}if(l)for(h=E?E.nextSibling:null;h;){H=h.nextSibling;l.removeChild(h);h=H}else h.appendChild(s);return s},_createRanges:function(h,l,o,q,s,z){if(!(o>=q)){if(h)for(var C=0;C<h.length;C++){var B=h[C];if(!(B.end<=s+o)){var E=Math.max(s+o,B.start)-s;if(E>=q)break;var G=Math.min(s+q,B.end)-s;if(E<G){E=Math.max(o,E);G=Math.min(q,G);for(o<E&&this._createRange(l,o,
E,null,z);C+1<h.length&&h[C+1].start-s===G&&this._compare(B.style,h[C+1].style);){B=h[C+1];G=Math.min(s+q,B.end)-s;C++}this._createRange(l,E,G,B.style,z);o=G}}}o<q&&this._createRange(l,o,q,null,z)}},_createRange:function(h,l,o,q,s){if(!(l>=o)){var z=this._customTabSize;if(z&&z!==8)for(var C=h.indexOf("\t",l);C!==-1&&C<o;){if(l<C){l={text:h.substring(l,C),style:q};s.ranges.push(l);s.tabOffset+=l.text.length}l=z-s.tabOffset%z;if(l>0){for(var B="\u00a0",E=1;E<l;E++)B+=" ";l={text:B,style:q,ignoreChars:l-
1};s.ranges.push(l);s.tabOffset+=l.text.length}l=C+1;C=h.indexOf("\t",l)}if(l<o){l={text:h.substring(l,o),style:q};s.ranges.push(l);s.tabOffset+=l.text.length}}},_createSpan:function(h,l,o,q,s){var z=q&&q.tagName==="A";if(z)h.hasLink=true;h=z&&this._linksVisible?"A":"SPAN";z=l.createElement(h);z.appendChild(l.createTextNode(o));this._applyStyle(q,z);if(h==="A"){var C=this;b(z,"click",function(B){return C._handleLinkClick(B)},false)}z.viewStyle=q;if(s)z.ignoreChars=s;return z},_createRuler:function(h){if(this._clientDiv){var l=
this._frameDocument,o=l.body,q=h.getLocation(),s=q==="left"?this._leftDiv:this._rightDiv;if(!s){s=l.createElement("DIV");s.style.overflow="hidden";s.style.MozUserSelect="none";s.style.WebkitUserSelect="none";i&&s.attachEvent("onselectstart",function(){return false});s.style.position="absolute";s.style.top="0px";s.style.cursor="default";o.appendChild(s);if(q==="left"){this._leftDiv=s;s.className="viewLeftRuler"}else{this._rightDiv=s;s.className="viewRightRuler"}o=l.createElement("TABLE");s.appendChild(o);
o.cellPadding="0px";o.cellSpacing="0px";o.border="0px";o.insertRow(0);var z=this;b(s,"click",function(C){z._handleRulerEvent(C)});b(s,"dblclick",function(C){z._handleRulerEvent(C)});b(s,"mousemove",function(C){z._handleRulerEvent(C)});b(s,"mouseover",function(C){z._handleRulerEvent(C)});b(s,"mouseout",function(C){z._handleRulerEvent(C)})}l=l.createElement("DIV");l._ruler=h;l.rulerChanged=true;l.style.position="relative";h=s.firstChild.rows[0];h=h.insertCell(h.cells.length);h.vAlign="top";h.appendChild(l)}},
_createFrame:function(){if(!this.frame){for(var h=this._parent;h.hasChildNodes();)h.removeChild(h.lastChild);var l=h.ownerDocument;this._parentDocument=l;var o=l.createElement("IFRAME");this._frame=o;o.frameBorder="0px";o.style.border="0px";o.style.width="100%";o.style.height="100%";o.scrolling="no";var q=this;q._frameLoaded=false;this._loadHandler=function(s){q._frameLoaded=true;q._sync?q._handleLoad(s):setTimeout(function(){q._handleLoad(s)},0)};b(o,"load",this._loadHandler,!!k);if(!t)b(l,"DOMAttrModified",
this._attrModifiedHandler=function(s){q._frameLoaded&&q._handleDOMAttrModified(s)});h.appendChild(o);this._sync&&this._handleLoad()}},_getFrameHTML:function(){var h=[];h.push("<!DOCTYPE html>");h.push("<html>");h.push("<head>");i<9&&h.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");h.push("<style>");h.push(".viewContainer {font-family: monospace; font-size: 10pt;}");h.push(".view {padding: 1px 2px;}");h.push(".viewContent {}");h.push("</style>");if(this._stylesheet)for(var l=
typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,o=0;o<l.length;o++){var q=l[o],s=this._isLinkURL(q);if(s&&this._sync)try{var z=new XMLHttpRequest;z.overrideMimeType&&z.overrideMimeType("text/css");z.open("GET",q,false);z.send(null);q=z.responseText;s=false}catch(C){}if(s){h.push("<link rel='stylesheet' type='text/css' ");i<9&&h.push("onload='window' ");h.push("href='");h.push(q);h.push("'></link>")}else{h.push("<style>");h.push(q);h.push("</style>")}}h.push("<script>");h.push("var waitForStyleSheets = true;");
h.push("<\/script>");h.push("</head>");h.push("<body spellcheck='false'></body>");h.push("</html>");return h.join("")},_createView:function(){if(!this._frameDocument){var h=this._frameWindow=this._frame.contentWindow,l=this._frameDocument=h.document,o=this;l.open("text/html","replace");l.write(o._getFrameHTML());l.close();o._windowLoadHandler=function(){l.readyState==="complete"&&o._createContent()};b(h,"load",o._windowLoadHandler);if(this._sync)this._createContent();else{this._createViewTimer=function(){o._clientDiv||
(l.readyState==="complete"?o._createContent():setTimeout(o._createViewTimer,10))};setTimeout(this._createViewTimer,10)}}},_createContent:function(){if(!this._clientDiv){var h=this._parent,l=this._parentDocument,o=this._frameDocument,q=o.body;this._setThemeClass(this._themeClass,true);q.style.margin="0px";q.style.borderWidth="0px";q.style.padding="0px";if(u){var s=l.createElement("DIV");this._touchDiv=s;s.style.position="absolute";s.style.border="0px";s.style.padding="0px";s.style.margin="0px";s.style.zIndex=
"2";s.style.overflow="hidden";s.style.background="transparent";s.style.WebkitUserSelect="none";h.appendChild(s);this._textArea=h=l.createElement("TEXTAREA");h.style.position="absolute";h.style.whiteSpace="pre";h.style.left="-1000px";h.tabIndex=1;h.autocapitalize="off";h.autocorrect="off";h.className="viewContainer";h.style.background="transparent";h.style.color="transparent";h.style.border="0px";h.style.padding="0px";h.style.margin="0px";h.style.borderRadius="0px";h.style.WebkitAppearance="none";
h.style.WebkitTapHighlightColor="transparent";s.appendChild(h)}if(k){this._clipboardDiv=s=o.createElement("DIV");s.style.position="fixed";s.style.whiteSpace="pre";s.style.left="-1000px";q.appendChild(s)}s=o.createElement("DIV");s.className="view";this._viewDiv=s;s.id="viewDiv";s.tabIndex=-1;s.style.overflow="auto";s.style.position="absolute";s.style.top="0px";s.style.borderWidth="0px";s.style.margin="0px";s.style.MozOutline="none";s.style.outline="none";s.setAttribute("role","application");q.appendChild(s);
this._scrollDiv=h=o.createElement("DIV");h.id="scrollDiv";h.style.margin="0px";h.style.borderWidth="0px";h.style.padding="0px";s.appendChild(h);if(k){this._clipDiv=l=o.createElement("DIV");l.id="clipDiv";l.style.position="fixed";l.style.overflow="hidden";l.style.margin="0px";l.style.borderWidth="0px";l.style.padding="0px";h.appendChild(l);var z=o.createElement("DIV");this._clipScrollDiv=z;z.id="clipScrollDiv";z.style.position="absolute";z.style.height="1px";z.style.top="-1000px";l.appendChild(z)}this._setFullSelection(this._fullSelection,
true);l=o.createElement("DIV");l.className="viewContent";this._clientDiv=l;l.id="clientDiv";l.style.whiteSpace="pre";l.style.position=this._clipDiv?"absolute":"fixed";l.style.borderWidth="0px";l.style.margin="0px";l.style.padding="0px";l.style.MozOutline="none";l.style.outline="none";l.style.zIndex="1";if(u)l.style.WebkitTapHighlightColor="transparent";(this._clipDiv||h).appendChild(l);if(k&&!l.setCapture){this._overlayDiv=o=o.createElement("DIV");o.id="overlayDiv";o.style.position=l.style.position;
o.style.borderWidth=l.style.borderWidth;o.style.margin=l.style.margin;o.style.padding=l.style.padding;o.style.cursor="text";o.style.zIndex="2";(this._clipDiv||h).appendChild(o)}if(!u)l.contentEditable="true";l.setAttribute("role","textbox");l.setAttribute("aria-multiline","true");o=this._metrics=this._calculateMetrics();if(i)q.style.lineHeight=o.lineHeight-(o.lineTrim.top+o.lineTrim.bottom)+"px";this._setTabSize(this._tabSize,true);this._hookEvents();q=this._rulers;for(o=0;o<q.length;o++)this._createRuler(q[o]);
this._updatePage();q=this._hScroll;o=this._vScroll;this._vScroll=this._hScroll=0;if(q>0||o>0){s.scrollLeft=q;s.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 h=this._frame;if(h){if(this._loadHandler){c(h,"load",this._loadHandler,!!k);this._loadHandler=null}if(this._attrModifiedHandler){c(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}h.parentNode.removeChild(h);this._frame=null}},_destroyRuler:function(h){var l=
h.getLocation()==="left"?this._leftDiv:this._rightDiv;if(l){l=l.firstChild.rows[0];for(var o=l.cells,q=0;q<o.length;q++)if(o[q].firstChild._ruler===h)break;if(q!==o.length){l.cells[q]._ruler=undefined;l.deleteCell(q)}}},_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 h=this._frameDocument.body;h.hasChildNodes();)h.removeChild(h.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(h,l,o){this._autoScrollDir=h;this._autoScrollX=l;this._autoScrollY=o;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_fixCaret:function(){var h=this._clientDiv;if(h){var l=this._hasFocus;this._ignoreFocus=true;l&&h.blur();h.contentEditable=false;h.contentEditable=true;l&&h.focus();
this._ignoreFocus=false}},_getBaseText:function(h,l){var o=this._model;if(o.getBaseModel){h=o.mapOffset(h);l=o.mapOffset(l);o=o.getBaseModel()}return o.getText(h,l)},_getBorder:function(h){var l,o,q,s;if(this._frameWindow.getComputedStyle){h=this._frameWindow.getComputedStyle(h,null);l=h.getPropertyValue("border-left-width");o=h.getPropertyValue("border-top-width");q=h.getPropertyValue("border-right-width");s=h.getPropertyValue("border-bottom-width")}else if(h.currentStyle){l=h.currentStyle.borderLeftWidth;
o=h.currentStyle.borderTopWidth;q=h.currentStyle.borderRightWidth;s=h.currentStyle.borderBottomWidth}return{left:parseInt(l,10)||0,top:parseInt(o,10)||0,right:parseInt(q,10)||0,bottom:parseInt(s,10)||0}},_getBoundsAtOffset:function(h){var l=this._model,o=this._frameDocument,q=this._clientDiv,s=l.getLineAtOffset(h),z,C=this._getLineNode(s);C||(C=z=this._createLine(q,null,o,s,l));var B=null;if(h<l.getLineEnd(s)){l=l.getLineStart(s);for(s=C.firstChild;s;){var E=s.firstChild,G=E.length;if(s.ignoreChars)G-=
s.ignoreChars;if(l+G>h){B=h-l;if(y){o=o.createRange();o.setStart(E,B);o.setEnd(E,B+1);B=o.getBoundingClientRect()}else if(i){o=o.body.createTextRange();o.moveToElementText(s);o.collapse();o.moveEnd("character",B+1);o.moveStart("character",B);B=o.getBoundingClientRect()}else{h=E.data;s.removeChild(E);s.appendChild(o.createTextNode(h.substring(0,B)));var M=o.createElement("SPAN");M.appendChild(o.createTextNode(h.substring(B,B+1)));s.appendChild(M);s.appendChild(o.createTextNode(h.substring(B+1)));B=
M.getBoundingClientRect();s.innerHTML="";s.appendChild(E);if(!z){o=this._getSelection();if(l<=o.start&&o.start<l+G||l<=o.end&&o.end<l+G)this._updateDOMSelection()}}if(i){o=window.screen.logicalXDPI;l=window.screen.deviceXDPI;B.left=B.left*o/l;B.right=B.right*o/l}break}l+=G;s=s.nextSibling}}if(!B){C=this._getLineBoundingClientRect(C);B={left:C.right,right:C.right}}z&&q.removeChild(z);return B},_getBottomIndex:function(h){var l=this._bottomChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=
l.getBoundingClientRect();var o=this._clientDiv.getBoundingClientRect();if(h.bottom>o.bottom)l=this._getLinePrevious(l)||l}return l.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var h=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-h.top-h.bottom)},_getClientWidth:function(){var h=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-h.left-h.right)},_getClipboardText:function(h,l){var o=this._model.getLineDelimiter(),q,s;if(this._frameWindow.clipboardData){q=[];s=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(s,function(H){q.push(H)},function(){q.push(o)});s=q.join("");l&&l(s);return s}if(k){this._ignoreFocus=true;var z=this._frameDocument,C=this._clipboardDiv;C.innerHTML="<pre contenteditable=''></pre>";C.firstChild.focus();var B=this,E=function(){var H=B._getTextFromElement(C);
C.innerHTML="";q=[];B._convertDelimiter(H,function(N){q.push(N)},function(){q.push(o)});return q.join("")},G=false;this._ignorePaste=true;if(!n||this._lastMouseButton!==2)try{G=z.execCommand("paste",false,null)}catch(M){G=C.childNodes.length>1||C.firstChild&&C.firstChild.childNodes.length>0}this._ignorePaste=false;if(!G)if(h){setTimeout(function(){B.focus();(s=E())&&l&&l(s);B._ignoreFocus=false},0);return null}else{this.focus();this._ignoreFocus=false;return""}this.focus();this._ignoreFocus=false;
(s=E())&&l&&l(s);return s}if(h&&h.clipboardData){q=[];s=h.clipboardData.getData("text/plain");this._convertDelimiter(s,function(H){q.push(H)},function(){q.push(o)});(s=q.join(""))&&l&&l(s);return s}return""},_getDOMText:function(h){h=this._getLineNode(h).firstChild;for(var l="";h;){for(var o=h.firstChild;o;){if(h.ignoreChars)for(var q=0;q<o.length;q++){var s=o.data.substring(q,q+1);if(s!==" ")l+=s}else l+=o.data;o=o.nextSibling}h=h.nextSibling}return l},_getTextFromElement:function(h){var l=h.ownerDocument,
o=l.defaultView;if(!o.getSelection)return h.innerText||h.textContent;l=l.createRange();l.selectNode(h);h=o.getSelection();o=[];var q;for(q=0;q<h.rangeCount;q++)o.push(h.getRangeAt(q));this._ignoreSelect=true;h.removeAllRanges();h.addRange(l);l=h.toString();h.removeAllRanges();for(q=0;q<o.length;q++)h.addRange(o[q]);this._ignoreSelect=false;return l},_getViewPadding:function(){return this._metrics.viewPadding},_getLineTrim:function(h){var l=h._trim;if(!l){l=this._getPadding(h);var o=this._getBorder(h);
l.left+=o.left;l.top+=o.top;l.right+=o.right;l.bottom+=o.bottom;h._trim=l}return l},_getLineBoundingClientRect:function(h,l){var o=h.getBoundingClientRect();o={left:o.left,top:o.top,right:o.left,bottom:o.bottom};for(var q=h.lastChild;q&&q.ignoreChars===q.firstChild.length;)q=q.previousSibling;if(q){q=q.getBoundingClientRect();o.right=q.right+this._getLineTrim(h).right}if(l){h=this._getLineTrim(h);o.left+=h.left;o.right-=h.right}return o},_getLineHeight:function(){return this._metrics.lineHeight},
_getLineNode:function(h){for(var l=this._clientDiv.firstChild;l;){if(h===l.lineIndex)return l;l=l.nextSibling}},_getLineNext:function(h){for(h=h?h.nextSibling:this._clientDiv.firstChild;h&&h.lineIndex===-1;)h=h.nextSibling;return h},_getLinePrevious:function(h){for(h=h?h.previousSibling:this._clientDiv.lastChild;h&&h.lineIndex===-1;)h=h.previousSibling;return h},_getOffset:function(h,l,o){if(l==="line"){l=this._model;h=l.getLineAtOffset(h);if(o>0)return l.getLineEnd(h);return l.getLineStart(h)}if(l===
"wordend")return this._getOffset_W3C(h,l,o);return i?this._getOffset_IE(h,l,o):this._getOffset_W3C(h,l,o)},_getOffset_W3C:function(h,l,o){function q(H){return 33<=H&&H<=47||58<=H&&H<=64||91<=H&&H<=94||H===96||123<=H&&H<=126}function s(H){return H===32||H===9}if(l==="word"||l==="wordend"){var z=this._model,C=z.getLineAtOffset(h),B=z.getLine(C),E=z.getLineStart(C);C=z.getLineEnd(C);z=B.length;h=h-E;var G,M;if(o>0){if(h===z)return C;G=B.charCodeAt(h);M=q(G);o=!M&&!s(G);for(h++;h<z;){G=B.charCodeAt(h);
C=q(G);if(l==="wordend"){if(!C&&M)break}else if(C&&!M)break;G=!C&&!s(G);if(l==="wordend"){if(!G&&o)break}else if(G&&!o)break;o=G;M=C;h++}}else{if(h===0)return E;h--;G=B.charCodeAt(h);M=q(G);for(o=!M&&!s(G);0<h;){G=B.charCodeAt(h-1);C=q(G);if(l==="wordend"){if(C&&!M)break}else if(!C&&M)break;G=!C&&!s(G);if(l==="wordend"){if(G&&!o)break}else if(!G&&o)break;o=G;M=C;h--}}return E+h}return h+o},_getOffset_IE:function(h,l,o){var q=this._frameDocument,s=this._model,z=s.getLineAtOffset(h),C=this._clientDiv,
B,E=this._getLineNode(z);E||(E=B=this._createLine(C,null,q,z,s));var G=0,M;M=s.getLineStart(z);if(h===s.getLineEnd(z)){q=q.body.createTextRange();q.moveToElementText(E.lastChild);M=q.text.length;q.moveEnd(l,o);G=h+q.text.length-M}else if(h===M&&o<0)G=M;else for(E=E.firstChild;E;){s=E.firstChild.length;if(E.ignoreChars)s-=E.ignoreChars;if(M+s>h){q=q.body.createTextRange();if(h===M&&o<0)q.moveToElementText(E.previousSibling);else{q.moveToElementText(E);q.collapse();q.moveEnd("character",h-M)}M=q.text.length;
q.moveEnd(l,o);G=h+q.text.length-M;break}M=s+M;E=E.nextSibling}B&&C.removeChild(B);return G},_getOffsetToX:function(h){return this._getBoundsAtOffset(h).left},_getPadding:function(h){var l,o,q,s;if(this._frameWindow.getComputedStyle){h=this._frameWindow.getComputedStyle(h,null);l=h.getPropertyValue("padding-left");o=h.getPropertyValue("padding-top");q=h.getPropertyValue("padding-right");s=h.getPropertyValue("padding-bottom")}else if(h.currentStyle){l=h.currentStyle.paddingLeft;o=h.currentStyle.paddingTop;
q=h.currentStyle.paddingRight;s=h.currentStyle.paddingBottom}return{left:parseInt(l,10)||0,top:parseInt(o,10)||0,right:parseInt(q,10)||0,bottom:parseInt(s,10)||0}},_getScroll:function(){var h=this._viewDiv;return{x:h.scrollLeft,y:h.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(h){var l=this._topChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=l.getBoundingClientRect();var o=this._getViewPadding(),q=this._viewDiv.getBoundingClientRect();if(h.top<
q.top+o.top)l=this._getLineNext(l)||l}return l.lineIndex},_getXToOffset:function(h,l){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 q=this._model,s=q.getLineStart(h),z=q.getLineEnd(h);
if(s===z)return s;var C=this._frameDocument,B=this._clientDiv,E,G=this._getLineNode(h);G||(G=E=this._createLine(B,null,C,h,q));h=this._getLineBoundingClientRect(G,true);if(l<h.left)l=h.left;if(l>h.right)l=h.right;var M=0,H;if(i<9){H=G.getClientRects();q=H[0].left;for(var N=1;N<H.length;N++)q=Math.min(H[N].left,q);M=q-h.left-this._getLineTrim(G).left}var L=this._getScroll().x,P=i?window.screen.logicalXDPI:1,S=i?window.screen.deviceXDPI:1;h=s;q=G.firstChild;a:for(;q;){N=q.firstChild;G=N.length;if(q.ignoreChars)G-=
q.ignoreChars;H=o(q);for(var D=0;D<H.length;D++){var F=H[D];if(F.left<=l&&l<F.right){if(i||y){C=y?C.createRange():C.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&&q.ignoreChars?N.length:Q+1;if(y){C.setStart(N,H);C.setEnd(N,F)}else{C.moveToElementText(q);C.move("character",H);C.moveEnd("character",F-H)}H=C.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<=l&&l<W){T=true;break}}if(T)D=Q;else J=Q}h+=D;H=D;F=D===
G-1&&q.ignoreChars?N.length:Math.min(D+1,N.length);if(y){C.setStart(N,H);C.setEnd(N,F)}else{C.moveToElementText(q);C.move("character",H);C.moveEnd("character",F-H)}F=C.getClientRects()[0];l>F.left*P/S-M+(F.right-F.left)*P/S/2&&h++}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>")}q.innerHTML=H.join("");for(H=q.firstChild;H;){F=H.getBoundingClientRect();if(F.left<=l&&l<F.right){l>F.left+(F.right-F.left)/2&&h++;break}h++;
H=H.nextSibling}if(!E){q.innerHTML="";q.appendChild(N);l=this._getSelection();if(h<=l.start&&l.start<h+G||h<=l.end&&l.end<h+G)this._updateDOMSelection()}}break a}}h+=G;q=q.nextSibling}E&&B.removeChild(E);return Math.min(z,Math.max(s,h))},_getYToLine:function(h){var l=this._getViewPadding(),o=this._viewDiv.getBoundingClientRect();h-=o.top+l.top;l=this._getLineHeight();h=Math.floor((h+this._getScroll().y)/l);l=this._model.getLineCount();return Math.max(0,Math.min(l-1,h))},_getOffsetBounds:function(h){var l=
this._model.getLineAtOffset(h),o=this._getLineHeight(),q=this._getScroll(),s=this._getViewPadding(),z=this._viewDiv.getBoundingClientRect();h=this._getBoundsAtOffset(h);l=l*o-q.y+z.top+s.top;return{left:h.left,top:l,right:h.right,bottom:l+o}},_getVisible:function(){for(var h=this._parent,l=h.ownerDocument;h!==l;){var o;if(i<9)o=h.currentStyle&&h.currentStyle.display==="none";else o=(o=l.defaultView.getComputedStyle(h,null))&&o.getPropertyValue("display")==="none";if(o)return"hidden";h=h.parentNode;
if(!h)return"disconnected"}return"visible"},_hitOffset:function(h,l,o){var q=this._getOffsetBounds(h);h=q.left;var s=q.right,z=q.top;q=q.bottom;h-=20;z-=20;s+=20;q+=20;return h<=l&&l<=s&&z<=o&&o<=q},_hookEvents:function(){var h=this;this._modelListener={onChanging:function(B){h._onModelChanging(B)},onChanged:function(B){h._onModelChanged(B)}};this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);var l=this._clientDiv,
o=this._viewDiv,q=this._frameDocument.body,s=this._handlers=[],z=i<9?this._frame:this._frameWindow,C=u?this._textArea:i||k?this._clientDiv:this._frameWindow;s.push({target:this._frameWindow,type:"unload",handler:function(B){return h._handleUnload(B)}});s.push({target:z,type:"resize",handler:function(B){return h._handleResize(B)}});s.push({target:C,type:"blur",handler:function(B){return h._handleBlur(B)}});s.push({target:C,type:"focus",handler:function(B){return h._handleFocus(B)}});s.push({target:o,
type:"scroll",handler:function(B){return h._handleScroll(B)}});if(u){l=this._touchDiv;q=this._textArea;s.push({target:q,type:"keydown",handler:function(B){return h._handleKeyDown(B)}});s.push({target:q,type:"input",handler:function(B){return h._handleInput(B)}});s.push({target:q,type:"textInput",handler:function(B){return h._handleTextInput(B)}});s.push({target:q,type:"click",handler:function(B){return h._handleTextAreaClick(B)}});s.push({target:l,type:"touchstart",handler:function(B){return h._handleTouchStart(B)}});
s.push({target:l,type:"touchmove",handler:function(B){return h._handleTouchMove(B)}});s.push({target:l,type:"touchend",handler:function(B){return h._handleTouchEnd(B)}})}else{o=this._overlayDiv||this._clientDiv;z=i?l:this._frameWindow;s.push({target:l,type:"keydown",handler:function(B){return h._handleKeyDown(B)}});s.push({target:l,type:"keypress",handler:function(B){return h._handleKeyPress(B)}});s.push({target:l,type:"keyup",handler:function(B){return h._handleKeyUp(B)}});s.push({target:l,type:"selectstart",
handler:function(B){return h._handleSelectStart(B)}});s.push({target:l,type:"contextmenu",handler:function(B){return h._handleContextMenu(B)}});s.push({target:l,type:"copy",handler:function(B){return h._handleCopy(B)}});s.push({target:l,type:"cut",handler:function(B){return h._handleCut(B)}});s.push({target:l,type:"paste",handler:function(B){return h._handlePaste(B)}});s.push({target:l,type:"mousedown",handler:function(B){return h._handleMouseDown(B)}});s.push({target:l,type:"mouseover",handler:function(B){return h._handleMouseOver(B)}});
s.push({target:l,type:"mouseout",handler:function(B){return h._handleMouseOut(B)}});s.push({target:z,type:"mouseup",handler:function(B){return h._handleMouseUp(B)}});s.push({target:z,type:"mousemove",handler:function(B){return h._handleMouseMove(B)}});s.push({target:q,type:"mousedown",handler:function(B){return h._handleBodyMouseDown(B)}});s.push({target:q,type:"mouseup",handler:function(B){return h._handleBodyMouseUp(B)}});s.push({target:o,type:"dragstart",handler:function(B){return h._handleDragStart(B)}});
s.push({target:o,type:"drag",handler:function(B){return h._handleDrag(B)}});s.push({target:o,type:"dragend",handler:function(B){return h._handleDragEnd(B)}});s.push({target:o,type:"dragenter",handler:function(B){return h._handleDragEnter(B)}});s.push({target:o,type:"dragover",handler:function(B){return h._handleDragOver(B)}});s.push({target:o,type:"dragleave",handler:function(B){return h._handleDragLeave(B)}});s.push({target:o,type:"drop",handler:function(B){return h._handleDrop(B)}});if(p){s.push({target:this._parentDocument,
type:"mousemove",handler:function(B){return h._handleMouseMove(B)}});s.push({target:this._parentDocument,type:"mouseup",handler:function(B){return h._handleMouseUp(B)}})}i&&s.push({target:this._frameDocument,type:"activate",handler:function(B){return h._handleDocFocus(B)}});k&&s.push({target:this._frameDocument,type:"focus",handler:function(B){return h._handleDocFocus(B)}});if(!i&&!m)s.push({target:this._viewDiv,type:k?"DOMMouseScroll":"mousewheel",handler:function(B){return h._handleMouseWheel(B)}});
k&&!x&&s.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(B){return h._handleDataModified(B)}});if(this._overlayDiv){s.push({target:this._overlayDiv,type:"mousedown",handler:function(B){return h._handleMouseDown(B)}});s.push({target:this._overlayDiv,type:"mouseover",handler:function(B){return h._handleMouseOver(B)}});s.push({target:this._overlayDiv,type:"mouseout",handler:function(B){return h._handleMouseOut(B)}});s.push({target:this._overlayDiv,type:"contextmenu",handler:function(B){return h._handleContextMenu(B)}})}r||
s.push({target:this._clientDiv,type:"dblclick",handler:function(B){return h._handleDblclick(B)}})}for(l=0;l<s.length;l++){q=s[l];b(q.target,q.type,q.handler,q.capture)}},_init:function(h){var l=h.parent;if(typeof l==="string")l=window.document.getElementById(l);if(!l)throw"no parent";h.parent=l;h.model=h.model||new d.TextModel;l=this._defaultOptions();for(var o in l)if(l.hasOwnProperty(o))this["_"+o]=h[o]!==undefined?h[o]:l[o].value;this._rulers=[];this._selection=new e(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(h){return h.toLowerCase().lastIndexOf(".css")===h.length-4},_modifyContent:function(h,l){if(!(this._readonly&&!h._code)){h.type="Verify";this.onVerify(h);if(!(h.text===null||h.text===undefined)){var o=this._model;try{if(h._ignoreDOMSelection)this._ignoreDOMSelection=true;o.setText(h.text,h.start,h.end)}finally{if(h._ignoreDOMSelection)this._ignoreDOMSelection=false}if(l){l=this._getSelection();l.setCaret(h.start+h.text.length);
this._setSelection(l,true)}this.onModify({type:"Modify"})}}},_onModelChanged:function(h){h.type="ModelChanged";this.onModelChanged(h);h.type="Changed";var l=h.start,o=h.addedCharCount,q=h.removedCharCount,s=h.addedLineCount,z=h.removedLineCount,C=this._getSelection();if(C.end>l){if(C.end>l&&C.start<l+q)C.setCaret(l+o);else{C.start+=o-q;C.end+=o-q}this._setSelection(C,false,false)}l=this._model.getLineAtOffset(l);for(o=this._getLineNext();o;){q=o.lineIndex;if(l<=q&&q<=l+z)if(l===q&&!o.modelChangedEvent&&
!o.lineRemoved){o.modelChangedEvent=h;o.lineChanged=true}else{o.lineRemoved=true;o.lineChanged=false;o.modelChangedEvent=null}if(q>l+z)o.lineIndex=q+s-z;o=this._getLineNext(o)}if(l<=this._maxLineIndex&&this._maxLineIndex<=l+z){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(h){h.type="ModelChanging";this.onModelChanging(h);h.type="Changing"},_queueUpdatePage:function(){if(!this._updateTimer){var h=this;this._updateTimer=
setTimeout(function(){h._updateTimer=null;h._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new e(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var h=this._clientDiv;if(h){for(var l=h.firstChild;l;){l.lineRemoved=true;l=l.nextSibling}if(k){this._ignoreFocus=false;(l=this._hasFocus)&&h.blur();h.contentEditable=false;h.contentEditable=
true;l&&h.focus();this._ignoreFocus=false}}},_resizeTouchDiv:function(){for(var h=this._viewDiv.getBoundingClientRect(),l=this._frame.getBoundingClientRect(),o=this._frame;o;){if(o.style&&o.style.top)break;o=o.parentNode}var q=l.top;if(o)q-=o.getBoundingClientRect().top;else q+=this._parentDocument.body.scrollTop;for(o=this._frame;o;){if(o.style&&o.style.left)break;o=o.parentNode}l=l.left;if(o)l-=o.getBoundingClientRect().left;else l+=this._parentDocument.body.scrollLeft;o=this._touchDiv;o.style.left=
l+h.left+"px";o.style.top=q+h.top+"px";o.style.width=h.width+"px";o.style.height=h.height+"px"},_scrollView:function(h,l){this._ensureCaretVisible=false;var o=this._viewDiv;if(h)o.scrollLeft+=h;if(l)o.scrollTop+=l},_setClipboardText:function(h,l){var o;if(this._frameWindow.clipboardData){o=[];this._convertDelimiter(h,function(E){o.push(E)},function(){o.push(A)});return this._frameWindow.clipboardData.setData("Text",o.join(""))}if(p||k||!l){var q=this._frameWindow,s=this._frameDocument,z=s.createElement("PRE");
z.style.position="fixed";z.style.left="-1000px";this._convertDelimiter(h,function(E){z.appendChild(s.createTextNode(E))},function(){z.appendChild(s.createElement("BR"))});z.appendChild(s.createTextNode(" "));this._clientDiv.appendChild(z);h=s.createRange();h.setStart(z.firstChild,0);h.setEndBefore(z.lastChild);q=q.getSelection();q.rangeCount>0&&q.removeAllRanges();q.addRange(h);var C=this;q=function(){z&&z.parentNode===C._clientDiv&&C._clientDiv.removeChild(z);C._updateDOMSelection()};h=false;this._ignoreCopy=
true;try{h=s.execCommand("copy",false,null)}catch(B){}this._ignoreCopy=false;if(!h)if(l){setTimeout(q,0);return false}q();return true}if(l&&l.clipboardData){o=[];this._convertDelimiter(h,function(E){o.push(E)},function(){o.push(A)});return l.clipboardData.setData("text/plain",o.join(""))}},_setDOMSelection:function(h,l,o,q){for(var s=this._frameWindow,z=this._frameDocument,C,B,E,G,M=0,H=h.firstChild,N,L,P=this._model.getLine(h.lineIndex).length;H;){N=H.firstChild;L=N.length;if(H.ignoreChars)L-=H.ignoreChars;
if(M+L>l||M+L>=P){C=N;B=l-M;if(H.ignoreChars&&L>0&&B===L)B+=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>q||M+L>=S){E=N;G=q-M;if(H.ignoreChars&&L>0&&G===L)G+=H.ignoreChars;break}M+=L;H=H.nextSibling}this._setDOMFullSelection(h,l,P,o,q,S);if(!u)if(s.getSelection){z=z.createRange();z.setStart(C,B);z.setEnd(E,G);E=s.getSelection();this._ignoreSelect=false;E.rangeCount>
0&&E.removeAllRanges();E.addRange(z);this._ignoreSelect=true}else if(z.selection){s=z.body;z=z.createElement("DIV");s.appendChild(z);s.removeChild(z);z=s.createTextRange();z.moveToElementText(C.parentNode);z.moveStart("character",B);C=s.createTextRange();C.moveToElementText(E.parentNode);C.moveStart("character",G);z.setEndPoint("EndToStart",C);this._ignoreSelect=false;z.select();this._ignoreSelect=true}},_setDOMFullSelection:function(h,l,o,q,s,z){var C=this._model;if(this._selDiv1){var B,E;B=this._getLineBoundingClientRect(h);
if(l===0)E=B.left;else if(l>=o)E=B.right;else{this._ignoreDOMSelection=true;E=this._getBoundsAtOffset(C.getLineStart(h.lineIndex)+l).left;this._ignoreDOMSelection=false}if((o=this._textArea)&&u){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<=B.top&&B.top<=H.top+H.height)||!(h===q&&l===s)?"-1000px":E-4+G.left-M.left+"px";o.style.top=B.top+
G.top-M.top+"px";o.style.width="6px";o.style.height=B.bottom-B.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(!(h===q&&l===s)){G=u?2:0;M=G+"px blue solid";var N=this._getViewPadding();H=this._clientDiv.getBoundingClientRect();var L=this._viewDiv.getBoundingClientRect();l=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(q);if(s===0)s=S.left;else if(s>=z)s=S.right;else{this._ignoreDOMSelection=true;s=this._getBoundsAtOffset(C.getLineStart(q.lineIndex)+s).left;this._ignoreDOMSelection=false}z=this._selDiv1;E=Math.min(o,Math.max(l,E));C=Math.min(P,Math.max(L,B.top));var D=o;B=Math.min(P,Math.max(L,B.bottom));z.style.left=E-H+"px";z.style.top=C-N+"px";z.style.width=Math.max(0,D-E)+"px";z.style.height=Math.max(0,B-C)+(u?1:0)+"px";if(u){z.style.borderLeft=
M;z.style.borderRight="0px"}if(h===q){D=Math.min(s,o);z.style.width=Math.max(0,D-E-G*2)+"px";if(u)z.style.borderRight=M}else{h=Math.min(P,Math.max(L,S.top));q=Math.min(o,Math.max(l,s));E=Math.min(P,Math.max(L,S.bottom));s=this._selDiv3;s.style.left=l-H+"px";s.style.top=h-N+"px";s.style.width=Math.max(0,q-l-G)+"px";s.style.height=Math.max(0,E-h)+"px";if(u)s.style.borderRight=M;if(h-B>0){q=this._selDiv2;q.style.left=l-H+"px";q.style.top=B-N+"px";q.style.width=Math.max(0,o-l)+"px";q.style.height=Math.max(0,
h-B)+(u?1:0)+"px"}}}}},_setGrab:function(h){if(h!==this._grabControl)if(h){h.setCapture&&h.setCapture();this._grabControl=h}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(h){if(this._linksVisible!==h){this._linksVisible=h;if(i&&h)this._hadFocus=this._hasFocus;var l=this._clientDiv;l.contentEditable=!h;this._hadFocus&&!h&&l.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=h?"-1":"1";h=this._frameDocument;for(l=this._getLineNext();l;){if(l.hasLink)for(var o=
l.firstChild;o;){var q=o.nextSibling,s=o.viewStyle;s&&s.tagName==="A"&&l.replaceChild(this._createSpan(l,h,o.firstChild.data,s),o);o=q}l=this._getLineNext(l)}}},_setSelection:function(h,l,o,q){if(h){this._columnX=-1;if(o===undefined)o=true;var s=this._selection;if(!s.equals(h)){this._selection=h;this.onSelection({type:"Selection",oldValue:{start:s.start,end:s.end},newValue:{start:h.start,end:h.end}})}if(l)o=!this._showCaret(false,q);o&&this._updateDOMSelection()}},_setSelectionTo:function(h,l,o,q){var s=
this._model,z=this._getSelection();l=this._getYToLine(l);if(this._clickCount===1){s=this._getXToOffset(l,h);if(q&&!o)if(z.start<=s&&s<z.end){this._dragOffset=s;return false}z.extend(s);o||z.collapse()}else{if((this._clickCount&1)===0){s=this._getXToOffset(l,h);if(this._doubleClickSelection)if(s>=this._doubleClickSelection.start){o=this._doubleClickSelection.start;s=this._getOffset(s,"wordend",+1)}else{o=this._getOffset(s,"word",-1);s=this._doubleClickSelection.end}else{o=this._getOffset(s,"word",
-1);s=this._getOffset(o,"wordend",+1)}}else if(this._doubleClickSelection){q=s.getLineAtOffset(this._doubleClickSelection.start);if(l>=q){o=s.getLineStart(q);s=s.getLineEnd(l)}else{o=s.getLineStart(l);s=s.getLineEnd(q)}}else{o=s.getLineStart(l);s=s.getLineEnd(l)}z.setCaret(o);z.extend(s)}this._setSelection(z,true,true);return true},_setStyleSheet:function(h){var l=this._stylesheet;l instanceof Array||(l=[l]);this._stylesheet=h;h instanceof Array||(h=[h]);for(var o=this._frameDocument,q=o.styleSheets,
s=o.getElementsByTagName("head")[0],z=false,C=0,B,E;C<h.length;){if(C>=l.length)break;B=h[C];E=l[C];if(B!==E)if(this._isLinkURL(B))return true;else{z=q[C+1];z=z.ownerNode;E=o.createElement("STYLE");B=o.createTextNode(B);E.appendChild(B);s.replaceChild(E,z);z=true}C++}if(C<l.length)for(;C<l.length;){B=l[C];if(this._isLinkURL(B))return true;else{z=q[C+1];z=z.ownerNode;s.removeChild(z);z=true}C++}else for(;C<h.length;){B=h[C];if(this._isLinkURL(B))return true;else{E=o.createElement("STYLE");B=o.createTextNode(B);
E.appendChild(B);s.appendChild(E);z=true}C++}z&&this._updateStyle();return false},_setFullSelection:function(h,l){this._fullSelection=h;if(i<9)this._fullSelection=false;if(t)this._fullSelection=true;var o=this._clipDiv||this._scrollDiv;if(o)if(!u&&!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&&(u||this._fullSelection&&
!t)){h=this._frameDocument;this._hightlightRGB="Highlight";var q=h.createElement("DIV");this._selDiv1=q;q.id="selDiv1";q.style.position=this._clipDiv?"absolute":"fixed";q.style.borderWidth="0px";q.style.margin="0px";q.style.padding="0px";q.style.MozOutline="none";q.style.outline="none";q.style.background=this._hightlightRGB;q.style.width="0px";q.style.height="0px";q.style.zIndex="0";o.appendChild(q);var s=h.createElement("DIV");this._selDiv2=s;s.id="selDiv2";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 z=h.createElement("DIV");this._selDiv3=z;z.id="selDiv3";z.style.position=this._clipDiv?"absolute":"fixed";z.style.borderWidth="0px";z.style.margin="0px";z.style.padding="0px";z.style.MozOutline="none";z.style.outline="none";z.style.background=this._hightlightRGB;
z.style.width="0px";z.style.height="0px";z.style.zIndex="0";o.appendChild(z);if(k&&v){o=this._frameWindow.getComputedStyle(z,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;q.style.background=o;s.style.background=o;z.style.background=o;if(!this._insertedSelRule){h.styleSheets[0].insertRule("::-moz-selection {background: "+o+"; }",0);this._insertedSelRule=true}}l||this._updateDOMSelection()}},_setTabSize:function(h,l){this._tabSize=h;this._customTabSize=undefined;h=this._clientDiv;if(m){if(h)h.style.OTabSize=this._tabSize+""}else if(k>=4){if(h)h.style.MozTabSize=
this._tabSize+""}else if(this._tabSize!==8){this._customTabSize=this._tabSize;l||this.redrawLines()}},_setThemeClass:function(h,l){this._themeClass=h;if(h=this._frameDocument){var o="viewContainer";if(this._themeClass)o+=" "+this._themeClass;h.body.className=o;l||this._updateStyle()}},_showCaret:function(h,l){if(this._clientDiv){var o=this._model,q=this._getSelection(),s=this._getScroll(),z=q.getCaret(),C=q.start,B=q.end,E=o.getLineAtOffset(C),G=o.getLineAtOffset(B),M=Math.max(Math.max(C,o.getLineStart(G)),
B-1),H=this._getViewPadding(),N=this._getClientWidth(),L=H.left;H=H.left+N;var P=this._getBoundsAtOffset(z===C?C:M),S=P.left,D=P.right,F=N/4;if(h&&!q.isEmpty()&&E===G){P=this._getBoundsAtOffset(z===B?C:M);if(N-F>(z===C?P.right-S:D-P.left)){if(S>P.left)S=P.left;if(D<P.right)D=P.right}}q=this._viewDiv.getBoundingClientRect();S-=q.left;D-=q.left;q=0;if(S<L)q=Math.min(S-L,-F);if(D>H)q=Math.min(this._scrollDiv.scrollWidth-s.x-N,Math.max(D-H,F));L=0;S=this._getTopIndex(true);D=this._getBottomIndex(true);
o=o.getLineAtOffset(z);H=this._getClientHeight();if(!(S<=o&&o<=D)){S=this._getLineHeight();h=h?(G-E)*S:0;L=o*S;L-=s.y;if(L+S>H){L-=H-S;if(z===C&&C!==B)L+=Math.min(H-S,h)}else if(z===B)L-=Math.min(H-S,h);if(l)if(l>0){if(L>0)L=Math.max(L,l)}else if(L<0)L=Math.min(L,l)}if(q!==0||L!==0){this._scrollView(q,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 h=this._getSelection();
h.isEmpty()||this._modifyContent({text:"",start:h.start,end:h.end},true);this._imeOffset=h.start}},_unhookEvents:function(){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);this._modelListener=null;for(var h=0;h<this._handlers.length;h++){var l=this._handlers[h];c(l.target,l.type,l.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var h=this._getSelection(),
l=this._model,o=l.getLineAtOffset(h.start),q=l.getLineAtOffset(h.end),s=this._getLineNext();if(s){var z=this._getLinePrevious(),C;if(o<s.lineIndex){C=s;o=0}else if(o>z.lineIndex){C=z;o=0}else{C=this._getLineNode(o);o=h.start-l.getLineStart(o)}if(q<s.lineIndex){s=s;h=0}else if(q>z.lineIndex){s=z;h=0}else{s=this._getLineNode(q);h=h.end-l.getLineStart(q)}this._setDOMSelection(C,o,s,h)}}},_updatePage:function(h){if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=
null;h=false}var l=this._clientDiv;if(l){var o=this._model,q=this._getScroll(),s=this._getViewPadding(),z=o.getLineCount(),C=this._getLineHeight(),B=Math.max(0,q.y)/C,E=Math.floor(B),G=Math.max(0,E-1),M=Math.round((B-G)*C),H=this._partialY=Math.round((B-E)*C);B=z*C;var N,L;if(h){N=this._getClientWidth();L=this._getClientHeight();o=this._leftDiv?this._leftDiv.scrollWidth:0;E=Math.max(this._maxLineWidth,N)}else{var P=this._frameDocument;q=this._getFrameWidth();L=this._getFrameHeight();P.body.style.width=
q+"px";P.body.style.height=L+"px";N=this._viewDiv;N.style.height=Math.max(0,L-s.top-s.bottom)+"px";L=this._getClientHeight();C=Math.floor((L+H)/C);C=Math.min(E+C,z-1);for(var S=Math.min(C+1,z-1),D=l.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 l.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){l.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&&l.insertBefore(F,D);if(t)l.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===
C)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<z){o=this._createLine(l,null,P,H,o);G=this._getLineBoundingClientRect(o);G=G.right-G.left;if(G>=this._maxLineWidth){this._maxLineWidth=G;this._maxLineIndex=H}l.removeChild(o)}}this._updateRuler(this._leftDiv,E,C);this._updateRuler(this._rightDiv,E,C);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,q-o-E-s.left-s.right)+"px";if(this._rightDiv)this._rightDiv.style.left=q-E+"px";q=this._scrollDiv;q.style.height=B+"px";N=this._getClientWidth();E=z=Math.max(this._maxLineWidth,N);if(!i||i>=9)z+=s.right;q.style.width=z+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=z+"px";q=this._getScroll();z=L+s.top+s.bottom;this._updateRulerSize(this._leftDiv,z);this._updateRulerSize(this._rightDiv,z)}H=q.x;
C=this._clipDiv;z=this._overlayDiv;if(C){C.scrollLeft=H;G=o+s.left;P=s.top;h=N;o=L;H=0;D=-M;if(q.x===0){G-=s.left;h+=s.left;H=s.left}if(q.x+N===E)h+=s.right;if(q.y===0){P-=s.top;o+=s.top;D+=s.top}if(q.y+L===B)o+=s.bottom;C.style.left=G+"px";C.style.top=P+"px";C.style.width=h+"px";C.style.height=o+"px";l.style.left=H+"px";l.style.top=D+"px";l.style.width=E+"px";l.style.height=L+M+"px";if(z){z.style.left=l.style.left;z.style.top=l.style.top;z.style.width=l.style.width;z.style.height=l.style.height}}else{G=
H;P=M;C=H+N;D=M+L;if(G===0)G-=s.left;if(P===0)P-=s.top;if(C===E)C+=s.right;if(q.y+L===B)D+=s.bottom;l.style.clip="rect("+P+"px,"+C+"px,"+D+"px,"+G+"px)";l.style.left=-H+o+s.left+"px";l.style.width=(t?E:N+H)+"px";if(!h){l.style.top=-M+s.top+"px";l.style.height=L+M+"px"}if(z){z.style.clip=l.style.clip;z.style.left=l.style.left;z.style.width=l.style.width;if(!h){z.style.top=l.style.top;z.style.height=l.style.height}}}this._updateDOMSelection();l=this._ensureCaretVisible;this._ensureCaretVisible=false;
if(L!==this._getClientHeight()){this._updatePage();l&&this._showCaret()}if(u){var J=this;setTimeout(function(){J._resizeTouchDiv()},0)}}}},_updateRulerSize:function(h,l){if(h){for(var o=this._partialY,q=this._getLineHeight(),s=h.firstChild.rows[0].cells,z=0;z<s.length;z++){var C=s[z].firstChild,B=q;if(C._ruler.getOverview()==="page")B+=o;C.style.top=-B+"px";C.style.height=l+B+"px"}h.style.height=l+"px"}},_updateRuler:function(h,l,o){if(h){h=h.firstChild.rows[0].cells;for(var q=this._getLineHeight(),
s=this._frameDocument,z=this._getViewPadding(),C=0;C<h.length;C++){var B=h[C].firstChild,E=B._ruler;B.rulerChanged&&this._applyStyle(E.getRulerStyle(),B);var G,M=B.firstChild;if(M){G=M;M=M.nextSibling}else{G=s.createElement("DIV");G.style.visibility="hidden";B.appendChild(G)}var H,N;if(B.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=q+z.top+"px"}var L,P;if(E.getOverview()==="page"){for(E=E.getAnnotations(l,
o+1);M;){H=M.lineIndex;N=M.nextSibling;if(!(l<=H&&H<=o)||M.lineChanged)B.removeChild(M);M=N}M=B.firstChild.nextSibling;P=s.createDocumentFragment();for(H=l;H<=o;H++)if(!M||M.lineIndex>H){L=s.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=q+"px";P.appendChild(L)}else{if(P.firstChild){B.insertBefore(P,M);P=s.createDocumentFragment()}if(M)M=M.nextSibling}P.firstChild&&B.insertBefore(P,M)}else{M=u?0:17;N=this._getClientHeight();
H=this._model.getLineCount();G=N+z.top+z.bottom-2*M;var S;S=q*H<G?q:G/H;if(B.rulerChanged){for(N=B.childNodes.length;N>1;){B.removeChild(B.lastChild);N--}E=E.getAnnotations(0,H);P=s.createDocumentFragment();for(var D in E){H=D>>>0;if(!(H<0)){L=s.createElement("DIV");N=E[D];this._applyStyle(N.style,L);L.style.position="absolute";L.style.top=M+q+Math.floor(H*S)+"px";if(N.html)L.innerHTML=N.html;L.annotation=N;L.lineIndex=H;P.appendChild(L)}}B.appendChild(P)}else if(B._oldTrackHeight!==G)for(L=B.firstChild?
B.firstChild.nextSibling:null;L;){L.style.top=M+q+Math.floor(L.lineIndex*S)+"px";L=L.nextSibling}B._oldTrackHeight=G}B.rulerChanged=false}}},_updateStyle:function(){var h=this._frameDocument;if(i)h.body.style.lineHeight="normal";var l=this._metrics=this._calculateMetrics();if(i)h.body.style.lineHeight=l.lineHeight-(l.lineTrim.top+l.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,f){function a(b){this._model=b;this._projections=[]}a.prototype={addProjection:function(b){if(b){var c=this._model,e=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 j=b._lineCount,i=
b._model.getCharCount(),k=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:b._model.getText(),start:c,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k});var m=this._binarySearch(e,b.start);e.splice(m,0,b);this.onChanged({type:"Changed",start:c,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,c){var e=this._projections,
g=0,j;if(c){for(c=0;c<e.length;c++){j=e[c];if(j.start>b)break;if(j.end>b)return-1;g+=j._model.getCharCount()-(j.end-j.start)}return b+g}for(c=0;c<e.length;c++){j=e[c];if(j.start>b-g)break;var i=j._model.getCharCount();if(j.start+i>b-g)return-1;g+=i-(j.end-j.start)}return b-g},removeProjection:function(b){var c,e=0;for(c=0;c<this._projections.length;c++){var g=this._projections[c];if(g===b){b=g;break}e+=g._model.getCharCount()-(g.end-g.start)}if(c<this._projections.length){g=this._model;e=b.start+
e;var j=b.end-b.start,i=b._lineCount,k=b._model.getCharCount(),m=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:g.getText(b.start,b.end),start:e,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i});this._projections.splice(c,1);this.onChanged({type:"Changed",start:e,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i})}},_binarySearch:function(b,c){for(var e=b.length,g=-1,j;e-g>1;){j=Math.floor((e+g)/2);if(c<=b[j].start)e=j;else g=j}return e},
getCharCount:function(){for(var b=this._model.getCharCount(),c=this._projections,e=0;e<c.length;e++){var g=c[e];b+=g._model.getCharCount()-(g.end-g.start)}return b},getLine:function(b,c){if(b<0)return null;var e=this._model,g=this._projections,j=0,i=[],k=0,m,p,w;for(m=0;m<g.length;m++){w=g[m];if(w._lineIndex>=b-j)break;p=w._model.getLineCount()-1;if(w._lineIndex+p>=b-j){k=b-(w._lineIndex+j);if(k<p)return w._model.getLine(k,c);else i.push(w._model.getLine(p))}k=w.end;j+=p-w._lineCount}for(k=Math.max(k,
e.getLineStart(b-j));m<g.length;m++){w=g[m];if(w._lineIndex>b-j)break;i.push(e.getText(k,w.start));p=w._model.getLineCount()-1;if(w._lineIndex+p>b-j){i.push(w._model.getLine(0,c));return i.join("")}i.push(w._model.getText());k=w.end;j+=p-w._lineCount}b=e.getLineEnd(b-j,c);k<b&&i.push(e.getText(k,b));return i.join("")},getLineAtOffset:function(b){for(var c=this._model,e=this._projections,g=0,j=0,i=0;i<e.length;i++){var k=e[i];if(k.start>b-g)break;var m=k._model.getCharCount();if(k.start+m>b-g){e=b-
(k.start+g);j+=k._model.getLineAtOffset(e);g+=e;break}j+=k._model.getLineCount()-1-k._lineCount;g+=m-(k.end-k.start)}return c.getLineAtOffset(b-g)+j},getLineCount:function(){for(var b=this._projections,c=this._model.getLineCount(),e=0;e<b.length;e++){var g=b[e];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 e=this._model,g=this._projections,j=0,i=0,k=0;k<g.length;k++){var m=g[k];
if(m._lineIndex>b-j)break;var p=m._model.getLineCount()-1;if(m._lineIndex+p>b-j)return m._model.getLineEnd(b-(m._lineIndex+j),c)+m.start+i;i+=m._model.getCharCount()-(m.end-m.start);j+=p-m._lineCount}return e.getLineEnd(b-j,c)+i},getLineStart:function(b){if(b<0)return-1;for(var c=this._model,e=this._projections,g=0,j=0,i=0;i<e.length;i++){var k=e[i];if(k._lineIndex>=b-g)break;var m=k._model.getLineCount()-1;if(k._lineIndex+m>=b-g)return k._model.getLineStart(b-(k._lineIndex+g))+k.start+j;j+=k._model.getCharCount()-
(k.end-k.start);g+=m-k._lineCount}return c.getLineStart(b-g)+j},getText:function(b,c){if(b===undefined)b=0;var e=this._model,g=this._projections,j=0,i=[],k,m,p;for(k=0;k<g.length;k++){m=g[k];if(m.start>b-j)break;p=m._model.getCharCount();if(m.start+p>b-j)if(c!==undefined&&m.start+p>c-j)return m._model.getText(b-(m.start+j),c-(m.start+j));else{i.push(m._model.getText(b-(m.start+j)));b=m.end+j+p-(m.end-m.start)}j+=p-(m.end-m.start)}b=b-j;if(c!==undefined){for(;k<g.length;k++){m=g[k];if(m.start>c-j)break;
i.push(e.getText(b,m.start));p=m._model.getCharCount();if(m.start+p>c-j){i.push(m._model.getText(0,c-(m.start+j)));return i.join("")}i.push(m._model.getText());b=m.end;j+=p-(m.end-m.start)}i.push(e.getText(b,c-j))}else{for(;k<g.length;k++){m=g[k];i.push(e.getText(b,m.start));i.push(m._model.getText());b=m.end}i.push(e.getText(b))}return i.join("")},_onChanging:function(b,c,e,g,j,i){for(var k=this._model,m=this._projections,p,w=0,t,u=c+e;p<m.length;p++){e=m[p];if(e.start>c)break;w+=e._model.getCharCount()-
(e.end-e.start)}c=c+w;for(var v=p;p<m.length;p++){e=m[p];if(e.start>u)break;w+=e._model.getCharCount()-(e.end-e.start);t+=e._model.getLineCount()-1-e._lineCount}e=u+w;w=p;this.onChanging(c,e-c,g,j+t,i);m.splice(m,w-v);for(b=b.length-(e-c);p<m.length;p++){e=m[p];e.start+=b;e.end+=b;e._lineIndex=k.getLineAtOffset(e.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,e){if(b===undefined)b="";if(c===undefined)c=0;var g=c,j=e,i=this._model,k=this._projections,m=0,p=0,w,t,u,v,x,n=0;for(w=0;w<k.length;w++){t=k[w];if(t.start>c-m)break;u=t._model.getCharCount();if(t.start+u>c-m)if(e!==undefined&&t.start+u>e-m){t._model.setText(b,c-(t.start+m),e-(t.start+m));return}else{n=t._model.getLineCount()-1-t._model.getLineAtOffset(c-(t.start+m));v={projection:t,start:c-(t.start+m)};c=t.end+m+u-(t.end-t.start)}p+=t._model.getLineCount()-1-t._lineCount;m+=u-(t.end-t.start)}c=
c-m;var r=w;n=i.getLineAtOffset(c)+p-n;if(e!==undefined)for(;w<k.length;w++){t=k[w];if(t.start>e-m)break;u=t._model.getCharCount();if(t.start+u>e-m){p+=t._model.getLineAtOffset(e-(t.start+m));u=e-(t.start+m);e=t.end+m;x={projection:t,end:u};break}p+=t._model.getLineCount()-1-t._lineCount;m+=u-(t.end-t.start)}else{for(;w<k.length;w++){t=k[w];p+=t._model.getLineCount()-1-t._lineCount;m+=t._model.getCharCount()-(t.end-t.start)}e=j=i.getCharCount()+m}e=e-m;w=w;t=i.getLineAtOffset(e)+p;j=j-g;p=t-n;n=b.length;
for(var y=u=t=m=0;;){if(t!==-1&&t<=y)t=b.indexOf("\r",y);if(u!==-1&&u<=y)u=b.indexOf("\n",y);if(u===-1&&t===-1)break;y=t!==-1&&u!==-1?t+1===u?u+1:(t<u?t:u)+1:t!==-1?t+1:u+1;m++}this.onChanging({type:"Changing",text:b,start:g,removedCharCount:j,addedCharCount:n,removedLineCount:p,addedLineCount:m});i.setText(b,c,e);if(v){t=v.projection;t._model.setText("",v.start)}if(x){t=x.projection;t._model.setText("",0,x.end);t.start=t.end;t._lineCount=0}k.splice(r,w-r);b=b.length-(e-c);for(w=w;w<k.length;w++){t=
k[w];t.start+=b;t.end+=b;t._lineIndex=i.getLineAtOffset(t.start)}this.onChanged({type:"Changed",start:g,removedCharCount:j,addedCharCount:n,removedLineCount:p,addedLineCount:m})}};f.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,f,a,b){function c(e){this._view=e;this._create(e._parent.ownerDocument);e.addEventListener("Destroy",this,this.destroy)}c.getTooltip=function(e){if(!e._tooltip)e._tooltip=new c(e);return e._tooltip};c.prototype={_create:function(e){if(!this._domNode){this._document=e;var g=this._domNode=e.createElement("DIV");g.className="viewTooltip";
var j=this._viewParent=e.createElement("DIV");g.appendChild(j);j=this._htmlParent=e.createElement("DIV");g.appendChild(j);e.body.appendChild(g);this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var e=this._domNode.parentNode;e&&e.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(e){if(this.target!==e){this._target=e;this.hide();if(e){var g=this;g._showTimeout=setTimeout(function(){g.show(true)},1E3)}}},show:function(e){if(this._target){var g=this._target.getTooltipInfo();if(g){var j=this._domNode;j.style.left=j.style.right=j.style.width=j.style.height="auto";var i=g.contents,k;if(i instanceof Array)i=this._getAnnotationContents(i);if(typeof i===
"string")(k=this._htmlParent).innerHTML=i;else if(i instanceof Node)(k=this._htmlParent).appendChild(i);else if(i instanceof b.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new a.TextModel("");k=this._contentsView=new f.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"]});k._clientDiv.contentEditable=false;var m=this._view;k.addEventListener("LineStyle",
{onLineStyle:function(w){m.onLineStyle(w)}}.onLineStyle)}k=this._contentsView;k.setModel(i);i=k.computeSize();k=this._viewParent;k.style.width=i.width+20+"px";k.style.height=i.height+"px"}else return;k.style.left="auto";k.style.position="static";k.style.visibility="visible";i=parseInt(this._getNodeStyle(j,"padding-left","0"),10);i+=parseInt(this._getNodeStyle(j,"border-left-width","0"),10);if(g.anchor==="right"){k=parseInt(this._getNodeStyle(j,"padding-right","0"),10);k+=parseInt(this._getNodeStyle(j,
"border-right-width","0"),10);j.style.right=j.ownerDocument.body.getBoundingClientRect().right-g.x+i+k+"px"}else j.style.left=g.x-i+"px";i=parseInt(this._getNodeStyle(j,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(j,"border-top-width","0"),10);j.style.top=g.y-i+"px";j.style.maxWidth=g.maxWidth+"px";j.style.maxHeight=g.maxHeight+"px";j.style.opacity="1";j.style.visibility="visible";if(e){var p=this;p._hideTimeout=setTimeout(function(){var w=parseFloat(p._getNodeStyle(j,"opacity","1"));p._fadeTimeout=
setInterval(function(){if(j.style.visibility==="visible"&&w>0){w-=0.1;j.style.opacity=w}else p.hide()},50)},5E3)}}}},_getAnnotationContents:function(e){function g(w,t){w=i.getLineStart(i.getLineAtOffset(w));t=i.getLineEnd(i.getLineAtOffset(t),true);return i.getText(w,t)}if(e.length===0)return null;var j=this._view.getModel(),i=j.getBaseModel?j.getBaseModel():j,k;if(e.length===1){j=e[0];if(j.title){k=j.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div>"+j.html+"&nbsp;<span style='vertical-align:middle;'>"+
k+"</span><div>"}else{e=new b.ProjectionTextModel(i);k=i.getLineStart(i.getLineAtOffset(j.start));e.addProjection({start:j.end,end:e.getCharCount()});e.addProjection({start:0,end:k});return e}}else{for(var m="<div><em>"+d.multipleAnnotations+"</em></div>",p=0;p<e.length;p++){j=e[p];(k=j.title)||(k=g(j.start,j.end));k=k.replace(/</g,"&lt;").replace(/>/g,"&gt;");m+="<div>"+j.html+"&nbsp;<span style='vertical-align:middle;'>"+k+"</span><div>"}return m}},_getNodeStyle:function(e,g,j){var i;if(e){i=e.style[g];
if(!i)if(e.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=e.currentStyle[g]}else i=(e=e.ownerDocument.defaultView.getComputedStyle(e,null))?e.getPropertyValue(g):null}return i||j}};return{Tooltip:c}});
define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget","orion/textview/tooltip"],function(d,f,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 e;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,j){this._statusReporter?this._statusReporter(g,j):window.alert(j==="error"?"ERROR: "+g:g)},getModel:function(){var g=this._textView.getModel();if(g.getBaseModel)g=g.getBaseModel();return g},mapOffset:function(g,j){var i=this._textView.getModel();if(i.getBaseModel)g=i.mapOffset(g,j);return g},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var g=this._textView,j=g.getSelection();g=g.getModel();if(g.getBaseModel){j.start=g.mapOffset(j.start);j.end=g.mapOffset(j.end)}return j},getText:function(g,j){var i=this._textView.getModel();if(i.getBaseModel)i=i.getBaseModel();return i.getText(g,j)},_expandOffset:function(g){var j=this._textView.getModel(),i=this._annotationModel;if(i&&j.getBaseModel)for(g=i.getAnnotations(g,g+1);g.hasNext();){j=g.next();if(j.type==="orion.annotation.folding")if(j.expand){j.expand();i.modifyAnnotation(j)}}},
setCaretOffset:function(g){var j=this._textView,i=j.getModel();if(i.getBaseModel){this._expandOffset(g);g=i.mapOffset(g,true)}j.setCaretOffset(g)},setText:function(g,j,i){var k=this._textView,m=k.getModel();if(m.getBaseModel){if(j!==undefined){this._expandOffset(j);j=m.mapOffset(j,true)}if(i!==undefined){this._expandOffset(i);i=m.mapOffset(i,true)}}k.setText(g,j,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,j,i){var k=this._textView,m=k.getModel();if(m.getBaseModel){this._expandOffset(g);
this._expandOffset(j);g=m.mapOffset(g,true);j=m.mapOffset(j,true)}k.setSelection(g,j,i)},moveSelection:function(g,j,i){j=j||g;var k=this._textView;this.setSelection(g,j,false);j=k.getTopPixel();var m=k.getBottomPixel();g=this.getModel().getLineAtOffset(g);g=k.getLinePixel(g);if(g<j||g>m){m=Math.max(0,g-Math.floor((g<j?3:1)*(m-j)/4));(new e.Animation({node:k,duration:300,curve:[j,m],onAnimate:function(p){k.setTopPixel(Math.floor(p))},onEnd:function(){k.showSelection();k.focus();i&&i()}})).play()}else{k.showSelection();
k.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,j){var i=this._textView,k=this.getAnnotationModel();if(!k)return null;var m=this._annotationStyler;if(!m)return null;var p=i.getOffsetAtLocation(g,j);if(p===-1)return null;p=this.mapOffset(p);m=m.getAnnotationsByType(k,p,p+1);k=[];for(p=0;p<m.length;p++)m[p].rangeStyle&&
k.push(m[p]);if(k.length===0)return null;g=i.convert({x:g,y:j},"document","page");return{contents:k,anchor:"left",x:g.x+10,y:g.y+20}},getAnnotationModel:function(){return this._annotationModel},doFind:function(g,j,i,k){var m=this.getText();if(i){g=g.toLowerCase();m=m.toLowerCase()}if(k){m=m.split("").reverse().join("");g=g.split("").reverse().join("");j=m.length-j-1;j=m.indexOf(g,j);if(j!==-1)return{index:m.length-g.length-j,length:g.length}}else{j=m.indexOf(g,j);if(j!==-1)return{index:j,length:g.length}}return null},
doFindRegExp:function(g,j,i,k){if(!g)return null;j=j||"";j+=(j.indexOf("g")===-1?"g":"")+(j.indexOf("m")===-1?"m":"");g=new RegExp(g,j);j=this.getText();var m=null,p=null;if(k)for(;;)if((m=g.exec(j))&&m.index<=i)p={index:m.index,length:m[0].length};else return p;else return(m=g.exec(j.substring(i)))&&{index:m.index+i,length:m[0].length}},_highlightCurrentLine:function(g,j){var i=this._annotationModel;if(i){var k=this._textView.getModel(),m=j?k.getLineAtOffset(j.start):-1,p=k.getLineAtOffset(g.start);
g=g.start===g.end;j=!j||j.start===j.end;if(!(m===p&&j&&g)){m=this._currentLineAnnotation?[this._currentLineAnnotation]:null;this._currentLineAnnotation=null;var w;if(g){w=k.getLineStart(p);p=k.getLineEnd(p);if(k.getBaseModel){w=k.mapOffset(w);p=k.mapOffset(p)}this._currentLineAnnotation={start:w,end:p,type:this.currentLineType,title:d.currentLine,html:"<div class='annotationHTML currentLine'></div>",overviewStyle:{styleClass:"annotationOverview currentLine"},lineStyle:{styleClass:"annotationLine currentLine"}};
w=[this._currentLineAnnotation]}i.replaceAnnotations(m,w)}}},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,j=this._textView,i=this;this._listener={onModelChanged:function(){i.checkDirty()},onMouseOver:function(m){i._listener.onMouseMove(m)},onMouseMove:function(m){var p=b.Tooltip.getTooltip(j);p&&p.setTarget({x:m.x,y:m.y,getTooltipInfo:function(){return i._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(){var m=b.Tooltip.getTooltip(j);m&&m.setTarget(null)},onSelection:function(m){i._updateCursorStatus();i._highlightCurrentLine(m.newValue,m.oldValue)}};
j.addEventListener("ModelChanged",this._listener.onModelChanged);j.addEventListener("Selection",this._listener.onSelection);j.addEventListener("MouseOver",this._listener.onMouseOver);j.addEventListener("MouseOut",this._listener.onMouseOut);j.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);j.setKeyBinding(new f.KeyBinding(27),"Cancel Current Mode");j.setAction("Cancel Current Mode",function(){for(var m=
false,p=0;p<this._keyModes.length;p++)if(this._keyModes[p].isActive())m=this._keyModes[p].cancel()||m;return m}.bind(this));j.setAction("lineUp",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineUp();return false}.bind(this));j.setAction("lineDown",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineDown();return false}.bind(this));j.setAction("enter",function(){for(var m=0;m<
this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].enter();return false}.bind(this));if(this._annotationFactory){var k=j.getModel();if(k.getBaseModel)k=k.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(k);k=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=k.annotationRuler;this._annotationRuler.onClick=function(m){if(m!==undefined)if(m!==-1){var p=j.getModel(),w=this.getAnnotationModel(),
t=g.mapOffset(p.getLineStart(m));m=g.mapOffset(p.getLineEnd(m));for(m=w.getAnnotations(t,m);m.hasNext();){w=m.next();if(this.isAnnotationTypeVisible(w.type)){m=g.getModel();g.onGotoLine(m.getLineAtOffset(t),w.start-t,w.end-t);break}}}};this._overviewRuler=k.overviewRuler;this._overviewRuler.onClick=function(m){if(m!==undefined){m=j.getModel().getLineStart(m);g.moveSelection(g.mapOffset(m))}};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);j.addRuler(this._annotationRuler);j.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);j.addRuler(this._lineNumberRuler)}this._updateFoldingRuler();this.dispatchEvent({type:"TextViewInstalled",textView:j})},_updateCursorStatus:function(){var g=this.getModel(),j=this.getCaretOffset(),i=g.getLineAtOffset(j);g=g.getLineStart(i);j=j-g;for(g=0;g<this._keyModes.length;g++){var k=this._keyModes[g];if(k.isActive()&&k.isStatusActive&&k.isStatusActive())return}this.reportStatus(d.formatMessage(d.lineColumn,i+1,j+1))},showProblems:function(g){var j=
this._annotationModel;if(j){for(var i=[],k=[],m=j.getTextModel(),p=j.getAnnotations(0,m.getCharCount()),w;p.hasNext();){w=p.next();if(w.type===this.errorType||w.type===this.warningType)i.push(w)}if(g)for(p=0;p<g.length;p++)if(w=g[p]){var t=w.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),u=m.getLineStart(w.line-1),v=w.severity;w={type:this[v+"Type"],start:u+w.start-1,end:u+w.end,title:t,html:"<div class='annotationHTML "+v+"'></div>",style:{styleClass:"annotation "+v},overviewStyle:{styleClass:"annotationOverview "+
v},rangeStyle:{styleClass:"annotationRange "+v}};k.push(w)}j.replaceAnnotations(i,k)}},showSelection:function(g,j,i,k,m){if(typeof g==="number"){if(typeof j!=="number")j=g;this.moveSelection(g,j)}else if(typeof i==="number"){g=this.getModel().getLineStart(i-1);if(typeof k==="number")g+=k;if(typeof m!=="number")m=0;this.moveSelection(g,g+m)}},setInput:function(g,j,i,k){this._title=g;if(this._textView)if(k){this._undoStack.markClean();this.checkDirty()}else{if(j)this._textView.setText(j);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:j,contents:i,contentsSaved:k})},onInputChanged:function(g){return this.dispatchEvent(g)},onGotoLine:function(g,j,i){if(this._textView){var k=this.getModel(),m=k.getLineStart(g),p=0;if(i===undefined)i=0;if(typeof j==="string"){g=
k.getLine(g).indexOf(j);if(g!==-1){p=g;i=p+j.length}}else{p=j;j=k.getLineEnd(g)-m;p=Math.min(p,j);i=Math.min(i,j)}this.moveSelection(m+p,m+i)}},onDirtyChanged:function(g){return this.dispatchEvent(g)},getTitle:function(){return this._title}};a.EventTarget.addMixin(c.prototype);e={Animation:function(){function g(j){this.options=j}g.prototype.play=function(){function j(){x=x===-1?(new Date).getTime():x;var n=((new Date).getTime()-x)/i;if(n<1){n=k(n);u=w+n*t;m(u)}else{clearInterval(v);p()}}var i=typeof this.options.duration===
"number"?this.options.duration:350,k=this.options.easing||this.defaultEasing,m=this.options.onAnimate||function(){},p=this.options.onEnd||function(){},w=this.options.curve[0],t=this.options.curve[1]-w,u,v,x=-1;v=setInterval(j,typeof this.options.rate==="number"?this.options.rate:20)};g.prototype.defaultEasing=function(j){return Math.sin(j*(Math.PI/2))};return g}(),bind:function(g){var j=this,i=Array.prototype.slice.call(arguments,1);if(i.length)return function(){return arguments.length?j.apply(g,
i.concat(Array.prototype.slice.call(arguments))):j.apply(g,i)};return function(){return arguments.length?j.apply(g,arguments):j.call(g)}}};if(!Function.prototype.bind)Function.prototype.bind=e.bind;return{Editor:c,util:e}});
define("orion/textview/annotations",["orion/textview/eventTarget"],function(d){function f(e,g,j,i,k,m,p,w){this.type=g;this.start=j;this.end=i;this._projectionModel=e;this._expandedHTML=this.html=k;this._expandedStyle=this.style=m;this._collapsedHTML=p;this._collapsedStyle=w;this.expanded=true}function a(){}function b(e){this._annotations=[];var g=this;this._listener={onChanged:function(j){g._onChanged(j)}};this.setTextModel(e)}function c(e,g){this._view=e;this._annotationModel=g;var j=this;this._listener=
{onDestroy:function(i){j._onDestroy(i)},onLineStyle:function(i){j._onLineStyle(i)},onChanged:function(i){j._onAnnotationModelChanged(i)}};e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",this._listener.onLineStyle);g.addEventListener("Changed",this._listener.onChanged)}f.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var e=this._projectionModel,g=e.getBaseModel();this._projection=
{start:g.getLineStart(g.getLineAtOffset(this.start)+1),end:g.getLineEnd(g.getLineAtOffset(this.end),true)};e.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(e){var g=a.prototype;for(var j in g)if(g.hasOwnProperty(j))e[j]=g[j]};a.prototype={addAnnotationType:function(e){if(!this._annotationTypes)this._annotationTypes=[];
this._annotationTypes.push(e)},getAnnotationTypePriority:function(e){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===e)return g+1;return 0},getAnnotationsByType:function(e,g,j){e=e.getAnnotations(g,j);for(j=[];e.hasNext();){g=e.next();this.getAnnotationTypePriority(g.type)!==0&&j.push(g)}var i=this;j.sort(function(k,m){return i.getAnnotationTypePriority(k.type)-i.getAnnotationTypePriority(m.type)});return j},isAnnotationTypeVisible:function(e){return this.getAnnotationTypePriority(e)!==
0},removeAnnotationType:function(e){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===e){this._annotationTypes.splice(g,1);break}}};b.prototype={addAnnotation:function(e){if(e){var g=this._annotations,j=this._binarySearch(g,e.start);g.splice(j,0,e);this.onChanged({type:"Changed",added:[e],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(e,g){var j=this._annotations,i,k=0,m=function(){for(;k<j.length;){var p=
j[k++];if(e===p.start||(e>p.start?e<p.end:p.start<g))return p;if(p.start>=g)break}return null};i=m();return{next:function(){var p=i;if(p)i=m();return p},hasNext:function(){return i!==null}}},modifyAnnotation:function(e){if(e)this._getAnnotationIndex(e)<0||this.onChanged({type:"Changed",added:[],removed:[],changed:[e]})},onChanged:function(e){return this.dispatchEvent(e)},removeAnnotations:function(e){var g=this._annotations,j,i;if(e){j=[];for(i=g.length-1;i>=0;i--){var k=g[i];k.type===e&&g.splice(i,
1);j.splice(0,0,k)}}else j=g;this.onChanged({type:"Changed",removed:j,added:[],changed:[]})},removeAnnotation:function(e){if(e){e=this._getAnnotationIndex(e);e<0||this.onChanged({type:"Changed",removed:this._annotations.splice(e,1),added:[],changed:[]})}},replaceAnnotations:function(e,g){var j=this._annotations,i,k,m,p=[];if(e)for(i=e.length-1;i>=0;i--){m=e[i];k=this._getAnnotationIndex(m);if(!(k<0)){j.splice(k,1);p.splice(0,0,m)}}g||(g=[]);for(i=0;i<g.length;i++){m=g[i];k=this._binarySearch(j,m.start);
j.splice(k,0,m)}this.onChanged({type:"Changed",removed:p,added:g,changed:[]})},setTextModel:function(e){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=e)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(e,g){for(var j=e.length,i=-1,k;j-i>1;){k=Math.floor((j+i)/2);if(g<=e[k].start)j=k;else i=k}return j},_getAnnotationIndex:function(e){for(var g=this._annotations,j=this._binarySearch(g,e.start);j<g.length&&g[j].start===
e.start;){if(g[j]===e)return j;j++}return-1},_onChanged:function(e){var g=e.start,j=e.removedCharCount,i=this._annotations,k=g+j;if(0<i.length){var m={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:e};e=e.addedCharCount-j;for(j=0;j<i.length;j++){var p=i[j];if(p.start>=k){p.start+=e;p.end+=e;m.changed.push(p)}else if(!(p.end<=g))if(p.start<g&&k<p.end){p.end+=e;m.changed.push(p)}else{i.splice(j,1);m.removed.push(p);j--}}if(m.added.length>0||m.removed.length>0||m.changed.length>
0)this.onChanged(m)}}};d.EventTarget.addMixin(b.prototype);c.prototype={destroy:function(){var e=this._view;if(e){e.removeEventListener("Destroy",this._listener.onDestroy);e.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}(e=this._annotationModel)&&e.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(e,g){if(g){e||(e={});if(e.styleClass&&g.styleClass&&e.styleClass!==g.styleClass)e.styleClass+=" "+g.styleClass;else e.styleClass=g.styleClass;var j;
if(g.style){if(!e.style)e.style={};for(j in g.style)e.style[j]||(e.style[j]=g.style[j])}if(g.attributes){if(!e.attributes)e.attributes={};for(j in g.attributes)e.attributes[j]||(e.attributes[j]=g.attributes[j])}}return e},_mergeStyleRanges:function(e,g){if(e)for(var j=0;j<e.length;j++){var i=e[j];if(g.end<=i.start)break;if(!(g.start>=i.end)){var k=this._mergeStyle({},i.style);k=this._mergeStyle(k,g.style);if(g.start<=i.start&&g.end>=i.end)e[j]={start:i.start,end:i.end,style:k};else if(g.start>i.start&&
g.end<i.end){e.splice(j,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:g.end,style:k},{start:g.end,end:i.end,style:i.style});j+=2}else if(g.start>i.start){e.splice(j,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:i.end,style:k});j+=1}else if(g.end<i.end){e.splice(j,1,{start:i.start,end:g.end,style:k},{start:g.end,end:i.end,style:i.style});j+=1}}}},_onAnnotationModelChanged:function(e){function g(m){for(var p=0;p<m.length;p++)if(i.isAnnotationTypeVisible(m[p].type)){var w=
m[p].start,t=m[p].end;if(k.getBaseModel){w=k.mapOffset(w,true);t=k.mapOffset(t,true)}w!==-1&&t!==-1&&j.redrawRange(w,t)}}if(!e.textModelChangedEvent){var j=this._view;if(j){var i=this,k=j.getModel();g(e.added);g(e.removed);g(e.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(e){var g=this._annotationModel,j=this._view.getModel(),i=g.getTextModel(),k=e.lineStart,m=e.lineStart+e.lineText.length;if(i!==j){k=j.mapOffset(k);m=j.mapOffset(m)}for(g=g.getAnnotations(k,m);g.hasNext();){k=
g.next();if(this.isAnnotationTypeVisible(k.type)){if(k.rangeStyle){m=k.start;var p=k.end;if(i!==j){m=j.mapOffset(m,true);p=j.mapOffset(p,true)}this._mergeStyleRanges(e.ranges,{start:m,end:p,style:k.rangeStyle})}if(k.lineStyle){e.style=this._mergeStyle({},e.style);e.style=this._mergeStyle(e.style,k.lineStyle)}}}}};a.addMixin(c.prototype);return{FoldingAnnotation:f,AnnotationTypeList:a,AnnotationModel:b,AnnotationStyler:c}});
define("orion/textview/rulers",["i18n!orion/textview/nls/messages","orion/textview/annotations","orion/textview/tooltip"],function(d,f,a){function b(i,k,m,p){this._location=k||"left";this._overview=m||"page";this._rulerStyle=p;this._view=null;var w=this;this._listener={onTextModelChanged:function(t){w._onTextModelChanged(t)},onAnnotationModelChanged:function(t){w._onAnnotationModelChanged(t)}};this.setAnnotationModel(i)}function c(i,k,m,p,w){b.call(this,i,k,"page",m);this._oddStyle=p||{style:{backgroundColor:"white"}};
this._evenStyle=w||{style:{backgroundColor:"white"}};this._numOfDigits=0}function e(i,k,m){b.call(this,i,k,"page",m)}function g(i,k,m){b.call(this,i,k,"document",m)}function j(i,k,m){e.call(this,i,k,m)}b.prototype={getAnnotations:function(i,k){var m=this._annotationModel;if(!m)return[];var p=this._view.getModel(),w=p.getLineStart(i),t=p.getLineEnd(k-1),u=p;if(p.getBaseModel){u=p.getBaseModel();w=p.mapOffset(w);t=p.mapOffset(t)}var v=[];m=this.getAnnotationsByType(m,w,t);for(w=0;w<m.length;w++){t=
m[w];for(var x=u.getLineAtOffset(t.start),n=u.getLineAtOffset(Math.max(t.start,t.end-1)),r=x;r<=n;r++){var y=r;if(p!==u){y=u.getLineStart(r);y=p.mapOffset(y,true);if(y===-1)continue;y=p.getLineAtOffset(y)}if(i<=y&&y<k){var A=this._mergeAnnotation(v[y],t,r-x,n-x+1);if(A)v[y]=A}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var h in v)if(v[h]._multiple)v[h].html+=this._multiAnnotationOverlay.html;return v},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,k){var m=a.Tooltip.getTooltip(this._view);if(m)if(!(m.isVisible()&&this._tooltipLineIndex===i)){this._tooltipLineIndex=i;var p=this;m.setTarget({y:k.clientY,getTooltipInfo:function(){return p._getTooltipInfo(p._tooltipLineIndex,
this.y)}})}},onMouseOver:function(i,k){this.onMouseMove(i,k)},onMouseOut:function(){var i=a.Tooltip.getTooltip(this._view);i&&i.setTarget(null)},_getTooltipInfo:function(i,k){if(i!==undefined){var m=this._view,p=m.getModel(),w=this._annotationModel,t=[];if(w){t=p.getLineStart(i);var u=p.getLineEnd(i);if(p.getBaseModel){t=p.mapOffset(t);u=p.mapOffset(u)}t=this.getAnnotationsByType(w,t,u)}w=this._getTooltipContents(i,t);if(!w)return null;w={contents:w,anchor:this.getLocation()};t=m.getClientArea();
t.y=this.getOverview()==="document"?m.convert({y:k},"view","document").y:m.getLocationAtOffset(p.getLineStart(i)).y;m.convert(t,"document","page");w.x=t.x;w.y=t.y;if(w.anchor==="right")w.x+=t.width;w.maxWidth=t.width;w.maxHeight=t.height-(t.y-m._parent.getBoundingClientRect().top);return w}},_getTooltipContents:function(i,k){return k},_onAnnotationModelChanged:function(i){function k(u){for(var v=0;v<u.length;v++)if(w.isAnnotationTypeVisible(u[v].type)){var x=u[v].start,n=u[v].end;if(p.getBaseModel){x=
p.mapOffset(x,true);n=p.mapOffset(n,true)}x!==-1&&n!==-1&&m.redrawLines(p.getLineAtOffset(x),p.getLineAtOffset(Math.max(x,n-1))+1,w)}}var m=this._view;if(m){var p=m.getModel(),w=this,t=p.getLineCount();if(i.textModelChangedEvent){i=i.textModelChangedEvent.start;if(p.getBaseModel)i=p.mapOffset(i,true);i=p.getLineAtOffset(i);m.redrawLines(i,t,w)}else{k(i.added);k(i.removed);k(i.changed)}}},_mergeAnnotation:function(i,k,m){i||(i={});if(m===0)if(i.html&&k.html){if(k.html!==i.html)if(!i._multiple&&this._multiAnnotation)i.html=
this._multiAnnotation.html;i._multiple=true}else i.html=k.html;i.style=this._mergeStyle(i.style,k.style);return i},_mergeStyle:function(i,k){if(k){i||(i={});if(i.styleClass&&k.styleClass&&i.styleClass!==k.styleClass)i.styleClass+=" "+k.styleClass;else i.styleClass=k.styleClass;var m;if(k.style){if(!i.style)i.style={};for(m in k.style)i.style[m]||(i.style[m]=k.style[m])}if(k.attributes){if(!i.attributes)i.attributes={};for(m in k.attributes)i.attributes[m]||(i.attributes[m]=k.attributes[m])}}return i}};
f.AnnotationTypeList.addMixin(b.prototype);c.prototype=new b;c.prototype.getAnnotations=function(i,k){var m=b.prototype.getAnnotations.call(this,i,k),p=this._view.getModel();for(i=i;i<k;i++){var w=i&1?this._oddStyle:this._evenStyle,t=i;if(p.getBaseModel){t=p.getLineStart(t);t=p.getBaseModel().getLineAtOffset(p.mapOffset(t))}m[i]||(m[i]={});m[i].html=t+1+"";if(!m[i].style)m[i].style=w}return m};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 k=this._view.getModel(),m=((k.getBaseModel?k.getBaseModel().getLineCount():k.getLineCount())+"").length;if(this._numOfDigits!==m){this._numOfDigits=m;this._view.redrawLines(k.getLineAtOffset(i),k.getLineCount(),this)}};e.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,k){if(k.length===0){k=this._view.getModel();i=i;if(k.getBaseModel){i=k.getLineStart(i);i=k.getBaseModel().getLineAtOffset(k.mapOffset(i))}return d.formatMessage(d.line,i+1)}return b.prototype._getTooltipContents.call(this,i,k)};g.prototype._mergeAnnotation=function(i,k,m,p){if(m===0){i=i;if(!i){i={html:"&nbsp;",style:{style:{height:3*p+"px"}}};i.style=this._mergeStyle(i.style,k.overviewStyle)}return i}};j.prototype=new e;j.prototype.onClick=
function(i){if(i!==undefined){var k=this._annotationModel;if(k){var m=this._view.getModel(),p=m.getLineStart(i);i=m.getLineEnd(i,true);if(m.getBaseModel){p=m.mapOffset(p);i=m.mapOffset(i);m=m.getBaseModel()}var w;for(k=k.getAnnotations(p,i);!w&&k.hasNext();){i=k.next();if(this.isAnnotationTypeVisible(i.type))w=i}if(w&&m.getLineAtOffset(w.start)===m.getLineAtOffset(p)){(m=a.Tooltip.getTooltip(this._view))&&m.setTarget(null);w.expanded?w.collapse():w.expand();this._annotationModel.modifyAnnotation(w)}}}};
j.prototype._getTooltipContents=function(i,k){if(k.length===1)if(k[0].expanded)return null;return e.prototype._getTooltipContents.call(this,i,k)};j.prototype._onAnnotationModelChanged=function(i){function k(x){for(t=0;t<x.length;t++)if(w.isAnnotationTypeVisible(x[t].type)){var n=x[t].start;if(p.getBaseModel)n=p.mapOffset(n,true);if(n!==-1)v=Math.min(v,p.getLineAtOffset(n))}}if(i.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,i);else{var m=this._view;if(m){var p=m.getModel(),
w=this,t,u=p.getLineCount(),v=u;k(i.added);k(i.removed);k(i.changed);i=m.getRulers();for(t=0;t<i.length;t++)m.redrawLines(v,u,i[t])}}};return{Ruler:b,AnnotationRuler:e,LineNumberRuler:c,OverviewRuler:g,FoldingRuler:j}});
define("orion/textview/textDND",[],function(){function d(f,a){this._view=f;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)}};f.addEventListener("DragStart",this._listener.onDragStart);f.addEventListener("DragEnd",
this._listener.onDragEnd);f.addEventListener("DragEnter",this._listener.onDragEnter);f.addEventListener("DragOver",this._listener.onDragOver);f.addEventListener("Drop",this._listener.onDrop);f.addEventListener("Destroy",this._listener.onDestroy)}d.prototype={destroy:function(){var f=this._view;if(f){f.removeEventListener("DragStart",this._listener.onDragStart);f.removeEventListener("DragEnd",this._listener.onDragEnd);f.removeEventListener("DragEnter",this._listener.onDragEnter);f.removeEventListener("DragOver",
this._listener.onDragOver);f.removeEventListener("Drop",this._listener.onDrop);f.removeEventListener("Destroy",this._listener.onDestroy);this._view=null}},_onDestroy:function(){this.destroy()},_onDragStart:function(f){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;f.event.dataTransfer.effectAllowed="copyMove";f.event.dataTransfer.setData("Text",a)}},
_onDragEnd:function(f){var a=this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(f=f.event.dataTransfer.dropEffect==="move")&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,c=this._dropOffset;if(f)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(f){this._onDragOver(f)},_onDragOver:function(f){var a=f.event.dataTransfer.types;if(a)if(!(a.contains?a.contains("text/plain"):a.indexOf("text/plain")!==-1))f.event.dataTransfer.dropEffect="none"},_onDrop:function(f){var a=this._view,b=f.event.dataTransfer.getData("Text");if(b){f=a.getOffsetAtLocation(f.x,f.y);if(this._dragSelection){this._dropOffset=f;this._dropText=b}else{a.setText(b,
f,f);a.setSelection(f,f+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,f,a,b,c,e,g){function j(){}function i(){}function k(){}function m(){}function p(){}function w(v,x,n){this.editor=v;this.textView=v.getTextView();this.undoStack=x;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=
false;this._incrementalFindPrefix="";(this._searcher=n)&&this._searcher.getAdaptor().setEditor(this.editor);this._lastEditLocation=null;this.init()}function t(v,x,n,r){this.editor=v;this.textView=v.getTextView();this.undoStack=x;this.contentAssist=n;this.linkedMode=r;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}function u(v){this.editor=v;this.textView=v.getTextView();this.linkedModeActive=false;this.linkedModePositions=
[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(x){for(var n=false,r=0,y=0;y<this.linkedModePositions.length;++y){var A=this.linkedModePositions[y];if(n)A.offset+=r;else if(x.start>=A.offset&&x.end<=A.offset+A.length){n=A.length;A.length=x.start-A.offset+x.text.length+(A.offset+A.length-x.end);r=A.length-n;n=true}}if(n)this.linkedModeEscapePosition+=r;else this.cancel()}.bind(this)}}j.prototype={createUndoStack:function(v){v=v.getTextView();
var x=new f.UndoStack(v,200);v.setKeyBinding(new a.KeyBinding("z",true),"Undo");v.setAction("Undo",function(){x.undo();return true});var n=navigator.platform.indexOf("Mac")!==-1;v.setKeyBinding(n?new a.KeyBinding("z",true,true):new a.KeyBinding("y",true),"Redo");v.setAction("Redo",function(){x.redo();return true});return x}};i.prototype={createLineNumberRuler:function(v){return new b.LineNumberRuler(v,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};
k.prototype={createFoldingRuler:function(v){return new b.FoldingRuler(v,"left",{styleClass:"ruler folding"})}};m.prototype={createAnnotationModel:function(v){return new c.AnnotationModel(v)},createAnnotationStyler:function(v,x){return new c.AnnotationStyler(v,x)},createAnnotationRulers:function(v){var x=new b.AnnotationRuler(v,"left",{styleClass:"ruler annotations"});v=new b.OverviewRuler(v,"right",{styleClass:"ruler overview"});return{annotationRuler:x,overviewRuler:v}}};p.prototype={createTextDND:function(v,
x){return new e.TextDND(v.getTextView(),x)}};w.prototype={init:function(){var v=this;this._incrementalFindListener={onVerify:function(n){var r=v.editor,y=r.getModel(),A=r.mapOffset(n.start),h=r.mapOffset(n.end);A=y.getText(A,h);y=v._incrementalFindPrefix;if((y=y.match(new RegExp("^"+g.escape(A),"i")))&&y.length>0){y=v._incrementalFindPrefix+=n.text;v.editor.reportStatus(d.formatMessage(d.incrementalFind,y));A=y.toLowerCase()===y;h=r.getSelection().start;if(A=r.doFind(y,h,A)){v._incrementalFindSuccess=
true;v._incrementalFindIgnoreSelection=true;r.moveSelection(A.index,A.index+A.length);v._incrementalFindIgnoreSelection=false}else{r.reportStatus(d.formatMessage(d.incrementalFindNotFound,y),"error");v._incrementalFindSuccess=false}n.text=null}},onSelection:function(){v._incrementalFindIgnoreSelection||v.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(n){if(v.editor.isDirty())v._lastEditLocation=n.start+n.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 n=this.editor,r=n.getSelection(),y="";if(r.end>r.start)y=n.getModel().getText(r.start,r.end);this._searcher.buildToolBar(y);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 n=this.editor;if(this._incrementalFindActive){var r=this._incrementalFindPrefix;if(r.length!==0){var y;if(this._searcher)y=this._searcher.findNext(true,
r);else{y=0;if(this._incrementalFindSuccess)y=n.getSelection().start+1;var A=r.toLowerCase()===r;y=n.doFind(r,y,A)}if(y){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;n.moveSelection(y.index,y.index+y.length);this._incrementalFindIgnoreSelection=false;n.reportStatus(d.formatMessage(d.incrementalFind,r))}else{n.reportStatus(d.formatMessage(d.incrementalFindNotFound,r),"error");this._incrementalFindSuccess=false}}}else{n.setCaretOffset(n.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));
this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var n=this.editor,r=this._incrementalFindPrefix;r=this._incrementalFindPrefix=r.substring(0,r.length-1);if(r.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;n.setCaretOffset(n.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}n.reportStatus(d.formatMessage(d.incrementalFind,r));var y=n.getCaretOffset();y=n.getModel().getText().lastIndexOf(r,
y-r.length-1);if(y!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;n.moveSelection(y,y+r.length);this._incrementalFindIgnoreSelection=false}else n.reportStatus(d.formatMessage(d.incrementalFindNotFound,r),"error");return true}return false}.bind(this));this.textView.setAction("tab",function(){var n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start),h=r.getLineAtOffset(y.end>y.start?y.end-1:y.end);if(A!==h){var l=[];l.push("");for(var o=A;o<=h;o++)l.push(r.getLine(o,
true));o=r.getLineStart(A);r=r.getLineEnd(h,true);var q=this.textView.getOptions("tabSize","expandTab");q=q.expandTab?(new Array(q.tabSize+1)).join(" "):"\t";n.setText(l.join(q),o,r);n.setSelection(o===y.start?y.start:y.start+q.length,y.end+(h-A+1)*q.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 n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start),
h=r.getLineAtOffset(y.end>y.start?y.end-1:y.end),l=this.textView.getOptions("tabSize"),o=(new Array(l+1)).join(" "),q=[],s=0,z=0,C=A;C<=h;C++){var B=r.getLine(C,true);if(r.getLineStart(C)!==r.getLineEnd(C))if(B.indexOf("\t")===0){B=B.substring(1);s++}else if(B.indexOf(o)===0){B=B.substring(l);s+=l}else return true;if(C===A)z=s;q.push(B)}A=r.getLineStart(A);l=r.getLineEnd(h,true);r=r.getLineStart(h);n.setText(q.join(""),A,l);n.setSelection(A===y.start?y.start:y.start-z,y.end-s+(y.end===r+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 n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start);if(A===0)return true;var h=r.getLineAtOffset(y.end>y.start?y.end-1:y.end),l=r.getLineCount();y=r.getLineStart(A-1);var o=r.getLineStart(A),q=r.getLineEnd(h,true),s=r.getText(o,q),z=0;if(h===l-1){h=r.getLineEnd(A-1);A=r.getLineEnd(A-1,true);s+=r.getText(h,A);o=h;z=A-h}this.startUndo();n.setText("",
o,q);n.setText(s,y,y);n.setSelection(y,y+s.length-z);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 n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start),h=r.getLineAtOffset(y.end>y.start?y.end-1:y.end),l=r.getLineCount();if(h===l-1)return true;A=r.getLineStart(A);y=r.getLineEnd(h,true);var o=r.getLineEnd(h+1,true)-(y-A),q=0;if(h!==l-2)r=r.getText(A,
y);else{h=r.getLineEnd(h);r=r.getText(h,y)+r.getText(A,h);q+=y-h}this.startUndo();n.setText("",A,y);n.setText(r,o,o);n.setSelection(o+q,o+q+r.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 n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start);y=r.getLineAtOffset(y.end>y.start?y.end-1:y.end);A=r.getLineStart(A);var h=r.getLineEnd(y,true),l=r.getLineCount(),
o="";h=r.getText(A,h);if(y===l-1)h+=o=r.getLineDelimiter();n.setText(h,A,A);n.setSelection(A,A+h.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 n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start);y=r.getLineAtOffset(y.end>y.start?y.end-1:y.end);var h=r.getLineStart(A);A=r.getLineEnd(y,true);var l=r.getLineCount(),o="";h=r.getText(h,A);if(y===
l-1)h=(o=r.getLineDelimiter())+h;n.setText(h,A,A);n.setSelection(A+o.length,A+h.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("d",true,false,false),d.deleteLines);this.textView.setAction(d.deleteLines,function(){var n=this.editor,r=n.getSelection(),y=n.getModel(),A=y.getLineAtOffset(r.start);r=y.getLineAtOffset(r.end>r.start?r.end-1:r.end);A=y.getLineStart(A);y=y.getLineEnd(r,true);n.setText("",A,y);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("l",
true),d.gotoLine);this.textView.setAction(d.gotoLine,function(){var n=this.editor,r=n.getModel().getLineAtOffset(n.getCaretOffset());if(r=prompt(d.gotoLinePrompty,r+1)){r=parseInt(r,10);n.onGotoLine(r-1,0)}return true}.bind(this));var x=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding("q",!x,false,false,x),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 v=this._incrementalFindPrefix;
if(v.length===0)return false;var x=this.editor,n=x.getModel(),r;r=this._incrementalFindSuccess?x.getCaretOffset()-v.length-1:n.getCharCount()-1;n=n.getText().lastIndexOf(v,r);if(n!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;x.moveSelection(n,n+v.length);this._incrementalFindIgnoreSelection=false;x.reportStatus(d.formatMessage(d.incrementalFind,v))}else{x.reportStatus(d.formatMessage(d.incrementalFindNotFound,v),"error");this._incrementalFindSuccess=false}return true}return false},
lineDown:function(){if(this._incrementalFindActive){var v=this._incrementalFindPrefix;if(v.length===0)return false;var x=this.editor,n=x.getModel(),r=0;if(this._incrementalFindSuccess)r=x.getSelection().start+1;n=n.getText().indexOf(v,r);if(n!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;x.moveSelection(n,n+v.length);this._incrementalFindIgnoreSelection=false;x.reportStatus(d.formatMessage(d.incrementalFind,v))}else{x.reportStatus(d.formatMessage(d.incrementalFindNotFound,
v),"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 v(n,r,y){var A=n.getLineAtOffset(r),h=n.getLineAtOffset(y),l,o,q,s,z,C;for(l=A;l>=0;l--){o=n.getLine(l);q=l===A?r-n.getLineStart(A):o.length;s=o.lastIndexOf("/*",q);o=o.lastIndexOf("*/",q);if(o>s)break;else if(s!==
-1){z=n.getLineStart(l)+s;break}}for(l=h;l<n.getLineCount();l++){o=n.getLine(l);q=l===h?y-n.getLineStart(h):0;s=o.indexOf("/*",q);o=o.indexOf("*/",q);if(s!==-1&&s<o)break;else if(o!==-1){C=n.getLineStart(l)+o;break}}return{commentStart:z,commentEnd:C}}this.textView.setKeyBinding(new a.KeyBinding(191,true),d.toggleLineComment);this.textView.setAction(d.toggleLineComment,function(){for(var n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getLineAtOffset(y.start),h=r.getLineAtOffset(y.end>y.start?
y.end-1:y.end),l=true,o=[],q,s,z=A;z<=h;z++){q=r.getLine(z,true);o.push(q);if(!l||(s=q.indexOf("//"))===-1)l=false;else if(s!==0){var C;for(C=0;C<s;C++){l=q.charCodeAt(C);if(!(l===32||l===9))break}l=C===s}}z=r.getLineStart(A);C=r.getLineEnd(h,true);if(l){for(l=0;l<o.length;l++){q=o[l];s=q.indexOf("//");o[l]=q.substring(0,s)+q.substring(s+2)}o=o.join("");q=r.getLineStart(h);r=z===y.start?y.start:y.start-2;y=y.end-2*(h-A+1)+(y.end===q+1?2:0)}else{o.splice(0,0,"");o=o.join("//");r=z===y.start?y.start:
y.start+2;y=y.end+2*(h-A+1)}n.setText(o,z,C);n.setSelection(r,y);return true}.bind(this));var x=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding(191,true,!x,false,x),d.addBlockComment);this.textView.setAction(d.addBlockComment,function(){var n=this.editor,r=n.getModel(),y=n.getSelection(),A=new RegExp("/\\*|\\*/","g"),h=v(r,y.start,y.end);if(h.commentStart!==undefined&&h.commentEnd!==undefined)return true;r=r.getText(y.start,y.end);if(r.length===0)return true;h=
r.length;r=r.replace(A,"");A=r.length;n.setText("/*"+r+"*/",y.start,y.end);n.setSelection(y.start+2,y.end+2+(A-h));return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(220,true,!x,false,x),d.removeBlockComment);this.textView.setAction(d.removeBlockComment,function(){var n=this.editor,r=n.getModel(),y=n.getSelection(),A=r.getText(y.start,y.end),h,l,o;for(o=0;o<A.length;o++)if(A.substring(o,o+2)==="/*"){h=y.start+o;break}for(;o<A.length;o++)if(A.substring(o,o+2)==="*/"){l=y.start+o;
break}if(h!==undefined&&l!==undefined){n.setText(r.getText(h+2,l),h,l+2);n.setSelection(h,l)}else{A=v(r,y.start,y.end);if(A.commentStart===undefined||A.commentEnd===undefined)return true;r=r.getText(A.commentStart+2,A.commentEnd);n.setText(r,A.commentStart,A.commentEnd+2);n.setSelection(y.start-2,y.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(v){var x=v.data.proposal,n;if(typeof x==="string")n=x;else if(typeof x.proposal==="string")n=x.proposal;this.textView.setText(n,v.data.start,
v.data.end);if(x.positions&&this.linkedMode){v=[];for(n=0;n<x.positions.length;++n)v[n]={positions:[{offset:x.positions[n].offset,length:x.positions[n].length}]};this.linkedMode.enterLinkedMode({groups:v,escapePosition:x.escapePosition})}else x.escapePosition&&this.textView.setCaretOffset(x.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 v=
this.editor,x=v.getSelection();if(x.start===x.end){var n=v.getModel(),r=n.getLineAtOffset(x.start),y=n.getLine(r,true),A=n.getLineStart(r);r=0;A=x.start-A;for(var h;r<A&&((h=y.charCodeAt(r))===32||h===9);)r++;if(r>0){var l=y.substring(0,r);for(r=A;r<y.length&&((h=y.charCodeAt(r++))===32||h===9);)x.end++;v.setText(n.getLineDelimiter()+l,x.start,x.end);return true}}return false}};u.prototype={enterLinkedMode:function(v){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=
[];for(var x=0;x<v.groups.length;++x){var n=v.groups[x];this.linkedModePositions[x]={offset:n.positions[0].offset,length:n.positions[0].length}}this.linkedModeEscapePosition=v.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(v){this.textView.setSelection(v.offset,v.offset+v.length)}};return{UndoFactory:j,LineNumberRulerFactory:i,FoldingRulerFactory:k,AnnotationFactory:m,TextDNDFactory:p,TextActions:w,SourceCodeActions:t,LinkedMode:u}});
define("orion/breadcrumbs",["require","dojo","orion/util"],function(d,f,a){function b(c){this._init(c)}b.prototype={_init:function(c){var e=c.container;if(typeof e==="string")e=f.byId(e);if(!e)throw"no parent container";this._container=e;f.removeClass(e,"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");f.place(document.createTextNode(this._firstSegmentName),c,"only");return c}return null},render:function(){var c=this._container,e=f.byId(this._id);if(e)f.empty(e);else{e=document.createElement("span");e.id=this._id;c.appendChild(e)}var g;if(g=this.getNavigatorRootSegment()){f.addClass(g,"breadcrumb");e.appendChild(g);
if(this._resource&&this._resource.Parents){g=document.createElement("span");f.place(document.createTextNode(" >> "),g,"only");this.path+="/";f.addClass(g,"breadcrumb");e.appendChild(g)}else{g.href="";f.removeClass(g,"breadcrumb");f.addClass(g,"currentLocation");a.forceLayout(c);return}}if(this._resource){if(this._resource.Parents)for(var j=this._resource.Parents,i=j.length;--i>=0;){g=document.createElement("a");f.addClass(g,"breadcrumb");f.place(document.createTextNode(j[i].Name),g,"only");this.path+=
j[i].Name;if(this._makeHref)this._makeHref(g,j[i].ChildrenLocation);else g.href=d.toUrl("navigate/table.html")+"#"+j[i].ChildrenLocation;e.appendChild(g);g=document.createElement("span");f.place(document.createTextNode(" >> "),g,"only");this.path+="/";f.addClass(g,"breadcrumb");e.appendChild(g)}g=document.createElement("span");f.place("<br>"+this._resource.Name,g,"only");f.addClass(g,"currentLocation");this.path+=this._resource.Name;e.appendChild(g)}if(e.childNodes.length===0){g=document.createElement("a");
f.place(document.createTextNode(document.title),g,"only");f.addClass(g,"breadcrumb");f.addClass(g,"currentLocation");e.appendChild(g)}a.forceLayout(c)}};b.prototype.constructor=b;return{BreadCrumbs:b}});
define("orion/compare/gap-model",["orion/textview/eventTarget"],function(d){var f=f||{};f.GapTextModel=function(){function a(b,c,e){this._model=b;this._myIndex=(this._isOriginal=c===undefined?true:c)?1:0;this._reverseIndex=1-this._myIndex;this._map=e;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};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 e=this._map[c][this._reverseIndex]-this._map[c][this._myIndex];this._gapNumber+=e;this._gapBlocks.push([b+this._map[c][this._myIndex],e])}b+=Math.max(this._map[c][this._reverseIndex],this._map[c][this._myIndex])}},lookUpRealIndex:function(b){for(var c=0,e=0;e<this._gapBlocks.length;e++){var g=
this._gapBlocks[e][0],j=this._gapBlocks[e][0]+this._gapBlocks[e][1]-1;if(b<g)break;if(b>=g&&b<=j)return{lineIndex:-1,gapsBefore:c+b-g};c+=this._gapBlocks[e][1]}return{lineIndex:b-c,gapsBefore:c}},getLineType:function(b){for(var c=0,e=0;e<this._map.length;e++){var g=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex]);if(b>=c&&b<c+g){if(this._map[e][2]===0)return"unchnaged";else if(this._map[e][2]<0)return"removed";else if(this._map[e][1]===0)return"added";else if(b<this._map[e][this._myIndex]+
c)return"changed";return"changed_gap"}c+=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex])}return"unchnaged"},getCharCount:function(){var b=this._model.getCharCount();b+=this._gapNumber*this.getLineDelimiter().length;return b},getLine:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))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(),e=0,g=0;e<c;){var j=this.lookUpRealIndex(e);g+=j.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(j.lineIndex,true).length;e++;if(g>b)break}return e-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;var g=this.lookUpRealIndex(b);e=g.gapsBefore*this.getLineDelimiter().length;
if(g.lineIndex<0){b=b-g.gapsBefore;if(b>0)e+=this._model.getLineEnd(b-1,true);if(c)e+=this.getLineDelimiter().length}else e+=this._model.getLineEnd(g.lineIndex,c);return e},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;var c=this.lookUpRealIndex(b),e=0,g=-1;if(c.lineIndex<0){e=c.gapsBefore;if(b-e>=0)g=b-e-1}else{e=c.gapsBefore;g=c.lineIndex}b=0;b+=this.getLineDelimiter().length*e;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,e){this._model.setText(b,c,e)}};d.EventTarget.addMixin(a.prototype);return a}();return f});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(d,f){function a(e,g,j){var i=new d.Deferred;e[g].apply(e,j).then(function(k){i.callback(k)},function(k){k.status===401||k.status===403?f.handleAuthenticationError(k,function(){e[g].apply(e,j).then(function(m){i.callback(m)},function(m){i.errback(m)})}):i.errback(k)});return i}function b(e){if(e.indexOf("://")===-1){var g=document.createElement("a");g.href=e;return g.href}return e}function c(e,g){var j=e.getServiceReferences("orion.core.diff"),
i=j;if(g){i=[];for(var k=0;k<j.length;++k)g(j[k])&&i.push(j[k])}var m=[],p=[];for(k=0;k<i.length;++k){m[k]=new RegExp(i[k].getProperty("pattern")||".*");p[k]=e.getService(i[k])}this._getService=function(w){w=b(w);for(var t=0;t<m.length;++t)if(m[t].test(w))return p[t];throw"No Matching DiffService for location:"+w;}}c.prototype={getDiffContent:function(e){return a(this._getService(e),"getDiffContent",arguments)},getDiffFileURI:function(e){return a(this._getService(e),"getDiffFileURI",arguments)}};
return{DiffProvider:c}});
var JsDiff=function(){function d(i){return{newPos:i.newPos,components:i.components.slice(0)}}function f(i){for(var k=[],m=0;m<i.length;m++)i[m]&&k.push(i[m]);return k}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,k){if(k==i)return[{value:k}];if(!k)return[{value:i,removed:true}];if(!i)return[{value:k,added:true}];k=this.tokenize(k);i=this.tokenize(i);
var m=k.length,p=i.length,w=m+p,t=[{newPos:-1,components:[]}],u=this.extractCommon(t[0],k,i,0);if(t[0].newPos+1>=m&&u+1>=p)return t[0].components;for(var v=1;v<=w;v++)for(var x=-1*v;x<=v;x+=2){var n;n=t[x-1];var r=t[x+1];u=(r?r.newPos:0)-x;if(n)t[x-1]=undefined;var y=n&&n.newPos+1<m,A=r&&0<=u&&u<p;if(!y&&!A)t[x]=undefined;else{if(!y||A&&n.newPos<r.newPos){n=d(r);this.pushComponent(n.components,i[u],undefined,true)}else{n=d(n);n.newPos++;this.pushComponent(n.components,k[n.newPos],true,undefined)}u=
this.extractCommon(n,k,i,x);if(n.newPos+1>=m&&u+1>=p)return n.components;else t[x]=n}}},pushComponent:function(i,k,m,p){var w=i[i.length-1];if(w&&w.added===m&&w.removed===p)i[i.length-1]={value:this.join(w.value,k),added:m,removed:p};else i.push({value:k,added:m,removed:p})},extractCommon:function(i,k,m,p){var w=k.length,t=m.length,u=i.newPos;for(p=u-p;u+1<w&&p+1<t&&this.equals(k[u+1],m[p+1]);){u++;p++;this.pushComponent(i.components,k[u],undefined,undefined)}i.newPos=u;return p},equals:function(i,
k){var m=/\S/;return this.ignoreWhitespace&&!m.test(i)&&!m.test(k)?true:i==k},join:function(i,k){return i+k},tokenize:function(i){return i}};var c=new b,e=new b(true);e.tokenize=function(i){return f(i.split(/(\s+|\b)/))};var g=new b(true);g.tokenize=function(i){return f(i.split(/([{}:;,]|\s+)/))};var j=new b;j.tokenize=function(i){return i.split(/^/m)};return{diffChars:function(i,k){return c.diff(i,k)},diffWords:function(i,k){return e.diff(i,k)},diffLines:function(i,k){return j.diff(i,k)},diffCss:function(i,
k){return g.diff(i,k)},createPatch:function(i,k,m,p,w){var t=[];t.push("Index: "+i);t.push("===================================================================");t.push("--- "+i+"\t"+p);t.push("+++ "+i+"\t"+w);i=j.diff(k,m);i.push({value:"",lines:[]});m=k=0;p=[];for(var u=w=1,v=0;v<i.length;v++){var x=i[v],n=x.lines||x.value.replace(/\n$/,"").split("\n");x.lines=n;if(x.added||x.removed){if(!k){var r=i[v-1];k=w;m=u;if(r){p.push.apply(p,r.lines.slice(-4).map(function(y){return" "+y}));k-=4;m-=4}}p.push.apply(p,
n.map(function(y){return(x.added?"+":"-")+y}));if(x.added)u+=n.length;else w+=n.length}else{if(k)if(n.length<=8&&v<i.length-1)p.push.apply(p,n.map(function(y){return" "+y}));else{r=Math.min(n.length,4);t.push("@@ -"+k+","+(w-k+r)+" +"+m+","+(u-m+r)+" @@");t.push.apply(t,p);t.push.apply(t,n.slice(0,r).map(function(y){return" "+y}));m=k=0;p=[]}w+=n.length;u+=n.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 k=
[],m=0;m<i.length;m++){var p=i[m];if(p.added)k.push("<ins>");else p.removed&&k.push("<del>");k.push(a(p.value));if(p.added)k.push("</ins>");else p.removed&&k.push("</del>")}return k.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 f=f||{};f.JSDiffAdapter=function(){function a(){}a.prototype={adapt:function(b,c){var e=b.split("\n"),g=c.split("\n"),j=e[e.length-1]==="";g=g[g.length-1]==="";var i=d.diffLines(b,c);b=[];c=[];linesRemoved=linesAdded=0;changeIndex=-1;for(var k=0,m=true,p=0;p<i.length;p++){var w=i[p];lines=w.lines||w.value.split("\n");var t=lines.length,u=0;lines.length>1&&lines[lines.length-1]===""&&t--;if(t>1&&!m)if(lines[0]===""){t--;u++}w.lines=
lines;if(!w.added&&!w.removed){if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);linesRemoved=linesAdded=0;changeIndex=-1;k+=linesRemoved}b.push([t,t,0]);k+=t}else if(w.added){if(changeIndex===-1)changeIndex=c.length+1;linesAdded+=t;for(m=u;m<t+u;m++)c.push(w.lines[m])}else linesRemoved+=t;m=false;if(lines.length>1&&lines[lines.length-1]==="")m=true}if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);k+=linesRemoved}if(k<e.length&&e.length>1){e=b[b.length-
1];if(e[2]===0){e[0]+=1;e[1]+=1}else if(e[2]===-1)b.push([1,1,0]);else if(j===g)b.push([1,1,0]);else{if(g)e[0]+=1;if(j)e[1]+=1}}return{mapper:b,changContents:{array:c,index:0}}}};return a}();return f});
define("examples/textview/textStyler",["i18n!orion/textview/nls/messages","orion/textview/annotations"],function(d,f){function a(h,l){this.keywords=h;this.whitespacesVisible=l;this.setText("")}function b(){a.call(this,null,true)}function c(h){a.call(this,null,h)}function e(){a.call(this,null,false)}function g(h,l,o){this.commentStart="/*";this.commentEnd="*/";var q=[];switch(l){case "java":q=i;break;case "js":q=j;break;case "css":q=k;break}this.whitespacesVisible=false;this.detectHyperlinks=true;
this.highlightCaretLine=false;this.detectTasks=this.foldingEnabled=true;this._scanner=new a(q,this.whitespacesVisible);this._firstScanner=new e;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new b;if(l==="css"){this._scanner.isCSS=true;this._firstScanner.isCSS=true}this.view=h;this.annotationModel=o;this._bracketAnnotations=undefined;var s=this;this._listener={onChanged:function(z){s._onModelChanged(z)},onDestroy:function(z){s._onDestroy(z)},onLineStyle:function(z){s._onLineStyle(z)},
onSelection:function(z){s._onSelection(z)}};l=h.getModel();l.getBaseModel?l.getBaseModel().addEventListener("Changed",this._listener.onChanged):h.addEventListener("ModelChanged",this._listener.onChanged);h.addEventListener("Selection",this._listener.onSelection);h.addEventListener("Destroy",this._listener.onDestroy);h.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();h.redrawLines()}var j=["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"],k=["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"],m={styleClass:"token_singleline_comment"},
p={styleClass:"token_multiline_comment"},w={styleClass:"token_doc_comment"},t={styleClass:"token_doc_html_markup"},u={styleClass:"token_task_tag"},v={styleClass:"token_doc_tag"},x={styleClass:"token_string"},n={styleClass:"token_keyword"},r={styleClass:"token_space"},y={styleClass:"token_tab"},A={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(h){var l=this.keywords;switch(h){case 32:case 9:if(this.whitespacesVisible)return h===32?9:8;do h=this._read();while(h===32||h===9);this._unread(h);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return h;default:var o=this.isCSS;if(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57||45===h&&o){var q=this.offset-1;do h=this._read();while(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57||45===
h&&o);this._unread(h);if(l.length>0){h=this.text.substring(q,this.offset);for(o=0;o<l.length;o++)if(this.keywords[o]===h)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(h){h!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;case 47:h=this._read();if(!this.isCSS)if(h===47)for(;;){h=this._read();if(h===-1||h===10||h===13){this._unread(h);
return 4}}if(h===42){h=this._read();var l=5;if(h===42)l=6;for(;;){for(;h===42;){h=this._read();if(h===47)return l}if(h===-1){this._unread(h);return l}h=this._read()}}this._unread(h);return 1;case 39:for(;;){h=this._read();switch(h){case 39:return 3;case 13:case 10:case -1:this._unread(h);return 3;case 92:this._read();break}}break;case 34:for(;;){h=this._read();switch(h){case 34:return 3;case 13:case 10:case -1:this._unread(h);return 3;case 92:this._read();break}}break;default:return this._default(h)}}},
setText:function(h){this.text=h;this.startOffset=this.offset=0}};b.prototype=new a(null);b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;case 32:return 9;case 9:return 8;default:do h=this._read();while(!(h===32||h===9||h===-1));this._unread(h);return 1}}};c.prototype=new a(null);c.prototype.setType=function(h){this._type=h};c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;
case 32:case 9:if(this.whitespacesVisible)return h===32?9:8;do h=this._read();while(h===32||h===9);this._unread(h);return 7;case 60:if(this._type===6){do h=this._read();while(!(h===62||h===-1));if(h===62)return 10}return 1;case 64:if(this._type===6){do h=this._read();while(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57);this._unread(h);return 11}return 1;case 84:if((h=this._read())===79)if((h=this._read())===68)if((h=this._read())===79){h=this._read();if(!(97<=h&&h<=122||65<=h&&h<=90||h===95||
48<=h&&h<=57)){this._unread(h);return 12}}this._unread(h);default:do h=this._read();while(!(h===32||h===9||h===-1||h===60||h===64||h===84));this._unread(h);return 1}}};e.prototype=new a(null);e.prototype._default=function(h){for(;;){h=this._read();switch(h){case 47:case 34:case 39:case -1:this._unread(h);return 1}}};g.prototype={getClassNameForToken:function(h){switch(h){case "singleLineComment":return m.styleClass;case "multiLineComment":return p.styleClass;case "docComment":return w.styleClass;
case "docHtmlComment":return t.styleClass;case "tasktag":return u.styleClass;case "doctag":return v.styleClass;case "string":return x.styleClass;case "keyword":return n.styleClass;case "space":return r.styleClass;case "tab":return y.styleClass;case "caretLine":return A.styleClass}return null},destroy:function(){var h=this.view;if(h){var l=h.getModel();l.getBaseModel?l.getBaseModel().removeEventListener("Changed",this._listener.onChanged):h.removeEventListener("ModelChanged",this._listener.onChanged);
h.removeEventListener("Selection",this._listener.onSelection);h.removeEventListener("Destroy",this._listener.onDestroy);h.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(h){this.highlightCaretLine=h},setWhitespacesVisible:function(h){this.whitespacesVisible=h;this._scanner.whitespacesVisible=h;this._commentScanner.whitespacesVisible=h},setDetectHyperlinks:function(h){this.detectHyperlinks=h},setFoldingEnabled:function(h){this.foldingEnabled=
h},setDetectTasks:function(h){this.detectTasks=h},_binarySearch:function(h,l,o,q,s){var z;if(q===undefined)q=-1;if(s===undefined)s=h.length;for(;s-q>1;){z=Math.floor((s+q)/2);if(l<=h[z].start)s=z;else if(o&&l<h[z].end){s=z;break}else q=z}return s},_computeComments:function(){var h=this.view.getModel();if(h.getBaseModel)h=h.getBaseModel();this.comments=this._findComments(h.getText())},_computeFolding:function(){if(this.foldingEnabled){var h=this.view.getModel();if(h.getBaseModel){var l=this.annotationModel;
if(l){l.removeAnnotations("orion.annotation.folding");for(var o=[],q=h.getBaseModel(),s=this.comments,z=0;z<s.length;z++){var C=s[z];(C=this._createFoldingAnnotation(h,q,C.start,C.end))&&o.push(C)}l.replaceAnnotations(null,o)}}}},_createFoldingAnnotation:function(h,l,o,q){var s=l.getLineAtOffset(o);l=l.getLineAtOffset(q);if(s===l)return null;return new f.FoldingAnnotation(h,"orion.annotation.folding",o,q,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",
{styleClass:"annotation collapsed"})},_computeTasks:function(h,l,o){if(this.detectTasks){var q=this.annotationModel;if(q){var s=this.view.getModel(),z=s;if(s.getBaseModel)z=s.getBaseModel();var C=q.getAnnotations(l,o);for(s=[];C.hasNext();){var B=C.next();B.type==="orion.annotation.task"&&s.push(B)}C=[];B=this._commentScanner;B.setText(z.getText(l,o));for(var E;E=B.nextToken();){var G=B.getStartOffset()+l;if(E===12){E=z.getLineEnd(z.getLineAtOffset(G));if(h!==4)E=Math.min(E,o-this.commentEnd.length);
C.push({start:G,end:E,type:"orion.annotation.task",title:z.getText(G,E),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"},rangeStyle:{styleClass:"annotationRange task"}})}}q.replaceAnnotations(s,C)}}},_getLineStyle:function(h){if(this.highlightCaretLine){var l=this.view,o=l.getModel();l=l.getSelection();if(l.start===l.end&&o.getLineAtOffset(l.start)===h)return A}return null},_getStyles:function(h,l,o){if(h.getBaseModel)o=
h.mapOffset(o);for(var q=o+l.length,s=[],z=o,C=this.comments,B=this._binarySearch(C,o,true);B<C.length;B++){if(C[B].start>=q)break;var E=C[B].start,G=C[B].end;z<E&&this._parse(l.substring(z-o,E-o),z,s);var M=C[B].type===6?w:p;if(this.whitespacesVisible||this.detectHyperlinks){z=Math.max(z,E);E=Math.min(q,G);this._parseComment(l.substring(z-o,E-o),z,s,M,C[B].type)}else s.push({start:E,end:G,style:M});z=G}z<q&&this._parse(l.substring(z-o,q-o),z,s);if(h.getBaseModel)for(l=0;l<s.length;l++){o=s[l].end-
s[l].start;s[l].start=h.mapOffset(s[l].start,true);s[l].end=s[l].start+o}return s},_parse:function(h,l,o){var q=this._scanner;for(q.setText(h);h=q.nextToken();){var s=q.getStartOffset()+l,z=null;switch(h){case 2:z=n;break;case 3:if(this.whitespacesVisible){this._parseString(q.getData(),s,o,x);continue}else z=x;break;case 6:this._parseComment(q.getData(),s,o,w,h);continue;case 4:this._parseComment(q.getData(),s,o,m,h);continue;case 5:this._parseComment(q.getData(),s,o,p,h);continue;case 8:if(this.whitespacesVisible)z=
y;break;case 9:if(this.whitespacesVisible)z=r;break}o.push({start:s,end:q.getOffset()+l,style:z})}},_parseComment:function(h,l,o,q,s){var z=this._commentScanner;z.setText(h);for(z.setType(s);h=z.nextToken();){s=z.getStartOffset()+l;var C=q;switch(h){case 8:if(this.whitespacesVisible)C=y;break;case 9:if(this.whitespacesVisible)C=r;break;case 10:C=t;break;case 11:C=v;break;case 12:C=u;break;default:if(this.detectHyperlinks)C=this._detectHyperlinks(z.getData(),s,o,C)}C&&o.push({start:s,end:z.getOffset()+
l,style:C})}},_parseString:function(h,l,o,q){var s=this._whitespaceScanner;for(s.setText(h);h=s.nextToken();){var z=s.getStartOffset()+l,C=q;switch(h){case 8:if(this.whitespacesVisible)C=y;break;case 9:if(this.whitespacesVisible)C=r;break}C&&o.push({start:z,end:s.getOffset()+l,style:C})}},_detectHyperlinks:function(h,l,o,q){var s=null,z;if((z=h.indexOf("://"))>0){s=h;for(var C=z;C>0;){z=s.charCodeAt(C-1);if(!(97<=z&&z<=122||65<=z&&z<=90||45===z||48<=z&&z<=57))break;C--}if(C>0){z="\"\"''(){}[]<>".indexOf(s.substring(C-
1,C));if(z!==-1&&(z&1)===0&&(z=s.lastIndexOf("\"\"''(){}[]<>".substring(z+1,z+2)))!==-1){var B=z;z=this._clone(q);z.tagName="A";z.attributes={href:s.substring(C,B)};o.push({start:l,end:l+C,style:q});o.push({start:l+C,end:l+B,style:z});o.push({start:l+B,end:l+h.length,style:q});return null}}}else if(h.toLowerCase().indexOf("bug#")===0)s="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(h.substring(4),10);if(s){z=this._clone(q);z.tagName="A";z.attributes={href:s};return z}return q},_clone:function(h){if(!h)return h;
var l={};for(var o in h)if(h.hasOwnProperty(o))l[o]=h[o];return l},_findComments:function(h,l){l=l||0;var o=this._firstScanner;o.setText(h);for(var q=[];h=o.nextToken();){if(h===5||h===6){var s={start:o.getStartOffset()+l,end:o.getOffset()+l,type:h};q.push(s);this._computeTasks(h,o.getStartOffset()+l,o.getOffset()+l)}h===4&&this._computeTasks(h,o.getStartOffset()+l,o.getOffset()+l)}return q},_findMatchingBracket:function(h,l){var o="{}()[]<>",q=h.getText(l,l+1),s=o.indexOf(q,0);if(s===-1)return-1;
var z;z=s&1?o.substring(s-1,s):o.substring(s+1,s+2);var C=h.getLineAtOffset(l);o=h.getLine(C);var B=h.getLineStart(C),E=h.getLineEnd(C);o=this._findBrackets(q,z,o,B,B,E);for(E=0;E<o.length;E++){B=o[E]>=0?1:-1;if(o[E]*B===l){l=1;if(s&1){for(E--;E>=0;E--){B=o[E]>=0?1:-1;l+=B;if(l===0)return o[E]*B}for(C-=1;C>=0;){o=h.getLine(C);B=h.getLineStart(C);E=h.getLineEnd(C);o=this._findBrackets(q,z,o,B,B,E);for(s=o.length-1;s>=0;s--){B=o[s]>=0?1:-1;l+=B;if(l===0)return o[s]*B}C--}}else{for(E++;E<o.length;E++){B=
o[E]>=0?1:-1;l+=B;if(l===0)return o[E]*B}C+=1;for(s=h.getLineCount();C<s;){o=h.getLine(C);B=h.getLineStart(C);E=h.getLineEnd(C);o=this._findBrackets(q,z,o,B,B,E);for(E=0;E<o.length;E++){B=o[E]>=0?1:-1;l+=B;if(l===0)return o[E]*B}C++}}break}}return-1},_findBrackets:function(h,l,o,q,s,z){var C=[];h=h.charCodeAt(0);l=l.charCodeAt(0);for(var B=s,E=this._scanner,G,M=this.comments,H=this._binarySearch(M,s,true);H<M.length;H++){if(M[H].start>=z)break;G=M[H].start;var N=M[H].end;if(B<G)for(E.setText(o.substring(B-
s,G-s));G=E.nextToken();)if(G===h)C.push(E.getStartOffset()+B-s+q);else G===l&&C.push(-(E.getStartOffset()+B-s+q));B=N}if(B<z)for(E.setText(o.substring(B-s,z-s));G=E.nextToken();)if(G===h)C.push(E.getStartOffset()+B-s+q);else G===l&&C.push(-(E.getStartOffset()+B-s+q));return C},_onDestroy:function(){this.destroy()},_onLineStyle:function(h){if(h.textView===this.view)h.style=this._getLineStyle(h.lineIndex);h.ranges=this._getStyles(h.textView.getModel(),h.lineText,h.lineStart)},_onSelection:function(h){var l=
h.oldValue,o=h.newValue,q=this.view;h=q.getModel();var s;if(this.highlightCaretLine){var z=h.getLineAtOffset(l.start);s=h.getLineAtOffset(o.start);var C=o.start===o.end;l=l.start===l.end;if(!(z===s&&l&&C)){l&&q.redrawLines(z,z+1);if((z!==s||!l)&&C)q.redrawLines(s,s+1)}}if(this.annotationModel){l=this._bracketAnnotations;var B,E;if(o.start===o.end&&(E=q.getCaretOffset())>0){E=E-1;if(h.getBaseModel){E=h.mapOffset(E);h=h.getBaseModel()}h=this._findMatchingBracket(h,E);if(h!==-1)B=[{start:h,end:h+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=B;this.annotationModel.replaceAnnotations(l,
B)}},_onModelChanged:function(h){var l=h.start,o=h.removedCharCount,q=h.addedCharCount-o,s=this.view;h=s.getModel();var z=h.getBaseModel?h.getBaseModel():h;o=l+o;var C=z.getCharCount(),B=this.comments.length,E=z.getLineStart(z.getLineAtOffset(l)),G=this._binarySearch(this.comments,E,true),M=this._binarySearch(this.comments,o,false,G-1,B);if(G<B&&this.comments[G].start<=E&&E<this.comments[G].end){E=this.comments[G].start;if(E>l)E+=q}else E=G===B&&B>0&&C-q===this.comments[B-1].end?this.comments[B-1].start:
E;var H;if(M<B){H=this.comments[M].end;if(H>l)H+=q;M+=1}else{M=B;H=C}var N;C=this._findComments(z.getText(E,H),E);for(B=G;B<this.comments.length;B++){N=this.comments[B];if(N.start>l)N.start+=q;if(N.start>l)N.end+=q}var L=M-G!==C.length;if(!L)for(B=0;B<C.length;B++){N=this.comments[G+B];var P=C[B];if(N.start!==P.start||N.end!==P.end||N.type!==P.type){L=true;break}}B=[G,M-G].concat(C);Array.prototype.splice.apply(this.comments,B);if(L){B=E;N=H;if(h!==z){B=h.mapOffset(B,true);N=h.mapOffset(N,true)}s.redrawRange(B,
N)}if(this.foldingEnabled&&z!==h&&this.annotationModel){s=this.annotationModel;G=s.getAnnotations(E,H);E=[];for(H=[];G.hasNext();){N=G.next();if(N.type==="orion.annotation.folding"){H.push(N);for(B=0;B<C.length;B++)if(N.start===C[B].start&&N.end===C[B].end)break;if(B===C.length){E.push(N);N.expand()}else{B=N.start;M=N.end;if(B>l)B-=q;if(M>l)M-=q;if(B<=l&&l<M&&B<=o&&o<M){B=z.getLineAtOffset(N.start);M=z.getLineAtOffset(N.end);if(B!==M){if(!N.expanded){N.expand();s.modifyAnnotation(N)}}else s.removeAnnotation(N)}}}}l=
[];for(B=0;B<C.length;B++){N=C[B];for(q=0;q<H.length;q++)if(H[q].start===N.start&&H[q].end===N.end)break;if(q===H.length)(N=this._createFoldingAnnotation(h,z,N.start,N.end))&&l.push(N)}s.replaceAnnotations(E,l)}}};return{TextStyler:g}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(d){function f(b,c,e){this.initialize(b);this.grammar=this.copy(c);this.externalGrammars=e?this.copy(e):[];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(k,
m){throw new Error('Unsupported regex feature "'+k+'": "'+m[0]+'" at index: '+m.index+" in "+m.input);}function e(k){for(var m="",p=false,w=k.length,t=0;t<w;){var u=k[t];if(!p&&u==="#")for(;t<w&&u!=="\r"&&u!=="\n";)u=k[++t];else if(!p&&/\s/.test(u))for(;t<w&&/\s/.test(u);)u=k[++t];else{if(u==="\\"){m+=u;if(!/\s/.test(k[t+1])){m+=k[t+1];t+=1}}else{if(u==="[")p=true;else if(u==="]")p=false;m+=u}t+=1}}return m}var g="",j;b=a.processGlobalFlag("x",b,function(k){return e(k)});b=a.processGlobalFlag("i",
b,function(k){g+="i";return k});for(j=0;j<this.unsupported.length;j++){var i;if(i=this.unsupported[j].regex.exec(b))c(this.unsupported[j].func(i),i)}return new RegExp(b,g)},processGlobalFlag:function(b,c,e){function g(i,k){var m=0,p=i.length,w=-1;for(k=k;k<p&&w===-1;k++)switch(i[k]){case "\\":k++;break;case "(":m++;break;case ")":m--;if(m===0)w=k;break}return w}var j="(?"+b+")";b="(?"+b+":";if(c.substring(0,j.length)===j)return e(c.substring(j.length));else if(c.substring(0,b.length)===b){j=g(c,0);
if(j<c.length-1)throw new Error("Only a "+b+") group that encloses the entire regex is supported in: "+c);return e(c.substring(b.length,j))}return c},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,c,e){e=typeof e==="undefined"?true:false;b=b.source.split(/(\\\d+)/g);for(var g=[],j=0;j<b.length;j++){var i=b[j],k=/\\(\d+)/.exec(i);if(k){i=c[k[1]]||"";g.push(e?d.escape(i):i)}else g.push(i)}return new RegExp(g.join(""))},groupify:function(b,c){var e=b.source,
g=e.length,j=[],i=0,k=[],m=1,p=1,w=[];b={};for(var t={},u=0;u<g;u++){var v=j[j.length-1],x=e[u];switch(x){case "(":if(v===4){j.pop();w.push(")");k[k.length-1].end=u}var n=u+2<g?e[u+1]+""+e[u+2]:null;if(n==="?:"||n==="?="||n==="?!"){var r;if(n==="?:")r=1;else{r=3;i++}j.push(r);k.push({start:u,end:-1,type:r});w.push(x);w.push(n);u+=n.length}else{j.push(2);k.push({start:u,end:-1,type:2,oldNum:m,num:p});w.push(x);if(i===0)t[p]=null;b[m]=p;m++;p++}break;case ")":v=j.pop();v===3&&i--;k[k.length-1].end=
u;w.push(x);break;case "*":case "+":case "?":case "}":var y=x,A=e[u-1];n=u-1;if(x==="}"){for(r=u-1;e[r]!=="{"&&r>=0;r--);A=e[r-1];n=r-1;y=e.substring(r,u+1)}r=k[k.length-1];if(A===")"&&(r.type===2||r.type===4)){w.splice(r.start,0,"(");w.push(y);w.push(")");x={start:r.start,end:w.length-1,type:4,num:r.num};for(A=0;A<k.length;A++){v=k[A];if(v.type===2||v.type===4)if(v.start>=r.start&&v.end<=n){v.start+=1;v.end+=1;v.num+=1;if(v.type===2)b[v.oldNum]=v.num}}k.push(x);p++;break}default:if(x!=="|"&&v!==
2&&v!==4)if(i===0){j.push(4);k.push({start:u,end:-1,type:4,num:p});w.push("(");t[p]=null;p++}w.push(x);if(x==="\\"){w.push(e[u+1]);u+=1}break}}for(;j.length;){j.pop();w.push(")")}e=new RegExp(w.join(""));g={};c=c||b;for(var h in c)if(c.hasOwnProperty(h))g[h]="\\"+c[h];e=this.getSubstitutedRegex(e,g,false);return[e,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}};f.prototype={initialize:function(b){this.textView=b;var c=
this;this._listener={onModelChanged:function(e){c.onModelChanged(e)},onDestroy:function(e){c.onDestroy(e)},onLineStyle:function(e){c.onLineStyle(e)}};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 e=0;e<c.patterns.length;e++)b.push(c.patterns[e])}}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var c=b.split("."),e=0;e<c.length;e++)this._styles[b].push(c.slice(0,e+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 e=a.complexCaptures(c.captures);c=a.complexCaptures(c.beginCaptures)||a.complexCaptures(c.endCaptures);if(this.isComplex=e||c){e=a.groupify(this.beginRegex);this.beginRegex=e[0];this.beginOld2New=e[1];this.beginConsuming=e[2];e=a.groupify(this.endRegex,this.beginOld2New);
this.endRegex=e[0];this.endOld2New=e[1];this.endConsuming=e[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 e=0;e<this.externalGrammars.length;e++){var g=this.externalGrammars[e];if(g.scopeName===b){this.preprocess(g);c=this._allGrammars[b]=g;break}}}}return c},ContainerNode:function(){function b(c,e){this.parent=c;this.rule=e;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,
e,g){this.parent=c;this.rule=e;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=e.endRegexHasBackRef?a.getSubstitutedRegex(e.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 e=c.length;e>0;)b.push(c[--e])},exec:function(b,c,e){if(c=b.exec(c))c.index+=e;b.lastIndex=0;return c},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,
c,e){if(b instanceof this.BeginEndNode){var g=b.rule;b=b.endRegexSubstituted||g.endRegex;if(!b)return null;return this.exec(b,c,e)}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,e=b.removedCharCount;b=b.start;if(this._tree){var g=this.textView.getModel(),j=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,e):j;this.textView.redrawRange(g,c)}else this.initialParse()},getFirstDamaged:function(b,c){if(b<0)return this._tree;for(var e=[this._tree],g=null;e.length;){var j=e.pop();if(!j.parent||this.isDamaged(j,b,c)){if(j instanceof this.BeginEndNode)g=j;for(var i=0;i<j.children.length;i++)e.push(j.children[i])}}return g||this._tree},isDamaged:function(b,c,e){return b.start<=e&&b.end>c},parse:function(b,c,e,g,j,i){var k=this.textView.getModel(),m=k.getLineStart(k.getLineCount()-
1),p=k.getCharCount(),w=this.getInitialExpected(b,e),t=-1;if(c){b.repaired=true;b.endNeedsUpdate=true;t=b.children[b.children.length-1];var u=j-i;t=t?k.getLineEnd(k.getLineAtOffset(t.end+u)):-1;g=k.getLineEnd(k.getLineAtOffset(g+i));t=Math.max(t,g)}t=t===-1?p:t;g=w;var v=b;u=false;for(var x=e,n=-1;v&&(!c||x<t);){var r=this.getNextMatch(k,v,x);r||(x=x>=m?p:k.getLineStart(k.getLineAtOffset(x)+1));var y=r&&r.match,A=r&&r.rule,h=r&&r.isEnd;if(r&&r.isSub){x=this.afterMatch(y);if(A instanceof this.BeginEndRule){u=
true;if(c&&A===g.rule&&v===g.parent){v=g;v.setStart(y);v.repaired=true;v.endNeedsUpdate=true;v=v;g=this.getNextExpected(g,"begin")}else{if(c){this.prune(v,g);c=false}y=new this.BeginEndNode(v,A,y);v.addChild(y);v=y}}}else if(h||x===p){if(v instanceof this.BeginEndNode)if(y){u=true;n=Math.max(n,v.end);v.setEnd(y);x=this.afterMatch(y);if(c&&v===g&&v.parent===g.parent){v.repaired=true;delete v.endNeedsUpdate;g=this.getNextExpected(g,"end")}else if(c){this.prune(v,g);c=false}}else{v.setEnd(p);delete v.endNeedsUpdate}v=
v.parent}if(c&&x>=t&&!u){this.prune(b,w);c=false}}this.removeUnrepairedChildren(b,c,e);this.cleanup(c,b,e,t,p,j,i);return c?Math.max(n,x):x},removeUnrepairedChildren:function(b,c,e){if(c){c=b.children;for(var g=-1,j=0;j<c.length;j++){var i=c[j];if(!i.repaired&&this.isDamaged(i,e,Number.MAX_VALUE)){g=j;break}}if(g!==-1)b.children.length=g}},cleanup:function(b,c,e,g,j,i,k){if(b){b=i-k;j=this.getIntersecting(g-b+1,j);c=this.getIntersecting(e,g);for(e=0;e<j.length;e++){g=j[e];if(!g.repaired&&g instanceof
this.BeginEndNode){g.shiftEnd(b);g.shiftStart(b)}}for(e=0;e<c.length;e++){g=c[e];g.repaired&&g.endNeedsUpdate&&g.shiftEnd(b);delete g.endNeedsUpdate;delete g.repaired}}else{c=this.getIntersecting(e,g);for(e=0;e<c.length;e++)delete c[e].repaired}},getNextMatch:function(b,c,e,g){var j=b.getLineAtOffset(e);j=b.getLineEnd(j);var i=b.getText(e,j),k=[],m=[];b=[];j=[];for(this.push(k,c.rule.subrules);k.length;){var p=k.length?k.pop():null;p=p&&p._resolvedRule._typedRule;if(p instanceof this.ContainerRule&&
m.indexOf(p)===-1){m.push(p);this.push(k,p.subrules)}else if(!(p&&g&&!p.matchRegex)){var w=p&&this.exec(p.matchRegex||p.beginRegex,i,e);if(w){b.push(w);j.push(p)}}}k=Number.MAX_VALUE;m=-1;for(p=0;p<b.length;p++){w=b[p];if(w.index<k){k=w.index;m=p}}if(!g)if(e=this.getEndMatch(c,i,e)){g=c.rule.applyEndPatternLast;if(m===-1||e.index<k||!g&&e.index===k)return{isEnd:true,rule:c.rule,match:e}}return m===-1?null:{isSub:true,rule:j[m],match:b[m]}},getInitialExpected:function(b,c){var e,g;if(b===this._tree)for(e=
0;e<b.children.length;e++){g=b.children[e];if(g.start>=c)return g}else if(b instanceof this.BeginEndNode)if(b.endMatch){var j=b.endMatch.index;for(e=0;e<b.children.length;e++){g=b.children[e];if(g.start>=c)break}if(g&&g.start<j)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(k,m){return k.start-m.start}this._tree||this.initialParse();var e=b.lineStart,g=this.textView.getModel(),j=g.getLineEnd(b.lineIndex),i=g.getLineEnd(g.getLineAtOffset(e)-1);i=this.getFirstDamaged(i,i);e=this.getLineScope(g,i,e,j);b.ranges=this.toStyleRanges(e);b.ranges.sort(c)},getLineScope:function(b,c,e,g){for(var j=e,i=this.getInitialExpected(c,e),k=[],m=
[];c&&j<g;){var p=this.getNextMatch(b,c,j);if(!p)break;var w=p&&p.match,t=p&&p.rule,u=p&&p.isSub;p=p&&p.isEnd;w.index!==j&&m.push({start:j,end:w.index,node:c});if(u){j=this.afterMatch(w);if(t instanceof this.BeginEndRule){this.addBeginScope(k,w,t);c=i;i=this.getNextExpected(i,"begin")}else this.addMatchScope(k,w,t)}else if(p){j=this.afterMatch(w);this.addEndScope(k,w,t);i=this.getNextExpected(i,"end");c=c.parent}}j<g&&m.push({start:j,end:g,node:c});b=this.getInheritedLineScope(m,e,g);return k.concat(b)},
getInheritedLineScope:function(b){for(var c=[],e=0;e<b.length;e++)for(var g=b[e],j=g.node;j;){var i=j.rule.rule,k=i.name;if(i=i.contentName||k){this.addScopeRange(c,g.start,g.end,i);break}j=j.parent}return c},addBeginScope:function(b,c,e){var g=e.rule;this.addCapturesScope(b,c,g.beginCaptures||g.captures,e.isComplex,e.beginOld2New,e.beginConsuming)},addEndScope:function(b,c,e){var g=e.rule;this.addCapturesScope(b,c,g.endCaptures||g.captures,e.isComplex,e.endOld2New,e.endConsuming)},addMatchScope:function(b,
c,e){var g=e.rule,j=g.name;(g=g.captures)?this.addCapturesScope(b,c,g,e.isComplex,e.matchOld2New,e.matchConsuming):this.addScope(b,c,j)},addScope:function(b,c,e){e&&b.push({start:c.index,end:this.afterMatch(c),scope:e})},addScopeRange:function(b,c,e,g){g&&b.push({start:c,end:e,scope:g})},addCapturesScope:function(b,c,e,g,j,i){if(e)if(g){g={1:0};for(var k=0,m=1;c[m]!==undefined;m++){if(i[m]!==undefined)k+=c[m].length;if(c[m+1]!==undefined)g[m+1]=k}i=c.index;for(k=1;e[k];k++){m=e[k].name;var p=j[k],
w=i+g[p];typeof c[p]!=="undefined"&&this.addScopeRange(b,w,w+c[p].length,m)}}else this.addScope(b,c,e[0]&&e[0].name)},getIntersecting:function(b,c){for(var e=[],g=this._tree?[this._tree]:[];g.length;){var j=g.pop(),i=false;if(j instanceof this.ContainerNode)i=true;else if(this.isDamaged(j,b,c)){i=true;e.push(j)}if(i){i=j.children.length;for(var k=0;k<i;k++)g.push(j.children[k])}}return e.reverse()},toStyleRanges:function(b){for(var c=[],e=0;e<b.length;e++){var g=b[e],j=this._styles[g.scope];if(!j)throw new Error("styles not found for "+
g.scope);j=j.join(" ");c.push({start:g.start,end:g.end,style:{styleClass:j}})}return c}};return{RegexUtil:a,TextMateStyler:f}});
define("orion/editor/asyncStyler",["i18n!orion/editor/nls/messages"],function(d){function f(b){return b.getName()==="orion.edit.highlighter"&&b.getProperty("type")==="highlighter"}function a(b,c,e){this.initialize(b,c,e);this.lineStyles=[]}a.prototype={initialize:function(b,c,e){this.textView=b;this.serviceRegistry=c;this.annotationModel=e;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,k){g.onServiceAdded(i,k)},onServiceRemoved:function(i,k){g.onServiceRemoved(i,k)}};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(e=0;e<b.length;e++){var j=b[e];f(j)&&this.addServiceListener(c.getService(j))}},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 e=-1,g=this.textView.getModel();for(var j in c)if(c.hasOwnProperty(j)){this.lineStyles[j]=c[j];b=Math.min(b,j);e=Math.max(e,j)}b=Math.max(b,0);e=Math.min(e,g.getLineCount());
if(c=this.annotationModel){for(var i=c.getAnnotations(g.getLineStart(b),g.getLineEnd(e)),k=[];i.hasNext();){var m=i.next();m.type==="orion.annotation.highlightError"&&k.push(m)}i=[];for(m=b;m<=e;m++){j=m;var p=this.lineStyles[j];p=p&&p.errors;j=g.getLineStart(j);if(p)for(var w=0;w<p.length;w++){var t=p[w];i.push({start:t.start+j,end:t.end+j,type:"orion.annotation.highlightError",title:d.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}})}}c.replaceAnnotations(k,
i)}this.textView.redrawLines(b,e+1)},onLineStyle:function(b){function c(g,j){for(var i=g.length,k=[],m=0;m<i;m++){var p=g[m];k.push({start:p.start+j,end:p.end+j,style:p.style})}return k}var e=this.lineStyles[b.lineIndex];if(e)if(e.ranges)b.ranges=c(e.ranges,b.lineStart);else if(e.style)b.style=e.style},_getEmptyStyle:function(b){for(var c=[],e=0;e<b;e++)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){f(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(f){this._styler=f;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(f,a){for(var b=JSON.parse(localStorage.getItem("JavaScript Editor")),
c,e=0;e<b.length;e++)if(b[e].label===f)for(var g=0;g<b[e].data.length;g++)if(b[e].data[g].label===a){c=b[e].data[g].value;break}return c},_getStyleSheet:function(f){function a(m,p){if(m=k.getClassNameForToken(m)){var w=i._getSetting(p,"Color");p=i._getSetting(p,"Weight").toLowerCase();b.push("."+f+" ."+m+" {");b.push("\tcolor: "+w+";");b.push("\tfont-weight: "+p+";");b.push("}")}}var b=[];b.push("");var c=this._getSetting("Font","Family").toLowerCase();c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':
"monospace";var e=this._getSetting("Font","Size"),g=this._getSetting("Font","Color"),j=this._getSetting("Font","Background");b.push("."+f+" {");b.push("\tfont-family: "+c+";");b.push("\tfont-size: "+e+";");b.push("\tcolor: "+g+";");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+f+" .view {");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+f+" .ruler {");b.push("\tbackground-color: "+j+";");b.push("}");var i=this,k=this._styler;if(k.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 f=this._view,a={stylesheet:null,themeClass:null};f.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;f.setOptions(a)}},_onLoad:function(){this._updateStylesheet();this._view.removeEventListener("Load",this._listener.onLoad)},_onStorage:function(f){f.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,f,a,b,c){function e(j,i,k,m,p,w){function t(A,h){var l=A.getProperty("contentType"),o=A.getProperty("fileTypes");if(l)return i.isSomeExtensionOf(k,l).then(function(q){return q?A:null});else if(h&&o&&o.indexOf(h)!==-1){h=new d.Deferred;h.callback(A);return h}return null}function u(A){var h=null;switch(A&&A.id){case "text.javascript":case "text.json":h=
new f.TextStyler(m,"js",p);break;case "text.java":h=new f.TextStyler(m,"java",p);break;case "text.css":h=new f.TextStyler(m,"css",p);break}h&&new c.TextStylerOptions(h);return h}var v=u(k);if(v){w=new d.Deferred;w.callback(v);return w}v=w&&w.split(".").pop().toLowerCase();w=j.getServiceReferences("orion.edit.highlighter");for(var x=[],n=[],r=0;r<w.length;r++){var y=w[r];y.getProperty("type")==="grammar"&&x.push(y.getProperty("grammar"));(y=t(y,v))&&n.push(y)}return(new d.DeferredList(n)).then(function(A){for(var h,
l=A.length-1;l>=0;l--){var o=A[l][1];if(o){h=o;break}}var q;if(h){A=h.getProperty("type");if(A==="highlighter"){q=new b.AsyncStyler(m,j,p);q.setContentType(k)}else if(A==="grammar"||typeof A==="undefined"){h=h.getProperty("grammar");q=new a.TextMateStyler(m,h,x)}}return q})}function g(j){this.serviceRegistry=j;this.styler=null}g.prototype={setup:function(j,i,k,m){if(this.styler){this.styler.destroy&&this.styler.destroy();this.styler=null}var p=this;return e(this.serviceRegistry,this.serviceRegistry.getService("orion.file.contenttypes"),
j,i,k,m).then(function(w){return p.styler=w})},getStyler:function(){return this.styler}};return{createStyler:e,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,f,a,b,c,e,g,j,i,k,m,p,w,t,u,v,x,n,r,y){var A={};A.CompareContainer=function(){function h(){this._diffParser=new a.DiffParser}h.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(l,o){o&&this._clearOptions();if(l){this._mapper=l.mapper?
l.mapper:this._mapper;this._readonly=l.readonly!==undefined||l.readonly!==null?l.readonly:this._readonly;this._hasConflicts=l.hasConflicts!==undefined||l.hasConflicts!==null?l.hasConflicts:this._hasConflicts;this._diffProvider=l.diffProvider?l.diffProvider:this._diffProvider;this._complexURL=l.complexURL?l.complexURL:this._complexURL;this._baseFile.URL=l.baseFileURL?l.baseFileURL:this._baseFile.URL;this._baseFile.Name=l.baseFileName?l.baseFileName:this._baseFile.Name;this._baseFile.Type=l.baseFileType?
l.baseFileType:this._baseFile.Type;this._baseFile.Content=l.baseFileContent?l.baseFileContent:this._baseFile.Content;this._newFile.URL=l.newFileURL?l.newFileURL:this._newFile.URL;this._newFile.Name=l.newFileName?l.newFileName:this._newFile.Name;this._newFile.Type=l.newFileType?l.newFileType:this._newFile.Type;this._newFile.Content=l.newFileContent?l.newFileContent:this._newFile.Content;this._diffURL=l.diffURL?l.diffURL:this._diffURL;this._diffContent=l.diffContent?l.diffContent:this._diffContent;
this._onSave=l.onSave?l.onSave:this._onSave;this._callback=l.callback?l.callback:this._callback;this._errorCallback=l.errorCallback?l.errorCallback:this._errorCallback;this._onSetTitle=l.onSetTitle?l.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(l){if(this._diffProvider){var o=this;o._diffProvider.provide(o._complexURL,l,o._hasConflicts,
function(q){o._baseFile.URL=q.baseFile&&typeof q.baseFile.URL==="string"?q.baseFile.URL:o._baseFile.URL;o._baseFile.Name=q.baseFile&&typeof q.baseFile.Name==="string"?q.baseFile.Name:o._baseFile.Name;o._baseFile.Type=q.baseFile&&typeof q.baseFile.Type==="object"?q.baseFile.Type:o._baseFile.Type;o._baseFile.Content=q.baseFile&&typeof q.baseFile.Content==="string"?q.baseFile.Content:o._baseFile.Content;o._newFile.URL=q.newFile&&typeof q.newFile.URL==="string"?q.newFile.URL:o._newFile.URL;o._newFile.Name=
q.newFile&&typeof q.newFile.Name==="string"?q.newFile.Name:o._newFile.Name;o._newFile.Type=q.newFile&&typeof q.newFile.Type==="object"?q.newFile.Type:o._newFile.Type;o._newFile.Content=q.newFile&&typeof q.newFile.Content==="string"?q.newFile.Content:o._newFile.Content;o._diffContent=typeof q.diff==="string"?q.diff:o._diffContent;if(l||typeof o._baseFile.Content==="string")o.setEditor(l);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(l){if(typeof this._baseFile.Content==="string"&&typeof this._newFile.Content==="string"){if(!this._diffContent&&!this._mapper)this._diffContent="";this.setEditor(l);return true}else return false},getFileContent:function(l,o){if(this._fileClient){var q=this;q._fileClient.read(l[o].URL).then(function(s){l[o].Content=s;o<l.length-1?q.getFileContent(l,o+1):q.setEditor()},function(s,z){if(s.status===404){l[o].Content="";o<l.length-1?q.getFileContent(l,o+1):q.setEditor()}else q.errorCallback&&
q.errorCallback(s,z)})}else console.log("A file client is needed for getting file content")},parseMapper:function(l,o,q,s,z){var C=this._getLineDelim(l,q);if(this._mapper)return{delim:C,mapper:this._mapper,output:o,diffArray:o};if(o){l=(new r.JSDiffAdapter).adapt(l,o);return{delim:C,mapper:l.mapper,output:o,diffArray:l.changContents}}else{this._diffParser.setLineDelim(C);o=this._diffParser.parse(l,q,s,z);l=this._diffParser.getDiffArray();return{delim:C,mapper:o.mapper,output:o.outPutFile,diffArray:l}}},
startup:function(l){this._complexURL?this.resolveComplexDiff(l):this.resolveDiffByContents(l)}};return h}();A.DefaultDiffProvider=function(){function h(l){this.serviceRegistry=l;this._diffProvider=new n.DiffProvider(l)}h.prototype={_resolveComplexDiff:function(l,o,q){if(this._diffProvider){var s=this;s._diffProvider.getDiffContent(l).then(function(z){s._diffContent=s._hasConflicts?z.split("diff --git")[1]:z;o?s.callBack({diff:s._diffContent}):s._resolveComplexFileURL(l)},q)}else console.log("A diff provider is needed for compound diff URL")},
_resolveFileName:function(l){return l.split("?")[0]},_getContentType:function(l){l=this._resolveFileName(l);return this.serviceRegistry.getService("orion.file.contenttypes").getFilenameContentType(l)},_resolveComplexFileURL:function(l,o){var q=this;this._diffProvider.getDiffFileURI(l).then(function(s){(new f.DeferredList([q._getContentType(s.Old),q._getContentType(s.New)])).then(function(z){var C=z[0][1];z=z[1][1];q.callBack({baseFile:{URL:s.Old,Name:q._resolveFileName(s.Old),Type:C},newFile:{URL:s.New,
Name:q._resolveFileName(s.New),Type:z},diff:q._diffContent})},o)},o)},provide:function(l,o,q,s,z){this.callBack=s;this._hasConflicts=q;this._resolveComplexDiff(l,o,z)}};return h}();A.DiffStyler=function(){function h(l,o){this._compareMatchRenderer=l;this._textView=o}h.prototype={highlight:function(l){this._textView&&this._textView.removeEventListener("LineStyle",this._lineStyleListener);if(l)this._textView=l;if(this._textView&&!this._textView.getModel().isMapperEmpty())this._textView.addEventListener("LineStyle",
this._lineStyleListener=f.hitch(this,this._onLineStyle))},_onLineStyle:function(l){var o=this._textView,q=l.lineIndex,s=o.getModel().getLineType(q);q=s.type;var z=x.getAnnotationIndexByMapper(o.getModel().getAnnotations(),s.mapperIndex).current;o=x.isMapperConflict(o.getModel().getMapper(),s.mapperIndex);z=z===this._compareMatchRenderer.getCurrentAnnotationIndex();if(q==="top-only"){q=z?"url('"+d.toUrl("images/diff-border-sel.png")+"')":"url('"+d.toUrl("images/diff-border.png")+"')";l.style={style:{backgroundImage:q,
backgroundRepeat:"repeat-x"}}}else if(q!=="unchanged")l.style={styleClass:z?o?"diffConflictSelect":"diffNormalSelect":o?"diffConflict":"diffNormal"}}};return h}();A.TwoWayCompareStyler=function(){function h(l,o){this._syntaxHighlither=new y.SyntaxHighlighter(l);this._diffHighlither=new A.DiffStyler(o)}h.prototype={highlight:function(l,o,q){var s=this;this._syntaxHighlither.setup(o,q,null,l).then(function(){s._diffHighlither.highlight(q)})}};return h}();A.TwoWayCompareContainer=function(){function h(l,
o,q){this._registry=l;this._commandService=this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._uiFactory=o;this._viewLoadedCounter=0;this.setOptions(q,true);var s=this;if(!this._callback)this._callback=function(z,C){if(s._uiFactory.getTitleDivId(true)&&s._uiFactory.getTitleDivId(false)){f.place(document.createTextNode(C),s._uiFactory.getTitleDivId(true),"only");f.place(document.createTextNode(z),s._uiFactory.getTitleDivId(false),"only")}};
if(!this._errorCallback)this._errorCallback=function(z,C){if(s._uiFactory.getTitleDivId(true)&&s._uiFactory.getTitleDivId(false)){z=typeof z.message==="string"?z.message:C.xhr.statusText;f.place(document.createTextNode(z),s._uiFactory.getTitleDivId(true),"only");f.place(document.createTextNode(z),s._uiFactory.getTitleDivId(false),"only");f.style(o.getTitleDivId(true),"color","red");f.style(o.getTitleDivId(false),"color","red")}};this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._rightEditorDivId=
this._uiFactory.getEditorParentDivId(false);this.initCommands();s=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(z){if(z)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(z){this.onSetTitle?this.onSetTitle(z,f.hitch(this,function(C){this.setTitle(C)}),
f.hitch(this,function(C){console.error("Error loading file metadata: "+C.message);this.setTitle(z)})):s._fileClient.read(z,true).then(f.hitch(this,function(C){this._fileMetadata=C;this.setTitle(C.Location)}),f.hitch(this,function(C){console.error("Error loading file metadata: "+C.message);this.setTitle(z)}));this.lastFilePath=z},setTitle:function(z){var C=z.lastIndexOf("/"),B=z;if(C!==-1){B="Compare "+B.substring(C+1);if(z.charAt(0)==="*")B="*"+B}this._lastTitle=B;window.document.title=B;if((C=f.byId("location"))&&
this._fileMetadata){f.empty(C);new p.BreadCrumbs({container:"location",resource:this._fileMetadata});if(z.charAt(0)==="*")f.create("b",null,C,"last").innerHTML="*"}},afterSave:function(){s.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 A.TwoWayCompareStyler(this._registry,
this._compareMatchRenderer));this._highlighter.push(new A.TwoWayCompareStyler(this._registry,this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}h.prototype=new A.CompareContainer;h.prototype.initEditorContainers=function(l,o,q,s,z){this._editorLeft=this.createEditorContainer(o,l,s,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this._readonly,z,this._newFile);m.generateDomCommandsInBanner(this._commandService,this._editorLeft,null,null,null,true);
this._textViewLeft=this._editorLeft.getTextView();this._editorRight=this.createEditorContainer(q,l,s,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,z,this._baseFile);this._textViewRight=this._editorRight.getTextView();var C=this;l=new b.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},C._compareMatchRenderer.getAnnotation(),function(B){C._compareMatchRenderer.matchPositionFromAnnotation(B)});this._textViewRight.addRuler(l);this._compareMatchRenderer.setOverviewRuler(l);
C=this;window.onbeforeunload=function(){if(C._editorLeft.isDirty())return"There are unsaved changes."}};h.prototype.initCommands=function(){var l=this._uiFactory.getCommandSpanId();if(l){var o=this,q=new t.Command({tooltip:"Go to next diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){o.nextDiff()}}),s=new t.Command({tooltip:"Go to previous diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",
callback:function(){o.prevDiff()}}),z=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(s,"dom");this._commandService.addCommand(q,"dom");this._commandService.addCommand(z,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,l);this._commandService.registerCommandContribution("orion.compare.nextDiff",
2,l);this._readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,l);this._commandService.renderCommands(l,"dom",o,o,"button")}};h.prototype.gotoMatch=function(l,o,q,s,z,C){if(!this.onScroll)this.onScroll=z;if(!this.onLoad)this.onLoad=C;z=this._textViewRight.getModel().getLineStart(l)+o.startIndex;this._editorRight.moveSelection(z,z+(o.length?o.length:s));l=this._textViewLeft.getModel().getLineStart(l)+q.startIndex;this._editorLeft.moveSelection(l,l+(q.length?q.length:
s))};h.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};h.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};h.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};h.prototype.createEditorContainer=function(l,o,q,s,z,C,B,E,G){var M=f.byId(z),H=this;l=new u.TextModel(l,o);var N=new e.TwoWayCompareModel(l,{mapper:q,columnIndex:s}),L="";q=B?new k.UndoFactory:new j.UndoCommandFactory(H._registry,H._commandService,"pageActions");var P=new i.Editor({textViewFactory:function(){var F=
new v.TextView({parent:M,model:N,readonly:B,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:q,contentAssistFactory:function(F){return new g.ContentAssist(F,"contentassist")},keyBindingFactory:function(F,J,Q,T){if(!B){(new j.EditorCommandFactory(H._registry,H._commandService,
H._fileClient,H._inputManager,"pageActions")).generateEditorCommands(F);var U=new k.TextActions(F,Q);J.push(U);F=new k.SourceCodeActions(F,Q,T);J.push(F)}},statusReporter:function(F,J){if(C){L=J?"ERROR: "+F:F;f.byId(C).innerHTML=""+L}},domNode:M});P.installTextView();if(!B){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[s].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=x.lookUpMapper(D.getModel().getMapper(),s,F).mapperIndex;F=x.getAnnotationIndexByMapper(D.getModel().getAnnotations(),F);F.current!==-1&&H._compareMatchRenderer.gotoDiff(F.current)});if(s===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};h.prototype.setEditor=function(l){var o=this._baseFile.Content,q=this._newFile.Content,s=this._diffContent;if(q)s=this.parseMapper(o,q,s,this._hasConflicts,true);else{s=this.parseMapper(o,q,s,this._hasConflicts,l);
q=s.output}this._compareMatchRenderer.init(s.mapper,this._textViewLeft,this._textViewRight);if(this._editorLeft)if(l){this._textViewLeft.getModel().init(s.mapper);this._textViewRight.getModel().init(s.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFile.URL;this._textViewLeft.getModel().init(s.mapper);this._textViewRight.getModel().init(s.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,q);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(s.delim,q,o,s.mapper,true);this._viewLoadedCounter>1&&this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return h}();A.InlineCompareContainer=function(){function h(l,o,q){this._registry=l;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(q,true);var s=this;if(!this._callback)this._callback=function(){f.place(document.createTextNode(s._diffTitle),"fileNameInViewer","only");f.style("fileNameInViewer","color","#6d6d6d");s._statusService.setProgressMessage("");f.empty("compare_rightContainerCommands");s._commandService.renderCommands("compare_rightContainerCommands",
"dom",s,s,"button")};if(!this._errorCallback)this._errorCallback=function(z,C){var B=[];B.Severity="Error";B.HTML=false;try{var E=JSON.parse(z.responseText);B.Message=E.DetailedMessage?E.DetailedMessage:E.Message}catch(G){B.Message=typeof z.message==="string"?z.message:C.xhr.statusText}this._statusService.setProgressResult(B);f.empty("compare_rightContainerCommands")};this._annotation=new b.CompareAnnotation;this._editorDivId=o;this.initEditorContainers("","\n",[],[]);this.hasContent=false}h.prototype=
new A.CompareContainer;h.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}};h.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}};h.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],
[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};h.prototype.createEditorContainer=function(l,o,q,s,z,C){var B=f.byId(this._editorDivId),E=this;l=new u.TextModel(l,o);var G=new c.CompareTextModel(l,{mapper:q,columnIndex:0},new c.DiffLineFeeder(s,o));o=new k.UndoFactory;o=new i.Editor({textViewFactory:function(){return new v.TextView({parent:B,model:G,readonly:true,stylesheet:d.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:o,keyBindingFactory:function(){},
statusReporter:function(){},domNode:B});o.installTextView();z&&C&&o.setInput(C.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=x.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};h.prototype.initEditorContainers=
function(l,o,q,s){this._editor=this.createEditorContainer(o,l,q,s,this._newFile);this._textView=this._editor.getTextView()};h.prototype._onLineStyle=function(l){var o=l.lineIndex,q=this._textView.getModel().getLineType(o);o=q.type;q=x.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),q.mapperIndex).current;if(o==="added")l.style=q===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(o==="removed")l.style=q===
this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};h.prototype._initDiffPosition=function(l){var o=l.getModel();if(o&&o.getAnnotations){o=o.getAnnotations();if(o.length>0){o=o[0][0];var q=l.getLineHeight(),s=l.getClientArea();q=Math.floor(s.height/q/3);l.setTopIndex(o-q>0?o-q:0)}}};h.prototype.setDiffTitle=function(l){this._diffTitle=l};h.prototype.setEditor=function(){var l=this._baseFile.Content,o=this._newFile.Content,q=this._diffContent;
this.hasContent=true;o=this.parseMapper(l,o,q,false,o);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(o.mapper,o.diffArray);if(l==="")l=" ";this._textView.setText(l);this._annotation.init(o.mapper,this._textView)}else this.initEditorContainers(o.delim,l,o.mapper,o.diffArray,true);this._initDiffPosition(this._textView)};h.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};
h.prototype.setConflicting=function(l){this._conflcit=l};h.prototype.prevDiff=function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};h.prototype.positionAnnotation=function(l){if(this._textView){var o=this._textView.getLineHeight(),q=this._textView.getClientArea();o=Math.floor(q.height/o/3);this._textView.setTopIndex(l-o>0?l-o:0);this._textView.redrawRange();l=this._textView.getTopIndex();this._textView.redrawLines(l,
l+1,this._overview)}};return h}();return A});
define("orion/searchExplorer",["require","dojo","dijit","orion/explorer","orion/explorerNavHandler","orion/util","orion/fileClient","orion/commands","orion/searchUtils","orion/globalSearch/search-features","orion/compare/compare-features","orion/compare/compare-container","dijit/TooltipDialog"],function(d,f,a,b,c,e,g,j,i,k,m,p){function w(n,r,y,A,h){this.registry=n;this.fileClient=r;this._resultLocation=y;this._listRoot={isRoot:true,children:[]};this.indexedFileItems=[];this.location2ModelMap=[];
this._lineDelimiter="\n";this.onMatchNumberChanged=h.onMatchNumberChanged;this.queryObj=i.parseQueryStr(A)}function t(n,r){this._init(n);this.explorer=r}function u(n,r){this.registry=n;this._commandService=r;this.fileClient=new g.FileClient(this.registry);this.defaulRows=40;this.declareCommands()}function v(n,r){this.parentId=n;this.reportList=r;this.renderer=new x({checkbox:false},this)}function x(n,r){this._init(n);this.options=n;this.explorer=r}w.prototype=new b.ExplorerModel;w.prototype.replaceMode=
function(){return typeof this.queryObj.replace==="string"};w.prototype.sameFile=function(n,r){return this.fileModel(n)===this.fileModel(r)};w.prototype.fileModel=function(n){if(!n)return null;if(n.type==="file")return n;return n.parent};w.prototype.model2Index=function(n,r){r=r;if(!r&&n.parent)r=n.parent.children;if(r)for(var y=0;y<r.length;y++)if(r[y]===n)return y;return-1};w.prototype.location2Model=function(n){if(n&&this.location2ModelMap[n])return this.location2ModelMap[n];if(this.indexedFileItems.length>
0)return this.indexedFileItems[0];return null};w.prototype.storeStatus=function(n){if(n){var r=this.fileModel(n);window.sessionStorage[this.queryObj.queryStr+"_search_result_currentFileLocation"]=r.location;window.sessionStorage[this.queryObj.queryStr+"_search_result_currentDetailIndex"]=n.type==="file"?"none":JSON.stringify(this.model2Index(n))}};w.prototype.restoreGlobalStatus=function(){this.defaultReplaceStr=this.queryObj.searchStrTitle;var n=window.sessionStorage.global_search_default_replace_string;
if(typeof n==="string")if(n.length>0)this.defaultReplaceStr=n;this.sortByName=this.queryObj.sort.indexOf("Name")>-1};w.prototype.getRoot=function(n){n(this._listRoot)};w.prototype.getTopIterationNodes=function(){return this.indexedFileItems};w.prototype.buildResultModel=function(){this.restoreGlobalStatus();this.indexedFileItems=[];for(var n=0;n<this._resultLocation.length;n++){var r={parent:this._listRoot,type:"file",name:this._resultLocation[n].name,lastModified:this._resultLocation[n].lastModified,
linkLocation:this._resultLocation[n].linkLocation,location:this._resultLocation[n].location,parentLocation:i.path2FolderName(this._resultLocation[n].location,this._resultLocation[n].name,true),fullPathName:i.path2FolderName(this._resultLocation[n].path,this._resultLocation[n].name)};this.location2ModelMap[r.location]=r;this._listRoot.children.push(r);this.indexedFileItems.push(r)}};w.prototype.checkStale=function(n,r){n.stale&&this.fileClient.read(n.location).then(f.hitch(this,function(y){if(this.hitOnceWithinFile(y))n.stale=
false;else r(n)}),f.hitch(this,function(y){console.error("Error loading file contents: "+y.message);r(n)}))};w.prototype.matchesReplaced=function(n){var r=0;if(!n.children)return n.checked===false?0:1;if(n.children)for(var y=0;y<n.children.length;y++)if(n.children[y].checked!==false)r+=1;return r};w.prototype.writeIncrementalNewContent=function(n,r,y,A,h){var l=r[A];if(!l||A===r.length)h(r);else{var o=this.matchesReplaced(l);o>0?this.getFileContent(l,f.hitch(this,function(q){o=this.matchesReplaced(q);
var s=[];i.generateNewContents(q.contents,s,q,n,this.queryObj.inFileQuery.searchStrLength);s=s.join(this._lineDelimiter);q=q.ETag;this.fileClient.write(l.location,s,q?{ETag:q}:null).then(f.hitch(this,function(){y.push({model:l,matchesReplaced:o,status:"pass"});this.writeIncrementalNewContent(n,r,y,A+1,h)}),f.hitch(this,function(z){if(z.status===412)y.push({model:l,message:"Resource has been changed by others.",matchesReplaced:o,status:"failed"});else{z.log=true;y.push({model:l,message:"Failed to write file.",
matchesReplaced:o,status:"failed"})}this.writeIncrementalNewContent(n,r,y,A+1,h)}))}),true):this.writeIncrementalNewContent(n,r,y,A+1,h)}};w.prototype.getId=function(n){if(n===this._listRoot)n=this.rootId;else{n=n.location;n=n.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return n};w.prototype.hitOnceWithinFile=function(n){n=n.toLowerCase();return this.queryObj.inFileQuery.wildCard?i.searchOnelineRegEx(this.queryObj.inFileQuery,n,true):i.searchOnelineLiteral(this.queryObj.inFileQuery,n,true)};w.prototype.getFileContent=
function(n,r,y){n.contents?r(n):this.fileClient.read(n.location).then(f.hitch(this,function(A){i.searchWithinFile(this.queryObj.inFileQuery,n,A,this._lineDelimiter,this.replaceMode());this.onMatchNumberChanged&&!y&&this.onMatchNumberChanged(n);r(n)}),f.hitch(this,function(A){console.error("Error loading file content: "+A.message);r(null)}))};w.prototype.getChildren=function(n,r){if(n)if(n.children)r(n.children);else if(n.type==="detail")r([]);else n.type==="file"&&n.location?this.fileClient.read(n.location).then(f.hitch(this,
function(y){i.searchWithinFile(this.queryObj.inFileQuery,n,y,this._lineDelimiter,this.replaceMode());this.onMatchNumberChanged&&this.onMatchNumberChanged(n);r(n.children)}),f.hitch(this,function(y){console.error("Error loading file content: "+y.message);r([])})):r([])};w.prototype.constructor=w;t.prototype=new b.SelectionRenderer;t.prototype.initCheckboxColumn=function(){if(this._useCheckboxSelection){var n=document.createElement("th"),r=document.createElement("span");f.addClass(r,"selectionCheckmarkSprite core-sprite-check");
if(this.getCheckedFunc){r.checked=this.getCheckedFunc(this.explorer.model._listRoot);f.toggleClass(r,"core-sprite-check_on",r.checked)}n.appendChild(r);f.connect(r,"onclick",f.hitch(this,function(y){this.onCheck(null,y.target,y.target.checked?false:true)}));return n}};t.prototype.getCellHeaderElement=function(n){if(n===1){n=f.create("th",{innerHTML:"<h2>Results</h2>"});if(this.explorer.model.queryObj.searchStrTitle)if(this.explorer.numberOnPage>0){var r=this.explorer.model.queryObj.start+1,y=r+this.explorer.numberOnPage-
1;n.innerHTML=this.explorer.model.replaceMode()?"Replace <b>"+this.explorer.model.queryObj.searchStrTitle+"</b> with <b>"+this.explorer._replaceStr+"</b> for files <b>"+r+"-"+y+"</b> of "+this.explorer.totalNumber:"Files <b>"+r+"-"+y+"</b> of "+this.explorer.totalNumber+" matching <b>"+this.explorer.model.queryObj.searchStrTitle+"</b>"}return n}else if(n===2)return f.create("th",{innerHTML:"<h2>Location</h2>"});else if(n===0)return f.create("th",{innerHTML:""})};t.prototype.focus=function(){var n=
f.byId(this.explorer.getParentDivId());window.setTimeout(function(){n.focus()},10)};t.prototype.staleFileElement=function(n){if(n.stale){var r=f.byId(this.getFileSpanId(n));f.empty(r);f.place(document.createTextNode(n.name),r,"last");r=f.byId(this.getFileIconId(n));f.empty(r)}};t.prototype.replaceFileElement=function(n){var r=n.totalMatches?n.name+" ("+n.totalMatches+" matches)":n.name;n=f.byId(this.getItemLinkId(n));f.place(document.createTextNode(r),n,"only")};t.prototype.replaceDetailIcon=function(n,
r){if(!this.explorer.model.replaceMode())if(!(!n||n.type!=="detail"))if(n=f.byId(this.getDetailIconId(n))){f.empty(n);n=f.create("span",null,n,"last");f.addClass(n,"imageSprite");if(r==="right")f.addClass(n,"core-sprite-rightarrow");else r==="left"?f.addClass(n,"core-sprite-leftarrow"):f.addClass(n,"core-sprite-none")}};t.prototype.renderFileElement=function(n,r,y){if(this.explorer.model.replaceMode()){var A=f.create("span",{className:"primaryColumn",id:this.getItemLinkId(n)},r,"last");f.place(document.createTextNode(y),
A,"only");A.title="Click to compare";var h=this.explorer.model.getId(n),l=this;f.connect(A,"onmouseover",A,function(){A.style.cursor="pointer";f.toggleClass(h,"fileNameCheckedRow",true)});f.connect(A,"onmouseout",A,function(){A.style.cursor="default";f.toggleClass(h,"fileNameCheckedRow",false)});f.connect(A,"onclick",A,function(){l.explorer.navHandler.cursorOn(n)})}else{r=f.create("a",{className:"navlink",id:this.getItemLinkId(n),href:n.linkLocation},r,"last");f.place(document.createTextNode(y),r,
"only")}};t.prototype.generateContextTip=function(n){for(var r=f.create("table",{bgcolor:"#FFFFCC"}),y=0;y<n.context.length;y++){var A=f.create("tr",{},r);if(n.context[y].current){A=f.create("td",{noWrap:true},A);this.generateDetailHighlight(n,f.create("span",{className:"primaryColumn"},A))}else f.create("td",{noWrap:true,innerHTML:n.context[y].context+"&nbsp"},A)}return r};t.prototype.generateDetailHighlight=function(n,r){for(var y=0,A=this.explorer.model.queryObj.inFileQuery.searchStrLength,h=0;h<
n.matches.length;h++){if(y>=n.name.length)break;if(this.explorer.model.replaceMode())if(h!==n.matchNumber-1)continue;y!==n.matches[h].startIndex&&f.place(document.createTextNode(n.name.substring(y,n.matches[h].startIndex)),r,"last");y=f.create("b",null,r,"last");if(this.explorer.model.queryObj.inFileQuery.wildCard)A=n.matches[h].length;f.place(document.createTextNode(n.name.substring(n.matches[h].startIndex,n.matches[h].startIndex+A)),y,"only");y=n.matches[h].startIndex+A;if(this.explorer.model.replaceMode())break}y<
n.name.length-1&&f.place(document.createTextNode(n.name.substring(y)),r,"last")};t.prototype.renderDetailElement=function(n,r,y,A){r=this.getDetailElement(n,r,y);A&&this.renderDetailLineNumber(n,r);this.generateDetailHighlight(n,r)};t.prototype.renderDetailLineNumber=function(n,r){!this.explorer.model.replaceMode()||n.matches.length<=1?f.place(document.createTextNode(n.lineNumber+":"),r,"last"):f.place(document.createTextNode(n.lineNumber+"("+n.matchNumber+"):"),r,"last")};t.prototype.getDetailElement=
function(n,r,y){var A=this;if(this.explorer.model.replaceMode()){var h=f.create("span",{className:"primaryColumn"},y,"last");h.title="Click to compare";var l=this.explorer.model.getId(n);A=this;f.connect(h,"onmouseover",h,function(){h.style.cursor="pointer";f.toggleClass(l,"fileNameCheckedRow",true)});f.connect(h,"onmouseout",h,function(){h.style.cursor="default";f.toggleClass(l,"fileNameCheckedRow",false)});f.connect(h,"onclick",h,function(){A.explorer.navHandler.cursorOn(n)});return h}else{r=f.create("a",
{className:"navlink",id:this.getItemLinkId(n),href:n.linkLocation},y,"last");f.connect(r,"onclick",r,function(){A.explorer.navHandler.cursorOn(n)});return f.create("span",null,r,"only")}};t.prototype.getRowActionElement=function(n){return f.byId(this.getItemLinkId(n))};t.prototype.getLocationSpanId=function(n){return this.explorer.model.getId(n)+"_locationSpan"};t.prototype.getFileSpanId=function(n){return this.explorer.model.getId(n)+"_fileSpan"};t.prototype.getFileIconId=function(n){return this.explorer.model.getId(n)+
"_fileIcon"};t.prototype.getItemLinkId=function(n){if(typeof n==="string")return n+"_itemLink";return this.explorer.model.getId(n)+"_itemLink"};t.prototype.getDetailIconId=function(n){return this.explorer.model.getId(n)+"_detailIcon"};t.prototype.renderLocationElement=function(n,r){r=r?r:f.byId(this.getLocationSpanId(n));f.empty(r);var y=i.copyQueryParams(this.explorer.model.queryObj,true);y.location=n.parentLocation;y.start=0;y=i.generateSearchHref(y);link=f.create("a",{className:"navlink",href:y},
r,"last");link.title='Search again in this folder with "'+this.explorer.model.queryObj.searchStrTitle+'"';var A=this;f.connect(link,"onclick",link,function(){A.explorer.closeContextTip()});f.place(document.createTextNode(n.fullPathName),link,"only")};t.prototype.getCellElement=function(n,r,y){switch(n){case 0:var A;n=document.createElement("td");if(r.type==="file"){n.noWrap=true;A=f.create("span",{id:this.getFileIconId(r)},n,"only");this.getExpandImage(y,A,"core-sprite-file")}else{A=f.create("span",
{},n,"only");n.noWrap=true;n.align="right";this.renderDetailLineNumber(r,A)}return n;case 1:n=document.createElement("td");A=f.create("span",{id:this.getFileSpanId(r)},n,"only");var h=this;if(!this.explorer.model.replaceMode()){f.connect(y,"onclick",y,function(){r.stale||h.explorer.navHandler.cursorOn(r)});f.connect(y,"onmouseover",y,function(){if(!r.stale)y.style.cursor="pointer"});f.connect(y,"onmouseout",y,function(){y.style.cursor="default"})}if(r.type==="file")this.renderFileElement(r,A,r.totalMatches?
r.name+" ("+r.totalMatches+" matches)":r.name);else{this.renderDetailElement(r,y,A);A=f.create("span",{id:this.getDetailIconId(r)},A,"last");A=f.create("span",null,A,"last");f.addClass(A,"imageSprite");f.addClass(A,"core-sprite-none")}return n;case 2:n=document.createElement("td");if(r.type==="file"){A=f.create("span",{id:this.getLocationSpanId(r)},n,"only");r.parentLocation&&this.renderLocationElement(r,A)}return n}};t.prototype.constructor=t;u.prototype=new b.Explorer;u.prototype.onchange=function(){};
u.prototype.setResult=function(n,r,y,A){var h=this;this.parentNode=n;this.queryStr=y;this.totalNumber=A;this.numberOnPage=r.length;this.model=new w(this.registry,this.fileClient,r,y,{onMatchNumberChanged:function(l){h.renderer.replaceFileElement(l)}});this._replaceStr=this.model.queryObj.replace;if(this.model.replaceMode()){this.checkbox=true;this.renderer=new t({checkbox:true,highlightSelection:false,getCheckedFunc:function(l){return h.getItemChecked(l)},onCheckedFunc:function(l,o,q){h.onRowChecked(l,
o,q)}},h)}else{this.checkbox=false;this.renderer=new t({checkbox:false},this)}this._reporting=false;this._currentReplacedContents=this._currentPreviewModel=this._uiFactory=null;this._popUpContext=false;this.timerRunning-=false;this.twoWayCompareContainer=this._timer=null};u.prototype.declareCommands=function(){var n=this,r=new j.Command({name:"Save Search",tooltip:"Save query to search favorites",id:"orion.saveSearchResults",callback:function(){n.saveSearch(n.queryStr)},visibleWhen:function(){return!n.model.replaceMode()}}),
y=new j.Command({name:"Replace",tooltip:"Replace all matches with...",id:"orion.previewCurrentPage",callback:function(){n.preview()},visibleWhen:function(){return!n.model.replaceMode()}}),A=new j.Command({name:"Commit",tooltip:"Replace all selected matches",id:"orion.globalSearch.replaceAll",callback:function(){n.replaceAll()},visibleWhen:function(){return n.model.replaceMode()&&!n._reporting}}),h=new j.Command({name:"Hide Compare",tooltip:"Hide compare view of changes",id:"orion.globalSearch.hideCompare",
callback:function(){n.toggleCompare(false)},visibleWhen:function(){return n.model.replaceMode()&&!n._reporting&&n._uiFactory}}),l=new j.Command({name:"Show Compare",tooltip:"Show compare view of changes",id:"orion.globalSearch.showCompare",callback:function(){n.toggleCompare(true)},visibleWhen:function(){return n.model.replaceMode()&&!n._reporting&&!n._uiFactory}}),o=new j.Command({name:"Search Again",tooltip:"Search again",id:"orion.globalSearch.searchAgain",callback:function(){return n.searchAgain()},
visibleWhen:function(){return n._reporting||n.model.replaceMode()}});this._commandService.addCommand(r,"dom");this._commandService.addCommand(y,"dom");this._commandService.addCommand(o,"dom");this._commandService.addCommand(h,"dom");this._commandService.addCommand(l,"dom");this._commandService.addCommand(A,"dom");this._commandService.addCommandGroup("orion.searchActions.unlabeled",200,null,null,"pageActions");this._commandService.registerCommandContribution("orion.saveSearchResults",1,"pageActions",
"orion.searchActions.unlabeled");this._commandService.registerCommandContribution("orion.previewCurrentPage",2,"pageActions","orion.searchActions.unlabeled");this._commandService.registerCommandContribution("orion.globalSearch.searchAgain",3,"pageActions","orion.searchActions.unlabeled");this._commandService.registerCommandContribution("orion.globalSearch.hideCompare",4,"pageActions","orion.searchActions.unlabeled");this._commandService.registerCommandContribution("orion.globalSearch.showCompare",
5,"pageActions","orion.searchActions.unlabeled");this._commandService.registerCommandContribution("orion.globalSearch.replaceAll",6,"pageActions","orion.searchActions.unlabeled");r=new j.Command({name:"< Previous Page",tooltip:"Show previous page of search result",id:"orion.search.prevPage",hrefCallback:function(){var q=n.caculatePrevPage(n.model.queryObj.start,n.model.queryObj.rows,n.totalNumber),s=i.copyQueryParams(n.model.queryObj,true);s.start=q.start;return i.generateSearchHref(s)},visibleWhen:function(){return n.caculatePrevPage(n.model.queryObj.start,
n.model.queryObj.rows,n.totalNumber).start!==n.model.queryObj.start}});y=new j.Command({name:"Next Page >",tooltip:"Show next page of search result",id:"orion.search.nextPage",hrefCallback:function(){var q=n.caculateNextPage(n.model.queryObj.start,n.model.queryObj.rows,n.totalNumber),s=i.copyQueryParams(n.model.queryObj,true);s.start=q.start;return i.generateSearchHref(s)},visibleWhen:function(){return n.caculateNextPage(n.model.queryObj.start,n.model.queryObj.rows,n.totalNumber).start!==n.model.queryObj.start}});
A=new j.Command({tooltip:"Next result",imageClass:"core-sprite-move_down",id:"orion.search.nextResult",groupId:"orion.searchGroup",visibleWhen:function(){return!n._reporting},callback:function(){n.gotoNext(true,true)}});h=new j.Command({tooltip:"Previous result",imageClass:"core-sprite-move_up",id:"orion.search.prevResult",groupId:"orion.searchGroup",visibleWhen:function(){return!n._reporting},callback:function(){n.gotoNext(false,true)}});l=new j.Command({tooltip:"Expand all results",imageClass:"core-sprite-expandAll",
id:"orion.search.expandAll",groupId:"orion.searchGroup",visibleWhen:function(){return!n._reporting},callback:function(){n.expandAll()}});o=new j.Command({tooltip:"Collapse all results",imageClass:"core-sprite-collapseAll",id:"orion.search.collapseAll",groupId:"orion.searchGroup",visibleWhen:function(){return!n._reporting},callback:function(){n.collapseAll()}});this._commandService.addCommand(r,"dom");this._commandService.addCommand(y,"dom");this._commandService.addCommand(A,"dom");this._commandService.addCommand(h,
"dom");this._commandService.addCommand(l,"dom");this._commandService.addCommand(o,"dom");this._commandService.registerCommandContribution("orion.search.nextResult",1,"pageNavigationActions");this._commandService.registerCommandContribution("orion.search.prevResult",2,"pageNavigationActions");this._commandService.registerCommandContribution("orion.search.expandAll",3,"pageNavigationActions");this._commandService.registerCommandContribution("orion.search.collapseAll",4,"pageNavigationActions");this._commandService.registerCommandContribution("orion.search.prevPage",
5,"pageNavigationActions");this._commandService.registerCommandContribution("orion.search.nextPage",6,"pageNavigationActions")};u.prototype.loadOneFileMetaData=function(n,r){var y=this.model.indexedFileItems[n],A=this;this.fileClient.read(y.location,true).then(f.hitch(this,function(h){y.fullPathName=i.fullPathNameByMeta(h.Parents);y.parentLocation=h.Parents[0].Location;y.stale=y.lastModified!==h.LocalTimeStamp;y.ETag=h.ETag;y.stale&&this.model.checkStale(y,function(l){A.renderer.staleFileElement(l)});
if(n===this.model.indexedFileItems.length-1)r&&r();else this.loadOneFileMetaData(n+1,r)}),f.hitch(this,function(h){console.error("Error loading file metadata: "+h.message);if(n===this.model.indexedFileItems.length-1)r&&r();else this.loadOneFileMetaData(n+1,r)}))};u.prototype.preview=function(){var n=this;this._commandService.openParameterCollector("pageActions",function(y){var A=document.createElement("input");A.type="text";A.name="ReplaceWith:";A.id="globalSearchReplaceWith";A.placeholder="Replace With";
A.onkeydown=function(h){if(h.keyCode===f.keys.ENTER){h=f.byId("globalSearchReplaceWith");n._commandService.closeParameterCollector();return n.doPreview(h.value)}if(h.keyCode===27){n._commandService.closeParameterCollector();return false}};y.appendChild(A);A=document.createElement("span");f.addClass(A,"parameters");A.id="globalSearchReplaceCommands";y.appendChild(A)});var r=document.getElementById("globalSearchReplaceWith");r.value=this.model.defaultReplaceStr;window.setTimeout(function(){r.select();
r.focus()},10);this._commandService.addCommand(new j.Command({name:"Preview Changes",image:d.toUrl("images/replaceAll.gif"),id:"orion.globalSearch.innerReplaceAll",groupId:"orion.searchGroup",callback:function(){var y=f.byId("globalSearchReplaceWith");n._commandService.closeParameterCollector();return n.doPreview(y.value)}}),"dom");this._commandService.registerCommandContribution("orion.globalSearch.innerReplaceAll",1,"globalSearchReplaceCommands");this._commandService.renderCommands("globalSearchReplaceCommands",
"dom",this,this,"button")};u.prototype._fileExpanded=function(n,r){n=this.model.indexedFileItems[n];if(r===null||r===undefined)return{childrenNumber:0,childDiv:f.byId(this.model.getId(n))};if(n.children&&n.children.length>0){if(r<0)r=n.children.length-1;else if(r>=n.children.length)r=0;return{childrenNumber:n.children.length,childDiv:f.byId(this.model.getId(n.children[r]))}}return{childrenNumber:0,childDiv:null}};u.prototype.doPreview=function(n,r){window.sessionStorage.global_search_default_replace_string=
n;var y=i.copyQueryParams(this.model.queryObj,true);y.replace=n;if(r){y.start=0;y.rows=this.totalNumber}n=i.generateSearchHref(y);window.location.href=n};u.prototype.searchAgain=function(){var n=i.copyQueryParams(this.model.queryObj,true);n.replace=null;if(n.rows>this.defaulRows)n.rows=this.defaulRows;n=i.generateSearchHref(n);if(n===window.location.href)window.location.reload();else window.location.href=n};u.prototype.replaceAll=function(){var n=[],r=this;this._reporting=true;this.initCommands();
this.reportStatus("Writing files...");this.model.writeIncrementalNewContent(this._replaceStr,this.model.indexedFileItems,n,0,function(){f.empty(r.getParentDivId());(new v(r.getParentDivId(),n)).report();r.reportStatus("")})};u.prototype.toggleCompare=function(n){this.replacePreview(false,n)};u.prototype.replacePreview=function(n,r){f.empty(this.getParentDivId());if(r){this._uiFactory=new k.SearchUIFactory({parentDivID:this.getParentDivId()});this._uiFactory.buildUI()}else{this._uiFactory&&this._uiFactory.destroy();
this._uiFactory=null}this._currentPreviewModel=this.twoWayCompareContainer=null;this.initCommands();n&&this.reportStatus("Preparing preview...");var y=this;this.createTree(this._uiFactory?this._uiFactory.getMatchDivID():this.getParentDivId(),this.model,{indent:20,onCollapse:function(A){y.onCollapse(A)}});if(n){this.hookUpNavHandler();this.gotoCurrent(this.restoreLocationStatus());this.reportStatus("");this.loadOneFileMetaData(0,function(){y.refreshIndex()})}else{this.hookUpNavHandler();this.gotoCurrent(this.restoreLocationStatus())}};
u.prototype.getItemChecked=function(n){if(n.checked===undefined)n.checked=true;return n.checked};u.prototype.onRowChecked=function(n,r,y){if(n)(n=f.byId(n))&&n._item&&this.onItemChecked(n._item,r,y);else this.onItemChecked(this.model._listRoot,r,y)};u.prototype.onNewContentChanged=function(n){n===this.model.fileModel(this.navHandler.currentModel())&&this.buildPreview(true)};u.prototype.onItemChecked=function(n,r,y){n.checked=r;if(n.type==="file"||n.isRoot){if(n.children)for(y=0;y<n.children.length;y++){var A=
f.byId(this.renderer.getCheckBoxId(this.model.getId(n.children[y])));if(A)this.renderer.onCheck(null,A,r,false);else n.children[y].checked=r}n.type==="file"&&this.onNewContentChanged(n)}else y&&this.onNewContentChanged(n.parent)};u.prototype._getContentType=function(n){return this.registry.getService("orion.file.contenttypes").getFilenameContentType(n.name)};u.prototype.buildPreview=function(n){if(this._uiFactory)if(this.model.indexedFileItems.length!==0){var r=this._uiFactory,y=this.model.fileModel(this.navHandler.currentModel());
this._currentPreviewModel=y;if(!n||!this._currentReplacedContents)this._currentReplacedContents=[];var A=this;this.model.getFileContent(y,function(h){i.generateNewContents(h.contents,A._currentReplacedContents,h,A._replaceStr,A.model.queryObj.inFileQuery.searchStrLength);var l=A._getContentType(h);f.when(l,function(o){o={readonly:true,hasConflicts:false,baseFileName:h.location,newFileName:h.location,baseFileType:o,newFileType:o,baseFileContent:h.contents.join(A.model._lineDelimiter),newFileContent:A._currentReplacedContents.join(A.model._lineDelimiter)};
if(A.twoWayCompareContainer){f.empty(A.uiFactoryCompare.getTitleDivId(true));f.place(document.createTextNode("Replaced File ("+h.name+")"),A.uiFactoryCompare.getTitleDivId(true),"only");f.empty(A.uiFactoryCompare.getTitleDivId());f.place(document.createTextNode("Original File ("+h.name+")"),A.uiFactoryCompare.getTitleDivId(),"only");A.twoWayCompareContainer.setOptions(o);A.twoWayCompareContainer.setEditor()}else{A.uiFactoryCompare=new m.TwoWayCompareUIFactory({parentDivID:r.getCompareDivID(),showTitle:true,
leftTitle:"Replaced File ("+h.name+")",rightTitle:"Original File ("+h.name+")",showLineStatus:false});A.uiFactoryCompare.buildUI();A.twoWayCompareContainer=new p.TwoWayCompareContainer(A.registry,A.uiFactoryCompare,o);A.twoWayCompareContainer.startup()}window.setTimeout(function(){A.renderer.focus()},100)})})}};u.prototype.addFavorite=function(n,r){this.registry.getService("orion.core.favorite").addFavoriteSearch(n,r)};u.prototype.saveSearch=function(n){var r=i.parseQueryStr(n),y=n;if(r&&typeof r.searchStrTitle===
"string"&&typeof r.location==="string"){y="'"+r.searchStrTitle+"' in ";r.location.length>0?this.fileClient.read(r.location,true).then(f.hitch(this,function(A){var h=i.fullPathNameByMeta(A.Parents);this.addFavorite(y+(h.length===0?A.Name:h+"/"+A.Name),n)}),f.hitch(this,function(A){console.error("Error loading file meta data: "+A.message);this.addFavorite(y+"root",n)})):this.addFavorite(y+"root",n)}else this.addFavorite(y,n)};u.prototype.caculateNextPage=function(n,r,y){if(n+r>=y)return{start:n};return{start:n+
r}};u.prototype.caculatePrevPage=function(n,r){n=n-r;if(n<0)n=0;return{start:n}};u.prototype.initCommands=function(){var n=this;f.empty("pageActions");this._commandService.renderCommands("pageActions","dom",n,n,"button");f.empty("pageNavigationActions");this._commandService.renderCommands("pageNavigationActions","dom",n,n,"button");if(!(this.model.replaceMode()||this._reporting)){var r=a.byId("globalSearchOptMenu");r&&r.destroy();r=new a.Menu({style:"display: none;",id:"globalSearchOptMenu"});this.model.replaceMode()?
r.addChild(new a.CheckedMenuItem({label:"Compare changes",checked:true,onChange:function(y){n.toggleCompare(y)}})):r.addChild(new a.CheckedMenuItem({label:"Sort by Name",checked:n.model.sortByName,onChange:function(y){n.sortWithName(y)}}));r=new a.form.DropDownButton({label:"Options",dropDown:r});f.addClass(r.domNode,"commandImage");f.place(r.domNode,"pageNavigationActions","last")}e.forceLayout("pageNavigationActions")};u.prototype.reportStatus=function(n){this.registry.getService("orion.page.message").setProgressMessage(n)};
u.prototype.isExpanded=function(n){return this.myTree.isExpanded(this.model.getId(n))};u.prototype.popupContext=function(n){var r=this.renderer.getDetailIconId(n);this.contextTipDialog.attr("content",this.renderer.generateContextTip(n));n=f.byId(r);r={TR:"TL",TR:"TL"};if(n)for(var y=this.myTree._parent.getClientRects()[0],A=n.getClientRects(),h=0,l=A.length;h<l;h++)if(A[h].bottom+100>y.bottom){r={TR:"BL",TR:"BL"};break}a.popup.open({popup:this.contextTipDialog,around:n,orient:r})};u.prototype.closeContextTip=
function(n){if(!this.model.replaceMode()){a.popup.close(this.contextTipDialog);if(!n)this._popUpContext=false;this.renderer.replaceDetailIcon(this.navHandler.currentModel(),"right")}};u.prototype.onCollapse=function(n){var r=this.navHandler.currentModel();r&&r.type==="detail"&&this.model.fileModel(n)===n&&this.navHandler.cursorOn(n)};u.prototype.onExpand=function(n,r){if(n&&n.children&&n.children.length>0&&typeof r==="string"){var y=0;y=r==="first"?0:r==="last"?n.children.length-1:JSON.parse(r);if(typeof y===
"string"||y<0||y>=n.children.length)y=0;this.navHandler.cursorOn(n.children[y])}};u.prototype.forceExpandFunc=function(n,r,y){this.myTree.expand(n,f.hitch(this,function(){this.onExpand(n,r,y)}));return null};u.prototype.keyEventListeningDiv=function(){return f.byId(this.getParentDivId())};u.prototype.onFocus=function(n){n||this.closeContextTip()};u.prototype.preventDefaultFunc=function(n,r){if(!r)return true;if(!this.model.replaceMode()&&!n.ctrlKey&&r.type==="detail"){if(n.keyCode===f.keys.LEFT_ARROW&&
this._popUpContext){this.closeContextTip();n.preventDefault();return true}if(n.keyCode===f.keys.RIGHT_ARROW&&!this._popUpContext){this._popUpContext=true;this.renderer.replaceDetailIcon(r,"left");this.popupContext(r);n.preventDefault();return true}}return false};u.prototype.onReplaceCursorChanged=function(n,r){var y=this;this.model.sameFile(this._currentPreviewModel,r)||this.buildPreview();if(r.type==="detail")if(r.newMatches){this.twoWayCompareContainer.gotoMatch(r.lineNumber-1,r.matches[r.matchNumber-
1],r.newMatches[r.matchNumber-1],this.model.queryObj.inFileQuery.searchStrLength,function(){window.setTimeout(function(){y.renderer.focus()},200)});window.setTimeout(function(){y.renderer.focus()},0)}else y.renderer.focus()};u.prototype.onCursorChanged=function(n,r){this.renderer.replaceDetailIcon(n,"none");this.model.storeStatus(r);var y=this;if(this.model.replaceMode()){if(this._uiFactory)if(this._timer){if(this.timerRunning){window.clearTimeOut(this._timer);this._timer=window.setTimeout(function(){y.onReplaceCursorChanged(n,
r);y.timerRunning=false;y._timer=null},500)}}else this._timer=window.setTimeout(function(){y.onReplaceCursorChanged(n,r);y.timerRunning=false;y._timer=null},500)}else if(r.type==="detail")if(this._popUpContext){this.popupContext(r);this.renderer.replaceDetailIcon(r,"left")}else this.renderer.replaceDetailIcon(r,"right");else this._popUpContext&&this.closeContextTip(true)};u.prototype.hookUpNavHandler=function(){if(!this.navHandler){var n={preventDefaultFunc:f.hitch(this,function(){return this.preventDefaultFunc(modelToExpand,
detailIndex)}),onCursorChanged:f.hitch(this,function(r,y){this.onCursorChanged(r,y)})};this.navHandler=new c.ExplorerNavHandler(this,n)}this.navHandler.refreshModel(this.model)};u.prototype.startUp=function(){var n=f.byId("pageTitle");if(n&&this.model.queryObj.searchStrTitle)if(this.numberOnPage>0){this.reportStatus("Generating search result...");n.innerHTML=this.model.replaceMode()?"Replace All Matches":"Search Results"}else{this.parentNode.innerHTML="<b>No matches</b> for <b>"+this.model.queryObj.searchStrTitle+
"</b>";return}var r=this;this.model.buildResultModel();if(this.model.replaceMode())r.replacePreview(true,true);else{this.contextTipDialog=new a.TooltipDialog({content:"",onBlur:function(){r.closeContextTip()}});this.initCommands();f.empty(this.getParentDivId());this.createTree(this.getParentDivId(),this.model,{indent:20,onCollapse:function(y){r.onCollapse(y)}});this.hookUpNavHandler();this.gotoCurrent(this.restoreLocationStatus());this.reportStatus("");this.loadOneFileMetaData(0,function(){r.refreshIndex()})}};
u.prototype.restoreLocationStatus=function(){var n=this.model.location2Model(window.sessionStorage[this.model.queryObj.queryStr+"_search_result_currentFileLocation"]),r="none",y=window.sessionStorage[this.model.queryObj.queryStr+"_search_result_currentDetailIndex"];if(typeof y==="string")if(y.length>0)r=y;return{file:n,detail:r}};u.prototype.refreshIndex=function(){for(var n=[],r=this.model.fileModel(this.navHandler.currentModel()),y=0;y<this.model.indexedFileItems.length;y++)if(this.model.indexedFileItems[y].stale){if(r===
this.model.indexedFileItems[y])r=null}else n.push(this.model.indexedFileItems[y]);this.model.indexedFileItems=n;if(this.model.indexedFileItems.length===0){this.navHandler.refreshModel(this.model);this.navHandler.cursorOn(null,true)}else if(r)this.navHandler.refreshModel(this.model,true);else{this.navHandler.cursorOn(null,true);this.navHandler.refreshModel(this.model);this.gotoCurrent()}};u.prototype.sortWithName=function(n){if(this.model.sortByName!==n){var r=i.copyQueryParams(this.model.queryObj);
r.sort=n?"Name asc":"Path asc";r.start=0;n=i.generateSearchHref(r);window.location.href=n}};u.prototype.expandAll=function(){for(var n=0;n<this.model.indexedFileItems.length;n++)this.model.matchesReplaced(this.model.indexedFileItems[n])>0&&this.expandRecursively(this.model.indexedFileItems[n])};u.prototype.collapseAll=function(){for(var n=0;n<this.model.indexedFileItems.length;n++)this.myTree.collapse(this.model.indexedFileItems[n])};u.prototype.expandRecursively=function(n){if(n.type!=="detail"){this.myTree.expand(n);
n=n.children;if(!(n===undefined||n===null))for(var r=n.length,y=0;y<r;y++)this.expandRecursively(n[y])}};u.prototype.getParentDivId=function(n){return!this.model.replaceMode()||!n?this.parentNode.id:this._uiFactory?this._uiFactory.getMatchDivID():this.parentNode.id};u.prototype.gotoCurrent=function(n){var r=null,y="none";if(n){r=n.file;y=n.detail}else r=this.navHandler.currentModel();this.navHandler.cursorOn(r,true);r&&y&&y!=="none"&&this.myTree.expand(r,f.hitch(this,function(){this.onExpand(r,y)}))};
u.prototype.gotoNext=function(n,r){this.model.indexedFileItems.length!==0&&this.navHandler.iterate(n,r)};u.prototype.constructor=u;v.prototype=new b.Explorer;v.prototype.report=function(){this.createTree(this.parentId,new b.ExplorerFlatModel(null,null,this.reportList))};v.prototype.constructor=v;x.prototype=new b.SelectionRenderer;x.prototype.getCellHeaderElement=function(n){switch(n){case 0:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Files replaced</h2>"});
case 1:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Status</h2>"})}};x.prototype.getCellElement=function(n,r){switch(n){case 0:n=f.create("td",{style:"padding-left: 5px; padding-right: 5px"});var y=f.create("div",null,n,"only"),A=f.create("span",{className:"primaryColumn"},y,"last");f.place(document.createTextNode(r.model.fullPathName+"/"+r.model.name),A,"only");f.connect(A,"onclick",A,function(){window.open(r.model.linkLocation)});f.connect(A,"onmouseover",A,
function(){A.style.cursor="pointer"});f.connect(A,"onmouseout",A,function(){A.style.cursor="default"});y=f.create("span",null,y,"first");f.addClass(y,"imageSprite");if(r.status)switch(r.status){case "warning":f.addClass(y,"core-sprite-warning");return n;case "failed":f.addClass(y,"core-sprite-error");return n;case "pass":f.addClass(y,"core-sprite-ok");return n}return n;case 1:if(r.status){switch(r.status){case "warning":y=r.message;break;case "failed":y=r.message;break;case "pass":y=r.matchesReplaced+
" out of "+r.model.totalMatches+" matches replaced.";break}return f.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:y})}}};x.prototype.constructor=x;return{SearchResultExplorer:u}});
define("orion/searchResults",["require","dojo","orion/commands","orion/searchExplorer","orion/searchUtils"],function(d,f,a,b,c){function e(g,j,i,k){this.registry=g;this.fileService=k;this.resultsId=j;this.commandService=i;this.explorer=new b.SearchResultExplorer(this.registry,this.commandService)}e.prototype={_renderSearchResult:function(g,j,i){var k=false,m=[];f.empty(g);var p=i.responseHeader.params.q;p.substring(p.indexOf("}")+1);if(i.response.numFound>0)for(p=0;p<i.response.docs.length;p++){var w=
i.response.docs[p];if(!w.Directory){k||(k=true);var t=w.Location;m.push({linkLocation:d.toUrl("edit/edit.html")+"#"+t,location:t,path:w.Path,name:w.Name,lastModified:w.LastModified})}}this.explorer.setResult(g,m,j,i.response.numFound);this.explorer.startUp()},_search:function(g,j){var i=c.parseQueryStr(j);try{this.fileService.search(i.location,j).then(f.hitch(this,function(m){this._renderSearchResult(g,j,m)}))}catch(k){this.registry.getService("orion.page.message").setErrorMessage(k)}},loadResults:function(g){var j=
f.byId(this.resultsId);f.place(document.createTextNode("Searching..."),j,"only");this._search(j,g)}};e.prototype.constructor=e;return{SearchResultsGenerator:e}});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(d,f){d.declare("dojox.layout.ToggleSplitter",[f.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 e=c.substring(14);e=e.charAt(0).toLowerCase()+e.substring(1);if(c in this.child)this[e]=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 e={},g=this.horizontal?"height":"width";e.visibility=b?c.visibility:"hidden";e[g]=b?a.style[g]||c[g]:this._closedSize;var j=["Top","Right","Bottom","Left"];
d.forEach(["padding","margin","border"],function(i){for(var k=0;k<j.length;k++){var m=i+j[k];if(i=="border")i+="Width";if(undefined!==c[m])e[m]=b?c[m]:0}});return e},_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(f._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(d,f){d.declare("orion.widgets.eWebBorderContainer",f.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,e=this._center,g=d.position(c).w,j=this.isLeftPaneOpen(),
i;i=j?0:this.getPreferredLeftPaneWidth();j||this.toggleLeftPaneState();var k=c.style.overflow,m=e.style.overflow;(new d.Animation({node:c,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(p){c.style.width=g+(i-g)*p/100+"px";c.style.overflow="hidden";e.style.overflow="hidden";this.layout()}),onEnd:d.hitch(this,function(){e.style.overflow=m;c.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();j?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",f.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,e=this._center,g=d.position(c).w,j=this.isRightPaneOpen(),i;i=j?0:this.getPreferredRightPaneWidth();j||this.toggleRightPaneState();var k=c.style.overflow,m=e.style.overflow;(new d.Animation({node:c,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(p){c.style.width=g+(i-g)*p/100+"px";c.style.overflow="hidden";e.style.overflow="hidden";
this.layout()}),onEnd:d.hitch(this,function(){e.style.overflow=m;c.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();j?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});
define("search/search",["require","dojo","orion/bootstrap","orion/status","orion/progress","orion/dialogs","orion/commands","orion/favorites","orion/navoutliner","orion/searchClient","orion/fileClient","orion/operationsClient","orion/searchResults","orion/breadcrumbs","orion/globalCommands","orion/contentTypes","dojo/parser","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(d,f,a,b,c,e,g,j,i,k,m,p,w,t,u,v){function x(){var A=window.location.hash,
h=A.indexOf("#");if(h>=0)A=A.substring(h+1);return A}function n(){var A=f.hash(),h=A.indexOf("+Location:")>-1,l=null,o=A;if(h){A=A.split("+Location:");if(A.length===2){l=A[1].split("*")[0];o=A[0]}}return{searchStr:o,searchLocation:l}}function r(A,h,l,o){if(!l||l===""||l==="root")h.href=d.toUrl("search/search.html")+"#"+o;else A.read(l,true).then(f.hitch(this,function(q){if(q.Location)h.href=d.toUrl("search/search.html")+"#"+o+"+Location:"+q.Location+"*"}),f.hitch(this,function(q){window.console.error("Error loading file metadata: "+
q.message)}))}function y(A,h,l,o){var q=n();if(q.searchLocation)A.read(q.searchLocation,true).then(f.hitch(this,function(z){l&&o&&u.setPageTarget(z,l,o);var C=f.byId("location");if(C){h.setLocationByMetaData(z);f.empty(C);new t.BreadCrumbs({container:C,resource:z,firstSegmentName:A.fileServiceName(z.Location),makeHref:function(B,E){r(A,B,E,q.searchStr)}})}}),f.hitch(this,function(z){window.console.error("Error loading file metadata: "+z.message)}));else{var s=f.byId("location");if(s){f.empty(s);new t.BreadCrumbs({container:s,
resource:{},firstSegmentName:A.fileServiceName(""),makeHref:function(z,C){r(A,z,C,q.searchStr)}})}}}f.addOnLoad(function(){a.startup().then(function(A){var h=A.serviceRegistry;A=A.preferences;window.document.body.style.visibility="visible";f.parser.parse();new e.DialogService(h);var l=new p.OperationsClient(h);new b.StatusReportingService(h,l,"statusPane","notifications","notificationArea");new c.ProgressService(h,l);var o=new g.CommandService({serviceRegistry:h});new j.FavoritesService({serviceRegistry:h});
var q=new m.FileClient(h);new v.ContentTypeService(h);var s=new k.Searcher({serviceRegistry:h,commandService:o,fileService:q});new i.NavigationOutliner({parent:"favoriteProgress",toolbar:"outlinerToolbar",serviceRegistry:h});u.generateBanner("banner",h,o,A,s,s);A=x();u.generateDomCommandsInBanner(o,s,A,null,null,false,true);y(q,s,h,o);var z=new w.SearchResultsGenerator(h,"results",o,q);z.loadResults(A);f.subscribe("/dojo/hashchange",z,function(){y(q,s,h,o);var C=x();z.loadResults(C);u.generateDomCommandsInBanner(o,
s,C,null,null,false,true)})})})});