diff --git a/cluster/addons/kube-ui/image/.gitignore b/cluster/addons/kube-ui/image/.gitignore deleted file mode 100644 index 8b040c11b0..0000000000 --- a/cluster/addons/kube-ui/image/.gitignore +++ /dev/null @@ -1 +0,0 @@ -kube-ui diff --git a/cluster/addons/kube-ui/image/Dockerfile b/cluster/addons/kube-ui/image/Dockerfile deleted file mode 100644 index 7faad8dca6..0000000000 --- a/cluster/addons/kube-ui/image/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2015 The Kubernetes Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM scratch -MAINTAINER Tim St. Clair -ADD kube-ui kube-ui -EXPOSE 8080 -ENTRYPOINT ["/kube-ui"] diff --git a/cluster/addons/kube-ui/image/Makefile b/cluster/addons/kube-ui/image/Makefile deleted file mode 100644 index d2b87e0c9a..0000000000 --- a/cluster/addons/kube-ui/image/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Makefile for the Docker image gcr.io/google_containers/kube-ui -# MAINTAINER: Tim St. Clair -# If you update this image please check the tag value before pushing. - -.PHONY: all container push clean - -# Keep this at dev, so no one accidentally blows away the latest published version. -TAG = dev # current version: v1.1 -PREFIX = gcr.io/google_containers - -all: push - -kube-ui: kube-ui.go - CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' ./kube-ui.go - -container: kube-ui - docker build -t $(PREFIX)/kube-ui:$(TAG) . - -push: container - gcloud docker push $(PREFIX)/kube-ui:$(TAG) - -clean: - rm -f kube-ui diff --git a/cluster/addons/kube-ui/image/kube-ui.go b/cluster/addons/kube-ui/image/kube-ui.go deleted file mode 100644 index 16b95698b0..0000000000 --- a/cluster/addons/kube-ui/image/kube-ui.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// A simple static web server for hosting the Kubernetes cluster UI. -package main - -import ( - "flag" - "fmt" - "mime" - "net/http" - - "github.com/golang/glog" - "k8s.io/kubernetes/pkg/ui/data/dashboard" - - assetfs "github.com/elazarl/go-bindata-assetfs" -) - -var ( - port = flag.Int("port", 8080, "Port number to serve at.") -) - -func main() { - flag.Parse() - - // Send correct mime type for .svg files. TODO: remove when - // https://github.com/golang/go/commit/21e47d831bafb59f22b1ea8098f709677ec8ce33 - // makes it into all of our supported go versions. - mime.AddExtensionType(".svg", "image/svg+xml") - - // Expose files in www/ on - fileServer := http.FileServer(&assetfs.AssetFS{ - Asset: dashboard.Asset, - AssetDir: dashboard.AssetDir, - Prefix: "www/app", - }) - http.Handle("/", fileServer) - - // TODO: Add support for serving over TLS. - glog.Fatal(http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", *port), nil)) -} diff --git a/hack/build-ui.sh b/hack/build-ui.sh old mode 100755 new mode 100644 index c04b786d02..b511131988 --- a/hack/build-ui.sh +++ b/hack/build-ui.sh @@ -26,13 +26,11 @@ source "${KUBE_ROOT}/hack/lib/init.sh" cd "${KUBE_ROOT}" if ! which go-bindata > /dev/null 2>&1 ; then - echo "Cannot find go-bindata. Install with \"go get github.com/jteeuwen/go-bindata/...\"" - exit 1 + echo "Cannot find go-bindata. Install with \"go get github.com/jteeuwen/go-bindata/...\"" + exit 1 fi readonly TMP_DATAFILE="/tmp/datafile.go" -readonly DASHBOARD_SRC="www/app/..." -readonly DASHBOARD_PKG="dashboard" readonly SWAGGER_SRC="third_party/swagger-ui/..." readonly SWAGGER_PKG="swagger" @@ -51,18 +49,6 @@ function kube::hack::build_ui() { gofmt -s -w "${TMP_DATAFILE}" mv "${TMP_DATAFILE}" "${output_file}" - } -case "${1:-}" in - dashboard) - kube::hack::build_ui "${DASHBOARD_PKG}" "${DASHBOARD_SRC}" - ;; - swagger) - kube::hack::build_ui "${SWAGGER_PKG}" "${SWAGGER_SRC}" - ;; - *) - kube::hack::build_ui "${DASHBOARD_PKG}" "${DASHBOARD_SRC}" - kube::hack::build_ui "${SWAGGER_PKG}" "${SWAGGER_SRC}" - ;; -esac +kube::hack::build_ui "${SWAGGER_PKG}" "${SWAGGER_SRC}" diff --git a/pkg/ui/data/dashboard/datafile.go b/pkg/ui/data/dashboard/datafile.go deleted file mode 100644 index 2d2085b44c..0000000000 --- a/pkg/ui/data/dashboard/datafile.go +++ /dev/null @@ -1,4939 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// generated by hack/build-ui.sh; DO NOT EDIT - -package dashboard - -import ( - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "strings" - "time" -) - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindata_file_info struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindata_file_info) Name() string { - return fi.name -} -func (fi bindata_file_info) Size() int64 { - return fi.size -} -func (fi bindata_file_info) Mode() os.FileMode { - return fi.mode -} -func (fi bindata_file_info) ModTime() time.Time { - return fi.modTime -} -func (fi bindata_file_info) IsDir() bool { - return false -} -func (fi bindata_file_info) Sys() interface{} { - return nil -} - -var _www_app_assets_css_app_css = []byte(`.nav-back{width:80px;font-size:14px;padding-left:14px;line-height:15px;background-size:14px 14px;background-repeat:no-repeat;display:block}a{text-decoration:none}.main-fab{position:absolute;z-index:20;font-size:30px;top:100px;left:24px;transform:scale(.88,.88)}.md-breadcrumb{padding-left:16px}.md-table{min-width:100%;border-collapse:collapse}.md-table tbody tr:focus,.md-table tbody tr:hover{cursor:pointer;background-color:rgba(63,81,181,.2)}.md-table-header{border-bottom:1px solid #e6e6e6;color:#828282;text-align:left;font-size:.75em;font-weight:700;padding:16px 16px 16px 0}.md-table-header a{text-decoration:none;color:inherit}.md-table-caret{display:inline-block;vertical-align:middle}.md-table-content{font-size:.8em;padding:16px 16px 16px 0}.md-table-td-more{max-width:72px;width:72px;padding:16px}.md-table-thumbs{max-width:104px;width:104px;padding:16px 32px}.md-table-thumbs div{overflow:hidden;width:40px;height:40px;border-radius:20px;border:1px solid rgba(0,0,0,.2);background-size:cover;box-shadow:0 8px 10px rgba(0,0,0,.3);-webkit-box-shadow:0 8px 10px rgba(0,0,0,.1)}.md-table-footer{height:40px}.md-table-count-info{line-height:40px;font-size:.75em}.md-table-footer-item{width:40px;height:40px;vertical-align:middle}.bold,.md-table-active-page{font-weight:700}.gray,.grey{color:#888}md-input-container.md-default-theme .md-input{color:#fff;border-color:#fff;margin-top:24px}.dashboard-subnav{font-size:.9em;min-height:38px;max-height:38px;background-color:#09c1d1!important}.dashboard-subnav md-select.md-default-theme:focus .md-select-label{border-bottom:none;color:#fff}.selectSubPages p{text-align:center;color:#fff}.selectSubPages .md-default-theme .md-select-label.md-placeholder{color:#fff}.selectSubPages .md-select-label{padding-top:0;font-size:1em;line-height:1em;border-bottom:none;padding-bottom:0}.selectSubPages md-select{margin-top:10px;margin-right:80px;padding:0}md-select-menu{max-height:none}.md-toolbar-tools{padding-left:8px;padding-right:8px}.md-toolbar-small{height:38px;min-height:38px}.md-toolbar-tools-small{background-color:#09c1d1}.kubernetes-ui-menu,.kubernetes-ui-menu ul{list-style:none;padding:0}.kubernetes-ui-menu li{margin:0}.kubernetes-ui-menu>li{border-top:1px solid rgba(0,0,0,.12)}.kubernetes-ui-menu .md-button{border-radius:0;color:inherit;cursor:pointer;font-weight:400;line-height:40px;margin:0;max-height:40px;overflow:hidden;padding:0 16px;text-align:left;text-decoration:none;white-space:normal;width:100%}.kubernetes-ui-menu a.md-button{display:block}.kubernetes-ui-menu button.md-button::-moz-focus-inner{padding:0}.kubernetes-ui-menu .md-button.active{color:#03a9f4}.menu-heading{color:#888;display:block;font-size:inherit;font-weight:500;line-height:40px;margin:0;padding:0 16px;text-align:left;width:100%}.kubernetes-ui-menu li.parentActive,.kubernetes-ui-menu li.parentActive .menu-toggle-list{background-color:#f6f6f6}.menu-toggle-list{background:#fff;max-height:999px;overflow:hidden;position:relative;z-index:1;-webkit-transition:.75s cubic-bezier(.35,0,.25,1);-webkit-transition-property:max-height;-moz-transition:.75s cubic-bezier(.35,0,.25,1);-moz-transition-property:max-height;transition:.75s cubic-bezier(.35,0,.25,1);transition-property:max-height}.menu-toggle-list.ng-hide{max-height:0}.kubernetes-ui-menu .menu-toggle-list a.md-button{display:block;padding:0 16px 0 32px;text-transform:none}.md-button-toggle .md-toggle-icon{background:url(../img/icons/list_control_down.png) center center no-repeat;background-size:100% auto;display:inline-block;height:24px;margin:auto 0 auto auto;speak:none;width:24px;transition:transform .3s ease-in-out;-webkit-transition:-webkit-transform .3s ease-in-out}.md-button-toggle .md-toggle-icon.toggled{transform:rotate(180deg);-webkit-transform:rotate(180deg)}.menu-icon{background:0 0;border:none;margin-right:16px;padding:0}.whiteframedemoBasicUsage md-whiteframe{background:#fff;margin:2px;padding:2px}.tabsDefaultTabs{height:100%;width:100%}.tabsDefaultTabs .remove-tab{margin-bottom:40px}.tabsDefaultTabs .home-buttons .md-button{display:block;max-height:30px}.tabsDefaultTabs .home-buttons .md-button.add-tab{margin-top:20px;max-height:30px!important}.tabsDefaultTabs .demo-tab{display:block;position:relative;background:#fff;border:0 solid #000;min-height:0;width:100%}.tabsDefaultTabs .tab0,.tabsDefaultTabs .tab1,.tabsDefaultTabs .tab2,.tabsDefaultTabs .tab3{background-color:#bbdefb}.tabsDefaultTabs .md-header{background-color:#1976D2!important}.tabsDefaultTabs md-tab{color:#90caf9!important}.tabsDefaultTabs md-tab.active,.tabsDefaultTabs md-tab:focus{color:#fff!important}.tabsDefaultTabs md-tab[disabled]{opacity:.5}.tabsDefaultTabs .md-header .md-ripple{border-color:#FFFF8D!important}.tabsDefaultTabs md-tabs-ink-bar{background-color:#FFFF8D!important}.tabsDefaultTabs .title{padding-top:8px;padding-right:8px;text-align:left;text-transform:uppercase;color:#888;margin-top:24px}.tabsDefaultTabs [layout-align]>*,.tabsDefaultTabs form>[layout]>*{margin-left:8px}.tabsDefaultTabs .long>input{width:264px}.menuBtn{background-color:transparent;border:none;height:38px;margin:16px;position:absolute;width:36px}md-toolbar h1{margin:auto}md-list .md-button{color:inherit;font-weight:500;text-align:left;width:100%}md-list .md-button.selected{color:#03a9f4}#content{overflow:hidden}#content md-content{padding-left:0;padding-right:0;padding-top:0}#content .md-button.action{background-color:transparent;border:none;height:38px;margin:8px auto 16px 0;position:absolute;top:10px;right:25px;width:36px}#content img{display:block;height:auto;max-width:500px}.content-wrapper{position:relative}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}md-toolbar h1{font-size:1.25em;font-weight:400}.menuBtn{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) center center no-repeat}.actionBtn{background:url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNiIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDM2IDM2Ij4NCiAgICA8cGF0aCBkPSJNMCAwaDM2djM2aC0zNnoiIGZpbGw9Im5vbmUiLz4NCiAgICA8cGF0aCBkPSJNNCAyN2gyOHYtM2gtMjh2M3ptMC04aDI4di0zaC0yOHYzem0wLTExdjNoMjh2LTNoLTI4eiIvPg0KPC9zdmc+) center center no-repeat}.kubernetes-ui-logo{background-image:url(../img/kubernetes.svg);background-size:40px 40px;width:40px;height:40px}.kubernetes-ui-text{line-height:40px;vertical-align:middle;padding:2px}md-select-menu.md-default-theme md-option:focus:not([selected]){background:#eee}md-select-menu md-option{transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),transform .4s cubic-bezier(.25,.8,.25,1)}md-select-menu md-option:not([disabled]):focus,md-select-menu md-option:not([disabled]):hover{background-color:rgba(158,158,158,.2)}.dashboard .body-wrapper{padding:25px}.dashboard [flex-align-self=end]{-webkit-align-self:flex-end;-ms-flex-align-self:end;align-self:flex-end}.dashboard .back{font-size:18px;line-height:27px;margin-bottom:30px}.dashboard .heading{font-size:18px;line-height:21px;color:#222;margin-bottom:25px}.dashboard .heading .label{color:#777}.dashboard .clear-bg{background-color:transparent}.dashboard .list-pods .pod-group{margin:25px}.dashboard .list-pods .pod-group md-grid-list{margin-top:50px;color:#fff}.dashboard .list-pods .pod-group md-grid-list figcaption{width:100%}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-header{padding-left:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-header .labels{width:100%}.dashboard .list-pods .pod-group md-grid-list md-grid-tile{transition:all 700ms ease-in 50ms}.dashboard .list-pods .pod-group md-grid-list .inner-box{padding-left:10px;padding-right:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer{background:rgba(0,0,0,.5)}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer .pod-title{margin-left:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer .pod-host{text-align:right;padding-right:15px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer a{color:#fff}.dashboard .list-pods .pod-group md-grid-list .restarts{width:100%;text-align:right;padding-right:10px}.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:focus,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:hover,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:not([disabled]):focus,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:not([disabled]):hover{background-color:#ff1744;width:30px;height:30px}.dashboard .list-pods .gray{background:#f5f5f5}.dashboard .list-pods .dark-overlay{background-color:#292935;opacity:.5}.dashboard .list-pods .light-overlay{background-color:#FFF;opacity:.2}.dashboard .list-pods .color-1{background-color:#2962ff;fill:#2962ff;stroke:#2962ff}.dashboard .list-pods .color-max-1{background-color:#dce5ff;border-color:#dce5ff;fill:#dce5ff}.dashboard .list-pods md-grid-list.list-color-1 md-grid-tile.colored{background-color:#2962ff}.dashboard .list-pods .color-2{background-color:#a0f;fill:#a0f;stroke:#a0f}.dashboard .list-pods .color-max-2{background-color:#e6b3ff;border-color:#e6b3ff;fill:#e6b3ff}.dashboard .list-pods md-grid-list.list-color-2 md-grid-tile.colored{background-color:#a0f}.dashboard .list-pods .color-3{background-color:#00c853;fill:#00c853;stroke:#00c853}.dashboard .list-pods .color-max-3{background-color:#7cffb2;border-color:#7cffb2;fill:#7cffb2}.dashboard .list-pods md-grid-list.list-color-3 md-grid-tile.colored{background-color:#00c853}.dashboard .list-pods .color-4{background-color:#304ffe;fill:#304ffe;stroke:#304ffe}.dashboard .list-pods .color-max-4{background-color:#e2e6ff;border-color:#e2e6ff;fill:#e2e6ff}.dashboard .list-pods md-grid-list.list-color-4 md-grid-tile.colored{background-color:#304ffe}.dashboard .list-pods .color-5{background-color:#0091ea;fill:#0091ea;stroke:#0091ea}.dashboard .list-pods .color-max-5{background-color:#9edaff;border-color:#9edaff;fill:#9edaff}.dashboard .list-pods md-grid-list.list-color-5 md-grid-tile.colored{background-color:#0091ea}.dashboard .list-pods .color-6{background-color:#ff6d00;fill:#ff6d00;stroke:#ff6d00}.dashboard .list-pods .color-max-6{background-color:#ffd3b3;border-color:#ffd3b3;fill:#ffd3b3}.dashboard .list-pods md-grid-list.list-color-6 md-grid-tile.colored{background-color:#ff6d00}.dashboard .list-pods .color-7{background-color:#00bfa5;fill:#00bfa5;stroke:#00bfa5}.dashboard .list-pods .color-max-7{background-color:#72ffec;border-color:#72ffec;fill:#72ffec}.dashboard .list-pods md-grid-list.list-color-7 md-grid-tile.colored{background-color:#00bfa5}.dashboard .list-pods .color-8{background-color:#c51162;fill:#c51162;stroke:#c51162}.dashboard .list-pods .color-max-8{background-color:#f693bf;border-color:#f693bf;fill:#f693bf}.dashboard .list-pods md-grid-list.list-color-8 md-grid-tile.colored{background-color:#c51162}.dashboard .list-pods .color-9{background-color:#64dd17;fill:#64dd17;stroke:#64dd17}.dashboard .list-pods .color-max-9{background-color:#cbf7b0;border-color:#cbf7b0;fill:#cbf7b0}.dashboard .list-pods md-grid-list.list-color-9 md-grid-tile.colored{background-color:#64dd17}.dashboard .list-pods .color-10{background-color:#6200ea;fill:#6200ea;stroke:#6200ea}.dashboard .list-pods .color-max-10{background-color:#c69eff;border-color:#c69eff;fill:#c69eff}.dashboard .list-pods md-grid-list.list-color-10 md-grid-tile.colored{background-color:#6200ea}.dashboard .list-pods .color-11{background-color:#ffd600;fill:#ffd600;stroke:#ffd600}.dashboard .list-pods .color-max-11{background-color:#fff3b3;border-color:#fff3b3;fill:#fff3b3}.dashboard .list-pods md-grid-list.list-color-11 md-grid-tile.colored{background-color:#ffd600}.dashboard .list-pods .color-12{background-color:#00b8d4;fill:#00b8d4;stroke:#00b8d4}.dashboard .list-pods .color-max-12{background-color:#87efff;border-color:#87efff;fill:#87efff}.dashboard .list-pods md-grid-list.list-color-12 md-grid-tile.colored{background-color:#00b8d4}.dashboard .list-pods .color-13{background-color:#ffab00;fill:#ffab00;stroke:#ffab00}.dashboard .list-pods .color-max-13{background-color:#ffe6b3;border-color:#ffe6b3;fill:#ffe6b3}.dashboard .list-pods md-grid-list.list-color-13 md-grid-tile.colored{background-color:#ffab00}.dashboard .list-pods .color-14{background-color:#dd2c00;fill:#dd2c00;stroke:#dd2c00}.dashboard .list-pods .color-max-14{background-color:#ffa791;border-color:#ffa791;fill:#ffa791}.dashboard .list-pods md-grid-list.list-color-14 md-grid-tile.colored{background-color:#dd2c00}.dashboard .list-pods .color-15{background-color:#2979ff;fill:#2979ff;stroke:#2979ff}.dashboard .list-pods .color-max-15{background-color:#dce9ff;border-color:#dce9ff;fill:#dce9ff}.dashboard .list-pods md-grid-list.list-color-15 md-grid-tile.colored{background-color:#2979ff}.dashboard .list-pods .color-16{background-color:#d500f9;fill:#d500f9;stroke:#d500f9}.dashboard .list-pods .color-max-16{background-color:#f3acff;border-color:#f3acff;fill:#f3acff}.dashboard .list-pods md-grid-list.list-color-16 md-grid-tile.colored{background-color:#d500f9}.dashboard .list-pods .color-17{background-color:#00e676;fill:#00e676;stroke:#00e676}.dashboard .list-pods .color-max-17{background-color:#9affce;border-color:#9affce;fill:#9affce}.dashboard .list-pods md-grid-list.list-color-17 md-grid-tile.colored{background-color:#00e676}.dashboard .list-pods .color-18{background-color:#3d5afe;fill:#3d5afe;stroke:#3d5afe}.dashboard .list-pods .color-max-18{background-color:#eff1ff;border-color:#eff1ff;fill:#eff1ff}.dashboard .list-pods md-grid-list.list-color-18 md-grid-tile.colored{background-color:#3d5afe}.dashboard .list-pods .color-19{background-color:#00b0ff;fill:#00b0ff;stroke:#00b0ff}.dashboard .list-pods .color-max-19{background-color:#b3e7ff;border-color:#b3e7ff;fill:#b3e7ff}.dashboard .list-pods md-grid-list.list-color-19 md-grid-tile.colored{background-color:#00b0ff}.dashboard .list-pods .color-20{background-color:#ff9100;fill:#ff9100;stroke:#ff9100}.dashboard .list-pods .color-max-20{background-color:#ffdeb3;border-color:#ffdeb3;fill:#ffdeb3}.dashboard .list-pods md-grid-list.list-color-20 md-grid-tile.colored{background-color:#ff9100}.dashboard .list-pods .color-21{background-color:#1de9b6;fill:#1de9b6;stroke:#1de9b6}.dashboard .list-pods .color-max-21{background-color:#c0f9eb;border-color:#c0f9eb;fill:#c0f9eb}.dashboard .list-pods md-grid-list.list-color-21 md-grid-tile.colored{background-color:#1de9b6}.dashboard .list-pods .color-22{background-color:#f50057;fill:#f50057;stroke:#f50057}.dashboard .list-pods .color-max-22{background-color:#ffa8c7;border-color:#ffa8c7;fill:#ffa8c7}.dashboard .list-pods md-grid-list.list-color-22 md-grid-tile.colored{background-color:#f50057}.dashboard .list-pods .color-23{background-color:#76ff03;fill:#76ff03;stroke:#76ff03}.dashboard .list-pods .color-max-23{background-color:#d7ffb5;border-color:#d7ffb5;fill:#d7ffb5}.dashboard .list-pods md-grid-list.list-color-23 md-grid-tile.colored{background-color:#76ff03}.dashboard .list-pods .color-24{background-color:#651fff;fill:#651fff;stroke:#651fff}.dashboard .list-pods .color-max-24{background-color:#e0d2ff;border-color:#e0d2ff;fill:#e0d2ff}.dashboard .list-pods md-grid-list.list-color-24 md-grid-tile.colored{background-color:#651fff}.dashboard .list-pods .color-25{background-color:#ffea00;fill:#ffea00;stroke:#ffea00}.dashboard .list-pods .color-max-25{background-color:#fff9b3;border-color:#fff9b3;fill:#fff9b3}.dashboard .list-pods md-grid-list.list-color-25 md-grid-tile.colored{background-color:#ffea00}.dashboard .list-pods .color-26{background-color:#00e5ff;fill:#00e5ff;stroke:#00e5ff}.dashboard .list-pods .color-max-26{background-color:#b3f7ff;border-color:#b3f7ff;fill:#b3f7ff}.dashboard .list-pods md-grid-list.list-color-26 md-grid-tile.colored{background-color:#00e5ff}.dashboard .list-pods .color-27{background-color:#ffc400;fill:#ffc400;stroke:#ffc400}.dashboard .list-pods .color-max-27{background-color:#ffedb3;border-color:#ffedb3;fill:#ffedb3}.dashboard .list-pods md-grid-list.list-color-27 md-grid-tile.colored{background-color:#ffc400}.dashboard .list-pods .color-28{background-color:#ff3d00;fill:#ff3d00;stroke:#ff3d00}.dashboard .list-pods .color-max-28{background-color:#ffc5b3;border-color:#ffc5b3;fill:#ffc5b3}.dashboard .list-pods md-grid-list.list-color-28 md-grid-tile.colored{background-color:#ff3d00}.dashboard .list-pods .color-29{background-color:#448aff;fill:#448aff;stroke:#448aff}.dashboard .list-pods .color-max-29{background-color:#f6faff;border-color:#f6faff;fill:#f6faff}.dashboard .list-pods md-grid-list.list-color-29 md-grid-tile.colored{background-color:#448aff}.dashboard .list-pods .color-30{background-color:#e040fb;fill:#e040fb;stroke:#e040fb}.dashboard .list-pods .color-max-30{background-color:#fcefff;border-color:#fcefff;fill:#fcefff}.dashboard .list-pods md-grid-list.list-color-30 md-grid-tile.colored{background-color:#e040fb}.dashboard .list-pods .color-31{background-color:#69f0ae;fill:#69f0ae;stroke:#69f0ae}.dashboard .list-pods .color-max-31{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-31 md-grid-tile.colored{background-color:#69f0ae}.dashboard .list-pods .color-32{background-color:#536dfe;fill:#536dfe;stroke:#536dfe}.dashboard .list-pods .color-max-32{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-32 md-grid-tile.colored{background-color:#536dfe}.dashboard .list-pods .color-33{background-color:#40c4ff;fill:#40c4ff;stroke:#40c4ff}.dashboard .list-pods .color-max-33{background-color:#f3fbff;border-color:#f3fbff;fill:#f3fbff}.dashboard .list-pods md-grid-list.list-color-33 md-grid-tile.colored{background-color:#40c4ff}.dashboard .list-pods .color-34{background-color:#ffab40;fill:#ffab40;stroke:#ffab40}.dashboard .list-pods .color-max-34{background-color:#fffaf3;border-color:#fffaf3;fill:#fffaf3}.dashboard .list-pods md-grid-list.list-color-34 md-grid-tile.colored{background-color:#ffab40}.dashboard .list-pods .color-35{background-color:#64ffda;fill:#64ffda;stroke:#64ffda}.dashboard .list-pods .color-max-35{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-35 md-grid-tile.colored{background-color:#64ffda}.dashboard .list-pods .color-36{background-color:#ff4081;fill:#ff4081;stroke:#ff4081}.dashboard .list-pods .color-max-36{background-color:#fff3f7;border-color:#fff3f7;fill:#fff3f7}.dashboard .list-pods md-grid-list.list-color-36 md-grid-tile.colored{background-color:#ff4081}.dashboard .list-pods .color-37{background-color:#b2ff59;fill:#b2ff59;stroke:#b2ff59}.dashboard .list-pods .color-max-37{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-37 md-grid-tile.colored{background-color:#b2ff59}.dashboard .list-pods .color-38{background-color:#7c4dff;fill:#7c4dff;stroke:#7c4dff}.dashboard .list-pods .color-max-38{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-38 md-grid-tile.colored{background-color:#7c4dff}.dashboard .list-pods .color-39{background-color:#ff0;fill:#ff0;stroke:#ff0}.dashboard .list-pods .color-max-39{background-color:#ffffb3;border-color:#ffffb3;fill:#ffffb3}.dashboard .list-pods md-grid-list.list-color-39 md-grid-tile.colored{background-color:#ff0}.dashboard .list-pods .color-40{background-color:#18ffff;fill:#18ffff;stroke:#18ffff}.dashboard .list-pods .color-max-40{background-color:#cbffff;border-color:#cbffff;fill:#cbffff}.dashboard .list-pods md-grid-list.list-color-40 md-grid-tile.colored{background-color:#18ffff}.dashboard .list-pods .color-41{background-color:#ffd740;fill:#ffd740;stroke:#ffd740}.dashboard .list-pods .color-max-41{background-color:#fffcf3;border-color:#fffcf3;fill:#fffcf3}.dashboard .list-pods md-grid-list.list-color-41 md-grid-tile.colored{background-color:#ffd740}.dashboard .list-pods .color-42{background-color:#ff6e40;fill:#ff6e40;stroke:#ff6e40}.dashboard .list-pods .color-max-42{background-color:#fff6f3;border-color:#fff6f3;fill:#fff6f3}.dashboard .list-pods md-grid-list.list-color-42 md-grid-tile.colored{background-color:#ff6e40}.dashboard .list-pods .color-warning{background-color:#ff9800!important;border-color:#ff9800!important;fill:#ff9800!important;stroke:#ff9800!important}.dashboard .list-pods .color-critical{background-color:#f44336!important;border-color:#f44336!important;fill:#f44336!important;stroke:#f44336!important}.dashboard .list-pods .status-waiting{background-color:#2e2e3b!important;border-color:#dad462!important;border-width:2px!important;border-style:solid!important}.dashboard .list-pods .status-terminated,.dashboard .list-pods .status-unknown{background-color:#ff1744!important;border-color:#e3002c!important;border-width:1px!important;border-style:solid!important}.dashboard .dash-table{min-width:100%;border-collapse:collapse}.dashboard .dash-table tbody tr:focus:not(.no-link),.dashboard .dash-table tbody tr:hover:not(.no-link){cursor:pointer;background-color:rgba(63,81,181,.2)}.dashboard .dash-table .dash-table-header{border-bottom:1px solid #e6e6e6;color:#828282;text-align:left;font-size:.75em;font-weight:700;padding:16px 16px 16px 0}.dashboard .dash-table .dash-table-header a{text-decoration:none;color:inherit}.dashboard .dash-table .dash-table-caret{display:inline-block;vertical-align:middle}.dashboard .dash-table .dash-table-content{font-size:.8em;padding:16px 16px 16px 0;height:72px}.dashboard .dash-table .dash-table-td-more{max-width:72px;width:72px;padding:16px}.dashboard .dash-table .dash-table-thumbs{max-width:104px;width:104px;padding:16px 32px}.dashboard .dash-table .dash-table-thumbs div{overflow:hidden;width:40px;height:40px;border-radius:20px;border:1px solid rgba(0,0,0,.2);background-size:cover;box-shadow:0 8px 10px rgba(0,0,0,.3);-webkit-box-shadow:0 8px 10px rgba(0,0,0,.1)}.dashboard .dash-table .dash-table-footer{height:40px}.dashboard .dash-table .dash-table-count-info{line-height:40px;font-size:.75em}.dashboard .dash-table .dash-table-footer-item{width:40px;height:40px;vertical-align:middle}.dashboard .dash-table .bold,.dashboard .dash-table .dash-table-active-page{font-weight:700}.dashboard .dash-table .grey{color:grey}.dashboard .dash-table md-input-container.md-default-theme .md-input{color:#fff;border-color:#fff;margin-top:24px}.dashboard .server-overview .dark-overlay{background-color:#292935;opacity:.5}.dashboard .server-overview .light-overlay{background-color:#FFF;opacity:.2}.dashboard .server-overview md-grid-list.list-color-1 md-grid-tile.colored{background-color:#2962ff}.dashboard .server-overview md-grid-list.list-color-2 md-grid-tile.colored{background-color:#a0f}.dashboard .server-overview md-grid-list.list-color-3 md-grid-tile.colored{background-color:#00c853}.dashboard .server-overview .color-4{background-color:#304ffe;fill:#304ffe;stroke:#304ffe}.dashboard .server-overview .color-max-4{background-color:#e2e6ff;border-color:#e2e6ff;fill:#e2e6ff}.dashboard .server-overview md-grid-list.list-color-4 md-grid-tile.colored{background-color:#304ffe}.dashboard .server-overview .color-5{background-color:#0091ea;fill:#0091ea;stroke:#0091ea}.dashboard .server-overview .color-max-5{background-color:#9edaff;border-color:#9edaff;fill:#9edaff}.dashboard .server-overview md-grid-list.list-color-5 md-grid-tile.colored{background-color:#0091ea}.dashboard .server-overview .color-6{background-color:#ff6d00;fill:#ff6d00;stroke:#ff6d00}.dashboard .server-overview .color-max-6{background-color:#ffd3b3;border-color:#ffd3b3;fill:#ffd3b3}.dashboard .server-overview md-grid-list.list-color-6 md-grid-tile.colored{background-color:#ff6d00}.dashboard .server-overview .color-7{background-color:#00bfa5;fill:#00bfa5;stroke:#00bfa5}.dashboard .server-overview .color-max-7{background-color:#72ffec;border-color:#72ffec;fill:#72ffec}.dashboard .server-overview md-grid-list.list-color-7 md-grid-tile.colored{background-color:#00bfa5}.dashboard .server-overview .color-8{background-color:#c51162;fill:#c51162;stroke:#c51162}.dashboard .server-overview .color-max-8{background-color:#f693bf;border-color:#f693bf;fill:#f693bf}.dashboard .server-overview md-grid-list.list-color-8 md-grid-tile.colored{background-color:#c51162}.dashboard .server-overview .color-9{background-color:#64dd17;fill:#64dd17;stroke:#64dd17}.dashboard .server-overview .color-max-9{background-color:#cbf7b0;border-color:#cbf7b0;fill:#cbf7b0}.dashboard .server-overview md-grid-list.list-color-9 md-grid-tile.colored{background-color:#64dd17}.dashboard .server-overview .color-10{background-color:#6200ea;fill:#6200ea;stroke:#6200ea}.dashboard .server-overview .color-max-10{background-color:#c69eff;border-color:#c69eff;fill:#c69eff}.dashboard .server-overview md-grid-list.list-color-10 md-grid-tile.colored{background-color:#6200ea}.dashboard .server-overview .color-11{background-color:#ffd600;fill:#ffd600;stroke:#ffd600}.dashboard .server-overview .color-max-11{background-color:#fff3b3;border-color:#fff3b3;fill:#fff3b3}.dashboard .server-overview md-grid-list.list-color-11 md-grid-tile.colored{background-color:#ffd600}.dashboard .server-overview .color-12{background-color:#00b8d4;fill:#00b8d4;stroke:#00b8d4}.dashboard .server-overview .color-max-12{background-color:#87efff;border-color:#87efff;fill:#87efff}.dashboard .server-overview md-grid-list.list-color-12 md-grid-tile.colored{background-color:#00b8d4}.dashboard .server-overview .color-13{background-color:#ffab00;fill:#ffab00;stroke:#ffab00}.dashboard .server-overview .color-max-13{background-color:#ffe6b3;border-color:#ffe6b3;fill:#ffe6b3}.dashboard .server-overview md-grid-list.list-color-13 md-grid-tile.colored{background-color:#ffab00}.dashboard .server-overview .color-14{background-color:#dd2c00;fill:#dd2c00;stroke:#dd2c00}.dashboard .server-overview .color-max-14{background-color:#ffa791;border-color:#ffa791;fill:#ffa791}.dashboard .server-overview md-grid-list.list-color-14 md-grid-tile.colored{background-color:#dd2c00}.dashboard .server-overview .color-15{background-color:#2979ff;fill:#2979ff;stroke:#2979ff}.dashboard .server-overview .color-max-15{background-color:#dce9ff;border-color:#dce9ff;fill:#dce9ff}.dashboard .server-overview md-grid-list.list-color-15 md-grid-tile.colored{background-color:#2979ff}.dashboard .server-overview .color-16{background-color:#d500f9;fill:#d500f9;stroke:#d500f9}.dashboard .server-overview .color-max-16{background-color:#f3acff;border-color:#f3acff;fill:#f3acff}.dashboard .server-overview md-grid-list.list-color-16 md-grid-tile.colored{background-color:#d500f9}.dashboard .server-overview .color-17{background-color:#00e676;fill:#00e676;stroke:#00e676}.dashboard .server-overview .color-max-17{background-color:#9affce;border-color:#9affce;fill:#9affce}.dashboard .server-overview md-grid-list.list-color-17 md-grid-tile.colored{background-color:#00e676}.dashboard .server-overview .color-18{background-color:#3d5afe;fill:#3d5afe;stroke:#3d5afe}.dashboard .server-overview .color-max-18{background-color:#eff1ff;border-color:#eff1ff;fill:#eff1ff}.dashboard .server-overview md-grid-list.list-color-18 md-grid-tile.colored{background-color:#3d5afe}.dashboard .server-overview .color-19{background-color:#00b0ff;fill:#00b0ff;stroke:#00b0ff}.dashboard .server-overview .color-max-19{background-color:#b3e7ff;border-color:#b3e7ff;fill:#b3e7ff}.dashboard .server-overview md-grid-list.list-color-19 md-grid-tile.colored{background-color:#00b0ff}.dashboard .server-overview .color-20{background-color:#ff9100;fill:#ff9100;stroke:#ff9100}.dashboard .server-overview .color-max-20{background-color:#ffdeb3;border-color:#ffdeb3;fill:#ffdeb3}.dashboard .server-overview md-grid-list.list-color-20 md-grid-tile.colored{background-color:#ff9100}.dashboard .server-overview .color-21{background-color:#1de9b6;fill:#1de9b6;stroke:#1de9b6}.dashboard .server-overview .color-max-21{background-color:#c0f9eb;border-color:#c0f9eb;fill:#c0f9eb}.dashboard .server-overview md-grid-list.list-color-21 md-grid-tile.colored{background-color:#1de9b6}.dashboard .server-overview .color-22{background-color:#f50057;fill:#f50057;stroke:#f50057}.dashboard .server-overview .color-max-22{background-color:#ffa8c7;border-color:#ffa8c7;fill:#ffa8c7}.dashboard .server-overview md-grid-list.list-color-22 md-grid-tile.colored{background-color:#f50057}.dashboard .server-overview .color-23{background-color:#76ff03;fill:#76ff03;stroke:#76ff03}.dashboard .server-overview .color-max-23{background-color:#d7ffb5;border-color:#d7ffb5;fill:#d7ffb5}.dashboard .server-overview md-grid-list.list-color-23 md-grid-tile.colored{background-color:#76ff03}.dashboard .server-overview .color-24{background-color:#651fff;fill:#651fff;stroke:#651fff}.dashboard .server-overview .color-max-24{background-color:#e0d2ff;border-color:#e0d2ff;fill:#e0d2ff}.dashboard .server-overview md-grid-list.list-color-24 md-grid-tile.colored{background-color:#651fff}.dashboard .server-overview .color-25{background-color:#ffea00;fill:#ffea00;stroke:#ffea00}.dashboard .server-overview .color-max-25{background-color:#fff9b3;border-color:#fff9b3;fill:#fff9b3}.dashboard .server-overview md-grid-list.list-color-25 md-grid-tile.colored{background-color:#ffea00}.dashboard .server-overview .color-26{background-color:#00e5ff;fill:#00e5ff;stroke:#00e5ff}.dashboard .server-overview .color-max-26{background-color:#b3f7ff;border-color:#b3f7ff;fill:#b3f7ff}.dashboard .server-overview md-grid-list.list-color-26 md-grid-tile.colored{background-color:#00e5ff}.dashboard .server-overview .color-27{background-color:#ffc400;fill:#ffc400;stroke:#ffc400}.dashboard .server-overview .color-max-27{background-color:#ffedb3;border-color:#ffedb3;fill:#ffedb3}.dashboard .server-overview md-grid-list.list-color-27 md-grid-tile.colored{background-color:#ffc400}.dashboard .server-overview .color-28{background-color:#ff3d00;fill:#ff3d00;stroke:#ff3d00}.dashboard .server-overview .color-max-28{background-color:#ffc5b3;border-color:#ffc5b3;fill:#ffc5b3}.dashboard .server-overview md-grid-list.list-color-28 md-grid-tile.colored{background-color:#ff3d00}.dashboard .server-overview .color-29{background-color:#448aff;fill:#448aff;stroke:#448aff}.dashboard .server-overview .color-max-29{background-color:#f6faff;border-color:#f6faff;fill:#f6faff}.dashboard .server-overview md-grid-list.list-color-29 md-grid-tile.colored{background-color:#448aff}.dashboard .server-overview .color-30{background-color:#e040fb;fill:#e040fb;stroke:#e040fb}.dashboard .server-overview .color-max-30{background-color:#fcefff;border-color:#fcefff;fill:#fcefff}.dashboard .server-overview md-grid-list.list-color-30 md-grid-tile.colored{background-color:#e040fb}.dashboard .server-overview .color-31{background-color:#69f0ae;fill:#69f0ae;stroke:#69f0ae}.dashboard .server-overview .color-max-31{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-31 md-grid-tile.colored{background-color:#69f0ae}.dashboard .server-overview .color-32{background-color:#536dfe;fill:#536dfe;stroke:#536dfe}.dashboard .server-overview .color-max-32{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-32 md-grid-tile.colored{background-color:#536dfe}.dashboard .server-overview .color-33{background-color:#40c4ff;fill:#40c4ff;stroke:#40c4ff}.dashboard .server-overview .color-max-33{background-color:#f3fbff;border-color:#f3fbff;fill:#f3fbff}.dashboard .server-overview md-grid-list.list-color-33 md-grid-tile.colored{background-color:#40c4ff}.dashboard .server-overview .color-34{background-color:#ffab40;fill:#ffab40;stroke:#ffab40}.dashboard .server-overview .color-max-34{background-color:#fffaf3;border-color:#fffaf3;fill:#fffaf3}.dashboard .server-overview md-grid-list.list-color-34 md-grid-tile.colored{background-color:#ffab40}.dashboard .server-overview .color-35{background-color:#64ffda;fill:#64ffda;stroke:#64ffda}.dashboard .server-overview .color-max-35{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-35 md-grid-tile.colored{background-color:#64ffda}.dashboard .server-overview .color-36{background-color:#ff4081;fill:#ff4081;stroke:#ff4081}.dashboard .server-overview .color-max-36{background-color:#fff3f7;border-color:#fff3f7;fill:#fff3f7}.dashboard .server-overview md-grid-list.list-color-36 md-grid-tile.colored{background-color:#ff4081}.dashboard .server-overview .color-37{background-color:#b2ff59;fill:#b2ff59;stroke:#b2ff59}.dashboard .server-overview .color-max-37{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-37 md-grid-tile.colored{background-color:#b2ff59}.dashboard .server-overview .color-38{background-color:#7c4dff;fill:#7c4dff;stroke:#7c4dff}.dashboard .server-overview .color-max-38{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-38 md-grid-tile.colored{background-color:#7c4dff}.dashboard .server-overview .color-39{background-color:#ff0;fill:#ff0;stroke:#ff0}.dashboard .server-overview .color-max-39{background-color:#ffffb3;border-color:#ffffb3;fill:#ffffb3}.dashboard .server-overview md-grid-list.list-color-39 md-grid-tile.colored{background-color:#ff0}.dashboard .server-overview .color-40{background-color:#18ffff;fill:#18ffff;stroke:#18ffff}.dashboard .server-overview .color-max-40{background-color:#cbffff;border-color:#cbffff;fill:#cbffff}.dashboard .server-overview md-grid-list.list-color-40 md-grid-tile.colored{background-color:#18ffff}.dashboard .server-overview .color-41{background-color:#ffd740;fill:#ffd740;stroke:#ffd740}.dashboard .server-overview .color-max-41{background-color:#fffcf3;border-color:#fffcf3;fill:#fffcf3}.dashboard .server-overview md-grid-list.list-color-41 md-grid-tile.colored{background-color:#ffd740}.dashboard .server-overview .color-42{background-color:#ff6e40;fill:#ff6e40;stroke:#ff6e40}.dashboard .server-overview .color-max-42{background-color:#fff6f3;border-color:#fff6f3;fill:#fff6f3}.dashboard .server-overview md-grid-list.list-color-42 md-grid-tile.colored{background-color:#ff6e40}.dashboard .server-overview .color-warning{background-color:#ff9800!important;border-color:#ff9800!important;fill:#ff9800!important;stroke:#ff9800!important}.dashboard .server-overview .color-critical{background-color:#f44336!important;border-color:#f44336!important;fill:#f44336!important;stroke:#f44336!important}.dashboard .server-overview .status-waiting{background-color:#2e2e3b!important;border-color:#dad462!important;border-width:2px!important;border-style:solid!important}.dashboard .server-overview .status-terminated,.dashboard .server-overview .status-unknown{background-color:#ff1744!important;border-color:#e3002c!important;border-width:1px!important;border-style:solid!important}.dashboard .server-overview .color-1{background-color:#512DA8;border-color:#512DA8;fill:#512DA8;stroke:#512DA8}.dashboard .server-overview .color-2{background-color:#9C27B0;border-color:#9C27B0;fill:#9C27B0;stroke:#9C27B0}.dashboard .server-overview .color-3{background-color:#00BCD4;border-color:#00BCD4;fill:#00BCD4;stroke:#00BCD4}.dashboard .server-overview .color-max-1{background-color:#b6a2e6;border-color:#b6a2e6;fill:#b6a2e6}.dashboard .server-overview .color-max-2{background-color:#dfa0ea;border-color:#dfa0ea;fill:#dfa0ea}.dashboard .server-overview .color-max-3{background-color:#87f1ff;border-color:#87f1ff;fill:#87f1ff}.dashboard .server-overview .color-max-warning{background-color:#ffd699!important;border-color:#ffd699!important;fill:#ffd699!important}.dashboard .server-overview .color-max-critical{background-color:#fccbc7!important;border-color:#fccbc7!important;fill:#fccbc7!important}.dashboard .server-overview .max_tick_arc{stroke:#FFF!important}.dashboard .server-overview .concentricchart .bg-circle{background:#F9F9F9;fill:#F9F9F9;stroke:#FFF;stroke-width:1px}.dashboard .server-overview .concentricchart text{font-size:12px;font-family:Roboto,sans-serif}.dashboard .server-overview .concentricchart .value_group{fill:#fff}.dashboard .server-overview .concentricchart .legend_group rect{opacity:.8}.dashboard .server-overview svg.legend{height:auto}.dashboard .server-overview svg.legend text{font-size:12px;font-family:Roboto,sans-serif}.dashboard .server-overview svg.legend .hostName{font-size:16px}.dashboard .server-overview .minion-name{text-align:center;vertical-align:bottom;width:100%}.dashboard .server-overview .chart_area{width:325px;height:auto}.dashboard .groups{font-size:13px}.dashboard .groups .header{line-height:21px}.dashboard .groups .header a{padding-left:5px;padding-right:5px}.dashboard .groups .header .selector-area .filter-text{font-size:13px;margin-left:10px}.dashboard .groups .header .selector-area .cancel-button{width:18px;height:18px;padding:0}.dashboard .groups .header .selector-area .cancel-button:focus,.dashboard .groups .header .selector-area .cancel-button:hover{background-color:none!important}.dashboard .groups .header .selector-area .cancel-icon{width:15px;height:15px;fill:#777}.dashboard .groups .select-group-by{min-width:110px;margin-left:10px;margin-right:40px}.dashboard .groups .select-group-by .md-select-label{padding-top:6px;font-size:13px}.dashboard .groups .group-item{padding-top:20px}.dashboard .groups .group-item .filter-button{height:18px;width:18px}.dashboard .groups .group-item .filter-button .filter-icon{width:18px;height:18px}.dashboard .groups .icon-area{min-width:34px}.dashboard .groups .icon-area .group-icon{border-radius:21px;width:21px;height:21px}.dashboard .groups .group-main-area .subtype{line-height:21px}.dashboard .groups md-divider{margin-top:40px;margin-bottom:30px}.dashboard .groups .group-name{padding-top:10px}.dashboard .groups .selectFilter{padding-top:7px;margin-right:30px}.dashboard .groups .selectFilter .md-select-label{border-bottom:none!important;width:17px;min-width:17px;padding-right:0}.dashboard .groups md-select-menu{min-height:40px;max-height:40px}.dashboard .groups .group-link-area{padding-left:15px;padding-bottom:15px}.dashboard .groups .group-link-area button{line-height:12px}.dashboard .groups .group-type-circle{width:21px;height:21px}.dashboard .groups md-select{margin-top:0}.dashboard .detail{color:#222}.dashboard .detail .back{font-size:18px;line-height:27px;margin-bottom:30px}.dashboard .detail .heading{font-size:18px;line-height:21px;color:#222;margin-bottom:25px}.dashboard .detail .heading .label{color:#777}.dashboard .detail td.name{font-size:14px;color:#222;line-height:24px}.dashboard .detail td.value{margin-left:50px;font-size:14px;color:#888;line-height:24px}.dashboard .detail .containerTable td{padding-right:20px}.dashboard .align-top tbody{vertical-align:top}`) - -func www_app_assets_css_app_css_bytes() ([]byte, error) { - return _www_app_assets_css_app_css, nil -} - -func www_app_assets_css_app_css() (*asset, error) { - bytes, err := www_app_assets_css_app_css_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/css/app.css", size: 39855, mode: os.FileMode(416), modTime: time.Unix(1436215736, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_docarrow_png = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00!\x00\x00\x00\"\b\x06\x00\x00\x00\xd1p\xb0\xc1\x00\x00\x00\x04sBIT\b\b\b\b|\bd\x88\x00\x00\x00\tpHYs\x00\x00\x15\xfd\x00\x00\x15\xfd\x01\xcdpQa\x00\x00\x00\x1ctEXtSoftware\x00Adobe Fireworks CS6輲\x8c\x00\x00\x00\xefIDATX\x85\xd5\xd71\x0e\xc20\f\x05І\xebq\x0568\x01\x8c\x1c\x80\xeep\x1aV\x18Y`\x05\xc1\x19\x10e\x81\xe13\x05UU\xab\xd8\xf1\xb7\xa2~\xc9K\x87\xf4)\x8e\xea4\x00\xa8JgR\x1aPUcB\x84\x10\xfeU\xef.X\xac\x8eh?KU2\x00\x92\x15\xb3ٞ\x01\x00\xaf\xe6\x83\xf9\xf2 >L\xc9\xf5\xa5\x88\b\x88\xd1@(\x88u}B_\xa4\x10\nb:\xdb\xe3\xf6xfCh\xed\xb0@h\b\v\x84\x8aȅ\xd0\x119\x10\x17\x84\x16\xe2\x86\xd0@\\\x11R\x88;\x82\x01\xa1 \xac\x10\xea(\x1f\xf2&')\xab\x1d\xd7{\xff.4\xef\xaf\u007f;\xac\x003B\x02\x90\xec\xb6\xe9c%\x01\xb8!4\x00\x17\x84\x16@G\xe4\x00\xa8\x88\\\x00\ra\x01\xd0\x10C\x17]\t\x80ڎ\xee\x95_\n\xa0\"\xda\x10\r\x80\x8e\x88\x10\r@\x82\bݗ\x94\xc8x\xfeʽ\xf3\x03\xba\v\x18\x94\x12\x8b\x872\x00\x00\x00\x00IEND\xaeB`\x82") - -func www_app_assets_img_docarrow_png_bytes() ([]byte, error) { - return _www_app_assets_img_docarrow_png, nil -} - -func www_app_assets_img_docarrow_png() (*asset, error) { - bytes, err := www_app_assets_img_docarrow_png_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/docArrow.png", size: 373, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_ic_arrow_drop_down_24px_svg = []byte(` - - - -`) - -func www_app_assets_img_ic_arrow_drop_down_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_ic_arrow_drop_down_24px_svg, nil -} - -func www_app_assets_img_ic_arrow_drop_down_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_ic_arrow_drop_down_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/ic_arrow_drop_down_24px.svg", size: 166, mode: os.FileMode(416), modTime: time.Unix(1433423161, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_ic_arrow_drop_up_24px_svg = []byte(` - - - - - - - - - - - - - - - - - - - - - - - -`) - -func www_app_assets_img_ic_arrow_drop_up_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_ic_arrow_drop_up_24px_svg, nil -} - -func www_app_assets_img_ic_arrow_drop_up_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_ic_arrow_drop_up_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/ic_arrow_drop_up_24px.svg", size: 795, mode: os.FileMode(416), modTime: time.Unix(1433423161, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_ic_keyboard_arrow_left_24px_svg = []byte(``) - -func www_app_assets_img_ic_keyboard_arrow_left_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_ic_keyboard_arrow_left_24px_svg, nil -} - -func www_app_assets_img_ic_keyboard_arrow_left_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_ic_keyboard_arrow_left_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/ic_keyboard_arrow_left_24px.svg", size: 151, mode: os.FileMode(416), modTime: time.Unix(1433423161, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_ic_keyboard_arrow_right_24px_svg = []byte(``) - -func www_app_assets_img_ic_keyboard_arrow_right_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_ic_keyboard_arrow_right_24px_svg, nil -} - -func www_app_assets_img_ic_keyboard_arrow_right_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_ic_keyboard_arrow_right_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/ic_keyboard_arrow_right_24px.svg", size: 149, mode: os.FileMode(416), modTime: time.Unix(1433423161, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_arrow_back_png = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x80\x00\x00\x00\x80\b\x06\x00\x00\x00\xc3>a\xcb\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x020IDATx\x9c\xed\xddIn\x13q\x10F\xf1ׄ\x05\xd7\xe0f\t\xc3\x166\x1c\xc0\x10\xa60\xc5!\x90\x046\x84Ab\xba\v7r`aY2\x02B\xecj\xf7_\xd5\xf5~\x92\x97\x91Jz_za\xc96H\x92$I\x92$I\x92$I\x92$I\x92$I\x92\xa4\xac\xb6Z\x1f\x90\xdc\x1ep\x15\xf8\xd1\xfa\x10\r\xab\x03\xde\x00?\x813\xe0V\xdbs4\xa4\xe5\xf8\x8b\x97#(\xa2\x03N\xf8=\xbe#(\xa2\x03\xa6\xfc=\xfe\xf2\bn\xb7:P\x9bs\x91\xf8\x8e`\xa4V\x89\xef\bF\xa6\x03\xf6Y-\xbe#\x18\x91\x87\xac\x17\u007f\xf1:\x1a\xfed\xf5e\xdd\xff\xfc\xc5k\xca\xfc\t\xa2\x84\xa2\xf1\x0f0~Z\xc6/,\x1a\xff%\xc6O\xeb\x05\xc6/+\x1a\xff\x10\xe3\xa7e\xfc\u008c_\xd8sb\xf1_a\xfc\xb4\x8c_X4\xfek\x8c\x9f\x96\xf1\v3~aψ\xc5?\xc2\xf8i\x19\xbf0\xe3\x17\x16\x8d\u007f\x8c\xf1\xd3z\x8a\xf1ˊ\xc6?\xc1\xf8iE\xe3\x9f\x02\x97\x86>Z\xfd0~aO0~Y\xd1\xf8\xef1~Z}\xc4\xf7;\x12\x922~a{\xc4\xe2\u007f\xc0\xf8i\x19\xbf\xb0h\xfc\x8f\x18?-\xe3\x17\xf6\x18\xe3\x975!\x16\xff\x13\xc6\xff\xa7\fo\x80\\\t\xfe\xfd\x8c\xf9\x10\x94\u0604\xd8S\xe0;py\xe8\xa3կ\t\x8e\xa0\xbc\t\xb1\x11|\xc3\x11\xa4w\x17GP\x9e#\x90#\x90#\x10p\x0fGP^t\x04_q\x04\xe99\x029\x02\xc1.\x8e\xa0\x8e\xa0x\xabsDG\xf0\x0eG\x90Z\xc7\xfc\xeb\xe2##\xf0\xe7\xe3G`\xdd'\xc1\f\xd8\x1e\xfe\\mª_Qc\xfc\x11\xba\xe8\bf\xc0N\xa3\x1b\xb5A\x1d0\xe5\xff\xf1\xaf\xb5:P\x9bw\xde\bf\xc0\xf5v\xa7i(\x1dp\xc0\x9f\xf1o\xb4 \xf7#U\x14\x00\x00\x02\xf4IDATx\xda|SkHSa\x18~\xceٙ\xd3m\xce\xcd\xcdL\x99I\xf7D\xa2?QXYBBZ\x19i\xa8\xe4\r\xaa\x95\x18*\x95B\xa4T&\bQZa\x96\x81\x05I\x14R\x96\x81H\x17B\xbbHY\x16d\x14\xa5\xa2&\xe4e\xe66\xddڙ\xbb\x9c\xad\xef\x9cyL\xff\xf4\xfd\xfa.\xcf\xf3\xbc\xcfy\xde\xf7P\x98\xb7|>\x9f\xba\u007f\xd4}\xd1h\xf1&5<\xb5\xe9\xbf\x0e\xbb\x85\xfb\xd8%R\x18\x92\x94\xa3a!\x92\xe71Q\xd2R\x8a\xa2L\"\x87\x9a%ꆌ\x9e\x9a\x91I.\xf1z\x9b-\xb2\xf7\x97\x9f\xa8\x92\xd3\b`\x80I\xabW8\xaf\xd6Kq$Yi\x8c\xd0H\xdaɾ\x98\bMR&+\x1778\xeeyx\xa1y:b`\xcc3\xdf\x106\xc5\xc8\x10\xa9\x95\xa0\xb9\x93]p\xbfl1\x83\x924\xd5D\xb8F\x92N\xf5\x8d\xb8\x9e\x1c\xbclJb\x9d\xbe\x05\xa0\xd8h)\xf6m\x96#(\x80B\xd3k\x16=\x83\xae\x05\xef\xfc\xfd\x8d\"\xed\v\xc6\xe6\xf0\xe9Er}a(\xeaZm0\xecPb\xdd\xd2\x00\x98\xff\xf8\xadW\x1fҀwW\xd7j\xc5\xf1T\x15\xf2\xaf\x9a\xe0p\xf9`c\xbdzz\xcc\xcciE\xd5\xf2\xc6)\xd4\x15\x84B\xafc\xb0\xeb\xec\x04\xda{f\xd0\xf5݉\xdd\x15\x13$\x0f\n7\x8fiQF0\x1eΏ\x1f1q:\xa6\xeb\x87S'\n\x90\x94A\x1c\x91\xe0(T\xe6\xaa!\x93R\xc2\xfe\\\x8e\x1a\xc1$\xd0q3G\xc4%0Z\xfc\n\xdd}N-\xf3y\xc0%\x15\x056\xac\n@\xdb\a\a\x1et\xdaq\xfb\x84\x0er\x19E:\x04\xc1\xae\xe1\x8a\t)\x1b\x83\x84`?\xf5\xfb\xf3\xe8\x19rS̨\x99\x9b\v\x86\xaf\x12\x1dƠ\"[\x8dp\xb5\x04\x8f߱Į\x0f\xe9\xf1\n\x9c\xca\b\x81\xc7\xebô\xdd;\x87\xff=́\x11\xfb}\xfe\x80ZH\x96'\xde{i\x17B\xcbۮ\x10\x80w;\xec\xe0\ve%(0E\x82\xad1hp\xa9\xc5\xcag\xe0\x17\xb0\xb2^\x1c\xbdf\x16,7\x97\x87\xe1}\xaf\v\xfb\x13\xe4h\xebv\x80#\x0e\xb4*\x1a-oY\xe4'+q\xb8\xd62\x97\x01\xbf\x98\x8cx9{\xff\r+\xe7\x0f|;\xab\x9a\xa6Q[\xa0Ap\x10\x8d\xbc\xeaIp\xc4q\xd3I\x1d֯\x94\tU\xe7\x93\xf7\xc6ɝ\xd4O\xa3\xfb\xd9\xe9;S\x89߆ݴ\xf8@D\x91\xb9U\x01\x9dJ\x02\x8a\f\xfb\x04\xf9V\xbe\x9dՏ\xacs\xe45QRT\xe6\xa8;\x98\xe8ELjY\x9a\xac\xb7\xb0\x81\xd3[f\ag\xdb\xda@\xe4\x92\xea\xe2\x80\xf1\"\xb7\xc8\fФ\x84\xd7\xeb\xcf\xecLV\xc8\xe0\xf2\b&\x85&?\x04\xfb\xf1nmiU\xb6\xc2L\xd3\xff\x06j\xfeh\xf3\xad,i\xb0\bd\x1eS\x95\xab\xb4\x90\xb0w\x12\xae\x9d\x12A#&O\xe6\xab/3\xf5Ħ\x06\xffY\xc5{\x82m[b\x03\x8bVDJ\x1b\xf9\xf3_\x01\x06\x00\xf19?q\xaaE\xa0\xa4\x00\x00\x00\x00IEND\xaeB`\x82") - -func www_app_assets_img_icons_favicon_png_bytes() ([]byte, error) { - return _www_app_assets_img_icons_favicon_png, nil -} - -func www_app_assets_img_icons_favicon_png() (*asset, error) { - bytes, err := www_app_assets_img_icons_favicon_png_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/favicon.png", size: 1663, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_ic_arrow_forward_24px_svg = []byte(``) - -func www_app_assets_img_icons_ic_arrow_forward_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_icons_ic_arrow_forward_24px_svg, nil -} - -func www_app_assets_img_icons_ic_arrow_forward_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_icons_ic_arrow_forward_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/ic_arrow_forward_24px.svg", size: 158, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_ic_cancel_24px_svg = []byte(``) - -func www_app_assets_img_icons_ic_cancel_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_icons_ic_cancel_24px_svg, nil -} - -func www_app_assets_img_icons_ic_cancel_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_icons_ic_cancel_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/ic_cancel_24px.svg", size: 276, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_ic_close_24px_svg = []byte(``) - -func www_app_assets_img_icons_ic_close_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_icons_ic_close_24px_svg, nil -} - -func www_app_assets_img_icons_ic_close_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_icons_ic_close_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/ic_close_24px.svg", size: 202, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_ic_menu_svg = []byte(` - - - - - - - - -`) - -func www_app_assets_img_icons_ic_menu_svg_bytes() ([]byte, error) { - return _www_app_assets_img_icons_ic_menu_svg, nil -} - -func www_app_assets_img_icons_ic_menu_svg() (*asset, error) { - bytes, err := www_app_assets_img_icons_ic_menu_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/ic_menu.svg", size: 791, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_ic_menu_24px_svg = []byte(` - - - - - - - - - - - - - - - - - - - - - -`) - -func www_app_assets_img_icons_ic_menu_24px_svg_bytes() ([]byte, error) { - return _www_app_assets_img_icons_ic_menu_24px_svg, nil -} - -func www_app_assets_img_icons_ic_menu_24px_svg() (*asset, error) { - bytes, err := www_app_assets_img_icons_ic_menu_24px_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/ic_menu_24px.svg", size: 841, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_icons_list_control_down_png = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x000\x00\x00\x000\b\x03\x00\x00\x00`\xdc\t\xb5\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\xc9e<\x00\x00\x00'PLTE\xa8\xa8\xa8\xfc\xfc\xfc\xc0\xc0\xc0\xb6\xb6\xb6\xf7\xf7\xf7\xaa\xaa\xaa\xf6\xf6\xf6\xe6\xe6\xe6\xe8\xe8赵\xb5\xc3\xc3\xc3\xe5\xe5\xe5\xff\xff\xffZLu\xde\x00\x00\x00\rtRNS\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00=\xe8\"\x86\x00\x00\x00\x8bIDATx\xda\xec\xd4I\x12\x80 \fD\xd1\x04\x04\x9c\xee\u007f^ˁ\xd2`\xb7\x96k\xc3\xd2\xfao\xa1\t\xca\xfc\xf1\x88\x03\a\xbf\x01}\xd7\x06\xb9\u007f\x02S\x8a\x8d\xc8C*\x1c\x94$bE\x1eD\xac0`\x14\xb1\"\xc7\xf5\xc9H\x81\x06+\xba\xad\x0f\xca\xdf\xc1\nԷ_\xe9*`\u007f\x9b\xc3)p\u007f\x1f\\\x15\xa4\a\x93>\x04\xe9\xd1j\xec\x82\xf4p\x97\xaa@=^\xbe]\xc0\x9el\xeb*p\xcf\xd6[\x03\xe9\xe9}P\xf5\x9f\x80\x03\a\xafg\x11`\x00\xb0\xe4e\a\x17\x87\xea}\x00\x00\x00\x00IEND\xaeB`\x82") - -func www_app_assets_img_icons_list_control_down_png_bytes() ([]byte, error) { - return _www_app_assets_img_icons_list_control_down_png, nil -} - -func www_app_assets_img_icons_list_control_down_png() (*asset, error) { - bytes, err := www_app_assets_img_icons_list_control_down_png_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/icons/list_control_down.png", size: 309, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_img_kubernetes_svg = []byte(` - - - - -`) - -func www_app_assets_img_kubernetes_svg_bytes() ([]byte, error) { - return _www_app_assets_img_kubernetes_svg, nil -} - -func www_app_assets_img_kubernetes_svg() (*asset, error) { - bytes, err := www_app_assets_img_kubernetes_svg_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/img/kubernetes.svg", size: 11663, mode: os.FileMode(416), modTime: time.Unix(1430167784, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_js_app_js = []byte(`var componentNamespaces = ["kubernetesApp.components.dashboard"]; -// APP START -// **************************** -// /www/app/assets/app.js is autogenerated. Do not modify. -// Changes should be made in /master/modules/js or /master/components//js -// **************************** -// ----------------------------------- - -var app = angular.module('kubernetesApp', [ - 'ngRoute', - 'ngMaterial', - 'ngLodash', - 'door3.css', - 'kubernetesApp.config', - 'kubernetesApp.services', - 'angular.filter' -].concat(componentNamespaces)); - -app.factory('menu', [ - '$location', - '$rootScope', - 'sections', - '$route', - function($location, $rootScope, sections, $route) { - - var self; - - $rootScope.$on('$locationChangeSuccess', onLocationChange); - - return self = { - - sections: sections, - - setSections: function(_sections) { this.sections = _sections; }, - selectSection: function(section) { self.openedSection = section; }, - toggleSelectSection: function(section) { - self.openedSection = (self.openedSection === section ? null : section); - }, - isSectionSelected: function(section) { return self.openedSection === section; }, - selectPage: function(section, page) { - self.currentSection = section; - self.currentPage = page; - }, - isPageSelected: function(page) { return self.currentPage === page; } - }; - - function onLocationChange() { - var path = $route.current.originalPath; - - var matchPage = function(section, page) { - if (path === page.url || path === (page.url + '/')) { - self.selectSection(section); - self.selectPage(section, page); - } - }; - - sections.forEach(function(section) { - if (section.children) { - section.children.forEach(function(childSection) { - if (childSection.pages) { - childSection.pages.forEach(function(page) { matchPage(childSection, page); }); - } - }); - } else if (section.pages) { - section.pages.forEach(function(page) { matchPage(section, page); }); - } else if (section.type === 'link') { - matchPage(section, section); - } - }); - } - } -]); - -angular.module('kubernetesApp.config', []); -angular.module('kubernetesApp.services', ['kubernetesApp.config']); - -app.config([ - '$routeProvider', - function($routeProvider) { - $routeProvider.when("/404", {templateUrl: "views/partials/404.html"}) - // else 404 - .otherwise({redirectTo: "/404"}); - } -]) - .config([ - '$routeProvider', - 'manifestRoutes', - function($routeProvider, manifestRoutes) { - angular.forEach(manifestRoutes, function(r) { - var route = { - templateUrl: r.templateUrl - }; - if (r.controller) { - route.controller = r.controller; - } - if (r.css) { - route.css = r.css; - } - $routeProvider.when(r.url, route); - }); - } - ]); - -app.value("sections", [{"name":"Dashboard","url":"/dashboard","type":"link","templateUrl":"/components/dashboard/pages/home.html"},{"name":"Dashboard","type":"heading","children":[{"name":"Dashboard","type":"toggle","url":"/dashboard","templateUrl":"/components/dashboard/pages/home.html","pages":[{"name":"Pods","url":"/dashboard/pods","templateUrl":"/components/dashboard/views/listPods.html","type":"link"},{"name":"Pod Visualizer","url":"/dashboard/visualpods","templateUrl":"/components/dashboard/views/listPodsVisualizer.html","type":"link"},{"name":"Services","url":"/dashboard/services","templateUrl":"/components/dashboard/views/listServices.html","type":"link"},{"name":"Replication Controllers","url":"/dashboard/replicationcontrollers","templateUrl":"/components/dashboard/views/listReplicationControllers.html","type":"link"},{"name":"Events","url":"/dashboard/events","templateUrl":"/components/dashboard/views/listEvents.html","type":"link"},{"name":"Nodes","url":"/dashboard/nodes","templateUrl":"/components/dashboard/views/listMinions.html","type":"link"},{"name":"Replication Controller","url":"/dashboard/replicationcontrollers/:replicationControllerId","templateUrl":"/components/dashboard/views/replication.html","type":"link"},{"name":"Service","url":"/dashboard/services/:serviceId","templateUrl":"/components/dashboard/views/service.html","type":"link"},{"name": "Node","url": "/dashboard/nodes/:nodeId","templateUrl": "/components/dashboard/views/node.html","type": "link"},{"name":"Explore","url":"/dashboard/groups/:grouping*?/selector/:selector*?","templateUrl":"/components/dashboard/views/groups.html","type":"link"},{"name":"Pod","url":"/dashboard/pods/:podId","templateUrl":"/components/dashboard/views/pod.html","type":"link"}]}]},{"name":"Graph","url":"/graph","type":"link","templateUrl":"/components/graph/pages/home.html"},{"name":"Graph","url":"/graph/inspect","type":"link","templateUrl":"/components/graph/pages/inspect.html","css":"/components/graph/css/show-details-table.css"},{"name":"Graph","type":"heading","children":[{"name":"Graph","type":"toggle","url":"/graph","templateUrl":"/components/graph/pages/home.html","pages":[{"name":"Test","url":"/graph/test","type":"link","templateUrl":"/components/graph/pages/home.html"}]}]}]); - -app.directive('includeReplace', - function() { - 'use strict'; - return { - require: 'ngInclude', - restrict: 'A', /* optional */ - link: function(scope, el, attrs) { el.replaceWith(el.children()); } - }; - }) - .directive('compile', - ["$compile", function($compile) { - 'use strict'; - return function(scope, element, attrs) { - scope.$watch(function(scope) { return scope.$eval(attrs.compile); }, - function(value) { - element.html(value); - $compile(element.contents())(scope); - }); - }; - }]) - .directive("kubernetesUiMenu", - function() { - 'use strict'; - return { - templateUrl: "views/partials/kubernetes-ui-menu.tmpl.html" - }; - }) - .directive('menuToggle', function() { - 'use strict'; - return { - scope: {section: '='}, - templateUrl: 'views/partials/menu-toggle.tmpl.html', - link: function($scope, $element) { - var controller = $element.parent().controller(); - - $scope.isOpen = function() { return controller.isOpen($scope.section); }; - $scope.toggle = function() { controller.toggleOpen($scope.section); }; - - var parentNode = $element[0].parentNode.parentNode.parentNode; - if (parentNode.classList.contains('parent-list-item')) { - var heading = parentNode.querySelector('h2'); - $element[0].firstChild.setAttribute('aria-describedby', heading.id); - } - } - }; - }); - -app.filter('startFrom', - function() { - 'use strict'; - return function(input, start) { return input.slice(start); }; - }) - .filter('nospace', function() { - 'use strict'; - return function(value) { return (!value) ? '' : value.replace(/ /g, ''); }; - }); - -app.run(['$route', angular.noop]) - .run(["lodash", function(lodash) { - // Alias lodash - window['_'] = lodash; - }]); - -app.service('SidebarService', [ - '$rootScope', - function($rootScope) { - var service = this; - service.sidebarItems = []; - - service.clearSidebarItems = function() { service.sidebarItems = []; }; - - service.renderSidebar = function() { - var _entries = ''; - service.sidebarItems.forEach(function(entry) { _entries += entry.Html; }); - - if (_entries) { - $rootScope.sidenavLeft = '
' + _entries + '
'; - } - }; - - service.addSidebarItem = function(item) { - - service.sidebarItems.push(item); - - service.sidebarItems.sort(function(a, b) { return (a.order > b.order) ? 1 : ((b.order > a.order) ? -1 : 0); }); - }; - } -]); - - -app.value("tabs", [{"component":"dashboard","title":"Dashboard"}]); -app.constant("manifestRoutes", [{"description":"Dashboard visualization.","url":"/dashboard/","templateUrl":"components/dashboard/pages/home.html"},{"description":"Pods","url":"/dashboard/pods","templateUrl":"components/dashboard/views/listPods.html"},{"description":"Pod Visualizer","url":"/dashboard/visualpods","templateUrl":"components/dashboard/views/listPodsVisualizer.html"},{"description":"Services","url":"/dashboard/services","templateUrl":"components/dashboard/views/listServices.html"},{"description":"Replication Controllers","url":"/dashboard/replicationcontrollers","templateUrl":"components/dashboard/views/listReplicationControllers.html"},{"description":"Events","url":"/dashboard/events","templateUrl":"components/dashboard/views/listEvents.html"},{"description":"Nodes","url":"/dashboard/nodes","templateUrl":"components/dashboard/views/listMinions.html"},{"description":"Replication Controller","url":"/dashboard/replicationcontrollers/:replicationControllerId","templateUrl":"components/dashboard/views/replication.html"},{"description":"Service","url":"/dashboard/services/:serviceId","templateUrl":"components/dashboard/views/service.html"},{"description":"Node","url":"/dashboard/nodes/:nodeId","templateUrl":"components/dashboard/views/node.html"},{"description":"Explore","url":"/dashboard/groups/:grouping*?/selector/:selector*?","templateUrl":"components/dashboard/views/groups.html"},{"description":"Pod","url":"/dashboard/pods/:podId","templateUrl":"components/dashboard/views/pod.html"}]); - -angular.module("kubernetesApp.config", []) - -.constant("ENV", { - "/": { - "k8sApiServer": "/api/v1", - "k8sDataServer": "", - "k8sDataPollMinIntervalSec": 10, - "k8sDataPollMaxIntervalSec": 120, - "k8sDataPollErrorThreshold": 5, - "cAdvisorProxy": "", - "cAdvisorPort": "4194" - } -}) - -.constant("ngConstant", true) - -; -/**========================================================= - * Module: config.js - * App routes and resources configuration - =========================================================*/ -/**========================================================= - * Module: constants.js - * Define constants to inject across the application - =========================================================*/ -/**========================================================= - * Module: home-page.js - * Page Controller - =========================================================*/ - -app.controller('PageCtrl', [ - '$scope', - '$timeout', - '$mdSidenav', - 'menu', - '$rootScope', - function($scope, $timeout, $mdSidenav, menu, $rootScope) { - $scope.menu = menu; - - $scope.path = path; - $scope.goHome = goHome; - $scope.openMenu = openMenu; - $rootScope.openMenu = openMenu; - $scope.closeMenu = closeMenu; - $scope.isSectionSelected = isSectionSelected; - - $rootScope.$on('$locationChangeSuccess', openPage); - - // Methods used by menuLink and menuToggle directives - this.isOpen = isOpen; - this.isSelected = isSelected; - this.toggleOpen = toggleOpen; - this.shouldLockOpen = shouldLockOpen; - $scope.toggleKubernetesUiMenu = toggleKubernetesUiMenu; - - var mainContentArea = document.querySelector("[role='main']"); - var kubernetesUiMenu = document.querySelector("[role='kubernetes-ui-menu']"); - - // ********************* - // Internal methods - // ********************* - - var _t = false; - - $scope.showKubernetesUiMenu = false; - - function shouldLockOpen() { - return _t; - } - - function toggleKubernetesUiMenu() { - $scope.showKubernetesUiMenu = !$scope.showKubernetesUiMenu; - } - - function closeMenu() { - $timeout(function() { - $mdSidenav('left').close(); - }); - } - - function openMenu() { - $timeout(function() { - _t = !$mdSidenav('left').isOpen(); - $mdSidenav('left').toggle(); - }); - } - - function path() { - return $location.path(); - } - - function goHome($event) { - menu.selectPage(null, null); - $location.path( '/' ); - } - - function openPage() { - $scope.closeMenu(); - mainContentArea.focus(); - } - - function isSelected(page) { - return menu.isPageSelected(page); - } - - function isSectionSelected(section) { - var selected = false; - var openedSection = menu.openedSection; - if(openedSection === section){ - selected = true; - } - else if(section.children) { - section.children.forEach(function(childSection) { - if(childSection === openedSection){ - selected = true; - } - }); - } - return selected; - } - - function isOpen(section) { - return menu.isSectionSelected(section); - } - - function toggleOpen(section) { - menu.toggleSelectSection(section); - } - - } -]).filter('humanizeDoc', function() { - return function(doc) { - if (!doc) return; - if (doc.type === 'directive') { - return doc.name.replace(/([A-Z])/g, function($1) { - return '-'+$1.toLowerCase(); - }); - } - return doc.label || doc.name; - }; }); - -/**========================================================= - * Module: main.js - * Main Application Controller - =========================================================*/ -/**========================================================= - * Module: tabs-global.js - * Page Controller - =========================================================*/ - -app.controller('TabCtrl', [ - '$scope', - '$location', - 'tabs', - function($scope, $location, tabs) { - $scope.tabs = tabs; - - $scope.switchTab = function(index) { - var location_path = $location.path(); - var tab = tabs[index]; - - if (tab) { - var path = '/%s'.format(tab.component); - if (location_path.indexOf(path) == -1) { - $location.path(path); - } - } - }; - } -]); - -/**========================================================= - * Module: sidebar.js - * Wraps the sidebar and handles collapsed state - =========================================================*/ -(function() { - "use strict"; - - angular.module('kubernetesApp.services') - .service('cAdvisorService', ["$http", "$q", "ENV", function($http, $q, ENV) { - var _baseUrl = function(minionIp) { - var minionPort = ENV['/']['cAdvisorPort'] || "8081"; - var proxy = ENV['/']['cAdvisorProxy'] || "/api/v1/proxy/nodes/"; - - return proxy + minionIp + ':' + minionPort + '/api/v1.0/'; - }; - - this.getMachineInfo = getMachineInfo; - - function getMachineInfo(minionIp) { - var fullUrl = _baseUrl(minionIp) + 'machine'; - var deferred = $q.defer(); - - // hack - $http.get(fullUrl).success(function(data) { - deferred.resolve(data); - }).error(function(data, status) { deferred.reject('There was an error') }); - return deferred.promise; - } - - this.getContainerInfo = getContainerInfo; - // containerId optional - function getContainerInfo(minionIp, containerId) { - containerId = (typeof containerId === "undefined") ? "/" : containerId; - - var fullUrl = _baseUrl(minionIp) + 'containers' + containerId; - var deferred = $q.defer(); - - var request = { - "num_stats": 10, - "num_samples": 0 - }; - - $http.post(fullUrl, request) - .success(function(data) { deferred.resolve(data); }) - .error(function() { deferred.reject('There was an error') }); - return deferred.promise; - } - - this.getDataForMinion = function(minionIp) { - var machineData, containerData; - var deferred = $q.defer(); - - var p = $q.all([getMachineInfo(minionIp), getContainerInfo(minionIp)]) - .then( - function(dataArray) { - machineData = dataArray[0]; - containerData = dataArray[1]; - - var memoryData = parseMemory(machineData, containerData); - var cpuData = parseCpu(machineData, containerData); - var fsData = parseFilesystems(machineData, containerData); - deferred.resolve({ - memoryData: memoryData, - cpuData: cpuData, - filesystemData: fsData, - machineData: machineData, - containerData: containerData - }); - - }, - function(errorData) { deferred.reject(errorData); }); - - return deferred.promise; - }; - - // Utils to process cadvisor data - function humanize(num, size, units) { - var unit; - for (unit = units.pop(); units.length && num >= size; unit = units.pop()) { - num /= size; - } - return [num, unit]; - } - - // Following the IEC naming convention - function humanizeIEC(num) { - var ret = humanize(num, 1024, ["TiB", "GiB", "MiB", "KiB", "Bytes"]); - return ret[0].toFixed(2) + " " + ret[1]; - } - - // Following the Metric naming convention - function humanizeMetric(num) { - var ret = humanize(num, 1000, ["TB", "GB", "MB", "KB", "Bytes"]); - return ret[0].toFixed(2) + " " + ret[1]; - } - - function hasResource(stats, resource) { return stats.stats.length > 0 && stats.stats[0][resource]; } - - // Gets the length of the interval in nanoseconds. - function getInterval(current, previous) { - var cur = new Date(current); - var prev = new Date(previous); - - // ms -> ns. - return (cur.getTime() - prev.getTime()) * 1000000; - } - - function parseCpu(machineInfo, containerInfo) { - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - var results = []; - - var cpuUsage = 0; - if (containerInfo.spec.has_cpu && containerInfo.stats.length >= 2) { - var prev = containerInfo.stats[containerInfo.stats.length - 2]; - var rawUsage = cur.cpu.usage.total - prev.cpu.usage.total; - var intervalInNs = getInterval(cur.timestamp, prev.timestamp); - - // Convert to millicores and take the percentage - cpuUsage = Math.round(((rawUsage / intervalInNs) / machineInfo.num_cores) * 100); - if (cpuUsage > 100) { - cpuUsage = 100; - } - } - - return { - cpuPercentUsage: cpuUsage - }; - } - - function parseFilesystems(machineInfo, containerInfo) { - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - if (!cur.filesystem) { - return; - } - - var filesystemData = []; - for (var i = 0; i < cur.filesystem.length; i++) { - var data = cur.filesystem[i]; - var totalUsage = Math.floor((data.usage * 100.0) / data.capacity); - - var f = { - device: data.device, - filesystemNumber: i + 1, - usage: data.usage, - usageDescription: humanizeMetric(data.usage), - capacity: data.capacity, - capacityDescription: humanizeMetric(data.capacity), - totalUsage: Math.floor((data.usage * 100.0) / data.capacity) - }; - - filesystemData.push(f); - } - return filesystemData; - } - - var oneMegabyte = 1024 * 1024; - var oneGigabyte = 1024 * oneMegabyte; - - function parseMemory(machineInfo, containerInfo) { - if (containerInfo.spec.has_memory && !hasResource(containerInfo, "memory")) { - return; - } - - // var titles = ["Time", "Total", "Hot"]; - var data = []; - for (var i = 0; i < containerInfo.stats.length; i++) { - var cur = containerInfo.stats[i]; - - var elements = []; - elements.push(cur.timestamp); - elements.push(cur.memory.usage / oneMegabyte); - elements.push(cur.memory.working_set / oneMegabyte); - data.push(elements); - } - - // Get the memory limit, saturate to the machine size. - var memory_limit = machineInfo.memory_capacity; - if (containerInfo.spec.memory.limit && (containerInfo.spec.memory.limit < memory_limit)) { - memory_limit = containerInfo.spec.memory.limit; - } - - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - - var r = { - current: { - memoryUsage: cur.memory.usage, - workingMemoryUsage: cur.memory.working_set, - memoryLimit: memory_limit, - memoryUsageDescription: humanizeMetric(cur.memory.usage), - workingMemoryUsageDescription: humanizeMetric(cur.memory.working_set), - memoryLimitDescription: humanizeMetric(memory_limit) - }, - historical: data - }; - - return r; - } - }]); -})(); - -app.provider('k8sApi', - function() { - - var urlBase = ''; - var _namespace = 'default'; - - this.setUrlBase = function(value) { urlBase = value; }; - - this.setNamespace = function(value) { _namespace = value; }; - this.getNamespace = function() { return _namespace; }; - - var _get = function($http, baseUrl, query) { - var _fullUrl = baseUrl; - - if (query !== undefined) { - _fullUrl += '/' + query; - } - - return $http.get(_fullUrl); - }; - - this.$get = ["$http", "$q", function($http, $q) { - var api = {}; - - api.getUrlBase = function() { return urlBase + '/namespaces/' + _namespace; }; - - api.getPods = function(query) { return _get($http, api.getUrlBase() + '/pods', query); }; - - api.getNodes = function(query) { return _get($http, urlBase + '/nodes', query); }; - - api.getMinions = api.getNodes; - - api.getServices = function(query) { return _get($http, api.getUrlBase() + '/services', query); }; - - api.getReplicationControllers = function(query) { - return _get($http, api.getUrlBase() + '/replicationcontrollers', query) - }; - - api.getEvents = function(query) { return _get($http, api.getUrlBase() + '/events', query); }; - - return api; - }]; - }) - .config(["k8sApiProvider", "ENV", function(k8sApiProvider, ENV) { - if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) { - k8sApiProvider.setUrlBase(ENV['/']['k8sApiServer']); - } - }]); - -(function() { - "use strict"; - - var pollK8sDataServiceProvider = function PollK8sDataServiceProvider(_) { - // A set of configuration controlling the polling behavior. - // Their values should be configured in the application before - // creating the service instance. - - var useSampleData = false; - this.setUseSampleData = function(value) { useSampleData = value; }; - - var sampleDataFiles = ["shared/assets/sampleData1.json"]; - this.setSampleDataFiles = function(value) { sampleDataFiles = value; }; - - var dataServer = "http://localhost:5555/cluster"; - this.setDataServer = function(value) { dataServer = value; }; - - var pollMinIntervalSec = 10; - this.setPollMinIntervalSec = function(value) { pollMinIntervalSec = value; }; - - var pollMaxIntervalSec = 120; - this.setPollMaxIntervalSec = function(value) { pollMaxIntervalSec = value; }; - - var pollErrorThreshold = 5; - this.setPollErrorThreshold = function(value) { pollErrorThreshold = value; }; - - this.$get = function($http, $timeout) { - // Now the sequenceNumber will be used for debugging and verification purposes. - var k8sdatamodel = { - "data": undefined, - "sequenceNumber": 0, - "useSampleData": useSampleData - }; - var pollingError = 0; - var promise = undefined; - - // Implement fibonacci back off when the service is down. - var pollInterval = pollMinIntervalSec; - var pollIncrement = pollInterval; - - // Reset polling interval. - var resetCounters = function() { - pollInterval = pollMinIntervalSec; - pollIncrement = pollInterval; - }; - - // Bump error count and polling interval. - var bumpCounters = function() { - // Bump the error count. - pollingError++; - - // TODO: maybe display an error in the UI to the end user. - if (pollingError % pollErrorThreshold === 0) { - console.log("Error: " + pollingError + " consecutive polling errors for " + dataServer + "."); - } - - // Bump the polling interval. - var oldIncrement = pollIncrement; - pollIncrement = pollInterval; - pollInterval += oldIncrement; - - // Reset when limit reached. - if (pollInterval > pollMaxIntervalSec) { - resetCounters(); - } - }; - - var updateModel = function(newModel) { - var dedupe = function(dataModel) { - if (dataModel.resources) { - dataModel.resources = _.uniq(dataModel.resources, function(resource) { return resource.id; }); - } - - if (dataModel.relations) { - dataModel.relations = - _.uniq(dataModel.relations, function(relation) { return relation.source + relation.target; }); - } - }; - - dedupe(newModel); - - var newModelString = JSON.stringify(newModel); - var oldModelString = ""; - if (k8sdatamodel.data) { - oldModelString = JSON.stringify(k8sdatamodel.data); - } - - if (newModelString !== oldModelString) { - k8sdatamodel.data = newModel; - k8sdatamodel.sequenceNumber++; - } - - pollingError = 0; - resetCounters(); - }; - - var nextSampleDataFile = 0; - var getSampleDataFile = function() { - var result = ""; - if (sampleDataFiles.length > 0) { - result = sampleDataFiles[nextSampleDataFile % sampleDataFiles.length]; - ++nextSampleDataFile; - } - - return result; - }; - - var pollOnce = function(scope, repeat) { - var dataSource = (k8sdatamodel.useSampleData) ? getSampleDataFile() : dataServer; - $.getJSON(dataSource) - .done(function(newModel, jqxhr, textStatus) { - if (newModel && newModel.success) { - delete newModel.success; // Remove success indicator. - delete newModel.timestamp; // Remove changing timestamp. - updateModel(newModel); - scope.$apply(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - return; - } - - bumpCounters(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - }) - .fail(function(jqxhr, textStatus, error) { - bumpCounters(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - }); - }; - - var isPolling = function() { return promise ? true : false; }; - - var start = function(scope) { - // If polling has already started, then calling start() again would - // just reset the counters and polling interval, but it will not - // start a new thread polling in parallel to the existing polling - // thread. - resetCounters(); - if (!promise) { - k8sdatamodel.data = undefined; - pollOnce(scope, true); - } - }; - - var stop = function() { - if (promise) { - $timeout.cancel(promise); - promise = undefined; - } - }; - - var refresh = function(scope) { - stop(scope); - resetCounters(); - k8sdatamodel.data = undefined; - pollOnce(scope, false); - }; - - return { - "k8sdatamodel": k8sdatamodel, - "isPolling": isPolling, - "refresh": refresh, - "start": start, - "stop": stop - }; - }; - }; - - angular.module("kubernetesApp.services") - .provider("pollK8sDataService", ["lodash", pollK8sDataServiceProvider]) - .config(["pollK8sDataServiceProvider", "ENV", function(pollK8sDataServiceProvider, ENV) { - if (ENV && ENV['/']) { - if (ENV['/']['k8sDataServer']) { - pollK8sDataServiceProvider.setDataServer(ENV['/']['k8sDataServer']); - } - if (ENV['/']['k8sDataPollIntervalMinSec']) { - pollK8sDataServiceProvider.setPollIntervalSec(ENV['/']['k8sDataPollIntervalMinSec']); - } - if (ENV['/']['k8sDataPollIntervalMaxSec']) { - pollK8sDataServiceProvider.setPollIntervalSec(ENV['/']['k8sDataPollIntervalMaxSec']); - } - if (ENV['/']['k8sDataPollErrorThreshold']) { - pollK8sDataServiceProvider.setPollErrorThreshold(ENV['/']['k8sDataPollErrorThreshold']); - } - } - }]); - -}()); - -/**========================================================= - * Module: toggle-state.js - * Services to share toggle state functionality - =========================================================*/ - - -app.controller('cAdvisorController', [ - '$scope', - '$routeParams', - 'k8sApi', - 'lodash', - 'cAdvisorService', - '$q', - '$interval', - function($scope, $routeParams, k8sApi, lodash, cAdvisorService, $q, $interval) { - $scope.k8sApi = k8sApi; - - $scope.activeMinionDataById = {}; - $scope.maxDataByById = {}; - - $scope.getData = function() { - $scope.loading = true; - - k8sApi.getMinions().success(angular.bind(this, function(res) { - $scope.minions = res; - // console.log(res); - var promises = lodash.map(res.items, function(m) { return cAdvisorService.getDataForMinion(m.metadata.name); }); - - $q.all(promises).then( - function(dataArray) { - lodash.each(dataArray, function(data, i) { - var m = res.items[i]; - - var maxData = maxMemCpuInfo(m.metadata.name, data.memoryData, data.cpuData, data.filesystemData); - - // console.log("maxData", maxData); - var hostname = ""; - if(m.status.addresses) - hostname = m.status.addresses[0].address; - - $scope.activeMinionDataById[m.metadata.name] = - transformMemCpuInfo(data.memoryData, data.cpuData, data.filesystemData, maxData, hostname); - }); - - }, - function(errorData) { - // console.log("Error: " + errorData); - $scope.loading = false; - }); - - $scope.loading = false; - })).error(angular.bind(this, this.handleError)); - }; - - function handleError(data, status, headers, config) { - // console.log("Error (" + status + "): " + data); - $scope.loading = false; - }; - - // d3 - function getColorForIndex(i, percentage) { - // var colors = ['red', 'blue', 'yellow', 'pink', 'purple', 'green', 'orange']; - // return colors[i]; - var c = "color-" + (i + 1); - if (percentage && percentage >= 90) - c = c + ' color-critical'; - else if (percentage && percentage >= 80) - c = c + ' color-warning'; - - return c; - } - - function getMaxColorForIndex(i, percentage) { - // var colors = ['red', 'blue', 'yellow', 'pink', 'purple', 'green', 'orange']; - // return colors[i]; - var c = "color-max-" + (i + 1); - if (percentage && percentage >= 90) - c = c + ' color-max-critical'; - else if (percentage && percentage >= 80) - c = c + ' color-max-warning'; - - return c; - } - - function maxMemCpuInfo(mId, mem, cpu, fsDataArray) { - if ($scope.maxDataByById[mId] === undefined) $scope.maxDataByById[mId] = {}; - - var currentMem = mem.current; - var currentCpu = cpu; - - var items = []; - - if ($scope.maxDataByById[mId]['cpu'] === undefined || - $scope.maxDataByById[mId]['cpu'] < currentCpu.cpuPercentUsage) { - // console.log("New max cpu " + mId, $scope.maxDataByById[mId].cpu, currentCpu.cpuPercentUsage); - $scope.maxDataByById[mId]['cpu'] = currentCpu.cpuPercentUsage; - } - items.push({ - maxValue: $scope.maxDataByById[mId]['cpu'], - maxTickClassNames: getColorForIndex(0, $scope.maxDataByById[mId]['cpu']), - maxClassNames: getMaxColorForIndex(0, $scope.maxDataByById[mId]['cpu']) - }); - - var memPercentage = Math.floor((currentMem.memoryUsage * 100.0) / currentMem.memoryLimit); - if ($scope.maxDataByById[mId]['mem'] === undefined || $scope.maxDataByById[mId]['mem'] < memPercentage) - $scope.maxDataByById[mId]['mem'] = memPercentage; - items.push({ - maxValue: $scope.maxDataByById[mId]['mem'], - maxTickClassNames: getColorForIndex(1, $scope.maxDataByById[mId]['mem']), - maxClassNames: getMaxColorForIndex(1, $scope.maxDataByById[mId]['mem']) - }); - - for (var i = 0; i < fsDataArray.length; i++) { - var f = fsDataArray[i]; - var fid = 'FS #' + f.filesystemNumber; - if ($scope.maxDataByById[mId][fid] === undefined || $scope.maxDataByById[mId][fid] < f.totalUsage) - $scope.maxDataByById[mId][fid] = f.totalUsage; - items.push({ - maxValue: $scope.maxDataByById[mId][fid], - maxTickClassNames: getColorForIndex(2 + i, $scope.maxDataByById[mId][fid]), - maxClassNames: getMaxColorForIndex(2 + i, $scope.maxDataByById[mId][fid]) - }); - } - - // console.log("Max Data is now " + mId, $scope.maxDataByById[mId]); - return items; - } - - function transformMemCpuInfo(mem, cpu, fsDataArray, maxData, hostName) { - var currentMem = mem.current; - var currentCpu = cpu; - - var items = []; - - items.push({ - label: 'CPU', - stats: currentCpu.cpuPercentUsage + '%', - value: currentCpu.cpuPercentUsage, - classNames: getColorForIndex(0, currentCpu.cpuPercentUsage), - maxData: maxData[0], - hostName: hostName - }); - - var memPercentage = Math.floor((currentMem.memoryUsage * 100.0) / currentMem.memoryLimit); - items.push({ - label: 'Memory', - stats: currentMem.memoryUsageDescription + ' / ' + currentMem.memoryLimitDescription, - value: memPercentage, - classNames: getColorForIndex(1, memPercentage), - maxData: maxData[1], - hostName: hostName - }); - - for (var i = 0; i < fsDataArray.length; i++) { - var f = fsDataArray[i]; - - items.push({ - label: 'Filesystem #' + f.filesystemNumber, - stats: f.usageDescription + ' / ' + f.capacityDescription, - value: f.totalUsage, - classNames: getColorForIndex(2 + i, f.totalUsage), - maxData: maxData[2 + i], - hostName: hostName - - }); - } - - var a = []; - var segments = { - segments: items - }; - a.push(segments); - return a; - }; - - // end d3 - var promise = $interval($scope.getData, 3000); - - // Cancel interval on page changes - $scope.$on('$destroy', function() { - if (angular.isDefined(promise)) { - $interval.cancel(promise); - promise = undefined; - } - }); - - $scope.getData(); - - } -]); - -/**========================================================= - * Module: Dashboard - * Visualizer for clusters - =========================================================*/ - -app.controller('DashboardCtrl', ['$scope', function($scope) {}]); - -/**========================================================= - * Module: Group - * Visualizer for groups - =========================================================*/ - -app.controller('GroupCtrl', [ - '$scope', - '$route', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - '$location', - 'lodash', - function($scope, $route, $interval, $routeParams, k8sApi, $rootScope, $location, _) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $scope.capitalize = function(s) { return _.capitalize(s); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.resetGroupLayout = function(group) { delete group.settings; }; - - $scope.handlePath = function(path) { - var parts = path.split("/"); - // split leaves an empty string at the beginning. - parts = parts.slice(1); - - if (parts.length === 0) { - return; - } - this.handleGroups(parts.slice(1)); - }; - - $scope.getState = function(obj) { return Object.keys(obj)[0]; }; - - $scope.clearSelector = function(grouping) { $location.path("/dashboard/groups/" + grouping + "/selector/"); }; - - $scope.changeGroupBy = function() { - var grouping = encodeURIComponent($scope.selectedGroupBy); - - var s = _.clone($location.search()); - if ($scope.routeParams.grouping != grouping) - $location.path("/dashboard/groups/" + grouping + "/selector/").search(s); - }; - - $scope.createBarrier = function(count, callback) { - var barrier = count; - var barrierFunction = angular.bind(this, function(data) { - // JavaScript is single threaded so this is safe. - barrier--; - if (barrier === 0) { - if (callback) { - callback(); - } - } - }); - return barrierFunction; - }; - - $scope.handleGroups = function(parts, selector) { - $scope.groupBy = parts; - $scope.loading = true; - $scope.selector = selector; - $scope.selectorName = decodeURIComponent(selector); - var args = []; - var type = ""; - var selectedHost = ""; - if (selector && selector.length > 0) { - $scope.selectorPieces = selector.split(","); - var labels = []; - var fields = []; - for (var i = 0; i < $scope.selectorPieces.length; i++) { - var piece = decodeURIComponent($scope.selectorPieces[i]); - if (piece[0] == '$') { - fields.push(piece.slice(2)); - } else { - if (piece.indexOf("type=") === 0) { - var labelParts = piece.split("="); - if (labelParts.length > 1) { - type = labelParts[1]; - } - } - else if (piece.indexOf("host=") === 0){ - var labelParts = piece.split("="); - if (labelParts.length > 1) { - selectedHost = labelParts[1]; - } - } - else { - labels.push(piece); - } - } - } - - if (labels.length > 0) { - args.push("labelSelector=" + encodeURI(labels.join(","))); - } - if (fields.length > 0) { - args.push("fields=" + encodeURI(fields.join(","))); - } - } - var query = "?" + args.join("&"); - var list = []; - var count = type.length > 0 ? 1 : 3; - - $scope.selectedGroupByName = decodeURIComponent($routeParams.grouping) - - var barrier = $scope.createBarrier(count, function() { - $scope.groups = $scope.groupData(list, 0); - $scope.loading = false; - $scope.groupByOptions = buildGroupByOptions(); - $scope.selectedGroupBy = $routeParams.grouping; - }); - - if (type === "" || type == "pod") { - k8sApi.getPods(query).success(function(data) { - $scope.addLabel("type", "pod", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - data.items[i].metadata.labels.host = data.items[i].spec.nodeName; - if(selectedHost.length == 0 || selectedHost == data.items[i].metadata.labels.host) - list.push(data.items[i]); - } - barrier(); - }).error($scope.handleError); - } - if (type === "" || type == "service") { - k8sApi.getServices(query).success(function(data) { - $scope.addLabel("type", "service", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - list.push(data.items[i]); - } - barrier(); - }).error($scope.handleError); - } - if (type === "" || type == "replicationController") { - k8sApi.getReplicationControllers(query).success(angular.bind(this, function(data) { - $scope.addLabel("type", "replicationController", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - list.push(data.items[i]); - } - barrier(); - })).error($scope.handleError); - } - }; - - $scope.addLabel = function(key, value, items) { - if (!items) { - return; - } - for (var i = 0; i < items.length; i++) { - if (!items[i].metadata.labels) { - items[i].metadata.labels = {}; - } - items[i].metadata.labels[key] = value; - } - }; - - $scope.groupData = function(items, index) { - var result = { - "items": {}, - "kind": "grouping" - }; - for (var i = 0; i < items.length; i++) { - key = items[i].metadata.labels[decodeURIComponent($scope.groupBy[index])]; - if (!key) { - key = ""; - } - var list = result.items[key]; - if (!list) { - list = []; - result.items[key] = list; - } - list.push(items[i]); - } - - if (index + 1 < $scope.groupBy.length) { - for (var key in result.items) { - result.items[key] = $scope.groupData(result.items[key], index + 1); - } - } - return result; - }; - $scope.getGroupColor = function(type) { - if (type === 'pod') { - return '#6193F0'; - } else if (type === 'replicationController') { - return '#E008FE'; - } else if (type === 'service') { - return '#7C43FF'; - } - }; - - var groups = $routeParams.grouping; - if (!groups) { - groups = ''; - } - - $scope.routeParams = $routeParams; - $scope.route = $route; - - $scope.handleGroups(groups.split('/'), $routeParams.selector); - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - function getDefaultGroupByOptions() { return [{name: 'Type', value: 'type'}, {name: 'Name', value: 'name'}]; } - - function buildGroupByOptions() { - var g = $scope.groups; - var options = getDefaultGroupByOptions(); - var newOptions = _.map(g.items, function(vals) { return _.map(vals, function(v) { return _.keys(v.metadata.labels); }); }); - newOptions = - _.reject(_.uniq(_.flattenDeep(newOptions)), function(o) { return o == 'name' || o == 'type' || o == ""; }); - newOptions = _.map(newOptions, function(o) { - return { - name: o, - value: o - }; - }); - - options = options.concat(newOptions); - return options; - } - - $scope.changeFilterBy = function(selector) { - var grouping = $scope.selectedGroupBy; - - var s = _.clone($location.search()); - if ($scope.routeParams.selector != selector) - $location.path("/dashboard/groups/" + $scope.routeParams.grouping + "/selector/" + selector).search(s); - }; - } -]); - -/**========================================================= - * Module: Header - * Visualizer for clusters - =========================================================*/ - -angular.module('kubernetesApp.components.dashboard', []) - .controller('HeaderCtrl', [ - '$scope', - '$location', - function($scope, $location) { - 'use strict'; - $scope.$watch('Pages', function(newValue, oldValue) { - if (typeof newValue !== 'undefined') { - $location.path(newValue); - } - }); - - $scope.subPages = [ - {category: 'dashboard', name: 'Explore', value: '/dashboard/groups/type/selector/'}, - {category: 'dashboard', name: 'Pods', value: '/dashboard/pods'}, - {category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes'}, - {category: 'dashboard', name: 'Replication Controllers', value: '/dashboard/replicationcontrollers'}, - {category: 'dashboard', name: 'Services', value: '/dashboard/services'}, - {category: 'dashboard', name: 'Events', value: '/dashboard/events'} - ]; - } - ]); - -/**========================================================= - * Module: List Events - * Visualizer list events - =========================================================*/ - -app.controller('ListEventsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - '$filter', - function($scope, $routeParams, k8sApi, $location, $filter) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Last Seen', field: 'lastSeen'}, - {name: 'First Seen', field: 'firstSeen'}, - {name: 'Count', field: 'count'}, - {name: 'Name', field: 'name'}, - {name: 'Kind', field: 'kind'}, - {name: 'SubObject', field: 'subObject'}, - {name: 'Reason', field: 'reason'}, - {name: 'Source', field: 'source'}, - {name: 'Message', field: 'message'} - ]; - - - $scope.sortable = ['lastSeen', 'firstSeen', 'count', 'name', 'kind', 'subObject', 'reason', 'source', 'message']; - $scope.count = 50; - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getEvents().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(event) { - var _sources = ''; - if (event.source) { - _sources = event.source.component + ' ' + event.source.host; - } - - - $scope.content.push({ - firstSeen: $filter('date')(event.firstTimestamp, 'medium'), - lastSeen: $filter('date')(event.lastTimestamp, 'medium'), - count: event.count, - name: event.involvedObject.name, - kind: event.involvedObject.kind, - subObject: event.involvedObject.fieldPath, - reason: event.reason, - source: _sources, - message: event.message - }); - - - - }); - - $scope.content = _.sortBy($scope.content, function(e){ - return e.lastSeen; - }).reverse(); - - - }).error($scope.handleError); - } - - getData(); - - } -]); - -/**========================================================= - * Module: Minions - * Visualizer for minions - =========================================================*/ - -app.controller('ListMinionsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [{name: 'Name', field: 'name'}, {name: 'Addresses', field: 'addresses'}, {name: 'Status', field: 'status'}]; - - $scope.custom = { - name: '', - status: 'grey', - ip: 'grey' - }; - $scope.sortable = ['name', 'status', 'addresses']; - $scope.thumbs = 'thumb'; - $scope.count = 50; - - $scope.go = function(d) { $location.path('/dashboard/nodes/' + d.name); }; - - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getMinions().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(minion) { - var _statusType = ''; - - if (minion.status.conditions) { - Object.keys(minion.status.conditions) - .forEach(function(key) { _statusType += minion.status.conditions[key].type; }); - } - - - $scope.content.push({name: minion.metadata.name, addresses: _.map(minion.status.addresses, function(a) { return a.address }).join(', '), status: _statusType}); - }); - - }).error($scope.handleError); - } - - getData(); - - } -]); - - - -app.controller('ListPodsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - 'lodash', - '$location', - function($scope, $routeParams, k8sApi, lodash, $location) { - var _ = lodash; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Pod', field: 'pod'}, - {name: 'IP', field: 'ip'}, - {name: 'Status', field: 'status'}, - {name: 'Containers', field: 'containers'}, - {name: 'Images', field: 'images'}, - {name: 'Host', field: 'host'}, - {name: 'Labels', field: 'labels'} - ]; - - $scope.custom = { - pod: '', - ip: 'grey', - containers: 'grey', - images: 'grey', - host: 'grey', - labels: 'grey', - status: 'grey' - }; - $scope.sortable = ['pod', 'ip', 'status','containers','images','host','labels']; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/pods/' + data.pod); }; - - var orderedPodNames = []; - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - }; - - function getPodName(pod) { return _.has(pod.metadata.labels, 'name') ? pod.metadata.labels.name : pod.metadata.name; } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getPods().success(angular.bind(this, function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(pod) { - var _containers = '', _images = '', _labels = '', _uses = ''; - - if (pod.spec) { - Object.keys(pod.spec.containers) - .forEach(function(key) { - _containers += ', ' + pod.spec.containers[key].name; - _images += ', ' + pod.spec.containers[key].image; - }); - } - - if (pod.metadata.labels) { - _labels = _.map(pod.metadata.labels, function(v, k) { return k + ': ' + v }).join(', '); - } - - $scope.content.push({ - pod: pod.metadata.name, - ip: pod.status.podIP, - containers: _fixComma(_containers), - images: _fixComma(_images), - host: pod.spec.nodeName, - labels: _labels, - status: pod.status.phase - }); - - }); - - })).error(angular.bind(this, handleError)); - }; - - $scope.getPodRestarts = function(pod) { - var r = null; - var container = _.first(pod.spec.containers); - if (container) r = pod.status.containerStatuses[container.name].restartCount; - return r; - }; - - $scope.otherLabels = function(labels) { return _.omit(labels, 'name') }; - - $scope.podStatusClass = function(pod) { - - var s = pod.status.phase.toLowerCase(); - - if (s == 'running' || s == 'succeeded') - return null; - else - return "status-" + s; - }; - - $scope.podIndexFromName = function(pod) { - var name = getPodName(pod); - return _.indexOf(orderedPodNames, name) + 1; - }; - - getData(); - - } -]); - -/**========================================================= - * Module: Replication Controllers - * Visualizer for replication controllers - =========================================================*/ - -app.controller('ListReplicationControllersCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Controller', field: 'controller'}, - {name: 'Containers', field: 'containers'}, - {name: 'Images', field: 'images'}, - {name: 'Selector', field: 'selector'}, - {name: 'Replicas', field: 'replicas'} - ]; - - $scope.custom = { - controller: '', - containers: 'grey', - images: 'grey', - selector: 'grey', - replicas: 'grey' - }; - $scope.sortable = ['controller', 'containers', 'images', 'selector', 'replicas']; - $scope.thumbs = 'thumb'; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/replicationcontrollers/' + data.controller); }; - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getReplicationControllers().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(replicationController) { - - var _name = '', _image = ''; - - if (replicationController.spec.template.spec.containers) { - Object.keys(replicationController.spec.template.spec.containers) - .forEach(function(key) { - _name += replicationController.spec.template.spec.containers[key].name; - _image += replicationController.spec.template.spec.containers[key].image; - }); - } - - var _selectors = ''; - - if (replicationController.spec.selector) { - _selectors = _.map(replicationController.spec.selector, function(v, k) { return k + '=' + v }).join(', '); - } - - $scope.content.push({ - controller: replicationController.metadata.name, - containers: _name, - images: _image, - selector: _selectors, - replicas: replicationController.status.replicas - }); - - }); - - }).error($scope.handleError); - } - - getData(); - - } -]); - -/**========================================================= - * Module: Services - * Visualizer for services - =========================================================*/ - -app.controller('ListServicesCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - '$location', - function($scope, $interval, $routeParams, k8sApi, $rootScope, $location) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $scope.headers = [ - {name: 'Name', field: 'name'}, - {name: 'Labels', field: 'labels'}, - {name: 'Selector', field: 'selector'}, - {name: 'IP', field: 'ip'}, - {name: 'Ports', field: 'port'} - ]; - - $scope.custom = { - name: '', - ip: 'grey', - selector: 'grey', - port: 'grey', - labels: 'grey' - }; - $scope.sortable = ['name', 'ip', 'port', 'labels', 'selector']; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/services/' + data.name); }; - - $scope.content = []; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.getData = function() { - $scope.loading = true; - k8sApi.getServices().success(angular.bind(this, function(data) { - $scope.services = data; - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - var addLabel = function(str, label) { - if (str) { - str = label + str; - } - return str; - }; - - if (data.items.constructor === Array) { - data.items.forEach(function(service) { - - var _labels = ''; - - if (service.metadata.labels) { - _labels = _.map(service.metadata.labels, function(v, k) { return k + ': ' + v }).join(', '); - } - - var _selectors = ''; - - if (service.spec.selector) { - _selectors = _.map(service.spec.selector, function(v, k) { return k + '=' + v }).join(', '); - } - - var _ports = ''; - - if (service.spec.ports) { - _ports = _.map(service.spec.ports, function(p) { - var n = ''; - if(p.name) - n = p.name + ': '; - n = n + p.port; - return n; - }).join(', '); - } - - $scope.content.push({ - name: service.metadata.name, - ip: service.spec.clusterIP, - port: _ports, - selector: _selectors, - labels: _labels - }); - }); - } - })).error($scope.handleError); - }; - - $scope.getData(); - } -]); - -/**========================================================= - * Module: Nodes - * Visualizer for nodes - =========================================================*/ - -app.controller('NodeCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - function($scope, $interval, $routeParams, k8sApi, $rootScope) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.handleNode = function(nodeId) { - $scope.loading = true; - k8sApi.getNodes(nodeId).success(angular.bind(this, function(data) { - $scope.node = data; - $scope.loading = false; - })).error($scope.handleError); - }; - - $scope.handleNode($routeParams.nodeId); - } -]); - -/**========================================================= - * Module: Pods - * Visualizer for pods - =========================================================*/ - -app.controller('PodCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - function($scope, $interval, $routeParams, k8sApi, $rootScope) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.handlePod = function(podId) { - $scope.loading = true; - k8sApi.getPods(podId).success(angular.bind(this, function(data) { - $scope.pod = data; - $scope.loading = false; - })).error($scope.handleError); - }; - - $scope.handlePod($routeParams.podId); - } -]); - -/**========================================================= - * Module: Replication - * Visualizer for replication controllers - =========================================================*/ - -function ReplicationController() { -} - -ReplicationController.prototype.getData = function(dataId) { - this.scope.loading = true; - this.k8sApi.getReplicationControllers(dataId).success(angular.bind(this, function(data) { - this.scope.replicationController = data; - this.scope.loading = false; - })).error(angular.bind(this, this.handleError)); -}; - -ReplicationController.prototype.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - this.scope.loading = false; -}; - -app.controller('ReplicationControllerCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - function($scope, $routeParams, k8sApi) { - $scope.controller = new ReplicationController(); - $scope.controller.k8sApi = k8sApi; - $scope.controller.scope = $scope; - $scope.controller.getData($routeParams.replicationControllerId); - - $scope.doTheBack = function() { window.history.back(); }; - $scope.getSelectorUrlFragment = function(sel){ return _.map(sel, function(v, k) { return k + '=' + v }).join(','); }; - - } -]); - -/**========================================================= - * Module: Services - * Visualizer for services - =========================================================*/ - -function ServiceController() { -} - -ServiceController.prototype.getData = function(dataId) { - this.scope.loading = true; - this.k8sApi.getServices(dataId).success(angular.bind(this, function(data) { - this.scope.service = data; - this.scope.loading = false; - })).error(angular.bind(this, this.handleError)); -}; - -ServiceController.prototype.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - this.scope.loading = false; -}; - -app.controller('ServiceCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - $scope.controller = new ServiceController(); - $scope.controller.k8sApi = k8sApi; - $scope.controller.scope = $scope; - $scope.controller.getData($routeParams.serviceId); - - $scope.doTheBack = function() { window.history.back(); }; - $scope.go = function(d) { $location.path('/dashboard/services/' + d.metadata.name); } - $scope.getSelectorUrlFragment = function(sel){ return _.map(sel, function(v, k) { return k + '=' + v }).join(','); }; - - } -]); - -(function() { - 'use strict'; - - angular.module('kubernetesApp.components.dashboard') - .directive('d3MinionBarGauge', [ - 'd3DashboardService', - function(d3DashboardService) { - - return { - restrict: 'E', - scope: { - data: '=', - thickness: '@', - graphWidth: '@', - graphHeight: '@' - - }, - link: function(scope, element, attrs) { - - var draw = function(d3) { - var svg = d3.select("svg.chart"); - var legendSvg = d3.select("svg.legend"); - window.onresize = function() { return scope.$apply(); }; - - scope.$watch(function() { return angular.element(window)[0].innerWidth; }, - function() { return scope.render(scope.data); }); - - scope.$watch('data', function(newVals, oldVals) { - return initOrUpdate(newVals, oldVals); - - }, true); - - function initOrUpdate(newVals, oldVals) { - if (oldVals === null || oldVals === undefined) { - return scope.render(newVals); - } else { - return update(oldVals, newVals); - } - } - - var textOffset = 10; - var el = null; - var radius = 100; - var oldData = []; - - function init(options) { - var clone = options.data; - var preparedData = setData(clone); - setup(preparedData, options.width, options.height); - } - - function setup(data, w, h) { - svg = d3.select(element[0]).append("svg").attr("width", "100%"); - - legendSvg = d3.select(element[0]).append("svg").attr("width", "100%"); - - var chart = svg.attr("class", "chart") - .attr("width", w) - .attr("height", h - 25) - .append("svg:g") - .attr("class", "concentricchart") - .attr("transform", "translate(" + ((w / 2)) + "," + h / 4 + ")"); - - var legend = legendSvg.attr("class", "legend").attr("width", w); - - radius = Math.min(w, h) / 2; - - var hostName = legendSvg.append("text") - .attr("class", "hostName") - .attr("transform", "translate(" + ((w - 120) / 2) + "," + 15 + ")"); - - var label_legend_area = legendSvg.append("svg:g") - .attr("class", "label_legend_area") - .attr("transform", "translate(" + ((w - 215) / 2) + "," + 35 + ")"); - - var legend_group = label_legend_area.append("svg:g").attr("class", "legend_group"); - - var label_group = label_legend_area.append("svg:g") - .attr("class", "label_group") - .attr("transform", "translate(" + 25 + "," + 11 + ")"); - - var stats_group = label_legend_area.append("svg:g") - .attr("class", "stats_group") - .attr("transform", "translate(" + 115 + "," + 11 + ")"); - - var path_group = chart.append("svg:g") - .attr("class", "path_group") - .attr("transform", "translate(0," + (h / 4) + ")"); - var value_group = chart.append("svg:g") - .attr("class", "value_group") - .attr("transform", "translate(" + -(w * 0.205) + "," + -(h * 0.10) + ")"); - generateArcs(chart, data); - } - - function update(_oldData, _newData) { - if (_newData === undefined || _newData === null) { - return; - } - - var clone = jQuery.extend(true, {}, _newData); - var cloneOld = jQuery.extend(true, {}, _oldData); - var preparedData = setData(clone); - oldData = setData(cloneOld); - animate(preparedData); - } - - function animate(data) { generateArcs(null, data); } - - function setData(data) { - var diameter = 2 * Math.PI * radius; - var localData = []; - - $.each(data[0].segments, function(ri, value) { - - function calcAngles(v) { - var segmentValueSum = 200; - if (v > segmentValueSum) { - v = segmentValueSum; - } - - var segmentValue = v; - var fraction = segmentValue / segmentValueSum; - var arcBatchLength = fraction * 4 * Math.PI; - var arcPartition = arcBatchLength; - var startAngle = Math.PI * 2; - var endAngle = startAngle + arcPartition; - - return { - startAngle: startAngle, - endAngle: endAngle - }; - } - - var valueData = calcAngles(value.value); - data[0].segments[ri].startAngle = valueData.startAngle; - data[0].segments[ri].endAngle = valueData.endAngle; - - var maxData = value.maxData; - var maxTickData = calcAngles(maxData.maxValue + 0.2); - data[0].segments[ri].maxTickStartAngle = maxTickData.startAngle; - data[0].segments[ri].maxTickEndAngle = maxTickData.endAngle; - - var maxArcData = calcAngles(maxData.maxValue); - data[0].segments[ri].maxArcStartAngle = maxArcData.startAngle; - data[0].segments[ri].maxArcEndAngle = maxArcData.endAngle; - - data[0].segments[ri].index = ri; - }); - localData.push(data[0].segments); - return localData[0]; - } - - function generateArcs(_svg, data) { - var chart = svg; - var transitionTime = 750; - $.each(data, function(index, value) { - if (oldData[index] !== undefined) { - data[index].previousEndAngle = oldData[index].endAngle; - } else { - data[index].previousEndAngle = 0; - } - }); - var thickness = parseInt(scope.thickness, 10); - var ir = (parseInt(scope.graphWidth, 10) / 3); - var path_group = svg.select('.path_group'); - var arc_group = path_group.selectAll(".arc_group").data(data); - var arcEnter = arc_group.enter().append("g").attr("class", "arc_group"); - - arcEnter.append("path").attr("class", "bg-circle").attr("d", getBackgroundArc(thickness, ir)); - - arcEnter.append("path") - .attr("class", function(d, i) { return 'max_tick_arc ' + d.maxData.maxTickClassNames; }); - - arcEnter.append("path") - .attr("class", function(d, i) { return 'max_bg_arc ' + d.maxData.maxClassNames; }); - - arcEnter.append("path").attr("class", function(d, i) { return 'value_arc ' + d.classNames; }); - - var max_tick_arc = arc_group.select(".max_tick_arc"); - - max_tick_arc.transition() - .attr("class", function(d, i) { return 'max_tick_arc ' + d.maxData.maxTickClassNames; }) - .attr("d", function(d) { - var arc = maxArc(thickness, ir); - arc.startAngle(d.maxTickStartAngle); - arc.endAngle(d.maxTickEndAngle); - return arc(d); - }); - - var max_bg_arc = arc_group.select(".max_bg_arc"); - - max_bg_arc.transition() - .attr("class", function(d, i) { return 'max_bg_arc ' + d.maxData.maxClassNames; }) - .attr("d", function(d) { - var arc = maxArc(thickness, ir); - arc.startAngle(d.maxArcStartAngle); - arc.endAngle(d.maxArcEndAngle); - return arc(d); - }); - - var value_arc = arc_group.select(".value_arc"); - - value_arc.transition().ease("exp").attr("class", function(d, i) { - return 'value_arc ' + d.classNames; - }).duration(transitionTime).attrTween("d", function(d) { return arcTween(d, thickness, ir); }); - - arc_group.exit() - .select(".value_arc") - .transition() - .ease("exp") - .duration(transitionTime) - .attrTween("d", function(d) { return arcTween(d, thickness, ir); }) - .remove(); - - drawLabels(chart, data, ir, thickness); - buildLegend(chart, data); - } - - function arcTween(b, thickness, ir) { - var prev = JSON.parse(JSON.stringify(b)); - prev.endAngle = b.previousEndAngle; - var i = d3.interpolate(prev, b); - return function(t) { return getArc(thickness, ir)(i(t)); }; - } - - function maxArc(thickness, ir) { - var arc = d3.svg.arc().innerRadius(function(d) { - return getRadiusRing(ir, d.index); - }).outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }); - return arc; - } - - function drawLabels(chart, data, ir, thickness) { - svg.select('.value_group').selectAll("*").remove(); - var counts = data.length; - var value_group = chart.select('.value_group'); - var valueLabels = value_group.selectAll("text.value").data(data); - valueLabels.enter() - .append("svg:text") - .attr("class", "value") - .attr("dx", function(d, i) { return 68; }) - .attr("dy", function(d, i) { return (thickness + 3) * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.value; }); - valueLabels.transition().duration(300).attrTween( - "d", function(d) { return arcTween(d, thickness, ir); }); - valueLabels.exit().remove(); - } - - function buildLegend(chart, data) { - var svg = legendSvg; - svg.select('.label_group').selectAll("*").remove(); - svg.select('.legend_group').selectAll("*").remove(); - svg.select('.stats_group').selectAll("*").remove(); - - var host_name = svg.select('.hostName'); - var label_group = svg.select('.label_group'); - var stats_group = svg.select('.stats_group'); - - host_name.text(data[0].hostName); - - host_name = svg.selectAll("text.hostName").data(data); - - host_name.attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.hostName; }); - host_name.exit().remove(); - - var labels = label_group.selectAll("text.labels").data(data); - labels.enter() - .append("svg:text") - .attr("class", "labels") - .attr("dy", function(d, i) { return 19 * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.label; }); - labels.exit().remove(); - - var stats = stats_group.selectAll("text.stats").data(data); - stats.enter() - .append("svg:text") - .attr("class", "stats") - .attr("dy", function(d, i) { return 19 * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.stats; }); - stats.exit().remove(); - - var legend_group = svg.select('.legend_group'); - var legend = legend_group.selectAll("rect").data(data); - legend.enter() - .append("svg:rect") - .attr("x", 2) - .attr("y", function(d, i) { return 19 * i; }) - .attr("width", 13) - .attr("height", 13) - .attr("class", function(d, i) { return "rect " + d.classNames; }); - - legend.exit().remove(); - } - - function getRadiusRing(ir, i) { return ir - (i * 20); } - - function getArc(thickness, ir) { - var arc = d3.svg.arc() - .innerRadius(function(d) { return getRadiusRing(ir, d.index); }) - .outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }) - .startAngle(function(d, i) { return d.startAngle; }) - .endAngle(function(d, i) { return d.endAngle; }); - return arc; - } - - function getBackgroundArc(thickness, ir) { - var arc = d3.svg.arc() - .innerRadius(function(d) { return getRadiusRing(ir, d.index); }) - .outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }) - .startAngle(0) - .endAngle(function() { return 2 * Math.PI; }); - return arc; - } - - scope.render = function(data) { - if (data === undefined || data === null) { - return; - } - - d3.select(element[0]).select("svg.chart").remove(); - d3.select(element[0]).select("svg.legend").remove(); - - var graph = $(element[0]); - var w = scope.graphWidth; - var h = scope.graphHeight; - - var options = { - data: data, - width: w, - height: h - }; - - init(options); - }; - }; - d3DashboardService.d3().then(draw); - } - }; - } - ]); -}()); - -(function() { - 'use strict'; - - angular.module('kubernetesApp.components.dashboard') - .directive( - 'dashboardHeader', - function() { - 'use strict'; - return { - restrict: 'A', - replace: true, - scope: {user: '='}, - templateUrl: "components/dashboard/pages/header.html", - controller: [ - '$scope', - '$filter', - '$location', - 'menu', - '$rootScope', - function($scope, $filter, $location, menu, $rootScope) { - $scope.menu = menu; - $scope.$watch('page', function(newValue, oldValue) { - if (typeof newValue !== 'undefined') { - $location.path(newValue); - } - }); - $scope.subpages = [ - { - category: 'dashboard', - name: 'Explore', - value: '/dashboard/groups/type/selector/', - id: 'groupsView' - }, - {category: 'dashboard', name: 'Pods', value: '/dashboard/pods', id: 'podsView'}, - {category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes', id: 'minionsView'}, - { - category: 'dashboard', - name: 'Replication Controllers', - value: '/dashboard/replicationcontrollers', - id: 'rcView' - }, - {category: 'dashboard', name: 'Services', value: '/dashboard/services', id: 'servicesView'}, - {category: 'dashboard', name: 'Events', value: '/dashboard/events', id: 'eventsView'}, - ]; - } - ] - }; - }) - .directive('dashboardFooter', - function() { - 'use strict'; - return { - restrict: 'A', - replace: true, - templateUrl: "components/dashboard/pages/footer.html", - controller: ['$scope', '$filter', function($scope, $filter) {}] - }; - }) - .directive('mdTable', function() { - 'use strict'; - return { - restrict: 'E', - scope: { - headers: '=', - content: '=', - sortable: '=', - filters: '=', - customClass: '=customClass', - thumbs: '=', - count: '=', - reverse: '=', - doSelect: '&onSelect' - }, - transclude: true, - controller: ["$scope", "$filter", "$window", "$location", function($scope, $filter, $window, $location) { - var orderBy = $filter('orderBy'); - $scope.currentPage = 0; - $scope.nbOfPages = function() { return Math.ceil($scope.content.length / $scope.count); }; - $scope.handleSort = function(field) { - if ($scope.sortable.indexOf(field) > -1) { - return true; - } else { - return false; - } - }; - $scope.order = function(predicate, reverse) { - $scope.content = orderBy($scope.content, predicate, reverse); - $scope.predicate = predicate; - }; - var reverse = false; - if($scope.reverse) - reverse = $scope.reverse; - - $scope.order($scope.sortable[0], reverse); - $scope.getNumber = function(num) { return new Array(num); }; - $scope.goToPage = function(page) { $scope.currentPage = page; }; - $scope.showMore = function() { return angular.isDefined($scope.moreClick);} - }], - templateUrl: 'views/partials/md-table.tmpl.html' - }; - }); - -}()); - -angular.module('kubernetesApp.components.dashboard') - .factory('d3DashboardService', [ - '$document', - '$q', - '$rootScope', - function($document, $q, $rootScope) { - var d = $q.defer(); - function onScriptLoad() { - // Load client in the browser - $rootScope.$apply(function() { d.resolve(window.d3); }); - } - // Create a script tag with d3 as the source - // and call our onScriptLoad callback when it - // has been loaded - var scriptTag = $document[0].createElement('script'); - scriptTag.type = 'text/javascript'; - scriptTag.async = true; - scriptTag.src = 'vendor/d3/d3.min.js'; - scriptTag.onreadystatechange = function() { - if (this.readyState == 'complete') onScriptLoad(); - }; - scriptTag.onload = onScriptLoad; - - var s = $document[0].getElementsByTagName('body')[0]; - s.appendChild(scriptTag); - - return { - d3: function() { return d.promise; } - }; - } - ]); - -(function() { - 'use strict'; - - angular.module('pods', []).service('podService', PodDataService); - - /** - * Pod DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function PodDataService($q) { - var pods = { - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "redis-master-c0r1n", - "generateName": "redis-master-", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/pods/redis-master-c0r1n", - "uid": "f12ddfaf-ff77-11e4-8f2d-080027213276", - "resourceVersion": "39", - "creationTimestamp": "2015-05-21T05:12:14Z", - "labels": { - "name": "redis-master" - }, - "annotations": { - "kubernetes.io/created-by": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"default\",\"name\":\"redis-master\",\"uid\":\"f12969e0-ff77-11e4-8f2d-080027213276\",\"apiVersion\":\"v1\",\"resourceVersion\":\"26\"}}" - } - }, - "spec": { - "volumes": [ - { - "name": "default-token-zb4rq", - "secret": { - "secretName": "default-token-zb4rq" - } - } - ], - "containers": [ - { - "name": "master", - "image": "redis", - "ports": [ - { - "containerPort": 6379, - "protocol": "TCP" - } - ], - "resources": {}, - "volumeMounts": [ - { - "name": "default-token-zb4rq", - "readOnly": true, - "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount" - } - ], - "terminationMessagePath": "/dev/termination-log", - "imagePullPolicy": "IfNotPresent", - "capabilities": {}, - "securityContext": { - "capabilities": {}, - "privileged": false - } - } - ], - "restartPolicy": "Always", - "dnsPolicy": "ClusterFirst", - "serviceAccount": "default", - "host": "127.0.0.1" - }, - "status": { - "phase": "Running", - "Condition": [ - { - "type": "Ready", - "status": "True" - } - ], - "hostIP": "127.0.0.1", - "podIP": "172.17.0.1", - "startTime": "2015-05-21T05:12:14Z", - "containerStatuses": [ - { - "name": "master", - "state": { - "running": { - "startedAt": "2015-05-21T05:12:14Z" - } - }, - "lastState": {}, - "ready": true, - "restartCount": 0, - "image": "redis", - "imageID": "docker://95af5842ddb9b03f7c6ec7601e65924cec516fcedd7e590ae31660057085cf67", - "containerID": "docker://ae2a1e0a91a8b1015191a0b8e2ce8c55a86fb1a9a2b1e8e3b29430c9d93c8c09" - } - ] - } -}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(pods); - } - }; - } - PodDataService.$inject = ["$q"]; - -})(); - -(function() { - 'use strict'; - - angular.module('replicationControllers', []) - .service('replicationControllerService', ReplicationControllerDataService); - - /** - * Replication Controller DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function ReplicationControllerDataService($q) { - var replicationControllers = { - "kind": "List", - "apiVersion": "v1", - "metadata": {}, - "items": [ - { - "kind": "ReplicationController", - "apiVersion": "v1", - "metadata": { - "name": "redis-master", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/replicationcontrollers/redis-master", - "uid": "f12969e0-ff77-11e4-8f2d-080027213276", - "resourceVersion": "28", - "creationTimestamp": "2015-05-21T05:12:14Z", - "labels": { - "name": "redis-master" - } - }, - "spec": { - "replicas": 1, - "selector": { - "name": "redis-master" - }, - "template": { - "metadata": { - "creationTimestamp": null, - "labels": { - "name": "redis-master" - } - }, - "spec": { - "containers": [ - { - "name": "master", - "image": "redis", - "ports": [ - { - "containerPort": 6379, - "protocol": "TCP" - } - ], - "resources": {}, - "terminationMessagePath": "/dev/termination-log", - "imagePullPolicy": "IfNotPresent", - "capabilities": {}, - "securityContext": { - "capabilities": {}, - "privileged": false - } - } - ], - "restartPolicy": "Always", - "dnsPolicy": "ClusterFirst", - "serviceAccount": "" - } - } - }, - "status": { - "replicas": 1 - } - } - ]}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(replicationControllers); - } - }; - } - ReplicationControllerDataService.$inject = ["$q"]; - -})(); - -(function() { - 'use strict'; - - angular.module('services', []).service('serviceService', ServiceDataService); - - /** - * Service DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function ServiceDataService($q) { - var services = { - "kind": "List", - "apiVersion": "v1", - "metadata": {}, - "items": [ - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "kubernetes", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/kubernetes", - "resourceVersion": "6", - "creationTimestamp": null, - "labels": { - "component": "apiserver", - "provider": "kubernetes" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 443, - "targetPort": 443 - } - ], - "portalIP": "10.0.0.2", - "sessionAffinity": "None" - }, - "status": {} - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "kubernetes-ro", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/kubernetes-ro", - "resourceVersion": "8", - "creationTimestamp": null, - "labels": { - "component": "apiserver", - "provider": "kubernetes" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 80, - "targetPort": 80 - } - ], - "portalIP": "10.0.0.1", - "sessionAffinity": "None" - }, - "status": {} - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "redis-master", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/redis-master", - "uid": "a6fde246-ff78-11e4-8f2d-080027213276", - "resourceVersion": "72", - "creationTimestamp": "2015-05-21T05:17:19Z", - "labels": { - "name": "redis-master" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 6379, - "targetPort": 6379 - } - ], - "selector": { - "name": "redis-master" - }, - "portalIP": "10.0.0.124", - "sessionAffinity": "None" - }, - "status": {} - } - ] -}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(services); - } - }; - } - ServiceDataService.$inject = ["$q"]; - -})(); -`) - -func www_app_assets_js_app_js_bytes() ([]byte, error) { - return _www_app_assets_js_app_js, nil -} - -func www_app_assets_js_app_js() (*asset, error) { - bytes, err := www_app_assets_js_app_js_bytes() - if err != nil { - return nil, err - } - - info := bindata_file_info{name: "www/app/assets/js/app.js", size: 91996, mode: os.FileMode(416), modTime: time.Unix(1436215736, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _www_app_assets_js_base_js = []byte(`!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=Z.type(e);return"function"===n||Z.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Z.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ae.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return U.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t=he[e]={};return Z.each(e.match(de)||[],function(e,n){t[n]=!0}),t}function s(){J.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),Z.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+a.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(be,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:xe.test(n)?Z.parseJSON(n):n}catch(i){}ye.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return J.activeElement}catch(e){}}function p(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function d(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function h(e){var t=Pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,r=e.length;r>n;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function m(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(ve.hasData(e)&&(o=ve.access(e),s=ve.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)Z.event.add(t,i,l[i][n])}ye.hasData(e)&&(a=ye.access(e),u=Z.extend({},a),ye.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ne.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function x(t,n){var r,i=Z(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:Z.css(i[0],"display");return i.detach(),o}function b(e){var t=J,n=$e[e];return n||(n=x(e,t),"none"!==n&&n||(We=(We||Z("
iframe with addEventListener('hashchange', function() { - document.body.style.background = 'lime'; -}, false); -
- - -

Session history management

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "history"
- -

Auto

Test if history.pushState was successful
- - -

IndexedDB

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "indexeddb"
- - -

JSON parsing

[Table] [Single feat]  -

Auto

- -

Auto

Create a JS object, convert to JSON string, convert back to object and compare.
- - -

CSS3 Multiple backgrounds

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "multiplebgs"
- -

Visual-square

background-repeat: repeat-x; -background-image: url(caniuse_files/green5x5.png), url(caniuse_files/green5x5.png), url(caniuse_files/green5x5.png), url(caniuse_files/green5x5.png), url(caniuse_files/green5x5.png), url(caniuse_files/green5x5.png); -background-position: 0 0, 0 5px, 0 10px, 0 15px, 0 20px, 0 25px;
- - -

CSS3 Multiple column layout

[Table] [Single feat] -pre- -

Auto (m)

Modernizr test for: "csscolumns"
- -

Visual-square

-
-
-
-
column-width: 15px; -column-gap: 0;
- - -

Web Storage - name/value pairs

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "localstorage"
- -

Auto

Test if getItem, setItem and removeItem work.
- - -

Web Notifications

[Table] [Single feat]  -

Auto

- - -

Offline web applications

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "applicationcache"
- - -

querySelector/querySelectorAll

[Table] [Single feat]  -

Auto

- -

Auto

-
-
-
-
-
querySelector test on selector '[data-foo=bar] + *'
- -

Auto

-
-
-
-
-
querySelectorAll test on selector '[data-foo=bar] + *'
- - -

SVG (basic support)

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "svg"
- -

Visual-square

SVG fail -
SVG in <object>
- - -

SVG effects for HTML

[Table] [Single feat]  - -

Visual

SVG fail -

Text must appear blurry

SVG with feGaussianBlur filter on foreignObject
- - -

Inline SVG in HTML5

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "inlinesvg"
- -

Visual-square

- - -
- - -

SVG SMIL animation

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "smil"
- -

Visual-square

SVG fail -
SVG with animate element inside a rect
- - -

Touch events

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "touch"
- - -

CSS3 Transforms

[Table] [Single feat] -pre- -

Auto (m)

Modernizr test for: "csstransforms"
- -

Visual-square

-
-
-
transform: translate(30px);
- - -

CSS3 3D Transforms

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "csstransforms3d"
- -

Visual-square

-
-
-
Parent: -perspective: 600; -perspective-origin: 0 200px; - -Child: - -transform: translate3d(-234px, 0, 0) rotate3d(0, 1, 0, -70deg);
- - -

Video element

[Table] [Single feat]  -

Auto

- -

Interact

Video with controls and all three formats available.
- -

Interact

Video with controls and all three formats available (with MIME).
- - -

Web Sockets

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "websockets"
- - -

Web Workers

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "webworkers"
- -

Auto

Create a new Worker using new Worker('worker.js'); - -Then, test postMessage and onmessage event.
- - -

Cross-document messaging

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "postmessage"
- - -

XMLHttpRequest 2

[Table] [Single feat]  -

Auto

- - -

XHTML served as application/xhtml+xml

[Table] [Single feat]  -

Auto

- - -

CSS Generated content

[Table] [Single feat]  -

Visual

--
Element with CSS: -#gencontent:before { - content: 'A'; -} -#gencontent:after { - content: 'Z'; -}
- - -

CSS Table display

[Table] [Single feat]  -

Visual

-
-
-
-
topleft
-
topright
-
-
-
bottomleft
-
bottomright
-
-
-

Should be 2x2 table

- - -

HTML5 form features

[Table] [Single feat]  -

Visual




date/time/range/number widgets

- - -

MathML

[Table] [Single feat]  -

Visual

- - -

PNG alpha transparency

[Table] [Single feat]  -

Visual

- - -

Ruby annotation

[Table] [Single feat]  -

Visual

-
-(bottom1)(top1)(bottom2)(top2) -

Elements should be stacked on top of each other

- - -

SVG filters

[Table] [Single feat]  -

Visual

- object SVG not supported - -
- -

Visual-square

SVG fail -

Must be green (not lime)

SVG with <feColorMatrix type="hueRotate" values="120"/>
- -

Visual-square

SVG fail -
SVG with <feFlood flood-color="lime"/>
- - -

CSS3 Word-wrap

[Table] [Single feat]  -

Visual

-
abcdefghijklmnopqrstuvwxyz
- - -

Text should wrap

- -

Visual

- -
abcdefghijklmnopqrstuvwxyz
-

Text should overflow box

- -

Visual-square

-
abcdefghijklmnop
-
-
word-wrap: break-word;
- - -

calc() as CSS unit value

[Table] [Single feat]  -

Visual-square

-
-
width: calc(10px + 20px);
- -

Visual-square

-
-
height: calc(60px - 100%); -width: calc((100% / 2) + 15px - 0.5em); -border-right: calc(0.5em) solid lime;
- - -

CSS Grid Layout

[Table] [Single feat]  -

Visual-square

- -
-
-
-
-
- -
Grid with two columns, two rows and three elements taking up space.
- - -

CSS3 Media Queries

[Table] [Single feat]  -

Visual-square

- -
-
-
-
- - -

CSS 2.1 selectors

[Table] [Single feat]  -

Visual-square

-
-
-
-
Test for child ( > )selector
- -

Visual-square

-
-
-
Adjacent sibling selector test ( + )
- -

Visual-square

-
Attribute selector ( [role="none"] )
- - -

CSS3 Box-sizing

[Table] [Single feat]  -

Visual-square

-
-
- - -

Data URLs

[Table] [Single feat]  -

Visual-square

div with data URL as background image
- - -

New semantic elements

[Table] [Single feat]  -

Visual-square

- -
-
-
- -
-
-
- -
section, article, aside, hgroup, header, footer, nav tested for default "block" style.
- - -

CSS inline-block

[Table] [Single feat]  -

Visual-square

- - -

CSS min/max-width/height

[Table] [Single feat]  -

Visual-square

- -

Visual-square

- -

Visual-square

- -

Visual-square

- - -

CSS3 object-fit/object-position

[Table] [Single feat]  -

Visual-square

- -
- -
object-fit: contain
- -

Visual-square

- -
- -
-
object-position: 30px 30px;
- - -

rem (root em) units

[Table] [Single feat]  -

Visual-square

- A -
span with single character and font-size: 5rem;
- - -

SVG in CSS backgrounds

[Table] [Single feat]  -

Visual-square

- -
- - -

SVG in HTML img element

[Table] [Single feat]  -

Visual-square

- - -

contenteditable attribute (basic support)

[Table] [Single feat]  -

Interact

-

This element should be editable.

-
Div element with attribute contenteditable="true"
- - -

CSS3 selectors

[Table] [Single feat]  -

Interact

Test here
- - -

Drag and Drop

[Table] [Single feat]  -

Interact

Test here
- - -

WAI-ARIA Accessibility features

[Table] [Single feat]  - - -

Text API for Canvas

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "canvastext"
- - -

WebGL - 3D Canvas graphics

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "webgl"
- -

Visual-square

- -
- - -

SVG fonts

[Table] [Single feat]  -

Visual

-

Windsong font

-
- - -

TTF/OTF - TrueType and OpenType font support

[Table] [Single feat]  -

Visual

-

Windsong font

-
OTF font test
- -

Visual

-

Windsong font

-
TTF font test
- - -

WOFF - Web Open Font Format

[Table] [Single feat]  -

Visual

-

Windsong font

-
- - -

Progress & Meter

[Table] [Single feat]  -

Visual

-fail -fail -

Progress and meter widgets at 50%

- - -

Datalist element

[Table] [Single feat]  -

Interact

- - - - -

Show "foo" and "foobar" as options when "f" is entered

- - -

Form validation

[Table] [Single feat]  -

Interact

Form should show warning and NOT submit

- - -

MPEG-4/H.264 video format

[Table] [Single feat]  -

Auto

- -

Interact

Video, no MIME, no type attribute.
- -

Interact

Video with source element
- -

Interact

Video with source element and MIME set
- - -

Ogg/Theora video format

[Table] [Single feat]  -

Auto

- -

Interact

Video, no MIME, no type attribute.
- -

Interact

Video with source element and MIME set
- -

Interact

Video with source element
- - -

WebM/VP8 video format

[Table] [Single feat]  -

Auto

- -

Interact

Video, no MIME, no type attribute.
- -

Interact

Video with source element
- -

Interact

Video with source element and MIME set
- - -

Animated PNG (APNG) [unoff]

[Table] [Single feat]  -

Auto

Test for second frame using Canvas element
- -

Visual

Must animate

- - -

CSS Canvas Drawings [unoff]

[Table] [Single feat] -pre- -

Auto

'getCSSCanvasContext' in document
- - -

CSS Reflections [unoff]

[Table] [Single feat] -pre- -

Auto (m)

Modernizr test for: "cssreflections"
- - -

Visual-square

- -
-
- -
- - - -

Web SQL Database [unoff]

[Table] [Single feat]  -

Auto (m)

Modernizr test for: "websqldatabase"
- - -

Stream API [unoff]

[Table] [Single feat]  -

Auto

Test for "getUserMedia" in navigator object
- - -

CSS Masks [unoff]

[Table] [Single feat] -pre- -

Visual

-
- -
mask-image: url(caniuse_files/alpha.png);
- - -

CSS3 Text-overflow [unoff]

[Table] [Single feat]  -

Visual

- -
-abcdefghijklmnopqrstuvwxyz -

Should end with ellipsis

text-overflow: ellipsis;
- - -

CSS text-stroke [unoff]

[Table] [Single feat] -pre- -

Visual

- -
-green stroked text -
text-stroke: 2px lime;
- - -

EOT - Embedded OpenType fonts [unoff]

[Table] [Single feat]  -

Visual

-

Windsong font

-
- - -

XHTML+SMIL animation [unoff]

[Table] [Single feat]  - - - -

Most tests by Alexis Deveria, additional contributions by Paul Irish

- - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.eot b/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.eot deleted file mode 100644 index 768d05309f..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.eot and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.otf b/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.otf deleted file mode 100644 index 369e640959..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.otf and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.svg b/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.svg deleted file mode 100644 index b200eb52d4..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Bright Ideas Magazine - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.ttf b/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.ttf deleted file mode 100644 index 4d341921ec..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.ttf and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.woff b/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.woff deleted file mode 100644 index 1aa47d4c86..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/Windsong-webfont.woff and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/alpha.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/alpha.png deleted file mode 100644 index b7a0f35215..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/alpha.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/apng_test.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/apng_test.png deleted file mode 100644 index f359d3c0cb..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/apng_test.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/before-after.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/before-after.png deleted file mode 100644 index 7a94c4b1e5..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/before-after.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/form_validation.html b/third_party/ui/bower_components/modernizr/test/caniuse_files/form_validation.html deleted file mode 100644 index e7a060cfee..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/form_validation.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -
- - - - -
- \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/ga.js b/third_party/ui/bower_components/modernizr/test/caniuse_files/ga.js deleted file mode 100644 index 76a01b0203..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/ga.js +++ /dev/null @@ -1,43 +0,0 @@ -(function(){var k=void 0,aa=encodeURIComponent,l=String,o=Math,ba="push",ca="cookie",p="charAt",q="indexOf",da="getTime",r="toString",t="window",v="length",w="document",x="split",y="location",ea="protocol",fa="href",z="substring",A="join",C="toLowerCase";var ga="_gat",ha="_gaq",ia="4.9.4",ja="_gaUserPrefs",ka="ioo",D="&",E="=",F="__utma=",H="__utmb=",la="__utmc=",ma="__utmk=",I="__utmv=",J="__utmz=",na="__utmx=",oa="GASO=";var pa=function(){var d=this,f=[],b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";d.set=function(b){f[b]=!0};d.Sc=function(){for(var d=[],e=0;e=0};b.Xc=function(){return b.Jb("Firefox")&&![].reduce};b.Vc=function(){return L[t][ja]};b.Gc=function(){return L[t].external};b.Hc=function(){return L[t].performance||L[t].webkitPerformance};b.Ic=function(){return L[t].top==L[t]};b.Ya=function(b){var e=L[t]&&L[t].gaGlobal;if(b&&!e)e={},L[t].gaGlobal=e;return e};b.ec=function(b){L[w][y].href=b};b.qb= -function(d){if(!d||!b.Jb("Firefox"))return d;for(var d=d.replace(/\n|\r/g," "),e=0,f=d[v];e-1&&(b=d[q](b,e),b<0&&(b=d[v]),h=d[z](e+f[q](E)+1,b)));return h},xa=function(d){var f=!1,b=0,h,e;if(!M(d)){f= -!0;for(h=0;h-1)}return f},P=function(d,f){var b=aa;return b instanceof Function?f?encodeURI(d):b(d):(K(68),escape(d))},Q=function(d,f){var b=decodeURIComponent,h,d=d[x]("+")[A](" ");if(b instanceof Function)try{h=f?decodeURI(d):b(d)}catch(e){K(17),h=unescape(d)}else K(68),h=unescape(d);return h},R=function(d,f){return d[q](f)>-1}; -function ya(d){if(!d||""==d)return"";for(;d[p](0)[v]>0&&" \n\r\t"[q](d[p](0))>-1;)d=d[z](1);for(;d[p](d[v]-1)[v]>0&&" \n\r\t"[q](d[p](d[v]-1))>-1;)d=d[z](0,d[v]-1);return d}var T=function(d,f){d[ba]||K(94);d[d[v]]=f},za=function(d){var f=1,b=0,h;if(!M(d)){f=0;for(h=d[v]-1;h>=0;h--)b=d.charCodeAt(h),f=(f<<6&268435455)+b+(b<<14),b=f&266338304,f=b!=0?f^b>>21:f}return f},Aa=function(){return o.round(o.random()*2147483647)},Ba=function(){};var Ca=function(d,f){this.ib=d;this.jb=f},Da=function(){function d(b){for(var d=[],b=b[x](","),e,f=0;f0&&(i=i[x]("^")[0]);b=i[x](":");i=b[1];d=parseInt(b[0],10);!j&&d0?h(b):"";m.o&&(c=e.Oc(L[w][ca],a,m.o,c,b),a="2"+a,j=b>0?h(m.s):"");a+=c;a=L.qb(a);a[v]>2E3&&(K(69),a=a[z](0,2E3));j=a+"; path="+m.f+"; "+j+e.hb();if(!V.pb())L[w].cookie=j};e.Oc=function(a,c,d,j,i){var g="",i=i||m.s,j=b([j,e.m+i*1],d),g=N(a,"2"+c,";");if(!M(g))return a=b(f(a,c,d,!0),d),g=g[x](a)[A](""),g=j+g;return j};e.hb=function(){return M(m.b)?"":"domain="+ -m.b+";"}};var Fa=function(d){function f(a){a=ua(a)?a[A]("."):"";return M(a)?"-":a}function b(a,c){var n=[],b;if(!M(a)&&(n=a[x]("."),c))for(b=0;b')}catch(m){e=h.createElement("iframe"),e.name=f}e.height="0";e.width="0";e.style.display="none";e.style.visibility="hidden";var g=h[y], -g=g[ea]+"//"+g.host+"/favicon.ico",g=Ga+"u/post_iframe.html#"+aa(g),a=function(){e.src="";e.parentNode&&e.parentNode.removeChild(e)};ta(L[t],"beforeunload",a);var c=!1,u=0,j=function(){if(!c){try{if(u>9||e.contentWindow[y].host==h[y].host){c=!0;a();var d=L[t],g="beforeunload",n=a;d.removeEventListener?d.removeEventListener(g,n,!1):d.detachEvent&&d.detachEvent("on"+g,n);b&&b();return}}catch(f){}u++;L.setTimeout(j,200)}};ta(e,"load",j);h.body.appendChild(e);e.src=g}else L.setTimeout(function(){d.Ob(f, -b)},100)}};var Ka=function(d){var f=this,b=d,h=new Fa(b),e=null,m=!V.pb(),g=function(){};f.Uc=function(){return"https:"==L[w][y][ea]?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif"};f.A=function(a,c,d,j,i,s){e||(e=new Ja);var n=b.B,O=L[w][y];h.Z(d);var B=h.z()[x](".");if(B[1]<500||j){if(i){var S=(new Date)[da](),X;X=(S-B[3])*(b.Ac/1E3);X>=1&&(B[2]=o.min(o.floor(B[2]*1+X),b.zc),B[3]=S)}if(j||!i||B[2]>=1){!j&&i&&(B[2]=B[2]*1-1);j=B[1]*1+1;B[1]=j;i="utmwv="+ia;S="&utms="+ -j;X="&utmn="+Aa();j=i+"e"+S+X;a=i+S+X+(M(O.hostname)?"":"&utmhn="+P(O.hostname))+(b.L==100?"":"&utmsp="+P(b.L))+a;if(0==n||2==n)O=2==n?g:s||g,m&&e.Bb(b.ga,a,j,O,!0);if(1==n||2==n)c="&utmac="+c,j+=c,a+=c+"&utmcc="+f.Tc(d),V.Ab&&(d="&aip=1",j+=d,a+=d),a+="&utmu="+qa.Sc(),m&&e.Bb(f.Uc(),a,j,s)}}h.$(B[A]("."));h.aa()};f.Tc=function(a){for(var c=[],b=[F,J,I,na],d=h.g(),i,g=0;g0)for(b=0;b0;)d+=a--^c++;return za(d)}};var Z=function(d,f,b,h){function e(a){var c="",c=a[x]("://")[1][C]();R(c,"/")&&(c=c[x]("/")[0]);return c}var m=h,g=this;g.a=d;g.ob=f;g.m=b;g.mb=function(a){var c=g.ua();return new Z.v(N(a,m.Ea+E,D),N(a,m.Ha+E,D),N(a,m.Ja+E,D),g.R(a,m.Ca,"(not set)"),g.R(a,m.Fa,"(not set)"),g.R(a,m.Ia,c&&!M(c.G)?Q(c.G):k),g.R(a,m.Da,k),N(a,m.vc+E,D))};g.nb=function(a){var c=e(a),b;b=a;var d="";b=b[x]("://")[1][C]();R(b,"/")&&(b=b[x]("/")[1],R(b,"?")&&(d=b[x]("?")[0]));b=d;if(R(c,"google")&&(a=a[x]("?")[A](D),R(a,D+ -m.xc+E)&&b==m.wc))return!0;return!1};g.ua=function(){var a,c=g.ob,b,d=m.J;if(!M(c)&&"0"!=c&&R(c,"://")&&!g.nb(c)){a=e(c);for(var i=0;i9?h[z](n+1)*1:0,f++,h=0==h?1:h,a.ra([B,g.m,h,f,e.H()][A](".")),a.sa()}}}}; -Z.v=function(d,f,b,h,e,m,g,a){var c=this;c.q=d;c.Q=f;c.ya=b;c.n=h;c.P=e;c.G=m;c.Gb=g;c.xa=a;c.H=function(){var a=[],b=[["cid",c.q],["csr",c.Q],["gclid",c.ya],["ccn",c.n],["cmd",c.P],["ctr",c.G],["cct",c.Gb],["dclid",c.xa]],d,e;if(c.fb())for(d=0;d0&&b<=a.Ta){var f=P(c),h=P(d);f[v]+h[v]<=64&&(e.r[b]=[c,d,g],e.T(),n=!0)}return n};e.Zb=function(a){if((a=e.r[a])&&1===a[2])return a[1]};e.Yb=function(a){var b=e.r;b[a]&&(delete b[a],e.T())};e.Pc=function(){c.t(8);c.t(9);c.t(11);var a=e.r,b,d;for(d in a)if(b=a[d])c.j(8,d,b[0]),c.j(9,d,b[1]),(b=b[2])&&3!=b&&c.j(11,d,""+b)}};var Na=function(){function d(a,b,c,d){k==g[a]&&(g[a]={});k==g[a][b]&&(g[a][b]=[]);g[a][b][c]=d}function f(a,b,c){if(k!=g[a]&&k!=g[a][b])return g[a][b][c]}function b(a,b){if(k!=g[a]&&k!=g[a][b]){g[a][b]=k;var c=!0,d;for(d=0;d0?b+"00":"0"};b.sb=function(){var d=b.Kc();if(d==k||isNaN(d))return!1;if(d<=0)return!0;if(d>2147483648)return!1; -var a=b.rb;a.t(14);a.ia(14);var c=b.Jc(d);a.j(14,1,c)&&a.ja(14,1,d)&&b.Lc();h&&h.isValidLoadTime!=k&&h.setPageReadyTime();return!1};b.Wa=function(){if(!b.Mc())return!1;if(!L.Ic())return!1;b.sb()&&ta(L[t],"load",b.sb,!1);return!0}};var $=function(){};$.Zc=function(d){var f="gaso=",b=L[w][y].hash;d=b&&1==b[q](f)?N(b,f,D):(b=L[t].name)&&0<=b[q](f)?N(b,f,D):N(d.g(),oa,";");return d};$.ad=function(d,f){var b=(f||"www")+".google.com",b="https://"+b+"/analytics/reporting/overlay_js?gaso="+d+D+Aa(),h="_gasojs",e=L[w].createElement("script");e.type="text/javascript";e.src=b;if(h)e.id=h;(L[w].getElementsByTagName("head")[0]||L[w].getElementsByTagName("body")[0]).appendChild(e)}; -$.load=function(d,f){if(!$.$c){var b=$.Zc(f),h=b&&b.match(/^(?:\|([-0-9a-z.]{1,30})\|)?([-.\w]{10,1200})$/i);if(h)f.Dc(b),f.Ec(),V._gasoDomain=d.b,V._gasoCPath=d.f,$.ad(h[2],h[1]);$.$c=!0}};var Qa=function(d,f,b){function h(){if("auto"==j.b){var a=L[w].domain;"www."==a[z](0,4)&&(a=a[z](4));j.b=a}j.b=j.b[C]()}function e(){h();var a=j.b,b=a[q]("www.google.")*a[q](".google.")*a[q]("google.");return b||"/"!=j.f||a[q]("google.org")>-1}function m(b,c,d){if(M(b)||M(c)||M(d))return"-";b=N(b,F+a.a+".",c);M(b)||(b=b[x]("."),b[5]=""+(b[5]?b[5]*1+1:1),b[3]=b[4],b[4]=d,b=b[A]("."));return b}function g(){return"file:"!=L[w][y][ea]&&e()}var a=this,c=sa(a),u=k,j=new Da,i=!1,s=k;a.n=d;a.m=o.round((new Date)[da]()/ -1E3);a.p=f||"UA-XXXXX-X";a.ab=L[w].referrer;a.oa=k;a.d=k;a.F=!1;a.O=k;a.e=k;a.bb=k;a.pa=k;a.a=k;a.k=k;j.o=b?P(b):k;a.eb=!1;a.mc=function(){return Aa()^a.O.cc()&2147483647};a.lc=function(){if(!j.b||""==j.b||"none"==j.b)return j.b="",1;h();return j.Ua?za(j.b):1};a.kc=function(a,b){if(M(a))a="-";else{b+=j.f&&"/"!=j.f?j.f:"";var c=a[q](b),a=c>=0&&c<=8?"0":"["==a[p](0)&&"]"==a[p](a[v]-1)?"-":a}return a};a.na=function(b){var c="";c+=j.ka?a.O.dc():"";c+=j.la&&!M(L[w].title)?"&utmdt="+P(L[w].title):"";var d; -d=L.Ya(!0);if(!d.hid)d.hid=Aa();d=d.hid;c+="&utmhid="+d+"&utmr="+P(l(a.oa))+"&utmp="+P(a.pc(b));return c};a.pc=function(a){var b=L[w][y];a&&K(13);return a=k!=a&&""!=a?P(a,!0):P(b.pathname+b.search,!0)};a.uc=function(b){if(a.D()){var c="";a.e!=k&&a.e.C()[v]>0&&(c+="&utme="+P(a.e.C()));c+=a.na(b);u.A(c,a.p,a.a)}};a.jc=function(){var b=new Fa(j);return b.Z(a.a)?b.Tb():k};a.cb=c("_getLinkerUrl",52,function(b,c){var d=b[x]("#"),e=b,f=a.jc();if(f)if(c&&1>=d[v])e+="#"+f;else if(!c||1>=d[v])1>=d[v]?e+=(R(b, -"?")?D:"?")+f:e=d[0]+(R(b,"?")?D:"?")+f+"#"+d[1];return e});a.nc=function(){var b=a.m,c=a.k,d=c.g(),e=a.a+"",f=L.Ya(),g,h=R(d,F+e+"."),i=R(d,H+e),u=R(d,la+e),s,G=[],Y="",Ia=!1,d=M(d)?"":d;if(j.w&&!a.eb){g=L[w][y]&&L[w][y].hash?L[w][y][fa][z](L[w][y][fa][q]("#")):"";j.U&&!M(g)&&(Y=g+D);Y+=L[w][y].search;if(!M(Y)&&R(Y,F))c.Sb(Y),c.Ba()||c.Qb(),s=c.ba(),a.eb=!0;g=c.ea;var va=c.Pa,U=c.Sa;M(g())||(va(Q(g())),R(g(),";")||U());g=c.da;va=c.X;U=c.Y;M(g())||(va(g()),R(g(),";")||U())}M(s)?h?(s=!i||!u)?(s=m(d, -";",l(b)),a.F=!0):(s=N(d,F+e+".",";"),G=N(d,H+e,";")[x](".")):(s=[e,a.mc(),b,b,b,1][A]("."),Ia=a.F=!0):M(c.z())||M(c.ca())?(s=m(Y,D,l(b)),a.F=!0):(G=c.z()[x]("."),e=G[0]);s=s[x](".");L[t]&&f&&f.dh==e&&!j.o&&(s[4]=f.sid?f.sid:s[4],Ia&&(s[3]=f.sid?f.sid:s[4],f.vid&&(b=f.vid[x]("."),s[1]=b[0],s[2]=b[1])));c.Na(s[A]("."));G[0]=e;G[1]=G[1]?G[1]:0;G[2]=k!=G[2]?G[2]:j.Wb;G[3]=G[3]?G[3]:s[4];c.$(G[A]("."));c.Oa(e);M(c.Rb())||c.fa(c.K());c.Qa();c.aa();c.Ra()};a.oc=function(){u=new Ka(j)};a.getName=c("_getName", -58,function(){return a.n});a.c=c("_initData",2,function(){var b;if(!i){if(!a.O)a.O=new La(j.ma);a.a=a.lc();a.k=new Fa(j);a.e=new Na;s=new Ma(j,l(a.a),a.k,a.e);a.oc()}if(g()){if(!i)a.oa=a.kc(a.ab,L[w].domain),b=new Z(l(a.a),a.oa,a.m,j);a.nc(b);s.$b()}if(!i)g()&&b.Pb(a.k,a.F),a.bb=new Na,$.load(j,a.k),i=!0});a.Xa=c("_visitCode",54,function(){a.c();var b=N(a.k.g(),F+a.a+".",";"),b=b[x](".");return b[v]<4?"":b[1]});a.qd=c("_cookiePathCopy",30,function(b){a.c();a.k&&a.k.Ub(a.a,b)});a.D=function(){return a.Xa()% -1E40&&(f=g[z](0,a),g=g[z](a+1));var c=f==ga?V:f==ha?Sa:V.Hb(f);c[g].apply(c,b[e].slice(1))}}catch(u){d++}return d}};var V=new Ra;var Ua=L[t][ga];Ua&&typeof Ua._getTracker=="function"?V=Ua:L[t][ga]=V;var Sa=new Ta;a:{var Va=L[t][ha],Wa=!1;if(Va&&typeof Va[ba]=="function"&&(Wa=ua(Va),!Wa))break a;L[t][ha]=Sa;Wa&&Sa[ba].apply(Sa,Va)};})(); diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/green5x5.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/green5x5.png deleted file mode 100644 index 1825547772..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/green5x5.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/hashchange.html b/third_party/ui/bower_components/modernizr/test/caniuse_files/hashchange.html deleted file mode 100644 index ad95f69802..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/hashchange.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - hashchange test - - - - - diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/jquery.min.js b/third_party/ui/bower_components/modernizr/test/caniuse_files/jquery.min.js deleted file mode 100644 index b2ac1747f3..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/jquery.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu May 12 15:04:36 2011 -0400 - */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem -)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml.html b/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml.html deleted file mode 100644 index 8203884ceb..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - Untitled - - - - - k - = - - - - - - - 2 - - z - - - - - x - 2 - - - - - - - - 2 - - z - - - - - y - 2 - - - - - - - - ( - - - - - 2 - - z - - - - x - - y - - - ) - - 2 - - - - - - ( - 1 - + - - - ( - - - - z - - - - x - - - ) - - 2 - - + - - - ( - - - - z - - - - y - - - ) - - 2 - - ) - - 2 - - - - - - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml_ref.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml_ref.png deleted file mode 100644 index 1633e58db6..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/mathml_ref.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/modernizr-1.7.min.js b/third_party/ui/bower_components/modernizr/test/caniuse_files/modernizr-1.7.min.js deleted file mode 100644 index 6f54850c01..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/modernizr-1.7.min.js +++ /dev/null @@ -1,2 +0,0 @@ -// Modernizr v1.7 www.modernizr.com -window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c - - - - popstate event test - - - - - - - diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/red30x30.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/red30x30.png deleted file mode 100644 index 561c8d2d8b..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/red30x30.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/ruby.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/ruby.png deleted file mode 100644 index 4fe06dd37a..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/ruby.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/stroked-text.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/stroked-text.png deleted file mode 100644 index e75890faa5..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/stroked-text.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/style.css b/third_party/ui/bower_components/modernizr/test/caniuse_files/style.css deleted file mode 100644 index d90731bc55..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/style.css +++ /dev/null @@ -1,168 +0,0 @@ -body { - font-family: "Lucida Grande", Lucida, Verdana, sans-serif; - font-size: 12px; -} - -a { - text-decoration: none; -} -a:hover { - text-decoration: underline; -} - -table, tr, th, td { - border: 1px solid #AAA; -} - -table { - margin-top: 1em; - width: 100%; -} - -tbody th { - text-align: left; - font-size: 14px; - width: 200px; -} - -th h3 { - margin: 3px; - font-size: 12px; -} - -th span.links { - font-size: 10px; -} - -dt { - font-weight: bold; -} - -tr:hover > th, -tr:hover > td + td { background-color: #FFC; } - -div.test_wrap { - display: -moz-inline-stack; - display: inline-block; - border: 1px solid #CCC; - text-align: center; - vertical-align: top; - min-height: 50px; - margin-right: 5px; - background: white; - position: relative; -} - -div.test_wrap h3 { - text-align: center; - margin: 2px; - font-size: 10px; -} - -div.auto { - display: -moz-inline-stack; - display: inline-block; - border: 1px solid; - width: 30px; - height: 30px; -} - -div.square { - display: -moz-inline-stack; - display: inline-block; - border: 1px solid; - width: 30px; - height: 30px; - background: red; -} - -div.info { - display: none; - position: absolute; - top: 100%; - z-index: 2; - left: 0; - background: white; - padding: 2px; - min-width: 300px; - border: 1px solid; - text-align: left; -} - -div.test_wrap:hover > div.info { - display: block; -} - - -div.vis_test { - display: -moz-inline-stack; - display: inline-block; -} - -div.vis_ref { - display: -moz-inline-stack; - display: inline-block; - border-left: 1px dashed black; - margin-left: 5px; - padding-left: 5px; - vertical-align: top; -} - -p.condition { - font-style: italic; - margin: 2px; - clear: both; -} - -.pass { - background: lime; -} - -.fail { - background: red; -} - -.partial { - background: yellow; -} - -.unknown { - background: #aaa; -} - -.current span { - border-radius: 6px; - -moz-border-radius: 6px; - background: none repeat scroll 0 0 #E6EA69; - color: black; - float: right; - font-size: 8px; - padding: 0 1px; -} - -#intro, #options { - width: 400px; - background: #EEE; - border-radius: 10px; - padding: 5px 10px; - margin: 10px; - float: left; -} - -#intro dt::after { - content: ':'; -} - -#intro dd { - margin-bottom: 1em; -} - -#opt_submit { - display: block; - margin: 10px; -} - -#options label { - display: block; - margin: 5px; -} \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-html-blur.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-html-blur.png deleted file mode 100644 index 549b29757a..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-html-blur.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg b/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg deleted file mode 100644 index c0a867f987..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg.1 b/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg.1 deleted file mode 100644 index c0a867f987..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg-img.svg.1 +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg_blur.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/svg_blur.png deleted file mode 100644 index 17cb6e3a8d..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/svg_blur.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/table.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/table.png deleted file mode 100644 index e9b9b9d772..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/table.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow1.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow1.png deleted file mode 100644 index 47b3ceaf08..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow1.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow2.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow2.png deleted file mode 100644 index f335189c4c..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/text-shadow2.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/windsong_font.png b/third_party/ui/bower_components/modernizr/test/caniuse_files/windsong_font.png deleted file mode 100644 index b983d2acab..0000000000 Binary files a/third_party/ui/bower_components/modernizr/test/caniuse_files/windsong_font.png and /dev/null differ diff --git a/third_party/ui/bower_components/modernizr/test/caniuse_files/xhtml.html b/third_party/ui/bower_components/modernizr/test/caniuse_files/xhtml.html deleted file mode 100644 index af4be89eff..0000000000 --- a/third_party/ui/bower_components/modernizr/test/caniuse_files/xhtml.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Untitled - -

true

- - - \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/index.html b/third_party/ui/bower_components/modernizr/test/index.html deleted file mode 100644 index 587f0c87e4..0000000000 --- a/third_party/ui/bower_components/modernizr/test/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Modernizr Test Suite - - - - - - - - - - - - - - - - - - - - - - - - -

Modernizr Test Suite

-

-
-

- -
    - -
    -
    - - -
    - -
    - - - - -
    JSON.stringify(Modernizr)
    - - Show the Ref Tests from Caniuse and Modernizr - - - - - - - - diff --git a/third_party/ui/bower_components/modernizr/test/js/basic.html b/third_party/ui/bower_components/modernizr/test/js/basic.html deleted file mode 100644 index 9f378a9601..0000000000 --- a/third_party/ui/bower_components/modernizr/test/js/basic.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Modernizr Test Suite - - - - - - - - - - - - - - - - - - -

    Modernizr Test Suite

    -

    -
    -

    - -
      - -
      -
      - - -
      - -
      - - - - diff --git a/third_party/ui/bower_components/modernizr/test/js/dumpdata.js b/third_party/ui/bower_components/modernizr/test/js/dumpdata.js deleted file mode 100644 index 43c667b760..0000000000 --- a/third_party/ui/bower_components/modernizr/test/js/dumpdata.js +++ /dev/null @@ -1,75 +0,0 @@ -function dumpModernizr(){ - var str = ''; - dumpModernizr.old = dumpModernizr.old || {}; - - for (var prop in Modernizr) { - - // skip previously done ones. - if (dumpModernizr.old[prop]) continue; - else dumpModernizr.old[prop] = true; - - if (typeof Modernizr[prop] === 'function') continue; - // skip unit test items - if (/^test/.test(prop)) continue; - - if (~TEST.inputs.indexOf(prop)) { - str += '
    1. '+prop+'{}
        '; - for (var field in Modernizr[prop]) { - str += '
      • ' + field + ': ' + Modernizr[prop][field] + '
      • '; - } - str += '
    2. '; - } else { - str += '
    3. ' + prop + ': ' + Modernizr[prop] + '
    4. '; - } - } - return str; -} - - -function grabFeatDetects(){ - // thx github.js - $.getScript('https://api.github.com/repos/Modernizr/Modernizr/git/trees/master?recursive=1&callback=processTree'); -} - - -function processTree(data){ - var filenames = []; - - for (var i = 0; i < data.data.tree.length; i++){ - var file = data.data.tree[i]; - var match = file.path.match(/^feature-detects\/(.*)/); - if (!match) continue; - - var relpath = location.host == "modernizr.github.com" ? - '../modernizr-git/' : '../'; - - filenames.push(relpath + match[0]); - } - - var jqxhrs = filenames.map(function(filename){ - return jQuery.getScript(filename); - }); - - jQuery.when.apply(jQuery, jqxhrs).done(resultsToDOM); - -} - -function resultsToDOM(){ - - var modOutput = document.createElement('div'), - ref = document.getElementById('qunit-testresult') || document.getElementById('qunit-tests'); - - modOutput.className = 'output'; - modOutput.innerHTML = dumpModernizr(); - - ref.parentNode.insertBefore(modOutput, ref); - - // Modernizr object as text - document.getElementsByTagName('textarea')[0].innerHTML = JSON.stringify(Modernizr); - -} - -/* uno */ resultsToDOM(); -/* dos */ grabFeatDetects(); -/* tres */ setTimeout(resultsToDOM, 5e3); -/* quatro */ setTimeout(resultsToDOM, 15e3); diff --git a/third_party/ui/bower_components/modernizr/test/js/lib/detect-global.js b/third_party/ui/bower_components/modernizr/test/js/lib/detect-global.js deleted file mode 100644 index 48b4ac244c..0000000000 --- a/third_party/ui/bower_components/modernizr/test/js/lib/detect-global.js +++ /dev/null @@ -1,153 +0,0 @@ -// https://github.com/kangax/detect-global - -// tweaked to run without a UI. - -(function () { - function getPropertyDescriptors(object) { - var props = { }; - for (var prop in object) { - - // nerfing for firefox who goes crazy over some objects like sessionStorage - try { - - props[prop] = { - type: typeof object[prop], - value: object[prop] - }; - - } catch(e){ - props[prop] = {}; - } - } - return props; - } - - function getCleanWindow() { - var elIframe = document.createElement('iframe'); - elIframe.style.display = 'none'; - - var ref = document.getElementsByTagName('script')[0]; - ref.parentNode.insertBefore(elIframe, ref); - - elIframe.src = 'about:blank'; - return elIframe.contentWindow; - } - - function appendControl(el, name) { - var elCheckbox = document.createElement('input'); - elCheckbox.type = 'checkbox'; - elCheckbox.checked = true; - elCheckbox.id = '__' + name; - - var elLabel = document.createElement('label'); - elLabel.htmlFor = '__' + name; - elLabel.innerHTML = 'Exclude ' + name + ' properties?'; - elLabel.style.marginLeft = '0.5em'; - - var elWrapper = document.createElement('p'); - elWrapper.style.marginBottom = '0.5em'; - - elWrapper.appendChild(elCheckbox); - elWrapper.appendChild(elLabel); - - el.appendChild(elWrapper); - } - - function appendAnalyze(el) { - var elAnalyze = document.createElement('button'); - elAnalyze.id = '__analyze'; - elAnalyze.innerHTML = 'Analyze'; - elAnalyze.style.marginTop = '1em'; - el.appendChild(elAnalyze); - } - - function appendCancel(el) { - var elCancel = document.createElement('a'); - elCancel.href = '#'; - elCancel.innerHTML = 'Cancel'; - elCancel.style.cssText = 'color:#eee;margin-left:0.5em;'; - elCancel.onclick = function() { - el.parentNode.removeChild(el); - return false; - }; - el.appendChild(elCancel); - } - - function initConfigPopup() { - var el = document.createElement('div'); - - el.style.cssText = 'position:fixed; left:10px; top:10px; width:300px; background:rgba(50,50,50,0.9);' + - '-moz-border-radius:10px; padding:1em; color: #eee; text-align: left;' + - 'font-family: "Helvetica Neue", Verdana, Arial, sans serif; z-index: 99999;'; - - for (var prop in propSets) { - appendControl(el, prop); - } - - appendAnalyze(el); - appendCancel(el); - - var ref = document.getElementsByTagName('script')[0]; - ref.parentNode.insertBefore(el, ref); - } - - function getPropsCount(object) { - var count = 0; - for (var prop in object) { - count++; - } - return count; - } - - function shouldDeleteProperty(propToCheck) { - for (var prop in propSets) { - var elCheckbox = document.getElementById('__' + prop); - var isPropInSet = propSets[prop].indexOf(propToCheck) > -1; - if (isPropInSet && (elCheckbox ? elCheckbox.checked : true) ) { - return true; - } - } - } - - function analyze() { - var global = (function(){ return this; })(), - globalProps = getPropertyDescriptors(global), - cleanWindow = getCleanWindow(); - - for (var prop in cleanWindow) { - if (globalProps[prop]) { - delete globalProps[prop]; - } - } - for (var prop in globalProps) { - if (shouldDeleteProperty(prop)) { - delete globalProps[prop]; - } - } - - window.__globalsCount = getPropsCount(globalProps); - window.__globals = globalProps; - - window.console && console.log('Total number of global properties: ' + __globalsCount); - window.console && console.dir(__globals); - } - - var propSets = { - 'Prototype': '$$ $A $F $H $R $break $continue $w Abstract Ajax Class Enumerable Element Field Form ' + - 'Hash Insertion ObjectRange PeriodicalExecuter Position Prototype Selector Template Toggle Try'.split(' '), - - 'Scriptaculous': 'Autocompleter Builder Control Draggable Draggables Droppables Effect Sortable SortableObserver Sound Scriptaculous'.split(' '), - 'Firebug': 'loadFirebugConsole console _getFirebugConsoleElement _FirebugConsole _FirebugCommandLine _firebug'.split(' '), - 'Mozilla': 'Components XPCNativeWrapper XPCSafeJSObjectWrapper getInterface netscape GetWeakReference GeckoActiveXObject'.split(' '), - 'GoogleAnalytics': 'gaJsHost gaGlobal _gat _gaq pageTracker'.split(' '), - 'lazyGlobals': 'onhashchange'.split(' ') - }; - - // initConfigPopup(); // disable because we're going UI-less. - - var analyzeElem = document.getElementById('__analyze'); - analyzeElem && (analyzeElem.onclick = analyze); - - analyze(); // and assign total added globals to window.__globalsCount - -})(); \ No newline at end of file diff --git a/third_party/ui/bower_components/modernizr/test/js/lib/jquery-1.7b2.js b/third_party/ui/bower_components/modernizr/test/js/lib/jquery-1.7b2.js deleted file mode 100644 index 98c6d0df5b..0000000000 --- a/third_party/ui/bower_components/modernizr/test/js/lib/jquery-1.7b2.js +++ /dev/null @@ -1,9279 +0,0 @@ -/*! - * jQuery JavaScript Library v1.7b2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Oct 13 21:12:55 2011 -0400 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7b2", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNumeric: function( obj ) { - return obj != null && rdigit.test( obj ) && !isNaN( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return (new Function( "return " + data ))(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return (new Date()).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -// Expose jQuery as an AMD module, but only for AMD loaders that -// understand the issues with loading multiple versions of jQuery -// in a page that all might call define(). The loader will indicate -// they have special allowances for multiple jQuery versions by -// specifying define.amd.jQuery = true. Register as a named module, -// since jQuery can be concatenated with other files that may use define, -// but not use a proper concatenation script that understands anonymous -// AMD modules. A named AMD is safest and most robust way to register. -// Lowercase jquery is used because AMD module names are derived from -// file names, and jQuery is normally delivered in a lowercase file name. -if ( typeof define === "function" && define.amd && define.amd.jQuery ) { - define( "jquery", [], function () { return jQuery; } ); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!memory; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var div = document.createElement( "div" ), - documentElement = document.documentElement, - all, - a, - select, - opt, - input, - marginDiv, - support, - fragment, - body, - testElementParent, - testElement, - testElementStyle, - tds, - events, - eventName, - i, - isSupported, - offsetSupport; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
      a"; - - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName( "tbody" ).length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName( "link" ).length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure unknown elements (like HTML5 elems) are handled appropriately - unknownElems: !!div.getElementsByTagName( "nav" ).length, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.firstChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - div.innerHTML = ""; - - // Figure out if the W3C box model works as expected - div.style.width = div.style.paddingLeft = "1px"; - - // We don't want to do body-related feature tests on frameset - // documents, which lack a body. So we use - // document.getElementsByTagName("body")[0], which is undefined in - // frameset documents, while document.body isn’t. (7398) - body = document.getElementsByTagName("body")[ 0 ]; - // We use our own, invisible, body unless the body is already present - // in which case we use a div (#9239) - testElement = document.createElement( body ? "div" : "body" ); - testElementStyle = { - visibility: "hidden", - width: 0, - height: 0, - border: 0, - margin: 0, - background: "none" - }; - if ( body ) { - jQuery.extend( testElementStyle, { - position: "absolute", - left: "-999px", - top: "-999px" - }); - } - for ( i in testElementStyle ) { - testElement.style[ i ] = testElementStyle[ i ]; - } - testElement.appendChild( div ); - testElementParent = body || documentElement; - testElementParent.insertBefore( testElement, testElementParent.firstChild ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - support.boxModel = div.offsetWidth === 2; - - if ( "zoom" in div.style ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
      "; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.innerHTML = "
      t
      "; - tds = div.getElementsByTagName( "td" ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE < 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( document.defaultView && document.defaultView.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Remove the body element we added - testElement.innerHTML = ""; - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - } ) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - // Determine fixed-position support early - testElement.style.position = "static"; - testElement.style.top = "0px"; - testElement.style.marginTop = "1px"; - offsetSupport = (function( body, container ) { - - var outer, inner, table, td, supports, - bodyMarginTop = parseFloat( body.style.marginTop ) || 0, - ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", - style = "style='" + ptlm + "border:5px solid #000;padding:0;'", - html = "
      " + - "" + - "
      "; - - container.style.cssText = ptlm + "border:0;visibility:hidden"; - - container.innerHTML = html; - body.insertBefore( container, body.firstChild ); - outer = container.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - supports = { - doesNotAddBorder: (inner.offsetTop !== 5), - doesAddBorderForTableAndCells: (td.offsetTop === 5) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - supports.supportsFixedPosition = (inner.offsetTop === 20 || inner.offsetTop === 15); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - supports.subtractsBorderForOverflowNotVisible = (inner.offsetTop === -5); - supports.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); - - return supports; - - })( testElement, div ); - - jQuery.extend( support, offsetSupport ); - testElementParent.removeChild( testElement ); - - // Null connected elements to avoid leaks in IE - testElement = fragment = select = opt = body = marginDiv = div = input = null; - - return support; -})(); - -// Keep track of boxModel -jQuery.boxModel = jQuery.support.boxModel; - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; - } else { - id = jQuery.expando; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should - // not attempt to inspect the internal events object using jQuery.data, as this - // internal data object is undocumented and subject to change. - if ( name === "events" && !thisCache[name] ) { - return thisCache[ internalKey ] && thisCache[ internalKey ].events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support space separated names - if ( jQuery.isArray( name ) ) { - name = name; - } else if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } else { - elem[ jQuery.expando ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, attr, name, - data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { - attr = this[0].attributes; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - jQuery._data( this[0], "parsedAttrs", true ); - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var $this = jQuery( this ), - args = [ parts[0], value ]; - - $this.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - $this.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = (type || "fx") + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = (type || "fx") + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - runner = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", runner ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, runner ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, runner ) { - var timeout = setTimeout( next, time ); - runner.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = (value || "").split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return undefined; - } - - var isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( !("getAttribute" in elem) ) { - return jQuery.prop( elem, name, value ); - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // Normalize the name if needed - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || (rboolean.test( name ) ? boolHook : nodeHook); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return undefined; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, - i = 0; - - if ( elem.nodeType === 1 ) { - attrNames = (value || "").split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ].toLowerCase(); - - // See #9699 for explanation of this approach (setting first, then removal) - jQuery.attr( elem, name, "" ); - elem.removeAttribute( name ); - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { - elem[ propName ] = false; - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return (elem[ name ] = value); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !jQuery.support.getSetAttribute ) { - - fixSpecified = { - name: true, - id: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && (fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return (ret.nodeValue = value + ""); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return (elem.style.cssText = "" + value); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); - } - } - }); -}); - - - - -var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspaces = / /g, - rescape = /[^\w\s.|`]/g, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /\bhover(\.\S+)?/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rquickIs = /^([\w\-]+)?(?:#([\w\-]+))?(?:\.([\w\-]+))?(?:\[([\w+\-]+)=["']?([\w\-]*)["']?\])?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 4 5 - // [ _, tag, id, class, attrName, attrValue ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "\\b" + quick[3] + "\\b" ); - } - return quick; - }, - quickIs = function( elem, m ) { - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || elem.id === m[2]) && - (!m[3] || m[3].test( elem.className )) && - (!m[4] || elem.getAttribute( m[4] ) == m[5]) - ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.replace( rhoverHack, "mouseover$1 mouseout$1" ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = (tns[2] || "").split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - namespace: namespaces.join(".") - }, handleObjIn ); - - // Delegated event; pre-analyze selector so it's processed quickly on event dispatch - if ( selector ) { - handleObj.quick = quickParse( selector ); - if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) { - handleObj.isPositional = true; - } - } - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // For removal, types can be an Event object - if ( types && types.type && types.handler ) { - handler = types.handler; - types = types.type; - selector = types.selector; - } - - // Once for each type.namespace in types; type may be omitted - types = (types || "").replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - namespaces = namespaces? "." + namespaces : ""; - for ( j in events ) { - jQuery.event.remove( elem, j + namespaces, handler, selector ); - } - return; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Only need to loop for special events or selective removal - if ( handler || namespaces || selector || special.remove ) { - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( !handler || handler.guid === handleObj.guid ) { - if ( !namespaces || namespaces.test( handleObj.namespace ) ) { - if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - } - } - } else { - // Removing all events - eventType.length = 0; - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // triggerHandler() and global events don't bubble or run the default action - if ( onlyHandlers || !elem ) { - event.preventDefault(); - } - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - event.stopPropagation(); - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - old = null; - for ( cur = elem.parentNode; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length; i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = (jQuery._data( cur, "events" ) || {})[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) ) { - handle.apply( cur, data ); - } - - if ( event.isPropagationStopped() ) { - break; - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.call( elem.ownerDocument, event, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - handle: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - handlerQueue = [], - i, cur, selMatch, matches, handleObj, sel, hit, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - - // Determine handlers that should run if there are delegated events - // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - selMatch = {}; - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - hit = selMatch[ sel ]; - - if ( handleObj.isPositional ) { - // Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/ - hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0; - } else if ( hit === undefined ) { - hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) ); - } - if ( hit ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - - // Copy the remaining (bound) handlers in case they're changed - handlers = handlers.slice( delegateCount ); - - // Run delegates first; they may want to stop propagation beneath us - event.delegateTarget = this; - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - dispatch( matched.elem, event, matched.matches, args ); - } - delete event.delegateTarget; - - // Run non-delegated handlers for this level - if ( handlers.length ) { - dispatch( this, event, handlers, args ); - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement layerX layerY offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - focus: { - delegateType: "focusin", - noBubble: true - }, - blur: { - delegateType: "focusout", - noBubble: true - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.handle.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Run jQuery handler functions; called from jQuery.event.handle -function dispatch( target, event, handlers, args ) { - var run_all = !event.exclusive && !event.namespace, - specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle, - j, handleObj, ret; - - event.currentTarget = target; - for ( j = 0; j < handlers.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = handlers[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handleObj.handler; - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( specialHandle || handleObj.handler ).apply( target, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } -} - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - oldType, ret; - - // For a real mouseover/out, always call the handler; for - // mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) { - oldType = event.type; - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = oldType; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - // Form was submitted, bubble the event up the tree - if ( this.parentNode ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - jQuery.event.remove( event.delegateTarget || this, event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on.call( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault ) { - // ( event ) native or jQuery.Event - return this.off( types.type, types.handler, types.selector ); - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.bind( name, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

      "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
      "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ), - // The variable 'args' was introduced in - // https://github.com/jquery/jquery/commit/52a0238 - // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. - // http://code.google.com/p/v8/issues/detail?id=1050 - args = slice.call(arguments); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, args.join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var nodeNames = ( - "abbr article aside audio canvas datalist details figcaption figure footer " + - "header hgroup mark meter nav output progress section summary time video" - ).split( " " ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( nodeNames.length ) { - safeFrag.createElement( - nodeNames.pop() - ); - } - } - return safeFrag; -} - -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /", "" ], - legend: [ 1, "
      ", "
      " ], - thead: [ 1, "", "
      " ], - tr: [ 2, "", "
      " ], - td: [ 3, "", "
      " ], - col: [ 2, "", "
      " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and ``` - -Add the module as a dependency to your app - -```js -var app = angular.module('yourAwesomeApp', ['ngLodash']); -``` - -And inject it into your controller like so! - -```js -var YourCtrl = app.controller('yourController', function($scope, lodash) { - lodash.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 }); -}); -``` - -## Developing - -To help us develop this module, we are using Grunt some tasks that may be -helpful for you to know about are: - -### Testing - -This command will run JSHint and JSCS testing JS Files (note files within build) -are not tested, it will also run your local build of the module with all of the -Karma tests: - -```grunt test``` it can also be run by using ```npm test``` - -### Build - -This command will build the module, run it through ngMin and then create a -minified version of the module, ready for distribution: - -```grunt build``` - -### Dist - -This command will build the module initially and then run the test suite. -Testing with JSHint, JSCS and Karma: - -```grunt dist``` diff --git a/third_party/ui/bower_components/ng-lodash/bower.json b/third_party/ui/bower_components/ng-lodash/bower.json deleted file mode 100644 index f818282757..0000000000 --- a/third_party/ui/bower_components/ng-lodash/bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "ng-lodash", - "version": "0.2.0", - "description": "An Angular module wrapper for lodash", - "author": ["Rockabox (http://www.rockabox.com)"], - "license": "MIT", - "keywords": [ - "nglodash", - "angular", - "lodash" - ], - "ignore": [ - "test", - "*.", - "karma.conf.js", - "Gruntfile.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/rockabox/ng-lodash.git" - }, - "main": [ - "build/ng-lodash.js" - ], - "dependencies": { - "angular": ">=1.2" - }, - "devDependencies": { - "angular-mocks": ">=1.2" - } -} diff --git a/third_party/ui/bower_components/ng-lodash/build/ng-lodash.js b/third_party/ui/bower_components/ng-lodash/build/ng-lodash.js deleted file mode 100644 index d5e11a0e5d..0000000000 --- a/third_party/ui/bower_components/ng-lodash/build/ng-lodash.js +++ /dev/null @@ -1,9782 +0,0 @@ -/** - * @license - * lodash 3.1.0 (Custom Build) - * Build: `lodash modern exports="amd,commonjs,node" iife="angular.module('ngLodash', []).constant('lodash', null).config(function ($provide) { %output% $provide.constant('lodash', _);});" --output build/ng-lodash.js` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -angular.module('ngLodash', []).constant('lodash', null).config([ - '$provide', - function ($provide) { - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - /** Used as the semantic version number. */ - var VERSION = '3.1.0'; - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, CURRY_FLAG = 8, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, REARG_FLAG = 128, ARY_FLAG = 256; - /** Used as default options for `_.trunc`. */ - var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; - /** Used to detect when a function becomes hot. */ - var HOT_COUNT = 150, HOT_SPAN = 16; - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 0, LAZY_MAP_FLAG = 1, LAZY_WHILE_FLAG = 2; - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; - var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, reUnescapedHtml = /[&<>"'`]/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; - /** - * Used to match ES template delimiters. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) - * for more details. - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - /** Used to detect named functions. */ - var reFuncName = /^\s*function[ \n\r\t]+\w/; - /** Used to detect hexadecimal string values. */ - var reHexPrefix = /^0[xX]/; - /** Used to detect host constructors (Safari > 5). */ - var reHostCtor = /^\[object .+?Constructor\]$/; - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - /** - * Used to match `RegExp` special characters. - * See this [article on `RegExp` characters](http://www.regular-expressions.info/characters.html#special) - * for more details. - */ - var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, reHasRegExpChars = RegExp(reRegExpChars.source); - /** Used to detect functions containing a `this` reference. */ - var reThis = /\bthis\b/; - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - /** Used to match words to create compound words. */ - var reWords = function () { - var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; - return RegExp(upper + '{2,}(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); - }(); - /** Used to detect and test for whitespace. */ - var whitespace = ' \t\x0B\f\xa0\ufeff' + '\n\r\u2028\u2029' + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'; - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', - 'ArrayBuffer', - 'Date', - 'Error', - 'Float32Array', - 'Float64Array', - 'Function', - 'Int8Array', - 'Int16Array', - 'Int32Array', - 'Math', - 'Number', - 'Object', - 'RegExp', - 'Set', - 'String', - '_', - 'clearTimeout', - 'document', - 'isFinite', - 'parseInt', - 'setTimeout', - 'TypeError', - 'Uint8Array', - 'Uint8ClampedArray', - 'Uint16Array', - 'Uint32Array', - 'WeakMap', - 'window', - 'WinRTError' - ]; - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[stringTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[mapTag] = cloneableTags[setTag] = cloneableTags[weakMapTag] = false; - /** Used as an internal `_.debounce` options object by `_.throttle`. */ - var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false - }; - /** Used to map latin-1 supplementary letters to basic latin letters. */ - var deburredLetters = { - '\xc0': 'A', - '\xc1': 'A', - '\xc2': 'A', - '\xc3': 'A', - '\xc4': 'A', - '\xc5': 'A', - '\xe0': 'a', - '\xe1': 'a', - '\xe2': 'a', - '\xe3': 'a', - '\xe4': 'a', - '\xe5': 'a', - '\xc7': 'C', - '\xe7': 'c', - '\xd0': 'D', - '\xf0': 'd', - '\xc8': 'E', - '\xc9': 'E', - '\xca': 'E', - '\xcb': 'E', - '\xe8': 'e', - '\xe9': 'e', - '\xea': 'e', - '\xeb': 'e', - '\xcc': 'I', - '\xcd': 'I', - '\xce': 'I', - '\xcf': 'I', - '\xec': 'i', - '\xed': 'i', - '\xee': 'i', - '\xef': 'i', - '\xd1': 'N', - '\xf1': 'n', - '\xd2': 'O', - '\xd3': 'O', - '\xd4': 'O', - '\xd5': 'O', - '\xd6': 'O', - '\xd8': 'O', - '\xf2': 'o', - '\xf3': 'o', - '\xf4': 'o', - '\xf5': 'o', - '\xf6': 'o', - '\xf8': 'o', - '\xd9': 'U', - '\xda': 'U', - '\xdb': 'U', - '\xdc': 'U', - '\xf9': 'u', - '\xfa': 'u', - '\xfb': 'u', - '\xfc': 'u', - '\xdd': 'Y', - '\xfd': 'y', - '\xff': 'y', - '\xc6': 'Ae', - '\xe6': 'ae', - '\xde': 'Th', - '\xfe': 'th', - '\xdf': 'ss' - }; - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': '\'', - '`': '`' - }; - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - '\'': '\'', - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - /** - * Used as a reference to the global object. - * - * The `this` value is used if it is the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = objectTypes[typeof window] && window !== (this && this.window) ? window : this; - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */ - var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { - root = freeGlobal; - } - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; - /*--------------------------------------------------------------------------*/ - /** - * The base implementation of `compareAscending` which compares values and - * sorts them in ascending order without guaranteeing a stable sort. - * - * @private - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. - * @returns {number} Returns the sort order indicator for `value`. - */ - function baseCompareAscending(value, other) { - if (value !== other) { - var valIsReflexive = value === value, othIsReflexive = other === other; - if (value > other || !valIsReflexive || typeof value == 'undefined' && othIsReflexive) { - return 1; - } - if (value < other || !othIsReflexive || typeof other == 'undefined' && valIsReflexive) { - return -1; - } - } - return 0; - } - /** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = (fromIndex || 0) - 1, length = array.length; - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - /** - * The base implementation of `_.sortBy` and `_.sortByAll` which uses `comparer` - * to define the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - /** - * Converts `value` to a string if it is not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : value + ''; - } - /** - * Used by `_.max` and `_.min` as the default callback for string values. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the code unit of the first character of the string. - */ - function charAtCallback(string) { - return string.charCodeAt(0); - } - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the first character not found in `chars`. - */ - function charsLeftIndex(string, chars) { - var index = -1, length = string.length; - while (++index < length && chars.indexOf(string.charAt(index)) > -1) { - } - return index; - } - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the last character not found in `chars`. - */ - function charsRightIndex(string, chars) { - var index = string.length; - while (index-- && chars.indexOf(string.charAt(index)) > -1) { - } - return index; - } - /** - * Used by `_.sortBy` to compare transformed elements of a collection and stable - * sort them in ascending order. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareAscending(object, other) { - return baseCompareAscending(object.criteria, other.criteria) || object.index - other.index; - } - /** - * Used by `_.sortByAll` to compare multiple properties of each element - * in a collection and stable sort them in ascending order. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultipleAscending(object, other) { - var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length; - while (++index < length) { - var result = baseCompareAscending(objCriteria[index], othCriteria[index]); - if (result) { - return result; - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - /** - * Used by `_.template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * If `fromRight` is provided elements of `array` are iterated from right to left. - * - * @private - * @param {Array} array The array to search. - * @param {number} [fromIndex] The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, index = fromRight ? fromIndex || length : (fromIndex || 0) - 1; - while (fromRight ? index-- : ++index < length) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - /** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ - function isObjectLike(value) { - return value && typeof value == 'object' || false; - } - /** - * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a - * character code is whitespace. - * - * @private - * @param {number} charCode The character code to inspect. - * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. - */ - function isSpace(charCode) { - return charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160 || charCode == 5760 || charCode == 6158 || charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279); - } - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, length = array.length, resIndex = -1, result = []; - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; - } - /** - * An implementation of `_.uniq` optimized for sorted arrays without support - * for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function sortedUniq(array, iteratee) { - var seen, index = -1, length = array.length, resIndex = -1, result = []; - while (++index < length) { - var value = array[index], computed = iteratee ? iteratee(value, index, array) : value; - if (!index || seen !== computed) { - seen = computed; - result[++resIndex] = value; - } - } - return result; - } - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. - */ - function trimmedLeftIndex(string) { - var index = -1, length = string.length; - while (++index < length && isSpace(string.charCodeAt(index))) { - } - return index; - } - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedRightIndex(string) { - var index = string.length; - while (index-- && isSpace(string.charCodeAt(index))) { - } - return index; - } - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - /*--------------------------------------------------------------------------*/ - /** - * Create a new pristine `lodash` function using the given `context` object. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'add': function(a, b) { return a + b; } }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'sub': function(a, b) { return a - b; } }); - * - * _.isFunction(_.add); - * // => true - * _.isFunction(_.sub); - * // => false - * - * lodash.isFunction(lodash.add); - * // => false - * lodash.isFunction(lodash.sub); - * // => true - * - * // using `context` to mock `Date#getTime` use in `_.now` - * var mock = _.runInContext({ - * 'Date': function() { - * return { 'getTime': getTimeMock }; - * } - * }); - * - * // or creating a suped-up `defer` in Node.js - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - function runInContext(context) { - // Avoid issues with some ES3 environments that attempt to use values, named - // after built-in constructors like `Object`, for the creation of literals. - // ES5 clears this up by stating that literals must use built-in constructors. - // See https://es5.github.io/#x11.1.5 for more details. - context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; - /** Native constructor references. */ - var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Number = context.Number, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; - /** Used for native method references. */ - var arrayProto = Array.prototype, objectProto = Object.prototype; - /** Used to detect DOM support. */ - var document = (document = context.window) && document.document; - /** Used to resolve the decompiled source of functions. */ - var fnToString = Function.prototype.toString; - /** Used to the length of n-tuples for `_.unzip`. */ - var getLength = baseProperty('length'); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - /** Used to generate unique IDs. */ - var idCounter = 0; - /** - * Used to resolve the `toStringTag` of values. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) - * for more details. - */ - var objToString = objectProto.toString; - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = context._; - /** Used to detect if a method is native. */ - var reNative = RegExp('^' + escapeRegExp(objToString).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); - /** Native method references. */ - var ArrayBuffer = isNative(ArrayBuffer = context.ArrayBuffer) && ArrayBuffer, bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice, ceil = Math.ceil, clearTimeout = context.clearTimeout, floor = Math.floor, getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, push = arrayProto.push, propertyIsEnumerable = objectProto.propertyIsEnumerable, Set = isNative(Set = context.Set) && Set, setTimeout = context.setTimeout, splice = arrayProto.splice, Uint8Array = isNative(Uint8Array = context.Uint8Array) && Uint8Array, unshift = arrayProto.unshift, WeakMap = isNative(WeakMap = context.WeakMap) && WeakMap; - /** Used to clone array buffers. */ - var Float64Array = function () { - // Safari 5 errors when using an array buffer to initialize a typed array - // where the array buffer's `byteLength` is not a multiple of the typed - // array's `BYTES_PER_ELEMENT`. - try { - var func = isNative(func = context.Float64Array) && func, result = new func(new ArrayBuffer(10), 0, 1) && func; - } catch (e) { - } - return result; - }(); - /* Native method references for those with the same name as other `lodash` methods. */ - var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, nativeIsFinite = context.isFinite, nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, nativeMax = Math.max, nativeMin = Math.min, nativeNow = isNative(nativeNow = Date.now) && nativeNow, nativeNumIsFinite = isNative(nativeNumIsFinite = Number.isFinite) && nativeNumIsFinite, nativeParseInt = context.parseInt, nativeRandom = Math.random; - /** Used as references for `-Infinity` and `Infinity`. */ - var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - /** Used as the size, in bytes, of each `Float64Array` element. */ - var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0; - /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. - */ - var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap(); - /*------------------------------------------------------------------------*/ - /** - * Creates a `lodash` object which wraps `value` to enable intuitive chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that return a boolean or single value will - * automatically end the chain returning the unwrapped value. Explicit chaining - * may be enabled using `_.chain`. The execution of chained methods is lazy, - * that is, execution is deferred until `_#value` is implicitly or explicitly - * called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization that merges iteratees to avoid creating intermediate - * arrays and reduce the number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers also have the following `Array` methods: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, - * and `unshift` - * - * The wrapper functions that support shortcut fusion are: - * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, - * `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, - * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `where` - * - * The chainable wrapper functions are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, - * `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, - * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, - * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, - * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, - * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, - * `mapValues`, `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, - * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`, - * `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, - * `rearg`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, - * `sortBy`, `sortByAll`, `splice`, `take`, `takeRight`, `takeRightWhile`, - * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, - * `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, - * `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` - * - * The wrapper functions that are **not** chainable by default are: - * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, - * `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, - * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, - * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, - * `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, - * `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, - * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, - * `startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, - * `trunc`, `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper function `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(sum, n) { return sum + n; }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { return n * n; }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return new LodashWrapper(value.__wrapped__, value.__chain__, arrayCopy(value.__actions__)); - } - } - return new LodashWrapper(value); - } - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. - */ - function LodashWrapper(value, chainAll, actions) { - this.__actions__ = actions || []; - this.__chain__ = !!chainAll; - this.__wrapped__ = value; - } - /** - * An object environment feature flags. - * - * @static - * @memberOf _ - * @type Object - */ - var support = lodash.support = {}; - (function (x) { - /** - * Detect if functions can be decompiled by `Function#toString` - * (all but Firefox OS certified apps, older Opera mobile browsers, and - * the PlayStation 3; forced `false` for Windows 8 apps). - * - * @memberOf _.support - * @type boolean - */ - support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); - /** - * Detect if `Function#name` is supported (all but IE). - * - * @memberOf _.support - * @type boolean - */ - support.funcNames = typeof Function.name == 'string'; - /** - * Detect if the DOM is supported. - * - * @memberOf _.support - * @type boolean - */ - try { - support.dom = document.createDocumentFragment().nodeType === 11; - } catch (e) { - support.dom = false; - } - /** - * Detect if `arguments` object indexes are non-enumerable. - * - * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object - * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat - * `arguments` object indexes as non-enumerable and fail `hasOwnProperty` - * checks for indexes that exceed their function's formal parameters with - * associated values of `0`. - * - * @memberOf _.support - * @type boolean - */ - try { - support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); - } catch (e) { - support.nonEnumArgs = true; - } - }(0, 0)); - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB). Change the following template settings to use - * alternative delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - 'escape': reEscape, - 'evaluate': reEvaluate, - 'interpolate': reInterpolate, - 'variable': '', - 'imports': { '_': lodash } - }; - /*------------------------------------------------------------------------*/ - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.actions = null; - this.dir = 1; - this.dropCount = 0; - this.filtered = false; - this.iteratees = null; - this.takeCount = POSITIVE_INFINITY; - this.views = null; - this.wrapped = value; - } - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var actions = this.actions, iteratees = this.iteratees, views = this.views, result = new LazyWrapper(this.wrapped); - result.actions = actions ? arrayCopy(actions) : null; - result.dir = this.dir; - result.dropCount = this.dropCount; - result.filtered = this.filtered; - result.iteratees = iteratees ? arrayCopy(iteratees) : null; - result.takeCount = this.takeCount; - result.views = views ? arrayCopy(views) : null; - return result; - } - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.filtered) { - var result = new LazyWrapper(this); - result.dir = -1; - result.filtered = true; - } else { - result = this.clone(); - result.dir *= -1; - } - return result; - } - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.wrapped.value(); - if (!isArray(array)) { - return baseWrapperValue(array, this.actions); - } - var dir = this.dir, isRight = dir < 0, view = getView(0, array.length, this.views), start = view.start, end = view.end, length = end - start, dropCount = this.dropCount, takeCount = nativeMin(length, this.takeCount - dropCount), index = isRight ? end : start - 1, iteratees = this.iteratees, iterLength = iteratees ? iteratees.length : 0, resIndex = 0, result = []; - outer: - while (length-- && resIndex < takeCount) { - index += dir; - var iterIndex = -1, value = array[index]; - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], iteratee = data.iteratee, computed = iteratee(value, index, array), type = data.type; - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - if (dropCount) { - dropCount--; - } else { - result[resIndex++] = value; - } - } - return result; - } - /*------------------------------------------------------------------------*/ - /** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ - function MapCache() { - this.__data__ = {}; - } - /** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ - function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - /** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ - function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; - } - /** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); - } - /** - * Adds `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ - function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; - } - /*------------------------------------------------------------------------*/ - /** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var length = values ? values.length : 0; - this.data = { - 'hash': nativeCreate(null), - 'set': new Set() - }; - while (length--) { - this.push(values[length]); - } - } - /** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ - function cacheIndexOf(cache, value) { - var data = cache.data, result = typeof value == 'string' || isObject(value) ? data.set.has(value) : data.hash[value]; - return result ? 0 : -1; - } - /** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } - } - /*------------------------------------------------------------------------*/ - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function arrayCopy(source, array) { - var index = -1, length = source.length; - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - /** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, length = array.length; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - /** - * A specialized version of `_.forEachRight` for arrays without support for - * callback shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - /** - * A specialized version of `_.every` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, length = array.length; - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - /** - * A specialized version of `_.filter` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, length = array.length, resIndex = -1, result = []; - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - /** - * A specialized version of `_.map` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, length = array.length, result = Array(length); - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - /** - * A specialized version of `_.max` for arrays without support for iteratees. - * - * @private - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - */ - function arrayMax(array) { - var index = -1, length = array.length, result = NEGATIVE_INFINITY; - while (++index < length) { - var value = array[index]; - if (value > result) { - result = value; - } - } - return result; - } - /** - * A specialized version of `_.min` for arrays without support for iteratees. - * - * @private - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - */ - function arrayMin(array) { - var index = -1, length = array.length, result = POSITIVE_INFINITY; - while (++index < length) { - var value = array[index]; - if (value < result) { - result = value; - } - } - return result; - } - /** - * A specialized version of `_.reduce` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { - var index = -1, length = array.length; - if (initFromArray && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - /** - * A specialized version of `_.reduceRight` for arrays without support for - * callback shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { - var length = array.length; - if (initFromArray && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - /** - * A specialized version of `_.some` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, length = array.length; - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - /** - * Used by `_.defaults` to customize its `_.assign` use. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignDefaults(objectValue, sourceValue) { - return typeof objectValue == 'undefined' ? sourceValue : objectValue; - } - /** - * Used by `_.template` to customize its `_.assign` use. - * - * **Note:** This method is like `assignDefaults` except that it ignores - * inherited property values when checking if a property is `undefined`. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @param {string} key The key associated with the object and source values. - * @param {Object} object The destination object. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignOwnDefaults(objectValue, sourceValue, key, object) { - return typeof objectValue == 'undefined' || !hasOwnProperty.call(object, key) ? sourceValue : objectValue; - } - /** - * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize assigning values. - * @returns {Object} Returns the destination object. - */ - function baseAssign(object, source, customizer) { - var props = keys(source); - if (!customizer) { - return baseCopy(source, object, props); - } - var index = -1, length = props.length; - while (++index < length) { - var key = props[index], value = object[key], result = customizer(value, source[key], key, object, source); - if ((result === result ? result !== value : value === value) || typeof value == 'undefined' && !(key in object)) { - object[key] = result; - } - } - return object; - } - /** - * The base implementation of `_.at` without support for strings and individual - * key arguments. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {number[]|string[]} [props] The property names or indexes of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ - function baseAt(collection, props) { - var index = -1, length = collection.length, isArr = isLength(length), propsLength = props.length, result = Array(propsLength); - while (++index < propsLength) { - var key = props[index]; - if (isArr) { - key = parseFloat(key); - result[index] = isIndex(key, length) ? collection[key] : undefined; - } else { - result[index] = collection[key]; - } - } - return result; - } - /** - * Copies the properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Object} [object={}] The object to copy properties to. - * @param {Array} props The property names to copy. - * @returns {Object} Returns `object`. - */ - function baseCopy(source, object, props) { - if (!props) { - props = object; - object = {}; - } - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; - } - /** - * The base implementation of `_.bindAll` without support for individual - * method name arguments. - * - * @private - * @param {Object} object The object to bind and assign the bound methods to. - * @param {string[]} methodNames The object method names to bind. - * @returns {Object} Returns `object`. - */ - function baseBindAll(object, methodNames) { - var index = -1, length = methodNames.length; - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; - } - /** - * The base implementation of `_.callback` which supports specifying the - * number of arguments to provide to `func`. - * - * @private - * @param {*} [func=_.identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function baseCallback(func, thisArg, argCount) { - var type = typeof func; - if (type == 'function') { - return typeof thisArg != 'undefined' && isBindable(func) ? bindCallback(func, thisArg, argCount) : func; - } - if (func == null) { - return identity; - } - // Handle "_.property" and "_.matches" style callback shorthands. - return type == 'object' ? baseMatches(func) : baseProperty(func + ''); - } - /** - * The base implementation of `_.clone` without support for argument juggling - * and `this` binding `customizer` functions. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The object `value` belongs to. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { - var result; - if (customizer) { - result = object ? customizer(value, key, object) : customizer(value); - } - if (typeof result != 'undefined') { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return arrayCopy(value, result); - } - } else { - var tag = objToString.call(value), isFunc = tag == funcTag; - if (tag == objectTag || tag == argsTag || isFunc && !object) { - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return baseCopy(value, result, keys(value)); - } - } else { - return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : object ? value : {}; - } - } - // Check for circular references and return corresponding clone. - stackA || (stackA = []); - stackB || (stackB = []); - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // Add the source value to the stack of traversed objects and associate it with its clone. - stackA.push(value); - stackB.push(result); - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function (subValue, key) { - result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); - }); - return result; - } - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = function () { - function Object() { - } - return function (prototype) { - if (isObject(prototype)) { - Object.prototype = prototype; - var result = new Object(); - Object.prototype = null; - } - return result || context.Object(); - }; - }(); - /** - * The base implementation of `_.delay` and `_.defer` which accepts an index - * of where to slice the arguments to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The `arguments` object to slice and provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args, fromIndex) { - if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function () { - func.apply(undefined, baseSlice(args, fromIndex)); - }, wait); - } - /** - * The base implementation of `_.difference` which accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values) { - var length = array ? array.length : 0, result = []; - if (!length) { - return result; - } - var index = -1, indexOf = getIndexOf(), isCommon = indexOf == baseIndexOf, cache = isCommon && values.length >= 200 && createCache(values), valuesLength = values.length; - if (cache) { - indexOf = cacheIndexOf; - isCommon = false; - values = cache; - } - outer: - while (++index < length) { - var value = array[index]; - if (isCommon && value === value) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === value) { - continue outer; - } - } - result.push(value); - } else if (indexOf(values, value) < 0) { - result.push(value); - } - } - return result; - } - /** - * The base implementation of `_.forEach` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - function baseEach(collection, iteratee) { - var length = collection ? collection.length : 0; - if (!isLength(length)) { - return baseForOwn(collection, iteratee); - } - var index = -1, iterable = toObject(collection); - while (++index < length) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - } - /** - * The base implementation of `_.forEachRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - function baseEachRight(collection, iteratee) { - var length = collection ? collection.length : 0; - if (!isLength(length)) { - return baseForOwnRight(collection, iteratee); - } - var iterable = toObject(collection); - while (length--) { - if (iteratee(iterable[length], length, iterable) === false) { - break; - } - } - return collection; - } - /** - * The base implementation of `_.every` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function (value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - /** - * The base implementation of `_.filter` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function (value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - /** - * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, - * without support for callback shorthands and `this` binding, which iterates - * over `collection` using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function (value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - /** - * The base implementation of `_.flatten` with added support for restricting - * flattening and specifying the start index. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays and `arguments` objects. - * @param {number} [fromIndex=0] The index to start from. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict, fromIndex) { - var index = (fromIndex || 0) - 1, length = array.length, resIndex = -1, result = []; - while (++index < length) { - var value = array[index]; - if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - value = baseFlatten(value, isDeep, isStrict); - } - var valIndex = -1, valLength = value.length; - result.length += valLength; - while (++valIndex < valLength) { - result[++resIndex] = value[valIndex]; - } - } else if (!isStrict) { - result[++resIndex] = value; - } - } - return result; - } - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iterator functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - function baseFor(object, iteratee, keysFunc) { - var index = -1, iterable = toObject(object), props = keysFunc(object), length = props.length; - while (++index < length) { - var key = props[index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - } - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - function baseForRight(object, iteratee, keysFunc) { - var iterable = toObject(object), props = keysFunc(object), length = props.length; - while (length--) { - var key = props[length]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - } - /** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); - } - /** - * The base implementation of `_.forOwn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return baseFor(object, iteratee, keys); - } - /** - * The base implementation of `_.forOwnRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return baseForRight(object, iteratee, keys); - } - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - var index = -1, length = props.length, resIndex = -1, result = []; - while (++index < length) { - var key = props[index]; - if (isFunction(object[key])) { - result[++resIndex] = key; - } - } - return result; - } - /** - * The base implementation of `_.invoke` which requires additional arguments - * to be provided as an array of arguments rather than individually. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|string} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {Array} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - */ - function baseInvoke(collection, methodName, args) { - var index = -1, isFunc = typeof methodName == 'function', length = collection ? collection.length : 0, result = isLength(length) ? Array(length) : []; - baseEach(collection, function (value) { - var func = isFunc ? methodName : value != null && value[methodName]; - result[++index] = func ? func.apply(value, args) : undefined; - }); - return result; - } - /** - * The base implementation of `_.isEqual` without support for `this` binding - * `customizer` functions. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isWhere] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, isWhere, stackA, stackB) { - // Exit early for identical values. - if (value === other) { - // Treat `+0` vs. `-0` as not equal. - return value !== 0 || 1 / value == 1 / other; - } - var valType = typeof value, othType = typeof other; - // Exit early for unlike primitive values. - if (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object' || value == null || other == null) { - // Return `false` unless both values are `NaN`. - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, isWhere, stackA, stackB); - } - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing objects. - * @param {boolean} [isWhere] Specify performing partial comparisons. - * @param {Array} [stackA=[]] Tracks traversed `value` objects. - * @param {Array} [stackB=[]] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, isWhere, stackA, stackB) { - var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; - if (!objIsArr) { - objTag = objToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = objToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); - } - var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - if (valWrapped || othWrapped) { - return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isWhere, stackA, stackB); - } - if (!isSameTag) { - return false; - } - // Assume cyclic values are equal. - // For more information on detecting circular references see https://es5.github.io/#JO. - stackA || (stackA = []); - stackB || (stackB = []); - var length = stackA.length; - while (length--) { - if (stackA[length] == object) { - return stackB[length] == other; - } - } - // Add `object` and `other` to the stack of traversed objects. - stackA.push(object); - stackB.push(other); - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isWhere, stackA, stackB); - stackA.pop(); - stackB.pop(); - return result; - } - /** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, noCustomizer = !customizer; - while (++index < length) { - if (noCustomizer && strictCompareFlags[index] ? values[index] !== object[props[index]] : !hasOwnProperty.call(object, props[index])) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], srcValue = values[index]; - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; - } - /** - * The base implementation of `_.map` without support for callback shorthands - * or `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var result = []; - baseEach(collection, function (value, key, collection) { - result.push(iteratee(value, key, collection)); - }); - return result; - } - /** - * The base implementation of `_.matches` which supports specifying whether - * `source` should be cloned. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var props = keys(source), length = props.length; - if (length == 1) { - var key = props[0], value = source[key]; - if (isStrictComparable(value)) { - return function (object) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - }; - } - } - var values = Array(length), strictCompareFlags = Array(length); - while (length--) { - value = source[props[length]]; - values[length] = value; - strictCompareFlags[length] = isStrictComparable(value); - } - return function (object) { - return baseIsMatch(object, props, values, strictCompareFlags); - }; - } - /** - * The base implementation of `_.merge` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {Object} Returns the destination object. - */ - function baseMerge(object, source, customizer, stackA, stackB) { - var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source)); - (isSrcArr ? arrayEach : baseForOwn)(source, function (srcValue, key, source) { - if (isObjectLike(srcValue)) { - stackA || (stackA = []); - stackB || (stackB = []); - return baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); - } - var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = typeof result == 'undefined'; - if (isCommon) { - result = srcValue; - } - if ((isSrcArr || typeof result != 'undefined') && (isCommon || (result === result ? result !== value : value === value))) { - object[key] = result; - } - }); - return object; - } - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { - var length = stackA.length, srcValue = source[key]; - while (length--) { - if (stackA[length] == srcValue) { - object[key] = stackB[length]; - return; - } - } - var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = typeof result == 'undefined'; - if (isCommon) { - result = srcValue; - if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) ? value : value ? arrayCopy(value) : []; - } else if (isPlainObject(srcValue) || isArguments(srcValue)) { - result = isArguments(value) ? toPlainObject(value) : isPlainObject(value) ? value : {}; - } else { - isCommon = false; - } - } - // Add the source value to the stack of traversed objects and associate - // it with its merged value. - stackA.push(srcValue); - stackB.push(result); - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); - } else if (result === result ? result !== value : value === value) { - object[key] = result; - } - } - /** - * The base implementation of `_.property` which does not coerce `key` to a string. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - /** - * The base implementation of `_.pullAt` without support for individual - * index arguments. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - */ - function basePullAt(array, indexes) { - var length = indexes.length, result = baseAt(array, indexes); - indexes.sort(baseCompareAscending); - while (length--) { - var index = parseFloat(indexes[length]); - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return result; - } - /** - * The base implementation of `_.random` without support for argument juggling - * and returning floating-point numbers. - * - * @private - * @param {number} min The minimum possible value. - * @param {number} max The maximum possible value. - * @returns {number} Returns the random number. - */ - function baseRandom(min, max) { - return min + floor(nativeRandom() * (max - min + 1)); - } - /** - * The base implementation of `_.reduce` and `_.reduceRight` without support - * for callback shorthands or `this` binding, which iterates over `collection` - * using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element - * of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { - eachFunc(collection, function (value, index, collection) { - accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - /** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function (func, data) { - metaMap.set(func, data); - return func; - }; - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, length = array.length; - start = start == null ? 0 : +start || 0; - if (start < 0) { - start = -start > length ? 0 : length + start; - } - end = typeof end == 'undefined' || end > length ? length : +end || 0; - if (end < 0) { - end += length; - } - length = start > end ? 0 : end - start >>> 0; - start >>>= 0; - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - /** - * The base implementation of `_.some` without support for callback shorthands - * or `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - baseEach(collection, function (value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - /** - * The base implementation of `_.uniq` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function baseUniq(array, iteratee) { - var index = -1, indexOf = getIndexOf(), length = array.length, isCommon = indexOf == baseIndexOf, isLarge = isCommon && length >= 200, seen = isLarge && createCache(), result = []; - if (seen) { - indexOf = cacheIndexOf; - isCommon = false; - } else { - isLarge = false; - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], computed = iteratee ? iteratee(value, index, array) : value; - if (isCommon && value === value) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } else if (indexOf(seen, computed) < 0) { - if (iteratee || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * returned by `keysFunc`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - var index = -1, length = props.length, result = Array(length); - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to peform to resolve the unwrapped value. - * @returns {*} Returns the resolved unwrapped value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - var index = -1, length = actions.length; - while (++index < length) { - var args = [result], action = actions[index]; - push.apply(args, action.args); - result = action.func.apply(action.thisArg, args); - } - return result; - } - /** - * Performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest, instead - * of the lowest, index at which a value should be inserted into `array`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndex(array, value, retHighest) { - var low = 0, high = array ? array.length : low; - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = low + high >>> 1, computed = array[mid]; - if (retHighest ? computed <= value : computed < value) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return binaryIndexBy(array, value, identity, retHighest); - } - /** - * This function is like `binaryIndex` except that it invokes `iteratee` for - * `value` and each element of `array` to compute their sort ranking. The - * iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The function invoked per iteration. - * @param {boolean} [retHighest] Specify returning the highest, instead - * of the lowest, index at which a value should be inserted into `array`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - var low = 0, high = array ? array.length : 0, valIsNaN = value !== value, valIsUndef = typeof value == 'undefined'; - while (low < high) { - var mid = floor((low + high) / 2), computed = iteratee(array[mid]), isReflexive = computed === computed; - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || typeof computed != 'undefined'); - } else { - setLow = retHighest ? computed <= value : computed < value; - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - /** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (typeof thisArg == 'undefined') { - return func; - } - switch (argCount) { - case 1: - return function (value) { - return func.call(thisArg, value); - }; - case 3: - return function (value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: - return function (accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: - return function (value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function () { - return func.apply(thisArg, arguments); - }; - } - /** - * Creates a clone of the given array buffer. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function bufferClone(buffer) { - return bufferSlice.call(buffer, 0); - } - if (!bufferSlice) { - // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`. - bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function (buffer) { - var byteLength = buffer.byteLength, floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, result = new ArrayBuffer(byteLength); - if (floatLength) { - var view = new Float64Array(result, 0, floatLength); - view.set(new Float64Array(buffer, 0, floatLength)); - } - if (byteLength != offset) { - view = new Uint8Array(result, offset); - view.set(new Uint8Array(buffer, offset)); - } - return result; - }; - } - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partials.length, result = Array(argsLength + leftLength); - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, result = Array(argsLength + rightLength); - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var pad = argsIndex; - while (++rightIndex < rightLength) { - result[pad + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[pad + holders[holdersIndex]] = args[argsIndex++]; - } - return result; - } - /** - * Creates a function that aggregates a collection, creating an accumulator - * object composed from the results of running each element in the collection - * through an iteratee. The `setter` sets the keys and values of the accumulator - * object. If `initializer` is provided initializes the accumulator object. - * - * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function (collection, iteratee, thisArg) { - var result = initializer ? initializer() : {}; - iteratee = getCallback(iteratee, thisArg, 3); - if (isArray(collection)) { - var index = -1, length = collection.length; - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value, index, collection), collection); - } - } else { - baseEach(collection, function (value, key, collection) { - setter(result, value, iteratee(value, key, collection), collection); - }); - } - return result; - }; - } - /** - * Creates a function that assigns properties of source object(s) to a given - * destination object. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return function () { - var length = arguments.length, object = arguments[0]; - if (length < 2 || object == null) { - return object; - } - if (length > 3 && isIterateeCall(arguments[1], arguments[2], arguments[3])) { - length = 2; - } - // Juggle arguments. - if (length > 3 && typeof arguments[length - 2] == 'function') { - var customizer = bindCallback(arguments[--length - 1], arguments[length--], 5); - } else if (length > 2 && typeof arguments[length - 1] == 'function') { - customizer = arguments[--length]; - } - var index = 0; - while (++index < length) { - var source = arguments[index]; - if (source) { - assigner(object, source, customizer); - } - } - return object; - }; - } - /** - * Creates a function that wraps `func` and invokes it with the `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new bound function. - */ - function createBindWrapper(func, thisArg) { - var Ctor = createCtorWrapper(func); - function wrapper() { - return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments); - } - return wrapper; - } - /** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ - var createCache = !(nativeCreate && Set) ? constant(null) : function (values) { - return new SetCache(values); - }; - /** - * Creates a function that produces compound words out of the words in a - * given string. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function (string) { - var index = -1, array = words(deburr(string)), length = array.length, result = ''; - while (++index < length) { - result = callback(result, array[index], index); - } - return result; - }; - } - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function () { - var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, arguments); - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - /** - * Creates a function that gets the extremum value of a collection. - * - * @private - * @param {Function} arrayFunc The function to get the extremum value from an array. - * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum, - * extremum value. - * @returns {Function} Returns the new extremum function. - */ - function createExtremum(arrayFunc, isMin) { - return function (collection, iteratee, thisArg) { - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - var func = getCallback(), noIteratee = iteratee == null; - if (!(func === baseCallback && noIteratee)) { - noIteratee = false; - iteratee = func(iteratee, thisArg, 3); - } - if (noIteratee) { - var isArr = isArray(collection); - if (!isArr && isString(collection)) { - iteratee = charAtCallback; - } else { - return arrayFunc(isArr ? collection : toIterable(collection)); - } - } - return extremumBy(collection, iteratee, isMin); - }; - } - /** - * Creates a function that wraps `func` and invokes it with optional `this` - * binding of, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurry = bitmask & CURRY_FLAG, isCurryBound = bitmask & CURRY_BOUND_FLAG, isCurryRight = bitmask & CURRY_RIGHT_FLAG; - var Ctor = !isBindKey && createCtorWrapper(func), key = func; - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it to other functions. - var length = arguments.length, index = length, args = Array(length); - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, argsHolders = replaceHolders(args, placeholder); - length -= argsHolders.length; - if (length < arity) { - var newArgPos = argPos ? arrayCopy(argPos) : null, newArity = nativeMax(arity - length, 0), newsHolders = isCurry ? argsHolders : null, newHoldersRight = isCurry ? null : argsHolders, newPartials = isCurry ? args : null, newPartialsRight = isCurry ? null : args; - bitmask |= isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG; - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var result = createHybridWrapper(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity); - result.placeholder = placeholder; - return result; - } - } - var thisBinding = isBind ? thisArg : this; - if (isBindKey) { - func = thisBinding[key]; - } - if (argPos) { - args = reorder(args, argPos); - } - if (isAry && ary < args.length) { - args.length = ary; - } - return (this instanceof wrapper ? Ctor || createCtorWrapper(func) : func).apply(thisBinding, args); - } - return wrapper; - } - /** - * Creates the pad required for `string` based on the given padding length. - * The `chars` string may be truncated if the number of padding characters - * exceeds the padding length. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the pad for `string`. - */ - function createPad(string, length, chars) { - var strLength = string.length; - length = +length; - if (strLength >= length || !nativeIsFinite(length)) { - return ''; - } - var padLength = length - strLength; - chars = chars == null ? ' ' : chars + ''; - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); - } - /** - * Creates a function that wraps `func` and invokes it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new bound function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func); - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it `func`. - var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(argsLength + leftLength); - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return (this instanceof wrapper ? Ctor : func).apply(isBind ? thisArg : this, args); - } - return wrapper; - } - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && !isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = null; - } - length -= holders ? holders.length : 0; - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, holdersRight = holders; - partials = holders = null; - } - var data = !isBindKey && getData(func), newData = [ - func, - bitmask, - thisArg, - partials, - holders, - partialsRight, - holdersRight, - argPos, - ary, - arity - ]; - if (data && data !== true) { - mergeData(newData, data); - bitmask = newData[1]; - arity = newData[9]; - } - newData[9] = arity == null ? isBindKey ? 0 : func.length : nativeMax(arity - length, 0) || 0; - if (bitmask == BIND_FLAG) { - var result = createBindWrapper(newData[0], newData[2]); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { - result = createPartialWrapper.apply(null, newData); - } else { - result = createHybridWrapper.apply(null, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); - } - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing arrays. - * @param {boolean} [isWhere] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, isWhere, stackA, stackB) { - var index = -1, arrLength = array.length, othLength = other.length, result = true; - if (arrLength != othLength && !(isWhere && othLength > arrLength)) { - return false; - } - // Deep compare the contents, ignoring non-numeric properties. - while (result && ++index < arrLength) { - var arrValue = array[index], othValue = other[index]; - result = undefined; - if (customizer) { - result = isWhere ? customizer(othValue, arrValue, index) : customizer(arrValue, othValue, index); - } - if (typeof result == 'undefined') { - // Recursively compare arrays (susceptible to call stack limits). - if (isWhere) { - var othIndex = othLength; - while (othIndex--) { - othValue = other[othIndex]; - result = arrValue && arrValue === othValue || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); - if (result) { - break; - } - } - } else { - result = arrValue && arrValue === othValue || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); - } - } - } - return !!result; - } - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} value The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag) { - switch (tag) { - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - case errorTag: - return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return object != +object ? other != +other : object == 0 ? 1 / object == 1 / other : object == +other; - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == other + ''; - } - return false; - } - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isWhere] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, isWhere, stackA, stackB) { - var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; - if (objLength != othLength && !isWhere) { - return false; - } - var hasCtor, index = -1; - while (++index < objLength) { - var key = objProps[index], result = hasOwnProperty.call(other, key); - if (result) { - var objValue = object[key], othValue = other[key]; - result = undefined; - if (customizer) { - result = isWhere ? customizer(othValue, objValue, key) : customizer(objValue, othValue, key); - } - if (typeof result == 'undefined') { - // Recursively compare objects (susceptible to call stack limits). - result = objValue && objValue === othValue || equalFunc(objValue, othValue, customizer, isWhere, stackA, stackB); - } - } - if (!result) { - return false; - } - hasCtor || (hasCtor = key == 'constructor'); - } - if (!hasCtor) { - var objCtor = object.constructor, othCtor = other.constructor; - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { - return false; - } - } - return true; - } - /** - * Gets the extremum value of `collection` invoking `iteratee` for each value - * in `collection` to generate the criterion by which the value is ranked. - * The `iteratee` is invoked with three arguments; (value, index, collection). - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {boolean} [isMin] Specify returning the minimum, instead of the - * maximum, extremum value. - * @returns {*} Returns the extremum value. - */ - function extremumBy(collection, iteratee, isMin) { - var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY, computed = exValue, result = computed; - baseEach(collection, function (value, index, collection) { - var current = iteratee(value, index, collection); - if ((isMin ? current < computed : current > computed) || current === exValue && current === result) { - computed = current; - result = value; - } - }); - return result; - } - /** - * Gets the appropriate "callback" function. If the `_.callback` method is - * customized this function returns the custom method, otherwise it returns - * the `baseCallback` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function} Returns the chosen function or its result. - */ - function getCallback(func, thisArg, argCount) { - var result = lodash.callback || callback; - result = result === callback ? baseCallback : result; - return argCount ? result(func, thisArg, argCount) : result; - } - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function (func) { - return metaMap.get(func); - }; - /** - * Gets the appropriate "indexOf" function. If the `_.indexOf` method is - * customized this function returns the custom method, otherwise it returns - * the `baseIndexOf` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function|number} Returns the chosen function or its result. - */ - function getIndexOf(collection, target, fromIndex) { - var result = lodash.indexOf || indexOf; - result = result === indexOf ? baseIndexOf : result; - return collection ? result(collection, target, fromIndex) : result; - } - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} [transforms] The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, length = transforms ? transforms.length : 0; - while (++index < length) { - var data = transforms[index], size = data.size; - switch (data.type) { - case 'drop': - start += size; - break; - case 'dropRight': - end -= size; - break; - case 'take': - end = nativeMin(end, start + size); - break; - case 'takeRight': - start = nativeMax(start, end - size); - break; - } - } - return { - 'start': start, - 'end': end - }; - } - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, result = new array.constructor(length); - // Add array properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - var Ctor = object.constructor; - if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { - Ctor = Object; - } - return new Ctor(); - } - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return bufferClone(object); - case boolTag: - case dateTag: - return new Ctor(+object); - case float32Tag: - case float64Tag: - case int8Tag: - case int16Tag: - case int32Tag: - case uint8Tag: - case uint8ClampedTag: - case uint16Tag: - case uint32Tag: - var buffer = object.buffer; - return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); - case numberTag: - case stringTag: - return new Ctor(object); - case regexpTag: - var result = new Ctor(object.source, reFlags.exec(object)); - result.lastIndex = object.lastIndex; - } - return result; - } - /** - * Checks if `func` is eligible for `this` binding. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is eligible, else `false`. - */ - function isBindable(func) { - var support = lodash.support, result = !(support.funcNames ? func.name : support.funcDecomp); - if (!result) { - var source = fnToString.call(func); - if (!support.funcNames) { - result = !reFuncName.test(source); - } - if (!result) { - // Check if `func` references the `this` keyword and store the result. - result = reThis.test(source) || isNative(func); - baseSetData(func, result); - } - } - return result; - } - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = +value; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - /** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number') { - var length = object.length, prereq = isLength(length) && isIndex(index, length); - } else { - prereq = type == 'string' && index in object; - } - return prereq && object[index] === value; - } - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && (value === 0 ? 1 / value > 0 : !isObject(value)); - } - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers required to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * augment function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * common case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask; - var arityFlags = ARY_FLAG | REARG_FLAG, bindFlags = BIND_FLAG | BIND_KEY_FLAG, comboFlags = arityFlags | bindFlags | CURRY_BOUND_FLAG | CURRY_RIGHT_FLAG; - var isAry = bitmask & ARY_FLAG && !(srcBitmask & ARY_FLAG), isRearg = bitmask & REARG_FLAG && !(srcBitmask & REARG_FLAG), argPos = (isRearg ? data : source)[7], ary = (isAry ? data : source)[8]; - var isCommon = !(bitmask >= REARG_FLAG && srcBitmask > bindFlags) && !(bitmask > bindFlags && srcBitmask >= REARG_FLAG); - var isCombo = newBitmask >= arityFlags && newBitmask <= comboFlags && (bitmask < REARG_FLAG || (isRearg || isAry) && argPos.length <= ary); - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = arrayCopy(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - return data; - } - /** - * A specialized version of `_.pick` that picks `object` properties specified - * by the `props` array. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function pickByArray(object, props) { - object = toObject(object); - var index = -1, length = props.length, result = {}; - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - return result; - } - /** - * A specialized version of `_.pick` that picks `object` properties `predicate` - * returns truthy for. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per iteration. - * @returns {Object} Returns the new object. - */ - function pickByCallback(object, predicate) { - var result = {}; - baseForIn(object, function (value, key, object) { - if (predicate(value, key, object)) { - result[key] = value; - } - }); - return result; - } - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = arrayCopy(array); - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = function () { - var count = 0, lastCalled = 0; - return function (key, value) { - var stamp = now(), remaining = HOT_SPAN - (stamp - lastCalled); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }(); - /** - * A fallback implementation of `_.isPlainObject` which checks if `value` - * is an object created by the `Object` constructor or has a `[[Prototype]]` - * of `null`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - var Ctor, support = lodash.support; - // Exit early for non `Object` objects. - if (!(isObjectLike(value) && objToString.call(value) == objectTag) || !hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor))) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function (subValue, key) { - result = key; - }); - return typeof result == 'undefined' || hasOwnProperty.call(value, result); - } - /** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to inspect. - * @returns {Array} Returns the array of property names. - */ - function shimKeys(object) { - var props = keysIn(object), propsLength = props.length, length = propsLength && object.length, support = lodash.support; - var allowIndexes = length && isLength(length) && (isArray(object) || support.nonEnumArgs && isArguments(object)); - var index = -1, result = []; - while (++index < propsLength) { - var key = props[index]; - if (allowIndexes && isIndex(key, length) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; - } - /** - * Converts `value` to an array-like object if it is not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array|Object} Returns the array-like object. - */ - function toIterable(value) { - if (value == null) { - return []; - } - if (!isLength(value.length)) { - return values(value); - } - return isObject(value) ? value : Object(value); - } - /** - * Converts `value` to an object if it is not one. - * - * @private - * @param {*} value The value to process. - * @returns {Object} Returns the object. - */ - function toObject(value) { - return isObject(value) ? value : Object(value); - } - /*------------------------------------------------------------------------*/ - /** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {numer} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(+size || 1, 1); - } - var index = 0, length = array ? array.length : 0, resIndex = -1, result = Array(ceil(length / size)); - while (index < length) { - result[++resIndex] = baseSlice(array, index, index += size); - } - return result; - } - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, length = array ? array.length : 0, resIndex = -1, result = []; - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; - } - /** - * Creates an array excluding all values of the provided arrays using - * `SameValueZero` for equality comparisons. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [5, 2, 10]); - * // => [1, 3] - */ - function difference() { - var index = -1, length = arguments.length; - while (++index < length) { - var value = arguments[index]; - if (isArray(value) || isArguments(value)) { - break; - } - } - return baseDifference(value, baseFlatten(arguments, false, true, ++index)); - } - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); - } - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per element. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'status': 'busy', 'active': false }, - * { 'user': 'fred', 'status': 'busy', 'active': true }, - * { 'user': 'pebbles', 'status': 'away', 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.dropRightWhile(users, { 'status': 'away' }), 'user'); - * // => ['barney', 'fred'] - */ - function dropRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - predicate = getCallback(predicate, thisArg, 3); - while (length-- && predicate(array[length], length, array)) { - } - return baseSlice(array, 0, length + 1); - } - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per element. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'status': 'busy', 'active': true }, - * { 'user': 'fred', 'status': 'busy', 'active': false }, - * { 'user': 'pebbles', 'status': 'away', 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.dropWhile(users, { 'status': 'busy' }), 'user'); - * // => ['pebbles'] - */ - function dropWhile(array, predicate, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var index = -1; - predicate = getCallback(predicate, thisArg, 3); - while (++index < length && predicate(array[index], index, array)) { - } - return baseSlice(array, index); - } - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for, instead of the element itself. - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.findIndex(users, function(chr) { return chr.age < 40; }); - * // => 0 - * - * // using the "_.matches" callback shorthand - * _.findIndex(users, { 'age': 1 }); - * // => 2 - * - * // using the "_.property" callback shorthand - * _.findIndex(users, 'active'); - * // => 1 - */ - function findIndex(array, predicate, thisArg) { - var index = -1, length = array ? array.length : 0; - predicate = getCallback(predicate, thisArg, 3); - while (++index < length) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { return chr.age < 40; }); - * // => 2 - * - * // using the "_.matches" callback shorthand - * _.findLastIndex(users, { 'age': 40 }); - * // => 1 - * - * // using the "_.property" callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, thisArg) { - var length = array ? array.length : 0; - predicate = getCallback(predicate, thisArg, 3); - while (length--) { - if (predicate(array[length], length, array)) { - return length; - } - } - return -1; - } - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ - function first(array) { - return array ? array[0] : undefined; - } - /** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2], [3, [[4]]]]); - * // => [1, 2, 3, [[4]]]; - * - * // using `isDeep` - * _.flatten([1, [2], [3, [[4]]]], true); - * // => [1, 2, 3, 4]; - */ - function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; - } - /** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2], [3, [[4]]]]); - * // => [1, 2, 3, 4]; - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using `SameValueZero` for equality comparisons. If `fromIndex` is negative, - * it is used as the offset from the end of `array`. If `array` is sorted - * providing `true` for `fromIndex` performs a faster binary search. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 4 - * - * // performing a binary search - * _.indexOf([4, 4, 5, 5, 6, 6], 5, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex || 0; - } else if (fromIndex) { - var index = binaryIndex(array, value), other = array[index]; - return (value === value ? value === other : other !== other) ? index : -1; - } - return baseIndexOf(array, value, fromIndex); - } - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - return dropRight(array, 1); - } - /** - * Creates an array of unique values in all provided arrays using `SameValueZero` - * for equality comparisons. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); - * // => [1, 2] - */ - function intersection() { - var args = [], argsIndex = -1, argsLength = arguments.length, caches = [], indexOf = getIndexOf(), isCommon = indexOf == baseIndexOf; - while (++argsIndex < argsLength) { - var value = arguments[argsIndex]; - if (isArray(value) || isArguments(value)) { - args.push(value); - caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value)); - } - } - argsLength = args.length; - var array = args[0], index = -1, length = array ? array.length : 0, result = [], seen = caches[0]; - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value)) < 0) { - argsIndex = argsLength; - while (--argsIndex) { - var cache = caches[argsIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; - } - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); - * // => 4 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([4, 4, 5, 5, 6, 6], 5, true); - * // => 3 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - return (value === value ? value === other : other !== other) ? index : -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - /** - * Removes all provided values from `array` using `SameValueZero` for equality - * comparisons. - * - * **Notes:** - * - Unlike `_.without`, this method mutates `array`. - * - `SameValueZero` comparisons are like strict equality comparisons, e.g. `===`, - * except that `NaN` matches `NaN`. See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ - function pull() { - var array = arguments[0]; - if (!(array && array.length)) { - return array; - } - var index = 0, indexOf = getIndexOf(), length = arguments.length; - while (++index < length) { - var fromIndex = 0, value = arguments[index]; - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; - } - /** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ - function pullAt(array) { - return basePullAt(array || [], baseFlatten(arguments, false, false, 1)); - } - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { return n % 2 == 0; }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate, thisArg) { - var index = -1, length = array ? array.length : 0, result = []; - predicate = getCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - splice.call(array, index--, 1); - length--; - } - } - return result; - } - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ - function rest(array) { - return drop(array, 1); - } - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This function is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); - } - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5, 6, 6], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the "_.property" callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ - function sortedIndex(array, value, iteratee, thisArg) { - var func = getCallback(iteratee); - return func === baseCallback && iteratee == null ? binaryIndex(array, value) : binaryIndexBy(array, value, func(iteratee, thisArg, 1)); - } - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5, 6, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value, iteratee, thisArg) { - var func = getCallback(iteratee); - return func === baseCallback && iteratee == null ? binaryIndex(array, value, true) : binaryIndexBy(array, value, func(iteratee, thisArg, 1), true); - } - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); - } - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); - } - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per element. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'status': 'busy', 'active': false }, - * { 'user': 'fred', 'status': 'busy', 'active': true }, - * { 'user': 'pebbles', 'status': 'away', 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.takeRightWhile(users, { 'status': 'away' }), 'user'); - * // => ['pebbles'] - */ - function takeRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - predicate = getCallback(predicate, thisArg, 3); - while (length-- && predicate(array[length], length, array)) { - } - return baseSlice(array, length + 1); - } - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per element. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'status': 'busy', 'active': true }, - * { 'user': 'fred', 'status': 'busy', 'active': false }, - * { 'user': 'pebbles', 'status': 'away', 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => ['barney'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.takeWhile(users, { 'status': 'busy' }), 'user'); - * // => ['barney', 'fred'] - */ - function takeWhile(array, predicate, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var index = -1; - predicate = getCallback(predicate, thisArg, 3); - while (++index < length && predicate(array[index], index, array)) { - } - return baseSlice(array, 0, index); - } - /** - * Creates an array of unique values, in order, of the provided arrays using - * `SameValueZero` for equality comparisons. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); - * // => [1, 2, 3, 5, 4] - */ - function union() { - return baseUniq(baseFlatten(arguments, false, true)); - } - /** - * Creates a duplicate-value-free version of an array using `SameValueZero` - * for equality comparisons. Providing `true` for `isSorted` performs a faster - * search algorithm for sorted arrays. If an iteratee function is provided it - * is invoked for each value in the array to generate the criterion by which - * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked - * with three arguments; (value, index, array). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * If a property name or object is provided it is used to create a "_.property" - * or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([1, 2, 1]); - * // => [1, 2] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { return this.floor(n); }, Math); - * // => [1, 2.5] - * - * // using the "_.property" callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - // Juggle arguments. - if (typeof isSorted != 'boolean' && isSorted != null) { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; - isSorted = false; - } - var func = getCallback(); - if (!(func === baseCallback && iteratee == null)) { - iteratee = func(iteratee, thisArg, 3); - } - return isSorted && getIndexOf() == baseIndexOf ? sortedUniq(array, iteratee) : baseUniq(array, iteratee); - } - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-`_.zip` - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ - function unzip(array) { - var index = -1, length = (array && array.length && arrayMax(arrayMap(array, getLength))) >>> 0, result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; - } - /** - * Creates an array excluding all provided values using `SameValueZero` for - * equality comparisons. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); - * // => [2, 3, 4] - */ - function without(array) { - return baseDifference(array, baseSlice(arguments, 1)); - } - /** - * Creates an array that is the symmetric difference of the provided arrays. - * See [Wikipedia](https://en.wikipedia.org/wiki/Symmetric_difference) for - * more details. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2, 3], [5, 2, 1, 4]); - * // => [3, 5, 4] - * - * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); - * // => [1, 4, 5] - */ - function xor() { - var index = -1, length = arguments.length; - while (++index < length) { - var array = arguments[index]; - if (isArray(array) || isArguments(array)) { - var result = result ? baseDifference(result, array).concat(baseDifference(array, result)) : array; - } - } - return result ? baseUniq(result) : []; - } - /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - function zip() { - var length = arguments.length, array = Array(length); - while (length--) { - array[length] = arguments[length]; - } - return unzip(array); - } - /** - * Creates an object composed from arrays of property names and values. Provide - * either a single two dimensional array, e.g. `[[key1, value1], [key2, value2]]` - * or two arrays, one of property names and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ - function zipObject(props, values) { - var index = -1, length = props ? props.length : 0, result = {}; - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; - } - /*------------------------------------------------------------------------*/ - /** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` object. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { return chr.user + ' is ' + chr.age; }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - /** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { array.pop(); }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; - } - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _([1, 2, 3]) - * .last() - * .thru(function(value) { return [value]; }) - * .value(); - * // => [3] - */ - function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); - } - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {*} Returns the `lodash` object. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - /** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` object. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - if (this.__actions__.length) { - value = new LazyWrapper(this); - } - return new LodashWrapper(value.reverse()); - } - return this.thru(function (value) { - return value.reverse(); - }); - } - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ - function wrapperToString() { - return this.value() + ''; - } - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - /*------------------------------------------------------------------------*/ - /** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); - * // => ['a', 'c', 'e'] - * - * _.at(['fred', 'barney', 'pebbles'], 0, 2); - * // => ['fred', 'pebbles'] - */ - function at(collection) { - var length = collection ? collection.length : 0; - if (isLength(length)) { - collection = toIterable(collection); - } - return baseAt(collection, baseFlatten(arguments, false, false, 1)); - } - /** - * Checks if `value` is in `collection` using `SameValueZero` for equality - * comparisons. If `fromIndex` is negative, it is used as the offset from - * the end of `collection`. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, target, fromIndex) { - var length = collection ? collection.length : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (!length) { - return false; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex || 0; - } else { - fromIndex = 0; - } - return typeof collection == 'string' || !isArray(collection) && isString(collection) ? fromIndex < length && collection.indexOf(target, fromIndex) > -1 : getIndexOf(collection, target, fromIndex) > -1; - } - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function (result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : result[key] = 1; - }); - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes']); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // using the "_.property" callback shorthand - * _.every(users, 'age'); - * // => true - * - * // using the "_.matches" callback shorthand - * _.every(users, { 'age': 36 }); - * // => false - */ - function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (typeof predicate != 'function' || typeof thisArg != 'undefined') { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * var evens = _.filter([1, 2, 3, 4], function(n) { return n % 2 == 0; }); - * // => [2, 4] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['fred'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.filter(users, { 'age': 36 }), 'user'); - * // => ['barney'] - */ - function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, predicate); - } - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); - * // => 'barney' - * - * // using the "_.matches" callback shorthand - * _.result(_.find(users, { 'age': 1 }), 'user'); - * // => 'pebbles' - * - * // using the "_.property" callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'fred' - */ - function find(collection, predicate, thisArg) { - if (isArray(collection)) { - var index = findIndex(collection, predicate, thisArg); - return index > -1 ? collection[index] : undefined; - } - predicate = getCallback(predicate, thisArg, 3); - return baseFind(collection, predicate, baseEach); - } - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); - * // => 3 - */ - function findLast(collection, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(collection, predicate, baseEachRight); - } - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'status': 'busy' }, - * { 'user': 'fred', 'age': 40, 'status': 'busy' } - * ]; - * - * _.result(_.findWhere(users, { 'status': 'busy' }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40 }), 'user'); - * // => 'fred' - */ - function findWhere(collection, source) { - return find(collection, baseMatches(source)); - } - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). Iterator functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a `length` property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEach(function(n) { console.log(n); }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(n, key) { console.log(n, key); }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ - function forEach(collection, iteratee, thisArg) { - return typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection) ? arrayEach(collection, iteratee) : baseEach(collection, bindCallback(iteratee, thisArg, 3)); - } - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEachRight(function(n) { console.log(n); }).join(','); - * // => logs each value from right to left and returns the array - */ - function forEachRight(collection, iteratee, thisArg) { - return typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection) ? arrayEachRight(collection, iteratee) : baseEachRight(collection, bindCallback(iteratee, thisArg, 3)); - } - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the "_.property" callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function (result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } - }); - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { return String.fromCharCode(object.code); }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { return this.fromCharCode(object.code); }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ - var indexBy = createAggregator(function (result, value, key) { - result[key] = value; - }); - /** - * Invokes the method named by `methodName` on each element in `collection`, - * returning an array of the results of each invoked method. Any additional - * arguments are provided to each invoked method. If `methodName` is a function - * it is invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|string} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - function invoke(collection, methodName) { - return baseInvoke(collection, methodName, baseSlice(arguments, 2)); - } - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * _.map([1, 2, 3], function(n) { return n * 3; }); - * // => [3, 6, 9] - * - * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(n) { return n * 3; }); - * // => [3, 6, 9] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the "_.property" callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = getCallback(iteratee, thisArg, 3); - return func(collection, iteratee); - } - /** - * Gets the maximum value of `collection`. If `collection` is empty or falsey - * `-Infinity` is returned. If an iteratee function is provided it is invoked - * for each value in `collection` to generate the criterion by which the value - * is ranked. The `iteratee` is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * If a property name or object is provided it is used to create a "_.property" - * or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the maximum value. - * @example - * - * _.max([4, 2, 8, 6]); - * // => 8 - * - * _.max([]); - * // => -Infinity - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.max(users, function(chr) { return chr.age; }); - * // => { 'user': 'fred', 'age': 40 }; - * - * // using the "_.property" callback shorthand - * _.max(users, 'age'); - * // => { 'user': 'fred', 'age': 40 }; - */ - var max = createExtremum(arrayMax); - /** - * Gets the minimum value of `collection`. If `collection` is empty or falsey - * `Infinity` is returned. If an iteratee function is provided it is invoked - * for each value in `collection` to generate the criterion by which the value - * is ranked. The `iteratee` is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * If a property name or object is provided it is used to create a "_.property" - * or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the minimum value. - * @example - * - * _.min([4, 2, 8, 6]); - * // => 2 - * - * _.min([]); - * // => Infinity - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.min(users, function(chr) { return chr.age; }); - * // => { 'user': 'barney', 'age': 36 }; - * - * // using the "_.property" callback shorthand - * _.min(users, 'age'); - * // => { 'user': 'barney', 'age': 36 }; - */ - var min = createExtremum(arrayMin, true); - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { return n % 2; }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; }, Math); - * // => [[1, 3], [2]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * // using the "_.matches" callback shorthand - * _.map(_.partition(users, { 'age': 1 }), function(array) { return _.pluck(array, 'user'); }); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the "_.property" callback shorthand - * _.map(_.partition(users, 'active'), function(array) { return _.pluck(array, 'user'); }); - * // => [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function (result, value, key) { - result[key ? 0 : 1].push(value); - }, function () { - return [ - [], - [] - ]; - }); - /** - * Gets the value of `key` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {string} key The key of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ - function pluck(collection, key) { - return map(collection, baseProperty(key + '')); - } - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg`and invoked with four arguments; - * (accumulator, value, index|key, collection). - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var sum = _.reduce([1, 2, 3], function(sum, n) { return sum + n; }); - * // => 6 - * - * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6, 'c': 9 } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator, thisArg) { - var func = isArray(collection) ? arrayReduce : baseReduce; - return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEach); - } - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * _.reduceRight(array, function(flattened, other) { return flattened.concat(other); }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator, thisArg) { - var func = isArray(collection) ? arrayReduceRight : baseReduce; - return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEachRight); - } - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * var odds = _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - * - * // using the "_.matches" callback shorthand - * _.pluck(_.reject(users, { 'age': 36 }), 'user'); - * // => ['fred'] - */ - function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, function (value, index, collection) { - return !predicate(value, index, collection); - }); - } - /** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ - function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var result = shuffle(collection); - result.length = nativeMin(n < 0 ? 0 : +n || 0, result.length); - return result; - } - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates - * shuffle. See [Wikipedia](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle) - * for more details. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - collection = toIterable(collection); - var index = -1, length = collection.length, result = Array(length); - while (++index < length) { - var rand = baseRandom(0, index); - if (index != rand) { - result[index] = result[rand]; - } - result[rand] = collection[index]; - } - return result; - } - /** - * Gets the size of `collection` by returning `collection.length` for - * array-like values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2]); - * // => 2 - * - * _.size({ 'one': 1, 'two': 2, 'three': 3 }); - * // => 3 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - var length = collection ? collection.length : 0; - return isLength(length) ? length : keys(collection).length; - } - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments; (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the "_.property" callback shorthand - * _.some(users, 'active'); - * // => true - * - * // using the "_.matches" callback shorthand - * _.some(users, { 'age': 1 }); - * // => false - */ - function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (typeof predicate != 'function' || typeof thisArg != 'undefined') { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] The function - * invoked per iteration. If a property name or an object is provided it is - * used to create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the "_.property" callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function sortBy(collection, iteratee, thisArg) { - var index = -1, length = collection ? collection.length : 0, result = isLength(length) ? Array(length) : []; - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - iteratee = getCallback(iteratee, thisArg, 3); - baseEach(collection, function (value, key, collection) { - result[++index] = { - 'criteria': iteratee(value, key, collection), - 'index': index, - 'value': value - }; - }); - return baseSortBy(result, compareAscending); - } - /** - * This method is like `_.sortBy` except that it sorts by property names - * instead of an iteratee function. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(string|string[])} props The property names to sort by, - * specified as individual property names or arrays of property names. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 26 }, - * { 'user': 'fred', 'age': 30 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] - */ - function sortByAll(collection) { - var args = arguments; - if (args.length > 3 && isIterateeCall(args[1], args[2], args[3])) { - args = [ - collection, - args[1] - ]; - } - var index = -1, length = collection ? collection.length : 0, props = baseFlatten(args, false, false, 1), result = isLength(length) ? Array(length) : []; - baseEach(collection, function (value, key, collection) { - var length = props.length, criteria = Array(length); - while (length--) { - criteria[length] = value == null ? undefined : value[props[length]]; - } - result[++index] = { - 'criteria': criteria, - 'index': index, - 'value': value - }; - }); - return baseSortBy(result, compareMultipleAscending); - } - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'status': 'busy', 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'status': 'busy', 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36 }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - * - * _.pluck(_.where(users, { 'status': 'busy' }), 'user'); - * // => ['barney', 'fred'] - */ - function where(collection, source) { - return filter(collection, baseMatches(source)); - } - /*------------------------------------------------------------------------*/ - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = nativeNow || function () { - return new Date().getTime(); - }; - /*------------------------------------------------------------------------*/ - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ - function after(n, func) { - if (!isFunction(func)) { - if (isFunction(n)) { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function () { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - /** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = null; - } - n = func && n == null ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, null, null, null, null, n); - } - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (!isFunction(func)) { - if (isFunction(n)) { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function () { - if (--n > 0) { - result = func.apply(this, arguments); - } else { - func = null; - } - return result; - }; - } - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the `length` - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [args] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - function bind(func, thisArg) { - var bitmask = BIND_FLAG; - if (arguments.length > 2) { - var partials = baseSlice(arguments, 2), holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); - } - /** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the `length` property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { console.log('clicked ' + this.label); } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ - function bindAll(object) { - return baseBindAll(object, arguments.length > 1 ? baseFlatten(arguments, false, false, 1) : functions(object)); - } - /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [args] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - function bindKey(object, key) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (arguments.length > 2) { - var partials = baseSlice(arguments, 2), holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); - } - /** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the `length` property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = null; - } - var result = createWrapper(func, CURRY_FLAG, null, null, null, null, null, arity); - result.placeholder = curry.placeholder; - return result; - } - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the `length` property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = null; - } - var result = createWrapper(func, CURRY_RIGHT_FLAG, null, null, null, null, null, arity); - result.placeholder = curryRight.placeholder; - return result; - } - /** - * Creates a function that delays invoking `func` until after `wait` milliseconds - * have elapsed since the last time it was invoked. The created function comes - * with a `cancel` method to cancel delayed invocations. Provide an options - * object to indicate that `func` should be invoked on the leading and/or - * trailing edge of the `wait` timeout. Subsequent calls to the debounced - * function return the result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} wait The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ - function debounce(func, wait, options) { - var args, maxTimeoutId, result, stamp, thisArg, timeoutId, trailingCall, lastCalled = 0, maxWait = false, trailing = true; - if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : wait; - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? options.trailing : trailing; - } - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - } - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - function maxDelayed() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || maxWait !== wait) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), isCalled = remaining <= 0 || remaining > maxWait; - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - return result; - } - debounced.cancel = cancel; - return debounced; - } - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { console.log(text); }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ - function defer(func) { - return baseDelay(func, 1, arguments, 1); - } - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { console.log(text); }, 1000, 'later'); - * // => logs 'later' after one second - */ - function delay(func, wait) { - return baseDelay(func, wait, arguments, 2); - } - /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function add(x, y) { - * return x + y; - * } - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(add, square); - * addSquare(1, 2); - * // => 9 - */ - function flow() { - var funcs = arguments, length = funcs.length; - if (!length) { - return function () { - }; - } - if (!arrayEvery(funcs, isFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function () { - var index = 0, result = funcs[index].apply(this, arguments); - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - } - /** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function add(x, y) { - * return x + y; - * } - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, add); - * addSquare(1, 2); - * // => 9 - */ - function flowRight() { - var funcs = arguments, fromIndex = funcs.length - 1; - if (fromIndex < 0) { - return function () { - }; - } - if (!arrayEvery(funcs, isFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function () { - var index = fromIndex, result = funcs[index].apply(this, arguments); - while (index--) { - result = funcs[index].call(this, result); - } - return result; - }; - } - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the ES `Map` method interface - * of `get`, `has`, and `set`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * for more details. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ - function memoize(func, resolver) { - if (!isFunction(func) || resolver && !isFunction(resolver)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function () { - var cache = memoized.cache, key = resolver ? resolver.apply(this, arguments) : arguments[0]; - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, arguments); - cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache(); - return memoized; - } - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (!isFunction(predicate)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function () { - return !predicate.apply(this, arguments); - }; - } - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @type Function - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(func, 2); - } - /** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the `length` property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [args] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - function partial(func) { - var partials = baseSlice(arguments, 1), holders = replaceHolders(partials, partial.placeholder); - return createWrapper(func, PARTIAL_FLAG, null, partials, holders); - } - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the `length` property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [args] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - function partialRight(func) { - var partials = baseSlice(arguments, 1), holders = replaceHolders(partials, partialRight.placeholder); - return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders); - } - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { return n * 3; }, [1, 2, 3]); - * // => [3, 6, 9] - */ - function rearg(func) { - var indexes = baseFlatten(arguments, false, false, 1); - return createWrapper(func, REARG_FLAG, null, null, null, indexes); - } - /** - * Creates a function that only invokes `func` at most once per every `wait` - * milliseconds. The created function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the throttled function return the result of the last - * `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} wait The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }) - * jQuery('.interactive').on('click', throttled); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, trailing = true; - if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = +wait; - debounceOptions.trailing = trailing; - return debounce(func, wait, debounceOptions); - } - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

      ' + func(text) + '

      '; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

      fred, barney, & pebbles

      ' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); - } - /*------------------------------------------------------------------------*/ - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, - * otherwise they are assigned by reference. If `customizer` is provided it is - * invoked to produce the cloned values. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the structured clone algorithm. - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) - * for more details. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var shallow = _.clone(users); - * shallow[0] === users[0]; - * // => true - * - * var deep = _.clone(users, true); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var body = _.clone(document.body, function(value) { - * return _.isElement(value) ? value.cloneNode(false) : undefined; - * }); - * - * body === document.body - * // => false - * body.nodeName - * // => BODY - * body.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, customizer, thisArg) { - // Juggle arguments. - if (typeof isDeep != 'boolean' && isDeep != null) { - thisArg = customizer; - customizer = isIterateeCall(value, isDeep, thisArg) ? null : isDeep; - isDeep = false; - } - customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1); - return baseClone(value, isDeep, customizer); - } - /** - * Creates a deep clone of `value`. If `customizer` is provided it is invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the structured clone algorithm. - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) - * for more details. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * return _.isElement(value) ? value.cloneNode(true) : undefined; - * }); - * - * body === document.body - * // => false - * body.nodeName - * // => BODY - * body.childNodes.length; - * // => 20 - */ - function cloneDeep(value, customizer, thisArg) { - customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1); - return baseClone(value, true, customizer); - } - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - var length = isObjectLike(value) ? value.length : undefined; - return isLength(length) && objToString.call(value) == argsTag || false; - } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * (function() { return _.isArray(arguments); })(); - * // => false - */ - var isArray = nativeIsArray || function (value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag || false; - }; - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || isObjectLike(value) && objToString.call(value) == boolTag || false; - } - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objToString.call(value) == dateTag || false; - } - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return value && value.nodeType === 1 && isObjectLike(value) && objToString.call(value).indexOf('Element') > -1 || false; - } - // Fallback for environments without DOM support. - if (!support.dom) { - isElement = function (value) { - return value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value) || false; - }; - } - /** - * Checks if a value is empty. A value is considered empty unless it is an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - var length = value.length; - if (isLength(length) && (isArray(value) || isString(value) || isArguments(value) || isObjectLike(value) && isFunction(value.splice))) { - return !length; - } - return !keys(value).length; - } - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is invoked to compare values. - * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments; (value, other [, index|key]). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * // using a customizer callback - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqual(array, other, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3); - if (!customizer && isStrictComparable(value) && isStrictComparable(other)) { - return value === other; - } - var result = customizer ? customizer(value, other) : undefined; - return typeof result == 'undefined' ? baseIsEqual(value, other, customizer) : !!result; - } - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag || false; - } - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on ES `Number.isFinite`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) - * for more details. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - var isFinite = nativeNumIsFinite || function (value) { - return typeof value == 'number' && nativeIsFinite(value); - }; - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; - } - // Fallback for environments that return incorrect `typeof` operator results. - if (isFunction(/x/) || Uint8Array && !isFunction(Uint8Array)) { - isFunction = function (value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return objToString.call(value) == funcTag; - }; - } - /** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return type == 'function' || value && type == 'object' || false; - } - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. If `customizer` is provided - * it is invoked to compare values. If `customizer` returns `undefined` - * comparisons are handled by the method instead. The `customizer` is bound - * to `thisArg` and invoked with three arguments; (value, other, index|key). - * - * **Note:** This method supports comparing properties of arrays, booleans, - * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions - * and DOM nodes are **not** supported. Provide a customizer function to extend - * support for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} source The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - * - * // using a customizer callback - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatch(object, source, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isMatch(object, source, customizer, thisArg) { - var props = keys(source), length = props.length; - customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3); - if (!customizer && length == 1) { - var key = props[0], value = source[key]; - if (isStrictComparable(value)) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - } - } - var values = Array(length), strictCompareFlags = Array(length); - while (length--) { - value = values[length] = source[props[length]]; - strictCompareFlags[length] = isStrictComparable(value); - } - return baseIsMatch(object, props, values, strictCompareFlags, customizer); - } - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as native `isNaN` which returns `true` - * for `undefined` and other non-numeric values. See the [ES5 spec](https://es5.github.io/#x15.1.2.4) - * for more details. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some host objects in IE. - return isNumber(value) && value != +value; - } - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (objToString.call(value) == funcTag) { - return reNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reHostCtor.test(value) || false; - } - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || isObjectLike(value) && objToString.call(value) == numberTag || false; - } - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function (value) { - if (!(value && objToString.call(value) == objectTag)) { - return false; - } - var valueOf = value.valueOf, objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - return objProto ? value == objProto || getPrototypeOf(value) == objProto : shimIsPlainObject(value); - }; - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObjectLike(value) && objToString.call(value) == regexpTag || false; - } - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || isObjectLike(value) && objToString.call(value) == stringTag || false; - } - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && typedArrayTags[objToString.call(value)] || false; - } - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3); - * // => [2, 3] - */ - function toArray(value) { - var length = value ? value.length : 0; - if (!isLength(length)) { - return values(value); - } - if (!length) { - return []; - } - return arrayCopy(value); - } - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return baseCopy(value, keysIn(value)); - } - /*------------------------------------------------------------------------*/ - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments; - * (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); - * // => { 'user': 'fred', 'age': 40 } - * - * // using a customizer callback - * var defaults = _.partialRight(_.assign, function(value, other) { - * return typeof value == 'undefined' ? other : value; - * }); - * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var assign = createAssigner(baseAssign); - /** - * Creates an object that inherits from the given `prototype` object. If a - * `properties` object is provided its own enumerable properties are assigned - * to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties, guard) { - var result = baseCreate(prototype); - if (guard && isIterateeCall(prototype, properties, guard)) { - properties = null; - } - return properties ? baseCopy(properties, result, keys(properties)) : result; - } - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional defaults of the same property are ignored. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - function defaults(object) { - if (object == null) { - return object; - } - var args = arrayCopy(arguments); - args.push(assignDefaults); - return assign.apply(undefined, args); - } - /** - * This method is like `_.findIndex` except that it returns the key of the - * first element `predicate` returns truthy for, instead of the element itself. - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(chr) { return chr.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // using the "_.matches" callback shorthand - * _.findKey(users, { 'age': 1 }); - * // => 'pebbles' - * - * // using the "_.property" callback shorthand - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(object, predicate, baseForOwn, true); - } - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * If a property name is provided for `predicate` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `predicate` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(chr) { return chr.age < 40; }); - * // => returns `pebbles` assuming `_.findKey` returns `barney` - * - * // using the "_.matches" callback shorthand - * _.findLastKey(users, { 'age': 36 }); - * // => 'barney' - * - * // using the "_.property" callback shorthand - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(object, predicate, baseForOwnRight, true); - } - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked - * with three arguments; (value, key, object). Iterator functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) - */ - function forIn(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || typeof thisArg != 'undefined') { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return baseFor(object, iteratee, keysIn); - } - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' - */ - function forInRight(object, iteratee, thisArg) { - iteratee = bindCallback(iteratee, thisArg, 3); - return baseForRight(object, iteratee, keysIn); - } - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The `iteratee` is bound to `thisArg` and invoked with - * three arguments; (value, key, object). Iterator functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { - * console.log(key); - * }); - * // => logs '0', '1', and 'length' (iteration order is not guaranteed) - */ - function forOwn(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || typeof thisArg != 'undefined') { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return baseForOwn(object, iteratee); - } - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { - * console.log(key); - * }); - * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' - */ - function forOwnRight(object, iteratee, thisArg) { - iteratee = bindCallback(iteratee, thisArg, 3); - return baseForRight(object, iteratee, keys); - } - /** - * Creates an array of function property names from all enumerable properties, - * own and inherited, of `object`. - * - * @static - * @memberOf _ - * @alias methods - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * _.functions(_); - * // => ['all', 'any', 'bind', ...] - */ - function functions(object) { - return baseFunctions(object, keysIn(object)); - } - /** - * Checks if `key` exists as a direct property of `object` instead of an - * inherited property. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @param {string} key The key to check. - * @returns {boolean} Returns `true` if `key` is a direct property, else `false`. - * @example - * - * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); - * // => true - */ - function has(object, key) { - return object ? hasOwnProperty.call(object, key) : false; - } - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiValue` is `true`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {boolean} [multiValue] Allow multiple values per key. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new inverted object. - * @example - * - * _.invert({ 'first': 'fred', 'second': 'barney' }); - * // => { 'fred': 'first', 'barney': 'second' } - * - * // without `multiValue` - * _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }); - * // => { 'fred': 'third', 'barney': 'second' } - * - * // with `multiValue` - * _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }, true); - * // => { 'fred': ['first', 'third'], 'barney': ['second'] } - */ - function invert(object, multiValue, guard) { - if (guard && isIterateeCall(object, multiValue, guard)) { - multiValue = null; - } - var index = -1, props = keys(object), length = props.length, result = {}; - while (++index < length) { - var key = props[index], value = object[key]; - if (multiValue) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } else { - result[value] = key; - } - } - return result; - } - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = !nativeKeys ? shimKeys : function (object) { - if (object) { - var Ctor = object.constructor, length = object.length; - } - if (typeof Ctor == 'function' && Ctor.prototype === object || typeof object != 'function' && (length && isLength(length))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; - }; - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = length && isLength(length) && (isArray(object) || support.nonEnumArgs && isArguments(object)) && length || 0; - var Ctor = object.constructor, index = -1, isProto = typeof Ctor == 'function' && Ctor.prototype == object, result = Array(length), skipIndexes = length > 0; - while (++index < length) { - result[index] = index + ''; - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is bound to `thisArg` and invoked with three arguments; - * (value, key, object). - * - * If a property name is provided for `iteratee` the created "_.property" - * style callback returns the property value of the given element. - * - * If an object is provided for `iteratee` the created "_.matches" style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(n) { return n * 3; }); - * // => { 'a': 3, 'b': 6, 'c': 9 } - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * // using the "_.property" callback shorthand - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee, thisArg) { - var result = {}; - iteratee = getCallback(iteratee, thisArg, 3); - baseForOwn(object, function (value, key, object) { - result[key] = iteratee(value, key, object); - }); - return result; - } - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments; (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize merging properties. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * return _.isArray(a) ? a.concat(b) : undefined; - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var merge = createAssigner(baseMerge); - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * Property names may be specified as individual arguments or as arrays of - * property names. If `predicate` is provided it is invoked for each property - * of `object` omitting the properties `predicate` returns truthy for. The - * predicate is bound to `thisArg` and invoked with three arguments; - * (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ - function omit(object, predicate, thisArg) { - if (object == null) { - return {}; - } - if (typeof predicate != 'function') { - var props = arrayMap(baseFlatten(arguments, false, false, 1), String); - return pickByArray(object, baseDifference(keysIn(object), props)); - } - predicate = bindCallback(predicate, thisArg, 3); - return pickByCallback(object, function (value, key, object) { - return !predicate(value, key, object); - }); - } - /** - * Creates a two dimensional array of the key-value pairs for `object`, - * e.g. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) - */ - function pairs(object) { - var index = -1, props = keys(object), length = props.length, result = Array(length); - while (++index < length) { - var key = props[index]; - result[index] = [ - key, - object[key] - ]; - } - return result; - } - /** - * Creates an object composed of the picked `object` properties. Property - * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` - * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments; (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.pick(object, 'user'); - * // => { 'user': 'fred' } - * - * _.pick(object, _.isString); - * // => { 'user': 'fred' } - */ - function pick(object, predicate, thisArg) { - if (object == null) { - return {}; - } - return typeof predicate == 'function' ? pickByCallback(object, bindCallback(predicate, thisArg, 3)) : pickByArray(object, baseFlatten(arguments, false, false, 1)); - } - /** - * Resolves the value of property `key` on `object`. If the value of `key` is - * a function it is invoked with the `this` binding of `object` and its result - * is returned, else the property value is returned. If the property value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {string} key The key of the property to resolve. - * @param {*} [defaultValue] The value returned if the property value - * resolves to `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'user': 'fred', 'age': _.constant(40) }; - * - * _.result(object, 'user'); - * // => 'fred' - * - * _.result(object, 'age'); - * // => 40 - * - * _.result(object, 'status', 'busy'); - * // => 'busy' - * - * _.result(object, 'status', _.constant('busy')); - * // => 'busy' - */ - function result(object, key, defaultValue) { - var value = object == null ? undefined : object[key]; - if (typeof value == 'undefined') { - value = defaultValue; - } - return isFunction(value) ? value.call(object) : value; - } - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked - * with four arguments; (accumulator, value, key, object). Iterator functions - * may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var squares = _.transform([1, 2, 3, 4, 5, 6], function(result, n) { - * n *= n; - * if (n % 2) { - * return result.push(n) < 3; - * } - * }); - * // => [1, 9, 25] - * - * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { - * result[key] = n * 3; - * }); - * // => { 'a': 3, 'b': 6, 'c': 9 } - */ - function transform(object, iteratee, accumulator, thisArg) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getCallback(iteratee, thisArg, 4); - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor() : []; - } else { - accumulator = baseCreate(typeof Ctor == 'function' && Ctor.prototype); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function (value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return baseValues(object, keys(object)); - } - /** - * Creates an array of the own and inherited enumerable property values - * of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return baseValues(object, keysIn(object)); - } - /*------------------------------------------------------------------------*/ - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = null; - } - var noMin = min == null, noMax = max == null; - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; - } else if (typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - noMax = false; - } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; - } - if (floating || min % 1 || max % 1) { - var rand = nativeRandom(); - return nativeMin(min + rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1))), max); - } - return baseRandom(min, max); - } - /*------------------------------------------------------------------------*/ - /** - * Converts `string` to camel case. - * See [Wikipedia](https://en.wikipedia.org/wiki/CamelCase) for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function (result, word, index) { - word = word.toLowerCase(); - return result + (index ? word.charAt(0).toUpperCase() + word.slice(1) : word); - }); - /** - * Capitalizes the first character of `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('fred'); - * // => 'Fred' - */ - function capitalize(string) { - string = baseToString(string); - return string && string.charAt(0).toUpperCase() + string.slice(1); - } - /** - * Deburrs `string` by converting latin-1 supplementary letters to basic latin letters. - * See [Wikipedia](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = baseToString(string); - return string && string.replace(reLatin1, deburrLetter); - } - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = baseToString(string); - target = target + ''; - var length = string.length; - position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : +position || 0, length)) - target.length; - return position >= 0 && string.indexOf(target, position) == position; - } - /** - * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't require escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#102](https://html5sec.org/#102), - * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133) of - * the [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. - * - * When working with HTML you should always quote attribute values to reduce - * XSS vectors. See [Ryan Grove's article](http://wonko.com/post/html-escaping) - * for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); - return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; - } - /** - * Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*", - * "+", "(", ")", "[", "]", "{" and "}" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = baseToString(string); - return string && reHasRegExpChars.test(string) ? string.replace(reRegExpChars, '\\$&') : string; - } - /** - * Converts `string` to kebab case (a.k.a. spinal case). - * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) for - * more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function (result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - /** - * Pads `string` on the left and right sides if it is shorter then the given - * padding length. The `chars` string may be truncated if the number of padding - * characters can't be evenly divided by the padding length. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = baseToString(string); - length = +length; - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { - return string; - } - var mid = (length - strLength) / 2, leftLength = floor(mid), rightLength = ceil(mid); - chars = createPad('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; - } - /** - * Pads `string` on the left side if it is shorter then the given padding - * length. The `chars` string may be truncated if the number of padding - * characters exceeds the padding length. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ - function padLeft(string, length, chars) { - string = baseToString(string); - return string && createPad(string, length, chars) + string; - } - /** - * Pads `string` on the right side if it is shorter then the given padding - * length. The `chars` string may be truncated if the number of padding - * characters exceeds the padding length. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ - function padRight(string, length, chars) { - string = baseToString(string); - return string && string + createPad(string, length, chars); - } - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the ES5 implementation of `parseInt`. - * See the [ES5 spec](https://es5.github.io/#E) for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard && isIterateeCall(string, radix, guard)) { - radix = 0; - } - return nativeParseInt(string, radix); - } - // Fallback for environments with pre-ES5 implementations. - if (nativeParseInt(whitespace + '08') != 8) { - parseInt = function (string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. - // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard ? isIterateeCall(string, radix, guard) : radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - string = trim(string); - return nativeParseInt(string, radix || (reHexPrefix.test(string) ? 16 : 10)); - }; - } - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n) { - var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = floor(n / 2); - string += string; - } while (n); - return result; - } - /** - * Converts `string` to snake case. - * See [Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--foo-bar'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function (result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - /** - * Converts `string` to start case. - * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage) - * for more details. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' - */ - var startCase = createCompounder(function (result, word, index) { - return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); - }); - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = baseToString(string); - position = position == null ? 0 : nativeMin(position < 0 ? 0 : +position || 0, string.length); - return string.lastIndexOf(target, position) == position; - } - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes sourceURLs for easier debugging. - * See the [HTML5 Rocks article on sourcemaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for more details. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as free variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. - * @param {string} [options.variable] The data object variable name. - * @param- {Object} [otherOptions] Enables the legacy `options` param signature. - * @returns {Function} Returns the compiled template function. - * @example - * - * // using the "interpolate" delimiter to create a compiled template - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // using the HTML "escape" delimiter to escape data property values - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' - - - - -
      {{ "%+010d"|sprintf:-123 }}
      -
      {{ "%+010d"|vsprintf:[-123] }}
      -
      {{ "%+010d"|fmt:-123 }}
      -
      {{ "%+010d"|vfmt:[-123] }}
      -
      {{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
      -
      {{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
      - - - - diff --git a/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.js b/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.js deleted file mode 100644 index dbaf744d83..0000000000 --- a/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); -//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.map b/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.map deleted file mode 100644 index 055964c624..0000000000 --- a/third_party/ui/bower_components/sprintf/dist/angular-sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/third_party/ui/bower_components/sprintf/dist/sprintf.min.js b/third_party/ui/bower_components/sprintf/dist/sprintf.min.js deleted file mode 100644 index d5bcd097f0..0000000000 --- a/third_party/ui/bower_components/sprintf/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[dief]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fiosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/third_party/ui/bower_components/sprintf/dist/sprintf.min.map b/third_party/ui/bower_components/sprintf/dist/sprintf.min.map deleted file mode 100644 index 33fe1636d5..0000000000 --- a/third_party/ui/bower_components/sprintf/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAaN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WAoJjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GA1KtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,YACNC,OAAQ,WACRC,YAAa,wFACbxB,IAAK,sBACLyB,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV5B,GAAQM,OAAS,SAASuB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYjC,EAASqB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI3B,eAAe8B,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM5C,EAAQ,yCAA0CkC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjB9B,EAASuB,KACTA,EAAMA,KAGNX,EAAGC,WAAWwB,KAAKX,EAAM,KAAyB,UAAjB1B,EAASuB,IAAoBe,MAAMf,GACpE,KAAM,IAAIgB,WAAU/C,EAAQ,0CAA2CQ,EAASuB,IAOpF,QAJIX,EAAGE,OAAOuB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAInB,SAAS,EACvB,MACA,KAAK,IACDmB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKH,EAAIoB,cAAcjB,EAAM,IAAMH,EAAIoB,eACvD,MACA,KAAK,IACDpB,EAAMG,EAAM,GAAKkB,WAAWrB,GAAKsB,QAAQnB,EAAM,IAAMkB,WAAWrB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAInB,SAAS,EACvB,MACA,KAAK,IACDmB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIuB,UAAU,EAAGpB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAInB,SAAS,GACvB,MACA,KAAK,IACDmB,EAAMA,EAAInB,SAAS,IAAI2C,eAG3BnC,EAAGE,OAAOuB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAInB,WAAW4C,QAAQpC,EAAGQ,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGuB,OAAO,GAAK,IACzEpB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAItB,EAAWqB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,EAGvH,MAAOW,GAAOvB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASqD,GAErB,IADA,GAAIC,GAAOD,EAAKxB,KAAYL,KAAiB+B,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhCzB,EAAQd,EAAGG,KAAKsC,KAAKF,IACtB9B,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQd,EAAGI,OAAOqC,KAAKF,IAC7B9B,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQd,EAAGK,YAAYoC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI5B,EAAM,GAAI,CACV0B,GAAa,CACb,IAAIG,MAAiBC,EAAoB9B,EAAM,GAAI+B,IACnD,IAAuD,QAAlDA,EAAc7C,EAAGnB,IAAI4D,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWvB,QAAUyB,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAGzB,UACnE,GAA8D,QAAzDyB,EAAc7C,EAAGM,WAAWmC,KAAKG,IAClCD,EAAWA,EAAWvB,QAAUyB,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAc7C,EAAGO,aAAakC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWvB,QAAUyB,EAAY,GAUxD/B,EAAM,GAAK6B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIhB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpCyB,EAAOA,EAAKL,UAAUpB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIqC,GAAW,SAASR,EAAK5B,EAAMqC,GAG/B,MAFAA,IAASrC,OAAYjB,MAAM,GAC3BsD,EAAMC,OAAO,EAAG,EAAGV,GACZ1D,EAAQqE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQtE,QAAUA,EAClBsE,QAAQJ,SAAWA,IAGnBnE,EAAOC,QAAUA,EACjBD,EAAOmE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACIvE,QAASA,EACTkE,SAAUA,OAKT,mBAAXnE,QAAyB0E,KAAO1E"} \ No newline at end of file diff --git a/third_party/ui/bower_components/sprintf/gruntfile.js b/third_party/ui/bower_components/sprintf/gruntfile.js deleted file mode 100644 index 246e1c3b98..0000000000 --- a/third_party/ui/bower_components/sprintf/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/third_party/ui/bower_components/sprintf/package.json b/third_party/ui/bower_components/sprintf/package.json deleted file mode 100644 index ebf4a21fe5..0000000000 --- a/third_party/ui/bower_components/sprintf/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "sprintf-js", - "version": "1.0.2", - "description": "JavaScript sprintf implementation", - "author": "Alexandru Marasteanu (http://alexei.ro/)", - "main": "src/sprintf.js", - "scripts": { - "test": "mocha test/test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/alexei/sprintf.js.git" - }, - "license": "BSD-3-Clause", - "readmeFilename": "README.md", - "devDependencies": { - "mocha": "*", - "grunt": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-uglify": "*" - } -} diff --git a/third_party/ui/bower_components/sprintf/src/angular-sprintf.js b/third_party/ui/bower_components/sprintf/src/angular-sprintf.js deleted file mode 100644 index 9c69123bea..0000000000 --- a/third_party/ui/bower_components/sprintf/src/angular-sprintf.js +++ /dev/null @@ -1,18 +0,0 @@ -angular. - module("sprintf", []). - filter("sprintf", function() { - return function() { - return sprintf.apply(null, arguments) - } - }). - filter("fmt", ["$filter", function($filter) { - return $filter("sprintf") - }]). - filter("vsprintf", function() { - return function(format, argv) { - return vsprintf(format, argv) - } - }). - filter("vfmt", ["$filter", function($filter) { - return $filter("vsprintf") - }]) diff --git a/third_party/ui/bower_components/sprintf/src/sprintf.js b/third_party/ui/bower_components/sprintf/src/sprintf.js deleted file mode 100644 index 0ccb64c981..0000000000 --- a/third_party/ui/bower_components/sprintf/src/sprintf.js +++ /dev/null @@ -1,195 +0,0 @@ -(function(window) { - var re = { - not_string: /[^s]/, - number: /[dief]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fiosuxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[\+\-]/ - } - - function sprintf() { - var key = arguments[0], cache = sprintf.cache - if (!(cache[key] && cache.hasOwnProperty(key))) { - cache[key] = sprintf.parse(key) - } - return sprintf.format.call(null, cache[key], arguments) - } - - sprintf.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]) - if (node_type === "string") { - output[output.length] = parse_tree[i] - } - else if (node_type === "array") { - match = parse_tree[i] // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor] - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) - } - arg = arg[match[2][k]] - } - } - else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - - if (get_type(arg) == "function") { - arg = arg() - } - - if (re.not_string.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { - throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) - } - - if (re.number.test(match[8])) { - is_positive = arg >= 0 - } - - switch (match[8]) { - case "b": - arg = arg.toString(2) - break - case "c": - arg = String.fromCharCode(arg) - break - case "d": - case "i": - arg = parseInt(arg, 10) - break - case "e": - arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() - break - case "f": - arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) - break - case "o": - arg = arg.toString(8) - break - case "s": - arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) - break - case "u": - arg = arg >>> 0 - break - case "x": - arg = arg.toString(16) - break - case "X": - arg = arg.toString(16).toUpperCase() - break - } - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") - } - else { - sign = "" - } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) - } - } - return output.join("") - } - - sprintf.cache = {} - - sprintf.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = match[0] - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = "%" - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - } - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") - } - parse_tree[parse_tree.length] = match - } - else { - throw new SyntaxError("[sprintf] unexpected placeholder") - } - _fmt = _fmt.substring(match[0].length) - } - return parse_tree - } - - var vsprintf = function(fmt, argv, _argv) { - _argv = (argv || []).slice(0) - _argv.splice(0, 0, fmt) - return sprintf.apply(null, _argv) - } - - /** - * helpers - */ - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() - } - - function str_repeat(input, multiplier) { - return Array(multiplier + 1).join(input) - } - - /** - * export to either browser or node.js - */ - if (typeof exports !== "undefined") { - exports.sprintf = sprintf - exports.vsprintf = vsprintf - } - else { - window.sprintf = sprintf - window.vsprintf = vsprintf - - if (typeof define === "function" && define.amd) { - define(function() { - return { - sprintf: sprintf, - vsprintf: vsprintf - } - }) - } - } -})(typeof window === "undefined" ? this : window); diff --git a/third_party/ui/bower_components/sprintf/test/test.js b/third_party/ui/bower_components/sprintf/test/test.js deleted file mode 100644 index 1717d8fd09..0000000000 --- a/third_party/ui/bower_components/sprintf/test/test.js +++ /dev/null @@ -1,72 +0,0 @@ -var assert = require("assert"), - sprintfjs = require("../src/sprintf.js"), - sprintf = sprintfjs.sprintf, - vsprintf = sprintfjs.vsprintf - -describe("sprintfjs", function() { - it("should return formated strings for simple placeholders", function() { - assert.equal("%", sprintf("%%")) - assert.equal("10", sprintf("%b", 2)) - assert.equal("A", sprintf("%c", 65)) - assert.equal("2", sprintf("%d", 2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("2", sprintf("%d", "2")) - assert.equal("2", sprintf("%i", "2")) - assert.equal("2e+0", sprintf("%e", 2)) - assert.equal("2", sprintf("%u", 2)) - assert.equal("4294967294", sprintf("%u", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("10", sprintf("%o", 8)) - assert.equal("%s", sprintf("%s", "%s")) - assert.equal("ff", sprintf("%x", 255)) - assert.equal("FF", sprintf("%X", 255)) - assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) - assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) - }) - - it("should return formated strings for complex placeholders", function() { - // sign - assert.equal("2", sprintf("%d", 2)) - assert.equal("-2", sprintf("%d", -2)) - assert.equal("+2", sprintf("%+d", 2)) - assert.equal("-2", sprintf("%+d", -2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("-2", sprintf("%i", -2)) - assert.equal("+2", sprintf("%+i", 2)) - assert.equal("-2", sprintf("%+i", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("-2.2", sprintf("%f", -2.2)) - assert.equal("+2.2", sprintf("%+f", 2.2)) - assert.equal("-2.2", sprintf("%+f", -2.2)) - assert.equal("-2.3", sprintf("%+.1f", -2.34)) - assert.equal("-0.0", sprintf("%+.1f", -0.01)) - assert.equal("-000000123", sprintf("%+010d", -123)) - assert.equal("______-123", sprintf("%+'_10d", -123)) - assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) - - // padding - assert.equal("-0002", sprintf("%05d", -2)) - assert.equal("-0002", sprintf("%05i", -2)) - assert.equal(" <", sprintf("%5s", "<")) - assert.equal("0000<", sprintf("%05s", "<")) - assert.equal("____<", sprintf("%'_5s", "<")) - assert.equal("> ", sprintf("%-5s", ">")) - assert.equal(">0000", sprintf("%0-5s", ">")) - assert.equal(">____", sprintf("%'_-5s", ">")) - assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) - assert.equal("1234", sprintf("%02u", 1234)) - assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) - assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) - - // precision - assert.equal("2.3", sprintf("%.1f", 2.345)) - assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) - assert.equal(" x", sprintf("%5.1s", "xxxxxx")) - - }) - - it("should return formated strings for callbacks", function() { - assert.equal("foobar", sprintf("%s", function() { return "foobar" })) - assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... - }) -}) diff --git a/third_party/ui/bower_components/string-format-js/.bower.json b/third_party/ui/bower_components/string-format-js/.bower.json deleted file mode 100644 index 66ef0ed3b1..0000000000 --- a/third_party/ui/bower_components/string-format-js/.bower.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "string-format-js", - "main": "format.js", - "version": "0.1.2", - "homepage": "https://github.com/tmaeda1981jp/string-format-js", - "authors": [ - "tmaeda1981jp " - ], - "description": "String format function for javascript", - "keywords": [ - "string", - "format" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "libs", - "test", - "tests" - ], - "_release": "0.1.2", - "_resolution": { - "type": "version", - "tag": "v0.1.2", - "commit": "52882d494f39ec556dd73b75f4e45e4f78f1f7bb" - }, - "_source": "git://github.com/tmaeda1981jp/string-format-js.git", - "_target": "~0.1.2", - "_originalSource": "string-format-js" -} \ No newline at end of file diff --git a/third_party/ui/bower_components/string-format-js/Gruntfile.js b/third_party/ui/bower_components/string-format-js/Gruntfile.js deleted file mode 100644 index 779127cf6d..0000000000 --- a/third_party/ui/bower_components/string-format-js/Gruntfile.js +++ /dev/null @@ -1,62 +0,0 @@ -/*jslint white: true, nomen: true, maxlen: 120, plusplus: true, */ -/*global _:false, $:false, define:false, require:false, */ - -module.exports = function(grunt) { - - 'use strict'; - - // Add the grunt-mocha-test tasks. - grunt.loadNpmTasks('grunt-mocha-test'); - grunt.loadNpmTasks('grunt-mocha-phantomjs'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { - my_target: { - options: { - mangle: true, - compress: true, - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %> */' - }, - files: { - 'format.min.js': ['format.js'] - } - } - }, - - mochaTest: { - test: { - options: { -// grep: '%b', - reporter: 'spec' - }, - src: ['test/format.spec.js'] - } - }, - - mocha_phantomjs: { - options: { - reporter: 'spec' - }, - all: ['test/**/*.html'] - }, - - watch: { - mochaTest: { - files: ['format.js', 'test/format.spec.js'], - tasks: ['mochaTest'] - }, - browserTest: { - files: ['format.js', 'test/format.spec.js'], - tasks: ['mocha_phantomjs'] - } - } - }); - - grunt.registerTask('default', 'mochaTest'); - grunt.registerTask('browserTest', 'mocha_phantomjs'); - -}; diff --git a/third_party/ui/bower_components/string-format-js/LICENSE.txt b/third_party/ui/bower_components/string-format-js/LICENSE.txt deleted file mode 100644 index d2b9895e47..0000000000 --- a/third_party/ui/bower_components/string-format-js/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 tmaeda1981jp - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/third_party/ui/bower_components/string-format-js/README.md b/third_party/ui/bower_components/string-format-js/README.md deleted file mode 100644 index 5c6fa83aab..0000000000 --- a/third_party/ui/bower_components/string-format-js/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# string-format-js - -[![Build Status](https://travis-ci.org/tmaeda1981jp/string-format-js.png?branch=master)](https://travis-ci.org/tmaeda1981jp/string-format-js) - - -## Synopsis - -String format function for javascript. - -## Code Example - -### %d - -```javascript -'%d'.format(10) === '10' -'%d, %d'.format(5, 10) === '5, 10' -'%d, %d and %d'.format(5, 10, 15) === '5, 10 and 15' -'%05d'.format(123) === '00123' -'%03d, %05d'.format(1, 123) === '001, 00123' -'[%5d]'.format(123) === '[ 123]' -'[%10d]'.format(123) === '[ 123]' -'[%-5d]'.format(123) === '[123 ]' -'[%-10d]'.format(123) === '[123 ]' -``` - -### %s - -```javascript -'This is a %s'.format('pen') === 'This is a pen' -'This %s %s %s'.format('is', 'a', 'pen') === 'This is a pen' -'[%5s]'.format('abc') === '[ abc]' -'[%-5s]'.format('abc') === '[abc ]' -'[%.4s]'.format('abcde') === '[abcd]' -'[%5.4s]'.format('abcde') === '[ abcd]' -'[%-5.4s]'.format('abcde') === '[abcd ]' -'[%-5.4s]'.format('あいうえお') === '[あいうえ ]' -``` - -### %o - -```javascript -'123 => %o'.format(123) === '123 => 173' -'0x7b => %o'.format(0x7b) === '0x7b => 173' -``` - -### %b - -```javascript -'123 => %b'.format(123) === '123 => 1111011' -'0x7b => %b'.format(0x7b) === '0x7b => 1111011' -``` - -### %x - -```javascript -'123 => %x'.format(123) === '123 => 7b' -``` - -### %X - -```javascript -'123 => %X'.format(123) === '123 => 7B' -``` - -### %u - -```javascript -'%u'.format(0x12345678 ^ 0xFFFFFFFF) === '3989547399' -'%u'.format(-1) === '4294967295' -``` - -### %c - -```javascript -'%c'.format(97) === 'a' -'%c'.format(0x61) === 'a' -``` - -### %f - -```javascript -'%f'.format(1.0) === '1.000000' -'%.2f'.format(1.0) === '1.00' -'[%10f]'.format(1.0) === '[1.00000000]' -'[%10.2f]'.format(1.0) === '[ 1.00]' -'[%10.2f]'.format(1.2345) === '[ 1.23]' -'[%-10.2f]'.format(1.0) === '[1.00 ]' -``` -### %e - -```javascript -'%e'.format(123) === '1.23e+2' -'%e'.format(123.45) === '1.2345e+2' -'%.5e'.format(123.45) === '1.23450e+2' -'[%15e]'.format(123.45) === '[1.2345000000e+2]' -'[%20e]'.format(12345678901.45) === '[1.23456789014500e+10]' -'[%15.2e]'.format(123.45) === '[ 1.23e+2]' -'[%7.2e]'.format(123.45) === '[1.23e+2]' -'[%-15.2e]'.format(123.45) === '[1.23e+2 ]' -``` -### hash - -```javascript -'#{name}'.format({name:'Takashi Maeda'}) === 'Takashi Maeda' -'#{first} #{last}'.format({first:'Takashi', last:'Maeda'}) === 'Takashi Maeda' -'#{a} #{b}, #{c} #{d}'.format(a:'Easy', b:'come', c:'easy', d:'go'}) === 'Easy come, easy go' -``` - -## Installation - -### node - -```bash -$ npm install string-format-js -``` - -### bower - -```bash -$ bower install string-format-js -``` - -## Tests - -### node - -```bash -$ grunt mochaTest -``` - -### browser - -```bash -$ grunt browserTest -``` - -## License - -This software is released under the MIT License, see LICENSE.txt. diff --git a/third_party/ui/bower_components/string-format-js/bower.json b/third_party/ui/bower_components/string-format-js/bower.json deleted file mode 100644 index ca1a7824a6..0000000000 --- a/third_party/ui/bower_components/string-format-js/bower.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "string-format-js", - "main": "format.js", - "version": "0.1.2", - "homepage": "https://github.com/tmaeda1981jp/string-format-js", - "authors": [ - "tmaeda1981jp " - ], - "description": "String format function for javascript", - "keywords": [ - "string", - "format" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "libs", - "test", - "tests" - ] -} diff --git a/third_party/ui/bower_components/string-format-js/format.js b/third_party/ui/bower_components/string-format-js/format.js deleted file mode 100644 index bb4a64cfa1..0000000000 --- a/third_party/ui/bower_components/string-format-js/format.js +++ /dev/null @@ -1,250 +0,0 @@ -/*jslint white: true, nomen: true, maxlen: 120, plusplus: true, */ -/*global _:false, $:false, define:false, require:false, */ - -(function(global, undefined) { - - 'use strict'; - - var string = global.String; - - if (!string.prototype.format) { - - string.prototype.format = function() { - - var i, - result = this, - - isNumber = function(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - }, - - Formatter = (function() { - var Constr = function(identifier) { - var array = function(len){ return new Array(len); }; - - switch(true) { - case /^#\{(\w+)\}*$/.test(identifier): - this.formatter = function(line, param) { - return line.replace('#{' + RegExp.$1 + '}', param[RegExp.$1]); - }; - break; - case /^([ds])$/.test(identifier): - this.formatter = function(line, param) { - if (RegExp.$1 === 'd' && !isNumber(param)) { - throw new TypeError(); - } - return line.replace("%" + identifier, param); - }; - break; - - // Octet - case /^(o)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - return line.replace( - "%" + identifier, - parseInt(param).toString(8)); - }; - break; - - // Binary - case /^(b)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - return line.replace( - "%" + identifier, - parseInt(param).toString(2)); - }; - break; - - // Hex - case /^([xX])$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - var hex = parseInt(param).toString(16); - if (identifier === 'X') { hex = hex.toUpperCase(); } - return line.replace("%" + identifier, hex); - }; - break; - - case /^(c)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - return line.replace("%" + identifier, String.fromCharCode(param)); - }; - break; - - case /^(u)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - return line.replace("%" + identifier, parseInt(param, 10) >>> 0); - }; - break; - - case /^(-?)(\d*).?(\d?)(e)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - var lpad = RegExp.$1 === '-', - width = RegExp.$2, - decimal = RegExp.$3 !== '' ? RegExp.$3: undefined, - val = param.toExponential(decimal), - mantissa, exponent, padLength - ; - - if (width !== '') { - if (decimal !== undefined) { - padLength = width - val.length; - if (padLength >= 0){ - val = lpad ? - val + array(padLength + 1).join(" "): - array(padLength + 1).join(" ") + val; - } - else { - // TODO throw ? - } - } - else { - mantissa = val.split('e')[0]; - exponent = 'e' + val.split('e')[1]; - padLength = width - (mantissa.length + exponent.length); - val = padLength >= 0 ? - mantissa + (array(padLength + 1)).join("0") + exponent : - mantissa.slice(0, padLength) + exponent; - } - } - return line.replace("%" + identifier, val); - }; - break; - - case /^(-?)(\d*).?(\d?)(f)$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - var lpad = RegExp.$1 === '-', - width = RegExp.$2, - decimal = RegExp.$3, - DOT_LENGTH = '.'.length, - integralPart = param > 0 ? Math.floor(param) : Math.ceil(param), - val = parseFloat(param).toFixed(decimal !== '' ? decimal : 6), - numberPartWidth, spaceWidth; - - if (width !== '') { - if (decimal !== '') { - numberPartWidth = - integralPart.toString().length + DOT_LENGTH + parseInt(decimal, 10); - spaceWidth = width - numberPartWidth; - val = lpad ? - parseFloat(param).toFixed(decimal) + (array(spaceWidth + 1).join(" ")) : - (array(spaceWidth + 1).join(" ")) + parseFloat(param).toFixed(decimal); - } - else { - val = parseFloat(param).toFixed( - width - (integralPart.toString().length + DOT_LENGTH)); - } - } - return line.replace("%" + identifier, val); - }; - break; - - // Decimal - case /^([0\-]?)(\d+)d$/.test(identifier): - this.formatter = function(line, param) { - if (!isNumber(param)) { throw new TypeError(); } - - var len = RegExp.$2 - param.toString().length, - replaceString = '', - result; - if (len < 0) { len = 0; } - switch(RegExp.$1) { - case "": // rpad - replaceString = (array(len + 1).join(" ") + param).slice(-RegExp.$2); - break; - case "-": // lpad - replaceString = (param + array(len + 1).join(" ")).slice(-RegExp.$2); - break; - case "0": // 0pad - replaceString = (array(len + 1).join("0") + param).slice(-RegExp.$2); - break; - } - return line.replace("%" + identifier, replaceString); - }; - break; - - // String - case /^(-?)(\d)s$/.test(identifier): - this.formatter = function(line, param) { - var len = RegExp.$2 - param.toString().length, - replaceString = '', - result; - if (len < 0) { len = 0; } - switch(RegExp.$1) { - case "": // rpad - replaceString = (array(len + 1).join(" ") + param).slice(-RegExp.$2); - break; - case "-": // lpad - replaceString = (param + array(len + 1).join(" ")).slice(-RegExp.$2); - break; - default: - // TODO throw ? - } - return line.replace("%" + identifier, replaceString); - }; - break; - - // String with max length - case /^(-?\d?)\.(\d)s$/.test(identifier): - this.formatter = function(line, param) { - var replaceString = '', - max, spacelen; - - // %.4s - if (RegExp.$1 === '') { - replaceString = param.slice(0, RegExp.$2); - } - // %5.4s %-5.4s - else { - param = param.slice(0, RegExp.$2); - max = Math.abs(RegExp.$1); - spacelen = max - param.toString().length; - replaceString = RegExp.$1.indexOf('-') !== -1 ? - (param + array(spacelen + 1).join(" ")).slice(-max): // lpad - (array(spacelen + 1).join(" ") + param).slice(-max); // rpad - } - return line.replace("%" + identifier, replaceString); - }; - break; - default: - this.formatter = function(line, param) { - return line; - }; - } - }; - - Constr.prototype = { - format: function(line, param) { - return this.formatter.call(this, line, param); - } - }; - return Constr; - }()), - - args = Array.prototype.slice.call(arguments) - ; - - if (args.length === 1 && typeof args[0] === 'object') { - for (i=0; i < Object.keys(args[0]).length; i+=1) { - if (result.match(/(#\{\w+\})/)) { - result = new Formatter(RegExp.$1).format(result, args[0]); - } - } - } - else { - for (i=0; i >>0)};break;case/^(-?)(\d*).?(\d?)(e)$/.test(a):this.formatter=function(e,f){if(!d(f))throw new TypeError;var g,h,i,j="-"===RegExp.$1,k=RegExp.$2,l=""!==RegExp.$3?RegExp.$3:b,m=f.toExponential(l);return""!==k&&(l!==b?(i=k-m.length,i>=0&&(m=j?m+c(i+1).join(" "):c(i+1).join(" ")+m)):(g=m.split("e")[0],h="e"+m.split("e")[1],i=k-(g.length+h.length),m=i>=0?g+c(i+1).join("0")+h:g.slice(0,i)+h)),e.replace("%"+a,m)};break;case/^(-?)(\d*).?(\d?)(f)$/.test(a):this.formatter=function(b,e){if(!d(e))throw new TypeError;var f,g,h="-"===RegExp.$1,i=RegExp.$2,j=RegExp.$3,k=".".length,l=e>0?Math.floor(e):Math.ceil(e),m=parseFloat(e).toFixed(""!==j?j:6);return""!==i&&(""!==j?(f=l.toString().length+k+parseInt(j,10),g=i-f,m=h?parseFloat(e).toFixed(j)+c(g+1).join(" "):c(g+1).join(" ")+parseFloat(e).toFixed(j)):m=parseFloat(e).toFixed(i-(l.toString().length+k))),b.replace("%"+a,m)};break;case/^([0\-]?)(\d+)d$/.test(a):this.formatter=function(b,e){if(!d(e))throw new TypeError;var f=RegExp.$2-e.toString().length,g="";switch(0>f&&(f=0),RegExp.$1){case"":g=(c(f+1).join(" ")+e).slice(-RegExp.$2);break;case"-":g=(e+c(f+1).join(" ")).slice(-RegExp.$2);break;case"0":g=(c(f+1).join("0")+e).slice(-RegExp.$2)}return b.replace("%"+a,g)};break;case/^(-?)(\d)s$/.test(a):this.formatter=function(b,d){var e=RegExp.$2-d.toString().length,f="";switch(0>e&&(e=0),RegExp.$1){case"":f=(c(e+1).join(" ")+d).slice(-RegExp.$2);break;case"-":f=(d+c(e+1).join(" ")).slice(-RegExp.$2)}return b.replace("%"+a,f)};break;case/^(-?\d?)\.(\d)s$/.test(a):this.formatter=function(b,d){var e,f,g="";return""===RegExp.$1?g=d.slice(0,RegExp.$2):(d=d.slice(0,RegExp.$2),e=Math.abs(RegExp.$1),f=e-d.toString().length,g=-1!==RegExp.$1.indexOf("-")?(d+c(f+1).join(" ")).slice(-e):(c(f+1).join(" ")+d).slice(-e)),b.replace("%"+a,g)};break;default:this.formatter=function(a){return a}}};return a.prototype={format:function(a,b){return this.formatter.call(this,a,b)}},a}(),f=Array.prototype.slice.call(arguments);if(1===f.length&&"object"==typeof f[0])for(a=0;a/ui/ -``` - -which redirects to: - -``` -https:///api/v1/proxy/namespaces/kube-system/services/kube-ui/ -``` - -## Configuration -### Configuration settings -A json file can be used by `gulp` to automatically create angular constants. This is useful for setting per environment variables such as api endpoints. - -`www/master/shared/config/development.json` and `www/master/shared/config/production.json` are used for application wide configuration in development and production, respectively. - -* `www/master/shared/config/production.json` is kept under source control with default values for production. -* `www/master/shared/config/development.json` is not kept under source control. Each developer can create a local version of the file by copy, paste and rename from `www/master/shared/config/development.example.json`, which is kept under source control with default values for development. - -The configuration files for the current build environment are compiled into the intermediary `www/master/shared/config/generated-config.js`, which is then compiled into `app.js`. - -* Component configuration added to `www/master/components//config/.json` is combined with the application wide configuration during the build. - -The generated angular constant is named `ENV`. The shared configuration and component configurations each generate a nested object within it. For example: - -``` -www/master -├── shared/config/development.json -└── components - ├── dashboard/config/development.json - └── my_component/config/development.json -``` -generates the following in `www/master/shared/config/generated-config.js`: - -``` -angular.module('kubernetesApp.config', []) -.constant('ENV', { - '/': , - 'dashboard': , - 'my_component': -}); -``` - -### Kubernetes server configuration -**RECOMMENDED**: The Kubernetes api server does not enable CORS by default, so `kube-apiserver` must be started with `--cors-allowed-origins=http://` or `--cors-allowed-origins=.*`. - -**NOT RECOMMENDED**: If you don't want to/cannot restart the Kubernetes api server, you can start your browser with web security disabled. For example, you can [launch Chrome](http://www.chromium.org/developers/how-tos/run-chromium-with-flags) with flag `--disable-web-security`. Be careful not to visit untrusted web sites when running your browser in this mode. - -## Building a new visualizer or component -See [master/components/README.md](master/components/README.md). - -## Testing -Currently, the UI project includes both unit-testing with [Karma](http://karma-runner.github.io/0.12/index.html) and end-to-end testing with [Protractor](http://angular.github.io/protractor/#/). - -### Unit testing with Karma -To run the existing Karma tests: - -* Install the Karma CLI (Note: it needs to be installed globally, so the `sudo` below may be needed. The other Karma packages, such as `karma`, `karma-jasmine`, and `karma-chrome-launcher,` should be installed automatically by the build). - -``` -sudo npm install -g karma-cli -``` - -* Edit the Karma configuration in `www/master/karma.config.js`, if necessary. -* Run the tests. The console should show the test results. - -``` -cd www/master -karma start karma.conf.js -``` - -To run new Karma tests for a component, put new `*.spec.js` files under the appropriate `www/master/components/**/test/modules/*` directories. - -To test the chrome, put new `*.spec.js` files under the appropriate `www/master/test/modules/*` directories. - -### End-to-end testing with Protractor -To run the existing Protractor tests: - -* Install the CLIs. - -``` -sudo npm install -g protractor -``` - -* Edit the test configuration in `www/master/protractor/conf.js`, if necessary. -* Start the webdriver server. - -``` -sudo webdriver-manager start -``` - -* Start the application (see instructions above), running at port 8000. -* Run the tests. The console should show the test results. - -``` -cd www/master/protractor -protractor conf.js -``` - -To run new protractor tests for a component, put new `*.spec.js` files in the appropriate `www/master/components/**/protractor/*` directories. - -To test the chrome, put new `*.spec.js` files under the `www/master/protractor/chrome` directory. [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/www/README.md?pixel)]() diff --git a/www/app/assets/css/app.css b/www/app/assets/css/app.css deleted file mode 100644 index 8c40dd35f2..0000000000 --- a/www/app/assets/css/app.css +++ /dev/null @@ -1 +0,0 @@ -.nav-back{width:80px;font-size:14px;padding-left:14px;line-height:15px;background-size:14px 14px;background-repeat:no-repeat;display:block}a{text-decoration:none}.main-fab{position:absolute;z-index:20;font-size:30px;top:100px;left:24px;transform:scale(.88,.88)}.md-breadcrumb{padding-left:16px}.md-table{min-width:100%;border-collapse:collapse}.md-table tbody tr:focus,.md-table tbody tr:hover{cursor:pointer;background-color:rgba(63,81,181,.2)}.md-table-header{border-bottom:1px solid #e6e6e6;color:#828282;text-align:left;font-size:.75em;font-weight:700;padding:16px 16px 16px 0}.md-table-header a{text-decoration:none;color:inherit}.md-table-caret{display:inline-block;vertical-align:middle}.md-table-content{font-size:.8em;padding:16px 16px 16px 0}.md-table-td-more{max-width:72px;width:72px;padding:16px}.md-table-thumbs{max-width:104px;width:104px;padding:16px 32px}.md-table-thumbs div{overflow:hidden;width:40px;height:40px;border-radius:20px;border:1px solid rgba(0,0,0,.2);background-size:cover;box-shadow:0 8px 10px rgba(0,0,0,.3);-webkit-box-shadow:0 8px 10px rgba(0,0,0,.1)}.md-table-footer{height:40px}.md-table-count-info{line-height:40px;font-size:.75em}.md-table-footer-item{width:40px;height:40px;vertical-align:middle}.bold,.md-table-active-page{font-weight:700}.gray,.grey{color:#888}md-input-container.md-default-theme .md-input{color:#fff;border-color:#fff;margin-top:24px}.dashboard-subnav{font-size:.9em;min-height:38px;max-height:38px;background-color:#09c1d1!important}.dashboard-subnav md-select.md-default-theme:focus .md-select-label{border-bottom:none;color:#fff}.selectSubPages p{text-align:center;color:#fff}.selectSubPages .md-default-theme .md-select-label.md-placeholder{color:#fff}.selectSubPages .md-select-label{padding-top:0;font-size:1em;line-height:1em;border-bottom:none;padding-bottom:0}.selectSubPages md-select{margin-top:10px;margin-right:80px;padding:0}md-select-menu{max-height:none}.md-toolbar-tools{padding-left:8px;padding-right:8px}.md-toolbar-small{height:38px;min-height:38px}.md-toolbar-tools-small{background-color:#09c1d1}.kubernetes-ui-menu,.kubernetes-ui-menu ul{list-style:none;padding:0}.kubernetes-ui-menu li{margin:0}.kubernetes-ui-menu>li{border-top:1px solid rgba(0,0,0,.12)}.kubernetes-ui-menu .md-button{border-radius:0;color:inherit;cursor:pointer;font-weight:400;line-height:40px;margin:0;max-height:40px;overflow:hidden;padding:0 16px;text-align:left;text-decoration:none;white-space:normal;width:100%}.kubernetes-ui-menu a.md-button{display:block}.kubernetes-ui-menu button.md-button::-moz-focus-inner{padding:0}.kubernetes-ui-menu .md-button.active{color:#03a9f4}.menu-heading{color:#888;display:block;font-size:inherit;font-weight:500;line-height:40px;margin:0;padding:0 16px;text-align:left;width:100%}.kubernetes-ui-menu li.parentActive,.kubernetes-ui-menu li.parentActive .menu-toggle-list{background-color:#f6f6f6}.menu-toggle-list{background:#fff;max-height:999px;overflow:hidden;position:relative;z-index:1;-webkit-transition:.75s cubic-bezier(.35,0,.25,1);-webkit-transition-property:max-height;-moz-transition:.75s cubic-bezier(.35,0,.25,1);-moz-transition-property:max-height;transition:.75s cubic-bezier(.35,0,.25,1);transition-property:max-height}.menu-toggle-list.ng-hide{max-height:0}.kubernetes-ui-menu .menu-toggle-list a.md-button{display:block;padding:0 16px 0 32px;text-transform:none}.md-button-toggle .md-toggle-icon{background:url(../img/icons/list_control_down.png) center center no-repeat;background-size:100% auto;display:inline-block;height:24px;margin:auto 0 auto auto;speak:none;width:24px;transition:transform .3s ease-in-out;-webkit-transition:-webkit-transform .3s ease-in-out}.md-button-toggle .md-toggle-icon.toggled{transform:rotate(180deg);-webkit-transform:rotate(180deg)}.menu-icon{background:0 0;border:none;margin-right:16px;padding:0}.whiteframedemoBasicUsage md-whiteframe{background:#fff;margin:2px;padding:2px}.tabsDefaultTabs{height:100%;width:100%}.tabsDefaultTabs .remove-tab{margin-bottom:40px}.tabsDefaultTabs .home-buttons .md-button{display:block;max-height:30px}.tabsDefaultTabs .home-buttons .md-button.add-tab{margin-top:20px;max-height:30px!important}.tabsDefaultTabs .demo-tab{display:block;position:relative;background:#fff;border:0 solid #000;min-height:0;width:100%}.tabsDefaultTabs .tab0,.tabsDefaultTabs .tab1,.tabsDefaultTabs .tab2,.tabsDefaultTabs .tab3{background-color:#bbdefb}.tabsDefaultTabs .md-header{background-color:#1976D2!important}.tabsDefaultTabs md-tab{color:#90caf9!important}.tabsDefaultTabs md-tab.active,.tabsDefaultTabs md-tab:focus{color:#fff!important}.tabsDefaultTabs md-tab[disabled]{opacity:.5}.tabsDefaultTabs .md-header .md-ripple{border-color:#FFFF8D!important}.tabsDefaultTabs md-tabs-ink-bar{background-color:#FFFF8D!important}.tabsDefaultTabs .title{padding-top:8px;padding-right:8px;text-align:left;text-transform:uppercase;color:#888;margin-top:24px}.tabsDefaultTabs [layout-align]>*,.tabsDefaultTabs form>[layout]>*{margin-left:8px}.tabsDefaultTabs .long>input{width:264px}.menuBtn{background-color:transparent;border:none;height:38px;margin:16px;position:absolute;width:36px}md-toolbar h1{margin:auto}md-list .md-button{color:inherit;font-weight:500;text-align:left;width:100%}md-list .md-button.selected{color:#03a9f4}#content{overflow:hidden}#content md-content{padding-left:0;padding-right:0;padding-top:0}#content .md-button.action{background-color:transparent;border:none;height:38px;margin:8px auto 16px 0;position:absolute;top:10px;right:25px;width:36px}#content img{display:block;height:auto;max-width:500px}.content-wrapper{position:relative}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}md-toolbar h1{font-size:1.25em;font-weight:400}.menuBtn{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) center center no-repeat}.actionBtn{background:url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNiIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDM2IDM2Ij4NCiAgICA8cGF0aCBkPSJNMCAwaDM2djM2aC0zNnoiIGZpbGw9Im5vbmUiLz4NCiAgICA8cGF0aCBkPSJNNCAyN2gyOHYtM2gtMjh2M3ptMC04aDI4di0zaC0yOHYzem0wLTExdjNoMjh2LTNoLTI4eiIvPg0KPC9zdmc+) center center no-repeat}.kubernetes-ui-logo{background-image:url(../img/kubernetes.svg);background-size:40px 40px;width:40px;height:40px}.kubernetes-ui-text{line-height:40px;vertical-align:middle;padding:2px}md-select-menu.md-default-theme md-option:focus:not([selected]){background:#eee}md-select-menu md-option{transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),transform .4s cubic-bezier(.25,.8,.25,1)}md-select-menu md-option:not([disabled]):focus,md-select-menu md-option:not([disabled]):hover{background-color:rgba(158,158,158,.2)}.dashboard .body-wrapper{padding:25px}.dashboard [flex-align-self=end]{-webkit-align-self:flex-end;-ms-flex-align-self:end;align-self:flex-end}.dashboard .back{font-size:18px;line-height:27px;margin-bottom:30px}.dashboard .heading{font-size:18px;line-height:21px;color:#222;margin-bottom:25px}.dashboard .heading .label{color:#777}.dashboard .clear-bg{background-color:transparent}.dashboard .list-pods .pod-group{margin:25px}.dashboard .list-pods .pod-group md-grid-list{margin-top:50px;color:#fff}.dashboard .list-pods .pod-group md-grid-list figcaption{width:100%}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-header{padding-left:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-header .labels{width:100%}.dashboard .list-pods .pod-group md-grid-list md-grid-tile{transition:all 700ms ease-in 50ms}.dashboard .list-pods .pod-group md-grid-list .inner-box{padding-left:10px;padding-right:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer{background:rgba(0,0,0,.5)}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer .pod-title{margin-left:10px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer .pod-host{text-align:right;padding-right:15px}.dashboard .list-pods .pod-group md-grid-list md-grid-tile-footer a{color:#fff}.dashboard .list-pods .pod-group md-grid-list .restarts{width:100%;text-align:right;padding-right:10px}.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:focus,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:hover,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:not([disabled]):focus,.dashboard .list-pods .pod-group md-grid-list .restarts .restart-button:not([disabled]):hover{background-color:#ff1744;width:30px;height:30px}.dashboard .list-pods .gray{background:#f5f5f5}.dashboard .list-pods .dark-overlay{background-color:#292935;opacity:.5}.dashboard .list-pods .light-overlay{background-color:#FFF;opacity:.2}.dashboard .list-pods .color-1{background-color:#2962ff;fill:#2962ff;stroke:#2962ff}.dashboard .list-pods .color-max-1{background-color:#dce5ff;border-color:#dce5ff;fill:#dce5ff}.dashboard .list-pods md-grid-list.list-color-1 md-grid-tile.colored{background-color:#2962ff}.dashboard .list-pods .color-2{background-color:#a0f;fill:#a0f;stroke:#a0f}.dashboard .list-pods .color-max-2{background-color:#e6b3ff;border-color:#e6b3ff;fill:#e6b3ff}.dashboard .list-pods md-grid-list.list-color-2 md-grid-tile.colored{background-color:#a0f}.dashboard .list-pods .color-3{background-color:#00c853;fill:#00c853;stroke:#00c853}.dashboard .list-pods .color-max-3{background-color:#7cffb2;border-color:#7cffb2;fill:#7cffb2}.dashboard .list-pods md-grid-list.list-color-3 md-grid-tile.colored{background-color:#00c853}.dashboard .list-pods .color-4{background-color:#304ffe;fill:#304ffe;stroke:#304ffe}.dashboard .list-pods .color-max-4{background-color:#e2e6ff;border-color:#e2e6ff;fill:#e2e6ff}.dashboard .list-pods md-grid-list.list-color-4 md-grid-tile.colored{background-color:#304ffe}.dashboard .list-pods .color-5{background-color:#0091ea;fill:#0091ea;stroke:#0091ea}.dashboard .list-pods .color-max-5{background-color:#9edaff;border-color:#9edaff;fill:#9edaff}.dashboard .list-pods md-grid-list.list-color-5 md-grid-tile.colored{background-color:#0091ea}.dashboard .list-pods .color-6{background-color:#ff6d00;fill:#ff6d00;stroke:#ff6d00}.dashboard .list-pods .color-max-6{background-color:#ffd3b3;border-color:#ffd3b3;fill:#ffd3b3}.dashboard .list-pods md-grid-list.list-color-6 md-grid-tile.colored{background-color:#ff6d00}.dashboard .list-pods .color-7{background-color:#00bfa5;fill:#00bfa5;stroke:#00bfa5}.dashboard .list-pods .color-max-7{background-color:#72ffec;border-color:#72ffec;fill:#72ffec}.dashboard .list-pods md-grid-list.list-color-7 md-grid-tile.colored{background-color:#00bfa5}.dashboard .list-pods .color-8{background-color:#c51162;fill:#c51162;stroke:#c51162}.dashboard .list-pods .color-max-8{background-color:#f693bf;border-color:#f693bf;fill:#f693bf}.dashboard .list-pods md-grid-list.list-color-8 md-grid-tile.colored{background-color:#c51162}.dashboard .list-pods .color-9{background-color:#64dd17;fill:#64dd17;stroke:#64dd17}.dashboard .list-pods .color-max-9{background-color:#cbf7b0;border-color:#cbf7b0;fill:#cbf7b0}.dashboard .list-pods md-grid-list.list-color-9 md-grid-tile.colored{background-color:#64dd17}.dashboard .list-pods .color-10{background-color:#6200ea;fill:#6200ea;stroke:#6200ea}.dashboard .list-pods .color-max-10{background-color:#c69eff;border-color:#c69eff;fill:#c69eff}.dashboard .list-pods md-grid-list.list-color-10 md-grid-tile.colored{background-color:#6200ea}.dashboard .list-pods .color-11{background-color:#ffd600;fill:#ffd600;stroke:#ffd600}.dashboard .list-pods .color-max-11{background-color:#fff3b3;border-color:#fff3b3;fill:#fff3b3}.dashboard .list-pods md-grid-list.list-color-11 md-grid-tile.colored{background-color:#ffd600}.dashboard .list-pods .color-12{background-color:#00b8d4;fill:#00b8d4;stroke:#00b8d4}.dashboard .list-pods .color-max-12{background-color:#87efff;border-color:#87efff;fill:#87efff}.dashboard .list-pods md-grid-list.list-color-12 md-grid-tile.colored{background-color:#00b8d4}.dashboard .list-pods .color-13{background-color:#ffab00;fill:#ffab00;stroke:#ffab00}.dashboard .list-pods .color-max-13{background-color:#ffe6b3;border-color:#ffe6b3;fill:#ffe6b3}.dashboard .list-pods md-grid-list.list-color-13 md-grid-tile.colored{background-color:#ffab00}.dashboard .list-pods .color-14{background-color:#dd2c00;fill:#dd2c00;stroke:#dd2c00}.dashboard .list-pods .color-max-14{background-color:#ffa791;border-color:#ffa791;fill:#ffa791}.dashboard .list-pods md-grid-list.list-color-14 md-grid-tile.colored{background-color:#dd2c00}.dashboard .list-pods .color-15{background-color:#2979ff;fill:#2979ff;stroke:#2979ff}.dashboard .list-pods .color-max-15{background-color:#dce9ff;border-color:#dce9ff;fill:#dce9ff}.dashboard .list-pods md-grid-list.list-color-15 md-grid-tile.colored{background-color:#2979ff}.dashboard .list-pods .color-16{background-color:#d500f9;fill:#d500f9;stroke:#d500f9}.dashboard .list-pods .color-max-16{background-color:#f3acff;border-color:#f3acff;fill:#f3acff}.dashboard .list-pods md-grid-list.list-color-16 md-grid-tile.colored{background-color:#d500f9}.dashboard .list-pods .color-17{background-color:#00e676;fill:#00e676;stroke:#00e676}.dashboard .list-pods .color-max-17{background-color:#9affce;border-color:#9affce;fill:#9affce}.dashboard .list-pods md-grid-list.list-color-17 md-grid-tile.colored{background-color:#00e676}.dashboard .list-pods .color-18{background-color:#3d5afe;fill:#3d5afe;stroke:#3d5afe}.dashboard .list-pods .color-max-18{background-color:#eff1ff;border-color:#eff1ff;fill:#eff1ff}.dashboard .list-pods md-grid-list.list-color-18 md-grid-tile.colored{background-color:#3d5afe}.dashboard .list-pods .color-19{background-color:#00b0ff;fill:#00b0ff;stroke:#00b0ff}.dashboard .list-pods .color-max-19{background-color:#b3e7ff;border-color:#b3e7ff;fill:#b3e7ff}.dashboard .list-pods md-grid-list.list-color-19 md-grid-tile.colored{background-color:#00b0ff}.dashboard .list-pods .color-20{background-color:#ff9100;fill:#ff9100;stroke:#ff9100}.dashboard .list-pods .color-max-20{background-color:#ffdeb3;border-color:#ffdeb3;fill:#ffdeb3}.dashboard .list-pods md-grid-list.list-color-20 md-grid-tile.colored{background-color:#ff9100}.dashboard .list-pods .color-21{background-color:#1de9b6;fill:#1de9b6;stroke:#1de9b6}.dashboard .list-pods .color-max-21{background-color:#c0f9eb;border-color:#c0f9eb;fill:#c0f9eb}.dashboard .list-pods md-grid-list.list-color-21 md-grid-tile.colored{background-color:#1de9b6}.dashboard .list-pods .color-22{background-color:#f50057;fill:#f50057;stroke:#f50057}.dashboard .list-pods .color-max-22{background-color:#ffa8c7;border-color:#ffa8c7;fill:#ffa8c7}.dashboard .list-pods md-grid-list.list-color-22 md-grid-tile.colored{background-color:#f50057}.dashboard .list-pods .color-23{background-color:#76ff03;fill:#76ff03;stroke:#76ff03}.dashboard .list-pods .color-max-23{background-color:#d7ffb5;border-color:#d7ffb5;fill:#d7ffb5}.dashboard .list-pods md-grid-list.list-color-23 md-grid-tile.colored{background-color:#76ff03}.dashboard .list-pods .color-24{background-color:#651fff;fill:#651fff;stroke:#651fff}.dashboard .list-pods .color-max-24{background-color:#e0d2ff;border-color:#e0d2ff;fill:#e0d2ff}.dashboard .list-pods md-grid-list.list-color-24 md-grid-tile.colored{background-color:#651fff}.dashboard .list-pods .color-25{background-color:#ffea00;fill:#ffea00;stroke:#ffea00}.dashboard .list-pods .color-max-25{background-color:#fff9b3;border-color:#fff9b3;fill:#fff9b3}.dashboard .list-pods md-grid-list.list-color-25 md-grid-tile.colored{background-color:#ffea00}.dashboard .list-pods .color-26{background-color:#00e5ff;fill:#00e5ff;stroke:#00e5ff}.dashboard .list-pods .color-max-26{background-color:#b3f7ff;border-color:#b3f7ff;fill:#b3f7ff}.dashboard .list-pods md-grid-list.list-color-26 md-grid-tile.colored{background-color:#00e5ff}.dashboard .list-pods .color-27{background-color:#ffc400;fill:#ffc400;stroke:#ffc400}.dashboard .list-pods .color-max-27{background-color:#ffedb3;border-color:#ffedb3;fill:#ffedb3}.dashboard .list-pods md-grid-list.list-color-27 md-grid-tile.colored{background-color:#ffc400}.dashboard .list-pods .color-28{background-color:#ff3d00;fill:#ff3d00;stroke:#ff3d00}.dashboard .list-pods .color-max-28{background-color:#ffc5b3;border-color:#ffc5b3;fill:#ffc5b3}.dashboard .list-pods md-grid-list.list-color-28 md-grid-tile.colored{background-color:#ff3d00}.dashboard .list-pods .color-29{background-color:#448aff;fill:#448aff;stroke:#448aff}.dashboard .list-pods .color-max-29{background-color:#f6faff;border-color:#f6faff;fill:#f6faff}.dashboard .list-pods md-grid-list.list-color-29 md-grid-tile.colored{background-color:#448aff}.dashboard .list-pods .color-30{background-color:#e040fb;fill:#e040fb;stroke:#e040fb}.dashboard .list-pods .color-max-30{background-color:#fcefff;border-color:#fcefff;fill:#fcefff}.dashboard .list-pods md-grid-list.list-color-30 md-grid-tile.colored{background-color:#e040fb}.dashboard .list-pods .color-31{background-color:#69f0ae;fill:#69f0ae;stroke:#69f0ae}.dashboard .list-pods .color-max-31{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-31 md-grid-tile.colored{background-color:#69f0ae}.dashboard .list-pods .color-32{background-color:#536dfe;fill:#536dfe;stroke:#536dfe}.dashboard .list-pods .color-max-32{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-32 md-grid-tile.colored{background-color:#536dfe}.dashboard .list-pods .color-33{background-color:#40c4ff;fill:#40c4ff;stroke:#40c4ff}.dashboard .list-pods .color-max-33{background-color:#f3fbff;border-color:#f3fbff;fill:#f3fbff}.dashboard .list-pods md-grid-list.list-color-33 md-grid-tile.colored{background-color:#40c4ff}.dashboard .list-pods .color-34{background-color:#ffab40;fill:#ffab40;stroke:#ffab40}.dashboard .list-pods .color-max-34{background-color:#fffaf3;border-color:#fffaf3;fill:#fffaf3}.dashboard .list-pods md-grid-list.list-color-34 md-grid-tile.colored{background-color:#ffab40}.dashboard .list-pods .color-35{background-color:#64ffda;fill:#64ffda;stroke:#64ffda}.dashboard .list-pods .color-max-35{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-35 md-grid-tile.colored{background-color:#64ffda}.dashboard .list-pods .color-36{background-color:#ff4081;fill:#ff4081;stroke:#ff4081}.dashboard .list-pods .color-max-36{background-color:#fff3f7;border-color:#fff3f7;fill:#fff3f7}.dashboard .list-pods md-grid-list.list-color-36 md-grid-tile.colored{background-color:#ff4081}.dashboard .list-pods .color-37{background-color:#b2ff59;fill:#b2ff59;stroke:#b2ff59}.dashboard .list-pods .color-max-37{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-37 md-grid-tile.colored{background-color:#b2ff59}.dashboard .list-pods .color-38{background-color:#7c4dff;fill:#7c4dff;stroke:#7c4dff}.dashboard .list-pods .color-max-38{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .list-pods md-grid-list.list-color-38 md-grid-tile.colored{background-color:#7c4dff}.dashboard .list-pods .color-39{background-color:#ff0;fill:#ff0;stroke:#ff0}.dashboard .list-pods .color-max-39{background-color:#ffffb3;border-color:#ffffb3;fill:#ffffb3}.dashboard .list-pods md-grid-list.list-color-39 md-grid-tile.colored{background-color:#ff0}.dashboard .list-pods .color-40{background-color:#18ffff;fill:#18ffff;stroke:#18ffff}.dashboard .list-pods .color-max-40{background-color:#cbffff;border-color:#cbffff;fill:#cbffff}.dashboard .list-pods md-grid-list.list-color-40 md-grid-tile.colored{background-color:#18ffff}.dashboard .list-pods .color-41{background-color:#ffd740;fill:#ffd740;stroke:#ffd740}.dashboard .list-pods .color-max-41{background-color:#fffcf3;border-color:#fffcf3;fill:#fffcf3}.dashboard .list-pods md-grid-list.list-color-41 md-grid-tile.colored{background-color:#ffd740}.dashboard .list-pods .color-42{background-color:#ff6e40;fill:#ff6e40;stroke:#ff6e40}.dashboard .list-pods .color-max-42{background-color:#fff6f3;border-color:#fff6f3;fill:#fff6f3}.dashboard .list-pods md-grid-list.list-color-42 md-grid-tile.colored{background-color:#ff6e40}.dashboard .list-pods .color-warning{background-color:#ff9800!important;border-color:#ff9800!important;fill:#ff9800!important;stroke:#ff9800!important}.dashboard .list-pods .color-critical{background-color:#f44336!important;border-color:#f44336!important;fill:#f44336!important;stroke:#f44336!important}.dashboard .list-pods .status-waiting{background-color:#2e2e3b!important;border-color:#dad462!important;border-width:2px!important;border-style:solid!important}.dashboard .list-pods .status-terminated,.dashboard .list-pods .status-unknown{background-color:#ff1744!important;border-color:#e3002c!important;border-width:1px!important;border-style:solid!important}.dashboard .dash-table{min-width:100%;border-collapse:collapse}.dashboard .dash-table tbody tr:focus:not(.no-link),.dashboard .dash-table tbody tr:hover:not(.no-link){cursor:pointer;background-color:rgba(63,81,181,.2)}.dashboard .dash-table .dash-table-header{border-bottom:1px solid #e6e6e6;color:#828282;text-align:left;font-size:.75em;font-weight:700;padding:16px 16px 16px 0}.dashboard .dash-table .dash-table-header a{text-decoration:none;color:inherit}.dashboard .dash-table .dash-table-caret{display:inline-block;vertical-align:middle}.dashboard .dash-table .dash-table-content{font-size:.8em;padding:16px 16px 16px 0;height:72px}.dashboard .dash-table .dash-table-td-more{max-width:72px;width:72px;padding:16px}.dashboard .dash-table .dash-table-thumbs{max-width:104px;width:104px;padding:16px 32px}.dashboard .dash-table .dash-table-thumbs div{overflow:hidden;width:40px;height:40px;border-radius:20px;border:1px solid rgba(0,0,0,.2);background-size:cover;box-shadow:0 8px 10px rgba(0,0,0,.3);-webkit-box-shadow:0 8px 10px rgba(0,0,0,.1)}.dashboard .dash-table .dash-table-footer{height:40px}.dashboard .dash-table .dash-table-count-info{line-height:40px;font-size:.75em}.dashboard .dash-table .dash-table-footer-item{width:40px;height:40px;vertical-align:middle}.dashboard .dash-table .bold,.dashboard .dash-table .dash-table-active-page{font-weight:700}.dashboard .dash-table .grey{color:grey}.dashboard .dash-table md-input-container.md-default-theme .md-input{color:#fff;border-color:#fff;margin-top:24px}.dashboard .server-overview .dark-overlay{background-color:#292935;opacity:.5}.dashboard .server-overview .light-overlay{background-color:#FFF;opacity:.2}.dashboard .server-overview md-grid-list.list-color-1 md-grid-tile.colored{background-color:#2962ff}.dashboard .server-overview md-grid-list.list-color-2 md-grid-tile.colored{background-color:#a0f}.dashboard .server-overview md-grid-list.list-color-3 md-grid-tile.colored{background-color:#00c853}.dashboard .server-overview .color-4{background-color:#304ffe;fill:#304ffe;stroke:#304ffe}.dashboard .server-overview .color-max-4{background-color:#e2e6ff;border-color:#e2e6ff;fill:#e2e6ff}.dashboard .server-overview md-grid-list.list-color-4 md-grid-tile.colored{background-color:#304ffe}.dashboard .server-overview .color-5{background-color:#0091ea;fill:#0091ea;stroke:#0091ea}.dashboard .server-overview .color-max-5{background-color:#9edaff;border-color:#9edaff;fill:#9edaff}.dashboard .server-overview md-grid-list.list-color-5 md-grid-tile.colored{background-color:#0091ea}.dashboard .server-overview .color-6{background-color:#ff6d00;fill:#ff6d00;stroke:#ff6d00}.dashboard .server-overview .color-max-6{background-color:#ffd3b3;border-color:#ffd3b3;fill:#ffd3b3}.dashboard .server-overview md-grid-list.list-color-6 md-grid-tile.colored{background-color:#ff6d00}.dashboard .server-overview .color-7{background-color:#00bfa5;fill:#00bfa5;stroke:#00bfa5}.dashboard .server-overview .color-max-7{background-color:#72ffec;border-color:#72ffec;fill:#72ffec}.dashboard .server-overview md-grid-list.list-color-7 md-grid-tile.colored{background-color:#00bfa5}.dashboard .server-overview .color-8{background-color:#c51162;fill:#c51162;stroke:#c51162}.dashboard .server-overview .color-max-8{background-color:#f693bf;border-color:#f693bf;fill:#f693bf}.dashboard .server-overview md-grid-list.list-color-8 md-grid-tile.colored{background-color:#c51162}.dashboard .server-overview .color-9{background-color:#64dd17;fill:#64dd17;stroke:#64dd17}.dashboard .server-overview .color-max-9{background-color:#cbf7b0;border-color:#cbf7b0;fill:#cbf7b0}.dashboard .server-overview md-grid-list.list-color-9 md-grid-tile.colored{background-color:#64dd17}.dashboard .server-overview .color-10{background-color:#6200ea;fill:#6200ea;stroke:#6200ea}.dashboard .server-overview .color-max-10{background-color:#c69eff;border-color:#c69eff;fill:#c69eff}.dashboard .server-overview md-grid-list.list-color-10 md-grid-tile.colored{background-color:#6200ea}.dashboard .server-overview .color-11{background-color:#ffd600;fill:#ffd600;stroke:#ffd600}.dashboard .server-overview .color-max-11{background-color:#fff3b3;border-color:#fff3b3;fill:#fff3b3}.dashboard .server-overview md-grid-list.list-color-11 md-grid-tile.colored{background-color:#ffd600}.dashboard .server-overview .color-12{background-color:#00b8d4;fill:#00b8d4;stroke:#00b8d4}.dashboard .server-overview .color-max-12{background-color:#87efff;border-color:#87efff;fill:#87efff}.dashboard .server-overview md-grid-list.list-color-12 md-grid-tile.colored{background-color:#00b8d4}.dashboard .server-overview .color-13{background-color:#ffab00;fill:#ffab00;stroke:#ffab00}.dashboard .server-overview .color-max-13{background-color:#ffe6b3;border-color:#ffe6b3;fill:#ffe6b3}.dashboard .server-overview md-grid-list.list-color-13 md-grid-tile.colored{background-color:#ffab00}.dashboard .server-overview .color-14{background-color:#dd2c00;fill:#dd2c00;stroke:#dd2c00}.dashboard .server-overview .color-max-14{background-color:#ffa791;border-color:#ffa791;fill:#ffa791}.dashboard .server-overview md-grid-list.list-color-14 md-grid-tile.colored{background-color:#dd2c00}.dashboard .server-overview .color-15{background-color:#2979ff;fill:#2979ff;stroke:#2979ff}.dashboard .server-overview .color-max-15{background-color:#dce9ff;border-color:#dce9ff;fill:#dce9ff}.dashboard .server-overview md-grid-list.list-color-15 md-grid-tile.colored{background-color:#2979ff}.dashboard .server-overview .color-16{background-color:#d500f9;fill:#d500f9;stroke:#d500f9}.dashboard .server-overview .color-max-16{background-color:#f3acff;border-color:#f3acff;fill:#f3acff}.dashboard .server-overview md-grid-list.list-color-16 md-grid-tile.colored{background-color:#d500f9}.dashboard .server-overview .color-17{background-color:#00e676;fill:#00e676;stroke:#00e676}.dashboard .server-overview .color-max-17{background-color:#9affce;border-color:#9affce;fill:#9affce}.dashboard .server-overview md-grid-list.list-color-17 md-grid-tile.colored{background-color:#00e676}.dashboard .server-overview .color-18{background-color:#3d5afe;fill:#3d5afe;stroke:#3d5afe}.dashboard .server-overview .color-max-18{background-color:#eff1ff;border-color:#eff1ff;fill:#eff1ff}.dashboard .server-overview md-grid-list.list-color-18 md-grid-tile.colored{background-color:#3d5afe}.dashboard .server-overview .color-19{background-color:#00b0ff;fill:#00b0ff;stroke:#00b0ff}.dashboard .server-overview .color-max-19{background-color:#b3e7ff;border-color:#b3e7ff;fill:#b3e7ff}.dashboard .server-overview md-grid-list.list-color-19 md-grid-tile.colored{background-color:#00b0ff}.dashboard .server-overview .color-20{background-color:#ff9100;fill:#ff9100;stroke:#ff9100}.dashboard .server-overview .color-max-20{background-color:#ffdeb3;border-color:#ffdeb3;fill:#ffdeb3}.dashboard .server-overview md-grid-list.list-color-20 md-grid-tile.colored{background-color:#ff9100}.dashboard .server-overview .color-21{background-color:#1de9b6;fill:#1de9b6;stroke:#1de9b6}.dashboard .server-overview .color-max-21{background-color:#c0f9eb;border-color:#c0f9eb;fill:#c0f9eb}.dashboard .server-overview md-grid-list.list-color-21 md-grid-tile.colored{background-color:#1de9b6}.dashboard .server-overview .color-22{background-color:#f50057;fill:#f50057;stroke:#f50057}.dashboard .server-overview .color-max-22{background-color:#ffa8c7;border-color:#ffa8c7;fill:#ffa8c7}.dashboard .server-overview md-grid-list.list-color-22 md-grid-tile.colored{background-color:#f50057}.dashboard .server-overview .color-23{background-color:#76ff03;fill:#76ff03;stroke:#76ff03}.dashboard .server-overview .color-max-23{background-color:#d7ffb5;border-color:#d7ffb5;fill:#d7ffb5}.dashboard .server-overview md-grid-list.list-color-23 md-grid-tile.colored{background-color:#76ff03}.dashboard .server-overview .color-24{background-color:#651fff;fill:#651fff;stroke:#651fff}.dashboard .server-overview .color-max-24{background-color:#e0d2ff;border-color:#e0d2ff;fill:#e0d2ff}.dashboard .server-overview md-grid-list.list-color-24 md-grid-tile.colored{background-color:#651fff}.dashboard .server-overview .color-25{background-color:#ffea00;fill:#ffea00;stroke:#ffea00}.dashboard .server-overview .color-max-25{background-color:#fff9b3;border-color:#fff9b3;fill:#fff9b3}.dashboard .server-overview md-grid-list.list-color-25 md-grid-tile.colored{background-color:#ffea00}.dashboard .server-overview .color-26{background-color:#00e5ff;fill:#00e5ff;stroke:#00e5ff}.dashboard .server-overview .color-max-26{background-color:#b3f7ff;border-color:#b3f7ff;fill:#b3f7ff}.dashboard .server-overview md-grid-list.list-color-26 md-grid-tile.colored{background-color:#00e5ff}.dashboard .server-overview .color-27{background-color:#ffc400;fill:#ffc400;stroke:#ffc400}.dashboard .server-overview .color-max-27{background-color:#ffedb3;border-color:#ffedb3;fill:#ffedb3}.dashboard .server-overview md-grid-list.list-color-27 md-grid-tile.colored{background-color:#ffc400}.dashboard .server-overview .color-28{background-color:#ff3d00;fill:#ff3d00;stroke:#ff3d00}.dashboard .server-overview .color-max-28{background-color:#ffc5b3;border-color:#ffc5b3;fill:#ffc5b3}.dashboard .server-overview md-grid-list.list-color-28 md-grid-tile.colored{background-color:#ff3d00}.dashboard .server-overview .color-29{background-color:#448aff;fill:#448aff;stroke:#448aff}.dashboard .server-overview .color-max-29{background-color:#f6faff;border-color:#f6faff;fill:#f6faff}.dashboard .server-overview md-grid-list.list-color-29 md-grid-tile.colored{background-color:#448aff}.dashboard .server-overview .color-30{background-color:#e040fb;fill:#e040fb;stroke:#e040fb}.dashboard .server-overview .color-max-30{background-color:#fcefff;border-color:#fcefff;fill:#fcefff}.dashboard .server-overview md-grid-list.list-color-30 md-grid-tile.colored{background-color:#e040fb}.dashboard .server-overview .color-31{background-color:#69f0ae;fill:#69f0ae;stroke:#69f0ae}.dashboard .server-overview .color-max-31{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-31 md-grid-tile.colored{background-color:#69f0ae}.dashboard .server-overview .color-32{background-color:#536dfe;fill:#536dfe;stroke:#536dfe}.dashboard .server-overview .color-max-32{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-32 md-grid-tile.colored{background-color:#536dfe}.dashboard .server-overview .color-33{background-color:#40c4ff;fill:#40c4ff;stroke:#40c4ff}.dashboard .server-overview .color-max-33{background-color:#f3fbff;border-color:#f3fbff;fill:#f3fbff}.dashboard .server-overview md-grid-list.list-color-33 md-grid-tile.colored{background-color:#40c4ff}.dashboard .server-overview .color-34{background-color:#ffab40;fill:#ffab40;stroke:#ffab40}.dashboard .server-overview .color-max-34{background-color:#fffaf3;border-color:#fffaf3;fill:#fffaf3}.dashboard .server-overview md-grid-list.list-color-34 md-grid-tile.colored{background-color:#ffab40}.dashboard .server-overview .color-35{background-color:#64ffda;fill:#64ffda;stroke:#64ffda}.dashboard .server-overview .color-max-35{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-35 md-grid-tile.colored{background-color:#64ffda}.dashboard .server-overview .color-36{background-color:#ff4081;fill:#ff4081;stroke:#ff4081}.dashboard .server-overview .color-max-36{background-color:#fff3f7;border-color:#fff3f7;fill:#fff3f7}.dashboard .server-overview md-grid-list.list-color-36 md-grid-tile.colored{background-color:#ff4081}.dashboard .server-overview .color-37{background-color:#b2ff59;fill:#b2ff59;stroke:#b2ff59}.dashboard .server-overview .color-max-37{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-37 md-grid-tile.colored{background-color:#b2ff59}.dashboard .server-overview .color-38{background-color:#7c4dff;fill:#7c4dff;stroke:#7c4dff}.dashboard .server-overview .color-max-38{background-color:#fff;border-color:#fff;fill:#fff}.dashboard .server-overview md-grid-list.list-color-38 md-grid-tile.colored{background-color:#7c4dff}.dashboard .server-overview .color-39{background-color:#ff0;fill:#ff0;stroke:#ff0}.dashboard .server-overview .color-max-39{background-color:#ffffb3;border-color:#ffffb3;fill:#ffffb3}.dashboard .server-overview md-grid-list.list-color-39 md-grid-tile.colored{background-color:#ff0}.dashboard .server-overview .color-40{background-color:#18ffff;fill:#18ffff;stroke:#18ffff}.dashboard .server-overview .color-max-40{background-color:#cbffff;border-color:#cbffff;fill:#cbffff}.dashboard .server-overview md-grid-list.list-color-40 md-grid-tile.colored{background-color:#18ffff}.dashboard .server-overview .color-41{background-color:#ffd740;fill:#ffd740;stroke:#ffd740}.dashboard .server-overview .color-max-41{background-color:#fffcf3;border-color:#fffcf3;fill:#fffcf3}.dashboard .server-overview md-grid-list.list-color-41 md-grid-tile.colored{background-color:#ffd740}.dashboard .server-overview .color-42{background-color:#ff6e40;fill:#ff6e40;stroke:#ff6e40}.dashboard .server-overview .color-max-42{background-color:#fff6f3;border-color:#fff6f3;fill:#fff6f3}.dashboard .server-overview md-grid-list.list-color-42 md-grid-tile.colored{background-color:#ff6e40}.dashboard .server-overview .color-warning{background-color:#ff9800!important;border-color:#ff9800!important;fill:#ff9800!important;stroke:#ff9800!important}.dashboard .server-overview .color-critical{background-color:#f44336!important;border-color:#f44336!important;fill:#f44336!important;stroke:#f44336!important}.dashboard .server-overview .status-waiting{background-color:#2e2e3b!important;border-color:#dad462!important;border-width:2px!important;border-style:solid!important}.dashboard .server-overview .status-terminated,.dashboard .server-overview .status-unknown{background-color:#ff1744!important;border-color:#e3002c!important;border-width:1px!important;border-style:solid!important}.dashboard .server-overview .color-1{background-color:#512DA8;border-color:#512DA8;fill:#512DA8;stroke:#512DA8}.dashboard .server-overview .color-2{background-color:#9C27B0;border-color:#9C27B0;fill:#9C27B0;stroke:#9C27B0}.dashboard .server-overview .color-3{background-color:#00BCD4;border-color:#00BCD4;fill:#00BCD4;stroke:#00BCD4}.dashboard .server-overview .color-max-1{background-color:#b6a2e6;border-color:#b6a2e6;fill:#b6a2e6}.dashboard .server-overview .color-max-2{background-color:#dfa0ea;border-color:#dfa0ea;fill:#dfa0ea}.dashboard .server-overview .color-max-3{background-color:#87f1ff;border-color:#87f1ff;fill:#87f1ff}.dashboard .server-overview .color-max-warning{background-color:#ffd699!important;border-color:#ffd699!important;fill:#ffd699!important}.dashboard .server-overview .color-max-critical{background-color:#fccbc7!important;border-color:#fccbc7!important;fill:#fccbc7!important}.dashboard .server-overview .max_tick_arc{stroke:#FFF!important}.dashboard .server-overview .concentricchart .bg-circle{background:#F9F9F9;fill:#F9F9F9;stroke:#FFF;stroke-width:1px}.dashboard .server-overview .concentricchart text{font-size:12px;font-family:Roboto,sans-serif}.dashboard .server-overview .concentricchart .value_group{fill:#fff}.dashboard .server-overview .concentricchart .legend_group rect{opacity:.8}.dashboard .server-overview svg.legend{height:auto}.dashboard .server-overview svg.legend text{font-size:12px;font-family:Roboto,sans-serif}.dashboard .server-overview svg.legend .hostName{font-size:16px}.dashboard .server-overview .minion-name{text-align:center;vertical-align:bottom;width:100%}.dashboard .server-overview .chart_area{width:325px;height:auto}.dashboard .groups{font-size:13px}.dashboard .groups .header{line-height:21px}.dashboard .groups .header a{padding-left:5px;padding-right:5px}.dashboard .groups .header .selector-area .filter-text{font-size:13px;margin-left:10px}.dashboard .groups .header .selector-area .cancel-button{width:18px;height:18px;padding:0}.dashboard .groups .header .selector-area .cancel-button:focus,.dashboard .groups .header .selector-area .cancel-button:hover{background-color:none!important}.dashboard .groups .header .selector-area .cancel-icon{width:15px;height:15px;fill:#777}.dashboard .groups .select-group-by{min-width:110px;margin-left:10px;margin-right:40px}.dashboard .groups .select-group-by .md-select-label{padding-top:6px;font-size:13px}.dashboard .groups .group-item{padding-top:20px}.dashboard .groups .group-item .filter-button{height:18px;width:18px}.dashboard .groups .group-item .filter-button .filter-icon{width:18px;height:18px}.dashboard .groups .icon-area{min-width:34px}.dashboard .groups .icon-area .group-icon{border-radius:21px;width:21px;height:21px}.dashboard .groups .group-main-area .subtype{line-height:21px}.dashboard .groups md-divider{margin-top:40px;margin-bottom:30px}.dashboard .groups .group-name{padding-top:10px}.dashboard .groups .selectFilter{padding-top:7px;margin-right:30px}.dashboard .groups .selectFilter .md-select-label{border-bottom:none!important;width:17px;min-width:17px;padding-right:0}.dashboard .groups md-select-menu{min-height:40px;max-height:40px}.dashboard .groups .group-link-area{padding-left:15px;padding-bottom:15px}.dashboard .groups .group-link-area button{line-height:12px}.dashboard .groups .group-type-circle{width:21px;height:21px}.dashboard .groups md-select{margin-top:0}.dashboard .detail{color:#222}.dashboard .detail .back{font-size:18px;line-height:27px;margin-bottom:30px}.dashboard .detail .heading{font-size:18px;line-height:21px;color:#222;margin-bottom:25px}.dashboard .detail .heading .label{color:#777}.dashboard .detail td.name{font-size:14px;color:#222;line-height:24px}.dashboard .detail td.value{margin-left:50px;font-size:14px;color:#888;line-height:24px}.dashboard .detail .containerTable td{padding-right:20px}.dashboard .align-top tbody{vertical-align:top} \ No newline at end of file diff --git a/www/app/assets/img/docArrow.png b/www/app/assets/img/docArrow.png deleted file mode 100644 index 860098aff9..0000000000 Binary files a/www/app/assets/img/docArrow.png and /dev/null differ diff --git a/www/app/assets/img/ic_arrow_drop_down_24px.svg b/www/app/assets/img/ic_arrow_drop_down_24px.svg deleted file mode 100644 index 79b1292b56..0000000000 --- a/www/app/assets/img/ic_arrow_drop_down_24px.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/www/app/assets/img/ic_arrow_drop_up_24px.svg b/www/app/assets/img/ic_arrow_drop_up_24px.svg deleted file mode 100644 index e8119c56e5..0000000000 --- a/www/app/assets/img/ic_arrow_drop_up_24px.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/www/app/assets/img/ic_keyboard_arrow_left_24px.svg b/www/app/assets/img/ic_keyboard_arrow_left_24px.svg deleted file mode 100644 index 7002d84385..0000000000 --- a/www/app/assets/img/ic_keyboard_arrow_left_24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/app/assets/img/ic_keyboard_arrow_right_24px.svg b/www/app/assets/img/ic_keyboard_arrow_right_24px.svg deleted file mode 100644 index e74898bbc6..0000000000 --- a/www/app/assets/img/ic_keyboard_arrow_right_24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/app/assets/img/icons/arrow-back.png b/www/app/assets/img/icons/arrow-back.png deleted file mode 100644 index 958c8b8b92..0000000000 Binary files a/www/app/assets/img/icons/arrow-back.png and /dev/null differ diff --git a/www/app/assets/img/icons/favicon.png b/www/app/assets/img/icons/favicon.png deleted file mode 100644 index 9cf941733c..0000000000 Binary files a/www/app/assets/img/icons/favicon.png and /dev/null differ diff --git a/www/app/assets/img/icons/ic_arrow_forward_24px.svg b/www/app/assets/img/icons/ic_arrow_forward_24px.svg deleted file mode 100644 index c4a2c18c8b..0000000000 --- a/www/app/assets/img/icons/ic_arrow_forward_24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/app/assets/img/icons/ic_cancel_24px.svg b/www/app/assets/img/icons/ic_cancel_24px.svg deleted file mode 100644 index d6e55da94a..0000000000 --- a/www/app/assets/img/icons/ic_cancel_24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/app/assets/img/icons/ic_close_24px.svg b/www/app/assets/img/icons/ic_close_24px.svg deleted file mode 100644 index 865788b755..0000000000 --- a/www/app/assets/img/icons/ic_close_24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/app/assets/img/icons/ic_menu.svg b/www/app/assets/img/icons/ic_menu.svg deleted file mode 100644 index 44bdb4de5c..0000000000 --- a/www/app/assets/img/icons/ic_menu.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/www/app/assets/img/icons/ic_menu_24px.svg b/www/app/assets/img/icons/ic_menu_24px.svg deleted file mode 100644 index b83714aa44..0000000000 --- a/www/app/assets/img/icons/ic_menu_24px.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/www/app/assets/img/icons/list_control_down.png b/www/app/assets/img/icons/list_control_down.png deleted file mode 100644 index ff322f44b5..0000000000 Binary files a/www/app/assets/img/icons/list_control_down.png and /dev/null differ diff --git a/www/app/assets/img/kubernetes.svg b/www/app/assets/img/kubernetes.svg deleted file mode 100644 index edba0c8c34..0000000000 --- a/www/app/assets/img/kubernetes.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/www/app/assets/js/app.js b/www/app/assets/js/app.js deleted file mode 100644 index 4fbe3da200..0000000000 --- a/www/app/assets/js/app.js +++ /dev/null @@ -1,2709 +0,0 @@ -var componentNamespaces = ["kubernetesApp.components.dashboard"]; -// APP START -// **************************** -// /www/app/assets/app.js is autogenerated. Do not modify. -// Changes should be made in /master/modules/js or /master/components//js -// **************************** -// ----------------------------------- - -var app = angular.module('kubernetesApp', [ - 'ngRoute', - 'ngMaterial', - 'ngLodash', - 'door3.css', - 'kubernetesApp.config', - 'kubernetesApp.services', - 'angular.filter' -].concat(componentNamespaces)); - -app.factory('menu', [ - '$location', - '$rootScope', - 'sections', - '$route', - function($location, $rootScope, sections, $route) { - - var self; - - $rootScope.$on('$locationChangeSuccess', onLocationChange); - - return self = { - - sections: sections, - - setSections: function(_sections) { this.sections = _sections; }, - selectSection: function(section) { self.openedSection = section; }, - toggleSelectSection: function(section) { - self.openedSection = (self.openedSection === section ? null : section); - }, - isSectionSelected: function(section) { return self.openedSection === section; }, - selectPage: function(section, page) { - self.currentSection = section; - self.currentPage = page; - }, - isPageSelected: function(page) { return self.currentPage === page; } - }; - - function onLocationChange() { - var path = $route.current.originalPath; - - var matchPage = function(section, page) { - if (path === page.url || path === (page.url + '/')) { - self.selectSection(section); - self.selectPage(section, page); - } - }; - - sections.forEach(function(section) { - if (section.children) { - section.children.forEach(function(childSection) { - if (childSection.pages) { - childSection.pages.forEach(function(page) { matchPage(childSection, page); }); - } - }); - } else if (section.pages) { - section.pages.forEach(function(page) { matchPage(section, page); }); - } else if (section.type === 'link') { - matchPage(section, section); - } - }); - } - } -]); - -angular.module('kubernetesApp.config', []); -angular.module('kubernetesApp.services', ['kubernetesApp.config']); - -app.config([ - '$routeProvider', - function($routeProvider) { - $routeProvider.when("/404", {templateUrl: "views/partials/404.html"}) - // else 404 - .otherwise({redirectTo: "/404"}); - } -]) - .config([ - '$routeProvider', - 'manifestRoutes', - function($routeProvider, manifestRoutes) { - angular.forEach(manifestRoutes, function(r) { - var route = { - templateUrl: r.templateUrl - }; - if (r.controller) { - route.controller = r.controller; - } - if (r.css) { - route.css = r.css; - } - $routeProvider.when(r.url, route); - }); - } - ]); - -app.value("sections", [{"name":"Dashboard","url":"/dashboard","type":"link","templateUrl":"/components/dashboard/pages/home.html"},{"name":"Dashboard","type":"heading","children":[{"name":"Dashboard","type":"toggle","url":"/dashboard","templateUrl":"/components/dashboard/pages/home.html","pages":[{"name":"Pods","url":"/dashboard/pods","templateUrl":"/components/dashboard/views/listPods.html","type":"link"},{"name":"Pod Visualizer","url":"/dashboard/visualpods","templateUrl":"/components/dashboard/views/listPodsVisualizer.html","type":"link"},{"name":"Services","url":"/dashboard/services","templateUrl":"/components/dashboard/views/listServices.html","type":"link"},{"name":"Replication Controllers","url":"/dashboard/replicationcontrollers","templateUrl":"/components/dashboard/views/listReplicationControllers.html","type":"link"},{"name":"Events","url":"/dashboard/events","templateUrl":"/components/dashboard/views/listEvents.html","type":"link"},{"name":"Nodes","url":"/dashboard/nodes","templateUrl":"/components/dashboard/views/listMinions.html","type":"link"},{"name":"Replication Controller","url":"/dashboard/replicationcontrollers/:replicationControllerId","templateUrl":"/components/dashboard/views/replication.html","type":"link"},{"name":"Service","url":"/dashboard/services/:serviceId","templateUrl":"/components/dashboard/views/service.html","type":"link"},{"name": "Node","url": "/dashboard/nodes/:nodeId","templateUrl": "/components/dashboard/views/node.html","type": "link"},{"name":"Explore","url":"/dashboard/groups/:grouping*?/selector/:selector*?","templateUrl":"/components/dashboard/views/groups.html","type":"link"},{"name":"Pod","url":"/dashboard/pods/:podId","templateUrl":"/components/dashboard/views/pod.html","type":"link"}]}]},{"name":"Graph","url":"/graph","type":"link","templateUrl":"/components/graph/pages/home.html"},{"name":"Graph","url":"/graph/inspect","type":"link","templateUrl":"/components/graph/pages/inspect.html","css":"/components/graph/css/show-details-table.css"},{"name":"Graph","type":"heading","children":[{"name":"Graph","type":"toggle","url":"/graph","templateUrl":"/components/graph/pages/home.html","pages":[{"name":"Test","url":"/graph/test","type":"link","templateUrl":"/components/graph/pages/home.html"}]}]}]); - -app.directive('includeReplace', - function() { - 'use strict'; - return { - require: 'ngInclude', - restrict: 'A', /* optional */ - link: function(scope, el, attrs) { el.replaceWith(el.children()); } - }; - }) - .directive('compile', - ["$compile", function($compile) { - 'use strict'; - return function(scope, element, attrs) { - scope.$watch(function(scope) { return scope.$eval(attrs.compile); }, - function(value) { - element.html(value); - $compile(element.contents())(scope); - }); - }; - }]) - .directive("kubernetesUiMenu", - function() { - 'use strict'; - return { - templateUrl: "views/partials/kubernetes-ui-menu.tmpl.html" - }; - }) - .directive('menuToggle', function() { - 'use strict'; - return { - scope: {section: '='}, - templateUrl: 'views/partials/menu-toggle.tmpl.html', - link: function($scope, $element) { - var controller = $element.parent().controller(); - - $scope.isOpen = function() { return controller.isOpen($scope.section); }; - $scope.toggle = function() { controller.toggleOpen($scope.section); }; - - var parentNode = $element[0].parentNode.parentNode.parentNode; - if (parentNode.classList.contains('parent-list-item')) { - var heading = parentNode.querySelector('h2'); - $element[0].firstChild.setAttribute('aria-describedby', heading.id); - } - } - }; - }); - -app.filter('startFrom', - function() { - 'use strict'; - return function(input, start) { return input.slice(start); }; - }) - .filter('nospace', function() { - 'use strict'; - return function(value) { return (!value) ? '' : value.replace(/ /g, ''); }; - }); - -app.run(['$route', angular.noop]) - .run(["lodash", function(lodash) { - // Alias lodash - window['_'] = lodash; - }]); - -app.service('SidebarService', [ - '$rootScope', - function($rootScope) { - var service = this; - service.sidebarItems = []; - - service.clearSidebarItems = function() { service.sidebarItems = []; }; - - service.renderSidebar = function() { - var _entries = ''; - service.sidebarItems.forEach(function(entry) { _entries += entry.Html; }); - - if (_entries) { - $rootScope.sidenavLeft = '
      ' + _entries + '
      '; - } - }; - - service.addSidebarItem = function(item) { - - service.sidebarItems.push(item); - - service.sidebarItems.sort(function(a, b) { return (a.order > b.order) ? 1 : ((b.order > a.order) ? -1 : 0); }); - }; - } -]); - - -app.value("tabs", [{"component":"dashboard","title":"Dashboard"}]); -app.constant("manifestRoutes", [{"description":"Dashboard visualization.","url":"/dashboard/","templateUrl":"components/dashboard/pages/home.html"},{"description":"Pods","url":"/dashboard/pods","templateUrl":"components/dashboard/views/listPods.html"},{"description":"Pod Visualizer","url":"/dashboard/visualpods","templateUrl":"components/dashboard/views/listPodsVisualizer.html"},{"description":"Services","url":"/dashboard/services","templateUrl":"components/dashboard/views/listServices.html"},{"description":"Replication Controllers","url":"/dashboard/replicationcontrollers","templateUrl":"components/dashboard/views/listReplicationControllers.html"},{"description":"Events","url":"/dashboard/events","templateUrl":"components/dashboard/views/listEvents.html"},{"description":"Nodes","url":"/dashboard/nodes","templateUrl":"components/dashboard/views/listMinions.html"},{"description":"Replication Controller","url":"/dashboard/replicationcontrollers/:replicationControllerId","templateUrl":"components/dashboard/views/replication.html"},{"description":"Service","url":"/dashboard/services/:serviceId","templateUrl":"components/dashboard/views/service.html"},{"description":"Node","url":"/dashboard/nodes/:nodeId","templateUrl":"components/dashboard/views/node.html"},{"description":"Explore","url":"/dashboard/groups/:grouping*?/selector/:selector*?","templateUrl":"components/dashboard/views/groups.html"},{"description":"Pod","url":"/dashboard/pods/:podId","templateUrl":"components/dashboard/views/pod.html"}]); - -angular.module("kubernetesApp.config", []) - -.constant("ENV", { - "/": { - "k8sApiServer": "/api/v1", - "k8sDataServer": "", - "k8sDataPollMinIntervalSec": 10, - "k8sDataPollMaxIntervalSec": 120, - "k8sDataPollErrorThreshold": 5, - "cAdvisorProxy": "", - "cAdvisorPort": "4194" - } -}) - -.constant("ngConstant", true) - -; -/**========================================================= - * Module: config.js - * App routes and resources configuration - =========================================================*/ -/**========================================================= - * Module: constants.js - * Define constants to inject across the application - =========================================================*/ -/**========================================================= - * Module: home-page.js - * Page Controller - =========================================================*/ - -app.controller('PageCtrl', [ - '$scope', - '$timeout', - '$mdSidenav', - 'menu', - '$rootScope', - function($scope, $timeout, $mdSidenav, menu, $rootScope) { - $scope.menu = menu; - - $scope.path = path; - $scope.goHome = goHome; - $scope.openMenu = openMenu; - $rootScope.openMenu = openMenu; - $scope.closeMenu = closeMenu; - $scope.isSectionSelected = isSectionSelected; - - $rootScope.$on('$locationChangeSuccess', openPage); - - // Methods used by menuLink and menuToggle directives - this.isOpen = isOpen; - this.isSelected = isSelected; - this.toggleOpen = toggleOpen; - this.shouldLockOpen = shouldLockOpen; - $scope.toggleKubernetesUiMenu = toggleKubernetesUiMenu; - - var mainContentArea = document.querySelector("[role='main']"); - var kubernetesUiMenu = document.querySelector("[role='kubernetes-ui-menu']"); - - // ********************* - // Internal methods - // ********************* - - var _t = false; - - $scope.showKubernetesUiMenu = false; - - function shouldLockOpen() { - return _t; - } - - function toggleKubernetesUiMenu() { - $scope.showKubernetesUiMenu = !$scope.showKubernetesUiMenu; - } - - function closeMenu() { - $timeout(function() { - $mdSidenav('left').close(); - }); - } - - function openMenu() { - $timeout(function() { - _t = !$mdSidenav('left').isOpen(); - $mdSidenav('left').toggle(); - }); - } - - function path() { - return $location.path(); - } - - function goHome($event) { - menu.selectPage(null, null); - $location.path( '/' ); - } - - function openPage() { - $scope.closeMenu(); - mainContentArea.focus(); - } - - function isSelected(page) { - return menu.isPageSelected(page); - } - - function isSectionSelected(section) { - var selected = false; - var openedSection = menu.openedSection; - if(openedSection === section){ - selected = true; - } - else if(section.children) { - section.children.forEach(function(childSection) { - if(childSection === openedSection){ - selected = true; - } - }); - } - return selected; - } - - function isOpen(section) { - return menu.isSectionSelected(section); - } - - function toggleOpen(section) { - menu.toggleSelectSection(section); - } - - } -]).filter('humanizeDoc', function() { - return function(doc) { - if (!doc) return; - if (doc.type === 'directive') { - return doc.name.replace(/([A-Z])/g, function($1) { - return '-'+$1.toLowerCase(); - }); - } - return doc.label || doc.name; - }; }); - -/**========================================================= - * Module: main.js - * Main Application Controller - =========================================================*/ -/**========================================================= - * Module: tabs-global.js - * Page Controller - =========================================================*/ - -app.controller('TabCtrl', [ - '$scope', - '$location', - 'tabs', - function($scope, $location, tabs) { - $scope.tabs = tabs; - - $scope.switchTab = function(index) { - var location_path = $location.path(); - var tab = tabs[index]; - - if (tab) { - var path = '/%s'.format(tab.component); - if (location_path.indexOf(path) == -1) { - $location.path(path); - } - } - }; - } -]); - -/**========================================================= - * Module: sidebar.js - * Wraps the sidebar and handles collapsed state - =========================================================*/ -(function() { - "use strict"; - - angular.module('kubernetesApp.services') - .service('cAdvisorService', ["$http", "$q", "ENV", function($http, $q, ENV) { - var _baseUrl = function(minionIp) { - var minionPort = ENV['/']['cAdvisorPort'] || "8081"; - var proxy = ENV['/']['cAdvisorProxy'] || "/api/v1/proxy/nodes/"; - - return proxy + minionIp + ':' + minionPort + '/api/v1.0/'; - }; - - this.getMachineInfo = getMachineInfo; - - function getMachineInfo(minionIp) { - var fullUrl = _baseUrl(minionIp) + 'machine'; - var deferred = $q.defer(); - - // hack - $http.get(fullUrl).success(function(data) { - deferred.resolve(data); - }).error(function(data, status) { deferred.reject('There was an error') }); - return deferred.promise; - } - - this.getContainerInfo = getContainerInfo; - // containerId optional - function getContainerInfo(minionIp, containerId) { - containerId = (typeof containerId === "undefined") ? "/" : containerId; - - var fullUrl = _baseUrl(minionIp) + 'containers' + containerId; - var deferred = $q.defer(); - - var request = { - "num_stats": 10, - "num_samples": 0 - }; - - $http.post(fullUrl, request) - .success(function(data) { deferred.resolve(data); }) - .error(function() { deferred.reject('There was an error') }); - return deferred.promise; - } - - this.getDataForMinion = function(minionIp) { - var machineData, containerData; - var deferred = $q.defer(); - - var p = $q.all([getMachineInfo(minionIp), getContainerInfo(minionIp)]) - .then( - function(dataArray) { - machineData = dataArray[0]; - containerData = dataArray[1]; - - var memoryData = parseMemory(machineData, containerData); - var cpuData = parseCpu(machineData, containerData); - var fsData = parseFilesystems(machineData, containerData); - deferred.resolve({ - memoryData: memoryData, - cpuData: cpuData, - filesystemData: fsData, - machineData: machineData, - containerData: containerData - }); - - }, - function(errorData) { deferred.reject(errorData); }); - - return deferred.promise; - }; - - // Utils to process cadvisor data - function humanize(num, size, units) { - var unit; - for (unit = units.pop(); units.length && num >= size; unit = units.pop()) { - num /= size; - } - return [num, unit]; - } - - // Following the IEC naming convention - function humanizeIEC(num) { - var ret = humanize(num, 1024, ["TiB", "GiB", "MiB", "KiB", "Bytes"]); - return ret[0].toFixed(2) + " " + ret[1]; - } - - // Following the Metric naming convention - function humanizeMetric(num) { - var ret = humanize(num, 1000, ["TB", "GB", "MB", "KB", "Bytes"]); - return ret[0].toFixed(2) + " " + ret[1]; - } - - function hasResource(stats, resource) { return stats.stats.length > 0 && stats.stats[0][resource]; } - - // Gets the length of the interval in nanoseconds. - function getInterval(current, previous) { - var cur = new Date(current); - var prev = new Date(previous); - - // ms -> ns. - return (cur.getTime() - prev.getTime()) * 1000000; - } - - function parseCpu(machineInfo, containerInfo) { - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - var results = []; - - var cpuUsage = 0; - if (containerInfo.spec.has_cpu && containerInfo.stats.length >= 2) { - var prev = containerInfo.stats[containerInfo.stats.length - 2]; - var rawUsage = cur.cpu.usage.total - prev.cpu.usage.total; - var intervalInNs = getInterval(cur.timestamp, prev.timestamp); - - // Convert to millicores and take the percentage - cpuUsage = Math.round(((rawUsage / intervalInNs) / machineInfo.num_cores) * 100); - if (cpuUsage > 100) { - cpuUsage = 100; - } - } - - return { - cpuPercentUsage: cpuUsage - }; - } - - function parseFilesystems(machineInfo, containerInfo) { - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - if (!cur.filesystem) { - return; - } - - var filesystemData = []; - for (var i = 0; i < cur.filesystem.length; i++) { - var data = cur.filesystem[i]; - var totalUsage = Math.floor((data.usage * 100.0) / data.capacity); - - var f = { - device: data.device, - filesystemNumber: i + 1, - usage: data.usage, - usageDescription: humanizeMetric(data.usage), - capacity: data.capacity, - capacityDescription: humanizeMetric(data.capacity), - totalUsage: Math.floor((data.usage * 100.0) / data.capacity) - }; - - filesystemData.push(f); - } - return filesystemData; - } - - var oneMegabyte = 1024 * 1024; - var oneGigabyte = 1024 * oneMegabyte; - - function parseMemory(machineInfo, containerInfo) { - if (containerInfo.spec.has_memory && !hasResource(containerInfo, "memory")) { - return; - } - - // var titles = ["Time", "Total", "Hot"]; - var data = []; - for (var i = 0; i < containerInfo.stats.length; i++) { - var cur = containerInfo.stats[i]; - - var elements = []; - elements.push(cur.timestamp); - elements.push(cur.memory.usage / oneMegabyte); - elements.push(cur.memory.working_set / oneMegabyte); - data.push(elements); - } - - // Get the memory limit, saturate to the machine size. - var memory_limit = machineInfo.memory_capacity; - if (containerInfo.spec.memory.limit && (containerInfo.spec.memory.limit < memory_limit)) { - memory_limit = containerInfo.spec.memory.limit; - } - - var cur = containerInfo.stats[containerInfo.stats.length - 1]; - - var r = { - current: { - memoryUsage: cur.memory.usage, - workingMemoryUsage: cur.memory.working_set, - memoryLimit: memory_limit, - memoryUsageDescription: humanizeMetric(cur.memory.usage), - workingMemoryUsageDescription: humanizeMetric(cur.memory.working_set), - memoryLimitDescription: humanizeMetric(memory_limit) - }, - historical: data - }; - - return r; - } - }]); -})(); - -app.provider('k8sApi', - function() { - - var urlBase = ''; - var _namespace = 'default'; - - this.setUrlBase = function(value) { urlBase = value; }; - - this.setNamespace = function(value) { _namespace = value; }; - this.getNamespace = function() { return _namespace; }; - - var _get = function($http, baseUrl, query) { - var _fullUrl = baseUrl; - - if (query !== undefined) { - _fullUrl += '/' + query; - } - - return $http.get(_fullUrl); - }; - - this.$get = ["$http", "$q", function($http, $q) { - var api = {}; - - api.getUrlBase = function() { return urlBase + '/namespaces/' + _namespace; }; - - api.getPods = function(query) { return _get($http, api.getUrlBase() + '/pods', query); }; - - api.getNodes = function(query) { return _get($http, urlBase + '/nodes', query); }; - - api.getMinions = api.getNodes; - - api.getServices = function(query) { return _get($http, api.getUrlBase() + '/services', query); }; - - api.getReplicationControllers = function(query) { - return _get($http, api.getUrlBase() + '/replicationcontrollers', query) - }; - - api.getEvents = function(query) { return _get($http, api.getUrlBase() + '/events', query); }; - - return api; - }]; - }) - .config(["k8sApiProvider", "ENV", function(k8sApiProvider, ENV) { - if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) { - k8sApiProvider.setUrlBase(ENV['/']['k8sApiServer']); - } - }]); - -(function() { - "use strict"; - - var pollK8sDataServiceProvider = function PollK8sDataServiceProvider(_) { - // A set of configuration controlling the polling behavior. - // Their values should be configured in the application before - // creating the service instance. - - var useSampleData = false; - this.setUseSampleData = function(value) { useSampleData = value; }; - - var sampleDataFiles = ["shared/assets/sampleData1.json"]; - this.setSampleDataFiles = function(value) { sampleDataFiles = value; }; - - var dataServer = "http://localhost:5555/cluster"; - this.setDataServer = function(value) { dataServer = value; }; - - var pollMinIntervalSec = 10; - this.setPollMinIntervalSec = function(value) { pollMinIntervalSec = value; }; - - var pollMaxIntervalSec = 120; - this.setPollMaxIntervalSec = function(value) { pollMaxIntervalSec = value; }; - - var pollErrorThreshold = 5; - this.setPollErrorThreshold = function(value) { pollErrorThreshold = value; }; - - this.$get = function($http, $timeout) { - // Now the sequenceNumber will be used for debugging and verification purposes. - var k8sdatamodel = { - "data": undefined, - "sequenceNumber": 0, - "useSampleData": useSampleData - }; - var pollingError = 0; - var promise = undefined; - - // Implement fibonacci back off when the service is down. - var pollInterval = pollMinIntervalSec; - var pollIncrement = pollInterval; - - // Reset polling interval. - var resetCounters = function() { - pollInterval = pollMinIntervalSec; - pollIncrement = pollInterval; - }; - - // Bump error count and polling interval. - var bumpCounters = function() { - // Bump the error count. - pollingError++; - - // TODO: maybe display an error in the UI to the end user. - if (pollingError % pollErrorThreshold === 0) { - console.log("Error: " + pollingError + " consecutive polling errors for " + dataServer + "."); - } - - // Bump the polling interval. - var oldIncrement = pollIncrement; - pollIncrement = pollInterval; - pollInterval += oldIncrement; - - // Reset when limit reached. - if (pollInterval > pollMaxIntervalSec) { - resetCounters(); - } - }; - - var updateModel = function(newModel) { - var dedupe = function(dataModel) { - if (dataModel.resources) { - dataModel.resources = _.uniq(dataModel.resources, function(resource) { return resource.id; }); - } - - if (dataModel.relations) { - dataModel.relations = - _.uniq(dataModel.relations, function(relation) { return relation.source + relation.target; }); - } - }; - - dedupe(newModel); - - var newModelString = JSON.stringify(newModel); - var oldModelString = ""; - if (k8sdatamodel.data) { - oldModelString = JSON.stringify(k8sdatamodel.data); - } - - if (newModelString !== oldModelString) { - k8sdatamodel.data = newModel; - k8sdatamodel.sequenceNumber++; - } - - pollingError = 0; - resetCounters(); - }; - - var nextSampleDataFile = 0; - var getSampleDataFile = function() { - var result = ""; - if (sampleDataFiles.length > 0) { - result = sampleDataFiles[nextSampleDataFile % sampleDataFiles.length]; - ++nextSampleDataFile; - } - - return result; - }; - - var pollOnce = function(scope, repeat) { - var dataSource = (k8sdatamodel.useSampleData) ? getSampleDataFile() : dataServer; - $.getJSON(dataSource) - .done(function(newModel, jqxhr, textStatus) { - if (newModel && newModel.success) { - delete newModel.success; // Remove success indicator. - delete newModel.timestamp; // Remove changing timestamp. - updateModel(newModel); - scope.$apply(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - return; - } - - bumpCounters(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - }) - .fail(function(jqxhr, textStatus, error) { - bumpCounters(); - promise = repeat ? $timeout(function() { pollOnce(scope, true); }, pollInterval * 1000) : undefined; - }); - }; - - var isPolling = function() { return promise ? true : false; }; - - var start = function(scope) { - // If polling has already started, then calling start() again would - // just reset the counters and polling interval, but it will not - // start a new thread polling in parallel to the existing polling - // thread. - resetCounters(); - if (!promise) { - k8sdatamodel.data = undefined; - pollOnce(scope, true); - } - }; - - var stop = function() { - if (promise) { - $timeout.cancel(promise); - promise = undefined; - } - }; - - var refresh = function(scope) { - stop(scope); - resetCounters(); - k8sdatamodel.data = undefined; - pollOnce(scope, false); - }; - - return { - "k8sdatamodel": k8sdatamodel, - "isPolling": isPolling, - "refresh": refresh, - "start": start, - "stop": stop - }; - }; - }; - - angular.module("kubernetesApp.services") - .provider("pollK8sDataService", ["lodash", pollK8sDataServiceProvider]) - .config(["pollK8sDataServiceProvider", "ENV", function(pollK8sDataServiceProvider, ENV) { - if (ENV && ENV['/']) { - if (ENV['/']['k8sDataServer']) { - pollK8sDataServiceProvider.setDataServer(ENV['/']['k8sDataServer']); - } - if (ENV['/']['k8sDataPollIntervalMinSec']) { - pollK8sDataServiceProvider.setPollIntervalSec(ENV['/']['k8sDataPollIntervalMinSec']); - } - if (ENV['/']['k8sDataPollIntervalMaxSec']) { - pollK8sDataServiceProvider.setPollIntervalSec(ENV['/']['k8sDataPollIntervalMaxSec']); - } - if (ENV['/']['k8sDataPollErrorThreshold']) { - pollK8sDataServiceProvider.setPollErrorThreshold(ENV['/']['k8sDataPollErrorThreshold']); - } - } - }]); - -}()); - -/**========================================================= - * Module: toggle-state.js - * Services to share toggle state functionality - =========================================================*/ - - -app.controller('cAdvisorController', [ - '$scope', - '$routeParams', - 'k8sApi', - 'lodash', - 'cAdvisorService', - '$q', - '$interval', - function($scope, $routeParams, k8sApi, lodash, cAdvisorService, $q, $interval) { - $scope.k8sApi = k8sApi; - - $scope.activeMinionDataById = {}; - $scope.maxDataByById = {}; - - $scope.getData = function() { - $scope.loading = true; - - k8sApi.getMinions().success(angular.bind(this, function(res) { - $scope.minions = res; - // console.log(res); - var promises = lodash.map(res.items, function(m) { return cAdvisorService.getDataForMinion(m.metadata.name); }); - - $q.all(promises).then( - function(dataArray) { - lodash.each(dataArray, function(data, i) { - var m = res.items[i]; - - var maxData = maxMemCpuInfo(m.metadata.name, data.memoryData, data.cpuData, data.filesystemData); - - // console.log("maxData", maxData); - var hostname = ""; - if(m.status.addresses) - hostname = m.status.addresses[0].address; - - $scope.activeMinionDataById[m.metadata.name] = - transformMemCpuInfo(data.memoryData, data.cpuData, data.filesystemData, maxData, hostname); - }); - - }, - function(errorData) { - // console.log("Error: " + errorData); - $scope.loading = false; - }); - - $scope.loading = false; - })).error(angular.bind(this, this.handleError)); - }; - - function handleError(data, status, headers, config) { - // console.log("Error (" + status + "): " + data); - $scope.loading = false; - }; - - // d3 - function getColorForIndex(i, percentage) { - // var colors = ['red', 'blue', 'yellow', 'pink', 'purple', 'green', 'orange']; - // return colors[i]; - var c = "color-" + (i + 1); - if (percentage && percentage >= 90) - c = c + ' color-critical'; - else if (percentage && percentage >= 80) - c = c + ' color-warning'; - - return c; - } - - function getMaxColorForIndex(i, percentage) { - // var colors = ['red', 'blue', 'yellow', 'pink', 'purple', 'green', 'orange']; - // return colors[i]; - var c = "color-max-" + (i + 1); - if (percentage && percentage >= 90) - c = c + ' color-max-critical'; - else if (percentage && percentage >= 80) - c = c + ' color-max-warning'; - - return c; - } - - function maxMemCpuInfo(mId, mem, cpu, fsDataArray) { - if ($scope.maxDataByById[mId] === undefined) $scope.maxDataByById[mId] = {}; - - var currentMem = mem.current; - var currentCpu = cpu; - - var items = []; - - if ($scope.maxDataByById[mId]['cpu'] === undefined || - $scope.maxDataByById[mId]['cpu'] < currentCpu.cpuPercentUsage) { - // console.log("New max cpu " + mId, $scope.maxDataByById[mId].cpu, currentCpu.cpuPercentUsage); - $scope.maxDataByById[mId]['cpu'] = currentCpu.cpuPercentUsage; - } - items.push({ - maxValue: $scope.maxDataByById[mId]['cpu'], - maxTickClassNames: getColorForIndex(0, $scope.maxDataByById[mId]['cpu']), - maxClassNames: getMaxColorForIndex(0, $scope.maxDataByById[mId]['cpu']) - }); - - var memPercentage = Math.floor((currentMem.memoryUsage * 100.0) / currentMem.memoryLimit); - if ($scope.maxDataByById[mId]['mem'] === undefined || $scope.maxDataByById[mId]['mem'] < memPercentage) - $scope.maxDataByById[mId]['mem'] = memPercentage; - items.push({ - maxValue: $scope.maxDataByById[mId]['mem'], - maxTickClassNames: getColorForIndex(1, $scope.maxDataByById[mId]['mem']), - maxClassNames: getMaxColorForIndex(1, $scope.maxDataByById[mId]['mem']) - }); - - for (var i = 0; i < fsDataArray.length; i++) { - var f = fsDataArray[i]; - var fid = 'FS #' + f.filesystemNumber; - if ($scope.maxDataByById[mId][fid] === undefined || $scope.maxDataByById[mId][fid] < f.totalUsage) - $scope.maxDataByById[mId][fid] = f.totalUsage; - items.push({ - maxValue: $scope.maxDataByById[mId][fid], - maxTickClassNames: getColorForIndex(2 + i, $scope.maxDataByById[mId][fid]), - maxClassNames: getMaxColorForIndex(2 + i, $scope.maxDataByById[mId][fid]) - }); - } - - // console.log("Max Data is now " + mId, $scope.maxDataByById[mId]); - return items; - } - - function transformMemCpuInfo(mem, cpu, fsDataArray, maxData, hostName) { - var currentMem = mem.current; - var currentCpu = cpu; - - var items = []; - - items.push({ - label: 'CPU', - stats: currentCpu.cpuPercentUsage + '%', - value: currentCpu.cpuPercentUsage, - classNames: getColorForIndex(0, currentCpu.cpuPercentUsage), - maxData: maxData[0], - hostName: hostName - }); - - var memPercentage = Math.floor((currentMem.memoryUsage * 100.0) / currentMem.memoryLimit); - items.push({ - label: 'Memory', - stats: currentMem.memoryUsageDescription + ' / ' + currentMem.memoryLimitDescription, - value: memPercentage, - classNames: getColorForIndex(1, memPercentage), - maxData: maxData[1], - hostName: hostName - }); - - for (var i = 0; i < fsDataArray.length; i++) { - var f = fsDataArray[i]; - - items.push({ - label: 'Filesystem #' + f.filesystemNumber, - stats: f.usageDescription + ' / ' + f.capacityDescription, - value: f.totalUsage, - classNames: getColorForIndex(2 + i, f.totalUsage), - maxData: maxData[2 + i], - hostName: hostName - - }); - } - - var a = []; - var segments = { - segments: items - }; - a.push(segments); - return a; - }; - - // end d3 - var promise = $interval($scope.getData, 3000); - - // Cancel interval on page changes - $scope.$on('$destroy', function() { - if (angular.isDefined(promise)) { - $interval.cancel(promise); - promise = undefined; - } - }); - - $scope.getData(); - - } -]); - -/**========================================================= - * Module: Dashboard - * Visualizer for clusters - =========================================================*/ - -app.controller('DashboardCtrl', ['$scope', function($scope) {}]); - -/**========================================================= - * Module: Group - * Visualizer for groups - =========================================================*/ - -app.controller('GroupCtrl', [ - '$scope', - '$route', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - '$location', - 'lodash', - function($scope, $route, $interval, $routeParams, k8sApi, $rootScope, $location, _) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $scope.capitalize = function(s) { return _.capitalize(s); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.resetGroupLayout = function(group) { delete group.settings; }; - - $scope.handlePath = function(path) { - var parts = path.split("/"); - // split leaves an empty string at the beginning. - parts = parts.slice(1); - - if (parts.length === 0) { - return; - } - this.handleGroups(parts.slice(1)); - }; - - $scope.getState = function(obj) { return Object.keys(obj)[0]; }; - - $scope.clearSelector = function(grouping) { $location.path("/dashboard/groups/" + grouping + "/selector/"); }; - - $scope.changeGroupBy = function() { - var grouping = encodeURIComponent($scope.selectedGroupBy); - - var s = _.clone($location.search()); - if ($scope.routeParams.grouping != grouping) - $location.path("/dashboard/groups/" + grouping + "/selector/").search(s); - }; - - $scope.createBarrier = function(count, callback) { - var barrier = count; - var barrierFunction = angular.bind(this, function(data) { - // JavaScript is single threaded so this is safe. - barrier--; - if (barrier === 0) { - if (callback) { - callback(); - } - } - }); - return barrierFunction; - }; - - $scope.handleGroups = function(parts, selector) { - $scope.groupBy = parts; - $scope.loading = true; - $scope.selector = selector; - $scope.selectorName = decodeURIComponent(selector); - var args = []; - var type = ""; - var selectedHost = ""; - if (selector && selector.length > 0) { - $scope.selectorPieces = selector.split(","); - var labels = []; - var fields = []; - for (var i = 0; i < $scope.selectorPieces.length; i++) { - var piece = decodeURIComponent($scope.selectorPieces[i]); - if (piece[0] == '$') { - fields.push(piece.slice(2)); - } else { - if (piece.indexOf("type=") === 0) { - var labelParts = piece.split("="); - if (labelParts.length > 1) { - type = labelParts[1]; - } - } - else if (piece.indexOf("host=") === 0){ - var labelParts = piece.split("="); - if (labelParts.length > 1) { - selectedHost = labelParts[1]; - } - } - else { - labels.push(piece); - } - } - } - - if (labels.length > 0) { - args.push("labelSelector=" + encodeURI(labels.join(","))); - } - if (fields.length > 0) { - args.push("fields=" + encodeURI(fields.join(","))); - } - } - var query = "?" + args.join("&"); - var list = []; - var count = type.length > 0 ? 1 : 3; - - $scope.selectedGroupByName = decodeURIComponent($routeParams.grouping) - - var barrier = $scope.createBarrier(count, function() { - $scope.groups = $scope.groupData(list, 0); - $scope.loading = false; - $scope.groupByOptions = buildGroupByOptions(); - $scope.selectedGroupBy = $routeParams.grouping; - }); - - if (type === "" || type == "pod") { - k8sApi.getPods(query).success(function(data) { - $scope.addLabel("type", "pod", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - data.items[i].metadata.labels.host = data.items[i].spec.nodeName; - if(selectedHost.length == 0 || selectedHost == data.items[i].metadata.labels.host) - list.push(data.items[i]); - } - barrier(); - }).error($scope.handleError); - } - if (type === "" || type == "service") { - k8sApi.getServices(query).success(function(data) { - $scope.addLabel("type", "service", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - list.push(data.items[i]); - } - barrier(); - }).error($scope.handleError); - } - if (type === "" || type == "replicationController") { - k8sApi.getReplicationControllers(query).success(angular.bind(this, function(data) { - $scope.addLabel("type", "replicationController", data.items); - for (var i = 0; data.items && i < data.items.length; ++i) { - list.push(data.items[i]); - } - barrier(); - })).error($scope.handleError); - } - }; - - $scope.addLabel = function(key, value, items) { - if (!items) { - return; - } - for (var i = 0; i < items.length; i++) { - if (!items[i].metadata.labels) { - items[i].metadata.labels = {}; - } - items[i].metadata.labels[key] = value; - } - }; - - $scope.groupData = function(items, index) { - var result = { - "items": {}, - "kind": "grouping" - }; - for (var i = 0; i < items.length; i++) { - key = items[i].metadata.labels[decodeURIComponent($scope.groupBy[index])]; - if (!key) { - key = ""; - } - var list = result.items[key]; - if (!list) { - list = []; - result.items[key] = list; - } - list.push(items[i]); - } - - if (index + 1 < $scope.groupBy.length) { - for (var key in result.items) { - result.items[key] = $scope.groupData(result.items[key], index + 1); - } - } - return result; - }; - $scope.getGroupColor = function(type) { - if (type === 'pod') { - return '#6193F0'; - } else if (type === 'replicationController') { - return '#E008FE'; - } else if (type === 'service') { - return '#7C43FF'; - } - }; - - var groups = $routeParams.grouping; - if (!groups) { - groups = ''; - } - - $scope.routeParams = $routeParams; - $scope.route = $route; - - $scope.handleGroups(groups.split('/'), $routeParams.selector); - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - function getDefaultGroupByOptions() { return [{name: 'Type', value: 'type'}, {name: 'Name', value: 'name'}]; } - - function buildGroupByOptions() { - var g = $scope.groups; - var options = getDefaultGroupByOptions(); - var newOptions = _.map(g.items, function(vals) { return _.map(vals, function(v) { return _.keys(v.metadata.labels); }); }); - newOptions = - _.reject(_.uniq(_.flattenDeep(newOptions)), function(o) { return o == 'name' || o == 'type' || o == ""; }); - newOptions = _.map(newOptions, function(o) { - return { - name: o, - value: o - }; - }); - - options = options.concat(newOptions); - return options; - } - - $scope.changeFilterBy = function(selector) { - var grouping = $scope.selectedGroupBy; - - var s = _.clone($location.search()); - if ($scope.routeParams.selector != selector) - $location.path("/dashboard/groups/" + $scope.routeParams.grouping + "/selector/" + selector).search(s); - }; - } -]); - -/**========================================================= - * Module: Header - * Visualizer for clusters - =========================================================*/ - -angular.module('kubernetesApp.components.dashboard', []) - .controller('HeaderCtrl', [ - '$scope', - '$location', - function($scope, $location) { - 'use strict'; - $scope.$watch('Pages', function(newValue, oldValue) { - if (typeof newValue !== 'undefined') { - $location.path(newValue); - } - }); - - $scope.subPages = [ - {category: 'dashboard', name: 'Explore', value: '/dashboard/groups/type/selector/'}, - {category: 'dashboard', name: 'Pods', value: '/dashboard/pods'}, - {category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes'}, - {category: 'dashboard', name: 'Replication Controllers', value: '/dashboard/replicationcontrollers'}, - {category: 'dashboard', name: 'Services', value: '/dashboard/services'}, - {category: 'dashboard', name: 'Events', value: '/dashboard/events'} - ]; - } - ]); - -/**========================================================= - * Module: List Events - * Visualizer list events - =========================================================*/ - -app.controller('ListEventsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - '$filter', - function($scope, $routeParams, k8sApi, $location, $filter) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Last Seen', field: 'lastSeen'}, - {name: 'First Seen', field: 'firstSeen'}, - {name: 'Count', field: 'count'}, - {name: 'Name', field: 'name'}, - {name: 'Kind', field: 'kind'}, - {name: 'SubObject', field: 'subObject'}, - {name: 'Reason', field: 'reason'}, - {name: 'Source', field: 'source'}, - {name: 'Message', field: 'message'} - ]; - - - $scope.sortable = ['lastSeen', 'firstSeen', 'count', 'name', 'kind', 'subObject', 'reason', 'source', 'message']; - $scope.count = 50; - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getEvents().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(event) { - var _sources = ''; - if (event.source) { - _sources = event.source.component + ' ' + event.source.host; - } - - - $scope.content.push({ - firstSeen: $filter('date')(event.firstTimestamp, 'medium'), - lastSeen: $filter('date')(event.lastTimestamp, 'medium'), - count: event.count, - name: event.involvedObject.name, - kind: event.involvedObject.kind, - subObject: event.involvedObject.fieldPath, - reason: event.reason, - source: _sources, - message: event.message - }); - - - - }); - - $scope.content = _.sortBy($scope.content, function(e){ - return e.lastSeen; - }).reverse(); - - - }).error($scope.handleError); - } - - getData(); - - } -]); - -/**========================================================= - * Module: Minions - * Visualizer for minions - =========================================================*/ - -app.controller('ListMinionsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [{name: 'Name', field: 'name'}, {name: 'Addresses', field: 'addresses'}, {name: 'Status', field: 'status'}]; - - $scope.custom = { - name: '', - status: 'grey', - ip: 'grey' - }; - $scope.sortable = ['name', 'status', 'addresses']; - $scope.thumbs = 'thumb'; - $scope.count = 50; - - $scope.go = function(d) { $location.path('/dashboard/nodes/' + d.name); }; - - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getMinions().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(minion) { - var _statusType = ''; - - if (minion.status.conditions) { - Object.keys(minion.status.conditions) - .forEach(function(key) { _statusType += minion.status.conditions[key].type; }); - } - - - $scope.content.push({name: minion.metadata.name, addresses: _.map(minion.status.addresses, function(a) { return a.address }).join(', '), status: _statusType}); - }); - - }).error($scope.handleError); - } - - getData(); - - } -]); - - - -app.controller('ListPodsCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - 'lodash', - '$location', - function($scope, $routeParams, k8sApi, lodash, $location) { - var _ = lodash; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Pod', field: 'pod'}, - {name: 'IP', field: 'ip'}, - {name: 'Status', field: 'status'}, - {name: 'Containers', field: 'containers'}, - {name: 'Images', field: 'images'}, - {name: 'Host', field: 'host'}, - {name: 'Labels', field: 'labels'} - ]; - - $scope.custom = { - pod: '', - ip: 'grey', - containers: 'grey', - images: 'grey', - host: 'grey', - labels: 'grey', - status: 'grey' - }; - $scope.sortable = ['pod', 'ip', 'status','containers','images','host','labels']; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/pods/' + data.pod); }; - - var orderedPodNames = []; - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - }; - - function getPodName(pod) { return _.has(pod.metadata.labels, 'name') ? pod.metadata.labels.name : pod.metadata.name; } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getPods().success(angular.bind(this, function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(pod) { - var _containers = '', _images = '', _labels = '', _uses = ''; - - if (pod.spec) { - Object.keys(pod.spec.containers) - .forEach(function(key) { - _containers += ', ' + pod.spec.containers[key].name; - _images += ', ' + pod.spec.containers[key].image; - }); - } - - if (pod.metadata.labels) { - _labels = _.map(pod.metadata.labels, function(v, k) { return k + ': ' + v }).join(', '); - } - - $scope.content.push({ - pod: pod.metadata.name, - ip: pod.status.podIP, - containers: _fixComma(_containers), - images: _fixComma(_images), - host: pod.spec.nodeName, - labels: _labels, - status: pod.status.phase - }); - - }); - - })).error(angular.bind(this, handleError)); - }; - - $scope.getPodRestarts = function(pod) { - var r = null; - var container = _.first(pod.spec.containers); - if (container) r = pod.status.containerStatuses[container.name].restartCount; - return r; - }; - - $scope.otherLabels = function(labels) { return _.omit(labels, 'name') }; - - $scope.podStatusClass = function(pod) { - - var s = pod.status.phase.toLowerCase(); - - if (s == 'running' || s == 'succeeded') - return null; - else - return "status-" + s; - }; - - $scope.podIndexFromName = function(pod) { - var name = getPodName(pod); - return _.indexOf(orderedPodNames, name) + 1; - }; - - getData(); - - } -]); - -/**========================================================= - * Module: Replication Controllers - * Visualizer for replication controllers - =========================================================*/ - -app.controller('ListReplicationControllersCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - 'use strict'; - $scope.getData = getData; - $scope.loading = true; - $scope.k8sApi = k8sApi; - $scope.pods = null; - $scope.groupedPods = null; - $scope.serverView = false; - - $scope.headers = [ - {name: 'Controller', field: 'controller'}, - {name: 'Containers', field: 'containers'}, - {name: 'Images', field: 'images'}, - {name: 'Selector', field: 'selector'}, - {name: 'Replicas', field: 'replicas'} - ]; - - $scope.custom = { - controller: '', - containers: 'grey', - images: 'grey', - selector: 'grey', - replicas: 'grey' - }; - $scope.sortable = ['controller', 'containers', 'images', 'selector', 'replicas']; - $scope.thumbs = 'thumb'; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/replicationcontrollers/' + data.controller); }; - - function handleError(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope.loading = false; - } - - $scope.content = []; - - function getData() { - $scope.loading = true; - k8sApi.getReplicationControllers().success(function(data) { - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - data.items.forEach(function(replicationController) { - - var _name = '', _image = ''; - - if (replicationController.spec.template.spec.containers) { - Object.keys(replicationController.spec.template.spec.containers) - .forEach(function(key) { - _name += replicationController.spec.template.spec.containers[key].name; - _image += replicationController.spec.template.spec.containers[key].image; - }); - } - - var _selectors = ''; - - if (replicationController.spec.selector) { - _selectors = _.map(replicationController.spec.selector, function(v, k) { return k + '=' + v }).join(', '); - } - - $scope.content.push({ - controller: replicationController.metadata.name, - containers: _name, - images: _image, - selector: _selectors, - replicas: replicationController.status.replicas - }); - - }); - - }).error($scope.handleError); - } - - getData(); - - } -]); - -/**========================================================= - * Module: Services - * Visualizer for services - =========================================================*/ - -app.controller('ListServicesCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - '$location', - function($scope, $interval, $routeParams, k8sApi, $rootScope, $location) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $scope.headers = [ - {name: 'Name', field: 'name'}, - {name: 'Labels', field: 'labels'}, - {name: 'Selector', field: 'selector'}, - {name: 'IP', field: 'ip'}, - {name: 'Ports', field: 'port'} - ]; - - $scope.custom = { - name: '', - ip: 'grey', - selector: 'grey', - port: 'grey', - labels: 'grey' - }; - $scope.sortable = ['name', 'ip', 'port', 'labels', 'selector']; - $scope.count = 50; - - $scope.go = function(data) { $location.path('/dashboard/services/' + data.name); }; - - $scope.content = []; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.getData = function() { - $scope.loading = true; - k8sApi.getServices().success(angular.bind(this, function(data) { - $scope.services = data; - $scope.loading = false; - - var _fixComma = function(str) { - if (str.substring(0, 1) == ',') { - return str.substring(1); - } else { - return str; - } - }; - - var addLabel = function(str, label) { - if (str) { - str = label + str; - } - return str; - }; - - if (data.items.constructor === Array) { - data.items.forEach(function(service) { - - var _labels = ''; - - if (service.metadata.labels) { - _labels = _.map(service.metadata.labels, function(v, k) { return k + ': ' + v }).join(', '); - } - - var _selectors = ''; - - if (service.spec.selector) { - _selectors = _.map(service.spec.selector, function(v, k) { return k + '=' + v }).join(', '); - } - - var _ports = ''; - - if (service.spec.ports) { - _ports = _.map(service.spec.ports, function(p) { - var n = ''; - if(p.name) - n = p.name + ': '; - n = n + p.port; - return n; - }).join(', '); - } - - $scope.content.push({ - name: service.metadata.name, - ip: service.spec.clusterIP, - port: _ports, - selector: _selectors, - labels: _labels - }); - }); - } - })).error($scope.handleError); - }; - - $scope.getData(); - } -]); - -/**========================================================= - * Module: Nodes - * Visualizer for nodes - =========================================================*/ - -app.controller('NodeCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - function($scope, $interval, $routeParams, k8sApi, $rootScope) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.handleNode = function(nodeId) { - $scope.loading = true; - k8sApi.getNodes(nodeId).success(angular.bind(this, function(data) { - $scope.node = data; - $scope.loading = false; - })).error($scope.handleError); - }; - - $scope.handleNode($routeParams.nodeId); - } -]); - -/**========================================================= - * Module: Pods - * Visualizer for pods - =========================================================*/ - -app.controller('PodCtrl', [ - '$scope', - '$interval', - '$routeParams', - 'k8sApi', - '$rootScope', - function($scope, $interval, $routeParams, k8sApi, $rootScope) { - 'use strict'; - $scope.doTheBack = function() { window.history.back(); }; - - $rootScope.doTheBack = $scope.doTheBack; - - $scope.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - $scope_.loading = false; - }; - - $scope.handlePod = function(podId) { - $scope.loading = true; - k8sApi.getPods(podId).success(angular.bind(this, function(data) { - $scope.pod = data; - $scope.loading = false; - })).error($scope.handleError); - }; - - $scope.handlePod($routeParams.podId); - } -]); - -/**========================================================= - * Module: Replication - * Visualizer for replication controllers - =========================================================*/ - -function ReplicationController() { -} - -ReplicationController.prototype.getData = function(dataId) { - this.scope.loading = true; - this.k8sApi.getReplicationControllers(dataId).success(angular.bind(this, function(data) { - this.scope.replicationController = data; - this.scope.loading = false; - })).error(angular.bind(this, this.handleError)); -}; - -ReplicationController.prototype.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - this.scope.loading = false; -}; - -app.controller('ReplicationControllerCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - function($scope, $routeParams, k8sApi) { - $scope.controller = new ReplicationController(); - $scope.controller.k8sApi = k8sApi; - $scope.controller.scope = $scope; - $scope.controller.getData($routeParams.replicationControllerId); - - $scope.doTheBack = function() { window.history.back(); }; - $scope.getSelectorUrlFragment = function(sel){ return _.map(sel, function(v, k) { return k + '=' + v }).join(','); }; - - } -]); - -/**========================================================= - * Module: Services - * Visualizer for services - =========================================================*/ - -function ServiceController() { -} - -ServiceController.prototype.getData = function(dataId) { - this.scope.loading = true; - this.k8sApi.getServices(dataId).success(angular.bind(this, function(data) { - this.scope.service = data; - this.scope.loading = false; - })).error(angular.bind(this, this.handleError)); -}; - -ServiceController.prototype.handleError = function(data, status, headers, config) { - console.log("Error (" + status + "): " + data); - this.scope.loading = false; -}; - -app.controller('ServiceCtrl', [ - '$scope', - '$routeParams', - 'k8sApi', - '$location', - function($scope, $routeParams, k8sApi, $location) { - $scope.controller = new ServiceController(); - $scope.controller.k8sApi = k8sApi; - $scope.controller.scope = $scope; - $scope.controller.getData($routeParams.serviceId); - - $scope.doTheBack = function() { window.history.back(); }; - $scope.go = function(d) { $location.path('/dashboard/services/' + d.metadata.name); } - $scope.getSelectorUrlFragment = function(sel){ return _.map(sel, function(v, k) { return k + '=' + v }).join(','); }; - - } -]); - -(function() { - 'use strict'; - - angular.module('kubernetesApp.components.dashboard') - .directive('d3MinionBarGauge', [ - 'd3DashboardService', - function(d3DashboardService) { - - return { - restrict: 'E', - scope: { - data: '=', - thickness: '@', - graphWidth: '@', - graphHeight: '@' - - }, - link: function(scope, element, attrs) { - - var draw = function(d3) { - var svg = d3.select("svg.chart"); - var legendSvg = d3.select("svg.legend"); - window.onresize = function() { return scope.$apply(); }; - - scope.$watch(function() { return angular.element(window)[0].innerWidth; }, - function() { return scope.render(scope.data); }); - - scope.$watch('data', function(newVals, oldVals) { - return initOrUpdate(newVals, oldVals); - - }, true); - - function initOrUpdate(newVals, oldVals) { - if (oldVals === null || oldVals === undefined) { - return scope.render(newVals); - } else { - return update(oldVals, newVals); - } - } - - var textOffset = 10; - var el = null; - var radius = 100; - var oldData = []; - - function init(options) { - var clone = options.data; - var preparedData = setData(clone); - setup(preparedData, options.width, options.height); - } - - function setup(data, w, h) { - svg = d3.select(element[0]).append("svg").attr("width", "100%"); - - legendSvg = d3.select(element[0]).append("svg").attr("width", "100%"); - - var chart = svg.attr("class", "chart") - .attr("width", w) - .attr("height", h - 25) - .append("svg:g") - .attr("class", "concentricchart") - .attr("transform", "translate(" + ((w / 2)) + "," + h / 4 + ")"); - - var legend = legendSvg.attr("class", "legend").attr("width", w); - - radius = Math.min(w, h) / 2; - - var hostName = legendSvg.append("text") - .attr("class", "hostName") - .attr("transform", "translate(" + ((w - 120) / 2) + "," + 15 + ")"); - - var label_legend_area = legendSvg.append("svg:g") - .attr("class", "label_legend_area") - .attr("transform", "translate(" + ((w - 215) / 2) + "," + 35 + ")"); - - var legend_group = label_legend_area.append("svg:g").attr("class", "legend_group"); - - var label_group = label_legend_area.append("svg:g") - .attr("class", "label_group") - .attr("transform", "translate(" + 25 + "," + 11 + ")"); - - var stats_group = label_legend_area.append("svg:g") - .attr("class", "stats_group") - .attr("transform", "translate(" + 115 + "," + 11 + ")"); - - var path_group = chart.append("svg:g") - .attr("class", "path_group") - .attr("transform", "translate(0," + (h / 4) + ")"); - var value_group = chart.append("svg:g") - .attr("class", "value_group") - .attr("transform", "translate(" + -(w * 0.205) + "," + -(h * 0.10) + ")"); - generateArcs(chart, data); - } - - function update(_oldData, _newData) { - if (_newData === undefined || _newData === null) { - return; - } - - var clone = jQuery.extend(true, {}, _newData); - var cloneOld = jQuery.extend(true, {}, _oldData); - var preparedData = setData(clone); - oldData = setData(cloneOld); - animate(preparedData); - } - - function animate(data) { generateArcs(null, data); } - - function setData(data) { - var diameter = 2 * Math.PI * radius; - var localData = []; - - $.each(data[0].segments, function(ri, value) { - - function calcAngles(v) { - var segmentValueSum = 200; - if (v > segmentValueSum) { - v = segmentValueSum; - } - - var segmentValue = v; - var fraction = segmentValue / segmentValueSum; - var arcBatchLength = fraction * 4 * Math.PI; - var arcPartition = arcBatchLength; - var startAngle = Math.PI * 2; - var endAngle = startAngle + arcPartition; - - return { - startAngle: startAngle, - endAngle: endAngle - }; - } - - var valueData = calcAngles(value.value); - data[0].segments[ri].startAngle = valueData.startAngle; - data[0].segments[ri].endAngle = valueData.endAngle; - - var maxData = value.maxData; - var maxTickData = calcAngles(maxData.maxValue + 0.2); - data[0].segments[ri].maxTickStartAngle = maxTickData.startAngle; - data[0].segments[ri].maxTickEndAngle = maxTickData.endAngle; - - var maxArcData = calcAngles(maxData.maxValue); - data[0].segments[ri].maxArcStartAngle = maxArcData.startAngle; - data[0].segments[ri].maxArcEndAngle = maxArcData.endAngle; - - data[0].segments[ri].index = ri; - }); - localData.push(data[0].segments); - return localData[0]; - } - - function generateArcs(_svg, data) { - var chart = svg; - var transitionTime = 750; - $.each(data, function(index, value) { - if (oldData[index] !== undefined) { - data[index].previousEndAngle = oldData[index].endAngle; - } else { - data[index].previousEndAngle = 0; - } - }); - var thickness = parseInt(scope.thickness, 10); - var ir = (parseInt(scope.graphWidth, 10) / 3); - var path_group = svg.select('.path_group'); - var arc_group = path_group.selectAll(".arc_group").data(data); - var arcEnter = arc_group.enter().append("g").attr("class", "arc_group"); - - arcEnter.append("path").attr("class", "bg-circle").attr("d", getBackgroundArc(thickness, ir)); - - arcEnter.append("path") - .attr("class", function(d, i) { return 'max_tick_arc ' + d.maxData.maxTickClassNames; }); - - arcEnter.append("path") - .attr("class", function(d, i) { return 'max_bg_arc ' + d.maxData.maxClassNames; }); - - arcEnter.append("path").attr("class", function(d, i) { return 'value_arc ' + d.classNames; }); - - var max_tick_arc = arc_group.select(".max_tick_arc"); - - max_tick_arc.transition() - .attr("class", function(d, i) { return 'max_tick_arc ' + d.maxData.maxTickClassNames; }) - .attr("d", function(d) { - var arc = maxArc(thickness, ir); - arc.startAngle(d.maxTickStartAngle); - arc.endAngle(d.maxTickEndAngle); - return arc(d); - }); - - var max_bg_arc = arc_group.select(".max_bg_arc"); - - max_bg_arc.transition() - .attr("class", function(d, i) { return 'max_bg_arc ' + d.maxData.maxClassNames; }) - .attr("d", function(d) { - var arc = maxArc(thickness, ir); - arc.startAngle(d.maxArcStartAngle); - arc.endAngle(d.maxArcEndAngle); - return arc(d); - }); - - var value_arc = arc_group.select(".value_arc"); - - value_arc.transition().ease("exp").attr("class", function(d, i) { - return 'value_arc ' + d.classNames; - }).duration(transitionTime).attrTween("d", function(d) { return arcTween(d, thickness, ir); }); - - arc_group.exit() - .select(".value_arc") - .transition() - .ease("exp") - .duration(transitionTime) - .attrTween("d", function(d) { return arcTween(d, thickness, ir); }) - .remove(); - - drawLabels(chart, data, ir, thickness); - buildLegend(chart, data); - } - - function arcTween(b, thickness, ir) { - var prev = JSON.parse(JSON.stringify(b)); - prev.endAngle = b.previousEndAngle; - var i = d3.interpolate(prev, b); - return function(t) { return getArc(thickness, ir)(i(t)); }; - } - - function maxArc(thickness, ir) { - var arc = d3.svg.arc().innerRadius(function(d) { - return getRadiusRing(ir, d.index); - }).outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }); - return arc; - } - - function drawLabels(chart, data, ir, thickness) { - svg.select('.value_group').selectAll("*").remove(); - var counts = data.length; - var value_group = chart.select('.value_group'); - var valueLabels = value_group.selectAll("text.value").data(data); - valueLabels.enter() - .append("svg:text") - .attr("class", "value") - .attr("dx", function(d, i) { return 68; }) - .attr("dy", function(d, i) { return (thickness + 3) * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.value; }); - valueLabels.transition().duration(300).attrTween( - "d", function(d) { return arcTween(d, thickness, ir); }); - valueLabels.exit().remove(); - } - - function buildLegend(chart, data) { - var svg = legendSvg; - svg.select('.label_group').selectAll("*").remove(); - svg.select('.legend_group').selectAll("*").remove(); - svg.select('.stats_group').selectAll("*").remove(); - - var host_name = svg.select('.hostName'); - var label_group = svg.select('.label_group'); - var stats_group = svg.select('.stats_group'); - - host_name.text(data[0].hostName); - - host_name = svg.selectAll("text.hostName").data(data); - - host_name.attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.hostName; }); - host_name.exit().remove(); - - var labels = label_group.selectAll("text.labels").data(data); - labels.enter() - .append("svg:text") - .attr("class", "labels") - .attr("dy", function(d, i) { return 19 * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.label; }); - labels.exit().remove(); - - var stats = stats_group.selectAll("text.stats").data(data); - stats.enter() - .append("svg:text") - .attr("class", "stats") - .attr("dy", function(d, i) { return 19 * i; }) - .attr("text-anchor", function(d) { return "start"; }) - .text(function(d) { return d.stats; }); - stats.exit().remove(); - - var legend_group = svg.select('.legend_group'); - var legend = legend_group.selectAll("rect").data(data); - legend.enter() - .append("svg:rect") - .attr("x", 2) - .attr("y", function(d, i) { return 19 * i; }) - .attr("width", 13) - .attr("height", 13) - .attr("class", function(d, i) { return "rect " + d.classNames; }); - - legend.exit().remove(); - } - - function getRadiusRing(ir, i) { return ir - (i * 20); } - - function getArc(thickness, ir) { - var arc = d3.svg.arc() - .innerRadius(function(d) { return getRadiusRing(ir, d.index); }) - .outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }) - .startAngle(function(d, i) { return d.startAngle; }) - .endAngle(function(d, i) { return d.endAngle; }); - return arc; - } - - function getBackgroundArc(thickness, ir) { - var arc = d3.svg.arc() - .innerRadius(function(d) { return getRadiusRing(ir, d.index); }) - .outerRadius(function(d) { return getRadiusRing(ir + thickness, d.index); }) - .startAngle(0) - .endAngle(function() { return 2 * Math.PI; }); - return arc; - } - - scope.render = function(data) { - if (data === undefined || data === null) { - return; - } - - d3.select(element[0]).select("svg.chart").remove(); - d3.select(element[0]).select("svg.legend").remove(); - - var graph = $(element[0]); - var w = scope.graphWidth; - var h = scope.graphHeight; - - var options = { - data: data, - width: w, - height: h - }; - - init(options); - }; - }; - d3DashboardService.d3().then(draw); - } - }; - } - ]); -}()); - -(function() { - 'use strict'; - - angular.module('kubernetesApp.components.dashboard') - .directive( - 'dashboardHeader', - function() { - 'use strict'; - return { - restrict: 'A', - replace: true, - scope: {user: '='}, - templateUrl: "components/dashboard/pages/header.html", - controller: [ - '$scope', - '$filter', - '$location', - 'menu', - '$rootScope', - function($scope, $filter, $location, menu, $rootScope) { - $scope.menu = menu; - $scope.$watch('page', function(newValue, oldValue) { - if (typeof newValue !== 'undefined') { - $location.path(newValue); - } - }); - $scope.subpages = [ - { - category: 'dashboard', - name: 'Explore', - value: '/dashboard/groups/type/selector/', - id: 'groupsView' - }, - {category: 'dashboard', name: 'Pods', value: '/dashboard/pods', id: 'podsView'}, - {category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes', id: 'minionsView'}, - { - category: 'dashboard', - name: 'Replication Controllers', - value: '/dashboard/replicationcontrollers', - id: 'rcView' - }, - {category: 'dashboard', name: 'Services', value: '/dashboard/services', id: 'servicesView'}, - {category: 'dashboard', name: 'Events', value: '/dashboard/events', id: 'eventsView'}, - ]; - } - ] - }; - }) - .directive('dashboardFooter', - function() { - 'use strict'; - return { - restrict: 'A', - replace: true, - templateUrl: "components/dashboard/pages/footer.html", - controller: ['$scope', '$filter', function($scope, $filter) {}] - }; - }) - .directive('mdTable', function() { - 'use strict'; - return { - restrict: 'E', - scope: { - headers: '=', - content: '=', - sortable: '=', - filters: '=', - customClass: '=customClass', - thumbs: '=', - count: '=', - reverse: '=', - doSelect: '&onSelect' - }, - transclude: true, - controller: ["$scope", "$filter", "$window", "$location", function($scope, $filter, $window, $location) { - var orderBy = $filter('orderBy'); - $scope.currentPage = 0; - $scope.nbOfPages = function() { return Math.ceil($scope.content.length / $scope.count); }; - $scope.handleSort = function(field) { - if ($scope.sortable.indexOf(field) > -1) { - return true; - } else { - return false; - } - }; - $scope.order = function(predicate, reverse) { - $scope.content = orderBy($scope.content, predicate, reverse); - $scope.predicate = predicate; - }; - var reverse = false; - if($scope.reverse) - reverse = $scope.reverse; - - $scope.order($scope.sortable[0], reverse); - $scope.getNumber = function(num) { return new Array(num); }; - $scope.goToPage = function(page) { $scope.currentPage = page; }; - $scope.showMore = function() { return angular.isDefined($scope.moreClick);} - }], - templateUrl: 'views/partials/md-table.tmpl.html' - }; - }); - -}()); - -angular.module('kubernetesApp.components.dashboard') - .factory('d3DashboardService', [ - '$document', - '$q', - '$rootScope', - function($document, $q, $rootScope) { - var d = $q.defer(); - function onScriptLoad() { - // Load client in the browser - $rootScope.$apply(function() { d.resolve(window.d3); }); - } - // Create a script tag with d3 as the source - // and call our onScriptLoad callback when it - // has been loaded - var scriptTag = $document[0].createElement('script'); - scriptTag.type = 'text/javascript'; - scriptTag.async = true; - scriptTag.src = 'vendor/d3/d3.min.js'; - scriptTag.onreadystatechange = function() { - if (this.readyState == 'complete') onScriptLoad(); - }; - scriptTag.onload = onScriptLoad; - - var s = $document[0].getElementsByTagName('body')[0]; - s.appendChild(scriptTag); - - return { - d3: function() { return d.promise; } - }; - } - ]); - -(function() { - 'use strict'; - - angular.module('pods', []).service('podService', PodDataService); - - /** - * Pod DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function PodDataService($q) { - var pods = { - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "redis-master-c0r1n", - "generateName": "redis-master-", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/pods/redis-master-c0r1n", - "uid": "f12ddfaf-ff77-11e4-8f2d-080027213276", - "resourceVersion": "39", - "creationTimestamp": "2015-05-21T05:12:14Z", - "labels": { - "name": "redis-master" - }, - "annotations": { - "kubernetes.io/created-by": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"default\",\"name\":\"redis-master\",\"uid\":\"f12969e0-ff77-11e4-8f2d-080027213276\",\"apiVersion\":\"v1\",\"resourceVersion\":\"26\"}}" - } - }, - "spec": { - "volumes": [ - { - "name": "default-token-zb4rq", - "secret": { - "secretName": "default-token-zb4rq" - } - } - ], - "containers": [ - { - "name": "master", - "image": "redis", - "ports": [ - { - "containerPort": 6379, - "protocol": "TCP" - } - ], - "resources": {}, - "volumeMounts": [ - { - "name": "default-token-zb4rq", - "readOnly": true, - "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount" - } - ], - "terminationMessagePath": "/dev/termination-log", - "imagePullPolicy": "IfNotPresent", - "capabilities": {}, - "securityContext": { - "capabilities": {}, - "privileged": false - } - } - ], - "restartPolicy": "Always", - "dnsPolicy": "ClusterFirst", - "serviceAccount": "default", - "host": "127.0.0.1" - }, - "status": { - "phase": "Running", - "Condition": [ - { - "type": "Ready", - "status": "True" - } - ], - "hostIP": "127.0.0.1", - "podIP": "172.17.0.1", - "startTime": "2015-05-21T05:12:14Z", - "containerStatuses": [ - { - "name": "master", - "state": { - "running": { - "startedAt": "2015-05-21T05:12:14Z" - } - }, - "lastState": {}, - "ready": true, - "restartCount": 0, - "image": "redis", - "imageID": "docker://95af5842ddb9b03f7c6ec7601e65924cec516fcedd7e590ae31660057085cf67", - "containerID": "docker://ae2a1e0a91a8b1015191a0b8e2ce8c55a86fb1a9a2b1e8e3b29430c9d93c8c09" - } - ] - } -}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(pods); - } - }; - } - PodDataService.$inject = ["$q"]; - -})(); - -(function() { - 'use strict'; - - angular.module('replicationControllers', []) - .service('replicationControllerService', ReplicationControllerDataService); - - /** - * Replication Controller DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function ReplicationControllerDataService($q) { - var replicationControllers = { - "kind": "List", - "apiVersion": "v1", - "metadata": {}, - "items": [ - { - "kind": "ReplicationController", - "apiVersion": "v1", - "metadata": { - "name": "redis-master", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/replicationcontrollers/redis-master", - "uid": "f12969e0-ff77-11e4-8f2d-080027213276", - "resourceVersion": "28", - "creationTimestamp": "2015-05-21T05:12:14Z", - "labels": { - "name": "redis-master" - } - }, - "spec": { - "replicas": 1, - "selector": { - "name": "redis-master" - }, - "template": { - "metadata": { - "creationTimestamp": null, - "labels": { - "name": "redis-master" - } - }, - "spec": { - "containers": [ - { - "name": "master", - "image": "redis", - "ports": [ - { - "containerPort": 6379, - "protocol": "TCP" - } - ], - "resources": {}, - "terminationMessagePath": "/dev/termination-log", - "imagePullPolicy": "IfNotPresent", - "capabilities": {}, - "securityContext": { - "capabilities": {}, - "privileged": false - } - } - ], - "restartPolicy": "Always", - "dnsPolicy": "ClusterFirst", - "serviceAccount": "" - } - } - }, - "status": { - "replicas": 1 - } - } - ]}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(replicationControllers); - } - }; - } - ReplicationControllerDataService.$inject = ["$q"]; - -})(); - -(function() { - 'use strict'; - - angular.module('services', []).service('serviceService', ServiceDataService); - - /** - * Service DataService - * Mock async data service. - * - * @returns {{loadAll: Function}} - * @constructor - */ - function ServiceDataService($q) { - var services = { - "kind": "List", - "apiVersion": "v1", - "metadata": {}, - "items": [ - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "kubernetes", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/kubernetes", - "resourceVersion": "6", - "creationTimestamp": null, - "labels": { - "component": "apiserver", - "provider": "kubernetes" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 443, - "targetPort": 443 - } - ], - "portalIP": "10.0.0.2", - "sessionAffinity": "None" - }, - "status": {} - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "kubernetes-ro", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/kubernetes-ro", - "resourceVersion": "8", - "creationTimestamp": null, - "labels": { - "component": "apiserver", - "provider": "kubernetes" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 80, - "targetPort": 80 - } - ], - "portalIP": "10.0.0.1", - "sessionAffinity": "None" - }, - "status": {} - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "redis-master", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/redis-master", - "uid": "a6fde246-ff78-11e4-8f2d-080027213276", - "resourceVersion": "72", - "creationTimestamp": "2015-05-21T05:17:19Z", - "labels": { - "name": "redis-master" - } - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 6379, - "targetPort": 6379 - } - ], - "selector": { - "name": "redis-master" - }, - "portalIP": "10.0.0.124", - "sessionAffinity": "None" - }, - "status": {} - } - ] -}; - - // Uses promises - return { - loadAll: function() { - // Simulate async call - return $q.when(services); - } - }; - } - ServiceDataService.$inject = ["$q"]; - -})(); diff --git a/www/app/assets/js/base.js b/www/app/assets/js/base.js deleted file mode 100644 index 5900f0b89f..0000000000 --- a/www/app/assets/js/base.js +++ /dev/null @@ -1,26 +0,0 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=Z.type(e);return"function"===n||Z.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Z.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ae.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return U.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t=he[e]={};return Z.each(e.match(de)||[],function(e,n){t[n]=!0}),t}function s(){J.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),Z.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+a.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(be,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:xe.test(n)?Z.parseJSON(n):n}catch(i){}ye.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return J.activeElement}catch(e){}}function p(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function d(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function h(e){var t=Pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,r=e.length;r>n;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function m(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(ve.hasData(e)&&(o=ve.access(e),s=ve.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)Z.event.add(t,i,l[i][n])}ye.hasData(e)&&(a=ye.access(e),u=Z.extend({},a),ye.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ne.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function x(t,n){var r,i=Z(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:Z.css(i[0],"display");return i.detach(),o}function b(e){var t=J,n=$e[e];return n||(n=x(e,t),"none"!==n&&n||(We=(We||Z("