}\r\n * @constant\r\n */\r\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\r\n\r\n/**\r\n * @name MarkerWithLabel for V3\r\n * @version 1.1.10 [April 8, 2014]\r\n * @author Gary Little (inspired by code from Marc Ridey of Google).\r\n * @copyright Copyright 2012 Gary Little [gary at luxcentral.com]\r\n * @fileoverview MarkerWithLabel extends the Google Maps JavaScript API V3\r\n * google.maps.Marker
class.\r\n * \r\n * MarkerWithLabel allows you to define markers with associated labels. As you would expect,\r\n * if the marker is draggable, so too will be the label. In addition, a marker with a label\r\n * responds to all mouse events in the same manner as a regular marker. It also fires mouse\r\n * events and \"property changed\" events just as a regular marker would. Version 1.1 adds\r\n * support for the raiseOnDrag feature introduced in API V3.3.\r\n *
\r\n * If you drag a marker by its label, you can cancel the drag and return the marker to its\r\n * original position by pressing the Esc
key. This doesn't work if you drag the marker\r\n * itself because this feature is not (yet) supported in the google.maps.Marker
class.\r\n */\r\n\r\n/*!\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*jslint browser:true */\r\n/*global document,google */\r\n\r\n/**\r\n * @param {Function} childCtor Child class.\r\n * @param {Function} parentCtor Parent class.\r\n * @private\r\n */\r\nfunction inherits(childCtor, parentCtor) {\r\n /* @constructor */\r\n function tempCtor() {}\r\n tempCtor.prototype = parentCtor.prototype;\r\n childCtor.superClass_ = parentCtor.prototype;\r\n childCtor.prototype = new tempCtor();\r\n /* @override */\r\n childCtor.prototype.constructor = childCtor;\r\n}\r\n\r\n/**\r\n * This constructor creates a label and associates it with a marker.\r\n * It is for the private use of the MarkerWithLabel class.\r\n * @constructor\r\n * @param {Marker} marker The marker with which the label is to be associated.\r\n * @param {string} crossURL The URL of the cross image =.\r\n * @param {string} handCursor The URL of the hand cursor.\r\n * @private\r\n */\r\nfunction MarkerLabel_(marker, crossURL, handCursorURL) {\r\n this.marker_ = marker;\r\n this.handCursorURL_ = marker.handCursorURL;\r\n\r\n this.labelDiv_ = document.createElement(\"div\");\r\n this.labelDiv_.style.cssText = \"position: absolute; overflow: hidden;\";\r\n\r\n // Set up the DIV for handling mouse events in the label. This DIV forms a transparent veil\r\n // in the \"overlayMouseTarget\" pane, a veil that covers just the label. This is done so that\r\n // events can be captured even if the label is in the shadow of a google.maps.InfoWindow.\r\n // Code is included here to ensure the veil is always exactly the same size as the label.\r\n this.eventDiv_ = document.createElement(\"div\");\r\n this.eventDiv_.style.cssText = this.labelDiv_.style.cssText;\r\n\r\n // This is needed for proper behavior on MSIE:\r\n this.eventDiv_.setAttribute(\"onselectstart\", \"return false;\");\r\n this.eventDiv_.setAttribute(\"ondragstart\", \"return false;\");\r\n\r\n // Get the DIV for the \"X\" to be displayed when the marker is raised.\r\n this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL);\r\n}\r\n\r\ninherits(MarkerLabel_, google.maps.OverlayView);\r\n\r\n/**\r\n * Returns the DIV for the cross used when dragging a marker when the\r\n * raiseOnDrag parameter set to true. One cross is shared with all markers.\r\n * @param {string} crossURL The URL of the cross image =.\r\n * @private\r\n */\r\nMarkerLabel_.getSharedCross = function (crossURL) {\r\n var div;\r\n if (typeof MarkerLabel_.getSharedCross.crossDiv === \"undefined\") {\r\n div = document.createElement(\"img\");\r\n div.style.cssText = \"position: absolute; z-index: 1000002; display: none;\";\r\n // Hopefully Google never changes the standard \"X\" attributes:\r\n div.style.marginLeft = \"-8px\";\r\n div.style.marginTop = \"-9px\";\r\n div.src = crossURL;\r\n MarkerLabel_.getSharedCross.crossDiv = div;\r\n }\r\n return MarkerLabel_.getSharedCross.crossDiv;\r\n};\r\n\r\n/**\r\n * Adds the DIV representing the label to the DOM. This method is called\r\n * automatically when the marker's setMap
method is called.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.onAdd = function () {\r\n var me = this;\r\n var cMouseIsDown = false;\r\n var cDraggingLabel = false;\r\n var cSavedZIndex;\r\n var cLatOffset, cLngOffset;\r\n var cIgnoreClick;\r\n var cRaiseEnabled;\r\n var cStartPosition;\r\n var cStartCenter;\r\n // Constants:\r\n var cRaiseOffset = 20;\r\n var cDraggingCursor = \"url(\" + this.handCursorURL_ + \")\";\r\n\r\n // Stops all processing of an event.\r\n //\r\n var cAbortEvent = function (e) {\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n }\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n };\r\n\r\n var cStopBounce = function () {\r\n me.marker_.setAnimation(null);\r\n };\r\n\r\n this.getPanes().overlayImage.appendChild(this.labelDiv_);\r\n this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_);\r\n // One cross is shared with all markers, so only add it once:\r\n if (typeof MarkerLabel_.getSharedCross.processed === \"undefined\") {\r\n this.getPanes().overlayImage.appendChild(this.crossDiv_);\r\n MarkerLabel_.getSharedCross.processed = true;\r\n }\r\n\r\n this.listeners_ = [\r\n google.maps.event.addDomListener(this.eventDiv_, \"mouseover\", function (e) {\r\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\r\n this.style.cursor = \"pointer\";\r\n google.maps.event.trigger(me.marker_, \"mouseover\", e);\r\n }\r\n }),\r\n google.maps.event.addDomListener(this.eventDiv_, \"mouseout\", function (e) {\r\n if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) {\r\n this.style.cursor = me.marker_.getCursor();\r\n google.maps.event.trigger(me.marker_, \"mouseout\", e);\r\n }\r\n }),\r\n google.maps.event.addDomListener(this.eventDiv_, \"mousedown\", function (e) {\r\n cDraggingLabel = false;\r\n if (me.marker_.getDraggable()) {\r\n cMouseIsDown = true;\r\n this.style.cursor = cDraggingCursor;\r\n }\r\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\r\n google.maps.event.trigger(me.marker_, \"mousedown\", e);\r\n cAbortEvent(e); // Prevent map pan when starting a drag on a label\r\n }\r\n }),\r\n google.maps.event.addDomListener(document, \"mouseup\", function (mEvent) {\r\n var position;\r\n if (cMouseIsDown) {\r\n cMouseIsDown = false;\r\n me.eventDiv_.style.cursor = \"pointer\";\r\n google.maps.event.trigger(me.marker_, \"mouseup\", mEvent);\r\n }\r\n if (cDraggingLabel) {\r\n if (cRaiseEnabled) { // Lower the marker & label\r\n position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition());\r\n position.y += cRaiseOffset;\r\n me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));\r\n // This is not the same bouncing style as when the marker portion is dragged,\r\n // but it will have to do:\r\n try { // Will fail if running Google Maps API earlier than V3.3\r\n me.marker_.setAnimation(google.maps.Animation.BOUNCE);\r\n setTimeout(cStopBounce, 1406);\r\n } catch (e) {}\r\n }\r\n me.crossDiv_.style.display = \"none\";\r\n me.marker_.setZIndex(cSavedZIndex);\r\n cIgnoreClick = true; // Set flag to ignore the click event reported after a label drag\r\n cDraggingLabel = false;\r\n mEvent.latLng = me.marker_.getPosition();\r\n google.maps.event.trigger(me.marker_, \"dragend\", mEvent);\r\n }\r\n }),\r\n google.maps.event.addListener(me.marker_.getMap(), \"mousemove\", function (mEvent) {\r\n var position;\r\n if (cMouseIsDown) {\r\n if (cDraggingLabel) {\r\n // Change the reported location from the mouse position to the marker position:\r\n mEvent.latLng = new google.maps.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset);\r\n position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng);\r\n if (cRaiseEnabled) {\r\n me.crossDiv_.style.left = position.x + \"px\";\r\n me.crossDiv_.style.top = position.y + \"px\";\r\n me.crossDiv_.style.display = \"\";\r\n position.y -= cRaiseOffset;\r\n }\r\n me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));\r\n if (cRaiseEnabled) { // Don't raise the veil; this hack needed to make MSIE act properly\r\n me.eventDiv_.style.top = (position.y + cRaiseOffset) + \"px\";\r\n }\r\n google.maps.event.trigger(me.marker_, \"drag\", mEvent);\r\n } else {\r\n // Calculate offsets from the click point to the marker position:\r\n cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat();\r\n cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng();\r\n cSavedZIndex = me.marker_.getZIndex();\r\n cStartPosition = me.marker_.getPosition();\r\n cStartCenter = me.marker_.getMap().getCenter();\r\n cRaiseEnabled = me.marker_.get(\"raiseOnDrag\");\r\n cDraggingLabel = true;\r\n me.marker_.setZIndex(1000000); // Moves the marker & label to the foreground during a drag\r\n mEvent.latLng = me.marker_.getPosition();\r\n google.maps.event.trigger(me.marker_, \"dragstart\", mEvent);\r\n }\r\n }\r\n }),\r\n google.maps.event.addDomListener(document, \"keydown\", function (e) {\r\n if (cDraggingLabel) {\r\n if (e.keyCode === 27) { // Esc key\r\n cRaiseEnabled = false;\r\n me.marker_.setPosition(cStartPosition);\r\n me.marker_.getMap().setCenter(cStartCenter);\r\n google.maps.event.trigger(document, \"mouseup\", e);\r\n }\r\n }\r\n }),\r\n google.maps.event.addDomListener(this.eventDiv_, \"click\", function (e) {\r\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\r\n if (cIgnoreClick) { // Ignore the click reported when a label drag ends\r\n cIgnoreClick = false;\r\n } else {\r\n google.maps.event.trigger(me.marker_, \"click\", e);\r\n cAbortEvent(e); // Prevent click from being passed on to map\r\n }\r\n }\r\n }),\r\n google.maps.event.addDomListener(this.eventDiv_, \"dblclick\", function (e) {\r\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\r\n google.maps.event.trigger(me.marker_, \"dblclick\", e);\r\n cAbortEvent(e); // Prevent map zoom when double-clicking on a label\r\n }\r\n }),\r\n google.maps.event.addListener(this.marker_, \"dragstart\", function (mEvent) {\r\n if (!cDraggingLabel) {\r\n cRaiseEnabled = this.get(\"raiseOnDrag\");\r\n }\r\n }),\r\n google.maps.event.addListener(this.marker_, \"drag\", function (mEvent) {\r\n if (!cDraggingLabel) {\r\n if (cRaiseEnabled) {\r\n me.setPosition(cRaiseOffset);\r\n // During a drag, the marker's z-index is temporarily set to 1000000 to\r\n // ensure it appears above all other markers. Also set the label's z-index\r\n // to 1000000 (plus or minus 1 depending on whether the label is supposed\r\n // to be above or below the marker).\r\n me.labelDiv_.style.zIndex = 1000000 + (this.get(\"labelInBackground\") ? -1 : +1);\r\n }\r\n }\r\n }),\r\n google.maps.event.addListener(this.marker_, \"dragend\", function (mEvent) {\r\n if (!cDraggingLabel) {\r\n if (cRaiseEnabled) {\r\n me.setPosition(0); // Also restores z-index of label\r\n }\r\n }\r\n }),\r\n google.maps.event.addListener(this.marker_, \"position_changed\", function () {\r\n me.setPosition();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"zindex_changed\", function () {\r\n me.setZIndex();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"visible_changed\", function () {\r\n me.setVisible();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"labelvisible_changed\", function () {\r\n me.setVisible();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"title_changed\", function () {\r\n me.setTitle();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"labelcontent_changed\", function () {\r\n me.setContent();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"labelanchor_changed\", function () {\r\n me.setAnchor();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"labelclass_changed\", function () {\r\n me.setStyles();\r\n }),\r\n google.maps.event.addListener(this.marker_, \"labelstyle_changed\", function () {\r\n me.setStyles();\r\n })\r\n ];\r\n};\r\n\r\n/**\r\n * Removes the DIV for the label from the DOM. It also removes all event handlers.\r\n * This method is called automatically when the marker's setMap(null)
\r\n * method is called.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.onRemove = function () {\r\n var i;\r\n if (this.labelDiv_.parentNode) {\r\n this.labelDiv_.parentNode.removeChild(this.labelDiv_);\r\n }\r\n if (this.eventDiv_.parentNode) {\r\n this.eventDiv_.parentNode.removeChild(this.eventDiv_);\r\n }\r\n\r\n // Remove event listeners:\r\n if (this.listeners_) {\r\n for (i = 0; i < this.listeners_.length; i++) {\r\n google.maps.event.removeListener(this.listeners_[i]);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Draws the label on the map.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.draw = function () {\r\n this.setContent();\r\n this.setTitle();\r\n this.setStyles();\r\n};\r\n\r\n/**\r\n * Sets the content of the label.\r\n * The content can be plain text or an HTML DOM node.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setContent = function () {\r\n var content = this.marker_.get(\"labelContent\");\r\n if (typeof content.nodeType === \"undefined\") {\r\n this.labelDiv_.innerHTML = content;\r\n this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;\r\n } else {\r\n this.labelDiv_.innerHTML = \"\"; // Remove current content\r\n this.labelDiv_.appendChild(content);\r\n content = content.cloneNode(true);\r\n this.eventDiv_.innerHTML = \"\"; // Remove current content\r\n this.eventDiv_.appendChild(content);\r\n }\r\n};\r\n\r\n/**\r\n * Sets the content of the tool tip for the label. It is\r\n * always set to be the same as for the marker itself.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setTitle = function () {\r\n this.eventDiv_.title = this.marker_.getTitle() || \"\";\r\n};\r\n\r\n/**\r\n * Sets the style of the label by setting the style sheet and applying\r\n * other specific styles requested.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setStyles = function () {\r\n var i, labelStyle;\r\n\r\n // Apply style values from the style sheet defined in the labelClass parameter:\r\n this.labelDiv_.className = this.marker_.get(\"labelClass\");\r\n this.eventDiv_.className = this.labelDiv_.className;\r\n\r\n // Clear existing inline style values:\r\n this.labelDiv_.style.cssText = \"\";\r\n this.eventDiv_.style.cssText = \"\";\r\n // Apply style values defined in the labelStyle parameter:\r\n labelStyle = this.marker_.get(\"labelStyle\");\r\n for (i in labelStyle) {\r\n if (labelStyle.hasOwnProperty(i)) {\r\n this.labelDiv_.style[i] = labelStyle[i];\r\n this.eventDiv_.style[i] = labelStyle[i];\r\n }\r\n }\r\n this.setMandatoryStyles();\r\n};\r\n\r\n/**\r\n * Sets the mandatory styles to the DIV representing the label as well as to the\r\n * associated event DIV. This includes setting the DIV position, z-index, and visibility.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setMandatoryStyles = function () {\r\n this.labelDiv_.style.position = \"absolute\";\r\n this.labelDiv_.style.overflow = \"hidden\";\r\n // Make sure the opacity setting causes the desired effect on MSIE:\r\n if (typeof this.labelDiv_.style.opacity !== \"undefined\" && this.labelDiv_.style.opacity !== \"\") {\r\n this.labelDiv_.style.MsFilter = \"\\\"progid:DXImageTransform.Microsoft.Alpha(opacity=\" + (this.labelDiv_.style.opacity * 100) + \")\\\"\";\r\n this.labelDiv_.style.filter = \"alpha(opacity=\" + (this.labelDiv_.style.opacity * 100) + \")\";\r\n }\r\n\r\n this.eventDiv_.style.position = this.labelDiv_.style.position;\r\n this.eventDiv_.style.overflow = this.labelDiv_.style.overflow;\r\n this.eventDiv_.style.opacity = 0.01; // Don't use 0; DIV won't be clickable on MSIE\r\n this.eventDiv_.style.MsFilter = \"\\\"progid:DXImageTransform.Microsoft.Alpha(opacity=1)\\\"\";\r\n this.eventDiv_.style.filter = \"alpha(opacity=1)\"; // For MSIE\r\n\r\n this.setAnchor();\r\n this.setPosition(); // This also updates z-index, if necessary.\r\n this.setVisible();\r\n};\r\n\r\n/**\r\n * Sets the anchor point of the label.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setAnchor = function () {\r\n var anchor = this.marker_.get(\"labelAnchor\");\r\n this.labelDiv_.style.marginLeft = -anchor.x + \"px\";\r\n this.labelDiv_.style.marginTop = -anchor.y + \"px\";\r\n this.eventDiv_.style.marginLeft = -anchor.x + \"px\";\r\n this.eventDiv_.style.marginTop = -anchor.y + \"px\";\r\n};\r\n\r\n/**\r\n * Sets the position of the label. The z-index is also updated, if necessary.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setPosition = function (yOffset) {\r\n var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());\r\n if (typeof yOffset === \"undefined\") {\r\n yOffset = 0;\r\n }\r\n this.labelDiv_.style.left = Math.round(position.x) + \"px\";\r\n this.labelDiv_.style.top = Math.round(position.y - yOffset) + \"px\";\r\n this.eventDiv_.style.left = this.labelDiv_.style.left;\r\n this.eventDiv_.style.top = this.labelDiv_.style.top;\r\n\r\n this.setZIndex();\r\n};\r\n\r\n/**\r\n * Sets the z-index of the label. If the marker's z-index property has not been defined, the z-index\r\n * of the label is set to the vertical coordinate of the label. This is in keeping with the default\r\n * stacking order for Google Maps: markers to the south are in front of markers to the north.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setZIndex = function () {\r\n var zAdjust = (this.marker_.get(\"labelInBackground\") ? -1 : +1);\r\n if (typeof this.marker_.getZIndex() === \"undefined\") {\r\n this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust;\r\n this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;\r\n } else {\r\n this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust;\r\n this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;\r\n }\r\n};\r\n\r\n/**\r\n * Sets the visibility of the label. The label is visible only if the marker itself is\r\n * visible (i.e., its visible property is true) and the labelVisible property is true.\r\n * @private\r\n */\r\nMarkerLabel_.prototype.setVisible = function () {\r\n if (this.marker_.get(\"labelVisible\")) {\r\n this.labelDiv_.style.display = this.marker_.getVisible() ? \"block\" : \"none\";\r\n } else {\r\n this.labelDiv_.style.display = \"none\";\r\n }\r\n this.eventDiv_.style.display = this.labelDiv_.style.display;\r\n};\r\n\r\n/**\r\n * @name MarkerWithLabelOptions\r\n * @class This class represents the optional parameter passed to the {@link MarkerWithLabel} constructor.\r\n * The properties available are the same as for google.maps.Marker
with the addition\r\n * of the properties listed below. To change any of these additional properties after the labeled\r\n * marker has been created, call google.maps.Marker.set(propertyName, propertyValue)
.\r\n *
\r\n * When any of these properties changes, a property changed event is fired. The names of these\r\n * events are derived from the name of the property and are of the form propertyname_changed
.\r\n * For example, if the content of the label changes, a labelcontent_changed
event\r\n * is fired.\r\n *
\r\n * @property {string|Node} [labelContent] The content of the label (plain text or an HTML DOM node).\r\n * @property {Point} [labelAnchor] By default, a label is drawn with its anchor point at (0,0) so\r\n * that its top left corner is positioned at the anchor point of the associated marker. Use this\r\n * property to change the anchor point of the label. For example, to center a 50px-wide label\r\n * beneath a marker, specify a labelAnchor
of google.maps.Point(25, 0)
.\r\n * (Note: x-values increase to the right and y-values increase to the top.)\r\n * @property {string} [labelClass] The name of the CSS class defining the styles for the label.\r\n * Note that style values for position
, overflow
, top
,\r\n * left
, zIndex
, display
, marginLeft
, and\r\n * marginTop
are ignored; these styles are for internal use only.\r\n * @property {Object} [labelStyle] An object literal whose properties define specific CSS\r\n * style values to be applied to the label. Style values defined here override those that may\r\n * be defined in the labelClass
style sheet. If this property is changed after the\r\n * label has been created, all previously set styles (except those defined in the style sheet)\r\n * are removed from the label before the new style values are applied.\r\n * Note that style values for position
, overflow
, top
,\r\n * left
, zIndex
, display
, marginLeft
, and\r\n * marginTop
are ignored; these styles are for internal use only.\r\n * @property {boolean} [labelInBackground] A flag indicating whether a label that overlaps its\r\n * associated marker should appear in the background (i.e., in a plane below the marker).\r\n * The default is false
, which causes the label to appear in the foreground.\r\n * @property {boolean} [labelVisible] A flag indicating whether the label is to be visible.\r\n * The default is true
. Note that even if labelVisible
is\r\n * true
, the label will not be visible unless the associated marker is also\r\n * visible (i.e., unless the marker's visible
property is true
).\r\n * @property {boolean} [raiseOnDrag] A flag indicating whether the label and marker are to be\r\n * raised when the marker is dragged. The default is true
. If a draggable marker is\r\n * being created and a version of Google Maps API earlier than V3.3 is being used, this property\r\n * must be set to false
.\r\n * @property {boolean} [optimized] A flag indicating whether rendering is to be optimized for the\r\n * marker. Important: The optimized rendering technique is not supported by MarkerWithLabel,\r\n * so the value of this parameter is always forced to false
.\r\n * @property {string} [crossImage=\"http://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png\"]\r\n * The URL of the cross image to be displayed while dragging a marker.\r\n * @property {string} [handCursor=\"http://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur\"]\r\n * The URL of the cursor to be displayed while dragging a marker.\r\n */\r\n/**\r\n * Creates a MarkerWithLabel with the options specified in {@link MarkerWithLabelOptions}.\r\n * @constructor\r\n * @param {MarkerWithLabelOptions} [opt_options] The optional parameters.\r\n */\r\nfunction MarkerWithLabel(opt_options) {\r\n opt_options = opt_options || {};\r\n opt_options.labelContent = opt_options.labelContent || \"\";\r\n opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0);\r\n opt_options.labelClass = opt_options.labelClass || \"markerLabels\";\r\n opt_options.labelStyle = opt_options.labelStyle || {};\r\n opt_options.labelInBackground = opt_options.labelInBackground || false;\r\n if (typeof opt_options.labelVisible === \"undefined\") {\r\n opt_options.labelVisible = true;\r\n }\r\n if (typeof opt_options.raiseOnDrag === \"undefined\") {\r\n opt_options.raiseOnDrag = true;\r\n }\r\n if (typeof opt_options.clickable === \"undefined\") {\r\n opt_options.clickable = true;\r\n }\r\n if (typeof opt_options.draggable === \"undefined\") {\r\n opt_options.draggable = false;\r\n }\r\n if (typeof opt_options.optimized === \"undefined\") {\r\n opt_options.optimized = false;\r\n }\r\n opt_options.crossImage = opt_options.crossImage || \"http\" + (document.location.protocol === \"https:\" ? \"s\" : \"\") + \"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png\";\r\n opt_options.handCursor = opt_options.handCursor || \"http\" + (document.location.protocol === \"https:\" ? \"s\" : \"\") + \"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur\";\r\n opt_options.optimized = false; // Optimized rendering is not supported\r\n\r\n this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker\r\n\r\n // Call the parent constructor. It calls Marker.setValues to initialize, so all\r\n // the new parameters are conveniently saved and can be accessed with get/set.\r\n // Marker.set triggers a property changed event (called \"propertyname_changed\")\r\n // that the marker label listens for in order to react to state changes.\r\n google.maps.Marker.apply(this, arguments);\r\n}\r\n\r\ninherits(MarkerWithLabel, google.maps.Marker);\r\n\r\n/**\r\n * Overrides the standard Marker setMap function.\r\n * @param {Map} theMap The map to which the marker is to be added.\r\n * @private\r\n */\r\nMarkerWithLabel.prototype.setMap = function (theMap) {\r\n\r\n // Call the inherited function...\r\n google.maps.Marker.prototype.setMap.apply(this, arguments);\r\n\r\n // ... then deal with the label:\r\n this.label.setMap(theMap);\r\n};\r\n\r\n //END REPLACE\r\n window.InfoBox = InfoBox;\r\n window.Cluster = Cluster;\r\n window.ClusterIcon = ClusterIcon;\r\n window.MarkerClusterer = MarkerClusterer;\r\n window.MarkerLabel_ = MarkerLabel_;\r\n window.MarkerWithLabel = MarkerWithLabel;\r\n })\r\n };\r\n});\r\n;/******/ (function(modules) { // webpackBootstrap\r\n/******/ \t// The module cache\r\n/******/ \tvar installedModules = {};\r\n\r\n/******/ \t// The require function\r\n/******/ \tfunction __webpack_require__(moduleId) {\r\n\r\n/******/ \t\t// Check if module is in cache\r\n/******/ \t\tif(installedModules[moduleId])\r\n/******/ \t\t\treturn installedModules[moduleId].exports;\r\n\r\n/******/ \t\t// Create a new module (and put it into the cache)\r\n/******/ \t\tvar module = installedModules[moduleId] = {\r\n/******/ \t\t\texports: {},\r\n/******/ \t\t\tid: moduleId,\r\n/******/ \t\t\tloaded: false\r\n/******/ \t\t};\r\n\r\n/******/ \t\t// Execute the module function\r\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\r\n\r\n/******/ \t\t// Flag the module as loaded\r\n/******/ \t\tmodule.loaded = true;\r\n\r\n/******/ \t\t// Return the exports of the module\r\n/******/ \t\treturn module.exports;\r\n/******/ \t}\r\n\r\n\r\n/******/ \t// expose the modules object (__webpack_modules__)\r\n/******/ \t__webpack_require__.m = modules;\r\n\r\n/******/ \t// expose the module cache\r\n/******/ \t__webpack_require__.c = installedModules;\r\n\r\n/******/ \t// __webpack_public_path__\r\n/******/ \t__webpack_require__.p = \"\";\r\n\r\n/******/ \t// Load entry module and return exports\r\n/******/ \treturn __webpack_require__(0);\r\n/******/ })\r\n/************************************************************************/\r\n/******/ ([\r\n/* 0 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\tangular.module('uiGmapgoogle-maps.wrapped')\r\n\t.service('uiGmapDataStructures', function() {\r\n\treturn {\r\n\t Graph: __webpack_require__(1).Graph,\r\n\t Queue: __webpack_require__(1).Queue\r\n\t};\r\n\t});\r\n\r\n\r\n/***/ },\r\n/* 1 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t(function() {\r\n\t module.exports = {\r\n\t Graph: __webpack_require__(2),\r\n\t Heap: __webpack_require__(3),\r\n\t LinkedList: __webpack_require__(4),\r\n\t Map: __webpack_require__(5),\r\n\t Queue: __webpack_require__(6),\r\n\t RedBlackTree: __webpack_require__(7),\r\n\t Trie: __webpack_require__(8)\r\n\t };\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 2 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tGraph implemented as a modified incidence list. O(1) for every typical\r\n\toperation except `removeNode()` at O(E) where E is the number of edges.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar graph = new Graph;\r\n\tgraph.addNode('A'); // => a node object. For more info, log the output or check\r\n\t // the documentation for addNode\r\n\tgraph.addNode('B');\r\n\tgraph.addNode('C');\r\n\tgraph.addEdge('A', 'C'); // => an edge object\r\n\tgraph.addEdge('A', 'B');\r\n\tgraph.getEdge('B', 'A'); // => undefined. Directed edge!\r\n\tgraph.getEdge('A', 'B'); // => the edge object previously added\r\n\tgraph.getEdge('A', 'B').weight = 2 // weight is the only built-in handy property\r\n\t // of an edge object. Feel free to attach\r\n\t // other properties\r\n\tgraph.getInEdgesOf('B'); // => array of edge objects, in this case only one;\r\n\t // connecting A to B\r\n\tgraph.getOutEdgesOf('A'); // => array of edge objects, one to B and one to C\r\n\tgraph.getAllEdgesOf('A'); // => all the in and out edges. Edge directed toward\r\n\t // the node itself are only counted once\r\n\tforEachNode(function(nodeObject) {\r\n\t console.log(node);\r\n\t});\r\n\tforEachEdge(function(edgeObject) {\r\n\t console.log(edgeObject);\r\n\t});\r\n\tgraph.removeNode('C'); // => 'C'. The edge between A and C also removed\r\n\tgraph.removeEdge('A', 'B'); // => the edge object removed\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- nodeSize: total number of nodes.\r\n\t- edgeSize: total number of edges.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var Graph,\r\n\t __hasProp = {}.hasOwnProperty;\r\n\r\n\t Graph = (function() {\r\n\t function Graph() {\r\n\t this._nodes = {};\r\n\t this.nodeSize = 0;\r\n\t this.edgeSize = 0;\r\n\t }\r\n\r\n\t Graph.prototype.addNode = function(id) {\r\n\t /*\r\n\t The `id` is a unique identifier for the node, and should **not** change\r\n\t after it's added. It will be used for adding, retrieving and deleting\r\n\t related edges too.\r\n\t \r\n\t **Note** that, internally, the ids are kept in an object. JavaScript's\r\n\t object hashes the id `'2'` and `2` to the same key, so please stick to a\r\n\t simple id data type such as number or string.\r\n\t \r\n\t _Returns:_ the node object. Feel free to attach additional custom properties\r\n\t on it for graph algorithms' needs. **Undefined if node id already exists**,\r\n\t as to avoid accidental overrides.\r\n\t */\r\n\r\n\t if (!this._nodes[id]) {\r\n\t this.nodeSize++;\r\n\t return this._nodes[id] = {\r\n\t _outEdges: {},\r\n\t _inEdges: {}\r\n\t };\r\n\t }\r\n\t };\r\n\r\n\t Graph.prototype.getNode = function(id) {\r\n\t /*\r\n\t _Returns:_ the node object. Feel free to attach additional custom properties\r\n\t on it for graph algorithms' needs.\r\n\t */\r\n\r\n\t return this._nodes[id];\r\n\t };\r\n\r\n\t Graph.prototype.removeNode = function(id) {\r\n\t /*\r\n\t _Returns:_ the node object removed, or undefined if it didn't exist in the\r\n\t first place.\r\n\t */\r\n\r\n\t var inEdgeId, nodeToRemove, outEdgeId, _ref, _ref1;\r\n\t nodeToRemove = this._nodes[id];\r\n\t if (!nodeToRemove) {\r\n\t return;\r\n\t } else {\r\n\t _ref = nodeToRemove._outEdges;\r\n\t for (outEdgeId in _ref) {\r\n\t if (!__hasProp.call(_ref, outEdgeId)) continue;\r\n\t this.removeEdge(id, outEdgeId);\r\n\t }\r\n\t _ref1 = nodeToRemove._inEdges;\r\n\t for (inEdgeId in _ref1) {\r\n\t if (!__hasProp.call(_ref1, inEdgeId)) continue;\r\n\t this.removeEdge(inEdgeId, id);\r\n\t }\r\n\t this.nodeSize--;\r\n\t delete this._nodes[id];\r\n\t }\r\n\t return nodeToRemove;\r\n\t };\r\n\r\n\t Graph.prototype.addEdge = function(fromId, toId, weight) {\r\n\t var edgeToAdd, fromNode, toNode;\r\n\t if (weight == null) {\r\n\t weight = 1;\r\n\t }\r\n\t /*\r\n\t `fromId` and `toId` are the node id specified when it was created using\r\n\t `addNode()`. `weight` is optional and defaults to 1. Ignoring it effectively\r\n\t makes this an unweighted graph. Under the hood, `weight` is just a normal\r\n\t property of the edge object.\r\n\t \r\n\t _Returns:_ the edge object created. Feel free to attach additional custom\r\n\t properties on it for graph algorithms' needs. **Or undefined** if the nodes\r\n\t of id `fromId` or `toId` aren't found, or if an edge already exists between\r\n\t the two nodes.\r\n\t */\r\n\r\n\t if (this.getEdge(fromId, toId)) {\r\n\t return;\r\n\t }\r\n\t fromNode = this._nodes[fromId];\r\n\t toNode = this._nodes[toId];\r\n\t if (!fromNode || !toNode) {\r\n\t return;\r\n\t }\r\n\t edgeToAdd = {\r\n\t weight: weight\r\n\t };\r\n\t fromNode._outEdges[toId] = edgeToAdd;\r\n\t toNode._inEdges[fromId] = edgeToAdd;\r\n\t this.edgeSize++;\r\n\t return edgeToAdd;\r\n\t };\r\n\r\n\t Graph.prototype.getEdge = function(fromId, toId) {\r\n\t /*\r\n\t _Returns:_ the edge object, or undefined if the nodes of id `fromId` or\r\n\t `toId` aren't found.\r\n\t */\r\n\r\n\t var fromNode, toNode;\r\n\t fromNode = this._nodes[fromId];\r\n\t toNode = this._nodes[toId];\r\n\t if (!fromNode || !toNode) {\r\n\r\n\t } else {\r\n\t return fromNode._outEdges[toId];\r\n\t }\r\n\t };\r\n\r\n\t Graph.prototype.removeEdge = function(fromId, toId) {\r\n\t /*\r\n\t _Returns:_ the edge object removed, or undefined of edge wasn't found.\r\n\t */\r\n\r\n\t var edgeToDelete, fromNode, toNode;\r\n\t fromNode = this._nodes[fromId];\r\n\t toNode = this._nodes[toId];\r\n\t edgeToDelete = this.getEdge(fromId, toId);\r\n\t if (!edgeToDelete) {\r\n\t return;\r\n\t }\r\n\t delete fromNode._outEdges[toId];\r\n\t delete toNode._inEdges[fromId];\r\n\t this.edgeSize--;\r\n\t return edgeToDelete;\r\n\t };\r\n\r\n\t Graph.prototype.getInEdgesOf = function(nodeId) {\r\n\t /*\r\n\t _Returns:_ an array of edge objects that are directed toward the node, or\r\n\t empty array if no such edge or node exists.\r\n\t */\r\n\r\n\t var fromId, inEdges, toNode, _ref;\r\n\t toNode = this._nodes[nodeId];\r\n\t inEdges = [];\r\n\t _ref = toNode != null ? toNode._inEdges : void 0;\r\n\t for (fromId in _ref) {\r\n\t if (!__hasProp.call(_ref, fromId)) continue;\r\n\t inEdges.push(this.getEdge(fromId, nodeId));\r\n\t }\r\n\t return inEdges;\r\n\t };\r\n\r\n\t Graph.prototype.getOutEdgesOf = function(nodeId) {\r\n\t /*\r\n\t _Returns:_ an array of edge objects that go out of the node, or empty array\r\n\t if no such edge or node exists.\r\n\t */\r\n\r\n\t var fromNode, outEdges, toId, _ref;\r\n\t fromNode = this._nodes[nodeId];\r\n\t outEdges = [];\r\n\t _ref = fromNode != null ? fromNode._outEdges : void 0;\r\n\t for (toId in _ref) {\r\n\t if (!__hasProp.call(_ref, toId)) continue;\r\n\t outEdges.push(this.getEdge(nodeId, toId));\r\n\t }\r\n\t return outEdges;\r\n\t };\r\n\r\n\t Graph.prototype.getAllEdgesOf = function(nodeId) {\r\n\t /*\r\n\t **Note:** not the same as concatenating `getInEdgesOf()` and\r\n\t `getOutEdgesOf()`. Some nodes might have an edge pointing toward itself.\r\n\t This method solves that duplication.\r\n\t \r\n\t _Returns:_ an array of edge objects linked to the node, no matter if they're\r\n\t outgoing or coming. Duplicate edge created by self-pointing nodes are\r\n\t removed. Only one copy stays. Empty array if node has no edge.\r\n\t */\r\n\r\n\t var i, inEdges, outEdges, selfEdge, _i, _ref, _ref1;\r\n\t inEdges = this.getInEdgesOf(nodeId);\r\n\t outEdges = this.getOutEdgesOf(nodeId);\r\n\t if (inEdges.length === 0) {\r\n\t return outEdges;\r\n\t }\r\n\t selfEdge = this.getEdge(nodeId, nodeId);\r\n\t for (i = _i = 0, _ref = inEdges.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\r\n\t if (inEdges[i] === selfEdge) {\r\n\t _ref1 = [inEdges[inEdges.length - 1], inEdges[i]], inEdges[i] = _ref1[0], inEdges[inEdges.length - 1] = _ref1[1];\r\n\t inEdges.pop();\r\n\t break;\r\n\t }\r\n\t }\r\n\t return inEdges.concat(outEdges);\r\n\t };\r\n\r\n\t Graph.prototype.forEachNode = function(operation) {\r\n\t /*\r\n\t Traverse through the graph in an arbitrary manner, visiting each node once.\r\n\t Pass a function of the form `fn(nodeObject, nodeId)`.\r\n\t \r\n\t _Returns:_ undefined.\r\n\t */\r\n\r\n\t var nodeId, nodeObject, _ref;\r\n\t _ref = this._nodes;\r\n\t for (nodeId in _ref) {\r\n\t if (!__hasProp.call(_ref, nodeId)) continue;\r\n\t nodeObject = _ref[nodeId];\r\n\t operation(nodeObject, nodeId);\r\n\t }\r\n\t };\r\n\r\n\t Graph.prototype.forEachEdge = function(operation) {\r\n\t /*\r\n\t Traverse through the graph in an arbitrary manner, visiting each edge once.\r\n\t Pass a function of the form `fn(edgeObject)`.\r\n\t \r\n\t _Returns:_ undefined.\r\n\t */\r\n\r\n\t var edgeObject, nodeId, nodeObject, toId, _ref, _ref1;\r\n\t _ref = this._nodes;\r\n\t for (nodeId in _ref) {\r\n\t if (!__hasProp.call(_ref, nodeId)) continue;\r\n\t nodeObject = _ref[nodeId];\r\n\t _ref1 = nodeObject._outEdges;\r\n\t for (toId in _ref1) {\r\n\t if (!__hasProp.call(_ref1, toId)) continue;\r\n\t edgeObject = _ref1[toId];\r\n\t operation(edgeObject);\r\n\t }\r\n\t }\r\n\t };\r\n\r\n\t return Graph;\r\n\r\n\t })();\r\n\r\n\t module.exports = Graph;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 3 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tMinimum heap, i.e. smallest node at root.\r\n\r\n\t**Note:** does not accept null or undefined. This is by design. Those values\r\n\tcause comparison problems and might report false negative during extraction.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar heap = new Heap([5, 6, 3, 4]);\r\n\theap.add(10); // => 10\r\n\theap.removeMin(); // => 3\r\n\theap.peekMin(); // => 4\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- size: total number of items.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var Heap, _leftChild, _parent, _rightChild;\r\n\r\n\t Heap = (function() {\r\n\t function Heap(dataToHeapify) {\r\n\t var i, item, _i, _j, _len, _ref;\r\n\t if (dataToHeapify == null) {\r\n\t dataToHeapify = [];\r\n\t }\r\n\t /*\r\n\t Pass an optional array to be heapified. Takes only O(n) time.\r\n\t */\r\n\r\n\t this._data = [void 0];\r\n\t for (_i = 0, _len = dataToHeapify.length; _i < _len; _i++) {\r\n\t item = dataToHeapify[_i];\r\n\t if (item != null) {\r\n\t this._data.push(item);\r\n\t }\r\n\t }\r\n\t if (this._data.length > 1) {\r\n\t for (i = _j = 2, _ref = this._data.length; 2 <= _ref ? _j < _ref : _j > _ref; i = 2 <= _ref ? ++_j : --_j) {\r\n\t this._upHeap(i);\r\n\t }\r\n\t }\r\n\t this.size = this._data.length - 1;\r\n\t }\r\n\r\n\t Heap.prototype.add = function(value) {\r\n\t /*\r\n\t **Remember:** rejects null and undefined for mentioned reasons.\r\n\t \r\n\t _Returns:_ the value added.\r\n\t */\r\n\r\n\t if (value == null) {\r\n\t return;\r\n\t }\r\n\t this._data.push(value);\r\n\t this._upHeap(this._data.length - 1);\r\n\t this.size++;\r\n\t return value;\r\n\t };\r\n\r\n\t Heap.prototype.removeMin = function() {\r\n\t /*\r\n\t _Returns:_ the smallest item (the root).\r\n\t */\r\n\r\n\t var min;\r\n\t if (this._data.length === 1) {\r\n\t return;\r\n\t }\r\n\t this.size--;\r\n\t if (this._data.length === 2) {\r\n\t return this._data.pop();\r\n\t }\r\n\t min = this._data[1];\r\n\t this._data[1] = this._data.pop();\r\n\t this._downHeap();\r\n\t return min;\r\n\t };\r\n\r\n\t Heap.prototype.peekMin = function() {\r\n\t /*\r\n\t Check the smallest item without removing it.\r\n\t \r\n\t _Returns:_ the smallest item (the root).\r\n\t */\r\n\r\n\t return this._data[1];\r\n\t };\r\n\r\n\t Heap.prototype._upHeap = function(index) {\r\n\t var valueHolder, _ref;\r\n\t valueHolder = this._data[index];\r\n\t while (this._data[index] < this._data[_parent(index)] && index > 1) {\r\n\t _ref = [this._data[_parent(index)], this._data[index]], this._data[index] = _ref[0], this._data[_parent(index)] = _ref[1];\r\n\t index = _parent(index);\r\n\t }\r\n\t };\r\n\r\n\t Heap.prototype._downHeap = function() {\r\n\t var currentIndex, smallerChildIndex, _ref;\r\n\t currentIndex = 1;\r\n\t while (_leftChild(currentIndex < this._data.length)) {\r\n\t smallerChildIndex = _leftChild(currentIndex);\r\n\t if (smallerChildIndex < this._data.length - 1) {\r\n\t if (this._data[_rightChild(currentIndex)] < this._data[smallerChildIndex]) {\r\n\t smallerChildIndex = _rightChild(currentIndex);\r\n\t }\r\n\t }\r\n\t if (this._data[smallerChildIndex] < this._data[currentIndex]) {\r\n\t _ref = [this._data[currentIndex], this._data[smallerChildIndex]], this._data[smallerChildIndex] = _ref[0], this._data[currentIndex] = _ref[1];\r\n\t currentIndex = smallerChildIndex;\r\n\t } else {\r\n\t break;\r\n\t }\r\n\t }\r\n\t };\r\n\r\n\t return Heap;\r\n\r\n\t })();\r\n\r\n\t _parent = function(index) {\r\n\t return index >> 1;\r\n\t };\r\n\r\n\t _leftChild = function(index) {\r\n\t return index << 1;\r\n\t };\r\n\r\n\t _rightChild = function(index) {\r\n\t return (index << 1) + 1;\r\n\t };\r\n\r\n\t module.exports = Heap;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 4 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tDoubly Linked.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar list = new LinkedList([5, 4, 9]);\r\n\tlist.add(12); // => 12\r\n\tlist.head.next.value; // => 4\r\n\tlist.tail.value; // => 12\r\n\tlist.at(-1); // => 12\r\n\tlist.removeAt(2); // => 9\r\n\tlist.remove(4); // => 4\r\n\tlist.indexOf(5); // => 0\r\n\tlist.add(5, 1); // => 5. Second 5 at position 1.\r\n\tlist.indexOf(5, 1); // => 1\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- head: first item.\r\n\t- tail: last item.\r\n\t- size: total number of items.\r\n\t- item.value: value passed to the item when calling `add()`.\r\n\t- item.prev: previous item.\r\n\t- item.next: next item.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var LinkedList;\r\n\r\n\t LinkedList = (function() {\r\n\t function LinkedList(valuesToAdd) {\r\n\t var value, _i, _len;\r\n\t if (valuesToAdd == null) {\r\n\t valuesToAdd = [];\r\n\t }\r\n\t /*\r\n\t Can pass an array of elements to link together during `new LinkedList()`\r\n\t initiation.\r\n\t */\r\n\r\n\t this.head = {\r\n\t prev: void 0,\r\n\t value: void 0,\r\n\t next: void 0\r\n\t };\r\n\t this.tail = {\r\n\t prev: void 0,\r\n\t value: void 0,\r\n\t next: void 0\r\n\t };\r\n\t this.size = 0;\r\n\t for (_i = 0, _len = valuesToAdd.length; _i < _len; _i++) {\r\n\t value = valuesToAdd[_i];\r\n\t this.add(value);\r\n\t }\r\n\t }\r\n\r\n\t LinkedList.prototype.at = function(position) {\r\n\t /*\r\n\t Get the item at `position` (optional). Accepts negative index:\r\n\t \r\n\t ```js\r\n\t myList.at(-1); // Returns the last element.\r\n\t ```\r\n\t However, passing a negative index that surpasses the boundary will return\r\n\t undefined:\r\n\t \r\n\t ```js\r\n\t myList = new LinkedList([2, 6, 8, 3])\r\n\t myList.at(-5); // Undefined.\r\n\t myList.at(-4); // 2.\r\n\t ```\r\n\t _Returns:_ item gotten, or undefined if not found.\r\n\t */\r\n\r\n\t var currentNode, i, _i, _j, _ref;\r\n\t if (!((-this.size <= position && position < this.size))) {\r\n\t return;\r\n\t }\r\n\t position = this._adjust(position);\r\n\t if (position * 2 < this.size) {\r\n\t currentNode = this.head;\r\n\t for (i = _i = 1; _i <= position; i = _i += 1) {\r\n\t currentNode = currentNode.next;\r\n\t }\r\n\t } else {\r\n\t currentNode = this.tail;\r\n\t for (i = _j = 1, _ref = this.size - position - 1; _j <= _ref; i = _j += 1) {\r\n\t currentNode = currentNode.prev;\r\n\t }\r\n\t }\r\n\t return currentNode;\r\n\t };\r\n\r\n\t LinkedList.prototype.add = function(value, position) {\r\n\t var currentNode, nodeToAdd, _ref, _ref1, _ref2;\r\n\t if (position == null) {\r\n\t position = this.size;\r\n\t }\r\n\t /*\r\n\t Add a new item at `position` (optional). Defaults to adding at the end.\r\n\t `position`, just like in `at()`, can be negative (within the negative\r\n\t boundary). Position specifies the place the value's going to be, and the old\r\n\t node will be pushed higher. `add(-2)` on list of size 7 is the same as\r\n\t `add(5)`.\r\n\t \r\n\t _Returns:_ item added.\r\n\t */\r\n\r\n\t if (!((-this.size <= position && position <= this.size))) {\r\n\t return;\r\n\t }\r\n\t nodeToAdd = {\r\n\t value: value\r\n\t };\r\n\t position = this._adjust(position);\r\n\t if (this.size === 0) {\r\n\t this.head = nodeToAdd;\r\n\t } else {\r\n\t if (position === 0) {\r\n\t _ref = [nodeToAdd, this.head, nodeToAdd], this.head.prev = _ref[0], nodeToAdd.next = _ref[1], this.head = _ref[2];\r\n\t } else {\r\n\t currentNode = this.at(position - 1);\r\n\t _ref1 = [currentNode.next, nodeToAdd, nodeToAdd, currentNode], nodeToAdd.next = _ref1[0], (_ref2 = currentNode.next) != null ? _ref2.prev = _ref1[1] : void 0, currentNode.next = _ref1[2], nodeToAdd.prev = _ref1[3];\r\n\t }\r\n\t }\r\n\t if (position === this.size) {\r\n\t this.tail = nodeToAdd;\r\n\t }\r\n\t this.size++;\r\n\t return value;\r\n\t };\r\n\r\n\t LinkedList.prototype.removeAt = function(position) {\r\n\t var currentNode, valueToReturn, _ref;\r\n\t if (position == null) {\r\n\t position = this.size - 1;\r\n\t }\r\n\t /*\r\n\t Remove an item at index `position` (optional). Defaults to the last item.\r\n\t Index can be negative (within the boundary).\r\n\t \r\n\t _Returns:_ item removed.\r\n\t */\r\n\r\n\t if (!((-this.size <= position && position < this.size))) {\r\n\t return;\r\n\t }\r\n\t if (this.size === 0) {\r\n\t return;\r\n\t }\r\n\t position = this._adjust(position);\r\n\t if (this.size === 1) {\r\n\t valueToReturn = this.head.value;\r\n\t this.head.value = this.tail.value = void 0;\r\n\t } else {\r\n\t if (position === 0) {\r\n\t valueToReturn = this.head.value;\r\n\t this.head = this.head.next;\r\n\t this.head.prev = void 0;\r\n\t } else {\r\n\t currentNode = this.at(position);\r\n\t valueToReturn = currentNode.value;\r\n\t currentNode.prev.next = currentNode.next;\r\n\t if ((_ref = currentNode.next) != null) {\r\n\t _ref.prev = currentNode.prev;\r\n\t }\r\n\t if (position === this.size - 1) {\r\n\t this.tail = currentNode.prev;\r\n\t }\r\n\t }\r\n\t }\r\n\t this.size--;\r\n\t return valueToReturn;\r\n\t };\r\n\r\n\t LinkedList.prototype.remove = function(value) {\r\n\t /*\r\n\t Remove the item using its value instead of position. **Will remove the fist\r\n\t occurrence of `value`.**\r\n\t \r\n\t _Returns:_ the value, or undefined if value's not found.\r\n\t */\r\n\r\n\t var currentNode;\r\n\t if (value == null) {\r\n\t return;\r\n\t }\r\n\t currentNode = this.head;\r\n\t while (currentNode && currentNode.value !== value) {\r\n\t currentNode = currentNode.next;\r\n\t }\r\n\t if (!currentNode) {\r\n\t return;\r\n\t }\r\n\t if (this.size === 1) {\r\n\t this.head.value = this.tail.value = void 0;\r\n\t } else if (currentNode === this.head) {\r\n\t this.head = this.head.next;\r\n\t this.head.prev = void 0;\r\n\t } else if (currentNode === this.tail) {\r\n\t this.tail = this.tail.prev;\r\n\t this.tail.next = void 0;\r\n\t } else {\r\n\t currentNode.prev.next = currentNode.next;\r\n\t currentNode.next.prev = currentNode.prev;\r\n\t }\r\n\t this.size--;\r\n\t return value;\r\n\t };\r\n\r\n\t LinkedList.prototype.indexOf = function(value, startingPosition) {\r\n\t var currentNode, position;\r\n\t if (startingPosition == null) {\r\n\t startingPosition = 0;\r\n\t }\r\n\t /*\r\n\t Find the index of an item, similarly to `array.indexOf()`. Defaults to start\r\n\t searching from the beginning, by can start at another position by passing\r\n\t `startingPosition`. This parameter can also be negative; but unlike the\r\n\t other methods of this class, `startingPosition` (optional) can be as small\r\n\t as desired; a value of -999 for a list of size 5 will start searching\r\n\t normally, at the beginning.\r\n\t \r\n\t **Note:** searches forwardly, **not** backwardly, i.e:\r\n\t \r\n\t ```js\r\n\t var myList = new LinkedList([2, 3, 1, 4, 3, 5])\r\n\t myList.indexOf(3, -3); // Returns 4, not 1\r\n\t ```\r\n\t _Returns:_ index of item found, or -1 if not found.\r\n\t */\r\n\r\n\t if (((this.head.value == null) && !this.head.next) || startingPosition >= this.size) {\r\n\t return -1;\r\n\t }\r\n\t startingPosition = Math.max(0, this._adjust(startingPosition));\r\n\t currentNode = this.at(startingPosition);\r\n\t position = startingPosition;\r\n\t while (currentNode) {\r\n\t if (currentNode.value === value) {\r\n\t break;\r\n\t }\r\n\t currentNode = currentNode.next;\r\n\t position++;\r\n\t }\r\n\t if (position === this.size) {\r\n\t return -1;\r\n\t } else {\r\n\t return position;\r\n\t }\r\n\t };\r\n\r\n\t LinkedList.prototype._adjust = function(position) {\r\n\t if (position < 0) {\r\n\t return this.size + position;\r\n\t } else {\r\n\t return position;\r\n\t }\r\n\t };\r\n\r\n\t return LinkedList;\r\n\r\n\t })();\r\n\r\n\t module.exports = LinkedList;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 5 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tKind of a stopgap measure for the upcoming [JavaScript\r\n\tMap](http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets)\r\n\r\n\t**Note:** due to JavaScript's limitations, hashing something other than Boolean,\r\n\tNumber, String, Undefined, Null, RegExp, Function requires a hack that inserts a\r\n\thidden unique property into the object. This means `set`, `get`, `has` and\r\n\t`delete` must employ the same object, and not a mere identical copy as in the\r\n\tcase of, say, a string.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar map = new Map({'alice': 'wonderland', 20: 'ok'});\r\n\tmap.set('20', 5); // => 5\r\n\tmap.get('20'); // => 5\r\n\tmap.has('alice'); // => true\r\n\tmap.delete(20) // => true\r\n\tvar arr = [1, 2];\r\n\tmap.add(arr, 'goody'); // => 'goody'\r\n\tmap.has(arr); // => true\r\n\tmap.has([1, 2]); // => false. Needs to compare by reference\r\n\tmap.forEach(function(key, value) {\r\n\t console.log(key, value);\r\n\t});\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- size: The total number of `(key, value)` pairs.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var Map, SPECIAL_TYPE_KEY_PREFIX, _extractDataType, _isSpecialType,\r\n\t __hasProp = {}.hasOwnProperty;\r\n\r\n\t SPECIAL_TYPE_KEY_PREFIX = '_mapId_';\r\n\r\n\t Map = (function() {\r\n\t Map._mapIdTracker = 0;\r\n\r\n\t Map._newMapId = function() {\r\n\t return this._mapIdTracker++;\r\n\t };\r\n\r\n\t function Map(objectToMap) {\r\n\t /*\r\n\t Pass an optional object whose (key, value) pair will be hashed. **Careful**\r\n\t not to pass something like {5: 'hi', '5': 'hello'}, since JavaScript's\r\n\t native object behavior will crush the first 5 property before it gets to\r\n\t constructor.\r\n\t */\r\n\r\n\t var key, value;\r\n\t this._content = {};\r\n\t this._itemId = 0;\r\n\t this._id = Map._newMapId();\r\n\t this.size = 0;\r\n\t for (key in objectToMap) {\r\n\t if (!__hasProp.call(objectToMap, key)) continue;\r\n\t value = objectToMap[key];\r\n\t this.set(key, value);\r\n\t }\r\n\t }\r\n\r\n\t Map.prototype.hash = function(key, makeHash) {\r\n\t var propertyForMap, type;\r\n\t if (makeHash == null) {\r\n\t makeHash = false;\r\n\t }\r\n\t /*\r\n\t The hash function for hashing keys is public. Feel free to replace it with\r\n\t your own. The `makeHash` parameter is optional and accepts a boolean\r\n\t (defaults to `false`) indicating whether or not to produce a new hash (for\r\n\t the first use, naturally).\r\n\t \r\n\t _Returns:_ the hash.\r\n\t */\r\n\r\n\t type = _extractDataType(key);\r\n\t if (_isSpecialType(key)) {\r\n\t propertyForMap = SPECIAL_TYPE_KEY_PREFIX + this._id;\r\n\t if (makeHash && !key[propertyForMap]) {\r\n\t key[propertyForMap] = this._itemId++;\r\n\t }\r\n\t return propertyForMap + '_' + key[propertyForMap];\r\n\t } else {\r\n\t return type + '_' + key;\r\n\t }\r\n\t };\r\n\r\n\t Map.prototype.set = function(key, value) {\r\n\t /*\r\n\t _Returns:_ value.\r\n\t */\r\n\r\n\t if (!this.has(key)) {\r\n\t this.size++;\r\n\t }\r\n\t this._content[this.hash(key, true)] = [value, key];\r\n\t return value;\r\n\t };\r\n\r\n\t Map.prototype.get = function(key) {\r\n\t /*\r\n\t _Returns:_ value corresponding to the key, or undefined if not found.\r\n\t */\r\n\r\n\t var _ref;\r\n\t return (_ref = this._content[this.hash(key)]) != null ? _ref[0] : void 0;\r\n\t };\r\n\r\n\t Map.prototype.has = function(key) {\r\n\t /*\r\n\t Check whether a value exists for the key.\r\n\t \r\n\t _Returns:_ true or false.\r\n\t */\r\n\r\n\t return this.hash(key) in this._content;\r\n\t };\r\n\r\n\t Map.prototype[\"delete\"] = function(key) {\r\n\t /*\r\n\t Remove the (key, value) pair.\r\n\t \r\n\t _Returns:_ **true or false**. Unlike most of this library, this method\r\n\t doesn't return the deleted value. This is so that it conforms to the future\r\n\t JavaScript `map.delete()`'s behavior.\r\n\t */\r\n\r\n\t var hashedKey;\r\n\t hashedKey = this.hash(key);\r\n\t if (hashedKey in this._content) {\r\n\t delete this._content[hashedKey];\r\n\t if (_isSpecialType(key)) {\r\n\t delete key[SPECIAL_TYPE_KEY_PREFIX + this._id];\r\n\t }\r\n\t this.size--;\r\n\t return true;\r\n\t }\r\n\t return false;\r\n\t };\r\n\r\n\t Map.prototype.forEach = function(operation) {\r\n\t /*\r\n\t Traverse through the map. Pass a function of the form `fn(key, value)`.\r\n\t \r\n\t _Returns:_ undefined.\r\n\t */\r\n\r\n\t var key, value, _ref;\r\n\t _ref = this._content;\r\n\t for (key in _ref) {\r\n\t if (!__hasProp.call(_ref, key)) continue;\r\n\t value = _ref[key];\r\n\t operation(value[1], value[0]);\r\n\t }\r\n\t };\r\n\r\n\t return Map;\r\n\r\n\t })();\r\n\r\n\t _isSpecialType = function(key) {\r\n\t var simpleHashableTypes, simpleType, type, _i, _len;\r\n\t simpleHashableTypes = ['Boolean', 'Number', 'String', 'Undefined', 'Null', 'RegExp', 'Function'];\r\n\t type = _extractDataType(key);\r\n\t for (_i = 0, _len = simpleHashableTypes.length; _i < _len; _i++) {\r\n\t simpleType = simpleHashableTypes[_i];\r\n\t if (type === simpleType) {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t return true;\r\n\t };\r\n\r\n\t _extractDataType = function(type) {\r\n\t return Object.prototype.toString.apply(type).match(/\\[object (.+)\\]/)[1];\r\n\t };\r\n\r\n\t module.exports = Map;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 6 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tAmortized O(1) dequeue!\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar queue = new Queue([1, 6, 4]);\r\n\tqueue.enqueue(10); // => 10\r\n\tqueue.dequeue(); // => 1\r\n\tqueue.dequeue(); // => 6\r\n\tqueue.dequeue(); // => 4\r\n\tqueue.peek(); // => 10\r\n\tqueue.dequeue(); // => 10\r\n\tqueue.peek(); // => undefined\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- size: The total number of items.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var Queue;\r\n\r\n\t Queue = (function() {\r\n\t function Queue(initialArray) {\r\n\t if (initialArray == null) {\r\n\t initialArray = [];\r\n\t }\r\n\t /*\r\n\t Pass an optional array to be transformed into a queue. The item at index 0\r\n\t is the first to be dequeued.\r\n\t */\r\n\r\n\t this._content = initialArray;\r\n\t this._dequeueIndex = 0;\r\n\t this.size = this._content.length;\r\n\t }\r\n\r\n\t Queue.prototype.enqueue = function(item) {\r\n\t /*\r\n\t _Returns:_ the item.\r\n\t */\r\n\r\n\t this.size++;\r\n\t this._content.push(item);\r\n\t return item;\r\n\t };\r\n\r\n\t Queue.prototype.dequeue = function() {\r\n\t /*\r\n\t _Returns:_ the dequeued item.\r\n\t */\r\n\r\n\t var itemToDequeue;\r\n\t if (this.size === 0) {\r\n\t return;\r\n\t }\r\n\t this.size--;\r\n\t itemToDequeue = this._content[this._dequeueIndex];\r\n\t this._dequeueIndex++;\r\n\t if (this._dequeueIndex * 2 > this._content.length) {\r\n\t this._content = this._content.slice(this._dequeueIndex);\r\n\t this._dequeueIndex = 0;\r\n\t }\r\n\t return itemToDequeue;\r\n\t };\r\n\r\n\t Queue.prototype.peek = function() {\r\n\t /*\r\n\t Check the next item to be dequeued, without removing it.\r\n\t \r\n\t _Returns:_ the item.\r\n\t */\r\n\r\n\t return this._content[this._dequeueIndex];\r\n\t };\r\n\r\n\t return Queue;\r\n\r\n\t })();\r\n\r\n\t module.exports = Queue;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 7 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tCredit to Wikipedia's article on [Red-black\r\n\ttree](http://en.wikipedia.org/wiki/Red–black_tree)\r\n\r\n\t**Note:** doesn't handle duplicate entries, undefined and null. This is by\r\n\tdesign.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar rbt = new RedBlackTree([7, 5, 1, 8]);\r\n\trbt.add(2); // => 2\r\n\trbt.add(10); // => 10\r\n\trbt.has(5); // => true\r\n\trbt.peekMin(); // => 1\r\n\trbt.peekMax(); // => 10\r\n\trbt.removeMin(); // => 1\r\n\trbt.removeMax(); // => 10\r\n\trbt.remove(8); // => 8\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- size: The total number of items.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var BLACK, NODE_FOUND, NODE_TOO_BIG, NODE_TOO_SMALL, RED, RedBlackTree, STOP_SEARCHING, _findNode, _grandParentOf, _isLeft, _leftOrRight, _peekMaxNode, _peekMinNode, _siblingOf, _uncleOf;\r\n\r\n\t NODE_FOUND = 0;\r\n\r\n\t NODE_TOO_BIG = 1;\r\n\r\n\t NODE_TOO_SMALL = 2;\r\n\r\n\t STOP_SEARCHING = 3;\r\n\r\n\t RED = 1;\r\n\r\n\t BLACK = 2;\r\n\r\n\t RedBlackTree = (function() {\r\n\t function RedBlackTree(valuesToAdd) {\r\n\t var value, _i, _len;\r\n\t if (valuesToAdd == null) {\r\n\t valuesToAdd = [];\r\n\t }\r\n\t /*\r\n\t Pass an optional array to be turned into binary tree. **Note:** does not\r\n\t accept duplicate, undefined and null.\r\n\t */\r\n\r\n\t this._root;\r\n\t this.size = 0;\r\n\t for (_i = 0, _len = valuesToAdd.length; _i < _len; _i++) {\r\n\t value = valuesToAdd[_i];\r\n\t if (value != null) {\r\n\t this.add(value);\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t RedBlackTree.prototype.add = function(value) {\r\n\t /*\r\n\t Again, make sure to not pass a value already in the tree, or undefined, or\r\n\t null.\r\n\t \r\n\t _Returns:_ value added.\r\n\t */\r\n\r\n\t var currentNode, foundNode, nodeToInsert, _ref;\r\n\t if (value == null) {\r\n\t return;\r\n\t }\r\n\t this.size++;\r\n\t nodeToInsert = {\r\n\t value: value,\r\n\t _color: RED\r\n\t };\r\n\t if (!this._root) {\r\n\t this._root = nodeToInsert;\r\n\t } else {\r\n\t foundNode = _findNode(this._root, function(node) {\r\n\t if (value === node.value) {\r\n\t return NODE_FOUND;\r\n\t } else {\r\n\t if (value < node.value) {\r\n\t if (node._left) {\r\n\t return NODE_TOO_BIG;\r\n\t } else {\r\n\t nodeToInsert._parent = node;\r\n\t node._left = nodeToInsert;\r\n\t return STOP_SEARCHING;\r\n\t }\r\n\t } else {\r\n\t if (node._right) {\r\n\t return NODE_TOO_SMALL;\r\n\t } else {\r\n\t nodeToInsert._parent = node;\r\n\t node._right = nodeToInsert;\r\n\t return STOP_SEARCHING;\r\n\t }\r\n\t }\r\n\t }\r\n\t });\r\n\t if (foundNode != null) {\r\n\t return;\r\n\t }\r\n\t }\r\n\t currentNode = nodeToInsert;\r\n\t while (true) {\r\n\t if (currentNode === this._root) {\r\n\t currentNode._color = BLACK;\r\n\t break;\r\n\t }\r\n\t if (currentNode._parent._color === BLACK) {\r\n\t break;\r\n\t }\r\n\t if (((_ref = _uncleOf(currentNode)) != null ? _ref._color : void 0) === RED) {\r\n\t currentNode._parent._color = BLACK;\r\n\t _uncleOf(currentNode)._color = BLACK;\r\n\t _grandParentOf(currentNode)._color = RED;\r\n\t currentNode = _grandParentOf(currentNode);\r\n\t continue;\r\n\t }\r\n\t if (!_isLeft(currentNode) && _isLeft(currentNode._parent)) {\r\n\t this._rotateLeft(currentNode._parent);\r\n\t currentNode = currentNode._left;\r\n\t } else if (_isLeft(currentNode) && !_isLeft(currentNode._parent)) {\r\n\t this._rotateRight(currentNode._parent);\r\n\t currentNode = currentNode._right;\r\n\t }\r\n\t currentNode._parent._color = BLACK;\r\n\t _grandParentOf(currentNode)._color = RED;\r\n\t if (_isLeft(currentNode)) {\r\n\t this._rotateRight(_grandParentOf(currentNode));\r\n\t } else {\r\n\t this._rotateLeft(_grandParentOf(currentNode));\r\n\t }\r\n\t break;\r\n\t }\r\n\t return value;\r\n\t };\r\n\r\n\t RedBlackTree.prototype.has = function(value) {\r\n\t /*\r\n\t _Returns:_ true or false.\r\n\t */\r\n\r\n\t var foundNode;\r\n\t foundNode = _findNode(this._root, function(node) {\r\n\t if (value === node.value) {\r\n\t return NODE_FOUND;\r\n\t } else if (value < node.value) {\r\n\t return NODE_TOO_BIG;\r\n\t } else {\r\n\t return NODE_TOO_SMALL;\r\n\t }\r\n\t });\r\n\t if (foundNode) {\r\n\t return true;\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t };\r\n\r\n\t RedBlackTree.prototype.peekMin = function() {\r\n\t /*\r\n\t Check the minimum value without removing it.\r\n\t \r\n\t _Returns:_ the minimum value.\r\n\t */\r\n\r\n\t var _ref;\r\n\t return (_ref = _peekMinNode(this._root)) != null ? _ref.value : void 0;\r\n\t };\r\n\r\n\t RedBlackTree.prototype.peekMax = function() {\r\n\t /*\r\n\t Check the maximum value without removing it.\r\n\t \r\n\t _Returns:_ the maximum value.\r\n\t */\r\n\r\n\t var _ref;\r\n\t return (_ref = _peekMaxNode(this._root)) != null ? _ref.value : void 0;\r\n\t };\r\n\r\n\t RedBlackTree.prototype.remove = function(value) {\r\n\t /*\r\n\t _Returns:_ the value removed, or undefined if the value's not found.\r\n\t */\r\n\r\n\t var foundNode;\r\n\t foundNode = _findNode(this._root, function(node) {\r\n\t if (value === node.value) {\r\n\t return NODE_FOUND;\r\n\t } else if (value < node.value) {\r\n\t return NODE_TOO_BIG;\r\n\t } else {\r\n\t return NODE_TOO_SMALL;\r\n\t }\r\n\t });\r\n\t if (!foundNode) {\r\n\t return;\r\n\t }\r\n\t this._removeNode(this._root, foundNode);\r\n\t this.size--;\r\n\t return value;\r\n\t };\r\n\r\n\t RedBlackTree.prototype.removeMin = function() {\r\n\t /*\r\n\t _Returns:_ smallest item removed, or undefined if tree's empty.\r\n\t */\r\n\r\n\t var nodeToRemove, valueToReturn;\r\n\t nodeToRemove = _peekMinNode(this._root);\r\n\t if (!nodeToRemove) {\r\n\t return;\r\n\t }\r\n\t valueToReturn = nodeToRemove.value;\r\n\t this._removeNode(this._root, nodeToRemove);\r\n\t return valueToReturn;\r\n\t };\r\n\r\n\t RedBlackTree.prototype.removeMax = function() {\r\n\t /*\r\n\t _Returns:_ biggest item removed, or undefined if tree's empty.\r\n\t */\r\n\r\n\t var nodeToRemove, valueToReturn;\r\n\t nodeToRemove = _peekMaxNode(this._root);\r\n\t if (!nodeToRemove) {\r\n\t return;\r\n\t }\r\n\t valueToReturn = nodeToRemove.value;\r\n\t this._removeNode(this._root, nodeToRemove);\r\n\t return valueToReturn;\r\n\t };\r\n\r\n\t RedBlackTree.prototype._removeNode = function(root, node) {\r\n\t var sibling, successor, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;\r\n\t if (node._left && node._right) {\r\n\t successor = _peekMinNode(node._right);\r\n\t node.value = successor.value;\r\n\t node = successor;\r\n\t }\r\n\t successor = node._left || node._right;\r\n\t if (!successor) {\r\n\t successor = {\r\n\t color: BLACK,\r\n\t _right: void 0,\r\n\t _left: void 0,\r\n\t isLeaf: true\r\n\t };\r\n\t }\r\n\t successor._parent = node._parent;\r\n\t if ((_ref = node._parent) != null) {\r\n\t _ref[_leftOrRight(node)] = successor;\r\n\t }\r\n\t if (node._color === BLACK) {\r\n\t if (successor._color === RED) {\r\n\t successor._color = BLACK;\r\n\t if (!successor._parent) {\r\n\t this._root = successor;\r\n\t }\r\n\t } else {\r\n\t while (true) {\r\n\t if (!successor._parent) {\r\n\t if (!successor.isLeaf) {\r\n\t this._root = successor;\r\n\t } else {\r\n\t this._root = void 0;\r\n\t }\r\n\t break;\r\n\t }\r\n\t sibling = _siblingOf(successor);\r\n\t if ((sibling != null ? sibling._color : void 0) === RED) {\r\n\t successor._parent._color = RED;\r\n\t sibling._color = BLACK;\r\n\t if (_isLeft(successor)) {\r\n\t this._rotateLeft(successor._parent);\r\n\t } else {\r\n\t this._rotateRight(successor._parent);\r\n\t }\r\n\t }\r\n\t sibling = _siblingOf(successor);\r\n\t if (successor._parent._color === BLACK && (!sibling || (sibling._color === BLACK && (!sibling._left || sibling._left._color === BLACK) && (!sibling._right || sibling._right._color === BLACK)))) {\r\n\t if (sibling != null) {\r\n\t sibling._color = RED;\r\n\t }\r\n\t if (successor.isLeaf) {\r\n\t successor._parent[_leftOrRight(successor)] = void 0;\r\n\t }\r\n\t successor = successor._parent;\r\n\t continue;\r\n\t }\r\n\t if (successor._parent._color === RED && (!sibling || (sibling._color === BLACK && (!sibling._left || ((_ref1 = sibling._left) != null ? _ref1._color : void 0) === BLACK) && (!sibling._right || ((_ref2 = sibling._right) != null ? _ref2._color : void 0) === BLACK)))) {\r\n\t if (sibling != null) {\r\n\t sibling._color = RED;\r\n\t }\r\n\t successor._parent._color = BLACK;\r\n\t break;\r\n\t }\r\n\t if ((sibling != null ? sibling._color : void 0) === BLACK) {\r\n\t if (_isLeft(successor) && (!sibling._right || sibling._right._color === BLACK) && ((_ref3 = sibling._left) != null ? _ref3._color : void 0) === RED) {\r\n\t sibling._color = RED;\r\n\t if ((_ref4 = sibling._left) != null) {\r\n\t _ref4._color = BLACK;\r\n\t }\r\n\t this._rotateRight(sibling);\r\n\t } else if (!_isLeft(successor) && (!sibling._left || sibling._left._color === BLACK) && ((_ref5 = sibling._right) != null ? _ref5._color : void 0) === RED) {\r\n\t sibling._color = RED;\r\n\t if ((_ref6 = sibling._right) != null) {\r\n\t _ref6._color = BLACK;\r\n\t }\r\n\t this._rotateLeft(sibling);\r\n\t }\r\n\t break;\r\n\t }\r\n\t sibling = _siblingOf(successor);\r\n\t sibling._color = successor._parent._color;\r\n\t if (_isLeft(successor)) {\r\n\t sibling._right._color = BLACK;\r\n\t this._rotateRight(successor._parent);\r\n\t } else {\r\n\t sibling._left._color = BLACK;\r\n\t this._rotateLeft(successor._parent);\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t if (successor.isLeaf) {\r\n\t return (_ref7 = successor._parent) != null ? _ref7[_leftOrRight(successor)] = void 0 : void 0;\r\n\t }\r\n\t };\r\n\r\n\t RedBlackTree.prototype._rotateLeft = function(node) {\r\n\t var _ref, _ref1;\r\n\t if ((_ref = node._parent) != null) {\r\n\t _ref[_leftOrRight(node)] = node._right;\r\n\t }\r\n\t node._right._parent = node._parent;\r\n\t node._parent = node._right;\r\n\t node._right = node._right._left;\r\n\t node._parent._left = node;\r\n\t if ((_ref1 = node._right) != null) {\r\n\t _ref1._parent = node;\r\n\t }\r\n\t if (node._parent._parent == null) {\r\n\t return this._root = node._parent;\r\n\t }\r\n\t };\r\n\r\n\t RedBlackTree.prototype._rotateRight = function(node) {\r\n\t var _ref, _ref1;\r\n\t if ((_ref = node._parent) != null) {\r\n\t _ref[_leftOrRight(node)] = node._left;\r\n\t }\r\n\t node._left._parent = node._parent;\r\n\t node._parent = node._left;\r\n\t node._left = node._left._right;\r\n\t node._parent._right = node;\r\n\t if ((_ref1 = node._left) != null) {\r\n\t _ref1._parent = node;\r\n\t }\r\n\t if (node._parent._parent == null) {\r\n\t return this._root = node._parent;\r\n\t }\r\n\t };\r\n\r\n\t return RedBlackTree;\r\n\r\n\t })();\r\n\r\n\t _isLeft = function(node) {\r\n\t return node === node._parent._left;\r\n\t };\r\n\r\n\t _leftOrRight = function(node) {\r\n\t if (_isLeft(node)) {\r\n\t return '_left';\r\n\t } else {\r\n\t return '_right';\r\n\t }\r\n\t };\r\n\r\n\t _findNode = function(startingNode, comparator) {\r\n\t var comparisonResult, currentNode, foundNode;\r\n\t currentNode = startingNode;\r\n\t foundNode = void 0;\r\n\t while (currentNode) {\r\n\t comparisonResult = comparator(currentNode);\r\n\t if (comparisonResult === NODE_FOUND) {\r\n\t foundNode = currentNode;\r\n\t break;\r\n\t }\r\n\t if (comparisonResult === NODE_TOO_BIG) {\r\n\t currentNode = currentNode._left;\r\n\t } else if (comparisonResult === NODE_TOO_SMALL) {\r\n\t currentNode = currentNode._right;\r\n\t } else if (comparisonResult === STOP_SEARCHING) {\r\n\t break;\r\n\t }\r\n\t }\r\n\t return foundNode;\r\n\t };\r\n\r\n\t _peekMinNode = function(startingNode) {\r\n\t return _findNode(startingNode, function(node) {\r\n\t if (node._left) {\r\n\t return NODE_TOO_BIG;\r\n\t } else {\r\n\t return NODE_FOUND;\r\n\t }\r\n\t });\r\n\t };\r\n\r\n\t _peekMaxNode = function(startingNode) {\r\n\t return _findNode(startingNode, function(node) {\r\n\t if (node._right) {\r\n\t return NODE_TOO_SMALL;\r\n\t } else {\r\n\t return NODE_FOUND;\r\n\t }\r\n\t });\r\n\t };\r\n\r\n\t _grandParentOf = function(node) {\r\n\t var _ref;\r\n\t return (_ref = node._parent) != null ? _ref._parent : void 0;\r\n\t };\r\n\r\n\t _uncleOf = function(node) {\r\n\t if (!_grandParentOf(node)) {\r\n\t return;\r\n\t }\r\n\t if (_isLeft(node._parent)) {\r\n\t return _grandParentOf(node)._right;\r\n\t } else {\r\n\t return _grandParentOf(node)._left;\r\n\t }\r\n\t };\r\n\r\n\t _siblingOf = function(node) {\r\n\t if (_isLeft(node)) {\r\n\t return node._parent._right;\r\n\t } else {\r\n\t return node._parent._left;\r\n\t }\r\n\t };\r\n\r\n\t module.exports = RedBlackTree;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ },\r\n/* 8 */\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/*\r\n\tGood for fast insertion/removal/lookup of strings.\r\n\r\n\t## Overview example:\r\n\r\n\t```js\r\n\tvar trie = new Trie(['bear', 'beer']);\r\n\ttrie.add('hello'); // => 'hello'\r\n\ttrie.add('helloha!'); // => 'helloha!'\r\n\ttrie.has('bears'); // => false\r\n\ttrie.longestPrefixOf('beatrice'); // => 'bea'\r\n\ttrie.wordsWithPrefix('hel'); // => ['hello', 'helloha!']\r\n\ttrie.remove('beers'); // => undefined. 'beer' still exists\r\n\ttrie.remove('Beer') // => undefined. Case-sensitive\r\n\ttrie.remove('beer') // => 'beer'. Removed\r\n\t```\r\n\r\n\t## Properties:\r\n\r\n\t- size: The total number of words.\r\n\t*/\r\n\r\n\r\n\t(function() {\r\n\t var Queue, Trie, WORD_END, _hasAtLeastNChildren,\r\n\t __hasProp = {}.hasOwnProperty;\r\n\r\n\t Queue = __webpack_require__(6);\r\n\r\n\t WORD_END = 'end';\r\n\r\n\t Trie = (function() {\r\n\t function Trie(words) {\r\n\t var word, _i, _len;\r\n\t if (words == null) {\r\n\t words = [];\r\n\t }\r\n\t /*\r\n\t Pass an optional array of strings to be inserted initially.\r\n\t */\r\n\r\n\t this._root = {};\r\n\t this.size = 0;\r\n\t for (_i = 0, _len = words.length; _i < _len; _i++) {\r\n\t word = words[_i];\r\n\t this.add(word);\r\n\t }\r\n\t }\r\n\r\n\t Trie.prototype.add = function(word) {\r\n\t /*\r\n\t Add a whole string to the trie.\r\n\t \r\n\t _Returns:_ the word added. Will return undefined (without adding the value)\r\n\t if the word passed is null or undefined.\r\n\t */\r\n\r\n\t var currentNode, letter, _i, _len;\r\n\t if (word == null) {\r\n\t return;\r\n\t }\r\n\t this.size++;\r\n\t currentNode = this._root;\r\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\r\n\t letter = word[_i];\r\n\t if (currentNode[letter] == null) {\r\n\t currentNode[letter] = {};\r\n\t }\r\n\t currentNode = currentNode[letter];\r\n\t }\r\n\t currentNode[WORD_END] = true;\r\n\t return word;\r\n\t };\r\n\r\n\t Trie.prototype.has = function(word) {\r\n\t /*\r\n\t __Returns:_ true or false.\r\n\t */\r\n\r\n\t var currentNode, letter, _i, _len;\r\n\t if (word == null) {\r\n\t return false;\r\n\t }\r\n\t currentNode = this._root;\r\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\r\n\t letter = word[_i];\r\n\t if (currentNode[letter] == null) {\r\n\t return false;\r\n\t }\r\n\t currentNode = currentNode[letter];\r\n\t }\r\n\t if (currentNode[WORD_END]) {\r\n\t return true;\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t };\r\n\r\n\t Trie.prototype.longestPrefixOf = function(word) {\r\n\t /*\r\n\t Find all words containing the prefix. The word itself counts as a prefix.\r\n\t \r\n\t ```js\r\n\t var trie = new Trie;\r\n\t trie.add('hello');\r\n\t trie.longestPrefixOf('he'); // 'he'\r\n\t trie.longestPrefixOf('hello'); // 'hello'\r\n\t trie.longestPrefixOf('helloha!'); // 'hello'\r\n\t ```\r\n\t \r\n\t _Returns:_ the prefix string, or empty string if no prefix found.\r\n\t */\r\n\r\n\t var currentNode, letter, prefix, _i, _len;\r\n\t if (word == null) {\r\n\t return '';\r\n\t }\r\n\t currentNode = this._root;\r\n\t prefix = '';\r\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\r\n\t letter = word[_i];\r\n\t if (currentNode[letter] == null) {\r\n\t break;\r\n\t }\r\n\t prefix += letter;\r\n\t currentNode = currentNode[letter];\r\n\t }\r\n\t return prefix;\r\n\t };\r\n\r\n\t Trie.prototype.wordsWithPrefix = function(prefix) {\r\n\t /*\r\n\t Find all words containing the prefix. The word itself counts as a prefix.\r\n\t **Watch out for edge cases.**\r\n\t \r\n\t ```js\r\n\t var trie = new Trie;\r\n\t trie.wordsWithPrefix(''); // []. Check later case below.\r\n\t trie.add('');\r\n\t trie.wordsWithPrefix(''); // ['']\r\n\t trie.add('he');\r\n\t trie.add('hello');\r\n\t trie.add('hell');\r\n\t trie.add('bear');\r\n\t trie.add('z');\r\n\t trie.add('zebra');\r\n\t trie.wordsWithPrefix('hel'); // ['hell', 'hello']\r\n\t ```\r\n\t \r\n\t _Returns:_ an array of strings, or empty array if no word found.\r\n\t */\r\n\r\n\t var accumulatedLetters, currentNode, letter, node, queue, subNode, words, _i, _len, _ref;\r\n\t if (prefix == null) {\r\n\t return [];\r\n\t }\r\n\t (prefix != null) || (prefix = '');\r\n\t words = [];\r\n\t currentNode = this._root;\r\n\t for (_i = 0, _len = prefix.length; _i < _len; _i++) {\r\n\t letter = prefix[_i];\r\n\t currentNode = currentNode[letter];\r\n\t if (currentNode == null) {\r\n\t return [];\r\n\t }\r\n\t }\r\n\t queue = new Queue();\r\n\t queue.enqueue([currentNode, '']);\r\n\t while (queue.size !== 0) {\r\n\t _ref = queue.dequeue(), node = _ref[0], accumulatedLetters = _ref[1];\r\n\t if (node[WORD_END]) {\r\n\t words.push(prefix + accumulatedLetters);\r\n\t }\r\n\t for (letter in node) {\r\n\t if (!__hasProp.call(node, letter)) continue;\r\n\t subNode = node[letter];\r\n\t queue.enqueue([subNode, accumulatedLetters + letter]);\r\n\t }\r\n\t }\r\n\t return words;\r\n\t };\r\n\r\n\t Trie.prototype.remove = function(word) {\r\n\t /*\r\n\t _Returns:_ the string removed, or undefined if the word in its whole doesn't\r\n\t exist. **Note:** this means removing `beers` when only `beer` exists will\r\n\t return undefined and conserve `beer`.\r\n\t */\r\n\r\n\t var currentNode, i, letter, prefix, _i, _j, _len, _ref;\r\n\t if (word == null) {\r\n\t return;\r\n\t }\r\n\t currentNode = this._root;\r\n\t prefix = [];\r\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\r\n\t letter = word[_i];\r\n\t if (currentNode[letter] == null) {\r\n\t return;\r\n\t }\r\n\t currentNode = currentNode[letter];\r\n\t prefix.push([letter, currentNode]);\r\n\t }\r\n\t if (!currentNode[WORD_END]) {\r\n\t return;\r\n\t }\r\n\t this.size--;\r\n\t delete currentNode[WORD_END];\r\n\t if (_hasAtLeastNChildren(currentNode, 1)) {\r\n\t return word;\r\n\t }\r\n\t for (i = _j = _ref = prefix.length - 1; _ref <= 1 ? _j <= 1 : _j >= 1; i = _ref <= 1 ? ++_j : --_j) {\r\n\t if (!_hasAtLeastNChildren(prefix[i][1], 1)) {\r\n\t delete prefix[i - 1][1][prefix[i][0]];\r\n\t } else {\r\n\t break;\r\n\t }\r\n\t }\r\n\t if (!_hasAtLeastNChildren(this._root[prefix[0][0]], 1)) {\r\n\t delete this._root[prefix[0][0]];\r\n\t }\r\n\t return word;\r\n\t };\r\n\r\n\t return Trie;\r\n\r\n\t })();\r\n\r\n\t _hasAtLeastNChildren = function(node, n) {\r\n\t var child, childCount;\r\n\t if (n === 0) {\r\n\t return true;\r\n\t }\r\n\t childCount = 0;\r\n\t for (child in node) {\r\n\t if (!__hasProp.call(node, child)) continue;\r\n\t childCount++;\r\n\t if (childCount >= n) {\r\n\t return true;\r\n\t }\r\n\t }\r\n\t return false;\r\n\t };\r\n\r\n\t module.exports = Trie;\r\n\r\n\t}).call(this);\r\n\r\n\r\n/***/ }\r\n/******/ ]);;/**\r\n * Performance overrides on MarkerClusterer custom to Angular Google Maps\r\n *\r\n * Created by Petr Bruna ccg1415 and Nick McCready on 7/13/14.\r\n */\r\nangular.module('uiGmapgoogle-maps.extensions')\r\n.service('uiGmapExtendMarkerClusterer',['uiGmapLodash', 'uiGmapPropMap', function (uiGmapLodash, PropMap) {\r\n return {\r\n init: _.once(function () {\r\n (function () {\r\n var __hasProp = {}.hasOwnProperty,\r\n __extends = function (child, parent) {\r\n for (var key in parent) {\r\n if (__hasProp.call(parent, key)) child[key] = parent[key];\r\n }\r\n function ctor() {\r\n this.constructor = child;\r\n }\r\n\r\n ctor.prototype = parent.prototype;\r\n child.prototype = new ctor();\r\n child.__super__ = parent.prototype;\r\n return child;\r\n };\r\n\r\n window.NgMapCluster = (function (_super) {\r\n __extends(NgMapCluster, _super);\r\n\r\n function NgMapCluster(opts) {\r\n NgMapCluster.__super__.constructor.call(this, opts);\r\n this.markers_ = new PropMap();\r\n }\r\n\r\n /**\r\n * Adds a marker to the cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to be added.\r\n * @return {boolean} True if the marker was added.\r\n * @ignore\r\n */\r\n NgMapCluster.prototype.addMarker = function (marker) {\r\n var i;\r\n var mCount;\r\n var mz;\r\n\r\n if (this.isMarkerAlreadyAdded_(marker)) {\r\n var oldMarker = this.markers_.get(marker.key);\r\n if (oldMarker.getPosition().lat() == marker.getPosition().lat() && oldMarker.getPosition().lon() == marker.getPosition().lon()) //if nothing has changed\r\n return false;\r\n }\r\n\r\n if (!this.center_) {\r\n this.center_ = marker.getPosition();\r\n this.calculateBounds_();\r\n } else {\r\n if (this.averageCenter_) {\r\n var l = this.markers_.length + 1;\r\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\r\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\r\n this.center_ = new google.maps.LatLng(lat, lng);\r\n this.calculateBounds_();\r\n }\r\n }\r\n marker.isAdded = true;\r\n this.markers_.push(marker);\r\n\r\n mCount = this.markers_.length;\r\n mz = this.markerClusterer_.getMaxZoom();\r\n if (mz !== null && this.map_.getZoom() > mz) {\r\n // Zoomed in past max zoom, so show the marker.\r\n if (marker.getMap() !== this.map_) {\r\n marker.setMap(this.map_);\r\n }\r\n } else if (mCount < this.minClusterSize_) {\r\n // Min cluster size not reached so show the marker.\r\n if (marker.getMap() !== this.map_) {\r\n marker.setMap(this.map_);\r\n }\r\n } else if (mCount === this.minClusterSize_) {\r\n // Hide the markers that were showing.\r\n this.markers_.each(function (m) {\r\n m.setMap(null);\r\n });\r\n } else {\r\n marker.setMap(null);\r\n }\r\n\r\n //this.updateIcon_();\r\n return true;\r\n };\r\n\r\n /**\r\n * Determines if a marker has already been added to the cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to check.\r\n * @return {boolean} True if the marker has already been added.\r\n */\r\n NgMapCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\r\n return uiGmapLodash.isNullOrUndefined(this.markers_.get(marker.key));\r\n };\r\n\r\n\r\n /**\r\n * Returns the bounds of the cluster.\r\n *\r\n * @return {google.maps.LatLngBounds} the cluster bounds.\r\n * @ignore\r\n */\r\n NgMapCluster.prototype.getBounds = function () {\r\n var i;\r\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\r\n this.getMarkers().each(function(m){\r\n bounds.extend(m.getPosition());\r\n });\r\n return bounds;\r\n };\r\n\r\n\r\n /**\r\n * Removes the cluster from the map.\r\n *\r\n * @ignore\r\n */\r\n NgMapCluster.prototype.remove = function () {\r\n this.clusterIcon_.setMap(null);\r\n this.markers_ = new PropMap();\r\n delete this.markers_;\r\n };\r\n\r\n\r\n return NgMapCluster;\r\n\r\n })(Cluster);\r\n\r\n\r\n window.NgMapMarkerClusterer = (function (_super) {\r\n __extends(NgMapMarkerClusterer, _super);\r\n\r\n function NgMapMarkerClusterer(map, opt_markers, opt_options) {\r\n NgMapMarkerClusterer.__super__.constructor.call(this, map, opt_markers, opt_options);\r\n this.markers_ = new PropMap();\r\n }\r\n\r\n /**\r\n * Removes all clusters and markers from the map and also removes all markers\r\n * managed by the clusterer.\r\n */\r\n NgMapMarkerClusterer.prototype.clearMarkers = function () {\r\n this.resetViewport_(true);\r\n this.markers_ = new PropMap();\r\n };\r\n /**\r\n * Removes a marker and returns true if removed, false if not.\r\n *\r\n * @param {google.maps.Marker} marker The marker to remove\r\n * @return {boolean} Whether the marker was removed or not\r\n */\r\n NgMapMarkerClusterer.prototype.removeMarker_ = function (marker) {\r\n if (!this.markers_.get(marker.key)) {\r\n return false;\r\n }\r\n marker.setMap(null);\r\n this.markers_.remove(marker.key); // Remove the marker from the list of managed markers\r\n return true;\r\n };\r\n\r\n /**\r\n * Creates the clusters. This is done in batches to avoid timeout errors\r\n * in some browsers when there is a huge number of markers.\r\n *\r\n * @param {number} iFirst The index of the first marker in the batch of\r\n * markers to be added to clusters.\r\n */\r\n NgMapMarkerClusterer.prototype.createClusters_ = function (iFirst) {\r\n var i, marker;\r\n var mapBounds;\r\n var cMarkerClusterer = this;\r\n if (!this.ready_) {\r\n return;\r\n }\r\n\r\n // Cancel previous batch processing if we're working on the first batch:\r\n if (iFirst === 0) {\r\n /**\r\n * This event is fired when the MarkerClusterer
begins\r\n * clustering markers.\r\n * @name MarkerClusterer#clusteringbegin\r\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\r\n * @event\r\n */\r\n google.maps.event.trigger(this, 'clusteringbegin', this);\r\n\r\n if (typeof this.timerRefStatic !== 'undefined') {\r\n clearTimeout(this.timerRefStatic);\r\n delete this.timerRefStatic;\r\n }\r\n }\r\n\r\n // Get our current map view bounds.\r\n // Create a new bounds object so we don't affect the map.\r\n //\r\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\r\n if (this.getMap().getZoom() > 3) {\r\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\r\n this.getMap().getBounds().getNorthEast());\r\n } else {\r\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\r\n }\r\n var bounds = this.getExtendedBounds(mapBounds);\r\n\r\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\r\n\r\n var _ms = this.markers_.values();\r\n for (i = iFirst; i < iLast; i++) {\r\n marker = _ms[i];\r\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\r\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\r\n this.addToClosestCluster_(marker);\r\n }\r\n }\r\n }\r\n\r\n if (iLast < this.markers_.length) {\r\n this.timerRefStatic = setTimeout(function () {\r\n cMarkerClusterer.createClusters_(iLast);\r\n }, 0);\r\n } else {\r\n // custom addition by ui-gmap\r\n // update icon for all clusters\r\n for (i = 0; i < this.clusters_.length; i++) {\r\n this.clusters_[i].updateIcon_();\r\n }\r\n\r\n delete this.timerRefStatic;\r\n\r\n /**\r\n * This event is fired when the MarkerClusterer
stops\r\n * clustering markers.\r\n * @name MarkerClusterer#clusteringend\r\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\r\n * @event\r\n */\r\n google.maps.event.trigger(this, 'clusteringend', this);\r\n }\r\n };\r\n\r\n /**\r\n * Adds a marker to a cluster, or creates a new cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to add.\r\n */\r\n NgMapMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\r\n var i, d, cluster, center;\r\n var distance = 40000; // Some large number\r\n var clusterToAddTo = null;\r\n for (i = 0; i < this.clusters_.length; i++) {\r\n cluster = this.clusters_[i];\r\n center = cluster.getCenter();\r\n if (center) {\r\n d = this.distanceBetweenPoints_(center, marker.getPosition());\r\n if (d < distance) {\r\n distance = d;\r\n clusterToAddTo = cluster;\r\n }\r\n }\r\n }\r\n\r\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\r\n clusterToAddTo.addMarker(marker);\r\n } else {\r\n cluster = new NgMapCluster(this);\r\n cluster.addMarker(marker);\r\n this.clusters_.push(cluster);\r\n }\r\n };\r\n\r\n /**\r\n * Redraws all the clusters.\r\n */\r\n NgMapMarkerClusterer.prototype.redraw_ = function () {\r\n this.createClusters_(0);\r\n };\r\n\r\n\r\n /**\r\n * Removes all clusters from the map. The markers are also removed from the map\r\n * if opt_hide
is set to true
.\r\n *\r\n * @param {boolean} [opt_hide] Set to true
to also remove the markers\r\n * from the map.\r\n */\r\n NgMapMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\r\n var i, marker;\r\n // Remove all the clusters\r\n for (i = 0; i < this.clusters_.length; i++) {\r\n this.clusters_[i].remove();\r\n }\r\n this.clusters_ = [];\r\n\r\n // Reset the markers to not be added and to be removed from the map.\r\n this.markers_.each(function (marker) {\r\n marker.isAdded = false;\r\n if (opt_hide) {\r\n marker.setMap(null);\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Extends an object's prototype by another's.\r\n *\r\n * @param {Object} obj1 The object to be extended.\r\n * @param {Object} obj2 The object to extend with.\r\n * @return {Object} The new extended object.\r\n * @ignore\r\n */\r\n NgMapMarkerClusterer.prototype.extend = function (obj1, obj2) {\r\n return (function (object) {\r\n var property;\r\n for (property in object.prototype) {\r\n if (property !== 'constructor')\r\n this.prototype[property] = object.prototype[property];\r\n }\r\n return this;\r\n }).apply(obj1, [obj2]);\r\n };\r\n ////////////////////////////////////////////////////////////////////////////////\r\n /*\r\n Other overrides relevant to MarkerClusterPlus\r\n */\r\n ////////////////////////////////////////////////////////////////////////////////\r\n /**\r\n * Positions and shows the icon.\r\n */\r\n ClusterIcon.prototype.show = function () {\r\n if (this.div_) {\r\n var img = \"\";\r\n // NOTE: values must be specified in px units\r\n var bp = this.backgroundPosition_.split(\" \");\r\n var spriteH = parseInt(bp[0].trim(), 10);\r\n var spriteV = parseInt(bp[1].trim(), 10);\r\n var pos = this.getPosFromLatLng_(this.center_);\r\n this.div_.style.cssText = this.createCss(pos);\r\n img = \"
\";\r\n this.div_.innerHTML = img + \"
\" + this.sums_.text + \"
\";\r\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\r\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\r\n } else {\r\n this.div_.title = this.sums_.title;\r\n }\r\n this.div_.style.display = \"\";\r\n }\r\n this.visible_ = true;\r\n };\r\n //END OTHER OVERRIDES\r\n ////////////////////////////////////////////////////////////////////////////////\r\n\r\n return NgMapMarkerClusterer;\r\n\r\n })(MarkerClusterer);\r\n }).call(this);\r\n })\r\n };\r\n}]);\r\n}( window,angular));","/**\n * @license\n * Lo-Dash 2.4.2 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE\n * Build: `lodash modern -o ./dist/lodash.js`\n */\n;(function(){function n(n,r,t){for(var e=(t||0)-1,u=n?n.length:0;++e-1?0:-1:r?0:-1}function t(n){var r=this.cache,t=typeof n;if(\"boolean\"==t||null==n)r[n]=!0;else{\"number\"!=t&&\"string\"!=t&&(t=\"object\");var e=\"number\"==t?n:m+n,u=r[t]||(r[t]={});\"object\"==t?(u[e]||(u[e]=[])).push(n):u[e]=!0;\n\n}}function e(n){return n.charCodeAt(0)}function u(n,r){for(var t=n.criteria,e=r.criteria,u=-1,o=t.length;++ui||\"undefined\"==typeof a)return 1;if(a=b&&a===n,l=[];\n\nif(f){var p=o(e);p?(a=r,e=p):f=!1}for(;++u-1:v});return u.pop(),o.pop(),_&&(l(u),l(o)),a}function tn(n,r,t,e,u){(Yt(r)?Xn:fe)(r,function(r,o){\nvar a,i,f=r,l=n[o];if(r&&((i=Yt(r))||le(r))){for(var c=e.length;c--;)if(a=e[c]==r){l=u[c];break}if(!a){var p;t&&(f=t(l,r),(p=\"undefined\"!=typeof f)&&(l=f)),p||(l=i?Yt(l)?l:[]:le(l)?l:{}),e.push(r),u.push(l),p||tn(l,r,t,e,u)}}else t&&(f=t(l,r),\"undefined\"==typeof f&&(f=r)),\"undefined\"!=typeof f&&(l=f);n[o]=l})}function en(n,r){return n+St(Ht()*(r-n+1))}function un(t,e,u){var a=-1,f=ln(),p=t?t.length:0,s=[],v=!e&&p>=b&&f===n,h=u||v?i():s;if(v){var g=o(h);f=r,h=g}for(;++a3&&\"function\"==typeof r[t-2])var e=Q(r[--t-1],r[t--],2);else t>2&&\"function\"==typeof r[t-1]&&(e=r[--t]);for(var u=p(arguments,1,t),o=-1,a=i(),f=i();++o-1:\"number\"==typeof o?a=(Fn(n)?n.indexOf(r,t):u(n,r,t))>-1:fe(n,function(n){return++eo&&(o=f)}else r=null==r&&Fn(n)?e:h.createCallback(r,t,3),Xn(n,function(n,t,e){var a=r(n,t,e);a>u&&(u=a,o=n)});return o;\n\n}function tr(n,r,t){var u=1/0,o=u;if(\"function\"!=typeof r&&t&&t[r]===n&&(r=null),null==r&&Yt(n))for(var a=-1,i=n.length;++a=b&&o(e?t[e]:s)))}var h=t[0],g=-1,y=h?h.length:0,m=[];n:for(;++g>>1;t(n[a])1?arguments:arguments[0],r=-1,t=n?rr(ve(n,\"length\")):0,e=ht(t<0?0:t);++r2?an(n,17,p(arguments,2),null,r):an(n,1,null,null,r)}function Fr(n){for(var r=arguments.length>1?nn(arguments,!0,!1,1):wn(n),t=-1,e=r.length;++t2?an(r,19,p(arguments,2),null,n):an(r,3,null,null,n);\n\n}function Wr(){for(var n=arguments,r=n.length;r--;)if(!In(n[r]))throw new kt;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}}function qr(n,r){return r=\"number\"==typeof r?r:+r||n.length,an(n,4,null,null,null,r)}function zr(n,r,t){var e,u,o,a,i,f,l,c=0,p=!1,s=!0;if(!In(n))throw new kt;if(r=Mt(0,r)||0,t===!0){var h=!0;s=!1}else Sn(t)&&(h=t.leading,p=\"maxWait\"in t&&(Mt(r,t.maxWait)||0),s=\"trailing\"in t?t.trailing:s);var g=function(){var t=r-(ge()-a);if(t>0)f=Ft(g,t);\nelse{u&&It(u);var p=l;u=f=l=v,p&&(c=ge(),o=n.apply(i,e),f||u||(e=i=null))}},y=function(){f&&It(f),u=f=l=v,(s||p!==r)&&(c=ge(),o=n.apply(i,e),f||u||(e=i=null))};return function(){if(e=arguments,a=ge(),i=this,l=s&&(f||!h),p===!1)var t=h&&!f;else{u||h||(c=a);var v=p-(a-c),m=v<=0;m?(u&&(u=It(u)),c=a,o=n.apply(i,e)):u||(u=Ft(y,v))}return m&&f?f=It(f):f||r===p||(f=Ft(g,r)),t&&(m=!0,o=n.apply(i,e)),!m||f||u||(e=i=null),o}}function Lr(n){if(!In(n))throw new kt;var r=p(arguments,1);return Ft(function(){n.apply(v,r);\n\n},1)}function Pr(n,r){if(!In(n))throw new kt;var t=p(arguments,2);return Ft(function(){n.apply(v,t)},r)}function Kr(n,r){if(!In(n))throw new kt;var t=function(){var e=t.cache,u=r?r.apply(this,arguments):m+arguments[0];return Tt.call(e,u)?e[u]:e[u]=n.apply(this,arguments)};return t.cache={},t}function Ur(n){var r,t;if(!In(n))throw new kt;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}}function Mr(n){return an(n,16,p(arguments,1))}function Vr(n){return an(n,32,null,p(arguments,1));\n\n}function Gr(n,r,t){var e=!0,u=!0;if(!In(n))throw new kt;return t===!1?e=!1:Sn(t)&&(e=\"leading\"in t?t.leading:e,u=\"trailing\"in t?t.trailing:u),U.leading=e,U.maxWait=r,U.trailing=u,zr(n,r,U)}function Hr(n,r){return an(r,16,[n])}function Jr(n){return function(){return n}}function Qr(n,r,t){var e=typeof n;if(null==n||\"function\"==e)return Q(n,r,t);if(\"object\"!=e)return tt(n);var u=ne(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Sn(a)?function(r){for(var t=u.length,e=!1;t--&&(e=rn(r[u[t]],n[u[t]],null,!0)););\nreturn e}:function(n){var r=n[o];return a===r&&(0!==a||1/a==1/r)}}function Xr(n){return null==n?\"\":jt(n).replace(ue,fn)}function Yr(n){return n}function Zr(n,r,t){var e=!0,u=r&&wn(r);r&&(t||u.length)||(null==t&&(t=r),o=g,r=n,n=h,u=wn(r)),t===!1?e=!1:Sn(t)&&\"chain\"in t&&(e=t.chain);var o=n,a=In(o);Xn(u,function(t){var u=n[t]=r[t];a&&(o.prototype[t]=function(){var r=this.__chain__,t=this.__wrapped__,a=[t];$t.apply(a,arguments);var i=u.apply(n,a);if(e||r){if(t===i&&Sn(i))return this;i=new o(i),i.__chain__=r;\n\n}return i})})}function nt(){return t._=Ot,this}function rt(){}function tt(n){return function(r){return r[n]}}function et(n,r,t){var e=null==n,u=null==r;if(null==t&&(\"boolean\"==typeof n&&u?(t=n,n=1):u||\"boolean\"!=typeof r||(t=r,u=!0)),e&&u&&(r=1),n=+n||0,u?(r=n,n=0):r=+r||0,t||n%1||r%1){var o=Ht();return Vt(n+o*(r-n+parseFloat(\"1e-\"+((o+\"\").length-1))),r)}return en(n,r)}function ut(n,r){if(n){var t=n[r];return In(t)?n[r]():t}}function ot(n,r,t){var e=h.templateSettings;n=jt(n||\"\"),t=ae({},t,e);var u,o=ae({},t.imports,e.imports),i=ne(o),f=Un(o),l=0,c=t.interpolate||E,p=\"__p += '\",s=wt((t.escape||E).source+\"|\"+c.source+\"|\"+(c===N?x:E).source+\"|\"+(t.evaluate||E).source+\"|$\",\"g\");\n\nn.replace(s,function(r,t,e,o,i,f){return e||(e=o),p+=n.slice(l,f).replace(S,a),t&&(p+=\"' +\\n__e(\"+t+\") +\\n'\"),i&&(u=!0,p+=\"';\\n\"+i+\";\\n__p += '\"),e&&(p+=\"' +\\n((__t = (\"+e+\")) == null ? '' : __t) +\\n'\"),l=f+r.length,r}),p+=\"';\\n\";var g=t.variable,y=g;y||(g=\"obj\",p=\"with (\"+g+\") {\\n\"+p+\"\\n}\\n\"),p=(u?p.replace(w,\"\"):p).replace(j,\"$1\").replace(k,\"$1;\"),p=\"function(\"+g+\") {\\n\"+(y?\"\":g+\" || (\"+g+\" = {});\\n\")+\"var __t, __p = '', __e = _.escape\"+(u?\", __j = Array.prototype.join;\\nfunction print() { __p += __j.call(arguments, '') }\\n\":\";\\n\")+p+\"return __p\\n}\";\n\nvar m=\"\\n/*\\n//# sourceURL=\"+(t.sourceURL||\"/lodash/template/source[\"+D++ +\"]\")+\"\\n*/\";try{var b=mt(i,\"return \"+p+m).apply(v,f)}catch(_){throw _.source=p,_}return r?b(r):(b.source=p,b)}function at(n,r,t){n=(n=+n)>-1?n:0;var e=-1,u=ht(n);for(r=Q(r,t,1);++e/g,evaluate:/<%([\\s\\S]+?)%>/g,interpolate:N,\nvariable:\"\",imports:{_:h}},zt||(J=function(){function n(){}return function(r){if(Sn(r)){n.prototype=r;var e=new n;n.prototype=null}return e||t.Object()}}());var Xt=qt?function(n,r){M.value=r,qt(n,\"__bindData__\",M),M.value=null}:rt,Yt=Lt||function(n){return n&&\"object\"==typeof n&&\"number\"==typeof n.length&&Nt.call(n)==$||!1},Zt=function(n){var r,t=n,e=[];if(!t)return e;if(!V[typeof n])return e;for(r in t)Tt.call(t,r)&&e.push(r);return e},ne=Ut?function(n){return Sn(n)?Ut(n):[]}:Zt,re={\"&\":\"&\",\n\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"},te=kn(re),ee=wt(\"(\"+ne(te).join(\"|\")+\")\",\"g\"),ue=wt(\"[\"+ne(re).join(\"\")+\"]\",\"g\"),oe=function(n,r,t){var e,u=n,o=u;if(!u)return o;var a=arguments,i=0,f=\"number\"==typeof t?2:a.length;if(f>3&&\"function\"==typeof a[f-2])var l=Q(a[--f-1],a[f--],2);else f>2&&\"function\"==typeof a[f-1]&&(l=a[--f]);for(;++i/g,R=RegExp(\"^[\"+d+\"]*0+(?=.$)\"),E=/($^)/,I=/\\bthis\\b/,S=/['\\n\\r\\t\\u2028\\u2029\\\\]/g,A=[\"Array\",\"Boolean\",\"Date\",\"Function\",\"Math\",\"Number\",\"Object\",\"RegExp\",\"String\",\"_\",\"attachEvent\",\"clearTimeout\",\"isFinite\",\"isNaN\",\"parseInt\",\"setTimeout\"],D=0,T=\"[object Arguments]\",$=\"[object Array]\",F=\"[object Boolean]\",B=\"[object Date]\",W=\"[object Function]\",q=\"[object Number]\",z=\"[object Object]\",L=\"[object RegExp]\",P=\"[object String]\",K={};\n\nK[W]=!1,K[T]=K[$]=K[F]=K[B]=K[q]=K[z]=K[L]=K[P]=!0;var U={leading:!1,maxWait:0,trailing:!1},M={configurable:!1,enumerable:!1,value:null,writable:!1},V={\"boolean\":!1,\"function\":!0,object:!0,number:!1,string:!1,undefined:!1},G={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\t\":\"t\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},H=V[typeof window]&&window||this,J=V[typeof exports]&&exports&&!exports.nodeType&&exports,Q=V[typeof module]&&module&&!module.nodeType&&module,X=Q&&Q.exports===J&&J,Y=V[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(H=Y);\n\nvar Z=s();\"function\"==typeof define&&\"object\"==typeof define.amd&&define.amd?(H._=Z,define(function(){return Z})):J&&Q?X?(Q.exports=Z)._=Z:J._=Z:H._=Z}).call(this);","!function(e,n){\"use strict\";var t=6,o=4,i=\"asc\",r=\"desc\",l=\"_ng_field_\",a=\"_ng_depth_\",s=\"_ng_hidden_\",c=\"_ng_column_\",g=/CUSTOM_FILTERS/g,d=/COL_FIELD/g,u=/DISPLAY_CELL_TEMPLATE/g,f=/EDITABLE_CELL_TEMPLATE/g,h=/CELL_EDITABLE_CONDITION/g,p=/<.+>/,m=/(\\([^)]*\\))?$/,v=/\\./g,w=/'/g,C=/^(.*)((?:\\s*\\[\\s*\\d+\\s*\\]\\s*)|(?:\\s*\\[\\s*\"(?:[^\"\\\\]|\\\\.)*\"\\s*\\]\\s*)|(?:\\s*\\[\\s*'(?:[^'\\\\]|\\\\.)*'\\s*\\]\\s*))(.*)$/;e.ngGrid={},e.ngGrid.i18n={};var b=(angular.module(\"ngGrid.services\",[]),angular.module(\"ngGrid.directives\",[])),S=angular.module(\"ngGrid.filters\",[]);angular.module(\"ngGrid\",[\"ngGrid.services\",\"ngGrid.directives\",\"ngGrid.filters\"]);var y=function(e,n,o,i){if(void 0===e.selectionProvider.selectedItems||i.config.noKeyboardNavigation)return!0;if(\"INPUT\"===document.activeElement.tagName)return!0;var r,l=o.which||o.keyCode,a=!1,s=!1,c=void 0===e.selectionProvider.lastClickedRow?1:e.selectionProvider.lastClickedRow.rowIndex,g=e.columns.filter(function(e){return e.visible&&e.width>0}),d=e.columns.filter(function(e){return e.pinned});if(e.col&&(r=g.indexOf(e.col)),37!==l&&38!==l&&39!==l&&40!==l&&(i.config.noTabInterference||9!==l)&&13!==l)return!0;if(e.enableCellSelection){9===l&&o.preventDefault();var u=e.showSelectionCheckbox?1===r:0===r,f=1===r||0===r,h=r===g.length-1||r===g.length-2,p=g.indexOf(e.col)===g.length-1,m=d.indexOf(e.col)===d.length-1;if(37===l||9===l&&o.shiftKey){var v=0;u||(r-=1),f?u&&9===l&&o.shiftKey?(v=i.$canvas.width(),r=g.length-1,s=!0):v=i.$viewport.scrollLeft()-e.col.width:d.length>0&&(v=i.$viewport.scrollLeft()-g[r].width),i.$viewport.scrollLeft(v)}else(39===l||9===l&&!o.shiftKey)&&(h?p&&9===l&&!o.shiftKey?(i.$viewport.scrollLeft(0),r=e.showSelectionCheckbox?1:0,a=!0):i.$viewport.scrollLeft(i.$viewport.scrollLeft()+e.col.width):m&&i.$viewport.scrollLeft(0),p||(r+=1))}var w;w=e.configGroups.length>0?i.rowFactory.parsedData.filter(function(e){return!e.isAggRow}):i.filteredRows;var C=0;if(0!==c&&(38===l||13===l&&o.shiftKey||9===l&&o.shiftKey&&s)?C=-1:c!==w.length-1&&(40===l||13===l&&!o.shiftKey||9===l&&a)&&(C=1),C){var b=w[c+C];b.beforeSelectionChange(b,o)&&(b.continueSelection(o),e.$emit(\"ngGridEventDigestGridParent\"),e.selectionProvider.lastClickedRow.renderedRowIndex>=e.renderedRows.length-t-2?i.$viewport.scrollTop(i.$viewport.scrollTop()+e.rowHeight):e.selectionProvider.lastClickedRow.renderedRowIndex<=t+2&&i.$viewport.scrollTop(i.$viewport.scrollTop()-e.rowHeight))}return e.enableCellSelection&&setTimeout(function(){e.domAccessProvider.focusCellElement(e,e.renderedColumns.indexOf(g[r]))},3),!1};String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\\s+|\\s+$/g,\"\")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var n=this.length>>>0,t=Number(arguments[1])||0;for(t=0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n);n>t;t++)if(t in this&&this[t]===e)return t;return-1}),Array.prototype.filter||(Array.prototype.filter=function(e){var n=Object(this),t=n.length>>>0;if(\"function\"!=typeof e)throw new TypeError;for(var o=[],i=arguments[1],r=0;t>r;r++)if(r in n){var l=n[r];e.call(i,l,r,n)&&o.push(l)}return o}),S.filter(\"checkmark\",function(){return function(e){return e?\"✔\":\"✘\"}}),S.filter(\"ngColumns\",function(){return function(e){return e.filter(function(e){return!e.isAggCol})}}),angular.module(\"ngGrid.services\").factory(\"$domUtilityService\",[\"$utilityService\",\"$window\",function(e,t){var o={},i={},r=function(){var e=n(\"\");e.appendTo(\"body\"),e.height(100).width(100).css(\"position\",\"absolute\").css(\"overflow\",\"scroll\"),e.append(''),o.ScrollH=e.height()-e[0].clientHeight,o.ScrollW=e.width()-e[0].clientWidth,e.empty(),e.attr(\"style\",\"\"),e.append('M'),o.LetterW=e.children().first().width(),e.remove()};return o.eventStorage={},o.AssignGridContainers=function(e,t,i){i.$root=n(t),i.$topPanel=i.$root.find(\".ngTopPanel\"),i.$groupPanel=i.$root.find(\".ngGroupPanel\"),i.$headerContainer=i.$topPanel.find(\".ngHeaderContainer\"),e.$headerContainer=i.$headerContainer,i.$headerScroller=i.$topPanel.find(\".ngHeaderScroller\"),i.$headers=i.$headerScroller.children(),i.$viewport=i.$root.find(\".ngViewport\"),i.$canvas=i.$viewport.find(\".ngCanvas\"),i.$footerPanel=i.$root.find(\".ngFooterPanel\");var r=e.$watch(function(){return i.$viewport.scrollLeft()},function(e){return i.$headerContainer.scrollLeft(e)});e.$on(\"$destroy\",function(){i.$root&&(n(i.$root.parent()).off(\"resize.nggrid\"),i.$root=null,i.$topPanel=null,i.$headerContainer=null,i.$headers=null,i.$canvas=null,i.$footerPanel=null),r()}),o.UpdateGridLayout(e,i)},o.getRealWidth=function(e){var t=0,o={visibility:\"hidden\",display:\"block\"},i=e.parents().andSelf().not(\":visible\");return n.swap(i[0],o,function(){t=e.outerWidth()}),t},o.UpdateGridLayout=function(e,n){if(n.$root){var t=n.$viewport.scrollTop();n.elementDims.rootMaxW=n.$root.width(),n.$root.is(\":hidden\")&&(n.elementDims.rootMaxW=o.getRealWidth(n.$root)),n.elementDims.rootMaxH=n.$root.height(),n.refreshDomSizes(),e.adjustScrollTop(t,!0)}},o.numberOfGrids=0,o.setStyleText=function(e,n){var o=e.styleSheet,i=e.gridId,r=t.document;o||(o=r.getElementById(i)),o||(o=r.createElement(\"style\"),o.type=\"text/css\",o.id=i,(r.head||r.getElementsByTagName(\"head\")[0]).appendChild(o)),o.styleSheet&&!o.sheet?o.styleSheet.cssText=n:o.innerHTML=n,e.styleSheet=o,e.styleText=n},o.BuildStyles=function(e,n,t){var i,r=n.config.rowHeight,l=n.gridId,a=e.columns,s=0,c=e.totalRowWidth();i=\".\"+l+\" .ngCanvas { width: \"+c+\"px; }.\"+l+\" .ngRow { width: \"+c+\"px; }.\"+l+\" .ngCanvas { width: \"+c+\"px; }.\"+l+\" .ngHeaderScroller { width: \"+(c+o.ScrollH)+\"px}\";for(var g=0;ge?-1:1},t.sortNumber=function(e,n){return e-n},t.sortNumberStr=function(e,n){var t,o,i=!1,r=!1;return t=parseFloat(e.replace(/[^0-9.-]/g,\"\")),isNaN(t)&&(i=!0),o=parseFloat(n.replace(/[^0-9.-]/g,\"\")),isNaN(o)&&(r=!0),i&&r?0:i?1:r?-1:t-o},t.sortAlpha=function(e,n){var t=e.toLowerCase(),o=n.toLowerCase();return t===o?0:o>t?-1:1},t.sortDate=function(e,n){var t=e.getTime(),o=n.getTime();return t===o?0:o>t?-1:1},t.sortBool=function(e,n){return e&&n?0:e||n?e?1:-1:0},t.sortData=function(e,o){if(o&&e){var r,l,a=e.fields.length,s=e.fields,c=o.slice(0);o.sort(function(o,g){for(var d,u,f=0,h=0;0===f&&a>h;){r=e.columns[h],l=e.directions[h],u=t.getSortFn(r,c);var p=n.evalProperty(o,s[h]),m=n.evalProperty(g,s[h]);t.isCustomSort?(d=u(p,m),f=l===i?d:0-d):null==p||null==m?null==m&&null==p?f=0:null==p?f=1:null==m&&(f=-1):(d=u(p,m),f=l===i?d:0-d),h++}return f})}},t.Sort=function(e,n){t.isSorting||(t.isSorting=!0,t.sortData(e,n),t.isSorting=!1)},t.getSortFn=function(n,o){var i,r;if(t.colSortFnCache[n.field])i=t.colSortFnCache[n.field];else if(void 0!==n.sortingAlgorithm)i=n.sortingAlgorithm,t.colSortFnCache[n.field]=n.sortingAlgorithm,t.isCustomSort=!0;else{if(r=o[0],!r)return i;i=t.guessSortFn(e(\"entity['\"+n.field.replace(v,\"']['\")+\"']\")({entity:r})),i?t.colSortFnCache[n.field]=i:i=t.sortAlpha}return i},t}]),angular.module(\"ngGrid.services\").factory(\"$utilityService\",[\"$parse\",function(t){var o=/function (.{1,})\\(/,i={visualLength:function(e){var t=document.getElementById(\"testDataLength\");t||(t=document.createElement(\"SPAN\"),t.id=\"testDataLength\",t.style.visibility=\"hidden\",document.body.appendChild(t));var o=n(e);n(t).css({font:o.css(\"font\"),\"font-size\":o.css(\"font-size\"),\"font-family\":o.css(\"font-family\")}),t.innerHTML=o.text();var i=t.offsetWidth;return document.body.removeChild(t),i},forIn:function(e,n){for(var t in e)e.hasOwnProperty(t)&&n(e[t],t)},endsWith:function(e,n){return e&&n&&\"string\"==typeof e?-1!==e.indexOf(n,e.length-n.length):!1},isNullOrUndefined:function(e){return void 0===e||null===e?!0:!1},getElementsByClassName:function(e){if(document.getElementsByClassName)return document.getElementsByClassName(e);for(var n=[],t=new RegExp(\"\\\\b\"+e+\"\\\\b\"),o=document.getElementsByTagName(\"*\"),i=0;i1){var t=n[1].replace(/^\\s+|\\s+$/g,\"\");return t}return\"\"},init:function(){function e(n){var t=C.exec(n);if(t)return(t[1]?e(t[1]):t[1])+t[2]+(t[3]?e(t[3]):t[3]);n=n.replace(w,\"\\\\'\");var o=n.split(v),i=[o.shift()];return angular.forEach(o,function(e){i.push(e.replace(m,\"']$1\"))}),i.join(\"['\")}return this.preEval=e,this.evalProperty=function(n,o){return t(e(\"entity.\"+o))({entity:n})},delete this.init,this}}.init();return i}]);var x=function(e,n,t,o){this.rowIndex=0,this.offsetTop=this.rowIndex*t,this.entity=e,this.label=e.gLabel,this.field=e.gField,this.depth=e.gDepth,this.parent=e.parent,this.children=e.children,this.aggChildren=e.aggChildren,this.aggIndex=e.aggIndex,this.collapsed=o,this.groupInitState=o,this.rowFactory=n,this.rowHeight=t,this.isAggRow=!0,this.offsetLeft=25*e.gDepth,this.aggLabelFilter=e.aggLabelFilter};x.prototype.toggleExpand=function(){this.collapsed=this.collapsed?!1:!0,this.orig&&(this.orig.collapsed=this.collapsed),this.notifyChildren()},x.prototype.setExpand=function(e){this.collapsed=e,this.orig&&(this.orig.collapsed=e),this.notifyChildren()},x.prototype.notifyChildren=function(){for(var e=Math.max(this.rowFactory.aggCache.length,this.children.length),n=0;e>n;n++)if(this.aggChildren[n]&&(this.aggChildren[n].entity[s]=this.collapsed,this.collapsed&&this.aggChildren[n].setExpand(this.collapsed)),this.children[n]&&(this.children[n][s]=this.collapsed),n>this.aggIndex&&this.rowFactory.aggCache[n]){var t=this.rowFactory.aggCache[n],o=30*this.children.length;t.offsetTop=this.collapsed?t.offsetTop-o:t.offsetTop+o}this.rowFactory.renderedChange()},x.prototype.aggClass=function(){return this.collapsed?\"ngAggArrowCollapsed\":\"ngAggArrowExpanded\"},x.prototype.totalChildren=function(){if(this.aggChildren.length>0){var e=0,n=function(t){t.aggChildren.length>0?angular.forEach(t.aggChildren,function(e){n(e)}):e+=t.children.length};return n(this),e}return this.children.length},x.prototype.copy=function(){var e=new x(this.entity,this.rowFactory,this.rowHeight,this.groupInitState);return e.orig=this,e};var P=function(e,t,o,l,a,s){var c=this,d=e.colDef,u=500,f=0,h=null;c.colDef=e.colDef,c.width=d.width,c.groupIndex=0,c.isGroupedBy=!1,c.minWidth=d.minWidth?d.minWidth:50,c.maxWidth=d.maxWidth?d.maxWidth:9e3,c.enableCellEdit=void 0!==d.enableCellEdit?d.enableCellEdit:e.enableCellEdit||e.enableCellEditOnFocus,c.cellEditableCondition=d.cellEditableCondition||e.cellEditableCondition||\"true\",c.headerRowHeight=e.headerRowHeight,c.displayName=void 0===d.displayName?d.field:d.displayName,c.index=e.index,c.isAggCol=e.isAggCol,c.cellClass=d.cellClass,c.sortPriority=void 0,c.cellFilter=d.cellFilter?d.cellFilter:\"\",c.field=d.field,c.aggLabelFilter=d.aggLabelFilter||d.cellFilter,c.visible=s.isNullOrUndefined(d.visible)||d.visible,c.sortable=!1,c.resizable=!1,c.pinnable=!1,c.pinned=e.enablePinning&&d.pinned,c.originalIndex=null==e.originalIndex?c.index:e.originalIndex,c.groupable=s.isNullOrUndefined(d.groupable)||d.groupable,e.enableSort&&(c.sortable=s.isNullOrUndefined(d.sortable)||d.sortable),e.enableResize&&(c.resizable=s.isNullOrUndefined(d.resizable)||d.resizable),e.enablePinning&&(c.pinnable=s.isNullOrUndefined(d.pinnable)||d.pinnable),c.sortDirection=void 0,c.sortingAlgorithm=d.sortFn,c.headerClass=d.headerClass,c.cursor=c.sortable?\"pointer\":\"default\",c.headerCellTemplate=d.headerCellTemplate||a.get(\"headerCellTemplate.html\"),c.cellTemplate=d.cellTemplate||a.get(\"cellTemplate.html\").replace(g,c.cellFilter?\"|\"+c.cellFilter:\"\"),c.enableCellEdit&&(c.cellEditTemplate=d.cellEditTemplate||a.get(\"cellEditTemplate.html\"),c.editableCellTemplate=d.editableCellTemplate||a.get(\"editableCellTemplate.html\")),d.cellTemplate&&!p.test(d.cellTemplate)&&(c.cellTemplate=a.get(d.cellTemplate)||n.ajax({type:\"GET\",url:d.cellTemplate,async:!1}).responseText),c.enableCellEdit&&d.editableCellTemplate&&!p.test(d.editableCellTemplate)&&(c.editableCellTemplate=a.get(d.editableCellTemplate)||n.ajax({type:\"GET\",url:d.editableCellTemplate,async:!1}).responseText),d.headerCellTemplate&&!p.test(d.headerCellTemplate)&&(c.headerCellTemplate=a.get(d.headerCellTemplate)||n.ajax({type:\"GET\",url:d.headerCellTemplate,async:!1}).responseText),c.colIndex=function(){var e=c.pinned?\"pinned \":\"\";return e+=\"col\"+c.index+\" colt\"+c.index,c.cellClass&&(e+=\" \"+c.cellClass),e},c.groupedByClass=function(){return c.isGroupedBy?\"ngGroupedByIcon\":\"ngGroupIcon\"},c.toggleVisible=function(){c.visible=!c.visible},c.showSortButtonUp=function(){return c.sortable?c.sortDirection===r:c.sortable},c.showSortButtonDown=function(){return c.sortable?c.sortDirection===i:c.sortable},c.noSortVisible=function(){return!c.sortDirection},c.sort=function(n){if(!c.sortable)return!0;var t=c.sortDirection===i?r:i;return c.sortDirection=t,e.sortCallback(c,n),!1},c.gripClick=function(){f++,1===f?h=setTimeout(function(){f=0},u):(clearTimeout(h),e.resizeOnDataCallback(c),f=0)},c.gripOnMouseDown=function(e){return t.isColumnResizing=!0,e.ctrlKey&&!c.pinned?(c.toggleVisible(),l.BuildStyles(t,o),!0):(e.target.parentElement.style.cursor=\"col-resize\",c.startMousePosition=e.clientX,c.origWidth=c.width,n(document).mousemove(c.onMouseMove),n(document).mouseup(c.gripOnMouseUp),!1)},c.onMouseMove=function(e){var n=e.clientX-c.startMousePosition,i=n+c.origWidth;return c.width=ic.maxWidth?c.maxWidth:i,t.hasUserChangedGridColumnWidths=!0,l.BuildStyles(t,o),!1},c.gripOnMouseUp=function(e){return n(document).off(\"mousemove\",c.onMouseMove),n(document).off(\"mouseup\",c.gripOnMouseUp),e.target.parentElement.style.cursor=\"default\",l.digest(t),t.isColumnResizing=!1,!1},c.copy=function(){var n=new P(e,t,o,l,a,s);return n.isClone=!0,n.orig=c,n},c.setVars=function(e){c.orig=e,c.width=e.width,c.groupIndex=e.groupIndex,c.isGroupedBy=e.isGroupedBy,c.displayName=e.displayName,c.index=e.index,c.isAggCol=e.isAggCol,c.cellClass=e.cellClass,c.cellFilter=e.cellFilter,c.field=e.field,c.aggLabelFilter=e.aggLabelFilter,c.visible=e.visible,c.sortable=e.sortable,c.resizable=e.resizable,c.pinnable=e.pinnable,c.pinned=e.pinned,c.originalIndex=e.originalIndex,c.sortDirection=e.sortDirection,c.sortingAlgorithm=e.sortingAlgorithm,c.headerClass=e.headerClass,c.headerCellTemplate=e.headerCellTemplate,c.cellTemplate=e.cellTemplate,c.cellEditTemplate=e.cellEditTemplate}},T=function(e){this.outerHeight=null,this.outerWidth=null,n.extend(this,e)},I=function(e){this.previousColumn=null,this.grid=e};I.prototype.changeUserSelect=function(e,n){e.css({\"-webkit-touch-callout\":n,\"-webkit-user-select\":n,\"-khtml-user-select\":n,\"-moz-user-select\":\"none\"===n?\"-moz-none\":n,\"-ms-user-select\":n,\"user-select\":n})},I.prototype.focusCellElement=function(e,n){if(e.selectionProvider.lastClickedRow){var t=void 0!==n?n:this.previousColumn,o=e.selectionProvider.lastClickedRow.clone?e.selectionProvider.lastClickedRow.clone.elm:e.selectionProvider.lastClickedRow.elm;if(void 0!==t&&o){var i=angular.element(o[0].children).filter(function(){return 8!==this.nodeType}),r=Math.max(Math.min(e.renderedColumns.length-1,t),0);this.grid.config.showSelectionCheckbox&&angular.element(i[r]).scope()&&0===angular.element(i[r]).scope().col.index&&(r=1),i[r]&&i[r].children[1].children[0].focus(),this.previousColumn=t}}},I.prototype.selectionHandlers=function(e,n){function t(t){if(16===t.keyCode)return r.changeUserSelect(n,\"none\",t),!0;if(!i){i=!0;var o=y(e,n,t,r.grid);return i=!1,o}return!0}function o(e){return 16===e.keyCode&&r.changeUserSelect(n,\"text\",e),!0}var i=!1,r=this;n.bind(\"keydown\",t),n.bind(\"keyup\",o),n.on(\"$destroy\",function(){n.off(\"keydown\",t),n.off(\"keyup\",o)})};var $=function(t,o,i,r){var l=this;l.colToMove=void 0,l.groupToMove=void 0,l.assignEvents=function(){t.config.jqueryUIDraggable&&!t.config.enablePinning?(t.$groupPanel.droppable({addClasses:!1,drop:function(e){l.onGroupDrop(e)}}),t.$groupPanel.on(\"$destroy\",function(){t.$groupPanel=null})):(t.$groupPanel.on(\"mousedown\",l.onGroupMouseDown).on(\"dragover\",l.dragOver).on(\"drop\",l.onGroupDrop),t.$topPanel.on(\"mousedown\",\".ngHeaderScroller\",l.onHeaderMouseDown).on(\"dragover\",\".ngHeaderScroller\",l.dragOver),t.$groupPanel.on(\"$destroy\",function(){t.$groupPanel&&t.$groupPanel.off(\"mousedown\"),t.$groupPanel=null}),t.config.enableColumnReordering&&t.$topPanel.on(\"drop\",\".ngHeaderScroller\",l.onHeaderDrop),t.$topPanel.on(\"$destroy\",function(){t.$topPanel&&t.$topPanel.off(\"mousedown\"),t.config.enableColumnReordering&&t.$topPanel&&t.$topPanel.off(\"drop\"),t.$topPanel=null})),o.$on(\"$destroy\",o.$watch(\"renderedColumns\",function(){r(l.setDraggables)}))},l.dragStart=function(e){e.dataTransfer.setData(\"text\",\"\")},l.dragOver=function(e){e.preventDefault()},l.setDraggables=function(){if(t.config.jqueryUIDraggable)t.$root&&t.$root.find(\".ngHeaderSortColumn\").draggable({helper:\"clone\",appendTo:\"body\",stack:\"div\",addClasses:!1,start:function(e){l.onHeaderMouseDown(e)}}).droppable({drop:function(e){l.onHeaderDrop(e)}});else if(t.$root){var e=t.$root.find(\".ngHeaderSortColumn\");if(angular.forEach(e,function(e){e.className&&-1!==e.className.indexOf(\"ngHeaderSortColumn\")&&(e.setAttribute(\"draggable\",\"true\"),e.addEventListener&&(e.addEventListener(\"dragstart\",l.dragStart),angular.element(e).on(\"$destroy\",function(){angular.element(e).off(\"dragstart\",l.dragStart),e.removeEventListener(\"dragstart\",l.dragStart)})))}),-1!==navigator.userAgent.indexOf(\"MSIE\")){var n=t.$root.find(\".ngHeaderSortColumn\");n.bind(\"selectstart\",function(){return this.dragDrop(),!1}),angular.element(n).on(\"$destroy\",function(){n.off(\"selectstart\")})}}},l.onGroupMouseDown=function(e){var o=n(e.target);if(\"ngRemoveGroup\"!==o[0].className){var i=angular.element(o).scope();i&&(t.config.jqueryUIDraggable||(o.attr(\"draggable\",\"true\"),this.addEventListener&&(this.addEventListener(\"dragstart\",l.dragStart),angular.element(this).on(\"$destroy\",function(){this.removeEventListener(\"dragstart\",l.dragStart)})),-1!==navigator.userAgent.indexOf(\"MSIE\")&&(o.bind(\"selectstart\",function(){return this.dragDrop(),!1}),o.on(\"$destroy\",function(){o.off(\"selectstart\")}))),l.groupToMove={header:o,groupName:i.group,index:i.$index})}else l.groupToMove=void 0},l.onGroupDrop=function(e){e.stopPropagation();var i,r;l.groupToMove?(i=n(e.target).closest(\".ngGroupElement\"),\"ngGroupPanel\"===i.context.className?(o.configGroups.splice(l.groupToMove.index,1),o.configGroups.push(l.groupToMove.groupName)):(r=angular.element(i).scope(),r&&l.groupToMove.index!==r.$index&&(o.configGroups.splice(l.groupToMove.index,1),o.configGroups.splice(r.$index,0,l.groupToMove.groupName))),l.groupToMove=void 0,t.fixGroupIndexes()):l.colToMove&&(-1===o.configGroups.indexOf(l.colToMove.col)&&(i=n(e.target).closest(\".ngGroupElement\"),\"ngGroupPanel\"===i.context.className||\"ngGroupPanelDescription ng-binding\"===i.context.className?o.groupBy(l.colToMove.col):(r=angular.element(i).scope(),r&&o.removeGroup(r.$index))),l.colToMove=void 0),o.$$phase||o.$apply()},l.onHeaderMouseDown=function(e){var t=n(e.target).closest(\".ngHeaderSortColumn\"),o=angular.element(t).scope();o&&(l.colToMove={header:t,col:o.col})},l.onHeaderDrop=function(e){if(l.colToMove&&!l.colToMove.col.pinned){var r=n(e.target).closest(\".ngHeaderSortColumn\"),a=angular.element(r).scope();if(a){if(l.colToMove.col===a.col||a.col.pinned)return;o.columns.splice(l.colToMove.col.index,1),o.columns.splice(a.col.index,0,l.colToMove.col),t.fixColumnIndexes(),l.colToMove=void 0,i.digest(o)}}},l.assignGridEventHandlers=function(){-1===t.config.tabIndex?(t.$viewport.attr(\"tabIndex\",i.numberOfGrids),i.numberOfGrids++):t.$viewport.attr(\"tabIndex\",t.config.tabIndex);var r,l=function(){clearTimeout(r),r=setTimeout(function(){i.RebuildGrid(o,t)},100)};n(e).on(\"resize.nggrid\",l);var a,s=function(){clearTimeout(a),a=setTimeout(function(){i.RebuildGrid(o,t)},100)};n(t.$root.parent()).on(\"resize.nggrid\",s),o.$on(\"$destroy\",function(){n(e).off(\"resize.nggrid\",l)})},l.assignGridEventHandlers(),l.assignEvents()},L=function(e,n){e.maxRows=function(){var t=Math.max(e.totalServerItems,n.data.length);return t},e.$on(\"$destroy\",e.$watch(\"totalServerItems\",function(){e.currentMaxPages=e.maxPages()})),e.multiSelect=n.config.enableRowSelection&&n.config.multiSelect,e.selectedItemCount=n.selectedItemCount,e.maxPages=function(){return 0===e.maxRows()?1:Math.ceil(e.maxRows()/e.pagingOptions.pageSize)},e.pageForward=function(){var n=e.pagingOptions.currentPage;e.totalServerItems>0?e.pagingOptions.currentPage=Math.min(n+1,e.maxPages()):e.pagingOptions.currentPage++},e.pageBackward=function(){var n=e.pagingOptions.currentPage;e.pagingOptions.currentPage=Math.max(n-1,1)},e.pageToFirst=function(){e.pagingOptions.currentPage=1},e.pageToLast=function(){var n=e.maxPages();e.pagingOptions.currentPage=n},e.cantPageForward=function(){var t=e.pagingOptions.currentPage,o=e.maxPages();return e.totalServerItems>0?t>=o:n.data.length<1},e.cantPageToLast=function(){return e.totalServerItems>0?e.cantPageForward():!0},e.cantPageBackward=function(){var n=e.pagingOptions.currentPage;return 1>=n}},D=function(i,r,l,a,c,g,d,u,f,h,m){var v={aggregateTemplate:void 0,afterSelectionChange:function(){},beforeSelectionChange:function(){return!0},checkboxCellTemplate:void 0,checkboxHeaderTemplate:void 0,columnDefs:void 0,data:[],dataUpdated:function(){},enableCellEdit:!1,enableCellEditOnFocus:!1,enableCellSelection:!1,enableColumnResize:!1,enableColumnReordering:!1,enableColumnHeavyVirt:!1,enablePaging:!1,enablePinning:!1,enableRowSelection:!0,enableSorting:!0,enableHighlighting:!1,excludeProperties:[],filterOptions:{filterText:\"\",useExternalFilter:!1},footerRowHeight:55,footerTemplate:void 0,forceSyncScrolling:!0,groups:[],groupsCollapsedByDefault:!0,headerRowHeight:30,headerRowTemplate:void 0,jqueryUIDraggable:!1,jqueryUITheme:!1,keepLastSelected:!0,maintainColumnRatios:void 0,menuTemplate:void 0,multiSelect:!0,pagingOptions:{pageSizes:[250,500,1e3],pageSize:250,currentPage:1},pinSelectionCheckbox:!1,plugins:[],primaryKey:void 0,rowHeight:30,rowTemplate:void 0,selectedItems:[],selectionCheckboxColumnWidth:25,selectWithCheckboxOnly:!1,showColumnMenu:!1,showFilter:!1,showFooter:!1,showGroupPanel:!1,showSelectionCheckbox:!1,sortInfo:{fields:[],columns:[],directions:[]},tabIndex:-1,totalServerItems:0,useExternalSorting:!1,i18n:\"en\",virtualizationThreshold:50,noTabInterference:!1},w=this;w.maxCanvasHt=0,w.config=n.extend(v,e.ngGrid.config,r),w.config.showSelectionCheckbox=w.config.showSelectionCheckbox&&w.config.enableColumnHeavyVirt===!1,w.config.enablePinning=w.config.enablePinning&&w.config.enableColumnHeavyVirt===!1,w.config.selectWithCheckboxOnly=w.config.selectWithCheckboxOnly&&w.config.showSelectionCheckbox!==!1,w.config.pinSelectionCheckbox=w.config.enablePinning,\"string\"==typeof r.columnDefs&&(w.config.columnDefs=i.$eval(r.columnDefs)),w.rowCache=[],w.rowMap=[],w.gridId=\"ng\"+d.newId(),w.$root=null,w.$groupPanel=null,w.$topPanel=null,w.$headerContainer=null,w.$headerScroller=null,w.$headers=null,w.$viewport=null,w.$canvas=null,w.rootDim=w.config.gridDim,w.data=[],w.lateBindColumns=!1,w.filteredRows=[],w.initTemplates=function(){var e=[\"rowTemplate\",\"aggregateTemplate\",\"headerRowTemplate\",\"checkboxCellTemplate\",\"checkboxHeaderTemplate\",\"menuTemplate\",\"footerTemplate\"],n=[];return angular.forEach(e,function(e){n.push(w.getTemplate(e))}),m.all(n)},w.getTemplate=function(e){var n=w.config[e],t=w.gridId+e+\".html\",o=m.defer();if(n&&!p.test(n))h.get(n,{cache:g}).success(function(e){g.put(t,e),o.resolve()}).error(function(){o.reject(\"Could not load template: \"+n)});else if(n)g.put(t,n),o.resolve();else{var i=e+\".html\";g.put(t,g.get(i)),o.resolve()}return o.promise},\"object\"==typeof w.config.data&&(w.data=w.config.data),w.calcMaxCanvasHeight=function(){var e;return e=w.config.groups.length>0?w.rowFactory.parsedData.filter(function(e){return!e[s]}).length*w.config.rowHeight:w.filteredRows.length*w.config.rowHeight},w.elementDims={scrollW:0,scrollH:0,rowIndexCellW:w.config.selectionCheckboxColumnWidth,rowSelectedCellW:w.config.selectionCheckboxColumnWidth,rootMaxW:0,rootMaxH:0},w.setRenderedRows=function(e){i.renderedRows.length=e.length;for(var n=0;n0){var t=w.config.showSelectionCheckbox?1:0,o=i.configGroups.length;i.configGroups.length=0,angular.forEach(e,function(e,r){r+=t;var l=new P({colDef:e,index:r+o,originalIndex:r,headerRowHeight:w.config.headerRowHeight,sortCallback:w.sortData,resizeOnDataCallback:w.resizeOnData,enableResize:w.config.enableColumnResize,enableSort:w.config.enableSorting,enablePinning:w.config.enablePinning,enableCellEdit:w.config.enableCellEdit||w.config.enableCellEditOnFocus,cellEditableCondition:w.config.cellEditableCondition},i,w,a,g,d),s=w.config.groups.indexOf(e.field);-1!==s&&(l.isGroupedBy=!0,i.configGroups.splice(s,0,l),l.groupIndex=i.configGroups.length),n.push(l)}),i.columns=n,w.config.groups.length>0&&w.rowFactory.getGrouping(w.config.groups)}},w.configureColumnWidths=function(){var e=[],n=[],t=0,o=0,r={};if(angular.forEach(i.columns,function(e,n){if(d.isNullOrUndefined(e.originalIndex))e.isAggCol&&e.visible&&(o+=25);else{var t=e.originalIndex;w.config.showSelectionCheckbox&&(0===e.originalIndex&&e.visible&&(o+=w.config.selectionCheckboxColumnWidth),t--),r[t]=n}}),angular.forEach(w.config.columnDefs,function(l,a){var s=i.columns[r[a]];l.index=a;var c,g=!1;if(d.isNullOrUndefined(l.width)?l.width=\"*\":(g=isNaN(l.width)?d.endsWith(l.width,\"%\"):!1,c=g?l.width:parseInt(l.width,10)),isNaN(c)){if(c=l.width,\"auto\"===c){s.width=s.minWidth,o+=s.width;var u=s;return void i.$on(\"$destroy\",i.$on(\"ngGridEventData\",function(){w.resizeOnData(u)}))}if(-1!==c.indexOf(\"*\"))return s.visible!==!1&&(t+=c.length),void e.push(l);if(g)return void n.push(l);throw'unable to parse column width, use percentage (\"10%\",\"20%\", etc...) or \"*\" to use remaining width of grid'}s.visible!==!1&&(o+=s.width=parseInt(s.width,10))}),n.length>0){w.config.maintainColumnRatios=w.config.maintainColumnRatios!==!1;var l=0,s=0;angular.forEach(n,function(e){var n=i.columns[r[e.index]],t=parseFloat(e.width)/100;l+=t,n.visible||(s+=t)});var c=l-s;angular.forEach(n,function(e){var n=i.columns[r[e.index]],t=parseFloat(e.width)/100;t/=s>0?c:l;var a=w.rootDim.outerWidth*l;n.width=a*t,o+=n.width})}if(e.length>0){w.config.maintainColumnRatios=w.config.maintainColumnRatios!==!1;var g=w.rootDim.outerWidth-o;w.maxCanvasHt>i.viewportDimHeight()&&(g-=a.ScrollW);var u=Math.floor(g/t);angular.forEach(e,function(n,t){var l=i.columns[r[n.index]];l.width=u*n.width.length,l.widthi.viewportDimHeight()&&(c-=a.ScrollW),l.width+=c}})}},w.init=function(){return w.initTemplates().then(function(){i.selectionProvider=new H(w,i,f,d),i.domAccessProvider=new I(w),w.rowFactory=new G(w,i,a,g,d),w.searchProvider=new k(i,w,c,d),w.styleProvider=new F(i,w),i.$on(\"$destroy\",i.$watch(\"configGroups\",function(e){var n=[];angular.forEach(e,function(e){n.push(e.field||e)}),w.config.groups=n,w.rowFactory.filteredRowsChanged(),i.$emit(\"ngGridEventGroups\",e)},!0)),i.$on(\"$destroy\",i.$watch(\"columns\",function(e){i.isColumnResizing||a.RebuildGrid(i,w),i.$emit(\"ngGridEventColumns\",e)},!0)),i.$on(\"$destroy\",i.$watch(function(){return r.i18n},function(e){d.seti18n(i,e)})),w.maxCanvasHt=w.calcMaxCanvasHeight(),w.config.sortInfo.fields&&w.config.sortInfo.fields.length>0&&i.$on(\"$destroy\",i.$watch(function(){return w.config.sortInfo},function(){l.isSorting||(w.sortColumnsInit(),i.$emit(\"ngGridEventSorted\",w.config.sortInfo))},!0))})},w.resizeOnData=function(e){var t=e.minWidth,o=d.getElementsByClassName(\"col\"+e.index);angular.forEach(o,function(e,o){var i;if(0===o){var r=n(e).find(\".ngHeaderText\");i=d.visualLength(r)+10}else{var l=n(e).find(\".ngCellText\");i=d.visualLength(l)+10}i>t&&(t=i)}),e.width=e.longest=Math.min(e.maxWidth,t+7),a.BuildStyles(i,w,!0)},w.lastSortedColumns=[],w.sortData=function(e,t){if(t&&t.shiftKey&&w.config.sortInfo){var o=w.config.sortInfo.columns.indexOf(e);-1===o?(1===w.config.sortInfo.columns.length&&(w.config.sortInfo.columns[0].sortPriority=1),w.config.sortInfo.columns.push(e),e.sortPriority=w.config.sortInfo.columns.length,w.config.sortInfo.fields.push(e.field),w.config.sortInfo.directions.push(e.sortDirection),w.lastSortedColumns.push(e)):w.config.sortInfo.directions[o]=e.sortDirection,i.$emit(\"ngGridEventSorted\",w.config.sortInfo)}else if(!w.config.useExternalSorting||w.config.useExternalSorting&&w.config.sortInfo){var r=n.isArray(e);w.config.sortInfo.columns.length=0,w.config.sortInfo.fields.length=0,w.config.sortInfo.directions.length=0;var l=function(e){w.config.sortInfo.columns.push(e),w.config.sortInfo.fields.push(e.field),w.config.sortInfo.directions.push(e.sortDirection),w.lastSortedColumns.push(e)};r?angular.forEach(e,function(e,n){e.sortPriority=n+1,l(e)\r\n}):(w.clearSortingData(e),e.sortPriority=void 0,l(e)),w.sortActual(),w.searchProvider.evalFilter(),i.$emit(\"ngGridEventSorted\",w.config.sortInfo)}},w.sortColumnsInit=function(){w.config.sortInfo.columns?w.config.sortInfo.columns.length=0:w.config.sortInfo.columns=[];var e=[];angular.forEach(i.columns,function(n){var t=w.config.sortInfo.fields.indexOf(n.field);-1!==t&&(n.sortDirection=w.config.sortInfo.directions[t]||\"asc\",e[t]=n)}),w.sortData(1===e.length?e[0]:e)},w.sortActual=function(){if(!w.config.useExternalSorting){var e=w.data.slice(0);angular.forEach(e,function(e,n){var t=w.rowMap[n];if(void 0!==t){var o=w.rowCache[t];void 0!==o&&(e.preSortSelected=o.selected,e.preSortIndex=n)}}),l.Sort(w.config.sortInfo,e),angular.forEach(e,function(e,n){w.rowCache[n].entity=e,w.rowCache[n].selected=e.preSortSelected,w.rowMap[e.preSortIndex]=n,delete e.preSortSelected,delete e.preSortIndex})}},w.clearSortingData=function(e){e?(angular.forEach(w.lastSortedColumns,function(n){e.index!==n.index&&(n.sortDirection=\"\",n.sortPriority=null)}),w.lastSortedColumns[0]=e,w.lastSortedColumns.length=1):(angular.forEach(w.lastSortedColumns,function(e){e.sortDirection=\"\",e.sortPriority=null}),w.lastSortedColumns=[])},w.fixColumnIndexes=function(){for(var e=0;eg;g++){var d=i.columns[g];if(d.visible!==!1){var u=d.width+n;if(d.pinned){c(d);var f=g>0?e+t:e;a.setColLeft(d,f,w),t+=d.width}else u>=e&&n<=e+w.rootDim.outerWidth&&c(d);n+=d.width}}l&&(i.renderedColumns=r)},w.prevScrollTop=0,w.prevScrollIndex=0,i.adjustScrollTop=function(e,n){if(w.prevScrollTop!==e||n){e>0&&w.$viewport[0].scrollHeight-e<=w.$viewport.outerHeight()&&i.$emit(\"ngGridEventScroll\");var r,l=Math.floor(e/w.config.rowHeight);if(w.filteredRows.length>w.config.virtualizationThreshold){if(w.prevScrollTope&&l>w.prevScrollIndex-o)return;r=new R(Math.max(0,l-t),l+w.minRowsToRender()+t)}else{var a=i.configGroups.length>0?w.rowFactory.parsedData.length:w.filteredRows.length;r=new R(0,Math.max(a,w.minRowsToRender()+t))}w.prevScrollTop=e,w.rowFactory.UpdateViewableRange(r),w.prevScrollIndex=l}},i.toggleShowMenu=function(){i.showMenu=!i.showMenu},i.toggleSelectAll=function(e,n){i.selectionProvider.toggleSelectAll(e,!1,n)},i.totalFilteredItemsLength=function(){return w.filteredRows.length},i.showGroupPanel=function(){return w.config.showGroupPanel},i.topPanelHeight=function(){return w.config.showGroupPanel===!0?w.config.headerRowHeight+32:w.config.headerRowHeight},i.viewportDimHeight=function(){return Math.max(0,w.rootDim.outerHeight-i.topPanelHeight()-i.footerRowHeight-2)},i.groupBy=function(e){if(!(w.data.length<1)&&e.groupable&&e.field){e.sortDirection||e.sort({shiftKey:i.configGroups.length>0?!0:!1});var n=i.configGroups.indexOf(e);-1===n?(e.isGroupedBy=!0,i.configGroups.push(e),e.groupIndex=i.configGroups.length):i.removeGroup(n),w.$viewport.scrollTop(0),a.digest(i)}},i.removeGroup=function(e){var n=i.columns.filter(function(n){return n.groupIndex===e+1})[0];n.isGroupedBy=!1,n.groupIndex=0,i.columns[e].isAggCol&&(i.columns.splice(e,1),i.configGroups.splice(e,1),w.fixGroupIndexes()),0===i.configGroups.length&&(w.fixColumnIndexes(),a.digest(i)),i.adjustScrollLeft(0)},i.togglePin=function(e){for(var n=e.index,t=0,o=0;oe,o=new T;return o.autoFitHeight=!0,o.outerWidth=i.totalRowWidth(),t?o.outerWidth+=w.elementDims.scrollW:n-e<=w.elementDims.scrollH&&(o.outerWidth+=w.elementDims.scrollW),o}},R=function(e,n){this.topRow=e,this.bottomRow=n},E=function(e,n,t,o,i){this.entity=e,this.config=n,this.selectionProvider=t,this.rowIndex=o,this.utils=i,this.selected=t.getSelection(e),this.cursor=this.config.enableRowSelection&&!this.config.selectWithCheckboxOnly?\"pointer\":\"default\",this.beforeSelectionChange=n.beforeSelectionChangeCallback,this.afterSelectionChange=n.afterSelectionChangeCallback,this.offsetTop=this.rowIndex*n.rowHeight,this.rowDisplayIndex=0};E.prototype.setSelection=function(e){this.selectionProvider.setSelection(this,e),this.selectionProvider.lastClickedRow=this},E.prototype.continueSelection=function(e){this.selectionProvider.ChangeSelection(this,e)},E.prototype.ensureEntity=function(e){this.entity!==e&&(this.entity=e,this.selected=this.selectionProvider.getSelection(this.entity))},E.prototype.toggleSelected=function(e){if(!this.config.enableRowSelection&&!this.config.enableCellSelection)return!0;var n=e.target||e;return\"checkbox\"===n.type&&\"ngSelectionCell ng-scope\"!==n.parentElement.className?!0:this.config.selectWithCheckboxOnly&&\"checkbox\"!==n.type?(this.selectionProvider.lastClickedRow=this,!0):(this.beforeSelectionChange(this,e)&&this.continueSelection(e),!1)},E.prototype.alternatingRowClass=function(){var e=this.rowIndex%2===0,n={ngRow:!0,selected:this.selected,even:e,odd:!e,\"ui-state-default\":this.config.jqueryUITheme&&e,\"ui-state-active\":this.config.jqueryUITheme&&!e};return n},E.prototype.getProperty=function(e){return this.utils.evalProperty(this.entity,e)},E.prototype.copy=function(){return this.clone=new E(this.entity,this.config,this.selectionProvider,this.rowIndex,this.utils),this.clone.isClone=!0,this.clone.elm=this.elm,this.clone.orig=this,this.clone},E.prototype.setVars=function(e){e.clone=this,this.entity=e.entity,this.selected=e.selected,this.orig=e};var G=function(e,n,o,i,r){var g=this;g.aggCache={},g.parentCache=[],g.dataChanged=!0,g.parsedData=[],g.rowConfig={},g.selectionProvider=n.selectionProvider,g.rowHeight=30,g.numberOfAggregates=0,g.groupedData=void 0,g.rowHeight=e.config.rowHeight,g.rowConfig={enableRowSelection:e.config.enableRowSelection,rowClasses:e.config.rowClasses,selectedItems:n.selectedItems,selectWithCheckboxOnly:e.config.selectWithCheckboxOnly,beforeSelectionChangeCallback:e.config.beforeSelectionChange,afterSelectionChangeCallback:e.config.afterSelectionChange,jqueryUITheme:e.config.jqueryUITheme,enableCellSelection:e.config.enableCellSelection,rowHeight:e.config.rowHeight},g.renderedRange=new R(0,e.minRowsToRender()+t),g.buildEntityRow=function(e,n){return new E(e,g.rowConfig,g.selectionProvider,n,r)},g.buildAggregateRow=function(n,t){var o=g.aggCache[n.aggIndex];return o||(o=new x(n,g,g.rowConfig.rowHeight,e.config.groupsCollapsedByDefault),g.aggCache[n.aggIndex]=o),o.rowIndex=t,o.offsetTop=t*g.rowConfig.rowHeight,o},g.UpdateViewableRange=function(e){g.renderedRange=e,g.renderedChange()},g.filteredRowsChanged=function(){e.lateBoundColumns&&e.filteredRows.length>0&&(e.config.columnDefs=void 0,e.buildColumns(),e.lateBoundColumns=!1,n.$evalAsync(function(){n.adjustScrollLeft(0)})),g.dataChanged=!0,e.config.groups.length>0&&g.getGrouping(e.config.groups),g.UpdateViewableRange(g.renderedRange)},g.renderedChange=function(){if(!g.groupedData||e.config.groups.length<1)return g.renderedChangeNoGroups(),void e.refreshDomSizes();g.wasGrouped=!0,g.parentCache=[];var n=0,t=g.parsedData.filter(function(e){return e.isAggRow?e.parent&&e.parent.collapsed?!1:!0:(e[s]||(e.rowIndex=n++),!e[s])});g.totalRows=t.length;for(var o=[],i=g.renderedRange.topRow;it)e.rowCache.length=e.rowMap.length=n;else for(var o=e.rowCache.length;n>o;o++)e.rowCache[o]=e.rowFactory.buildEntityRow(e.data[o],o)},g.parseGroupData=function(e){if(e.values)for(var n=0;n0)for(var y=0;y=y&&h.splice(0,0,new P({colDef:{field:\"\",width:25,sortable:!1,resizable:!1,headerCellTemplate:'',pinned:e.config.pinSelectionCheckbox},enablePinning:e.config.enablePinning,isAggCol:!0,headerRowHeight:e.config.headerRowHeight},n,e,o,i,r));e.fixColumnIndexes(),n.adjustScrollLeft(0),g.parsedData.length=0,g.parseGroupData(g.groupedData),g.fixRowCache()},e.config.groups.length>0&&e.filteredRows.length>0&&g.getGrouping(e.config.groups)},k=function(e,t,o,i){var r=this,l=[];r.extFilter=t.config.filterOptions.useExternalFilter,e.showFilter=t.config.showFilter,e.filterText=\"\",r.fieldMap={};var a=function(e){var n={};for(var t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},s=function(e){if(\"object\"==typeof e){var n=[];for(var t in e)n=n.concat(s(e[t]));return n}return[e]},c=function(e,n,t){var i;for(var r in n)if(n.hasOwnProperty(r)){var l=t[r.toLowerCase()],s=n[r];if(\"object\"!=typeof s||s instanceof Date){var g=null,d=null;if(l&&l.cellFilter&&(d=l.cellFilter.split(\":\"),g=o(d[0])),null!==s&&void 0!==s){if(\"function\"==typeof g){var u=g(s,d[1]?d[1].slice(1,-1):\"\").toString();i=e.regex.test(u)}else i=e.regex.test(s.toString());if(i)return!0}}else{var f=a(l);if(i=c(e,s,f))return!0}}return!1},g=function(e,n){var t,l=r.fieldMap[e.columnDisplay];if(!l)return!1;var a=l.cellFilter.split(\":\"),c=l.cellFilter?o(a[0]):null,g=n[e.column]||n[l.field.split(\".\")[0]]||i.evalProperty(n,l.field);if(null===g||void 0===g)return!1;if(\"function\"==typeof c){var d=c(\"object\"==typeof g?u(g,l.field):g,a[1]).toString();t=e.regex.test(d)}else{var f=s(u(g,l.field));for(var h in f)t|=e.regex.test(f[h])}return t?!0:!1},d=function(e){for(var n=0,t=l.length;t>n;n++){var o,i=l[n];if(o=i.column?g(i,e):c(i,e,r.fieldMap),!o)return!1}return!0};r.evalFilter=function(){t.filteredRows=0===l.length?t.rowCache:t.rowCache.filter(function(e){return d(e.entity)});for(var e=0;e1){for(var i=1,r=t.length;r>i;i++)if(o=o[t[i]],!o)return e;return o}return e},f=function(e,n){try{return new RegExp(e,n)}catch(t){return new RegExp(e.replace(/(\\^|\\$|\\(|\\)|<|>|\\[|\\]|\\{|\\}|\\\\|\\||\\.|\\*|\\+|\\?)/g,\"\\\\$1\"))}},h=function(e){l=[];var t;if(t=n.trim(e))for(var o=t.split(\";\"),i=0;i1){var a=n.trim(r[0]),s=n.trim(r[1]);a&&s&&l.push({column:a,columnDisplay:a.replace(/\\s+/g,\"\").toLowerCase(),regex:f(s,\"i\")})}else{var c=n.trim(r[0]);c&&l.push({column:\"\",regex:f(c,\"i\")})}}};r.extFilter||e.$on(\"$destroy\",e.$watch(\"columns\",function(e){for(var n=0;n0?e.rowFactory.parsedData.filter(function(e){return!e.isAggRow}):e.filteredRows;var s=t.rowIndex,c=i.lastClickedRowIndex;if(s===c)return!1;c>s?(s^=c,c=s^c,s^=c,s--):c++;for(var g=[];s>=c;c++)g.push(a[c]);if(g[g.length-1].beforeSelectionChange(g,o)){for(var d=0;d0&&i.toggleSelectAll(!1,!0),i.selectedItems.push(n.entity));else{var o=i.getSelectionIndex(n.entity);-1!==o&&i.selectedItems.splice(o,1)}n.selected=t,n.orig&&(n.orig.selected=t),n.clone&&(n.clone.selected=t),n.afterSelectionChange(n)}},i.toggleSelectAll=function(n,t,o){var r,l,a=o?e.filteredRows:e.rowCache;if(t||e.config.beforeSelectionChange(a,n)){!o&&i.selectedItems.length>0&&(i.selectedItems.length=0);for(var s=0;s-1&&i.selectedItems.splice(l,1));t||e.config.afterSelectionChange(a,n)}}},F=function(e,n){e.headerCellStyle=function(e){return{height:e.headerRowHeight+\"px\"}},e.rowStyle=function(n){var t={top:n.offsetTop+\"px\",height:e.rowHeight+\"px\"};return n.isAggRow&&(t.left=n.offsetLeft),t},e.canvasStyle=function(){return{height:n.maxCanvasHt+\"px\"}},e.headerScrollerStyle=function(){return{height:n.config.headerRowHeight+\"px\"}},e.topPanelStyle=function(){return{width:n.rootDim.outerWidth+\"px\",height:e.topPanelHeight()+\"px\"}},e.headerStyle=function(){return{width:n.rootDim.outerWidth+\"px\",height:n.config.headerRowHeight+\"px\"}},e.groupPanelStyle=function(){return{width:n.rootDim.outerWidth+\"px\",height:\"32px\"}},e.viewportStyle=function(){return{width:n.rootDim.outerWidth+\"px\",height:e.viewportDimHeight()+\"px\"}},e.footerStyle=function(){return{width:n.rootDim.outerWidth+\"px\",height:e.footerRowHeight+\"px\"}}};b.directive(\"ngCellHasFocus\",[\"$domUtilityService\",function(e){var n=function(n){n.isFocused=!0,e.digest(n),n.$broadcast(\"ngGridEventStartCellEdit\"),n.$emit(\"ngGridEventStartCellEdit\"),n.$on(\"$destroy\",n.$on(\"ngGridEventEndCellEdit\",function(){n.isFocused=!1,e.digest(n)}))};return function(e,t){function o(){return e.enableCellEditOnFocus?c=!0:t.focus(),!0}function i(o){e.enableCellEditOnFocus&&(o.preventDefault(),c=!1,n(e,t))}function r(){return s=!0,e.enableCellEditOnFocus&&!c&&n(e,t),!0}function l(){return s=!1,!0}function a(o){return e.enableCellEditOnFocus||(s&&37!==o.keyCode&&38!==o.keyCode&&39!==o.keyCode&&40!==o.keyCode&&9!==o.keyCode&&!o.shiftKey&&13!==o.keyCode&&n(e,t),s&&o.shiftKey&&o.keyCode>=65&&o.keyCode<=90&&n(e,t),27===o.keyCode&&t.focus()),!0}var s=!1,c=!1;e.editCell=function(){e.enableCellEditOnFocus||setTimeout(function(){n(e,t)},0)},t.bind(\"mousedown\",o),t.bind(\"click\",i),t.bind(\"focus\",r),t.bind(\"blur\",l),t.bind(\"keydown\",a),t.on(\"$destroy\",function(){t.off(\"mousedown\",o),t.off(\"click\",i),t.off(\"focus\",r),t.off(\"blur\",l),t.off(\"keydown\",a)})}}]),b.directive(\"ngCellText\",function(){return function(e,n){function t(e){e.preventDefault()}function o(e){e.preventDefault()}n.bind(\"mouseover\",t),n.bind(\"mouseleave\",o),n.on(\"$destroy\",function(){n.off(\"mouseover\",t),n.off(\"mouseleave\",o)})}}),b.directive(\"ngCell\",[\"$compile\",\"$domUtilityService\",\"$utilityService\",function(e,t,o){var i={scope:!1,compile:function(){return{pre:function(t,i){var r,l=t.col.cellTemplate.replace(d,o.preEval(\"row.entity.\"+t.col.field));t.col.enableCellEdit?(r=t.col.cellEditTemplate,r=r.replace(h,t.col.cellEditableCondition),r=r.replace(u,l),r=r.replace(f,t.col.editableCellTemplate.replace(d,o.preEval(\"row.entity.\"+t.col.field)))):r=l;var a=n(r);i.append(a),e(a)(t),t.enableCellSelection&&-1===a[0].className.indexOf(\"ngSelectionCell\")&&(a[0].setAttribute(\"tabindex\",0),a.addClass(\"ngCellElement\"))},post:function(e,n){e.enableCellSelection&&e.domAccessProvider.selectionHandlers(e,n),e.$on(\"$destroy\",e.$on(\"ngGridEventDigestCell\",function(){t.digest(e)}))}}}};return i}]),b.directive(\"ngEditCellIf\",[function(){return{transclude:\"element\",priority:1e3,terminal:!0,restrict:\"A\",compile:function(e,n,t){return function(e,n,o){var i,r;e.$on(\"$destroy\",e.$watch(o.ngEditCellIf,function(o){i&&(i.remove(),i=void 0),r&&(r.$destroy(),r=void 0),o&&(r=e.$new(),t(r,function(e){i=e,n.after(e)}))}))}}}}]),b.directive(\"ngGridFooter\",[\"$compile\",\"$templateCache\",function(e,n){var t={scope:!1,compile:function(){return{pre:function(t,o){0===o.children().length&&o.append(e(n.get(t.gridId+\"footerTemplate.html\"))(t))}}}};return t}]),b.directive(\"ngGridMenu\",[\"$compile\",\"$templateCache\",function(e,n){var t={scope:!1,compile:function(){return{pre:function(t,o){0===o.children().length&&o.append(e(n.get(t.gridId+\"menuTemplate.html\"))(t))}}}};return t}]),b.directive(\"ngGrid\",[\"$compile\",\"$filter\",\"$templateCache\",\"$sortService\",\"$domUtilityService\",\"$utilityService\",\"$timeout\",\"$parse\",\"$http\",\"$q\",function(e,t,o,i,r,l,a,s,c,g){var d={scope:!0,compile:function(){return{pre:function(d,u,f){var h=n(u),p=d.$eval(f.ngGrid);p.gridDim=new T({outerHeight:n(h).height(),outerWidth:n(h).width()});var m=new D(d,p,i,r,t,o,l,a,s,c,g);return d.$on(\"$destroy\",function(){p.gridDim=null,p.selectRow=null,p.selectItem=null,p.selectAll=null,p.selectVisible=null,p.groupBy=null,p.sortBy=null,p.gridId=null,p.ngGrid=null,p.$gridScope=null,p.$gridServices=null,d.domAccessProvider.grid=null,angular.element(m.styleSheet).remove(),m.styleSheet=null}),m.init().then(function(){if(\"string\"==typeof p.columnDefs?d.$on(\"$destroy\",d.$parent.$watch(p.columnDefs,function(e){return e?(m.lateBoundColumns=!1,d.columns=[],m.config.columnDefs=e,m.buildColumns(),m.eventProvider.assignEvents(),void r.RebuildGrid(d,m)):(m.refreshDomSizes(),void m.buildColumns())},!0)):m.buildColumns(),\"string\"==typeof p.totalServerItems?d.$on(\"$destroy\",d.$parent.$watch(p.totalServerItems,function(e){d.totalServerItems=angular.isDefined(e)?e:0})):d.totalServerItems=0,\"string\"==typeof p.data){var t=function(e){m.data=n.extend([],e),m.rowFactory.fixRowCache(),angular.forEach(m.data,function(e,n){var t=m.rowMap[n]||n;m.rowCache[t]&&m.rowCache[t].ensureEntity(e),m.rowMap[t]=n}),m.searchProvider.evalFilter(),m.configureColumnWidths(),m.refreshDomSizes(),m.config.sortInfo.fields.length>0&&(m.sortColumnsInit(),d.$emit(\"ngGridEventSorted\",m.config.sortInfo)),d.$emit(\"ngGridEventData\",m.gridId)};d.$on(\"$destroy\",d.$parent.$watch(p.data,t)),d.$on(\"$destroy\",d.$parent.$watch(p.data+\".length\",function(){t(d.$eval(p.data)),d.adjustScrollTop(m.$viewport.scrollTop(),!0)}))}return m.footerController=new L(d,m),u.addClass(\"ngGrid\").addClass(m.gridId.toString()),p.enableHighlighting||u.addClass(\"unselectable\"),p.jqueryUITheme&&u.addClass(\"ui-widget\"),u.append(e(o.get(\"gridTemplate.html\"))(d)),r.AssignGridContainers(d,u,m),m.eventProvider=new $(m,d,r,a),p.selectRow=function(e,n){m.rowCache[e]&&(m.rowCache[e].clone&&m.rowCache[e].clone.setSelection(n?!0:!1),m.rowCache[e].setSelection(n?!0:!1))},p.selectItem=function(e,n){p.selectRow(m.rowMap[e],n)},p.selectAll=function(e){d.toggleSelectAll(e)},p.selectVisible=function(e){d.toggleSelectAll(e,!0)},p.groupBy=function(e){if(e)d.groupBy(d.columns.filter(function(n){return n.field===e})[0]);else{var t=n.extend(!0,[],d.configGroups);angular.forEach(t,d.groupBy)}},p.sortBy=function(e){var n=d.columns.filter(function(n){return n.field===e})[0];n&&n.sort()},p.gridId=m.gridId,p.ngGrid=m,p.$gridScope=d,p.$gridServices={SortService:i,DomUtilityService:r,UtilityService:l},d.$on(\"$destroy\",d.$on(\"ngGridEventDigestGrid\",function(){r.digest(d.$parent)})),d.$on(\"$destroy\",d.$on(\"ngGridEventDigestGridParent\",function(){r.digest(d.$parent)})),d.$evalAsync(function(){d.adjustScrollLeft(0)}),angular.forEach(p.plugins,function(n){\"function\"==typeof n&&(n=new n);var t=d.$new();t.$compile=e,n.init(t,m,p.$gridServices),p.plugins[l.getInstanceType(n)]=n,d.$on(\"$destroy\",function(){t.$destroy()})}),\"function\"==typeof p.init&&p.init(m,d),null})}}}};return d}]),b.directive(\"ngHeaderCell\",[\"$compile\",function(e){var n={scope:!1,compile:function(){return{pre:function(n,t){t.append(e(n.col.headerCellTemplate)(n))}}}};return n}]),b.directive(\"ngHeaderRow\",[\"$compile\",\"$templateCache\",function(e,n){var t={scope:!1,compile:function(){return{pre:function(t,o){0===o.children().length&&o.append(e(n.get(t.gridId+\"headerRowTemplate.html\"))(t))}}}};return t}]),b.directive(\"ngInput\",[function(){return{require:\"ngModel\",link:function(e,n,t,o){function i(t){switch(t.keyCode){case 37:case 38:case 39:case 40:t.stopPropagation();break;case 27:e.$$phase||e.$apply(function(){o.$setViewValue(a),n.blur()});break;case 13:(e.enableCellEditOnFocus&&e.totalFilteredItemsLength()-1>e.row.rowIndex&&e.row.rowIndex>0||e.col.enableCellEdit)&&n.blur()}return!0}function r(e){e.stopPropagation()}function l(e){e.stopPropagation()}var a,s=e.$watch(\"ngModel\",function(){a=o.$modelValue,s()});n.bind(\"keydown\",i),n.bind(\"click\",r),n.bind(\"mousedown\",l),n.on(\"$destroy\",function(){n.off(\"keydown\",i),n.off(\"click\",r),n.off(\"mousedown\",l)}),e.$on(\"$destroy\",e.$on(\"ngGridEventStartCellEdit\",function(){n.focus(),n.select()})),angular.element(n).bind(\"blur\",function(){e.$emit(\"ngGridEventEndCellEdit\")})}}}]),b.directive(\"ngRow\",[\"$compile\",\"$domUtilityService\",\"$templateCache\",function(e,n,t){var o={scope:!1,compile:function(){return{pre:function(o,i){if(o.row.elm=i,o.row.clone&&(o.row.clone.elm=i),o.row.isAggRow){var r=t.get(o.gridId+\"aggregateTemplate.html\");r=o.row.aggLabelFilter?r.replace(g,\"| \"+o.row.aggLabelFilter):r.replace(g,\"\"),i.append(e(r)(o))}else i.append(e(t.get(o.gridId+\"rowTemplate.html\"))(o));o.$on(\"$destroy\",o.$on(\"ngGridEventDigestRow\",function(){n.digest(o)}))}}}};return o}]),b.directive(\"ngViewport\",[function(){return function(e,n){function t(n){var t=n.target.scrollLeft,o=n.target.scrollTop;return e.$headerContainer&&e.$headerContainer.scrollLeft(t),e.adjustScrollLeft(t),e.adjustScrollTop(o),e.forceSyncScrolling?s():(clearTimeout(l),l=setTimeout(s,150)),r=t,a=o,i=!1,!0}function o(){return i=!0,n.focus&&n.focus(),!0}var i,r,l,a=0,s=function(){e.$root.$$phase||e.$digest()};n.bind(\"scroll\",t),n.bind(\"mousewheel DOMMouseScroll\",o),n.on(\"$destroy\",function(){n.off(\"scroll\",t),n.off(\"mousewheel DOMMouseScroll\",o)}),e.enableCellSelection||e.domAccessProvider.selectionHandlers(e,n)}}]),e.ngGrid.i18n.da={ngAggregateLabel:\"artikler\",ngGroupPanelDescription:\"Grupér rækker udfra en kolonne ved at trække dens overskift hertil.\",ngSearchPlaceHolder:\"Søg...\",ngMenuText:\"Vælg kolonner:\",ngShowingItemsLabel:\"Viste rækker:\",ngTotalItemsLabel:\"Rækker totalt:\",ngSelectedItemsLabel:\"Valgte rækker:\",ngPageSizeLabel:\"Side størrelse:\",ngPagerFirstTitle:\"Første side\",ngPagerNextTitle:\"Næste side\",ngPagerPrevTitle:\"Forrige side\",ngPagerLastTitle:\"Sidste side\"},e.ngGrid.i18n.de={ngAggregateLabel:\"eintrag\",ngGroupPanelDescription:\"Ziehen Sie eine Spaltenüberschrift hierhin um nach dieser Spalte zu gruppieren.\",ngSearchPlaceHolder:\"Suche...\",ngMenuText:\"Spalten auswählen:\",ngShowingItemsLabel:\"Zeige Einträge:\",ngTotalItemsLabel:\"Einträge gesamt:\",ngSelectedItemsLabel:\"Ausgewählte Einträge:\",ngPageSizeLabel:\"Einträge pro Seite:\",ngPagerFirstTitle:\"Erste Seite\",ngPagerNextTitle:\"Nächste Seite\",ngPagerPrevTitle:\"Vorherige Seite\",ngPagerLastTitle:\"Letzte Seite\"},e.ngGrid.i18n.en={ngAggregateLabel:\"items\",ngGroupPanelDescription:\"Drag a column header here and drop it to group by that column.\",ngSearchPlaceHolder:\"Search...\",ngMenuText:\"Choose Columns:\",ngShowingItemsLabel:\"Showing Items:\",ngTotalItemsLabel:\"Total Items:\",ngSelectedItemsLabel:\"Selected Items:\",ngPageSizeLabel:\"Page Size:\",ngPagerFirstTitle:\"First Page\",ngPagerNextTitle:\"Next Page\",ngPagerPrevTitle:\"Previous Page\",ngPagerLastTitle:\"Last Page\"},e.ngGrid.i18n[\"en-US\"]={ngAggregateLabel:\"items\",ngGroupPanelDescription:\"Drag a column header here and drop it to group by that column.\",ngSearchPlaceHolder:\"Search...\",ngMenuText:\"Choose Columns:\",ngShowingItemsLabel:\"Showing Items:\",ngTotalItemsLabel:\"Total Items:\",ngSelectedItemsLabel:\"Selected Items:\",ngPageSizeLabel:\"Page Size:\",ngPagerFirstTitle:\"First Page\",ngPagerNextTitle:\"Next Page\",ngPagerPrevTitle:\"Previous Page\",ngPagerLastTitle:\"Last Page\"},e.ngGrid.i18n.es={ngAggregateLabel:\"Artículos\",ngGroupPanelDescription:\"Arrastre un encabezado de columna aquí y soltarlo para agrupar por esa columna.\",ngSearchPlaceHolder:\"Buscar...\",ngMenuText:\"Elegir columnas:\",ngShowingItemsLabel:\"Artículos Mostrando:\",ngTotalItemsLabel:\"Artículos Totales:\",ngSelectedItemsLabel:\"Artículos Seleccionados:\",ngPageSizeLabel:\"Tamaño de Página:\",ngPagerFirstTitle:\"Primera Página\",ngPagerNextTitle:\"Página Siguiente\",ngPagerPrevTitle:\"Página Anterior\",ngPagerLastTitle:\"Última Página\"},e.ngGrid.i18n.fa={ngAggregateLabel:\"موردها\",ngGroupPanelDescription:\"یک عنوان ستون اینجا را بردار و به گروهی از آن ستون بیانداز.\",ngSearchPlaceHolder:\"جستجو...\",ngMenuText:\"انتخاب ستونها:\",ngShowingItemsLabel:\"نمایش موردها:\",ngTotalItemsLabel:\"همهٔ موردها:\",ngSelectedItemsLabel:\"موردهای انتخابشده:\",ngPageSizeLabel:\"اندازهٔ صفحه:\",ngPagerFirstTitle:\"صفحهٔ اول\",ngPagerNextTitle:\"صفحهٔ بعد\",ngPagerPrevTitle:\"صفحهٔ قبل\",ngPagerLastTitle:\"آخرین صفحه\"},e.ngGrid.i18n.fr={ngAggregateLabel:\"articles\",ngGroupPanelDescription:\"Faites glisser un en-tête de colonne ici et déposez-le vers un groupe par cette colonne.\",ngSearchPlaceHolder:\"Recherche...\",ngMenuText:\"Choisir des colonnes:\",ngShowingItemsLabel:\"Articles Affichage des:\",ngTotalItemsLabel:\"Nombre total d'articles:\",ngSelectedItemsLabel:\"Éléments Articles:\",ngPageSizeLabel:\"Taille de page:\",ngPagerFirstTitle:\"Première page\",ngPagerNextTitle:\"Page Suivante\",ngPagerPrevTitle:\"Page précédente\",ngPagerLastTitle:\"Dernière page\"},e.ngGrid.i18n.nl={ngAggregateLabel:\"items\",ngGroupPanelDescription:\"Sleep hier een kolomkop om op te groeperen.\",ngSearchPlaceHolder:\"Zoeken...\",ngMenuText:\"Kies kolommen:\",ngShowingItemsLabel:\"Toon items:\",ngTotalItemsLabel:\"Totaal items:\",ngSelectedItemsLabel:\"Geselecteerde items:\",ngPageSizeLabel:\"Pagina grootte:, \",ngPagerFirstTitle:\"Eerste pagina\",ngPagerNextTitle:\"Volgende pagina\",ngPagerPrevTitle:\"Vorige pagina\",ngPagerLastTitle:\"Laatste pagina\"},e.ngGrid.i18n.pt={ngAggregateLabel:\"itens\",ngGroupPanelDescription:\"Arraste e solte uma coluna aqui para agrupar por essa coluna\",ngSearchPlaceHolder:\"Procurar...\",ngMenuText:\"Selecione as colunas:\",ngShowingItemsLabel:\"Mostrando os Itens:\",ngTotalItemsLabel:\"Total de Itens:\",ngSelectedItemsLabel:\"Items Selecionados:\",ngPageSizeLabel:\"Tamanho da Página:\",ngPagerFirstTitle:\"Primeira Página\",ngPagerNextTitle:\"Próxima Página\",ngPagerPrevTitle:\"Página Anterior\",ngPagerLastTitle:\"Última Página\"},e.ngGrid.i18n[\"pt-br\"]={ngAggregateLabel:\"itens\",ngGroupPanelDescription:\"Arraste e solte uma coluna aqui para agrupar por essa coluna\",ngSearchPlaceHolder:\"Procurar...\",ngMenuText:\"Selecione as colunas:\",ngShowingItemsLabel:\"Mostrando os Itens:\",ngTotalItemsLabel:\"Total de Itens:\",ngSelectedItemsLabel:\"Items Selecionados:\",ngPageSizeLabel:\"Tamanho da Página:\",ngPagerFirstTitle:\"Primeira Página\",ngPagerNextTitle:\"Próxima Página\",ngPagerPrevTitle:\"Página Anterior\",ngPagerLastTitle:\"Última Página\"},e.ngGrid.i18n.ru={ngAggregateLabel:\"записи\",ngGroupPanelDescription:\"Перетащите сюда заголовок колонки для группировки по этой колонке.\",ngSearchPlaceHolder:\"Искать...\",ngMenuText:\"Выберите столбцы:\",ngShowingItemsLabel:\"Показаны записи:\",ngTotalItemsLabel:\"Всего записей:\",ngSelectedItemsLabel:\"Выбранные записи:\",ngPageSizeLabel:\"Строк на странице:\",ngPagerFirstTitle:\"Первая страница\",ngPagerNextTitle:\"Следующая страница\",ngPagerPrevTitle:\"Предыдущая страница\",ngPagerLastTitle:\"Последняя страница\"},e.ngGrid.i18n[\"zh-cn\"]={ngAggregateLabel:\"条目\",ngGroupPanelDescription:\"拖曳表头到此处以进行分组\",ngSearchPlaceHolder:\"搜索...\",ngMenuText:\"数据分组与选择列:\",ngShowingItemsLabel:\"当前显示条目:\",ngTotalItemsLabel:\"条目总数:\",ngSelectedItemsLabel:\"选中条目:\",ngPageSizeLabel:\"每页显示数:\",ngPagerFirstTitle:\"回到首页\",ngPagerNextTitle:\"下一页\",ngPagerPrevTitle:\"上一页\",ngPagerLastTitle:\"前往尾页\"},e.ngGrid.i18n[\"zh-tw\"]={ngAggregateLabel:\"筆\",ngGroupPanelDescription:\"拖拉表頭到此處以進行分組\",ngSearchPlaceHolder:\"搜尋...\",ngMenuText:\"選擇欄位:\",ngShowingItemsLabel:\"目前顯示筆數:\",ngTotalItemsLabel:\"總筆數:\",ngSelectedItemsLabel:\"選取筆數:\",ngPageSizeLabel:\"每頁顯示:\",ngPagerFirstTitle:\"第一頁\",ngPagerNextTitle:\"下一頁\",ngPagerPrevTitle:\"上一頁\",ngPagerLastTitle:\"最後頁\"},angular.module(\"ngGrid\").run([\"$templateCache\",function(e){e.put(\"aggregateTemplate.html\",'\\r\\n
{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})\\r\\n
\\r\\n
\\r\\n'),e.put(\"cellEditTemplate.html\",'\\r\\n\t
\t\\r\\n\t\tDISPLAY_CELL_TEMPLATE\\r\\n\t
\\r\\n\t
\\r\\n\t\tEDITABLE_CELL_TEMPLATE\\r\\n\t
\\r\\n
\\r\\n'),e.put(\"cellTemplate.html\",'{{COL_FIELD CUSTOM_FILTERS}}
'),e.put(\"checkboxCellTemplate.html\",''),e.put(\"checkboxHeaderTemplate.html\",''),e.put(\"editableCellTemplate.html\",''),e.put(\"footerTemplate.html\",'\\r\\n'),e.put(\"gridTemplate.html\",'\\r\\n
\\r\\n
{{i18n.ngGroupPanelDescription}}
\\r\\n
0\" class=\"ngGroupList\">\\r\\n - \\r\\n \\r\\n {{group.displayName}}\\r\\n x\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n'),e.put(\"headerCellTemplate.html\",'\\r\\n \\r\\n
\\r\\n
\\r\\n
{{col.sortPriority}}
\\r\\n
\\r\\n
\\r\\n\\r\\n'),e.put(\"headerRowTemplate.html\",''),e.put(\"menuTemplate.html\",'\\r\\n'),e.put(\"rowTemplate.html\",'')\r\n}])}(window,jQuery);","// Todo:\r\n// 1) Make the button prettier\r\n// 2) add a config option for IE users which takes a URL. That URL should accept a POST request with a\r\n// JSON encoded object in the payload and return a CSV. This is necessary because IE doesn't let you\r\n// download from a data-uri link\r\n//\r\n// Notes: This has not been adequately tested and is very much a proof of concept at this point\r\nfunction ngGridCsvExportPlugin(opts) {\r\n var self = this;\r\n self.grid = null;\r\n self.scope = null;\r\n self.services = null;\r\n\r\n opts = opts || {};\r\n opts.dropdownTemplate = opts.dropdownTemplate || '';\r\n opts.containerPanel = opts.containerPanel || '.ngFooterPanel';\r\n opts.linkClass = opts.linkCss || 'csv-data-link-span';\r\n opts.linkLabel = opts.linkLabel || 'CSV Export';\r\n opts.fileName = opts.fileName || 'Export.csv';\r\n opts.isExportDisabled = opts.isExportDisabled || true;\r\n \r\n self.init = function (scope, grid, services) {\r\n self.grid = grid;\r\n self.scope = scope;\r\n self.services = services;\r\n scope.isExportDisabled = opts.isExportDisabled;\r\n\r\n function showDs() {\r\n /// \r\n /// Shows the ds.\r\n /// \r\n /// \r\n function csvStringify(str) {\r\n if (str == null) { // we want to catch anything null-ish, hence just == not ===\r\n return '';\r\n }\r\n if (typeof (str) === 'number') {\r\n return '' + str;\r\n }\r\n if (typeof (str) === 'boolean') {\r\n return (str ? 'TRUE' : 'FALSE');\r\n }\r\n if (typeof (str) === 'string') {\r\n return str.replace(/\"/g, '\"\"');\r\n }\r\n\r\n return JSON.stringify(str).replace(/\"/g, '\"\"');\r\n }\r\n\r\n var keys = [];\r\n var csvData = '';\r\n for (var f in grid.config.columnDefs) {\r\n if (grid.config.columnDefs.hasOwnProperty(f)) {\r\n keys.push(grid.config.columnDefs[f].field);\r\n csvData += '\"';\r\n if (typeof grid.config.columnDefs[f].displayName !== 'undefined') {/** moved to reduce looping and capture the display name if it exists**/\r\n csvData += csvStringify(grid.config.columnDefs[f].displayName);\r\n }\r\n else {\r\n csvData += csvStringify(grid.config.columnDefs[f].field);\r\n }\r\n csvData += '\",';\r\n }\r\n }\r\n\r\n function swapLastCommaForNewline(str) {\r\n var newStr = str.substr(0, str.length - 1);\r\n return newStr + \"\\n\";\r\n }\r\n\r\n csvData = swapLastCommaForNewline(csvData);\r\n var gridData = grid.data;\r\n for (var gridRow in gridData) {\r\n var rowData = '';\r\n for (var k in keys) {\r\n var curCellRaw;\r\n\r\n if (opts != null && opts.columnOverrides != null && opts.columnOverrides[keys[k]] != null) {\r\n curCellRaw = opts.columnOverrides[keys[k]](\r\n self.services.UtilityService.evalProperty(gridData[gridRow], keys[k]));\r\n } else {\r\n curCellRaw = self.services.UtilityService.evalProperty(gridData[gridRow], keys[k]);\r\n }\r\n\r\n rowData += '\"' + csvStringify(curCellRaw) + '\",';\r\n }\r\n csvData += swapLastCommaForNewline(rowData);\r\n }\r\n \r\n var fp = grid.$root.find(opts.containerPanel);\r\n var csvDataLinkPrevious = grid.$root.find(opts.containerPanel + ' .' + opts.linkClass);\r\n if (csvDataLinkPrevious != null) { csvDataLinkPrevious.remove(); }\r\n var csvDataLinkHtml = '';\r\n csvDataLinkHtml += '
';\r\n csvDataLinkHtml += '
';\r\n csvDataLinkHtml += '
' + opts.linkLabel + '';\r\n csvDataLinkHtml += '
' + '' + '';\r\n csvDataLinkHtml += opts.dropdownTemplate;\r\n csvDataLinkHtml += '
';\r\n csvDataLinkHtml += '
';\r\n\r\n fp.append(scope.$compile(csvDataLinkHtml)(scope));\r\n //scope.$apply();\r\n }\r\n setTimeout(showDs, 0);\r\n scope.catHashKeys = function () {\r\n var hash = '';\r\n for (var idx in scope.renderedRows) {\r\n hash += scope.renderedRows[idx].$$hashKey;\r\n }\r\n return hash;\r\n };\r\n if (opts && opts.customDataWatcher) {\r\n scope.$watch(opts.customDataWatcher, showDs);\r\n } else {\r\n scope.$watch(scope.catHashKeys, showDs);\r\n }\r\n };\r\n}\r\n","//! moment.js\n//! version : 2.10.3\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n!function(a,b){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=b():\"function\"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){\"use strict\";function a(){return Dc.apply(null,arguments)}function b(a){Dc=a}function c(a){return\"[object Array]\"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||\"[object Date]\"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Fc)d=Fc[c],e=b[d],\"undefined\"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(+b._d),Gc===!1&&(Gc=!0,a.updateOffset(this),Gc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function q(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&p(a[d])!==p(b[d]))&&g++;return g+f}function r(){}function s(a){return a?a.toLowerCase().replace(\"_\",\"-\"):a}function t(a){for(var b,c,d,e,f=0;f0;){if(d=u(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&q(e,c,!0)>=b-1)break;b--}f++}return null}function u(a){var b=null;if(!Hc[a]&&\"undefined\"!=typeof module&&module&&module.exports)try{b=Ec._abbr,require(\"./locale/\"+a),v(b)}catch(c){}return Hc[a]}function v(a,b){var c;return a&&(c=\"undefined\"==typeof b?x(a):w(a,b),c&&(Ec=c)),Ec._abbr}function w(a,b){return null!==b?(b.abbr=a,Hc[a]||(Hc[a]=new r),Hc[a].set(b),v(a),Hc[a]):(delete Hc[a],null)}function x(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ec;if(!c(a)){if(b=u(a))return b;a=[a]}return t(a)}function y(a,b){var c=a.toLowerCase();Ic[c]=Ic[c+\"s\"]=Ic[b]=a}function z(a){return\"string\"==typeof a?Ic[a]||Ic[a.toLowerCase()]:void 0}function A(a){var b,c,d={};for(c in a)f(a,c)&&(b=z(c),b&&(d[b]=a[c]));return d}function B(b,c){return function(d){return null!=d?(D(this,b,d),a.updateOffset(this,c),this):C(this,b)}}function C(a,b){return a._d[\"get\"+(a._isUTC?\"UTC\":\"\")+b]()}function D(a,b,c){return a._d[\"set\"+(a._isUTC?\"UTC\":\"\")+b](c)}function E(a,b){var c;if(\"object\"==typeof a)for(c in a)this.set(c,a[c]);else if(a=z(a),\"function\"==typeof this[a])return this[a](b);return this}function F(a,b,c){for(var d=\"\"+Math.abs(a),e=a>=0;d.lengthb;b++)Mc[d[b]]?d[b]=Mc[d[b]]:d[b]=H(d[b]);return function(e){var f=\"\";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function J(a,b){return a.isValid()?(b=K(b,a.localeData()),Lc[b]||(Lc[b]=I(b)),Lc[b](a)):a.localeData().invalidDate()}function K(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Kc.lastIndex=0;d>=0&&Kc.test(a);)a=a.replace(Kc,c),Kc.lastIndex=0,d-=1;return a}function L(a,b,c){_c[a]=\"function\"==typeof b?b:function(a){return a&&c?c:b}}function M(a,b){return f(_c,a)?_c[a](b._strict,b._locale):new RegExp(N(a))}function N(a){return a.replace(\"\\\\\",\"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}function O(a,b){var c,d=b;for(\"string\"==typeof a&&(a=[a]),\"number\"==typeof b&&(d=function(a,c){c[b]=p(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp(\"^\"+this.months(e,\"\").replace(\".\",\"\")+\"$\",\"i\"),this._shortMonthsParse[d]=new RegExp(\"^\"+this.monthsShort(e,\"\").replace(\".\",\"\")+\"$\",\"i\")),c||this._monthsParse[d]||(f=\"^\"+this.months(e,\"\")+\"|^\"+this.monthsShort(e,\"\"),this._monthsParse[d]=new RegExp(f.replace(\".\",\"\"),\"i\")),c&&\"MMMM\"===b&&this._longMonthsParse[d].test(a))return d;if(c&&\"MMM\"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function V(a,b){var c;return\"string\"==typeof b&&(b=a.localeData().monthsParse(b),\"number\"!=typeof b)?a:(c=Math.min(a.date(),R(a.year(),b)),a._d[\"set\"+(a._isUTC?\"UTC\":\"\")+\"Month\"](b,c),a)}function W(b){return null!=b?(V(this,b),a.updateOffset(this,!0),this):C(this,\"Month\")}function X(){return R(this.year(),this.month())}function Y(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[cd]<0||c[cd]>11?cd:c[dd]<1||c[dd]>R(c[bd],c[cd])?dd:c[ed]<0||c[ed]>24||24===c[ed]&&(0!==c[fd]||0!==c[gd]||0!==c[hd])?ed:c[fd]<0||c[fd]>59?fd:c[gd]<0||c[gd]>59?gd:c[hd]<0||c[hd]>999?hd:-1,j(a)._overflowDayOfYear&&(bd>b||b>dd)&&(b=dd),j(a).overflow=b),a}function Z(b){a.suppressDeprecationWarnings===!1&&\"undefined\"!=typeof console&&console.warn&&console.warn(\"Deprecation warning: \"+b)}function $(a,b){var c=!0,d=a+\"\\n\"+(new Error).stack;return g(function(){return c&&(Z(d),c=!1),b.apply(this,arguments)},b)}function _(a,b){kd[a]||(Z(b),kd[a]=!0)}function aa(a){var b,c,d=a._i,e=ld.exec(d);if(e){for(j(a).iso=!0,b=0,c=md.length;c>b;b++)if(md[b][1].exec(d)){a._f=md[b][0]+(e[6]||\" \");break}for(b=0,c=nd.length;c>b;b++)if(nd[b][1].exec(d)){a._f+=nd[b][0];break}d.match(Yc)&&(a._f+=\"Z\"),ta(a)}else a._isValid=!1}function ba(b){var c=od.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(aa(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ca(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function da(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ea(a){return fa(a)?366:365}function fa(a){return a%4===0&&a%100!==0||a%400===0}function ga(){return fa(this.year())}function ha(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Aa(a).add(f,\"d\"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ia(a){return ha(a,this._week.dow,this._week.doy).week}function ja(){return this._week.dow}function ka(){return this._week.doy}function la(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),\"d\")}function ma(a){var b=ha(this,1,4).week;return null==a?b:this.add(7*(a-b),\"d\")}function na(a,b,c,d,e){var f,g,h=da(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:ea(a-1)+g}}function oa(a){var b=Math.round((this.clone().startOf(\"day\")-this.clone().startOf(\"year\"))/864e5)+1;return null==a?b:this.add(a-b,\"d\")}function pa(a,b,c){return null!=a?a:null!=b?b:c}function qa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ra(a){var b,c,d,e,f=[];if(!a._d){for(d=qa(a),a._w&&null==a._a[dd]&&null==a._a[cd]&&sa(a),a._dayOfYear&&(e=pa(a._a[bd],d[bd]),a._dayOfYear>ea(e)&&(j(a)._overflowDayOfYear=!0),c=da(e,0,a._dayOfYear),a._a[cd]=c.getUTCMonth(),a._a[dd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ed]&&0===a._a[fd]&&0===a._a[gd]&&0===a._a[hd]&&(a._nextDay=!0,a._a[ed]=0),a._d=(a._useUTC?da:ca).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ed]=24)}}function sa(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=pa(b.GG,a._a[bd],ha(Aa(),1,4).year),d=pa(b.W,1),e=pa(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=pa(b.gg,a._a[bd],ha(Aa(),f,g).year),d=pa(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=na(c,d,e,g,f),a._a[bd]=h.year,a._dayOfYear=h.dayOfYear}function ta(b){if(b._f===a.ISO_8601)return void aa(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=\"\"+b._i,i=h.length,k=0;for(e=K(b._f,b._locale).match(Jc)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Mc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),Q(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ed]<=12&&b._a[ed]>0&&(j(b).bigHour=void 0),b._a[ed]=ua(b._locale,b._a[ed],b._meridiem),ra(b),Y(b)}function ua(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function va(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(0/0));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function wa(a){if(!a._d){var b=A(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ra(a)}}function xa(a){var b,e=a._i,f=a._f;return a._locale=a._locale||x(a._l),null===e||void 0===f&&\"\"===e?l({nullInput:!0}):(\"string\"==typeof e&&(a._i=e=a._locale.preparse(e)),o(e)?new n(Y(e)):(c(f)?va(a):f?ta(a):d(e)?a._d=e:ya(a),b=new n(Y(a)),b._nextDay&&(b.add(1,\"d\"),b._nextDay=void 0),b))}function ya(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):\"string\"==typeof f?ba(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ra(b)):\"object\"==typeof f?wa(b):\"number\"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function za(a,b,c,d,e){var f={};return\"boolean\"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,xa(f)}function Aa(a,b,c,d){return za(a,b,c,d,!1)}function Ba(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Aa();for(d=b[0],e=1;ea&&(a=-a,c=\"-\"),c+F(~~(a/60),2)+b+F(~~a%60,2)})}function Ha(a){var b=(a||\"\").match(Yc)||[],c=b[b.length-1]||[],d=(c+\"\").match(td)||[\"-\",0,0],e=+(60*d[1])+p(d[2]);return\"+\"===d[0]?e:-e}function Ia(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Aa(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Aa(b).local();return c._isUTC?Aa(b).zone(c._offset||0):Aa(b).local()}function Ja(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ka(b,c){var d,e=this._offset||0;return null!=b?(\"string\"==typeof b&&(b=Ha(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ja(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,\"m\"),e!==b&&(!c||this._changeInProgress?$a(this,Va(b-e,\"m\"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ja(this)}function La(a,b){return null!=a?(\"string\"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Ma(a){return this.utcOffset(0,a)}function Na(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ja(this),\"m\")),this}function Oa(){return this._tzm?this.utcOffset(this._tzm):\"string\"==typeof this._i&&this.utcOffset(Ha(this._i)),this}function Pa(a){return a=a?Aa(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Qa(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ra(){if(this._a){var a=this._isUTC?h(this._a):Aa(this._a);return this.isValid()&&q(this._a,a.toArray())>0}return!1}function Sa(){return!this._isUTC}function Ta(){return this._isUTC}function Ua(){return this._isUTC&&0===this._offset}function Va(a,b){var c,d,e,g=a,h=null;return Fa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:\"number\"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=ud.exec(a))?(c=\"-\"===h[1]?-1:1,g={y:0,d:p(h[dd])*c,h:p(h[ed])*c,m:p(h[fd])*c,s:p(h[gd])*c,ms:p(h[hd])*c}):(h=vd.exec(a))?(c=\"-\"===h[1]?-1:1,g={y:Wa(h[2],c),M:Wa(h[3],c),d:Wa(h[4],c),h:Wa(h[5],c),m:Wa(h[6],c),s:Wa(h[7],c),w:Wa(h[8],c)}):null==g?g={}:\"object\"==typeof g&&(\"from\"in g||\"to\"in g)&&(e=Ya(Aa(g.from),Aa(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ea(g),Fa(a)&&f(a,\"_locale\")&&(d._locale=a._locale),d}function Wa(a,b){var c=a&&parseFloat(a.replace(\",\",\".\"));return(isNaN(c)?0:c)*b}function Xa(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,\"M\").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,\"M\"),c}function Ya(a,b){var c;return b=Ia(b,a),a.isBefore(b)?c=Xa(a,b):(c=Xa(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function Za(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(_(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period).\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Va(c,d),$a(this,e,a),this}}function $a(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&D(b,\"Date\",C(b,\"Date\")+g*d),h&&V(b,C(b,\"Month\")+h*d),e&&a.updateOffset(b,g||h)}function _a(a){var b=a||Aa(),c=Ia(b,this).startOf(\"day\"),d=this.diff(c,\"days\",!0),e=-6>d?\"sameElse\":-1>d?\"lastWeek\":0>d?\"lastDay\":1>d?\"sameDay\":2>d?\"nextDay\":7>d?\"nextWeek\":\"sameElse\";return this.format(this.localeData().calendar(e,this,Aa(b)))}function ab(){return new n(this)}function bb(a,b){var c;return b=z(\"undefined\"!=typeof b?b:\"millisecond\"),\"millisecond\"===b?(a=o(a)?a:Aa(a),+this>+a):(c=o(a)?+a:+Aa(a),c<+this.clone().startOf(b))}function cb(a,b){var c;return b=z(\"undefined\"!=typeof b?b:\"millisecond\"),\"millisecond\"===b?(a=o(a)?a:Aa(a),+a>+this):(c=o(a)?+a:+Aa(a),+this.clone().endOf(b)a?Math.ceil(a):Math.floor(a)}function gb(a,b,c){var d,e,f=Ia(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=z(b),\"year\"===b||\"month\"===b||\"quarter\"===b?(e=hb(this,f),\"quarter\"===b?e/=3:\"year\"===b&&(e/=12)):(d=this-f,e=\"second\"===b?d/1e3:\"minute\"===b?d/6e4:\"hour\"===b?d/36e5:\"day\"===b?(d-g)/864e5:\"week\"===b?(d-g)/6048e5:d),c?e:fb(e)}function hb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,\"months\");return 0>b-f?(c=a.clone().add(e-1,\"months\"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,\"months\"),d=(b-f)/(c-f)),-(e+d)}function ib(){return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\")}function jb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Aa([2e3,1]).day(b),d=\"^\"+this.weekdays(c,\"\")+\"|^\"+this.weekdaysShort(c,\"\")+\"|^\"+this.weekdaysMin(c,\"\"),this._weekdaysParse[b]=new RegExp(d.replace(\".\",\"\"),\"i\")),this._weekdaysParse[b].test(a))return b}function Mb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Hb(a,this.localeData()),this.add(a-b,\"d\")):b}function Nb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,\"d\")}function Ob(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Pb(a,b){G(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Qb(a,b){return b._meridiemParse}function Rb(a){return\"p\"===(a+\"\").toLowerCase().charAt(0)}function Sb(a,b,c){return a>11?c?\"pm\":\"PM\":c?\"am\":\"AM\"}function Tb(a){G(0,[a,3],0,\"millisecond\")}function Ub(){return this._isUTC?\"UTC\":\"\"}function Vb(){return this._isUTC?\"Coordinated Universal Time\":\"\"}function Wb(a){return Aa(1e3*a)}function Xb(){return Aa.apply(null,arguments).parseZone()}function Yb(a,b,c){var d=this._calendar[a];return\"function\"==typeof d?d.call(b,c):d}function Zb(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b}function $b(){return this._invalidDate}function _b(a){return this._ordinal.replace(\"%d\",a)}function ac(a){return a}function bc(a,b,c,d){var e=this._relativeTime[c];return\"function\"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function cc(a,b){var c=this._relativeTime[a>0?\"future\":\"past\"];return\"function\"==typeof c?c(b):c.replace(/%s/i,b)}function dc(a){var b,c;for(c in a)b=a[c],\"function\"==typeof b?this[c]=b:this[\"_\"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+\"|\"+/\\d{1,2}/.source)}function ec(a,b,c,d){var e=x(),f=h().set(d,b);return e[c](f,a)}function fc(a,b,c,d,e){if(\"number\"==typeof a&&(b=a,a=void 0),a=a||\"\",null!=b)return ec(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=ec(a,f,c,e);return g}function gc(a,b){return fc(a,b,\"months\",12,\"month\")}function hc(a,b){return fc(a,b,\"monthsShort\",12,\"month\")}function ic(a,b){return fc(a,b,\"weekdays\",7,\"day\")}function jc(a,b){return fc(a,b,\"weekdaysShort\",7,\"day\")}function kc(a,b){return fc(a,b,\"weekdaysMin\",7,\"day\")}function lc(){var a=this._data;return this._milliseconds=Rd(this._milliseconds),this._days=Rd(this._days),this._months=Rd(this._months),a.milliseconds=Rd(a.milliseconds),a.seconds=Rd(a.seconds),a.minutes=Rd(a.minutes),a.hours=Rd(a.hours),a.months=Rd(a.months),a.years=Rd(a.years),this}function mc(a,b,c,d){var e=Va(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function nc(a,b){return mc(this,a,b,1)}function oc(a,b){return mc(this,a,b,-1)}function pc(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;return g.milliseconds=d%1e3,a=fb(d/1e3),g.seconds=a%60,b=fb(a/60),g.minutes=b%60,c=fb(b/60),g.hours=c%24,e+=fb(c/24),h=fb(qc(e)),e-=fb(rc(h)),f+=fb(e/30),e%=30,h+=fb(f/12),f%=12,g.days=e,g.months=f,g.years=h,this}function qc(a){return 400*a/146097}function rc(a){return 146097*a/400}function sc(a){var b,c,d=this._milliseconds;if(a=z(a),\"month\"===a||\"year\"===a)return b=this._days+d/864e5,c=this._months+12*qc(b),\"month\"===a?c:c/12;switch(b=this._days+Math.round(rc(this._months/12)),a){case\"week\":return b/7+d/6048e5;case\"day\":return b+d/864e5;case\"hour\":return 24*b+d/36e5;case\"minute\":return 1440*b+d/6e4;case\"second\":return 86400*b+d/1e3;case\"millisecond\":return Math.floor(864e5*b)+d;default:throw new Error(\"Unknown unit \"+a)}}function tc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)}function uc(a){return function(){return this.as(a)}}function vc(a){return a=z(a),this[a+\"s\"]()}function wc(a){return function(){return this._data[a]}}function xc(){return fb(this.days()/7)}function yc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function zc(a,b,c){var d=Va(a).abs(),e=fe(d.as(\"s\")),f=fe(d.as(\"m\")),g=fe(d.as(\"h\")),h=fe(d.as(\"d\")),i=fe(d.as(\"M\")),j=fe(d.as(\"y\")),k=e0,k[4]=c,yc.apply(null,k)}function Ac(a,b){return void 0===ge[a]?!1:void 0===b?ge[a]:(ge[a]=b,!0)}function Bc(a){var b=this.localeData(),c=zc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Cc(){var a=he(this.years()),b=he(this.months()),c=he(this.days()),d=he(this.hours()),e=he(this.minutes()),f=he(this.seconds()+this.milliseconds()/1e3),g=this.asSeconds();return g?(0>g?\"-\":\"\")+\"P\"+(a?a+\"Y\":\"\")+(b?b+\"M\":\"\")+(c?c+\"D\":\"\")+(d||e||f?\"T\":\"\")+(d?d+\"H\":\"\")+(e?e+\"M\":\"\")+(f?f+\"S\":\"\"):\"P0D\"}var Dc,Ec,Fc=a.momentProperties=[],Gc=!1,Hc={},Ic={},Jc=/(\\[[^\\[]*\\])|(\\\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Kc=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Lc={},Mc={},Nc=/\\d/,Oc=/\\d\\d/,Pc=/\\d{3}/,Qc=/\\d{4}/,Rc=/[+-]?\\d{6}/,Sc=/\\d\\d?/,Tc=/\\d{1,3}/,Uc=/\\d{1,4}/,Vc=/[+-]?\\d{1,6}/,Wc=/\\d+/,Xc=/[+-]?\\d+/,Yc=/Z|[+-]\\d\\d:?\\d\\d/gi,Zc=/[+-]?\\d+(\\.\\d{1,3})?/,$c=/[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i,_c={},ad={},bd=0,cd=1,dd=2,ed=3,fd=4,gd=5,hd=6;G(\"M\",[\"MM\",2],\"Mo\",function(){return this.month()+1}),G(\"MMM\",0,0,function(a){return this.localeData().monthsShort(this,a)}),G(\"MMMM\",0,0,function(a){return this.localeData().months(this,a)}),y(\"month\",\"M\"),L(\"M\",Sc),L(\"MM\",Sc,Oc),L(\"MMM\",$c),L(\"MMMM\",$c),O([\"M\",\"MM\"],function(a,b){b[cd]=p(a)-1}),O([\"MMM\",\"MMMM\"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[cd]=e:j(c).invalidMonth=a});var id=\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),jd=\"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\"),kd={};a.suppressDeprecationWarnings=!1;var ld=/^\\s*(?:[+-]\\d{6}|\\d{4})-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,md=[[\"YYYYYY-MM-DD\",/[+-]\\d{6}-\\d{2}-\\d{2}/],[\"YYYY-MM-DD\",/\\d{4}-\\d{2}-\\d{2}/],[\"GGGG-[W]WW-E\",/\\d{4}-W\\d{2}-\\d/],[\"GGGG-[W]WW\",/\\d{4}-W\\d{2}/],[\"YYYY-DDD\",/\\d{4}-\\d{3}/]],nd=[[\"HH:mm:ss.SSSS\",/(T| )\\d\\d:\\d\\d:\\d\\d\\.\\d+/],[\"HH:mm:ss\",/(T| )\\d\\d:\\d\\d:\\d\\d/],[\"HH:mm\",/(T| )\\d\\d:\\d\\d/],[\"HH\",/(T| )\\d\\d/]],od=/^\\/?Date\\((\\-?\\d+)/i;a.createFromInputFallback=$(\"moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.\",function(a){a._d=new Date(a._i+(a._useUTC?\" UTC\":\"\"))}),G(0,[\"YY\",2],0,function(){return this.year()%100}),G(0,[\"YYYY\",4],0,\"year\"),G(0,[\"YYYYY\",5],0,\"year\"),G(0,[\"YYYYYY\",6,!0],0,\"year\"),y(\"year\",\"y\"),L(\"Y\",Xc),L(\"YY\",Sc,Oc),L(\"YYYY\",Uc,Qc),L(\"YYYYY\",Vc,Rc),L(\"YYYYYY\",Vc,Rc),O([\"YYYY\",\"YYYYY\",\"YYYYYY\"],bd),O(\"YY\",function(b,c){c[bd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return p(a)+(p(a)>68?1900:2e3)};var pd=B(\"FullYear\",!1);G(\"w\",[\"ww\",2],\"wo\",\"week\"),G(\"W\",[\"WW\",2],\"Wo\",\"isoWeek\"),y(\"week\",\"w\"),y(\"isoWeek\",\"W\"),L(\"w\",Sc),L(\"ww\",Sc,Oc),L(\"W\",Sc),L(\"WW\",Sc,Oc),P([\"w\",\"ww\",\"W\",\"WW\"],function(a,b,c,d){b[d.substr(0,1)]=p(a)});var qd={dow:0,doy:6};G(\"DDD\",[\"DDDD\",3],\"DDDo\",\"dayOfYear\"),y(\"dayOfYear\",\"DDD\"),L(\"DDD\",Tc),L(\"DDDD\",Pc),O([\"DDD\",\"DDDD\"],function(a,b,c){c._dayOfYear=p(a)}),a.ISO_8601=function(){};var rd=$(\"moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548\",function(){var a=Aa.apply(null,arguments);return this>a?this:a}),sd=$(\"moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548\",function(){var a=Aa.apply(null,arguments);return a>this?this:a});Ga(\"Z\",\":\"),Ga(\"ZZ\",\"\"),L(\"Z\",Yc),L(\"ZZ\",Yc),O([\"Z\",\"ZZ\"],function(a,b,c){c._useUTC=!0,c._tzm=Ha(a)});var td=/([\\+\\-]|\\d\\d)/gi;a.updateOffset=function(){};var ud=/(\\-)?(?:(\\d*)\\.)?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?)?/,vd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Va.fn=Ea.prototype;var wd=Za(1,\"add\"),xd=Za(-1,\"subtract\");a.defaultFormat=\"YYYY-MM-DDTHH:mm:ssZ\";var yd=$(\"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.\",function(a){return void 0===a?this.localeData():this.locale(a)});G(0,[\"gg\",2],0,function(){return this.weekYear()%100}),G(0,[\"GG\",2],0,function(){return this.isoWeekYear()%100}),Ab(\"gggg\",\"weekYear\"),Ab(\"ggggg\",\"weekYear\"),Ab(\"GGGG\",\"isoWeekYear\"),Ab(\"GGGGG\",\"isoWeekYear\"),y(\"weekYear\",\"gg\"),y(\"isoWeekYear\",\"GG\"),L(\"G\",Xc),L(\"g\",Xc),L(\"GG\",Sc,Oc),L(\"gg\",Sc,Oc),L(\"GGGG\",Uc,Qc),L(\"gggg\",Uc,Qc),L(\"GGGGG\",Vc,Rc),L(\"ggggg\",Vc,Rc),P([\"gggg\",\"ggggg\",\"GGGG\",\"GGGGG\"],function(a,b,c,d){b[d.substr(0,2)]=p(a)}),P([\"gg\",\"GG\"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),G(\"Q\",0,0,\"quarter\"),y(\"quarter\",\"Q\"),L(\"Q\",Nc),O(\"Q\",function(a,b){b[cd]=3*(p(a)-1)}),G(\"D\",[\"DD\",2],\"Do\",\"date\"),y(\"date\",\"D\"),L(\"D\",Sc),L(\"DD\",Sc,Oc),L(\"Do\",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),O([\"D\",\"DD\"],dd),O(\"Do\",function(a,b){b[dd]=p(a.match(Sc)[0],10)});var zd=B(\"Date\",!0);G(\"d\",0,\"do\",\"day\"),G(\"dd\",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),G(\"ddd\",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),G(\"dddd\",0,0,function(a){return this.localeData().weekdays(this,a)}),G(\"e\",0,0,\"weekday\"),G(\"E\",0,0,\"isoWeekday\"),y(\"day\",\"d\"),y(\"weekday\",\"e\"),y(\"isoWeekday\",\"E\"),L(\"d\",Sc),L(\"e\",Sc),L(\"E\",Sc),L(\"dd\",$c),L(\"ddd\",$c),L(\"dddd\",$c),P([\"dd\",\"ddd\",\"dddd\"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),P([\"d\",\"e\",\"E\"],function(a,b,c,d){b[d]=p(a)});var Ad=\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),Bd=\"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\"),Cd=\"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");G(\"H\",[\"HH\",2],0,\"hour\"),G(\"h\",[\"hh\",2],0,function(){return this.hours()%12||12}),Pb(\"a\",!0),Pb(\"A\",!1),y(\"hour\",\"h\"),L(\"a\",Qb),L(\"A\",Qb),L(\"H\",Sc),L(\"h\",Sc),L(\"HH\",Sc,Oc),L(\"hh\",Sc,Oc),O([\"H\",\"HH\"],ed),O([\"a\",\"A\"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),O([\"h\",\"hh\"],function(a,b,c){b[ed]=p(a),j(c).bigHour=!0});var Dd=/[ap]\\.?m?\\.?/i,Ed=B(\"Hours\",!0);G(\"m\",[\"mm\",2],0,\"minute\"),y(\"minute\",\"m\"),L(\"m\",Sc),L(\"mm\",Sc,Oc),O([\"m\",\"mm\"],fd);var Fd=B(\"Minutes\",!1);G(\"s\",[\"ss\",2],0,\"second\"),y(\"second\",\"s\"),L(\"s\",Sc),L(\"ss\",Sc,Oc),O([\"s\",\"ss\"],gd);var Gd=B(\"Seconds\",!1);G(\"S\",0,0,function(){return~~(this.millisecond()/100)}),G(0,[\"SS\",2],0,function(){return~~(this.millisecond()/10)}),Tb(\"SSS\"),Tb(\"SSSS\"),y(\"millisecond\",\"ms\"),L(\"S\",Tc,Nc),L(\"SS\",Tc,Oc),L(\"SSS\",Tc,Pc),L(\"SSSS\",Wc),O([\"S\",\"SS\",\"SSS\",\"SSSS\"],function(a,b){b[hd]=p(1e3*(\"0.\"+a))});var Hd=B(\"Milliseconds\",!1);G(\"z\",0,0,\"zoneAbbr\"),G(\"zz\",0,0,\"zoneName\");var Id=n.prototype;Id.add=wd,Id.calendar=_a,Id.clone=ab,Id.diff=gb,Id.endOf=sb,Id.format=kb,Id.from=lb,Id.fromNow=mb,Id.to=nb,Id.toNow=ob,Id.get=E,Id.invalidAt=zb,Id.isAfter=bb,Id.isBefore=cb,Id.isBetween=db,Id.isSame=eb,Id.isValid=xb,Id.lang=yd,Id.locale=pb,Id.localeData=qb,Id.max=sd,Id.min=rd,Id.parsingFlags=yb,Id.set=E,Id.startOf=rb,Id.subtract=xd,Id.toArray=wb,Id.toDate=vb,Id.toISOString=jb,Id.toJSON=jb,Id.toString=ib,Id.unix=ub,Id.valueOf=tb,Id.year=pd,Id.isLeapYear=ga,Id.weekYear=Cb,Id.isoWeekYear=Db,Id.quarter=Id.quarters=Gb,Id.month=W,Id.daysInMonth=X,Id.week=Id.weeks=la,Id.isoWeek=Id.isoWeeks=ma,Id.weeksInYear=Fb,Id.isoWeeksInYear=Eb,Id.date=zd,Id.day=Id.days=Mb,Id.weekday=Nb,Id.isoWeekday=Ob,Id.dayOfYear=oa,Id.hour=Id.hours=Ed,Id.minute=Id.minutes=Fd,Id.second=Id.seconds=Gd,Id.millisecond=Id.milliseconds=Hd,Id.utcOffset=Ka,Id.utc=Ma,Id.local=Na,Id.parseZone=Oa,Id.hasAlignedHourOffset=Pa,Id.isDST=Qa,Id.isDSTShifted=Ra,Id.isLocal=Sa,Id.isUtcOffset=Ta,Id.isUtc=Ua,Id.isUTC=Ua,Id.zoneAbbr=Ub,Id.zoneName=Vb,Id.dates=$(\"dates accessor is deprecated. Use date instead.\",zd),Id.months=$(\"months accessor is deprecated. Use month instead\",W),Id.years=$(\"years accessor is deprecated. Use year instead\",pd),Id.zone=$(\"moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779\",La);var Jd=Id,Kd={sameDay:\"[Today at] LT\",nextDay:\"[Tomorrow at] LT\",nextWeek:\"dddd [at] LT\",lastDay:\"[Yesterday at] LT\",lastWeek:\"[Last] dddd [at] LT\",sameElse:\"L\"},Ld={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY LT\",LLLL:\"dddd, MMMM D, YYYY LT\"},Md=\"Invalid date\",Nd=\"%d\",Od=/\\d{1,2}/,Pd={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",\nhh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"},Qd=r.prototype;Qd._calendar=Kd,Qd.calendar=Yb,Qd._longDateFormat=Ld,Qd.longDateFormat=Zb,Qd._invalidDate=Md,Qd.invalidDate=$b,Qd._ordinal=Nd,Qd.ordinal=_b,Qd._ordinalParse=Od,Qd.preparse=ac,Qd.postformat=ac,Qd._relativeTime=Pd,Qd.relativeTime=bc,Qd.pastFuture=cc,Qd.set=dc,Qd.months=S,Qd._months=id,Qd.monthsShort=T,Qd._monthsShort=jd,Qd.monthsParse=U,Qd.week=ia,Qd._week=qd,Qd.firstDayOfYear=ka,Qd.firstDayOfWeek=ja,Qd.weekdays=Ib,Qd._weekdays=Ad,Qd.weekdaysMin=Kb,Qd._weekdaysMin=Cd,Qd.weekdaysShort=Jb,Qd._weekdaysShort=Bd,Qd.weekdaysParse=Lb,Qd.isPM=Rb,Qd._meridiemParse=Dd,Qd.meridiem=Sb,v(\"en\",{ordinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===p(a%100/10)?\"th\":1===b?\"st\":2===b?\"nd\":3===b?\"rd\":\"th\";return a+c}}),a.lang=$(\"moment.lang is deprecated. Use moment.locale instead.\",v),a.langData=$(\"moment.langData is deprecated. Use moment.localeData instead.\",x);var Rd=Math.abs,Sd=uc(\"ms\"),Td=uc(\"s\"),Ud=uc(\"m\"),Vd=uc(\"h\"),Wd=uc(\"d\"),Xd=uc(\"w\"),Yd=uc(\"M\"),Zd=uc(\"y\"),$d=wc(\"milliseconds\"),_d=wc(\"seconds\"),ae=wc(\"minutes\"),be=wc(\"hours\"),ce=wc(\"days\"),de=wc(\"months\"),ee=wc(\"years\"),fe=Math.round,ge={s:45,m:45,h:22,d:26,M:11},he=Math.abs,ie=Ea.prototype;ie.abs=lc,ie.add=nc,ie.subtract=oc,ie.as=sc,ie.asMilliseconds=Sd,ie.asSeconds=Td,ie.asMinutes=Ud,ie.asHours=Vd,ie.asDays=Wd,ie.asWeeks=Xd,ie.asMonths=Yd,ie.asYears=Zd,ie.valueOf=tc,ie._bubble=pc,ie.get=vc,ie.milliseconds=$d,ie.seconds=_d,ie.minutes=ae,ie.hours=be,ie.days=ce,ie.weeks=xc,ie.months=de,ie.years=ee,ie.humanize=Bc,ie.toISOString=Cc,ie.toString=Cc,ie.toJSON=Cc,ie.locale=pb,ie.localeData=qb,ie.toIsoString=$(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\",Cc),ie.lang=yd,G(\"X\",0,0,\"unix\"),G(\"x\",0,0,\"valueOf\"),L(\"x\",Xc),L(\"X\",Zc),O(\"X\",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),O(\"x\",function(a,b,c){c._d=new Date(p(a))}),a.version=\"2.10.3\",b(Aa),a.fn=Jd,a.min=Ca,a.max=Da,a.utc=h,a.unix=Wb,a.months=gc,a.isDate=d,a.locale=v,a.invalid=l,a.duration=Va,a.isMoment=o,a.weekdays=ic,a.parseZone=Xb,a.localeData=x,a.isDuration=Fa,a.monthsShort=hc,a.weekdaysMin=kc,a.defineLocale=w,a.weekdaysShort=jc,a.normalizeUnits=z,a.relativeTimeThreshold=Ac;var je=a;return je});","/**\n * An Angular module that gives you access to the browsers local storage\n * @version v0.2.0 - 2015-05-10\n * @link https://github.com/grevory/angular-local-storage\n * @author grevory \n * @license MIT License, http://www.opensource.org/licenses/MIT\n */!function(a,b,c){\"use strict\";function d(a){return/^-?\\d+\\.?\\d*$/.test(a.replace(/[\"']/g,\"\"))}var e=b.isDefined,f=b.isUndefined,g=b.isNumber,h=b.isObject,i=b.isArray,j=b.extend,k=b.toJson,l=b.module(\"LocalStorageModule\",[]);l.provider(\"localStorageService\",function(){this.prefix=\"ls\",this.storageType=\"localStorage\",this.cookie={expiry:30,path:\"/\"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(a){return this.prefix=a,this},this.setStorageType=function(a){return this.storageType=a,this},this.setStorageCookie=function(a,b){return this.cookie.expiry=a,this.cookie.path=b,this},this.setStorageCookieDomain=function(a){return this.cookie.domain=a,this},this.setNotify=function(a,b){return this.notify={setItem:a,removeItem:b},this},this.$get=[\"$rootScope\",\"$window\",\"$document\",\"$parse\",function(a,b,c,l){function m(a,b){return\"true\"===b||\"false\"===b?\"true\"===b:b}var n,o=this,p=o.prefix,q=o.cookie,r=o.notify,s=o.storageType;c?c[0]&&(c=c[0]):c=document,\".\"!==p.substr(-1)&&(p=p?p+\".\":\"\");var t=function(a){return p+a},u=function(){try{var c=s in b&&null!==b[s],d=t(\"__\"+Math.round(1e7*Math.random()));return c&&(n=b[s],n.setItem(d,\"\"),n.removeItem(d)),c}catch(e){return s=\"cookie\",a.$broadcast(\"LocalStorageModule.notification.error\",e.message),!1}}(),v=function(b,c){if(f(c)?c=null:(h(c)||i(c)||g(+c||c))&&(c=k(c)),!u||\"cookie\"===o.storageType)return u||a.$broadcast(\"LocalStorageModule.notification.warning\",\"LOCAL_STORAGE_NOT_SUPPORTED\"),r.setItem&&a.$broadcast(\"LocalStorageModule.notification.setitem\",{key:b,newvalue:c,storageType:\"cookie\"}),B(b,c);try{n&&n.setItem(t(b),c),r.setItem&&a.$broadcast(\"LocalStorageModule.notification.setitem\",{key:b,newvalue:c,storageType:o.storageType})}catch(d){return a.$broadcast(\"LocalStorageModule.notification.error\",d.message),B(b,c)}return!0},w=function(b){if(!u||\"cookie\"===o.storageType)return u||a.$broadcast(\"LocalStorageModule.notification.warning\",\"LOCAL_STORAGE_NOT_SUPPORTED\"),C(b);var c=n?n.getItem(t(b)):null;return c&&\"null\"!==c?\"{\"===c.charAt(0)||\"[\"===c.charAt(0)||d(c)?JSON.parse(c,m):c:null},x=function(){var b,c;for(b=0;b0||(c.cookie=\"test\").indexOf.call(c.cookie,\"test\")>-1)}catch(d){return a.$broadcast(\"LocalStorageModule.notification.error\",d.message),!1}}(),B=function(b,d,e){if(f(d))return!1;if((i(d)||h(d))&&(d=k(d)),!A)return a.$broadcast(\"LocalStorageModule.notification.error\",\"COOKIES_NOT_SUPPORTED\"),!1;try{var j=\"\",l=new Date,m=\"\";if(null===d?(l.setTime(l.getTime()+-864e5),j=\"; expires=\"+l.toGMTString(),d=\"\"):g(e)&&0!==e?(l.setTime(l.getTime()+24*e*60*60*1e3),j=\"; expires=\"+l.toGMTString()):0!==q.expiry&&(l.setTime(l.getTime()+24*q.expiry*60*60*1e3),j=\"; expires=\"+l.toGMTString()),b){var n=\"; path=\"+q.path;q.domain&&(m=\"; domain=\"+q.domain),c.cookie=t(b)+\"=\"+encodeURIComponent(d)+j+n+m}}catch(o){return a.$broadcast(\"LocalStorageModule.notification.error\",o.message),!1}return!0},C=function(b){if(!A)return a.$broadcast(\"LocalStorageModule.notification.error\",\"COOKIES_NOT_SUPPORTED\"),!1;for(var d=c.cookie&&c.cookie.split(\";\")||[],e=0;e=e;e+=1){if(void 0!==d&&d.hasClass(b)){c=d;break}void 0!==d&&(d=d.parent())}return c},e=function(b,c){for(var d,f=0;f0));f+=1);return a.element(d)},f=function(a){return d(a,\"form-group\")},g=function(a){return e(a,\"input-group\")},h=function(a,b){a[0].parentNode.insertBefore(b[0],a[0].nextSibling)},i=!1,j=function(a){i=a},k=function(d){var e,j=f(d);if(j){if(c(j),e=g(j[0]),j.addClass(\"has-success \"+(e.length>0?\"\":\"has-feedback\")),i){var k='';e.length>0&&(k=k.replace(\"form-\",\"\"),k=''+k+\"'+e+\"\");if(k){if(c(k),j=g(k[0]),k.addClass(\"has-error \"+(j.length>0?\"\":\"has-feedback\")),h(j.length>0?j:d,l),i){var m='';j.length>0&&(m=m.replace(\"form-\",\"\"),m=''+m+\"=c&&(void 0===b||!b.hasClass(\"columns\"));c+=1)void 0!==b&&(b=b.parent());return b},d=function(a){var d=c(a);b(d&&d.length>0?d:a,a)},e=function(d,e){var f,g=c(d);b(g||d,d),d.addClass(\"error\"),g&&(f=a.element(''+e+\"\"),g.append(f))},f=function(a){d(a)};return{makeValid:d,makeInvalid:e,makeDefault:f,key:\"foundation5\"}}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").factory(\"jcs-elementUtils\",[function(){var a=function(a){return a[0].offsetWidth>0&&a[0].offsetHeight>0};return{isElementVisible:a}}]),a.module(\"jcs-autoValidate\").factory(\"validationManager\",[\"validator\",\"jcs-elementUtils\",function(b,c){var d=[\"input\",\"textarea\",\"select\",\"form\"],e=function(a){return c.isElementVisible(a)},f=function(c){var d=a.element(c).controller(\"form\");return void 0!==d&&null!==d?d.autoValidateFormOptions:b.defaultFormValidationOptions},g=function(a,b){var c=a&&a.length>0&&(e(a)||b.validateNonVisibleControls)&&(d.indexOf(a[0].nodeName.toLowerCase())>-1||a[0].hasAttribute(\"register-custom-form-control\"));return c},h=function(c,d,e){var h,i=!0,j=e||f(d),k=c.$pristine===!1||j.forceValidation,l=function(b){var c,d=!0;return a.forEach(b,function(a,b){d&&a&&(d=!1,c=b)}),c};return j.disabled===!1&&(j.forceValidation||g(d,j)&&c&&k)&&(i=!c.$invalid,j.removeExternalValidationErrorsOnSubmit&&c.removeAllExternalValidation&&c.removeAllExternalValidation(),i?b.makeValid(d):(h=l(c.$errors||c.$error),void 0===h?i=!0:b.getErrorMessage(h,d).then(function(a){b.makeInvalid(d,a)}))),i},i=function(a){b.makeDefault(a)},j=function(b){a.forEach(b[0].all||b[0].elements||b[0],function(b){var c,d=a.element(b);c=d.controller(\"ngModel\"),void 0!==c&&(\"form\"===d[0].nodeName.toLowerCase()?j(d):c.$setPristine())})},k=function(b){var c,d=!0,e=b?a.element(b).controller(\"form\"):void 0,i=function(b,c,e){var i,j,l;b=a.element(b),i=b.controller(\"ngModel\"),void 0!==i&&(c||g(b,e))&&(\"form\"===b[0].nodeName.toLowerCase()?k(b):(l=f(b),l.forceValidation=c,j=h(i,b,l),d=d&&j))};return void 0===b||void 0!==e&&e.autoValidateFormOptions.disabled?void 0!==b:(c=a.copy(e.autoValidateFormOptions),c.forceValidation=!0,a.forEach(b[0].all||b[0].elements||b[0],function(a){i(a,!0,c)}),b[0].customHTMLFormControlsCollection&&a.forEach(b[0].customHTMLFormControlsCollection,function(a){i(a,!0,c)}),d)},l=function(a,c,d){c?b.getErrorMessage(c,a).then(function(c){b.makeInvalid(a,c)}):b.makeInvalid(a,d)};return{setElementValidationError:l,validateElement:h,validateForm:k,resetElement:i,resetForm:j}}])}(angular),function(a){\"use strict\";function b(a){return void 0!==a&&\"false\"!==a}function c(c,d,e){var f=c.autoValidateFormOptions=c.autoValidateFormOptions||a.copy(d.defaultFormValidationOptions);f.forceValidation=!1,f.disabled=!d.isEnabled()||b(e.disableDynamicValidation),f.validateNonVisibleControls=b(e.validateNonVisibleControls),f.removeExternalValidationErrorsOnSubmit=void 0===e.removeExternalValidationErrorsOnSubmit?!0:b(e.removeExternalValidationErrorsOnSubmit),d.isEnabled()===!1&&b(e.disableDynamicValidation)===!1&&(f.disabled=!1)}a.module(\"jcs-autoValidate\").directive(\"form\",[\"validator\",function(a){return{restrict:\"E\",require:\"form\",priority:9999,compile:function(){return{pre:function(b,d,e,f){c(f,a,e)}}}}}]),a.module(\"jcs-autoValidate\").directive(\"ngForm\",[\"validator\",function(a){return{restrict:\"EA\",require:\"form\",priority:9999,compile:function(){return{pre:function(b,d,e,f){c(f,a,e)}}}}}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").directive(\"form\",[\"validationManager\",function(a){return{restrict:\"E\",link:function(b,c){var d=c.controller(\"form\");void 0!==d&&d.autoValidateFormOptions&&d.autoValidateFormOptions.disabled===!1&&(c.on(\"reset\",function(){a.resetForm(c)}),b.$on(\"$destroy\",function(){c.off(\"reset\")}))}}}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").directive(\"registerCustomFormControl\",[function(){var b=function(b){for(var c=b,d=0;50>=d&&(void 0===c||\"form\"!==c.nodeName.toLowerCase());d+=1)void 0!==c&&(c=a.element(c).parent()[0]);return c};return{restrict:\"A\",link:function(a,c){var d=b(c.parent()[0]);d&&(d.customHTMLFormControlsCollection=d.customHTMLFormControlsCollection||[],d.customHTMLFormControlsCollection.push(c[0]))}}}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").config([\"$provide\",function(a){a.decorator(\"ngSubmitDirective\",[\"$delegate\",\"$parse\",\"validationManager\",function(a,b,c){return a[0].compile=function(a,d){var e=b(d.ngSubmit),f=\"true\"===d.ngSubmitForce;return function(b,d){function g(g){b.$apply(function(){var h=a.controller(\"form\");void 0!==h&&null!==h&&h.autoValidateFormOptions&&h.autoValidateFormOptions.disabled===!0?e(b,{$event:g}):(c.validateForm(d)||f===!0)&&e(b,{$event:g})})}d.on(\"submit\",g),b.$on(\"$destroy\",function(){d.off(\"submit\",g)})}},a}])}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").config([\"$provide\",function(b){b.decorator(\"ngModelDirective\",[\"$timeout\",\"$delegate\",\"validationManager\",\"jcs-debounce\",function(b,c,d,e){var f=c[0],g=f.link||f.compile;return f.compile=function(b){return function(c,f,h,i){var j=i[0],k=i[1],l=a.version.major>=1&&a.version.minor>=3,m=void 0===h.ngModelOptions?void 0:c.$eval(h.ngModelOptions),n=j.$setValidity,o=j.$setPristine,p=e.debounce(function(){var a=void 0!==k&&null!==k?k.autoValidateFormOptions:void 0;d.validateElement(j,f,a)},100);l&&a.isFunction(g)&&(g=g(b)),g.pre&&(g.pre.apply(this,arguments),m=void 0===j.$options?void 0:j.$options),void 0===h.formnovalidate&&void 0!==k&&null!==k&&k.autoValidateFormOptions&&k.autoValidateFormOptions.disabled===!1&&(l||void 0===m||void 0===m.updateOn||\"\"===m.updateOn?j.$setValidity=function(a,b){n.call(j,a,b),p()}:(f.on(m.updateOn,function(){p()}),c.$on(\"$destroy\",function(){f.off(m.updateOn)})),j.$setPristine=function(){o.call(j),d.resetElement(f)},j.autoValidated=!0),g.post?g.post.apply(this,arguments):g.apply(this,arguments),j.setExternalValidation=function(a,b,c){if(c){var e=j.$error||j.$errors;e[a]=!1}j.externalErrors=j.externalErrors||{},j.externalErrors[a]=!1,d.setElementValidationError(f,a,b)},j.removeExternalValidation=function(a,b){if(b){var c=j.$error||j.$errors;c[a]=!0}j.externalErrors&&delete j.externalErrors[a],d.resetElement(f)},j.removeAllExternalValidation=function(){if(j.externalErrors){var b=j.$error||j.$errors;a.forEach(j.externalErrors,function(a,c){b[c]=!0}),j.externalErrors={},d.resetElement(f)}},k&&(k.setExternalValidation=function(a,b,c,d){var e=!1;return k[a]&&(k[a].setExternalValidation(b,c,d),e=!0),e},k.removeExternalValidation=function(a,b,c,d){var e=!1;return k[a]&&(k[a].removeExternalValidation(b,d),e=!0),e})}},c}])}])}(angular),function(a){\"use strict\";a.module(\"jcs-autoValidate\").run([\"validator\",\"defaultErrorMessageResolver\",\"bootstrap3ElementModifier\",\"foundation5ElementModifier\",function(a,b,c,d){a.setErrorMessageResolver(b.resolve),a.registerDomModifier(c.key,c),a.registerDomModifier(d.key,d),a.setDefaultElementModifier(c.key)}])}(angular);","/*!\n angular-block-ui v0.2.0\n (c) 2015 (null) McNull https://github.com/McNull/angular-block-ui\n License: MIT\n*/\n(function(angular) {\n\nvar blkUI = angular.module('blockUI', []);\n\nblkUI.config([\"$provide\", \"$httpProvider\", function ($provide, $httpProvider) {\n\n $provide.decorator('$exceptionHandler', ['$delegate', '$injector',\n function ($delegate, $injector) {\n var blockUI, blockUIConfig;\n\n return function (exception, cause) {\n\n blockUIConfig = blockUIConfig || $injector.get('blockUIConfig');\n\n if (blockUIConfig.resetOnException) {\n try {\n blockUI = blockUI || $injector.get('blockUI');\n blockUI.instances.reset();\n } catch (ex) {\n console.log('$exceptionHandler', exception);\n }\n }\n\n $delegate(exception, cause);\n };\n }\n ]);\n\n $httpProvider.interceptors.push('blockUIHttpInterceptor');\n}]);\n\nblkUI.run([\"$document\", \"blockUIConfig\", \"$templateCache\", function ($document, blockUIConfig, $templateCache) {\n if (blockUIConfig.autoInjectBodyBlock) {\n $document.find('body').attr('block-ui', 'main');\n }\n\n if (blockUIConfig.template) {\n\n // Swap the builtin template with the custom template.\n // Create a magic cache key and place the template in the cache.\n\n blockUIConfig.templateUrl = '$$block-ui-template$$';\n $templateCache.put(blockUIConfig.templateUrl, blockUIConfig.template);\n }\n}]);\n\nfunction moduleLoaded(name) {\n try {\n angular.module(name);\n } catch(ex) {\n return false;\n }\n return true;\n}\nblkUI.config([\"$provide\", function ($provide) {\n $provide.decorator('$location', decorateLocation);\n}]);\n\nvar decorateLocation = [\n '$delegate', 'blockUI', 'blockUIConfig',\n function ($delegate, blockUI, blockUIConfig) {\n\n if (blockUIConfig.blockBrowserNavigation) {\n\n blockUI.$_blockLocationChange = true;\n\n var overrides = ['url', 'path', 'search', 'hash', 'state'];\n\n function hook(f) {\n var s = $delegate[f];\n $delegate[f] = function () {\n\n // console.log(f, Date.now(), arguments);\n\n var result = s.apply($delegate, arguments);\n\n // The call was a setter if the $location service is returned.\n\n if (result === $delegate) {\n\n // Mark the mainblock ui to allow the location change.\n\n blockUI.$_blockLocationChange = false;\n }\n\n return result;\n };\n }\n\n angular.forEach(overrides, hook);\n\n }\n\n return $delegate;\n}];\n\n// Called from block-ui-directive for the 'main' instance.\n\nfunction blockNavigation($scope, mainBlockUI, blockUIConfig) {\n\n if (blockUIConfig.blockBrowserNavigation) {\n\n function registerLocationChange() {\n\n $scope.$on('$locationChangeStart', function (event) {\n\n // console.log('$locationChangeStart', mainBlockUI.$_blockLocationChange + ' ' + mainBlockUI.state().blockCount);\n\n if (mainBlockUI.$_blockLocationChange && mainBlockUI.state().blockCount > 0) {\n event.preventDefault();\n }\n });\n\n $scope.$on('$locationChangeSuccess', function () {\n mainBlockUI.$_blockLocationChange = blockUIConfig.blockBrowserNavigation;\n\n // console.log('$locationChangeSuccess', mainBlockUI.$_blockLocationChange + ' ' + mainBlockUI.state().blockCount);\n });\n }\n\n if (moduleLoaded('ngRoute')) {\n\n // After the initial content has been loaded we'll spy on any location\n // changes and discard them when needed.\n\n var fn = $scope.$on('$viewContentLoaded', function () {\n\n // Unhook the view loaded and hook a function that will prevent\n // location changes while the block is active.\n\n fn();\n registerLocationChange();\n\n });\n\n } else {\n registerLocationChange();\n }\n\n }\n}\nblkUI.directive('blockUiContainer', [\"blockUIConfig\", \"blockUiContainerLinkFn\", function (blockUIConfig, blockUiContainerLinkFn) {\n return {\n scope: true,\n restrict: 'A',\n templateUrl: blockUIConfig.templateUrl,\n compile: function($element) {\n return blockUiContainerLinkFn;\n }\n };\n}]).factory('blockUiContainerLinkFn', [\"blockUI\", \"blockUIUtils\", function (blockUI, blockUIUtils) {\n\n return function ($scope, $element, $attrs) {\n\n var srvInstance = $element.inheritedData('block-ui');\n\n if (!srvInstance) {\n throw new Error('No parent block-ui service instance located.');\n }\n\n // Expose the state on the scope\n\n $scope.state = srvInstance.state();\n\n// $scope.$watch('state.blocking', function(value) {\n// $element.toggleClass('block-ui-visible', !!value);\n// });\n//\n// $scope.$watch('state.blockCount > 0', function(value) {\n// $element.toggleClass('block-ui-active', !!value);\n// });\n };\n}]);\nblkUI.directive('blockUi', [\"blockUiCompileFn\", function (blockUiCompileFn) {\n\n return {\n scope: true,\n restrict: 'A',\n compile: blockUiCompileFn\n };\n\n}]).factory('blockUiCompileFn', [\"blockUiPreLinkFn\", function (blockUiPreLinkFn) {\n\n return function ($element, $attrs) {\n\n // Class should be added here to prevent an animation delay error.\n\n $element.append('');\n\n return {\n pre: blockUiPreLinkFn\n };\n\n };\n\n}]).factory('blockUiPreLinkFn', [\"blockUI\", \"blockUIUtils\", \"blockUIConfig\", function (blockUI, blockUIUtils, blockUIConfig) {\n\n return function ($scope, $element, $attrs) {\n\n // If the element does not have the class \"block-ui\" set, we set the\n // default css classes from the config.\n\n if (!$element.hasClass('block-ui')) {\n $element.addClass(blockUIConfig.cssClass);\n }\n\n // Expose the blockUiMessageClass attribute value on the scope\n\n $attrs.$observe('blockUiMessageClass', function (value) {\n $scope.$_blockUiMessageClass = value;\n });\n\n // Create the blockUI instance\n // Prefix underscore to prevent integers:\n // https://github.com/McNull/angular-block-ui/pull/8\n\n var instanceId = $attrs.blockUi || '_' + $scope.$id;\n var srvInstance = blockUI.instances.get(instanceId);\n\n // If this is the main (topmost) block element we'll also need to block any\n // location changes while the block is active.\n\n if (instanceId === 'main') {\n blockNavigation($scope, srvInstance, blockUIConfig);\n } else {\n // Locate the parent blockUI instance\n var parentInstance = $element.inheritedData('block-ui');\n\n if (parentInstance) {\n // TODO: assert if parent is already set to something else\n srvInstance._parent = parentInstance;\n }\n }\n\n // Ensure the instance is released when the scope is destroyed\n\n $scope.$on('$destroy', function () {\n srvInstance.release();\n });\n\n // Increase the reference count\n\n srvInstance.addRef();\n\n // Expose the state on the scope\n\n $scope.$_blockUiState = srvInstance.state();\n\n $scope.$watch('$_blockUiState.blocking', function (value) {\n // Set the aria-busy attribute if needed\n $element.attr('aria-busy', !!value);\n $element.toggleClass('block-ui-visible', !!value);\n });\n\n $scope.$watch('$_blockUiState.blockCount > 0', function (value) {\n $element.toggleClass('block-ui-active', !!value);\n });\n\n // If a pattern is provided assign it to the state\n\n var pattern = $attrs.blockUiPattern;\n\n if (pattern) {\n var regExp = blockUIUtils.buildRegExp(pattern);\n srvInstance.pattern(regExp);\n }\n\n // Store a reference to the service instance on the element\n\n $element.data('block-ui', srvInstance);\n\n };\n\n}]);\n//.factory('blockUiPostLinkFn', function(blockUIUtils) {\n//\n// return function($scope, $element, $attrs) {\n//\n// var $message;\n//\n// $attrs.$observe('blockUiMessageClass', function(value) {\n//\n// $message = $message || blockUIUtils.findElement($element, function($e) {\n// return $e.hasClass('block-ui-message');\n// });\n//\n// $message.addClass(value);\n//\n// });\n// };\n//\n//});\nblkUI.constant('blockUIConfig', {\n templateUrl: 'angular-block-ui/angular-block-ui.ng.html',\n delay: 250,\n message: \"Loading ...\",\n autoBlock: true,\n resetOnException: true,\n requestFilter: angular.noop,\n autoInjectBodyBlock: true,\n cssClass: 'block-ui block-ui-anim-fade',\n blockBrowserNavigation: false\n});\n\n\nblkUI.factory('blockUIHttpInterceptor', [\"$q\", \"$injector\", \"blockUIConfig\", \"$templateCache\", function($q, $injector, blockUIConfig, $templateCache) {\n\n var blockUI;\n\n function injectBlockUI() {\n blockUI = blockUI || $injector.get('blockUI');\n }\n\n function stopBlockUI(config) {\n if (blockUIConfig.autoBlock && (config && !config.$_noBlock && config.$_blocks)) {\n injectBlockUI();\n config.$_blocks.stop();\n }\n }\n\n function error(rejection) {\n\n try {\n stopBlockUI(rejection.config);\n } catch(ex) {\n console.log('httpRequestError', ex);\n }\n\n return $q.reject(rejection);\n }\n\n return {\n request: function(config) {\n\n // Only block when autoBlock is enabled ...\n // ... and the request doesn't match a cached template.\n\n if (blockUIConfig.autoBlock &&\n !(config.method == 'GET' && $templateCache.get(config.url))) {\n\n // Don't block excluded requests\n\n var result = blockUIConfig.requestFilter(config);\n\n if (result === false) {\n // Tag the config so we don't unblock this request\n config.$_noBlock = true;\n } else {\n\n injectBlockUI();\n\n config.$_blocks = blockUI.instances.locate(config);\n config.$_blocks.start(result);\n }\n }\n\n return config;\n },\n\n requestError: error,\n\n response: function(response) {\n\n // If the connection to the website goes down the response interceptor gets and error with \"cannot read property config of null\".\n // https://github.com/McNull/angular-block-ui/issues/53\n\n if(response) {\n stopBlockUI(response.config);\n }\n\n return response;\n },\n\n responseError: error\n };\n\n}]);\n\nblkUI.factory('blockUI', [\"blockUIConfig\", \"$timeout\", \"blockUIUtils\", \"$document\", function(blockUIConfig, $timeout, blockUIUtils, $document) {\n\n var $body = $document.find('body');\n\n function BlockUI(id) {\n\n var self = this;\n\n var state = {\n id: id,\n blockCount: 0,\n message: blockUIConfig.message,\n blocking: false\n }, startPromise, doneCallbacks = [];\n\n this._id = id;\n\n this._refs = 0;\n\n this.start = function(message) {\n\n if(state.blockCount > 0) {\n message = message || state.message || blockUIConfig.message;\n } else {\n message = message || blockUIConfig.message;\n }\n\n state.message = message;\n\n state.blockCount++;\n\n // Check if the focused element is part of the block scope\n\n var $ae = angular.element($document[0].activeElement);\n\n if($ae.length && blockUIUtils.isElementInBlockScope($ae, self)) {\n\n // Let the active element lose focus and store a reference \n // to restore focus when we're done (reset)\n\n self._restoreFocus = $ae[0];\n\n // https://github.com/McNull/angular-block-ui/issues/13\n // http://stackoverflow.com/questions/22698058/apply-already-in-progress-error-when-using-typeahead-plugin-found-to-be-relate\n // Queue the blur after any ng-blur expression.\n\n $timeout(function() {\n // Ensure we still need to blur\n if(self._restoreFocus) {\n self._restoreFocus.blur();\n }\n });\n }\n\n if (!startPromise) {\n startPromise = $timeout(function() {\n startPromise = null;\n state.blocking = true;\n }, blockUIConfig.delay);\n }\n };\n\n this._cancelStartTimeout = function() {\n if (startPromise) {\n $timeout.cancel(startPromise);\n startPromise = null;\n }\n };\n\n this.stop = function() {\n state.blockCount = Math.max(0, --state.blockCount);\n\n if (state.blockCount === 0) {\n self.reset(true);\n }\n };\n\n this.message = function(value) {\n state.message = value;\n };\n\n this.pattern = function(regexp) {\n if (regexp !== undefined) {\n self._pattern = regexp;\n }\n\n return self._pattern;\n };\n\n this.reset = function(executeCallbacks) {\n \n self._cancelStartTimeout();\n state.blockCount = 0;\n state.blocking = false;\n\n // Restore the focus to the element that was active\n // before the block start, but not if the user has \n // focused something else while the block was active.\n\n if(self._restoreFocus && \n (!$document[0].activeElement || $document[0].activeElement === $body[0])) {\n self._restoreFocus.focus();\n self._restoreFocus = null;\n }\n \n try {\n if (executeCallbacks) {\n angular.forEach(doneCallbacks, function(cb) {\n cb();\n });\n }\n } finally {\n doneCallbacks.length = 0;\n }\n };\n\n this.done = function(fn) {\n doneCallbacks.push(fn);\n };\n\n this.state = function() {\n return state;\n };\n\n this.addRef = function() {\n self._refs += 1;\n };\n\n this.release = function() {\n if(--self._refs <= 0) {\n mainBlock.instances._destroy(self);\n }\n };\n }\n\n var instances = [];\n\n instances.get = function(id) {\n\n if(!isNaN(id)) {\n throw new Error('BlockUI id cannot be a number');\n }\n\n var instance = instances[id];\n\n if(!instance) {\n // TODO: ensure no array instance trashing [xxx] -- current workaround: '_' + $scope.$id\n instance = instances[id] = new BlockUI(id);\n instances.push(instance);\n }\n\n return instance;\n };\n\n instances._destroy = function(idOrInstance) {\n if (angular.isString(idOrInstance)) {\n idOrInstance = instances[idOrInstance];\n }\n\n if (idOrInstance) {\n idOrInstance.reset();\n\n var i = blockUIUtils.indexOf(instances, idOrInstance);\n instances.splice(i, 1);\n\n delete instances[idOrInstance.state().id];\n }\n };\n \n instances.locate = function(request) {\n\n var result = [];\n\n // Add function wrappers that will be executed on every item\n // in the array.\n \n blockUIUtils.forEachFnHook(result, 'start');\n blockUIUtils.forEachFnHook(result, 'stop');\n\n var i = instances.length;\n\n while(i--) {\n var instance = instances[i];\n var pattern = instance._pattern;\n\n if(pattern && pattern.test(request.url)) {\n result.push(instance);\n }\n }\n\n if(result.length === 0) {\n result.push(mainBlock);\n }\n\n return result;\n };\n\n // Propagate the reset to all instances\n\n blockUIUtils.forEachFnHook(instances, 'reset');\n\n var mainBlock = instances.get('main');\n\n mainBlock.addRef();\n mainBlock.instances = instances;\n\n return mainBlock;\n}]);\n\n\nblkUI.factory('blockUIUtils', function() {\n\n var $ = angular.element;\n\n var utils = {\n buildRegExp: function(pattern) {\n var match = pattern.match(/^\\/(.*)\\/([gim]*)$/), regExp;\n\n if(match) {\n regExp = new RegExp(match[1], match[2]);\n } else {\n throw Error('Incorrect regular expression format: ' + pattern);\n }\n\n return regExp;\n },\n forEachFn: function(arr, fnName, args) {\n var i = arr.length;\n while(i--) {\n var t = arr[i];\n t[fnName].apply(t, args);\n }\n },\n forEachFnHook: function(arr, fnName) {\n arr[fnName] = function() {\n utils.forEachFn(this, fnName, arguments);\n }\n },\n isElementInBlockScope: function($element, blockScope) {\n var c = $element.inheritedData('block-ui');\n\n while(c) {\n if(c === blockScope) {\n return true;\n }\n\n c = c._parent;\n }\n\n return false;\n },\n findElement: function ($element, predicateFn, traverse) {\n var ret = null;\n\n if (predicateFn($element)) {\n ret = $element;\n } else {\n\n var $elements;\n\n if (traverse) {\n $elements = $element.parent();\n } else {\n $elements = $element.children();\n }\n\n var i = $elements.length;\n while (!ret && i--) {\n ret = utils.findElement($($elements[i]), predicateFn, traverse);\n }\n }\n\n return ret;\n },\n indexOf: function(arr, obj, start) {\n// if(Array.prototype.indexOf) {\n// return arr.indexOf(obj, start);\n// }\n\n for (var i = (start || 0), j = arr.length; i < j; i++) {\n if (arr[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }\n };\n\n return utils;\n\n});\n// Automatically generated.\n// This file is already embedded in your main javascript output, there's no need to include this file\n// manually in the index.html. This file is only here for your debugging pleasures.\nangular.module('blockUI').run(['$templateCache', function($templateCache){\n $templateCache.put('angular-block-ui/angular-block-ui.ng.html', '');\n}]);\n})(angular);\n//# sourceMappingURL=angular-block-ui.js.map","angular.module('bgDirectives', [])\n .directive('bgSplitter', function () {\r\n return {\n restrict: 'E',\n replace: true,\n transclude: true,\n scope: {\n orientation: '@'\n }, \n template: '',\n controller: ['$scope', function ($scope) {\n $scope.panes = [];\n \n this.addPane = function (pane) {\r\n if ($scope.panes.length > 1) \n throw 'splitters can only have two panes';\n $scope.panes.push(pane);\n return $scope.panes.length;\n };\n }],\n link: function (scope, element, attrs) {\r\n var handler = angular.element('');\n var pane1 = scope.panes[0];\n var pane2 = scope.panes[1];\n var vertical = scope.orientation == 'vertical';\n var pane1Min = pane1.minSize || 0;\n var pane2Min = pane2.minSize || 0;\n var drag = false;\n \n pane1.elem.after(handler);\n\n element.bind('mousemove', function (ev) {\n if (!drag) return;\n \n var bounds = element[0].getBoundingClientRect();\n var pos = 0;\n \n if (vertical) {\n var height = bounds.bottom - bounds.top;\n pos = ev.clientY - bounds.top;\n\n if (pos < pane1Min) return;\n if (height - pos < pane2Min) return;\n\n\n handler.css('top', pos + 'px');\n pane1.elem.css('height', pos + 'px');\n pane2.elem.css('top', pos + 'px');\n \n if (document.getElementsByClassName(\"map-on-top\").length === 0) {\r\n jQuery('.gridStyle').height(jQuery('.split-handler').position().top - 75);\r\n jQuery('.ngViewport').height(jQuery('.split-handler').position().top - 155);\r\n $('.angular-google-map-container').height($('.split-panes').height() - $('.split-pane2').position().top - 6);\r\n }\n else {\r\n $('.angular-google-map-container').height(jQuery('.split-handler').position().top);\r\n jQuery('.gridStyle').height($('.split-panes').height() - $('.split-pane2').position().top - 60);\r\n jQuery('.ngViewport').height($('.split-panes').height() - $('.split-pane2').position().top - 150);\r\n }\n } else {\n\n var width = bounds.right - bounds.left;\n pos = ev.clientX - bounds.left;\n\n if (pos < pane1Min) return;\n if (width - pos < pane2Min) return;\n\n handler.css('left', pos + 'px');\n pane1.elem.css('width', pos + 'px');\n pane2.elem.css('left', pos + 'px');\n }\n });\n \n handler.bind('mousedown', function (ev) { \n ev.preventDefault();\n drag = true; \n });\n \n angular.element(document).bind('mouseup', function (ev) {\n drag = false;\n });\n }\n };\n })\n .directive('bgPane', function () {\n return {\n restrict: 'E',\n require: '^bgSplitter',\n replace: true,\n transclude: true,\n scope: {\n minSize: '='\n },\n template: '',\n link: function (scope, element, attrs, bgSplitterCtrl) {\r\n scope.elem = element;\n scope.index = bgSplitterCtrl.addPane(scope);\n }\n };\n });\n","/*!\n * ASP.NET SignalR JavaScript Library v2.2.0\n * http://signalr.net/\n *\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *\n */\n(function(n,t,i){function w(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)===\"string\"&&r.transports[f]||(i.log(\"Invalid transport: \"+f+\", removing it from the transports list.\"),t.splice(u,1));t.length===0&&(i.log(\"No transports remain within the specified transport array.\"),t=null)}else if(r.transports[t]||t===\"auto\"){if(t===\"auto\"&&r._.ieVersion<=8)return[\"longPolling\"]}else i.log(\"Invalid transport: \"+t.toString()+\".\"),t=null;return t}function b(n){return n===\"http:\"?80:n===\"https:\"?443:void 0}function a(n,t){return t.match(/:\\d+$/)?t:t+\":\"+b(n)}function k(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:\"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.\",noTransportOnInit:\"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.\",errorOnNegotiate:\"Error during negotiation request.\",stoppedWhileLoading:\"The connection was stopped during page load.\",stoppedWhileNegotiating:\"The connection was stopped during the negotiate request.\",errorParsingNegotiateResponse:\"Error parsing negotiate response.\",errorDuringStartRequest:\"Error during start request. Stopping the connection.\",stoppedDuringStartRequest:\"The connection was stopped during the start request.\",errorParsingStartResponse:\"Error parsing start response: '{0}'. Stopping the connection.\",invalidStartResponse:\"Invalid start response: '{0}'. Stopping the connection.\",protocolIncompatible:\"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.\",sendFailed:\"Send failed.\",parseFailed:\"Failed at parsing response: {0}\",longPollFailed:\"Long polling request failed.\",eventSourceFailedToConnect:\"EventSource failed to connect.\",eventSourceError:\"Error raised by EventSource\",webSocketClosed:\"WebSocket closed.\",pingServerFailedInvalidResponse:\"Invalid ping response when pinging server: '{0}'.\",pingServerFailed:\"Failed to ping server.\",pingServerFailedStatusCode:\"Failed to ping server. Server responded with status code {0}, stopping the connection.\",pingServerFailedParse:\"Failed to parse ping server response, stopping the connection.\",noConnectionTransport:\"Connection is in an invalid state, there is no transport active.\",webSocketsInvalidState:\"The Web Socket transport is in an invalid state, transitioning into reconnecting.\",reconnectTimeout:\"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.\",reconnectWindowTimeout:\"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection.\"};if(typeof n!=\"function\")throw new Error(f.nojQuery);var r,h,s=t.document.readyState===\"complete\",e=n(t),c=\"__Negotiate Aborted__\",u={onStart:\"onStart\",onStarting:\"onStarting\",onReceived:\"onReceived\",onError:\"onError\",onConnectionSlow:\"onConnectionSlow\",onReconnecting:\"onReconnecting\",onReconnect:\"onReconnect\",onStateChanged:\"onStateChanged\",onDisconnect:\"onDisconnect\"},v=function(n,i){if(i!==!1){var r;typeof t.console!=\"undefined\"&&(r=\"[\"+(new Date).toTimeString()+\"] SignalR: \"+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},y=function(n){return n.state===r.connectionState.disconnected},l=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},p=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,\"TimeoutException\")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:\"application/x-www-form-urlencoded; charset=UTF-8\",ieVersion:function(){var i,n;return t.navigator.appName===\"Microsoft Internet Explorer\"&&(n=/MSIE ([0-9]+\\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!=\"undefined\"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<\\/script>.\");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new k(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r==\"boolean\"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n==\"string\"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf(\"http\")!==0)?!1:(u=t.document.createElement(\"a\"),u.href=i,u.protocol+a(u.protocol,u.host)!==r.protocol+a(r.protocol,r.host))},ajaxDataType:\"text\",contentType:\"application/json; charset=UTF-8\",logging:!1,state:r.connectionState.disconnected,clientProtocol:\"1.5\",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var a=this,v={pingInterval:3e5,waitForPageLoad:!0,transport:\"auto\",jsonp:!1},d,y=a._deferral||n.Deferred(),b=t.document.createElement(\"a\"),k,g;if(a.lastError=null,a._deferral=y,!a.json)throw new Error(\"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.\");if(n.type(i)===\"function\"?h=i:n.type(i)===\"object\"&&(n.extend(v,i),n.type(v.callback)===\"function\"&&(h=v.callback)),v.transport=w(v.transport,a),!v.transport)throw new Error(\"SignalR: Invalid transport(s) specified, aborting start.\");return(a._.config=v,!s&&v.waitForPageLoad===!0)?(a._.deferredStartHandler=function(){a.start(i,h)},e.bind(\"load\",a._.deferredStartHandler),y.promise()):a.state===r.connectionState.connecting?y.promise():o(a,r.connectionState.disconnected,r.connectionState.connecting)===!1?(y.resolve(a),y.promise()):(p(a),b.href=a.url,b.protocol&&b.protocol!==\":\"?(a.protocol=b.protocol,a.host=b.host):(a.protocol=t.document.location.protocol,a.host=b.host||t.document.location.host),a.baseUrl=a.protocol+\"//\"+a.host,a.wsProtocol=a.protocol===\"https:\"?\"wss://\":\"ws://\",v.transport===\"auto\"&&v.jsonp===!0&&(v.transport=\"longPolling\"),a.url.indexOf(\"//\")===0&&(a.url=t.location.protocol+a.url,a.log(\"Protocol relative URL detected, normalizing it to '\"+a.url+\"'.\")),this.isCrossDomain(a.url)&&(a.log(\"Auto detected cross domain url.\"),v.transport===\"auto\"&&(v.transport=[\"webSockets\",\"serverSentEvents\",\"longPolling\"]),typeof v.withCredentials==\"undefined\"&&(v.withCredentials=!0),v.jsonp||(v.jsonp=!n.support.cors,v.jsonp&&a.log(\"Using jsonp because this browser doesn't support CORS.\")),a.contentType=r._.defaultContentType),a.withCredentials=v.withCredentials,a.ajaxDataType=v.jsonp?\"jsonp\":\"text\",n(a).bind(u.onStart,function(){n.type(h)===\"function\"&&h.call(a);y.resolve(a)}),a._.initHandler=r.transports._logic.initHandler(a),d=function(i,s){var c=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){s===0?a.log(\"No transports supported by the server were selected.\"):s===1?a.log(\"No fallback transports were selected.\"):a.log(\"Fallback transports exhausted.\");n(a).triggerHandler(u.onError,[c]);y.reject(c);a.stop();return}if(a.state!==r.connectionState.disconnected){var p=i[s],h=r.transports[p],v=function(){d(i,s+1)};a.transport=h;try{a._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!a.withCredentials&&i;a.log(\"The start request succeeded. Transitioning to the connected state.\");l(a)&&r.transports._logic.monitorKeepAlive(a);r.transports._logic.startHeartbeat(a);r._.configurePingInterval(a);o(a,r.connectionState.connecting,r.connectionState.connected)||a.log(\"WARNING! The connection was not in the connecting state.\");a._.connectingMessageBuffer.drain();n(a).triggerHandler(u.onStart);e.bind(\"unload\",function(){a.log(\"Window unloading, stopping the connection.\");a.stop(f)});i&&e.bind(\"beforeunload\",function(){t.setTimeout(function(){a.stop(f)},0)})},v)}catch(w){a.log(h.name+\" transport threw '\"+w.message+\"' when attempting to start.\");v()}}},k=a.url+\"/negotiate\",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);y.reject(e);i.stop()},n(a).triggerHandler(u.onStarting),k=r.transports._logic.prepareQueryString(a,k),a.log(\"Negotiating with '\"+k+\"'.\"),a._.negotiateRequest=r.transports._logic.ajax(a,{url:k,error:function(n,t){t!==c?g(n,a):y.reject(r._.error(f.stoppedWhileNegotiating,null,a._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=a._parseResponse(t)}catch(c){g(r._.error(f.errorParsingNegotiateResponse,c),a);return}if(e=a._.keepAliveData,a.appRelativeUrl=i.Url,a.id=i.ConnectionId,a.token=i.ConnectionToken,a.webSocketServerUrl=i.WebSocketServerUrl,a._.pollTimeout=i.ConnectionTimeout*1e3+1e4,a.disconnectTimeout=i.DisconnectTimeout*1e3,a._.totalTransportConnectTimeout=a.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*a.keepAliveWarnAt,a._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,a.reconnectWindow=a.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==a.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,a.clientProtocol,i.ProtocolVersion));n(a).triggerHandler(u.onError,[h]);y.reject(h);return}n.each(r.transports,function(n){if(n.indexOf(\"_\")===0||n===\"webSockets\"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(v.transport)?n.each(v.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):v.transport===\"auto\"?o=s:n.inArray(v.transport,s)>=0&&o.push(v.transport);d(o)}}),y.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error(\"SignalR: Connection must be started before data can be sent. Call .start() before .send()\");if(t.state===r.connectionState.connecting)throw new Error(\"SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.\");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var a=this,v=a._deferral;if(a._.deferredStartHandler&&e.unbind(\"load\",a._.deferredStartHandler),delete a._.config,delete a._.deferredStartHandler,!s&&(!a._.config||a._.config.waitForPageLoad===!0)){a.log(\"Stopping connection prior to negotiate.\");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(a.state!==r.connectionState.disconnected)return a.log(\"Stopping connection.\"),o(a,a.state,r.connectionState.disconnected),t.clearTimeout(a._.beatHandle),t.clearInterval(a._.pingIntervalId),a.transport&&(a.transport.stop(a),h!==!1&&a.transport.abort(a,i),l(a)&&r.transports._logic.stopMonitoringKeepAlive(a),a.transport=null),a._.negotiateRequest&&(a._.negotiateRequest.abort(c),delete a._.negotiateRequest),a._.initHandler&&a._.initHandler.stop(),n(a).triggerHandler(u.onDisconnect),delete a._deferral,delete a.messageId,delete a.groupsToken,delete a.id,delete a._.pingIntervalId,delete a._.lastMessageAt,delete a._.lastActiveAt,a._.connectingMessageBuffer.clear(),a},log:function(n){v(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r})(window.jQuery,window),function(n,t,i){function s(n){n._.keepAliveData.monitoring&&l(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){s(n)},n._.beatInterval))}function l(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log(\"Keep alive timed out. Notifying transport that connection has been lost.\"),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log(\"Keep alive has been missed, connection may be dead/slow.\"),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+=\"?transport=\"+n.transport.name),u.prepareQueryString(n,i)}function h(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,c=n.signalR.changeState,o=\"__Start Aborted__\",u;r.transports={};h.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log(\"WARNING! \"+n.name+\" transport cannot be started. Initialization ongoing or completed.\");return}e.log(n.name+\" transport starting.\");f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+\" transport timed out when trying to connect.\"),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout);n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped})},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log(\"WARNING! The client received multiple init messages.\");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+\" transport connected. Initiating start request.\"),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+\" transport failed during the start request. Stopping the connection.\"),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+\" transport failed to connect. Attempting to fall back.\"),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:\"GET\",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+\"/ping\",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response===\"pong\"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,\"clientProtocol=\"+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+=\"&connectionToken=\"+t.encodeURIComponent(n.token)),n.data&&(r+=\"&connectionData=\"+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf(\"?\")!==-1?\"&\":\"?\",u;if(!i)return t;if(typeof i==\"object\")return t+r+n.param(i);if(typeof i==\"string\")return u=i.charAt(0),(u===\"?\"||u===\"&\")&&(r=\"\"),t+r+i;throw new Error(\"Query string property must be either a string or object.\");},getUrl:function(n,i,r,f,e){var h=i===\"webSockets\"?\"\":n.baseUrl,o=h+n.appRelativeUrl,s=\"transport=\"+i;return!e&&n.groupsToken&&(s+=\"&groupsToken=\"+t.encodeURIComponent(n.groupsToken)),r?(o+=f?\"/poll\":\"/reconnect\",!e&&n.messageId&&(s+=\"&messageId=\"+t.encodeURIComponent(n.messageId))):o+=\"/connect\",o+=\"?\"+s,o=u.prepareQueryString(n,o),e||(o+=\"&tid=\"+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!=\"undefined\"?!0:!1,ShouldReconnect:typeof n.T!=\"undefined\"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t==\"string\"||typeof t==\"undefined\"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,\"/send\"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType===\"jsonp\"?\"GET\":\"POST\",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!==\"abort\"&&i!==\"parsererror\"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!=\"undefined\"){t=typeof t==\"undefined\"?!0:t;var i=e(n,\"/abort\");u.ajax(n,{url:i,async:t,timeout:1e3,type:\"POST\"});n.log(\"Fired ajax abort async = \"+t+\".\")}},ajaxStart:function(t,i){var h=function(n){var i=t._deferral;i&&i.reject(n)},s=function(i){t.log(\"The start request failed. Stopping the connection.\");n(t).triggerHandler(f.onError,[i]);h(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,\"/start\"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(o){s(r._.error(r._.format(r.resources.errorParsingStartResponse,n),o,f));return}e.Response===\"started\"?i():s(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==o?s(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log(\"The start request aborted because connection.stop() was called.\"),h(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(o),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log(\"Tried to monitor keep alive but it's already being monitored.\"):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log(\"Now monitoring keep alive with a warning timeout of \"+i.timeoutWarning+\", keep alive timeout of \"+i.timeout+\" and disconnecting timeout of \"+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log(\"Stopping the monitoring of the keep alive.\"))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();s(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return c(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,\"TimeoutException\")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+\" reconnecting.\"),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log(\"Failed to parse server response while attempting to connect.\"):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new h(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:\"webSockets\",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log(\"Connecting to websocket endpoint '\"+h+\"'.\"),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log(\"Websocket opened.\");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!=\"undefined\"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log(\"Unclean disconnect from websocket: \"+(t.reason||\"[no reason given].\"))):e.log(\"Websocket closed.\"),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log(\"Closing the Websocket.\"),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:\"serverSentEvents\",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log(\"The connection already has an event source. Stopping it.\"),o.stop()),!t.EventSource){h&&(o.log(\"This browser doesn't support SSE.\"),h());return}y=r.getUrl(o,this.name,v);try{o.log(\"Attempting to connect to SSE endpoint '\"+y+\"'.\");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log(\"EventSource failed trying to connect with error \"+p.Message+\".\");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener(\"open\",function(){o.log(\"EventSource connected.\");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener(\"message\",function(n){var t;if(n.data!==\"initialized\"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener(\"error\",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log(\"EventSource readyState: \"+o.eventSource.readyState+\".\"),n.eventPhase===t.EventSource.CLOSED?(o.log(\"EventSource reconnecting due to the server connection ending.\"),c.reconnect(o)):(o.log(\"EventSource error.\"),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log(\"EventSource calling close().\"),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement(\"iframe\");return n.setAttribute(\"style\",\"position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;\"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:\"foreverFrame\",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log(\"Forever frame iframe finished loading and is no longer receiving messages.\");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log(\"Forever Frame is not supported by SignalR on browsers with SSE support.\"),e());return}o.setAttribute(\"data-signalr-connection-id\",n.id);f.prevent();h=i.getUrl(n,this.name);h+=\"&frameId=\"+s;t.document.documentElement.appendChild(o);n.log(\"Binding to iframe's load event.\");o.addEventListener?o.addEventListener(\"load\",c,!1):o.attachEvent&&o.attachEvent(\"onload\",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log(\"Iframe transport started.\");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+\"&frameId=\"+n.frameId;n.log(\"Updating iframe src to '\"+t+\"'.\");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand(\"Stop\")}catch(u){n.log(\"Error occured when stopping foreverFrame transport. Message = \"+u.message+\".\")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log(\"Stopping forever frame.\")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:\"longPolling\",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log(\"LongPolling connected.\");s()},y=function(n){return h(n)?(o.log(\"LongPolling failed to connect.\"),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log(\"Raising the reconnect event\"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log(\"Polling xhr requests already exists, aborting.\"),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log(\"Opening long polling request to '\"+d+\"'.\"),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:\"POST\",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log(\"Long poll complete.\");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)===\"number\"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h===\"abort\"){o.log(\"Aborted xhr request.\");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log(\"An error occurred using longPolling. Status = \"+h+\". Response = \"+f.responseText+\".\"),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort(\"lostConnection\")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+e}function s(n,t,i){for(var f=n.length,u=[],r=0;r