diff --git a/.gitignore b/.gitignore index 4eaf8ae..82aca4a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,9 @@ results node_modules npm-debug.log -client/bower_components -client/public -client/app/locales/*.json -!client/app/locales/en.json +bower_components +public +app/locales/*.json +app/locales/en.json picture.jpg diff --git a/client/README.md b/app/README.md similarity index 100% rename from client/README.md rename to app/README.md diff --git a/client/app/application.coffee b/app/application.coffee similarity index 79% rename from client/app/application.coffee rename to app/application.coffee index de67633..33541e1 100644 --- a/client/app/application.coffee +++ b/app/application.coffee @@ -35,12 +35,13 @@ class Application extends Mn.Application @model = new AppViewModel null, model: config @contacts = new ContactsCollection() - @filtered = new FilteredCollection() - @tags = new TagsCollection(@contacts) + @filtered = new FilteredCollection { + contacts: @contacts + model: @model + channel: @channel + } - # As long as Tags require Contacts to be loaded (see Tags.refs), we - # trigger all TagsCollection fetch after syncing ContactsCollection. - @listenToOnce @contacts, 'sync': -> @tags.underlying.fetch reset: true + @tags = new TagsCollection @contacts @layout = new AppLayout model: @model @router = new Router() @@ -49,10 +50,15 @@ class Application extends Mn.Application Object.freeze @ if typeof Object.freeze is 'function' + # render components when app starts onStart: -> @layout.render() - @contacts.fetch reset: true + + @contacts.fetch {reset: true}, (models, collection) => + # As long as Tags require Contacts to be loaded (see Tags.refs), we + # trigger all TagsCollection fetch after syncing ContactsCollection. + @tags.underlying.fetch {reset: true} # prohibit pushState because URIs mapped from cozy-home rely on # fragment @@ -62,7 +68,7 @@ class Application extends Mn.Application search: (pattern, string) -> filter = @model.get 'filter' input = "`#{pattern}:#{string}`" - _pattern = require('config').search.pattern pattern + _pattern = require('const-config').search.pattern pattern prev = filter?.match _pattern if string diff --git a/build/client/public/fonts/adobeblank.woff b/app/assets/fonts/adobeblank.woff similarity index 100% rename from build/client/public/fonts/adobeblank.woff rename to app/assets/fonts/adobeblank.woff diff --git a/build/client/public/fonts/fontawesome-webfont.woff b/app/assets/fonts/fontawesome-webfont.woff similarity index 100% rename from build/client/public/fonts/fontawesome-webfont.woff rename to app/assets/fonts/fontawesome-webfont.woff diff --git a/build/client/public/fonts/fontawesome-webfont.woff2 b/app/assets/fonts/fontawesome-webfont.woff2 similarity index 100% rename from build/client/public/fonts/fontawesome-webfont.woff2 rename to app/assets/fonts/fontawesome-webfont.woff2 diff --git a/build/client/public/fonts/fonts.css b/app/assets/fonts/fonts.css similarity index 100% rename from build/client/public/fonts/fonts.css rename to app/assets/fonts/fonts.css diff --git a/build/client/public/fonts/mavenpro-bold.woff b/app/assets/fonts/mavenpro-bold.woff similarity index 100% rename from build/client/public/fonts/mavenpro-bold.woff rename to app/assets/fonts/mavenpro-bold.woff diff --git a/build/client/public/fonts/mavenpro-bold.woff2 b/app/assets/fonts/mavenpro-bold.woff2 similarity index 100% rename from build/client/public/fonts/mavenpro-bold.woff2 rename to app/assets/fonts/mavenpro-bold.woff2 diff --git a/build/client/public/fonts/mavenpro-regular.woff b/app/assets/fonts/mavenpro-regular.woff similarity index 100% rename from build/client/public/fonts/mavenpro-regular.woff rename to app/assets/fonts/mavenpro-regular.woff diff --git a/build/client/public/fonts/mavenpro-regular.woff2 b/app/assets/fonts/mavenpro-regular.woff2 similarity index 100% rename from build/client/public/fonts/mavenpro-regular.woff2 rename to app/assets/fonts/mavenpro-regular.woff2 diff --git a/build/client/public/fonts/sourcecodepro-bold.woff b/app/assets/fonts/sourcecodepro-bold.woff old mode 100644 new mode 100755 similarity index 100% rename from build/client/public/fonts/sourcecodepro-bold.woff rename to app/assets/fonts/sourcecodepro-bold.woff diff --git a/build/client/public/fonts/sourcecodepro-regular.woff b/app/assets/fonts/sourcecodepro-regular.woff old mode 100644 new mode 100755 similarity index 100% rename from build/client/public/fonts/sourcecodepro-regular.woff rename to app/assets/fonts/sourcecodepro-regular.woff diff --git a/build/client/public/fonts/sourcesanspro-bold-italic.woff b/app/assets/fonts/sourcesanspro-bold-italic.woff similarity index 100% rename from build/client/public/fonts/sourcesanspro-bold-italic.woff rename to app/assets/fonts/sourcesanspro-bold-italic.woff diff --git a/build/client/public/fonts/sourcesanspro-bold-italic.woff2 b/app/assets/fonts/sourcesanspro-bold-italic.woff2 similarity index 100% rename from build/client/public/fonts/sourcesanspro-bold-italic.woff2 rename to app/assets/fonts/sourcesanspro-bold-italic.woff2 diff --git a/build/client/public/fonts/sourcesanspro-bold.woff b/app/assets/fonts/sourcesanspro-bold.woff similarity index 100% rename from build/client/public/fonts/sourcesanspro-bold.woff rename to app/assets/fonts/sourcesanspro-bold.woff diff --git a/build/client/public/fonts/sourcesanspro-bold.woff2 b/app/assets/fonts/sourcesanspro-bold.woff2 similarity index 100% rename from build/client/public/fonts/sourcesanspro-bold.woff2 rename to app/assets/fonts/sourcesanspro-bold.woff2 diff --git a/build/client/public/fonts/sourcesanspro-italic.woff b/app/assets/fonts/sourcesanspro-italic.woff similarity index 100% rename from build/client/public/fonts/sourcesanspro-italic.woff rename to app/assets/fonts/sourcesanspro-italic.woff diff --git a/build/client/public/fonts/sourcesanspro-italic.woff2 b/app/assets/fonts/sourcesanspro-italic.woff2 similarity index 100% rename from build/client/public/fonts/sourcesanspro-italic.woff2 rename to app/assets/fonts/sourcesanspro-italic.woff2 diff --git a/build/client/public/fonts/sourcesanspro-regular.woff b/app/assets/fonts/sourcesanspro-regular.woff similarity index 100% rename from build/client/public/fonts/sourcesanspro-regular.woff rename to app/assets/fonts/sourcesanspro-regular.woff diff --git a/build/client/public/fonts/sourcesanspro-regular.woff2 b/app/assets/fonts/sourcesanspro-regular.woff2 similarity index 100% rename from build/client/public/fonts/sourcesanspro-regular.woff2 rename to app/assets/fonts/sourcesanspro-regular.woff2 diff --git a/client/app/collections/contacts.coffee b/app/collections/contacts.coffee similarity index 54% rename from client/app/collections/contacts.coffee rename to app/collections/contacts.coffee index 48e4166..620cdb8 100644 --- a/client/app/collections/contacts.coffee +++ b/app/collections/contacts.coffee @@ -5,7 +5,6 @@ Contact = require 'models/contact' module.exports = class Contacts extends Backbone.Collection model: Contact - url: 'contacts' sortDisabled: false @@ -20,6 +19,71 @@ module.exports = class Contacts extends Backbone.Collection @listenToOnce @, 'sync', -> @contactListener.watch @ + fetch: (options={}, success = -> ) -> + # This event is listened by layout + # to display applications views + @trigger 'sync', options + + @reset() if options.reset + + # FIXME: remove this fakeData + # when request will work + n = 'last name;first name;middle name;préfix;suffixe' + datapoints = [] + datapoints.push { + id: "06", + name: "email", + value: "noelie@cozycloud.cc", + type: "work" + } + datapoints.push { + id: "05", + name: "email", + value: "noelieandrieu@gmail.com", + type: "work" + } + datapoints.push { + id: "04", + name: "tel", + value: "0619384462", + type: "main" + } + datapoints.push { + id: "03", + name: "tel", + value: "0619384462", + type: "portable" + } + datapoints.push { + id: "02", + name: "tel", + value: "n0619384462", + type: "work" + } + + + result = [] + result.push { _id: '01', n, datapoints } + result.push { _id: '02', n, datapoints } + result.push { _id: '03', n, datapoints } + result.push { _id: '04', n, datapoints } + result.push { _id: '05', n, datapoints } + # + @add result + success result, @ + + # cozy.init { isV2: true } + # cozy.defineIndex 'io.cozy.contacts', ['id'] + # .then (index) => + # cozy.query index, { selector: id: {"$gte": " "} } + # .then (result=[]) => + # @add result + # success result, @ + # , (err) => + # success null, err + + + # Turns a vcard text into a list of contacts. Then it saves every contacts # in the data system. Finally it reloads the contact list. importFromVCF: (vcard) -> diff --git a/client/app/collections/duplicates.coffee b/app/collections/duplicates.coffee similarity index 100% rename from client/app/collections/duplicates.coffee rename to app/collections/duplicates.coffee diff --git a/client/app/collections/filtered.coffee b/app/collections/filtered.coffee similarity index 89% rename from client/app/collections/filtered.coffee rename to app/collections/filtered.coffee index 29fbbe4..a5a3bd9 100644 --- a/client/app/collections/filtered.coffee +++ b/app/collections/filtered.coffee @@ -1,9 +1,8 @@ ContactViewModel = require 'views/models/contact' -{indexes, search} = require 'config' +{indexes, search} = require 'const-config' tagRegExp = search.pattern 'tag' -app = null scores = new Map() @@ -29,8 +28,10 @@ module.exports = class FilteredCollection query: null - constructor: -> - app = require 'application' + + constructor: (options={}) -> + { model, channel, contacts } = options + @app = { model, channel, contacts } @models = [] @indexes = new Map Array::map.call indexes, (char) -> @@ -38,16 +39,16 @@ module.exports = class FilteredCollection vmodels.channel = Backbone.Radio.channel "idx.#{char}" [char, vmodels] - @listenTo app.model, + @listenTo @app.model, 'change:sort': @reset 'change:scored': (nil, scored) -> @comparator = if scored (a, b) -> (scores.get(b?.model) or 0) - scores.get(a.model) else 'model.attributes.sortedName' - @listenTo app.channel, 'filter:text': @setQuery + @listenTo @app.channel, 'filter:text': @setQuery - @listenTo app.contacts, + @listenTo @app.contacts, 'reset': @reset 'add': @add 'remove': @remove @@ -68,7 +69,7 @@ module.exports = class FilteredCollection @query = query if query - res = app.contacts.filter filter @query + res = @contacts.filter filter @query # Reduce to get max score and get a median limit, then excludes all # results $lt it. @@ -102,7 +103,7 @@ module.exports = class FilteredCollection get: (opts = {}) -> base = if opts.index then @indexes.get(opts.index) else @models - tag = _.last app.model.get('filter')?.match tagRegExp + tag = _.last @app.model.get('filter')?.match tagRegExp if tag and opts.tagged base.filter (vmodel) -> _.includes vmodel.get('tags'), tag @@ -113,9 +114,9 @@ module.exports = class FilteredCollection # Internal models collection handlers # ################################### reset: -> - @models = app.contacts + @models = @app.contacts .filter filter @query - .map (model) -> new ContactViewModel {}, model: model + .map (model) -> new ContactViewModel @app, { model } @resetIndexes() @@ -126,14 +127,15 @@ module.exports = class FilteredCollection models = if _.isArray models then _.clone models else [models] models.forEach (model) => - return unless filter(@query, model) - - vmodel = new ContactViewModel {}, model: model + return unless filter @query, model + vmodel = new ContactViewModel @app, { model } idx = _.sortedIndex @models, vmodel, @comparator + @models.splice idx, 0, vmodel @addToIndex vmodel + @trigger 'add', vmodel, @, {add:true, index: idx} @@ -162,9 +164,9 @@ module.exports = class FilteredCollection addToIndex: (vmodel, opts = {}) -> set = @indexes.get vmodel.getIndexKey() - return vmodel if _.includes set, vmodel + # add model to collection idx = _.sortedIndex set, vmodel, @comparator set.splice idx, 0, vmodel diff --git a/client/app/collections/tags.coffee b/app/collections/tags.coffee similarity index 70% rename from client/app/collections/tags.coffee rename to app/collections/tags.coffee index 70f96b3..a76da88 100644 --- a/client/app/collections/tags.coffee +++ b/app/collections/tags.coffee @@ -16,17 +16,22 @@ class Tags extends Backbone.Collection model: require 'models/tag' - url: 'tags' - initialize: -> @listenToOnce @, 'sync', -> (new TagsListener()).watch @ + # We convert all tags to lowercase and remove duplicates at pers time parse: (tags) -> _.uniq tags, (tag) -> tag.name.toLowerCase() + fetch: (success) -> + # TODO: add fake data + # TODO: add cozy-client-js code + console.log "(fetch) TAGS" + + # Export TagsCollection is the Contacts aware projection. All tags Collection # can be accessed at `underlying` property. module.exports = class FilteredTags extends Filtered @@ -49,12 +54,29 @@ module.exports = class FilteredTags extends Filtered # concact tags. updateRefs: -> @refs = @contacts.chain() - .map (model) -> model.get 'tags' + .map (model) -> model.get('tags') or [] .flatten() .uniq() .value() + + create: (data={}, options={}) -> + callback = options.success or null + + cozy.init { isV2: true } + cozy.create 'io.cozy.tags', data + .then (resp) => + # Add model to collection + # if data is correct + @add resp, options + + callback resp, @ if callback + + , () => + console.log '(save.error) TAG', arguments + + update: -> @updateRefs() super diff --git a/client/app/config.coffee b/app/const-config.coffee similarity index 100% rename from client/app/config.coffee rename to app/const-config.coffee diff --git a/client/app/initialize.coffee b/app/initialize.coffee similarity index 96% rename from client/app/initialize.coffee rename to app/initialize.coffee index 1461463..9b3f4af 100644 --- a/client/app/initialize.coffee +++ b/app/initialize.coffee @@ -5,7 +5,6 @@ Sets the browser environment to prepare it to launch the app, and then require the application. ### - ### Logging @@ -56,12 +55,14 @@ Starts Trigger locale initilization and starts application singleton. ### application = require './application' + + # Temporary use a global variable to store the `t` helpers, waiting for # Marionette allow to register global helpers. # see https://github.com/marionettejs/backbone.marionette/issues/2164 window.t = require 'lib/i18n' -ColorHash.addScheme 'cozy', require('config').colorSet +ColorHash.addScheme 'cozy', require('const-config').colorSet Mn.Behaviors.behaviorsLookup = require 'lib/behaviors' document.addEventListener 'DOMContentLoaded', -> diff --git a/client/app/lib/behaviors/confirm.coffee b/app/lib/behaviors/confirm.coffee similarity index 100% rename from client/app/lib/behaviors/confirm.coffee rename to app/lib/behaviors/confirm.coffee diff --git a/client/app/lib/behaviors/dialog.coffee b/app/lib/behaviors/dialog.coffee similarity index 100% rename from client/app/lib/behaviors/dialog.coffee rename to app/lib/behaviors/dialog.coffee diff --git a/client/app/lib/behaviors/dropdown.coffee b/app/lib/behaviors/dropdown.coffee similarity index 100% rename from client/app/lib/behaviors/dropdown.coffee rename to app/lib/behaviors/dropdown.coffee diff --git a/client/app/lib/behaviors/form.coffee b/app/lib/behaviors/form.coffee similarity index 100% rename from client/app/lib/behaviors/form.coffee rename to app/lib/behaviors/form.coffee diff --git a/client/app/lib/behaviors/index.coffee b/app/lib/behaviors/index.coffee similarity index 100% rename from client/app/lib/behaviors/index.coffee rename to app/lib/behaviors/index.coffee diff --git a/client/app/lib/behaviors/keyboard.coffee b/app/lib/behaviors/keyboard.coffee similarity index 100% rename from client/app/lib/behaviors/keyboard.coffee rename to app/lib/behaviors/keyboard.coffee diff --git a/client/app/lib/behaviors/navigator.coffee b/app/lib/behaviors/navigator.coffee similarity index 100% rename from client/app/lib/behaviors/navigator.coffee rename to app/lib/behaviors/navigator.coffee diff --git a/client/app/lib/behaviors/pickavatar.coffee b/app/lib/behaviors/pickavatar.coffee similarity index 100% rename from client/app/lib/behaviors/pickavatar.coffee rename to app/lib/behaviors/pickavatar.coffee diff --git a/client/app/lib/compare_contacts.coffee b/app/lib/compare_contacts.coffee similarity index 100% rename from client/app/lib/compare_contacts.coffee rename to app/lib/compare_contacts.coffee diff --git a/client/app/lib/contact_helper.coffee b/app/lib/contact_helper.coffee similarity index 100% rename from client/app/lib/contact_helper.coffee rename to app/lib/contact_helper.coffee diff --git a/client/app/lib/contacts_listener.coffee b/app/lib/contacts_listener.coffee similarity index 100% rename from client/app/lib/contacts_listener.coffee rename to app/lib/contacts_listener.coffee diff --git a/client/app/lib/i18n.coffee b/app/lib/i18n.coffee similarity index 100% rename from client/app/lib/i18n.coffee rename to app/lib/i18n.coffee diff --git a/client/app/lib/intent_manager.coffee b/app/lib/intent_manager.coffee similarity index 100% rename from client/app/lib/intent_manager.coffee rename to app/lib/intent_manager.coffee diff --git a/client/app/lib/regions/dialogs.coffee b/app/lib/regions/dialogs.coffee similarity index 100% rename from client/app/lib/regions/dialogs.coffee rename to app/lib/regions/dialogs.coffee diff --git a/client/app/lib/request.coffee b/app/lib/request.coffee similarity index 100% rename from client/app/lib/request.coffee rename to app/lib/request.coffee diff --git a/client/app/lib/slugifier.coffee b/app/lib/slugifier.coffee similarity index 100% rename from client/app/lib/slugifier.coffee rename to app/lib/slugifier.coffee diff --git a/client/app/lib/tags_listener.coffee b/app/lib/tags_listener.coffee similarity index 100% rename from client/app/lib/tags_listener.coffee rename to app/lib/tags_listener.coffee diff --git a/client/app/lib/views/confirm.coffee b/app/lib/views/confirm.coffee similarity index 100% rename from client/app/lib/views/confirm.coffee rename to app/lib/views/confirm.coffee diff --git a/client/app/lib/views/templates/base/alert.jade b/app/lib/views/templates/base/alert.jade similarity index 100% rename from client/app/lib/views/templates/base/alert.jade rename to app/lib/views/templates/base/alert.jade diff --git a/client/app/lib/views/templates/base/dialog.jade b/app/lib/views/templates/base/dialog.jade similarity index 100% rename from client/app/lib/views/templates/base/dialog.jade rename to app/lib/views/templates/base/dialog.jade diff --git a/client/app/lib/views/templates/confirm.jade b/app/lib/views/templates/confirm.jade similarity index 100% rename from client/app/lib/views/templates/confirm.jade rename to app/lib/views/templates/confirm.jade diff --git a/client/app/locales/en.json b/app/locales/en.json similarity index 100% rename from client/app/locales/en.json rename to app/locales/en.json diff --git a/app/models/config.coffee b/app/models/config.coffee new file mode 100644 index 0000000..8f1963f --- /dev/null +++ b/app/models/config.coffee @@ -0,0 +1,4 @@ +module.exports = class Config extends Backbone.Model + + fetch: (success) -> + console.log "(fetch) CONFIG" diff --git a/client/app/models/contact.coffee b/app/models/contact.coffee similarity index 84% rename from client/app/models/contact.coffee rename to app/models/contact.coffee index 368897b..01c57e2 100644 --- a/client/app/models/contact.coffee +++ b/app/models/contact.coffee @@ -1,7 +1,5 @@ -app = undefined - - class Datapoint extends Backbone.Model + defaults: name: 'other' type: 'other' @@ -11,6 +9,7 @@ class Datapoint extends Backbone.Model # represents an e-mail address from that of a cloud. mediatype: '' + parse: (attrs) -> if attrs.name is 'adr' and _.isArray attrs.value attrs.value = VCardParser.adrArrayToString attrs.value @@ -19,15 +18,28 @@ class Datapoint extends Backbone.Model module.exports = class Contact extends Backbone.Model - urlRoot: 'contacts' - defaults: n: ';;;;' + constructor: (model, options={}) -> + options.parse = true + super model, options + + + initialize: -> + @AppViewModel = require('application').model + @listenTo @AppViewModel, 'change:sort': -> + @set 'sortedName': @_buildSortedName() + + parse: (attrs) -> + datapoints = attrs.datapoints or [] + + # Remove empty values delete attrs[key] for key, value of attrs when value is '' + # Get attrs from n property if attrs.n [gn, fn, ...] = attrs.n.split ';' attrs.initials = _.chain [fn, gn] @@ -47,20 +59,18 @@ module.exports = class Contact extends Backbone.Model # following code. if (url = attrs.url) delete attrs.url - attrs.datapoints.unshift + datapoints.unshift name: 'url' type: 'main' value: url # Ensure Datapoints consistency - datapoints = @attributes.datapoints or - new Backbone.Collection attrs.datapoints or [], - model: Datapoint - parse: true - datapoints.comparator = 'name' - attrs.datapoints = datapoints + attrs.datapoints = new Backbone.Collection datapoints, + model: Datapoint + parse: true + attrs.datapoints.comparator = 'name' - attrs.tags = _.invoke attrs.tags, 'toLowerCase' + attrs.tags = _.invoke (attrs.tags or []), 'toLowerCase' return attrs @@ -89,12 +99,15 @@ module.exports = class Contact extends Backbone.Model # Handle specific attributes. attrs.fn = VCardParser.nToFN attrs.n.split ';' - datapoints = (attrs.datapoints?.toJSON() or []) - attrs.datapoints = datapoints.map (point) -> + datapoints = (attrs.datapoints or []).map (point) -> if point.name is 'adr' point.value = VCardParser.adrStringToArray point.value return point + attrs.datapoints = new Backbone.Collection datapoints, + model: Datapoint + parse: true + # (legacy, see comments in "parse" function) The condition to decide if # an e-mail address can be the main url is: it must be an url and it's # mediatype is empty. Indeed if an url has a mediatype it means that @@ -110,19 +123,31 @@ module.exports = class Contact extends Backbone.Model # The changes are: # name: 'share' -> name: 'url' + mediatype: 'cloud:cozy' clouds = _.where attrs.datapoints, {name: 'share'} - if not _.isEmpty(clouds) - for cloud in clouds - cloud.name = 'url' - cloud.mediatype = 'cloud:cozy' + for cloud in clouds + cloud.name = 'url' + cloud.mediatype = 'cloud:cozy' options.attrs = attrs false + # FIXME: isnt saved by ther server + # because it is handled threow websocket + # thats can't works without server + # waits for cozy-client-js can handle this case + save: (options={}) -> + cozy.init { isV2: true } + cozy.create 'io.cozy.contacts', @toJSON() + .then (resp) => + @attributes = resp + , () => + console.log 'ERROR', arguments + + _buildSortedName: (n) -> n ?= @get 'n' - sortKey = app.model.get 'sort' + sortKey = @AppViewModel?.get 'sort' [gn, fn, mn, ...] = n.split ';' _.chain if sortKey is 'fn' then [fn, mn, gn] else [gn, fn, mn] @@ -131,16 +156,6 @@ module.exports = class Contact extends Backbone.Model .value() - constructor: -> - app = require 'application' - super - - - initialize: -> - @listenTo app.model, 'change:sort': -> - @set 'sortedName': @_buildSortedName() - - toString: (opts = {}) -> [gn, fn, mn, pf, sf] = @attributes.n.split ';' # wrap given name (at index 0) in pre/post tags if provided @@ -151,7 +166,7 @@ module.exports = class Contact extends Backbone.Model # We override toJSON to ensure the exported object is the a true object. # Allow a options.toVCF boolean to sanitize the output before. toJSON: (options) -> - _.extend super, datapoints: @attributes.datapoints.toJSON() + _.extend super, datapoints: @attributes.datapoints?.toJSON() toHighlightedString: (pattern, opts= {})-> @@ -239,6 +254,7 @@ module.exports = class Contact extends Backbone.Model toVCF: (callback) -> + console.log "TO_VCF" data = @toJSON() # Because viewModel call uses the saveAs method, that broke console diff --git a/client/app/models/tag.coffee b/app/models/tag.coffee similarity index 87% rename from client/app/models/tag.coffee rename to app/models/tag.coffee index 52e17a0..f7b2fdd 100644 --- a/client/app/models/tag.coffee +++ b/app/models/tag.coffee @@ -1,6 +1,5 @@ module.exports = class Tag extends Backbone.Model - urlRoot: 'tags' parse: (attrs) -> attrs.name = attrs.name.toLowerCase() diff --git a/client/app/routes/contacts.coffee b/app/routes/contacts.coffee similarity index 100% rename from client/app/routes/contacts.coffee rename to app/routes/contacts.coffee diff --git a/client/app/routes/index.coffee b/app/routes/index.coffee similarity index 100% rename from client/app/routes/index.coffee rename to app/routes/index.coffee index 4cbe917..ca6b6e7 100644 --- a/client/app/routes/index.coffee +++ b/app/routes/index.coffee @@ -46,6 +46,6 @@ module.exports = class Router extends Backbone.Router settings: -> app.model.set 'dialog', 'settings' + legacyContactRedirect: (slug) -> @navigate "contacts/#{slug}", trigger: true - diff --git a/client/app/routes/tags.coffee b/app/routes/tags.coffee similarity index 100% rename from client/app/routes/tags.coffee rename to app/routes/tags.coffee diff --git a/client/app/styles/app/_background.styl b/app/styles/app/_background.styl similarity index 100% rename from client/app/styles/app/_background.styl rename to app/styles/app/_background.styl diff --git a/client/app/styles/app/_foreground.styl b/app/styles/app/_foreground.styl similarity index 100% rename from client/app/styles/app/_foreground.styl rename to app/styles/app/_foreground.styl diff --git a/client/app/styles/app/_layout.styl b/app/styles/app/_layout.styl similarity index 100% rename from client/app/styles/app/_layout.styl rename to app/styles/app/_layout.styl diff --git a/client/app/styles/app/_list.styl b/app/styles/app/_list.styl similarity index 100% rename from client/app/styles/app/_list.styl rename to app/styles/app/_list.styl diff --git a/client/app/styles/base/_button.styl b/app/styles/base/_button.styl similarity index 100% rename from client/app/styles/base/_button.styl rename to app/styles/base/_button.styl diff --git a/client/app/styles/base/_foreground.styl b/app/styles/base/_foreground.styl similarity index 100% rename from client/app/styles/base/_foreground.styl rename to app/styles/base/_foreground.styl diff --git a/client/app/styles/base/_form.styl b/app/styles/base/_form.styl similarity index 100% rename from client/app/styles/base/_form.styl rename to app/styles/base/_form.styl diff --git a/client/app/styles/base/_layout.styl b/app/styles/base/_layout.styl similarity index 100% rename from client/app/styles/base/_layout.styl rename to app/styles/base/_layout.styl diff --git a/client/app/styles/components/_card.styl b/app/styles/components/_card.styl similarity index 100% rename from client/app/styles/components/_card.styl rename to app/styles/components/_card.styl diff --git a/client/app/styles/components/_contacts.styl b/app/styles/components/_contacts.styl similarity index 100% rename from client/app/styles/components/_contacts.styl rename to app/styles/components/_contacts.styl diff --git a/client/app/styles/components/_drawer.styl b/app/styles/components/_drawer.styl similarity index 100% rename from client/app/styles/components/_drawer.styl rename to app/styles/components/_drawer.styl diff --git a/client/app/styles/components/_duplicates.styl b/app/styles/components/_duplicates.styl similarity index 100% rename from client/app/styles/components/_duplicates.styl rename to app/styles/components/_duplicates.styl diff --git a/client/app/styles/components/_merge.styl b/app/styles/components/_merge.styl similarity index 100% rename from client/app/styles/components/_merge.styl rename to app/styles/components/_merge.styl diff --git a/client/app/styles/components/_settings.styl b/app/styles/components/_settings.styl similarity index 100% rename from client/app/styles/components/_settings.styl rename to app/styles/components/_settings.styl diff --git a/client/app/styles/components/_toolbar.styl b/app/styles/components/_toolbar.styl similarity index 100% rename from client/app/styles/components/_toolbar.styl rename to app/styles/components/_toolbar.styl diff --git a/client/app/styles/main.styl b/app/styles/main.styl similarity index 100% rename from client/app/styles/main.styl rename to app/styles/main.styl diff --git a/client/app/views/app_layout.coffee b/app/views/app_layout.coffee similarity index 98% rename from client/app/views/app_layout.coffee rename to app/views/app_layout.coffee index 5304983..dfc7ffd 100644 --- a/client/app/views/app_layout.coffee +++ b/app/views/app_layout.coffee @@ -62,6 +62,7 @@ module.exports = class AppLayout extends Mn.LayoutView 'select:end': 'hideContextualMenu' 'change:scored': 'onSearchResults' + childEvents: 'drawer:toggle': 'toggleDrawer' 'contacts:select': (contactsView, id) -> @model.select id @@ -221,9 +222,9 @@ module.exports = class AppLayout extends Mn.LayoutView error: (err) -> - {ERR} = require 'config' + {ERR} = require 'const-config' if err is ERR.SEARCH_TOO_SHORT @results.$el.attr 'aria-hidden', true @ui.counter - .text t 'error search too short' - .addClass 'important' + .text t 'error search too short' + .addClass 'important' diff --git a/client/app/views/contacts/card.coffee b/app/views/contacts/card.coffee similarity index 98% rename from client/app/views/contacts/card.coffee rename to app/views/contacts/card.coffee index 864398a..198c35c 100644 --- a/client/app/views/contacts/card.coffee +++ b/app/views/contacts/card.coffee @@ -4,7 +4,7 @@ TagsActionsView = require 'views/contacts/components/edit_tags' t = require 'lib/i18n' -CONFIG = require('config').contact +CONFIG = require('const-config').contact app = undefined diff --git a/client/app/views/contacts/components/avatar.coffee b/app/views/contacts/components/avatar.coffee similarity index 100% rename from client/app/views/contacts/components/avatar.coffee rename to app/views/contacts/components/avatar.coffee diff --git a/client/app/views/contacts/components/data.coffee b/app/views/contacts/components/data.coffee similarity index 97% rename from client/app/views/contacts/components/data.coffee rename to app/views/contacts/components/data.coffee index 05698cd..56428f4 100644 --- a/client/app/views/contacts/components/data.coffee +++ b/app/views/contacts/components/data.coffee @@ -2,7 +2,7 @@ DatapointsView = require 'views/contacts/components/datapoints' XtrasView = require 'views/contacts/components/xtras' EditActionsView = require 'views/contacts/components/edit_actions' -CONFIG = require('config').contact +CONFIG = require('const-config').contact module.exports = class DataView extends Mn.LayoutView diff --git a/client/app/views/contacts/components/datapoint.coffee b/app/views/contacts/components/datapoint.coffee similarity index 98% rename from client/app/views/contacts/components/datapoint.coffee rename to app/views/contacts/components/datapoint.coffee index 407e50c..3f04ee2 100644 --- a/client/app/views/contacts/components/datapoint.coffee +++ b/app/views/contacts/components/datapoint.coffee @@ -1,4 +1,4 @@ -CONFIG = require('config').contact +CONFIG = require('const-config').contact module.exports = class ContactDatapointView extends Mn.ItemView diff --git a/client/app/views/contacts/components/datapoints.coffee b/app/views/contacts/components/datapoints.coffee similarity index 97% rename from client/app/views/contacts/components/datapoints.coffee rename to app/views/contacts/components/datapoints.coffee index 51ae095..c5b4483 100644 --- a/client/app/views/contacts/components/datapoints.coffee +++ b/app/views/contacts/components/datapoints.coffee @@ -2,7 +2,7 @@ t = require 'lib/i18n' ContactDatapointView = require 'views/contacts/components/datapoint' -CONFIG = require('config').contact +CONFIG = require('const-config').contact module.exports = class ContactDatapointsView extends Mn.CompositeView diff --git a/client/app/views/contacts/components/edit_actions.coffee b/app/views/contacts/components/edit_actions.coffee similarity index 100% rename from client/app/views/contacts/components/edit_actions.coffee rename to app/views/contacts/components/edit_actions.coffee diff --git a/client/app/views/contacts/components/edit_tags.coffee b/app/views/contacts/components/edit_tags.coffee similarity index 100% rename from client/app/views/contacts/components/edit_tags.coffee rename to app/views/contacts/components/edit_tags.coffee diff --git a/client/app/views/contacts/components/tag.coffee b/app/views/contacts/components/tag.coffee similarity index 100% rename from client/app/views/contacts/components/tag.coffee rename to app/views/contacts/components/tag.coffee diff --git a/client/app/views/contacts/components/xtras.coffee b/app/views/contacts/components/xtras.coffee similarity index 87% rename from client/app/views/contacts/components/xtras.coffee rename to app/views/contacts/components/xtras.coffee index 8236d04..3d3931d 100644 --- a/client/app/views/contacts/components/xtras.coffee +++ b/app/views/contacts/components/xtras.coffee @@ -1,14 +1,14 @@ -CONFIG = require('config').contact +CONFIG = require('const-config').contact module.exports = class ContactXtrasView extends Mn.ItemView - tagName: -> - if @model.get 'edit' then 'fieldset' else 'ul' - template: require 'views/templates/contacts/components/xtras' + tagName: -> if @model.get 'edit' then 'fieldset' else 'ul' + + modelEvents: -> _.reduce CONFIG.xtras, (memo, prop) -> memo["change:#{prop}"] = (args...) -> @@ -31,4 +31,3 @@ module.exports = class ContactXtrasView extends Mn.ItemView ref = @model.get 'ref' field = _.keys(model.changed)[0] @$("##{field}-#{ref}").trigger 'focus' - diff --git a/client/app/views/contacts/index.coffee b/app/views/contacts/index.coffee similarity index 97% rename from client/app/views/contacts/index.coffee rename to app/views/contacts/index.coffee index 1f34a58..707d285 100644 --- a/client/app/views/contacts/index.coffee +++ b/app/views/contacts/index.coffee @@ -1,18 +1,21 @@ -ContactViewModel = require 'views/models/contact' ContactRowView = require 'views/contacts/row' Slugifier = require 'lib/slugifier' Indexes = Backbone.Collection -{indexes} = require 'config' +{indexes} = require 'const-config' filtered = undefined module.exports = class Contacts extends Mn.CompositeView + template: require 'views/templates/contacts' + + sort: false + # backbone dom node dynamics are called before initialize, internal sets are # so unavailable, so fallback to root method for detection tagName: -> @@ -24,11 +27,11 @@ module.exports = class Contacts extends Mn.CompositeView else 'div' + attributes: -> {model} = require 'application' role: 'rowgroup' if model.get('scored') or @model?.has('char') - template: require 'views/templates/contacts' events: -> @@ -47,13 +50,13 @@ module.exports = class Contacts extends Mn.CompositeView el.appendChild buffer - buildChildView: (child) -> + buildChildView: (model) -> if @_hasContacts ChildView = ContactRowView else ChildView = @constructor - new ChildView model: child + new ChildView { model } showCollection: -> diff --git a/client/app/views/contacts/merge.coffee b/app/views/contacts/merge.coffee similarity index 100% rename from client/app/views/contacts/merge.coffee rename to app/views/contacts/merge.coffee diff --git a/client/app/views/contacts/row.coffee b/app/views/contacts/row.coffee similarity index 84% rename from client/app/views/contacts/row.coffee rename to app/views/contacts/row.coffee index b7eb2f1..a3e88df 100644 --- a/client/app/views/contacts/row.coffee +++ b/app/views/contacts/row.coffee @@ -1,14 +1,15 @@ -PATTERN = require('config').search.pattern 'text' +PATTERN = require('const-config').search.pattern 'text' Slugifier = require '../../lib/slugifier' -app = undefined module.exports = class ContactRow extends Backbone.View supportsRenderLifecycle: false + tagName: 'li' + attributes: role: 'row' @@ -17,14 +18,14 @@ module.exports = class ContactRow extends Backbone.View pre: '' post: '' + _isAvatarLoaded: false initialize: -> - app = require 'application' - + @AppViewModel = require('application').model @listenTo @model, 'change': @render - @listenTo app.model, 'change:selected': @refreshChecked + @listenTo @AppViewModel, 'change:selected': @refreshChecked render: -> @@ -50,13 +51,14 @@ module.exports = class ContactRow extends Backbone.View serializeData: -> _.extend @model.toJSON(), - selected: @model.id in app.model.get 'selected' + selected: @model.id in @AppViewModel.get 'selected' fullname: @model.toString @_format isAvatarLoaded: @_isAvatarLoaded + bg: ColorHash.getColor @model.get('n'), 'cozy' highlight: -> - filter = app.model.get('filter')?.match PATTERN + filter = @AppViewModel.get('filter')?.match PATTERN return unless filter fullname = @model.toHighlightedString filter[1], diff --git a/client/app/views/duplicates/index.coffee b/app/views/duplicates/index.coffee similarity index 95% rename from client/app/views/duplicates/index.coffee rename to app/views/duplicates/index.coffee index d96e693..a5f9dc0 100644 --- a/client/app/views/duplicates/index.coffee +++ b/app/views/duplicates/index.coffee @@ -2,7 +2,7 @@ Duplicates = require 'collections/duplicates' t = require 'lib/i18n' -CONFIG = require('config').contact +CONFIG = require('const-config').contact module.exports = class DuplicatesView extends Mn.CompositeView diff --git a/client/app/views/duplicates/row.coffee b/app/views/duplicates/row.coffee similarity index 100% rename from client/app/views/duplicates/row.coffee rename to app/views/duplicates/row.coffee diff --git a/client/app/views/labels/edit.coffee b/app/views/labels/edit.coffee similarity index 100% rename from client/app/views/labels/edit.coffee rename to app/views/labels/edit.coffee diff --git a/client/app/views/labels/filter.coffee b/app/views/labels/filter.coffee similarity index 100% rename from client/app/views/labels/filter.coffee rename to app/views/labels/filter.coffee diff --git a/client/app/views/labels/index.coffee b/app/views/labels/index.coffee similarity index 100% rename from client/app/views/labels/index.coffee rename to app/views/labels/index.coffee diff --git a/client/app/views/models/app.coffee b/app/views/models/app.coffee similarity index 95% rename from client/app/views/models/app.coffee rename to app/views/models/app.coffee index a4df8e9..629f2bd 100644 --- a/client/app/views/models/app.coffee +++ b/app/views/models/app.coffee @@ -1,6 +1,7 @@ MergeView = require 'views/contacts/merge' MergeModel = require 'views/models/merge' request = require 'lib/request' +CONFIG = require 'const-config' app = undefined @@ -29,9 +30,10 @@ module.exports = class AppViewModel extends Backbone.ViewModel app = require 'application' @set 'selected', [] + @listenTo @, 'change:filter', (nil, value) -> @unselectAll() - @set 'scored', require('config').search.pattern('text').test value + @set 'scored', CONFIG.search.pattern('text').test value select: (id) -> @@ -82,8 +84,8 @@ module.exports = class AppViewModel extends Backbone.ViewModel @trigger 'bulk:delete:done' - # TODO: probably need to be revamped when doing it for the whole merge - # feature + # TODO: probably need to be revamped + # when doing it for the whole merge feature bulkMerge: -> candidates = app.contacts.filter (contact) => contact.id in @attributes.selected diff --git a/client/app/views/models/contact.coffee b/app/views/models/contact.coffee similarity index 71% rename from client/app/views/models/contact.coffee rename to app/views/models/contact.coffee index d277d72..88ef612 100644 --- a/client/app/views/models/contact.coffee +++ b/app/views/models/contact.coffee @@ -1,10 +1,8 @@ Filtered = BackboneProjections.Filtered -CONFIG = require('config').contact +CONFIG = require('const-config').contact CH = require('lib/contact_helper') -app = null - module.exports = class ContactViewModel extends Backbone.ViewModel @@ -12,31 +10,44 @@ module.exports = class ContactViewModel extends Backbone.ViewModel new: false edit: false + map: avatar: '_attachments' name: 'n' events: - 'before:save': 'syncDatapoints' - save: 'onSave' - reset: 'onReset' + 'before:save': 'syncDatapoints' + 'save': 'onSave' + 'reset': 'onReset' + viewEvents: 'edit:cancel': 'reset' + 'form:submit': _.ary @::save, 0 + 'delete': _.ary @::destroy, 0 + + # TODO: handle all these cases 'tags:update': 'updateTags' 'tags:add': 'addNewTag' 'form:field:add': 'onAddField' - 'form:submit': _.ary @::save, 0 + + # TODO: handle all these cases 'export': 'downloadAsVCF' - 'delete': _.ary @::destroy, 0 + proxy: ['toString', 'toHighlightedString', 'match'] - initialize: -> - app = require 'application' + config: + datapoints: CONFIG.datapoints.main + xtras: CONFIG.xtras + + + initialize: (options={}) -> + { model, contacts } = options + @app = { model, contacts } @_setRef() @@ -53,10 +64,11 @@ module.exports = class ContactViewModel extends Backbone.ViewModel data = super delete data.datapoints data.xtras = @getDatapoints('xtras').toJSON() - _.reduce CONFIG.datapoints.main, (memo, attr) => + _.reduce @config.datapoints, (memo, attr) => memo[attr] = @getDatapoints(attr).toJSON() return memo , data + data getMappedAvatar: (attachments) -> @@ -104,49 +116,51 @@ module.exports = class ContactViewModel extends Backbone.ViewModel getIndexKey: -> - sortIdx = if app.model.get('sort') is 'fn' then 0 else 1 - initial = @get('initials')[sortIdx]?.toLowerCase() or '' + sortIdx = if @app.model.get('sort') is 'fn' then 0 else 1 + initial = @get('initials')?[sortIdx]?.toLowerCase() or '' if /[a-z]/.test initial then initial else '#' onAddField: (type) -> - @set type, '' if type in CONFIG.xtras + @set type, '' if type in @config.xtras getDatapoints: (name) -> - filter = (datapoint) -> - if name in CONFIG.datapoints.main - datapoint.get('name') is name + isEdit = @attributes.edit + datapoints = @model.get 'datapoints' + datapointsConfig = @config.datapoints + + filter = (datapoint) => + datapointName = datapoint.get('name') + if name in @config.datapoints + return datapointName is name else - datapoint.get('name') not in CONFIG.datapoints.main + return datapointName not in datapointsConfig - if @attributes.edit - models = @model.get 'datapoints' - .filter filter - .map (model) -> model.clone() + if isEdit + models = datapoints.filter(filter).map((model) -> model.clone()) new Backbone.Collection models else - new Filtered @model.get('datapoints'), filter: filter + new Filtered datapoints, { filter } # Extract datapoints from the view model to store them in the data model. syncDatapoints: -> - # The getDatapoints function has been memoized, it means it keeps all # its returned values in a cache. # Here we deal directly with this cache because this function has # already been called for all fields and edited fields were already # marked. - cache = @getDatapoints.cache - datapoints = @model.get 'datapoints' + if (cache = @getDatapoints.cache) + datapoints = @model.get 'datapoints' + models = [] - # It grabs all datapoints that has been edited. - models = [] - for key, collection of cache.__data__ when /^edit/.test key - models = models.concat CH.getNonEmptyDatapoints collection + # It grabs all datapoints that has been edited. + for key, collection of cache.__data__ when /^edit/.test key + models = models.concat CH.getNonEmptyDatapoints collection # Load new datapoints in the data model. - datapoints.reset models + datapoints?.reset models # Save directly new tags to the server if the model is already created. @@ -172,7 +186,7 @@ module.exports = class ContactViewModel extends Backbone.ViewModel onSave: -> - app.contacts.add @model if @get 'new' + @app.contacts.add @model if @get 'new' onReset: -> @_setRef() diff --git a/client/app/views/models/merge.coffee b/app/views/models/merge.coffee similarity index 100% rename from client/app/views/models/merge.coffee rename to app/views/models/merge.coffee diff --git a/client/app/views/settings/index.coffee b/app/views/settings/index.coffee similarity index 98% rename from client/app/views/settings/index.coffee rename to app/views/settings/index.coffee index 9fed286..384847b 100644 --- a/client/app/views/settings/index.coffee +++ b/app/views/settings/index.coffee @@ -1,4 +1,4 @@ -{settings} = require 'config' +{settings} = require 'const-config' t = require 'lib/i18n' diff --git a/client/app/views/templates/contacts/card.jade b/app/views/templates/contacts/card.jade similarity index 100% rename from client/app/views/templates/contacts/card.jade rename to app/views/templates/contacts/card.jade diff --git a/client/app/views/templates/contacts/components/add_field_dropdown.jade b/app/views/templates/contacts/components/add_field_dropdown.jade similarity index 100% rename from client/app/views/templates/contacts/components/add_field_dropdown.jade rename to app/views/templates/contacts/components/add_field_dropdown.jade diff --git a/client/app/views/templates/contacts/components/avatar.jade b/app/views/templates/contacts/components/avatar.jade similarity index 100% rename from client/app/views/templates/contacts/components/avatar.jade rename to app/views/templates/contacts/components/avatar.jade diff --git a/client/app/views/templates/contacts/components/data.jade b/app/views/templates/contacts/components/data.jade similarity index 100% rename from client/app/views/templates/contacts/components/data.jade rename to app/views/templates/contacts/components/data.jade diff --git a/client/app/views/templates/contacts/components/datapoint.jade b/app/views/templates/contacts/components/datapoint.jade similarity index 100% rename from client/app/views/templates/contacts/components/datapoint.jade rename to app/views/templates/contacts/components/datapoint.jade diff --git a/client/app/views/templates/contacts/components/edit_tags.jade b/app/views/templates/contacts/components/edit_tags.jade similarity index 100% rename from client/app/views/templates/contacts/components/edit_tags.jade rename to app/views/templates/contacts/components/edit_tags.jade diff --git a/client/app/views/templates/contacts/components/tag.jade b/app/views/templates/contacts/components/tag.jade similarity index 100% rename from client/app/views/templates/contacts/components/tag.jade rename to app/views/templates/contacts/components/tag.jade diff --git a/client/app/views/templates/contacts/components/xtras.jade b/app/views/templates/contacts/components/xtras.jade similarity index 100% rename from client/app/views/templates/contacts/components/xtras.jade rename to app/views/templates/contacts/components/xtras.jade diff --git a/client/app/views/templates/contacts/helpers.jade b/app/views/templates/contacts/helpers.jade similarity index 100% rename from client/app/views/templates/contacts/helpers.jade rename to app/views/templates/contacts/helpers.jade diff --git a/client/app/views/templates/contacts/index.jade b/app/views/templates/contacts/index.jade similarity index 100% rename from client/app/views/templates/contacts/index.jade rename to app/views/templates/contacts/index.jade diff --git a/client/app/views/templates/contacts/merge.jade b/app/views/templates/contacts/merge.jade similarity index 100% rename from client/app/views/templates/contacts/merge.jade rename to app/views/templates/contacts/merge.jade diff --git a/client/app/views/templates/contacts/row.jade b/app/views/templates/contacts/row.jade similarity index 95% rename from client/app/views/templates/contacts/row.jade rename to app/views/templates/contacts/row.jade index 81e1781..cb88c36 100644 --- a/client/app/views/templates/contacts/row.jade +++ b/app/views/templates/contacts/row.jade @@ -27,7 +27,6 @@ a.name(role="gridcell", href="contacts/#{_id}") - var src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" img.avatar(data-src=avatar, src=src) else - - var bg = ColorHash.getColor(n, 'cozy') span.avatar.initials(style="background-color:#{bg}")= initials p!= fullname diff --git a/client/app/views/templates/duplicates/index.jade b/app/views/templates/duplicates/index.jade similarity index 100% rename from client/app/views/templates/duplicates/index.jade rename to app/views/templates/duplicates/index.jade diff --git a/client/app/views/templates/duplicates/row.jade b/app/views/templates/duplicates/row.jade similarity index 100% rename from client/app/views/templates/duplicates/row.jade rename to app/views/templates/duplicates/row.jade diff --git a/client/app/views/templates/labels/edit.jade b/app/views/templates/labels/edit.jade similarity index 100% rename from client/app/views/templates/labels/edit.jade rename to app/views/templates/labels/edit.jade diff --git a/client/app/views/templates/labels/filter.jade b/app/views/templates/labels/filter.jade similarity index 100% rename from client/app/views/templates/labels/filter.jade rename to app/views/templates/labels/filter.jade diff --git a/client/app/views/templates/labels/index.jade b/app/views/templates/labels/index.jade similarity index 100% rename from client/app/views/templates/labels/index.jade rename to app/views/templates/labels/index.jade diff --git a/client/app/views/templates/layouts/app.jade b/app/views/templates/layouts/app.jade similarity index 100% rename from client/app/views/templates/layouts/app.jade rename to app/views/templates/layouts/app.jade diff --git a/client/app/views/templates/settings/index.jade b/app/views/templates/settings/index.jade similarity index 100% rename from client/app/views/templates/settings/index.jade rename to app/views/templates/settings/index.jade diff --git a/client/app/views/templates/tools/context_actions.jade b/app/views/templates/tools/context_actions.jade similarity index 100% rename from client/app/views/templates/tools/context_actions.jade rename to app/views/templates/tools/context_actions.jade diff --git a/client/app/views/templates/tools/default_actions.jade b/app/views/templates/tools/default_actions.jade similarity index 100% rename from client/app/views/templates/tools/default_actions.jade rename to app/views/templates/tools/default_actions.jade diff --git a/client/app/views/templates/tools/search.jade b/app/views/templates/tools/search.jade similarity index 100% rename from client/app/views/templates/tools/search.jade rename to app/views/templates/tools/search.jade diff --git a/client/app/views/templates/tools/toolbar.jade b/app/views/templates/tools/toolbar.jade similarity index 100% rename from client/app/views/templates/tools/toolbar.jade rename to app/views/templates/tools/toolbar.jade diff --git a/client/app/views/tools/context_actions.coffee b/app/views/tools/context_actions.coffee similarity index 100% rename from client/app/views/tools/context_actions.coffee rename to app/views/tools/context_actions.coffee diff --git a/client/app/views/tools/default_actions.coffee b/app/views/tools/default_actions.coffee similarity index 100% rename from client/app/views/tools/default_actions.coffee rename to app/views/tools/default_actions.coffee diff --git a/client/app/views/tools/search.coffee b/app/views/tools/search.coffee similarity index 98% rename from client/app/views/tools/search.coffee rename to app/views/tools/search.coffee index 31494f1..205d4f4 100644 --- a/client/app/views/tools/search.coffee +++ b/app/views/tools/search.coffee @@ -1,4 +1,4 @@ -{ERR} = require 'config' +{ERR} = require 'const-config' app = null diff --git a/client/app/views/tools/toolbar.coffee b/app/views/tools/toolbar.coffee similarity index 100% rename from client/app/views/tools/toolbar.coffee rename to app/views/tools/toolbar.coffee diff --git a/client/bower.json b/bower.json similarity index 100% rename from client/bower.json rename to bower.json diff --git a/build/client/public/scripts/app.js b/build/client/public/scripts/app.js deleted file mode 100644 index 0b9faf0..0000000 --- a/build/client/public/scripts/app.js +++ /dev/null @@ -1,7 +0,0 @@ -!function(){"use strict";var t="undefined"==typeof window?global:window;if("function"!=typeof t.require){var e={},o={},a={},n={}.hasOwnProperty,r="components/",i=function(t,e){var o=0;e&&(0===e.indexOf(r)&&(o=r.length),e.indexOf("/",o)>0&&(e=e.substring(o,e.indexOf("/",o))));var n=a[t+"/index.js"]||a[e+"/deps/"+t+"/index.js"];return n?r+n.substring(0,n.length-".js".length):t},s=/^\.\.?(\/|$)/,l=function(t,e){for(var o,a=[],n=(s.test(e)?t+"/"+e:e).split("/"),r=0,i=n.length;i>r;r++)o=n[r],".."===o?a.pop():"."!==o&&""!==o&&a.push(o);return a.join("/")},c=function(t){return t.split("/").slice(0,-1).join("/")},d=function(e){return function(o){var a=l(c(e),o);return t.require(a,e)}},u=function(t,e){var a={id:t,exports:{}};return o[t]=a,e(a.exports,d(t),a),a.exports},p=function(t,a){var r=l(t,".");if(null==a&&(a="/"),r=i(t,a),n.call(o,r))return o[r].exports;if(n.call(e,r))return u(r,e[r]);var s=l(r,"./index");if(n.call(o,s))return o[s].exports;if(n.call(e,s))return u(s,e[s]);throw new Error('Cannot find module "'+t+'" from "'+a+'"')};p.alias=function(t,e){a[e]=t},p.register=p.define=function(t,o){if("object"==typeof t)for(var a in t)n.call(t,a)&&(e[a]=t[a]);else e[t]=o},p.list=function(){var t=[];for(var o in e)n.call(e,o)&&t.push(o);return t},p.brunch=!0,p._cache=o,t.require=p}}(),require.register("application",function(t,e,o){var a,n,r,i,s,l,c,d,u,p=function(t,e){function o(){this.constructor=t}for(var a in e)m.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},m={}.hasOwnProperty;d=e("routes"),i=e("models/config"),s=e("collections/contacts"),l=e("collections/filtered"),u=e("collections/tags"),a=e("views/app_layout"),n=e("views/models/app"),c=e("lib/intent_manager"),r=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return p(o,t),o.prototype.onBeforeStart=function(){var t;return t=new i(e("imports").config),this.model=new n(null,{model:t}),this.contacts=new s,this.filtered=new l,this.tags=new u(this.contacts),this.listenToOnce(this.contacts,{sync:function(){return this.tags.underlying.fetch({reset:!0})}}),this.layout=new a({model:this.model}),this.router=new d,this.intentManager=new c,"function"==typeof Object.freeze?Object.freeze(this):void 0},o.prototype.onStart=function(){return this.layout.render(),this.contacts.fetch({reset:!0}),Backbone.history?Backbone.history.start({pushState:!1}):void 0},o.prototype.search=function(t,o){var a,n,r,i,s;return n=this.model.get("filter"),r="`"+t+":"+o+"`",a=e("config").search.pattern(t),s=null!=n?n.match(a):void 0,o?s?(i=s[1],n=n.replace(a,r)):(null!=n?n.length:void 0)?n+=r:n=r:s&&(n=n.replace(a,"")),this.model.set("filter",n),this.channel.trigger("filter:"+t,o,i)},o}(Mn.Application),o.exports=new r}),require.register("collections/contacts",function(t,e,o){var a,n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=e("lib/contacts_listener"),a=e("models/contact"),o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,t),o.prototype.model=a,o.prototype.url="contacts",o.prototype.sortDisabled=!1,o.prototype.initialize=function(){var t;return t=e("application").model,this.comparator="sortedName",this.listenTo(t,{"change:sort":_.ary(this.sort,0)}),this.contactListener=new r,this.listenToOnce(this,"sync",function(){return this.contactListener.watch(this)})},o.prototype.importFromVCF=function(t){var e,o,n,r;return o=0,e=t.trimRight().split(/END:VCARD/gi).filter(function(t){return!_.isEmpty(t)}).map(function(t){return t+"END:VCARD"}),this.trigger("before:import:progress",e.length),n=e.length,n>10&&this.contactListener.disable(),r=function(t){return function(){var i,s,l,c;return i=e.pop(),i?(c=new VCardParser,c.read(i),l=c.contacts[0],s=new a(l,{parse:!0}),s.save(null,{success:function(){return t.trigger("import:progress",++o),r()},error:function(){return r()}})):(t.trigger("import",o),n>10?(t.fetch({reset:!0}),setTimeout(t.contactListener.enable,1e3)):void 0)}}(this),setTimeout(r,35)},o}(Backbone.Collection)}),require.register("collections/duplicates",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=e("lib/compare_contacts"),o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.model=e("views/models/merge"),o.prototype.url=null,o.prototype.initialize=function(t,e){var o,n;return(o=e.collection)?(n=a.findSimilars(o.toJSON()),n.forEach(function(t){return function(e){return e=e.map(function(t){return o.get(t.id)}),t.add({candidates:e})}}(this))):void 0},o}(Backbone.Collection)}),require.register("collections/filtered",function(t,e,o){var a,n,r,i,s,l,c,d,u,p=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};a=e("views/models/contact"),l=e("config"),s=l.indexes,d=l.search,u=d.pattern("tag"),r=null,c=new Map,Math.median=function(t){var e,o;return o=t.sort(function(t,e){return t-e}),e=t.length,o[Math.floor(t.length/2)]},i=_.curry(function(t,e){var o;if(t){if(o=e.match(t,{fullsearch:!0}),!o)return c["delete"](e),!1;c.set(e,o)}return!0}),o.exports=n=function(){function t(){r=e("application"),this.models=[],this.indexes=new Map(Array.prototype.map.call(s,function(t){var e;return e=[],e.channel=Backbone.Radio.channel("idx."+t),[t,e]})),this.listenTo(r.model,{"change:sort":this.reset,"change:scored":function(t,e){return this.comparator=e?function(t,e){return(c.get(null!=e?e.model:void 0)||0)-c.get(t.model)}:"model.attributes.sortedName"}}),this.listenTo(r.channel,{"filter:text":this.setQuery}),this.listenTo(r.contacts,{reset:this.reset,add:this.add,remove:this.remove,update:function(){return this.trigger("update",this)},"change:tags":function(t,e,o){var a,n;return n=_.find(this.models,function(e){return e.model===t}),a=this.indexes.get(n.getIndexKey()),a.channel.trigger("change:tags",n,e,o)},"change:sortedName":function(t){var e;return(e=_.find(this.models,function(e){return e.model===t}))?this.migrateIndex(e):void 0}})}return t.prototype.comparator="model.attributes.sortedName",t.prototype.query=null,t.prototype.setQuery=function(t){var e,o,a,n,s,l,d,u,p;if(this.query=t,t){if(n=r.contacts.filter(i(this.query)),o=n.reduce(function(t,e){return Math.max(t,c.get(e))},0),o>5){for(p=c.values(),e=[];s=p.next().value;)e.push(s);a=Math.median(e),n=n.filter(function(t){return c.get(t)>=a})}return d=this.models.filter(function(t){return _.includes(n,t.model)}),l=_.difference(n,d.map(function(t){return t.model})),u=_.chain(this.models).difference(d).map(function(t){return t.model}).value(),this.remove(u),this.sort(),this.add(l),this.trigger("update",this)}return this.reset()},t.prototype.get=function(t){var e,o,a;return null==t&&(t={}),e=t.index?this.indexes.get(t.index):this.models,a=_.last(null!=(o=r.model.get("filter"))?o.match(u):void 0),a&&t.tagged?e.filter(function(t){return _.includes(t.get("tags"),a)}):e},t.prototype.reset=function(){return this.models=r.contacts.filter(i(this.query)).map(function(t){return new a({},{model:t})}),this.resetIndexes(),this.trigger("reset",this)},t.prototype.add=function(t){return t=_.isArray(t)?_.clone(t):[t],t.forEach(function(t){return function(e){var o,n;if(i(t.query,e))return n=new a({},{model:e}),o=_.sortedIndex(t.models,n,t.comparator),t.models.splice(o,0,n),t.addToIndex(n),t.trigger("add",n,t,{add:!0,index:o})}}(this))},t.prototype.remove=function(t){var e;return t=_.isArray(t)?_.clone(t):[t],e=this.models.filter(function(e){var o;return o=e.model,p.call(t,o)>=0}),e.forEach(function(t){return function(e){return _.pull(t.models,e),t.removeFromIndex(e),t.trigger("remove",e,t)}}(this))},t.prototype.sort=function(){return this.models=_.sortBy(this.models,this.comparator),this.trigger("sort",this)},t.prototype.resetIndexes=function(){return this.indexes.forEach(function(t){return t.length=0}),this.models.forEach(function(t){return function(e){return t.addToIndex(e,{silent:!0})}}(this)),this.indexes.forEach(function(t){return t.channel.trigger("reset",t,{})})},t.prototype.addToIndex=function(t,e){var o,a;return null==e&&(e={}),a=this.indexes.get(t.getIndexKey()),_.includes(a,t)?t:(o=_.sortedIndex(a,t,this.comparator),a.splice(o,0,t),e.silent||(a.channel.trigger("add",t,a,{add:!0,index:o}),a.channel.trigger("update",a)),a)},t.prototype.removeFromIndex=function(t,e){var o;return null==e&&(e={}),e.all?this.indexes.forEach(function(o){var a;return a=o.length,o=_.pull(o,t),a===o.length||e.silent?void 0:o.channel.trigger("remove",t,o)}):(o=this.indexes.get(t.getIndexKey()),_.pull(o,t),e.silent?void 0:(o.channel.trigger("remove",t,o),o.channel.trigger("update",o)))},t.prototype.migrateIndex=function(t){var e;return e=this.indexes.get(t.getIndexKey()),_.includes(e,t)?void 0:(this.removeFromIndex(t,{all:!0}),this.addToIndex(t))},t}(),_.extend(n.prototype,Backbone.Events)}),require.register("collections/tags",function(t,e,o){var a,n,r,i,s=function(t,e){function o(){this.constructor=t}for(var a in e)l.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},l={}.hasOwnProperty,c=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};a=BackboneProjections.Filtered,i=e("lib/tags_listener"),r=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.model=e("models/tag"),o.prototype.url="tags",o.prototype.initialize=function(){return this.listenToOnce(this,"sync",function(){return(new i).watch(this)})},o.prototype.parse=function(t){return _.uniq(t,function(t){return t.name.toLowerCase()})},o}(Backbone.Collection),o.exports=n=function(t){function e(t,o){var a;this.contacts=t,null==o&&(o={}),this.updateRefs(),a=new r,o.filter=function(t){return function(e){var o;return o=e.get("name"),c.call(t.refs,o)>=0}}(this),e.__super__.constructor.call(this,a,o),this.listenTo(this.contacts,"add remove reset change:tags",this.update)}return s(e,t),e.prototype.updateRefs=function(){return this.refs=this.contacts.chain().map(function(t){return t.get("tags")}).flatten().uniq().value()},e.prototype.update=function(){return this.updateRefs(),e.__super__.update.apply(this,arguments)},e}(a)}),require.register("config",function(t,e,o){o.exports={ERR:{SEARCH_TOO_SHORT:Symbol("ERR_SEARCH_TOO_SHORT")},contact:{xtras:["bday"],datapoints:{main:["tel","email","adr"],types:{"default":["main","work","home"],social:["twitter:social","skype:chat"],url:["website","blog"],share:["cozy"]}}},settings:{sortkeys:["gn","fn"]},indexes:"abcdefghijklmnopqrstuvwxyz#",colorSet:["304FFE","2979FF","00B0FF","00DCE9","00D5B8","00C853","E70505","FF5700","FF7900","FFA300","B3C51D","64DD17","FF2828","F819AA","AA00FF","6200EA","7190AB","51658D"],search:{pattern:function(t,e){return e=t?"i":"ig",new RegExp("`"+(t||"\\w+")+":([^`]+)`",e)}}}}),require.register("initialize",function(t,e,o){var a,n,r=[].slice;n=function(){var t,o,a,n,i,s,l,c;for(o=e("imports").env,t=window.console||{},s=["log","info","warn","error"],l=function(t,e,o,a,n,r){var i;return i={type:t,href:window.location.href,url:o,line:a,col:n,error:{msg:e}},r instanceof Error&&_.extend(i.error,{name:null!=r?r.name:void 0,full:(null!=r?r.toString():void 0)||e,stack:null!=r?r.stack:void 0}),$.post("log",i,"json")},c=function(e){var a;return a=t[e],function(){var n;return n=1<=arguments.length?r.call(arguments,0):[],l(e,JSON.stringify(n)),"production"!==o?a.apply(t,n):void 0}},a=0,n=s.length;n>a;a++)i=s[a],t[i]=c(i);return window.onerror=function(){var t;return t=1<=arguments.length?r.call(arguments,0):[],l.call.apply(l,[null,"error"].concat(r.call(t))),"production"===o}},a=e("./application"),window.t=e("lib/i18n"),ColorHash.addScheme("cozy",e("config").colorSet),Mn.Behaviors.behaviorsLookup=e("lib/behaviors"),document.addEventListener("DOMContentLoaded",function(){return n(),a.start()})}),require.register("lib/behaviors/confirm",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;n=e("lib/views/confirm"),o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.ui={confirms:"[data-confirm]"},o.prototype.events={"click @ui.confirms":"confirm"},o.prototype.initialize=function(t){return this.events=_.extend({},this.events,this._buildTriggers())},o.prototype.confirm=function(t){var e;return t.preventDefault(),t.stopPropagation(),e=this.$(t.currentTarget).data("confirm"),this._triggerView(e)},o.prototype._buildTriggers=function(){var t;return t=this.view,_.reduce(this.options.triggers,function(t,e,o){var a,n;return a=function(){return _.defaults({},_.isFunction(e)?e():e,{preventDefault:!0,stopPropagation:!0})},_.isFunction(e)||(n=a()),t[o]=function(t){var o;return _.isFunction(e)&&(n=a()),t&&(t.preventDefault&&n.preventDefault&&t.preventDefault(),t.stopPropagation&&n.stopPropagation&&t.stopPropagation()),o=this._triggerView(n)},t},{})},o.prototype._triggerView=function(t){var o,a,r;return o=e("application"),r=_.pick(t,"title","message","btn_ok","btn_cancel","end_event"),a=new n({model:new Backbone.Model(r)}),this.view.$el.attr("aria-busy",!0),Mn.bindEntityEvents(this,a,{"confirm:close":function(){return this.view.$el.attr("aria-busy",!1),this.view.triggerMethod("confirm:false")},"confirm:true":function(){return t.event&&this.view.triggerMethod(t.event),r.end_event?(a.showLoading(),o.model.on(r.end_event,function(t){return function(){return t.view.$el.attr("aria-busy",!1),t.view.triggerMethod("confirm:true"),o.model.off(r.end_event),a.close()}}(this))):(this.view.$el.attr("aria-busy",!1),this.view.triggerMethod("confirm:true"),a.close())}}),o.layout.showChildView("alerts",a),a},o}(Mn.Behavior)}),require.register("lib/behaviors/dialog",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.behaviors={Keyboard:{keymaps:{27:"key:escape"}}},e.prototype.ui={backdrop:'[role="separator"]',content:'[role="contentinfo"]'},e.prototype.triggers={"click @ui.backdrop":"click:backdrop"},e.prototype.events={"click @ui.content":"detectClickOutside"},e.prototype.initialize=function(){return this.listenTo(this.view,"click:backdrop",this.close),this.listenTo(this.view,"key:escape",this.close)},e.prototype.close=function(){return this.view.triggerMethod("dialog:close")},e.prototype.detectClickOutside=function(t){var e,o,a;if(t.pageX||t.pageY)return e=this.ui.content[0].getBoundingClientRect(),a=t.pageXe.right,o=t.pageYe.bottom,o&&a?this.close():void 0},e}(Mn.Behavior)}),require.register("lib/behaviors/dropdown",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.ui={trigger:'[aria-haspopup="true"] > :first-child'},e.prototype.events={"click @ui.trigger":"toggleExpand",click:"closeAll"},e.prototype.toggleExpand=function(t){var e;return t.stopPropagation(),e=this.$(t.currentTarget).parent("[aria-haspopup]"),this.closeAll(e),e.attr("aria-expanded","true"!==e.attr("aria-expanded"))},e.prototype.closeAll=function(t){return this.$('[aria-haspopup="true"]').not(t).attr("aria-expanded",!1)},e}(Mn.Behavior)}),require.register("lib/behaviors/form",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.behaviors={Keyboard:{keymaps:{13:{event:"form:key:enter",preventDefault:!1}}}},e.prototype.events=function(){return{"click @ui.formAdd":"addField","keyup @ui.formAutoAdd":"addField","keyup @ui.formInputs":_.debounce(this.updateFields,250),"change @ui.formInputs":"updateFields","click @ui.formClear":"clearField","click @ui.formDelete":"deleteField"}},e.prototype.triggers={"click @ui.formSubmit":"form:submit"},e.prototype.updateFields=function(t,e){var o,a;return null==e&&(e=t.currentTarget),(o={}).setValueOf(e.name,e.value),null!=(a=this.view.model)&&a.set(o,{silent:!0}),e.classList.toggle("empty",""===e.value),this.view.triggerMethod("form:field:update",e,t)},e.prototype.addField=function(t){var e,o,a;return"click"===t.type?this.view.triggerMethod("form:field:add",t.currentTarget.value):(e=this.$(t.currentTarget).parents("[data-type]"),a=e.data("type"),(o=!!e.find(".value").filter(function(){return!this.value}).length)?void 0:this.view.triggerMethod("form:field:add",a))},e.prototype.clearField=function(t){var e;return e=this.$(t.currentTarget).prev(".value"),e.val(null),this.view.triggerMethod("form:field:clear",t),this.updateFields(t,e[0])},e.prototype.deleteField=function(t){var e;return e=this.$(t.currentTarget).parents("[data-cid]").data("cid"),this.view.triggerMethod("form:field:delete",e,t)},e}(Mn.Behavior)}),require.register("lib/behaviors/index",function(t,e,o){var a;a={Confirm:e("./confirm"),Dialog:e("./dialog"),Dropdown:e("./dropdown"),Form:e("./form"),Keyboard:e("./keyboard"),Navigator:e("./navigator"),PickAvatar:e("./pickavatar")},o.exports=a}),require.register("lib/behaviors/keyboard",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty,i=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.defaults={eventName:"keydown"},e.prototype.events=function(){var t,e;if(this.options.keymaps)return e=_.reduce(this.options.keymaps,this._buildKeyboardTrigger,{}),(t={})[this.options.eventName]=function(t){return function(o){var a;return a=o.which.toString(),i.call(_.keys(e),a)<0?void 0:e[a].call(t,o)}}(this),t},e.prototype._buildKeyboardTrigger=function(t,e,o){var a,n,r;return n=_.isObject(e),r=_.defaults({},n?e:{},{preventDefault:!0,stopPropagation:!0}),a=n?r.event:e,t[o]=function(t){return t&&(t.preventDefault&&r.preventDefault&&t.preventDefault(),t.stopPropagation&&r.stopPropagation&&t.stopPropagation()),this.view.triggerMethod(a,t)},t},e}(Mn.Behavior)}),require.register("lib/behaviors/navigator",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.behaviors={Confirm:{}},o.prototype.events={"click @ui.navigate":"navigate"},o.prototype.navigate=function(t){var o;return t.preventDefault(),o=function(){var o,a;return a=t.currentTarget,o=a.dataset.next||a.getAttribute("href"),e("application").router.navigate(o,{trigger:!0})},t.currentTarget.dataset.confirm?Mn.bindEntityEvents(this,this.view,{"confirm:true":o,"confirm:close":function(){return Mn.unbindEntityEvents(this,this.view)}}):o()},o}(Mn.Behavior)}),require.register("lib/behaviors/pickavatar",function(t,e,o){var a,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;o.exports=a=function(t){function o(){return this.choosePhoto_answer=n(this.choosePhoto_answer,this),this.choosePhoto=n(this.choosePhoto,this),o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.events=function(){return{"click @ui.avatar":"choosePhoto"}},o.prototype.choosePhoto=function(){var t,o,a;return t=e("application"),o={type:"pickObject",params:{objectType:"singlePhoto",isCropped:!0,proportion:1,maxWidth:10,minWidth:10}},a=108e5,t.intentManager.send("nameSpace",o,a).then(this.choosePhoto_answer,function(t){return console.error("contact : response in error : ",t)})},o.prototype.choosePhoto_answer=function(t){var e,o;return e=t.data,e.newPhotoChosen&&null!=(o=this.view.model)?o.set("avatar",e.dataUrl):void 0},o}(Mn.Behavior)}),require.register("lib/compare_contacts",function(t,e,o){var a,n,r,i,s;n=e("lib/contact_helper"),o.exports=a={},a.isSamePerson=function(t,e){return t.fn===e.fn&&t.datapoints.some(function(t){var o;return"tel"===(o=t.name)||"adr"===o||"email"===o||"chat"===o?s(t,e):!1})},a.mayBeSamePerson=function(t,e){return compareN(t.n,e.n)>0},a.findSimilars=function(t){var e,o,a,n,r,i,s,l,c;for(c=[],s={},n=0,i=t.length;i>n;n++)e=t[n],l=e.n.split(";"),r=l[0],a=l[1],o=l[2],o=l[3],o=l[4],r=r.toAscii().toLowerCase(),a=a.toAscii().toLowerCase(),null!=s[a+" "+r]?s[a+" "+r].push(e):null!=s[r+" "+a]?s[r+" "+a].push(e):(a+" "+r).length>1&&(s[a+" "+r]=[],s[a+" "+r].push(e));return c=Object.keys(s).filter(function(t){return s[t].length>1}).map(function(t){return s[t]})},a.mergeContacts=function(t,e){return e.datapoints.forEach(function(e){return s(e,t,!0)?void 0:t.datapoints.push(e)}),delete e.datapoints,null!=e.accounts&&(e.accounts.forEach(function(e){return n.hasAccount(t,e.type,e.name)?void 0:n.setAccount(t,e)}),delete e.accounts),t.tags=i(t.tags,e.tags),delete e.tags,null!=e.note&&""!==e.note&&null!=t.note&&""!==t.note&&(t.note+="\n"+e.note),delete e.note,t=r(t,e)},s=function(t,e,o){return null==o&&(o=!1),null==t.value?!1:e.datapoints.some(function(e){var a,n,r;if(t.name===e.name&&(!o||o&&t.type===e.type)&&null!=e.value){if("tel"===t.name)return t.value.replace(/[-\s]/g,"")===e.value.replace(/[-\s]/g,"");if("adr"===t.name){for(r=!0,a=0;r&&7>a;)r=r&&t.value[a]===e.value[a]||""===t.value[a]&&null==e.value[a]||!(null!=(n=t.value)?n[a]:void 0)&&""===e.value[a],a++;return r}return t.value===e.value}return!1})},i=function(t,e){return t=t||[],e=e||[],t.concat(e.filter(function(e){return t.indexOf(e)<0}))},r=function(t,e){var o,a;for(o in e)a=e[o],null!=a&&(t[o]=a);return t}}),require.register("lib/contact_helper",function(t,e,o){var a,n,r=[].slice;o.exports=a={},a.nToFN=function(t){var e,o,a,n,r,i;return t=t||[],e=t[0],o=t[1],a=t[2],r=t[3],i=t[4],n=[r,o,a,e,i],n=n.filter(function(t){return null!=t&&""!==t}),n.join(" ")},a.fnToN=function(t){return t=t||"",["",t,"","",""]},a.fnToNLastnameNFirstname=function(t){var e,o,a,n,i,s;return t=t||"",s=t.split(" "),o=s[0],n=3<=s.length?r.call(s,1,a=s.length-1):(a=1,[]),e=s[a++],i=[e,o,n.join(" "),"",""]},n=function(t){return t=t.filter(function(t){return null!=t&&""!==t}),t.join(", ")},a.adrArrayToString=function(t){var e,o,a;return t=t||[],a=n(t.slice(0,3)),e=n(t.slice(3,7)),o=a,""!==e&&(o+="\n"+e),o},a.adrCompleteStreet=function(t){return t=t||[],n(t.slice(0,3))},a.adrStringToArray=function(t){return t=t||"",["","",t,"","","",""]},a.imgUrl2DataUrl=function(t,e){var o;return o=new Image,o.onload=function(){var t,a,n,r,i,s;return t=600,s=o.width>o.height?"height":"width",i=t/o[s],a=document.createElement("canvas"),a.height=a.width=t,n=a.getContext("2d"),n.drawImage(o,0,0,i*o.width,i*o.height),r=a.toDataURL("image/jpeg"),e(null,r)},o.src=t},a.getAccount=function(t,e,o){var a;return null==t.accounts?null:(a=t.accounts.filter(function(t){return t.type===e&&t.name===o}),a.length>0?a[0]:null)},a.setAccount=function(t,e){var o,n,r,i;if(o=a.getAccount(t,e.type,e.name),null!=o){r=[];for(n in e)i=e[n],r.push(o[n]=i);return r}return t.accounts=t.accounts||[],t.accounts.push(e)},a.deleteAccount=function(t,e){var o,a,n,r,i;for(i=t.accounts,a=n=0,r=i.length;r>n;a=++n)if(o=i[a],o.type===e.type&&o.name===e.name)return contacts.accounts.splice(a,1),!0;return!1},a.hasAccount=function(t,e,o){return null!=a.getAccount(t,e,o)},a.intrinsicRev=function(t){var e,o,n,r,i,s;for(n=["fn","n","org","title","bday","nickname","url","note"],e="",r=0,i=n.length;i>r;r++)o=n[r],o in t&&null!=t[o]&&""!==t[o]&&(e+=o,e+=": ",e+=t[o],e+=", ");return s=t.datapoints.map(function(t){var e,o;return o="name:"+t.name+", type:"+t.type+", value: ",o+="adr"===t.name?a.adrArrayToString(t.value):"tel"===t.name?null!=(e=t.value)?e.replace(/[^\d+]/g,""):void 0:t.value}),s.sort(),e+="datapoints: "+s.join(", ")},a.getNonEmptyDatapoints=function(t){return t.filter(function(t){return!_.isEmpty(t.get("value"))})}}),require.register("lib/contacts_listener",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=e("models/contact"),o.exports=n=function(t){function e(){e.__super__.constructor.apply(this,arguments),this._bulk=_.debounce(this._bulk,1e3),this.enabled=!0}return r(e,t),e.prototype.models={contact:a},e.prototype.queues={create:[],update:[],"delete":[]},e.prototype.events=["contact.create","contact.update","contact.delete"],e.prototype._bulk=function(t){var e,o,a;switch(t){case"delete":e="remove",a={};break;default:e="add",a={merge:!0,trigger:!1}}return a.sort=!1,this.enabled?(console.log("Remote action occured ("+t+", "+e+"), processing start!"),o=this.queues[t].length,async.whilst(function(e){return function(){return e.queues[t].length>0}}(this),function(o){return function(n){var r;return r=o.queues[t].splice(0,50),o.collection[e](r,a),setTimeout(n,100)}}(this),function(){return console.log("Remote action processing done for "+o+" for operation\n("+t+", "+e+").")})):this.queues[t]=[]},e.prototype.enable=function(){return this.enabled=!0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.onRemoteCreate=function(t){return this.queues.create.push(t),this._bulk("create")},e.prototype.onRemoteUpdate=function(t){return this.queues.update.push(t),this._bulk("update")},e.prototype.onRemoteDelete=function(t){return this.queues["delete"].push(t),this._bulk("delete")},e}(CozySocketListener)}),require.register("lib/i18n",function(t,e,o){var a;a=function(){var t,o,a,n,r;a=document.documentElement.getAttribute("lang");try{n=e("locales/"+a)}catch(o){t=o,n=e("locales/en")}return r=new Polyglot({phrases:n,locale:a}),r.t.bind(r)},o.exports=a()}),require.register("lib/intent_manager",function(t,e,o){var a,n;n=3e3,o.exports=a=function(){function t(){this.talker=new Talker(window.parent,"*")}return t.prototype.send=function(t,e,o){return this.talker.timeout=o?o:n,this.talker.send("nameSpace",e)},t}()}),require.register("lib/regions/dialogs",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.toggleDialogs=function(t){return null==t&&(t="true"!==this.$el.attr("aria-hidden")),this.$el.attr("aria-hidden",!t)},e.prototype.onShow=function(){return this.toggleDialogs(!0)},e.prototype.onBeforeEmpty=function(){return this.toggleDialogs(!1)},e}(Mn.Region)}),require.register("lib/request",function(t,e,o){var a;o.exports=a={send:function(t,e,o,a){return $.ajax({type:t,url:e,data:null!=o?JSON.stringify(o):null,contentType:"application/json",dataType:"json",success:function(t){return null!=a?a(null,t):void 0},error:function(t){return null!=t&&null!=t.msg&&null!=a?a(new Error(t.msg)):null!=a?a(new Error("Server error occured")):void 0}})},get:function(t,e){return a.send("GET",t,null,e)},post:function(t,e,o){return a.send("POST",t,e,o)},put:function(t,e,o){return a.send("PUT",t,e,o)},del:function(e,o){return t.request("DELETE",e,null,o)}}}),require.register("lib/tags_listener",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=e("models/tag"),o.exports=n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return r(e,t),e.prototype.models={tag:a},e.prototype.events=["tag.create","tag.update","tag.delete"],e.prototype.onRemoteCreate=function(t){return this.collection.add(t,{merge:!0})},e.prototype.onRemoteUpdate=function(t){return this.collection.add(t,{merge:!0})},e.prototype.onRemoteDelete=function(t){return this.collection.remove(t)},e}(CozySocketListener)}),require.register("lib/views/confirm",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.template=e("./templates/confirm"),o.prototype.tagName="section",o.prototype.attributes={role:"alertdialog","aria-busy":!1},o.prototype.ui={btn_ok:"button.ok",btn_cancel:"button.cancel"},o.prototype.triggers={"click @ui.btn_ok":"confirm:true","click @ui.btn_cancel":"confirm:false"},o.prototype.onDomRefresh=function(){return setTimeout(function(t){return function(){return t.$el.attr("aria-busy",!0)}}(this),50)},o.prototype.close=function(){var t;return t=e("application").layout,t.alerts.empty()},o.prototype.onConfirmFalse=o.prototype.close,o.prototype.showLoading=function(){return this.ui.btn_ok.attr("aria-busy",!0)},o.prototype.hideLoading=function(){return this.ui.btn_ok.attr("aria-busy",!1)},o}(Mn.ItemView)}),require.register("lib/views/templates/base/alert",function(t,e,o){var a=function(t){var e=[];return e.push('
'),e.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("lib/views/templates/base/dialog",function(t,e,o){var a=function(t){var e=[];return e.push('
'),e.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("lib/views/templates/confirm",function(t,e,o){var a=function(t){var e,o=[],a=t||{};return function(t,a,n,r){o.push('

'+jade.escape(null==(e=r)?"":e)+"

"+jade.escape(null==(e=n)?"":e)+'

")}.call(this,"btn_cancel"in a?a.btn_cancel:"undefined"!=typeof btn_cancel?btn_cancel:void 0,"btn_ok"in a?a.btn_ok:"undefined"!=typeof btn_ok?btn_ok:void 0,"message"in a?a.message:"undefined"!=typeof message?message:void 0,"title"in a?a.title:"undefined"!=typeof title?title:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("locales/ar",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts", -"tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/de",function(t,e,o){o.exports={"list counter":"%{smart_count} Kontakt |||| %{smart_count} Kontakte","list counter no-search":"Kein passender Kontakt gefunden","list counter empty":"Derzeit keine Kontakte","tools subactions settings":"Einstellungen","tools actions add contact":"Neuer Kontakt","tools actions find duplicates":"Duplikate suchen","tools search placeholder":"Kontakte suchen","tools labels filters":"Labels","tools labels filters all":"Alle Kontakte","tools contextual selected":"%{smart_count} Kontakt ausgewählt |||| %{smart_count} Kontakte ausgewählt","tools contextual select all":"Alle auswählen","tools contextual select none":"Keine auswählen","tools contextual merge":"Zusammenfügen","tools contextual export":"Exportieren","tools contextual delete":"Löschen","bulk confirm delete title":"Kontakt löschen |||| Kontakte löschen","bulk confirm delete message":"Ein Kontakt wird gelöscht werden. Sind Sie sicher? |||| %{smart_count} Kontakte werden gelöscht werden. Sind Sie sicher?","bulk confirm delete ok":"Löschen","bulk confirm delete cancel":"Nicht verändern","settings title":"Einstellungen","settings in-out title":"Kontakte importieren/exportieren","settings in-out import action":"vCard importieren","settings in-out export action":"vCard exportieren","settings in-out import result":"%{smart_count} Kontakt erfolgreich importiert. |||| %{smart_count} Kontakte erfolgreich importiert.","settings display title":"Einstellungen anzeigen","settings display sort gn":"Sortieren nach Nachnamen","settings display sort fn":"Sortieren nach Vornamen","settings sync title":"Synchronisation","settings sync gplay":"Greifen Sie in Ihrem mobilen Gerät auf Ihr ganzes Cozy zu. Laden Sie dazu jetzt die App im Google Play Store herunter:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Mehr Informationen über die Synchronisierung per CardDav finden Sie in [unserer Dokumentation](%{link}).","card actions create":"Erstellen","card actions save":"Speichern","card actions labels":"Etiketten","card actions labels add":"Etikett hinzufügen","card actions labels create":"Etikett erstellen","card actions cancel":"Abbrechen","card actions edit":"Bearbeiten","card actions delete":"Löschen","card actions export":"Exportieren","card actions add select":"Feld hinzufügen","card actions add birthday":"Geburtstag","card actions add social":"Soziale Medien","card actions add link":"URL","card actions add other":"Weitere Informationen","card actions add share":"cozy cloud","card confirm delete title":"%{name} löschen?","card confirm delete message":" %{name} wird aus Ihren Kontakten gelöscht. Sind Sie sicher?","card confirm delete ok":"Kontakt löschen","card confirm delete cancel":"Behalten","card confirm cancel title":"Wirklich beenden?","card confirm cancel message":"Ihr Kontakt wurde nicht gespeichert.","card confirm cancel ok":"Verlassen","card confirm cancel cancel":"Im Bearbeiten-Modus bleiben","datapoints section tel":"Telefon-Nummern","datapoints section email":"Email-Adressen","datapoints section adr":"Anschriften","datapoints section xtras":"Zusätzliche Informationen","datapoint label name prefix":"Präfix","datapoint label name first":"Vorname","datapoint label name middle":"Zweiter Name","datapoint label name given":"Nachname","datapoint label name suffix":"Suffix","datapoint label org":"Firma","datapoint placeholder org":"Firmenname hinzufügen","datapoint label department":"Abteilung","datapoint placeholder department":"Abteilung hinzufügen","datapoint label title":"Titel","datapoint placeholder title":"Title hinzufügen","datapoint placeholder tel":"Telefonnummer hinzufügen","datapoint placeholder email":"Email-Adresse hinzufügen","datapoint placeholder adr":"Anschrift hinzufügen","datapoint placeholder social":"Social Media Nickname hinzufügen","datapoint placeholder im":"Social Media Nickname hinzufügen","datapoint placeholder chat":"Social Media Nickname hinzufügen","datapoint placeholder url":"Eine URL hinzufügen","datapoint placeholder other":"Weitere Information hinzufügen","datapoint placeholder share":"cozy cloud URL hinzufügen","datapoint label bday":"Geburtstag","datapoint placeholder bday":"DD.MM.YYYY","datapoint label note":"Anmerkungen","duplicates title":"Duplikate suchen","duplicates actions mergeall":"Alle zusammenführen","duplicates empty":"Keine Duplikate gefunden","mergerow actions merge":"Zusammenführen","mergerow actions dismiss":"Verwerfen","merge title":"Kontakte zusammenführen","merge choose avatar":"Profilbild wählen:","merge choose name":"Name wählen:","merge choose nickname":"Spitzname auswählen:","merge choose organisation":"Organisation wählen:","merge choose org":"Firma","merge choose department":"Abteilung","merge choose title":"Title","merge choose birthday":"Geburtstag auswählen:","merge actions merge":"Kontakte zusammenführen","merge actions cancel":"Abbrechen","error upload wrong filetype":"Die hochgeladene Datei ist kein valides VCF/VCard Format. Bitte versuchen Sie es mit einer anderen Datei,","error search too short":"Bitte geben Sie mindestens 3 Zeichen für eine Suche ein"}}),require.register("locales/en",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools labels admin":"edit label","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/eo",function(t,e,o){o.exports={"list counter":"%{smart_count} kontakto |||| %{smart_count} kontaktoj","list counter no-search":"neniu kontakto kongruas kun viaj serĉkriterioj","list counter empty":"neniu kontakto nun","tools subactions settings":"agordoj","tools actions add contact":"aldoni kontakton","tools actions find duplicates":"trovi duoblaĵon","tools search placeholder":"serĉi kontaktojn","tools labels filters":"etikedoj","tools labels filters all":"ĉiuj kontaktoj","tools contextual selected":"%{smart_count} elektita kontakto |||| %{smart_count} elektitaj kontaktoj","tools contextual select all":"elekti ĉiujn","tools contextual select none":"elekti neniun","tools contextual merge":"kunfandi","tools contextual export":"elporti","tools contextual delete":"forigi","bulk confirm delete title":"Forigi kontakton |||| Forigi kontaktojn","bulk confirm delete message":"Vi forigos kontakton. Ĉu vi certas? |||| Vi forigos %{smart_count} kontaktojn. Ĉu vi certas?","bulk confirm delete ok":"forigi","bulk confirm delete cancel":"teni ilin sekuraj","settings title":"agordoj","settings in-out title":"enporti/elporti kontaktojn","settings in-out import action":"enporti vcard","settings in-out export action":"elporti vcard","settings in-out import result":"Vi sukcese enportis %{smart_count} kontakton. |||| Vi sukcese enportis %{smart_count} kontaktojn.","settings display title":"vidigi agordojn","settings display sort gn":"ordigi laŭ familinomo","settings display sort fn":"ordigi laŭ antaŭnomo","settings sync title":"poŝkomputila sinkronigo","settings sync gplay":"Aliru vian tutan Cozy rekte per via poŝtelefono. Elŝutu nian aplikaĵon nun ĉe la gugla merkato Play Store:","settings sync gplay get it":"Akiru ĝin ĉe Google Play","settings sync carddav":"Ĉu vi serĉas pli da informo pri la sinkronigo per CardDav? Ĵetu rigardon al [nia dokumentado](%{link}).","card actions create":"krei","card actions save":"konversi","card actions labels":"etikedoj","card actions labels add":"aldoni etikedon","card actions labels create":"krei etikedon","card actions cancel":"nuligi","card actions edit":"redakti","card actions delete":"forigi","card actions export":"elporti","card actions add select":"aldoni kampon","card actions add birthday":"naskiĝdato","card actions add social":"sociaj komunikiloj","card actions add link":"url","card actions add other":"aliaj informoj","card actions add share":"cozy-nubo","card confirm delete title":"Forigi %{name}?","card confirm delete message":"Vi forigos %{name} el inter viaj kontaktoj. Ĉu vi certas?","card confirm delete ok":"Forigi kontakton","card confirm delete cancel":"Konservi ĝin","card confirm cancel title":"Ĉu vi certas ke vi volas foriri?","card confirm cancel message":"Via kontakto ne estis konversita","card confirm cancel ok":"Foriri","card confirm cancel cancel":"Daŭrigi je redakta reĝimo","datapoints section tel":"Telefonnumeroj","datapoints section email":"Retpoŝtadresoj","datapoints section adr":"Poŝtaj adresoj","datapoints section xtras":"Aldonaj informoj","datapoint label name prefix":"prefikso","datapoint label name first":"antaŭnomo","datapoint label name middle":"meznomo","datapoint label name given":"familinomo","datapoint label name suffix":"sufikso","datapoint label org":"firmao","datapoint placeholder org":"aldoni firmaonomon","datapoint label department":"departemento","datapoint placeholder department":"aldoni departementon","datapoint label title":"titolo","datapoint placeholder title":"aldoni titolon","datapoint placeholder tel":"aldoni telefonnumeron","datapoint placeholder email":"aldoni retpoŝtadreson","datapoint placeholder adr":"aldoni adreson","datapoint placeholder social":"aldoni socikomunikilan kromnomon","datapoint placeholder im":"aldoni socikomunikilan kromnomon","datapoint placeholder chat":"aldoni socikomunikilan kromnomon","datapoint placeholder url":"aldoni urlon","datapoint placeholder other":"aldoni iun informon","datapoint placeholder share":"aldoni cozynuban urlon","datapoint label bday":"naskiĝtdato","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notoj","duplicates title":"Trovi duoblaĵon","duplicates actions mergeall":"kunfandi ĉiujn","duplicates empty":"Neniu duoblaĵo trovita","mergerow actions merge":"kunfandi","mergerow actions dismiss":"rezigni","merge title":"Kunfandi kontaktojn","merge choose avatar":"Elektu profilan bildon:","merge choose name":"Elektu nomon:","merge choose nickname":"Elektu kromnomon:","merge choose organisation":"Elektu organizaĵon:","merge choose org":"firmao","merge choose department":"departemento","merge choose title":"titolo","merge choose birthday":"Elektu naskiĝdaton:","merge actions merge":"kunfandi kontaktojn","merge actions cancel":"nuligi","error upload wrong filetype":"La alŝutita dosiero ne estas valida laŭ formo VCF/VCard. Bonvolu provi per alia dosiero.","error search too short":"Vi devas tajpi almenaŭ 3 signojn por plenumi serĉon"}}),require.register("locales/es",function(t,e,o){o.exports={"list counter":"%{smart_count} contacto |||| %{smart_count} contactos","list counter no-search":"ningún contacto corresponde a sus criterios","list counter empty":"ningún contacto en este momento","tools subactions settings":"parámetros","tools actions add contact":"añadir contacto","tools actions find duplicates":"encontrar duplicados","tools search placeholder":"busqueda de contactos","tools labels filters":"etiquetas","tools labels filters all":"todos los contactos","tools contextual selected":"%{smart_count} contacto seleccionado |||| %{smart_count} contactos seleccionados","tools contextual select all":"seleccionar todos","tools contextual select none":"no seleccionar ninguno","tools contextual merge":"fusionar","tools contextual export":"exportar","tools contextual delete":"suprimir","bulk confirm delete title":" Suprimir el contacto |||| Suprimir los contactos","bulk confirm delete message":"Usted va a suprimir un contacto. ¿Está seguro? |||| Usted va a suprimir %{smart_count} contactos. ¿Está seguro?","bulk confirm delete ok":"Suprimir","bulk confirm delete cancel":"mantenerlos en lugar seguro","settings title":"parámetros","settings in-out title":"importar/exportar contactos","settings in-out import action":"importar vcard","settings in-out export action":"exportar vcard","settings in-out import result":"contactos.Usted acaba de importar exitosamente %{smart_count} contacto. |||| Usted acaba de importar exitosamente %{smart_count} ","settings display title":"visualizar parámetros","settings display sort gn":"ordenar por apellido","settings display sort fn":"ordenar por nombre","settings sync title":"sincronización de su móvil","settings sync gplay":"Acceda a su Cozy directamente desde su perférico móvil. Ahora puede descargar nuestra aplicación en el Google Play Store:","settings sync gplay get it":"Consígala en Google Play","settings sync carddav":"¿Quisiera usted tener mayores informes sobre la sincronización con CardDav? Echele una mirada a [nuestra documentación] (%{link}).","card actions create":"crear","card actions save":"guardar","card actions labels":"etiquetas","card actions labels add":"añadir una etiqueta","card actions labels create":"crear una etiqueta","card actions cancel":"anular","card actions edit":"editar","card actions delete":"suprimir","card actions export":"exportar","card actions add select":"añadir campo","card actions add birthday":"cumpleaños","card actions add social":"redes sociales","card actions add link":"url","card actions add other":"información adicional","card actions add share":"cozy cloud","card confirm delete title":"Suprimir %{name}?","card confirm delete message":"¿Desea usted remover %{name} de sus contactos? ¿Está seguro?","card confirm delete ok":"Suprimir Contacto","card confirm delete cancel":"Guardarlo","card confirm cancel title":"¿Está usted seguro de abandonar?","card confirm cancel message":"Su contacto no ha sido guardado.","card confirm cancel ok":"Abandonar","card confirm cancel cancel":"Permanecer en Modo Edición","datapoints section tel":"Números de teléfono","datapoints section email":"Direcciones email","datapoints section adr":"Direcciones postales","datapoints section xtras":"Datos adicionales","datapoint label name prefix":"prefijo","datapoint label name first":"nombre","datapoint label name middle":"segundo nombre","datapoint label name given":"apellido","datapoint label name suffix":"sufijo","datapoint label org":"empresa","datapoint placeholder org":"añadir nombre de empresa","datapoint label department":"departamento","datapoint placeholder department":"añadir departamento","datapoint label title":"título","datapoint placeholder title":"añadir título","datapoint placeholder tel":"añadir número de teléfono","datapoint placeholder email":"añadir dirección email","datapoint placeholder adr":"añadir una dirección","datapoint placeholder social":"añadir alias de redes sociales","datapoint placeholder im":"añadir alias para redes sociales","datapoint placeholder chat":"añadir alias para redes sociales","datapoint placeholder url":"añadir una url","datapoint placeholder other":"añadir un dato","datapoint placeholder share":"añadir la url de cozy cloud","datapoint label bday":"cumpleaños","datapoint placeholder bday":"AAAA-MM-DD","datapoint label note":"notas","duplicates title":"Encontrar duplicados","duplicates actions mergeall":"fusionar todas","duplicates empty":"No se han encontrado duplicados","mergerow actions merge":"fusionar","mergerow actions dismiss":"descartar","merge title":"Fusionar contactos","merge choose avatar":"Escoger una imagen para el perfil:","merge choose name":"Escoger un nombre:","merge choose nickname":"Escogr un alias:","merge choose organisation":"escoger una organización:Escoger una organización:","merge choose org":"empresa","merge choose department":"departamento","merge choose title":"título","merge choose birthday":"Escoger un cumpleaños:","merge actions merge":"combinar contactos","merge actions cancel":"anular","error upload wrong filetype":"El archivo descargado no tiene un formato VCF/VCard válido. Ensaye con otro archivo.","error search too short":"Se necesita al menos 3 caracteres para realizar una búsqueda"}}),require.register("locales/fr",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"aucun contact ne correspond à votre recherche","list counter empty":"aucun contact disponible","tools subactions settings":"configuration","tools actions add contact":"ajouter un contact","tools actions find duplicates":"doublons","tools search placeholder":"rechercher des contacts","tools labels filters":"libellés","tools labels filters all":"tous les contacts","tools contextual selected":"%{smart_count} contact sélectionné |||| %{smart_count} contacts sélectionnés","tools contextual select all":"tout sélectionner","tools contextual select none":"tout désélectionner","tools contextual merge":"fusionner","tools contextual export":"exporter","tools contextual delete":"supprimer","bulk confirm delete title":"Supprimer le contact |||| Supprimer les contacts","bulk confirm delete message":"Vous allez supprimer un contact. Le voulez-vous vraiment ? |||| Vous aller supprimer %{smart_count} contacts. Le voulez-vous vraiment ? ","bulk confirm delete ok":"Supprimer","bulk confirm delete cancel":"Conserver","settings title":"configuration","settings in-out title":"importer / exporter les contacts","settings in-out import action":"importer un fichier vcard","settings in-out export action":"exporter vos contacts","settings in-out import result":"Vous avez importé %{smart_count} contact. |||| Vous avez importé %{smart_count} contacts.","settings display title":"affichage","settings display sort gn":"trier par nom","settings display sort fn":"trier par prénom","settings sync title":"synchronisation mobile","settings sync gplay":"Accédez à votre Cozy depuis votre mobile. Téléchargez notre application sur le Google Play Store :","settings sync gplay get it":"Disponible sur Google Play","settings sync carddav":"Besoin de synchronisation CardDav ? Jetez un œil à [notre documentation](%{link}).","card actions create":"créer","card actions save":"enregistrer","card actions labels":"libellés","card actions labels add":"ajouter un libellé","card actions labels create":"créer un libellé","card actions cancel":"annuler","card actions edit":"modifier","card actions delete":"supprimer","card actions export":"exporter","card actions add select":"ajouter un champ","card actions add birthday":"date de naissance","card actions add social":"réseau social","card actions add link":"lien","card actions add other":"autre","card actions add share":"Cozy cloud","card confirm delete title":"Supprimer %{name} ?","card confirm delete message":"Vous allez supprimer %{name} de vos contacts. Le voulez-vous vraiment ?","card confirm delete ok":"Le supprimer","card confirm delete cancel":"Le garder","card confirm cancel title":"Voulez-vous vraiment quitter l'édition ?","card confirm cancel message":"Vos modifications n'ont pas été sauvées.","card confirm cancel ok":"Quitter","card confirm cancel cancel":"Rester","datapoints section tel":"Numéros de téléphone","datapoints section email":"Adresses email","datapoints section adr":"Adresses postales","datapoints section xtras":"Informations complémentaires","datapoint label name prefix":"civilité","datapoint label name first":"prénom","datapoint label name middle":"surnom","datapoint label name given":"nom","datapoint label name suffix":"particule","datapoint label org":"société","datapoint placeholder org":"ajouter une société","datapoint label department":"département","datapoint placeholder department":"ajouter un département","datapoint label title":"poste","datapoint placeholder title":"ajouter un poste","datapoint placeholder tel":"ajouter un numéro de téléphone","datapoint placeholder email":"ajouter une adresse email","datapoint placeholder adr":"ajouter une adresse","datapoint placeholder social":"ajouter un nom d'utilisateur","datapoint placeholder im":"ajouter un nom d'utilisateur","datapoint placeholder chat":"ajouter un nom d'utilisateur","datapoint placeholder url":"ajouter une url","datapoint placeholder other":"ajouter une information","datapoint placeholder share":"Ajouter l'URL cozy","datapoint label bday":"anniversaire","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Doublons","duplicates actions mergeall":"tout fusionner","duplicates empty":"Aucun doublon détecté","mergerow actions merge":"fusionner","mergerow actions dismiss":"abandonner","merge title":"Fusionner les contacts","merge choose avatar":"Choisissez une photo de profil :","merge choose name":"Choisissez un nom :","merge choose nickname":"Choisissez un surnom :","merge choose organisation":"Choisissez une organisation:","merge choose org":"société","merge choose department":"département","merge choose title":"poste","merge choose birthday":"Choisissez un anniversaire :","merge actions merge":"fusionner","merge actions cancel":"annuler","error upload wrong filetype":"Le fichier sélectionné n'est pas un format VCard/VCF valide. Essayez avec un autre fichier.","error search too short":"Vous devez saisir au moins3 caractères."}}),require.register("locales/it",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field", -"card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/ja",function(t,e,o){o.exports={"list counter":"%{smart_count} 連絡先 |||| %{smart_count} 連絡先","list counter no-search":"条件に一致する連絡先はありません","list counter empty":"現在、連絡先はありません","tools subactions settings":"設定","tools actions add contact":"連絡先を追加","tools actions find duplicates":"重複を探す","tools search placeholder":"連絡先の検索","tools labels filters":"ラベル","tools labels filters all":"すべての連絡先","tools contextual selected":"%{smart_count} 連絡先を選択しました |||| %{smart_count} 連絡先を選択しました","tools contextual select all":"すべて選択","tools contextual select none":"すべて選択解除","tools contextual merge":"マージ","tools contextual export":"エクスポート","tools contextual delete":"削除","bulk confirm delete title":"連絡先を削除 |||| 連絡先を削除","bulk confirm delete message":"連絡先を削除します。よろしいですか? |||| %{smart_count} 連絡先を削除します。よろしいですか?","bulk confirm delete ok":"削除","bulk confirm delete cancel":"安全に保存","settings title":"設定","settings in-out title":"連絡先のインポート/エクスポート","settings in-out import action":"vcard をインポート","settings in-out export action":"vcard をエクスポート","settings in-out import result":"%{smart_count} 連絡先を正常にインポートしました。 |||| %{smart_count} 連絡先を正常にインポートしました。","settings display title":"表示設定","settings display sort gn":"姓で並び替え","settings display sort fn":"名で並び替え","settings sync title":"モバイル同期","settings sync gplay":"お使いのモバイルデバイスから直接すべての Cozy にアクセスしましょう。Google Play ストアでアプリをダウンロードしてください。","settings sync gplay get it":"Google play で入手","settings sync carddav":"CardDav を使用する同期についての詳細情報をお探しですか? [ドキュメント](%{link}) を参照してください。","card actions create":"作成","card actions save":"保存","card actions labels":"ラベル","card actions labels add":"ラベルを追加","card actions labels create":"ラベルを作成","card actions cancel":"キャンセル","card actions edit":"編集","card actions delete":"削除","card actions export":"エクスポート","card actions add select":"項目を追加","card actions add birthday":"誕生日","card actions add social":"ソーシャルメディア","card actions add link":"url","card actions add other":"その他の情報","card actions add share":"cozy クラウド","card confirm delete title":"%{name} を削除しますか?","card confirm delete message":"連絡先から %{name} を削除します。よろしいですか?","card confirm delete ok":"連絡先を削除","card confirm delete cancel":"残す","card confirm cancel title":"離れてもよろしいですか?","card confirm cancel message":"連絡先は保存されていません。","card confirm cancel ok":"離れる","card confirm cancel cancel":"編集モードのままにする","datapoints section tel":"電話番号","datapoints section email":"メールアドレス","datapoints section adr":"住所","datapoints section xtras":"追加情報","datapoint label name prefix":"敬称(前)","datapoint label name first":"名","datapoint label name middle":"ミドル名","datapoint label name given":"名","datapoint label name suffix":"敬称","datapoint label org":"会社","datapoint placeholder org":"会社名を追加","datapoint label department":"部署","datapoint placeholder department":"部署を追加","datapoint label title":"肩書","datapoint placeholder title":"肩書を追加","datapoint placeholder tel":"電話番号を追加","datapoint placeholder email":"メールアドレスを追加","datapoint placeholder adr":"住所を追加","datapoint placeholder social":"ソーシャルメディアのニックネームを追加","datapoint placeholder im":"ソーシャルメディアのニックネームを追加","datapoint placeholder chat":"ソーシャルメディアのニックネームを追加","datapoint placeholder url":"url を追加","datapoint placeholder other":"任意の情報を追加","datapoint placeholder share":"cozy クラウドの url を追加","datapoint label bday":"誕生日","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"メモ","duplicates title":"重複を探す","duplicates actions mergeall":"すべてマージ","duplicates empty":"重複は見つかりません","mergerow actions merge":"マージ","mergerow actions dismiss":"却下","merge title":"連絡先をマージ","merge choose avatar":"プロファイル写真を選択:","merge choose name":"名前を選択:","merge choose nickname":"ニックネームを選択:","merge choose organisation":"組織を選択:","merge choose org":"会社","merge choose department":"部署","merge choose title":"肩書","merge choose birthday":"誕生日を選択:","merge actions merge":"連絡先をマージ","merge actions cancel":"キャンセル","error upload wrong filetype":"アップロードされたファイルは有効な VCF/VCard 形式ではありません。別のファイルを試してください。","error search too short":"検索を実行するには、少なくとも3文字入力する必要があります"}}),require.register("locales/ko",function(t,e,o){o.exports={"list counter":"%{smart_count}개의 연락처 |||| %{smart_count}개의 연락처","list counter no-search":"일치하는 연락처가 없습니다","list counter empty":"등록된 연락처가 없습니다","tools subactions settings":"설정","tools actions add contact":"연락처 추가","tools actions find duplicates":"중복검색","tools search placeholder":"연락처 검색","tools labels filters":"태그 목록","tools labels filters all":"모든 연락처","tools contextual selected":"%{smart_count} 개의 연락처 선택됨 |||| %{smart_count} 개의 연락처 선택됨","tools contextual select all":"전체 선택","tools contextual select none":"전체 해제","tools contextual merge":"합치기","tools contextual export":"내보내기","tools contextual delete":"삭제","bulk confirm delete title":"연락처 삭제 |||| 연락처 삭제","bulk confirm delete message":"연락처를 삭제 하시겠습니까? |||| %{smart_count} 개의 연락처를 삭제 하시겠습니까?","bulk confirm delete ok":"삭제","bulk confirm delete cancel":"안전하게 보관함","settings title":"설정","settings in-out title":"연락처 가져오기/내보내기","settings in-out import action":"VCARD 가져오기","settings in-out export action":"VCARD 내보내기","settings in-out import result":"%{smart_count} 개의 연락처 가져오기를 성공했습니다. ||||%{smart_count} 개의 연락처 가져오기를 성공했습니다.","settings display title":"설정 표시","settings display sort gn":"성으로 정렬","settings display sort fn":"이름으로 정렬","settings sync title":"모바일 동기화","settings sync gplay":"모바일 기기로 접속하여 연락처를 공유 할 수 있습니다. 구글 플레이 스토어에서 다운로드 받을 수 있습니다.","settings sync gplay get it":"구글 플레이에서 가져오기","settings sync carddav":"CardDav 사용하여 동기화 하는 방법에 대해 더 자세히 알려면, 링크 내용을 참고 하세요.(%{link}).","card actions create":"생성","card actions save":"저장","card actions labels":"태그","card actions labels add":"태그 추가","card actions labels create":"태그 생성","card actions cancel":"취소","card actions edit":"수정","card actions delete":"삭제","card actions export":"내보내기","card actions add select":"필드 추가","card actions add birthday":"생년월일","card actions add social":"소셜미디어","card actions add link":"인터넷 주소","card actions add other":"추가 정보","card actions add share":"Cozy 클라우드","card confirm delete title":"%{name}를 삭제 하시겠습니까?","card confirm delete message":"정말로 연락처에서 %{name}을 삭제 하시겠습니까?","card confirm delete ok":"연락처 삭제","card confirm delete cancel":"유지","card confirm cancel title":"페이지를 나가시겠습니까?","card confirm cancel message":"연락처 목록이 저장 되지 않았습니다.","card confirm cancel ok":"떠나기","card confirm cancel cancel":"수정 모드에 머무르기","datapoints section tel":"전화번호","datapoints section email":"이메일 주소","datapoints section adr":"우편번호","datapoints section xtras":"추가 정보","datapoint label name prefix":"접두사","datapoint label name first":"이름","datapoint label name middle":"중간이름","datapoint label name given":"성","datapoint label name suffix":"접미사","datapoint label org":"회사","datapoint placeholder org":"회사명 추가","datapoint label department":"부서","datapoint placeholder department":"부서 추가","datapoint label title":"제목","datapoint placeholder title":"제목 추가","datapoint placeholder tel":"전화번호 추가","datapoint placeholder email":"이메일 추가","datapoint placeholder adr":"주소 추가","datapoint placeholder social":"소셜미디어 별명 추가","datapoint placeholder im":"소셜미디어 별명 추가","datapoint placeholder chat":"소셜미디어 별명 추가","datapoint placeholder url":"URL 추가","datapoint placeholder other":"추가 정보 추가","datapoint placeholder share":"Cozy 클라우드 주소 추가","datapoint label bday":"생년월일","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"메모","duplicates title":"중복 검색","duplicates actions mergeall":"전체 합치기","duplicates empty":"중복된 연락처 없음","mergerow actions merge":"합치기","mergerow actions dismiss":"해제","merge title":"연락처 합치기","merge choose avatar":"프로파일 사진 선택","merge choose name":"이름 선택","merge choose nickname":"별명 선택","merge choose organisation":"조직 선택","merge choose org":"회사명","merge choose department":"부서명","merge choose title":"제목","merge choose birthday":"생년월일 선택","merge actions merge":"연락처 합치기","merge actions cancel":"취소","error upload wrong filetype":"VCF/VCard 형식이 올바르지 않습니다. 다른 파일을 이용해 주세요.","error search too short":"검색을 위해서는 최소 3자 이상 입력 하세요."}}),require.register("locales/pl",function(t,e,o){o.exports={"list counter":"%{smart_count} kontakt |||| %{smart_count} kontatky","list counter no-search":"nie znaleziono kontaktów","list counter empty":"nie znaleziono kontaktów","tools subactions settings":"ustawienia","tools actions add contact":"dodaj kontakt","tools actions find duplicates":"znajdź duplikaty","tools search placeholder":"wyszukaj kontakty","tools labels filters":"etykiety","tools labels filters all":"wszystkie kontakty","tools contextual selected":"%{smart_count} wybrano kontakt |||| %{smart_count} wybrano kontakty","tools contextual select all":"wybierz wszystkie","tools contextual select none":"wybierz żaden","tools contextual merge":"scal","tools contextual export":"eksportuj","tools contextual delete":"usuń","bulk confirm delete title":"Usuń kontakt |||| Usuń kontakty","bulk confirm delete message":"Czy jesteś pewien usunięcia tego kontaktu? |||| Czy jesteś pewien usunięcia %{smart_count} kontaktów? ","bulk confirm delete ok":"usuń","bulk confirm delete cancel":"anuluj usuwanie","settings title":"ustawienia","settings in-out title":"import/eksport kontatków","settings in-out import action":"importuj vcard","settings in-out export action":"eksportuj vcard","settings in-out import result":"Zaimportowałeś %{smart_count} kontakt. |||| Zaimportowałeś %{smart_count} kontaktów.","settings display title":"pokaż ustawienia","settings display sort gn":"sortuj po nazwisku","settings display sort fn":"sortuj po imieniu","settings sync title":"Synchronizacja na smartfonie","settings sync gplay":"Zdobądź dostęp do Cozy na swoim smarfonie. Pobierz naszą aplikację z sklepu Google Play:","settings sync gplay get it":"Zainstaluj z Google Play","settings sync carddav":"Szukasz więcej informacji o synchronizacji poprzez CardDav? Spójrz na [naszą dokumentację](%{link}).","card actions create":"stwórz","card actions save":"zapisz","card actions labels":"etykiety","card actions labels add":"dodaj etykietę","card actions labels create":"stwórz etykietę","card actions cancel":"anuluj","card actions edit":"edytuj","card actions delete":"usuń","card actions export":"eksportuj","card actions add select":"dodaj pole","card actions add birthday":"urodziny","card actions add social":"media społecznościowe","card actions add link":"adres url","card actions add other":"inne informacje","card actions add share":"chmura cozy","card confirm delete title":"Czy na pewno usunąć %{name}?","card confirm delete message":"Usuniesz %{name} z swoich kontaktów. Jesteś tego pewien?","card confirm delete ok":"Usuń kontakt","card confirm delete cancel":"Zapamiętaj to","card confirm cancel title":"Czy na pewno chcesz już iść?","card confirm cancel message":"Twój kontakt nie został zapisany","card confirm cancel ok":"Opuść ","card confirm cancel cancel":"Zostań w trybie edycji","datapoints section tel":"Numer telefonu","datapoints section email":"Adres Email","datapoints section adr":"adresy pocztowe","datapoints section xtras":"Dodatkowe informacje","datapoint label name prefix":"prefiks","datapoint label name first":"Imię","datapoint label name middle":"Drugie imię","datapoint label name given":"Nazwisko","datapoint label name suffix":"przyrostek","datapoint label org":"Nazwa firmy","datapoint placeholder org":"dodaj nazwę firmy","datapoint label department":"odział","datapoint placeholder department":"dodaj oddział","datapoint label title":"tytuł","datapoint placeholder title":"dodaj tytuł","datapoint placeholder tel":"dodaj numer telefonu","datapoint placeholder email":"dodaj adres e-mail","datapoint placeholder adr":"dodaj adres","datapoint placeholder social":"nick używany w mediach społecznościowych","datapoint placeholder im":"nick używany w mediach społecznościowych","datapoint placeholder chat":"nick używany w mediach społecznościowych","datapoint placeholder url":"dodaj adres url","datapoint placeholder other":"dodaj inną informację","datapoint placeholder share":"dodaj adres url do cozy","datapoint label bday":"urodziny","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notatatki","duplicates title":"Znajdź duplikaty","duplicates actions mergeall":"scal wszystkie","duplicates empty":"Nie znaleziono duplikatów","mergerow actions merge":"scal","mergerow actions dismiss":"oddal","merge title":"Scal kontakty","merge choose avatar":"Wybierz zdjęcie profilowe:","merge choose name":"Wprowadź nazwę","merge choose nickname":"Wprowadź nick","merge choose organisation":"Wprowadź nazwę organizacji","merge choose org":"nazwa firmy","merge choose department":"oddział","merge choose title":"tytuł","merge choose birthday":"Wprowadź urodziny","merge actions merge":"scal kontakty","merge actions cancel":"anuluj","error upload wrong filetype":"Dodany plik nie jest kompatybilny z formatem VCF/VCard. Spróbuj ponownie z innym plikiem.","error search too short":"musisz wpisać co najmniej 3 znaki aby wyszukiać"}}),require.register("locales/pt_BR",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/ro",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/ru",function(t,e,o){o.exports={"list counter":"%{smart_count} контакт |||| %{smart_count} контактов","list counter no-search":"контакта по вашему критерию не найдено","list counter empty":"нет контакта в это время","tools subactions settings":"настройки","tools actions add contact":"добавить контакт","tools actions find duplicates":"найти дубли","tools search placeholder":"поиск контактов","tools labels filters":"метки","tools labels filters all":"все контакты","tools contextual selected":"%{smart_count} контакт выбран |||| %{smart_count} контактов выбрано","tools contextual select all":"выбрать все","tools contextual select none":"отменить выбор","tools contextual merge":"обьеденить","tools contextual export":"экспорт","tools contextual delete":"удалить","bulk confirm delete title":"Удалить контакт |||| Удалить контакты","bulk confirm delete message":"Вы удаляете контакт. Вы уверены? |||| Вы удаляете %{smart_count} контактов. Вы уверены?","bulk confirm delete ok":"удалить","bulk confirm delete cancel":"Держите их в безопасности","settings title":"настройки","settings in-out title":"импорт/экспорт контактов","settings in-out import action":"импорт vcard","settings in-out export action":"экспорт vcard","settings in-out import result":"Вы успешно импортировали %{smart_count} контакт. |||| Вы успешно импортировали %{smart_count} контактов.","settings display title":"показать настройки","settings display sort gn":"сортировать по фамилии","settings display sort fn":"сортировать по имени","settings sync title":"синхронизация с телефоном","settings sync gplay":"Доступ к вашему Cozy прямо на вашем мобильном устройстве. Скачайте наше приложение в магазине Google Play:","settings sync gplay get it":"Получить его в Google Play","settings sync carddav":"Хотите узнать больше о синхронизации через CalDav? Ознакомьтесь с [our documentation](%{link}).","card actions create":"создать","card actions save":"сохранить","card actions labels":"метки","card actions labels add":"добавить метку","card actions labels create":"создать метку","card actions cancel":"отмена","card actions edit":"изменить","card actions delete":"удалить","card actions export":"экспорт","card actions add select":"добавить поле","card actions add birthday":"день рождения","card actions add social":"социальные сети","card actions add link":"url","card actions add other":"другая информация","card actions add share":"облако cozy","card confirm delete title":"Удалить %{name}?","card confirm delete message":"Вы удаляете %{name} из ваших контактов. Вы уверены?","card confirm delete ok":"Удалить Контакт","card confirm delete cancel":"Сохранить это","card confirm cancel title":"Вы уверены, что хотите выйти?","card confirm cancel message":"Ваш контакт не сохранен.","card confirm cancel ok":"Выйти","card confirm cancel cancel":"Остаться в режиме редактирования","datapoints section tel":"Номер телефона","datapoints section email":"Адрес эл. почты","datapoints section adr":"Почтовый адрес","datapoints section xtras":"Дополнительная информация","datapoint label name prefix":"префикс","datapoint label name first":"Имя","datapoint label name middle":"отчество","datapoint label name given":"фамилия","datapoint label name suffix":"суффикс","datapoint label org":"компания","datapoint placeholder org":"добавить название компании","datapoint label department":"отдел","datapoint placeholder department":"добавить отдел","datapoint label title":"должность","datapoint placeholder title":"добавить должность","datapoint placeholder tel":"добавить номер телефона","datapoint placeholder email":"добавить адрес эл. почты","datapoint placeholder adr":"добавить адрес","datapoint placeholder social":"добавить никнейм в соц. сетях","datapoint placeholder im":"добавить никнейм в мессенджерах","datapoint placeholder chat":"добавить никнейм в чатах","datapoint placeholder url":"добавить ссылку","datapoint placeholder other":"добавить информацию","datapoint placeholder share":"добавить облако cozy по url","datapoint label bday":"день рождения","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"записки","duplicates title":"Найти повторы","duplicates actions mergeall":"объединить все","duplicates empty":"Повторов не найдено","mergerow actions merge":"обьеденить","mergerow actions dismiss":"отбросить","merge title":"Объединить контакты","merge choose avatar":"Выберите аватар профиля:","merge choose name":"Выберите имя:","merge choose nickname":"Выберите никнейм:","merge choose organisation":"Выберите организацию:","merge choose org":"компания","merge choose department":"отдел","merge choose title":"должность","merge choose birthday":"Выберите день рождения:","merge actions merge":"объединить контакты","merge actions cancel":"отмена","error upload wrong filetype":"Загруженный файл имеет неверный формат VCF/VCard. Попробуйте снова с другим файлом.","error search too short":"вам нужно ввести минимум 3 символа для выполнения поиска"}}),require.register("locales/ru_RU",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).", -"card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("locales/zh_CN",function(t,e,o){o.exports={"list counter":"%{smart_count} contact |||| %{smart_count} contacts","list counter no-search":"no contact matches your criteria","list counter empty":"no contact at this time","tools subactions settings":"settings","tools actions add contact":"add contact","tools actions find duplicates":"find duplicates","tools search placeholder":"search for contacts","tools labels filters":"labels","tools labels filters all":"all contacts","tools contextual selected":"%{smart_count} contact selected |||| %{smart_count} contacts selected","tools contextual select all":"select all","tools contextual select none":"select none","tools contextual merge":"merge","tools contextual export":"export","tools contextual delete":"delete","bulk confirm delete title":"Delete contact |||| Delete contacts","bulk confirm delete message":"You'll delete a contact. Are you sure? |||| You'll delete %{smart_count} contacts. Are you sure?","bulk confirm delete ok":"delete","bulk confirm delete cancel":"keep 'em safe","settings title":"settings","settings in-out title":"import/export contacts","settings in-out import action":"import vcard","settings in-out export action":"export vcard","settings in-out import result":"You've just successfully imported %{smart_count} contact. |||| You've just successfully imported %{smart_count} contacts.","settings display title":"display settings","settings display sort gn":"sort by last name","settings display sort fn":"sort by first name","settings sync title":"mobile synchronization","settings sync gplay":"Access all your Cozy directly on your mobile device. Download our app now on the Google Play Store:","settings sync gplay get it":"Get it on Google play","settings sync carddav":"Looking for more information about the synchronization using CardDav? Take a look at [our documentation](%{link}).","card actions create":"create","card actions save":"save","card actions labels":"labels","card actions labels add":"add label","card actions labels create":"create label","card actions cancel":"cancel","card actions edit":"edit","card actions delete":"delete","card actions export":"export","card actions add select":"add field","card actions add birthday":"birthday","card actions add social":"social media","card actions add link":"url","card actions add other":"other information","card actions add share":"cozy cloud","card confirm delete title":"Remove %{name}?","card confirm delete message":"You'll remove %{name} from your contacts. Are you sure?","card confirm delete ok":"Delete Contact","card confirm delete cancel":"Keep it","card confirm cancel title":"Are you sure you want to leave?","card confirm cancel message":"Your contact hasn't been saved.","card confirm cancel ok":"Leave","card confirm cancel cancel":"Stay on Edit Mode","datapoints section tel":"Phone numbers","datapoints section email":"Email addresses","datapoints section adr":"Postal addresses","datapoints section xtras":"Additional informations","datapoint label name prefix":"prefix","datapoint label name first":"first name","datapoint label name middle":"middle name","datapoint label name given":"last name","datapoint label name suffix":"suffix","datapoint label org":"company","datapoint placeholder org":"add company name","datapoint label department":"department","datapoint placeholder department":"add department","datapoint label title":"title","datapoint placeholder title":"add title","datapoint placeholder tel":"add phone number","datapoint placeholder email":"add email address","datapoint placeholder adr":"add address","datapoint placeholder social":"add social media nickname","datapoint placeholder im":"add social media nickname","datapoint placeholder chat":"add social media nickname","datapoint placeholder url":"add an url","datapoint placeholder other":"add any information","datapoint placeholder share":"add cozy cloud url","datapoint label bday":"birthday","datapoint placeholder bday":"YYYY-MM-DD","datapoint label note":"notes","duplicates title":"Find Duplicates","duplicates actions mergeall":"merge all","duplicates empty":"No duplicates found","mergerow actions merge":"merge","mergerow actions dismiss":"dismiss","merge title":"Merge contacts","merge choose avatar":"Choose a profile picture:","merge choose name":"Choose a name:","merge choose nickname":"Choose a nickname:","merge choose organisation":"Choose an organisation:","merge choose org":"company","merge choose department":"department","merge choose title":"title","merge choose birthday":"Choose a birthday:","merge actions merge":"merge contacts","merge actions cancel":"cancel","error upload wrong filetype":"The uploaded file isn't a valid VCF/VCard format. Please try with another file.","error search too short":"you need to input at least 3 characters to perform a search"}}),require.register("models/config",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.url="config",e}(Backbone.Model)}),require.register("models/contact",function(t,e,o){var a,n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=void 0,n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.defaults={name:"other",type:"other",value:"",mediatype:""},e.prototype.parse=function(t){return"adr"===t.name&&_.isArray(t.value)&&(t.value=VCardParser.adrArrayToString(t.value)),t},e}(Backbone.Model),o.exports=a=function(t){function o(){r=e("application"),o.__super__.constructor.apply(this,arguments)}return i(o,t),o.prototype.urlRoot="contacts",o.prototype.defaults={n:";;;;"},o.prototype.parse=function(t){var e,o,a,r,i,s,l;for(r in t)l=t[r],""===l&&delete t[r];return t.n&&(i=t.n.split(";"),a=i[0],o=i[1],t.initials=_.chain([o,a]).compact().map(function(t){return t[0].toAscii()[0]}).join("").value(),t.sortedName=this._buildSortedName(t.n)),(s=t.url)&&(delete t.url,t.datapoints.unshift({name:"url",type:"main",value:s})),e=this.attributes.datapoints||new Backbone.Collection(t.datapoints||[],{model:n,parse:!0}),e.comparator="name",t.datapoints=e,t.tags=_.invoke(t.tags,"toLowerCase"),t},o.prototype.sync=function(t,e,a){var n,r;return n=e.get("avatar")||e.get("photo"),n&&(e.unset("avatar",{silent:!0}),e.unset("photo",{silent:!0}),r=a.success,a.success=function(t){return function(e,o,i){return t.savePicture(n,e,{success:function(){return r.apply(t,arguments),t.fetch()},error:a.error})}}(this)),o.__super__.sync.apply(this,arguments)},o.prototype.validate=function(t,e){var o,a,n,r,i,s,l;if(t.fn=VCardParser.nToFN(t.n.split(";")),n=(null!=(l=t.datapoints)?l.toJSON():void 0)||[],t.datapoints=n.map(function(t){return"adr"===t.name&&(t.value=VCardParser.adrStringToArray(t.value)),t}),s=_.findWhere(t.datapoints,{name:"url",mediatype:""}),s&&(t.datapoints=_.without(t.datapoints,s),t.url=s.value),a=_.where(t.datapoints,{name:"share"}),!_.isEmpty(a))for(r=0,i=a.length;i>r;r++)o=a[r],o.name="url",o.mediatype="cloud:cozy";return e.attrs=t,!1},o.prototype._buildSortedName=function(t){var e,o,a,n,i;return null==t&&(t=this.get("n")),i=r.model.get("sort"),n=t.split(";"),o=n[0],e=n[1],a=n[2],_.chain("fn"===i?[e,a,o]:[o,e,a]).compact().join(" ").value()},o.prototype.initialize=function(){return this.listenTo(r.model,{"change:sort":function(){return this.set({sortedName:this._buildSortedName()})}})},o.prototype.toString=function(t){var e,o,a,n,r,i;return null==t&&(t={}),r=this.attributes.n.split(";"),o=r[0],e=r[1],a=r[2],n=r[3],i=r[4],o=_.compact([t.pre,o,t.post]).join(""),_.compact([n,e,a,o,i]).join(" ")},o.prototype.toHighlightedString=function(t,e){var o,a,n,r;return null==e&&(e={}),o=e.format?{pre:"»",post:"«"}:void 0,n=this.toString(o),t&&(a=fuzzy.match(t,n,e)),r=a?a.rendered:n,o&&(r=r.replace("»",e.format.pre).replace("«",e.format.post)),r},o.prototype.match=function(t,e){var o,a,n;return null==e&&(e={}),n=_.compact([this.toString(),this.attributes.org]),e.fullsearch&&(o=_.compact(this.attributes.datapoints.map(function(t){return"adr"!==t.get("name")?t.get("value"):void 0})),n=n.concat(o).concat(this.attributes.tags)),a=n.reduce(function(e,o,a){var n;return n=fuzzy.match(t,o),e+((null!=n?n.score:void 0)||0)},0),a||!1},o.prototype.savePicture=function(t,e,o){var a,n,r,i,s,l,c;if(!e.id)return o.error(new Error("Model should have been saved once."));for(n=atob(t),a=[],s=l=0,c=n.length;c>=0?c>=l:l>=c;s=c>=0?++l:--l)a.push(n.charCodeAt(s));return r=new Blob([new Uint8Array(a)],{type:"image/jpeg"}),i=new FormData,i.append("picture",r),i.append("contact",e),$.ajax({type:"PUT",url:"contacts/"+e.id+"/picture",data:i,contentType:!1,processData:!1,success:o.success,error:o.error})},o.prototype.picturetoa=function(t){var e,o;return(null!=(o=this.attributes._attachments)?o.picture:void 0)?(e=new Image,e.onload=function(){var e,o,a,n;return o=document.createElement("canvas"),o.width=this.naturalWidth,o.height=this.naturalHeight,a=o.getContext("2d"),a.drawImage(this,0,0),n=o.toDataURL("image/jpeg").split(","),e=n[n.length-1],t(e)},e.src="contacts/"+this.id+"/picture.png"):t()},o.prototype.toVCF=function(t){var e;return e=this.toJSON(),e.datapoints=e.datapoints.toJSON(),this.picturetoa(function(o){return t(VCardParser.toVCF(e,o))})},o.prototype.getLastAndFirstNames=function(){var t;return t=this.get("n").split(";"),""+t[1]+t[0]},o}(Backbone.Model)}),require.register("models/tag",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.urlRoot="tags",e.prototype.parse=function(t){return t.name=t.name.toLowerCase(),t},e}(Backbone.Model)}),require.register("routes/contacts",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};n=void 0,o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.routes={"new":"create",duplicates:"duplicates",":slug":"show",":slug/edit":"edit","":"index"},o.prototype.initialize=function(){return n=e("application")},o.prototype._ensureContacts=function(t){return _.isFunction(t)?n.contacts.isEmpty()?this.listenToOnce(n.contacts,"sync",t):t():void 0},o.prototype._setCardState=function(t,e){var o;return o=s.call(n.contacts.pluck("id"),t)>=0||"new"===t,n.model.set("dialog",o?t:!1),n.channel.trigger("mode:edit",e)},o.prototype.index=function(){return n.search("tag",null)},o.prototype.show=function(t){return this._ensureContacts(_.wrap(this._setCardState,function(e){return e(t)}))},o.prototype.edit=function(t){return this._ensureContacts(_.wrap(this._setCardState,function(e){return e(t,!0)}))},o.prototype.create=function(){return this._setCardState("new",!0)},o.prototype.duplicates=function(){return this._ensureContacts(function(){return $($("nav a").get(1)).attr("aria-busy",!0),setTimeout(function(){return n.model.set("dialog","duplicates")},500)})},o}(Backbone.SubRoute)}),require.register("routes/index",function(t,e,o){var a,n,r,i,s=function(t,e){function o(){this.constructor=t}for(var a in e)l.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},l={}.hasOwnProperty;a=e("routes/contacts"),r=e("routes/tags"),i=void 0,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.routes={settings:"settings","contact/:slug":"legacyContactRedirect","":"index"},o.prototype.initialize=function(){return i=e("application"),i.on("start",function(){var t,e;return t=new a("contacts"),e=new r("tags")}),this.listenTo(i.model,"change:dialog",function(t,e){var o,a,n;if(!e)return o=null!=(n=i.model.get("filter"))?n.match(/tag:(\w+)/i):void 0,a=o?"tags/"+o[1]:"contacts",this.navigate(a)})},o.prototype.index=function(){return this.navigate("contacts",{trigger:!0})},o.prototype.settings=function(){return i.model.set("dialog","settings")},o.prototype.legacyContactRedirect=function(t){return this.navigate("contacts/"+t,{trigger:!0})},o}(Backbone.Router)}),require.register("routes/tags",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;n=void 0,o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.routes={":slug":"filter"},o.prototype.initialize=function(){var t;return n=e("application"),t=document.createElement("style"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),this.sheet=t.sheet,this.listenTo(n.channel,"filter:tag",function(t){return function(e){var o,a,n,r,i,s;for(r=t.sheet.cssRules,i=[],a=o=0,n=r.length;n>o;a=++o)s=r[a],i.push(t.sheet.deleteRule(a));return i}}(this))},o.prototype.filter=function(t){var e;return n.search("tag",t),e=this.sheet.cssRules.length,this.sheet.insertRule("[role=row]:not(.tag_"+t+"),\n[role=rowgroup]:not(.tag_"+t+") { display: none }",e)},o}(Backbone.SubRoute)}),require.register("views/app_layout",function(t,e,o){var a,n,r,i,s,l,c,d,u,p,m,h,f,g,y=function(t,e){function o(){this.constructor=t}for(var a in e)v.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},v={}.hasOwnProperty;r=e("models/contact"),i=e("views/models/contact"),c=e("views/tools/default_actions"),l=e("views/tools/context_actions"),p=e("views/labels/index"),u=e("views/labels/edit"),h=e("views/tools/toolbar"),s=e("views/contacts"),n=e("views/contacts/card"),d=e("views/duplicates"),m=e("views/settings"),g=e("lib/i18n"),f=void 0,o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return y(o,t),o.prototype.template=e("views/templates/layouts/app"),o.prototype.el='[role="application"]',o.prototype.behaviors={Navigator:{},Dropdown:{},Keyboard:{keymaps:{33:"key:pageup",34:"key:pagedown"}}},o.prototype.ui={navigate:'aside [role="button"], .name',content:'main [role="contentinfo"] ',counter:"main .counter"},o.prototype.regions={actions:"aside .tool-actions",labels:"aside .tool-labels",indexes:"@ui.content .indexes",results:"@ui.content .results",toolbar:'main [role="toolbar"]',dialogs:{selector:".dialogs",regionClass:e("lib/regions/dialogs")},alerts:{selector:".alerts",regionClass:e("lib/regions/dialogs")}},o.prototype.modelEvents={"change:dialog":"showDialog","select:start":"showContextualMenu","select:end":"hideContextualMenu","change:scored":"onSearchResults"},o.prototype.childEvents={"drawer:toggle":"toggleDrawer","contacts:select":function(t,e){return this.model.select(e)},"contacts:unselect":function(t,e){return this.model.unselect(e)},"dialog:close":function(){return this.model.set("dialog",!1)},"label:change":"updateContactsTags"},o.prototype.initialize=function(){return f=e("application"),this.listenToOnce(f.tags.underlying,{sync:this.showFilters}),this.listenToOnce(f.contacts,{sync:this.showContactsList}),this.listenTo(f.filtered,{update:this.updateCounter}),this.listenTo(f.model,{"change:filter":this.updateCounter}),this.listenTo(f.channel,{"busy:enable":function(){return this.$el.attr("aria-busy",!0)},"busy:disable":function(){return this.$el.attr("aria-busy",!1)},"filter:text":this.toggleResults,"search:error":this.error})},o.prototype.onRender=function(){var t;return t=new h,this.listenToOnce(t,{show:function(){return t.$("#contacts-search").trigger("focus")}}),this.showChildView("toolbar",t),this.showChildView("actions",new c)},o.prototype.showFilters=function(){return this.showChildView("labels",new p({model:this.model,collection:f.tags}))},o.prototype.showContactsList=function(){var t;return t=new s({collection:f.filtered}),this.listenToOnce(t,{show:this.updateCounter}),this.showChildView("indexes",t)},o.prototype.showContextualMenu=function(){return f.tags.length>0?this.showChildView("labels",new u({model:this.model,collection:f.tags.underlying})):this.getRegion("labels").empty(),this.showChildView("actions",new l({model:this.model}))},o.prototype.hideContextualMenu=function(){return this.showFilters(),this.showChildView("actions",new c)},o.prototype.onKeyPageup=function(){var t;return t=this.ui.content[0],t.scrollTop-=t.offsetHeight},o.prototype.onKeyPagedown=function(){var t;return t=this.ui.content[0],t.scrollTop+=t.offsetHeight},o.prototype.toggleDrawer=function(){var t,e;return t=this.$("aside.drawer"),e="true"===t.attr("aria-expanded"),t.attr("aria-expanded",!e)},o.prototype.onSearchResults=function(t,e){return this.indexes.$el.attr("aria-hidden",e),e?setTimeout(function(t){return function(){var e;return e=new s({collection:f.filtered}),t.showChildView("results",e)}}(this)):this.results.reset()},o.prototype.toggleResults=function(t){var e;return null!=(e=this.results.$el)?e.attr("aria-hidden",!t.length):void 0},o.prototype.showDialog=function(t,e){var o,a,s,l;return e?((a=this.getChildView("dialogs"))&&a.stopListening(a.model,"change:tags"),o=function(){switch(e){case"settings":return new m({model:this.model});case"duplicates":return new d;default:return s="new"===e?new r(null,{parse:!0}):f.contacts.get(e),l=new i({"new":"new"===e},{model:s}),l.listenTo(f.channel,{"mode:edit":function(t){return this.set("edit",t)}}),new n({model:l})}}.call(this),this.showChildView("dialogs",o)):this.dialogs.empty()},o.prototype.updateCounter=function(){return window.requestAnimationFrame(function(t){return function(){var e,o;return f.contacts.length?(o=f.filtered.get({tagged:!0}).length,e=o?g("list counter",{smart_count:o}):g("list counter no-search")):e=g("list counter empty"),t.ui.counter.text(e).toggleClass("important",!o)}}(this))},o.prototype.error=function(t){var o;return o=e("config").ERR,t===o.SEARCH_TOO_SHORT?(this.results.$el.attr("aria-hidden",!0),this.ui.counter.text(g("error search too short")).addClass("important")):void 0},o}(Mn.LayoutView)}),require.register("views/contacts/card",function(t,e,o){var a,n,r,i,s,l,c,d=function(t,e){return function(){return t.apply(e,arguments)}},u=function(t,e){function o(){this.constructor=t}for(var a in e)p.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},p={}.hasOwnProperty;a=e("views/contacts/components/avatar"),i=e("views/contacts/components/data"),s=e("views/contacts/components/edit_tags"),c=e("lib/i18n"),n=e("config").contact,l=void 0,o.exports=r=function(t){function o(){return this._deleteModalCfg=d(this._deleteModalCfg,this),o.__super__.constructor.apply(this,arguments)}return u(o,t),o.prototype.template=e("views/templates/contacts/card"),o.prototype.tagName="section",o.prototype.className="card",o.prototype.attributes={role:"dialog"},o.prototype.behaviors=function(){return{Navigator:{},Dialog:{},Form:{},Dropdown:{},Confirm:{triggers:{"click @ui.btnDelete":this._deleteModalCfg}}}},o.prototype.ui={btnEdit:'.edit[role="button"]',btnDelete:"button.delete",btnExport:'[formaction="contact/export"]',navigate:"[href^=contacts], [data-next]",formSubmit:'[type="submit"]',formClear:"button.clear",formInputs:".group:not([data-cid]) input, .group:not([data-cid]) textarea",avatar:".avatar"},o.prototype.regions={avatar:'[role="img"]',infos:".data",tags:"aside .tags"},o.prototype.triggers={"click @ui.btnExport":"export"},o.prototype.events={"click @ui.formSubmit":"showSaving"},o.prototype.modelEvents={"change:edit":"render",save:"onSave",destroy:function(){return this.triggerMethod("dialog:close")}},o.prototype.childEvents={"form:key:enter":"onFormKeyEnter"},o.prototype.initialize=function(){return l=e("application"),Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},o.prototype.serializeData=function(){return _.extend({},o.__super__.serializeData.apply(this,arguments),{lists:n.datapoints.types})},o.prototype._deleteModalCfg=function(){var t,e;return e={name:this.model.get("fn")},t={event:"delete",title:c("card confirm delete title",e),message:c("card confirm delete message",e),btn_ok:c("card confirm delete ok"),btn_cancel:c("card confirm delete cancel")}},o.prototype.onRender=function(){return this.showChildView("avatar",new a({model:this.model})),this.showChildView("infos",new i({model:this.model})),this.showChildView("tags",new s({model:this.model,collection:l.tags})),this.$('[role="contentinfo"]').toggleClass("edit",!!this.model.get("edit"))},o.prototype.onDomRefresh=function(){return this.model.get("edit")?void 0:this.ui.btnEdit.trigger("focus")},o.prototype.onSave=function(){var t;if(this.model.get("new"))return t="contacts/"+this.model.get("id"),this.hideSaving(),l.router.navigate(t,{trigger:!0})},o.prototype.onEditCancel=function(){return this.model.get("new")?this.triggerMethod("dialog:close"):void 0},o.prototype.onFormKeyEnter=function(){var t;return t=this.$(".data.edit").find('input:not([type="hidden"]), textarea'),"textarea"!==document.activeElement.tagName.toLowerCase()?t.eq(t.index(document.activeElement)+1).trigger("focus"):void 0},o.prototype.showSaving=function(){return this.ui.formSubmit.attr("aria-busy",!0)},o.prototype.hideSaving=function(){return this.ui.formSubmit.attr("aria-busy",!1)},o}(Mn.LayoutView)}),require.register("views/contacts/components/avatar",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.template=e("views/templates/contacts/components/avatar"),o.prototype.behaviors={PickAvatar:{}},o.prototype.ui=function(){return this.options.model.get("edit")?{avatar:".avatar"}:void 0},o.prototype.modelEvents={"change:n":"updateInitials","change:avatar":"render"},o.prototype.getInitialsColor=function(){return ColorHash.getColor(this.model.get("n"),"cozy")},o.prototype.serializeData=function(){return _.extend({},o.__super__.serializeData.apply(this,arguments),{bg:this.getInitialsColor()})},o.prototype.updateInitials=function(t,e){var o;return o=this.el.querySelector(".initials"),o?(o.innerHTML=this.model.get("initials"),o.style["background-color"]=this.getInitialsColor()):void 0},o}(Mn.ItemView)}),require.register("views/contacts/components/data",function(t,e,o){var a,n,r,i,s,l=function(t,e){function o(){this.constructor=t}for(var a in e)c.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},c={}.hasOwnProperty,d=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};r=e("views/contacts/components/datapoints"),s=e("views/contacts/components/xtras"),i=e("views/contacts/components/edit_actions"),a=e("config").contact,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return l(o,t),o.prototype.template=e("views/templates/contacts/components/data"),o.prototype.behaviors={Form:{}},o.prototype.ui={formAdd:".actions button"},o.prototype.modelEvents={change:function(){return this.model.get("edit")?void 0:this.render()}},o.prototype.childEvents={"form:key:enter":function(){return this.triggerMethod("form:key:enter")}},o.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},o.prototype.serializeData=function(){return _.extend({},o.__super__.serializeData.apply(this,arguments),{fullname:this.model.toString({pre:"",post:""})})},o.prototype._renderDatapoints=function(){return this.$(".datapoints").each(function(t){return function(e,o){var a;return a=o.dataset.type,t.addRegion(a,"[data-type='"+a+"']"),t.showChildView(a,new r({collection:t.model.getDatapoints(a),name:a,cardViewModel:t.model}))}}(this)),this.addRegion("xtras-infos",'[data-type="xtras-infos"]'),this.showChildView("xtras-infos",new s({model:this.model}))},o.prototype._renderEditActions=function(){return this.addRegion("actions",".actions"),this.showChildView("actions",new i({model:this.model}))},o.prototype.onRender=function(){return this._renderDatapoints(),this.model.get("edit")?this._renderEditActions():void 0},o.prototype.onDomRefresh=function(){return this.model.get("edit")?this.$('input:not([type="hidden"])').eq(1).trigger("focus"):void 0},o.prototype.onFormFieldAdd=function(t){var e;return e=this.getRegion("xtras").currentView,d.call(a.xtras,t)<0?e.addEmptyField(t):void 0},o}(Mn.LayoutView)}),require.register("views/contacts/components/datapoint",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=e("config").contact,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.tagName=function(){return this.options.cardViewModel.get("edit")?"div":"li"},o.prototype.className="group",o.prototype.attributes=function(){return{"data-cid":this.model.cid}},o.prototype.template=e("views/templates/contacts/components/datapoint"),o.prototype.ui={type:"input.type"},o.prototype.events=function(){return"xtras"===this.options.name?{"keyup @ui.type":_.debounce(this.updateType,250),"change @ui.type":this.updateType}:void 0},o.prototype.serializeData=function(){var t,e;return t=this.model.toJSON(),e=function(){switch(t.name){case"social":case"chat":return"social";case"url":return null!=t.mediatype&&t.mediatype.search(!0)?"share":"url";case"share":return"share";default:return"default"}}(),null==t.type&&(t.type=a.datapoints.types[e][0].split(":")[0]),{edit:this.options.cardViewModel.get("edit"),ref:this.options.cardViewModel.get("ref"),name:this.options.name,index:this.options.index,entity:e,point:t}},o.prototype.updateType=function(t){var e,o,n;return o=this.model.get("name"),"url"!==o&&"share"!==o?(e=_.find(a.datapoints.types.social,function(e){return e.match(new RegExp("^"+t.currentTarget.value.toLowerCase()))}),e?(n=e.split(":"),o=n[n.length-1]):o="other",this.$(t.currentTarget).siblings(".name").val(o)):void 0},o}(Mn.ItemView)}),require.register("views/contacts/components/datapoints",function(t,e,o){var a,n,r,i,s=function(t,e){function o(){this.constructor=t}for(var a in e)l.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},l={}.hasOwnProperty,c=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};i=e("lib/i18n"),n=e("views/contacts/components/datapoint"),a=e("config").contact,o.exports=r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.tagName=function(){return this.options.cardViewModel.get("edit")?"fieldset":"ul"},e.prototype.template=function(t){var e;return t.edit?(e=i("datapoints section "+t.name),""+e+""):void 0},e.prototype.behaviors={Form:{}},e.prototype.ui=function(){var t;return t={formInputs:"input, textarea",formDelete:"button.delete"},"xtras"!==this.options.name&&(t.formAutoAdd=".value"),t},e.prototype.childView=n,e.prototype.childViewOptions=function(t,e){return _.extend(_.pick(this.options,"name","cardViewModel"),{index:e})},e.prototype.initialize=function(){return this.options.cardViewModel.get("edit")?this._initializeEditMode():void 0},e.prototype.serializeData=function(){return{name:this.options.name,edit:this.options.cardViewModel.get("edit")}},e.prototype._initializeEditMode=function(){return"xtras"!==this.options.name?this.addEmptyField():void 0},e.prototype.onFormFieldAdd=function(t){return this.addEmptyField(t)},e.prototype.onFormFieldUpdate=function(t){var e,o,a;return e=this.$(t).parents("[data-cid]"),a=this.collection.get(e.data("cid")),o=_.reduce(e.find("input, textarea"),function(t,e){return t[_.last(e.name.split("."))]=e.value,t},{}),a.set(o)},e.prototype.onFormFieldDelete=function(t){return this.collection.remove(t)},e.prototype.getDatapoints=function(){return this.collection.filter(function(t){return!_.isEmpty(t.get("value"))})},e.prototype.addEmptyField=function(t){var e;return e=this.collection.add({type:void 0,value:"",name:t||this.options.name}),c.call(a.datapoints.main,t)>=0?void 0:this.$("[data-cid='"+e.cid+"'] input.value").trigger("focus")},e}(Mn.CompositeView)}),require.register("views/contacts/components/edit_actions",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]); -return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.tagName="dl",o.prototype.attributes={"aria-haspopup":!0,"aria-expanded":!1,"data-position":"top left"},o.prototype.template=e("views/templates/contacts/components/add_field_dropdown"),o.prototype.modelEvents={"change:bday":"render"},o}(Mn.ItemView)}),require.register("views/contacts/components/edit_tags",function(t,e,o){var a,n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=BackboneProjections.Filtered,r=e("views/contacts/components/tag"),o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,t),o.prototype.tagName="dl",o.prototype.attributes={"aria-haspopup":!0,"aria-expanded":!1,"data-position":"bottom right"},o.prototype.template=e("views/templates/contacts/components/edit_tags"),o.prototype.childView=r,o.prototype.childViewOptions=function(t){return{contactViewModel:this.model}},o.prototype.childViewContainer="ul",o.prototype.ui={tags:"li:not(.create) input",create:".create",dropdown:"dd"},o.prototype.events={"change @ui.tags":"onClickTag","click @ui.create button":"toggleCreate",'keydown @ui.create [name="name"]':"addNewTag","click @ui.dropdown":function(t){return t.stopPropagation()}},o.prototype.modelEvents={"change:tags":function(t){return this.toggleCreate(!1),this.children.invoke("render")}},o.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},o.prototype.onClickTag=function(t){var e;return e=this.$("li:not(.create) input").serializeArray().map(function(t){return function(e){return t.collection.get(e.value).get("name")}}(this)),this.triggerMethod("tags:update",e)},o.prototype.toggleCreate=function(t){return(_.isNull(t)||!_.isBoolean(t))&&(t="true"!==this.ui.create.attr("aria-expanded")),this.ui.create.attr("aria-expanded",t),this.ui.create.find('[name="name"]').val(""),t?this.ui.create.find('input[name="name"]').trigger("focus"):void 0},o.prototype.addNewTag=function(t){var e;return t.stopPropagation(),e=t.currentTarget.value,13!==t.which||_.isEmpty(e)?void 0:this.triggerMethod("tags:add",e)},o}(Mn.CompositeView)}),require.register("views/contacts/components/tag",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.tagName="li",o.prototype.template=e("views/templates/contacts/components/tag"),o.prototype.serializeData=function(){var t;return t=this.options.contactViewModel.get("tags"),_.extend({},o.__super__.serializeData.apply(this,arguments),{selected:_.includes(t,this.model.get("name"))})},o}(Mn.ItemView)}),require.register("views/contacts/components/xtras",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty,s=[].slice;a=e("config").contact,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.tagName=function(){return this.model.get("edit")?"fieldset":"ul"},o.prototype.template=e("views/templates/contacts/components/xtras"),o.prototype.modelEvents=function(){return _.reduce(a.xtras,function(t,e){return t["change:"+e]=function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],this.render.apply(this,t),this.setFocus.apply(this,t)},t},{})},o.prototype.serializeData=function(){return{edit:this.model.get("edit"),ref:this.model.get("ref"),xtras:_.reduce(a.xtras,function(t){return function(e,o){return t.model.has(o)&&(e[o]=t.model.get(o)),e}}(this),{})}},o.prototype.setFocus=function(t){var e,o;return o=this.model.get("ref"),e=_.keys(t.changed)[0],this.$("#"+e+"-"+o).trigger("focus")},o}(Mn.ItemView)}),require.register("views/contacts/index",function(t,e,o){var a,n,r,i,s,l,c=function(t,e){function o(){this.constructor=t}for(var a in e)d.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},d={}.hasOwnProperty;n=e("views/models/contact"),a=e("views/contacts/row"),i=Backbone.Collection,l=e("config").indexes,s=void 0,o.exports=r=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return c(o,t),o.prototype.sort=!1,o.prototype.tagName=function(){var t,o;return t=e("application").model,t.get("scored")?"ul":(null!=(o=this.model)?o.has("char"):void 0)?"dl":"div"},o.prototype.attributes=function(){var t,o;return t=e("application").model,t.get("scored")||(null!=(o=this.model)?o.has("char"):void 0)?{role:"rowgroup"}:void 0},o.prototype.template=e("views/templates/contacts"),o.prototype.events=function(){return null==this.model?{'change [type="checkbox"]':"updateBulkSelection"}:void 0},o.prototype.attachElContent=function(t){return this.el.innerHTML=t,this},o.prototype.attachBuffer=function(t,e){var o,a;return a=Mn._getValue(this.childViewContainer,this),o=_.isString(a)?this.el.querySelector(a):this.el,o.appendChild(e)},o.prototype.buildChildView=function(t){var e;return new(e=this._hasContacts?a:this.constructor)({model:t})},o.prototype.showCollection=function(){var t,e,o;return e=0,o=this._getModels(),setTimeout(t=function(a){return function(){var n,r;return n=o[e],o.length&&n?(r=a.buildChildView(n),a._updateIndices(r,!0,e),a.children.add(r),a.renderChildView(r,e),r._parent=a,e++,setTimeout(t)):a.trigger("show:collection")}}(this))},o.prototype._createBuffer=function(){return document.createDocumentFragment()},o.prototype._onCollectionRemove=function(t){var e,o;return e=t.model,o=this.children.find(function(t){return t.model.model===e}),this.removeChildView(o),this.checkEmpty(),this.toggleEmpty()},o.prototype._onCollectionAdd=function(t,e,o){var a;return this.destroyEmptyView(),a=this.getChildView(t),this.addChild(t,a,o.index),this.toggleEmpty()},o.prototype._getModels=function(){var t;return t="scored"===this._mode?s.get():this._hasContacts?s.get({index:this.model.get("char")}):this.collection.models},o.prototype.initialize=function(){var t,o,a,n;return a=e("application"),o=a.model,s=a.filtered,this._mode=o.get("scored")?"scored":"indexed",this._hasContacts=(null!=(n=this.model)?n.has("char"):void 0)||"scored"===this._mode,this._hasContacts&&"indexed"===this._mode?(t=this.model.get("char"),this.collection=Backbone.Radio.channel("idx."+t),this.childViewContainer="ul"):"indexed"!==this._mode||this._hasContacts||(this.collection=new i(Array.prototype.map.call(l,function(t){return{"char":t}})),this.once("show:collection",function(){return e("application").channel.trigger("busy:disable")})),this._hasContacts&&(this.sort=!0,this.listenTo(this.collection,{reset:this.updateTagClasses,update:this.updateTagClasses,"change:tags":this.updateTagClasses})),"scored"===this._mode&&this.listenTo(o,{"change:filter":function(){return this.children.invoke("highlight")}}),"indexed"===this._mode?this.listenTo(o,{"change:scored":this.toggleEvents}):void 0},o.prototype.toggleEvents=function(t,e){return e?(this.stopListening(this.collection,"add"),this.stopListening(this.collection,"remove"),this.stopListening(this.collection,"reset"),this._hasContacts?this.stopListening(this.collection,"sort"):void 0):setTimeout(function(t){return function(){return t._initialEvents(),t.updateTagClasses()}}(this))},o.prototype.toggleEmpty=function(){return this.el.classList.toggle("empty",!this._getModels().length)},o.prototype.updateTagClasses=function(){var t,e;return e=_.chain(s.get({index:null!=(t=this.model)?t.get("char"):void 0})).invoke("get","tags").flatten().compact().map(function(t){return"tag_"+t}).join(" ").value(),e.length?this.el.className=e:this.el.removeAttribute("class"),this.toggleEmpty()},o.prototype.updateBulkSelection=function(t){var e,o,a;return a=t.currentTarget.checked,e=t.currentTarget.value,o=a?"contacts:select":"contacts:unselect",this.triggerMethod(o,e)},o.prototype.onRender=o.prototype.updateTagClasses,o}(Mn.CompositeView)}),require.register("views/contacts/merge",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;n=e("lib/i18n"),o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.template=e("views/templates/contacts/merge"),o.prototype.tagName="section",o.prototype.className="merge",o.prototype.attributes={role:"alertdialog"},o.prototype.behaviors={Dialog:{},Form:{}},o.prototype.ui={formSubmit:'[type="submit"]',formInputs:"input",cancel:".cancel"},o.prototype.modelEvents={"contacts:merge":"onClose"},o.prototype.events={"click @ui.cancel":"onCancel"},o.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},o.prototype.serializeData=function(){return{model:this.model.toJSON()}},o.prototype.onDomRefresh=function(){return _.defer(function(t){return function(){return t.$el.attr("aria-busy",!0)}}(this))},o.prototype.onFormSubmit=function(){return this.model.merge(),this.onClose()},o.prototype.onCancel=function(){return this.model.trigger("contacts:merge",this.model,"abort")},o.prototype.onClose=function(){return e("application").layout.alerts.empty()},o}(Mn.ItemView)}),require.register("views/contacts/row",function(t,e,o){var a,n,r,i=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e){function o(){this.constructor=t}for(var a in e)l.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},l={}.hasOwnProperty,c=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};n=e("config").search.pattern("text"),r=void 0,o.exports=a=function(t){function o(){return this.lazyLoadAvatar=i(this.lazyLoadAvatar,this),o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.supportsRenderLifecycle=!1,o.prototype.tagName="li",o.prototype.attributes={role:"row"},o.prototype._format={pre:"",post:""},o.prototype._isAvatarLoaded=!1,o.prototype.initialize=function(){return r=e("application"),this.listenTo(this.model,{change:this.render}),this.listenTo(r.model,{"change:selected":this.refreshChecked})},o.prototype.render=function(){var t,o,a,n;return o=this.el,t=this.serializeData(),o.className=null!=(a=this.model.get("tags"))?a.map(function(t){return"tag_"+t}).join(" "):void 0,n=e("views/templates/contacts/row"),o.innerHTML=n(t),window.requestAnimationFrame(this.lazyLoadAvatar),this.highlight()},o.prototype.serializeData=function(){var t;return _.extend(this.model.toJSON(),{selected:(t=this.model.id,c.call(r.model.get("selected"),t)>=0),fullname:this.model.toString(this._format),isAvatarLoaded:this._isAvatarLoaded})},o.prototype.highlight=function(){var t,e,o;return(t=null!=(o=r.model.get("filter"))?o.match(n):void 0)?(e=this.model.toHighlightedString(t[1],{pre:'',post:"",format:this._format}),this.el.querySelector(".name p").innerHTML=e):void 0},o.prototype.refreshChecked=function(t,e){var o;return this.$('[type="checkbox"]').prop("checked",(o=this.model.id,c.call(e,o)>=0))},o.prototype.lazyLoadAvatar=function(){var t,e,o,a;if(!this._isAvatarLoaded)return t=document.documentElement,e=this.el.querySelector("img.avatar"),a=this.el.getBoundingClientRect(),o=a.top<=(window.innerHeight||t.clientHeight),o&&e?(e.setAttribute("src",e.dataset.src),this._isAvatarLoaded=!0):window.requestAnimationFrame(this.lazyLoadAvatar)},o}(Backbone.View)}),require.register("views/duplicates/index",function(t,e,o){var a,n,r,i,s=function(t,e){function o(){this.constructor=t}for(var a in e)l.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},l={}.hasOwnProperty;n=e("collections/duplicates"),i=e("lib/i18n"),a=e("config").contact,o.exports=r=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.template=e("views/templates/duplicates"),o.prototype.tagName="section",o.prototype.className="duplicates",o.prototype.attributes={role:"dialog"},o.prototype.childViewContainer='[role="grid"]',o.prototype.childView=e("views/duplicates/row"),o.prototype.templateHelpers=function(){return{size:this.toMerge.size()}},o.prototype.behaviors={Dialog:{}},o.prototype.collectionEvents={"contacts:merge":"render"},o.prototype.render=function(){return o.__super__.render.apply(this,arguments),$($("nav a").get(1)).attr("aria-busy",!1)},o.prototype.initialize=function(){var t;return t=e("application").contacts,this.collection=new n(null,{collection:t}),this.toMerge=new BackboneProjections.Filtered(this.collection,{filter:function(t){return t.isMergeable()}}),this.bindEntityEvents(this.collection,this.getOption("collectionEvents"))},o}(Mn.CompositeView)}),require.register("views/duplicates/row",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};a=e("views/models/contact"),o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.template=e("views/templates/duplicates/row"),o.prototype.tagName=function(){return this.model.has("result")?"div":"dl"},o.prototype.className=function(){return this.model.has("result")?"merged":""},o.prototype.attributes=function(){return{role:this.model.has("result")?"row":"rowgroup"}},o.prototype.ui={submit:'[type="submit"]',dismiss:".cancel"},o.prototype.modelEvents={change:"render","contacts:merge":"onContactsMerge"},o.prototype.events={"click @ui.submit":"merge",'click [type="checkbox"]':"check","click @ui.dismiss":"dismiss"},o.prototype.serializeData=function(){var t;return t=this.model.has("result")?new a({"new":!1},{model:this.model.get("result")}):void 0,_.extend(o.__super__.serializeData.apply(this,arguments),{candidates:this.model.get("candidates").map(function(t){return new a({"new":!1},{model:t})}),selected:this.model.get("candidates").map(function(t){return function(e){return s.call(t.model.get("toMerge"),e)>=0}}(this)),isMergeable:this.model.isMergeable(),result:t,merging:this.merging})},o.prototype.check=function(t){var e;return e=$(t.target),this.model.selectCandidate(e.val(),e.is(":checked"))},o.prototype.dismiss=function(){return this.model.collection.remove(this.model)},o.prototype.onContactsMerge=function(){return this.merging=!1,this.render()},o.prototype.merge=function(){var t,o,a;return this.triggerMethod("merge"),this.merging=!0,this.$("button, input").prop("disabled",!0),_.defer(function(t){return function(){return t.ui.submit.attr("aria-busy",!0)}}(this)),a=this.model.buildMergeOptions(),0===Object.keys(a).length?this.model.merge():(t=e("views/contacts/merge"),o=e("application").layout,o.showChildView("alerts",new t({model:this.model})))},o}(Mn.ItemView)}),require.register("views/labels/edit",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=BackboneProjections.Filtered,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.template=e("views/templates/labels/edit"),o.prototype.tagName="fieldset",o.prototype.childViewContainer="ul",o.prototype.childView=e("views/labels/filter"),o.prototype.childViewOptions={edit:!0},o.prototype.childEvents={"tags:bulkupdate":"applyBulkTag"},o.prototype.modelEvents={"change:selected":"render"},o.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},o.prototype.applyBulkTag=function(t){var e,o,a;return a=t.model.get("name"),o=t.ui.checkbox.attr("aria-checked"),e="true"===o?!1:"false"===o||"mixed"===o?!0:void 0,this.triggerMethod("bulk:tag",a,e)},o}(Mn.CompositeView)}),require.register("views/labels/filter",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};n=void 0,o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.template=e("views/templates/labels/filter"),o.prototype.tagName="li",o.prototype.ui={checkbox:'[data-input="checkbox"]'},o.prototype.triggers={"click @ui.checkbox":{event:"tags:bulkupdate",preventDefault:!0,stopPropagation:!0}},o.prototype.initialize=function(){return n=e("application"),this.listenTo(n.contacts,{"change:tags":this.render})},o.prototype.serializeData=function(){var t,e,a,r,i,l;return e=this.model.get("name"),a=new RegExp("tag:"+e,"i"),this.options.edit?(l=n.model.get("selected"),t=l.reduce(function(t,o){var a;return a=n.contacts.get(o),s.call(a.get("tags"),e)>=0?t.concat(a):t},[]),i=0===t.length?!1:t.length===l.length?!0:"mixed"):i=!!(null!=(r=n.model.get("filter"))?r.match(a):void 0),_.extend({},o.__super__.serializeData.apply(this,arguments),{selected:i,edit:this.options.edit})},o}(Mn.ItemView)}),require.register("views/labels/index",function(e,o,a){var n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=BackboneProjections.Filtered,a.exports=r=function(e){function a(){return a.__super__.constructor.apply(this,arguments)}return i(a,e),a.prototype.template=o("views/templates/labels/index"),a.prototype.tagName="fieldset",a.prototype.ui={navigate:"a"},a.prototype.behaviors={Navigator:{}},a.prototype.childViewContainer="ul",a.prototype.childView=o("views/labels/filter"),a.prototype.initialize=function(){var t;return t=o("application"),this.listenTo(t.channel,{"filter:tag":this.toggleSelected})},a.prototype.serializeData=function(){return{name:t("tools labels filters all"),href:"contacts",selected:-1===(this.model.get("filter")||"").indexOf("tag:")}},a.prototype.toggleSelected=function(t){var e;return e=t?"[href$='/"+t+"']":":first",this.$("a:not("+e+")").attr("aria-checked",!1).find("input").prop("checked",!1),this.$("a"+e).attr("aria-checked",!0).find("input").prop("checked",!0)},a}(Mn.CompositeView)}),require.register("views/models/app",function(e,o,a){var n,r,i,s,l,c=function(t,e){function o(){this.constructor=t}for(var a in e)d.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},d={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};i=o("views/contacts/merge"),r=o("views/models/merge"),l=o("lib/request"),s=void 0,a.exports=n=function(e){function a(){return a.__super__.constructor.apply(this,arguments)}return c(a,e),a.prototype.defaults={dialog:!1,filter:void 0,scored:!1,errors:void 0},a.prototype.viewEvents={"settings:sort":"updateSortSetting","settings:upload":"onUploadFile","select:all":"selectAll","select:none":"unselectAll","bulk:delete":"bulkDelete","bulk:export":function(){return this.bulkExport()},"bulk:merge":"bulkMerge","bulk:tag":"bulkTag","contacts:export":function(){return this.bulkExport(!0)}},a.prototype.initialize=function(){return s=o("application"),this.set("selected",[]),this.listenTo(this,"change:filter",function(t,e){return this.unselectAll(),this.set("scored",o("config").search.pattern("text").test(e))})},a.prototype.select=function(t){var e;return e=_.clone(this.get("selected")),_.isEmpty(e)&&this.trigger("select:start"),e.push(t),this.set({selected:e},{silent:!0}),this.trigger("change:selected",this,e)},a.prototype.unselect=function(t){var e;return e=_.clone(this.get("selected")),e=_.without(e,t),this.set({selected:e}),_.isEmpty(e)?this.trigger("select:end"):void 0},a.prototype.selectAll=function(){var t;return _.isEmpty(this.get("selected"))&&this.trigger("select:start"),t=s.filtered.get({tagged:!0}).map(function(t){return t.id}),this.set({selected:t})},a.prototype.unselectAll=function(){return this.set({selected:[]}),this.trigger("select:end")},a.prototype.bulkDelete=function(){var e;return e=this.attributes.selected,s.contacts.contactListener.disable(),l.post("contacts/bulk-delete",e,function(o){return function(a,n){return a?(console.log(a),alert(t("contacts delete bulk error"))):(s.contacts.remove(e,{sort:!1}),o.set({selected:[]}),setTimeout(s.contacts.contactListener.enable,1500),o.trigger("bulk:delete:done"))}}(this))},a.prototype.bulkMerge=function(){var t,e,o;return t=s.contacts.filter(function(t){return function(e){var o;return o=e.id,u.call(t.attributes.selected,o)>=0}}(this)),o=new r({candidates:t}),e=o.buildMergeOptions(),o.on("contacts:merge",function(t){return function(e,a){return t.unselectAll(),"abort"!==a?t.select(o.get("result").id):void 0}}(this)),0===Object.keys(e).length?o.merge():s.layout.showChildView("alerts",new i({model:o}))},a.prototype.bulkTag=function(t,e){return this.get("selected").forEach(function(o){var a,n;return a=s.contacts.get(o),n=_.clone(a.get("tags")),e?n.push(t):_.pull(n,t),a.save({tags:n})})},a.prototype.bulkExport=function(t){var e,o,a,n;return a=this.attributes.selected,e=t?s.contacts.size():a.length,n=[],o=_.after(e,function(){var t,e;return e=moment().format("YYYYMMDD"),t=new Blob(n,{type:"text/plain;charset=utf-8"}),saveAs(t,e+"_cozy_contacts_"+n.length+".vcf")}),s.contacts.chain().filter(function(e){var o;return t||(o=e.id,u.call(a,o)>=0)}).invoke("toVCF",function(t){return n.push(t),o()}).value()},a.prototype.updateSortSetting=function(t){return this.model.save("sort",t)},a.prototype.onUploadFile=function(t){var e;return/.+\.(vcf|vcard)$/i.test(t.name)?(this.trigger("before:import"),e=new FileReader,e.readAsText(t),e.onloadend=function(t){return function(){var o,a;return a=e.result,o=/^BEGIN:VCARD/,o.test(a)?s.contacts.importFromVCF(a):t.set("errors",{upload:"error upload wrong filetype"})}}(this)):this.set("errors",{upload:"error upload wrong filetype"})},a}(Backbone.ViewModel)}),require.register("views/models/contact",function(t,e,o){var a,n,r,i,s,l=function(t,e){function o(){this.constructor=t}for(var a in e)c.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},c={}.hasOwnProperty,d=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};i=BackboneProjections.Filtered,n=e("config").contact,a=e("lib/contact_helper"),s=null,o.exports=r=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return l(o,t),o.prototype.defaults={"new":!1,edit:!1},o.prototype.map={avatar:"_attachments",name:"n"},o.prototype.events={"before:save":"syncDatapoints",save:"onSave",reset:"onReset"},o.prototype.viewEvents={"edit:cancel":"reset","tags:update":"updateTags","tags:add":"addNewTag","form:field:add":"onAddField","form:submit":_.ary(o.prototype.save,0),"export":"downloadAsVCF","delete":_.ary(o.prototype.destroy,0)},o.prototype.proxy=["toString","toHighlightedString","match"],o.prototype.initialize=function(){return s=e("application"),this._setRef(),this.getDatapoints=_.memoize(this.getDatapoints,function(t){return this.attributes.edit?"edit-"+t:t}),this.listenTo(this,"change:edit",function(t,e){var o,a,n;if(e){o=this.getDatapoints.cache,n=[];for(a in o)/^edit/.test(a)&&n.push(delete o[a]);return n}})},o.prototype.toJSON=function(){var t;return t=o.__super__.toJSON.apply(this,arguments),delete t.datapoints,t.xtras=this.getDatapoints("xtras").toJSON(),_.reduce(n.datapoints.main,function(t){return function(e,o){return e[o]=t.getDatapoints(o).toJSON(),e}}(this),t)},o.prototype.getMappedAvatar=function(t){return(null!=t?t.picture:void 0)?"contacts/"+this.model.id+"/picture.png?revpos="+t.picture.revpos:null},o.prototype.saveMappedAvatar=function(){var t,e;return t={},e=this.get("avatar"),null!=e&&null==e.match(/contacts\/.+\/picture.png/)&&(t.avatar=e.split(",")[1]),t},o.prototype.getMappedName=function(t){var e,o,a,n,r,i,s;return i=t.split(";"),o=i[0],e=i[1],a=i[2],r=i[3],s=i[4],n={first:e,given:o},a&&(n.middle=a),r&&(n.prefix=r),s&&(n.suffix=s),n},o.prototype.saveMappedName=function(){var t,e;return e=_.clone(this.get("name")),(t={}).n=[e.given,e.first,e.middle,e.prefix,e.suffix].join(";"),t},o.prototype._setRef=function(){return this.set("ref",this.model.cid)},o.prototype.getIndexKey=function(){var t,e,o;return o="fn"===s.model.get("sort")?0:1,t=(null!=(e=this.get("initials")[o])?e.toLowerCase():void 0)||"",/[a-z]/.test(t)?t:"#"},o.prototype.onAddField=function(t){return d.call(n.xtras,t)>=0?this.set(t,""):void 0},o.prototype.getDatapoints=function(t){var e,o;return e=function(e){var o;return d.call(n.datapoints.main,t)>=0?e.get("name")===t:(o=e.get("name"),d.call(n.datapoints.main,o)<0)},this.attributes.edit?(o=this.model.get("datapoints").filter(e).map(function(t){return t.clone()}),new Backbone.Collection(o)):new i(this.model.get("datapoints"),{filter:e})},o.prototype.syncDatapoints=function(){var t,e,o,n,r,i;t=this.getDatapoints.cache,o=this.model.get("datapoints"),r=[],i=t.__data__;for(n in i)e=i[n],/^edit/.test(n)&&(r=r.concat(a.getNonEmptyDatapoints(e)));return o.reset(r)},o.prototype.updateTags=function(t){return null!=this.model.id?this.model.save({tags:t}):this.model.set({tags:t})},o.prototype.addNewTag=function(t){var e,o;return e=s.contacts,o=s.tags,o.create({name:t},{wait:!0,success:function(e){return function(){return o=_.clone(e.model.get("tags")).concat(t),e.updateTags(o)}}(this)})},o.prototype.onSave=function(){return this.get("new")?s.contacts.add(this.model):void 0},o.prototype.onReset=function(){return this._setRef()},o.prototype.downloadAsVCF=function(){var t;return t=this.model.get("fn"),this.model.toVCF(function(e){var o;return o=new Blob([e],{type:"text/plain;charset=utf-8"}),saveAs(o,t+".vcf")})},o}(Backbone.ViewModel)}),require.register("views/models/merge",function(t,e,o){var a,n,r,i,s,l,c=function(t,e){function o(){this.constructor=t}for(var a in e)d.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},d={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};r=e("models/contact"),s=e("views/models/contact"),n=e("lib/compare_contacts"),i=e("lib/contact_helper"),a=["org","title","department","bday","nickname"],o.exports=l=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return c(o,t),o.prototype.initialize=function(t){return null!=t.candidates?this.set("toMerge",t.candidates.slice(0)):void 0},o.prototype.selectCandidate=function(t,e){return e?this.isCandidateSelected(t)||this.attributes.toMerge.push(this.get("candidates")[t]):this.unselectCandidate(t),this.trigger("change",this)},o.prototype.unselectCandidate=function(t){return this.attributes.toMerge=this.attributes.toMerge.filter(function(e){return function(o){return o!==e.get("candidates")[t]}}(this))},o.prototype.isCandidateSelected=function(t){var e;return e=this.get("candidates")[t],u.call(this.get("toMerge"),e)>=0},o.prototype.toMergeAsJson=function(){return this.get("toMerge").map(function(t){return t.toJSON()})},o.prototype.isMergeable=function(){return!this.has("result")&&this.get("toMerge").length>1},o.prototype.buildMergeOptions=function(){var t,e,o,n,r,i;for(r={},e=a.concat(["avatar","fullname"]),o=0,n=e.length;n>o;o++)t=e[o],i=[],this.get("toMerge").forEach(function(e,o){var a,n;return n="avatar"===t?e.has("_attachments")?"contacts/"+e.get("id")+"/picture.png":null:"fullname"===t?e.toString({pre:"",post:""}):e.get(t),a=function(t){return t.value===n},null==n||""===n||i.some(a)?void 0:i.push({value:n,index:o})}),i.length>0&&this.set(t,i[0].index),i.length>1&&(r[t]=i);return this.set("mergeOptions",r),r},o.prototype.merge=function(t){var e,o,s,l,c,d,u,p,m;if(p=this.toMergeAsJson(),p.length<=1)return t(new Error("not enought contact to merge."));for(d={datapoints:[],tags:[]},p.forEach(function(t){return n.mergeContacts(d,t)}),delete d._id,delete d.id,delete d.revision,delete d._rev,delete d._attachments,s=a,this.has("fullname")&&(this.set("n",this.get("fullname")),this.set("fn",this.get("fullname")),s=s.concat(["n","fn"])),l=0,c=s.length;c>l;l++)o=s[l],this.has(o)&&(d[o]=p[this.get(o)][o]);return u=new r(d,{parse:!0}),e=function(e){return function(o){return o?t(o):(e.listenToOnce(u,"sync",e.afterSyncResult.bind(e)),u.save(),null!=t?t():void 0)}}(this),this.has("avatar")?(m="contacts/"+p[this.get("avatar")].id+"/picture.png",i.imgUrl2DataUrl(m,function(t,o){return u.set("avatar",o.split(",")[1]),e(t)})):e()},o.prototype.afterSyncResult=function(t){return async.each(this.get("toMerge"),function(t,e){return t.destroy({success:function(){return e()},error:function(t,o,a){return e(o)}})},function(o){return function(a){var n;return a?(console.error(a),o.trigger("contacts:merge",o,a)):(o.attributes.toMerge=[],o.attributes.candidates=[],o.set("result",t),o.trigger("contacts:merge",o,null)),n=e("application").contacts,n.add(t,{sort:!1})}}(this))},o}(Backbone.ViewModel)}),require.register("views/settings/index",function(t,e,o){var a,n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=e("config").settings,r=e("lib/i18n"),o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,t),o.prototype.template=e("views/templates/settings"),o.prototype.tagName="section",o.prototype.className="settings",o.prototype.attributes={role:"dialog"},o.prototype.behaviors={Dialog:{}},o.prototype.ui={sort:'[name="sort"]',"import":"button.import",upload:'[type="file"]',"export":'[formaction="contacts/export"]',feedback:".feedback"},o.prototype.triggers={"click @ui.export":"contacts:export"},o.prototype.events={"change @ui.sort":"updateSort","click @ui.import":"triggerUploader","change @ui.upload":"onUploadFile"},o.prototype.modelEvents={"change:errors":"render","before:import":"onBeforeImport"},o.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents),this.listenTo(e("application").contacts,{"before:import:progress":this.onBeforeImportProgress,"import:progress":this.onProgressImport,"import":this.onProgressEnd})},o.prototype.serializeData=function(){return _.extend({},o.__super__.serializeData.apply(this,arguments),n,{locale:e("imports").locale})},o.prototype.updateSort=function(t){return t.preventDefault(),t.stopPropagation(),this.triggerMethod("settings:sort",t.currentTarget.value)},o.prototype.triggerUploader=function(t){return t.preventDefault(),t.stopPropagation(),this.ui.upload.trigger("click")},o.prototype.onUploadFile=function(t){return t.preventDefault(),t.stopPropagation(),this.triggerMethod("settings:upload",t.currentTarget.files[0])},o.prototype.onBeforeImport=function(){return this.ui["import"].prop("disabled",!0),this.ui.feedback.empty()},o.prototype.onBeforeImportProgress=function(t){var e;return this.ui.progress=$("",{max:t,value:0}),this.ui.counter=$("",{text:0}),e=$("
",{text:"/"+t}).prepend(this.ui.counter),this.ui.progress.appendTo(this.ui.feedback),e.appendTo(this.ui.feedback)},o.prototype.onProgressImport=function(t){return this.ui.progress.val(t),this.ui.counter.text(t)},o.prototype.onProgressEnd=function(t){ -return this.ui.feedback.empty().text(r("settings in-out import result",{smart_count:t})),this.ui["import"].prop("disabled",!1)},o}(Mn.ItemView)}),require.register("views/templates/contacts/card",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e,n,r,i,s){a.push('
'),n&&function(){var t=i;if("number"==typeof t.length)for(var e=0,o=t.length;o>e;e++){var n=t[e];a.push(""),function(){var t=n;if("number"==typeof t.length)for(var e=0,o=t.length;o>e;e++){var r=t[e],i=r.split(":");a.push("")}else{var o=0;for(var e in t){o++;var r=t[e],i=r.split(":");a.push("")}}}.call(this),a.push("")}else{var o=0;for(var e in t){o++;var n=t[e];a.push(""),function(){var t=n;if("number"==typeof t.length)for(var e=0,o=t.length;o>e;e++){var r=t[e],i=r.split(":");a.push("")}else{var o=0;for(var e in t){o++;var r=t[e],i=r.split(":");a.push("")}}}.call(this),a.push("")}}}.call(this),a.push('
')}.call(this,"_id"in n?n._id:"undefined"!=typeof _id?_id:void 0,"edit"in n?n.edit:"undefined"!=typeof edit?edit:void 0,"id"in n?n.id:"undefined"!=typeof id?id:void 0,"lists"in n?n.lists:"undefined"!=typeof lists?lists:void 0,"undefined"in n?n.undefined:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/components/add_field_dropdown",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e){a.push('
'+jade.escape(null==(o=t("card actions add select"))?"":o)+'
    '),null==e&&a.push('
  • "),a.push('
")}.call(this,"bday"in n?n.bday:"undefined"!=typeof bday?bday:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/components/avatar",function(t,e,o){var a=function(t){var e,o=[],a=t||{};return function(t,a,n){t?o.push("'):o.push("'+jade.escape(null==(e=n)?"":e)+"")}.call(this,"avatar"in a?a.avatar:"undefined"!=typeof avatar?avatar:void 0,"bg"in a?a.bg:"undefined"!=typeof bg?bg:void 0,"initials"in a?a.initials:"undefined"!=typeof initials?initials:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/contacts/components/data",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e,r,i,s,l,c,d,u,p,m){n.formatJob=o=function(t,e,n){this&&this.block,this&&this.attributes||{};t&&a.push(jade.escape(null==(o=t)?"":o)),t&&e&&a.push(" - "),e&&a.push(jade.escape(null==(o=e)?"":o)),(e&&n||t&&n)&&a.push(" "),n&&a.push("("+jade.escape(null==(o=n)?"":o)+")")},n.input=o=function(e,n){var r=(this&&this.block,this&&this.attributes||{}),i=t("datapoint label "+e.replace("."," ")),s=[e,d].join("-"),l=r.placeholder?t("datapoint placeholder "+e):!1,c=r.value;a.push("'+jade.escape(null==(o=i)?"":o)+""),"textarea"==n?a.push("'+jade.escape(null==(o=c)?"":o)+""):a.push("'),a.push("")},r?(n.input.call({attributes:{value:jade.escape(s.prefix)}},"name.prefix"),n.input.call({attributes:{value:jade.escape(s.first)}},"name.first"),n.input.call({attributes:{value:jade.escape(s.middle)}},"name.middle"),n.input.call({attributes:{value:jade.escape(s.given)}},"name.given"),n.input.call({attributes:{value:jade.escape(s.suffix)}},"name.suffix"),a.push('
'),n.input.call({attributes:{value:jade.escape(c),placeholder:!0}},"org"),n.input.call({attributes:{value:jade.escape(e),placeholder:!0}},"department"),n.input.call({attributes:{value:jade.escape(p),placeholder:!0}},"title"),a.push("
")):(a.push("

"+(null==(o=i)?"":o)+'

    '),function(){var t=u;if("number"==typeof t.length)for(var e=0,n=t.length;n>e;e++){var r=t[e];a.push("
  • "+jade.escape(null==(o=r)?"":o)+"
  • ")}else{var n=0;for(var e in t){n++;var r=t[e];a.push("
  • "+jade.escape(null==(o=r)?"":o)+"
  • ")}}}.call(this),a.push('
    '),(p||c||e||l)&&((p||c||e)&&(a.push("
  • "),n.formatJob(p,c,e),a.push("
  • ")),l&&a.push("
  • "+jade.escape(null==(o=l)?"":o)+"
  • ")),a.push("
")),a.push('
'),r&&n.input.call({attributes:{value:jade.escape(l)}},"note","textarea"),a.push("
"),r&&a.push('
')}.call(this,"department"in r?r.department:"undefined"!=typeof department?department:void 0,"edit"in r?r.edit:"undefined"!=typeof edit?edit:void 0,"fullname"in r?r.fullname:"undefined"!=typeof fullname?fullname:void 0,"name"in r?r.name:"undefined"!=typeof name?name:void 0,"note"in r?r.note:"undefined"!=typeof note?note:void 0,"org"in r?r.org:"undefined"!=typeof org?org:void 0,"ref"in r?r.ref:"undefined"!=typeof ref?ref:void 0,"tags"in r?r.tags:"undefined"!=typeof tags?tags:void 0,"title"in r?r.title:"undefined"!=typeof title?title:void 0,"undefined"in r?r.undefined:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/components/datapoint",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e,r,i,s,l,c){n.formatPoint=o=function(t,e){this&&this.block,this&&this.attributes||{};if(e)switch(t.type.toLowerCase()){case"home":var e="home";break;case"work":var e="building";break;default:switch(t.name){case"tel":var e="phone";break;case"email":var e="envelope";break;default:var e=!1}}a.push(""+jade.escape(null==(o=t.type)?"":o)+' '+(null==(o=t.value.replace(/\n/g,"
"))?"":o)+"
")},n.groupInput=o=function(e,n,i){var s=(this&&this.block,this&&this.attributes||{}),l=s.placeholder?t("datapoint placeholder "+("default"==r?e.name:r)):!1,d=n+"."+i;a.push("'),"adr"==n?a.push(""+jade.escape(null==(o=e.value)?"":o)+""):a.push(""),a.push('')},e?n.groupInput.call({attributes:{placeholder:!0}},l,s,i):n.formatPoint(l)}.call(this,"edit"in r?r.edit:"undefined"!=typeof edit?edit:void 0,"entity"in r?r.entity:"undefined"!=typeof entity?entity:void 0,"index"in r?r.index:"undefined"!=typeof index?index:void 0,"name"in r?r.name:"undefined"!=typeof name?name:void 0,"point"in r?r.point:"undefined"!=typeof point?point:void 0,"ref"in r?r.ref:"undefined"!=typeof ref?ref:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/components/edit_tags",function(e,o,a){var n=function(e){var o,a=[];return a.push('
'+jade.escape(null==(o=t("card actions labels"))?"":o)+'
'+jade.escape(null==(o=t("card actions labels add"))?"":o)+'
    "),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/components/tag",function(t,e,o){var a=function(t){var e,o=[],a=t||{};return function(t,a,n){var r=t.slice(-6);o.push("'+jade.escape(null==(e=a)?"":e)+"")}.call(this,"_id"in a?a._id:"undefined"!=typeof _id?_id:void 0,"name"in a?a.name:"undefined"!=typeof name?name:void 0,"selected"in a?a.selected:"undefined"!=typeof selected?selected:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/contacts/components/xtras",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e,r,i,s){n.formatPoint=o=function(t,e){this&&this.block,this&&this.attributes||{};if(e)switch(t.type.toLowerCase()){case"home":var e="home";break;case"work":var e="building";break;default:switch(t.name){case"tel":var e="phone";break;case"email":var e="envelope";break;default:var e=!1}}a.push(""+jade.escape(null==(o=t.type)?"":o)+' '+(null==(o=t.value.replace(/\n/g,"
    "))?"":o)+"
    ")},n.input=o=function(e,n){var i=(this&&this.block,this&&this.attributes||{}),s=t("datapoint label "+e.replace("."," ")),l=[e,r].join("-"),c=i.placeholder?t("datapoint placeholder "+e):!1,d=i.value;a.push("'+jade.escape(null==(o=s)?"":o)+""),"textarea"==n?a.push("'+jade.escape(null==(o=d)?"":o)+""):a.push("'),a.push("")},function(){var o=s;if("number"==typeof o.length)for(var r=0,i=o.length;i>r;r++){var l=o[r];if(e)n.input.call({attributes:{value:jade.escape(l),placeholder:!0}},r,"text");else{var c={type:t("datapoint label "+r),value:l};a.push('
  • '),n.formatPoint(c),a.push("
  • ")}}else{var i=0;for(var r in o){i++;var l=o[r];if(e)n.input.call({attributes:{value:jade.escape(l),placeholder:!0}},r,"text");else{var c={type:t("datapoint label "+r),value:l};a.push('
  • '),n.formatPoint(c),a.push("
  • ")}}}}.call(this)}.call(this,"edit"in r?r.edit:"undefined"!=typeof edit?edit:void 0,"ref"in r?r.ref:"undefined"!=typeof ref?ref:void 0,"undefined"in r?r.undefined:void 0,"xtras"in r?r.xtras:"undefined"!=typeof xtras?xtras:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/helpers",function(t,e,o){var a=function(t){var e=[];return e.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/contacts/index",function(t,e,o){var a=function(t){var e,o=[],a=t||{};return function(t){t&&o.push('
    '+jade.escape(null==(e=t)?"":e)+"
      ")}.call(this,"char"in a?a["char"]:"undefined"!=typeof char?char:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/contacts/merge",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e){n.radio=o=function(t,n){this&&this.block,this&&this.attributes||{};a.push(""),function(){var r=t;if("number"==typeof r.length)for(var i=0,s=r.length;s>i;i++){var l=r[i],c=l.index,d=["merge",n,c].join("-"),u=e[n]==c;a.push("
    • "),"avatar"==n?a.push('"):(a.push('"),"fullname"==n?a.push(null==(o=l.value)?"":o):a.push(jade.escape(null==(o=l.value)?"":o)),a.push("")),a.push("
    • ")}else{var s=0;for(var i in r){s++;var l=r[i],c=l.index,d=["merge",n,c].join("-"),u=e[n]==c;a.push("
    • "),"avatar"==n?a.push('"):(a.push('"),"fullname"==n?a.push(null==(o=l.value)?"":o):a.push(jade.escape(null==(o=l.value)?"":o)),a.push("")),a.push("
    • ")}}}.call(this),a.push("")},a.push('
      '),n.radio=o=function(t,n){this&&this.block,this&&this.attributes||{};a.push(""),function(){var r=t;if("number"==typeof r.length)for(var i=0,s=r.length;s>i;i++){var l=r[i],c=l.index,d=["merge",n,c].join("-"),u=e[n]==c;a.push("
    • "),"avatar"==n?a.push('"):(a.push('"),"fullname"==n?a.push(null==(o=l.value)?"":o):a.push(jade.escape(null==(o=l.value)?"":o)),a.push("")),a.push("
    • ")}else{var s=0;for(var i in r){s++;var l=r[i],c=l.index,d=["merge",n,c].join("-"),u=e[n]==c;a.push("
    • "),"avatar"==n?a.push('"):(a.push('"),"fullname"==n?a.push(null==(o=l.value)?"":o):a.push(jade.escape(null==(o=l.value)?"":o)),a.push("")),a.push("
    • ")}}}.call(this),a.push("")},a.push("

      "+jade.escape(null==(o=t("merge title"))?"":o)+"

      "),null!=e.mergeOptions.avatar&&(a.push("
      "+jade.escape(null==(o=t("merge choose avatar"))?"":o)+"
      "),n.radio(e.mergeOptions.avatar,"avatar"),a.push("
      ")),null!=e.mergeOptions.fullname&&(a.push("
      "+jade.escape(null==(o=t("merge choose name"))?"":o)+"
      "),n.radio(e.mergeOptions.fullname,"fullname"),a.push("
      ")),null!=e.mergeOptions.nickname&&(a.push("
      "+jade.escape(null==(o=t("merge choose nickname"))?"":o)+"
      "),n.radio(e.mergeOptions.nickname),a.push("
      ")),(null!=e.mergeOptions.org||null!=e.mergeOptions.department||null!=e.mergeOptions.title)&&(a.push("
      "+jade.escape(null==(o=t("merge choose organisation"))?"":o)+"
      "),null!=e.mergeOptions.org&&(a.push("
      "+jade.escape(null==(o=t("merge choose org"))?"":o)+"
      "),n.radio(e.mergeOptions.org,"org"),a.push("
      ")),null!=e.mergeOptions.department&&(a.push("
      "+jade.escape(null==(o=t("merge choose department"))?"":o)+"
      "),n.radio(e.mergeOptions.department,"department"),a.push("
      ")),null!=e.mergeOptions.title&&(a.push("
      "+jade.escape(null==(o=t("merge choose title"))?"":o)+"
      "),n.radio(e.mergeOptions.title,"title"),a.push("
      ")),a.push("
      ")),null!=e.mergeOptions.bday&&(a.push("
      "+jade.escape(null==(o=t("merge choose birthday"))?"":o)+"
      "),n.radio(e.mergeOptions.bday,"bday"),a.push("
      ")),a.push('
      ")}.call(this,"model"in r?r.model:"undefined"!=typeof model?model:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/contacts/row",function(t,e,o){var a=function(t){var e,o=[],a={},r=t||{};return function(t,n,r,i,s,l,c,d,u,p,m){if(a.formatPoint=e=function(t,a){this&&this.block,this&&this.attributes||{};if(a)switch(t.type.toLowerCase()){case"home":var a="home";break;case"work":var a="building";break;default:switch(t.name){case"tel":var a="phone";break;case"email":var a="envelope";break;default:var a=!1}}o.push(""+jade.escape(null==(e=t.type)?"":e)+' '+(null==(e=t.value.replace(/\n/g,"
      "))?"":e)+"
      ")},a.formatDatapoints=e=function(t,e){this&&this.block,this&&this.attributes||{};if(null!=t&&t.length){var n=t.length>1;o.push('")}else o.push('
      ")},o.push(''),n){if(c)var h=n;else var h="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";o.push("')}else{var f=ColorHash.getColor(d,"cozy");o.push("'+jade.escape(null==(e=l)?"":e)+"")}o.push("

      "+(null==(e=i)?"":e)+"

      "),a.formatDatapoints(m,"tel"),a.formatDatapoints(r,"email")}.call(this,"_id"in r?r._id:"undefined"!=typeof _id?_id:void 0,"avatar"in r?r.avatar:"undefined"!=typeof avatar?avatar:void 0,"email"in r?r.email:"undefined"!=typeof email?email:void 0,"fullname"in r?r.fullname:"undefined"!=typeof fullname?fullname:void 0,"id"in r?r.id:"undefined"!=typeof id?id:void 0,"initials"in r?r.initials:"undefined"!=typeof initials?initials:void 0,"isAvatarLoaded"in r?r.isAvatarLoaded:"undefined"!=typeof isAvatarLoaded?isAvatarLoaded:void 0,"n"in r?r.n:"undefined"!=typeof n?n:void 0,"ref"in r?r.ref:"undefined"!=typeof ref?ref:void 0,"selected"in r?r.selected:"undefined"!=typeof selected?selected:void 0,"tel"in r?r.tel:"undefined"!=typeof tel?tel:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/duplicates/index",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e){a.push('

      '+jade.escape(null==(o=t("duplicates title"))?"":o)+"

      "),e>0?a.push('
      '):a.push('

      '+jade.escape(null==(o=t("duplicates empty"))?"":o)+"

      "),a.push("
      ")}.call(this,"size"in n?n.size:"undefined"!=typeof size?size:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/duplicates/row",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e,r,i,s,l,c){n.formatPoint=o=function(t,e){this&&this.block,this&&this.attributes||{};if(e)switch(t.type.toLowerCase()){case"home":var e="home";break;case"work":var e="building";break;default:switch(t.name){case"tel":var e="phone";break;case"email":var e="envelope";break;default:var e=!1}}a.push(""+jade.escape(null==(o=t.type)?"":o)+' '+(null==(o=t.value.replace(/\n/g,"
      "))?"":o)+"
      ")},n.fullname=o=function(t){this&&this.block,this&&this.attributes||{};a.push("

      "+(null==(o=t.toString({pre:"",post:""}))?"":o)+"

      ")},n.formatDatapoints=o=function(t,e){this&&this.block,this&&this.attributes||{};null!=t&&t.length?(a.push('
      "),n.formatPoint(t[0]),a.push("
      ")):a.push('
      ")},n.contactrow=o=function(t){var e=(this&&this.block,this&&this.attributes||{},t.toJSON());a.push('
      '),e.avatar?a.push("'):a.push(''+jade.escape(null==(o=e.initials)?"":o)+""),n.fullname(t),a.push("
      "),n.formatDatapoints(e.tel,"tel"),n.formatDatapoints(e.email,"email")},s?n.contactrow(s):(a.push('
      '),n.fullname(e[0]),a.push('
        "),function(){var t=e;if("number"==typeof t.length)for(var o=0,r=t.length;r>o;o++){var i=t[o];a.push('
      • "),n.contactrow(i),a.push("
      • ")}else{var r=0;for(var o in t){r++;var i=t[o];a.push('
      • "),n.contactrow(i),a.push("
      • ")}}}.call(this),a.push("
      "))}.call(this,"candidates"in r?r.candidates:"undefined"!=typeof candidates?candidates:void 0,"isMergeable"in r?r.isMergeable:"undefined"!=typeof isMergeable?isMergeable:void 0,"merging"in r?r.merging:"undefined"!=typeof merging?merging:void 0,"result"in r?r.result:"undefined"!=typeof result?result:void 0,"selected"in r?r.selected:"undefined"!=typeof selected?selected:void 0,"undefined"in r?r.undefined:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/labels/edit",function(e,o,a){var n=function(e){var o,a=[];return a.push(""+jade.escape(null==(o=t("tools labels admin"))?"":o)+""),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/labels/filter",function(t,e,o){var a=function(t){var e,o=[],a={},n=t||{};return function(t,n,r,i,s){a.input=e=function(t,a,n,r){this&&this.block,this&&this.attributes||{};o.push(""+jade.escape(null==(e=n)?"":e)+"")},t?(o.push('"),a.input("checkbox",r,i,s),o.push("")):(o.push(""),a.input("radio",r,i,s),o.push(""))}.call(this,"edit"in n?n.edit:"undefined"!=typeof edit?edit:void 0,"href"in n?n.href:"undefined"!=typeof href?href:void 0,"id"in n?n.id:"undefined"!=typeof id?id:void 0,"name"in n?n.name:"undefined"!=typeof name?name:void 0,"selected"in n?n.selected:"undefined"!=typeof selected?selected:void 0),o.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/templates/labels/index",function(e,o,a){var n=function(e){var o,a=[],n={},r=e||{};return function(e,r,i,s,l){a.push(""+jade.escape(null==(o=t("tools labels filters"))?"":o)+"")}.call(this,"edit"in r?r.edit:"undefined"!=typeof edit?edit:void 0,"href"in r?r.href:"undefined"!=typeof href?href:void 0,"id"in r?r.id:"undefined"!=typeof id?id:void 0,"name"in r?r.name:"undefined"!=typeof name?name:void 0,"selected"in r?r.selected:"undefined"!=typeof selected?selected:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/layouts/app",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e){a.push('
      ')}.call(this,"mode"in n?n.mode:"undefined"!=typeof mode?mode:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/settings/index",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e,n,r,i,s){a.push('

      '+jade.escape(null==(o=t("settings title"))?"":o)+'

      '+jade.escape(null==(o=t("settings in-out title"))?"":o)+'

      "), -e&&e.upload&&a.push(jade.escape(null==(o=t(e.upload))?"":o)),a.push('

      '+jade.escape(null==(o=t("settings display title"))?"":o)+'

      '+jade.escape(null==(o=t("settings sync title"))?"":o)+"

      "+jade.escape(null==(o=t("settings sync gplay"))?"":o)+'

      "+(null==(o=t("settings sync carddav",{link:"https://docs.cozy.io/mobile/contacts.html"}).replace(/\[(.+)\]\((.+)\)/i,'$1'))?"":o)+"

      ")}.call(this,"errors"in n?n.errors:"undefined"!=typeof errors?errors:void 0,"locale"in n?n.locale:"undefined"!=typeof locale?locale:void 0,"sort"in n?n.sort:"undefined"!=typeof sort?sort:void 0,"sortkeys"in n?n.sortkeys:"undefined"!=typeof sortkeys?sortkeys:void 0,"undefined"in n?n.undefined:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/tools/context_actions",function(e,o,a){var n=function(e){var o,a=[],n=e||{};return function(e){a.push(""+jade.escape(null==(o=t("tools contextual selected",{smart_count:e.length}))?"":o)+'")}.call(this,"selected"in n?n.selected:"undefined"!=typeof selected?selected:void 0),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/tools/default_actions",function(e,o,a){var n=function(e){var o,a=[];return a.push('"),a.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/tools/search",function(e,o,a){var n=function(e){var o=[];return o.push(''),o.join("")};"function"==typeof define&&define.amd?define([],function(){return n}):"object"==typeof a&&a&&a.exports&&(a.exports=n)}),require.register("views/templates/tools/toolbar",function(t,e,o){var a=function(t){var e=[];return e.push(''),e.join("")};"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof o&&o&&o.exports&&(o.exports=a)}),require.register("views/tools/context_actions",function(e,o,a){var n,r=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;a.exports=n=function(e){function a(){return this._deleteModalCfg=r(this._deleteModalCfg,this),a.__super__.constructor.apply(this,arguments)}return i(a,e),a.prototype.template=o("views/templates/tools/context_actions"),a.prototype.tagName="fieldset",a.prototype.behaviors=function(){return{Confirm:{triggers:{"click @ui.delete":this._deleteModalCfg}}}},a.prototype.ui={select:'[formaction="select/all"]',unselect:'[formaction="select/none"]',merge:'[formaction="contacts/merge"]',"export":'[formaction="contacts/export"]',"delete":'[formaction="contacts/delete"]'},a.prototype.triggers={"click @ui.select":"select:all","click @ui.unselect":"select:none","click @ui.export":"bulk:export","click @ui.merge":"bulk:merge"},a.prototype.modelEvents={"change:selected":function(t,e){return e.length?this.render():void 0}},a.prototype.initialize=function(){return Mn.bindEntityEvents(this.model,this,this.model.viewEvents)},a.prototype._deleteModalCfg=function(){var e,o;return o={smart_count:this.model.get("selected").length},e={event:"bulk:delete",title:t("bulk confirm delete title",o),message:t("bulk confirm delete message",o),btn_ok:t("bulk confirm delete ok"),btn_cancel:t("bulk confirm delete cancel"),end_event:"bulk:delete:done"}},a}(Mn.ItemView)}),require.register("views/tools/default_actions",function(t,e,o){var a,n=function(t,e){function o(){this.constructor=t}for(var a in e)r.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},r={}.hasOwnProperty;o.exports=a=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return n(o,t),o.prototype.template=e("views/templates/tools/default_actions"),o.prototype.tagName="fieldset",o}(Mn.ItemView)}),require.register("views/tools/search",function(t,e,o){var a,n,r,i=function(t,e){function o(){this.constructor=t}for(var a in e)s.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s={}.hasOwnProperty;a=e("config").ERR,r=null,o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,t),o.prototype.template=e("views/templates/tools/search"),o.prototype.tagName="label",o.prototype.className="empty",o.prototype.attributes={"for":"contacts-search"},o.prototype.ui={search:"input",clear:"button.clear"},o.prototype._lastValue=void 0,o.prototype.events=function(){return{"click @ui.clear":function(){return r.search("text",null)},"keyup @ui.search":_.debounce(function(t){var e,o;return 27===t.which?r.search("text",null):(o=t.currentTarget.value,0===o.length?r.search("text",null):o.length>2?(r.search("text",o),this._lastValue=o):o.length<(null!=(e=this._lastValue)?e.length:void 0)?r.channel.trigger("search:error",a.SEARCH_TOO_SHORT):void 0)},450,{trailing:!0,maxWait:350})}},o.prototype.initialize=function(){return r=e("application"),this.listenTo(r.channel,{"filter:text":this.updateSearch,"search:error":function(){return this.el.querySelector("input").setAttribute("aria-invalid",!0)}})},o.prototype.onDomRefresh=function(){return this.ui.search.trigger("focus")},o.prototype.updateSearch=function(t){return this.ui.search.val(t),this.toggleUi(t)},o.prototype.toggleUi=function(t){return this.el.classList.toggle("empty",_.isEmpty(t)),this.el.querySelector("input").setAttribute("aria-invalid",!1)},o}(Mn.ItemView)}),require.register("views/tools/toolbar",function(t,e,o){var a,n,r=function(t,e){function o(){this.constructor=t}for(var a in e)i.call(e,a)&&(t[a]=e[a]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i={}.hasOwnProperty;a=e("views/tools/search"),o.exports=n=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return r(o,t),o.prototype.template=e("views/templates/tools/toolbar"),o.prototype.ui={drawer:".drawer-toggle"},o.prototype.triggers={"click @ui.drawer":"drawer:toggle"},o.prototype.onRender=function(){return(new a).render().$el.appendTo(this.$el)},o}(Mn.ItemView)}); \ No newline at end of file diff --git a/build/client/public/scripts/vendor.js b/build/client/public/scripts/vendor.js deleted file mode 100644 index ff48859..0000000 --- a/build/client/public/scripts/vendor.js +++ /dev/null @@ -1,11 +0,0 @@ -!function(){"use strict";var t="undefined"==typeof window?global:window;if("function"!=typeof t.require){var e={},n={},r={},i={}.hasOwnProperty,o="components/",s=function(t,e){var n=0;e&&(0===e.indexOf(o)&&(n=o.length),e.indexOf("/",n)>0&&(e=e.substring(n,e.indexOf("/",n))));var i=r[t+"/index.js"]||r[e+"/deps/"+t+"/index.js"];return i?o+i.substring(0,i.length-".js".length):t},a=/^\.\.?(\/|$)/,u=function(t,e){for(var n,r=[],i=(a.test(e)?t+"/"+e:e).split("/"),o=0,s=i.length;s>o;o++)n=i[o],".."===n?r.pop():"."!==n&&""!==n&&r.push(n);return r.join("/")},c=function(t){return t.split("/").slice(0,-1).join("/")},l=function(e){return function(n){var r=u(c(e),n);return t.require(r,e)}},h=function(t,e){var r={id:t,exports:{}};return n[t]=r,e(r.exports,l(t),r),r.exports},f=function(t,r){var o=u(t,".");if(null==r&&(r="/"),o=s(t,r),i.call(n,o))return n[o].exports;if(i.call(e,o))return h(o,e[o]);var a=u(o,"./index");if(i.call(n,a))return n[a].exports;if(i.call(e,a))return h(a,e[a]);throw new Error('Cannot find module "'+t+'" from "'+r+'"')};f.alias=function(t,e){r[e]=t},f.register=f.define=function(t,n){if("object"==typeof t)for(var r in t)i.call(t,r)&&(e[r]=t[r]);else e[t]=n},f.list=function(){var t=[];for(var n in e)i.call(e,n)&&t.push(n);return t},f.brunch=!0,f._cache=n,t.require=f}}(),function(){function t(t,e){if(t!==e){var n=null===t,r=t===E,i=t===t,o=null===e,s=e===E,a=e===e;if(t>e&&!o||!i||n&&!s&&a||r&&a)return 1;if(e>t&&!n||!a||o&&!r&&i||s&&i)return-1}return 0}function e(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function s(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function a(e,n){return t(e.criteria,n.criteria)||e.index-n.index}function u(e,n,r){for(var i=-1,o=e.criteria,s=n.criteria,a=o.length,u=r.length;++i=u)return c;var l=r[i];return c*("asc"===l||l===!0?1:-1)}}return e.index-n.index}function c(t){return Vt[t]}function l(t){return qt[t]}function h(t,e,n){return e?t=zt[t]:n&&(t=Ht[t]),"\\"+t}function f(t){return"\\"+Ht[t]}function p(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function m(t,e){for(var n=-1,r=t.length,i=-1,o=[];++ne,i=n?t.length:0,o=Hn(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=r?a:s-1,l=this.__iteratees__,h=l.length,f=0,p=xs(u,this.__takeCount__);if(!n||I>i||i==u&&p==u)return nn(t,this.__actions__);var d=[];t:for(;u--&&p>f;){c+=e;for(var g=-1,m=t[c];++g=I?gn(e):null,c=e.length;u&&(s=Kt,a=!1,e=u);t:for(;++on&&(n=-n>i?0:i+n),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Te(t,e){var n=[];return Ns(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Se(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function De(t,e,n,r){r||(r=[]);for(var i=-1,o=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:E}}function Be(t,e,n,r,i,o){return t===e?!0:null==t||null==e||!ji(t)&&!d(e)?t!==t&&e!==e:Ne(t,e,Be,n,r,i,o)}function Ne(t,e,n,r,i,o,s){var a=Da(t),u=Da(e),c=Y,l=Y;a||(c=rs.call(t),c==q?c=J:c!=J&&(a=Yi(t))),u||(l=rs.call(e),l==q?l=J:l!=J&&(u=Yi(e)));var h=c==J,f=l==J,p=c==l;if(p&&!a&&!h)return Pn(t,e,c);if(!i){var d=h&&es.call(t,"__wrapped__"),g=f&&es.call(e,"__wrapped__");if(d||g)return n(d?t.value():t,g?e.value():e,r,i,o,s)}if(!p)return!1;o||(o=[]),s||(s=[]);for(var m=o.length;m--;)if(o[m]==t)return s[m]==e;o.push(t),s.push(e);var y=(a?Ln:Un)(t,e,n,r,i,o,s);return o.pop(),s.pop(),y}function Ie(t,e,n){var r=e.length,i=r,o=!n;if(null==t)return!i;for(t=hr(t);r--;){var s=e[r];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Vo(i);++r=I,u=a?gn():null,c=[];u?(i=Kt,s=!1):(a=!1,u=e?[]:c);t:for(;++r=i){for(;i>r;){var o=r+i>>>1,s=t[o];(n?e>=s:e>s)&&null!==s?r=o+1:i=o}return i}return on(t,e,So,n)}function on(t,e,n,r){e=n(e);for(var i=0,o=t?t.length:0,s=e!==e,a=null===e,u=e===E;o>i;){var c=vs((i+o)/2),l=n(t[c]),h=l!==E,f=l===l;if(s)var p=f||r;else p=a?f&&h&&(r||null!=l):u?f&&(r||h):null==l?!1:r?e>=l:e>l;p?i=c+1:o=c}return xs(o,Ms)}function sn(t,e,n){if("function"!=typeof t)return So;if(e===E)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,s){return t.call(e,n,r,i,o,s)}}return function(){return t.apply(e,arguments)}}function an(t){var e=new ss(t.byteLength),n=new ds(e);return n.set(new ds(t)),e}function un(t,e,n){for(var r=n.length,i=-1,o=Es(t.length-r,0),s=-1,a=e.length,u=Vo(a+o);++s2?n[i-2]:E,s=i>2?n[2]:E,a=i>1?n[i-1]:E;for("function"==typeof o?(o=sn(o,a,5),i-=2):(o="function"==typeof a?a:E,i-=o?1:0),s&&Qn(n[0],n[1],s)&&(o=3>i?E:o,i=1);++r-1?r[s]:E}return Se(r,i,t)}}function En(t){return function(n,r,i){return n&&n.length?(r=Vn(r,i,3),e(n,r,t)):-1}}function xn(t){return function(e,n,r){return n=Vn(n,r,3),Se(e,n,t,!0)}}function Cn(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,o=Vo(n);t?r--:++r=I)return e.plant(r).value();for(var i=0,s=n?o[i].apply(this,t):r;++i_){var T=a?ne(a):E,S=Es(c-_,0),O=d?A:E,F=d?E:A,R=d?w:E,j=d?E:w;e|=d?D:M,e&=~(d?M:D),g||(e&=~(C|k));var B=[t,e,n,R,O,j,F,T,u,S],N=Fn.apply(E,B);return er(t)&&Ys(N,B),N.placeholder=x,N}}var I=f?n:this,L=p?I[t]:t;return a&&(w=ur(w,a)),h&&u=e||!bs(e))return"";var i=e-r;return n=null==n?" ":n+"",yo(n,ms(i/n.length)).slice(0,i)}function jn(t,e,n,r){function i(){for(var e=-1,a=arguments.length,u=-1,c=r.length,l=Vo(c+a);++uu))return!1;for(;++a-1&&t%1==0&&e>t}function Qn(t,e,n){if(!ji(n))return!1;var r=typeof e;if("number"==r?Kn(n)&&Zn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&Et.test(t)||"number"==n)return!0;if(Da(t))return!1;var r=!wt.test(t);return r||null!=e&&t in hr(e)}function er(t){var e=qn(t),n=G[e];if("function"!=typeof n||!(e in Vt.prototype))return!1;if(t===n)return!0;var r=Vs(n);return!!r&&t===r[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fs>=t}function rr(t){return t===t&&!ji(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,o=O>i,s=r==O&&n==T||r==O&&n==F&&t[7].length<=e[8]||r==(O|F)&&n==T;if(!o&&!s)return t;r&C&&(t[2]=e[2],i|=n&C?0:A);var a=e[3];if(a){var u=t[3];t[3]=u?un(u,a,e[4]):ne(a),t[4]=u?m(t[3],V):ne(e[4])}return a=e[5],a&&(u=t[5],t[5]=u?cn(u,a,e[6]):ne(a),t[6]=u?m(t[5],V):ne(e[6])),a=e[7],a&&(t[7]=ne(a)),r&O&&(t[8]=null==t[8]?e[8]:xs(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function or(t,e){return t===E?e:Ma(t,e,or)}function sr(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)s[++o]=Ge(t,r,r+=e);return s}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function yr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ge(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,Vn(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,Vn(e,n,3),!0):[]}function br(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Qn(t,e,n)&&(n=0,r=i),Ae(t,e,n,r)):[]}function wr(t){return t?t[0]:E}function Er(t,e,n){var r=t?t.length:0;return n&&Qn(t,e,n)&&(e=!1),r?De(t,e):[]}function xr(t){var e=t?t.length:0;return e?De(t,!0):[]}function Cr(t,e,r){var i=t?t.length:0;if(!i)return-1;if("number"==typeof r)r=0>r?Es(i+r,0):r;else if(r){var o=rn(t,e);return i>o&&(e===e?e===t[o]:t[o]!==t[o])?o:-1}return n(t,e,r||0)}function kr(t){return yr(t,1)}function Ar(t){var e=t?t.length:0;return e?t[e-1]:E}function Tr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?Es(r+n,0):xs(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var o=t[i];return(e===e?e===o:o!==o)?i:-1}if(e!==e)return p(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Sr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Yn(),i=t.length;++n-1;)ps.call(e,o,1);return e}function Dr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,o=[],s=t.length;for(e=Vn(e,n,3);++ie?0:e)):[]}function Rr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ge(t,0>e?0:e)):[]}function jr(t,e,n){return t&&t.length?en(t,Vn(e,n,3),!1,!0):[]}function Br(t,e,n){return t&&t.length?en(t,Vn(e,n,3)):[]}function Nr(t,e,r,i){var o=t?t.length:0;if(!o)return[];null!=e&&"boolean"!=typeof e&&(i=r,r=Qn(t,e,i)?E:e,e=!1);var s=Vn();return(null!=r||s!==be)&&(r=s(r,i,3)),e&&Yn()===n?y(t,r):Qe(t,r)}function Ir(t){if(!t||!t.length)return[];var e=-1,n=0;t=ae(t,function(t){return Kn(t)?(n=Es(t.length,n),!0):void 0});for(var r=Vo(n);++en?Es(i+n,0):n||0,"string"==typeof t||!Da(t)&&qi(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&Yn(t,e,n)>-1}function ti(t,e,n){var r=Da(t)?ue:Le;return e=Vn(e,n,3),r(t,e)}function ei(t,e){return ti(t,jo(e))}function ni(t,e,n){var r=Da(t)?ae:Te;return e=Vn(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Qn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[He(0,r-1)]:E}var i=-1,o=Wi(t),r=o.length,s=r-1;for(e=xs(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=E),n}}function pi(t,e,n){function r(){p&&as(p),c&&as(c),g=0,c=p=d=E}function i(e,n){n&&as(n),c=p=d=E,e&&(g=ga(),l=t.apply(f,u),p||c||(u=f=E))}function o(){var t=e-(ga()-h);0>=t||t>e?i(d,c):p=fs(o,t)}function s(){i(y,p)}function a(){if(u=arguments,h=ga(),f=this,d=y&&(p||!v),m===!1)var n=v&&!p;else{c||v||(g=h);var r=m-(h-g),i=0>=r||r>m;i?(c&&(c=as(c)),g=h,l=t.apply(f,u)):c||(c=fs(s,r))}return i&&p?p=as(p):p||e===m||(p=fs(o,e)),n&&(i=!0,l=t.apply(f,u)),!i||p||c||(u=f=E),l}var u,c,l,h,f,p,d,g=0,m=!1,y=!0;if("function"!=typeof t)throw new Jo(U);if(e=0>e?0:+e||0,n===!0){var v=!0;y=!1}else ji(n)&&(v=!!n.leading,m="maxWait"in n&&Es(+n.maxWait||0,e),y="trailing"in n?!!n.trailing:y);return a.cancel=r,a}function di(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Jo(U);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new di.Cache,n}function gi(t){if("function"!=typeof t)throw new Jo(U);return function(){return!t.apply(this,arguments)}}function mi(t){return fi(2,t)}function yi(t,e){if("function"!=typeof t)throw new Jo(U);return e=Es(e===E?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=Es(n.length-e,0),o=Vo(i);++re}function Ci(t,e){return t>=e}function ki(t){return d(t)&&Kn(t)&&es.call(t,"callee")&&!ls.call(t,"callee")}function Ai(t){return t===!0||t===!1||d(t)&&rs.call(t)==$}function Ti(t){return d(t)&&rs.call(t)==z}function Si(t){return!!t&&1===t.nodeType&&d(t)&&!Ui(t)}function Di(t){return null==t?!0:Kn(t)&&(Da(t)||qi(t)||ki(t)||d(t)&&Ri(t.splice))?!t.length:!Ua(t).length}function Mi(t,e,n,r){n="function"==typeof n?sn(n,r,3):E;var i=n?n(t,e):E;return i===E?Be(t,e,n):!!i}function Oi(t){return d(t)&&"string"==typeof t.message&&rs.call(t)==H}function Fi(t){return"number"==typeof t&&bs(t)}function Ri(t){return ji(t)&&rs.call(t)==W}function ji(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Bi(t,e,n,r){return n="function"==typeof n?sn(n,r,3):E,Ie(t,$n(e),n)}function Ni(t){return Pi(t)&&t!=+t}function Ii(t){return null==t?!1:Ri(t)?os.test(ts.call(t)):d(t)&&Ot.test(t)}function Li(t){return null===t}function Pi(t){return"number"==typeof t||d(t)&&rs.call(t)==X}function Ui(t){var e;if(!d(t)||rs.call(t)!=J||ki(t)||!es.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Me(t,function(t,e){n=e}),n===E||es.call(t,n)}function Vi(t){return ji(t)&&rs.call(t)==K}function qi(t){return"string"==typeof t||d(t)&&rs.call(t)==Q}function Yi(t){return d(t)&&nr(t.length)&&!!Pt[rs.call(t)]}function $i(t){return t===E}function zi(t,e){return e>t}function Hi(t,e){return e>=t}function Wi(t){var e=t?qs(t):0;return nr(e)?e?ne(t):[]:oo(t)}function Gi(t){return _e(t,to(t))}function Xi(t,e,n){var r=Bs(t);return n&&Qn(t,e,n)&&(e=E),e?ye(r,e):r}function Ji(t){return Re(t,to(t))}function Ki(t,e,n){var r=null==t?E:je(t,fr(e),e+"");return r===E?n:r}function Zi(t,e){if(null==t)return!1;var n=es.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:je(t,Ge(e,0,-1)),null==t)return!1;e=Ar(e),n=es.call(t,e)}return n||nr(t.length)&&Zn(e,t.length)&&(Da(t)||ki(t))}function Qi(t,e,n){n&&Qn(t,e,n)&&(e=E);for(var r=-1,i=Ua(t),o=i.length,s={};++r0;++r=xs(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fo(t){return t=i(t),t&&yt.test(t)?t.replace(gt,l):t}function po(t){return t=i(t),t&&kt.test(t)?t.replace(Ct,h):t||"(?:)"}function go(t,e,n){t=i(t),e=+e;var r=t.length;if(r>=e||!bs(e))return t;var o=(e-r)/2,s=vs(o),a=ms(o);return n=Rn("",a,n),n.slice(0,s)+t+n}function mo(t,e,n){return(n?Qn(t,e,n):null==e)?e=0:e&&(e=+e),t=bo(t),ks(t,e||(Mt.test(t)?16:10))}function yo(t,e){var n="";if(t=i(t),e=+e,1>e||!t||!bs(e))return n;do e%2&&(n+=t),e=vs(e/2),t+=t;while(e);return n}function vo(t,e,n){return t=i(t),n=null==n?0:xs(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function _o(t,e,n){var r=G.templateSettings;n&&Qn(t,e,n)&&(e=n=E),t=i(t),e=me(ye({},n||e),r,ge);var o,s,a=me(ye({},e.imports),r.imports,ge),u=Ua(a),c=tn(a,u),l=0,h=e.interpolate||jt,p="__p += '",d=Go((e.escape||jt).source+"|"+h.source+"|"+(h===bt?St:jt).source+"|"+(e.evaluate||jt).source+"|$","g"),g="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++Lt+"]")+"\n";t.replace(d,function(e,n,r,i,a,u){return r||(r=i),p+=t.slice(l,u).replace(Bt,f),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e}),p+="';\n";var m=e.variable;m||(p="with (obj) {\n"+p+"\n}\n"),p=(s?p.replace(ht,""):p).replace(ft,"$1").replace(pt,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Ka(function(){return $o(u,g+"return "+p).apply(E,c)});if(y.source=p,Oi(y))throw y;return y}function bo(t,e,n){var r=t;return(t=i(t))?(n?Qn(r,e,n):null==e)?t.slice(v(t),_(t)+1):(e+="",t.slice(o(t,e),s(t,e)+1)):t}function wo(t,e,n){var r=t;return t=i(t),t?(n?Qn(r,e,n):null==e)?t.slice(v(t)):t.slice(o(t,e+"")):t}function Eo(t,e,n){var r=t;return t=i(t),t?(n?Qn(r,e,n):null==e)?t.slice(0,_(t)+1):t.slice(0,s(t,e+"")+1):t}function xo(t,e,n){n&&Qn(t,e,n)&&(e=E);var r=R,o=j;if(null!=e)if(ji(e)){var s="separator"in e?e.separator:s;r="length"in e?+e.length||0:r,o="omission"in e?i(e.omission):o}else r=+e||0;if(t=i(t),r>=t.length)return t;var a=r-o.length;if(1>a)return o;var u=t.slice(0,a);if(null==s)return u+o;if(Vi(s)){if(t.slice(a).search(s)){var c,l,h=t.slice(0,a);for(s.global||(s=Go(s.source,(Dt.exec(s)||"")+"g")),s.lastIndex=0;c=s.exec(h);)l=c.index;u=u.slice(0,null==l?a:l)}}else if(t.indexOf(s,a)!=a){var f=u.lastIndexOf(s);f>-1&&(u=u.slice(0,f))}return u+o}function Co(t){return t=i(t),t&&mt.test(t)?t.replace(dt,b):t}function ko(t,e,n){return n&&Qn(t,e,n)&&(e=E),t=i(t),t.match(e||Nt)||[]}function Ao(t,e,n){return n&&Qn(t,e,n)&&(e=E),d(t)?Do(t):be(t,e)}function To(t){return function(){return t}}function So(t){return t}function Do(t){return Pe(we(t,!0))}function Mo(t,e){return Ue(t,we(e,!0))}function Oo(t,e,n){if(null==n){var r=ji(e),i=r?Ua(e):E,o=i&&i.length?Re(e,i):E;(o?o.length:r)||(o=!1,n=e,e=t,t=this)}o||(o=Re(e,Ua(e)));var s=!0,a=-1,u=Ri(t),c=o.length;n===!1?s=!1:ji(n)&&"chain"in n&&(s=n.chain);for(;++at||!bs(t))return[];var r=-1,i=Vo(xs(t,Ds));for(e=sn(e,n,1);++rr?i[r]=e(r):e(r);return i}function Lo(t){var e=++ns;return i(t)+e}function Po(t,e){return(+t||0)+(+e||0)}function Uo(t,e,n){return n&&Qn(t,e,n)&&(e=E),e=Vn(e,n,3),1==e.length?pe(Da(t)?t:lr(t),e):Ze(t,e)}g=g?te.defaults(Qt.Object(),g,te.pick(Qt,It)):Qt;var Vo=g.Array,qo=g.Date,Yo=g.Error,$o=g.Function,zo=g.Math,Ho=g.Number,Wo=g.Object,Go=g.RegExp,Xo=g.String,Jo=g.TypeError,Ko=Vo.prototype,Zo=Wo.prototype,Qo=Xo.prototype,ts=$o.prototype.toString,es=Zo.hasOwnProperty,ns=0,rs=Zo.toString,is=Qt._,os=Go("^"+ts.call(es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ss=g.ArrayBuffer,as=g.clearTimeout,us=g.parseFloat,cs=zo.pow,ls=Zo.propertyIsEnumerable,hs=zn(g,"Set"),fs=g.setTimeout,ps=Ko.splice,ds=g.Uint8Array,gs=zn(g,"WeakMap"),ms=zo.ceil,ys=zn(Wo,"create"),vs=zo.floor,_s=zn(Vo,"isArray"),bs=g.isFinite,ws=zn(Wo,"keys"),Es=zo.max,xs=zo.min,Cs=zn(qo,"now"),ks=g.parseInt,As=zo.random,Ts=Ho.NEGATIVE_INFINITY,Ss=Ho.POSITIVE_INFINITY,Ds=4294967295,Ms=Ds-1,Os=Ds>>>1,Fs=9007199254740991,Rs=gs&&new gs,js={};G.support={};G.templateSettings={escape:vt,evaluate:_t,interpolate:bt,variable:"",imports:{_:G}};var Bs=function(){function t(){}return function(e){if(ji(e)){t.prototype=e;var n=new t;t.prototype=E}return n||{}}}(),Ns=fn(Oe),Is=fn(Fe,!0),Ls=pn(),Ps=pn(!0),Us=Rs?function(t,e){return Rs.set(t,e),t}:So,Vs=Rs?function(t){return Rs.get(t)}:Ro,qs=Ye("length"),Ys=function(){var t=0,e=0;return function(n,r){var i=ga(),o=N-(i-e);if(e=i,o>0){if(++t>=B)return n}else t=0;return Us(n,r)}}(),$s=yi(function(t,e){return d(t)&&Kn(t)?xe(t,De(e,!1,!0)):[]}),zs=En(),Hs=En(!0),Ws=yi(function(t){for(var e=t.length,r=e,i=Vo(h),o=Yn(),s=o===n,a=[];r--;){var u=t[r]=Kn(u=t[r])?u:[];i[r]=s&&u.length>=120?gn(r&&u):null}var c=t[0],l=-1,h=c?c.length:0,f=i[0];t:for(;++l2?t[e-2]:E,r=e>1?t[e-1]:E;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):E,r=E),t.length=e,Lr(t,n,r)}),ea=yi(function(t){return t=De(t),this.thru(function(e){return ee(Da(e)?e:[hr(e)],t)})}),na=yi(function(t,e){return ve(t,De(e))}),ra=ln(function(t,e,n){es.call(t,n)?++t[n]:t[n]=1}),ia=wn(Ns),oa=wn(Is,!0),sa=kn(re,Ns),aa=kn(ie,Is),ua=ln(function(t,e,n){es.call(t,n)?t[n].push(e):t[n]=[e]}),ca=ln(function(t,e,n){t[n]=e}),la=yi(function(t,e,n){var r=-1,i="function"==typeof e,o=tr(e),s=Kn(t)?Vo(t.length):[];return Ns(t,function(t){var a=i?e:o&&null!=t?t[e]:E;s[++r]=a?a.apply(t,n):Jn(t,e,n)}),s}),ha=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),fa=On(le,Ns),pa=On(he,Is),da=yi(function(t,e){if(null==t)return[];var n=e[2];return n&&Qn(e[0],e[1],n)&&(e.length=1),Ke(t,De(e),[])}),ga=Cs||function(){return(new qo).getTime()},ma=yi(function(t,e,n){var r=C;if(n.length){var i=m(n,ma.placeholder);r|=D}return In(t,r,e,n,i)}),ya=yi(function(t,e){e=e.length?De(e):Ji(t);for(var n=-1,r=e.length;++n0||0>e)?new Vt(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==E&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},Vt.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},Vt.prototype.toArray=function(){return this.take(Ss)},Oe(Vt.prototype,function(t,e){var n=/^(?:filter|map|reject)|While$/.test(e),r=/^(?:first|last)$/.test(e),i=G[r?"take"+("last"==e?"Right":""):e];i&&(G.prototype[e]=function(){var e=r?[1]:arguments,o=this.__chain__,s=this.__wrapped__,a=!!this.__actions__.length,u=s instanceof Vt,c=e[0],l=u||Da(s);l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=function(t){return r&&o?i(t,1)[0]:i.apply(E,ce([t],e))},f={func:Yr,args:[h],thisArg:E},p=u&&!a;if(r&&!o)return p?(s=s.clone(),s.__actions__.push(f),t.call(s)):i.call(E,this.value())[0];if(!r&&l){s=p?s:new Vt(this);var d=t.apply(s,e);return d.__actions__.push(f),new tt(d,o)}return this.thru(h)})}),re(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var e=(/^(?:replace|split)$/.test(t)?Qo:Ko)[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:join|pop|replace|shift)$/.test(t);G.prototype[t]=function(){var t=arguments;return r&&!this.__chain__?e.apply(this.value(),t):this[n](function(n){return e.apply(n,t)})}}),Oe(Vt.prototype,function(t,e){var n=G[e];if(n){var r=n.name+"",i=js[r]||(js[r]=[]);i.push({name:e,func:n})}}),js[Fn(E,k).name]=[{name:"wrapper",func:E}],Vt.prototype.clone=qt,Vt.prototype.reverse=Yt,Vt.prototype.value=$t,G.prototype.chain=$r,G.prototype.commit=zr,G.prototype.concat=ea,G.prototype.plant=Hr,G.prototype.reverse=Wr,G.prototype.toString=Gr,G.prototype.run=G.prototype.toJSON=G.prototype.valueOf=G.prototype.value=Xr,G.prototype.collect=G.prototype.map,G.prototype.head=G.prototype.first,G.prototype.select=G.prototype.filter,G.prototype.tail=G.prototype.rest,G}var E,x="3.10.1",C=1,k=2,A=4,T=8,S=16,D=32,M=64,O=128,F=256,R=30,j="...",B=150,N=16,I=200,L=1,P=2,U="Expected a function",V="__lodash_placeholder__",q="[object Arguments]",Y="[object Array]",$="[object Boolean]",z="[object Date]",H="[object Error]",W="[object Function]",G="[object Map]",X="[object Number]",J="[object Object]",K="[object RegExp]",Z="[object Set]",Q="[object String]",tt="[object WeakMap]",et="[object ArrayBuffer]",nt="[object Float32Array]",rt="[object Float64Array]",it="[object Int8Array]",ot="[object Int16Array]",st="[object Int32Array]",at="[object Uint8Array]",ut="[object Uint8ClampedArray]",ct="[object Uint16Array]",lt="[object Uint32Array]",ht=/\b__p \+= '';/g,ft=/\b(__p \+=) '' \+/g,pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dt=/&(?:amp|lt|gt|quot|#39|#96);/g,gt=/[&<>"'`]/g,mt=RegExp(dt.source),yt=RegExp(gt.source),vt=/<%-([\s\S]+?)%>/g,_t=/<%([\s\S]+?)%>/g,bt=/<%=([\s\S]+?)%>/g,wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,kt=RegExp(Ct.source),At=/[\u0300-\u036f\ufe20-\ufe23]/g,Tt=/\\(\\)?/g,St=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dt=/\w*$/,Mt=/^0[xX]/,Ot=/^\[object .+?Constructor\]$/,Ft=/^\d+$/,Rt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,jt=/($^)/,Bt=/['\n\r\u2028\u2029\\]/g,Nt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),It=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Lt=-1,Pt={};Pt[nt]=Pt[rt]=Pt[it]=Pt[ot]=Pt[st]=Pt[at]=Pt[ut]=Pt[ct]=Pt[lt]=!0,Pt[q]=Pt[Y]=Pt[et]=Pt[$]=Pt[z]=Pt[H]=Pt[W]=Pt[G]=Pt[X]=Pt[J]=Pt[K]=Pt[Z]=Pt[Q]=Pt[tt]=!1;var Ut={};Ut[q]=Ut[Y]=Ut[et]=Ut[$]=Ut[z]=Ut[nt]=Ut[rt]=Ut[it]=Ut[ot]=Ut[st]=Ut[X]=Ut[J]=Ut[K]=Ut[Q]=Ut[at]=Ut[ut]=Ut[ct]=Ut[lt]=!0,Ut[H]=Ut[W]=Ut[G]=Ut[Z]=Ut[tt]=!1;var Vt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},qt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Yt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},$t={"function":!0,object:!0},zt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wt=$t[typeof exports]&&exports&&!exports.nodeType&&exports,Gt=$t[typeof module]&&module&&!module.nodeType&&module,Xt=Wt&&Gt&&"object"==typeof global&&global&&global.Object&&global,Jt=$t[typeof self]&&self&&self.Object&&self,Kt=$t[typeof window]&&window&&window.Object&&window,Zt=Gt&&Gt.exports===Wt&&Wt,Qt=Xt||Kt!==(this&&this.window)&&Kt||Jt||this,te=w();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Qt._=te,define(function(){return te})):Wt&&Gt?Zt?(Gt.exports=te)._=te:Wt._=te:Qt._=te}.call(this),function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e="length"in t&&t.length,n=B.type(t);return"function"===n||B.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function r(t,e,n){if(B.isFunction(e))return B.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return B.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(Y.test(e))return B.filter(e,t,n);e=B.filter(e,t)}return B.grep(t,function(t){return S.call(e,t)>=0!==n})}function i(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function o(t){var e=J[t]={};return B.each(t.match(X)||[],function(t,n){e[n]=!0}),e}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=B.expando+s.uid++}function a(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(et,"-$1").toLowerCase(),n=t.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:tt.test(n)?B.parseJSON(n):n}catch(i){}Q.set(t,e,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function l(){try{return R.activeElement}catch(t){}}function h(t,e){return B.nodeName(t,"table")&&B.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function f(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function p(t){var e=dt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function d(t,e){for(var n=0,r=t.length;r>n;n++)Z.set(t[n],"globalEval",!e||Z.get(e[n],"globalEval"))}function g(t,e){var n,r,i,o,s,a,u,c;if(1===e.nodeType){if(Z.hasData(t)&&(o=Z.access(t),s=Z.set(e,o),c=o.events)){delete s.handle,s.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)B.event.add(e,i,c[i][n])}Q.hasData(t)&&(a=Q.access(t),u=B.extend({},a),Q.set(e,u))}}function m(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&B.nodeName(t,e)?B.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&nt.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function v(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(X)||[];if(B.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function _(t,e,n,r){function i(a){var u;return o[a]=!0,B.each(t[a]||[],function(t,a){var c=a(e,n,r);return"string"!=typeof c||s||o[c]?s?!(u=c):void 0:(e.dataTypes.unshift(c),i(c),!1)}),u}var o={},s=t===Rt;return i(e.dataTypes[0])||!o["*"]&&i("*")}function b(t,e){var n,r,i=B.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&B.extend(!0,t,r),t}function w(t,e,n){for(var r,i,o,s,a=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):void 0}function E(t,e,n,r){var i,o,s,a,u,c={},l=t.dataTypes.slice();if(l[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=c[u+" "+o]||c["* "+o],!s)for(i in c)if(a=i.split(" "),a[1]===o&&(s=c[u+" "+a[0]]||c["* "+a[0]])){s===!0?s=c[i]:c[i]!==!0&&(o=a[0],l.unshift(a[1]));break}if(s!==!0)if(s&&t["throws"])e=s(e);else try{e=s(e)}catch(h){return{state:"parsererror",error:s?h:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}function x(t,e,n,r){var i;if(B.isArray(e))B.each(e,function(e,i){n||Lt.test(t)?r(t,i):x(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==B.type(e))r(t,e);else for(i in e)x(t+"["+i+"]",e[i],n,r)}var C=[],k=C.slice,A=C.concat,T=C.push,S=C.indexOf,D={},M=D.toString,O=D.hasOwnProperty,F={},R=t.document,j="2.1.4 -ajax/script,-ajax/jsonp,-css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/getStyles,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-dimensions,-offset,-deprecated,-event/alias,-wrap,-core/ready",B=function(t,e){return new B.fn.init(t,e)},N=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,I=/^-ms-/,L=/-([\da-z])/gi,P=function(t,e){return e.toUpperCase()};B.fn=B.prototype={jquery:j,constructor:B,selector:"",length:0,toArray:function(){return k.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:k.call(this)},pushStack:function(t){var e=B.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return B.each(this,t,e)},map:function(t){return this.pushStack(B.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(k.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:T,sort:C.sort,splice:C.splice},B.extend=B.fn.extend=function(){var t,e,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||B.isFunction(s)||(s={}),a===u&&(s=this,a--);u>a;a++)if(null!=(t=arguments[a]))for(e in t)n=s[e],r=t[e],s!==r&&(c&&r&&(B.isPlainObject(r)||(i=B.isArray(r)))?(i?(i=!1,o=n&&B.isArray(n)?n:[]):o=n&&B.isPlainObject(n)?n:{},s[e]=B.extend(c,o,r)):void 0!==r&&(s[e]=r));return s},B.extend({expando:"jQuery"+(j+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===B.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!B.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==B.type(t)||t.nodeType||B.isWindow(t)?!1:t.constructor&&!O.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?D[M.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=B.trim(t),t&&(1===t.indexOf("use strict")?(e=R.createElement("script"),e.text=t,R.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(I,"ms-").replace(L,P)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,r){var i,o=0,s=t.length,a=n(t);if(r){if(a)for(;s>o&&(i=e.apply(t[o],r),i!==!1);o++);else for(o in t)if(i=e.apply(t[o],r),i===!1)break}else if(a)for(;s>o&&(i=e.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=e.call(t[o],o,t[o]),i===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(N,"")},makeArray:function(t,e){var r=e||[];return null!=t&&(n(Object(t))?B.merge(r,"string"==typeof t?[t]:t):T.call(r,t)),r},inArray:function(t,e,n){return null==e?-1:S.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r,i=[],o=0,s=t.length,a=!n;s>o;o++)r=!e(t[o],o),r!==a&&i.push(t[o]);return i},map:function(t,e,r){var i,o=0,s=t.length,a=n(t),u=[];if(a)for(;s>o;o++)i=e(t[o],o,r),null!=i&&u.push(i);else for(o in t)i=e(t[o],o,r),null!=i&&u.push(i);return A.apply([],u)},guid:1,proxy:function(t,e){var n,r,i;return"string"==typeof e&&(n=t[e],e=t,t=n),B.isFunction(t)?(r=k.call(arguments,2),i=function(){return t.apply(e||this,r.concat(k.call(arguments)))},i.guid=t.guid=t.guid||B.guid++,i):void 0},now:Date.now,support:F}),B.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){D["[object "+e+"]"]=e.toLowerCase()});var U=function(t){function e(t,e,n,r){var i,o,s,a,u,c,h,p,d,g;if((e?e.ownerDocument||e:U)!==F&&O(e),e=e||F,n=n||[],a=e.nodeType,"string"!=typeof t||!t||1!==a&&9!==a&&11!==a)return n;if(!r&&j){if(11!==a&&(i=vt.exec(t)))if(s=i[1]){if(9===a){if(o=e.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(s))&&L(e,o)&&o.id===s)return n.push(o),n}else{if(i[2])return Z.apply(n,e.getElementsByTagName(t)),n;if((s=i[3])&&w.getElementsByClassName)return Z.apply(n,e.getElementsByClassName(s)),n}if(w.qsa&&(!B||!B.test(t))){if(p=h=P,d=e,g=1!==a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(c=k(t),(h=e.getAttribute("id"))?p=h.replace(bt,"\\$&"):e.setAttribute("id",p),p="[id='"+p+"'] ",u=c.length;u--;)c[u]=p+f(c[u]);d=_t.test(t)&&l(e.parentNode)||e,g=c.join(",")}if(g)try{return Z.apply(n,d.querySelectorAll(g)),n}catch(m){}finally{h||e.removeAttribute("id")}}}return T(t.replace(ut,"$1"),e,n,r)}function n(){function t(n,r){return e.push(n+" ")>E.cacheLength&&delete t[e.shift()],t[n+" "]=r}var e=[];return t}function r(t){return t[P]=!0,t}function i(t){var e=F.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)E.attrHandle[n[r]]=e}function s(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||W)-(~t.sourceIndex||W);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function a(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function u(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function c(t){return r(function(e){return e=+e,r(function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function l(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function h(){}function f(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function p(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=q++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,s){var a,u,c=[V,o];if(s){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,s))return!0}else for(;e=e[r];)if(1===e.nodeType||i){if(u=e[P]||(e[P]={}),(a=u[r])&&a[0]===V&&a[1]===o)return c[2]=a[2];if(u[r]=c,c[2]=t(e,n,s))return!0}}}function d(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function m(t,e,n,r,i){for(var o,s=[],a=0,u=t.length,c=null!=e;u>a;a++)(o=t[a])&&(!n||n(o,r,i))&&(s.push(o),c&&e.push(a));return s}function y(t,e,n,i,o,s){return i&&!i[P]&&(i=y(i)),o&&!o[P]&&(o=y(o,s)),r(function(r,s,a,u){var c,l,h,f=[],p=[],d=s.length,y=r||g(e||"*",a.nodeType?[a]:a,[]),v=!t||!r&&e?y:m(y,f,t,a,u),_=n?o||(r?t:d||i)?[]:s:v;if(n&&n(v,_,a,u),i)for(c=m(_,p),i(c,[],a,u),l=c.length;l--;)(h=c[l])&&(_[p[l]]=!(v[p[l]]=h));if(r){if(o||t){if(o){for(c=[],l=_.length;l--;)(h=_[l])&&c.push(v[l]=h);o(null,_=[],c,u)}for(l=_.length;l--;)(h=_[l])&&(c=o?tt(r,h):f[l])>-1&&(r[c]=!(s[c]=h))}}else _=m(_===s?_.splice(d,_.length):_),o?o(null,s,_,u):Z.apply(s,_)})}function v(t){for(var e,n,r,i=t.length,o=E.relative[t[0].type],s=o||E.relative[" "],a=o?1:0,u=p(function(t){return t===e},s,!0),c=p(function(t){return tt(e,t)>-1},s,!0),l=[function(t,n,r){var i=!o&&(r||n!==S)||((e=n).nodeType?u(t,n,r):c(t,n,r));return e=null,i}];i>a;a++)if(n=E.relative[t[a].type])l=[p(d(l),n)];else{ -if(n=E.filter[t[a].type].apply(null,t[a].matches),n[P]){for(r=++a;i>r&&!E.relative[t[r].type];r++);return y(a>1&&d(l),a>1&&f(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(ut,"$1"),n,r>a&&v(t.slice(a,r)),i>r&&v(t=t.slice(r)),i>r&&f(t))}l.push(n)}return d(l)}function _(t,n){var i=n.length>0,o=t.length>0,s=function(r,s,a,u,c){var l,h,f,p=0,d="0",g=r&&[],y=[],v=S,_=r||o&&E.find.TAG("*",c),b=V+=null==v?1:Math.random()||.1,w=_.length;for(c&&(S=s!==F&&s);d!==w&&null!=(l=_[d]);d++){if(o&&l){for(h=0;f=t[h++];)if(f(l,s,a)){u.push(l);break}c&&(V=b)}i&&((l=!f&&l)&&p--,r&&g.push(l))}if(p+=d,i&&d!==p){for(h=0;f=n[h++];)f(g,y,s,a);if(r){if(p>0)for(;d--;)g[d]||y[d]||(y[d]=J.call(u));y=m(y)}Z.apply(u,y),c&&!r&&y.length>0&&p+n.length>1&&e.uniqueSort(u)}return c&&(V=b,S=v),g};return i?r(s):s}var b,w,E,x,C,k,A,T,S,D,M,O,F,R,j,B,N,I,L,P="sizzle"+1*new Date,U=t.document,V=0,q=0,Y=n(),$=n(),z=n(),H=function(t,e){return t===e&&(M=!0),0},W=1<<31,G={}.hasOwnProperty,X=[],J=X.pop,K=X.push,Z=X.push,Q=X.slice,tt=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="\\["+nt+"*("+rt+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+nt+"*\\]",st=":("+rt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",at=new RegExp(nt+"+","g"),ut=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),lt=new RegExp("^"+nt+"*([>+~]|"+nt+")"+nt+"*"),ht=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),ft=new RegExp(st),pt=new RegExp("^"+it+"$"),dt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},gt=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,yt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_t=/[+~]/,bt=/'|\\/g,wt=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),Et=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},xt=function(){O()};try{Z.apply(X=Q.call(U.childNodes),U.childNodes),X[U.childNodes.length].nodeType}catch(Ct){Z={apply:X.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={},C=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},O=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:U;return r!==F&&9===r.nodeType&&r.documentElement?(F=r,R=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",xt,!1):n.attachEvent&&n.attachEvent("onunload",xt)),j=!C(r),w.attributes=i(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=i(function(t){return t.appendChild(r.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=yt.test(r.getElementsByClassName),w.getById=i(function(t){return R.appendChild(t).id=P,!r.getElementsByName||!r.getElementsByName(P).length}),w.getById?(E.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&j){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},E.filter.ID=function(t){var e=t.replace(wt,Et);return function(t){return t.getAttribute("id")===e}}):(delete E.find.ID,E.filter.ID=function(t){var e=t.replace(wt,Et);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),E.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},E.find.CLASS=w.getElementsByClassName&&function(t,e){return j?e.getElementsByClassName(t):void 0},N=[],B=[],(w.qsa=yt.test(r.querySelectorAll))&&(i(function(t){R.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&B.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||B.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+P+"-]").length||B.push("~="),t.querySelectorAll(":checked").length||B.push(":checked"),t.querySelectorAll("a#"+P+"+*").length||B.push(".#.+[+~]")}),i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&B.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||B.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),B.push(",.*:")})),(w.matchesSelector=yt.test(I=R.matches||R.webkitMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector||R.msMatchesSelector))&&i(function(t){w.disconnectedMatch=I.call(t,"div"),I.call(t,"[s!='']:x"),N.push("!=",st)}),B=B.length&&new RegExp(B.join("|")),N=N.length&&new RegExp(N.join("|")),e=yt.test(R.compareDocumentPosition),L=e||yt.test(R.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},H=e?function(t,e){if(t===e)return M=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===U&&L(U,t)?-1:e===r||e.ownerDocument===U&&L(U,e)?1:D?tt(D,t)-tt(D,e):0:4&n?-1:1)}:function(t,e){if(t===e)return M=!0,0;var n,i=0,o=t.parentNode,a=e.parentNode,u=[t],c=[e];if(!o||!a)return t===r?-1:e===r?1:o?-1:a?1:D?tt(D,t)-tt(D,e):0;if(o===a)return s(t,e);for(n=t;n=n.parentNode;)u.unshift(n);for(n=e;n=n.parentNode;)c.unshift(n);for(;u[i]===c[i];)i++;return i?s(u[i],c[i]):u[i]===U?-1:c[i]===U?1:0},r):F},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==F&&O(t),n=n.replace(ht,"='$1']"),w.matchesSelector&&j&&(!N||!N.test(n))&&(!B||!B.test(n)))try{var r=I.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,F,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==F&&O(t),L(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==F&&O(t);var n=E.attrHandle[e.toLowerCase()],r=n&&G.call(E.attrHandle,e.toLowerCase())?n(t,e,!j):void 0;return void 0!==r?r:w.attributes||!j?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],r=0,i=0;if(M=!w.detectDuplicates,D=!w.sortStable&&t.slice(0),t.sort(H),M){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}return D=null,t},x=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=x(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=x(e);return n},E=e.selectors={cacheLength:50,createPseudo:r,match:dt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(wt,Et),t[3]=(t[3]||t[4]||t[5]||"").replace(wt,Et),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return dt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&ft.test(n)&&(e=k(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(wt,Et).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Y[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&Y(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(at," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var c,l,h,f,p,d,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,y=a&&e.nodeName.toLowerCase(),v=!u&&!a;if(m){if(o){for(;g;){for(h=e;h=h[g];)if(a?h.nodeName.toLowerCase()===y:1===h.nodeType)return!1;d=g="only"===t&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&v){for(l=m[P]||(m[P]={}),c=l[t]||[],p=c[0]===V&&c[1],f=c[0]===V&&c[2],h=p&&m.childNodes[p];h=++p&&h&&h[g]||(f=p=0)||d.pop();)if(1===h.nodeType&&++f&&h===e){l[t]=[V,p,f];break}}else if(v&&(c=(e[P]||(e[P]={}))[t])&&c[0]===V)f=c[1];else for(;(h=++p&&h&&h[g]||(f=p=0)||d.pop())&&((a?h.nodeName.toLowerCase()!==y:1!==h.nodeType)||!++f||(v&&((h[P]||(h[P]={}))[t]=[V,f]),h!==e)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=E.pseudos[t]||E.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[P]?o(n):o.length>1?(i=[t,t,"",n],E.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),s=i.length;s--;)r=tt(t,i[s]),t[r]=!(e[r]=i[s])}):function(t){return o(t,0,i)}):o}},pseudos:{not:r(function(t){var e=[],n=[],i=A(t.replace(ut,"$1"));return i[P]?r(function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){return t=t.replace(wt,Et),function(e){return(e.textContent||e.innerText||x(e)).indexOf(t)>-1}}),lang:r(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(wt,Et).toLowerCase(),function(e){var n;do if(n=j?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===R},focus:function(t){return t===F.activeElement&&(!F.hasFocus||F.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!E.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return gt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:c(function(){return[0]}),last:c(function(t,e){return[e-1]}),eq:c(function(t,e,n){return[0>n?n+e:n]}),even:c(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:c(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:c(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:c(function(t,e,n){for(var r=0>n?n+e:n;++r2&&"ID"===(s=o[0]).type&&w.getById&&9===e.nodeType&&j&&E.relative[o[1].type]){if(e=(E.find.ID(s.matches[0].replace(wt,Et),e)||[])[0],!e)return n;c&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(i=dt.needsContext.test(t)?0:o.length;i--&&(s=o[i],!E.relative[a=s.type]);)if((u=E.find[a])&&(r=u(s.matches[0].replace(wt,Et),_t.test(o[0].type)&&l(e.parentNode)||e))){if(o.splice(i,1),t=r.length&&f(o),!t)return Z.apply(n,r),n;break}}return(c||A(t,h))(r,e,!j,n,_t.test(t)&&l(e.parentNode)||e),n},w.sortStable=P.split("").sort(H).join("")===P,w.detectDuplicates=!!M,O(),w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(F.createElement("div"))}),i(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&i(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),i(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),e}(t);B.find=U,B.expr=U.selectors,B.expr[":"]=B.expr.pseudos,B.unique=U.uniqueSort,B.text=U.getText,B.isXMLDoc=U.isXML,B.contains=U.contains;var V=B.expr.match.needsContext,q=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Y=/^.[^:#\[\.,]*$/;B.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?B.find.matchesSelector(r,t)?[r]:[]:B.find.matches(t,B.grep(e,function(t){return 1===t.nodeType}))},B.fn.extend({find:function(t){var e,n=this.length,r=[],i=this;if("string"!=typeof t)return this.pushStack(B(t).filter(function(){for(e=0;n>e;e++)if(B.contains(i[e],this))return!0}));for(e=0;n>e;e++)B.find(t,i[e],r);return r=this.pushStack(n>1?B.unique(r):r),r.selector=this.selector?this.selector+" "+t:t,r},filter:function(t){return this.pushStack(r(this,t||[],!1))},not:function(t){return this.pushStack(r(this,t||[],!0))},is:function(t){return!!r(this,"string"==typeof t&&V.test(t)?B(t):t||[],!1).length}});var $,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,H=B.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:z.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||$).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof B?e[0]:e,B.merge(this,B.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:R,!0)),q.test(n[1])&&B.isPlainObject(e))for(n in e)B.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=R.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=R,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):B.isFunction(t)?"undefined"!=typeof $.ready?$.ready(t):t(B):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),B.makeArray(t,this))};H.prototype=B.fn,$=B(R);var W=/^(?:parents|prev(?:Until|All))/,G={children:!0,contents:!0,next:!0,prev:!0};B.extend({dir:function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&B(t).is(n))break;r.push(t)}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),B.fn.extend({has:function(t){var e=B(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(B.contains(this,e[t]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],s=V.test(t)||"string"!=typeof t?B(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&B.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?B.unique(o):o)},index:function(t){return t?"string"==typeof t?S.call(B(t),this[0]):S.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(B.unique(B.merge(this.get(),B(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),B.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return B.dir(t,"parentNode")},parentsUntil:function(t,e,n){return B.dir(t,"parentNode",n)},next:function(t){return i(t,"nextSibling")},prev:function(t){return i(t,"previousSibling")},nextAll:function(t){return B.dir(t,"nextSibling")},prevAll:function(t){return B.dir(t,"previousSibling")},nextUntil:function(t,e,n){return B.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return B.dir(t,"previousSibling",n)},siblings:function(t){return B.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return B.sibling(t.firstChild)},contents:function(t){return t.contentDocument||B.merge([],t.childNodes)}},function(t,e){B.fn[t]=function(n,r){var i=B.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=B.filter(r,i)),this.length>1&&(G[t]||B.unique(i),W.test(t)&&i.reverse()),this.pushStack(i)}});var X=/\S+/g,J={};B.Callbacks=function(t){t="string"==typeof t?J[t]||o(t):B.extend({},t);var e,n,r,i,s,a,u=[],c=!t.once&&[],l=function(o){for(e=t.memory&&o,n=!0,a=i||0,i=0,s=u.length,r=!0;u&&s>a;a++)if(u[a].apply(o[0],o[1])===!1&&t.stopOnFalse){e=!1;break}r=!1,u&&(c?c.length&&l(c.shift()):e?u=[]:h.disable())},h={add:function(){if(u){var n=u.length;!function o(e){B.each(e,function(e,n){var r=B.type(n);"function"===r?t.unique&&h.has(n)||u.push(n):n&&n.length&&"string"!==r&&o(n)})}(arguments),r?s=u.length:e&&(i=n,l(e))}return this},remove:function(){return u&&B.each(arguments,function(t,e){for(var n;(n=B.inArray(e,u,n))>-1;)u.splice(n,1),r&&(s>=n&&s--,a>=n&&a--)}),this},has:function(t){return t?B.inArray(t,u)>-1:!(!u||!u.length)},empty:function(){return u=[],s=0,this},disable:function(){return u=c=e=void 0,this},disabled:function(){return!u},lock:function(){return c=void 0,e||h.disable(),this},locked:function(){return!c},fireWith:function(t,e){return!u||n&&!c||(e=e||[],e=[t,e.slice?e.slice():e],r?c.push(e):l(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},B.extend({Deferred:function(t){var e=[["resolve","done",B.Callbacks("once memory"),"resolved"],["reject","fail",B.Callbacks("once memory"),"rejected"],["notify","progress",B.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return B.Deferred(function(n){B.each(e,function(e,o){var s=B.isFunction(t[e])&&t[e];i[o[1]](function(){var t=s&&s.apply(this,arguments);t&&B.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?B.extend(t,r):r}},i={};return r.pipe=r.then,B.each(e,function(t,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=k.call(arguments),s=o.length,a=1!==s||t&&B.isFunction(t.promise)?s:0,u=1===a?t:B.Deferred(),c=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?k.call(arguments):i,r===e?u.notifyWith(n,r):--a||u.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),r=new Array(s);s>i;i++)o[i]&&B.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(u.reject).progress(c(i,n,e)):--a;return a||u.resolveWith(r,o),u.promise()}});var K=B.access=function(t,e,n,r,i,o,s){var a=0,u=t.length,c=null==n;if("object"===B.type(n)){i=!0;for(a in n)B.access(t,e,a,n[a],!0,o,s)}else if(void 0!==r&&(i=!0,B.isFunction(r)||(s=!0),c&&(s?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(B(t),n)})),e))for(;u>a;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return i?t:c?e.call(t):u?e(t[0],n):o};B.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType},s.uid=1,s.accepts=B.acceptData,s.prototype={key:function(t){if(!s.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=s.uid++;try{e[this.expando]={value:n},Object.defineProperties(t,e)}catch(r){e[this.expando]=n,B.extend(t,e)}}return this.cache[n]||(this.cache[n]={}),n},set:function(t,e,n){var r,i=this.key(t),o=this.cache[i];if("string"==typeof e)o[e]=n;else if(B.isEmptyObject(o))B.extend(this.cache[i],e);else for(r in e)o[r]=e[r];return o},get:function(t,e){var n=this.cache[this.key(t)];return void 0===e?n:n[e]},access:function(t,e,n){var r;return void 0===e||e&&"string"==typeof e&&void 0===n?(r=this.get(t,e),void 0!==r?r:this.get(t,B.camelCase(e))):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r,i,o=this.key(t),s=this.cache[o];if(void 0===e)this.cache[o]={};else{B.isArray(e)?r=e.concat(e.map(B.camelCase)):(i=B.camelCase(e),e in s?r=[e,i]:(r=i,r=r in s?[r]:r.match(X)||[])),n=r.length;for(;n--;)delete s[r[n]]}},hasData:function(t){return!B.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var Z=new s,Q=new s,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/([A-Z])/g;B.extend({hasData:function(t){return Q.hasData(t)||Z.hasData(t)},data:function(t,e,n){return Q.access(t,e,n)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,n){return Z.access(t,e,n)},_removeData:function(t,e){Z.remove(t,e)}}),B.fn.extend({data:function(t,e){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Z.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&(r=s[n].name,0===r.indexOf("data-")&&(r=B.camelCase(r.slice(5)),a(o,r,i[r])));Z.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each(function(){Q.set(this,t)}):K(this,function(e){var n,r=B.camelCase(t);if(o&&void 0===e){if(n=Q.get(o,t),void 0!==n)return n;if(n=Q.get(o,r),void 0!==n)return n;if(n=a(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=Q.get(this,r);Q.set(this,r,e),-1!==t.indexOf("-")&&void 0!==n&&Q.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Q.remove(this,t)})}}),B.extend({queue:function(t,e,n){var r;return t?(e=(e||"fx")+"queue",r=Z.get(t,e),n&&(!r||B.isArray(n)?r=Z.access(t,e,B.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=B.queue(t,e),r=n.length,i=n.shift(),o=B._queueHooks(t,e),s=function(){B.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Z.get(t,n)||Z.access(t,n,{empty:B.Callbacks("once memory").add(function(){Z.remove(t,[e+"queue",n])})})}}),B.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.lengthx",F.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var rt="undefined";F.focusinBubbles="onfocusin"in t;var it=/^key/,ot=/^(?:mouse|pointer|contextmenu)|click/,st=/^(?:focusinfocus|focusoutblur)$/,at=/^([^.]*)(?:\.(.+)|)$/;B.event={global:{},add:function(t,e,n,r,i){var o,s,a,u,c,l,h,f,p,d,g,m=Z.get(t);if(m)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=B.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(e){return typeof B!==rt&&B.event.triggered!==e.type?B.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(X)||[""],c=e.length;c--;)a=at.exec(e[c])||[],p=g=a[1],d=(a[2]||"").split(".").sort(),p&&(h=B.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,h=B.event.special[p]||{},l=B.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&B.expr.match.needsContext.test(i),namespace:d.join(".")},o),(f=u[p])||(f=u[p]=[],f.delegateCount=0,h.setup&&h.setup.call(t,r,d,s)!==!1||t.addEventListener&&t.addEventListener(p,s,!1)),h.add&&(h.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),B.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,s,a,u,c,l,h,f,p,d,g,m=Z.hasData(t)&&Z.get(t);if(m&&(u=m.events)){for(e=(e||"").match(X)||[""],c=e.length;c--;)if(a=at.exec(e[c])||[],p=g=a[1],d=(a[2]||"").split(".").sort(),p){for(h=B.event.special[p]||{},p=(r?h.delegateType:h.bindType)||p,f=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)l=f[o],!i&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,h.remove&&h.remove.call(t,l));s&&!f.length&&(h.teardown&&h.teardown.call(t,d,m.handle)!==!1||B.removeEvent(t,p,m.handle),delete u[p])}else for(p in u)B.event.remove(t,p+e[c],n,r,!0);B.isEmptyObject(u)&&(delete m.handle,Z.remove(t,"events"))}},trigger:function(e,n,r,i){var o,s,a,u,c,l,h,f=[r||R],p=O.call(e,"type")?e.type:e,d=O.call(e,"namespace")?e.namespace.split("."):[];if(s=a=r=r||R,3!==r.nodeType&&8!==r.nodeType&&!st.test(p+B.event.triggered)&&(p.indexOf(".")>=0&&(d=p.split("."),p=d.shift(),d.sort()),c=p.indexOf(":")<0&&"on"+p,e=e[B.expando]?e:new B.Event(p,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=d.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:B.makeArray(n,[e]),h=B.event.special[p]||{},i||!h.trigger||h.trigger.apply(r,n)!==!1)){if(!i&&!h.noBubble&&!B.isWindow(r)){for(u=h.delegateType||p,st.test(u+p)||(s=s.parentNode);s;s=s.parentNode)f.push(s),a=s;a===(r.ownerDocument||R)&&f.push(a.defaultView||a.parentWindow||t)}for(o=0;(s=f[o++])&&!e.isPropagationStopped();)e.type=o>1?u:h.bindType||p,l=(Z.get(s,"events")||{})[e.type]&&Z.get(s,"handle"),l&&l.apply(s,n),l=c&&s[c],l&&l.apply&&B.acceptData(s)&&(e.result=l.apply(s,n),e.result===!1&&e.preventDefault());return e.type=p,i||e.isDefaultPrevented()||h._default&&h._default.apply(f.pop(),n)!==!1||!B.acceptData(r)||c&&B.isFunction(r[p])&&!B.isWindow(r)&&(a=r[c],a&&(r[c]=null),B.event.triggered=p,r[p](),B.event.triggered=void 0,a&&(r[c]=a)),e.result}},dispatch:function(t){t=B.event.fix(t);var e,n,r,i,o,s=[],a=k.call(arguments),u=(Z.get(this,"events")||{})[t.type]||[],c=B.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,t)!==!1){for(s=B.event.handlers.call(this,t,u),e=0;(i=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(o.namespace))&&(t.handleObj=o,t.data=o.data,r=((B.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),void 0!==r&&(t.result=r)===!1&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,r,i,o,s=[],a=e.delegateCount,u=t.target;if(a&&u.nodeType&&(!t.button||"click"!==t.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==t.type){for(r=[],n=0;a>n;n++)o=e[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?B(i,this).index(u)>=0:B.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a]*)\/>/gi,ct=/<([\w:]+)/,lt=/<|&#?\w+;/,ht=/<(?:script|style|link)/i,ft=/checked\s*(?:[^=]|=\s*.checked.)/i,pt=/^$|\/(?:java|ecma)script/i,dt=/^true\/(.*)/,gt=/^\s*\s*$/g,mt={option:[1,""],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};mt.optgroup=mt.option,mt.tbody=mt.tfoot=mt.colgroup=mt.caption=mt.thead,mt.th=mt.td,B.extend({clone:function(t,e,n){var r,i,o,s,a=t.cloneNode(!0),u=B.contains(t.ownerDocument,t);if(!(F.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||B.isXMLDoc(t)))for(s=m(a),o=m(t),r=0,i=o.length;i>r;r++)y(o[r],s[r]);if(e)if(n)for(o=o||m(t),s=s||m(a),r=0,i=o.length;i>r;r++)g(o[r],s[r]);else g(t,a);return s=m(a,"script"),s.length>0&&d(s,!u&&m(t,"script")),a},buildFragment:function(t,e,n,r){for(var i,o,s,a,u,c,l=e.createDocumentFragment(),h=[],f=0,p=t.length;p>f;f++)if(i=t[f],i||0===i)if("object"===B.type(i))B.merge(h,i.nodeType?[i]:i);else if(lt.test(i)){for(o=o||l.appendChild(e.createElement("div")),s=(ct.exec(i)||["",""])[1].toLowerCase(),a=mt[s]||mt._default,o.innerHTML=a[1]+i.replace(ut,"<$1>")+a[2],c=a[0];c--;)o=o.lastChild;B.merge(h,o.childNodes),o=l.firstChild,o.textContent=""}else h.push(e.createTextNode(i));for(l.textContent="",f=0;i=h[f++];)if((!r||-1===B.inArray(i,r))&&(u=B.contains(i.ownerDocument,i),o=m(l.appendChild(i),"script"),u&&d(o),n))for(c=0;i=o[c++];)pt.test(i.type||"")&&n.push(i);return l},cleanData:function(t){for(var e,n,r,i,o=B.event.special,s=0;void 0!==(n=t[s]);s++){if(B.acceptData(n)&&(i=n[Z.expando],i&&(e=Z.cache[i]))){if(e.events)for(r in e.events)o[r]?B.event.remove(n,r):B.removeEvent(n,r,e.handle);Z.cache[i]&&delete Z.cache[i]}delete Q.cache[n[Q.expando]]}}}),B.fn.extend({text:function(t){return K(this,function(t){return void 0===t?B.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?B.filter(t,this):this,i=0;null!=(n=r[i]);i++)e||1!==n.nodeType||B.cleanData(m(n)),n.parentNode&&(e&&B.contains(n.ownerDocument,n)&&d(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(B.cleanData(m(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return B.clone(this,t,e)})},html:function(t){return K(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!ht.test(t)&&!mt[(ct.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(ut,"<$1>");try{for(;r>n;n++)e=this[n]||{},1===e.nodeType&&(B.cleanData(m(e,!1)),e.innerHTML=t);e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,B.cleanData(m(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=A.apply([],t);var n,r,i,o,s,a,u=0,c=this.length,l=this,h=c-1,d=t[0],g=B.isFunction(d);if(g||c>1&&"string"==typeof d&&!F.checkClone&&ft.test(d))return this.each(function(n){var r=l.eq(n);g&&(t[0]=d.call(this,n,r.html())),r.domManip(t,e)});if(c&&(n=B.buildFragment(t,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=B.map(m(n,"script"),f),o=i.length;c>u;u++)s=n,u!==h&&(s=B.clone(s,!0,!0),o&&B.merge(i,m(s,"script"))),e.call(this[u],s,u);if(o)for(a=i[i.length-1].ownerDocument,B.map(i,p),u=0;o>u;u++)s=i[u],pt.test(s.type||"")&&!Z.access(s,"globalEval")&&B.contains(a,s)&&(s.src?B._evalUrl&&B._evalUrl(s.src):B.globalEval(s.textContent.replace(gt,"")))}return this}}),B.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){B.fn[t]=function(t){for(var n,r=[],i=B(t),o=i.length-1,s=0;o>=s;s++)n=s===o?this:this.clone(!0),B(i[s])[e](n),T.apply(r,n.get());return this.pushStack(r)}}),B.fn.delay=function(t,e){return t=B.fx?B.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},function(){var t=R.createElement("input"),e=R.createElement("select"),n=e.appendChild(R.createElement("option"));t.type="checkbox",F.checkOn=""!==t.value,F.optSelected=n.selected,e.disabled=!0,F.optDisabled=!n.disabled,t=R.createElement("input"),t.value="t",t.type="radio",F.radioValue="t"===t.value}();var yt,vt,_t=B.expr.attrHandle;B.fn.extend({attr:function(t,e){return K(this,B.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){B.removeAttr(this,t)})}}),B.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===rt?B.prop(t,e,n):(1===o&&B.isXMLDoc(t)||(e=e.toLowerCase(),r=B.attrHooks[e]||(B.expr.match.bool.test(e)?vt:yt)),void 0===n?r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=B.find.attr(t,e),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):void B.removeAttr(t,e))},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(X);if(o&&1===t.nodeType)for(;n=o[i++];)r=B.propFix[n]||n,B.expr.match.bool.test(n)&&(t[r]=!1),t.removeAttribute(n)},attrHooks:{type:{set:function(t,e){if(!F.radioValue&&"radio"===e&&B.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),vt={set:function(t,e,n){return e===!1?B.removeAttr(t,n):t.setAttribute(n,n),n}},B.each(B.expr.match.bool.source.match(/\w+/g),function(t,e){var n=_t[e]||B.find.attr;_t[e]=function(t,e,r){var i,o;return r||(o=_t[e],_t[e]=i,i=null!=n(t,e,r)?e.toLowerCase():null,_t[e]=o),i}});var bt=/^(?:input|select|textarea|button)$/i;B.fn.extend({prop:function(t,e){return K(this,B.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[B.propFix[t]||t]})}}),B.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return o=1!==s||!B.isXMLDoc(t),o&&(e=B.propFix[e]||e,i=B.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||bt.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),F.optSelected||(B.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),B.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){B.propFix[this.toLowerCase()]=this});var wt=/[\t\r\n\f]/g;B.fn.extend({addClass:function(t){var e,n,r,i,o,s,a="string"==typeof t&&t,u=0,c=this.length;if(B.isFunction(t))return this.each(function(e){B(this).addClass(t.call(this,e,this.className))});if(a)for(e=(t||"").match(X)||[];c>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(wt," "):" ")){for(o=0;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");s=B.trim(r),n.className!==s&&(n.className=s)}return this},removeClass:function(t){var e,n,r,i,o,s,a=0===arguments.length||"string"==typeof t&&t,u=0,c=this.length;if(B.isFunction(t))return this.each(function(e){B(this).removeClass(t.call(this,e,this.className))});if(a)for(e=(t||"").match(X)||[];c>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(wt," "):"")){for(o=0;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");s=t?B.trim(r):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):B.isFunction(t)?this.each(function(n){B(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var e,r=0,i=B(this),o=t.match(X)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else(n===rt||"boolean"===n)&&(this.className&&Z.set(this,"__className__",this.className),this.className=this.className||t===!1?"":Z.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(wt," ").indexOf(e)>=0)return!0;return!1}});var Et=/\r/g;B.fn.extend({val:function(t){var e,n,r,i=this[0];{if(arguments.length)return r=B.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(i=r?t.call(this,n,B(this).val()):t,null==i?i="":"number"==typeof i?i+="":B.isArray(i)&&(i=B.map(i,function(t){return null==t?"":t+""})),e=B.valHooks[this.type]||B.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))});if(i)return e=B.valHooks[i.type]||B.valHooks[i.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Et,""):null==n?"":n)}}}),B.extend({valHooks:{option:{get:function(t){var e=B.find.attr(t,"value");return null!=e?e:B.trim(B.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;a>u;u++)if(n=r[u],(n.selected||u===i)&&(F.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!B.nodeName(n.parentNode,"optgroup"))){if(e=B(n).val(),o)return e;s.push(e)}return s},set:function(t,e){for(var n,r,i=t.options,o=B.makeArray(e),s=i.length;s--;)r=i[s],(r.selected=B.inArray(r.value,o)>=0)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),B.each(["radio","checkbox"],function(){B.valHooks[this]={set:function(t,e){return B.isArray(e)?t.checked=B.inArray(B(t).val(),e)>=0:void 0}},F.checkOn||(B.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var xt=B.now(),Ct=/\?/;B.parseJSON=function(t){return JSON.parse(t+"")},B.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{n=new DOMParser,e=n.parseFromString(t,"text/xml")}catch(r){e=void 0}return(!e||e.getElementsByTagName("parsererror").length)&&B.error("Invalid XML: "+t),e};var kt=/#.*$/,At=/([?&])_=[^&]*/,Tt=/^(.*?):[ \t]*([^\r\n]*)$/gm,St=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Dt=/^(?:GET|HEAD)$/,Mt=/^\/\//,Ot=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ft={},Rt={},jt="*/".concat("*"),Bt=t.location.href,Nt=Ot.exec(Bt.toLowerCase())||[];B.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Bt,type:"GET",isLocal:St.test(Nt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":jt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":B.parseJSON,"text xml":B.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?b(b(t,B.ajaxSettings),e):b(B.ajaxSettings,t)},ajaxPrefilter:v(Ft),ajaxTransport:v(Rt),ajax:function(t,e){function n(t,e,n,s){var u,l,y,v,_,x=e;2!==b&&(b=2,a&&clearTimeout(a),r=void 0,o=s||"",C.readyState=t>0?4:0,u=t>=200&&300>t||304===t,n&&(v=w(h,C,n)),v=E(h,v,C,u),u?(h.ifModified&&(_=C.getResponseHeader("Last-Modified"),_&&(B.lastModified[i]=_),_=C.getResponseHeader("etag"),_&&(B.etag[i]=_)),204===t||"HEAD"===h.type?x="nocontent":304===t?x="notmodified":(x=v.state,l=v.data,y=v.error,u=!y)):(y=x,(t||!x)&&(x="error",0>t&&(t=0))),C.status=t,C.statusText=(e||x)+"",u?d.resolveWith(f,[l,x,C]):d.rejectWith(f,[C,x,y]),C.statusCode(m),m=void 0,c&&p.trigger(u?"ajaxSuccess":"ajaxError",[C,h,u?l:y]),g.fireWith(f,[C,x]),c&&(p.trigger("ajaxComplete",[C,h]),--B.active||B.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,s,a,u,c,l,h=B.ajaxSetup({},e),f=h.context||h,p=h.context&&(f.nodeType||f.jquery)?B(f):B.event,d=B.Deferred(),g=B.Callbacks("once memory"),m=h.statusCode||{},y={},v={},b=0,x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!s)for(s={};e=Tt.exec(o);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return b||(t=v[n]=v[n]||t,y[t]=e),this},overrideMimeType:function(t){return b||(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)m[e]=[m[e],t[e]];else C.always(t[C.status]);return this},abort:function(t){var e=t||x;return r&&r.abort(e),n(0,e),this}};if(d.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,h.url=((t||h.url||Bt)+"").replace(kt,"").replace(Mt,Nt[1]+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=B.trim(h.dataType||"*").toLowerCase().match(X)||[""],null==h.crossDomain&&(u=Ot.exec(h.url.toLowerCase()),h.crossDomain=!(!u||u[1]===Nt[1]&&u[2]===Nt[2]&&(u[3]||("http:"===u[1]?"80":"443"))===(Nt[3]||("http:"===Nt[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=B.param(h.data,h.traditional)),_(Ft,h,e,C),2===b)return C;c=B.event&&h.global,c&&0===B.active++&&B.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Dt.test(h.type),i=h.url,h.hasContent||(h.data&&(i=h.url+=(Ct.test(i)?"&":"?")+h.data,delete h.data),h.cache===!1&&(h.url=At.test(i)?i.replace(At,"$1_="+xt++):i+(Ct.test(i)?"&":"?")+"_="+xt++)),h.ifModified&&(B.lastModified[i]&&C.setRequestHeader("If-Modified-Since",B.lastModified[i]),B.etag[i]&&C.setRequestHeader("If-None-Match",B.etag[i])),(h.data&&h.hasContent&&h.contentType!==!1||e.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+jt+"; q=0.01":""):h.accepts["*"]);for(l in h.headers)C.setRequestHeader(l,h.headers[l]);if(h.beforeSend&&(h.beforeSend.call(f,C,h)===!1||2===b))return C.abort();x="abort";for(l in{success:1,error:1,complete:1})C[l](h[l]);if(r=_(Rt,h,e,C)){C.readyState=1,c&&p.trigger("ajaxSend",[C,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){C.abort("timeout")},h.timeout));try{b=1,r.send(y,n)}catch(k){if(!(2>b))throw k;n(-1,k)}}else n(-1,"No Transport");return C},getJSON:function(t,e,n){return B.get(t,e,n,"json")},getScript:function(t,e){return B.get(t,void 0,e,"script")}}),B.each(["get","post"],function(t,e){B[e]=function(t,n,r,i){return B.isFunction(n)&&(i=i||r,r=n,n=void 0),B.ajax({url:t,type:e,dataType:i,data:n,success:r})}}),B._evalUrl=function(t){return B.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};var It=/%20/g,Lt=/\[\]$/,Pt=/\r?\n/g,Ut=/^(?:submit|button|image|reset|file)$/i,Vt=/^(?:input|select|textarea|keygen)/i;B.param=function(t,e){var n,r=[],i=function(t,e){e=B.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=B.ajaxSettings&&B.ajaxSettings.traditional),B.isArray(t)||t.jquery&&!B.isPlainObject(t))B.each(t,function(){i(this.name,this.value)});else for(n in t)x(n,t[n],e,i);return r.join("&").replace(It,"+")},B.fn.extend({serialize:function(){return B.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=B.prop(this,"elements");return t?B.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!B(this).is(":disabled")&&Vt.test(this.nodeName)&&!Ut.test(t)&&(this.checked||!nt.test(t))}).map(function(t,e){var n=B(this).val();return null==n?null:B.isArray(n)?B.map(n,function(t){return{name:e.name,value:t.replace(Pt,"\r\n")}}):{name:e.name,value:n.replace(Pt,"\r\n")}}).get()}}),B.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var qt=0,Yt={},$t={0:200,1223:204},zt=B.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in Yt)Yt[t]()}),F.cors=!!zt&&"withCredentials"in zt,F.ajax=zt=!!zt,B.ajaxTransport(function(t){var e;return F.cors||zt&&!t.crossDomain?{send:function(n,r){var i,o=t.xhr(),s=++qt;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);e=function(t){return function(){e&&(delete Yt[s],e=o.onload=o.onerror=null,"abort"===t?o.abort():"error"===t?r(o.status,o.statusText):r($t[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=e(),o.onerror=e("error"),e=Yt[s]=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(a){if(e)throw a}},abort:function(){e&&e()}}:void 0}),B.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||R;var r=q.exec(t),i=!n&&[];return r?[e.createElement(r[1])]:(r=B.buildFragment([t],e,i),i&&i.length&&B(i).remove(),B.merge([],r.childNodes))};var Ht=B.fn.load;B.fn.load=function(t,e,n){if("string"!=typeof t&&Ht)return Ht.apply(this,arguments);var r,i,o,s=this,a=t.indexOf(" ");return a>=0&&(r=B.trim(t.slice(a)),t=t.slice(0,a)),B.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),s.length>0&&B.ajax({url:t,type:i,dataType:"html",data:e}).done(function(t){o=arguments,s.html(r?B("
      ").append(B.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){s.each(n,o||[t.responseText,e,t])}),this},B.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){B.fn[e]=function(t){return this.on(e,t)}}),"function"==typeof define&&define.amd&&define("jquery",[],function(){return B});var Wt=t.jQuery,Gt=t.$;return B.noConflict=function(e){return t.$===B&&(t.$=Gt),e&&t.jQuery===B&&(t.jQuery=Wt),B},typeof e===rt&&(t.jQuery=t.$=B),B}),function(t){var e="object"==typeof self&&self.self==self&&self||"object"==typeof global&&global.global==global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if("undefined"!=typeof exports){var n,r=require("underscore");try{n=require("jquery")}catch(i){}t(e,exports,r,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.2.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],u(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],u(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}},a=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=s(e,i,r))})},u=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},l=e.Events={},h=/\s+/,f=function(t,e,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);ar;r++)n[r]=arguments[r+1];return f(y,this._events,t,void 0,n),this};var y=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&v(i,r),o&&v(o,[e].concat(r))}return t},v=function(t,e){var n,r=-1,i=t.length,o=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++ro;o++)t[o+n]=e[o];for(o=0;oi&&(i+=this.length+1);for(var o,s=[],a=[],u=[],c={},l=e.add,h=e.merge,f=e.remove,p=!1,d=this.comparator&&null==i&&e.sort!==!1,g=n.isString(this.comparator)?this.comparator:null,m=0;mt&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t), -this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){t=n.extend({parse:!0},t);var e=t.success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},V(this,t),this.sync("read",this,t)},create:function(t,e){e=e?n.clone(e):{};var r=e.wait;if(t=this._prepareModel(t,e),!t)return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?n.clone(e):{},e.collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(I,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};return this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.options.silent?void 0:this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),B.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment?!1:(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return this.matchRoot()?(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0})):!1},navigate:function(t,e){if(!B.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;(""===t||"?"===t.charAt(0))&&(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(L,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new B;var P=function(t,e){var r,i=this;r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e);var o=function(){this.constructor=r};return o.prototype=i.prototype,r.prototype=new o,t&&n.extend(r.prototype,t),r.__super__=i.prototype,r};_.extend=w.extend=M.extend=A.extend=B.extend=P;var U=function(){throw new Error('A "url" property or function must be specified')},V=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}),function(t,e){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(t,n){return e(t,n)});else if("undefined"!=typeof exports){var n=require("backbone"),r=require("underscore");module.exports=e(n,r)}else e(t.Backbone,t._)}(this,function(t,e){"use strict";var n=t.ChildViewContainer;return t.ChildViewContainer=function(t,e){var n=function(t){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(t,this.add,this)};e.extend(n.prototype,{add:function(t,e){var n=t.cid;return this._views[n]=t,t.model&&(this._indexByModel[t.model.cid]=n),e&&(this._indexByCustom[e]=n),this._updateLength(),this},findByModel:function(t){return this.findByModelCid(t.cid)},findByModelCid:function(t){var e=this._indexByModel[t];return this.findByCid(e)},findByCustom:function(t){var e=this._indexByCustom[t];return this.findByCid(e)},findByIndex:function(t){return e.values(this._views)[t]},findByCid:function(t){return this._views[t]},remove:function(t){var n=t.cid;return t.model&&delete this._indexByModel[t.model.cid],e.any(this._indexByCustom,function(t,e){return t===n?(delete this._indexByCustom[e],!0):void 0},this),delete this._views[n],this._updateLength(),this},call:function(t){this.apply(t,e.tail(arguments))},apply:function(t,n){e.each(this._views,function(r){e.isFunction(r[t])&&r[t].apply(r,n||[])})},_updateLength:function(){this.length=e.size(this._views)}});var r=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck","reduce"];return e.each(r,function(t){n.prototype[t]=function(){var n=e.values(this._views),r=[n].concat(e.toArray(arguments));return e[t].apply(e,r)}}),n}(t,e),t.ChildViewContainer.VERSION="0.1.10",t.ChildViewContainer.noConflict=function(){return t.ChildViewContainer=n,this},t.ChildViewContainer}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],e):t.Backbone.Radio=e(t._,t.Backbone)}(this,function(t,e){"use strict";function n(t,e,n,r){var i=t[e];return n&&n!==i.callback&&n!==i.callback._callback||r&&r!==i.context?void 0:(delete t[e],!0)}function r(e,r,i,o){e||(e={});for(var s=r?[r]:t.keys(e),a=!1,u=0,c=s.length;c>u;u++)r=s[u],e[r]&&n(e,r,i,o)&&(a=!0);return a}function i(e){return c[e]||(c[e]=t.partial(a.log,e))}function o(e){return t.isFunction(e)?e:function(){return e}}var s=e.Radio,a=e.Radio={};a.VERSION="1.0.2",a.noConflict=function(){return e.Radio=s,this},a.DEBUG=!1,a._debugText=function(t,e,n){return t+(n?" on the "+n+" channel":"")+': "'+e+'"'},a.debugLog=function(t,e,n){a.DEBUG&&console&&console.warn&&console.warn(a._debugText(t,e,n))};var u=/\s+/;a._eventsApi=function(e,n,r,i){if(!r)return!1;var o={};if("object"==typeof r){for(var s in r){var a=e[n].apply(e,[s,r[s]].concat(i));u.test(s)?t.extend(o,a):o[s]=a}return o}if(u.test(r)){for(var c=r.split(u),l=0,h=c.length;h>l;l++)o[c[l]]=e[n].apply(e,[c[l]].concat(i));return o}return!1},a._callHandler=function(t,e,n){var r=n[0],i=n[1],o=n[2];switch(n.length){case 0:return t.call(e);case 1:return t.call(e,r);case 2:return t.call(e,r,i);case 3:return t.call(e,r,i,o);default:return t.apply(e,n)}};var c={};t.extend(a,{log:function(e,n){var r=t.rest(arguments,2);console.log("["+e+'] "'+n+'"',r)},tuneIn:function(t){var e=a.channel(t);return e._tunedIn=!0,e.on("all",i(t)),this},tuneOut:function(t){var e=a.channel(t);return e._tunedIn=!1,e.off("all",i(t)),delete c[t],this}}),a.Requests={request:function(e){var n=t.rest(arguments),r=a._eventsApi(this,"request",e,n);if(r)return r;var i=this.channelName,o=this._requests;if(i&&this._tunedIn&&a.log.apply(this,[i,e].concat(n)),o&&(o[e]||o["default"])){var s=o[e]||o["default"];return n=o[e]?n:arguments,a._callHandler(s.callback,s.context,n)}a.debugLog("An unhandled request was fired",e,i)},reply:function(t,e,n){return a._eventsApi(this,"reply",t,[e,n])?this:(this._requests||(this._requests={}),this._requests[t]&&a.debugLog("A request was overwritten",t,this.channelName),this._requests[t]={callback:o(e),context:n||this},this)},replyOnce:function(e,n,r){if(a._eventsApi(this,"replyOnce",e,[n,r]))return this;var i=this,s=t.once(function(){return i.stopReplying(e),o(n).apply(this,arguments)});return this.reply(e,s,r)},stopReplying:function(t,e,n){return a._eventsApi(this,"stopReplying",t)?this:(t||e||n?r(this._requests,t,e,n)||a.debugLog("Attempted to remove the unregistered request",t,this.channelName):delete this._requests,this)}},a._channels={},a.channel=function(t){if(!t)throw new Error("You must provide a name for the channel.");return a._channels[t]?a._channels[t]:a._channels[t]=new a.Channel(t)},a.Channel=function(t){this.channelName=t},t.extend(a.Channel.prototype,e.Events,a.Requests,{reset:function(){return this.off(),this.stopListening(),this.stopReplying(),this}});var l,h,f=[e.Events,a.Commands,a.Requests];t.each(f,function(e){t.each(e,function(e,n){a[n]=function(e){return h=t.rest(arguments),l=this.channel(e),l[n].apply(l,h)}})}),a.reset=function(e){var n=e?[this._channels[e]]:this._channels;t.invoke(n,"reset")};var p=a;return p}),function(t,e){if("function"==typeof define&&define.amd)define(["backbone","underscore","backbone.wreqr","backbone.babysitter"],function(n,r){return t.Marionette=t.Mn=e(t,n,r)});else if("undefined"!=typeof exports){var n=require("backbone"),r=require("underscore");require("backbone.wreqr"),require("backbone.babysitter");module.exports=e(t,n,r)}else t.Marionette=t.Mn=e(t,t.Backbone,t._)}(this,function(t,e,n){"use strict";var r=t.Marionette,i=t.Mn,o=e.Marionette={};o.VERSION="2.4.4",o.noConflict=function(){return t.Marionette=r,t.Mn=i,this},o.Deferred=e.$.Deferred,o.FEATURES={},o.isEnabled=function(t){return!!o.FEATURES[t]},o.extend=e.Model.extend,o.isNodeAttached=function(t){return e.$.contains(document.documentElement,t)},o.mergeOptions=function(t,e){t&&n.extend(this,n.pick(t,e))},o.getOption=function(t,e){return t&&e?t.options&&void 0!==t.options[e]?t.options[e]:t[e]:void 0},o.proxyGetOption=function(t){return o.getOption(this,t)},o._getValue=function(t,e,r){return n.isFunction(t)&&(t=r?t.apply(e,r):t.call(e)),t},o.normalizeMethods=function(t){return n.reduce(t,function(t,e,r){return n.isFunction(e)||(e=this[e]),e&&(t[r]=e),t},{},this)},o.normalizeUIString=function(t,e){return t.replace(/@ui\.[a-zA-Z_$0-9]*/g,function(t){return e[t.slice(4)]})},o.normalizeUIKeys=function(t,e){return n.reduce(t,function(t,n,r){var i=o.normalizeUIString(r,e);return t[i]=n,t},{})},o.normalizeUIValues=function(t,e,r){return n.each(t,function(i,s){n.isString(i)?t[s]=o.normalizeUIString(i,e):n.isObject(i)&&n.isArray(r)&&(n.extend(i,o.normalizeUIValues(n.pick(i,r),e)),n.each(r,function(t){var r=i[t];n.isString(r)&&(i[t]=o.normalizeUIString(r,e))}))}),t},o.actAsCollection=function(t,e){var r=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];n.each(r,function(r){t[r]=function(){var t=n.values(n.result(this,e)),i=[t].concat(n.toArray(arguments));return n[r].apply(n,i)}})};var s=o.deprecate=function(t,e){n.isObject(t)&&(t=t.prev+" is going to be removed in the future. Please use "+t.next+" instead."+(t.url?" See: "+t.url:"")),void 0!==e&&e||s._cache[t]||(s._warn("Deprecation warning: "+t),s._cache[t]=!0)};s._warn="undefined"!=typeof console&&(console.warn||console.log)||function(){},s._cache={},o._triggerMethod=function(){function t(t,e,n){return n.toUpperCase()}var e=/(^|:)(\w)/gi;return function(r,i,o){var s=arguments.length<3;s&&(o=i,i=o[0]);var a,u="on"+i.replace(e,t),c=r[u];return n.isFunction(c)&&(a=c.apply(r,s?n.rest(o):o)),n.isFunction(r.trigger)&&(s+o.length>1?r.trigger.apply(r,s?o:[i].concat(n.drop(o,0))):r.trigger(i)),a}}(),o.triggerMethod=function(t){return o._triggerMethod(this,arguments)},o.triggerMethodOn=function(t){var e=n.isFunction(t.triggerMethod)?t.triggerMethod:o.triggerMethod;return e.apply(t,n.rest(arguments))},o.MonitorDOMRefresh=function(t){function e(){t._isShown=!0,r()}function n(){t._isRendered=!0,r()}function r(){t._isShown&&t._isRendered&&o.isNodeAttached(t.el)&&o.triggerMethodOn(t,"dom:refresh",t)}t._isDomRefreshMonitored||(t._isDomRefreshMonitored=!0,t.on({show:e,render:n}))},function(t){function e(e,r,i,o){var s=o.split(/\s+/);n.each(s,function(n){var o=e[n];if(!o)throw new t.Error('Method "'+n+'" was configured as an event handler, but does not exist.');e.listenTo(r,i,o)})}function r(t,e,n,r){t.listenTo(e,n,r)}function i(t,e,r,i){var o=i.split(/\s+/);n.each(o,function(n){var i=t[n];t.stopListening(e,r,i)})}function o(t,e,n,r){t.stopListening(e,n,r)}function s(e,r,i,o,s){if(r&&i){if(!n.isObject(i))throw new t.Error({message:"Bindings must be an object or function.",url:"marionette.functions.html#marionettebindentityevents"});i=t._getValue(i,e),n.each(i,function(t,i){n.isFunction(t)?o(e,r,i,t):s(e,r,i,t)})}}t.bindEntityEvents=function(t,n,i){s(t,n,i,r,e)},t.unbindEntityEvents=function(t,e,n){s(t,e,n,o,i)},t.proxyBindEntityEvents=function(e,n){return t.bindEntityEvents(this,e,n)},t.proxyUnbindEntityEvents=function(e,n){return t.unbindEntityEvents(this,e,n)}}(o);var a=["description","fileName","lineNumber","name","message","number"];return o.Error=o.extend.call(Error,{urlRoot:"http://marionettejs.com/docs/v"+o.VERSION+"/",constructor:function(t,e){n.isObject(t)?(e=t,t=e.message):e||(e={});var r=Error.call(this,t);n.extend(this,n.pick(r,a),n.pick(e,a)),this.captureStackTrace(),e.url&&(this.url=this.urlRoot+e.url)},captureStackTrace:function(){Error.captureStackTrace&&Error.captureStackTrace(this,o.Error)},toString:function(){return this.name+": "+this.message+(this.url?" See: "+this.url:"")}}),o.Error.extend=o.extend,o.Callbacks=function(){this._deferred=o.Deferred(),this._callbacks=[]},n.extend(o.Callbacks.prototype,{add:function(t,e){var r=n.result(this._deferred,"promise");this._callbacks.push({cb:t,ctx:e}),r.then(function(n){e&&(n.context=e),t.call(n.context,n.options)})},run:function(t,e){this._deferred.resolve({options:t,context:e})},reset:function(){var t=this._callbacks;this._deferred=o.Deferred(),this._callbacks=[],n.each(t,function(t){this.add(t.cb,t.ctx)},this)}}),o.Controller=function(t){this.options=t||{},n.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,n.extend(o.Controller.prototype,e.Events,{destroy:function(){return o._triggerMethod(this,"before:destroy",arguments),o._triggerMethod(this,"destroy",arguments),this.stopListening(),this.off(),this},triggerMethod:o.triggerMethod,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption}),o.Object=function(t){this.options=n.extend({},n.result(this,"options"),t),this.initialize.apply(this,arguments)},o.Object.extend=o.extend,n.extend(o.Object.prototype,e.Events,{initialize:function(){},destroy:function(t){return t=t||{},this.triggerMethod("before:destroy",t),this.triggerMethod("destroy",t),this.stopListening(),this},triggerMethod:o.triggerMethod,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption,bindEntityEvents:o.proxyBindEntityEvents,unbindEntityEvents:o.proxyUnbindEntityEvents}),o.Region=o.Object.extend({constructor:function(t){if(this.options=t||{},this.el=this.getOption("el"),this.el=this.el instanceof e.$?this.el[0]:this.el,!this.el)throw new o.Error({name:"NoElError",message:'An "el" must be specified for a region.'});this.$el=this.getEl(this.el),o.Object.call(this,t)},show:function(t,e){if(this._ensureElement()){this._ensureViewIsIntact(t),o.MonitorDOMRefresh(t);var r=e||{},i=t!==this.currentView,s=!!r.preventDestroy,a=!!r.forceShow,u=!!this.currentView,c=i&&!s,l=i||a;if(u&&this.triggerMethod("before:swapOut",this.currentView,this,e),this.currentView&&delete this.currentView._parent,c?this.empty():u&&l&&this.currentView.off("destroy",this.empty,this),l){t.once("destroy",this.empty,this),t._parent=this,this._renderView(t),u&&this.triggerMethod("before:swap",t,this,e),this.triggerMethod("before:show",t,this,e),o.triggerMethodOn(t,"before:show",t,this,e),u&&this.triggerMethod("swapOut",this.currentView,this,e);var h=o.isNodeAttached(this.el),f=[],p=n.extend({triggerBeforeAttach:this.triggerBeforeAttach,triggerAttach:this.triggerAttach},r);return h&&p.triggerBeforeAttach&&(f=this._displayedViews(t),this._triggerAttach(f,"before:")),this.attachHtml(t),this.currentView=t,h&&p.triggerAttach&&(f=this._displayedViews(t),this._triggerAttach(f)),u&&this.triggerMethod("swap",t,this,e),this.triggerMethod("show",t,this,e),o.triggerMethodOn(t,"show",t,this,e),this}return this}},triggerBeforeAttach:!0,triggerAttach:!0,_triggerAttach:function(t,e){var r=(e||"")+"attach";n.each(t,function(t){o.triggerMethodOn(t,r,t,this)},this)},_displayedViews:function(t){return n.union([t],n.result(t,"_getNestedViews")||[])},_renderView:function(t){t.supportsRenderLifecycle||o.triggerMethodOn(t,"before:render",t),t.render(),t.supportsRenderLifecycle||o.triggerMethodOn(t,"render",t)},_ensureElement:function(){if(n.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),!this.$el||0===this.$el.length){if(this.getOption("allowMissingEl"))return!1;throw new o.Error('An "el" '+this.$el.selector+" must exist in DOM")}return!0},_ensureViewIsIntact:function(t){if(!t)throw new o.Error({name:"ViewNotValid",message:"The view passed is undefined and therefore invalid. You must pass a view instance to show."});if(t.isDestroyed)throw new o.Error({name:"ViewDestroyedError",message:'View (cid: "'+t.cid+'") has already been destroyed and cannot be used.'})},getEl:function(t){return e.$(t,o._getValue(this.options.parentEl,this))},attachHtml:function(t){this.$el.contents().detach(),this.el.appendChild(t.el)},empty:function(t){var e=this.currentView,n=t||{},r=!!n.preventDestroy;return e?(e.off("destroy",this.empty,this),this.triggerMethod("before:empty",e),r||this._destroyView(),this.triggerMethod("empty",e),delete this.currentView,r&&this.$el.contents().detach(),this):this},_destroyView:function(){var t=this.currentView;t.isDestroyed||(t.supportsDestroyLifecycle||o.triggerMethodOn(t,"before:destroy",t),t.destroy?t.destroy():(t.remove(),t.isDestroyed=!0),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"destroy",t))},attachView:function(t){return this.currentView&&delete this.currentView._parent,t._parent=this,this.currentView=t,this},hasView:function(){return!!this.currentView},reset:function(){return this.empty(),this.$el&&(this.el=this.$el.selector),delete this.$el,this}},{buildRegion:function(t,e){if(n.isString(t))return this._buildRegionFromSelector(t,e);if(t.selector||t.el||t.regionClass)return this._buildRegionFromObject(t,e);if(n.isFunction(t))return this._buildRegionFromRegionClass(t);throw new o.Error({message:"Improper region configuration type.",url:"marionette.region.html#region-configuration-types"})},_buildRegionFromSelector:function(t,e){return new e({el:t})},_buildRegionFromObject:function(t,e){var r=t.regionClass||e,i=n.omit(t,"selector","regionClass");return t.selector&&!i.el&&(i.el=t.selector),new r(i)},_buildRegionFromRegionClass:function(t){return new t}}),o.RegionManager=o.Controller.extend({constructor:function(t){this._regions={},this.length=0,o.Controller.call(this,t),this.addRegions(this.getOption("regions"))},addRegions:function(t,e){return t=o._getValue(t,this,arguments),n.reduce(t,function(t,r,i){return n.isString(r)&&(r={selector:r}),r.selector&&(r=n.defaults({},r,e)),t[i]=this.addRegion(i,r),t},{},this)},addRegion:function(t,e){var n;return n=e instanceof o.Region?e:o.Region.buildRegion(e,o.Region),this.triggerMethod("before:add:region",t,n),n._parent=this,this._store(t,n),this.triggerMethod("add:region",t,n),n},get:function(t){return this._regions[t]},getRegions:function(){return n.clone(this._regions)},removeRegion:function(t){var e=this._regions[t];return this._remove(t,e),e},removeRegions:function(){var t=this.getRegions();return n.each(this._regions,function(t,e){this._remove(e,t)},this),t},emptyRegions:function(){var t=this.getRegions();return n.invoke(t,"empty"),t},destroy:function(){return this.removeRegions(),o.Controller.prototype.destroy.apply(this,arguments)},_store:function(t,e){this._regions[t]||this.length++,this._regions[t]=e},_remove:function(t,e){this.triggerMethod("before:remove:region",t,e),e.empty(),e.stopListening(),delete e._parent,delete this._regions[t],this.length--,this.triggerMethod("remove:region",t,e)}}),o.actAsCollection(o.RegionManager.prototype,"_regions"),o.TemplateCache=function(t){this.templateId=t},n.extend(o.TemplateCache,{templateCaches:{},get:function(t,e){var n=this.templateCaches[t];return n||(n=new o.TemplateCache(t),this.templateCaches[t]=n),n.load(e)},clear:function(){var t,e=n.toArray(arguments),r=e.length;if(r>0)for(t=0;r>t;t++)delete this.templateCaches[e[t]];else this.templateCaches={}}}),n.extend(o.TemplateCache.prototype,{load:function(t){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId,t);return this.compiledTemplate=this.compileTemplate(e,t),this.compiledTemplate},loadTemplate:function(t,n){var r=e.$(t);if(!r.length)throw new o.Error({name:"NoTemplateError",message:'Could not find template: "'+t+'"'});return r.html()},compileTemplate:function(t,e){return n.template(t,e)}}),o.Renderer={render:function(t,e){if(!t)throw new o.Error({name:"TemplateNotFoundError",message:"Cannot render the template since its false, null or undefined."});var r=n.isFunction(t)?t:o.TemplateCache.get(t);return r(e)}},o.View=e.View.extend({isDestroyed:!1,supportsRenderLifecycle:!0,supportsDestroyLifecycle:!0,constructor:function(t){this.render=n.bind(this.render,this),t=o._getValue(t,this),this.options=n.extend({},n.result(this,"options"),t),this._behaviors=o.Behaviors(this),e.View.call(this,this.options),o.MonitorDOMRefresh(this)},getTemplate:function(){return this.getOption("template")},serializeModel:function(t){return t.toJSON.apply(t,n.rest(arguments))},mixinTemplateHelpers:function(t){t=t||{};var e=this.getOption("templateHelpers");return e=o._getValue(e,this),n.extend(t,e)},normalizeUIKeys:function(t){var e=n.result(this,"_uiBindings");return o.normalizeUIKeys(t,e||n.result(this,"ui"))},normalizeUIValues:function(t,e){var r=n.result(this,"ui"),i=n.result(this,"_uiBindings");return o.normalizeUIValues(t,i||r,e)},configureTriggers:function(){if(this.triggers){var t=this.normalizeUIKeys(n.result(this,"triggers"));return n.reduce(t,function(t,e,n){return t[n]=this._buildViewTrigger(e),t},{},this)}},delegateEvents:function(t){return this._delegateDOMEvents(t),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents")),n.each(this._behaviors,function(t){t.bindEntityEvents(this.model,t.getOption("modelEvents")),t.bindEntityEvents(this.collection,t.getOption("collectionEvents"))},this),this},_delegateDOMEvents:function(t){var r=o._getValue(t||this.events,this);r=this.normalizeUIKeys(r),n.isUndefined(t)&&(this.events=r);var i={},s=n.result(this,"behaviorEvents")||{},a=this.configureTriggers(),u=n.result(this,"behaviorTriggers")||{};n.extend(i,s,r,a,u),e.View.prototype.delegateEvents.call(this,i)},undelegateEvents:function(){return e.View.prototype.undelegateEvents.apply(this,arguments),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents")),n.each(this._behaviors,function(t){t.unbindEntityEvents(this.model,t.getOption("modelEvents")),t.unbindEntityEvents(this.collection,t.getOption("collectionEvents"))},this),this},_ensureViewIsIntact:function(){if(this.isDestroyed)throw new o.Error({name:"ViewDestroyedError",message:'View (cid: "'+this.cid+'") has already been destroyed and cannot be used.'})},destroy:function(){if(this.isDestroyed)return this;var t=n.toArray(arguments);return this.triggerMethod.apply(this,["before:destroy"].concat(t)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(t)),this.unbindUIElements(),this.isRendered=!1,this.remove(),n.invoke(this._behaviors,"destroy",t),this},bindUIElements:function(){this._bindUIElements(),n.invoke(this._behaviors,this._bindUIElements)},_bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var t=n.result(this,"_uiBindings");this.ui={},n.each(t,function(t,e){this.ui[e]=this.$(t)},this)}},unbindUIElements:function(){this._unbindUIElements(),n.invoke(this._behaviors,this._unbindUIElements)},_unbindUIElements:function(){this.ui&&this._uiBindings&&(n.each(this.ui,function(t,e){delete this.ui[e]},this),this.ui=this._uiBindings,delete this._uiBindings)},_buildViewTrigger:function(t){var e=n.defaults({},t,{preventDefault:!0,stopPropagation:!0}),r=n.isObject(t)?e.event:t;return function(t){t&&(t.preventDefault&&e.preventDefault&&t.preventDefault(),t.stopPropagation&&e.stopPropagation&&t.stopPropagation());var n={view:this,model:this.model,collection:this.collection};this.triggerMethod(r,n); -}},setElement:function(){var t=e.View.prototype.setElement.apply(this,arguments);return n.invoke(this._behaviors,"proxyViewProperties",this),t},triggerMethod:function(){var t=o._triggerMethod(this,arguments);return this._triggerEventOnBehaviors(arguments),this._triggerEventOnParentLayout(arguments[0],n.rest(arguments)),t},_triggerEventOnBehaviors:function(t){for(var e=o._triggerMethod,n=this._behaviors,r=0,i=n&&n.length;i>r;r++)e(n[r],t)},_triggerEventOnParentLayout:function(t,e){var r=this._parentLayoutView();if(r){var i=o.getOption(r,"childViewEventPrefix"),s=i+":"+t,a=[this].concat(e);o._triggerMethod(r,s,a);var u=o.getOption(r,"childEvents");u=o._getValue(u,r);var c=r.normalizeMethods(u);c&&n.isFunction(c[t])&&c[t].apply(r,a)}},_getImmediateChildren:function(){return[]},_getNestedViews:function(){var t=this._getImmediateChildren();return t.length?n.reduce(t,function(t,e){return e._getNestedViews?t.concat(e._getNestedViews()):t},t):t},_parentLayoutView:function(){for(var t=this._parent;t;){if(t instanceof o.LayoutView)return t;t=t._parent}},normalizeMethods:o.normalizeMethods,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption,bindEntityEvents:o.proxyBindEntityEvents,unbindEntityEvents:o.proxyUnbindEntityEvents}),o.ItemView=o.View.extend({constructor:function(){o.View.apply(this,arguments)},serializeData:function(){if(!this.model&&!this.collection)return{};var t=[this.model||this.collection];return arguments.length&&t.push.apply(t,arguments),this.model?this.serializeModel.apply(this,t):{items:this.serializeCollection.apply(this,t)}},serializeCollection:function(t){return t.toJSON.apply(t,n.rest(arguments))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderTemplate(),this.isRendered=!0,this.bindUIElements(),this.triggerMethod("render",this),this},_renderTemplate:function(){var t=this.getTemplate();if(t!==!1){if(!t)throw new o.Error({name:"UndefinedTemplateError",message:"Cannot render the template since it is null or undefined."});var e=this.mixinTemplateHelpers(this.serializeData()),n=o.Renderer.render(t,e,this);return this.attachElContent(n),this}},attachElContent:function(t){return this.$el.html(t),this}}),o.CollectionView=o.View.extend({childViewEventPrefix:"childview",sort:!0,constructor:function(t){this.once("render",this._initialEvents),this._initChildViewStorage(),o.View.apply(this,arguments),this.on({"before:show":this._onBeforeShowCalled,show:this._onShowCalled,"before:attach":this._onBeforeAttachCalled,attach:this._onAttachCalled}),this.initRenderBuffer()},initRenderBuffer:function(){this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){var t,e=this._isShown&&o.isNodeAttached(this.el);this.isBuffering=!1,this._isShown&&this._triggerMethodMany(this._bufferedChildren,this,"before:show"),e&&this._triggerBeforeAttach&&(t=this._getNestedViews(),this._triggerMethodMany(t,this,"before:attach")),this.attachBuffer(this,this._createBuffer()),e&&this._triggerAttach&&(t=this._getNestedViews(),this._triggerMethodMany(t,this,"attach")),this._isShown&&this._triggerMethodMany(this._bufferedChildren,this,"show"),this.initRenderBuffer()},_triggerMethodMany:function(t,e,r){var i=n.drop(arguments,3);n.each(t,function(t){o.triggerMethodOn.apply(t,[t,r,t,e].concat(i))})},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.getOption("sort")&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(t,e,r){var i=void 0!==r.at&&(r.index||e.indexOf(t));if((this.getOption("filter")||i===!1)&&(i=n.indexOf(this._filteredSortedModels(i),t)),this._shouldAddChild(t,i)){this.destroyEmptyView();var o=this.getChildView(t);this.addChild(t,o,i)}},_onCollectionRemove:function(t){var e=this.children.findByModel(t);this.removeChildView(e),this.checkEmpty()},_onBeforeShowCalled:function(){this._triggerBeforeAttach=this._triggerAttach=!1,this.children.each(function(t){o.triggerMethodOn(t,"before:show",t)})},_onShowCalled:function(){this.children.each(function(t){o.triggerMethodOn(t,"show",t)})},_onBeforeAttachCalled:function(){this._triggerBeforeAttach=!0},_onAttachCalled:function(){this._triggerAttach=!0},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.isRendered=!0,this.triggerMethod("render",this),this},reorder:function(){var t=this.children,e=this._filteredSortedModels(),r=n.some(e,function(e){return!t.findByModel(e)});if(r)this.render();else{var i=n.map(e,function(e,n){var r=t.findByModel(e);return r._index=n,r.el}),o=t.filter(function(t){return!n.contains(i,t.el)});this.triggerMethod("before:reorder"),this._appendReorderedChildren(i),n.each(o,this.removeChildView,this),this.checkEmpty(),this.triggerMethod("reorder")}},resortView:function(){o.getOption(this,"reorderOnSort")?this.reorder():this.render()},_sortViews:function(){var t=this._filteredSortedModels(),e=n.find(t,function(t,e){var n=this.children.findByModel(t);return!n||n._index!==e},this);e&&this.resortView()},_emptyViewIndex:-1,_appendReorderedChildren:function(t){this.$el.append(t)},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren({checkEmpty:!1}),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this),this.children.isEmpty()&&this.getOption("filter")&&this.showEmptyView())},showCollection:function(){var t,e=this._filteredSortedModels();n.each(e,function(e,n){t=this.getChildView(e),this.addChild(e,t,n)},this)},_filteredSortedModels:function(t){var e=this.getViewComparator(),r=this.collection.models;if(t=Math.min(Math.max(t,0),r.length-1),e){var i;t&&(i=r[t],r=r.slice(0,t).concat(r.slice(t+1))),r=this._sortModelsBy(r,e),i&&r.splice(t,0,i)}return this.getOption("filter")&&(r=n.filter(r,function(t,e){return this._shouldAddChild(t,e)},this)),r},_sortModelsBy:function(t,e){return"string"==typeof e?n.sortBy(t,function(t){return t.get(e)},this):1===e.length?n.sortBy(t,e,this):t.sort(n.bind(e,this))},showEmptyView:function(){var t=this.getEmptyView();if(t&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var n=new e.Model;this.addEmptyView(n,t),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.triggerMethod("before:remove:empty"),this.destroyChildren(),delete this._showingEmptyView,this.triggerMethod("remove:empty"))},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(t,e){var r,i=this._isShown&&!this.isBuffering&&o.isNodeAttached(this.el),s=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");n.isFunction(s)&&(s=s.call(this,t,this._emptyViewIndex));var a=this.buildChildView(t,e,s);a._parent=this,this.proxyChildEvents(a),a.once("render",function(){this._isShown&&o.triggerMethodOn(a,"before:show",a),i&&this._triggerBeforeAttach&&(r=this._getViewAndNested(a),this._triggerMethodMany(r,this,"before:attach"))},this),this.children.add(a),this.renderChildView(a,this._emptyViewIndex),i&&this._triggerAttach&&(r=this._getViewAndNested(a),this._triggerMethodMany(r,this,"attach")),this._isShown&&o.triggerMethodOn(a,"show",a)},getChildView:function(t){var e=this.getOption("childView");if(!e)throw new o.Error({name:"NoChildViewError",message:'A "childView" must be specified'});return e},addChild:function(t,e,n){var r=this.getOption("childViewOptions");r=o._getValue(r,this,[t,n]);var i=this.buildChildView(t,e,r);return this._updateIndices(i,!0,n),this.triggerMethod("before:add:child",i),this._addChildView(i,n),this.triggerMethod("add:child",i),i._parent=this,i},_updateIndices:function(t,e,n){this.getOption("sort")&&(e&&(t._index=n),this.children.each(function(n){n._index>=t._index&&(n._index+=e?1:-1)}))},_addChildView:function(t,e){var n,r=this._isShown&&!this.isBuffering&&o.isNodeAttached(this.el);this.proxyChildEvents(t),t.once("render",function(){this._isShown&&!this.isBuffering&&o.triggerMethodOn(t,"before:show",t),r&&this._triggerBeforeAttach&&(n=this._getViewAndNested(t),this._triggerMethodMany(n,this,"before:attach"))},this),this.children.add(t),this.renderChildView(t,e),r&&this._triggerAttach&&(n=this._getViewAndNested(t),this._triggerMethodMany(n,this,"attach")),this._isShown&&!this.isBuffering&&o.triggerMethodOn(t,"show",t)},renderChildView:function(t,e){return t.supportsRenderLifecycle||o.triggerMethodOn(t,"before:render",t),t.render(),t.supportsRenderLifecycle||o.triggerMethodOn(t,"render",t),this.attachHtml(this,t,e),t},buildChildView:function(t,e,r){var i=n.extend({model:t},r),s=new e(i);return o.MonitorDOMRefresh(s),s},removeChildView:function(t){return t?(this.triggerMethod("before:remove:child",t),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"before:destroy",t),t.destroy?t.destroy():t.remove(),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"destroy",t),delete t._parent,this.stopListening(t),this.children.remove(t),this.triggerMethod("remove:child",t),this._updateIndices(t,!1),t):t},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(t,e){t.$el.append(e)},_createBuffer:function(){var t=document.createDocumentFragment();return n.each(this._bufferedChildren,function(e){t.appendChild(e.el)}),t},attachHtml:function(t,e,n){t.isBuffering?t._bufferedChildren.splice(n,0,e):t._insertBefore(e,n)||t._insertAfter(e)},_insertBefore:function(t,e){var n,r=this.getOption("sort")&&e=0&&t.length%1===0}function a(t,e){return s(t)?u(t,e):f(t,e)}function u(t,e){for(var n=-1,r=t.length;++nr?r:null}):(n=P(t),e=n.length,function(){return r++,e>r?n[r]:null})}function g(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;n>i;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r)}}}function m(t){return function(e,n,r){return t(e,r)}}function y(e){return function(n,r,s){s=o(s||t),n=n||[];var a=d(n);if(0>=e)return s(null);var u=!1,c=0,l=!1;!function h(){if(u&&0>=c)return s(null);for(;e>c&&!l;){var t=a();if(null===t)return u=!0,void(0>=c&&s(null));c+=1,r(n[t],t,i(function(t){c-=1,t?(s(t),l=!0):h()}))}}()}}function v(t){return function(e,n,r){return t(j.eachOf,e,n,r)}}function _(t){return function(e,n,r,i){return t(y(n),e,r,i)}}function b(t){return function(e,n,r){return t(j.eachOfSeries,e,n,r)}}function w(e,n,r,i){i=o(i||t);var s=[];e(n,function(t,e,n){r(t,function(t,r){s[e]=r,n(t)})},function(t){i(t,s)})}function E(t,e,n,r){var i=[];t(e,function(t,e,r){n(t,function(n){n&&i.push({index:e,value:t}),r()})},function(){r(c(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function x(t,e,n,r){E(t,e,function(t,e){n(t,function(t){e(!t)})},r)}function C(t,e,n){return function(r,i,o,s){function a(){s&&s(n(!1,void 0))}function u(t,r,i){return s?void o(t,function(r){s&&e(r)&&(s(n(!0,t)),s=o=!1),i()}):i()}arguments.length>3?t(r,i,u,a):(s=o,o=i,t(r,u,a))}}function k(t,e){return e}function A(e,n,r){r=r||t;var i=s(n)?[]:{};e(n,function(t,e,n){t(g(function(t,r){r.length<=1&&(r=r[0]),i[e]=r,n(t)}))},function(t){r(t,i)})}function T(t,e,n,r){var i=[];t(e,function(t,e,r){n(t,function(t,e){i=i.concat(e||[]),r(t)})},function(t){r(t,i)})}function S(e,n,r){function o(e,n,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return e.started=!0,I(n)||(n=[n]),0===n.length&&e.idle()?j.setImmediate(function(){e.drain()}):(u(n,function(n){var o={data:n,callback:i||t};r?e.tasks.unshift(o):e.tasks.push(o),e.tasks.length===e.concurrency&&e.saturated()}),void j.setImmediate(e.process))}function s(t,e){return function(){a-=1;var n=arguments;u(e,function(t){t.callback.apply(t,n)}),t.tasks.length+a===0&&t.drain(),t.process()}}if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var a=0,l={tasks:[],concurrency:n,payload:r,saturated:t,empty:t,drain:t,started:!1,paused:!1,push:function(t,e){o(l,t,!1,e)},kill:function(){l.drain=t,l.tasks=[]},unshift:function(t,e){o(l,t,!0,e)},process:function(){if(!l.paused&&a=e;e++)j.setImmediate(l.process)}}};return l}function D(t){return g(function(e,n){e.apply(null,n.concat([g(function(e,n){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&u(n,function(e){console[t](e)}))})]))})}function M(t){return function(e,n,r){t(l(e),n,r)}}function O(t){return g(function(e,n){var r=g(function(n){var r=this,i=n.pop();return t(e,function(t,e,i){t.apply(r,n.concat([i]))},i)});return n.length?r.apply(this,n):r})}function F(t){return g(function(e){var n=e.pop();e.push(function(){var t=arguments;r?j.setImmediate(function(){n.apply(null,t)}):n.apply(null,t)});var r=!0;t.apply(this,e),r=!1})}var R,j={},B="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=B&&(R=B.async),j.noConflict=function(){return B.async=R,j};var N=Object.prototype.toString,I=Array.isArray||function(t){return"[object Array]"===N.call(t)},L=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},P=Object.keys||function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},U="function"==typeof setImmediate&&setImmediate,V=U?function(t){U(t)}:function(t){setTimeout(t,0)};"object"==typeof process&&"function"==typeof process.nextTick?j.nextTick=process.nextTick:j.nextTick=V,j.setImmediate=U?V:j.nextTick,j.forEach=j.each=function(t,e,n){return j.eachOf(t,m(e),n)},j.forEachSeries=j.eachSeries=function(t,e,n){return j.eachOfSeries(t,m(e),n)},j.forEachLimit=j.eachLimit=function(t,e,n,r){return y(e)(t,m(n),r)},j.forEachOf=j.eachOf=function(e,n,r){function u(t){t?r(t):(l+=1,l>=c&&r(null))}r=o(r||t),e=e||[];var c=s(e)?e.length:P(e).length,l=0;return c?void a(e,function(t,r){n(e[r],r,i(u))}):r(null)},j.forEachOfSeries=j.eachOfSeries=function(e,n,r){function s(){var t=!0;return null===u?r(null):(n(e[u],u,i(function(e){if(e)r(e);else{if(u=a(),null===u)return r(null);t?j.nextTick(s):s()}})),void(t=!1))}r=o(r||t),e=e||[];var a=d(e),u=a();s()},j.forEachOfLimit=j.eachOfLimit=function(t,e,n,r){y(e)(t,n,r)},j.map=v(w),j.mapSeries=b(w),j.mapLimit=_(w),j.inject=j.foldl=j.reduce=function(t,e,n,r){j.eachOfSeries(t,function(t,r,i){n(e,t,function(t,n){e=n,i(t)})},function(t){r(t||null,e)})},j.foldr=j.reduceRight=function(t,n,r,i){var o=c(t,e).reverse();j.reduce(o,n,r,i)},j.select=j.filter=v(E),j.selectLimit=j.filterLimit=_(E),j.selectSeries=j.filterSeries=b(E),j.reject=v(x),j.rejectLimit=_(x),j.rejectSeries=b(x),j.any=j.some=C(j.eachOf,n,e),j.someLimit=C(j.eachOfLimit,n,e),j.all=j.every=C(j.eachOf,r,r),j.everyLimit=C(j.eachOfLimit,r,r),j.detect=C(j.eachOf,e,k),j.detectSeries=C(j.eachOfSeries,e,k),j.detectLimit=C(j.eachOfLimit,e,k),j.sortBy=function(t,e,n){function r(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0}j.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){return t?n(t):void n(null,c(e.sort(r),function(t){return t.value}))})},j.auto=function(e,n){function r(t){d.unshift(t)}function i(t){var e=p(d,t);e>=0&&d.splice(e,1)}function s(){c--,u(d.slice(0),function(t){t()})}n=o(n||t);var a=P(e),c=a.length;if(!c)return n(null);var l={},d=[];r(function(){c||n(null,l)}),u(a,function(t){function o(){return h(m,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(t)}function a(){o()&&(i(a),c[c.length-1](d,l))}for(var u,c=I(e[t])?e[t]:[e[t]],d=g(function(e,r){if(r.length<=1&&(r=r[0]),e){var i={};f(l,function(t,e){i[e]=t}),i[t]=r,n(e,i)}else l[t]=r,j.setImmediate(s)}),m=c.slice(0,c.length-1),y=m.length;y--;){if(!(u=e[m[y]]))throw new Error("Has inexistant dependency");if(I(u)&&p(u,t)>=0)throw new Error("Has cyclic dependencies")}o()?c[c.length-1](d,l):r(a)})},j.retry=function(t,e,n){function r(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function i(t,e){function n(t,n){return function(r){t(function(t,e){r(!t||n,{err:t,result:e})},e)}}function r(t){return function(e){setTimeout(function(){e(null)},t)}}for(;u.times;){var i=!(u.times-=1);a.push(n(u.task,i)),!i&&u.interval>0&&a.push(r(u.interval))}j.series(a,function(e,n){n=n[n.length-1],(t||u.callback)(n.err,n.result); -})}var o=5,s=0,a=[],u={times:o,interval:s},c=arguments.length;if(1>c||c>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=c&&"function"==typeof t&&(n=e,e=t),"function"!=typeof t&&r(u,t),u.callback=n,u.task=e,u.callback?i():i},j.waterfall=function(e,n){function r(t){return g(function(e,i){if(e)n.apply(null,[e].concat(i));else{var o=t.next();o?i.push(r(o)):i.push(n),F(t).apply(null,i)}})}if(n=o(n||t),!I(e)){var i=new Error("First argument to waterfall must be an array of functions");return n(i)}return e.length?void r(j.iterator(e))():n()},j.parallel=function(t,e){A(j.eachOf,t,e)},j.parallelLimit=function(t,e,n){A(y(e),t,n)},j.series=function(t,e){A(j.eachOfSeries,t,e)},j.iterator=function(t){function e(n){function r(){return t.length&&t[n].apply(null,arguments),r.next()}return r.next=function(){return nr;){var o=r+(i-r+1>>>1);n(e,t[o])>=0?r=o:i=o-1}return r}function o(e,n,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return e.started=!0,I(n)||(n=[n]),0===n.length?j.setImmediate(function(){e.drain()}):void u(n,function(n){var a={data:n,priority:o,callback:"function"==typeof s?s:t};e.tasks.splice(i(e.tasks,a,r)+1,0,a),e.tasks.length===e.concurrency&&e.saturated(),j.setImmediate(e.process)})}var s=j.queue(e,n);return s.push=function(t,e,n){o(s,t,e,n)},delete s.unshift,s},j.cargo=function(t,e){return S(t,1,e)},j.log=D("log"),j.dir=D("dir"),j.memoize=function(t,n){var r={},i={};n=n||e;var o=g(function(e){var o=e.pop(),s=n.apply(null,e);s in r?j.nextTick(function(){o.apply(null,r[s])}):s in i?i[s].push(o):(i[s]=[o],t.apply(null,e.concat([g(function(t){r[s]=t;var e=i[s];delete i[s];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return o.memo=r,o.unmemoized=t,o},j.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},j.times=M(j.map),j.timesSeries=M(j.mapSeries),j.timesLimit=function(t,e,n,r){return j.mapLimit(l(t),e,n,r)},j.seq=function(){var e=arguments;return g(function(n){var r=this,i=n[n.length-1];"function"==typeof i?n.pop():i=t,j.reduce(e,n,function(t,e,n){e.apply(r,t.concat([g(function(t,e){n(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},j.compose=function(){return j.seq.apply(null,Array.prototype.reverse.call(arguments))},j.applyEach=O(j.eachOf),j.applyEachSeries=O(j.eachOfSeries),j.forever=function(e,n){function r(t){return t?o(t):void s(r)}var o=i(n||t),s=F(e);r()},j.ensureAsync=F,j.constant=g(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),j.wrapSync=j.asyncify=function(t){return g(function(e){var n,r=e.pop();try{n=t.apply(this,e)}catch(i){return r(i)}L(n)&&"function"==typeof n.then?n.then(function(t){r(null,t)})["catch"](function(t){r(t.message?t:new Error(t))}):r(null,n)})},"object"==typeof module&&module.exports?module.exports=j:"function"==typeof define&&define.amd?define([],function(){return j}):B.async=j}(),function(){var t=this,e={};"undefined"!=typeof exports?module.exports=e:t.fuzzy=e,e.simpleFilter=function(t,n){return n.filter(function(n){return e.test(t,n)})},e.test=function(t,n){return null!==e.match(t,n)},e.match=function(t,e,n){n=n||{};var r,i=0,o=[],s=e.length,a=0,u=0,c=n.pre||"",l=n.post||"",h=n.caseSensitive&&e||e.toLowerCase();t=n.caseSensitive&&t||t.toLowerCase();for(var f=0;s>f;f++)r=e[f],h[f]===t[i]?(r=c+r+l,i+=1,u+=1+u):u=0,a+=u,o[o.length]=r;return i===t.length?{rendered:o.join(""),score:a}:null},e.filter=function(t,n,r){return r=r||{},n.reduce(function(n,i,o,s){var a=i;r.extract&&(a=r.extract(i));var u=e.match(t,a,r);return null!=u&&(n[n.length]={string:u.rendered,score:u.score,index:o,original:i}),n},[]).sort(function(t,e){var n=e.score-t.score;return n?n:t.index-e.index})}}(),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return jn.apply(null,arguments)}function e(t){jn=t}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function r(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function i(t,e){var n,r=[];for(n=0;n0)for(n in Nn)r=Nn[n],i=e[r],"undefined"!=typeof i&&(t[r]=i);return t}function p(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),In===!1&&(In=!0,t.updateOffset(this),In=!1)}function d(t){return t instanceof p||null!=t&&null!=t._isAMomentObject}function g(t){return 0>t?Math.ceil(t):Math.floor(t)}function m(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=g(e)),n}function y(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&m(t[r])!==m(e[r]))&&s++;return s+o}function v(){}function _(t){return t?t.toLowerCase().replace("_","-"):t}function b(t){for(var e,n,r,i,o=0;o0;){if(r=w(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&y(i,n,!0)>=e-1)break;e--}o++}return null}function w(t){var e=null;if(!Ln[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=Bn._abbr,require("./locale/"+t),E(e)}catch(n){}return Ln[t]}function E(t,e){var n;return t&&(n="undefined"==typeof e?C(t):x(t,e),n&&(Bn=n)),Bn._abbr}function x(t,e){return null!==e?(e.abbr=t,Ln[t]=Ln[t]||new v,Ln[t].set(e),E(t),Ln[t]):(delete Ln[t],null)}function C(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Bn;if(!n(t)){if(e=w(t))return e;t=[t]}return b(t)}function k(t,e){var n=t.toLowerCase();Pn[n]=Pn[n+"s"]=Pn[e]=t}function A(t){return"string"==typeof t?Pn[t]||Pn[t.toLowerCase()]:void 0}function T(t){var e,n,r={};for(n in t)o(t,n)&&(e=A(n),e&&(r[e]=t[n]));return r}function S(e,n){return function(r){return null!=r?(M(this,e,r),t.updateOffset(this,n),this):D(this,e)}}function D(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function M(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function O(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=A(t),"function"==typeof this[t])return this[t](e);return this}function F(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function R(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(Yn[t]=i),e&&(Yn[e[0]]=function(){return F(i.apply(this,arguments),e[1],e[2])}),n&&(Yn[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function j(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,n,r=t.match(Un);for(e=0,n=r.length;n>e;e++)Yn[r[e]]?r[e]=Yn[r[e]]:r[e]=j(r[e]);return function(i){var o="";for(e=0;n>e;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}function N(t,e){return t.isValid()?(e=I(e,t.localeData()),qn[e]=qn[e]||B(e),qn[e](t)):t.localeData().invalidDate()}function I(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(Vn.lastIndex=0;r>=0&&Vn.test(t);)t=t.replace(Vn,n),Vn.lastIndex=0,r-=1;return t}function L(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function P(t,e,n){ir[t]=L(e)?e:function(t){return t&&n?n:e}}function U(t,e){return o(ir,t)?ir[t](e._strict,e._locale):new RegExp(V(t))}function V(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=m(t)}),n=0;nr;r++){if(i=a([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function X(t,e){var n;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),z(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function J(e){return null!=e?(X(this,e),t.updateOffset(this,!0),this):D(this,"Month")}function K(){return z(this.year(),this.month())}function Z(t){var e,n=t._a;return n&&-2===c(t).overflow&&(e=n[ar]<0||n[ar]>11?ar:n[ur]<1||n[ur]>z(n[sr],n[ar])?ur:n[cr]<0||n[cr]>24||24===n[cr]&&(0!==n[lr]||0!==n[hr]||0!==n[fr])?cr:n[lr]<0||n[lr]>59?lr:n[hr]<0||n[hr]>59?hr:n[fr]<0||n[fr]>999?fr:-1,c(t)._overflowDayOfYear&&(sr>e||e>ur)&&(e=ur),c(t).overflow=e),t}function Q(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function tt(t,e){var n=!0;return s(function(){return n&&(Q(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function et(t,e){gr[t]||(Q(e),gr[t]=!0)}function nt(t){var e,n,r=t._i,i=mr.exec(r);if(i){for(c(t).iso=!0,e=0,n=yr.length;n>e;e++)if(yr[e][1].exec(r)){t._f=yr[e][0];break}for(e=0,n=vr.length;n>e;e++)if(vr[e][1].exec(r)){t._f+=(i[6]||" ")+vr[e][0];break}r.match(er)&&(t._f+="Z"),wt(t)}else t._isValid=!1}function rt(e){var n=_r.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(nt(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function it(t,e,n,r,i,o,s){var a=new Date(t,e,n,r,i,o,s);return 1970>t&&a.setFullYear(t),a}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function st(t){return at(t)?366:365}function at(t){return t%4===0&&t%100!==0||t%400===0}function ut(){return at(this.year())}function ct(t,e,n){var r,i=n-e,o=n-t.day();return o>i&&(o-=7),i-7>o&&(o+=7),r=Dt(t).add(o,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function lt(t){return ct(t,this._week.dow,this._week.doy).week}function ht(){return this._week.dow}function ft(){return this._week.doy}function pt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function dt(t){var e=ct(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function gt(t,e,n,r,i){var o,s=6+i-r,a=ot(t,0,1+s),u=a.getUTCDay();return i>u&&(u+=7),n=null!=n?1*n:i,o=1+s+7*(e-1)-u+n,{year:o>0?t:t-1,dayOfYear:o>0?o:st(t-1)+o}}function mt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function yt(t,e,n){return null!=t?t:null!=e?e:n}function vt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function _t(t){var e,n,r,i,o=[];if(!t._d){for(r=vt(t),t._w&&null==t._a[ur]&&null==t._a[ar]&&bt(t),t._dayOfYear&&(i=yt(t._a[sr],r[sr]),t._dayOfYear>st(i)&&(c(t)._overflowDayOfYear=!0),n=ot(i,0,t._dayOfYear),t._a[ar]=n.getUTCMonth(),t._a[ur]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[cr]&&0===t._a[lr]&&0===t._a[hr]&&0===t._a[fr]&&(t._nextDay=!0,t._a[cr]=0),t._d=(t._useUTC?ot:it).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[cr]=24)}}function bt(t){var e,n,r,i,o,s,a;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,n=yt(e.GG,t._a[sr],ct(Dt(),1,4).year),r=yt(e.W,1),i=yt(e.E,1)):(o=t._locale._week.dow,s=t._locale._week.doy,n=yt(e.gg,t._a[sr],ct(Dt(),o,s).year),r=yt(e.w,1),null!=e.d?(i=e.d,o>i&&++r):i=null!=e.e?e.e+o:o),a=gt(n,r,i,s,o),t._a[sr]=a.year,t._dayOfYear=a.dayOfYear}function wt(e){if(e._f===t.ISO_8601)return void nt(e);e._a=[],c(e).empty=!0;var n,r,i,o,s,a=""+e._i,u=a.length,l=0;for(i=I(e._f,e._locale).match(Un)||[],n=0;n0&&c(e).unusedInput.push(s),a=a.slice(a.indexOf(r)+r.length),l+=r.length),Yn[o]?(r?c(e).empty=!1:c(e).unusedTokens.push(o),$(o,r,e)):e._strict&&!r&&c(e).unusedTokens.push(o);c(e).charsLeftOver=u-l,a.length>0&&c(e).unusedInput.push(a),c(e).bigHour===!0&&e._a[cr]<=12&&e._a[cr]>0&&(c(e).bigHour=void 0),e._a[cr]=Et(e._locale,e._a[cr],e._meridiem),_t(e),Z(e)}function Et(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function xt(t){var e,n,r,i,o;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));s(t,n||e)}function Ct(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],_t(t)}}function kt(t){var e=new p(Z(At(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function At(t){var e=t._i,i=t._f;return t._locale=t._locale||C(t._l),null===e||void 0===i&&""===e?h({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),d(e)?new p(Z(e)):(n(i)?xt(t):i?wt(t):r(e)?t._d=e:Tt(t),t))}function Tt(e){var o=e._i;void 0===o?e._d=new Date:r(o)?e._d=new Date(+o):"string"==typeof o?rt(e):n(o)?(e._a=i(o.slice(0),function(t){return parseInt(t,10)}),_t(e)):"object"==typeof o?Ct(e):"number"==typeof o?e._d=new Date(o):t.createFromInputFallback(e)}function St(t,e,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,kt(o)}function Dt(t,e,n,r){return St(t,e,n,r,!1)}function Mt(t,e){var r,i;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Dt();for(r=e[0],i=1;it&&(t=-t,n="-"),n+F(~~(t/60),2)+e+F(~~t%60,2)})}function Nt(t){var e=(t||"").match(er)||[],n=e[e.length-1]||[],r=(n+"").match(Cr)||["-",0,0],i=+(60*r[1])+m(r[2]);return"+"===r[0]?i:-i}function It(e,n){var i,o;return n._isUTC?(i=n.clone(),o=(d(e)||r(e)?+e:+Dt(e))-+i,i._d.setTime(+i._d+o),t.updateOffset(i,!1),i):Dt(e).local()}function Lt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Pt(e,n){var r,i=this._offset||0;return null!=e?("string"==typeof e&&(e=Nt(e)),Math.abs(e)<16&&(e=60*e),!this._isUTC&&n&&(r=Lt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!n||this._changeInProgress?ee(this,Jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Lt(this)}function Ut(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Vt(t){return this.utcOffset(0,t)}function qt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Lt(this),"m")),this}function Yt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Nt(this._i)),this}function $t(t){return t=t?Dt(t).utcOffset():0,(this.utcOffset()-t)%60===0}function zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ht(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(f(t,this),t=At(t),t._a){var e=t._isUTC?a(t._a):Dt(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wt(){return!this._isUTC}function Gt(){return this._isUTC}function Xt(){return this._isUTC&&0===this._offset}function Jt(t,e){var n,r,i,s=t,a=null;return jt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=kr.exec(t))?(n="-"===a[1]?-1:1,s={y:0,d:m(a[ur])*n,h:m(a[cr])*n,m:m(a[lr])*n,s:m(a[hr])*n,ms:m(a[fr])*n}):(a=Ar.exec(t))?(n="-"===a[1]?-1:1,s={y:Kt(a[2],n),M:Kt(a[3],n),d:Kt(a[4],n),h:Kt(a[5],n),m:Kt(a[6],n),s:Kt(a[7],n),w:Kt(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(i=Qt(Dt(s.from),Dt(s.to)),s={},s.ms=i.milliseconds,s.M=i.months),r=new Rt(s),jt(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function Kt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Zt(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Qt(t,e){var n;return e=It(e,t),t.isBefore(e)?n=Zt(t,e):(n=Zt(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function te(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(et(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=Jt(n,r),ee(this,i,t),this}}function ee(e,n,r,i){var o=n._milliseconds,s=n._days,a=n._months;i=null==i?!0:i,o&&e._d.setTime(+e._d+o*r),s&&M(e,"Date",D(e,"Date")+s*r),a&&X(e,D(e,"Month")+a*r),i&&t.updateOffset(e,s||a)}function ne(t,e){var n=t||Dt(),r=It(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[o]||this.localeData().calendar(o,this,Dt(n)))}function re(){return new p(this)}function ie(t,e){var n;return e=A("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=d(t)?t:Dt(t),+this>+t):(n=d(t)?+t:+Dt(t),n<+this.clone().startOf(e))}function oe(t,e){var n;return e=A("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=d(t)?t:Dt(t),+t>+this):(n=d(t)?+t:+Dt(t),+this.clone().endOf(e)e-o?(n=t.clone().add(i-1,"months"),r=(e-o)/(o-n)):(n=t.clone().add(i+1,"months"),r=(e-o)/(n-o)),-(i+r)}function le(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function he(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(n=Dt([2e3,1]).day(e),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function Ve(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ne(t,this.localeData()),this.add(t-e,"d")):e}function qe(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ye(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function $e(t,e){R(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function ze(t,e){return e._meridiemParse}function He(t){return"p"===(t+"").toLowerCase().charAt(0)}function We(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Ge(t,e){e[fr]=m(1e3*("0."+t))}function Xe(){return this._isUTC?"UTC":""}function Je(){return this._isUTC?"Coordinated Universal Time":""}function Ke(t){return Dt(1e3*t)}function Ze(){return Dt.apply(null,arguments).parseZone()}function Qe(t,e,n){var r=this._calendar[t];return"function"==typeof r?r.call(e,n):r}function tn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function en(){return this._invalidDate}function nn(t){return this._ordinal.replace("%d",t)}function rn(t){return t}function on(t,e,n,r){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,r):i.replace(/%d/i,t)}function sn(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)}function an(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function un(t,e,n,r){var i=C(),o=a().set(r,e);return i[n](o,t)}function cn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return un(t,e,n,i);var o,s=[];for(o=0;r>o;o++)s[o]=un(t,o,n,i);return s}function ln(t,e){return cn(t,e,"months",12,"month")}function hn(t,e){return cn(t,e,"monthsShort",12,"month")}function fn(t,e){return cn(t,e,"weekdays",7,"day")}function pn(t,e){return cn(t,e,"weekdaysShort",7,"day")}function dn(t,e){return cn(t,e,"weekdaysMin",7,"day")}function gn(){var t=this._data;return this._milliseconds=Xr(this._milliseconds),this._days=Xr(this._days),this._months=Xr(this._months),t.milliseconds=Xr(t.milliseconds),t.seconds=Xr(t.seconds),t.minutes=Xr(t.minutes),t.hours=Xr(t.hours),t.months=Xr(t.months),t.years=Xr(t.years),this}function mn(t,e,n,r){var i=Jt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function yn(t,e){return mn(this,t,e,1)}function vn(t,e){return mn(this,t,e,-1)}function _n(t){return 0>t?Math.floor(t):Math.ceil(t)}function bn(){var t,e,n,r,i,o=this._milliseconds,s=this._days,a=this._months,u=this._data;return o>=0&&s>=0&&a>=0||0>=o&&0>=s&&0>=a||(o+=864e5*_n(En(a)+s),s=0,a=0),u.milliseconds=o%1e3,t=g(o/1e3),u.seconds=t%60,e=g(t/60),u.minutes=e%60,n=g(e/60),u.hours=n%24,s+=g(n/24),i=g(wn(s)),a+=i,s-=_n(En(i)),r=g(a/12),a%=12,u.days=s,u.months=a,u.years=r,this}function wn(t){return 4800*t/146097}function En(t){return 146097*t/4800}function xn(t){var e,n,r=this._milliseconds;if(t=A(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+wn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(En(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Cn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function kn(t){return function(){return this.as(t)}}function An(t){return t=A(t),this[t+"s"]()}function Tn(t){return function(){return this._data[t]}}function Sn(){return g(this.days()/7)}function Dn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Mn(t,e,n){var r=Jt(t).abs(),i=hi(r.as("s")),o=hi(r.as("m")),s=hi(r.as("h")),a=hi(r.as("d")),u=hi(r.as("M")),c=hi(r.as("y")),l=i0,l[4]=n,Dn.apply(null,l)}function On(t,e){return void 0===fi[t]?!1:void 0===e?fi[t]:(fi[t]=e,!0)}function Fn(t){var e=this.localeData(),n=Mn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Rn(){var t,e,n,r=pi(this._milliseconds)/1e3,i=pi(this._days),o=pi(this._months);t=g(r/60),e=g(t/60),r%=60,t%=60,n=g(o/12),o%=12;var s=n,a=o,u=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var jn,Bn,Nn=t.momentProperties=[],In=!1,Ln={},Pn={},Un=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Vn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qn={},Yn={},$n=/\d/,zn=/\d\d/,Hn=/\d{3}/,Wn=/\d{4}/,Gn=/[+-]?\d{6}/,Xn=/\d\d?/,Jn=/\d{1,3}/,Kn=/\d{1,4}/,Zn=/[+-]?\d{1,6}/,Qn=/\d+/,tr=/[+-]?\d+/,er=/Z|[+-]\d\d:?\d\d/gi,nr=/[+-]?\d+(\.\d{1,3})?/,rr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ir={},or={},sr=0,ar=1,ur=2,cr=3,lr=4,hr=5,fr=6;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),R("MMMM",0,0,function(t){return this.localeData().months(this,t)}),k("month","M"),P("M",Xn),P("MM",Xn,zn),P("MMM",rr),P("MMMM",rr),q(["M","MM"],function(t,e){e[ar]=m(t)-1}),q(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[ar]=i:c(n).invalidMonth=t});var pr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),dr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),gr={};t.suppressDeprecationWarnings=!1;var mr=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],vr=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],_r=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=tt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),k("year","y"),P("Y",tr),P("YY",Xn,zn),P("YYYY",Kn,Wn),P("YYYYY",Zn,Gn),P("YYYYYY",Zn,Gn),q(["YYYYY","YYYYYY"],sr),q("YYYY",function(e,n){n[sr]=2===e.length?t.parseTwoDigitYear(e):m(e)}),q("YY",function(e,n){n[sr]=t.parseTwoDigitYear(e)}),t.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var br=S("FullYear",!1);R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),k("week","w"),k("isoWeek","W"),P("w",Xn),P("ww",Xn,zn),P("W",Xn),P("WW",Xn,zn),Y(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var wr={dow:0,doy:6};R("DDD",["DDDD",3],"DDDo","dayOfYear"),k("dayOfYear","DDD"), -P("DDD",Jn),P("DDDD",Hn),q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),t.ISO_8601=function(){};var Er=tt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Dt.apply(null,arguments);return this>t?this:t}),xr=tt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Dt.apply(null,arguments);return t>this?this:t});Bt("Z",":"),Bt("ZZ",""),P("Z",er),P("ZZ",er),q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Nt(t)});var Cr=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var kr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ar=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Jt.fn=Rt.prototype;var Tr=te(1,"add"),Sr=te(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Dr=tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),De("gggg","weekYear"),De("ggggg","weekYear"),De("GGGG","isoWeekYear"),De("GGGGG","isoWeekYear"),k("weekYear","gg"),k("isoWeekYear","GG"),P("G",tr),P("g",tr),P("GG",Xn,zn),P("gg",Xn,zn),P("GGGG",Kn,Wn),P("gggg",Kn,Wn),P("GGGGG",Zn,Gn),P("ggggg",Zn,Gn),Y(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),Y(["gg","GG"],function(e,n,r,i){n[i]=t.parseTwoDigitYear(e)}),R("Q",0,0,"quarter"),k("quarter","Q"),P("Q",$n),q("Q",function(t,e){e[ar]=3*(m(t)-1)}),R("D",["DD",2],"Do","date"),k("date","D"),P("D",Xn),P("DD",Xn,zn),P("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),q(["D","DD"],ur),q("Do",function(t,e){e[ur]=m(t.match(Xn)[0],10)});var Mr=S("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),R("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),R("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),k("day","d"),k("weekday","e"),k("isoWeekday","E"),P("d",Xn),P("e",Xn),P("E",Xn),P("dd",rr),P("ddd",rr),P("dddd",rr),Y(["dd","ddd","dddd"],function(t,e,n){var r=n._locale.weekdaysParse(t);null!=r?e.d=r:c(n).invalidWeekday=t}),Y(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var Or="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("H",["HH",2],0,"hour"),R("h",["hh",2],0,function(){return this.hours()%12||12}),$e("a",!0),$e("A",!1),k("hour","h"),P("a",ze),P("A",ze),P("H",Xn),P("h",Xn),P("HH",Xn,zn),P("hh",Xn,zn),q(["H","HH"],cr),q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),q(["h","hh"],function(t,e,n){e[cr]=m(t),c(n).bigHour=!0});var jr=/[ap]\.?m?\.?/i,Br=S("Hours",!0);R("m",["mm",2],0,"minute"),k("minute","m"),P("m",Xn),P("mm",Xn,zn),q(["m","mm"],lr);var Nr=S("Minutes",!1);R("s",["ss",2],0,"second"),k("second","s"),P("s",Xn),P("ss",Xn,zn),q(["s","ss"],hr);var Ir=S("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),k("millisecond","ms"),P("S",Jn,$n),P("SS",Jn,zn),P("SSS",Jn,Hn);var Lr;for(Lr="SSSS";Lr.length<=9;Lr+="S")P(Lr,Qn);for(Lr="S";Lr.length<=9;Lr+="S")q(Lr,Ge);var Pr=S("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ur=p.prototype;Ur.add=Tr,Ur.calendar=ne,Ur.clone=re,Ur.diff=ue,Ur.endOf=be,Ur.format=fe,Ur.from=pe,Ur.fromNow=de,Ur.to=ge,Ur.toNow=me,Ur.get=O,Ur.invalidAt=Se,Ur.isAfter=ie,Ur.isBefore=oe,Ur.isBetween=se,Ur.isSame=ae,Ur.isValid=Ae,Ur.lang=Dr,Ur.locale=ye,Ur.localeData=ve,Ur.max=xr,Ur.min=Er,Ur.parsingFlags=Te,Ur.set=O,Ur.startOf=_e,Ur.subtract=Sr,Ur.toArray=Ce,Ur.toObject=ke,Ur.toDate=xe,Ur.toISOString=he,Ur.toJSON=he,Ur.toString=le,Ur.unix=Ee,Ur.valueOf=we,Ur.year=br,Ur.isLeapYear=ut,Ur.weekYear=Oe,Ur.isoWeekYear=Fe,Ur.quarter=Ur.quarters=Be,Ur.month=J,Ur.daysInMonth=K,Ur.week=Ur.weeks=pt,Ur.isoWeek=Ur.isoWeeks=dt,Ur.weeksInYear=je,Ur.isoWeeksInYear=Re,Ur.date=Mr,Ur.day=Ur.days=Ve,Ur.weekday=qe,Ur.isoWeekday=Ye,Ur.dayOfYear=mt,Ur.hour=Ur.hours=Br,Ur.minute=Ur.minutes=Nr,Ur.second=Ur.seconds=Ir,Ur.millisecond=Ur.milliseconds=Pr,Ur.utcOffset=Pt,Ur.utc=Vt,Ur.local=qt,Ur.parseZone=Yt,Ur.hasAlignedHourOffset=$t,Ur.isDST=zt,Ur.isDSTShifted=Ht,Ur.isLocal=Wt,Ur.isUtcOffset=Gt,Ur.isUtc=Xt,Ur.isUTC=Xt,Ur.zoneAbbr=Xe,Ur.zoneName=Je,Ur.dates=tt("dates accessor is deprecated. Use date instead.",Mr),Ur.months=tt("months accessor is deprecated. Use month instead",J),Ur.years=tt("years accessor is deprecated. Use year instead",br),Ur.zone=tt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ut);var Vr=Ur,qr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Yr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$r="Invalid date",zr="%d",Hr=/\d{1,2}/,Wr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Gr=v.prototype;Gr._calendar=qr,Gr.calendar=Qe,Gr._longDateFormat=Yr,Gr.longDateFormat=tn,Gr._invalidDate=$r,Gr.invalidDate=en,Gr._ordinal=zr,Gr.ordinal=nn,Gr._ordinalParse=Hr,Gr.preparse=rn,Gr.postformat=rn,Gr._relativeTime=Wr,Gr.relativeTime=on,Gr.pastFuture=sn,Gr.set=an,Gr.months=H,Gr._months=pr,Gr.monthsShort=W,Gr._monthsShort=dr,Gr.monthsParse=G,Gr.week=lt,Gr._week=wr,Gr.firstDayOfYear=ft,Gr.firstDayOfWeek=ht,Gr.weekdays=Ie,Gr._weekdays=Or,Gr.weekdaysMin=Pe,Gr._weekdaysMin=Rr,Gr.weekdaysShort=Le,Gr._weekdaysShort=Fr,Gr.weekdaysParse=Ue,Gr.isPM=He,Gr._meridiemParse=jr,Gr.meridiem=We,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===m(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=tt("moment.lang is deprecated. Use moment.locale instead.",E),t.langData=tt("moment.langData is deprecated. Use moment.localeData instead.",C);var Xr=Math.abs,Jr=kn("ms"),Kr=kn("s"),Zr=kn("m"),Qr=kn("h"),ti=kn("d"),ei=kn("w"),ni=kn("M"),ri=kn("y"),ii=Tn("milliseconds"),oi=Tn("seconds"),si=Tn("minutes"),ai=Tn("hours"),ui=Tn("days"),ci=Tn("months"),li=Tn("years"),hi=Math.round,fi={s:45,m:45,h:22,d:26,M:11},pi=Math.abs,di=Rt.prototype;di.abs=gn,di.add=yn,di.subtract=vn,di.as=xn,di.asMilliseconds=Jr,di.asSeconds=Kr,di.asMinutes=Zr,di.asHours=Qr,di.asDays=ti,di.asWeeks=ei,di.asMonths=ni,di.asYears=ri,di.valueOf=Cn,di._bubble=bn,di.get=An,di.milliseconds=ii,di.seconds=oi,di.minutes=si,di.hours=ai,di.days=ui,di.weeks=Sn,di.months=ci,di.years=li,di.humanize=Fn,di.toISOString=Rn,di.toString=Rn,di.toJSON=Rn,di.locale=ye,di.localeData=ve,di.toIsoString=tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rn),di.lang=Dr,R("X",0,0,"unix"),R("x",0,0,"valueOf"),P("x",tr),P("X",nr),q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),q("x",function(t,e,n){n._d=new Date(m(t))}),t.version="2.10.6",e(Dt),t.fn=Vr,t.min=Ot,t.max=Ft,t.utc=a,t.unix=Ke,t.months=ln,t.isDate=r,t.locale=E,t.invalid=h,t.duration=Jt,t.isMoment=d,t.weekdays=fn,t.parseZone=Ze,t.localeData=C,t.isDuration=jt,t.monthsShort=hn,t.weekdaysMin=dn,t.defineLocale=x,t.weekdaysShort=pn,t.normalizeUnits=A,t.relativeTimeThreshold=On;var gi=t;return gi}),function(t,e){"function"==typeof define&&define.amd?define([],function(){return e(t)}):"object"==typeof exports?module.exports=e(t):t.Polyglot=e(t)}(this,function(t){"use strict";function e(t){t=t||{},this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en",this.allowMissing=!!t.allowMissing,this.warn=t.warn||u}function n(t){var e,n,r,i={};for(e in t)if(t.hasOwnProperty(e)){n=t[e];for(r in n)i[n[r]]=e}return i}function r(t){return l.call(t,d,"")}function i(t,e,n){var i,o,a;return null!=n&&t?(o=t.split(h),a=o[s(e,n)]||o[0],i=r(a)):i=t,i}function o(t){var e=n(p);return e[t]||e.en}function s(t,e){return f[o(t)](e)}function a(t,e){for(var n in e)if("_"!==n&&e.hasOwnProperty(n)){var r=e[n];"string"==typeof r&&(r=l.call(e[n],g,m)),t=l.call(t,new RegExp("%\\{"+n+"\\}","g"),r)}return t}function u(e){t.console&&t.console.warn&&t.console.warn("WARNING: "+e)}function c(t){var e={};for(var n in t)e[n]=t[n];return e}var l=String.prototype.replace;e.VERSION="0.4.5",e.prototype.locale=function(t){return t&&(this.currentLocale=t),this.currentLocale},e.prototype.extend=function(t,e){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],e&&(r=e+"."+r),"object"==typeof n?this.extend(n,r):this.phrases[r]=n)},e.prototype.unset=function(t,e){var n;if("string"==typeof t)delete this.phrases[t];else for(var r in t)t.hasOwnProperty(r)&&(n=t[r],e&&(r=e+"."+r),"object"==typeof n?this.unset(n,r):delete this.phrases[r])},e.prototype.clear=function(){this.phrases={}},e.prototype.replace=function(t){this.clear(),this.extend(t)},e.prototype.t=function(t,e){var n,r;return e=null==e?{}:e,"number"==typeof e&&(e={smart_count:e}),"string"==typeof this.phrases[t]?n=this.phrases[t]:"string"==typeof e._?n=e._:this.allowMissing?n=t:(this.warn('Missing translation for key: "'+t+'"'),r=t),"string"==typeof n&&(e=c(e),r=i(n,this.currentLocale,e.smart_count),r=a(r,e)),r},e.prototype.has=function(t){return t in this.phrases};var h="||||",f={chinese:function(t){return 0},german:function(t){return 1!==t?1:0},french:function(t){return t>1?1:0},russian:function(t){return t%10===1&&t%100!==11?0:t%10>=2&&4>=t%10&&(10>t%100||t%100>=20)?1:2},czech:function(t){return 1===t?0:t>=2&&4>=t?1:2},polish:function(t){return 1===t?0:t%10>=2&&4>=t%10&&(10>t%100||t%100>=20)?1:2},icelandic:function(t){return t%10!==1||t%100===11?1:0}},p={chinese:["fa","id","ja","ko","lo","ms","th","tr","zh"],german:["da","de","en","es","fi","el","he","hu","it","nl","no","pt","sv"],french:["fr","tl","pt-br"],russian:["hr","ru"],czech:["cs"],polish:["pl"],icelandic:["is"]},d=/^\s+|\s+$/g,g=/\$/g,m="$$$$";return e}),function(t){var e="object"==typeof exports&&exports,n="object"==typeof module&&module&&module.exports==e&&module,r="object"==typeof global&&global;(r.global===r||r.window===r)&&(t=r);var i=String.fromCharCode,o=function(t){return t.replace(/[\t\x20]$/gm,"").replace(/=?(?:\r\n?|\n)/g,"").replace(/=([a-fA-F0-9]{2})/g,function(t,e){var n=parseInt(e,16);return i(n)})},s=function(t){return t.replace(/\x20$/,"=20").replace(/\t$/,"=09")},a=/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,u=function(t){for(var e=t.replace(a,function(t){if(t>"ÿ")throw RangeError("`quotedPrintable.encode()` expects extended ASCII input only. Don’t forget to encode the input first using a character encoding like UTF-8.");var e=t.charCodeAt(0),n=e.toString(16).toUpperCase();return"="+("0"+n).slice(-2)}),n=e.split(/\r\n?|\n/g),r=-1,i=n.length,o=[];++rl;){var f=e.slice(l,l+c);/=$/.test(f)?(f=f.slice(0,c-1),l+=c-1):/=[A-F0-9]$/.test(f)?(f=f.slice(0,c-2),l+=c-2):l+=c,o.push(f)}var p=f.length;return/[\t\x20]$/.test(f)&&(o.pop(),c+1>=p+2?o.push(s(f)):o.push(f.slice(0,p-1),s(f.slice(p-1,p)))),o.join("=\r\n")},c={encode:u,decode:o,version:"0.2.1"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return c});else if(e&&!e.nodeType)if(n)n.exports=c;else for(var l in c)c.hasOwnProperty(l)&&(e[l]=c[l]);else t.quotedPrintable=c}(this),function(t){function e(t){for(var e,n,r=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function n(t){for(var e,n=t.length,r=-1,i="";++r65535&&(e-=65536,i+=g(e>>>10&1023|55296),e=56320|1023&e),i+=g(e);return i}function r(t,e){return g(t>>e&63|128)}function i(t){if(0==(4294967168&t))return g(t);var e="";return 0==(4294965248&t)?e=g(t>>6&31|192):0==(4294901760&t)?(e=g(t>>12&15|224),e+=r(t,6)):0==(4292870144&t)&&(e=g(t>>18&7|240),e+=r(t,12),e+=r(t,6)),e+=g(63&t|128)}function o(t){for(var n,r=e(t),o=r.length,s=-1,a="";++s=p)throw Error("Invalid byte index");var t=255&f[d];if(d++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function a(){var t,e,n,r,i;if(d>p)throw Error("Invalid byte index");if(d==p)return!1;if(t=255&f[d],d++,0==(128&t))return t;if(192==(224&t)){var e=s();if(i=(31&t)<<6|e,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=s(),n=s(),i=(15&t)<<12|e<<6|n,i>=2048)return i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=s(),n=s(),r=s(),i=(15&t)<<18|e<<12|n<<6|r,i>=65536&&1114111>=i))return i;throw Error("Invalid UTF-8 detected")}function u(t){f=e(t),p=f.length,d=0;for(var r,i=[];(r=a())!==!1;)i.push(r);return n(i)}var c="object"==typeof exports&&exports,l="object"==typeof module&&module&&module.exports==c&&module,h="object"==typeof global&&global;(h.global===h||h.window===h)&&(t=h);var f,p,d,g=String.fromCharCode,m={version:"2.0.0",encode:o,decode:u};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return m});else if(c&&!c.nodeType)if(l)l.exports=m;else{var y={},v=y.hasOwnProperty;for(var _ in m)v.call(m,_)&&(c[_]=m[_])}else t.utf8=m}(this),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jade=t()}}(function(){return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s":">",'"':"""},u=/[&<>"]/g;n.escape=s,n.rethrow=function l(e,n,r,i){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||i))throw e.message+=" on line "+r,e;try{i=i||t("fs").readFileSync(n,"utf8")}catch(o){l(e,null,r)}var s=3,a=i.split("\n"),u=Math.max(r-s,0),c=Math.min(a.length,r+s),s=a.slice(u,c).map(function(t,e){var n=e+u+1;return(n==r?" > ":" ")+n+"| "+t}).join("\n");throw e.path=n,e.message=(n||"Jade")+":"+r+"\n"+s+"\n\n"+e.message,e},n.DebugItem=function(t,e){this.lineno=t,this.filename=e}},{fs:2}],2:[function(t,e,n){},{}]},{},[1])(1)});var ColorHash=function(){function t(t){var e,n,r,i;for(e=0,i=Math.pow(2,32),n=0,r=t.length;r>n;n++)e=(31*e+t.charCodeAt(n))%i;return e}function e(e,n){var r,i;return r=o[n]||o.base,i=t(e),"#"+r[i%r.length]}function n(t,e){o[t]=e}function r(t){return scheme[t]}function i(t){"base"!==t&&delete o[t]}var o={base:["00bb3f","238c47","007929","37dd6f","63dd8d","0f4fa8","284c7e","05316d","4380d3","6996d3","ff9f00","bf8930","a66800","ffb740","ffca73","ff2800","bf4630","a61a00","ff5d40","ff8973"]};return{addScheme:n,getScheme:r,deleteScheme:i,getHash:t,getColor:e}}(),saveAs=saveAs||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},s=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),a=t.webkitRequestFileSystem,u=t.requestFileSystem||a||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},l="application/octet-stream",h=0,f=500,p=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,f)},d=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(o){c(o)}}},g=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},m=function(e,c,f){f||(e=g(e));var m,y,v,_=this,b=e.type,w=!1,E=function(){d(_,"writestart progress write writeend".split(" "))},x=function(){if(y&&s&&"undefined"!=typeof FileReader){var r=new FileReader;return r.onloadend=function(){var t=r.result;y.location.href="data:attachment/file"+t.slice(t.search(/[,;]/)),_.readyState=_.DONE,E()},r.readAsDataURL(e),void(_.readyState=_.INIT)}if((w||!m)&&(m=n().createObjectURL(e)),y)y.location.href=m;else{var i=t.open(m,"_blank");void 0==i&&s&&(t.location.href=m)}_.readyState=_.DONE,E(),p(m)},C=function(t){return function(){return _.readyState!==_.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return _.readyState=_.INIT,c||(c="download"),i?(m=n().createObjectURL(e),r.href=m,r.download=c,void setTimeout(function(){o(r),E(),p(m),_.readyState=_.DONE})):(t.chrome&&b&&b!==l&&(v=e.slice||e.webkitSlice,e=v.call(e,0,e.size,l),w=!0),a&&"download"!==c&&(c+=".download"),(b===l||a)&&(y=t),u?(h+=e.size,void u(t.TEMPORARY,h,C(function(t){t.root.getDirectory("saved",k,C(function(t){var n=function(){t.getFile(c,k,C(function(t){t.createWriter(C(function(n){n.onwriteend=function(e){y.location.href=t.toURL(),_.readyState=_.DONE,d(_,"writeend",e),p(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=_["on"+t]}),n.write(e),_.abort=function(){n.abort(),_.readyState=_.DONE},_.readyState=_.WRITING}),x)}),x)};t.getFile(c,{create:!1},C(function(t){t.remove(),n()}),C(function(t){t.code===t.NOT_FOUND_ERR?n():x()}))}),x)}),x)):void x())},y=m.prototype,v=function(t,e,n){return new m(t,e,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return n||(t=g(t)),navigator.msSaveOrOpenBlob(t,e||"download")}:(y.abort=function(){var t=this;t.readyState=t.DONE,d(t,"abort")},y.readyState=y.INIT=0,y.WRITING=1,y.DONE=2,y.error=y.onwritestart=y.onprogress=y.onwrite=y.onabort=y.onerror=y.onwriteend=null,v)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs}),function(t){if("function"==typeof bootstrap)bootstrap("backboneprojections",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeBackboneProjections=t}else"undefined"!=typeof window?window.BackboneProjections=t():global.BackboneProjections=t()}(function(){return function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var s="function"==typeof require&&require;if(!o&&s)return s(n,!0);if(i)return i(n,!0);throw new Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var i=t[n][1][e];return r(i?i:e)},a,a.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;on?1:n>t?-1:0}),t.slice(0,this.options.cap)},e.prototype.resize=function(t){var e,n,r,i,o;if(this.options.cap>t)for(this.options.cap=t,o=this.models,n=i=o.length-1;i>=0&&(r=o[n],!(t>n));n=i+=-1)this.remove(r);else this.options.cape;e++)t=r[e],i.push(this.decideOn(t));return i},e.prototype.decideOn=function(t){if(this.contains(t)){if(!this.options.filter(t))return this.remove(t)}else if(this.options.filter(t))return this.add(t)},e}(r),n.FilteredCollection=n.Filtered},{backbone:"backbone",underscore:"underscore"}],"lib/sorted.js":[function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=(("undefined"!=typeof window&&null!==window?window.Backbone:void 0)||t("backbone")).Collection,i=(("undefined"!=typeof window&&null!==window?window._:void 0)||t("underscore")).extend,n.Sorted=function(t){function e(t,n){var r=this;if(null==n&&(n={}),!n.comparator)throw new Error("provide a comparator");this.underlying=t,this.model=t.model,this.comparator=n.comparator,this.options=i({},t.options,n),e.__super__.constructor.call(this,this.underlying.models,n),this.listenTo(this.underlying,{reset:function(){return r.reset(r.underlying.models)},remove:function(t){return r.remove(t)},add:function(t){return r.add(t)}})}return s(e,t),e}(r),n.Reversed=function(t){function e(t,n){null==n&&(n={}),n.comparator=function(e){return-t.indexOf(e)},e.__super__.constructor.call(this,t,n),this.listenTo(this.underlying,{sort:this.sort})}return s(e,t),e}(n.Sorted),n.SortedCollection=n.Sorted,n.ReversedCollection=n.Reversed},{backbone:"backbone",underscore:"underscore"}]},{},["lib/index.js"])("lib/index.js")}),function(){var t=function(t,n){function r(){this.constructor=t}for(var i in n)e.call(n,i)&&(t[i]=n[i]);return r.prototype=n.prototype,t.prototype=new r,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].slice,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};!function(t){var e,n;return n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global,"function"==typeof define&&define.amd?define(["backbone"],function(e){return t(n,e)}):"undefined"!=typeof exports?(e=require("backbone"),module.exports=t(n,e)):t(n,n.Backbone)}(function(e,i){var o;return Object.defineProperty(Object.prototype,"setValueOf",{__proto__:null,value:function(t,e){return t.split(".").reduce(function(t,n,r,i){var o;return o=r===i.length-1?e:null!=t[n]?t[n]:"number"===+n?[]:{},t[n]=o},this)}}),i.ViewModel=o=function(e){function i(t,e){var r;this.model=(null!=e?e.model:void 0)||null,r=this._buildMappedAttributes(),i.__super__.constructor.call(this,_.extend({},t,r),e),this.listenTo(this.model,"all",function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.trigger.apply(this,t)}),this.proxyMethods(),this.bindEntityEvents()}return t(i,e),i.prototype.proxyMethods=function(){var t,e,n,r,i;if(this.model){for(r=_.result(this,"proxy",{}),i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(this[n]=this.model[n].bind(this.model));return i}},i.prototype.bindEntityEvents=function(){var t,e,n,r,i,o;e=_.result(this,"events",{}),o=[];for(t in e)i=e[t],_.isFunction(i)?o.push(this.listenTo(this,t,i)):(r=i.split(/\s+/),o.push(function(){var e,i,o;for(o=[],e=0,i=r.length;i>e;e++)n=r[e],this[n]?o.push(this.listenTo(this,t,this[n])):o.push(void 0);return o}.call(this)));return o},i.prototype.sync=function(){},i.prototype.reset=function(){var t,e,n,i;e=_.result(this,"defaults",{}),n=_.result(this,"map",{}),i=_.union(_.keys(e),_.keys(n));for(t in this.attributes)r.call(i,t)<0&&this.unset(t);return this.trigger("reset")},i.prototype.save=function(t,e,n){var r,i;return null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),r&&this.set(r),i=_.reduce(this.attributes,function(t){return function(e,n,r){var i;return i="saveMapped"+r[0].toUpperCase()+r.slice(1),null!=t.map[r]&&_.isFunction(t[i])?_.extend(e,t[i]()):null==t.defaults[r]&&null==t.map[r]&&(e[r]=n),e}}(this),{}),n.wait=!0,n.success=function(t){return function(){return t.trigger("save")}}(this),this.trigger("before:save"),this.model.save(i,n)},i.prototype.destroy=function(t){var e;return e=function(e){return function(){return e.stopListening(),e.trigger("destroy",e,e.collection,t)}}(this),this.model.destroy(_.extend({},t,{wait:!0,success:e}))},i.prototype._buildMappedAttributes=function(){return this.map?Object.keys(this.map).reduce(function(t){return function(e,n){var r,i,o;return o="getMapped"+n[0].toUpperCase()+n.slice(1),_.isFunction(t[o])?(r=t.map[n].split(" "),i=function(e){var i,s,a;return s=_.defaults({},e,{immediate:!0,reset:!0}),i=r.map(function(e){return t.model.get(e)}),a=t[o].apply(t,i),s.immediate&&t.set(n,a,{reset:s.reset}),a},t.listenTo(t,"reset",i),r.map(function(e){return t.listenTo(t.model,"change:"+e,i)}),e[n]=i({immediate:!1}),e):e}}(this),{}):{}},i.prototype.toJSON=function(){return this.model?_.extend(this.model.toJSON(),_.clone(this.attributes)):_.clone(this.attributes)},i.prototype.get=function(t){var e;return null!=this.attributes[t]?this.attributes[t]:null!=(e=this.model)?e.get(t):void 0},i.prototype.set=function(t,e,n){var r,o,s,a;if(null==t)return this;if("object"==typeof t?(o=t,n=e):(o={})[t]=e,n||(n={}),!n.reset)for(r in o)a=o[r],s=a&&_.isObject(a)&&!_.isArray(a),s&&_.isObject(this.attributes[r])&&(o[r]=_.extend({},this.attributes[r],a));return i.__super__.set.call(this,o,n)},i}(i.Model)})}.call(this),function(){var t,e,n=function(t,e){return function(){return t.apply(e,arguments)}};t=function(){function t(){this.processStack=n(this.processStack,this),this.callbackFactory=n(this.callbackFactory,this),this.resume=n(this.resume,this),this.pause=n(this.pause,this);var t,e;try{this.connect()}catch(e){t=e,console.log("Error while connecting to socket.io"),console.log(t.stack)}this.collections=[],this.singlemodels=new Backbone.Collection,this.stack=[],this.ignore=[],this.paused=0}return t.prototype.models={},t.prototype.events=[],t.prototype.shouldFetchCreated=function(t){return!0},t.prototype.onRemoteCreate=function(t){},t.prototype.onRemoteUpdate=function(t,e){},t.prototype.onRemoteDelete=function(t,e){},t.prototype.connect=function(){var t,e,n,r,i,o,s;for(s=window.location.origin,r="/"+window.location.pathname.substring(1)+"socket.io",this.socket=io(s,{path:r,reconnectionDelayMax:6e4,reconectionDelay:2e3,reconnectionAttempts:3}),i=this.events,o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(this.socket.on(t,this.callbackFactory(t)));return o},t.prototype.watch=function(t){return 0===this.collections.length&&(this.collection=t),this.collections.push(t),t.socketListener=this,this.watchOne(t)},t.prototype.stopWatching=function(t){var e,n,r,i,o;for(o=this.collections,n=r=0,i=o.length;i>r;n=++r)if(e=o[n],e===t)return this.collections.splice(n,1)},t.prototype.watchOne=function(t){return this.singlemodels.add(t),t.on("request",this.pause),t.on("sync",this.resume),t.on("destroy",this.resume),t.on("error",this.resume)},t.prototype.pause=function(t,e,n){var r,i;if(n.ignoreMySocketNotification){if(i=t.isNew()?"create":"update",r=this.getDoctypeOf(t),null==r)return;return this.ignore.push({doctype:r,operation:i,model:t}),this.paused=this.paused+1}},t.prototype.resume=function(t,e,n){ -return n.ignoreMySocketNotification&&(this.paused=this.paused-1,this.paused<=0)?(this.processStack(),this.paused=0):void 0},t.prototype.getDoctypeOf=function(t){var e,n,r;r=this.models;for(n in r)if(e=r[n],t instanceof e)return n},t.prototype.cleanStack=function(){var t,e,n,r,i,o;for(e=0,r=[];e0;)t.push(this.process(this.stack.shift()));return t},t.prototype.process=function(t){var e,n,r,i;switch(e=t.doctype,i=t.operation,n=t.id,i){case"create":if(!this.shouldFetchCreated(n))return;return r=new this.models[e]({id:n}),r.fetch({success:function(t){return function(e){return t.onRemoteCreate(e)}}(this)});case"update":return(r=this.singlemodels.get(n))&&r.fetch({success:function(t){return function(e){return e.changedAttributes()?t.onRemoteUpdate(e,null):void 0}}(this)}),this.collections.forEach(function(t){return function(e){return(r=e.get(n))?r.fetch({success:function(n){return n.changedAttributes()?t.onRemoteUpdate(n,e):void 0}}):void 0}}(this));case"delete":return(r=this.singlemodels.get(n))&&this.onRemoteDelete(r,this.singlemodels),this.collections.forEach(function(t){return function(e){return(r=e.get(n))?t.onRemoteDelete(r,e):void 0}}(this))}},t}(),e=("undefined"!=typeof module&&null!==module?module.exports:void 0)||window,e.CozySocketListener=t}.call(this),function(){var t,e,n,r,i,o,s,a,u,c,l,h,f,p,d,g,m,y,v,_,b,w,E,x,C,k,A,T,S,D,M,O,F=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},R=[].slice;("undefined"!=typeof module&&null!==module?module.exports:void 0)?(O=require("utf8"),D=require("quoted-printable")):(O=window.utf8,D=window.quotedPrintable),M={begin:/^BEGIN:VCARD$/i,end:/^END:VCARD$/i,beginNonVCard:/^BEGIN:(.*)$/i,endNonVCard:/^END:(.*)$/i,simple:/^(version|fn|n|title|org|note|categories|bday|url|nickname|uid|tz|lang|geo|gender|kind)(;CHARSET=UTF-8)?(;ENCODING=QUOTED-PRINTABLE)?\:(.+)$/i,composedkey:/^item(\d{1,2})\.([^\:]+):(.+)$/,complex:/^([^\:\;]+);([^\:]+)\:(.+)$/,property:/^(.+)=(.+)$/,extended:/^X-([^\:]+)\:(.+)$/i,applebday:/^(version|fn|n|title|org|note|categories|bday|url);value=date:(.+)$/i,android:/^x-android-custom\:(.+)$/i},r=["skype","skype-username","aim","msn","yahoo","qq","google-talk","gtalk","icq","jabber","sip","gad"],i=["aim","jabber","msn","yahoo","icq"],a=["phonetic-first-name","phonetic-middle-name","phonetic-last-name"],t=["custom","assistant","brother","child","domestic partner","father","friend","manager","mother","parent","partner","referred by","relative","sister","spouse"],e=["fn","bday","org","title","url","note","nickname","uid"],n=["tz","lang","geo","gender","kind"],u={twitter:"http://twitter.com/",facebook:"http://facebook.com/",flickr:"http://www.flickr.com/photos/",linkedin:"http://www.linkedin.com/in/",myspace:"http://www.myspace.com/",sina:"http://weibo.com/n/"},s={msn:"MSN:msnim",skype:"Skype:skype","google-talk":"GoogleTalk:xmpp",googletalk:"GoogleTalk:xmpp",gtalk:"GoogleTalk:xmpp",facebook:"Facebook:xmpp",aim:"AIM:aim",yahoo:"Yahoo:aim",icq:"ICQ:aim",jabber:"Jabber:xmpp",qq:"QQ:x-apple",gadugadu:"GaduGadu:x-apple"},o={msn:"MSN",skype:"Skype","google-talk":"GoogleTalk",googletalk:"GoogleTalk",gtalk:"GoogleTalk",facebook:"Facebook",aim:"AIM",yahoo:"Yahoo:",icq:"ICQ",jabber:"Jabber",qq:"QQ",gadugadu:"GaduGadu"},S=function(t){var e,n,r,i,o;return r=/^(\d{4})[-\/](\d{2})[-\/](\d{2})$/.exec(t),null===r?!1:(o=parseInt(r[1]),n=parseInt(r[2]-1),e=parseInt(r[3]),t=new Date(o,n,e),i=t.getDate()===e,i=i&&t.getMonth()===n,i=i&&t.getFullYear()===o)},l=function(t){return""+t.charAt(0).toUpperCase()+t.toLowerCase().slice(1)},T=function(e,n,r){var i,o,s;if(n=n.toLowerCase().replace("_"," "),"anniversary"===n)i=1;else if("died"===n)i=2;else{for(i=0,o=t.length;o>i&&t[i]!==n;)i++;i===o&&(n=null)}return n?(s="X-ANDROID-CUSTOM:vnd.android.cursor.item/",""+s+e+";"+r+";"+i+";;;;;;;;;;;;;"):null},c=function(){function i(t){this.reset(),t&&this.read(t)}return i.prototype.reset=function(){return this.contacts=[],this.currentContact=null,this.currentDatapoint=null,this.currentIndex=null,this.currentVersion="3.0"},i.prototype.storeCurrentDatapoint=function(){return this.currentDatapoint?(this.currentContact.datapoints.push(this.currentDatapoint),this.currentDatapoint=null):void 0},i.prototype.addDatapoint=function(t,e,n){return this.storeCurrentDatapoint(),this.currentContact.datapoints.push({name:t,type:e,value:n})},i.prototype.addTypeProperty=function(t,e){return null!=t.type&&"internet"!==t.type?t.type=t.type+" "+e:t.type=e},i.prototype.storeCurrentContact=function(){var t;return null==this.currentContact.n&&null==this.currentContact.fn&&console.error("There should be at least a N field or a FN field"),(null==this.currentContact.n||""===(t=this.currentContact.n)||";;;;"===t)&&(this.currentContact.n=i.fnToN(this.currentContact.fn).join(";")),(null==this.currentContact.fn||""===this.currentContact.fn)&&(this.currentContact.fn=i.nToFN(this.currentContact.n)),this.contacts.push(this.currentContact)},i.prototype.read=function(t){var e,n,r,i,o;for(i=this.splitLines(t),o=[],e=0,n=i.length;n>e;e++)r=i[e],o.push(this.handleLine(r));return o},i.prototype.splitLines=function(t){var e,n,r;return r=t.split(/\r?\n/),n=[],e=!1,r.forEach(function(t){var r;return null!=t&&""!==t?" "===t[0]||e?(" "===t[0]&&(t=t.slice(1)),e&&("="===t[t.length-1]?t=t.slice(0,-1):e=!1),r=n.length-1,r>=0?n[r]=n[r]+t:n.push(t)):(/^(.+)ENCODING=QUOTED-PRINTABLE(.+)=$/i.test(t)&&(e=!0,t=t.slice(0,-1)),n.push(t)):void 0}),n},i.prototype.handleLine=function(t){if(this.nonVCard){if(M.endNonVCard.test(t)&&t.match(M.endNonVCard)[1]===this.nonVCard)return this.nonVCard=!1}else{if(M.begin.test(t))return this.currentContact={datapoints:[]};if(M.beginNonVCard.test(t))return this.nonVCard=t.match(M.beginNonVCard)[1];if(M.end.test(t))return this.storeCurrentDatapoint(),this.storeCurrentContact();if(M.simple.test(t))return this.handleSimpleLine(t);if(M.applebday.test(t))return this.handleSimpleLine(t,!0);if(M.android.test(t))return this.handleAndroidLine(t);if(M.extended.test(t))return this.handleExtendedLine(t);if(M.composedkey.test(t))return this.handleComposedLine(t);if(M.complex.test(t))return this.handleComplexLine(t)}},i.prototype.handleSimpleLine=function(t,r){var o,s,a,u,c,l,h,f,p,d;return null==r&&(r=!1),r?(l=t.match(M.applebday),o=l[0],s=l[1],p=l[2]):(h=t.match(M.simple),o=h[0],s=h[1],f=h[2],c=h[3],p=h[4]),null!=c&&(p=i.unquotePrintable(p)),p=i.unescapeText(p),s=s.toLowerCase(),"version"===s?this.currentversion=p:"rev"===s?this.currentContact.revision=p:"categories"===s?this.currentContact.tags=p.split(/(?!\\),/).map(i.unescapeText):"n"===s?(a=p.split(/(?!\\);/),5===a.length?this.currentContact.n=p:(u=["","","","",""],a.length<=5?a.forEach(function(t,e){return u[e]=t}):6===a.length?(u.push(""),a.forEach(function(t,e){return u[e]=t})):u[2]=a.join(" "),this.currentContact.n=u.join(";"))):F.call(e,s)>=0?"org"===s?(d=p.split(";"),2===d.length?(this.currentContact.org=d[0],this.currentContact.department=d[1]):this.currentContact.org=p):this.currentContact[s.toLowerCase()]=p:F.call(n,s)>=0?this.currentContact[s.toLowerCase()]=p:void 0},i.prototype.handleExtendedLine=function(t){var e,n,i,o,s,u,c,l,h,f,p,d,g;if(l=t.match(M.extended),e=l[0],o=l[1],g=l[2],null!=o){if(o=o.toLowerCase(),F.call(r,o)>=0)return this.currentContact.datapoints.push({name:"chat",type:o,value:g});if(F.call(a,o)>=0)return o=o.replace(/-/g," "),this.currentContact.datapoints.push({name:"about",type:o,value:g});if(0===o.indexOf("socialprofile")){for(s=o.split(";"),n={},i=0,c=s.length;c>i;i++)u=s[i],h=u.split("="),n[h[0].replace("x-","")]=h[1];if(n.user||(n.user=g),n.type&&n.user)return f=n.type,p=n.user,this.currentContact.datapoints.push({name:"social",type:f,value:p})}else if("activity-alert"===o)return d=g.split(","),d.length>1&&(f=d.splice(0,1)[0],f=f.split("=")[1].replace(/\\/g,""),g=d.join(",")),this.currentContact.datapoints.push({name:"alerts",type:f,value:g})}},i.prototype.handleAndroidLine=function(e){var n,r,i,o,s,a,u;switch(o=e.match(M.android),n=o[0],i=o[1],r=i.split(";"),r[0].replace("vnd.android.cursor.item/","")){case"contact_event":return u=r[1],a="0"===(s=r[2])||"2"===s?r[3]:"1"===r[2]?"anniversary":"birthday",this.currentContact.datapoints.push({name:"about",type:a,value:u});case"relation":return u=r[1],a=t[+r[2]],"custom"===a&&(a=r[3]),this.currentContact.datapoints.push({name:"relation",type:a,value:u});case"nickname":return u=r[1],this.currentContact.nickname=u}},i.prototype.handleCurrentSpecialCases=function(){var t,e,n;return t=this.currentDatapoint,e=null!=t?t.type:void 0,F.call(r,e)>=0&&(t.name="chat",null!=t["x-service-type"]&&(t.value=t.value.split(":")[1],n=t["x-service-type"],F.call(r,n)<0&&(t.type=t["x-service-type"]))),"impp"===(null!=t?t.name:void 0)?(t.name="chat",t.value=t.value.split(":")[1]):void 0},i.prototype.handleComposedLine=function(t){var e,n,r,o,s,a,u;return a=t.match(M.composedkey),e=a[0],n=a[1],o=a[2],u=a[3],null!==this.currentIndex&&this.currentIndex===n&&this.currentDatapoint||(this.handleCurrentSpecialCases(),this.storeCurrentDatapoint(),this.currentDatapoint={}),this.currentIndex=n,o=o.split(";"),r=o[0],s=o.splice(1),u=u.split(";"),1===u.length&&(u=u[0].replace("_$!<","").replace(">!$_","").replace("\\:",":")),r=r.toLowerCase(),"x-ablabel"===r||"x-abadr"===r?this.addTypeProperty(this.currentDatapoint,u.toLowerCase()):(this.handleProperties(this.currentDatapoint,s),"x-abdate"===r&&(r="about"),"x-abrelatednames"===r&&(r="relation"),"adr"===r&&(u=Array.isArray(u)?u.map(i.unescapeText):["","",i.unescapeText(u),"","","",""]),this.currentDatapoint.name=r.toLowerCase(),this.currentDatapoint.value=u)},i.prototype.handleComplexLine=function(t){var e,n,r,o,s,a;return o=t.match(M.complex),e=o[0],n=o[1],r=o[2],a=o[3],this.storeCurrentDatapoint(),this.currentDatapoint={},a=a.split(";"),1===a.length&&(a=a[0]),n=n.toLowerCase(),"photo"===n?(this.currentContact.photo=a,this.currentDatapoint=null):"email"===(s=!n)||"tel"===s||"adr"===s||"url"===s?this.currentDatapoint=null:(this.currentDatapoint.name=n,"adr"===n&&(a=Array.isArray(a)?a.map(i.unescapeText):["","",i.unescapeText(a),"","","",""]),this.handleProperties(this.currentDatapoint,r.split(";")),"quoted-printable"===this.currentDatapoint.encoding&&(a=Array.isArray(a)?a.map(i.unquotePrintable):i.unquotePrintable(a),delete this.currentDatapoint.encoding),this.currentDatapoint.value=a)},i.prototype.handleProperties=function(t,e){var n,r,i,o,s,a,u,c,l;for(l=[],r=0,i=e.length;i>r;r++)u=e[r],(o=u.match(M.property))?(n=o[0],s=o[1],c=o[2],c=c.toLowerCase(),a=t[s.toLowerCase()],null!=a&&"internet"!==a&&(c=a+" "+c)):"PREF"===u?(s="pref",c=!0,null!=t.type?t.type=t.type+" "+u.toLowerCase():t.type=u.toLowerCase()):(s="type",c=null!=t.type?t.type+" "+u.toLowerCase():u.toLowerCase()),"type"===s&&"pref"===c&&(s="pref",c=!0),l.push(t[s.toLowerCase()]=c);return l},i}(),c.unquotePrintable=function(t){var e,n;t=t||"";try{return O.decode(D.decode(t))}catch(n){return e=n,t}},c.escapeText=function(t){var e;return null==t?t:(e=t.replace(/([,;\\])/gi,"\\$1"),e=e.replace(/\n/g,"\\n"))},c.unescapeText=function(t){var e;return null==t?t:(e=t.replace(/\\n/gi,"\n"),e=e.replace(/\\([,;\\])/gi,"$1"))},c.toVCF=function(t,e,n){var r,i,o,s,a,u,l,T,S,D,M,O,F,R,j;null==e&&(e=null),null==n&&(n="google"),a=0,D=["BEGIN:VCARD"],D.push("VERSION:3.0"),k(D,t),null!=t.revision&&E(D,t),null!=t.n&&v(D,t),d(D,t),y(D,t),null!=t.tags&&t.tags.length>0&&C(D,t),M=t.datapoints;for(s in M)if(i=M[s],null!=i.name&&null!=i.value){if(l=i.name.toUpperCase(),F=(null!=(O=i.type)?O.toUpperCase():void 0)||null,j=i.value,j=Array.isArray(j)?j.map(c.escapeText):c.escapeText(j),o="",null!=F)for(R=F.split(" "),u=0,T=R.length;T>u;u++)r=R[u],o+=";TYPE="+r;switch(S={out:D,type:F,formattedType:o,value:j,mode:n,itemCounter:a,key:l},l){case"ABOUT":a=h(S);break;case"OTHER":a=_(S);break;case"CHAT":a=g(S);break;case"URL":a=A(S);break;case"RELATION":a=w(S);break;case"ADR":a=f(S);break;case"SOCIAL":a=x(S);break;case"ALERTS":a=p(S);break;default:a=m(S)}}return null!=e&&b(D,e),D.push("END:VCARD"),D.join("\n")+"\n"},k=function(t,e){var n,r;return r=e.carddavuri,n=(null!=r?r.substring(0,r.length-4):void 0)||e.id,null!=n?t.push("UID:"+n):void 0},d=function(t,n){var r,i,o,s,a,u;for(a=[],i=0,o=e.length;o>i;i++)s=e[i],u=n[s],u&&(u=c.escapeText(u)),"org"===s&&null!=n.department&&n.department.length>0&&(r=c.escapeText(n.department),u=u+";"+r),u?a.push(t.push(s.toUpperCase()+":"+u)):a.push(void 0);return a},y=function(t,e){var r,i,o,s,a;for(s=[],r=0,i=n.length;i>r;r++)o=n[r],a=e[o],a&&(a=c.escapeText(a)),a?s.push(t.push(o.toUpperCase()+":"+a)):s.push(void 0);return s},v=function(t,e){return t.push("N:"+e.n)},E=function(t,e){return"date"==typeof e.revision?t.push("REV:"+e.revision.toISOString()):t.push("REV:"+e.revision)},C=function(t,e){var n;return n=e.tags.map(c.escapeText).join(","),t.push("CATEGORIES:"+n)},h=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,"DIED"===o||"ANNIVERSARY"===o?"android"===r?i.push(T("contact_event",o,s)):(n++,i.push("item"+n+".X-ABDATE:"+s),e=l(o),i.push("item"+n+".X-ABLabel:"+e)):0===o.indexOf("PHONETIC")?i.push("X-"+o.replace(/\s/g,"-")+":"+s):S(s)?(n++,i.push("item"+n+".X-ABDATE:"+s),e=l(o),i.push("item"+n+".X-ABLabel:"+e)):i.push("X-"+o+":"+s),n},_=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,i.push("X-EVENT"+e+":"+s),n},g=function(t){var e,n,r,i,o,a,u,c;return o=t.out,u=t.type,e=t.formattedType,c=t.value,i=t.mode,n=t.itemCounter,"SKYPE"===u&&"android"===i?o.push("X-SKYPE-USERNAME:"+c):"ios"===i?(n++,a=s[u.toLowerCase()],null!=a?(r="item"+n+".IMPP;",r+="X-SERVICE-TYPE="+a+":"+c,o.push(r)):(u=l(u.toLowerCase()),r="item"+n+".IMPP;",r+="X-SERVICE-TYPE="+u+":x-apple:"+c,o.push(r))):o.push("X-"+u+":"+c),n},A=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,null!=o?(n++,i.push("item"+n+".URL:"+s),"PROFILE"!==o&&"BLOG"!==o?(e=l(o.toLowerCase()),("ios"!==r||"HOME"!==o&&"WORK"!==o&&"OTHER"!==o)&&"ios"===r?i.push("item"+n+".X-ABLabel:"+e):i.push("item"+n+".X-ABLabel:_$!<"+e+">!$_")):i.push("item"+n+".X-ABLabel:"+o)):i.push("URL:"+s),n},w=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,"android"===i?(r=T("relation",s,a),r&&o.push(r)):(n++,o.push("item"+n+".X-ABRELATEDNAMES:"+a),e=l(s.toLowerCase()),o.push("item"+n+".X-ABLabel:_$!<"+e+">!$_")),n},f=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,r=t.key,Array.isArray(a)&&(a=a.join(";")),o.push(""+r+e+":"+a),n},x=function(t){var e,n,r,i,o,s,a,c,h,f;return o=t.out,a=t.type,e=t.formattedType,f=t.value,i=t.mode,n=t.itemCounter,r=t.key,c=f,h=u[a.toLowerCase()],null!=h?c=""+h+f:(e=l(a.toLowerCase()),e=";TYPE="+e),s="X-SOCIALPROFILE"+e+";x-user="+f+":"+c,o.push(s),n},p=function(t){var e,n,r,i,o,s,a,u;return o=t.out,a=t.type,e=t.formattedType,u=t.value,i=t.mode,n=t.itemCounter,r=t.key,a=a.toLowerCase(),u=u.replace(/\\\\\\/g,"\\"),s="X-ACTIVITY-ALERT:type="+a+"\\,"+u,o.push(s),n},m=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,r=t.key,o.push(""+r+e+":"+a),n},b=function(t,e){var n,r;return n=e.match(/.{1,75}/g).join("\n "),r="PHOTO;ENCODING=B;TYPE=JPEG;VALUE=BINARY:\n "+n,t.push(r)},c.nToFN=function(t){var e,n,r,i,o,s;return t=t||[],e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],i=[o,n,r,e,s],i=i.filter(function(t){return null!=t&&""!==t}),i.join(" ")},c.fnToN=function(t){return t=t||"",["",t,"","",""]},c.fnToNLastnameNFirstname=function(t){var e,n,r,i,o,s;return t=t||"",s=t.split(" "),n=s[0],i=3<=s.length?R.call(s,1,r=s.length-1):(r=1,[]),e=s[r++],o=[e,n,i.join(" "),"",""]},c.adrArrayToString=function(t){var e,n,r,i;return t=t||[],i=function(t){return t=t.filter(function(t){return null!=t&&""!==t}),t.join(", ")},r=i(t.slice(0,3)),e=i(t.slice(3,7)),n=r,""!==e&&(n+="\n"+e),n},c.adrStringToArray=function(t){return t=t||"",["","",t,"","","",""]},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=c:window.VCardParser=c}.call(this),function(){var t;t={AA:/[\uA732]/g,A:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g,AE:/[\u00C6\u01FC\u01E2]/g,AO:/[\uA734]/g,AU:/[\uA736]/g,AV:/[\uA738\uA73A]/g,AY:/[\uA73C]/g,B:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g,C:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g,D:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g,DZ:/[\u01F1\u01C4]/g,Dz:/[\u01F2\u01C5]/g,E:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g,F:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g,G:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g,H:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g,I:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g,J:/[\u004A\u24BF\uFF2A\u0134\u0248]/g,K:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g,L:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g,LJ:/[\u01C7]/g,Lj:/[\u01C8]/g,M:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g,N:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g,NJ:/[\u01CA]/g,Nj:/[\u01CB]/g,O:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g,OE:/[\u0152]/g,OI:/[\u01A2]/g,OO:/[\uA74E]/g,OU:/[\u0222]/g,P:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g,Q:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g,R:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g,S:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g,T:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g,TZ:/[\uA728]/g,U:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g,V:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g,VY:/[\uA760]/g,W:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g,X:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g,Y:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g,Z:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g,a:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g,aa:/[\uA733]/g,ae:/[\u00E6\u01FD\u01E3]/g,ao:/[\uA735]/g,au:/[\uA737]/g,av:/[\uA739\uA73B]/g,ay:/[\uA73D]/g,b:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g,c:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g,d:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g,dz:/[\u01F3\u01C6]/g,e:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g,f:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g,g:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g,h:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g,hv:/[\u0195]/g,i:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g,j:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g,k:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g,l:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g,lj:/[\u01C9]/g,m:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g,n:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g,nj:/[\u01CC]/g,o:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g,oe:/[\u0153]/g,oi:/[\u01A3]/g,ou:/[\u0223]/g,oo:/[\uA74F]/g,p:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g,q:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g,r:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g,s:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g,t:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g,tz:/[\uA729]/g,u:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g,v:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g,vy:/[\uA761]/g,w:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g,x:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g,y:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g,z:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/},String.prototype.toAscii=function(){var e;return e=this.match(/[a-zA-Z\s]/g),e&&e.length!==this.length?Object.keys(t).reduce(function(e,n){return e.replace(t[n],n)},this):this.slice()}}.call(this),function(t){"function"==typeof define&&define.amd?define(["underscore","backbone"],t):"object"==typeof exports?module.exports=t(require("underscore"),require("backbone")):t(_,Backbone)}(function(t,e){return e.SubRoute=e.Router.extend({constructor:function(n,r){this.routes=t.clone(this.routes)||{},this.prefix=n=n||"",this.separator="/"===n.slice(-1)?"":"/",this.createTrailingSlashRoutes=r&&r.createTrailingSlashRoutes,e.Router.prototype.constructor.call(this,r);var i;i=e.history.fragment?e.history.getFragment(e.history.fragment):e.history.getHash(),t.every(this.routes,function(t,n){return i.match(e.Router.prototype._routeToRegExp(n))?(e.history.loadUrl(i),!1):!0},this),this.postInitialize&&this.postInitialize(r)},navigate:function(t,n){"/"!=t.substr(0,1)&&0!==t.indexOf(this.prefix.substr(0,this.prefix.length-1))&&(t=this.prefix+(t?this.separator:"")+t),e.Router.prototype.navigate.call(this,t,n)},route:function(t,n,r){"/"===t.substr(0)&&(t=t.substr(1,t.length));var i=this.prefix;return t&&t.length>0&&(this.prefix.length>0&&(i+=this.separator),i+=t),this.createTrailingSlashRoutes&&(this.routes[i+"/"]=n,e.Router.prototype.route.call(this,i+"/",n,r)),delete this.routes[t],this.routes[i]=n,e.Router.prototype.route.call(this,i,n,r)}}),e.SubRoute}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.io=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},r.prototype.cleanup=function(){for(var t;t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(t){l("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)l("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();l("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(l("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(l("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(l("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e,n){function r(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}e.exports=r},{}],5:[function(t,e,n){function r(t,e){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var i=t("socket.io-parser"),o=t("component-emitter"),s=t("to-array"),a=t("./on"),u=t("component-bind"),c=t("debug")("socket.io-client:socket"),l=t("has-binary");e.exports=n=r;var h={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},f=o.prototype.emit; -o(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[a(t,"open",u(this,"onopen")),a(t,"packet",u(this,"onpacket")),a(t,"close",u(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},r.prototype.send=function(){var t=s(arguments);return t.unshift("message"),this.emit.apply(this,t),this},r.prototype.emit=function(t){if(h.hasOwnProperty(t))return f.apply(this,arguments),this;var e=s(arguments),n=i.EVENT;l(e)&&(n=i.BINARY_EVENT);var r={type:n,data:e};return"function"==typeof e[e.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this},r.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},r.prototype.onopen=function(){c("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:i.CONNECT})},r.prototype.onclose=function(t){c("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},r.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},r.prototype.onevent=function(t){var e=t.data||[];c("emitting event %j",e),null!=t.id&&(c("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?f.apply(this,e):this.receiveBuffer.push(e)},r.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);c("sending ack %j",r);var o=l(r)?i.BINARY_ACK:i.ACK;e.packet({type:o,id:t,data:r})}}},r.prototype.onack=function(t){c("calling ack %s with %j",t.id,t.data);var e=this.acks[t.id];e.apply(this,t.data),delete this.acks[t.id]},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var t;for(t=0;t0&&t.jitter<=1?t.jitter:0,this.attempts=0}e.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}},{}],8:[function(t,e,n){var r=[].slice;e.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return e.apply(t,n.concat(r.call(arguments)))}}},{}],9:[function(t,e,n){function r(t){return t?i(t):void 0}function i(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,i=0;ir;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],10:[function(t,e,n){function r(t){return r.enabled(t)?function(e){e=i(e);var n=new Date,o=n-(r[t]||n);r[t]=n,e=t+" "+e+" +"+r.humanize(o),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function i(t){return t instanceof Error?t.stack||t.message:t}e.exports=r,r.names=[],r.skips=[],r.enable=function(t){try{localStorage.debug=t}catch(e){}for(var n=(t||"").split(/[\s,]+/),i=n.length,o=0;i>o;o++)t=n[o].replace("*",".*?"),"-"===t[0]?r.skips.push(new RegExp("^"+t.substr(1)+"$")):r.names.push(new RegExp("^"+t+"$"))},r.disable=function(){r.enable("")},r.humanize=function(t){var e=1e3,n=6e4,r=60*n;return t>=r?(t/r).toFixed(1)+"h":t>=n?(t/n).toFixed(1)+"m":t>=e?(t/e|0)+"s":t+"ms"},r.enabled=function(t){for(var e=0,n=r.skips.length;n>e;e++)if(r.skips[e].test(t))return!1;for(var e=0,n=r.names.length;n>e;e++)if(r.names[e].test(t))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch(o){}},{}],11:[function(t,e,n){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e,n){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e,n){(function(n){function r(t,e){if(!(this instanceof r))return new r(t,e);if(e=e||{},t&&"object"==typeof t&&(e=t,t=null),t&&(t=l(t),e.host=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port,t.query&&(e.query=t.query)),this.secure=null!=e.secure?e.secure:n.location&&"https:"==location.protocol,e.host){var i=e.host.split(":");e.hostname=i.shift(),i.length?e.port=i.pop():e.port||(e.port=this.secure?"443":"80")}this.agent=e.agent||!1,this.hostname=e.hostname||(n.location?location.hostname:"localhost"),this.port=e.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=f.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=e.rejectUnauthorized||null,this.open()}function i(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var o=t("./transports"),s=t("component-emitter"),a=t("debug")("engine.io-client:socket"),u=t("indexof"),c=t("engine.io-parser"),l=t("parseuri"),h=t("parsejson"),f=t("parseqs");e.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=c.protocol,r.Socket=r,r.Transport=t("./transport"),r.transports=t("./transports"),r.parser=t("engine.io-parser"),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=i(this.query);e.EIO=c.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=new o[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return n},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))t="websocket";else{if(0==this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";var t;try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;h=h||e}h||(a('probe transport "%s" opened',t),l.send([{type:"ping",data:"probe"}]),l.once("packet",function(e){if(!h)if("pong"==e.type&&"probe"==e.data){if(a('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",l),!l)return;r.priorWebsocketSuccess="websocket"==l.name,a('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){h||"closed"!=f.readyState&&(a("changing transport and sending upgrade packet"),c(),f.setTransport(l),l.send([{type:"upgrade"}]),f.emit("upgrade",l),l=null,f.upgrading=!1,f.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=l.name,f.emit("upgradeError",n)}}))}function n(){h||(h=!0,c(),l.close(),l=null)}function i(e){var r=new Error("probe error: "+e);r.transport=l.name,n(),a('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",r)}function o(){i("transport closed")}function s(){i("socket closed")}function u(t){l&&t.name!=l.name&&(a('"%s" works - aborting "%s"',t.name,l.name),n())}function c(){l.removeListener("open",e),l.removeListener("error",i),l.removeListener("close",o),f.removeListener("close",s),f.removeListener("upgrading",u)}a('probing transport "%s"',t);var l=this.createTransport(t,{probe:1}),h=!1,f=this;r.priorWebsocketSuccess=!1,l.once("open",e),l.once("error",i),l.once("close",o),this.once("close",s),this.once("upgrading",u),l.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(a('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(h(t.data));break;case"pong":this.setPing();break;case"error":var e=new Error("server error");e.code=t.data,this.emit("error",e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},r.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.ping=function(){this.sendPacket("ping")},r.prototype.onDrain=function(){for(var t=0;tn;n++)~u(this.transports,t[n])&&e.push(t[n]);return e}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(t,e,n){function r(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized}var i=t("engine.io-parser"),o=t("component-emitter");e.exports=r,o(r.prototype),r.timestamps=0,r.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},r.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},r.prototype.send=function(t){if("open"!=this.readyState)throw new Error("Transport not open");this.write(t)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(t){var e=i.decodePacket(t,this.socket.binaryType);this.onPacket(e)},r.prototype.onPacket=function(t){this.emit("packet",t)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,n){(function(e){function r(t){var n,r=!1,a=!1,u=!1!==t.jsonp;if(e.location){var c="https:"==location.protocol,l=location.port;l||(l=c?443:80),r=t.hostname!=location.hostname||l!=t.port,a=t.secure!=c}if(t.xdomain=r,t.xscheme=a,n=new i(t),"open"in n&&!t.forceJSONP)return new o(t);if(!u)throw new Error("JSONP disabled");return new s(t)}var i=t("xmlhttprequest"),o=t("./polling-xhr"),s=t("./polling-jsonp"),a=t("./websocket");n.polling=r,n.websocket=a}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e,n){(function(n){function r(){}function i(t){o.call(this,t),this.query=this.query||{},a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var e=this;a.push(function(t){e.onData(t)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){e.script&&(e.script.onerror=r)},!1)}var o=t("./polling"),s=t("component-inherit");e.exports=i;var a,u=/\n/g,c=/\\n/g;s(i,o),i.prototype.supportsBinary=!1,i.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),o.prototype.doClose.call(this)},i.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n),this.script=e;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},i.prototype.doWrite=function(t,e){function n(){r(),e()}function r(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(t){i.onError("jsonp polling iframe removal error",t)}try{var e='