diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..3bd7a036 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +ie 9 \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..83b80ca8 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,34 @@ +version: 2.1 +orbs: + node: circleci/node@4.1.0 +jobs: + test: + executor: + name: node/default + parameters: + os: + type: string + node-version: + type: string + steps: + - checkout + - node/install-packages + - run: npm test + - run: + name: code-coverage + command: 'bash <(curl -s https://codecov.io/bash)' + +workflows: + build: + jobs: + - test: + matrix: + parameters: + os: + - docker + node-version: + - '6.17.1' + - '8.17.0' + - '10.23.1' + - '12.20.1' + - '14.15.4' diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..7966f407 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +codecov: + branch: master diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..47c7d29e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '14.15.1' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test diff --git a/.gitignore b/.gitignore index 3a2312ef..4269a0a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .DS_Store -lab/ -components -build node_modules +docs/_site +docs/.sass-cache +docs/.jekyll-metadata +coverage +docs/vendor \ No newline at end of file diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 2b7b69e3..00000000 --- a/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -src/utils/extend.js diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..dceaa19c --- /dev/null +++ b/.npmignore @@ -0,0 +1,10 @@ +docs +__test__ +.circleci +WISHLIST.md +webpack.config.js +Release.md +prettier.config.js +.prettierignore +.codecov.yml +.browserslistrc \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..7c6b4259 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14.15.1 \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..0baf8092 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.min.js \ No newline at end of file diff --git a/History.md b/CHANGELOG.md similarity index 64% rename from History.md rename to CHANGELOG.md index 30688404..db33d8b4 100644 --- a/History.md +++ b/CHANGELOG.md @@ -1,27 +1,93 @@ -# TODO - -- Add tests for custom event handlers. 27e2d6fdeee7090eb1342a108013db898fc29b96 -- Regex in search https://github.com/javve/list.js/issues/371 -- Keep original order? -- Automatically add item in the right place if sort is active -- How to handle arrays? -- Implement debouncing in search? -- Better search https://github.com/javve/list.js/pull/312/files ? -- Investigate sort button defaults: - - https://github.com/javve/list.js/issues/316 - - https://github.com/javve/list.js/pull/301 -- Improve testability by decoupling things and make it possible to use require('') in tests - - # Changelog +### 2.3.1 - 2021-01-17 + +- - **[Improvement]** #708 Support restored for Node 6, 8, 10 and 12. + +### 2.3.0 - 2020-11-25 + +- **[Feature]** #682 Multiple word search +- **[Feature]** #683 Debounced keyup handler in search +- **[Improvement]** #679 Faster search +- **[Website]** #684 Add more documentation for automagical search and sort elements + +### 2.1.0 - 2020-11-21 + +- **[Feature]** #634 Add item template function +- **[Feature]** #591 Support adding custom pagination item +- **[Bugfix]** #667 Fix `getAttribute` fallback method +- **[Bugfix]** #636 Aviod strange ie11 bug +- **[Bugfix]** #570 Don't empty original value array when adding items async +- **[Misc]** #637 Reuse iteration indices + +### 2.0.0 - 2020-11-21 - Winter cleanup 🧹 + +- **[Breaking]** Drop support for IE6-8 +- **[Misc]** Update dev dependencies to latest version: Webpack 3.12.0 -> 5.6.0, jest 23.3 -> 26.6.3, jquery 3.3.1 -> 3.5.1, Removed: jshint jshint-loader +- **[Misc]** Replace uglify-js with terser +- **[Misc]** Update Node for dev from 6.15 to 14.15.1 +- **[Misc]** Prettier on everything +- **[Misc]** Make release script simpler +- **[Misc]** Rename History.md to CHANGELOG.md +- **[Misc]** Use `babal-loader` with `@babel/preset-env` for supporting IE9-11 +- **[Misc]** Add source-maps to `/dist` +- **[Misc]** Added WISHLIST.md for feature requests to allow cleanup of issue list. +- **[Misc]** Update CircleCI from 1.0 to 2.0 +- **[Website]** Update Jekyll to remove security warnings +- **[Website]** Fix all examples (sorry that they we're broken) +- **[Website]** Use https instead of http for listjs.com +- **[Website]** Update Contribute guidelines [See commit →](https://github.com/javve/list.js/commit/6242496de2ac5c07903fb1590a5cb5129f0887a7) +- **[Bugfix]** Use one event listener per pagination and select page via data attributes + [See commit →](https://github.com/javve/list.js/commit/7610c59039f3b39f52175cd1a200e935664869e8) +- **[Bugfix]** Don't break pagination if page=0 + [See commit →](https://github.com/javve/list.js/commit/b3db0de731d436422e016b5e17f7ceab5941cd5d) + [See commit →](https://github.com/javve/list.js/commit/725bc188d7ba72c7d234bda1e09fc50b40661310) + +### 2017-01-29 v1.5.0 + +- **[Feature]** Bundle fuzzySearch and pagination plugins into List.js + [See commit →](https://github.com/javve/list.js/commit/2f5322fd139ee6f30cef3bb5e15d382ff29f9489) +- **[Misc]** Switch from Grunt to Webpack and from Mocha to Jest + [See commit →](https://github.com/javve/list.js/commit/8376ef01b1da4b6e60a7457d628d97a803a82e14) + +### 2017-01-19 v1.4.1 + +- **[Bugfix]** Move string-natural-compare to dependencies instead of devDependencies + [See commit →](https://github.com/javve/list.js/commit/c17162b26fd5093d3ddde01e11a3f748310d993c) + +### 2017-01-15 v1.4.0 + +- **[Bugfix/Feature]** Change natural-sort library to support custom alphabets + and thereby handle JavaScripts unicode bugs like sorting ÅÄÖ in Swedish wrong. + [See commit →](https://github.com/javve/list.js/commit/81e1386bed88d1f932e729feca2b3649e489bdfe) + +### 2016-10-23 v1.3.0 + +- **[Bugfix]** Make mkdir in build script OS agnostic + [See commit →](https://github.com/javve/list.js/commit/ba387125efddd7f5f4f8360bce516ae740cb5ae5) +- **[Bugfix]** Make it possible to reset search columns + [See commit →](https://github.com/javve/list.js/commit/37edc1b98bf63a684d633f29e2f52106c21eaf7d) +- **[Bugfix]** Allow empty list without template. + [See commit →](https://github.com/javve/list.js/commit/95329b945c64c0ad0693df120ef00547eac9b029) +- **[Bugfix]** Make it possible to use as string template + [See commit →](https://github.com/javve/list.js/commit/38583e097cb75e369779b46c6129e1b8b8324f24) +- **[Misc]** Update NaturalSort to 0.8.1 + [See commit →](https://github.com/javve/list.js/commit/42d3db491801677c63238d5db3e0e9257087999a) +- **[Misc]** Use local Browserify + [See commit →](https://github.com/javve/list.js/commit/83f6502dcea428fa2de2513d19ac71f82905ecb8) +- **[Misc]** Add version to start of minified file + [See commit →](https://github.com/javve/list.js/commit/79daff8da51aa047aae5d31e0af12cb30b395048) +- **[Misc]** Switch to GitHub pages for listjs.com + [See commit →](https://github.com/javve/list.js/commit/1af94012de89fd6bcf8446c31305ad517507c44b) + ### 2016-02-27: v1.2.0 + It's been two years since the last update of List.js. That is absolutely not ok and I'm very sorry that it has taken so long. I promise I'll do better in the future! Anyways, this release introduces a bunch of bug fixes and improvements, but most importantly: List.js now has support for data attributes PLUS all other attributes. -[See an example]() and [read the docs](http://www.listjs.com/docs#example-6). +[See an example]() and [read the docs](https://www.listjs.com/docs#example-6). Another noteworthy update is that I've left Component and moved back all utils to the core lib. Instead I'm using Browserify as module handler. @@ -40,7 +106,7 @@ I hope you'll like this update! [See commit →](https://github.com/javve/list.js/commit/618565b203b61c34b868a9cb86eea899e75ea4b6) - **[Breaking]** Rename list.helpers to list.utils [See commit →](https://github.com/javve/list.js/commit/58695c93849b78787d9cf78cbf9be20b01cdcc8a) -- **[Feature]** Add support for data attributes and custom attributes ex. links and images. [See docs](http://listjs.com/). +- **[Feature]** Add support for data attributes and custom attributes ex. links and images. [See docs](https://listjs.com/). [See commit →](https://github.com/javve/list.js/commit/a8e083dc0f642e90b7a3f3cc11b12f9bb353d3a0) - **[Feature]** Add toJSON method. [See commit →](https://github.com/javve/list.js/commit/570fd10e65fcf2e0d3d959ca42137625d9fd3b7c) @@ -70,14 +136,15 @@ I hope you'll like this update! get same values as first item in list [See commit →](https://github.com/javve/list.js/commit/3a4733d52cff25ef99ee8a1326c0b54be81d64ca) - ### 2014-02-03: 1.1.1 + - **[Bugfix]** Update `javve/events` version which fixes critical bugs in Safari for PC and PhantomJS (which makes the command line tests work again). - **[Bugfix]** Clear search when clicking in the HTML5 clear button. - **[Misc]** Add History.md file for changelog instead of having it at Listjs.com. ### 2014-02-03: 1.1.0 + - **[Breaking]** The sorting API is update so it looks like this `listObj.sort('name', { order: "asc "})` and `listObj.sort('name', { order: "desc "})` instead or `listObj.sort('name', { desc: true/false })`. @@ -87,16 +154,17 @@ I hope you'll like this update! - **[Bugfix]** Remove sorting when searching and filtering. - **[Bugfix]** Fix sorting and search when using pagiation plugin - ### 2014-01-17: 1.0.2 + - **[Bugfix]** Fix error that broke the lib in IE8. ### 2013-11-12: 1.0.0 + - **[Feature]** Add more events and enable to add them on initialization. - **[Feature]** Add support for Component.js, Bower, RequireJS and CommonJS - **[Feature]** Make it possible to remove event handlers by `.off('event', handler)` - **[Improvement]** Many new tests -- **[Improvement]** Paging plugin default classes and structure now correspons to Twitter Bootstraps pagination. +- **[Improvement]** Paging plugin default classes and structure now correspons to Twitter Bootstraps pagination. - **[Improvement]** Make sorting case-insensitive (thanks @thomasklemm) - **[Improvement]** Add item.\_values for direct access to a items values. Simplifies debugging. Note: Always use item.values() when interacting with the values. - **[Bugfix]** `.add(items, callbak)` with `callback` set does no longer add an extra item. @@ -113,42 +181,49 @@ I hope you'll like this update! - **[Change]** Move plugins into seperated repos: github.com/javve/list.pagination.js and github.com/javve/list.fuzzysearch.js - **[Change]** Plugin initiation have changed. See getting started with plugins - ### 2012-04-24: 0.2.1 -- Fuzzy Search plugin, `.filter()` changes and bug fixes *[Read more »](http://jonnystromberg.com/listjs-0-2-1-release-notes/)* + +- Fuzzy Search plugin, `.filter()` changes and bug fixes _[Read more »](http://jonnystromberg.com/listjs-0-2-1-release-notes/)_ ### 2012-01-23: 0.2.0 -- Lots of updates and interesting features. *[Read more »](http://jonnystromberg.com/listjs-0-2-0-plugins-paging/)* + +- Lots of updates and interesting features. _[Read more »](http://jonnystromberg.com/listjs-0-2-0-plugins-paging/)_ ### 2011-12-15: 0.1.4 + - `.filters()`, `.sort()` and `.search()` now deped on each other. If the list is filtered and then there is a search, the items hidden by the filters will stay hidden etc. - `.filter()` is the only way to reset filter. `.filter(false)` does not work anymore. ### 2011-11-29: 0.1.3 release + - Added function `.clear()` that removes all items from the list - Changed the sort function to be based on `data-sort` instead of `rel` - When sorting one category, all sort-related classes will be removed from the other sort buttons - Updated `.sort(valueName, sortFunction)` to `.sort(valueName, options)`, se more info in the documentation ### 2011-11-16: 0.1.2 release + - Sorting is now indicated by class `asc` or `desc` at sorting buttons -- Added three new small helper functions `hasClass(element, class)`, `addClass(element, class)`` - and `removeClass(element, class)` +- Added three new small helper functions `hasClass(element, class)`, ` addClass(element, class)`` and `removeClass(element, class)` ### 2011-10-20: 0.1.1 release + - Added possibility to reverse sort the list ### 2011-10-18: 0.1 release + - Examples at Listjs.com works in IE7,8,9 (IE6 is not tested, should work) - More documentation - Misc bug fixes ### 2011-10-15 Final alpha 0.3 release + - More documentation - Only show 200 items at same time, huge speed increase - Misc bug fixes ### 2011-08-08 Alpha 0.2 release + - Added asynchronous item adding - Added asynchronous list indexing - Improved (but incomplete) documentation diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 3a28545a..00000000 --- a/Gruntfile.js +++ /dev/null @@ -1,88 +0,0 @@ -module.exports = function(grunt) { - "use strict"; - - grunt.initConfig({ - pkg: require("./package.json"), - watch: { - scripts: { - files: ['src/*.js', 'src/utils/*.js', '*.js', 'test/*.html', 'test/*.js'], - tasks: ['test'], - options: { - spawn: false, - }, - }, - }, - shell: { - mkdir: { - command: 'mkdir -p dist' - }, - build: { - command: 'browserify index.js > dist/list.js', - options: { - stderr: true - } - }, - remove: { - command: 'rm -fr node_modules dist' - } - }, - jshint: { - code: { - src: ['Gruntfile.js', '*.js', 'src/*.js', 'src/utils/*.js'], - options: { - expr: true, - multistr: false, - globals: { - module: true - } - } - }, - tests: { - src: ['test/(*|!mocha).js'], - options: { - expr: true, - multistr: true, - globals: { - jQuery: true, - module: true - } - } - } - }, - uglify: { - target: { - files: { - 'dist/list.min.js': ['dist/list.js'] - } - } - }, - mocha: { - cool: { - src: [ 'test/index.html' ], - options: { - run: true, - timeout: 10000, - bail: false, - log: true, - reporter: 'Nyan', - mocha: { - ignoreLeaks: false - } - } - } - } - }); - - grunt.loadNpmTasks("grunt-contrib-watch"); - grunt.loadNpmTasks('grunt-shell'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-mocha'); - - grunt.registerTask('default', ['jshint:code', 'jshint:tests', 'shell:mkdir', 'shell:build']); - grunt.registerTask('dist', ['default', 'shell:mkdir', 'shell:build', 'uglify']); - grunt.registerTask('clean', ['shell:remove']); - grunt.registerTask('test', ['dist', 'mocha']); - - return grunt; -}; diff --git a/LICENSE b/LICENSE index 20b618d1..42c01042 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2011-2014 Jonny Strömberg, jonnystromberg.com +Copyright (c) 2011-2018 Jonny Strömberg, jonnystromberg.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4c940d21..ac96ec8e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ # List.js + Perfect library for adding **search**, **sort**, **filters** and **flexibility** to **tables**, **lists** and various HTML elements. Built to be invisible and work on existing HTML. Really simple and easy to use! [![Donate](https://s3.amazonaws.com/listjs/donate-coffee.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=M7ZGHV75VSD2E) +[![npm version](https://badge.fury.io/js/list.js.svg)](https://badge.fury.io/js/list.js) +[![CircleCI](https://circleci.com/gh/javve/list.js/tree/master.svg?style=shield)](https://circleci.com/gh/javve/list.js/tree/master) +[![codecov](https://codecov.io/gh/javve/list.js/branch/master/graph/badge.svg)](https://codecov.io/gh/javve/list.js) +[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/list.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/list.js) ### Core idea + - Simple and invisible - Easy to apply to existing HTML - No dependencies @@ -14,87 +20,75 @@ Really simple and easy to use! - Handle thousands of items ### Features + - Works both lists, tables and almost anything else. E.g. `
`,`
') + + $(document.body).append(listEl) - var list = new List('list', { - valueNames: ['name'], - item: '
  • ' - }, [ - { name: 'Jonny' } - ]); + var list = new List( + 'list', + { + valueNames: ['name'], + item: '', + }, + [{ name: 'Jonny' }] + ) - it('should contain one item', function() { - expect(list.items.length).to.equal(1); - expect(listEl.find('li').size()).to.equal(1); - }); + it('should contain one item', function () { + expect(list.items.length).toEqual(1) + expect(listEl.find('tr').length).toEqual(1) + }) - it('should contain two items', function() { - list.add({ name: 'Jonas' }); - expect(list.items.length).to.equal(2); - expect(listEl.find('li').size()).to.equal(2); - }); + it('should contain two items', function () { + list.add({ name: 'Jonas' }) + expect(list.items.length).toEqual(2) + expect(listEl.find('tr').length).toEqual(2) + }) - listEl.remove(); - }); + listEl.remove() + }) - describe('Without items and with HTML template', function() { + describe('Without items and with template function', function () { var listEl = $('
    \ \ -
    '); + ') + + $(document.body).append(listEl) - var templateEl = $('
  • '); + var list = new List( + 'list', + { + valueNames: ['name'], + item: function (values) { + return `
  • ` + }, + }, + [{ name: 'Jonny' }] + ) + + it('should contain one item', function () { + expect(list.items.length).toEqual(1) + expect(listEl.find('li').length).toEqual(1) + }) - $(document.body).append(listEl); - $(document.body).append(templateEl); + it('should contain two items', function () { + list.add({ name: 'Jonas' }) + expect(list.items.length).toEqual(2) + expect(listEl.find('li').length).toEqual(2) + }) - var list = new List('list', { - valueNames: ['name'], - item: 'template-item' - }, [ - { name: 'Jonny' } - ]); + it('should get values from items', function () { + list.add({ name: 'Egon' }) + expect(listEl.find('li[data-template-fn-egon]').length).toEqual(1) + }) - it('should contain one item', function() { - expect(list.items.length).to.equal(1); - expect(listEl.find('li').size()).to.equal(1); - }); + listEl.remove() + }) - it('should contain two items', function() { - list.add({ name: 'Jonas' }); - expect(list.items.length).to.equal(2); - expect(listEl.find('li').size()).to.equal(2); - }); + describe('without items and or template', function () { + it('should throw error on init', function () { + var listEl = $('
    \ + \ +
    ') + $(document.body).append(listEl) - listEl.remove(); - templateEl.remove(); - }); + expect(function () { + var list = new List('list', { + valueNames: ['name'], + }) + }).toThrow() + listEl.remove() + }) + }) - describe('Asyn index with existing list', function() { + describe('Without items and with HTML template', function () { var listEl = $('
    \ + \ +
    ') + + var templateEl = $('
  • ') + + $(document.body).append(listEl) + $(document.body).append(templateEl) + + var list = new List( + 'list', + { + valueNames: ['name'], + item: 'template-item', + }, + [{ name: 'Jonny' }] + ) + + it('should contain one item', function () { + expect(list.items.length).toEqual(1) + expect(listEl.find('li').length).toEqual(1) + }) + + it('should contain two items', function () { + list.add({ name: 'Jonas' }) + expect(list.items.length).toEqual(2) + expect(listEl.find('li').length).toEqual(2) + }) + + listEl.remove() + templateEl.remove() + }) + + describe('Asyn index with existing list', function () { + var listEl = $( + '
    \ \ -
    '); + ' + ) - it('should contain one item', function(done) { - $(document.body).append(listEl); + it('should contain one item', function (done) { + $(document.body).append(listEl) var list = new List('list', { valueNames: ['name'], indexAsync: true, - parseComplete: function(list) { - expect(listEl.find('li').size()).to.equal(162); - listEl.remove(); - done(); - } - }); - }); - }); - -}); + parseComplete: function (list) { + expect(listEl.find('li').length).toEqual(162) + listEl.remove() + done() + }, + }) + }) + }) +}) diff --git a/__test__/defaults.test.js b/__test__/defaults.test.js new file mode 100644 index 00000000..9633f64c --- /dev/null +++ b/__test__/defaults.test.js @@ -0,0 +1,67 @@ +const $ = require('jquery'), + fixture = require('./fixtures') + +describe('Defaults', function () { + var list + + beforeAll(function () { + list = fixture.list(['name'], [{ name: 'Jonny' }]) + }) + + afterAll(function () { + fixture.removeList() + }) + + it('should have all default attributes', function () { + expect(list.items).toBeInstanceOf(Array) + expect(list.visibleItems).toBeInstanceOf(Array) + expect(list.matchingItems).toBeInstanceOf(Array) + + expect(list.handlers.updated).toBeInstanceOf(Array) + expect(list.handlers.searchStart).toBeInstanceOf(Array) + expect(list.handlers.searchComplete).toBeInstanceOf(Array) + expect(list.handlers.sortStart).toBeInstanceOf(Array) + expect(list.handlers.sortComplete).toBeInstanceOf(Array) + expect(list.handlers.filterStart).toBeInstanceOf(Array) + expect(list.handlers.filterComplete).toBeInstanceOf(Array) + + expect(list.searched).toBe(false) + expect(list.filtered).toBe(false) + expect(list.i).toEqual(1) + expect(list.page).toEqual(10000) + expect(list.listClass).toEqual('list') + expect(list.sortClass).toEqual('sort') + expect(list.searchClass).toEqual('search') + }) + + it('should have the right elements', function () { + expect(list.list).toEqual($('.list')[0]) + expect(list.listContainer).toEqual($('#list')[0]) + }) + + it('should have all default methods', function () { + expect(list.add).toBeInstanceOf(Function) + expect(list.remove).toBeInstanceOf(Function) + expect(list.get).toBeInstanceOf(Function) + expect(list.sort).toBeInstanceOf(Function) + expect(list.search).toBeInstanceOf(Function) + expect(list.clear).toBeInstanceOf(Function) + expect(list.filter).toBeInstanceOf(Function) + expect(list.size).toBeInstanceOf(Function) + expect(list.show).toBeInstanceOf(Function) + expect(list.update).toBeInstanceOf(Function) + expect(list.on).toBeInstanceOf(Function) + }) + + it('should have all helper methods', function () { + expect(list.utils.classes).toBeInstanceOf(Function) + expect(list.utils.getAttribute).toBeInstanceOf(Function) + expect(list.utils.getByClass).toBeInstanceOf(Function) + expect(list.utils.naturalSort).toBeInstanceOf(Function) + expect(list.utils.events.bind).toBeInstanceOf(Function) + expect(list.utils.events.unbind).toBeInstanceOf(Function) + expect(list.utils.extend).toBeInstanceOf(Function) + expect(list.utils.indexOf).toBeInstanceOf(Function) + expect(list.utils.toString).toBeInstanceOf(Function) + }) +}) diff --git a/__test__/filter.test.js b/__test__/filter.test.js new file mode 100644 index 00000000..37760e20 --- /dev/null +++ b/__test__/filter.test.js @@ -0,0 +1,102 @@ +const fixture = require('./fixtures') + +describe('Filter', function () { + var list, jonny, martina, angelica, sebastian, imma, hasse + + beforeAll(function () { + list = fixture.list(['name', 'born'], fixture.all) + jonny = list.get('name', 'Jonny Strömberg')[0] + martina = list.get('name', 'Martina Elm')[0] + angelica = list.get('name', 'Angelica Abraham')[0] + sebastian = list.get('name', 'Sebastian Höglund')[0] + imma = list.get('name', 'Imma Grafström')[0] + hasse = list.get('name', 'Hasse Strömberg')[0] + }) + + afterAll(function () { + fixture.removeList() + }) + + afterEach(function () { + list.filter() + list.show(1, 200) + }) + + describe('Basics', function () { + it('should return everyone born after 1988', function () { + var result = list.filter(function (item) { + return item.values().born > 1988 + }) + expect(result.length).toEqual(1) + expect(result[0]).toEqual(sebastian) + }) + it('should return everyone born 1986', function () { + var result = list.filter(function (item) { + return item.values().born == 1986 + }) + expect(result.length).toEqual(3) + for (var i = 0; i < result.length; i++) { + expect(result[i].values().born).toEqual('1986') + } + }) + }) + + describe('Show and pages', function () { + it('should return the visible items', function () { + list.show(1, 2) + var result = list.filter(function (item) { + return item.values().born > 1985 + }) + expect(result).toEqual(list.visibleItems) + }) + + it('should return be 2 visible items and 3 matching', function () { + list.show(1, 2) + var result = list.filter(function (item) { + return item.values().born > 1985 + }) + expect(result.length).toEqual(2) + expect(list.visibleItems.length).toEqual(2) + expect(list.matchingItems.length).toEqual(4) + }) + + describe('Specific items', function () { + beforeEach(function () { + list.show(1, 2) + var result = list.filter(function (item) { + return item.values().born > 1985 + }) + }) + it('should match jonny', function () { + expect(jonny.matching()).toBe(true) + expect(jonny.filtered).toBe(true) + expect(jonny.visible()).toBe(true) + }) + it('should match martina', function () { + expect(martina.matching()).toBe(true) + expect(martina.filtered).toBe(true) + expect(martina.visible()).toBe(true) + }) + it('should match but not show angelica', function () { + expect(angelica.matching()).toBe(true) + expect(angelica.filtered).toBe(true) + expect(angelica.visible()).toBe(false) + }) + it('should match but not show sebastian', function () { + expect(sebastian.matching()).toBe(true) + expect(sebastian.filtered).toBe(true) + expect(sebastian.visible()).toBe(false) + }) + it('should not match imma', function () { + expect(imma.matching()).toBe(false) + expect(imma.filtered).toBe(false) + expect(imma.visible()).toBe(false) + }) + it('should not match hasse', function () { + expect(hasse.matching()).toBe(false) + expect(hasse.filtered).toBe(false) + expect(hasse.visible()).toBe(false) + }) + }) + }) +}) diff --git a/__test__/fixtures-fuzzysearch.js b/__test__/fixtures-fuzzysearch.js new file mode 100644 index 00000000..9cb95840 --- /dev/null +++ b/__test__/fixtures-fuzzysearch.js @@ -0,0 +1,45 @@ +const $ = require('jquery') + +var fixtureFuzzysearch = { + list: function (valueNames) { + var listHtml = $(''), + item = '' + + item = '
  • ' + for (var i = 0; i < valueNames.length; i++) { + item += '' + } + item += '
  • ' + + $(document.body).append(listHtml) + + return item + }, + removeList: function () { + $('#list-fuzzy-search').remove() + }, + i1: { name: 'Guybrush Threepwood' }, + i2: { name: 'Manny Calavera' }, + i3: { name: 'Bernard Bernoulli' }, + i4: { name: 'LeChuck' }, + i5: { name: 'Elaine Marley-Threepwood' }, + i6: { name: 'Purple Tentacle' }, + i7: { name: 'Adrian Ripburger' }, + i8: { name: 'Bobbin Threadbare' }, + i9: { name: 'Murray the Demonic Skull' }, + i10: { name: 'Zak McKracken' }, +} +fixtureFuzzysearch.all = [ + fixtureFuzzysearch.i1, + fixtureFuzzysearch.i2, + fixtureFuzzysearch.i3, + fixtureFuzzysearch.i4, + fixtureFuzzysearch.i5, + fixtureFuzzysearch.i6, + fixtureFuzzysearch.i7, + fixtureFuzzysearch.i8, + fixtureFuzzysearch.i9, + fixtureFuzzysearch.i10, +] + +module.exports = fixtureFuzzysearch diff --git a/__test__/fixtures-pagination.js b/__test__/fixtures-pagination.js new file mode 100644 index 00000000..dea045ea --- /dev/null +++ b/__test__/fixtures-pagination.js @@ -0,0 +1,115 @@ +const $ = require('jquery') + +var fixturePagination = { + list: function (valueNames) { + var listHtml = $('
    '), + item = '' + + item = '
  • ' + for (var i = 0; i < valueNames.length; i++) { + item += '' + } + item += '
  • ' + + $(document.body).append(listHtml) + + return item + }, + removeList: function () { + $('#list-pagination').remove() + }, + jonny: { + name: 'Jonny Strömberg', + born: '1986', + }, + martina: { + name: 'Martina Elm', + born: '1986', + }, + angelica: { + name: 'Angelica Abraham', + born: '1986', + }, + sebastian: { + name: 'Sebastian Höglund', + born: '1989', + }, + imma: { + name: 'Imma Grafström', + born: '1953', + }, + hasse: { + name: 'Hasse Strömberg', + born: '1955', + }, + fredrik: { + name: 'Fredrik Martinsson', + born: '1987', + }, + jonas: { + name: 'Jonas Arnklint', + born: '1987', + }, + egon: { + name: 'Egon Östgren', + born: '1983', + }, + lars: { + name: 'Lars Larsson', + born: '1992', + }, + bertil: { + name: 'Bertil Cool', + born: '1943', + }, + ture: { + name: 'Ture Tur', + born: '1965', + }, + anders: { + name: 'Anders', + born: '1987', + }, + anna: { + name: 'Anna', + born: '1987', + }, + matilda: { + name: 'Matilda', + born: '1983', + }, + li: { + name: 'Li', + born: '1992', + }, + asa: { + name: 'Åsa', + born: '1943', + }, + gun: { + name: 'Gun', + born: '1965', + }, +} +fixturePagination.all = [ + fixturePagination.jonny, + fixturePagination.martina, + fixturePagination.angelica, + fixturePagination.sebastian, + fixturePagination.imma, + fixturePagination.hasse, + fixturePagination.fredrik, + fixturePagination.jonas, + fixturePagination.egon, + fixturePagination.lars, + fixturePagination.bertil, + fixturePagination.ture, + fixturePagination.anders, + fixturePagination.anna, + fixturePagination.matilda, + fixturePagination.li, + fixturePagination.asa, + fixturePagination.gun, +] + +module.exports = fixturePagination diff --git a/__test__/fixtures.js b/__test__/fixtures.js new file mode 100644 index 00000000..083dae56 --- /dev/null +++ b/__test__/fixtures.js @@ -0,0 +1,58 @@ +const $ = require('jquery'), + List = require('../src/index') + +var fixture = { + list: function (valueNames, items) { + var listHtml = $('
    '), + item = '' + + item = '
  • ' + for (var i = 0; i < valueNames.length; i++) { + item += '' + } + item += '
  • ' + + $(document.body).append(listHtml) + + items = items || [] + + return new List( + 'list', + { + valueNames: valueNames, + item: item, + }, + items + ) + }, + removeList: function () { + $('#list').remove() + }, + jonny: { + name: 'Jonny Strömberg', + born: '1986', + }, + martina: { + name: 'Martina Elm', + born: '1986', + }, + angelica: { + name: 'Angelica Abraham', + born: '1986', + }, + sebastian: { + name: 'Sebastian Höglund', + born: '1989', + }, + imma: { + name: 'Imma Grafström', + born: '1953', + }, + hasse: { + name: 'Hasse Strömberg', + born: '1955', + }, +} +fixture.all = [fixture.jonny, fixture.martina, fixture.angelica, fixture.sebastian, fixture.imma, fixture.hasse] + +module.exports = fixture diff --git a/__test__/fuzzysearch.test.js b/__test__/fuzzysearch.test.js new file mode 100644 index 00000000..eea89f5d --- /dev/null +++ b/__test__/fuzzysearch.test.js @@ -0,0 +1,78 @@ +const $ = require('jquery'), + fixtureFuzzysearch = require('./fixtures-fuzzysearch'), + List = require('../src/index') + +function fireKeyup(el) { + if (document.createEvent) { + var evObj + if (window.KeyEvent) { + evObj = document.createEvent('KeyEvents') + evObj.initKeyEvent('keyup', true, true, window, false, false, false, false, 13, 0) + } else { + evObj = document.createEvent('UIEvents') + evObj.initUIEvent('keyup', true, true, window, 1) + } + el.dispatchEvent(evObj) + } else if (document.createEventObject) { + el.fireEvent('onkeyup') + } else { + // IE 5.0, seriously? :) + } +} + +describe('Fuzzy Search', function () { + var list, itemHTML, pagination + + beforeEach(function () { + itemHTML = fixtureFuzzysearch.list(['name', 'born']) + list = new List( + 'list-fuzzy-search', + { + valueNames: ['name', 'born'], + item: itemHTML, + }, + fixtureFuzzysearch.all + ) + }) + + afterEach(function () { + fixtureFuzzysearch.removeList() + }) + + it('should have default attribute', function () { + expect(list.fuzzySearch).toBeInstanceOf(Function) + }) + + it('should find result', function () { + list.fuzzySearch('guybrush') + expect(list.matchingItems.length).toBe(1) + }) + + it('should find result', function () { + list.fuzzySearch('g thre') + expect(list.matchingItems.length).toBe(1) + }) + + it('should find result', function () { + list.fuzzySearch('thre') + expect(list.matchingItems.length).toBe(4) + }) + + describe('Search field', function () { + it('should trigger searchStart', function (done) { + list.on('searchStart', function () { + done() + }) + $('#list-fuzzy-search .fuzzy-search').val('angelica') + fireKeyup($('#list-fuzzy-search .fuzzy-search')[0]) + }) + + it('should trigger searchComplete', function (done) { + list.on('searchComplete', function () { + done() + }) + $('#list-fuzzy-search .fuzzy-search').val('angelica') + fireKeyup($('#list-fuzzy-search .fuzzy-search')[0]) + }) + }) +}) diff --git a/__test__/item.test.js b/__test__/item.test.js new file mode 100644 index 00000000..e1e6c464 --- /dev/null +++ b/__test__/item.test.js @@ -0,0 +1,152 @@ +const $ = require('jquery'), + fixture = require('./fixtures') + +describe('Item', function () { + var list, item + + beforeAll(function () { + list = fixture.list( + ['name', 'born', 'doin'], + [ + { + name: 'Jonny', + born: '1986', + doin: 'Living the dream', + }, + ] + ) + item = list.get('name', 'Jonny')[0] + }) + + beforeEach(function () { + list.search() + list.filter() + list.show(1, 200) + }) + + afterAll(function () { + fixture.removeList() + }) + + describe('Defaults', function () { + it('should have all default attributes', function () { + expect(item.found).toBe(false) + expect(item.filtered).toBe(false) + }) + + it('should have the right elements', function () { + expect(item.elm).toEqual($('#list li')[0]) + }) + + it('should have all default methods', function () { + expect(item.hide).toBeInstanceOf(Function) + expect(item.show).toBeInstanceOf(Function) + expect(item.values).toBeInstanceOf(Function) + expect(item.matching).toBeInstanceOf(Function) + expect(item.visible).toBeInstanceOf(Function) + }) + }) + + describe('Values()', function () { + it('should have the right values', function () { + expect(item.values()).toEqual({ + name: 'Jonny', + born: '1986', + doin: 'Living the dream', + }) + }) + it('should be able to change one value', function () { + expect(item.values().name).toBe('Jonny') + item.values({ name: 'Egon' }) + expect(item.values().name).toBe('Egon') + }) + it('should be able to change many value', function () { + expect(item.values()).toEqual({ + name: 'Egon', + born: '1986', + doin: 'Living the dream', + }) + item.values({ + name: 'Sven', + born: '1801', + doin: 'Is dead', + }) + expect(item.values()).toEqual({ + name: 'Sven', + born: '1801', + doin: 'Is dead', + }) + }) + }) + + describe('Hide, show, visible', function () { + it('should be hidden', function () { + expect($('#list li').length).toEqual(1) + item.hide() + expect(item.visible()).toBe(false) + expect($('#list li').length).toEqual(0) + }) + it('should be visible', function () { + item.hide() + expect($('#list li').length).toEqual(0) + item.show() + expect(item.visible()).toBe(true) + expect($('#list li').length).toEqual(1) + }) + }) + + describe('Matching, found, filtered', function () { + describe('Searching', function () { + it('should not be visible, match, found or filtered', function () { + list.search('Fredrik') + expect(item.matching()).toBe(false) + expect(item.found).toBe(false) + expect(item.filtered).toBe(false) + expect(item.visible()).toBe(false) + }) + it('should be visble, match and found but not filterd', function () { + var result = list.search('Sven') + expect(item.matching()).toBe(true) + expect(item.found).toBe(true) + expect(item.filtered).toBe(false) + expect(item.visible()).toBe(true) + }) + it('reset: should be visible and matching but not found or filtered', function () { + list.search() + expect(item.matching()).toBe(true) + expect(item.found).toBe(false) + expect(item.filtered).toBe(false) + expect(item.visible()).toBe(true) + }) + }) + describe('Filtering', function () { + it('should not be visble, match, found or filtered', function () { + list.filter(function (item) { + return item.values().name == 'Fredrik' + }) + expect(item.matching()).toBe(false) + expect(item.found).toBe(false) + expect(item.filtered).toBe(false) + expect(item.visible()).toBe(false) + }) + it('should be visble, match and filtered but not found', function () { + list.filter(function (item) { + return item.values().name == 'Sven' + }) + expect(item.matching()).toBe(true) + expect(item.found).toBe(false) + expect(item.filtered).toBe(true) + expect(item.visible()).toBe(true) + }) + it('reset: should be visble and match but not filtered or found', function () { + list.filter() + expect(item.matching()).toBe(true) + expect(item.found).toBe(false) + expect(item.filtered).toBe(false) + expect(item.visible()).toBe(true) + }) + }) + }) + + fixture.removeList() +}) diff --git a/__test__/off.test.js b/__test__/off.test.js new file mode 100644 index 00000000..d0c2218c --- /dev/null +++ b/__test__/off.test.js @@ -0,0 +1,40 @@ +const fixture = require('./fixtures') + +describe('Off', function () { + var list + + beforeAll(function () { + list = fixture.list(['name', 'born'], fixture.all) + }) + + afterAll(function () { + fixture.removeList() + }) + + describe('General', function () { + it('should be remove added handler', function (done) { + var updated = function (list) { + expect(list.handlers.updated.length).toEqual(1) + list.off('updated', updated) + expect(list.handlers.updated.length).toEqual(0) + done() + } + list.on('updated', updated) + list.search('jonny') + }) + + it('should not remove unnamed handlers', function (done) { + var searchComplete = function (list) { + expect(list.handlers.searchComplete.length).toEqual(3) + list.off('searchComplete', function () {}) + list.off('searchComplete', searchComplete) + expect(list.handlers.searchComplete.length).toEqual(2) + done() + } + list.on('searchComplete', function () {}) + list.on('searchComplete', searchComplete) + list.on('searchComplete', function () {}) + list.search('jonny') + }) + }) +}) diff --git a/__test__/on.test.js b/__test__/on.test.js new file mode 100644 index 00000000..4f887c63 --- /dev/null +++ b/__test__/on.test.js @@ -0,0 +1,124 @@ +const fixture = require('./fixtures') + +describe('On', function () { + var list + + beforeEach(function () { + list = fixture.list(['name', 'born'], fixture.all) + }) + + afterEach(function () { + fixture.removeList() + }) + + describe('Updated', function () { + it('should be triggered after search', function (done) { + list.on('updated', function (list) { + done() + }) + list.search('jonny') + }) + it('should be triggered after sort', function (done) { + list.on('updated', function (list) { + done() + }) + list.sort('name') + }) + it('should be triggered after filter', function (done) { + list.on('updated', function (list) { + done() + }) + list.filter(function () { + return true + }) + }) + it('should be triggered after show', function (done) { + list.on('updated', function (list) { + done() + }) + list.show(1, 10) + }) + + it('should be triggered after add', function (done) { + list.on('updated', function (list) { + done() + }) + list.add({ name: 'Hej' }) + }) + it('should be triggered after remove', function (done) { + list.on('updated', function (list) { + done() + }) + list.remove('name', 'Jonny') + }) + }) + + describe('Multiple handlers', function () { + it('should be trigger both handlers', function (done) { + var done1 = false, + done2 = false, + isDone = function () { + if (done1 && done2) { + done() + } + } + + list.on('updated', function (list) { + done1 = true + isDone() + }) + list.on('updated', function (list) { + done2 = true + isDone() + }) + list.search('jonny') + }) + }) + + describe('Search', function () { + it('should be triggered before and after search', function (done) { + var done1 = false + list.on('searchStart', function (list) { + done1 = true + }) + list.on('searchComplete', function (list) { + if (done1) { + done() + } + }) + list.search('jonny') + }) + }) + + describe('Sort', function () { + it('should be triggered before and after sort', function (done) { + var done1 = false + list.on('sortStart', function (list) { + done1 = true + }) + list.on('sortComplete', function (list) { + if (done1) { + done() + } + }) + list.sort('name') + }) + }) + + describe('Filter', function () { + it('should be triggered before and after filter', function (done) { + var done1 = false + list.on('filterStart', function (list) { + done1 = true + }) + list.on('filterComplete', function (list) { + if (done1) { + done() + } + }) + list.filter(function () { + return true + }) + }) + }) +}) diff --git a/__test__/pagination.test.js b/__test__/pagination.test.js new file mode 100644 index 00000000..0e113b1e --- /dev/null +++ b/__test__/pagination.test.js @@ -0,0 +1,373 @@ +const $ = require('jquery'), + fixturePagination = require('./fixtures-pagination'), + List = require('../src/index') + +describe('Pagination', function () { + describe('Default settings, innerWindow: 2, outerWindow: 0, left: 0, right: 0', function () { + var list, itemHTML, pagination + + beforeAll(function () { + itemHTML = fixturePagination.list(['name']) + list = new List( + 'list-pagination', + { + valueNames: ['name'], + item: itemHTML, + page: 2, + pagination: true, + }, + fixturePagination.all + ) + + pagination = $('.pagination') + }) + + afterAll(function () { + fixturePagination.removeList() + }) + + it('should have default settings', function () { + expect(pagination.find('a').length).toEqual(4) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('3') + expect(pagination.find('a').get(3).innerHTML).toEqual('...') + expect(pagination.find('a').get(4)).toEqual(undefined) + }) + + it('should show same pages for show(7,2) and show(8,2)', function () { + list.show(7, 2) + expect(pagination.find('a').length).toEqual(7) + expect(pagination.find('a').get(0).innerHTML).toEqual('...') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('3') + expect(pagination.find('a').get(3).innerHTML).toEqual('4') + expect(pagination.find('a').get(4).innerHTML).toEqual('5') + expect(pagination.find('a').get(5).innerHTML).toEqual('6') + expect(pagination.find('a').get(6).innerHTML).toEqual('...') + expect(pagination.find('a').get(7)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should show same pages for show(7,2) and show(8,2)', function () { + list.show(8, 2) + expect(pagination.find('a').length).toEqual(7) + expect(pagination.find('a').get(0).innerHTML).toEqual('...') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('3') + expect(pagination.find('a').get(3).innerHTML).toEqual('4') + expect(pagination.find('a').get(4).innerHTML).toEqual('5') + expect(pagination.find('a').get(5).innerHTML).toEqual('6') + expect(pagination.find('a').get(6).innerHTML).toEqual('...') + expect(pagination.find('a').get(7)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should test show(14,2)', function () { + list.show(14, 2) + expect(pagination.find('a').length).toEqual(6) + expect(pagination.find('a').get(0).innerHTML).toEqual('...') + expect(pagination.find('a').get(1).innerHTML).toEqual('5') + expect(pagination.find('a').get(2).innerHTML).toEqual('6') + expect(pagination.find('a').get(3).innerHTML).toEqual('7') + expect(pagination.find('a').get(4).innerHTML).toEqual('8') + expect(pagination.find('a').get(5).innerHTML).toEqual('9') + expect(pagination.find('a').get(6)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should show last page with show(17,2)', function () { + list.show(17, 2) + expect(pagination.find('a').length).toEqual(4) + expect(pagination.find('a').get(0).innerHTML).toEqual('...') + expect(pagination.find('a').get(1).innerHTML).toEqual('7') + expect(pagination.find('a').get(2).innerHTML).toEqual('8') + expect(pagination.find('a').get(3).innerHTML).toEqual('9') + expect(pagination.find('a').get(4)).toEqual(undefined) + expect($(pagination.find('li').get(1)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + }) + + it('should handle page = 0', function () { + expect(list.listContainer.style.display).toBe('') + list.show(0, 0) + expect(list.listContainer.style.display).toBe('none') + list.show(1, 1) + expect(list.listContainer.style.display).toBe('block') + }) + }) + + describe('Custom settings, innerWindow: 1, outerWindow: 1, left: 0, right: 0', function () { + var list, itemHTML, pagination + + beforeAll(function () { + itemHTML = fixturePagination.list(['name']) + list = new List( + 'list-pagination', + { + valueNames: ['name'], + item: itemHTML, + page: 2, + pagination: { + innerWindow: 1, + outerWindow: 1, + }, + }, + fixturePagination.all + ) + + pagination = $('.pagination') + }) + + afterAll(function () { + fixturePagination.removeList() + }) + + it('should have default settings', function () { + expect(pagination.find('a').length).toEqual(4) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('...') + expect(pagination.find('a').get(3).innerHTML).toEqual('9') + expect(pagination.find('a').get(4)).toEqual(undefined) + }) + + it('should test show(7,2)', function () { + list.show(7, 2) + expect(pagination.find('a').length).toEqual(7) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('...') + expect(pagination.find('a').get(2).innerHTML).toEqual('3') + expect(pagination.find('a').get(3).innerHTML).toEqual('4') + expect(pagination.find('a').get(4).innerHTML).toEqual('5') + expect(pagination.find('a').get(5).innerHTML).toEqual('...') + expect(pagination.find('a').get(6).innerHTML).toEqual('9') + expect(pagination.find('a').get(7)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should test show(14,2)', function () { + list.show(14, 2) + expect(pagination.find('a').length).toEqual(6) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('...') + expect(pagination.find('a').get(2).innerHTML).toEqual('6') + expect(pagination.find('a').get(3).innerHTML).toEqual('7') + expect(pagination.find('a').get(4).innerHTML).toEqual('8') + expect(pagination.find('a').get(5).innerHTML).toEqual('9') + expect(pagination.find('a').get(6)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should show last page with show(17,2)', function () { + list.show(17, 2) + expect(pagination.find('a').length).toEqual(4) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('...') + expect(pagination.find('a').get(2).innerHTML).toEqual('8') + expect(pagination.find('a').get(3).innerHTML).toEqual('9') + expect(pagination.find('a').get(4)).toEqual(undefined) + expect($(pagination.find('li').get(1)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + }) + }) + + describe('Custom settings, innerWindow: 1, outerWindow: 1, left: 2, right: 1', function () { + var list, itemHTML, pagination + + beforeAll(function () { + itemHTML = fixturePagination.list(['name']) + list = new List( + 'list-pagination', + { + valueNames: ['name'], + item: itemHTML, + page: 2, + pagination: { + innerWindow: 1, + outerWindow: 1, + left: 2, + right: 1, + }, + }, + fixturePagination.all + ) + + pagination = $('.pagination') + }) + + afterAll(function () { + fixturePagination.removeList() + }) + + it('should have default settings', function () { + expect(pagination.find('a').length).toEqual(4) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('...') + expect(pagination.find('a').get(3).innerHTML).toEqual('9') + expect(pagination.find('a').get(4)).toEqual(undefined) + }) + + it('should test show(7,2)', function () { + list.show(7, 2) + expect(pagination.find('a').length).toEqual(7) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('3') + expect(pagination.find('a').get(3).innerHTML).toEqual('4') + expect(pagination.find('a').get(4).innerHTML).toEqual('5') + expect(pagination.find('a').get(5).innerHTML).toEqual('...') + expect(pagination.find('a').get(6).innerHTML).toEqual('9') + expect(pagination.find('a').get(7)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(false) + }) + + it('should test show(12,2)', function () { + list.show(12, 2) + expect(pagination.find('a').length).toEqual(8) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('...') + expect(pagination.find('a').get(3).innerHTML).toEqual('5') + expect(pagination.find('a').get(4).innerHTML).toEqual('6') + expect(pagination.find('a').get(5).innerHTML).toEqual('7') + expect(pagination.find('a').get(6).innerHTML).toEqual('...') + expect(pagination.find('a').get(7).innerHTML).toEqual('9') + expect(pagination.find('a').get(8)).toEqual(undefined) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(true) + expect($(pagination.find('li').get(5)).hasClass('active')).toEqual(false) + }) + it('should show last page with show(17,2)', function () { + list.show(17, 2) + expect(pagination.find('a').length).toEqual(5) + expect(pagination.find('a').get(0).innerHTML).toEqual('1') + expect(pagination.find('a').get(1).innerHTML).toEqual('2') + expect(pagination.find('a').get(2).innerHTML).toEqual('...') + expect(pagination.find('a').get(3).innerHTML).toEqual('8') + expect(pagination.find('a').get(4).innerHTML).toEqual('9') + expect(pagination.find('a').get(5)).toEqual(undefined) + expect($(pagination.find('li').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(3)).hasClass('active')).toEqual(false) + expect($(pagination.find('li').get(4)).hasClass('active')).toEqual(true) + }) + }) + + describe('Custom settings, pagination: { item: "" }', function () { + var list, itemHTML, pagination + + beforeAll(function () { + itemHTML = fixturePagination.list(['name']) + list = new List( + 'list-pagination', + { + valueNames: ['name'], + item: itemHTML, + page: 2, + pagination: { + item: '', + }, + }, + fixturePagination.all + ) + + pagination = $('.pagination') + }) + + afterAll(function () { + fixturePagination.removeList() + }) + + it('should have default settings', function () { + expect(pagination.find('span').length).toEqual(4) + expect(pagination.find('span').get(0).innerHTML).toEqual('1') + expect(pagination.find('span').get(1).innerHTML).toEqual('2') + expect(pagination.find('span').get(2).innerHTML).toEqual('3') + expect(pagination.find('span').get(3).innerHTML).toEqual('...') + expect(pagination.find('span').get(4)).toEqual(undefined) + }) + + it('should show same pages for show(7,2) and show(8,2)', function () { + list.show(7, 2) + expect(pagination.find('span').length).toEqual(7) + expect(pagination.find('span').get(0).innerHTML).toEqual('...') + expect(pagination.find('span').get(1).innerHTML).toEqual('2') + expect(pagination.find('span').get(2).innerHTML).toEqual('3') + expect(pagination.find('span').get(3).innerHTML).toEqual('4') + expect(pagination.find('span').get(4).innerHTML).toEqual('5') + expect(pagination.find('span').get(5).innerHTML).toEqual('6') + expect(pagination.find('span').get(6).innerHTML).toEqual('...') + expect(pagination.find('span').get(7)).toEqual(undefined) + expect($(pagination.find('button').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('button').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('button').get(4)).hasClass('active')).toEqual(false) + }) + + it('should show same pages for show(7,2) and show(8,2)', function () { + list.show(8, 2) + expect(pagination.find('span').length).toEqual(7) + expect(pagination.find('span').get(0).innerHTML).toEqual('...') + expect(pagination.find('span').get(1).innerHTML).toEqual('2') + expect(pagination.find('span').get(2).innerHTML).toEqual('3') + expect(pagination.find('span').get(3).innerHTML).toEqual('4') + expect(pagination.find('span').get(4).innerHTML).toEqual('5') + expect(pagination.find('span').get(5).innerHTML).toEqual('6') + expect(pagination.find('span').get(6).innerHTML).toEqual('...') + expect(pagination.find('span').get(7)).toEqual(undefined) + expect($(pagination.find('button').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('button').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('button').get(4)).hasClass('active')).toEqual(false) + }) + + it('should test show(14,2)', function () { + list.show(14, 2) + expect(pagination.find('span').length).toEqual(6) + expect(pagination.find('span').get(0).innerHTML).toEqual('...') + expect(pagination.find('span').get(1).innerHTML).toEqual('5') + expect(pagination.find('span').get(2).innerHTML).toEqual('6') + expect(pagination.find('span').get(3).innerHTML).toEqual('7') + expect(pagination.find('span').get(4).innerHTML).toEqual('8') + expect(pagination.find('span').get(5).innerHTML).toEqual('9') + expect(pagination.find('span').get(6)).toEqual(undefined) + expect($(pagination.find('button').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('button').get(3)).hasClass('active')).toEqual(true) + expect($(pagination.find('button').get(4)).hasClass('active')).toEqual(false) + }) + + it('should show last page with show(17,2)', function () { + list.show(17, 2) + expect(pagination.find('span').length).toEqual(4) + expect(pagination.find('span').get(0).innerHTML).toEqual('...') + expect(pagination.find('span').get(1).innerHTML).toEqual('7') + expect(pagination.find('span').get(2).innerHTML).toEqual('8') + expect(pagination.find('span').get(3).innerHTML).toEqual('9') + expect(pagination.find('span').get(4)).toEqual(undefined) + expect($(pagination.find('button').get(1)).hasClass('active')).toEqual(false) + expect($(pagination.find('button').get(2)).hasClass('active')).toEqual(false) + expect($(pagination.find('button').get(3)).hasClass('active')).toEqual(true) + }) + + it('should handle page = 0', function () { + expect(list.listContainer.style.display).toBe('') + list.show(0, 0) + expect(list.listContainer.style.display).toBe('none') + list.show(1, 1) + expect(list.listContainer.style.display).toBe('block') + }) + }) +}) diff --git a/__test__/parse.test.js b/__test__/parse.test.js new file mode 100644 index 00000000..4055050f --- /dev/null +++ b/__test__/parse.test.js @@ -0,0 +1,136 @@ +const $ = require('jquery'), + List = require('../src/index') + +describe('Parse', function () { + describe('Parse class', function () { + var list + beforeEach(function () { + $('body').append( + $( + '
    \ +
    \ +
    Jonny1986
    \ +
    Jocke1985
    \ +
    \ +
    ' + ) + ) + + list = new List('parse-list', { + valueNames: ['name', 'born'], + }) + }) + + afterEach(function () { + $('#parse-list').remove() + }) + + it('should have two items', function () { + expect(list.items.length).toEqual(2) + expect(list.items[0].values().name).toEqual('Jonny') + expect(list.items[1].values().name).toEqual('Jocke') + }) + it('should add item to parsed list', function () { + list.add({ name: 'Sven', born: 1950 }) + expect(list.items.length).toEqual(3) + expect(list.items[0].values().name).toEqual('Jonny') + expect(list.items[1].values().name).toEqual('Jocke') + expect(list.items[2].values().name).toEqual('Sven') + expect(list.items[0].values().born).toEqual('1986') + expect(list.items[2].values().born).toEqual(1950) + var el = $($('#parse-list').find('.list div')[2]) + expect(el.find('span').length).toEqual(2) + expect(el.find('span.name').text()).toEqual('Sven') + expect(el.find('span.born').text()).toEqual('1950') + }) + it('should parsed value always be string while added could be number', function () { + list.add({ name: 'Sven', born: 1950 }) + expect(list.items[0].values().born).toEqual('1986') + expect(list.items[0].values().born).not.toEqual(1986) + expect(list.items[2].values().born).not.toEqual('1950') + expect(list.items[2].values().born).toEqual(1950) + }) + }) + + describe('Parse data', function () { + var list + + beforeEach(function () { + $('body').append( + $( + '
    \ +
    \ +
    \ + Jonny\ + 1986\ + \ + \ +
    \ +
    \ + Jocke\ + 1985\ + \ + \ +
    \ +
    \ +
    ' + ) + ) + + list = new List('parse-list', { + valueNames: [ + 'name', + 'born', + { data: ['id'] }, + { attr: 'src', name: 'image' }, + { attr: 'href', name: 'link' }, + { attr: 'value', name: 'foo' }, + { attr: 'data-timestamp', name: 'timestamp' }, + ], + }) + }) + + afterEach(function () { + $('#parse-list').remove() + }) + + it('should get values from class, data, src, value and child els data-attribute', function () { + expect(list.items.length).toEqual(2) + var jonny = list.items[0].values() + expect(jonny.name).toEqual('Jonny') + expect(jonny.born).toEqual('1986') + expect(jonny.id).toEqual('1') + expect(jonny.image).toEqual('usage/boba.jpeg') + expect(jonny.timestamp).toEqual('54321') + expect(jonny.foo).toEqual('Bar') + }) + it('should add item to list with class, data and src', function () { + list.add({ + name: 'Sven', + born: 1950, + id: 4, + image: 'usage/rey.jpeg', + link: 'localhost', + timestamp: '1337', + foo: 'hej', + }) + expect(list.items.length).toEqual(3) + var sven = list.items[2].values() + expect(sven.name).toEqual('Sven') + expect(sven.born).toEqual(1950) + expect(sven.id).toEqual(4) + expect(sven.image).toEqual('usage/rey.jpeg') + expect(sven.link).toEqual('localhost') + expect(sven.timestamp).toEqual('1337') + expect(sven.foo).toEqual('hej') + var el = $($('#parse-list').find('.list div')[2]) + expect(el.data('id')).toEqual(4) + expect(el.find('.name').text()).toEqual('Sven') + expect(el.find('.born').text()).toEqual('1950') + expect(el.find('.image').attr('src')).toEqual('usage/rey.jpeg') + expect(el.find('.link').attr('href')).toEqual('localhost') + expect(el.find('.timestamp').data('timestamp')).toEqual(1337) + expect(el.find('.foo').val()).toEqual('hej') + }) + }) +}) diff --git a/__test__/re-index.test.js b/__test__/re-index.test.js new file mode 100644 index 00000000..6bed7c97 --- /dev/null +++ b/__test__/re-index.test.js @@ -0,0 +1,36 @@ +const $ = require('jquery'), + fixture = require('./fixtures') + +describe('ReIndex', function () { + var list, jonny, martina, angelica, sebastian, imma, hasse + + beforeAll(function () { + list = fixture.list(['name', 'born'], fixture.all) + }) + + afterAll(function () { + fixture.removeList() + }) + + afterEach(function () { + list.show(1, 200) + }) + it('should return everyone born after 1988', function () { + expect(list.toJSON()).toEqual([ + { name: 'Jonny Strömberg', born: '1986' }, + { name: 'Martina Elm', born: '1986' }, + { name: 'Angelica Abraham', born: '1986' }, + { name: 'Sebastian Höglund', born: '1989' }, + { name: 'Imma Grafström', born: '1953' }, + { name: 'Hasse Strömberg', born: '1955' }, + ]) + var newHtml = '
  • Sven2013' + newHtml = newHtml + '
  • Anna3043' + $(list.list).html(newHtml) + list.reIndex() + expect(list.toJSON()).toEqual([ + { name: 'Sven', born: '2013' }, + { name: 'Anna', born: '3043' }, + ]) + }) +}) diff --git a/__test__/search-filter.test.js b/__test__/search-filter.test.js new file mode 100644 index 00000000..73e7264f --- /dev/null +++ b/__test__/search-filter.test.js @@ -0,0 +1,67 @@ +const fixture = require('./fixtures') + +describe('Search and filter', function () { + var list, jonny, martina, angelica, sebastian, imma, hasse + + beforeAll(function () { + list = fixture.list(['name', 'born'], fixture.all) + + jonny = list.get('name', 'Jonny Strömberg')[0] + martina = list.get('name', 'Martina Elm')[0] + angelica = list.get('name', 'Angelica Abraham')[0] + sebastian = list.get('name', 'Sebastian Höglund')[0] + imma = list.get('name', 'Imma Grafström')[0] + hasse = list.get('name', 'Hasse Strömberg')[0] + }) + + afterAll(function () { + fixture.removeList() + }) + + afterEach(function () { + list.search() + list.filter() + }) + + describe('Search with filter', function () { + it('should find everyone born 1986', function () { + list.filter(function (item) { + return item.values().born == '1986' + }) + expect(list.matchingItems.length).toEqual(3) + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(true) + expect(angelica.matching()).toBe(true) + expect(sebastian.matching()).toBe(false) + expect(imma.matching()).toBe(false) + expect(hasse.matching()).toBe(false) + }) + it('should find everyone born 1986 and containes "ö"', function () { + list.filter(function (item) { + return item.values().born == '1986' + }) + list.search('ö') + expect(list.matchingItems.length).toEqual(1) + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(false) + expect(angelica.matching()).toBe(false) + expect(sebastian.matching()).toBe(false) + expect(imma.matching()).toBe(false) + expect(hasse.matching()).toBe(false) + }) + it('should find everyone with a "ö"', function () { + list.filter(function (item) { + return item.values().born == '1986' + }) + list.search('ö') + list.filter() + expect(list.matchingItems.length).toEqual(4) + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(false) + expect(angelica.matching()).toBe(false) + expect(sebastian.matching()).toBe(true) + expect(imma.matching()).toBe(true) + expect(hasse.matching()).toBe(true) + }) + }) +}) diff --git a/__test__/search.test.js b/__test__/search.test.js new file mode 100755 index 00000000..ec2abc7e --- /dev/null +++ b/__test__/search.test.js @@ -0,0 +1,217 @@ +const fixture = require('./fixtures') + +describe('Search', function () { + var list, jonny, martina, angelica, sebastian, imma, hasse + + beforeEach(function () { + list = fixture.list(['name', 'born'], fixture.all) + + jonny = list.get('name', 'Jonny Strömberg')[0] + martina = list.get('name', 'Martina Elm')[0] + angelica = list.get('name', 'Angelica Abraham')[0] + sebastian = list.get('name', 'Sebastian Höglund')[0] + imma = list.get('name', 'Imma Grafström')[0] + hasse = list.get('name', 'Hasse Strömberg')[0] + }) + + afterEach(function () { + fixture.removeList() + }) + + describe('Case-sensitive', function () { + it('should not be case-sensitive', function () { + var result = list.search('jonny') + expect(result.length).toEqual(1) + expect(result[0]).toEqual(jonny) + }) + }) + + describe('Number of results', function () { + it('should find jonny, martina, angelice', function () { + var result = list.search('1986') + expect(result.length).toEqual(3) // 3!! + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(true) + expect(angelica.matching()).toBe(true) + expect(sebastian.matching()).toBe(false) + expect(imma.matching()).toBe(false) + expect(hasse.matching()).toBe(false) + }) + it('should find all with utf-8 char ö', function () { + var result = list.search('ö') + expect(result.length).toEqual(4) // 4!! + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(false) + expect(angelica.matching()).toBe(false) + expect(sebastian.matching()).toBe(true) + expect(imma.matching()).toBe(true) + expect(hasse.matching()).toBe(true) + }) + it('should not break with weird searches', function () { + expect(function () { + list.search(undefined) + }).not.toThrow() + expect(function () { + list.search(null) + }).not.toThrow() + expect(function () { + list.search(0) + }).not.toThrow() + expect(function () { + list.search(function () {}) + }).not.toThrow() + expect(function () { + list.search({ foo: 'bar' }) + }).not.toThrow() + }) + it('should not break with weird values', function () { + jonny.values({ name: undefined }) + martina.values({ name: null }) + angelica.values({ name: 0 }) + sebastian.values({ name: function () {} }) + imma.values({ name: { foo: 'bar' } }) + + expect(function () { + list.search('jonny') + }).not.toThrow() + expect(function () { + list.search(undefined) + }).not.toThrow() + expect(function () { + list.search(null) + }).not.toThrow() + expect(function () { + list.search(0) + }).not.toThrow() + expect(function () { + list.search(function () {}) + }).not.toThrow() + expect(function () { + list.search({ foo: 'bar' }) + }).not.toThrow() + }) + }) + + describe('Default search columns', function () { + it('should find in the default match column', function () { + list.searchColumns = ['name'] + var result = list.search('jonny') + expect(result.length).toEqual(1) + expect(result[0]).toEqual(jonny) + }) + it('should not find in the default match column', function () { + list.searchColumns = ['born'] + var result = list.search('jonny') + expect(result.length).toEqual(0) + }) + }) + + describe('Specific columns', function () { + it('should find match in column', function () { + var result = list.search('jonny', ['name']) + expect(result.length).toEqual(1) + expect(result[0]).toEqual(jonny) + }) + it('should not find match in column', function () { + var result = list.search('jonny', ['born']) + expect(result.length).toEqual(0) + }) + it('should find match in column', function () { + var result = list.search('jonny', ['name']) + expect(result.length).toEqual(1) + expect(result[0]).toEqual(jonny) + }) + it('should not find match in column', function () { + var result = list.search('jonny', ['born']) + expect(result.length).toEqual(0) + }) + it('should work with columns that do not exist', function () { + var result = list.search('jonny', ['pet']) + expect(result.length).toEqual(0) + }) + it('should remove column option', function () { + var result = list.search('jonny', ['born']) + expect(result.length).toEqual(0) + result = list.search('jonny') + expect(result.length).toEqual(1) + }) + }) + + describe('Custom search function', function () { + var customSearchFunction = function (searchString, columns) { + for (var k = 0, kl = list.items.length; k < kl; k++) { + if (list.items[k].values().born > 1985) { + list.items[k].found = true + } + } + } + it('should use custom function in third argument', function () { + var result = list.search('jonny', ['name'], customSearchFunction) + expect(result.length).toEqual(4) + }) + it('should use custom function in second argument', function () { + var result = list.search('jonny', customSearchFunction) + expect(result.length).toEqual(4) + }) + }) + + describe('Multiple word search', function () { + it('should find jonny, hasse', function () { + var result = list.search('berg str') + expect(result.length).toEqual(2) + expect(jonny.matching()).toBe(true) + expect(martina.matching()).toBe(false) + expect(angelica.matching()).toBe(false) + expect(sebastian.matching()).toBe(false) + expect(imma.matching()).toBe(false) + expect(hasse.matching()).toBe(true) + }) + it('should find martina, angelica, sebastian, hasse', function () { + var result = list.search('a e') + expect(result.length).toEqual(4) + expect(jonny.matching()).toBe(false) + expect(martina.matching()).toBe(true) + expect(angelica.matching()).toBe(true) + expect(sebastian.matching()).toBe(true) + expect(imma.matching()).toBe(false) + expect(hasse.matching()).toBe(true) + }) + it('stripping whitespace should find martina', function () { + var result = list.search('martina elm ') + expect(result.length).toEqual(1) + expect(result[0]).toEqual(martina) + }) + }) + + describe('Quoted phrase searches', function () { + it('should find martina', function () { + var result = list.search('"a e"') + expect(result.length).toEqual(1) + expect(result[0]).toEqual(martina) + }) + it('quoted phrase and multiple words should find jonny', function () { + var result = list.search('" str" 1986') + expect(result.length).toEqual(1) + expect(result[0]).toEqual(jonny) + }) + }) + + // + // describe('Special characters', function() { + // it('should escape and handle special characters', function() { + // list.add([ + // { name: 'Jonny&Jabba' }, + // { name: 'Luke' }, + // { name: '"Chewie"' }, + // { name: "'Ewok'" } + // ]); + // var result = list.search('Leia'); + // console.log(result); + // expect(result.length).toEqual(1); + // var result = list.search('<'); + // console.log(result); + // expect(result.length).toEqual(1); + // }); + // }); +}) diff --git a/__test__/show.test.js b/__test__/show.test.js new file mode 100644 index 00000000..60fa41cb --- /dev/null +++ b/__test__/show.test.js @@ -0,0 +1,212 @@ +const fixture = require('./fixtures') + +describe('Show', function () { + var list, a, b, c, d, e, f + + beforeAll(function () { + list = fixture.list( + ['id', 'id2'], + [ + { id: '1', id2: 'a' }, + { id: '2', id2: 'a' }, + { id: '3', id2: 'b' }, + { id: '4', id2: 'b' }, + { id: '5', id2: 'bc' }, + { id: '6', id2: 'bc' }, + ] + ) + a = list.get('id', '1')[0] + b = list.get('id', '2')[0] + c = list.get('id', '3')[0] + d = list.get('id', '4')[0] + e = list.get('id', '5')[0] + f = list.get('id', '6')[0] + }) + + afterAll(function () { + fixture.removeList() + }) + + afterEach(function () { + list.filter() + list.show(1, 200) + }) + + describe('Basics', function () { + it('should be 1, 2', function () { + list.show(1, 2) + expect(list.visibleItems.length).toEqual(2) + expect(a.visible()).toBe(true) + expect(b.visible()).toBe(true) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(false) + }) + it('should show item 6', function () { + list.show(6, 2) + expect(list.visibleItems.length).toEqual(1) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(true) + }) + it('should show item 1, 2, 3, 4, 5, 6', function () { + list.show(1, 200) + expect(list.visibleItems.length).toEqual(6) + expect(a.visible()).toBe(true) + expect(b.visible()).toBe(true) + expect(c.visible()).toBe(true) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(true) + }) + it('should show item 3, 4, 5', function () { + list.show(3, 3) + expect(list.visibleItems.length).toEqual(3) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(true) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(false) + }) + it('should show item 5, 6', function () { + list.show(5, 3) + expect(list.visibleItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(true) + }) + }) + + describe('Search', function () { + afterEach(function () { + list.search() + }) + it('should show 3, 4', function () { + list.search('b') + list.show(1, 2) + expect(list.visibleItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(true) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(false) + }) + it('should show item 3,4,5,6', function () { + list.search('b') + list.show(1, 4) + expect(list.visibleItems.length).toEqual(4) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(true) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(true) + }) + it('should not show any items but match two', function () { + list.search('a') + list.show(3, 2) + expect(list.visibleItems.length).toEqual(0) + expect(list.matchingItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(false) + }) + }) + + describe('Filter', function () { + afterEach(function () { + list.filter() + }) + it('should show 3, 4', function () { + list.filter(function (item) { + return item.values().id2 == 'b' + }) + list.show(1, 2) + expect(list.visibleItems.length).toEqual(2) + expect(list.matchingItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(true) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(false) + }) + it('should show item 3,4,5,6', function () { + list.filter(function (item) { + return item.values().id2 == 'bc' + }) + list.show(1, 4) + expect(list.visibleItems.length).toEqual(2) + expect(list.matchingItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(true) + }) + it('should not show any items but match two', function () { + list.filter(function (item) { + return item.values().id2 == 'b' + }) + list.show(3, 2) + expect(list.visibleItems.length).toEqual(0) + expect(list.matchingItems.length).toEqual(2) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(false) + expect(f.visible()).toBe(false) + }) + }) + + describe('Filter and search', function () { + afterEach(function () { + list.filter() + }) + it('should show 4, 5', function () { + list.show(1, 2) + list.filter(function (item) { + return item.values().id > '3' + }) + list.search('b') + expect(list.visibleItems.length).toEqual(2) + expect(list.matchingItems.length).toEqual(3) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(true) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(false) + }) + it('should show 5, 6', function () { + list.show(1, 2) + list.filter(function (item) { + return item.values().id > '3' + }) + list.search('b') + list.show(2, 2) + expect(list.visibleItems.length).toEqual(2) + expect(list.matchingItems.length).toEqual(3) + expect(a.visible()).toBe(false) + expect(b.visible()).toBe(false) + expect(c.visible()).toBe(false) + expect(d.visible()).toBe(false) + expect(e.visible()).toBe(true) + expect(f.visible()).toBe(true) + }) + }) +}) diff --git a/__test__/sort.test.js b/__test__/sort.test.js new file mode 100644 index 00000000..c30503f8 --- /dev/null +++ b/__test__/sort.test.js @@ -0,0 +1,376 @@ +const $ = require('jquery'), + fixture = require('./fixtures') + +describe('Sort', function () { + var list, i1, i2, i3, i4, i5, i6 + + beforeEach(function () { + list = fixture.list( + ['id'], + [ + { id: '1', val: '' }, + { id: '2', val: '' }, + { id: '3', val: '' }, + { id: '4', val: '' }, + { id: '5', val: '' }, + { id: '6', val: '' }, + ] + ) + i1 = list.get('id', '1')[0] + i2 = list.get('id', '2')[0] + i3 = list.get('id', '3')[0] + i4 = list.get('id', '4')[0] + i5 = list.get('id', '5')[0] + i6 = list.get('id', '6')[0] + }) + + afterEach(function () { + fixture.removeList() + }) + + describe('Basics', function () { + it('should sort letters asc', function () { + i1.values({ val: 'b' }) + i2.values({ val: 'a' }) + i3.values({ val: 'c' }) + i4.values({ val: 'z' }) + i5.values({ val: 's' }) + i6.values({ val: 'y' }) + list.sort('val') + expect(list.items[0].values().val).toBe('a') + expect(list.items[1].values().val).toBe('b') + expect(list.items[2].values().val).toBe('c') + expect(list.items[3].values().val).toBe('s') + expect(list.items[4].values().val).toBe('y') + expect(list.items[5].values().val).toBe('z') + }) + it('should sort letters desc', function () { + i1.values({ val: 'b' }) + i2.values({ val: 'a' }) + i3.values({ val: 'c' }) + i4.values({ val: 'z' }) + i5.values({ val: 's' }) + i6.values({ val: 'y' }) + list.sort('val', { order: 'desc' }) + expect(list.items[0].values().val).toBe('z') + expect(list.items[1].values().val).toBe('y') + expect(list.items[2].values().val).toBe('s') + expect(list.items[3].values().val).toBe('c') + expect(list.items[4].values().val).toBe('b') + expect(list.items[5].values().val).toBe('a') + }) + it('should sort åäö desc', function () { + list.alphabet = 'ABCDEFGHIJKLMNOPQRSTUVXYZÅÄÖabcdefghijklmnopqrstuvxyzåäö' + i1.values({ val: 'a' }) + i2.values({ val: 'å' }) + i3.values({ val: 'ä' }) + i4.values({ val: 'ö' }) + i5.values({ val: 'o' }) + i6.values({ val: 's' }) + list.sort('val', { order: 'desc' }) + expect(list.items[0].values().val).toBe('ö') + expect(list.items[1].values().val).toBe('ä') + expect(list.items[2].values().val).toBe('å') + expect(list.items[3].values().val).toBe('s') + expect(list.items[4].values().val).toBe('o') + expect(list.items[5].values().val).toBe('a') + }) + it('should sort åäö asc', function () { + list.alphabet = 'ABCDEFGHIJKLMNOPQRSTUVXYZÅÄÖabcdefghijklmnopqrstuvxyzåäö' + i1.values({ val: 'a' }) + i2.values({ val: 'å' }) + i3.values({ val: 'ä' }) + i4.values({ val: 'ö' }) + i5.values({ val: 'o' }) + i6.values({ val: 's' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('a') + expect(list.items[1].values().val).toBe('o') + expect(list.items[2].values().val).toBe('s') + expect(list.items[3].values().val).toBe('å') + expect(list.items[4].values().val).toBe('ä') + expect(list.items[5].values().val).toBe('ö') + }) + it('should sort åäö desc case insensitive', function () { + list.alphabet = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZzÅåÄäÖö' + i1.values({ val: 'a' }) + i2.values({ val: 'Å' }) + i3.values({ val: 'ä' }) + i4.values({ val: 'Ö' }) + i5.values({ val: 'o' }) + i6.values({ val: 'S' }) + list.sort('val', { order: 'desc' }) + expect(list.items[0].values().val).toBe('Ö') + expect(list.items[1].values().val).toBe('ä') + expect(list.items[2].values().val).toBe('Å') + expect(list.items[3].values().val).toBe('S') + expect(list.items[4].values().val).toBe('o') + expect(list.items[5].values().val).toBe('a') + }) + it('should sort åäö asc case insensitive', function () { + list.alphabet = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZzÅåÄäÖö' + i1.values({ val: 'A' }) + i2.values({ val: 'å' }) + i3.values({ val: 'Ä' }) + i4.values({ val: 'ö' }) + i5.values({ val: 'O' }) + i6.values({ val: 's' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('A') + expect(list.items[1].values().val).toBe('O') + expect(list.items[2].values().val).toBe('s') + expect(list.items[3].values().val).toBe('å') + expect(list.items[4].values().val).toBe('Ä') + expect(list.items[5].values().val).toBe('ö') + }) + it('should handle case-insensitive by default', function () { + i1.values({ val: 'e' }) + i2.values({ val: 'b' }) + i4.values({ val: 'F' }) + i3.values({ val: 'D' }) + i5.values({ val: 'A' }) + i6.values({ val: 'C' }) + list.sort('val') + expect(list.items[0].values().val).toBe('A') + expect(list.items[1].values().val).toBe('b') + expect(list.items[2].values().val).toBe('C') + expect(list.items[3].values().val).toBe('D') + expect(list.items[4].values().val).toBe('e') + expect(list.items[5].values().val).toBe('F') + }) + it('should disable insensitive', function () { + i1.values({ val: 'e' }) + i2.values({ val: 'b' }) + i4.values({ val: 'F' }) + i3.values({ val: 'D' }) + i5.values({ val: 'A' }) + i6.values({ val: 'C' }) + list.sort('val', { insensitive: false }) + expect(list.items[0].values().val).toBe('A') + expect(list.items[1].values().val).toBe('C') + expect(list.items[2].values().val).toBe('D') + expect(list.items[3].values().val).toBe('F') + expect(list.items[4].values().val).toBe('b') + expect(list.items[5].values().val).toBe('e') + }) + it('should sort dates', function () { + i1.values({ val: '2008-12-10' }) + i2.values({ val: '2008-11-10' }) + i3.values({ val: '2007-11-10' }) + i4.values({ val: '2009-12-10' }) + i5.values({ val: '2007-01-4' }) + i6.values({ val: '2006-12-10' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('2006-12-10') + expect(list.items[1].values().val).toBe('2007-01-4') + expect(list.items[2].values().val).toBe('2007-11-10') + expect(list.items[3].values().val).toBe('2008-11-10') + expect(list.items[4].values().val).toBe('2008-12-10') + expect(list.items[5].values().val).toBe('2009-12-10') + }) + it('should sort file names (a bit wrong)', function () { + i1.values({ val: 'car.mov' }) + i2.values({ val: '01alpha.sgi' }) + i3.values({ val: '001alpha.sgi' }) + i4.values({ val: 'my.string_41299.tif' }) + i5.values({ val: '0003.zip' }) + i6.values({ val: '0002.asp' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('01alpha.sgi') + expect(list.items[1].values().val).toBe('001alpha.sgi') + expect(list.items[2].values().val).toBe('0002.asp') + expect(list.items[3].values().val).toBe('0003.zip') + expect(list.items[4].values().val).toBe('car.mov') + expect(list.items[5].values().val).toBe('my.string_41299.tif') + }) + it('should show order of sorted floates (a bit wrong)', function () { + i1.values({ val: '10.0401' }) + i2.values({ val: '10.022' }) + i3.values({ val: '10.021999' }) + i4.values({ val: '11.231' }) + i5.values({ val: '0003.123' }) + i6.values({ val: '09.2123' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('0003.123') + expect(list.items[1].values().val).toBe('09.2123') + expect(list.items[2].values().val).toBe('10.022') + expect(list.items[3].values().val).toBe('10.0401') + expect(list.items[4].values().val).toBe('10.021999') + expect(list.items[5].values().val).toBe('11.231') + }) + it('should sort IP addresses', function () { + i1.values({ val: '192.168.1.1' }) + i2.values({ val: '192.168.0.100' }) + i3.values({ val: '192.168.0.1' }) + i4.values({ val: '192.168.1.3' }) + i5.values({ val: '127.0.0.1' }) + i6.values({ val: '192.168.1.2' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('127.0.0.1') + expect(list.items[1].values().val).toBe('192.168.0.1') + expect(list.items[2].values().val).toBe('192.168.0.100') + expect(list.items[3].values().val).toBe('192.168.1.1') + expect(list.items[4].values().val).toBe('192.168.1.2') + expect(list.items[5].values().val).toBe('192.168.1.3') + }) + it('should not break with weird values', function () { + i1.values({ val: undefined }) + i2.values({ val: null }) + i3.values({ val: 0 }) + i4.values({ val: function () {} }) + i5.values({ val: { foo: 'bar' } }) + + expect(function () { + list.sort('val') + }).not.toThrow() + }) + it('should handle values from issue 387', function () { + i1.values({ val: 'Test' }) + i2.values({ val: 'Test1Test2' }) + i3.values({ val: 'Bill-To Phone1 Extension' }) + i4.values({ val: 'z' }) + i5.values({ val: 's' }) + i6.values({ val: 'y' }) + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('Bill-To Phone1 Extension') + expect(list.items[1].values().val).toBe('s') + expect(list.items[2].values().val).toBe('Test') + expect(list.items[3].values().val).toBe('Test1Test2') + expect(list.items[4].values().val).toBe('y') + expect(list.items[5].values().val).toBe('z') + }) + + xit('should show how random values are sorted', function () { + list.add({ id: '7', val: '' }) + list.add({ id: '8', val: '' }) + list.add({ id: '9', val: '' }) + list.add({ id: '10', val: '' }) + list.add({ id: '11', val: '' }) + list.add({ id: '12', val: '' }) + + var i7 = list.get('id', '7')[0], + i8 = list.get('id', '8')[0], + i9 = list.get('id', '9')[0], + i10 = list.get('id', '10')[0], + i11 = list.get('id', '11')[0], + i12 = list.get('id', '12')[0] + + i1.values({ val: undefined }) + i2.values({ val: '' }) + i3.values({ val: null }) + i4.values({ val: 'a' }) + i5.values({ val: '0' }) + i6.values({ val: true }) + i7.values({ val: 0 }) + i8.values({ val: 'z' }) + i9.values({ val: '!' }) + i10.values({ val: '?' }) + i11.values({ val: 100 }) + i12.values({ val: false }) + + list.sort('val', { order: 'asc' }) + list.sort('val', { order: 'desc' }) + list.sort('val', { order: 'asc' }) + + expect(list.items[0].values().val).toBe('') + expect(list.items[1].values().val).toBe('!') + expect(list.items[2].values().val).toBe(0) + expect(list.items[3].values().val).toBe('0') + expect(list.items[4].values().val).toBe(100) + expect(list.items[5].values().val).toBe('?') + expect(list.items[6].values().val).toBe('a') + expect(list.items[7].values().val).toBe(false) + expect(list.items[8].values().val).toBe(null) + expect(list.items[9].values().val).toBe(true) + expect(list.items[10].values().val).toBe(undefined) + expect(list.items[11].values().val).toBe('z') + }) + + it('should handle not longer (since 1.4.0) space and zero the same for desc and asc', function () { + list.clear() + list.add({ val: '' }) + list.add({ val: '0' }) + list.add({ val: 0 }) + + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('') + expect(list.items[1].values().val).toBe('0') + expect(list.items[2].values().val).toBe(0) + list.sort('val', { order: 'desc' }) + expect(list.items[0].values().val).toBe('0') + expect(list.items[1].values().val).toBe(0) + expect(list.items[2].values().val).toBe('') + list.sort('val', { order: 'asc' }) + expect(list.items[0].values().val).toBe('') + expect(list.items[1].values().val).toBe('0') + expect(list.items[2].values().val).toBe(0) + }) + }) + + describe('Custom sort function', function () { + it('should use custom sort option', function () { + i1.values({ val: "" }) + i2.values({ val: "" }) + i3.values({ val: "" }) + i4.values({ val: "" }) + i5.values({ val: "" }) + i6.values({ val: "" }) + list.sort('val', { + sortFunction: function (itemA, itemB, options) { + return list.utils.naturalSort( + $(itemA.values()[options.valueName]).val(), + $(itemB.values()[options.valueName]).val() + ) + }, + }) + expect(list.items[0].values().val).toBe("") + expect(list.items[1].values().val).toBe("") + expect(list.items[2].values().val).toBe("") + expect(list.items[3].values().val).toBe("") + expect(list.items[4].values().val).toBe("") + expect(list.items[5].values().val).toBe("") + }) + it('should use default custom sort function', function () { + list.sortFunction = function (itemA, itemB, options) { + return list.utils.naturalSort( + $(itemA.values()[options.valueName]).val(), + $(itemB.values()[options.valueName]).val() + ) + } + i1.values({ val: "" }) + i2.values({ val: "" }) + i3.values({ val: "" }) + i4.values({ val: "" }) + i5.values({ val: "" }) + i6.values({ val: "" }) + list.sort('val') + expect(list.items[0].values().val).toBe("") + expect(list.items[1].values().val).toBe("") + expect(list.items[2].values().val).toBe("") + expect(list.items[3].values().val).toBe("") + expect(list.items[4].values().val).toBe("") + expect(list.items[5].values().val).toBe("") + }) + it('should use default custom sort function with order desc', function () { + list.sortFunction = function (itemA, itemB, options) { + return list.utils.naturalSort( + $(itemA.values()[options.valueName]).val(), + $(itemB.values()[options.valueName]).val() + ) + } + i1.values({ val: "" }) + i2.values({ val: "" }) + i3.values({ val: "" }) + i4.values({ val: "" }) + i5.values({ val: "" }) + i6.values({ val: "" }) + list.sort('val', { order: 'desc' }) + expect(list.items[0].values().val).toBe("") + expect(list.items[1].values().val).toBe("") + expect(list.items[2].values().val).toBe("") + expect(list.items[3].values().val).toBe("") + expect(list.items[4].values().val).toBe("") + expect(list.items[5].values().val).toBe("") + }) + }) +}) diff --git a/__test__/trigger.test.js b/__test__/trigger.test.js new file mode 100644 index 00000000..9c0077a7 --- /dev/null +++ b/__test__/trigger.test.js @@ -0,0 +1,22 @@ +const fixture = require('./fixtures') + +describe('Trigger', function () { + var list + + beforeAll(function () { + list = fixture.list(['name', 'born'], fixture.all) + }) + + afterAll(function () { + fixture.removeList() + }) + + describe('General', function () { + it('should be triggered by searchComplete', function (done) { + list.on('searchComplete', function () { + done() + }) + list.trigger('searchComplete') + }) + }) +}) diff --git a/test/usage/amd.html b/__test__/usage/amd.html similarity index 100% rename from test/usage/amd.html rename to __test__/usage/amd.html diff --git a/test/usage/boba.jpeg b/__test__/usage/boba.jpeg similarity index 100% rename from test/usage/boba.jpeg rename to __test__/usage/boba.jpeg diff --git a/test/usage/classic.html b/__test__/usage/classic.html similarity index 97% rename from test/usage/classic.html rename to __test__/usage/classic.html index aa3fb0c7..66729565 100644 --- a/test/usage/classic.html +++ b/__test__/usage/classic.html @@ -1,7 +1,7 @@ - + diff --git a/test/usage/darth.jpeg b/__test__/usage/darth.jpeg similarity index 100% rename from test/usage/darth.jpeg rename to __test__/usage/darth.jpeg diff --git a/__test__/usage/fuzzy-search-pagination.html b/__test__/usage/fuzzy-search-pagination.html new file mode 100644 index 00000000..7fa05bba --- /dev/null +++ b/__test__/usage/fuzzy-search-pagination.html @@ -0,0 +1,44 @@ + + + + + Basic example + + + +
    + +
      +
        +
      • Guybrush Threepwood

      • +
      • Manny Calavera

      • +
      • Bernard Bernoulli

      • +
      • LeChuck

      • +
      • Elaine Marley-Threepwood

      • +
      • Purple Tentacle

      • +
      • Adrian Ripburger

      • +
      • Bobbin Threadbare

      • +
      • Murray the Demonic Skull

      • +
      • Zak McKracken

      • +
      +
        +
        + + + + + diff --git a/test/usage/leia.jpeg b/__test__/usage/leia.jpeg similarity index 100% rename from test/usage/leia.jpeg rename to __test__/usage/leia.jpeg diff --git a/test/usage/luke.jpeg b/__test__/usage/luke.jpeg similarity index 100% rename from test/usage/luke.jpeg rename to __test__/usage/luke.jpeg diff --git a/__test__/usage/main.js b/__test__/usage/main.js new file mode 100644 index 00000000..5ff9002e --- /dev/null +++ b/__test__/usage/main.js @@ -0,0 +1,6 @@ +require(['../../dist/list', '../../dist/list.min'], function (List, ListMin) { + var options = { + valueNames: ['name', 'born'], + } + var userList = new List('users', options) +}) diff --git a/__test__/usage/require.js b/__test__/usage/require.js new file mode 100644 index 00000000..7360434e --- /dev/null +++ b/__test__/usage/require.js @@ -0,0 +1,2142 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, setTimeout, opera */ + +var requirejs, require, define +;(function (global) { + var req, + s, + head, + baseElement, + dataMain, + src, + interactiveScript, + currentlyAddingScript, + mainScript, + subPath, + version = '2.1.17', + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + ap = Array.prototype, + apsp = ap.splice, + isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false + + function isFunction(it) { + return ostring.call(it) === '[object Function]' + } + + function isArray(it) { + return ostring.call(it) === '[object Array]' + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop) + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop] + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if ( + deepStringMixin && + typeof value === 'object' && + value && + !isArray(value) && + !isFunction(value) && + !(value instanceof RegExp) + ) { + if (!target[prop]) { + target[prop] = {} + } + mixin(target[prop], value, force, deepStringMixin) + } else { + target[prop] = value + } + } + }) + } + return target + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments) + } + } + + function scripts() { + return document.getElementsByTagName('script') + } + + function defaultOnError(err) { + throw err + } + + //Allow getting a global that is expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value + } + var g = global + each(value.split('.'), function (part) { + g = g[part] + }) + return g + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id) + e.requireType = id + e.requireModules = requireModules + if (err) { + e.originalError = err + } + return e + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite an existing requirejs instance. + return + } + cfg = requirejs + requirejs = undefined + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require + require = undefined + } + + function newContext(contextName) { + var inCheckLoaded, + Module, + context, + handlers, + checkLoadedTimeoutId, + config = { + //Defaults. Do not set a default for map + //config to speed up normalize(), which + //will run faster if there is no default. + waitSeconds: 7, + baseUrl: './', + paths: {}, + bundles: {}, + pkgs: {}, + shim: {}, + config: {}, + }, + registry = {}, + //registry of just enabled modules, to speed + //cycle breaking code when lots of modules + //are registered, but not activated. + enabledRegistry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + bundlesMap = {}, + requireCounter = 1, + unnormalizedCounter = 1 + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part + for (i = 0; i < ary.length; i++) { + part = ary[i] + if (part === '.') { + ary.splice(i, 1) + i -= 1 + } else if (part === '..') { + // If at the start, or previous value is still .., + // keep them so that when converted to a path it may + // still work when converted to a path, even though + // as an ID it is less than ideal. In larger point + // releases, may be better to just kick out an error. + if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { + continue + } else if (i > 0) { + ary.splice(i - 1, 2) + i -= 2 + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgMain, + mapValue, + nameParts, + i, + j, + nameSegment, + lastIndex, + foundMap, + foundI, + foundStarMap, + starI, + normalizedBaseParts, + baseParts = baseName && baseName.split('/'), + map = config.map, + starMap = map && map['*'] + + //Adjust any relative paths. + if (name) { + name = name.split('/') + lastIndex = name.length - 1 + + // If wanting node ID compatibility, strip .js from end + // of IDs. Have to do this here, and not in nameToUrl + // because node allows either .js or non .js to map + // to same file. + if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { + name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '') + } + + // Starts with a '.' so need the baseName + if (name[0].charAt(0) === '.' && baseParts) { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1) + name = normalizedBaseParts.concat(name) + } + + trimDots(name) + name = name.join('/') + } + + //Apply map config if available. + if (applyMap && map && (baseParts || starMap)) { + nameParts = name.split('/') + + outerLoop: for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/') + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')) + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment) + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue + foundI = i + break outerLoop + } + } + } + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment) + starI = i + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap + foundI = starI + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap) + name = nameParts.join('/') + } + } + + // If the name points to a package's name, use + // the package main instead. + pkgMain = getOwn(config.pkgs, name) + + return pkgMain ? pkgMain : name + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if ( + scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName + ) { + scriptNode.parentNode.removeChild(scriptNode) + return true + } + }) + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id) + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift() + context.require.undef(id) + + //Custom require that does not do map translation, since + //ID is "absolute", already mapped/resolved. + context.makeRequire(null, { + skipMap: true, + })([id]) + + return true + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1 + if (index > -1) { + prefix = name.substring(0, index) + name = name.substring(index + 1, name.length) + } + return [prefix, name] + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, + pluginModule, + suffix, + nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = '' + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false + name = '_@r' + (requireCounter += 1) + } + + nameParts = splitPrefix(name) + prefix = nameParts[0] + name = nameParts[1] + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap) + pluginModule = getOwn(defined, prefix) + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap) + }) + } else { + // If nested plugin references, then do not try to + // normalize, as it will not normalize correctly. This + // places a restriction on resourceIds, and the longer + // term solution is not to normalize until plugins are + // loaded and all normalizations to allow for async + // loading of a loader plugin. But for now, fixes the + // common uses. Details in #1131 + normalizedName = name.indexOf('!') === -1 ? normalize(name, parentName, applyMap) : name + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap) + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName) + prefix = nameParts[0] + normalizedName = nameParts[1] + isNormalized = true + + url = context.nameToUrl(normalizedName) + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? '_unnormalized' + (unnormalizedCounter += 1) : '' + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? prefix + '!' + normalizedName : normalizedName) + suffix, + } + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id) + + if (!mod) { + mod = registry[id] = new context.Module(depMap) + } + + return mod + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id) + + if (hasProp(defined, id) && (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]) + } + } else { + mod = getModule(depMap) + if (mod.error && name === 'error') { + fn(mod.error) + } else { + mod.on(name, fn) + } + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false + + if (errback) { + errback(err) + } else { + each(ids, function (id) { + var mod = getOwn(registry, id) + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err + if (mod.events.error) { + notified = true + mod.emit('error', err) + } + } + }) + + if (!notified) { + req.onError(err) + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(defQueue, [defQueue.length, 0].concat(globalDefQueue)) + globalDefQueue = [] + } + } + + handlers = { + require: function (mod) { + if (mod.require) { + return mod.require + } else { + return (mod.require = context.makeRequire(mod.map)) + } + }, + exports: function (mod) { + mod.usingExports = true + if (mod.map.isDefine) { + if (mod.exports) { + return (defined[mod.map.id] = mod.exports) + } else { + return (mod.exports = defined[mod.map.id] = {}) + } + } + }, + module: function (mod) { + if (mod.module) { + return mod.module + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return getOwn(config.config, mod.map.id) || {} + }, + exports: mod.exports || (mod.exports = {}), + }) + } + }, + } + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id] + delete enabledRegistry[id] + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id + + if (mod.error) { + mod.emit('error', mod.error) + } else { + traced[id] = true + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId) + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]) + mod.check() //pass false? + } else { + breakCycle(dep, traced, processed) + } + } + }) + processed[id] = true + } + } + + function checkLoaded() { + var err, + usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && context.startTime + waitInterval < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return + } + + inCheckLoaded = true + + //Figure out the state of all the modules. + eachProp(enabledRegistry, function (mod) { + var map = mod.map, + modId = map.id + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return + } + + if (!map.isDefine) { + reqCalls.push(mod) + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true + stillLoading = true + } else { + noLoads.push(modId) + removeScript(modId) + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false) + } + } + } + }) + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads) + err.contextName = context.contextName + return onError(err) + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}) + }) + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0 + checkLoaded() + }, 50) + } + } + + inCheckLoaded = false + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {} + this.map = map + this.shim = getOwn(config.shim, map.id) + this.depExports = [] + this.depMaps = [] + this.depMatched = [] + this.pluginMaps = {} + this.depCount = 0 + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + } + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {} + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return + } + + this.factory = factory + + if (errback) { + //Register for errors on this module. + this.on('error', errback) + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err) + }) + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0) + + this.errback = errback + + //Indicate this module has be initialized + this.inited = true + + this.ignore = options.ignore + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable() + } else { + this.check() + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true + this.depCount -= 1 + this.depExports[i] = depExports + } + }, + + fetch: function () { + if (this.fetched) { + return + } + this.fetched = true + + context.startTime = new Date().getTime() + + var map = this.map + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true, + })( + this.shim.deps || [], + bind(this, function () { + return map.prefix ? this.callPlugin() : this.load() + }) + ) + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load() + } + }, + + load: function () { + var url = this.map.url + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true + context.load(this.map.id, url) + } + }, + + /** + * Checks if the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return + } + + var err, + cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory + + if (!this.inited) { + this.fetch() + } else if (this.error) { + this.emit('error', this.error) + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. However, + //only do it for define()'d modules. require + //errbacks should not be called for failures in + //their callbacks (#699). However if a global + //onError is set, use that. + if ((this.events.error && this.map.isDefine) || req.onError !== defaultOnError) { + try { + exports = context.execCb(id, factory, depExports, exports) + } catch (e) { + err = e + } + } else { + exports = context.execCb(id, factory, depExports, exports) + } + + // Favor return value over exports. If node/cjs in play, + // then will not have a return value anyway. Favor + // module.exports assignment over exports object. + if (this.map.isDefine && exports === undefined) { + cjsModule = this.module + if (cjsModule) { + exports = cjsModule.exports + } else if (this.usingExports) { + //exports already set the defined value. + exports = this.exports + } + } + + if (err) { + err.requireMap = this.map + err.requireModules = this.map.isDefine ? [this.map.id] : null + err.requireType = this.map.isDefine ? 'define' : 'require' + return onError((this.error = err)) + } + } else { + //Just a literal value + exports = factory + } + + this.exports = exports + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports + + if (req.onResourceLoad) { + req.onResourceLoad(context, this.map, this.depMaps) + } + } + + //Clean up + cleanRegistry(id) + + this.defined = true + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true + this.emit('defined', this.exports) + this.defineEmitComplete = true + } + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix) + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap) + + on( + pluginMap, + 'defined', + bind(this, function (plugin) { + var load, + normalizedMap, + normalizedMod, + bundleId = getOwn(bundlesMap, this.map.id), + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true, + }) + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = + plugin.normalize(name, function (name) { + return normalize(name, parentName, true) + }) || '' + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, this.map.parentMap) + on( + normalizedMap, + 'defined', + bind(this, function (value) { + this.init( + [], + function () { + return value + }, + null, + { + enabled: true, + ignore: true, + } + ) + }) + ) + + normalizedMod = getOwn(registry, normalizedMap.id) + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap) + + if (this.events.error) { + normalizedMod.on( + 'error', + bind(this, function (err) { + this.emit('error', err) + }) + ) + } + normalizedMod.enable() + } + + return + } + + //If a paths config, then just load that file instead to + //resolve the plugin, as it is built into that paths layer. + if (bundleId) { + this.map.url = context.nameToUrl(bundleId) + this.load() + return + } + + load = bind(this, function (value) { + this.init( + [], + function () { + return value + }, + null, + { + enabled: true, + } + ) + }) + + load.error = bind(this, function (err) { + this.inited = true + this.error = err + err.requireModules = [id] + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id) + } + }) + + onError(err) + }) + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap) + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id] + } + + try { + req.exec(text) + } catch (e) { + return onError(makeError('fromtexteval', 'fromText eval for ' + id + ' failed: ' + e, e, [id])) + } + + if (hasInteractive) { + useInteractive = true + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap) + + //Support anonymous modules. + context.completeLoad(moduleName) + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load) + }) + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config) + }) + ) + + context.enable(pluginMap, this) + this.pluginMaps[pluginMap.id] = pluginMap + }, + + enable: function () { + enabledRegistry[this.map.id] = this + this.enabled = true + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true + + //Enable each dependency + each( + this.depMaps, + bind(this, function (depMap, i) { + var id, mod, handler + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, this.map.isDefine ? this.map : this.map.parentMap, false, !this.skipMap) + this.depMaps[i] = depMap + + handler = getOwn(handlers, depMap.id) + + if (handler) { + this.depExports[i] = handler(this) + return + } + + this.depCount += 1 + + on( + depMap, + 'defined', + bind(this, function (depExports) { + this.defineDep(i, depExports) + this.check() + }) + ) + + if (this.errback) { + on(depMap, 'error', bind(this, this.errback)) + } else if (this.events.error) { + // No direct errback on this module, but something + // else is listening for errors, so be sure to + // propagate the error correctly. + on( + depMap, + 'error', + bind(this, function (err) { + this.emit('error', err) + }) + ) + } + } + + id = depMap.id + mod = registry[id] + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this) + } + }) + ) + + //Enable each plugin that is used in + //a dependency + eachProp( + this.pluginMaps, + bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id) + if (mod && !mod.enabled) { + context.enable(pluginMap, this) + } + }) + ) + + this.enabling = false + + this.check() + }, + + on: function (name, cb) { + var cbs = this.events[name] + if (!cbs) { + cbs = this.events[name] = [] + } + cbs.push(cb) + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt) + }) + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name] + } + }, + } + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]) + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func) + } + } else { + node.removeEventListener(name, func, false) + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange') + removeListener(node, context.onScriptError, 'error') + + return { + node: node, + id: node && node.getAttribute('data-requiremodule'), + } + } + + function intakeDefines() { + var args + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue() + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift() + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])) + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args) + } + } + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + onError: onError, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/' + } + } + + //Save off the paths since they require special processing, + //they are additive. + var shim = config.shim, + objs = { + paths: true, + bundles: true, + config: true, + map: true, + } + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (!config[prop]) { + config[prop] = {} + } + mixin(config[prop], value, true, true) + } else { + config[prop] = value + } + }) + + //Reverse map the bundles + if (cfg.bundles) { + eachProp(cfg.bundles, function (value, prop) { + each(value, function (v) { + if (v !== prop) { + bundlesMap[v] = prop + } + }) + }) + } + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value, + } + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value) + } + shim[id] = value + }) + config.shim = shim + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location, name + + pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj + + name = pkgObj.name + location = pkgObj.location + if (location) { + config.paths[name] = pkgObj.location + } + + //Save pointer to main module ID for pkg name. + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + config.pkgs[name] = + pkgObj.name + '/' + (pkgObj.main || 'main').replace(currDirRegExp, '').replace(jsSuffixRegExp, '') + }) + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id) + } + }) + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback) + } + }, + + makeShimExports: function (value) { + function fn() { + var ret + if (value.init) { + ret = value.init.apply(global, arguments) + } + return ret || (value.exports && getGlobal(value.exports)) + } + return fn + }, + + makeRequire: function (relMap, options) { + options = options || {} + + function localRequire(deps, callback, errback) { + var id, map, requireMod + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback) + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]) + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap, localRequire) + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true) + id = map.id + + if (!hasProp(defined, id)) { + return onError( + makeError( + 'notloaded', + 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])') + ) + ) + } + return defined[id] + } + + //Grab defines waiting in the global queue. + intakeDefines() + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines() + + requireMod = getModule(makeModuleMap(null, relMap)) + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap + + requireMod.init(deps, callback, errback, { + enabled: true, + }) + + checkLoaded() + }) + + return localRequire + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var ext, + index = moduleNamePlusExt.lastIndexOf('.'), + segment = moduleNamePlusExt.split('/')[0], + isRelative = segment === '.' || segment === '..' + + //Have a file extension alias, and it is not the + //dots from a relative path. + if (index !== -1 && (!isRelative || index > 1)) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length) + moduleNamePlusExt = moduleNamePlusExt.substring(0, index) + } + + return context.nameToUrl(normalize(moduleNamePlusExt, relMap && relMap.id, true), ext, true) + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id) + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id + return hasProp(defined, id) || hasProp(registry, id) + }, + }) + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue() + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id) + + removeScript(id) + + delete defined[id] + delete urlFetched[map.url] + delete undefEvents[id] + + //Clean queued defines too. Go backwards + //in array so that the splices do not + //mess up the iteration. + eachReverse(defQueue, function (args, i) { + if (args[0] === id) { + defQueue.splice(i, 1) + } + }) + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events + } + + cleanRegistry(id) + } + } + } + + return localRequire + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. A second arg, parent, the parent module, + * is passed in for context, when this method is overridden by + * the optimizer. Not shown here to keep code compact. + */ + enable: function (depMap) { + var mod = getOwn(registry, depMap.id) + if (mod) { + getModule(depMap).enable() + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, + args, + mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports + + takeGlobalQueue() + + while (defQueue.length) { + args = defQueue.shift() + if (args[0] === null) { + args[0] = moduleName + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break + } + found = true + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true + } + + callGetModule(args) + } + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName) + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return + } else { + return onError(makeError('nodefine', 'No define call for ' + moduleName, null, [moduleName])) + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, shim.deps || [], shim.exportsFn]) + } + } + + checkLoaded() + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext, skipExt) { + var paths, + syms, + i, + parentModule, + url, + parentPath, + bundleId, + pkgMain = getOwn(config.pkgs, moduleName) + + if (pkgMain) { + moduleName = pkgMain + } + + bundleId = getOwn(bundlesMap, moduleName) + + if (bundleId) { + return context.nameToUrl(bundleId, ext, skipExt) + } + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || '') + } else { + //A module that needs to be converted to a path. + paths = config.paths + + syms = moduleName.split('/') + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/') + + parentPath = getOwn(paths, parentModule) + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0] + } + syms.splice(0, i, parentPath) + break + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/') + url += ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js') + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url + } + + return config.urlArgs ? url + ((url.indexOf('?') === -1 ? '?' : '&') + config.urlArgs) : url + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url) + }, + + /** + * Executes a module callback function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args) + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || readyRegExp.test((evt.currentTarget || evt.srcElement).readyState)) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null + + //Pull out the name of the module and the context. + var data = getScriptData(evt) + context.completeLoad(data.id) + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt) + if (!hasPathFallback(data.id)) { + return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])) + } + }, + } + + context.require = context.makeRequire() + return context + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + //Find the right context, use default + var context, + config, + contextName = defContextName + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback + callback = errback + errback = optional + } else { + deps = [] + } + } + + if (config && config.context) { + contextName = config.context + } + + context = getOwn(contexts, contextName) + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName) + } + + if (config) { + context.configure(config) + } + + return context.require(deps, callback, errback) + } + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config) + } + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = + typeof setTimeout !== 'undefined' + ? function (fn) { + setTimeout(fn, 4) + } + : function (fn) { + fn() + } + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req + } + + req.version = version + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/ + req.isBrowser = isBrowser + s = req.s = { + contexts: contexts, + newContext: newContext, + } + + //Create default context. + req({}) + + //Exports some context-sensitive methods on global require. + each(['toUrl', 'undef', 'defined', 'specified'], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName] + return ctx.require[prop].apply(ctx, arguments) + } + }) + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0] + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0] + if (baseElement) { + head = s.head = baseElement.parentNode + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = defaultOnError + + /** + * Creates the node for the load command. Only used in browser envs. + */ + req.createNode = function (config, moduleName, url) { + var node = config.xhtml + ? document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') + : document.createElement('script') + node.type = config.scriptType || 'text/javascript' + node.charset = 'utf-8' + node.async = true + return node + } + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node + if (isBrowser) { + //In the browser so use a script tag + node = req.createNode(config, moduleName, url) + + node.setAttribute('data-requirecontext', context.contextName) + node.setAttribute('data-requiremodule', moduleName) + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if ( + node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/jrburke/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/jrburke/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera + ) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true + + node.attachEvent('onreadystatechange', context.onScriptLoad) + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEventListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false) + node.addEventListener('error', context.onScriptError, false) + } + node.src = url + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node + if (baseElement) { + head.insertbeforeAll(node, baseElement) + } else { + head.appendChild(node) + } + currentlyAddingScript = null + + return node + } else if (isWebWorker) { + try { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url) + + //Account for anonymous modules + context.completeLoad(moduleName) + } catch (e) { + context.onError( + makeError('importscripts', 'importScripts failed for ' + moduleName + ' at ' + url, e, [moduleName]) + ) + } + } + } + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script) + } + }) + return interactiveScript + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser && !cfg.skipDataMain) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main') + if (dataMain) { + //Preserve dataMain in case it is a path (i.e. contains '?') + mainScript = dataMain + + //Set final baseUrl if there is not already an explicit one. + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = mainScript.split('/') + mainScript = src.pop() + subPath = src.length ? src.join('/') + '/' : './' + + cfg.baseUrl = subPath + } + + //Strip off any trailing .js since mainScript is now + //like a module name. + mainScript = mainScript.replace(jsSuffixRegExp, '') + + //If mainScript is still a path, fall back to dataMain + if (req.jsExtRegExp.test(mainScript)) { + mainScript = dataMain + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript] + + return true + } + }) + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps + deps = name + name = null + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps + deps = null + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps && isFunction(callback)) { + deps = [] + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, '') + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep) + }) + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps) + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript() + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule') + } + context = contexts[node.getAttribute('data-requirecontext')] + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + ;(context ? context.defQueue : globalDefQueue).push([name, deps, callback]) + } + + define.amd = { + jQuery: true, + } + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text) + } + + //Set up with config info. + req(cfg) +})(this) diff --git a/test/usage/rey.jpeg b/__test__/usage/rey.jpeg similarity index 100% rename from test/usage/rey.jpeg rename to __test__/usage/rey.jpeg diff --git a/test/usage/style.css b/__test__/usage/style.css similarity index 100% rename from test/usage/style.css rename to __test__/usage/style.css diff --git a/__test__/utils.classes.test.js b/__test__/utils.classes.test.js new file mode 100644 index 00000000..e2ad006f --- /dev/null +++ b/__test__/utils.classes.test.js @@ -0,0 +1,45 @@ +const classes = require('../src/utils/classes') + +describe('Classes', function () { + var el + + beforeEach(function () { + el = document.createElement('div') + document.body.appendChild(el) + }) + + afterEach(function () { + document.body.removeChild(el) + }) + + it('should add', function () { + classes(el).add('show') + expect(el.getAttribute('class')).toBe('show') + }) + it('should remove', function () { + el.setAttribute('class', 'show') + expect(el.getAttribute('class')).toBe('show') + classes(el).remove('show') + expect(el.getAttribute('class')).toBe('') + }) + it('should toggle', function () { + classes(el).toggle('show') + expect(el.getAttribute('class')).toBe('show') + classes(el).toggle('show') + expect(el.getAttribute('class')).toBe('') + }) + it('should array', function () { + el.setAttribute('class', 'foo bar') + expect(classes(el).array()).toEqual(['foo', 'bar']) + }) + it('should has', function () { + expect(classes(el).has('show')).toBe(false) + el.setAttribute('class', 'show') + expect(classes(el).has('show')).toBe(true) + }) + it('should contains', function () { + expect(classes(el).contains('show')).toBe(false) + el.setAttribute('class', 'show') + expect(classes(el).contains('show')).toBe(true) + }) +}) diff --git a/__test__/utils.get-by-class.test.js b/__test__/utils.get-by-class.test.js new file mode 100644 index 00000000..b524b544 --- /dev/null +++ b/__test__/utils.get-by-class.test.js @@ -0,0 +1,25 @@ +const getByClass = require('../src/utils/get-by-class') + +describe('GetByClass', function () { + var el + + beforeEach(function () { + el = document.createElement('div') + el.setAttribute('class', 'foo') + document.body.appendChild(el) + }) + + afterEach(function () { + document.body.removeChild(el) + }) + + it('should use getElementsByClassName', function () { + expect(getByClass(document.body, 'foo', false, { test: true, getElementsByClassName: true }).length).toBe(1) + }) + it('should use getElementsByClassName', function () { + expect(getByClass(document.body, 'foo', false, { test: true, querySelector: true }).length).toBe(1) + }) + it('should toggle', function () { + expect(getByClass(document.body, 'foo', false, { test: true, polyfill: true }).length).toBe(1) + }) +}) diff --git a/bower.json b/bower.json index 8794778d..aea09c3c 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "list.js", "main": "dist/list.js", - "homepage": "http://listjs.com", + "homepage": "https://listjs.com", "authors": [ "Jonny Strömberg " ], - "description": "The perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML", + "description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML", "keywords": [ "list", "search", @@ -19,9 +19,7 @@ "ignore": [ "**/.*", "node_modules", - "bower_components", - "components", - "test", - "tests" + "__test__", + "docs" ] } diff --git a/dist/list.js b/dist/list.js index 38ddeca4..640deceb 100644 --- a/dist/list.js +++ b/dist/list.js @@ -1,46 +1,203 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { + setTimeout(function () { + addAsync(values, callback, items); + }, 1); + } else { + list.update(); + callback(items); + } + }; + + return addAsync; +}; + +/***/ }), + +/***/ "./src/filter.js": +/*!***********************!*\ + !*** ./src/filter.js ***! + \***********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { + +module.exports = function (list) { + // Add handlers + list.handlers.filterStart = list.handlers.filterStart || []; + list.handlers.filterComplete = list.handlers.filterComplete || []; + return function (filterFunction) { + list.trigger('filterStart'); + list.i = 1; // Reset paging + + list.reset.filter(); + + if (filterFunction === undefined) { + list.filtered = false; + } else { + list.filtered = true; + var is = list.items; + + for (var i = 0, il = is.length; i < il; i++) { + var item = is[i]; + + if (filterFunction(item)) { + item.filtered = true; + } else { + item.filtered = false; + } + } + } + + list.update(); + list.trigger('filterComplete'); + return list.visibleItems; + }; +}; + +/***/ }), + +/***/ "./src/fuzzy-search.js": +/*!*****************************!*\ + !*** ./src/fuzzy-search.js ***! + \*****************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 8:0-14 */ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var classes = __webpack_require__(/*! ./utils/classes */ "./src/utils/classes.js"), + events = __webpack_require__(/*! ./utils/events */ "./src/utils/events.js"), + extend = __webpack_require__(/*! ./utils/extend */ "./src/utils/extend.js"), + toString = __webpack_require__(/*! ./utils/to-string */ "./src/utils/to-string.js"), + getByClass = __webpack_require__(/*! ./utils/get-by-class */ "./src/utils/get-by-class.js"), + fuzzy = __webpack_require__(/*! ./utils/fuzzy */ "./src/utils/fuzzy.js"); + +module.exports = function (list, options) { + options = options || {}; + options = extend({ + location: 0, + distance: 100, + threshold: 0.4, + multiSearch: true, + searchClass: 'fuzzy-search' + }, options); + var fuzzySearch = { + search: function search(searchString, columns) { + // Substract arguments from the searchString or put searchString as only argument + var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString]; + + for (var k = 0, kl = list.items.length; k < kl; k++) { + fuzzySearch.item(list.items[k], columns, searchArguments); + } + }, + item: function item(_item, columns, searchArguments) { + var found = true; + + for (var i = 0; i < searchArguments.length; i++) { + var foundArgument = false; + + for (var j = 0, jl = columns.length; j < jl; j++) { + if (fuzzySearch.values(_item.values(), columns[j], searchArguments[i])) { + foundArgument = true; + } + } + + if (!foundArgument) { + found = false; + } + } + + _item.found = found; + }, + values: function values(_values, value, searchArgument) { + if (_values.hasOwnProperty(value)) { + var text = toString(_values[value]).toLowerCase(); -var document = window.document, - getByClass = require('./src/utils/get-by-class'), - extend = require('./src/utils/extend'), - indexOf = require('./src/utils/index-of'), - events = require('./src/utils/events'), - toString = require('./src/utils/to-string'), - naturalSort = require('./src/utils/natural-sort'), - classes = require('./src/utils/classes'), - getAttribute = require('./src/utils/get-attribute'), - toArray = require('./src/utils/to-array'); + if (fuzzy(text, searchArgument, options)) { + return true; + } + } + + return false; + } + }; + events.bind(getByClass(list.listContainer, options.searchClass), 'keyup', list.utils.events.debounce(function (e) { + var target = e.target || e.srcElement; // IE have srcElement -var List = function(id, options, values) { + list.search(target.value, fuzzySearch.search); + }, list.searchDelay)); + return function (str, columns) { + list.search(str, columns, fuzzySearch.search); + }; +}; +/***/ }), + +/***/ "./src/index.js": +/*!**********************!*\ + !*** ./src/index.js ***! + \**********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 11:0-14 */ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var naturalSort = __webpack_require__(/*! string-natural-compare */ "./node_modules/string-natural-compare/natural-compare.js"), + getByClass = __webpack_require__(/*! ./utils/get-by-class */ "./src/utils/get-by-class.js"), + extend = __webpack_require__(/*! ./utils/extend */ "./src/utils/extend.js"), + indexOf = __webpack_require__(/*! ./utils/index-of */ "./src/utils/index-of.js"), + events = __webpack_require__(/*! ./utils/events */ "./src/utils/events.js"), + toString = __webpack_require__(/*! ./utils/to-string */ "./src/utils/to-string.js"), + classes = __webpack_require__(/*! ./utils/classes */ "./src/utils/classes.js"), + getAttribute = __webpack_require__(/*! ./utils/get-attribute */ "./src/utils/get-attribute.js"), + toArray = __webpack_require__(/*! ./utils/to-array */ "./src/utils/to-array.js"); + +module.exports = function (id, options, values) { var self = this, - init, - Item = require('./src/item')(self), - addAsync = require('./src/add-async')(self); + init, + Item = __webpack_require__(/*! ./item */ "./src/item.js")(self), + addAsync = __webpack_require__(/*! ./add-async */ "./src/add-async.js")(self), + initPagination = __webpack_require__(/*! ./pagination */ "./src/pagination.js")(self); init = { - start: function() { - self.listClass = "list"; - self.searchClass = "search"; - self.sortClass = "sort"; - self.page = 10000; - self.i = 1; - self.items = []; - self.visibleItems = []; - self.matchingItems = []; - self.searched = false; - self.filtered = false; - self.searchColumns = undefined; - self.handlers = { 'updated': [] }; - self.plugins = {}; - self.valueNames = []; - self.utils = { + start: function start() { + self.listClass = 'list'; + self.searchClass = 'search'; + self.sortClass = 'sort'; + self.page = 10000; + self.i = 1; + self.items = []; + self.visibleItems = []; + self.matchingItems = []; + self.searched = false; + self.filtered = false; + self.searchColumns = undefined; + self.searchDelay = 0; + self.handlers = { + updated: [] + }; + self.valueNames = []; + self.utils = { getByClass: getByClass, extend: extend, indexOf: indexOf, @@ -51,200 +208,234 @@ var List = function(id, options, values) { getAttribute: getAttribute, toArray: toArray }; - self.utils.extend(self, options); + self.listContainer = typeof id === 'string' ? document.getElementById(id) : id; - self.listContainer = (typeof(id) === 'string') ? document.getElementById(id) : id; - if (!self.listContainer) { return; } - self.list = getByClass(self.listContainer, self.listClass, true); - - self.parse = require('./src/parse')(self); - self.templater = require('./src/templater')(self); - self.search = require('./src/search')(self); - self.filter = require('./src/filter')(self); - self.sort = require('./src/sort')(self); + if (!self.listContainer) { + return; + } + self.list = getByClass(self.listContainer, self.listClass, true); + self.parse = __webpack_require__(/*! ./parse */ "./src/parse.js")(self); + self.templater = __webpack_require__(/*! ./templater */ "./src/templater.js")(self); + self.search = __webpack_require__(/*! ./search */ "./src/search.js")(self); + self.filter = __webpack_require__(/*! ./filter */ "./src/filter.js")(self); + self.sort = __webpack_require__(/*! ./sort */ "./src/sort.js")(self); + self.fuzzySearch = __webpack_require__(/*! ./fuzzy-search */ "./src/fuzzy-search.js")(self, options.fuzzySearch); this.handlers(); this.items(); + this.pagination(); self.update(); - this.plugins(); }, - handlers: function() { + handlers: function handlers() { for (var handler in self.handlers) { - if (self[handler]) { + if (self[handler] && self.handlers.hasOwnProperty(handler)) { self.on(handler, self[handler]); } } }, - items: function() { + items: function items() { self.parse(self.list); + if (values !== undefined) { self.add(values); } }, - plugins: function() { - for (var i = 0; i < self.plugins.length; i++) { - var plugin = self.plugins[i]; - self[plugin.name] = plugin; - plugin.init(self, List); + pagination: function pagination() { + if (options.pagination !== undefined) { + if (options.pagination === true) { + options.pagination = [{}]; + } + + if (options.pagination[0] === undefined) { + options.pagination = [options.pagination]; + } + + for (var i = 0, il = options.pagination.length; i < il; i++) { + initPagination(options.pagination[i]); + } } } }; - /* - * Re-parse the List, use if html have changed - */ - this.reIndex = function() { - self.items = []; - self.visibleItems = []; - self.matchingItems = []; - self.searched = false; - self.filtered = false; + * Re-parse the List, use if html have changed + */ + + this.reIndex = function () { + self.items = []; + self.visibleItems = []; + self.matchingItems = []; + self.searched = false; + self.filtered = false; self.parse(self.list); }; - this.toJSON = function() { + this.toJSON = function () { var json = []; + for (var i = 0, il = self.items.length; i < il; i++) { json.push(self.items[i].values()); } + return json; }; + /* + * Add object to list + */ - /* - * Add object to list - */ - this.add = function(values, callback) { + this.add = function (values, callback) { if (values.length === 0) { return; } + if (callback) { - addAsync(values, callback); + addAsync(values.slice(0), callback); return; } + var added = [], - notCreate = false; - if (values[0] === undefined){ + notCreate = false; + + if (values[0] === undefined) { values = [values]; } + for (var i = 0, il = values.length; i < il; i++) { var item = null; - notCreate = (self.items.length > self.page) ? true : false; + notCreate = self.items.length > self.page ? true : false; item = new Item(values[i], undefined, notCreate); self.items.push(item); added.push(item); } + self.update(); return added; }; - this.show = function(i, page) { - this.i = i; - this.page = page; - self.update(); + this.show = function (i, page) { + this.i = i; + this.page = page; + self.update(); return self; - }; - + }; /* Removes object from list. - * Loops through the list and removes objects where - * property "valuename" === value - */ - this.remove = function(valueName, value, options) { + * Loops through the list and removes objects where + * property "valuename" === value + */ + + + this.remove = function (valueName, value, options) { var found = 0; + for (var i = 0, il = self.items.length; i < il; i++) { if (self.items[i].values()[valueName] == value) { self.templater.remove(self.items[i], options); - self.items.splice(i,1); + self.items.splice(i, 1); il--; i--; found++; } } + self.update(); return found; }; - /* Gets the objects in the list which - * property "valueName" === value - */ - this.get = function(valueName, value) { + * property "valueName" === value + */ + + + this.get = function (valueName, value) { var matchedItems = []; + for (var i = 0, il = self.items.length; i < il; i++) { var item = self.items[i]; + if (item.values()[valueName] == value) { matchedItems.push(item); } } + return matchedItems; }; - /* - * Get size of the list - */ - this.size = function() { + * Get size of the list + */ + + + this.size = function () { return self.items.length; }; - /* - * Removes all items from the list - */ - this.clear = function() { + * Removes all items from the list + */ + + + this.clear = function () { self.templater.clear(); self.items = []; return self; }; - this.on = function(event, callback) { + this.on = function (event, callback) { self.handlers[event].push(callback); return self; }; - this.off = function(event, callback) { + this.off = function (event, callback) { var e = self.handlers[event]; var index = indexOf(e, callback); + if (index > -1) { e.splice(index, 1); } + return self; }; - this.trigger = function(event) { + this.trigger = function (event) { var i = self.handlers[event].length; - while(i--) { + + while (i--) { self.handlers[event][i](self); } + return self; }; this.reset = { - filter: function() { + filter: function filter() { var is = self.items, - il = is.length; + il = is.length; + while (il--) { is[il].filtered = false; } + return self; }, - search: function() { + search: function search() { var is = self.items, - il = is.length; + il = is.length; + while (il--) { is[il].found = false; } + return self; } }; - this.update = function() { + this.update = function () { var is = self.items, - il = is.length; - + il = is.length; self.visibleItems = []; self.matchingItems = []; self.templater.clear(); + for (var i = 0; i < il; i++) { - if (is[i].matching() && ((self.matchingItems.length+1) >= self.i && self.visibleItems.length < self.page)) { + if (is[i].matching() && self.matchingItems.length + 1 >= self.i && self.visibleItems.length < self.page) { is[i].show(); self.visibleItems.push(is[i]); self.matchingItems.push(is[i]); @@ -255,6 +446,7 @@ var List = function(id, options, values) { is[i].hide(); } } + self.trigger('updated'); return self; }; @@ -262,76 +454,26 @@ var List = function(id, options, values) { init.start(); }; +/***/ }), -// AMD support -if (typeof define === 'function' && define.amd) { - define(function () { return List; }); -} -module.exports = List; -window.List = List; - -})(window); - -},{"./src/add-async":2,"./src/filter":3,"./src/item":4,"./src/parse":5,"./src/search":6,"./src/sort":7,"./src/templater":8,"./src/utils/classes":9,"./src/utils/events":10,"./src/utils/extend":11,"./src/utils/get-attribute":12,"./src/utils/get-by-class":13,"./src/utils/index-of":14,"./src/utils/natural-sort":15,"./src/utils/to-array":16,"./src/utils/to-string":17}],2:[function(require,module,exports){ -module.exports = function(list) { - var addAsync = function(values, callback, items) { - var valuesToAdd = values.splice(0, 50); - items = items || []; - items = items.concat(list.add(valuesToAdd)); - if (values.length > 0) { - setTimeout(function() { - addAsync(values, callback, items); - }, 1); - } else { - list.update(); - callback(items); - } - }; - return addAsync; -}; - -},{}],3:[function(require,module,exports){ -module.exports = function(list) { - - // Add handlers - list.handlers.filterStart = list.handlers.filterStart || []; - list.handlers.filterComplete = list.handlers.filterComplete || []; - - return function(filterFunction) { - list.trigger('filterStart'); - list.i = 1; // Reset paging - list.reset.filter(); - if (filterFunction === undefined) { - list.filtered = false; - } else { - list.filtered = true; - var is = list.items; - for (var i = 0, il = is.length; i < il; i++) { - var item = is[i]; - if (filterFunction(item)) { - item.filtered = true; - } else { - item.filtered = false; - } - } - } - list.update(); - list.trigger('filterComplete'); - return list.visibleItems; - }; -}; +/***/ "./src/item.js": +/*!*********************!*\ + !*** ./src/item.js ***! + \*********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { -},{}],4:[function(require,module,exports){ -module.exports = function(list) { - return function(initValues, element, notCreate) { +module.exports = function (list) { + return function (initValues, element, notCreate) { var item = this; - this._values = {}; - this.found = false; // Show if list.searched == true and this.found == true - this.filtered = false;// Show if list.filtered == true and this.filtered == true - var init = function(initValues, element, notCreate) { + this.filtered = false; // Show if list.filtered == true and this.filtered == true + + var init = function init(initValues, element, notCreate) { if (element === undefined) { if (notCreate) { item.values(initValues, notCreate); @@ -345,11 +487,12 @@ module.exports = function(list) { } }; - this.values = function(newValues, notCreate) { + this.values = function (newValues, notCreate) { if (newValues !== undefined) { - for(var name in newValues) { + for (var name in newValues) { item._values[name] = newValues[name]; } + if (notCreate !== true) { list.templater.set(item, item.values()); } @@ -358,58 +501,182 @@ module.exports = function(list) { } }; - this.show = function() { + this.show = function () { list.templater.show(item); }; - this.hide = function() { + this.hide = function () { list.templater.hide(item); }; - this.matching = function() { - return ( - (list.filtered && list.searched && item.found && item.filtered) || - (list.filtered && !list.searched && item.filtered) || - (!list.filtered && list.searched && item.found) || - (!list.filtered && !list.searched) - ); + this.matching = function () { + return list.filtered && list.searched && item.found && item.filtered || list.filtered && !list.searched && item.filtered || !list.filtered && list.searched && item.found || !list.filtered && !list.searched; }; - this.visible = function() { - return (item.elm && (item.elm.parentNode == list.list)) ? true : false; + this.visible = function () { + return item.elm && item.elm.parentNode == list.list ? true : false; }; init(initValues, element, notCreate); }; }; -},{}],5:[function(require,module,exports){ -module.exports = function(list) { +/***/ }), + +/***/ "./src/pagination.js": +/*!***************************!*\ + !*** ./src/pagination.js ***! + \***************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 5:0-14 */ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var classes = __webpack_require__(/*! ./utils/classes */ "./src/utils/classes.js"), + events = __webpack_require__(/*! ./utils/events */ "./src/utils/events.js"), + List = __webpack_require__(/*! ./index */ "./src/index.js"); + +module.exports = function (list) { + var isHidden = false; + + var refresh = function refresh(pagingList, options) { + if (list.page < 1) { + list.listContainer.style.display = 'none'; + isHidden = true; + return; + } else if (isHidden) { + list.listContainer.style.display = 'block'; + } + + var item, + l = list.matchingItems.length, + index = list.i, + page = list.page, + pages = Math.ceil(l / page), + currentPage = Math.ceil(index / page), + innerWindow = options.innerWindow || 2, + left = options.left || options.outerWindow || 0, + right = options.right || options.outerWindow || 0; + right = pages - right; + pagingList.clear(); + + for (var i = 1; i <= pages; i++) { + var className = currentPage === i ? 'active' : ''; //console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className); + + if (is.number(i, left, right, currentPage, innerWindow)) { + item = pagingList.add({ + page: i, + dotted: false + })[0]; + + if (className) { + classes(item.elm).add(className); + } + + item.elm.firstChild.setAttribute('data-i', i); + item.elm.firstChild.setAttribute('data-page', page); + } else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) { + item = pagingList.add({ + page: '...', + dotted: true + })[0]; + classes(item.elm).add('disabled'); + } + } + }; + + var is = { + number: function number(i, left, right, currentPage, innerWindow) { + return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow); + }, + left: function left(i, _left) { + return i <= _left; + }, + right: function right(i, _right) { + return i > _right; + }, + innerWindow: function innerWindow(i, currentPage, _innerWindow) { + return i >= currentPage - _innerWindow && i <= currentPage + _innerWindow; + }, + dotted: function dotted(pagingList, i, left, right, currentPage, innerWindow, currentPageItem) { + return this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) || this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem); + }, + dottedLeft: function dottedLeft(pagingList, i, left, right, currentPage, innerWindow) { + return i == left + 1 && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right); + }, + dottedRight: function dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem) { + if (pagingList.items[currentPageItem - 1].values().dotted) { + return false; + } else { + return i == right && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right); + } + } + }; + return function (options) { + var pagingList = new List(list.listContainer.id, { + listClass: options.paginationClass || 'pagination', + item: options.item || "
      • ", + valueNames: ['page', 'dotted'], + searchClass: 'pagination-search-that-is-not-supposed-to-exist', + sortClass: 'pagination-sort-that-is-not-supposed-to-exist' + }); + events.bind(pagingList.listContainer, 'click', function (e) { + var target = e.target || e.srcElement, + page = list.utils.getAttribute(target, 'data-page'), + i = list.utils.getAttribute(target, 'data-i'); + + if (i) { + list.show((i - 1) * page + 1, page); + } + }); + list.on('updated', function () { + refresh(pagingList, options); + }); + refresh(pagingList, options); + }; +}; + +/***/ }), - var Item = require('./item')(list); +/***/ "./src/parse.js": +/*!**********************!*\ + !*** ./src/parse.js ***! + \**********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - var getChildren = function(parent) { +module.exports = function (list) { + var Item = __webpack_require__(/*! ./item */ "./src/item.js")(list); + + var getChildren = function getChildren(parent) { var nodes = parent.childNodes, - items = []; + items = []; + for (var i = 0, il = nodes.length; i < il; i++) { // Only textnodes have a data attribute if (nodes[i].data === undefined) { items.push(nodes[i]); } } + return items; }; - var parse = function(itemElements, valueNames) { + var parse = function parse(itemElements, valueNames) { for (var i = 0, il = itemElements.length; i < il; i++) { list.items.push(new Item(valueNames, itemElements[i])); } }; - var parseAsync = function(itemElements, valueNames) { + + var parseAsync = function parseAsync(itemElements, valueNames) { var itemsToIndex = itemElements.splice(0, 50); // TODO: If < 100 items, what happens in IE etc? + parse(itemsToIndex, valueNames); + if (itemElements.length > 0) { - setTimeout(function() { + setTimeout(function () { parseAsync(itemElements, valueNames); }, 1); } else { @@ -419,10 +686,9 @@ module.exports = function(list) { }; list.handlers.parseComplete = list.handlers.parseComplete || []; - - return function() { + return function () { var itemsToIndex = getChildren(list.list), - valueNames = list.valueNames; + valueNames = list.valueNames; if (list.indexAsync) { parseAsync(itemsToIndex, valueNames); @@ -432,91 +698,132 @@ module.exports = function(list) { }; }; -},{"./item":4}],6:[function(require,module,exports){ -module.exports = function(list) { - var item, - text, - columns, - searchString, - customSearch; +/***/ }), +/***/ "./src/search.js": +/*!***********************!*\ + !*** ./src/search.js ***! + \***********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { + +module.exports = function (_list) { + var item, text, columns, searchString, customSearch; var prepare = { - resetList: function() { - list.i = 1; - list.templater.clear(); + resetList: function resetList() { + _list.i = 1; + + _list.templater.clear(); + customSearch = undefined; }, - setOptions: function(args) { + setOptions: function setOptions(args) { if (args.length == 2 && args[1] instanceof Array) { columns = args[1]; - } else if (args.length == 2 && typeof(args[1]) == "function") { + } else if (args.length == 2 && typeof args[1] == 'function') { + columns = undefined; customSearch = args[1]; } else if (args.length == 3) { columns = args[1]; customSearch = args[2]; + } else { + columns = undefined; } }, - setColumns: function() { - if (list.items.length === 0) return; + setColumns: function setColumns() { + if (_list.items.length === 0) return; + if (columns === undefined) { - columns = (list.searchColumns === undefined) ? prepare.toArray(list.items[0].values()) : list.searchColumns; + columns = _list.searchColumns === undefined ? prepare.toArray(_list.items[0].values()) : _list.searchColumns; } }, - setSearchString: function(s) { - s = list.utils.toString(s).toLowerCase(); - s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&"); // Escape regular expression characters + setSearchString: function setSearchString(s) { + s = _list.utils.toString(s).toLowerCase(); + s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&'); // Escape regular expression characters + searchString = s; }, - toArray: function(values) { + toArray: function toArray(values) { var tmpColumn = []; + for (var name in values) { tmpColumn.push(name); } + return tmpColumn; } }; var search = { - list: function() { - for (var k = 0, kl = list.items.length; k < kl; k++) { - search.item(list.items[k]); - } - }, - item: function(item) { - item.found = false; - for (var j = 0, jl = columns.length; j < jl; j++) { - if (search.values(item.values(), columns[j])) { - item.found = true; - return; - } - } - }, - values: function(values, column) { - if (values.hasOwnProperty(column)) { - text = list.utils.toString(values[column]).toLowerCase(); - if ((searchString !== "") && (text.search(searchString) > -1)) { - return true; + list: function list() { + // Extract quoted phrases "word1 word2" from original searchString + // searchString is converted to lowercase by List.js + var words = [], + phrase, + ss = searchString; + + while ((phrase = ss.match(/"([^"]+)"/)) !== null) { + words.push(phrase[1]); + ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length); + } // Get remaining space-separated words (if any) + + + ss = ss.trim(); + if (ss.length) words = words.concat(ss.split(/\s+/)); + + for (var k = 0, kl = _list.items.length; k < kl; k++) { + var item = _list.items[k]; + item.found = false; + if (!words.length) continue; + + for (var i = 0, il = words.length; i < il; i++) { + var word_found = false; + + for (var j = 0, jl = columns.length; j < jl; j++) { + var values = item.values(), + column = columns[j]; + + if (values.hasOwnProperty(column) && values[column] !== undefined && values[column] !== null) { + var text = typeof values[column] !== 'string' ? values[column].toString() : values[column]; + + if (text.toLowerCase().indexOf(words[i]) !== -1) { + // word found, so no need to check it against any other columns + word_found = true; + break; + } + } + } // this word not found? no need to check any other words, the item cannot match + + + if (!word_found) break; } + + item.found = word_found; } - return false; }, - reset: function() { - list.reset.search(); - list.searched = false; + // Removed search.item() and search.values() + reset: function reset() { + _list.reset.search(); + + _list.searched = false; } }; - var searchMethod = function(str) { - list.trigger('searchStart'); + var searchMethod = function searchMethod(str) { + _list.trigger('searchStart'); prepare.resetList(); prepare.setSearchString(str); prepare.setOptions(arguments); // str, cols|searchFunction, searchFunction + prepare.setColumns(); - if (searchString === "" ) { + if (searchString === '') { search.reset(); } else { - list.searched = true; + _list.searched = true; + if (customSearch) { customSearch(searchString, columns); } else { @@ -524,26 +831,32 @@ module.exports = function(list) { } } - list.update(); - list.trigger('searchComplete'); - return list.visibleItems; + _list.update(); + + _list.trigger('searchComplete'); + + return _list.visibleItems; }; - list.handlers.searchStart = list.handlers.searchStart || []; - list.handlers.searchComplete = list.handlers.searchComplete || []; + _list.handlers.searchStart = _list.handlers.searchStart || []; + _list.handlers.searchComplete = _list.handlers.searchComplete || []; + + _list.utils.events.bind(_list.utils.getByClass(_list.listContainer, _list.searchClass), 'keyup', _list.utils.events.debounce(function (e) { + var target = e.target || e.srcElement, + // IE have srcElement + alreadyCleared = target.value === '' && !_list.searched; - list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'keyup', function(e) { - var target = e.target || e.srcElement, // IE have srcElement - alreadyCleared = (target.value === "" && !list.searched); - if (!alreadyCleared) { // If oninput already have resetted the list, do nothing + if (!alreadyCleared) { + // If oninput already have resetted the list, do nothing searchMethod(target.value); } - }); + }, _list.searchDelay)); // Used to detect click on HTML5 clear button + - // Used to detect click on HTML5 clear button - list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function(e) { + _list.utils.events.bind(_list.utils.getByClass(_list.listContainer, _list.searchClass), 'input', function (e) { var target = e.target || e.srcElement; - if (target.value === "") { + + if (target.value === '') { searchMethod(''); } }); @@ -551,49 +864,59 @@ module.exports = function(list) { return searchMethod; }; -},{}],7:[function(require,module,exports){ -module.exports = function(list) { - list.sortFunction = list.sortFunction || function(itemA, itemB, options) { - options.desc = options.order == "desc" ? true : false; // Natural sort uses this format - return list.utils.naturalSort(itemA.values()[options.valueName], itemB.values()[options.valueName], options); - }; +/***/ }), +/***/ "./src/sort.js": +/*!*********************!*\ + !*** ./src/sort.js ***! + \*********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { + +module.exports = function (list) { var buttons = { els: undefined, - clear: function() { + clear: function clear() { for (var i = 0, il = buttons.els.length; i < il; i++) { list.utils.classes(buttons.els[i]).remove('asc'); list.utils.classes(buttons.els[i]).remove('desc'); } }, - getOrder: function(btn) { + getOrder: function getOrder(btn) { var predefinedOrder = list.utils.getAttribute(btn, 'data-order'); - if (predefinedOrder == "asc" || predefinedOrder == "desc") { + + if (predefinedOrder == 'asc' || predefinedOrder == 'desc') { return predefinedOrder; } else if (list.utils.classes(btn).has('desc')) { - return "asc"; + return 'asc'; } else if (list.utils.classes(btn).has('asc')) { - return "desc"; + return 'desc'; } else { - return "asc"; + return 'asc'; } }, - getInSensitive: function(btn, options) { + getInSensitive: function getInSensitive(btn, options) { var insensitive = list.utils.getAttribute(btn, 'data-insensitive'); - if (insensitive === "false") { + + if (insensitive === 'false') { options.insensitive = false; } else { options.insensitive = true; } }, - setOrder: function(options) { + setOrder: function setOrder(options) { for (var i = 0, il = buttons.els.length; i < il; i++) { var btn = buttons.els[i]; + if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) { continue; } + var predefinedOrder = list.utils.getAttribute(btn, 'data-order'); - if (predefinedOrder == "asc" || predefinedOrder == "desc") { + + if (predefinedOrder == 'asc' || predefinedOrder == 'desc') { if (predefinedOrder == options.order) { list.utils.classes(btn).add(options.order); } @@ -603,10 +926,10 @@ module.exports = function(list) { } } }; - var sort = function() { + + var sort = function sort() { list.trigger('sortStart'); var options = {}; - var target = arguments[0].currentTarget || arguments[0].srcElement || undefined; if (target) { @@ -616,192 +939,268 @@ module.exports = function(list) { } else { options = arguments[1] || options; options.valueName = arguments[0]; - options.order = options.order || "asc"; - options.insensitive = (typeof options.insensitive == "undefined") ? true : options.insensitive; + options.order = options.order || 'asc'; + options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive; } + buttons.clear(); - buttons.setOrder(options); + buttons.setOrder(options); // caseInsensitive + // alphabet - options.sortFunction = options.sortFunction || list.sortFunction; - list.items.sort(function(a, b) { - var mult = (options.order === 'desc') ? -1 : 1; - return (options.sortFunction(a, b, options) * mult); - }); + var customSortFunction = options.sortFunction || list.sortFunction || null, + multi = options.order === 'desc' ? -1 : 1, + sortFunction; + + if (customSortFunction) { + sortFunction = function sortFunction(itemA, itemB) { + return customSortFunction(itemA, itemB, options) * multi; + }; + } else { + sortFunction = function sortFunction(itemA, itemB) { + var sort = list.utils.naturalSort; + sort.alphabet = list.alphabet || options.alphabet || undefined; + + if (!sort.alphabet && options.insensitive) { + sort = list.utils.naturalSort.caseInsensitive; + } + + return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi; + }; + } + + list.items.sort(sortFunction); list.update(); list.trigger('sortComplete'); - }; + }; // Add handlers + - // Add handlers list.handlers.sortStart = list.handlers.sortStart || []; list.handlers.sortComplete = list.handlers.sortComplete || []; - buttons.els = list.utils.getByClass(list.listContainer, list.sortClass); list.utils.events.bind(buttons.els, 'click', sort); list.on('searchStart', buttons.clear); list.on('filterStart', buttons.clear); - return sort; }; -},{}],8:[function(require,module,exports){ -var Templater = function(list) { - var itemSource, - templater = this; +/***/ }), + +/***/ "./src/templater.js": +/*!**************************!*\ + !*** ./src/templater.js ***! + \**************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 216:0-14 */ +/***/ (function(module) { + +var Templater = function Templater(list) { + var createItem, + templater = this; - var init = function() { - itemSource = templater.getItemSource(list.item); - itemSource = templater.clearSourceItem(itemSource, list.valueNames); + var init = function init() { + var itemSource; + + if (typeof list.item === 'function') { + createItem = function createItem(values) { + var item = list.item(values); + return getItemSource(item); + }; + + return; + } + + if (typeof list.item === 'string') { + if (list.item.indexOf('<') === -1) { + itemSource = document.getElementById(list.item); + } else { + itemSource = getItemSource(list.item); + } + } else { + /* If item source does not exists, use the first item in list as + source for new items */ + itemSource = getFirstListItem(); + } + + if (!itemSource) { + throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template."); + } + + itemSource = createCleanTemplateItem(itemSource, list.valueNames); + + createItem = function createItem() { + return itemSource.cloneNode(true); + }; }; - this.clearSourceItem = function(el, valueNames) { - for(var i = 0, il = valueNames.length; i < il; i++) { - var elm; - if (valueNames[i].data) { - for (var j = 0, jl = valueNames[i].data.length; j < jl; j++) { - el.setAttribute('data-'+valueNames[i].data[j], ''); + var createCleanTemplateItem = function createCleanTemplateItem(templateNode, valueNames) { + var el = templateNode.cloneNode(true); + el.removeAttribute('id'); + + for (var i = 0, il = valueNames.length; i < il; i++) { + var elm = undefined, + valueName = valueNames[i]; + + if (valueName.data) { + for (var j = 0, jl = valueName.data.length; j < jl; j++) { + el.setAttribute('data-' + valueName.data[j], ''); } - } else if (valueNames[i].attr && valueNames[i].name) { - elm = list.utils.getByClass(el, valueNames[i].name, true); + } else if (valueName.attr && valueName.name) { + elm = list.utils.getByClass(el, valueName.name, true); + if (elm) { - elm.setAttribute(valueNames[i].attr, ""); + elm.setAttribute(valueName.attr, ''); } } else { - elm = list.utils.getByClass(el, valueNames[i], true); + elm = list.utils.getByClass(el, valueName, true); + if (elm) { - elm.innerHTML = ""; + elm.innerHTML = ''; } } - elm = undefined; } + return el; }; - this.getItemSource = function(item) { - if (item === undefined) { - var nodes = list.list.childNodes, - items = []; + var getFirstListItem = function getFirstListItem() { + var nodes = list.list.childNodes; - for (var i = 0, il = nodes.length; i < il; i++) { - // Only textnodes have a data attribute - if (nodes[i].data === undefined) { - return nodes[i].cloneNode(true); - } + for (var i = 0, il = nodes.length; i < il; i++) { + // Only textnodes have a data attribute + if (nodes[i].data === undefined) { + return nodes[i].cloneNode(true); } - } else if (/^tr[\s>]/.exec(item)) { - var table = document.createElement('table'); - table.innerHTML = item; - return table.firstChild; - } else if (item.indexOf("<") !== -1) { + } + + return undefined; + }; + + var getItemSource = function getItemSource(itemHTML) { + if (typeof itemHTML !== 'string') return undefined; + + if (/]/g.exec(itemHTML)) { + var tbody = document.createElement('tbody'); + tbody.innerHTML = itemHTML; + return tbody.firstElementChild; + } else if (itemHTML.indexOf('<') !== -1) { var div = document.createElement('div'); - div.innerHTML = item; - return div.firstChild; - } else { - var source = document.getElementById(list.item); - if (source) { - return source; - } + div.innerHTML = itemHTML; + return div.firstElementChild; } - throw new Error("The list need to have at list one item on init otherwise you'll have to add a template."); + + return undefined; }; - this.get = function(item, valueNames) { - templater.create(item); - var values = {}; - for(var i = 0, il = valueNames.length; i < il; i++) { - var elm; - if (valueNames[i].data) { - for (var j = 0, jl = valueNames[i].data.length; j < jl; j++) { - values[valueNames[i].data[j]] = list.utils.getAttribute(item.elm, 'data-'+valueNames[i].data[j]); + var getValueName = function getValueName(name) { + for (var i = 0, il = list.valueNames.length; i < il; i++) { + var valueName = list.valueNames[i]; + + if (valueName.data) { + var data = valueName.data; + + for (var j = 0, jl = data.length; j < jl; j++) { + if (data[j] === name) { + return { + data: name + }; + } } - } else if (valueNames[i].attr && valueNames[i].name) { - elm = list.utils.getByClass(item.elm, valueNames[i].name, true); - values[valueNames[i].name] = elm ? list.utils.getAttribute(elm, valueNames[i].attr) : ""; - } else { - elm = list.utils.getByClass(item.elm, valueNames[i], true); - values[valueNames[i]] = elm ? elm.innerHTML : ""; + } else if (valueName.attr && valueName.name && valueName.name == name) { + return valueName; + } else if (valueName === name) { + return name; } - elm = undefined; } - return values; }; - this.set = function(item, values) { - var getValueName = function(name) { - for (var i = 0, il = list.valueNames.length; i < il; i++) { - if (list.valueNames[i].data) { - var data = list.valueNames[i].data; - for (var j = 0, jl = data.length; j < jl; j++) { - if (data[j] === name) { - return { data: name }; - } - } - } else if (list.valueNames[i].attr && list.valueNames[i].name && list.valueNames[i].name == name) { - return list.valueNames[i]; - } else if (list.valueNames[i] === name) { - return name; - } + var setValue = function setValue(item, name, value) { + var elm = undefined, + valueName = getValueName(name); + if (!valueName) return; + + if (valueName.data) { + item.elm.setAttribute('data-' + valueName.data, value); + } else if (valueName.attr && valueName.name) { + elm = list.utils.getByClass(item.elm, valueName.name, true); + + if (elm) { + elm.setAttribute(valueName.attr, value); } - }; - var setValue = function(name, value) { - var elm; - var valueName = getValueName(name); - if (!valueName) - return; + } else { + elm = list.utils.getByClass(item.elm, valueName, true); + + if (elm) { + elm.innerHTML = value; + } + } + }; + + this.get = function (item, valueNames) { + templater.create(item); + var values = {}; + + for (var i = 0, il = valueNames.length; i < il; i++) { + var elm = undefined, + valueName = valueNames[i]; + if (valueName.data) { - item.elm.setAttribute('data-'+valueName.data, value); + for (var j = 0, jl = valueName.data.length; j < jl; j++) { + values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j]); + } } else if (valueName.attr && valueName.name) { elm = list.utils.getByClass(item.elm, valueName.name, true); - if (elm) { - elm.setAttribute(valueName.attr, value); - } + values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : ''; } else { elm = list.utils.getByClass(item.elm, valueName, true); - if (elm) { - elm.innerHTML = value; - } + values[valueName] = elm ? elm.innerHTML : ''; } - elm = undefined; - }; + } + + return values; + }; + + this.set = function (item, values) { if (!templater.create(item)) { - for(var v in values) { + for (var v in values) { if (values.hasOwnProperty(v)) { - setValue(v, values[v]); + setValue(item, v, values[v]); } } } }; - this.create = function(item) { + this.create = function (item) { if (item.elm !== undefined) { return false; } - /* If item source does not exists, use the first item in list as - source for new items */ - var newItem = itemSource.cloneNode(true); - newItem.removeAttribute('id'); - item.elm = newItem; + + item.elm = createItem(item.values()); templater.set(item, item.values()); return true; }; - this.remove = function(item) { + + this.remove = function (item) { if (item.elm.parentNode === list.list) { list.list.removeChild(item.elm); } }; - this.show = function(item) { + + this.show = function (item) { templater.create(item); list.list.appendChild(item.elm); }; - this.hide = function(item) { + + this.hide = function (item) { if (item.elm !== undefined && item.elm.parentNode === list.list) { list.list.removeChild(item.elm); } }; - this.clear = function() { + + this.clear = function () { /* .innerHTML = ''; fucks up IE */ if (list.list.hasChildNodes()) { - while (list.list.childNodes.length >= 1) - { + while (list.list.childNodes.length >= 1) { list.list.removeChild(list.list.firstChild); } } @@ -810,29 +1209,36 @@ var Templater = function(list) { init(); }; -module.exports = function(list) { +module.exports = function (list) { return new Templater(list); }; -},{}],9:[function(require,module,exports){ +/***/ }), + +/***/ "./src/utils/classes.js": +/*!******************************!*\ + !*** ./src/utils/classes.js ***! + \******************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 24:0-14 */ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + /** * Module dependencies. */ - -var index = require('./index-of'); - +var index = __webpack_require__(/*! ./index-of */ "./src/utils/index-of.js"); /** * Whitespace regexp. */ -var re = /\s+/; +var re = /\s+/; /** * toString reference. */ var toString = Object.prototype.toString; - /** * Wrap `el` in a `ClassList`. * @@ -841,10 +1247,9 @@ var toString = Object.prototype.toString; * @api public */ -module.exports = function(el){ +module.exports = function (el) { return new ClassList(el); }; - /** * Initialize a new ClassList for `el`. * @@ -852,14 +1257,15 @@ module.exports = function(el){ * @api private */ + function ClassList(el) { if (!el || !el.nodeType) { throw new Error('A DOM element reference is required'); } + this.el = el; this.list = el.classList; } - /** * Add class `name` if not already present. * @@ -868,21 +1274,21 @@ function ClassList(el) { * @api public */ -ClassList.prototype.add = function(name){ + +ClassList.prototype.add = function (name) { // classList if (this.list) { this.list.add(name); return this; - } + } // fallback + - // fallback var arr = this.array(); var i = index(arr, name); if (!~i) arr.push(name); this.el.className = arr.join(' '); return this; }; - /** * Remove class `name` when present, or * pass a regular expression to remove @@ -893,43 +1299,21 @@ ClassList.prototype.add = function(name){ * @api public */ -ClassList.prototype.remove = function(name){ - if ('[object RegExp]' == toString.call(name)) { - return this.removeMatching(name); - } +ClassList.prototype.remove = function (name) { // classList if (this.list) { this.list.remove(name); return this; - } + } // fallback + - // fallback var arr = this.array(); var i = index(arr, name); if (~i) arr.splice(i, 1); this.el.className = arr.join(' '); return this; }; - -/** - * Remove all classes matching `re`. - * - * @param {RegExp} re - * @return {ClassList} - * @api private - */ - -ClassList.prototype.removeMatching = function(re){ - var arr = this.array(); - for (var i = 0; i < arr.length; i++) { - if (re.test(arr[i])) { - this.remove(arr[i]); - } - } - return this; -}; - /** * Toggle class `name`, can force state via `force`. * @@ -942,21 +1326,23 @@ ClassList.prototype.removeMatching = function(re){ * @api public */ -ClassList.prototype.toggle = function(name, force){ + +ClassList.prototype.toggle = function (name, force) { // classList if (this.list) { - if ("undefined" !== typeof force) { + if ('undefined' !== typeof force) { if (force !== this.list.toggle(name, force)) { this.list.toggle(name); // toggle again to correct } } else { this.list.toggle(name); } + return this; - } + } // fallback - // fallback - if ("undefined" !== typeof force) { + + if ('undefined' !== typeof force) { if (!force) { this.remove(name); } else { @@ -972,7 +1358,6 @@ ClassList.prototype.toggle = function(name, force){ return this; }; - /** * Return an array of classes. * @@ -980,14 +1365,14 @@ ClassList.prototype.toggle = function(name, force){ * @api public */ -ClassList.prototype.array = function(){ + +ClassList.prototype.array = function () { var className = this.el.getAttribute('class') || ''; var str = className.replace(/^\s+|\s+$/g, ''); var arr = str.split(re); if ('' === arr[0]) arr.shift(); return arr; }; - /** * Check if class `name` is present. * @@ -996,17 +1381,29 @@ ClassList.prototype.array = function(){ * @api public */ -ClassList.prototype.has = -ClassList.prototype.contains = function(name){ - return this.list ? this.list.contains(name) : !! ~index(this.array(), name); + +ClassList.prototype.has = ClassList.prototype.contains = function (name) { + return this.list ? this.list.contains(name) : !!~index(this.array(), name); }; -},{"./index-of":14}],10:[function(require,module,exports){ +/***/ }), + +/***/ "./src/utils/events.js": +/*!*****************************!*\ + !*** ./src/utils/events.js ***! + \*****************************/ +/*! default exports */ +/*! export bind [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export debounce [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export unbind [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_exports__, __webpack_require__ */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + var bind = window.addEventListener ? 'addEventListener' : 'attachEvent', unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent', prefix = bind !== 'addEventListener' ? 'on' : '', - toArray = require('./to-array'); - + toArray = __webpack_require__(/*! ./to-array */ "./src/utils/to-array.js"); /** * Bind `el` event `type` to `fn`. * @@ -1017,13 +1414,14 @@ var bind = window.addEventListener ? 'addEventListener' : 'attachEvent', * @api public */ -exports.bind = function(el, type, fn, capture){ + +exports.bind = function (el, type, fn, capture) { el = toArray(el); - for ( var i = 0; i < el.length; i++ ) { + + for (var i = 0, il = el.length; i < il; i++) { el[i][bind](prefix + type, fn, capture || false); } }; - /** * Unbind `el` event `type`'s callback `fn`. * @@ -1034,34 +1432,227 @@ exports.bind = function(el, type, fn, capture){ * @api public */ -exports.unbind = function(el, type, fn, capture){ + +exports.unbind = function (el, type, fn, capture) { el = toArray(el); - for ( var i = 0; i < el.length; i++ ) { + + for (var i = 0, il = el.length; i < il; i++) { el[i][unbind](prefix + type, fn, capture || false); } }; +/** + * Returns a function, that, as long as it continues to be invoked, will not + * be triggered. The function will be called after it stops being called for + * `wait` milliseconds. If `immediate` is true, trigger the function on the + * leading edge, instead of the trailing. + * + * @param {Function} fn + * @param {Integer} wait + * @param {Boolean} immediate + * @api public + */ + + +exports.debounce = function (fn, wait, immediate) { + var timeout; + return wait ? function () { + var context = this, + args = arguments; + + var later = function later() { + timeout = null; + if (!immediate) fn.apply(context, args); + }; + + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) fn.apply(context, args); + } : fn; +}; + +/***/ }), + +/***/ "./src/utils/extend.js": +/*!*****************************!*\ + !*** ./src/utils/extend.js ***! + \*****************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 4:0-14 */ +/***/ (function(module) { -},{"./to-array":16}],11:[function(require,module,exports){ /* * Source: https://github.com/segmentio/extend */ +module.exports = function extend(object) { + // Takes an unlimited number of extenders. + var args = Array.prototype.slice.call(arguments, 1); // For each extender, copy their properties on our object. + + for (var i = 0, source; source = args[i]; i++) { + if (!source) continue; + + for (var property in source) { + object[property] = source[property]; + } + } + + return object; +}; + +/***/ }), + +/***/ "./src/utils/fuzzy.js": +/*!****************************!*\ + !*** ./src/utils/fuzzy.js ***! + \****************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { + +module.exports = function (text, pattern, options) { + // Aproximately where in the text is the pattern expected to be found? + var Match_Location = options.location || 0; //Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold. + + var Match_Distance = options.distance || 100; // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything. + + var Match_Threshold = options.threshold || 0.4; + if (pattern === text) return true; // Exact match + + if (pattern.length > 32) return false; // This algorithm cannot be used + // Set starting location at beginning text and initialise the alphabet. + + var loc = Match_Location, + s = function () { + var q = {}, + i; + + for (i = 0; i < pattern.length; i++) { + q[pattern.charAt(i)] = 0; + } + + for (i = 0; i < pattern.length; i++) { + q[pattern.charAt(i)] |= 1 << pattern.length - i - 1; + } + + return q; + }(); // Compute and return the score for a match with e errors and x location. + // Accesses loc and pattern through being a closure. + + + function match_bitapScore_(e, x) { + var accuracy = e / pattern.length, + proximity = Math.abs(loc - x); + + if (!Match_Distance) { + // Dodge divide by zero error. + return proximity ? 1.0 : accuracy; + } + + return accuracy + proximity / Match_Distance; + } + + var score_threshold = Match_Threshold, + // Highest score beyond which we give up. + best_loc = text.indexOf(pattern, loc); // Is there a nearby exact match? (speedup) + + if (best_loc != -1) { + score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold); // What about in the other direction? (speedup) + + best_loc = text.lastIndexOf(pattern, loc + pattern.length); + + if (best_loc != -1) { + score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold); + } + } // Initialise the bit arrays. + + + var matchmask = 1 << pattern.length - 1; + best_loc = -1; + var bin_min, bin_mid; + var bin_max = pattern.length + text.length; + var last_rd; + + for (var d = 0; d < pattern.length; d++) { + // Scan for the best match; each iteration allows for one more error. + // Run a binary search to determine how far from 'loc' we can stray at this + // error level. + bin_min = 0; + bin_mid = bin_max; + + while (bin_min < bin_mid) { + if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) { + bin_min = bin_mid; + } else { + bin_max = bin_mid; + } + + bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min); + } // Use the result from this iteration as the maximum for the next. + + + bin_max = bin_mid; + var start = Math.max(1, loc - bin_mid + 1); + var finish = Math.min(loc + bin_mid, text.length) + pattern.length; + var rd = Array(finish + 2); + rd[finish + 1] = (1 << d) - 1; -module.exports = function extend (object) { - // Takes an unlimited number of extenders. - var args = Array.prototype.slice.call(arguments, 1); + for (var j = finish; j >= start; j--) { + // The alphabet (s) is a sparse hash, so the following line generates + // warnings. + var charMatch = s[text.charAt(j - 1)]; - // For each extender, copy their properties on our object. - for (var i = 0, source; source = args[i]; i++) { - if (!source) continue; - for (var property in source) { - object[property] = source[property]; + if (d === 0) { + // First pass: exact match. + rd[j] = (rd[j + 1] << 1 | 1) & charMatch; + } else { + // Subsequent passes: fuzzy match. + rd[j] = (rd[j + 1] << 1 | 1) & charMatch | ((last_rd[j + 1] | last_rd[j]) << 1 | 1) | last_rd[j + 1]; + } + + if (rd[j] & matchmask) { + var score = match_bitapScore_(d, j - 1); // This match will almost certainly be better than any existing match. + // But check anyway. + + if (score <= score_threshold) { + // Told you so. + score_threshold = score; + best_loc = j - 1; + + if (best_loc > loc) { + // When passing loc, don't exceed our current distance from loc. + start = Math.max(1, 2 * loc - best_loc); + } else { + // Already passed loc, downhill from here on in. + break; + } } + } + } // No hope for a (better) match at greater error levels. + + + if (match_bitapScore_(d + 1, loc) > score_threshold) { + break; } - return object; + last_rd = rd; + } + + return best_loc < 0 ? false : true; }; -},{}],12:[function(require,module,exports){ +/***/ }), + +/***/ "./src/utils/get-attribute.js": +/*!************************************!*\ + !*** ./src/utils/get-attribute.js ***! + \************************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 11:0-14 */ +/***/ (function(module) { + /** * A cross-browser implementation of getAttribute. * Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath @@ -1072,24 +1663,36 @@ module.exports = function extend (object) { * @param {String} attr * @api public */ +module.exports = function (el, attr) { + var result = el.getAttribute && el.getAttribute(attr) || null; -module.exports = function(el, attr) { - var result = (el.getAttribute && el.getAttribute(attr)) || null; - if( !result ) { + if (!result) { var attrs = el.attributes; var length = attrs.length; - for(var i = 0; i < length; i++) { - if (attr[i] !== undefined) { - if(attr[i].nodeName === attr) { - result = attr[i].nodeValue; + + for (var i = 0; i < length; i++) { + if (attrs[i] !== undefined) { + if (attrs[i].nodeName === attr) { + result = attrs[i].nodeValue; } } } } + return result; }; -},{}],13:[function(require,module,exports){ +/***/ }), + +/***/ "./src/utils/get-by-class.js": +/*!***********************************!*\ + !*** ./src/utils/get-by-class.js ***! + \***********************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 53:0-14 */ +/***/ (function(module) { + /** * A cross-browser implementation of getElementsByClass. * Heavily based on Dustin Diaz's function: http://dustindiaz.com/getelementsbyclass. @@ -1103,112 +1706,93 @@ module.exports = function(el, attr) { * @param {Boolean} single * @api public */ +var getElementsByClassName = function getElementsByClassName(container, className, single) { + if (single) { + return container.getElementsByClassName(className)[0]; + } else { + return container.getElementsByClassName(className); + } +}; -module.exports = (function() { - if (document.getElementsByClassName) { - return function(container, className, single) { - if (single) { - return container.getElementsByClassName(className)[0]; - } else { - return container.getElementsByClassName(className); - } - }; - } else if (document.querySelector) { - return function(container, className, single) { - className = '.' + className; +var querySelector = function querySelector(container, className, single) { + className = '.' + className; + + if (single) { + return container.querySelector(className); + } else { + return container.querySelectorAll(className); + } +}; + +var polyfill = function polyfill(container, className, single) { + var classElements = [], + tag = '*'; + var els = container.getElementsByTagName(tag); + var elsLen = els.length; + var pattern = new RegExp('(^|\\s)' + className + '(\\s|$)'); + + for (var i = 0, j = 0; i < elsLen; i++) { + if (pattern.test(els[i].className)) { if (single) { - return container.querySelector(className); + return els[i]; } else { - return container.querySelectorAll(className); + classElements[j] = els[i]; + j++; } - }; - } else { - return function(container, className, single) { - var classElements = [], - tag = '*'; - if (container === null) { - container = document; - } - var els = container.getElementsByTagName(tag); - var elsLen = els.length; - var pattern = new RegExp("(^|\\s)"+className+"(\\s|$)"); - for (var i = 0, j = 0; i < elsLen; i++) { - if ( pattern.test(els[i].className) ) { - if (single) { - return els[i]; - } else { - classElements[j] = els[i]; - j++; - } - } - } - return classElements; - }; + } } -})(); -},{}],14:[function(require,module,exports){ + return classElements; +}; + +module.exports = function () { + return function (container, className, single, options) { + options = options || {}; + + if (options.test && options.getElementsByClassName || !options.test && document.getElementsByClassName) { + return getElementsByClassName(container, className, single); + } else if (options.test && options.querySelector || !options.test && document.querySelector) { + return querySelector(container, className, single); + } else { + return polyfill(container, className, single); + } + }; +}(); + +/***/ }), + +/***/ "./src/utils/index-of.js": +/*!*******************************!*\ + !*** ./src/utils/index-of.js ***! + \*******************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ +/***/ (function(module) { + var indexOf = [].indexOf; -module.exports = function(arr, obj){ +module.exports = function (arr, obj) { if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { + + for (var i = 0, il = arr.length; i < il; ++i) { if (arr[i] === obj) return i; } + return -1; }; -},{}],15:[function(require,module,exports){ -/* - * Natural Sort algorithm for Javascript - Version 0.8 - Released under MIT license - * Author: Jim Palmer (based on chunking idea from Dave Koelle) - */ -module.exports = function(a, b, opts) { - var re = /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[\da-fA-F]+$|\d+)/g, - sre = /^\s+|\s+$/g, // trim pre-post whitespace - snre = /\s+/g, // normalize all whitespace to single ' ' character - dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, - hre = /^0x[0-9a-f]+$/i, - ore = /^0/, - options = opts || {}, - i = function(s) { return options.insensitive && (''+s).toLowerCase() || ''+s; }, - // convert all to strings strip whitespace - x = i(a) || '', - y = i(b) || '', - // chunk/tokenize - xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), - yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), - // numeric, hex or date detection - xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && Date.parse(x)), - yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null, - normChunk = function(s, l) { - // normalize spaces; find floats not starting with '0', string or 0 if not defined (Clint Priest) - return (!s.match(ore) || l == 1) && parseFloat(s) || s.replace(snre, ' ').replace(sre, '') || 0; - }, - oFxNcL, oFyNcL; - // first try and sort Hex codes or Dates - if (yD) { - if ( xD < yD ) { return -1; } - else if ( xD > yD ) { return 1; } - } - // natural sorting through split numeric strings and default strings - for(var cLoc=0, xNl = xN.length, yNl = yN.length, numS=Math.max(xNl, yNl); cLoc < numS; cLoc++) { - oFxNcL = normChunk(xN[cLoc], xNl); - oFyNcL = normChunk(yN[cLoc], yNl); - // handle numeric vs string comparison - number < string - (Kyle Adams) - if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; } - // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' - else if (typeof oFxNcL !== typeof oFyNcL) { - oFxNcL += ''; - oFyNcL += ''; - } - if (oFxNcL < oFyNcL) { return -1; } - if (oFxNcL > oFyNcL) { return 1; } - } - return 0; -}; +/***/ }), + +/***/ "./src/utils/to-array.js": +/*!*******************************!*\ + !*** ./src/utils/to-array.js ***! + \*******************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 11:0-14 */ +/***/ (function(module) { -},{}],16:[function(require,module,exports){ /** * Source: https://github.com/timoxley/to-array * @@ -1219,7 +1803,6 @@ module.exports = function(a, b, opts) { * @return {Array} Naive conversion of `collection` to a new `Array`. * @api public */ - module.exports = function toArray(collection) { if (typeof collection === 'undefined') return []; if (collection === null) return [null]; @@ -1228,27 +1811,210 @@ module.exports = function toArray(collection) { if (isArray(collection)) return collection; if (typeof collection.length != 'number') return [collection]; if (typeof collection === 'function' && collection instanceof Function) return [collection]; - var arr = []; - for (var i = 0; i < collection.length; i++) { + + for (var i = 0, il = collection.length; i < il; i++) { if (Object.prototype.hasOwnProperty.call(collection, i) || i in collection) { arr.push(collection[i]); } } + if (!arr.length) return []; return arr; }; function isArray(arr) { - return Object.prototype.toString.call(arr) === "[object Array]"; + return Object.prototype.toString.call(arr) === '[object Array]'; } -},{}],17:[function(require,module,exports){ -module.exports = function(s) { - s = (s === undefined) ? "" : s; - s = (s === null) ? "" : s; +/***/ }), + +/***/ "./src/utils/to-string.js": +/*!********************************!*\ + !*** ./src/utils/to-string.js ***! + \********************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ +/***/ (function(module) { + +module.exports = function (s) { + s = s === undefined ? '' : s; + s = s === null ? '' : s; s = s.toString(); return s; }; -},{}]},{},[1]); +/***/ }), + +/***/ "./node_modules/string-natural-compare/natural-compare.js": +/*!****************************************************************!*\ + !*** ./node_modules/string-natural-compare/natural-compare.js ***! + \****************************************************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 124:0-14 */ +/***/ (function(module) { + +"use strict"; + + +var alphabet; +var alphabetIndexMap; +var alphabetIndexMapLength = 0; + +function isNumberCode(code) { + return code >= 48 && code <= 57; +} + +function naturalCompare(a, b) { + var lengthA = (a += '').length; + var lengthB = (b += '').length; + var aIndex = 0; + var bIndex = 0; + + while (aIndex < lengthA && bIndex < lengthB) { + var charCodeA = a.charCodeAt(aIndex); + var charCodeB = b.charCodeAt(bIndex); + + if (isNumberCode(charCodeA)) { + if (!isNumberCode(charCodeB)) { + return charCodeA - charCodeB; + } + + var numStartA = aIndex; + var numStartB = bIndex; + + while (charCodeA === 48 && ++numStartA < lengthA) { + charCodeA = a.charCodeAt(numStartA); + } + while (charCodeB === 48 && ++numStartB < lengthB) { + charCodeB = b.charCodeAt(numStartB); + } + + var numEndA = numStartA; + var numEndB = numStartB; + + while (numEndA < lengthA && isNumberCode(a.charCodeAt(numEndA))) { + ++numEndA; + } + while (numEndB < lengthB && isNumberCode(b.charCodeAt(numEndB))) { + ++numEndB; + } + + var difference = numEndA - numStartA - numEndB + numStartB; // numA length - numB length + if (difference) { + return difference; + } + + while (numStartA < numEndA) { + difference = a.charCodeAt(numStartA++) - b.charCodeAt(numStartB++); + if (difference) { + return difference; + } + } + + aIndex = numEndA; + bIndex = numEndB; + continue; + } + + if (charCodeA !== charCodeB) { + if ( + charCodeA < alphabetIndexMapLength && + charCodeB < alphabetIndexMapLength && + alphabetIndexMap[charCodeA] !== -1 && + alphabetIndexMap[charCodeB] !== -1 + ) { + return alphabetIndexMap[charCodeA] - alphabetIndexMap[charCodeB]; + } + + return charCodeA - charCodeB; + } + + ++aIndex; + ++bIndex; + } + + if (aIndex >= lengthA && bIndex < lengthB && lengthA >= lengthB) { + return -1; + } + + if (bIndex >= lengthB && aIndex < lengthA && lengthB >= lengthA) { + return 1; + } + + return lengthA - lengthB; +} + +naturalCompare.caseInsensitive = naturalCompare.i = function(a, b) { + return naturalCompare(('' + a).toLowerCase(), ('' + b).toLowerCase()); +}; + +Object.defineProperties(naturalCompare, { + alphabet: { + get: function() { + return alphabet; + }, + + set: function(value) { + alphabet = value; + alphabetIndexMap = []; + + var i = 0; + + if (alphabet) { + for (; i < alphabet.length; i++) { + alphabetIndexMap[alphabet.charCodeAt(i)] = i; + } + } + + alphabetIndexMapLength = alphabetIndexMap.length; + + for (i = 0; i < alphabetIndexMapLength; i++) { + if (alphabetIndexMap[i] === undefined) { + alphabetIndexMap[i] = -1; + } + } + }, + }, +}); + +module.exports = naturalCompare; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ return __webpack_require__("./src/index.js"); +/******/ })() +; +//# sourceMappingURL=list.js.map \ No newline at end of file diff --git a/dist/list.js.map b/dist/list.js.map new file mode 100644 index 00000000..0583dbe3 --- /dev/null +++ b/dist/list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list.js","sources":["webpack://List/./src/add-async.js","webpack://List/./src/filter.js","webpack://List/./src/fuzzy-search.js","webpack://List/./src/index.js","webpack://List/./src/item.js","webpack://List/./src/pagination.js","webpack://List/./src/parse.js","webpack://List/./src/search.js","webpack://List/./src/sort.js","webpack://List/./src/templater.js","webpack://List/./src/utils/classes.js","webpack://List/./src/utils/events.js","webpack://List/./src/utils/extend.js","webpack://List/./src/utils/fuzzy.js","webpack://List/./src/utils/get-attribute.js","webpack://List/./src/utils/get-by-class.js","webpack://List/./src/utils/index-of.js","webpack://List/./src/utils/to-array.js","webpack://List/./src/utils/to-string.js","webpack://List/./node_modules/string-natural-compare/natural-compare.js","webpack://List/webpack/bootstrap","webpack://List/webpack/startup"],"sourcesContent":["module.exports = function (list) {\n var addAsync = function (values, callback, items) {\n var valuesToAdd = values.splice(0, 50)\n items = items || []\n items = items.concat(list.add(valuesToAdd))\n if (values.length > 0) {\n setTimeout(function () {\n addAsync(values, callback, items)\n }, 1)\n } else {\n list.update()\n callback(items)\n }\n }\n return addAsync\n}\n","module.exports = function (list) {\n // Add handlers\n list.handlers.filterStart = list.handlers.filterStart || []\n list.handlers.filterComplete = list.handlers.filterComplete || []\n\n return function (filterFunction) {\n list.trigger('filterStart')\n list.i = 1 // Reset paging\n list.reset.filter()\n if (filterFunction === undefined) {\n list.filtered = false\n } else {\n list.filtered = true\n var is = list.items\n for (var i = 0, il = is.length; i < il; i++) {\n var item = is[i]\n if (filterFunction(item)) {\n item.filtered = true\n } else {\n item.filtered = false\n }\n }\n }\n list.update()\n list.trigger('filterComplete')\n return list.visibleItems\n }\n}\n","var classes = require('./utils/classes'),\n events = require('./utils/events'),\n extend = require('./utils/extend'),\n toString = require('./utils/to-string'),\n getByClass = require('./utils/get-by-class'),\n fuzzy = require('./utils/fuzzy')\n\nmodule.exports = function (list, options) {\n options = options || {}\n\n options = extend(\n {\n location: 0,\n distance: 100,\n threshold: 0.4,\n multiSearch: true,\n searchClass: 'fuzzy-search',\n },\n options\n )\n\n var fuzzySearch = {\n search: function (searchString, columns) {\n // Substract arguments from the searchString or put searchString as only argument\n var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString]\n\n for (var k = 0, kl = list.items.length; k < kl; k++) {\n fuzzySearch.item(list.items[k], columns, searchArguments)\n }\n },\n item: function (item, columns, searchArguments) {\n var found = true\n for (var i = 0; i < searchArguments.length; i++) {\n var foundArgument = false\n for (var j = 0, jl = columns.length; j < jl; j++) {\n if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) {\n foundArgument = true\n }\n }\n if (!foundArgument) {\n found = false\n }\n }\n item.found = found\n },\n values: function (values, value, searchArgument) {\n if (values.hasOwnProperty(value)) {\n var text = toString(values[value]).toLowerCase()\n\n if (fuzzy(text, searchArgument, options)) {\n return true\n }\n }\n return false\n },\n }\n\n events.bind(\n getByClass(list.listContainer, options.searchClass),\n 'keyup',\n list.utils.events.debounce(function (e) {\n var target = e.target || e.srcElement // IE have srcElement\n list.search(target.value, fuzzySearch.search)\n }, list.searchDelay)\n )\n\n return function (str, columns) {\n list.search(str, columns, fuzzySearch.search)\n }\n}\n","var naturalSort = require('string-natural-compare'),\n getByClass = require('./utils/get-by-class'),\n extend = require('./utils/extend'),\n indexOf = require('./utils/index-of'),\n events = require('./utils/events'),\n toString = require('./utils/to-string'),\n classes = require('./utils/classes'),\n getAttribute = require('./utils/get-attribute'),\n toArray = require('./utils/to-array')\n\nmodule.exports = function (id, options, values) {\n var self = this,\n init,\n Item = require('./item')(self),\n addAsync = require('./add-async')(self),\n initPagination = require('./pagination')(self)\n\n init = {\n start: function () {\n self.listClass = 'list'\n self.searchClass = 'search'\n self.sortClass = 'sort'\n self.page = 10000\n self.i = 1\n self.items = []\n self.visibleItems = []\n self.matchingItems = []\n self.searched = false\n self.filtered = false\n self.searchColumns = undefined\n self.searchDelay = 0\n self.handlers = { updated: [] }\n self.valueNames = []\n self.utils = {\n getByClass: getByClass,\n extend: extend,\n indexOf: indexOf,\n events: events,\n toString: toString,\n naturalSort: naturalSort,\n classes: classes,\n getAttribute: getAttribute,\n toArray: toArray,\n }\n\n self.utils.extend(self, options)\n\n self.listContainer = typeof id === 'string' ? document.getElementById(id) : id\n if (!self.listContainer) {\n return\n }\n self.list = getByClass(self.listContainer, self.listClass, true)\n\n self.parse = require('./parse')(self)\n self.templater = require('./templater')(self)\n self.search = require('./search')(self)\n self.filter = require('./filter')(self)\n self.sort = require('./sort')(self)\n self.fuzzySearch = require('./fuzzy-search')(self, options.fuzzySearch)\n\n this.handlers()\n this.items()\n this.pagination()\n\n self.update()\n },\n handlers: function () {\n for (var handler in self.handlers) {\n if (self[handler] && self.handlers.hasOwnProperty(handler)) {\n self.on(handler, self[handler])\n }\n }\n },\n items: function () {\n self.parse(self.list)\n if (values !== undefined) {\n self.add(values)\n }\n },\n pagination: function () {\n if (options.pagination !== undefined) {\n if (options.pagination === true) {\n options.pagination = [{}]\n }\n if (options.pagination[0] === undefined) {\n options.pagination = [options.pagination]\n }\n for (var i = 0, il = options.pagination.length; i < il; i++) {\n initPagination(options.pagination[i])\n }\n }\n },\n }\n\n /*\n * Re-parse the List, use if html have changed\n */\n this.reIndex = function () {\n self.items = []\n self.visibleItems = []\n self.matchingItems = []\n self.searched = false\n self.filtered = false\n self.parse(self.list)\n }\n\n this.toJSON = function () {\n var json = []\n for (var i = 0, il = self.items.length; i < il; i++) {\n json.push(self.items[i].values())\n }\n return json\n }\n\n /*\n * Add object to list\n */\n this.add = function (values, callback) {\n if (values.length === 0) {\n return\n }\n if (callback) {\n addAsync(values.slice(0), callback)\n return\n }\n var added = [],\n notCreate = false\n if (values[0] === undefined) {\n values = [values]\n }\n for (var i = 0, il = values.length; i < il; i++) {\n var item = null\n notCreate = self.items.length > self.page ? true : false\n item = new Item(values[i], undefined, notCreate)\n self.items.push(item)\n added.push(item)\n }\n self.update()\n return added\n }\n\n this.show = function (i, page) {\n this.i = i\n this.page = page\n self.update()\n return self\n }\n\n /* Removes object from list.\n * Loops through the list and removes objects where\n * property \"valuename\" === value\n */\n this.remove = function (valueName, value, options) {\n var found = 0\n for (var i = 0, il = self.items.length; i < il; i++) {\n if (self.items[i].values()[valueName] == value) {\n self.templater.remove(self.items[i], options)\n self.items.splice(i, 1)\n il--\n i--\n found++\n }\n }\n self.update()\n return found\n }\n\n /* Gets the objects in the list which\n * property \"valueName\" === value\n */\n this.get = function (valueName, value) {\n var matchedItems = []\n for (var i = 0, il = self.items.length; i < il; i++) {\n var item = self.items[i]\n if (item.values()[valueName] == value) {\n matchedItems.push(item)\n }\n }\n return matchedItems\n }\n\n /*\n * Get size of the list\n */\n this.size = function () {\n return self.items.length\n }\n\n /*\n * Removes all items from the list\n */\n this.clear = function () {\n self.templater.clear()\n self.items = []\n return self\n }\n\n this.on = function (event, callback) {\n self.handlers[event].push(callback)\n return self\n }\n\n this.off = function (event, callback) {\n var e = self.handlers[event]\n var index = indexOf(e, callback)\n if (index > -1) {\n e.splice(index, 1)\n }\n return self\n }\n\n this.trigger = function (event) {\n var i = self.handlers[event].length\n while (i--) {\n self.handlers[event][i](self)\n }\n return self\n }\n\n this.reset = {\n filter: function () {\n var is = self.items,\n il = is.length\n while (il--) {\n is[il].filtered = false\n }\n return self\n },\n search: function () {\n var is = self.items,\n il = is.length\n while (il--) {\n is[il].found = false\n }\n return self\n },\n }\n\n this.update = function () {\n var is = self.items,\n il = is.length\n\n self.visibleItems = []\n self.matchingItems = []\n self.templater.clear()\n for (var i = 0; i < il; i++) {\n if (is[i].matching() && self.matchingItems.length + 1 >= self.i && self.visibleItems.length < self.page) {\n is[i].show()\n self.visibleItems.push(is[i])\n self.matchingItems.push(is[i])\n } else if (is[i].matching()) {\n self.matchingItems.push(is[i])\n is[i].hide()\n } else {\n is[i].hide()\n }\n }\n self.trigger('updated')\n return self\n }\n\n init.start()\n}\n","module.exports = function (list) {\n return function (initValues, element, notCreate) {\n var item = this\n\n this._values = {}\n\n this.found = false // Show if list.searched == true and this.found == true\n this.filtered = false // Show if list.filtered == true and this.filtered == true\n\n var init = function (initValues, element, notCreate) {\n if (element === undefined) {\n if (notCreate) {\n item.values(initValues, notCreate)\n } else {\n item.values(initValues)\n }\n } else {\n item.elm = element\n var values = list.templater.get(item, initValues)\n item.values(values)\n }\n }\n\n this.values = function (newValues, notCreate) {\n if (newValues !== undefined) {\n for (var name in newValues) {\n item._values[name] = newValues[name]\n }\n if (notCreate !== true) {\n list.templater.set(item, item.values())\n }\n } else {\n return item._values\n }\n }\n\n this.show = function () {\n list.templater.show(item)\n }\n\n this.hide = function () {\n list.templater.hide(item)\n }\n\n this.matching = function () {\n return (\n (list.filtered && list.searched && item.found && item.filtered) ||\n (list.filtered && !list.searched && item.filtered) ||\n (!list.filtered && list.searched && item.found) ||\n (!list.filtered && !list.searched)\n )\n }\n\n this.visible = function () {\n return item.elm && item.elm.parentNode == list.list ? true : false\n }\n\n init(initValues, element, notCreate)\n }\n}\n","var classes = require('./utils/classes'),\n events = require('./utils/events'),\n List = require('./index')\n\nmodule.exports = function (list) {\n var isHidden = false\n\n var refresh = function (pagingList, options) {\n if (list.page < 1) {\n list.listContainer.style.display = 'none'\n isHidden = true\n return\n } else if (isHidden) {\n list.listContainer.style.display = 'block'\n }\n\n var item,\n l = list.matchingItems.length,\n index = list.i,\n page = list.page,\n pages = Math.ceil(l / page),\n currentPage = Math.ceil(index / page),\n innerWindow = options.innerWindow || 2,\n left = options.left || options.outerWindow || 0,\n right = options.right || options.outerWindow || 0\n\n right = pages - right\n pagingList.clear()\n for (var i = 1; i <= pages; i++) {\n var className = currentPage === i ? 'active' : ''\n\n //console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className);\n\n if (is.number(i, left, right, currentPage, innerWindow)) {\n item = pagingList.add({\n page: i,\n dotted: false,\n })[0]\n if (className) {\n classes(item.elm).add(className)\n }\n item.elm.firstChild.setAttribute('data-i', i)\n item.elm.firstChild.setAttribute('data-page', page)\n } else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) {\n item = pagingList.add({\n page: '...',\n dotted: true,\n })[0]\n classes(item.elm).add('disabled')\n }\n }\n }\n\n var is = {\n number: function (i, left, right, currentPage, innerWindow) {\n return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow)\n },\n left: function (i, left) {\n return i <= left\n },\n right: function (i, right) {\n return i > right\n },\n innerWindow: function (i, currentPage, innerWindow) {\n return i >= currentPage - innerWindow && i <= currentPage + innerWindow\n },\n dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {\n return (\n this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) ||\n this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem)\n )\n },\n dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) {\n return i == left + 1 && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)\n },\n dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {\n if (pagingList.items[currentPageItem - 1].values().dotted) {\n return false\n } else {\n return i == right && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)\n }\n },\n }\n\n return function (options) {\n var pagingList = new List(list.listContainer.id, {\n listClass: options.paginationClass || 'pagination',\n item: options.item || \"
      • \",\n valueNames: ['page', 'dotted'],\n searchClass: 'pagination-search-that-is-not-supposed-to-exist',\n sortClass: 'pagination-sort-that-is-not-supposed-to-exist',\n })\n\n events.bind(pagingList.listContainer, 'click', function (e) {\n var target = e.target || e.srcElement,\n page = list.utils.getAttribute(target, 'data-page'),\n i = list.utils.getAttribute(target, 'data-i')\n if (i) {\n list.show((i - 1) * page + 1, page)\n }\n })\n\n list.on('updated', function () {\n refresh(pagingList, options)\n })\n refresh(pagingList, options)\n }\n}\n","module.exports = function (list) {\n var Item = require('./item')(list)\n\n var getChildren = function (parent) {\n var nodes = parent.childNodes,\n items = []\n for (var i = 0, il = nodes.length; i < il; i++) {\n // Only textnodes have a data attribute\n if (nodes[i].data === undefined) {\n items.push(nodes[i])\n }\n }\n return items\n }\n\n var parse = function (itemElements, valueNames) {\n for (var i = 0, il = itemElements.length; i < il; i++) {\n list.items.push(new Item(valueNames, itemElements[i]))\n }\n }\n var parseAsync = function (itemElements, valueNames) {\n var itemsToIndex = itemElements.splice(0, 50) // TODO: If < 100 items, what happens in IE etc?\n parse(itemsToIndex, valueNames)\n if (itemElements.length > 0) {\n setTimeout(function () {\n parseAsync(itemElements, valueNames)\n }, 1)\n } else {\n list.update()\n list.trigger('parseComplete')\n }\n }\n\n list.handlers.parseComplete = list.handlers.parseComplete || []\n\n return function () {\n var itemsToIndex = getChildren(list.list),\n valueNames = list.valueNames\n\n if (list.indexAsync) {\n parseAsync(itemsToIndex, valueNames)\n } else {\n parse(itemsToIndex, valueNames)\n }\n }\n}\n","module.exports = function (list) {\n var item, text, columns, searchString, customSearch\n\n var prepare = {\n resetList: function () {\n list.i = 1\n list.templater.clear()\n customSearch = undefined\n },\n setOptions: function (args) {\n if (args.length == 2 && args[1] instanceof Array) {\n columns = args[1]\n } else if (args.length == 2 && typeof args[1] == 'function') {\n columns = undefined\n customSearch = args[1]\n } else if (args.length == 3) {\n columns = args[1]\n customSearch = args[2]\n } else {\n columns = undefined\n }\n },\n setColumns: function () {\n if (list.items.length === 0) return\n if (columns === undefined) {\n columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns\n }\n },\n setSearchString: function (s) {\n s = list.utils.toString(s).toLowerCase()\n s = s.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, '\\\\$&') // Escape regular expression characters\n searchString = s\n },\n toArray: function (values) {\n var tmpColumn = []\n for (var name in values) {\n tmpColumn.push(name)\n }\n return tmpColumn\n },\n }\n var search = {\n list: function () {\n // Extract quoted phrases \"word1 word2\" from original searchString\n // searchString is converted to lowercase by List.js\n var words = [],\n phrase,\n ss = searchString\n while ((phrase = ss.match(/\"([^\"]+)\"/)) !== null) {\n words.push(phrase[1])\n ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length)\n }\n // Get remaining space-separated words (if any)\n ss = ss.trim()\n if (ss.length) words = words.concat(ss.split(/\\s+/))\n for (var k = 0, kl = list.items.length; k < kl; k++) {\n var item = list.items[k]\n item.found = false\n if (!words.length) continue\n for (var i = 0, il = words.length; i < il; i++) {\n var word_found = false\n for (var j = 0, jl = columns.length; j < jl; j++) {\n var values = item.values(),\n column = columns[j]\n if (values.hasOwnProperty(column) && values[column] !== undefined && values[column] !== null) {\n var text = typeof values[column] !== 'string' ? values[column].toString() : values[column]\n if (text.toLowerCase().indexOf(words[i]) !== -1) {\n // word found, so no need to check it against any other columns\n word_found = true\n break\n }\n }\n }\n // this word not found? no need to check any other words, the item cannot match\n if (!word_found) break\n }\n item.found = word_found\n }\n },\n // Removed search.item() and search.values()\n reset: function () {\n list.reset.search()\n list.searched = false\n },\n }\n\n var searchMethod = function (str) {\n list.trigger('searchStart')\n\n prepare.resetList()\n prepare.setSearchString(str)\n prepare.setOptions(arguments) // str, cols|searchFunction, searchFunction\n prepare.setColumns()\n\n if (searchString === '') {\n search.reset()\n } else {\n list.searched = true\n if (customSearch) {\n customSearch(searchString, columns)\n } else {\n search.list()\n }\n }\n\n list.update()\n list.trigger('searchComplete')\n return list.visibleItems\n }\n\n list.handlers.searchStart = list.handlers.searchStart || []\n list.handlers.searchComplete = list.handlers.searchComplete || []\n\n list.utils.events.bind(\n list.utils.getByClass(list.listContainer, list.searchClass),\n 'keyup',\n list.utils.events.debounce(function (e) {\n var target = e.target || e.srcElement, // IE have srcElement\n alreadyCleared = target.value === '' && !list.searched\n if (!alreadyCleared) {\n // If oninput already have resetted the list, do nothing\n searchMethod(target.value)\n }\n }, list.searchDelay)\n )\n\n // Used to detect click on HTML5 clear button\n list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function (e) {\n var target = e.target || e.srcElement\n if (target.value === '') {\n searchMethod('')\n }\n })\n\n return searchMethod\n}\n","module.exports = function (list) {\n var buttons = {\n els: undefined,\n clear: function () {\n for (var i = 0, il = buttons.els.length; i < il; i++) {\n list.utils.classes(buttons.els[i]).remove('asc')\n list.utils.classes(buttons.els[i]).remove('desc')\n }\n },\n getOrder: function (btn) {\n var predefinedOrder = list.utils.getAttribute(btn, 'data-order')\n if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {\n return predefinedOrder\n } else if (list.utils.classes(btn).has('desc')) {\n return 'asc'\n } else if (list.utils.classes(btn).has('asc')) {\n return 'desc'\n } else {\n return 'asc'\n }\n },\n getInSensitive: function (btn, options) {\n var insensitive = list.utils.getAttribute(btn, 'data-insensitive')\n if (insensitive === 'false') {\n options.insensitive = false\n } else {\n options.insensitive = true\n }\n },\n setOrder: function (options) {\n for (var i = 0, il = buttons.els.length; i < il; i++) {\n var btn = buttons.els[i]\n if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) {\n continue\n }\n var predefinedOrder = list.utils.getAttribute(btn, 'data-order')\n if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {\n if (predefinedOrder == options.order) {\n list.utils.classes(btn).add(options.order)\n }\n } else {\n list.utils.classes(btn).add(options.order)\n }\n }\n },\n }\n\n var sort = function () {\n list.trigger('sortStart')\n var options = {}\n\n var target = arguments[0].currentTarget || arguments[0].srcElement || undefined\n\n if (target) {\n options.valueName = list.utils.getAttribute(target, 'data-sort')\n buttons.getInSensitive(target, options)\n options.order = buttons.getOrder(target)\n } else {\n options = arguments[1] || options\n options.valueName = arguments[0]\n options.order = options.order || 'asc'\n options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive\n }\n\n buttons.clear()\n buttons.setOrder(options)\n\n // caseInsensitive\n // alphabet\n var customSortFunction = options.sortFunction || list.sortFunction || null,\n multi = options.order === 'desc' ? -1 : 1,\n sortFunction\n\n if (customSortFunction) {\n sortFunction = function (itemA, itemB) {\n return customSortFunction(itemA, itemB, options) * multi\n }\n } else {\n sortFunction = function (itemA, itemB) {\n var sort = list.utils.naturalSort\n sort.alphabet = list.alphabet || options.alphabet || undefined\n if (!sort.alphabet && options.insensitive) {\n sort = list.utils.naturalSort.caseInsensitive\n }\n return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi\n }\n }\n\n list.items.sort(sortFunction)\n list.update()\n list.trigger('sortComplete')\n }\n\n // Add handlers\n list.handlers.sortStart = list.handlers.sortStart || []\n list.handlers.sortComplete = list.handlers.sortComplete || []\n\n buttons.els = list.utils.getByClass(list.listContainer, list.sortClass)\n list.utils.events.bind(buttons.els, 'click', sort)\n list.on('searchStart', buttons.clear)\n list.on('filterStart', buttons.clear)\n\n return sort\n}\n","var Templater = function (list) {\n var createItem,\n templater = this\n\n var init = function () {\n var itemSource\n\n if (typeof list.item === 'function') {\n createItem = function (values) {\n var item = list.item(values)\n return getItemSource(item)\n }\n return\n }\n\n if (typeof list.item === 'string') {\n if (list.item.indexOf('<') === -1) {\n itemSource = document.getElementById(list.item)\n } else {\n itemSource = getItemSource(list.item)\n }\n } else {\n /* If item source does not exists, use the first item in list as\n source for new items */\n itemSource = getFirstListItem()\n }\n\n if (!itemSource) {\n throw new Error(\"The list needs to have at least one item on init otherwise you'll have to add a template.\")\n }\n\n itemSource = createCleanTemplateItem(itemSource, list.valueNames)\n\n createItem = function () {\n return itemSource.cloneNode(true)\n }\n }\n\n var createCleanTemplateItem = function (templateNode, valueNames) {\n var el = templateNode.cloneNode(true)\n el.removeAttribute('id')\n\n for (var i = 0, il = valueNames.length; i < il; i++) {\n var elm = undefined,\n valueName = valueNames[i]\n if (valueName.data) {\n for (var j = 0, jl = valueName.data.length; j < jl; j++) {\n el.setAttribute('data-' + valueName.data[j], '')\n }\n } else if (valueName.attr && valueName.name) {\n elm = list.utils.getByClass(el, valueName.name, true)\n if (elm) {\n elm.setAttribute(valueName.attr, '')\n }\n } else {\n elm = list.utils.getByClass(el, valueName, true)\n if (elm) {\n elm.innerHTML = ''\n }\n }\n }\n return el\n }\n\n var getFirstListItem = function () {\n var nodes = list.list.childNodes\n\n for (var i = 0, il = nodes.length; i < il; i++) {\n // Only textnodes have a data attribute\n if (nodes[i].data === undefined) {\n return nodes[i].cloneNode(true)\n }\n }\n return undefined\n }\n\n var getItemSource = function (itemHTML) {\n if (typeof itemHTML !== 'string') return undefined\n if (/]/g.exec(itemHTML)) {\n var tbody = document.createElement('tbody')\n tbody.innerHTML = itemHTML\n return tbody.firstElementChild\n } else if (itemHTML.indexOf('<') !== -1) {\n var div = document.createElement('div')\n div.innerHTML = itemHTML\n return div.firstElementChild\n }\n return undefined\n }\n\n var getValueName = function (name) {\n for (var i = 0, il = list.valueNames.length; i < il; i++) {\n var valueName = list.valueNames[i]\n if (valueName.data) {\n var data = valueName.data\n for (var j = 0, jl = data.length; j < jl; j++) {\n if (data[j] === name) {\n return { data: name }\n }\n }\n } else if (valueName.attr && valueName.name && valueName.name == name) {\n return valueName\n } else if (valueName === name) {\n return name\n }\n }\n }\n\n var setValue = function (item, name, value) {\n var elm = undefined,\n valueName = getValueName(name)\n if (!valueName) return\n if (valueName.data) {\n item.elm.setAttribute('data-' + valueName.data, value)\n } else if (valueName.attr && valueName.name) {\n elm = list.utils.getByClass(item.elm, valueName.name, true)\n if (elm) {\n elm.setAttribute(valueName.attr, value)\n }\n } else {\n elm = list.utils.getByClass(item.elm, valueName, true)\n if (elm) {\n elm.innerHTML = value\n }\n }\n }\n\n this.get = function (item, valueNames) {\n templater.create(item)\n var values = {}\n for (var i = 0, il = valueNames.length; i < il; i++) {\n var elm = undefined,\n valueName = valueNames[i]\n if (valueName.data) {\n for (var j = 0, jl = valueName.data.length; j < jl; j++) {\n values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j])\n }\n } else if (valueName.attr && valueName.name) {\n elm = list.utils.getByClass(item.elm, valueName.name, true)\n values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : ''\n } else {\n elm = list.utils.getByClass(item.elm, valueName, true)\n values[valueName] = elm ? elm.innerHTML : ''\n }\n }\n return values\n }\n\n this.set = function (item, values) {\n if (!templater.create(item)) {\n for (var v in values) {\n if (values.hasOwnProperty(v)) {\n setValue(item, v, values[v])\n }\n }\n }\n }\n\n this.create = function (item) {\n if (item.elm !== undefined) {\n return false\n }\n item.elm = createItem(item.values())\n templater.set(item, item.values())\n return true\n }\n this.remove = function (item) {\n if (item.elm.parentNode === list.list) {\n list.list.removeChild(item.elm)\n }\n }\n this.show = function (item) {\n templater.create(item)\n list.list.appendChild(item.elm)\n }\n this.hide = function (item) {\n if (item.elm !== undefined && item.elm.parentNode === list.list) {\n list.list.removeChild(item.elm)\n }\n }\n this.clear = function () {\n /* .innerHTML = ''; fucks up IE */\n if (list.list.hasChildNodes()) {\n while (list.list.childNodes.length >= 1) {\n list.list.removeChild(list.list.firstChild)\n }\n }\n }\n\n init()\n}\n\nmodule.exports = function (list) {\n return new Templater(list)\n}\n","/**\n * Module dependencies.\n */\n\nvar index = require('./index-of')\n\n/**\n * Whitespace regexp.\n */\n\nvar re = /\\s+/\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function (el) {\n return new ClassList(el)\n}\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required')\n }\n this.el = el\n this.list = el.classList\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function (name) {\n // classList\n if (this.list) {\n this.list.add(name)\n return this\n }\n\n // fallback\n var arr = this.array()\n var i = index(arr, name)\n if (!~i) arr.push(name)\n this.el.className = arr.join(' ')\n return this\n}\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function (name) {\n // classList\n if (this.list) {\n this.list.remove(name)\n return this\n }\n\n // fallback\n var arr = this.array()\n var i = index(arr, name)\n if (~i) arr.splice(i, 1)\n this.el.className = arr.join(' ')\n return this\n}\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function (name, force) {\n // classList\n if (this.list) {\n if ('undefined' !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name) // toggle again to correct\n }\n } else {\n this.list.toggle(name)\n }\n return this\n }\n\n // fallback\n if ('undefined' !== typeof force) {\n if (!force) {\n this.remove(name)\n } else {\n this.add(name)\n }\n } else {\n if (this.has(name)) {\n this.remove(name)\n } else {\n this.add(name)\n }\n }\n\n return this\n}\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function () {\n var className = this.el.getAttribute('class') || ''\n var str = className.replace(/^\\s+|\\s+$/g, '')\n var arr = str.split(re)\n if ('' === arr[0]) arr.shift()\n return arr\n}\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has = ClassList.prototype.contains = function (name) {\n return this.list ? this.list.contains(name) : !!~index(this.array(), name)\n}\n","var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '',\n toArray = require('./to-array')\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el, NodeList, HTMLCollection or Array\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.bind = function (el, type, fn, capture) {\n el = toArray(el)\n for (var i = 0, il = el.length; i < il; i++) {\n el[i][bind](prefix + type, fn, capture || false)\n }\n}\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el, NodeList, HTMLCollection or Array\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function (el, type, fn, capture) {\n el = toArray(el)\n for (var i = 0, il = el.length; i < il; i++) {\n el[i][unbind](prefix + type, fn, capture || false)\n }\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * `wait` milliseconds. If `immediate` is true, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {Function} fn\n * @param {Integer} wait\n * @param {Boolean} immediate\n * @api public\n */\n\nexports.debounce = function (fn, wait, immediate) {\n var timeout\n return wait\n ? function () {\n var context = this,\n args = arguments\n var later = function () {\n timeout = null\n if (!immediate) fn.apply(context, args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait)\n if (callNow) fn.apply(context, args)\n }\n : fn\n}\n","/*\n * Source: https://github.com/segmentio/extend\n */\n\nmodule.exports = function extend(object) {\n // Takes an unlimited number of extenders.\n var args = Array.prototype.slice.call(arguments, 1)\n\n // For each extender, copy their properties on our object.\n for (var i = 0, source; (source = args[i]); i++) {\n if (!source) continue\n for (var property in source) {\n object[property] = source[property]\n }\n }\n\n return object\n}\n","module.exports = function (text, pattern, options) {\n // Aproximately where in the text is the pattern expected to be found?\n var Match_Location = options.location || 0\n\n //Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n var Match_Distance = options.distance || 100\n\n // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.\n var Match_Threshold = options.threshold || 0.4\n\n if (pattern === text) return true // Exact match\n if (pattern.length > 32) return false // This algorithm cannot be used\n\n // Set starting location at beginning text and initialise the alphabet.\n var loc = Match_Location,\n s = (function () {\n var q = {},\n i\n\n for (i = 0; i < pattern.length; i++) {\n q[pattern.charAt(i)] = 0\n }\n\n for (i = 0; i < pattern.length; i++) {\n q[pattern.charAt(i)] |= 1 << (pattern.length - i - 1)\n }\n\n return q\n })()\n\n // Compute and return the score for a match with e errors and x location.\n // Accesses loc and pattern through being a closure.\n\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x)\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n return accuracy + proximity / Match_Distance\n }\n\n var score_threshold = Match_Threshold, // Highest score beyond which we give up.\n best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup)\n\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length)\n\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1)\n best_loc = -1\n\n var bin_min, bin_mid\n var bin_max = pattern.length + text.length\n var last_rd\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0\n bin_mid = bin_max\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid\n } else {\n bin_max = bin_mid\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min)\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid\n var start = Math.max(1, loc - bin_mid + 1)\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length\n\n var rd = Array(finish + 2)\n rd[finish + 1] = (1 << d) - 1\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)]\n if (d === 0) {\n // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch\n } else {\n // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1]\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1)\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score\n best_loc = j - 1\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc)\n } else {\n // Already passed loc, downhill from here on in.\n break\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break\n }\n last_rd = rd\n }\n\n return best_loc < 0 ? false : true\n}\n","/**\n * A cross-browser implementation of getAttribute.\n * Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath\n *\n * Return the value for `attr` at `element`.\n *\n * @param {Element} el\n * @param {String} attr\n * @api public\n */\n\nmodule.exports = function (el, attr) {\n var result = (el.getAttribute && el.getAttribute(attr)) || null\n if (!result) {\n var attrs = el.attributes\n var length = attrs.length\n for (var i = 0; i < length; i++) {\n if (attrs[i] !== undefined) {\n if (attrs[i].nodeName === attr) {\n result = attrs[i].nodeValue\n }\n }\n }\n }\n return result\n}\n","/**\n * A cross-browser implementation of getElementsByClass.\n * Heavily based on Dustin Diaz's function: http://dustindiaz.com/getelementsbyclass.\n *\n * Find all elements with class `className` inside `container`.\n * Use `single = true` to increase performance in older browsers\n * when only one element is needed.\n *\n * @param {String} className\n * @param {Element} container\n * @param {Boolean} single\n * @api public\n */\n\nvar getElementsByClassName = function (container, className, single) {\n if (single) {\n return container.getElementsByClassName(className)[0]\n } else {\n return container.getElementsByClassName(className)\n }\n}\n\nvar querySelector = function (container, className, single) {\n className = '.' + className\n if (single) {\n return container.querySelector(className)\n } else {\n return container.querySelectorAll(className)\n }\n}\n\nvar polyfill = function (container, className, single) {\n var classElements = [],\n tag = '*'\n\n var els = container.getElementsByTagName(tag)\n var elsLen = els.length\n var pattern = new RegExp('(^|\\\\s)' + className + '(\\\\s|$)')\n for (var i = 0, j = 0; i < elsLen; i++) {\n if (pattern.test(els[i].className)) {\n if (single) {\n return els[i]\n } else {\n classElements[j] = els[i]\n j++\n }\n }\n }\n return classElements\n}\n\nmodule.exports = (function () {\n return function (container, className, single, options) {\n options = options || {}\n if ((options.test && options.getElementsByClassName) || (!options.test && document.getElementsByClassName)) {\n return getElementsByClassName(container, className, single)\n } else if ((options.test && options.querySelector) || (!options.test && document.querySelector)) {\n return querySelector(container, className, single)\n } else {\n return polyfill(container, className, single)\n }\n }\n})()\n","var indexOf = [].indexOf\n\nmodule.exports = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0, il = arr.length; i < il; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1\n}\n","/**\n * Source: https://github.com/timoxley/to-array\n *\n * Convert an array-like object into an `Array`.\n * If `collection` is already an `Array`, then will return a clone of `collection`.\n *\n * @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`\n * @return {Array} Naive conversion of `collection` to a new `Array`.\n * @api public\n */\n\nmodule.exports = function toArray(collection) {\n if (typeof collection === 'undefined') return []\n if (collection === null) return [null]\n if (collection === window) return [window]\n if (typeof collection === 'string') return [collection]\n if (isArray(collection)) return collection\n if (typeof collection.length != 'number') return [collection]\n if (typeof collection === 'function' && collection instanceof Function) return [collection]\n\n var arr = [];\n for (var i = 0, il = collection.length; i < il; i++) {\n if (Object.prototype.hasOwnProperty.call(collection, i) || i in collection) {\n arr.push(collection[i])\n }\n }\n if (!arr.length) return []\n return arr\n}\n\nfunction isArray(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n","module.exports = function (s) {\n s = s === undefined ? '' : s\n s = s === null ? '' : s\n s = s.toString()\n return s\n}\n","'use strict';\n\nvar alphabet;\nvar alphabetIndexMap;\nvar alphabetIndexMapLength = 0;\n\nfunction isNumberCode(code) {\n return code >= 48 && code <= 57;\n}\n\nfunction naturalCompare(a, b) {\n var lengthA = (a += '').length;\n var lengthB = (b += '').length;\n var aIndex = 0;\n var bIndex = 0;\n\n while (aIndex < lengthA && bIndex < lengthB) {\n var charCodeA = a.charCodeAt(aIndex);\n var charCodeB = b.charCodeAt(bIndex);\n\n if (isNumberCode(charCodeA)) {\n if (!isNumberCode(charCodeB)) {\n return charCodeA - charCodeB;\n }\n\n var numStartA = aIndex;\n var numStartB = bIndex;\n\n while (charCodeA === 48 && ++numStartA < lengthA) {\n charCodeA = a.charCodeAt(numStartA);\n }\n while (charCodeB === 48 && ++numStartB < lengthB) {\n charCodeB = b.charCodeAt(numStartB);\n }\n\n var numEndA = numStartA;\n var numEndB = numStartB;\n\n while (numEndA < lengthA && isNumberCode(a.charCodeAt(numEndA))) {\n ++numEndA;\n }\n while (numEndB < lengthB && isNumberCode(b.charCodeAt(numEndB))) {\n ++numEndB;\n }\n\n var difference = numEndA - numStartA - numEndB + numStartB; // numA length - numB length\n if (difference) {\n return difference;\n }\n\n while (numStartA < numEndA) {\n difference = a.charCodeAt(numStartA++) - b.charCodeAt(numStartB++);\n if (difference) {\n return difference;\n }\n }\n\n aIndex = numEndA;\n bIndex = numEndB;\n continue;\n }\n\n if (charCodeA !== charCodeB) {\n if (\n charCodeA < alphabetIndexMapLength &&\n charCodeB < alphabetIndexMapLength &&\n alphabetIndexMap[charCodeA] !== -1 &&\n alphabetIndexMap[charCodeB] !== -1\n ) {\n return alphabetIndexMap[charCodeA] - alphabetIndexMap[charCodeB];\n }\n\n return charCodeA - charCodeB;\n }\n\n ++aIndex;\n ++bIndex;\n }\n\n if (aIndex >= lengthA && bIndex < lengthB && lengthA >= lengthB) {\n return -1;\n }\n\n if (bIndex >= lengthB && aIndex < lengthA && lengthB >= lengthA) {\n return 1;\n }\n\n return lengthA - lengthB;\n}\n\nnaturalCompare.caseInsensitive = naturalCompare.i = function(a, b) {\n return naturalCompare(('' + a).toLowerCase(), ('' + b).toLowerCase());\n};\n\nObject.defineProperties(naturalCompare, {\n alphabet: {\n get: function() {\n return alphabet;\n },\n\n set: function(value) {\n alphabet = value;\n alphabetIndexMap = [];\n\n var i = 0;\n\n if (alphabet) {\n for (; i < alphabet.length; i++) {\n alphabetIndexMap[alphabet.charCodeAt(i)] = i;\n }\n }\n\n alphabetIndexMapLength = alphabetIndexMap.length;\n\n for (i = 0; i < alphabetIndexMapLength; i++) {\n if (alphabetIndexMap[i] === undefined) {\n alphabetIndexMap[i] = -1;\n }\n }\n },\n },\n});\n\nmodule.exports = naturalCompare;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./src/index.js\");\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;A;;;;;;;;;;;AChBA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC5BA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAMA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AALA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAjCA;AAoCA;AAIA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;ACtEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AASA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA;AAYA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AA1EA;AA6EA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAhBA;AACA;AAkBA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;ACvQA;AACA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC5DA;AAAA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAGA;AACA;AACA;AACA;AAFA;AACA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAFA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA5BA;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AALA;AAQA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC5GA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC9CA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AApCA;AAsCA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AA1CA;AACA;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3CA;AACA;AA6CA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;A;;;;;;;;;;;ACxGA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;ACnMA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;A;;;;;;;;;;;;;;AClKA;AAAA;AAAA;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;A;;;;;;;;;;;ACpEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AClBA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAAA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;A;;;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;A;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file diff --git a/dist/list.min.js b/dist/list.min.js index ff939b4b..81318815 100644 --- a/dist/list.min.js +++ b/dist/list.min.js @@ -1 +1,2 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb;b++)a.push(r.items[b].values());return a},this.add=function(a,b){if(0!==a.length){if(b)return void t(a,b);var c=[],e=!1;a[0]===d&&(a=[a]);for(var f=0,g=a.length;g>f;f++){var h=null;e=r.items.length>r.page?!0:!1,h=new s(a[f],d,e),r.items.push(h),c.push(h)}return r.update(),c}},this.show=function(a,b){return this.i=a,this.page=b,r.update(),r},this.remove=function(a,b,c){for(var d=0,e=0,f=r.items.length;f>e;e++)r.items[e].values()[a]==b&&(r.templater.remove(r.items[e],c),r.items.splice(e,1),f--,e--,d++);return r.update(),d},this.get=function(a,b){for(var c=[],d=0,e=r.items.length;e>d;d++){var f=r.items[d];f.values()[a]==b&&c.push(f)}return c},this.size=function(){return r.items.length},this.clear=function(){return r.templater.clear(),r.items=[],r},this.on=function(a,b){return r.handlers[a].push(b),r},this.off=function(a,b){var c=r.handlers[a],d=h(c,b);return d>-1&&c.splice(d,1),r},this.trigger=function(a){for(var b=r.handlers[a].length;b--;)r.handlers[a][b](r);return r},this.reset={filter:function(){for(var a=r.items,b=a.length;b--;)a[b].filtered=!1;return r},search:function(){for(var a=r.items,b=a.length;b--;)a[b].found=!1;return r}},this.update=function(){var a=r.items,b=a.length;r.visibleItems=[],r.matchingItems=[],r.templater.clear();for(var c=0;b>c;c++)a[c].matching()&&r.matchingItems.length+1>=r.i&&r.visibleItems.length0?setTimeout(function(){b(c,d,e)},1):(a.update(),d(e))};return b}},{}],3:[function(a,b,c){b.exports=function(a){return a.handlers.filterStart=a.handlers.filterStart||[],a.handlers.filterComplete=a.handlers.filterComplete||[],function(b){if(a.trigger("filterStart"),a.i=1,a.reset.filter(),void 0===b)a.filtered=!1;else{a.filtered=!0;for(var c=a.items,d=0,e=c.length;e>d;d++){var f=c[d];b(f)?f.filtered=!0:f.filtered=!1}}return a.update(),a.trigger("filterComplete"),a.visibleItems}}},{}],4:[function(a,b,c){b.exports=function(a){return function(b,c,d){var e=this;this._values={},this.found=!1,this.filtered=!1;var f=function(b,c,d){if(void 0===c)d?e.values(b,d):e.values(b);else{e.elm=c;var f=a.templater.get(e,b);e.values(f)}};this.values=function(b,c){if(void 0===b)return e._values;for(var d in b)e._values[d]=b[d];c!==!0&&a.templater.set(e,e.values())},this.show=function(){a.templater.show(e)},this.hide=function(){a.templater.hide(e)},this.matching=function(){return a.filtered&&a.searched&&e.found&&e.filtered||a.filtered&&!a.searched&&e.filtered||!a.filtered&&a.searched&&e.found||!a.filtered&&!a.searched},this.visible=function(){return e.elm&&e.elm.parentNode==a.list?!0:!1},f(b,c,d)}}},{}],5:[function(a,b,c){b.exports=function(b){var c=a("./item")(b),d=function(a){for(var b=a.childNodes,c=[],d=0,e=b.length;e>d;d++)void 0===b[d].data&&c.push(b[d]);return c},e=function(a,d){for(var e=0,f=a.length;f>e;e++)b.items.push(new c(d,a[e]))},f=function(a,c){var d=a.splice(0,50);e(d,c),a.length>0?setTimeout(function(){f(a,c)},1):(b.update(),b.trigger("parseComplete"))};return b.handlers.parseComplete=b.handlers.parseComplete||[],function(){var a=d(b.list),c=b.valueNames;b.indexAsync?f(a,c):e(a,c)}}},{"./item":4}],6:[function(a,b,c){b.exports=function(a){var b,c,d,e,f={resetList:function(){a.i=1,a.templater.clear(),e=void 0},setOptions:function(a){2==a.length&&a[1]instanceof Array?c=a[1]:2==a.length&&"function"==typeof a[1]?e=a[1]:3==a.length&&(c=a[1],e=a[2])},setColumns:function(){0!==a.items.length&&void 0===c&&(c=void 0===a.searchColumns?f.toArray(a.items[0].values()):a.searchColumns)},setSearchString:function(b){b=a.utils.toString(b).toLowerCase(),b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),d=b},toArray:function(a){var b=[];for(var c in a)b.push(c);return b}},g={list:function(){for(var b=0,c=a.items.length;c>b;b++)g.item(a.items[b])},item:function(a){a.found=!1;for(var b=0,d=c.length;d>b;b++)if(g.values(a.values(),c[b]))return void(a.found=!0)},values:function(c,e){return c.hasOwnProperty(e)&&(b=a.utils.toString(c[e]).toLowerCase(),""!==d&&b.search(d)>-1)?!0:!1},reset:function(){a.reset.search(),a.searched=!1}},h=function(b){return a.trigger("searchStart"),f.resetList(),f.setSearchString(b),f.setOptions(arguments),f.setColumns(),""===d?g.reset():(a.searched=!0,e?e(d,c):g.list()),a.update(),a.trigger("searchComplete"),a.visibleItems};return a.handlers.searchStart=a.handlers.searchStart||[],a.handlers.searchComplete=a.handlers.searchComplete||[],a.utils.events.bind(a.utils.getByClass(a.listContainer,a.searchClass),"keyup",function(b){var c=b.target||b.srcElement,d=""===c.value&&!a.searched;d||h(c.value)}),a.utils.events.bind(a.utils.getByClass(a.listContainer,a.searchClass),"input",function(a){var b=a.target||a.srcElement;""===b.value&&h("")}),h}},{}],7:[function(a,b,c){b.exports=function(a){a.sortFunction=a.sortFunction||function(b,c,d){return d.desc="desc"==d.order?!0:!1,a.utils.naturalSort(b.values()[d.valueName],c.values()[d.valueName],d)};var b={els:void 0,clear:function(){for(var c=0,d=b.els.length;d>c;c++)a.utils.classes(b.els[c]).remove("asc"),a.utils.classes(b.els[c]).remove("desc")},getOrder:function(b){var c=a.utils.getAttribute(b,"data-order");return"asc"==c||"desc"==c?c:a.utils.classes(b).has("desc")?"asc":a.utils.classes(b).has("asc")?"desc":"asc"},getInSensitive:function(b,c){var d=a.utils.getAttribute(b,"data-insensitive");"false"===d?c.insensitive=!1:c.insensitive=!0},setOrder:function(c){for(var d=0,e=b.els.length;e>d;d++){var f=b.els[d];if(a.utils.getAttribute(f,"data-sort")===c.valueName){var g=a.utils.getAttribute(f,"data-order");"asc"==g||"desc"==g?g==c.order&&a.utils.classes(f).add(c.order):a.utils.classes(f).add(c.order)}}}},c=function(){a.trigger("sortStart");var c={},d=arguments[0].currentTarget||arguments[0].srcElement||void 0;d?(c.valueName=a.utils.getAttribute(d,"data-sort"),b.getInSensitive(d,c),c.order=b.getOrder(d)):(c=arguments[1]||c,c.valueName=arguments[0],c.order=c.order||"asc",c.insensitive="undefined"==typeof c.insensitive?!0:c.insensitive),b.clear(),b.setOrder(c),c.sortFunction=c.sortFunction||a.sortFunction,a.items.sort(function(a,b){var d="desc"===c.order?-1:1;return c.sortFunction(a,b,c)*d}),a.update(),a.trigger("sortComplete")};return a.handlers.sortStart=a.handlers.sortStart||[],a.handlers.sortComplete=a.handlers.sortComplete||[],b.els=a.utils.getByClass(a.listContainer,a.sortClass),a.utils.events.bind(b.els,"click",c),a.on("searchStart",b.clear),a.on("filterStart",b.clear),c}},{}],8:[function(a,b,c){var d=function(a){var b,c=this,d=function(){b=c.getItemSource(a.item),b=c.clearSourceItem(b,a.valueNames)};this.clearSourceItem=function(b,c){for(var d=0,e=c.length;e>d;d++){var f;if(c[d].data)for(var g=0,h=c[d].data.length;h>g;g++)b.setAttribute("data-"+c[d].data[g],"");else c[d].attr&&c[d].name?(f=a.utils.getByClass(b,c[d].name,!0),f&&f.setAttribute(c[d].attr,"")):(f=a.utils.getByClass(b,c[d],!0),f&&(f.innerHTML=""));f=void 0}return b},this.getItemSource=function(b){if(void 0===b){for(var c=a.list.childNodes,d=0,e=c.length;e>d;d++)if(void 0===c[d].data)return c[d].cloneNode(!0)}else{if(/^tr[\s>]/.exec(b)){var f=document.createElement("table");return f.innerHTML=b,f.firstChild}if(-1!==b.indexOf("<")){var g=document.createElement("div");return g.innerHTML=b,g.firstChild}var h=document.getElementById(a.item);if(h)return h}throw new Error("The list need to have at list one item on init otherwise you'll have to add a template.")},this.get=function(b,d){c.create(b);for(var e={},f=0,g=d.length;g>f;f++){var h;if(d[f].data)for(var i=0,j=d[f].data.length;j>i;i++)e[d[f].data[i]]=a.utils.getAttribute(b.elm,"data-"+d[f].data[i]);else d[f].attr&&d[f].name?(h=a.utils.getByClass(b.elm,d[f].name,!0),e[d[f].name]=h?a.utils.getAttribute(h,d[f].attr):""):(h=a.utils.getByClass(b.elm,d[f],!0),e[d[f]]=h?h.innerHTML:"");h=void 0}return e},this.set=function(b,d){var e=function(b){for(var c=0,d=a.valueNames.length;d>c;c++)if(a.valueNames[c].data){for(var e=a.valueNames[c].data,f=0,g=e.length;g>f;f++)if(e[f]===b)return{data:b}}else{if(a.valueNames[c].attr&&a.valueNames[c].name&&a.valueNames[c].name==b)return a.valueNames[c];if(a.valueNames[c]===b)return b}},f=function(c,d){var f,g=e(c);g&&(g.data?b.elm.setAttribute("data-"+g.data,d):g.attr&&g.name?(f=a.utils.getByClass(b.elm,g.name,!0),f&&f.setAttribute(g.attr,d)):(f=a.utils.getByClass(b.elm,g,!0),f&&(f.innerHTML=d)),f=void 0)};if(!c.create(b))for(var g in d)d.hasOwnProperty(g)&&f(g,d[g])},this.create=function(a){if(void 0!==a.elm)return!1;var d=b.cloneNode(!0);return d.removeAttribute("id"),a.elm=d,c.set(a,a.values()),!0},this.remove=function(b){b.elm.parentNode===a.list&&a.list.removeChild(b.elm)},this.show=function(b){c.create(b),a.list.appendChild(b.elm)},this.hide=function(b){void 0!==b.elm&&b.elm.parentNode===a.list&&a.list.removeChild(b.elm)},this.clear=function(){if(a.list.hasChildNodes())for(;a.list.childNodes.length>=1;)a.list.removeChild(a.list.firstChild)},d()};b.exports=function(a){return new d(a)}},{}],9:[function(a,b,c){function d(a){if(!a||!a.nodeType)throw new Error("A DOM element reference is required");this.el=a,this.list=a.classList}var e=a("./index-of"),f=/\s+/,g=Object.prototype.toString;b.exports=function(a){return new d(a)},d.prototype.add=function(a){if(this.list)return this.list.add(a),this;var b=this.array(),c=e(b,a);return~c||b.push(a),this.el.className=b.join(" "),this},d.prototype.remove=function(a){if("[object RegExp]"==g.call(a))return this.removeMatching(a);if(this.list)return this.list.remove(a),this;var b=this.array(),c=e(b,a);return~c&&b.splice(c,1),this.el.className=b.join(" "),this},d.prototype.removeMatching=function(a){for(var b=this.array(),c=0;cf;f++)void 0!==b[f]&&b[f].nodeName===b&&(c=b[f].nodeValue);return c}},{}],13:[function(a,b,c){b.exports=function(){return document.getElementsByClassName?function(a,b,c){return c?a.getElementsByClassName(b)[0]:a.getElementsByClassName(b)}:document.querySelector?function(a,b,c){return b="."+b,c?a.querySelector(b):a.querySelectorAll(b)}:function(a,b,c){var d=[],e="*";null===a&&(a=document);for(var f=a.getElementsByTagName(e),g=f.length,h=new RegExp("(^|\\s)"+b+"(\\s|$)"),i=0,j=0;g>i;i++)if(h.test(f[i].className)){if(c)return f[i];d[j]=f[i],j++}return d}}()},{}],14:[function(a,b,c){var d=[].indexOf;b.exports=function(a,b){if(d)return a.indexOf(b);for(var c=0;cr)return-1;if(r>s)return 1}for(var u=0,v=p.length,w=q.length,x=Math.max(v,w);x>u;u++){if(d=t(p[u],v),e=t(q[u],w),isNaN(d)!==isNaN(e))return isNaN(d)?1:-1;if(typeof d!=typeof e&&(d+="",e+=""),e>d)return-1;if(d>e)return 1}return 0}},{}],16:[function(a,b,c){function d(a){return"[object Array]"===Object.prototype.toString.call(a)}b.exports=function(a){if("undefined"==typeof a)return[];if(null===a)return[null];if(a===window)return[window];if("string"==typeof a)return[a];if(d(a))return a;if("number"!=typeof a.length)return[a];if("function"==typeof a&&a instanceof Function)return[a];for(var b=[],c=0;c0?setTimeout((function(){e(r,n,s)}),1):(t.update(),n(s))}}},"./src/filter.js":function(t){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,s=r.length;nv.page,a=new g(t[s],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}m(t.slice(0),e)}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,s=0,i=v.items.length;s-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r=v.i&&v.visibleItems.lengthe},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,s,i,a){return this.dottedLeft(t,e,r,n,s,i)||this.dottedRight(t,e,r,n,s,i,a)},dottedLeft:function(t,e,r,n,s,i){return e==r+1&&!this.innerWindow(e,s,i)&&!this.right(e,n)},dottedRight:function(t,e,r,n,s,i,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,i)&&!this.right(e,n))}};return function(e){var n=new i(t.listContainer.id,{listClass:e.paginationClass||"pagination",item:e.item||"
      • ",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});s.bind(n.listContainer,"click",(function(e){var r=e.target||e.srcElement,n=t.utils.getAttribute(r,"data-page"),s=t.utils.getAttribute(r,"data-i");s&&t.show((s-1)*n+1,n)})),t.on("updated",(function(){r(n,e)})),r(n,e)}}},"./src/parse.js":function(t,e,r){t.exports=function(t){var e=r("./src/item.js")(t),n=function(r,n){for(var s=0,i=r.length;s0?setTimeout((function(){e(r,s)}),1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=function(t){for(var e=t.childNodes,r=[],n=0,s=e.length;n]/g.exec(t)){var e=document.createElement("tbody");return e.innerHTML=t,e.firstElementChild}if(-1!==t.indexOf("<")){var r=document.createElement("div");return r.innerHTML=t,r.firstElementChild}}},a=function(e,r,n){var s=void 0,i=function(e){for(var r=0,n=t.valueNames.length;r=1;)t.list.removeChild(t.list.firstChild)},function(){var r;if("function"!=typeof t.item){if(!(r="string"==typeof t.item?-1===t.item.indexOf("<")?document.getElementById(t.item):i(t.item):s()))throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.");r=n(r,t.valueNames),e=function(){return r.cloneNode(!0)}}else e=function(e){var r=t.item(e);return i(r)}}()};t.exports=function(t){return new e(t)}},"./src/utils/classes.js":function(t,e,r){var n=r("./src/utils/index-of.js"),s=/\s+/;Object.prototype.toString;function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}t.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~n(e,t)||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=n(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},i.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(s);return""===t[0]&&t.shift(),t},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~n(this.array(),t)}},"./src/utils/events.js":function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"",a=r("./src/utils/to-array.js");e.bind=function(t,e,r,s){for(var o=0,l=(t=a(t)).length;o32)return!1;var a=n,o=function(){var t,r={};for(t=0;t=p;b--){var j=o[t.charAt(b-1)];if(C[b]=0===m?(C[b+1]<<1|1)&j:(C[b+1]<<1|1)&j|(v[b+1]|v[b])<<1|1|v[b+1],C[b]&d){var x=l(m,b-1);if(x<=u){if(u=x,!((c=b-1)>a))break;p=Math.max(1,2*a-c)}}}if(l(m+1,a)>u)break;v=C}return!(c<0)}},"./src/utils/get-attribute.js":function(t){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,s=n.length,i=0;i=48&&t<=57}function i(t,e){for(var i=(t+="").length,a=(e+="").length,o=0,l=0;o=i&&l=a?-1:l>=a&&o=i?1:i-a}i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return e},set:function(t){r=[];var s=0;if(e=t)for(;s 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.17.13) + ruby-enum (~> 0.5) + concurrent-ruby (1.1.7) + dnsruby (1.61.5) + simpleidn (~> 0.1) + em-websocket (0.5.2) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) + eventmachine (1.2.7) + execjs (2.7.0) + faraday (1.1.0) + multipart-post (>= 1.2, < 3) + ruby2_keywords + ffi (1.13.1) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (209) + github-pages-health-check (= 1.16.1) + jekyll (= 3.9.0) + jekyll-avatar (= 0.7.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.1.6) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.15.1) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.13.0) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.2) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.6.1) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.1.1) + jekyll-theme-cayman (= 0.1.1) + jekyll-theme-dinky (= 0.1.1) + jekyll-theme-hacker (= 0.1.2) + jekyll-theme-leap-day (= 0.1.1) + jekyll-theme-merlot (= 0.1.1) + jekyll-theme-midnight (= 0.1.1) + jekyll-theme-minimal (= 0.1.1) + jekyll-theme-modernist (= 0.1.1) + jekyll-theme-primer (= 0.5.4) + jekyll-theme-slate (= 0.1.1) + jekyll-theme-tactile (= 0.1.1) + jekyll-theme-time-machine (= 0.1.1) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.12.0) + kramdown (= 2.3.0) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.3) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.10.4, < 2.0) + rouge (= 3.23.0) + terminal-table (~> 1.4) + github-pages-health-check (1.16.1) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (~> 3.0) + typhoeus (~> 1.3) + html-pipeline (2.14.0) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.9.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.3.1) + commonmarker (~> 0.14) + jekyll (>= 3.7, < 5.0) + jekyll-commonmark-ghpages (0.1.6) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1.2) + rouge (>= 2.0, < 4.0) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.15.1) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) + octokit (~> 4.0, != 4.4.0) + jekyll-mentions (1.6.0) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.2) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.2) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.4) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.12.0) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + kramdown (2.3.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.3.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + mini_portile2 (2.5.0) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.14.2) + multipart-post (2.1.1) + nokogiri (1.11.1) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) + octokit (4.19.0) + faraday (>= 0.9) + sawyer (~> 0.8.0, >= 0.5.3) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (3.1.1) + racc (1.5.2) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.4) + rouge (3.23.0) + ruby-enum (0.8.0) + i18n + ruby2_keywords (0.0.2) + rubyzip (2.3.0) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + simpleidn (0.1.1) + unf (~> 0.1.4) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.8) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.7) + unicode-display_width (1.7.0) + zeitwerk (2.4.1) + +PLATFORMS + ruby + +DEPENDENCIES + github-pages + +BUNDLED WITH + 2.1.4 diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..592839e5 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +# listjs.com diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 00000000..302b3c25 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,21 @@ +title: List.js +email: jonny.stromberg@gmail.com +description: > # this means to ignore newlines until "baseurl:" + Perfect library for adding search, sort, filters and flexibility to tables, + lists and various HTML elements. Built to be invisible and work on existing HTML. +baseurl: "" # the subpath of your site, e.g. /blog +url: "https://listjs.com" # the base hostname & protocol for your site +twitter_username: javve +github_username: javve + +permalink: pretty +markdown: kramdown +livereload: true + +plugins: + - jekyll-coffeescript + - jekyll-redirect-from + +collections: + examples: + output: true diff --git a/docs/_data/pkg.json b/docs/_data/pkg.json new file mode 100644 index 00000000..f09bd26e --- /dev/null +++ b/docs/_data/pkg.json @@ -0,0 +1,69 @@ +{ + "name": "list.js", + "version": "2.3.1", + "description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML", + "keywords": [ + "list", + "search", + "sort", + "table", + "dom", + "html", + "ui" + ], + "author": { + "name": "Jonny Strömberg", + "email": "jonny.stromberg@gmail.com", + "url": "https://javve.com" + }, + "homepage": "https://listjs.com", + "repository": "git://github.com/javve/list.js.git", + "license": "MIT", + "bugs": { + "url": "https://github.com/javve/list.js/issues" + }, + "dependencies": { + "string-natural-compare": "^2.0.2" + }, + "devDependencies": { + "@babel/core": "^7.12.7", + "@babel/preset-env": "^7.12.7", + "babel-loader": "^8.2.1", + "jest": "^26.6.3", + "jquery": "^3.5.1", + "prettier": "^2.2.0", + "webpack": "^5.6.0", + "webpack-cli": "^4.2.0" + }, + "main": "src/index", + "engines": { + "node": "^6.0 || ^8.0 || ^10.0 || ^12.0 || >=14" + }, + "scripts": { + "test": "npx jest", + "build": "npx webpack", + "watch": "npx webpack --watch", + "watch-test": "npx jest --watch", + "preversion": "npm test && npm run build && cp dist/list.min.js docs/assets/javascripts/list.min.js && cp dist/list.min.js.map docs/assets/javascripts/list.min.js.map && git add dist && git add docs/assets/javascripts", + "postversion": "git push --follow-tags origin master && cp package.json docs/_data/pkg.json && git add docs/_data/pkg.json && git commit -m \"pkg.json update\"" + }, + "npmName": "list.js", + "npmFileMap": [ + { + "basePath": "/dist/", + "files": [ + "*.js", + "*.js.map" + ] + } + ], + "jest": { + "coverageDirectory": "./coverage/", + "collectCoverage": true, + "collectCoverageFrom": [ + "src/*.js", + "src/utils/*.js" + ], + "testURL": "http://localhost/" + } +} diff --git a/docs/_examples/add-get-remove.html b/docs/_examples/add-get-remove.html new file mode 100644 index 00000000..d764b4b5 --- /dev/null +++ b/docs/_examples/add-get-remove.html @@ -0,0 +1,9 @@ +--- +layout: default +name: Add, get, remove +title: Example to showcase the add, get and remove methods. +url: https://codepen.io/javve/pen/cLdfw +slug: cLdfw +--- + +{% include codepen.html %} diff --git a/docs/_examples/data-attributes-custom-attributes.html b/docs/_examples/data-attributes-custom-attributes.html new file mode 100644 index 00000000..22e1628f --- /dev/null +++ b/docs/_examples/data-attributes-custom-attributes.html @@ -0,0 +1,9 @@ +--- +layout: default +url: https://codepen.io/javve/pen/GZREaN +slug: GZREaN +title: Use data attributes and other custom attributes as keys +name: Data attributes + custom +--- + +{% include codepen.html %} diff --git a/docs/_examples/existing-list-add.html b/docs/_examples/existing-list-add.html new file mode 100644 index 00000000..46bc9e83 --- /dev/null +++ b/docs/_examples/existing-list-add.html @@ -0,0 +1,9 @@ +--- +layout: default +url: https://codepen.io/javve/pen/lAmCz +slug: lAmCz +title: Existing list and add items +name: Existing list and add +--- + +{% include codepen.html %} diff --git a/docs/_examples/existing-list.html b/docs/_examples/existing-list.html new file mode 100644 index 00000000..34adca62 --- /dev/null +++ b/docs/_examples/existing-list.html @@ -0,0 +1,9 @@ +--- +layout: default +url: https://codepen.io/javve/pen/zpuKF +slug: zpuKF +title: Basic example with existing list +name: Existing list +--- + +{% include codepen.html %} diff --git a/docs/_examples/fuzzy-search.html b/docs/_examples/fuzzy-search.html new file mode 100644 index 00000000..dc654f59 --- /dev/null +++ b/docs/_examples/fuzzy-search.html @@ -0,0 +1,9 @@ +--- +layout: default +name: Fuzzy search +title: Example of how to use the fuzzy search plugin +url: https://codepen.io/javve/pen/isInl +slug: isInl +--- + +{% include codepen.html %} diff --git a/docs/_examples/new-list.html b/docs/_examples/new-list.html new file mode 100644 index 00000000..990f5c58 --- /dev/null +++ b/docs/_examples/new-list.html @@ -0,0 +1,9 @@ +--- +layout: default +url: https://codepen.io/javve/pen/yroGq +slug: yroGq +title: Basic example with a new list +name: New list +--- + +{% include codepen.html %} diff --git a/docs/_examples/pagination.html b/docs/_examples/pagination.html new file mode 100644 index 00000000..35e4144f --- /dev/null +++ b/docs/_examples/pagination.html @@ -0,0 +1,9 @@ +--- +layout: default +name: Pagination +title: Example of how to use the pagination plugin +url: https://codepen.io/javve/pen/bBfgD +slug: bBfgD +--- + +{% include codepen.html %} diff --git a/docs/_examples/table.html b/docs/_examples/table.html new file mode 100644 index 00000000..fc759145 --- /dev/null +++ b/docs/_examples/table.html @@ -0,0 +1,9 @@ +--- +layout: default +url: https://codepen.io/javve/pen/oEezp +slug: oEezp +title: Example of how to use a table with List.js +name: Table +--- + +{% include codepen.html %} diff --git a/docs/_includes/author.html b/docs/_includes/author.html new file mode 100644 index 00000000..ee139f67 --- /dev/null +++ b/docs/_includes/author.html @@ -0,0 +1,22 @@ +
        + +
        + +

        Hi! I'm Jonny and the author of List.js.

        +

        + I hope you like the lib. I’ve put a lot of hours into it! + Feel free to follow me on Twitter and GitHub for news and donate a coffee for good karma ;) +

        + + + + +
        +
        diff --git a/docs/_includes/carbon.html b/docs/_includes/carbon.html new file mode 100644 index 00000000..aa09f87f --- /dev/null +++ b/docs/_includes/carbon.html @@ -0,0 +1 @@ + diff --git a/docs/_includes/codepen.html b/docs/_includes/codepen.html new file mode 100644 index 00000000..10e914d9 --- /dev/null +++ b/docs/_includes/codepen.html @@ -0,0 +1,10 @@ +

        {{ page.name }}

        +

        {{ page.title }}

        + + +

        + See the Pen {{ page.url }} by Jonny Strömberg (@javve) + on CodePen. +

        + \ No newline at end of file diff --git a/docs/_includes/examples/annotated-example.html b/docs/_includes/examples/annotated-example.html new file mode 100644 index 00000000..3c0b72e8 --- /dev/null +++ b/docs/_includes/examples/annotated-example.html @@ -0,0 +1,171 @@ +
        +

        Basic examples

        +

        + Here is an example of a list with List.js applied. List.js can be used in + three different ways. It can be on existing HTML, it can create it's own + HTML or a combination of both methods. +

        +
        + + + +
        +
        +

        Jonny Strömberg

        +

        1990

        +
        +
        +

        Jonas Arnklint

        +

        1985

        +
        +
        +

        Martina Elm

        +

        1986

        +
        +
        +

        Gustaf Lindqvist

        +

        1983

        +
        +
        +
        + +

        Apply List.js on existing HTML

        +
        +
        +
        <div id="users">
        +
        +<!-- class="search" automagically makes an input a search field. -->
        +  <input class="search" placeholder="Search" />
        +<!-- class="sort" automagically makes an element a sort buttons. The date-sort value decides what to sort by. -->
        +  <button class="sort" data-sort="name">
        +    Sort
        +  </button>
        +
        +<!-- Child elements of container with class="list" becomes list items -->
        +  <ul class="list">
        +    <li>
        +<!-- The innerHTML of children with class="name" becomes this items "name" value -->
        +      <h3 class="name">Jonny Stromberg</h3>
        +      <p class="born">1986</p>
        +    </li>
        +    <li>
        +      <h3 class="name">Jonas Arnklint</h3>
        +      <p class="born">1985</p>
        +    </li>
        +    <li>
        +      <h3 class="name">Martina Elm</h3>
        +      <p class="born">1986</p>
        +    </li>
        +    <li>
        +      <h3 class="name">Gustaf Lindqvist</h3>
        +      <p class="born">1983</p>
        +    </li>
        +  </ul>
        +
        +</div>
        +
        +
        +
        var options = {
        +  valueNames: [ 'name', 'born' ]
        +};
        +
        +var userList = new List('users', options);
        +
        +
        + +

        Apply List.js on existing HTML and then add items

        +
        +
        +
        <div id="users">
        +
        +  <input class="search" placeholder="Search" />
        +  <button class="sort" data-sort="name">
        +    Sort
        +  </button>
        +
        +  <ul class="list">
        +<!-- This, the first element in the list, will be used as template for new items. -->
        +    <li>
        +      <h3 class="name">Jonny Stromberg</h3>
        +      <p class="born">1986</p>
        +    </li>
        +  </ul>
        +
        +</div>
        +
        +
        +
        +
        var options = {
        +  valueNames: [ 'name', 'born' ]
        +};
        +
        +// These items will be added to the list on initialization.
        +var values = [
        +  {
        +    name: 'Jonas Arnklint',
        +    born: 1985
        +  },
        +  {
        +    name: 'Martina Elm',
        +    born: 1986
        +  }
        +];
        +
        +var userList = new List('users', options, values);
        +
        +// It's possible to add items after list been initiated
        +userList.add({
        +  name: 'Gustaf Lindqvist',
        +  born: 1983
        +});
        +
        +
        + + + +

        Make List.js create a list from scratch

        +
        +
        +
        <div id="users">
        +
        +  <input class="search" placeholder="Search" />
        +  <button class="sort" data-sort="name">
        +    Sort
        +  </button>
        +
        +  <ul class="list"></ul>
        +
        +</div>
        +
        +
        +
        var options = {
        +  valueNames: [ 'name', 'born' ],
        +  // Since there are no elements in the list, this will be used as template.
        +  item: '<li><h3 class="name"></h3><p class="born"></p></li>'
        +};
        +
        +var values = [
        +  {
        +    name: 'Jonny Strömberg',
        +    born: 1986
        +  },
        +  {
        +    name: 'Jonas Arnklint',
        +    born: 1985
        +  },
        +  {
        +    name: 'Martina Elm',
        +    born: 1986
        +  }
        +];
        +
        +var userList = new List('users', options, values);
        +
        +userList.add({
        +  name: 'Gustaf Lindqvist',
        +  born: 1983
        +});
        +
        +
        +
        +
        diff --git a/docs/_includes/javascripts/vendor/bootstrap/tab.js b/docs/_includes/javascripts/vendor/bootstrap/tab.js new file mode 100644 index 00000000..bdf8bbe9 --- /dev/null +++ b/docs/_includes/javascripts/vendor/bootstrap/tab.js @@ -0,0 +1,135 @@ +/* ======================================================================== + * Bootstrap: tab.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#tabs + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // TAB CLASS DEFINITION + // ==================== + + var Tab = function (element) { + this.element = $(element) + } + + Tab.prototype.show = function () { + var $this = this.element + var $ul = $this.closest('ul:not(.dropdown-menu)') + var selector = $this.data('target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + if ($this.parent('li').hasClass('active')) return + + var previous = $ul.find('.active:last a')[0] + var e = $.Event('show.bs.tab', { + relatedTarget: previous + }) + + $this.trigger(e) + + if (e.isDefaultPrevented()) return + + var $target = $(selector) + + this.activate($this.parent('li'), $ul) + this.activate($target, $target.parent(), function () { + $this.trigger({ + type: 'shown.bs.tab' + , relatedTarget: previous + }) + }) + } + + Tab.prototype.activate = function (element, container, callback) { + var $active = container.find('> .active') + var transition = callback + && $.support.transition + && $active.hasClass('fade') + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + + element.addClass('active') + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') + } else { + element.removeClass('fade') + } + + if (element.parent('.dropdown-menu')) { + element.closest('li.dropdown').addClass('active') + } + + callback && callback() + } + + transition ? + $active + .one($.support.transition.end, next) + .emulateTransitionEnd(150) : + next() + + $active.removeClass('in') + } + + + // TAB PLUGIN DEFINITION + // ===================== + + var old = $.fn.tab + + $.fn.tab = function ( option ) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tab') + + if (!data) $this.data('bs.tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tab.Constructor = Tab + + + // TAB NO CONFLICT + // =============== + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + + // TAB DATA-API + // ============ + + $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { + e.preventDefault() + $(this).tab('show') + }) + +}(window.jQuery); diff --git a/docs/_includes/javascripts/vendor/bootstrap/tooltip.js b/docs/_includes/javascripts/vendor/bootstrap/tooltip.js new file mode 100644 index 00000000..41375c6c --- /dev/null +++ b/docs/_includes/javascripts/vendor/bootstrap/tooltip.js @@ -0,0 +1,386 @@ +/* ======================================================================== + * Bootstrap: tooltip.js v3.0.0 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== + + var Tooltip = function (element, options) { + this.type = + this.options = + this.enabled = + this.timeout = + this.hoverState = + this.$element = null + + this.init('tooltip', element, options) + } + + Tooltip.DEFAULTS = { + animation: true + , placement: 'top' + , selector: false + , template: '
        ' + , trigger: 'hover focus' + , title: '' + , delay: 0 + , html: false + , container: false + } + + Tooltip.prototype.init = function (type, element, options) { + this.enabled = true + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + + var triggers = this.options.trigger.split(' ') + + for (var i = triggers.length; i--;) { + var trigger = triggers[i] + + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' + var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' + + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } + + Tooltip.prototype.getOptions = function (options) { + options = $.extend({}, this.getDefaults(), this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay + , hide: options.delay + } + } + + return options + } + + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) + + return options + } + + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) + + clearTimeout(self.timeout) + + self.hoverState = 'in' + + if (!self.options.delay || !self.options.delay.show) return self.show() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) + + clearTimeout(self.timeout) + + self.hoverState = 'out' + + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.'+ this.type) + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + var $tip = this.tip() + + this.setContent() + + if (this.options.animation) $tip.addClass('fade') + + var placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + var autoToken = /\s?auto?\s?/i + var autoPlace = autoToken.test(placement) + if (autoPlace) placement = placement.replace(autoToken, '') || 'top' + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(placement) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + + var pos = this.getPosition() + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (autoPlace) { + var $parent = this.$element.parent() + + var orgPlacement = placement + var docScroll = document.documentElement.scrollTop || document.body.scrollTop + var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() + var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() + var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left + + placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : + placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : + placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : + placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : + placement + + $tip + .removeClass(orgPlacement) + .addClass(placement) + } + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + + this.applyPlacement(calculatedOffset, placement) + this.$element.trigger('shown.bs.' + this.type) + } + } + + Tooltip.prototype.applyPlacement = function(offset, placement) { + var replace + var $tip = this.tip() + var width = $tip[0].offsetWidth + var height = $tip[0].offsetHeight + + // manually read margins because getBoundingClientRect includes difference + var marginTop = parseInt($tip.css('margin-top'), 10) + var marginLeft = parseInt($tip.css('margin-left'), 10) + + // we must check for NaN for ie 8/9 + if (isNaN(marginTop)) marginTop = 0 + if (isNaN(marginLeft)) marginLeft = 0 + + offset.top = offset.top + marginTop + offset.left = offset.left + marginLeft + + $tip + .offset(offset) + .addClass('in') + + // check to see if placing tip in new offset caused the tip to resize itself + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + replace = true + offset.top = offset.top + height - actualHeight + } + + if (/bottom|top/.test(placement)) { + var delta = 0 + + if (offset.left < 0) { + delta = offset.left * -2 + offset.left = 0 + + $tip.offset(offset) + + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + } + + this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') + } else { + this.replaceArrow(actualHeight - height, actualHeight, 'top') + } + + if (replace) $tip.offset(offset) + } + + Tooltip.prototype.replaceArrow = function(delta, dimension, position) { + this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') + } + + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + Tooltip.prototype.hide = function () { + var that = this + var $tip = this.tip() + var e = $.Event('hide.bs.' + this.type) + + function complete() { + if (that.hoverState != 'in') $tip.detach() + } + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one($.support.transition.end, complete) + .emulateTransitionEnd(150) : + complete() + + this.$element.trigger('hidden.bs.' + this.type) + + return this + } + + Tooltip.prototype.fixTitle = function () { + var $e = this.$element + if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') + } + } + + Tooltip.prototype.hasContent = function () { + return this.getTitle() + } + + Tooltip.prototype.getPosition = function () { + var el = this.$element[0] + return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) + } + + Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } + } + + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + Tooltip.prototype.tip = function () { + return this.$tip = this.$tip || $(this.options.template) + } + + Tooltip.prototype.arrow = function () { + return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') + } + + Tooltip.prototype.validate = function () { + if (!this.$element[0].parentNode) { + this.hide() + this.$element = null + this.options = null + } + } + + Tooltip.prototype.enable = function () { + this.enabled = true + } + + Tooltip.prototype.disable = function () { + this.enabled = false + } + + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled + } + + Tooltip.prototype.toggle = function (e) { + var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) + } + + Tooltip.prototype.destroy = function () { + this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) + } + + + // TOOLTIP PLUGIN DEFINITION + // ========================= + + var old = $.fn.tooltip + + $.fn.tooltip = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tooltip.Constructor = Tooltip + + + // TOOLTIP NO CONFLICT + // =================== + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(window.jQuery); diff --git a/docs/_includes/javascripts/vendor/bootstrap/transition.js b/docs/_includes/javascripts/vendor/bootstrap/transition.js new file mode 100644 index 00000000..d3a7abff --- /dev/null +++ b/docs/_includes/javascripts/vendor/bootstrap/transition.js @@ -0,0 +1,56 @@ +/* ======================================================================== + * Bootstrap: transition.js v3.0.0 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(window.jQuery); diff --git a/docs/_includes/javascripts/vendor/highlight.pack.js b/docs/_includes/javascripts/vendor/highlight.pack.js new file mode 100644 index 00000000..7ec26642 --- /dev/null +++ b/docs/_includes/javascripts/vendor/highlight.pack.js @@ -0,0 +1 @@ +var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(//gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+(q.parentNode?q.parentNode.className:"")).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("")}while(o!=u.node);r.splice(q,1);while(q'+M[0]+""}else{r+=M[0]}O=A.lR.lastIndex;M=A.lR.exec(L)}return r+L.substr(O)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return''+r.value+""}function K(){return A.sL!==undefined?z():H()}function J(M,r){var L=M.cN?'':"";if(M.rB){x+=L;w=""}else{if(M.eB){x+=l(r)+L;w=""}else{x+=L;w=r}}A=Object.create(M,{parent:{value:A}})}function D(L,r){w+=L;if(r===undefined){x+=K();return 0}var N=o(r,A);if(N){x+=K();J(N,r);return N.rB?0:r.length}var O=s(A,r);if(O){var M=A;if(!(M.rE||M.eE)){w+=r}x+=K();do{if(A.cN){x+=""}B+=A.r;A=A.parent}while(A!=O.parent);if(M.eE){x+=l(r)}w="";if(O.starts){J(O.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw new Error('Illegal lexem "'+r+'" for mode "'+(A.cN||"")+'"')}w+=r;return r.length||1}var G=e[E];f(G);var A=G;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(F);if(!u){break}q=D(F.substr(p,u.index-p),u[0]);p=u.index+q}D(F.substr(p));return{r:B,keyword_count:v,value:x,language:E}}catch(I){if(I.message.indexOf("Illegal")!=-1){return{r:0,keyword_count:0,value:l(F)}}else{throw I}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s,false);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"
        ")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v,true):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,a.REGEXP_MODE,{b:/;/,sL:"xml"}],r:0},{cN:"function",bWK:true,e:/{/,k:"function",c:[{cN:"title",b:/[A-Za-z$_][0-9A-Za-z$_]*/},{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/}]}}(hljs);hljs.LANGUAGES.css=function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,r:0,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%}",sL:"vbscript"},{cN:"tag",b:"",r:0,c:[{cN:"title",b:"[^ /><]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs); \ No newline at end of file diff --git a/docs/_includes/javascripts/vendor/jquery-1.8.3.min.js b/docs/_includes/javascripts/vendor/jquery-1.8.3.min.js new file mode 100644 index 00000000..83589daa --- /dev/null +++ b/docs/_includes/javascripts/vendor/jquery-1.8.3.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
        a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
        t
        ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
        ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
        ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

        ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
        ","
        "],thead:[1,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],col:[2,"","
        "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
        ","
        "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
        ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/docs/_includes/menu.html b/docs/_includes/menu.html new file mode 100755 index 00000000..79a81266 --- /dev/null +++ b/docs/_includes/menu.html @@ -0,0 +1,27 @@ +
        + +

        Overview

        + + +

        Documentation

        + + +

        Examples

        + +
        diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 00000000..b030ec6a --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,109 @@ + + + + + + + + + + + + {{ page.title }} - {{ site.title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        + {% include menu.html %} +
        + {{ content }} +
        +
        +
        + + + + {% include carbon.html %} + + + + +
        + + + + + + diff --git a/docs/_sass/_base.scss b/docs/_sass/_base.scss new file mode 100644 index 00000000..3919b171 --- /dev/null +++ b/docs/_sass/_base.scss @@ -0,0 +1,194 @@ +/** + * Basic styling + */ +body { + font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; + color: $text-color; + background-color: $background-color; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; + @include transition(background-color .2s ease-in-out); +} + + + +/** + * Set `margin-bottom` to maintain vertical rhythm + */ +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +ul, ol, dl, figure, +%vertical-rhythm { + margin-top:0; + margin-bottom: $spacing-unit / 2; +} + + + +/** + * Images + */ +img { + max-width: 100%; + vertical-align: middle; +} + + + +/** + * Figures + */ +figure > img { + display: block; +} + +figcaption { + font-size: $small-font-size; +} + + + +/** + * Lists + */ +ul, ol { + margin-left: $spacing-unit; +} + +li { + > ul, + > ol { + margin-bottom: 0; + } +} + + + +/** + * Headings + */ +h1, h2, h3, h4, h5, h6 { + font-family: $headline-font-family; + font-weight: $headline-font-weight; +} + + + +/** + * Links + */ +a { + color: $brand-color; + text-decoration: none; + + &:visited { + color: darken($brand-color, 15%); + } + + &:hover { + color: $text-color; + text-decoration: underline; + } +} + + + +/** + * Blockquotes + */ +blockquote { + color: $grey-color; + border-left: 4px solid $grey-color-light; + padding-left: $spacing-unit / 2; + font-size: 18px; + letter-spacing: -1px; + font-style: italic; + + > :last-child { + margin-bottom: 0; + } +} + + + +/** + * Code formatting + */ +pre, +code { + font-size: 15px; + border: 1px solid $grey-color-light; + border-radius: 3px; + background-color: #eef; +} + +code { + padding: 1px 5px; +} + +pre { + padding: 8px 12px; + overflow-x: auto; + + > code { + border: 0; + padding-right: 0; + padding-left: 0; + } +} + + + +/** + * Wrapper + */ +.wrapper { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2)); + max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); + margin-right: auto; + margin-left: auto; + padding-right: $spacing-unit; + padding-left: $spacing-unit; + @extend %clearfix; + + @include media-query($on-laptop) { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit})); + max-width: calc(#{$content-width} - (#{$spacing-unit})); + padding-right: $spacing-unit / 2; + padding-left: $spacing-unit / 2; + } +} + +.content-container { + background-color: #fff; + box-sizing: border-box; + max-width: $content-width; + margin:- $spacing-unit auto $spacing-unit; +} +.content { + @include transition(all .2s ease-in-out); + padding: $spacing-unit; + @include media-query($on-laptop) { + padding:$spacing-unit * 2; + } + &:after { + content: ""; + display: table; + clear: both; + } +} + +.image-shadow-box { + border: solid $spacing-unit / 2 #fff; + box-shadow: 5px 10px 40px rgba(0,0,0,.3); +} +.image-right-50 { + float:right; + margin-left:$spacing-unit * 2; + margin-bottom:$spacing-unit; + max-width: 45%; +} diff --git a/docs/_sass/_carbonads.scss b/docs/_sass/_carbonads.scss new file mode 100644 index 00000000..8c98d2cf --- /dev/null +++ b/docs/_sass/_carbonads.scss @@ -0,0 +1,114 @@ +@keyframes fadein { + from { + transform: translateY(100%); + opacity: 0; + } + to { + opacity: 1; + transform: translateY(0); + } +} +@-moz-keyframes fadein { + from { + transform: translateY(100%); + opacity: 0; + } + to { + opacity: 1; + transform: translateY(0); + } +} +@-webkit-keyframes fadein { + from { + transform: translateY(100%); + opacity: 0; + } + to { + opacity: 1; + transform: translateY(0); + } +} +@-ms-keyframes fadein { + from { + transform: translateY(100%); + opacity: 0; + } + to { + opacity: 1; + transform: translateY(0); + } +} +@-o-keyframes fadein { + from { + transform: translateY(100%); + opacity: 0; + } + to { + opacity: 1; + transform: translateY(0); + } +} + +#carbonads { + position: fixed; + z-index: 10000; + right: 0; + bottom: 0; + opacity: 0; + transform: translateY(100%); + -webkit-animation: fadein 1s 2s forwards; + -moz-animation: fadein 1s 2s forwards; + -ms-animation: fadein 1s 2s forwards; + -o-animation: fadein 1s 2s forwards; + animation: fadein 1s 2s forwards +} + +#carbonads { + display: block; + overflow: hidden; + padding: 1em; + background-color: hsla(0, 0%, 100%, .88); + max-width: 330px; + box-shadow: 0 0 1px 0 hsla(0, 0%, 0%, .6); + font-size: 14px; + border-top-left-radius: 4px; + line-height: 1.5; +} + +#carbonads a { + text-decoration: none; +} + +#carbonads span { + position: relative; + display: block; + overflow: hidden; +} + +.carbon-img { + float: left; + margin-right: 1em; +} + +.carbon-img img { + display: block; +} + +.carbon-text { + display: block; + float: left; + max-width: calc(100% - 130px - 1em); + text-align: left; +} + +.carbon-poweredby { + position: absolute; + right: 0; + bottom: 0; + display: block; + font-size: 10px; + color: hsl(0, 0%, 60%); + text-transform: uppercase; + line-height: 1; + letter-spacing: 1px; +} diff --git a/docs/_sass/_docs.scss b/docs/_sass/_docs.scss new file mode 100644 index 00000000..04a99b25 --- /dev/null +++ b/docs/_sass/_docs.scss @@ -0,0 +1,111 @@ +.docs { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +.docs-menu { + background-color:$blue; + max-width: $menuWidth; + position: relative; + padding: 0 20px; + box-sizing: border-box; + flex: 1; + + a { + transition: opacity .2s ease-in-out; + color:#fff; + text-decoration: none; + &:hover { + opacity: 0.7; + color:#fff; + } + } + ul { + padding-left:20px; + color:rgba(255,255,255,0.3); + } + li { + margin-bottom:4px; + &.active { + font-weight: 700; + color:#fff; + } + } +} + +.docs-content { + position: relative; + color:#555; + padding:30px; + box-sizing: border-box; + + flex: 1; + + h2:first-child { + margin-top: 0; + } + p, h1, h2, h3, h4, h5 { + max-width: 500px; + } + p { + line-height: 1.5; + } + ul { + padding-left:30px; + pre { + margin-left:-60px; + padding-left:60px; + } + ul pre { + margin-left:-90px; + padding-left:90px; + } + } + strong, b { + color:#222; + font-weight: bold; + } + pre { + background-color: $lightGrey; + padding:20px 30px; + margin:0 -30px 1px; + code { + background-color: transparent; + } + } + li { + margin-bottom:5px; + } + .api-index { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + margin:0; + padding:0; + li { + list-style-type: none; + margin-bottom: 0; + } + } +} +.docs-parameter-description { + color:#999; + font-size:80%; +} + +.docs-top { + display:none; + border-bottom:solid 1px $lightGrey; + padding:20px; + .docs-top-title { + font-size: 50px; + font-size: 5rem; + color:$orange; + font-weight:700; + margin:0; + } +} diff --git a/docs/_sass/_menu.scss b/docs/_sass/_menu.scss new file mode 100644 index 00000000..9a4b680e --- /dev/null +++ b/docs/_sass/_menu.scss @@ -0,0 +1,87 @@ +@-webkit-keyframes pluse { + 0% { + -webkit-transform: scale(1); + } + 80% { + -webkit-transform: scale(1.2); + } + 100% { + -webkit-transform: scale(1); + } +} +@keyframes pluse { + 0% { + transform: scale(1); + } + 80% { + transform: scale(1.2); + } + 100% { + transform: scale(1); + } +} + +.menu { + padding:0 20px; + z-index: 100; + //margin-top:-80px; + //margin-bottom:40px; + margin:0; + background-color: $black; + + .heart { + -webkit-animation: pluse 1.4s infinite linear; + animation: pluse 1.4s infinite linear; + position:relative; + top:2px; + right:-3px; + display: inline-block; + } + + ul { + display:block; + margin:0; + padding:0; + } + li { + display:inline-block; + margin:0 10px 0 0; + } + a { + line-height:60px; + display: inline-block; + text-decoration: none; + font-weight: 600; + color:#fff; + &:hover, + &.active { + color:#eee; + } + &.active { + font-weight: 500; + color:$black; + } + } +} + +.menu-sub { + margin:-40px 0 20px; + color: #ccc; + background-color:$lightGrey; + font-size:14px; + font-size:1.4rem; + @extend %clearfix; + ul { + padding: 15px 0 13px; + margin:0; + } + li { + display: inline-block; + margin-right:20px; + &.active { + a { + color:#222; + } + } + } +} diff --git a/docs/_sass/_mixins.scss b/docs/_sass/_mixins.scss new file mode 100644 index 00000000..eb4208ae --- /dev/null +++ b/docs/_sass/_mixins.scss @@ -0,0 +1,19 @@ +%clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin media-query($device) { + @media screen and (min-width: $device) { + @content; + } +} + + +@mixin transition($value){ + -webkit-transition: $value; + transition: $value; +} diff --git a/docs/_sass/_normalize.scss b/docs/_sass/_normalize.scss new file mode 100644 index 00000000..c2de8df9 --- /dev/null +++ b/docs/_sass/_normalize.scss @@ -0,0 +1,406 @@ +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined in IE 8/9. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 8/9. + */ + +audio, +canvas, +video { + display: inline-block; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9. + * Hide the `template` element in IE, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background: transparent; +} + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Correct font family set oddly in Safari 5 and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre-wrap; +} + +/** + * Set consistent quote types. + */ + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9. + */ + +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari 5. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Correct font family not being inherited in all browsers. + * 2. Correct font size not being inherited in all browsers. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ + +button, +input, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/docs/_sass/vendor/highlight/xcode.scss b/docs/_sass/vendor/highlight/xcode.scss new file mode 100644 index 00000000..0f4e851d --- /dev/null +++ b/docs/_sass/vendor/highlight/xcode.scss @@ -0,0 +1,156 @@ +/* + +XCode style (c) Angel Garcia + +*/ + +pre code { + display: block; padding: 0.5em; + background: #fff; color: black; +} + +pre .comment, +pre .template_comment, +pre .javadoc, +pre .comment * { + color: rgba(0, 0, 0, 0.27); +} + +pre .keyword, +pre .literal, +pre .nginx .title { + color: rgb(170,13,145); +} +pre .method, +pre .list .title, +pre .tag .title, +pre .setting .value, +pre .winutils, +pre .tex .command, +pre .http .title, +pre .request, +pre .status { + color: #008; +} + +pre .envvar, +pre .tex .special { + color: #660; +} + +pre .string { + color: rgb(196,26,22); +} +pre .tag .value, +pre .cdata, +pre .filter .argument, +pre .attr_selector, +pre .apache .cbracket, +pre .date, +pre .regexp { + color: #080; +} + +pre .sub .identifier, +pre .pi, +pre .tag, +pre .tag .keyword, +pre .decorator, +pre .ini .title, +pre .shebang, +pre .prompt, +pre .hexcolor, +pre .rules .value, +pre .css .value .number, +pre .symbol, +pre .symbol .string, +pre .number, +pre .css .function, +pre .clojure .title, +pre .clojure .built_in, +pre .function .title, +pre .coffeescript .attribute { + color: rgb(28,0,207); +} + +pre .class .title, +pre .haskell .type, +pre .smalltalk .class, +pre .javadoctag, +pre .yardoctag, +pre .phpdoc, +pre .typename, +pre .tag .attribute, +pre .doctype, +pre .class .id, +pre .built_in, +pre .setting, +pre .params, +pre .clojure .attribute { + color: rgb(92,38,153); +} + +pre .variable { + color: rgb(63,110,116); +} +pre .css .tag, +pre .rules .property, +pre .pseudo, +pre .subst { + color: #000; +} + +pre .css .class, pre .css .id { + color: #9B703F; +} + +pre .value .important { + color: #ff7700; + font-weight: bold; +} + +pre .rules .keyword { + color: #C5AF75; +} + +pre .annotation, +pre .apache .sqbracket, +pre .nginx .built_in { + color: #9B859D; +} + +pre .preprocessor, +pre .preprocessor * { + color: rgb(100,56,32); +} + +pre .tex .formula { + background-color: #EEE; + font-style: italic; +} + +pre .diff .header, +pre .chunk { + color: #808080; + font-weight: bold; +} + +pre .diff .change { + background-color: #BCCFF9; +} + +pre .addition { + background-color: #BAEEBA; +} + +pre .deletion { + background-color: #FFC8BD; +} + +pre .comment .yardoctag { + font-weight: bold; +} + +pre .method .id { + color: #000; +} diff --git a/docs/api.html b/docs/api.html new file mode 100755 index 00000000..ee045f4a --- /dev/null +++ b/docs/api.html @@ -0,0 +1,395 @@ +--- +layout: default +title: List API +redirect_from: + - /docs/list-api + - /docs/options +--- + +

        + + List API +

        + +

        Options

        + + +

        Properties

        + + + +

        Methods

        + + +

        + + Options +

        +

        Using List.js is pretty much plug and play, but you can change some options if you feel like it.

        +
        new List(id/element, options, values);
        + +
          +
        • + id or element *required
          + Id the element in which the list area should be initialized. OR the actual element itself. +
        • +
        • +

          options Object, default: undefined
          +Some of the option parameters are required at some times

          + +
            +
          • +

            valueNames Array, default: null. *required
            +If the list contains items on initialization, then this array +has to contain the value names (class names) for the different values of +each list item.

            + +
            <ul class="list">
            +    <li>
            +        <span class="name">Jonny</span>
            +        <span class="city">Sundsvall</span>
            +    </li>
            +</ul>
            +
            +var valueNames = ['name', 'city'];
            +
            + +
            <ul class="list">
            + <li data-id="1">
            +   <a href="http://javve.com" class="link name">Jonny</a>
            +   <p class="born timestamp" data-timestamp="1234">1986</p>
            +   <img class="image" src="javve.jpg" />
            + </li>
            +</ul>
            +
            +var valueNames =  [
            +  'name',
            +  'born',
            +  { data: ['id'] },
            +  { name: 'timestamp', attr: 'data-timestamp' },
            +  { name: 'link', attr: 'href' },
            +  { name: 'image', attr: 'src' }
            +];
            + +
          • +
          • +

            item String, default: undefined
            +ID to item template element or a string of HTML. Can also be a function which receives a values object and which must return the complete item's HTML as a string.

            + +
            var options = {
            +    item: "<li><span class='name'></span><span class='city'></span></li>"
            +}
            +// or
            +var options = {
            +    item: 'cool-item-id'
            +};
            +// or
            +var options = {
            +    item: function(values) {
            +      return `<li><span class='name'>${values.name}</span><span class='city'>${values.city}</span></li>`;
            +    }
            +};
            +
            +
          • +
          • listClass String, default: "list"
            +What is the class of the list-container?

          • +
          • searchClass String, default: "search"
            +What is the class of the search field?

          • +
          • searchColumns Array of strings, default: undefined
            +Restrict searching to just these column names? Default is to search all columns.

          • +
          • searchDelay Int default: 0
            +Delay in milliseconds after last keypress in search field before search starts. 250→750 is good for very large lists.

          • +
          • sortClass String, default: "sort"
            +What is the class of the sort buttons?

          • +
          • indexAsync Boolean, default: false
            +If there are already items in the list to which the +List.js-script is added, then should the indexing be done +in a asynchronous way? Good for large lists (> 500 items).

          • +
          • page Int, default: 200
            +Defines how many items that should be visible at the same time. This affects +performance.

          • +
          • i Int, default: 1
            +Which item should be shown as the first one.

          • +
          • pagination Boolean, default: undefined
            +Read more here.

          • +
          +
        • +
        • values Array of objects, default: undefined
          +Values to add to the list on initialization.

        • +
        + + +

        Properties

        + +
          +
        • +

          + listContainer + Element
          + The element node that contains the entire list area. +

          +
        • +
        • +

          + list + Element
          + The element containing all items. +

          +
        • +
        • +

          + items + Array
          + An Array of all Item-objects in the list. +

          +
        • +
        • +

          + visibleItems + Array
          + The currently visible items in the list +

          +
        • +
        • +

          + matchingItems + Array
          + The items matching the currently active filter and search. +

          +
        • +
        • +

          + searched + Boolean
          + Returns true if the list is searched. +

          +
        • +
        • +

          + filtered + Boolean
          + Returns true if there is an active filter. +

          +
        • +
        + +

        Methods

        + +
          +
        • +

          add(values, callback)
          + Adds one or more items to the list.

          + +
          listObj.add({ name: "Jonny", city: "Stockholm" });
          +
          +listObj.add([
          +{ name: "Gustaf", city: "Sundsvall" }
          +, { name: "Jonas", city: "Berlin" }
          +]);
          + +

          If callback is set then items are added to the list in a asynchronous way, and the + callback is called when all items are added. This is especially useful + when adding very many items (200+ or something), or if you just like the + asynchronous coding style.

          + +
          listObj.add(arrayWithManyManyItems, function(items) {
          +console.log('All ' + items.length + ' were added!');
          +});
          +
        • +
        • +

          remove(valueName, value)
          + Removes items from the list where the value named valueName has value value. + Returns the number of items that where removed.

          + +
          itemsInList = [
          +{ id: 1, name: "Jonny" }
          +, { id: 2, name "Gustaf" }
          +];
          +listObj.remove("id", 1); // return 1
          +
        • +
        • +

          get(valueName, value)
          + Returns values from the list where the value named valueName has value value.

          + +
          itemsInList = [
          +{ id: 1, name: "Jonny" }
          +, { id: 2, name "Gustaf" }
          +];
          +listObj.get("id", 2); // return { id: 2, name "Gustaf" }
          +
        • +
        • +

          sort(valueName, {
          +   order: 'desc',
          +   alphabet: undefined,
          +   insensitive: true,
          +   sortFunction: undefined
          + })

          + Sorts the list based on values the in the column named valueName. + The alphabet option is used when you have non-english alphabet + where which JavaScript don't know how to sort some characters by default.

          +

          The default sort function is found here + https://github.com/nwoltman/string-natural-compare, + if you want to use your own, read the code and + check out the tests.

          + +
          listObj.sort('name', { order: "asc" }); // Sorts the list in abc-order based on names
          +listObj.sort('name', { order: "desc" }); // Sorts the list in zxy-order based on names
          +
          +// Sort swedish characters correcly, case-insensitive.
          +listObj.sort('name', { alphabet: "ABCDEFGHIJKLMNOPQRSTUVXYZÅÄÖabcdefghijklmnopqrstuvxyzåäö" });
          +
          +// Sort swedish characters correcly, case-sensitive.
          +listObj.sort('name', { alphabet: "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZzÅåÄäÖö" });
          +
          +// Alphabet could also be on the actual listObj via
          +listObj.alphabet = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZzÅåÄäÖö";
          +
          + +
        • +
        • +

          search(searchString, columns, searchFunction)
          + Searches the list

          + +
          itemsInList = [
          +{ id: 1, name: "Jonny Stromberg", born: 1986 }
          +, { id: 2, name "Jonas Arnklint", born: 1985 }
          +, { id: 3, name "Martina Elm", born: 1986 }
          +, { id: 4, name "Gustaf Lindqvist", born: 1983 }
          +, { id: 5, name "Jonny Strandberg", born: 1990 }
          +];
          +
          +listObj.search('Jonny'); // Only items with name Jonny are shown (also returns these items)
          +
          +listObj.search(); // Show all items in list
          +
          +listObj.search('Jonny', ['name']); // Only search in the 'name' column
          + +

          Space-separated words match in any order using logical AND. Surround a phrase in quotes for exact matches:

          + +
          listObj.search('Jon 198'); // Items that match Jon AND 198
          +
          +listObj.search('"Jonny S" 1990'); // Items that match "Jonny S" AND 1990
          + +

          Optionally your own search function can be used:

          + +
          listObj.search('Jonny', searchFunction); // Custom search for Jonny
          +
          +listObj.search('Jonny', ['name'], searchFunction); // Custom search in the 'name' column
          +
          +function searchFunction(searchString, columns) {
          +  for (var k = 0, kl = listObj.items.length; k < kl; k++) {
          +     listObj.items[k].found = false;
          +     // Insert your custom search logic here, set found = true
          +
          +  }
          +};
          + +
        • +
        • +

          clear()
          + Removes all items from the list

          +
        • +
        • +

          filter(filterFunction)

          + +
          itemsInList = [
          +{ id: 1, name: "Jonny" }
          +, { id: 2, name "Gustaf" }
          +, { id: 3, name "Jonas" }
          +];
          +
          +listObj.filter(function(item) {
          +if (item.values().id > 1) {
          +   return true;
          +} else {
          +   return false;
          +}
          +}); // Only items with id > 1 are shown in list
          +
          +listObj.filter(); // Remove all filters
          + +
        • +
        • +

          size()
          + Returns the size of the list.

          +
        • +
        • +

          show(i, page)
          + Shows page number of items from i. Use for paging etc.

          + +
          itemsInList = [
          +{ id: 1, name: "Jonny" }
          +, { id: 2, name "Gustaf" }
          +, { id: 3, name "Jonas" }
          +, { id: 4, name "Egon" }
          +, { id: 5, name "Frank" }
          +, { id: 6, name "Ester" }
          +];
          +
          +listObj.show(4, 3); // Display item 4,5,6 
          + +
        • +
        • +

          update()
          + Updates the current state of the list. Meaning that if you for instance + hides some items with the itemObj.hide() method then you have to call listObj.update() + if you want the paging to update.

          +
        • +
        • +

          reIndex()
          + Re-index list from HTML. Good to use if the HTML has been changed by something + else than List.js.

          +
        • +
        • +

          fuzzySearch()
          + Read more here

          +
        • +
        • +

          on(event, callback)
          + Execute callback when list have been updated (triggered by update(), which is used by a lot of methods). Use updated as the event.

          +

          Avaliable events

          +
            +
          • updated
          • +
          • searchStart
          • +
          • searchComplete
          • +
          • filterStart
          • +
          • filterComplete
          • +
          • sortStart
          • +
          • sortComplete
          • +
          +
        • +
        diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss new file mode 100644 index 00000000..d856fbf2 --- /dev/null +++ b/docs/assets/css/style.scss @@ -0,0 +1,554 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- + +$blue: #28a8e0; +$green: #6cd25e; +$grey: #555; +$orange: #f59621; +$lightGrey: #edf4f4; +$black: #2e2e2e; + +$menuWidth: 250px; + + +@import "normalize"; +@import "mixins"; +@import "vendor/highlight/xcode"; +@import "carbonads"; +@import "menu"; +@import "docs"; + +/* * * * * * * * * * * * * * * * * * * * * +* General +* * * * * * * * * * * * * * * * * * * * */ +html { + font-size: 62.5%; +} + +body { + background-color:#fff; + font-size:16px; + font:400 1.6rem/1.4 'source sans pro', 'helvetica neue', helvetica, arial; + color:$grey; + padding:0; //80px 0 150px; +} + +a { + color:$blue; + &:hover { + color:darken($blue, 10%); + } +} +p { + font-size: 16px; + font-size:1.6rem; + line-height:1.3; + strong, b { + color:darken($grey, 20%); + font-weight: 500; + } +} +h1 { + font-size: 50px; + font-size: 5rem; + color:$orange; + font-weight:400; + margin:0 0 30px; +} +h2 { + font-size: 30px; + font-size:3rem; + color:$black; + font-weight:400; +} +h3 { + font-weight:600; + font-size:2rem; + margin-bottom:10px; + color:$black; +} +h4 { + font-weight:600; + font-size: 16px; + font-size:1.6rem; + margin-bottom:10px; + color:$black; +} + +.btn { + font-size: 18px; + font-size: 1.8rem; + padding:8px 30px; + border-radius: 6px; + border:solid 2px $blue; + display:inline-block; + color:$blue; + text-decoration: none; + + &.btn-primary { + border-color:$blue; + background-color: $blue; + color:#fff; + font-weight: 500; + &:hover { + background-color: darken($blue, 10%); + color:#eee; + } + } +} +.btn:hover { + text-decoration: none; + color:darken($blue, 10%); + border-color:darken($blue, 10%); +} +.donate-form { + display:inline-block; + margin-left:5px; +} +.donate { + border:none; + background:none; + padding:0; + margin:0 10px 0 0; + float:left; + span { + // #gradient > .vertical(#fafafa, #eaeaea); + border: 1px solid #b7b7b7; + border-bottom-color: #888; + display:block; + padding: 2px 5px 2px 4px; + color: #111; + text-decoration: none; + text-shadow: 0 1px 0 #fff; + white-space: nowrap; + cursor: pointer; + border-radius: 3px; + font: bold 11px/14px "Helvetica Neue",Helvetica,Arial,sans-serif; + padding-left:20px; + position:relative; + &:hover { + color:#fff; + text-decoration: none; + background-color:$blue; + text-shadow: 0 1px 0 darken($blue, 20%); + background-image:none; + border-color:darken($blue, 10%); + } + &:before { + content:" "; + display: block; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMyOUYyMjMyNTAzNDExRTM4RjkxRjY4OERCMDI3N0ZEIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjMyOUYyMjMzNTAzNDExRTM4RjkxRjY4OERCMDI3N0ZEIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzI5RjIyMzA1MDM0MTFFMzhGOTFGNjg4REIwMjc3RkQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzI5RjIyMzE1MDM0MTFFMzhGOTFGNjg4REIwMjc3RkQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6BnPLgAAAENklEQVR42tRVTUxjVRT+3usr7WtLy//wV0YIIFBLJwYNkChOnGCMCZMYEo2uTMRodKFxdi5cqUwMKxdG3ao4sxuTyWAwJIoybQBxhkmGQAoMM/xJSynQn9f29fndpyXMj8bNLDzJyXt9997vnvOd75xKhmHgYZiMh2TKvR80TauOx+PuWCxWmclkLJIk5elWukpbLS8vX3Y6nZLFYkn9J+Ctra1HQ6HQe0tLSy+n05rHZrfDoapQHQ5YrVbIkgRJlpDP5zN2m22+qanpemtr65jL5brM44l7gSXBcTAYfH109LuvVKcLrS0tKCku5kIOei6FXCYBxWKF010Kt6cMqsuNREpDOBzmehb9/f3nvF7vyH3Aa2trJz45f36rvs4Lh5zByo0gbi0vIBb5A6mshlwuL7bBYpGh2uyoqj2J9s4n0P3M89AMBalkQvf7/V8uLi4u2Gy2+q6uri9qamrWpWAo9NTFCxd/jqzewOK1n2Dk09AJlaNYstm7q0w2TLfSVacHz734GvxPnsby8rK5J5Vihrnc7aGhoReUvJ5HW2sTLvxyGdE4QY2/DjNI6Lr5+Du3Y+/cY0nGMRsK4sTJdtR7vR+fHRj4TNf1V4aHh0fm5uYSCjnOO1wefPr51/j+0iVM/HAFG2thxON7BDIgGyYODAEsW1BWVomGphY8ffoMfIEAZmd/g+8xf5gFztO/kWV5JJvNHiqVlRWYn78Om13Fu++fw1tvv4M7t29hZWUVWlrD4T4vkGS43B4U2YrAQsGuOnBwcIjV1RVmleNlvA2IRiKRwObmJnp7e8sV6lJUB3t7e6A+4XIVo8PnR+epxykx2cybEiPfWSQSScRiu9jd3eX7ockpQdHY2HiHmZeNj4+fKaaiOjs70woXbtI/2tnZ+aC0tJTRSWYUQrtsAgg5siBgsyCZTJouLiGf5tPn84kLuiYmJl6amZl5dnBwcKCqqmrT1PHCwoI0PT291tzcXF9SUgI7m6OoqOgIWACwI80IC+AHBwdgMGhrawtTFdsbGxuRnp6eN/v6+jaPGkTY2NiYO51OX6muru51sNsURTkCFtEJYOHcQxoSJh288GpFRcWHHo8nzaCm6+rqNGZs3NXSHR0d6cnJyeT6+rrJG8UOVvgIuECHiDoajWJ/fx/t7e3XyOePTF0EYSWMo9De0vGxydY+Rb/KaO2MxKSkAC6iFZFub2+bVLDbRgOBwKsClBnaeUbl3t0HTrfu7u7fOdW6WIRfOYw84psoolCFoEA4h44A/bahoeENqkgmIPHkDD113xASxjRlFsyU3tTUlEpgC+eIypQbSMUjXNNra2unOdWi1LLMSA23281BZ9MInnzgdCsYAWzkSiv8ZrUlMZO5Ryef5kY2gRjMQjViJnOampb9V+DjxkvMNbpdzH9RbboAEsM/W6j+P5n0v/vP+1OAAQAqLhyT7hjz3gAAAABJRU5ErkJggg==); + + background-repeat: no-repeat; + background-size: 14px; + width:14px; + height:14px; + z-index: 1; + position: absolute; + left:3px; + top:3px; + } + } +} +.donate-pixel { + position: absolute; +} + +table { + border-collapse:collapse; + width:100%; + margin-bottom:10px; +} +th { + background-color:rgba(0,0,0,.1); + border:solid 1px rgba(255,255,255,.1); + padding:10px 10px; + text-align:left; + font-weight: bold; + color:#ddd +} +td { + padding:10px 10px; + border:solid 1px rgba(255,255,255,.1); +} + + +.example-header { + margin-bottom:15px; + h1 { + margin-bottom:0; + } + p { + margin-top:10px; + } +} + +.continue { + margin-top: 30px; + border-top: solid 1px #eee; + padding-top: 15px; + text-align: right; + font-weight: bold; + color: #222; +} + +.footer { + //position: fixed; + //bottom:0; + clear:both; + width:100%; + height:20px; + padding:20px 0; + background-color:#111; + text-align: center; + a { + color:#fff; + &:hover { + color:$lightGrey; + } + } + .misc-share-button { + display: inline-block; + height: 20px; + overflow: hidden; + } + .tweet { + width:100px; + } + .facebook { + width:90px; + .fb_iframe_widget span { + vertical-align: top !important; + } + } +} + +/* * * * * * * * * * * * * * * * * * * * * +* Start page +* * * * * * * * * * * * * * * * * * * * */ + +.intro { + @extend %clearfix; + margin:0 auto; + max-width: 900px; + padding:80px; + box-sizing: border-box; + .intro-logo { + text-align: center; + img { + max-width: 80%; + } + float: left; + width:30%; + } + .intro-text { + float: left; + width:70%; + h1 { + font-size: 72px; + font-size: 7.2rem; + margin: 0 0 1px; + small { + font-size: 30px; + font-size: 3rem; + color:lighten($grey, 20%); + } + } + h2 { + font-size: 25px; + font-size: 2.5rem; + font-weight: 300; + margin: 0 0 25px; + color:lighten($grey, 20%); + a { + font-weight: 500; + } + em { + color:darken($grey, 20%); + } + } + .btn { + margin-right:10px; + } + } +} + +.misc { + @extend %clearfix; + clear:both; + background-color:$lightGrey; + padding:30px; + margin:30px -30px; + color:#333; + h3 { + margin:0 0 5px; + } + .misc-share { + margin-bottom:5px; + } + .misc-author { + .misc-author-pic { + float:left; + margin-right:20px; + border-radius: 5px; + } + h4 { + margin-top:0; + margin-bottom: 4px; + } + p { + font-size: 14px; + font-size:1.4rem; + color:lighten($black, 10%); + margin-top:0; + margin-bottom: 10px; + } + } +} +// .loaded .misc-carbon:before & { +// content:"Everytime you hide an ad... An open source developer goes to go to bed instead of buying a coffee :'(\A <--- Cheat? Donate! :D"; +// white-space: pre-wrap; +// width:260px; +// display: block; +// text-align: center; +// left:20px; +// top:20px; +// position: relative; +// font-size: 12px; +// font-size:1.2rem; +// font-family: monaco, monospace; +// } + +.startpage-quotes { + @extend %clearfix; + padding:60px 0; + .startpage-quotes-quote { + width:33%; + float:left; + padding: 0 10px; + box-sizing: border-box; + } +} +.startpage-more-examples { + clear:both; + ul { + padding:0 !important; + margin:0; + } + li { + display:inline-block; + margin-right:15px; + } +} + +.startpage-examples { + .startpage-example { + @extend %clearfix; + display:none; + &.active { + display: block; + } + } +} + +.annotated-examples { + h3 { + margin-top:50px; + } +} +.columns { + overflow: hidden; + padding:0; + margin:0 -30px 5px; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + overflow: hidden; + + .column { + padding:20px 30px; + flex: 1; + background-color: $lightGrey; + &:last-child { + background-color: darken($lightGrey, 2%); + } + pre { + background-color: transparent; + margin:0; + padding:0; + } + } +} + +.annotated-list { + box-sizing: border-box; + @extend %clearfix; + .list { + padding-top:20px; + & > div { + padding:10px 0; + border-top:solid 1px rgba(255,255,255,.1); + } + } + .avatar { + max-width: 150px; + img { + max-width: 100%; + } + } + h3 { + font-size:16px; + font-size: 1.6rem; + margin:0 0 3px; + font-weight: bold; + //color:#fff; + } + p { + margin:0; + //color:#eee; + } + + input { + border-radius: 25px; + padding:7px 14px; + background-color: transparent; + border:solid 1px rgba(0,0,0,.2); + width:200px; + box-sizing: border-box; + color:$black; + margin-bottom:5px; + } + input:focus { + outline:none; + border-color:#aaa; + } + .sort { + font-size:12px; + font-size: 1.2rem; + padding:5px 15px; + border-radius: 25px; + border:none; + display:inline-block; + color:$black; + text-decoration: none; + background-color: rgba(0,0,0,.05); + margin:2px 0; + } + .sort:hover { + text-decoration: none; + background-color: rgba(0,0,0,.1); + } + .sort:focus { + outline:none; + } + .sort:after { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-bottom: 4px solid transparent; + content:""; + position: relative; + top:-10px; + right:-4px; + } + .sort.asc:after { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid $black; + content:""; + position: relative; + top:11px; + right:-4px; + } + .sort.desc:after { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-bottom: 4px solid $black; + content:""; + position: relative; + top:-9px; + right:-4px; + } +} + +/* * * * * * * * * * * * * * * * * * * * * +* Examples +* * * * * * * * * * * * * * * * * * * * */ +.nav-tabs { + .active a { + background-color: $lightGrey !important; + } +} + + + +/* * * * * * * * * * * * * * * * * * * * * +* Paging +* * * * * * * * * * * * * * * * * * * * */ +.paging { + padding-bottom:10px; + clear:both; + float:left; +} +.paging li { + display:block; + float:left; + padding:10px 15px; + border-radius:50%; +} +.paging li a { + color:#999; + text-decoration:none; + display:inline-block; + line-height:14px; +} +.paging li.active a { + font-weight:bold; + color:#eee; + font-size:18px; + margin:-1px; +} +.paging li a:hover { + color:#eee; +} + +code { + background-color: $lightGrey; + border: solid 1px darken($lightGrey, 5%); + border-radius: 5px; + padding: 1px 4px; +} +pre { + padding:30px; + margin:0; + line-height:1.7; + color:#666; +} +pre code { + padding:0; + border:none; + background-color: transparent; + border-radius: 0; +} + +pre, code { + font-family: monospace, 'monaco', sans-serif; + font-size: 12px; + font-size: 1.2rem; +} +pre code .annotation { + background-color: $orange; + color: #fff; + padding: 2px 6px; + border-radius: 11px; + cursor:help; + &:hover { + background-color:darken($orange, 10%); + } +} diff --git a/docs/assets/images/graphics/favicon.ico b/docs/assets/images/graphics/favicon.ico new file mode 100644 index 00000000..60055ebb Binary files /dev/null and b/docs/assets/images/graphics/favicon.ico differ diff --git a/docs/assets/images/graphics/javve-coffee.jpg b/docs/assets/images/graphics/javve-coffee.jpg new file mode 100644 index 00000000..9c67cc5b Binary files /dev/null and b/docs/assets/images/graphics/javve-coffee.jpg differ diff --git a/docs/assets/images/graphics/javve-coffee2.jpg b/docs/assets/images/graphics/javve-coffee2.jpg new file mode 100644 index 00000000..53552855 Binary files /dev/null and b/docs/assets/images/graphics/javve-coffee2.jpg differ diff --git a/docs/assets/images/graphics/javve.jpg b/docs/assets/images/graphics/javve.jpg new file mode 100644 index 00000000..67f440c7 Binary files /dev/null and b/docs/assets/images/graphics/javve.jpg differ diff --git a/docs/assets/images/graphics/listjs-logo.png b/docs/assets/images/graphics/listjs-logo.png new file mode 100644 index 00000000..d946d8bd Binary files /dev/null and b/docs/assets/images/graphics/listjs-logo.png differ diff --git a/docs/assets/images/tests/boba.jpeg b/docs/assets/images/tests/boba.jpeg new file mode 100644 index 00000000..3003f7bf Binary files /dev/null and b/docs/assets/images/tests/boba.jpeg differ diff --git a/docs/assets/images/tests/darth.jpeg b/docs/assets/images/tests/darth.jpeg new file mode 100644 index 00000000..f4ff609a Binary files /dev/null and b/docs/assets/images/tests/darth.jpeg differ diff --git a/docs/assets/images/tests/leia.jpeg b/docs/assets/images/tests/leia.jpeg new file mode 100644 index 00000000..20d07cb6 Binary files /dev/null and b/docs/assets/images/tests/leia.jpeg differ diff --git a/docs/assets/images/tests/luke.jpeg b/docs/assets/images/tests/luke.jpeg new file mode 100644 index 00000000..4eaaba6f Binary files /dev/null and b/docs/assets/images/tests/luke.jpeg differ diff --git a/docs/assets/images/tests/rey.jpeg b/docs/assets/images/tests/rey.jpeg new file mode 100644 index 00000000..a399b78b Binary files /dev/null and b/docs/assets/images/tests/rey.jpeg differ diff --git a/docs/assets/javascripts/list.min.js b/docs/assets/javascripts/list.min.js new file mode 100644 index 00000000..81318815 --- /dev/null +++ b/docs/assets/javascripts/list.min.js @@ -0,0 +1,2 @@ +var List;List=function(){var t={"./src/add-async.js":function(t){t.exports=function(t){return function e(r,n,s){var i=r.splice(0,50);s=(s=s||[]).concat(t.add(i)),r.length>0?setTimeout((function(){e(r,n,s)}),1):(t.update(),n(s))}}},"./src/filter.js":function(t){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,s=r.length;nv.page,a=new g(t[s],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}m(t.slice(0),e)}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,s=0,i=v.items.length;s-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r=v.i&&v.visibleItems.lengthe},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,s,i,a){return this.dottedLeft(t,e,r,n,s,i)||this.dottedRight(t,e,r,n,s,i,a)},dottedLeft:function(t,e,r,n,s,i){return e==r+1&&!this.innerWindow(e,s,i)&&!this.right(e,n)},dottedRight:function(t,e,r,n,s,i,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,i)&&!this.right(e,n))}};return function(e){var n=new i(t.listContainer.id,{listClass:e.paginationClass||"pagination",item:e.item||"
      • ",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});s.bind(n.listContainer,"click",(function(e){var r=e.target||e.srcElement,n=t.utils.getAttribute(r,"data-page"),s=t.utils.getAttribute(r,"data-i");s&&t.show((s-1)*n+1,n)})),t.on("updated",(function(){r(n,e)})),r(n,e)}}},"./src/parse.js":function(t,e,r){t.exports=function(t){var e=r("./src/item.js")(t),n=function(r,n){for(var s=0,i=r.length;s0?setTimeout((function(){e(r,s)}),1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=function(t){for(var e=t.childNodes,r=[],n=0,s=e.length;n]/g.exec(t)){var e=document.createElement("tbody");return e.innerHTML=t,e.firstElementChild}if(-1!==t.indexOf("<")){var r=document.createElement("div");return r.innerHTML=t,r.firstElementChild}}},a=function(e,r,n){var s=void 0,i=function(e){for(var r=0,n=t.valueNames.length;r=1;)t.list.removeChild(t.list.firstChild)},function(){var r;if("function"!=typeof t.item){if(!(r="string"==typeof t.item?-1===t.item.indexOf("<")?document.getElementById(t.item):i(t.item):s()))throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.");r=n(r,t.valueNames),e=function(){return r.cloneNode(!0)}}else e=function(e){var r=t.item(e);return i(r)}}()};t.exports=function(t){return new e(t)}},"./src/utils/classes.js":function(t,e,r){var n=r("./src/utils/index-of.js"),s=/\s+/;Object.prototype.toString;function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}t.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~n(e,t)||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=n(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},i.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(s);return""===t[0]&&t.shift(),t},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~n(this.array(),t)}},"./src/utils/events.js":function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"",a=r("./src/utils/to-array.js");e.bind=function(t,e,r,s){for(var o=0,l=(t=a(t)).length;o32)return!1;var a=n,o=function(){var t,r={};for(t=0;t=p;b--){var j=o[t.charAt(b-1)];if(C[b]=0===m?(C[b+1]<<1|1)&j:(C[b+1]<<1|1)&j|(v[b+1]|v[b])<<1|1|v[b+1],C[b]&d){var x=l(m,b-1);if(x<=u){if(u=x,!((c=b-1)>a))break;p=Math.max(1,2*a-c)}}}if(l(m+1,a)>u)break;v=C}return!(c<0)}},"./src/utils/get-attribute.js":function(t){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,s=n.length,i=0;i=48&&t<=57}function i(t,e){for(var i=(t+="").length,a=(e+="").length,o=0,l=0;o=i&&l=a?-1:l>=a&&o=i?1:i-a}i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return e},set:function(t){r=[];var s=0;if(e=t)for(;sFuzzy search + +

        + Note: The fuzzy search plugin is + deprecated since v1.5.0, it's now bundled into List.js. Read the + old docs here. +

        + +

        The difference between Fuzzy Search and List.js default search

        + +

        The default search will conduct a time efficient search for an exact match in the content searched, while the fuzzy search will render results depending on if they are included anywhere in the content.

        + +

        Basic example

        +
        var items = [
        +    { character: "Guybrush Threepwood", game: "The Secret of Monkey Island" },
        +    { character: "Manny Calavera", game: "Grim Fandango" },
        +    { character: "Bernard Bernoulli", game: "Maniac Mansion" }
        +];
        +
        +list.search('gu thre'); // return none
        +list.fuzzySearch('gu thre') // return 1 item
        +
        + + +

        Options

        +

        All options are optional. Simplest implementation is:

        +
        new List(id, { fuzzySearch: options });
        +
          +
        • + searchClass String, default: fuzzy-search
          + What is the class of the search field? +
        • +
        • + location Int, default: 0
          + Approximately where in the text is the pattern expected to be found? +
        • +
        • + distance Int, default: 100
          + Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is ‘distance’ characters away from the fuzzy location would score as a complete mismatch. A distance of 0 requires the match be at the exact location specified, a threshold of 1000 would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold. +
        • +
        • + threshold Int, default: 0.4
          + At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything. +
        • +
        • + multiSearch Boolean, default: true
          + Subtract arguments from the searchString or put searchString as only argument +
        • +
        + +

        Implementation

        +
        <div id="list-id">
        +  <input class="fuzzy-search" />
        +  <ul class="list">
        +    / A bunch of items /
        +  </ul>
        +</div>
        +
        +<script>
        +
        +var options = {
        +  valueNames: [ 'name', 'category' ],
        +  fuzzySearch: {
        +    searchClass: "fuzzy-search",
        +    location: 0,
        +    distance: 100,
        +    threshold: 0.4,
        +    multiSearch: true
        +  }
        +};
        +
        +var listObj = new List('list-id', options);
        +
        +// Search manually
        +listObj.fuzzySearch('my search');
        +
        +// Search manually on specific columns
        +listObj.fuzzySearch('my search', [ 'name' ]);
        +
        +</script>
        +
        + +

        A big thanks to LuukvE who made a commit from which I could create this Fuzzy Search plugin.

        + + diff --git a/docs/docs/index.html b/docs/docs/index.html new file mode 100755 index 00000000..45632742 --- /dev/null +++ b/docs/docs/index.html @@ -0,0 +1,168 @@ +--- +layout: default +title: Really simple example +--- + +

        Really simple examples

        +

        You can use List.js on either existing HTML or create new with super simple templating.

        + + +

        Example 1: Using existing list

        +
        HTML
        + +
        <div id="hacker-list">
        +  <ul class="list">
        +    <li>
        +       <h3 class="name">Jonny</h3>
        +       <p class="city">Stockholm</p>
        +    </li>
        +    <li>
        +      <h3 class="name">Jonas</h3>
        +      <p class="city">Berlin</p>
        +    </li>
        +  </ul>
        +</div>
        + +
        JavaScript
        +
        var options = {
        +    valueNames: [ 'name', 'city' ]
        +};
        +
        +var hackerList = new List('hacker-list', options);
        + + +

        Example 2: Create list on initialization: Version 1

        + +
        HTML
        +
        <div id="hacker-list">
        +    <ul class="list"></ul>
        +</div>
        + +
        JavaScript
        +
        var options = {
        +  valueNames: [ 'name', 'city' ],
        +  item: '<li><h3 class="name"></h3><p class="city"></p></li>'
        +};
        +
        +var values = [
        +  { name: 'Jonny', city:'Stockholm' }
        +  , { name: 'Jonas', city:'Berlin' }
        +];
        +
        +var hackerList = new List('hacker-list', options, values);
        + +

        Example 3: Create list on initialization: Version 2

        + +
        HTML
        +
        <div id="hacker-list">
        +  <ul class="list"></ul>
        +</div>
        +
        +<div style="display:none;">
        +  <!-- A template element is needed when list is empty, TODO: needs a better solution -->
        +  <li id="hacker-item">
        +   <h3 class="name"></h3>
        +   <p class="city"></p>
        +  </li>
        +</div>
        + +
        JavaScript
        +
        var options = {
        +    item: 'hacker-item'
        +};
        +
        +var values = [
        +    { name: 'Jonny', city:'Stockholm' }
        +    , { name: 'Jonas', city:'Berlin' }
        +];
        +
        +var hackerList = new List('hacker-list', options, values);
        + +

        Example 4: Index existing list and then add

        + +
        HTML
        +
        <div id="hacker-list">
        +  <ul class="list">
        +   <li>
        +     <h3 class="name">Jonny</h3>
        +     <p class="city">Stockholm</p>
        +   </li>
        +  </ul>
        +</div>
        + +
        JavaScript
        +
        var options = {
        +  valueNames: ['name', 'city']
        +};
        +
        +var hackerList = new List('hacker-list', options);
        +
        +hackerList.add( { name: 'Jonas', city:'Berlin' } );
        + +

        Example 5: Add automagic search and sort inputs and buttons

        + +
        HTML
        +
        <div id="hacker-list">
        +
        +  <input class="search" />
        +  <span class="sort" data-sort="name">Sort by name</span>
        +  <span class="sort" data-sort="city">Sort by city</span>
        +
        +  <ul class="list">
        +   <li>
        +     <h3 class="name">Jonny</h3>
        +     <p class="city">Stockholm</p>
        +   </li>
        +   <li>
        +     <h3 class="name">Jonas</h3>
        +     <p class="city">Berlin</p>
        +   </li>
        +  </ul>
        +</div>
        + +
        JavaScript (nothing special)
        +
        var options = {
        +  valueNames: [ 'name', 'city' ]
        +};
        +
        +var hackerList = new List('hacker-list', options);
        + +

        Read more here

        + +

        Example 6: Using data attributes and other custom attributes (introduced in v1.2.0)

        + +
        HTML
        +
        <div id="hacker-list">
        +  <ul class="list">
        +   <li data-id="1">
        +     <a href="http://javve.com" class="link name">Jonny</a>
        +     <p class="born timestamp" data-timestamp="1234">1986</p>
        +     <img class="image" src="javve.jpg" />
        +   </li>
        +  </ul>
        +</div>
        + +
        JavaScript
        +
        var options = {
        +  valueNames: [
        +    'name',
        +    'born',
        +    { data: ['id'] },
        +    { name: 'timestamp', attr: 'data-timestamp' },
        +    { name: 'link', attr: 'href' },
        +    { name: 'image', attr: 'src' }
        +  ]
        +};
        +
        +var hackerList = new List('hacker-list', options);
        +
        +hackerList.add({
        +  name: 'Jonas',
        +  born: '1985',
        +  id: 2,
        +  timestamp: '1337',
        +  link: 'http://arnklint.com'
        +  image: 'jonas.gif'
        +});
        + +
        Next topic: Options ›
        diff --git a/docs/docs/item-api.html b/docs/docs/item-api.html new file mode 100644 index 00000000..2cadf428 --- /dev/null +++ b/docs/docs/item-api.html @@ -0,0 +1,77 @@ +--- +layout: default +title: Item API +--- + +

        +Item API

        + +

        These methods are available for all Items that are returned by +the list.

        + +

        +Properties

        + +
          +
        • + elm Element
          + The actual item DOM element +
        • +
        • + _values Array
          + Direct access to the item's values. Simplifies debugging. Note: Always use item.values() when interacting with the values. +
        • +
        + +

        Methods

        + +
          +
        • +

          values(newValues)

          +
            +
          • +

            + newValues optional
            + If variable newValues are present the new values replaces the current item values + and updates the list. + If newValues are not present, the function returns the current values. +

            +
            item.values() // { name: "Jonny", age: 24, city: "Umeå" }
            +  item.values({
            +      age: 25,
            +      city: "Stockholm"
            +  });
            +  item.values() // { name: "Jonny", age: 25, city: "Stockholm" }
            +  
            +
          • +
          +
        • +
        • +

          + show()
          + Shows the item +

          +
        • +
        • +

          + hide()
          + Hides the item (removes the element from the list, and then when its shown it's appended again. The element will thereby change position in the list. A bug, but a good solution is yet to be found.) +

          +
        • +
        • +

          + matching() Boolean
          + Returns boolean. True if the item matches the current filter and search. Visible items + always matches, but matching items are not always visible. +

          +
        • +
        • +

          + visible() Boolean
          + Returns boolean. True if the item is visible. Visible items + always matches, but matching items are not always visible. +

          +
        • +
        + + diff --git a/docs/docs/pagination.html b/docs/docs/pagination.html new file mode 100644 index 00000000..f1554cf1 --- /dev/null +++ b/docs/docs/pagination.html @@ -0,0 +1,120 @@ +--- +layout: default +title: Pagination +--- + +

        Pagination

        + +

        + Note: The pagination plugin is + deprecated since v1.5.0, it's now bundled into List.js. Read the + old docs here. +

        + +

        Basic example

        +
        <div id="listId">
        +  <ul class="list">
        +      // A bunch of items
        +  </ul>
        +  <ul class="pagination"></ul>
        +</div>
        +
        +<script>
        +  var options = {
        +    valueNames: [ 'name', 'category' ],
        +    page: 3,
        +    pagination: true
        +  };
        +
        +  var listObj = new List('listId', options);
        +</script>
        +
        + + + +

        Options

        +
          +
        • + paginationClass String, default: “pagination”
          + The class that defines which ul that should contain the pagination (must be inside the list container) +
        • +
        • + innerWindow Int, default: 2
          + How many pages should be visible on each side of the current page.
          + innerWindow: 2 … 3 4 5 6 7 …
          + innerWindow: 1 … 4 5 6 … +
        • +
        • + outerWindow Int, default: 0
          + How many pages should be visible on from the beginning and from the end of the pagination.
          + outerWindow: 0 … 3 4 5 6 7…
          + outerWindow: 2 1 2 … 4 5 6 7 8 … 11 12 +
        • +
        • + left Int, default: 0
          + Same as outerWindow but only from left. + outerWindow: 2 and left: 1 1 … 4 5 6 7 8 … 11 12 +
        • +
        • + right Int, default: 0
          + Same as left but from right. +
        • +
        • + item String, default <li><a class='page' href='#'></a></li>
          + Template for the pagination items. +
        • +
        + +

        Notice

        +

        The number of items at each page are decided by the List.js own property page. To set this just add page: Number to the option object sent into the List.js constructor (as been done in both of the examples at this page).

        + +

        Generated output

        + +
        <div id="listId">
        +  <ul class="list">
        +      / A bunch of items /
        +  </ul>
        +  <ul class="pagination">
        +    <li>
        +      <a class="page active" href="javascript:function Z(){Z=""}Z()">1</a>
        +    </li>
        +    <li>
        +      <a class="page" href="javascript:function Z(){Z=""}Z()">2</a>
        +    </li>
        +    <li>
        +      …
        +    </li>
        +  </ul>
        +</div>
        +
        + +

        Double pagination

        + +
        <div id="listId">
        +  <ul class="paginationTop"></ul>
        +  <ul class="list">
        +    // A bunch of items
        +  </ul>
        +  <ul class="paginationBottom"></ul>
        +</div>
        +
        +<script>
        +  var listOptions = {
        +    valueNames: [ 'name', 'category' ],
        +    page: 3,
        +    pagination: [{
        +      name: "paginationTop",
        +      paginationClass: "paginationTop",
        +      outerWindow: 2
        +    }, {
        +      paginationClass: "paginationBottom",
        +      innerWindow: 3,
        +      left: 2,
        +      right: 4
        +    }]
        +  };
        +
        +  var listObj = new List('listId', listOptions);
        +</script>
        + + diff --git a/docs/docs/plugins/build.html b/docs/docs/plugins/build.html new file mode 100644 index 00000000..80ffad82 --- /dev/null +++ b/docs/docs/plugins/build.html @@ -0,0 +1,50 @@ +--- +layout: default +title: Build your own plugin +--- + +

        Build your own plugin

        + +

        A List.js plugin is basically a function/class which returns a object on initialization.

        + +

        A basic example plugin

        +

        The plugin code list.awesomething.js

        +
        function ListAwesomething() {
        +  options = options || {};
        +  return {
        +    init: function(list) {
        +      // This method is called on initialization
        +    },
        +    name: options.name || "awesomething",
        +    customMethod: function() {
        +      return "cowabunga";
        +    }
        +  };
        +};
        +
        + +

        Using the plugin

        +
        <script src="list.js"></script>
        +<script src="list.awesomething.js"></script>
        +<script>
        +  var myList = new List('my-list', {
        +    plugins: ListAwesomething()
        +  });
        +
        +  myList.awesomething.customMethod(); // cowabunga
        +</script>
        +
        +

        Requirements / Specifications

        +
          +
        • + A plugin namned Awesome Thing have to be in a JavaScript file namned list.awesomething.js (no dash, camelcase or anything) + and the function/class have to be namned ListAwesomeThing (camelcase but no dash anything else). +
        • +
        • The plugin object must contain an init method.
        • +
        • The plugin object must contain an name attribute that defaults to the plugin name.
        • +
        + +

        Live example

        +

        Check this out!

        + + <% locals.mediaTempleTerm = "plugin" %> diff --git a/docs/docs/plugins/fuzzysearch.html b/docs/docs/plugins/fuzzysearch.html new file mode 100644 index 00000000..bd98eae5 --- /dev/null +++ b/docs/docs/plugins/fuzzysearch.html @@ -0,0 +1,97 @@ +--- +layout: default +title: Fuzzy search plugin +--- + +

        Fuzzy search plugin

        + +

        Note: The fuzzy search plugin is deprecated since v1.5.0, it's now bundled into List.js.

        + +

        To use the plugin you first need to download it:

        + +

        Via GitHub

        + Download list.fuzzysearch.js + +

        Via Bower

        +
        bower install list.fuzzysearch.js
        + +

        Via CDNJS

        +
        <script src="//cdnjs.cloudflare.com/ajax/libs/list.fuzzysearch.js/0.1.0/list.fuzzysearch.min.js"></script>
        + +

        The difference between Fuzzy Search and List.js default search

        + +

        The default search will conduct a time efficient search for an exact match in the content searched, while the fuzzy search will render results depending on if they are included anywhere in the content.

        + +

        Basic example

        +
        var items = [
        +    { character: "Guybrush Threepwood", game: "The Secret of Monkey Island" },
        +    { character: "Manny Calavera", game: "Grim Fandango" },
        +    { character: "Bernard Bernoulli", game: "Maniac Mansion" }
        +];
        +
        +list.search('gu thre'); // return none
        +list.fuzzySearch.search('gu thre') // return 1 item
        +
        + +

        Implementation

        +
        <div id="list-id">
        +  <input class="fuzzy-search" />
        +  <ul class="list">
        +    / A bunch of items /
        +  </ul>
        +</div>
        +
        +<script>
        +
        +var fuzzyOptions = {
        +  searchClass: "fuzzy-search",
        +  location: 0,
        +  distance: 100,
        +  threshold: 0.4,
        +    multiSearch: true
        +};
        +var options = {
        +  valueNames: [ 'name', 'category' ],
        +  plugins: [
        +    ListFuzzySearch(fuzzyOptions)
        +  ]
        +};
        +
        +var listObj = new List('list-id', options);
        +
        +// Search manually
        +listObj.fuzzySearch.search('my search');
        +
        +// Search manually on specific columns
        +listObj.fuzzySearch.search('my search', { name: true });
        +
        +</script>
        +
        + + + +

        Options

        +

        All options are optional. Simplest implementation is:

        +
        plugins: [ ListFuzzySearch() ]
        +
          +
        • + location Int, default: 0
          + Approximately where in the text is the pattern expected to be found? +
        • +
        • + distance Int, default: 100
          + Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is ‘distance’ characters away from the fuzzy location would score as a complete mismatch. A distance of 0 requires the match be at the exact location specified, a threshold of 1000 would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold. +
        • +
        • + threshold Int, default: 0.4
          + At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything. +
        • +
        • + multiSearch Boolean, default: true
          + Subtract arguments from the searchString or put searchString as only argument +
        • +
        + +

        A big thanks to LuukvE who made a commit from which I could create this Fuzzy Search plugin.

        + + diff --git a/docs/docs/plugins/index.html b/docs/docs/plugins/index.html new file mode 100755 index 00000000..4e8c8910 --- /dev/null +++ b/docs/docs/plugins/index.html @@ -0,0 +1,38 @@ +--- +layout: default +title: Using Plugins +--- + +

        Using plugins

        + +

        Getting started

        +

        To use a plugin you need two things:

        +
          +
        1. Include the plugins .js-file at the page.
        2. +
        3. +

          Include it when you instantiate List.js

          +
          new List('list-id', {
          +  plugins: [ ListPagination(), NameOfOtherPlugin(options) ]
          +});
          +
        + + +

        Naming and accessing plugins

        +

        It is also possible to add options and load multiple instances of the same plugins (if the plugin itself allows it).

        +

        + If the property name is added in the plugin option parameter does the plugin become + accessible through listObj.namePropertyValue.This is useful when having multiple instances of the same plugin. +

        +
        var myList = new List('list-id', {
        +  plugins: [
        +    ListPagination({ name: "topPagination", paginationClass: "top-pagination" }),
        +    ListPagination({ name: "bottomPagination", paginationClass: "bottom-pagination" })
        +  ]
        +});
        +console.log(myList.topPagination);
        +console.log(myList.bottomPagination);
        + +

        Build your own plugin

        +

        Go to: /docs/plugins/build

        + + diff --git a/docs/docs/plugins/pagination.html b/docs/docs/plugins/pagination.html new file mode 100644 index 00000000..403cc04e --- /dev/null +++ b/docs/docs/plugins/pagination.html @@ -0,0 +1,135 @@ +--- +layout: default +title: Pagination plugin +--- + +

        Pagination plugin

        + +

        Note: The pagination plugin is deprecated since v1.5.0, it's now bundled into List.js.

        + +

        To use the plugin you first need to download it:

        + +

        Via GitHub

        + Download List.pagination.js + +

        Via Bower

        +
        bower install list.pagination.js
        + +

        Via CDNJS

        +
        <script src="//cdnjs.cloudflare.com/ajax/libs/list.pagination.js/0.1.1/list.pagination.min.js"></script>
        + +

        Basic example

        +
        <div id="listId">
        +  <ul class="list">
        +      // A bunch of items
        +  </ul>
        +  <ul class="pagination"></ul>
        +</div>
        +
        +<script>
        +  var options = {
        +    valueNames: [ 'name', 'category' ],
        +    page: 3,
        +    plugins: [
        +      ListPagination({})
        +    ]
        +  };
        +
        +  var listObj = new List('listId', options);
        +</script>
        +
        + + + +

        Options

        +
          +
        • + name String, default: “pagination”
          + Default option for all plugins. Defines how to access the plugin from the list object listObj.pluginName. +
        • +
        • + paginationClass String, default: “pagination”
          + The class that defines which ul that should contain the pagination (must be inside the list container) +
        • +
        • + innerWindow Int, default: 2
          + How many pages should be visible on each side of the current page.
          + innerWindow: 2 … 3 4 5 6 7 …
          + innerWindow: 1 … 4 5 6 … +
        • +
        • + outerWindow Int, default: 0
          + How many pages should be visible on from the beginning and from the end of the pagination.
          + outerWindow: 0 … 3 4 5 6 7…
          + outerWindow: 2 1 2 … 4 5 6 7 8 … 11 12 +
        • +
        • + left Int, default: 0
          + Same as outerWindow but only from left. + outerWindow: 2 and left: 1 1 … 4 5 6 7 8 … 11 12 +
        • +
        • + right Int, default: 0
          + Same as left but from right. +
        • +
        + +

        Notice

        +

        The number of items at each page are decided by the List.js own property page. To set this just add page: Number to the option object sent into the List.js constructor (as been done in both of the examples at this page).

        + +

        Generated output

        + +
        <div id="listId">
        +  <ul class="list">
        +      / A bunch of items /
        +  </ul>
        +  <ul class="pagination">
        +    <li>
        +      <a class="page active" href="javascript:function Z(){Z=""}Z()">1</a>
        +    </li>
        +    <li>
        +      <a class="page" href="javascript:function Z(){Z=""}Z()">2</a>
        +    </li>
        +    <li>
        +      …
        +    </li>
        +  </ul>
        +</div>
        +
        + +

        Double pagination

        + +
        <div id="listId">
        +  <ul class="paginationTop"></ul>
        +  <ul class="list">
        +    // A bunch of items
        +  </ul>
        +  <ul class="paginationBottom"></ul>
        +</div>
        +
        +<script>
        +  var paginationTopOptions = {
        +    name: "paginationTop",
        +    paginationClass: "paginationTop",
        +    outerWindow: 2
        +  };
        +  var paginationBottomOptions = {
        +    name: "paginationBottom",
        +    paginationClass: "paginationBottom",
        +    innerWindow: 3,
        +    left: 2,
        +    right: 4
        +  };
        +  var listOptions = {
        +    valueNames: [ 'name', 'category' ],
        +    page: 3,
        +    plugins: [
        +        ListPagination(paginationTopOptions),
        +        ListPagination(paginationBottomOptions)
        +    ]
        +  };
        +
        +  var listObj = new List('listId', listOptions);
        +</script>
        + + diff --git a/docs/docs/search-sort.html b/docs/docs/search-sort.html new file mode 100755 index 00000000..7dbac087 --- /dev/null +++ b/docs/docs/search-sort.html @@ -0,0 +1,91 @@ +--- +layout: default +title: Automagical Searching + Sorting +--- + +

        +Automagical Searching + Sorting

        + +

        It is easy to add search input and sort buttons with just a few classes and attributes in your HTML. ‘Automagical’ because List.js registers the event handlers, searches/sorts and updates the list for you:

        + +

        +Searching

        + +
          +
        • +

          + class String. *required
          + The default class search is how List.js finds your writable search field. If you change it also set options.searchClass.

          +

          + Alternatively, using fuzzy-search here will switch to the Fuzzy Search function. +

          +
        • +
        • +

          + type String. *required
          + The default input type search is similar to using text, but web browsers may render it slightly differently: see https://developer.mozilla.org/.../input/search. Either type will work with List.js. +

          +
        • +
        + +
        
        +<input type="search" class="search" placeholder="normal search"> or
        +<input type="search" class="fuzzy-search" placeholder="fuzzy search!">
        +
        + +

        Sorting

        + +
          +
        • +

          class String. *required
          + The default class sort is how List.js finds clickable sort buttons. If you change it also set options.sortClass. +

          +
        • +
        • +

          + data-sort String. *required
          + This attribute on a clickable sort button should match the column name passed to List.js in options.valueNames. +

          +
        • +
        • +

          + data-order String
          + Set to asc or desc to enforce that sorting order for a column. The user won't be able to change the order, and any data-default-order attribute is ignored. +

          +
        • +
        • +

          + data-default-order String, default: "asc"
          + Set to desc to change the initial sorting order for a column. Subsequent clicks will toggle the sorting order between ascending/descending, as usual. +

          +
        • +
        • +

          + data-insensitive Boolean, default: true
          + Set to false for case-sensitive sorting of that column. +

          +
        • +
        + +
        
        +Sort by: 
        +<span class='sort' data-sort='name'>Name</span> or 
        +<span class='sort' data-sort='born' data-default-order='desc'>Born in Year</span> or 
        +<span class='sort' data-sort='city'>City</span>
        +
        + +

        The CSS classes asc and desc are added when a sort button is clicked on, so List.js can show which column is currently sorted. For example, using this CSS sets a yellow background with ⬆ or ⬇ added after the button text:

        + +
        
        +.sort.asc, .sort.desc {
        +  background-color: yellow;
        +  }
        +.sort.asc::after {
        +  content: "\002B06";
        +  padding-left: 3px;
        +  }
        +.sort.desc::after {
        +  content: "\002B07";
        +  padding-left: 3px
        +  }
        +
        diff --git a/docs/faq.html b/docs/faq.html new file mode 100644 index 00000000..e26192ea --- /dev/null +++ b/docs/faq.html @@ -0,0 +1,25 @@ +--- +layout: default +title: List FAQ +--- + +

        List FAQ

        + +

        Questions

        + +

        + +

        + + I want to have a search field outside the list container. +

        +
        <input id="search-field" />
        +<div id="container"> ... </div>
        +
        var listObj = new List('container', options);
        +
        +$('#search-field').on('keyup', function() {
        +  var searchString = $(this).val();
        +  listObj.search(searchString);
        +});
        diff --git a/docs/feed.xml b/docs/feed.xml new file mode 100644 index 00000000..a6628bd8 --- /dev/null +++ b/docs/feed.xml @@ -0,0 +1,30 @@ +--- +layout: null +--- + + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + {% for post in site.posts limit:10 %} + + {{ post.title | xml_escape }} + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {% for tag in post.tags %} + {{ tag | xml_escape }} + {% endfor %} + {% for cat in post.categories %} + {{ cat | xml_escape }} + {% endfor %} + + {% endfor %} + + diff --git a/docs/index.html b/docs/index.html new file mode 100755 index 00000000..85f11214 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,44 @@ +--- +layout: default +title: Search, sort, filters, flexibility to tables, list and more! +--- + +
        + +
        +

        List.js v{{site.data.pkg.version}}

        +

        + Tiny, invisible and simple, yet powerful and incredibly fast vanilla JavaScript + that adds search, sort, filters and flexibility + to plain HTML lists, tables, or anything. +

        +
        +
        + +{% include author.html %} + +{% include examples/annotated-example.html %} + +
        +

        More examples

        + +
        + + +
        +
        + +
        +
        + +
        +
        + +
        +
        diff --git a/docs/overview/changelog.html b/docs/overview/changelog.html new file mode 100644 index 00000000..4b6dea10 --- /dev/null +++ b/docs/overview/changelog.html @@ -0,0 +1,7 @@ +--- +layout: default +title: Read the changelog at Github +--- + +

        Changelog

        +

        Go to the changelog at GitHub

        diff --git a/docs/overview/contribute.html b/docs/overview/contribute.html new file mode 100644 index 00000000..7d4ac0da --- /dev/null +++ b/docs/overview/contribute.html @@ -0,0 +1,32 @@ +--- +layout: default +title: Contribute +--- + +

        Setup environment

        +

        1. Install Node.js

        +

        Go to Nodejs.org

        + +

        2. Install dependencies

        +
        npm install
        + +

        Compile and test

        +

        Compile the script (webpack.config.js)

        +
        npx webpack
        + +

        Watch and recompile when files change

        +
        npx webpack --watch
        + +

        Run the test suite

        +
        npx jest
        +

        Run tests continuously when files change

        +
        npx jest --watch
        + +

        Guidelines for making pull requests

        +
          +
        • Add tests if applicable.
        • +
        • Make sure all tests run. Preferably in IE7+
        • +
        • Do not include dist/list.js or dist/list.min.js. That file is only update for each release.
        • +
        • ONE feature per pull request
        • +
        • List.js is used in a lot of different ways on a lot of places, so please have understanding if your new special feature is not accepted :)
        • +
        diff --git a/docs/overview/download.html b/docs/overview/download.html new file mode 100644 index 00000000..2a6e8205 --- /dev/null +++ b/docs/overview/download.html @@ -0,0 +1,23 @@ +--- +layout: default +title: Download +--- + +

        Download

        + +

        The core thing in List.js have always been simplicity. It should require as little effort as possible to use the script and it's features.

        + +

        Via GitHub

        +Download compressed List.js   5KB with gzip
        +Download uncompressed List.js + +

        Via NPM

        +
        npm install list.js
        + +

        Via Bower

        +
        bower install list.js
        + +

        Via CDNJS

        +
        <script src="//cdnjs.cloudflare.com/ajax/libs/list.js/{{site.data.pkg.version}}/list.min.js"></script>
        + + diff --git a/docs/overview/index.html b/docs/overview/index.html new file mode 100644 index 00000000..8c9f161b --- /dev/null +++ b/docs/overview/index.html @@ -0,0 +1,36 @@ +--- +layout: default +title: TL;DR / Features +--- + +

        TL;DR

        + +

        Perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML.

        + +

        Core idea

        +
          +
        • Simple and invisible
        • +
        • Easy to apply to existing HTML
        • +
        • No dependencies
        • +
        • Fast
        • +
        • Tiny (5KB minified&gzip)
        • +
        • Handle thousands of items
        • +
        + +

        Features

        + + +

        Used by

        + diff --git a/docs/overview/press.html b/docs/overview/press.html new file mode 100644 index 00000000..bbbfa89e --- /dev/null +++ b/docs/overview/press.html @@ -0,0 +1,18 @@ +

        Press

        + +
        + + + + + + +
        +
        + + + + + +
        + diff --git a/index.js b/index.js deleted file mode 100644 index 131e03c4..00000000 --- a/index.js +++ /dev/null @@ -1,272 +0,0 @@ -/* -List.js 1.1.1 -By Jonny Strömberg (www.jonnystromberg.com, www.listjs.com) -*/ -(function( window, undefined ) { -"use strict"; - -var document = window.document, - getByClass = require('./src/utils/get-by-class'), - extend = require('./src/utils/extend'), - indexOf = require('./src/utils/index-of'), - events = require('./src/utils/events'), - toString = require('./src/utils/to-string'), - naturalSort = require('./src/utils/natural-sort'), - classes = require('./src/utils/classes'), - getAttribute = require('./src/utils/get-attribute'), - toArray = require('./src/utils/to-array'); - -var List = function(id, options, values) { - - var self = this, - init, - Item = require('./src/item')(self), - addAsync = require('./src/add-async')(self); - - init = { - start: function() { - self.listClass = "list"; - self.searchClass = "search"; - self.sortClass = "sort"; - self.page = 10000; - self.i = 1; - self.items = []; - self.visibleItems = []; - self.matchingItems = []; - self.searched = false; - self.filtered = false; - self.searchColumns = undefined; - self.handlers = { 'updated': [] }; - self.plugins = {}; - self.valueNames = []; - self.utils = { - getByClass: getByClass, - extend: extend, - indexOf: indexOf, - events: events, - toString: toString, - naturalSort: naturalSort, - classes: classes, - getAttribute: getAttribute, - toArray: toArray - }; - - self.utils.extend(self, options); - - self.listContainer = (typeof(id) === 'string') ? document.getElementById(id) : id; - if (!self.listContainer) { return; } - self.list = getByClass(self.listContainer, self.listClass, true); - - self.parse = require('./src/parse')(self); - self.templater = require('./src/templater')(self); - self.search = require('./src/search')(self); - self.filter = require('./src/filter')(self); - self.sort = require('./src/sort')(self); - - this.handlers(); - this.items(); - self.update(); - this.plugins(); - }, - handlers: function() { - for (var handler in self.handlers) { - if (self[handler]) { - self.on(handler, self[handler]); - } - } - }, - items: function() { - self.parse(self.list); - if (values !== undefined) { - self.add(values); - } - }, - plugins: function() { - for (var i = 0; i < self.plugins.length; i++) { - var plugin = self.plugins[i]; - self[plugin.name] = plugin; - plugin.init(self, List); - } - } - }; - - /* - * Re-parse the List, use if html have changed - */ - this.reIndex = function() { - self.items = []; - self.visibleItems = []; - self.matchingItems = []; - self.searched = false; - self.filtered = false; - self.parse(self.list); - }; - - this.toJSON = function() { - var json = []; - for (var i = 0, il = self.items.length; i < il; i++) { - json.push(self.items[i].values()); - } - return json; - }; - - - /* - * Add object to list - */ - this.add = function(values, callback) { - if (values.length === 0) { - return; - } - if (callback) { - addAsync(values, callback); - return; - } - var added = [], - notCreate = false; - if (values[0] === undefined){ - values = [values]; - } - for (var i = 0, il = values.length; i < il; i++) { - var item = null; - notCreate = (self.items.length > self.page) ? true : false; - item = new Item(values[i], undefined, notCreate); - self.items.push(item); - added.push(item); - } - self.update(); - return added; - }; - - this.show = function(i, page) { - this.i = i; - this.page = page; - self.update(); - return self; - }; - - /* Removes object from list. - * Loops through the list and removes objects where - * property "valuename" === value - */ - this.remove = function(valueName, value, options) { - var found = 0; - for (var i = 0, il = self.items.length; i < il; i++) { - if (self.items[i].values()[valueName] == value) { - self.templater.remove(self.items[i], options); - self.items.splice(i,1); - il--; - i--; - found++; - } - } - self.update(); - return found; - }; - - /* Gets the objects in the list which - * property "valueName" === value - */ - this.get = function(valueName, value) { - var matchedItems = []; - for (var i = 0, il = self.items.length; i < il; i++) { - var item = self.items[i]; - if (item.values()[valueName] == value) { - matchedItems.push(item); - } - } - return matchedItems; - }; - - /* - * Get size of the list - */ - this.size = function() { - return self.items.length; - }; - - /* - * Removes all items from the list - */ - this.clear = function() { - self.templater.clear(); - self.items = []; - return self; - }; - - this.on = function(event, callback) { - self.handlers[event].push(callback); - return self; - }; - - this.off = function(event, callback) { - var e = self.handlers[event]; - var index = indexOf(e, callback); - if (index > -1) { - e.splice(index, 1); - } - return self; - }; - - this.trigger = function(event) { - var i = self.handlers[event].length; - while(i--) { - self.handlers[event][i](self); - } - return self; - }; - - this.reset = { - filter: function() { - var is = self.items, - il = is.length; - while (il--) { - is[il].filtered = false; - } - return self; - }, - search: function() { - var is = self.items, - il = is.length; - while (il--) { - is[il].found = false; - } - return self; - } - }; - - this.update = function() { - var is = self.items, - il = is.length; - - self.visibleItems = []; - self.matchingItems = []; - self.templater.clear(); - for (var i = 0; i < il; i++) { - if (is[i].matching() && ((self.matchingItems.length+1) >= self.i && self.visibleItems.length < self.page)) { - is[i].show(); - self.visibleItems.push(is[i]); - self.matchingItems.push(is[i]); - } else if (is[i].matching()) { - self.matchingItems.push(is[i]); - is[i].hide(); - } else { - is[i].hide(); - } - } - self.trigger('updated'); - return self; - }; - - init.start(); -}; - - -// AMD support -if (typeof define === 'function' && define.amd) { - define(function () { return List; }); -} -module.exports = List; -window.List = List; - -})(window); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..0a2d2923 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,7423 @@ +{ + "name": "list.js", + "version": "2.3.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/compat-data": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.7.tgz", + "integrity": "sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw==", + "dev": true + }, + "@babel/core": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.7.tgz", + "integrity": "sha512-tRKx9B53kJe8NCGGIxEQb2Bkr0riUIEuN7Sc1fxhs5H8lKlCWUvQCSNMVIB0Meva7hcbCRJ76de15KoLltdoqw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.7", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.7", + "@babel/types": "^7.12.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.12.5", + "@babel/helper-validator-option": "^7.12.1", + "browserslist": "^4.14.5", + "semver": "^5.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", + "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz", + "integrity": "sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "regexpu-core": "^4.7.1" + } + }, + "@babel/helper-define-map": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", + "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz", + "integrity": "sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.7" + } + }, + "@babel/helper-module-imports": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5" + } + }, + "@babel/helper-module-transforms": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + }, + "dependencies": { + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz", + "integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.7" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz", + "integrity": "sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-replace-supers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "@babel/helper-simple-access": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", + "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz", + "integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz", + "integrity": "sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helpers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz", + "integrity": "sha512-d+/o30tJxFxrA1lhzJqiUcEJdI6jKlNregCv5bASeGf2Q4MXmnwH7viDo7nhx1/ohf09oaH8j1GVYG/e3Yqk6A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz", + "integrity": "sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.1.tgz", + "integrity": "sha512-a4rhUSZFuq5W8/OO8H7BL5zspjnc1FLd9hlOxIK/f7qG4a0qsqk8uvF/ywgBA8/OmjsapjpvaEOYItfGG1qIvQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + } + }, + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz", + "integrity": "sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz", + "integrity": "sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz", + "integrity": "sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz", + "integrity": "sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz", + "integrity": "sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", + "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.12.1" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz", + "integrity": "sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz", + "integrity": "sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz", + "integrity": "sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz", + "integrity": "sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz", + "integrity": "sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz", + "integrity": "sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.12.1" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz", + "integrity": "sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.1.tgz", + "integrity": "sha512-zJyAC9sZdE60r1nVQHblcfCj29Dh2Y0DOvlMkcqSo0ckqjiCwNiUezUKw+RjOCwGfpLRwnAeQ2XlLpsnGkvv9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz", + "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-define-map": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz", + "integrity": "sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz", + "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz", + "integrity": "sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz", + "integrity": "sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz", + "integrity": "sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz", + "integrity": "sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz", + "integrity": "sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz", + "integrity": "sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz", + "integrity": "sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz", + "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz", + "integrity": "sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-simple-access": "^7.12.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz", + "integrity": "sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.10.4", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-identifier": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz", + "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz", + "integrity": "sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz", + "integrity": "sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz", + "integrity": "sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz", + "integrity": "sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz", + "integrity": "sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz", + "integrity": "sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz", + "integrity": "sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz", + "integrity": "sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz", + "integrity": "sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz", + "integrity": "sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz", + "integrity": "sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.1.tgz", + "integrity": "sha512-EPGgpGy+O5Kg5pJFNDKuxt9RdmTgj5sgrus2XVeMp/ZIbOESadgILUbm50SNpghOh3/6yrbsH+NB5+WJTmsA7Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz", + "integrity": "sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz", + "integrity": "sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/preset-env": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.7.tgz", + "integrity": "sha512-OnNdfAr1FUQg7ksb7bmbKoby4qFOHw6DKWWUNB9KqnnCldxhxJlP+21dpyaWFmf2h0rTbOkXJtAGevY3XW1eew==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.12.7", + "@babel/helper-compilation-targets": "^7.12.5", + "@babel/helper-module-imports": "^7.12.5", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.1", + "@babel/plugin-proposal-async-generator-functions": "^7.12.1", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-proposal-dynamic-import": "^7.12.1", + "@babel/plugin-proposal-export-namespace-from": "^7.12.1", + "@babel/plugin-proposal-json-strings": "^7.12.1", + "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", + "@babel/plugin-proposal-numeric-separator": "^7.12.7", + "@babel/plugin-proposal-object-rest-spread": "^7.12.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.12.7", + "@babel/plugin-proposal-private-methods": "^7.12.1", + "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.12.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.12.1", + "@babel/plugin-transform-arrow-functions": "^7.12.1", + "@babel/plugin-transform-async-to-generator": "^7.12.1", + "@babel/plugin-transform-block-scoped-functions": "^7.12.1", + "@babel/plugin-transform-block-scoping": "^7.12.1", + "@babel/plugin-transform-classes": "^7.12.1", + "@babel/plugin-transform-computed-properties": "^7.12.1", + "@babel/plugin-transform-destructuring": "^7.12.1", + "@babel/plugin-transform-dotall-regex": "^7.12.1", + "@babel/plugin-transform-duplicate-keys": "^7.12.1", + "@babel/plugin-transform-exponentiation-operator": "^7.12.1", + "@babel/plugin-transform-for-of": "^7.12.1", + "@babel/plugin-transform-function-name": "^7.12.1", + "@babel/plugin-transform-literals": "^7.12.1", + "@babel/plugin-transform-member-expression-literals": "^7.12.1", + "@babel/plugin-transform-modules-amd": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-modules-systemjs": "^7.12.1", + "@babel/plugin-transform-modules-umd": "^7.12.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", + "@babel/plugin-transform-new-target": "^7.12.1", + "@babel/plugin-transform-object-super": "^7.12.1", + "@babel/plugin-transform-parameters": "^7.12.1", + "@babel/plugin-transform-property-literals": "^7.12.1", + "@babel/plugin-transform-regenerator": "^7.12.1", + "@babel/plugin-transform-reserved-words": "^7.12.1", + "@babel/plugin-transform-shorthand-properties": "^7.12.1", + "@babel/plugin-transform-spread": "^7.12.1", + "@babel/plugin-transform-sticky-regex": "^7.12.7", + "@babel/plugin-transform-template-literals": "^7.12.1", + "@babel/plugin-transform-typeof-symbol": "^7.12.1", + "@babel/plugin-transform-unicode-escapes": "^7.12.1", + "@babel/plugin-transform-unicode-regex": "^7.12.1", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.12.7", + "core-js-compat": "^3.7.0", + "semver": "^5.5.0" + } + }, + "@babel/preset-modules": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "@babel/traverse": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.7.tgz", + "integrity": "sha512-nMWaqsQEeSvMNypswUDzjqQ+0rR6pqCtoQpsqGJC4/Khm9cISwPTSpai57F6/jDaOoEGz8yE/WxcO3PV6tKSmQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@cnakazawa/watch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", + "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", + "dev": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@jest/console": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", + "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^26.6.2", + "jest-util": "^26.6.2", + "slash": "^3.0.0" + } + }, + "@jest/core": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", + "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/reporters": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^26.6.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-resolve-dependencies": "^26.6.3", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "jest-watcher": "^26.6.2", + "micromatch": "^4.0.2", + "p-each-series": "^2.1.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "@jest/environment": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "dev": true, + "requires": { + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2" + } + }, + "@jest/fake-timers": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@sinonjs/fake-timers": "^6.0.1", + "@types/node": "*", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" + } + }, + "@jest/globals": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "dev": true, + "requires": { + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" + } + }, + "@jest/reporters": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", + "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "node-notifier": "^8.0.0", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^7.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/source-map": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", + "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/test-result": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", + "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", + "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "dev": true, + "requires": { + "@jest/test-result": "^26.6.2", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.6.2", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "@jest/transform": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^26.6.2", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-util": "^26.6.2", + "micromatch": "^4.0.2", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "@sinonjs/commons": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", + "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@types/babel__core": { + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", + "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", + "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.15.tgz", + "integrity": "sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/eslint": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.5.tgz", + "integrity": "sha512-Dc6ar9x16BdaR3NSxSF7T4IjL9gxxViJq8RmFd+2UAyA+K6ck2W+gUwfgpG/y9TPyUuBL35109bbULpEynvltA==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", + "integrity": "sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "@types/node": { + "version": "14.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.9.tgz", + "integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/prettier": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", + "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", + "dev": true + }, + "@types/stack-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", + "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", + "dev": true + }, + "@types/yargs": { + "version": "15.0.10", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.10.tgz", + "integrity": "sha512-z8PNtlhrj7eJNLmrAivM7rjBESG6JwC5xP3RVk12i/8HVP7Xnx/sEmERnRImyEuUaJfO942X0qMOYsoupaJbZQ==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/info": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.1.0.tgz", + "integrity": "sha512-uNWSdaYHc+f3LdIZNwhdhkjjLDDl3jP2+XBqAq9H8DjrJUvlOKdP8TNruy1yEaDfgpAIgbSAN7pye4FEHg9tYQ==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.1.0.tgz", + "integrity": "sha512-7RfnMXCpJ/NThrhq4gYQYILB18xWyoQcBey81oIyVbmgbc6m5ZHHyFK+DyH7pLHJf0p14MxL4mTsoPAgBSTpIg==", + "dev": true + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "acorn": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "babel-jest": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "dev": true, + "requires": { + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/babel__core": "^7.1.7", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^26.6.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "babel-loader": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.1.tgz", + "integrity": "sha512-dMF8sb2KQ8kJl21GUjkW1HWmcsL39GOV5vnzjqrCzEPNY0S0UfMLnumidiwIajDSBmKhYf5iRW+HXaM4cvCKBw==", + "dev": true, + "requires": { + "find-cache-dir": "^2.1.0", + "loader-utils": "^1.4.0", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "schema-utils": "^2.6.5" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + } + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", + "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^4.0.0", + "test-exclude": "^6.0.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz", + "integrity": "sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "browserslist": { + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001159", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001159.tgz", + "integrity": "sha512-w9Ph56jOsS8RL20K9cLND3u/+5WASWdhC/PPrf+V3/HsM3uHOavWOR1Xzakbv4Puo/srmPHudkmCRWM7Aq+/UA==", + "dev": true + }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "dev": true, + "requires": { + "rsvp": "^4.8.4" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cjs-module-lexer": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", + "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "dev": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "command-line-usage": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.1.tgz", + "integrity": "sha512-F59pEuAR9o1SF/bD0dQBDluhpT4jJQNWUHEuVBqpDmCUo6gPjCi+m9fCWnWZVR/oG6cMTUms4h+3NPl74wGXvA==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "chalk": "^2.4.2", + "table-layout": "^1.0.1", + "typical": "^5.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js-compat": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.7.0.tgz", + "integrity": "sha512-V8yBI3+ZLDVomoWICO6kq/CD28Y4r1M7CWeO4AGpMdMfseu8bkSubBmUPySMGKRTS+su4XQ07zUkAsiu9FCWTg==", + "dev": true, + "requires": { + "browserslist": "^4.14.6", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decimal.js": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", + "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff-sequences": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "dev": true + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.603", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.603.tgz", + "integrity": "sha512-J8OHxOeJkoSLgBXfV9BHgKccgfLMHh+CoeRo6wJsi6m0k3otaxS/5vrHpMNSEYY4MISwewqanPOuhAtuE8riQQ==", + "dev": true + }, + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.2.tgz", + "integrity": "sha512-G28GCrglCAH6+EqMN2D+Q2wCUS1O1vVQJBn8ME2I/Api41YBe4vLWWRBOUbwDH7vwzSZdljxwTRVqnf+sm6XqQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "envinfo": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "exec-sh": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", + "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expect": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-styles": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + }, + "dependencies": { + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", + "dev": true, + "optional": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-potential-custom-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", + "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", + "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", + "dev": true, + "requires": { + "@jest/core": "^26.6.3", + "import-local": "^3.0.2", + "jest-cli": "^26.6.3" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "jest-cli": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", + "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "dev": true, + "requires": { + "@jest/core": "^26.6.3", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "is-ci": "^2.0.0", + "jest-config": "^26.6.3", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "prompts": "^2.0.1", + "yargs": "^15.4.1" + } + } + } + }, + "jest-changed-files": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", + "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "execa": "^4.0.0", + "throat": "^5.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "jest-config": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", + "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^26.6.3", + "@jest/types": "^26.6.2", + "babel-jest": "^26.6.3", + "chalk": "^4.0.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^26.6.2", + "jest-environment-node": "^26.6.2", + "jest-get-type": "^26.3.0", + "jest-jasmine2": "^26.6.3", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-diff": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-docblock": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", + "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", + "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2" + } + }, + "jest-environment-jsdom": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", + "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", + "dev": true, + "requires": { + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2", + "jsdom": "^16.4.0" + } + }, + "jest-environment-node": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", + "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "dev": true, + "requires": { + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" + } + }, + "jest-get-type": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", + "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", + "dev": true + }, + "jest-haste-map": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^26.0.0", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "micromatch": "^4.0.2", + "sane": "^4.0.3", + "walker": "^1.0.7" + }, + "dependencies": { + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "fsevents": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", + "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", + "dev": true, + "optional": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } + } + }, + "jest-jasmine2": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", + "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^26.6.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2", + "throat": "^5.0.0" + } + }, + "jest-leak-detector": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", + "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "dev": true, + "requires": { + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-matcher-utils": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-message-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.2" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-mock": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*" + } + }, + "jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true + }, + "jest-regex-util": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", + "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "dev": true + }, + "jest-resolve": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", + "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^26.6.2", + "read-pkg-up": "^7.0.1", + "resolve": "^1.18.1", + "slash": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "jest-resolve-dependencies": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", + "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-snapshot": "^26.6.2" + } + }, + "jest-runner": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", + "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.7.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-config": "^26.6.3", + "jest-docblock": "^26.0.0", + "jest-haste-map": "^26.6.2", + "jest-leak-detector": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "source-map-support": "^0.5.6", + "throat": "^5.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-runtime": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", + "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/globals": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^0.6.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^15.4.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-serializer": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", + "dev": true, + "requires": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-snapshot": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", + "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.0.0", + "chalk": "^4.0.0", + "expect": "^26.6.2", + "graceful-fs": "^4.2.4", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "jest-haste-map": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "natural-compare": "^1.4.0", + "pretty-format": "^26.6.2", + "semver": "^7.3.2" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "jest-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "is-ci": "^2.0.0", + "micromatch": "^4.0.2" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "jest-validate": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "camelcase": "^6.0.0", + "chalk": "^4.0.0", + "jest-get-type": "^26.3.0", + "leven": "^3.1.0", + "pretty-format": "^26.6.2" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + } + } + }, + "jest-watcher": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", + "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "dev": true, + "requires": { + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^26.6.2", + "string-length": "^4.0.1" + } + }, + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz", + "integrity": "sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "acorn": "^7.1.1", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.2.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.0", + "domexception": "^2.0.1", + "escodegen": "^1.14.1", + "html-encoding-sniffer": "^2.0.1", + "is-potential-custom-element-name": "^1.0.0", + "nwsapi": "^2.2.0", + "parse5": "5.1.1", + "request": "^2.88.2", + "request-promise-native": "^1.0.8", + "saxes": "^5.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0", + "ws": "^7.2.3", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "loader-runner": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", + "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", + "dev": true + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true + }, + "node-notifier": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz", + "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^2.2.0", + "semver": "^7.3.2", + "shellwords": "^0.1.1", + "uuid": "^8.3.0", + "which": "^2.0.2" + }, + "dependencies": { + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "node-releases": { + "version": "1.1.67", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz", + "integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "p-each-series": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", + "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + }, + "dependencies": { + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.0.tgz", + "integrity": "sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw==", + "dev": true + }, + "pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + } + } + }, + "prompts": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", + "integrity": "sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "react-is": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, + "request-promise-core": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", + "dev": true, + "requires": { + "lodash": "^4.17.19" + }, + "dependencies": { + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } + } + }, + "request-promise-native": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", + "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", + "dev": true, + "requires": { + "request-promise-core": "1.1.4", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "resolve": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rsvp": { + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sane": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "dev": true, + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "string-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", + "integrity": "sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "string-natural-compare": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-2.0.3.tgz", + "integrity": "sha512-4Kcl12rNjc+6EKhY8QyDVuQTAlMWwRiNbsxnVwBUKFr7dYPQuXVrtNU4sEkjF9LHY0AY6uVbB3ktbkIH4LC+BQ==" + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-hyperlinks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz", + "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==", + "dev": true, + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + } + }, + "tapable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz", + "integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==", + "dev": true + }, + "terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + } + }, + "terser": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.0.tgz", + "integrity": "sha512-eopt1Gf7/AQyPhpygdKePTzaet31TvQxXvrf7xYUvD/d8qkCJm4SKPDzu+GHK5ZaYTn8rvttfqaZc3swK21e5g==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", + "dev": true, + "requires": { + "jest-worker": "^26.6.1", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.3.8" + }, + "dependencies": { + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "dev": true + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", + "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "v8-to-istanbul": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz", + "integrity": "sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "watchpack": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", + "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + }, + "webpack": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.6.0.tgz", + "integrity": "sha512-SIeFuBhuheKElRbd84O35UhKc0nxlgSwtzm2ksZ0BVhRJqxVJxEguT/pYhfiR0le/pxTa1VsCp7EOYyTsa6XOA==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.45", + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.3.1", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.1.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^4.2.0", + "schema-utils": "^3.0.0", + "tapable": "^2.0.0", + "terser-webpack-plugin": "^5.0.3", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" + } + }, + "webpack-cli": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.2.0.tgz", + "integrity": "sha512-EIl3k88vaF4fSxWSgtAQR+VwicfLMTZ9amQtqS4o+TDPW9HGaEpbFBbAZ4A3ZOT5SOnMxNOzROsSTPiE8tBJPA==", + "dev": true, + "requires": { + "@webpack-cli/info": "^1.1.0", + "@webpack-cli/serve": "^1.1.0", + "colorette": "^1.2.1", + "command-line-usage": "^6.1.0", + "commander": "^6.2.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "leven": "^3.1.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^4.2.2" + }, + "dependencies": { + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.4.0.tgz", + "integrity": "sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^2.0.2", + "webidl-conversions": "^6.1.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", + "dev": true, + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "ws": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + } + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + } + } +} diff --git a/package.json b/package.json index 460cef2c..f09bd26e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "list.js", - "version": "1.2.0", - "description": "The perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML", + "version": "2.3.1", + "description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML", "keywords": [ "list", "search", @@ -11,32 +11,59 @@ "html", "ui" ], - "author": "Jonny Strömberg ", + "author": { + "name": "Jonny Strömberg", + "email": "jonny.stromberg@gmail.com", + "url": "https://javve.com" + }, + "homepage": "https://listjs.com", "repository": "git://github.com/javve/list.js.git", - "dependencies": {}, + "license": "MIT", + "bugs": { + "url": "https://github.com/javve/list.js/issues" + }, + "dependencies": { + "string-natural-compare": "^2.0.2" + }, "devDependencies": { - "browserify": "^13.0.0", - "expect.js": "^0.3.1", - "grunt": "^0.4.5", - "grunt-cli": "^0.1.13", - "grunt-contrib-jshint": "^0.12.0", - "grunt-contrib-uglify": "^0.11.0", - "grunt-contrib-watch": "^0.6.1", - "grunt-mocha": "^0.4.15", - "grunt-shell": "^1.1.2", - "jquery": "^1.12.0" + "@babel/core": "^7.12.7", + "@babel/preset-env": "^7.12.7", + "babel-loader": "^8.2.1", + "jest": "^26.6.3", + "jquery": "^3.5.1", + "prettier": "^2.2.0", + "webpack": "^5.6.0", + "webpack-cli": "^4.2.0" }, - "main": "index", + "main": "src/index", "engines": { - "node": ">= 0.10.21" + "node": "^6.0 || ^8.0 || ^10.0 || ^12.0 || >=14" + }, + "scripts": { + "test": "npx jest", + "build": "npx webpack", + "watch": "npx webpack --watch", + "watch-test": "npx jest --watch", + "preversion": "npm test && npm run build && cp dist/list.min.js docs/assets/javascripts/list.min.js && cp dist/list.min.js.map docs/assets/javascripts/list.min.js.map && git add dist && git add docs/assets/javascripts", + "postversion": "git push --follow-tags origin master && cp package.json docs/_data/pkg.json && git add docs/_data/pkg.json && git commit -m \"pkg.json update\"" }, "npmName": "list.js", "npmFileMap": [ { "basePath": "/dist/", "files": [ - "*.js" + "*.js", + "*.js.map" ] } - ] + ], + "jest": { + "coverageDirectory": "./coverage/", + "collectCoverage": true, + "collectCoverageFrom": [ + "src/*.js", + "src/utils/*.js" + ], + "testURL": "http://localhost/" + } } diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 00000000..342b8e5c --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,5 @@ +module.exports = { + semi: false, + singleQuote: true, + printWidth: 120, +} \ No newline at end of file diff --git a/src/add-async.js b/src/add-async.js index aa223f32..1e034ba3 100644 --- a/src/add-async.js +++ b/src/add-async.js @@ -1,16 +1,16 @@ -module.exports = function(list) { - var addAsync = function(values, callback, items) { - var valuesToAdd = values.splice(0, 50); - items = items || []; - items = items.concat(list.add(valuesToAdd)); +module.exports = function (list) { + var addAsync = function (values, callback, items) { + var valuesToAdd = values.splice(0, 50) + items = items || [] + items = items.concat(list.add(valuesToAdd)) if (values.length > 0) { - setTimeout(function() { - addAsync(values, callback, items); - }, 1); + setTimeout(function () { + addAsync(values, callback, items) + }, 1) } else { - list.update(); - callback(items); + list.update() + callback(items) } - }; - return addAsync; -}; + } + return addAsync +} diff --git a/src/filter.js b/src/filter.js index 4b147670..3fd79f38 100644 --- a/src/filter.js +++ b/src/filter.js @@ -1,29 +1,28 @@ -module.exports = function(list) { - +module.exports = function (list) { // Add handlers - list.handlers.filterStart = list.handlers.filterStart || []; - list.handlers.filterComplete = list.handlers.filterComplete || []; + list.handlers.filterStart = list.handlers.filterStart || [] + list.handlers.filterComplete = list.handlers.filterComplete || [] - return function(filterFunction) { - list.trigger('filterStart'); - list.i = 1; // Reset paging - list.reset.filter(); + return function (filterFunction) { + list.trigger('filterStart') + list.i = 1 // Reset paging + list.reset.filter() if (filterFunction === undefined) { - list.filtered = false; + list.filtered = false } else { - list.filtered = true; - var is = list.items; + list.filtered = true + var is = list.items for (var i = 0, il = is.length; i < il; i++) { - var item = is[i]; + var item = is[i] if (filterFunction(item)) { - item.filtered = true; + item.filtered = true } else { - item.filtered = false; + item.filtered = false } } } - list.update(); - list.trigger('filterComplete'); - return list.visibleItems; - }; -}; + list.update() + list.trigger('filterComplete') + return list.visibleItems + } +} diff --git a/src/fuzzy-search.js b/src/fuzzy-search.js new file mode 100755 index 00000000..91a07c59 --- /dev/null +++ b/src/fuzzy-search.js @@ -0,0 +1,70 @@ +var classes = require('./utils/classes'), + events = require('./utils/events'), + extend = require('./utils/extend'), + toString = require('./utils/to-string'), + getByClass = require('./utils/get-by-class'), + fuzzy = require('./utils/fuzzy') + +module.exports = function (list, options) { + options = options || {} + + options = extend( + { + location: 0, + distance: 100, + threshold: 0.4, + multiSearch: true, + searchClass: 'fuzzy-search', + }, + options + ) + + var fuzzySearch = { + search: function (searchString, columns) { + // Substract arguments from the searchString or put searchString as only argument + var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString] + + for (var k = 0, kl = list.items.length; k < kl; k++) { + fuzzySearch.item(list.items[k], columns, searchArguments) + } + }, + item: function (item, columns, searchArguments) { + var found = true + for (var i = 0; i < searchArguments.length; i++) { + var foundArgument = false + for (var j = 0, jl = columns.length; j < jl; j++) { + if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) { + foundArgument = true + } + } + if (!foundArgument) { + found = false + } + } + item.found = found + }, + values: function (values, value, searchArgument) { + if (values.hasOwnProperty(value)) { + var text = toString(values[value]).toLowerCase() + + if (fuzzy(text, searchArgument, options)) { + return true + } + } + return false + }, + } + + events.bind( + getByClass(list.listContainer, options.searchClass), + 'keyup', + list.utils.events.debounce(function (e) { + var target = e.target || e.srcElement // IE have srcElement + list.search(target.value, fuzzySearch.search) + }, list.searchDelay) + ) + + return function (str, columns) { + list.search(str, columns, fuzzySearch.search) + } +} diff --git a/src/index.js b/src/index.js new file mode 100755 index 00000000..c314855b --- /dev/null +++ b/src/index.js @@ -0,0 +1,263 @@ +var naturalSort = require('string-natural-compare'), + getByClass = require('./utils/get-by-class'), + extend = require('./utils/extend'), + indexOf = require('./utils/index-of'), + events = require('./utils/events'), + toString = require('./utils/to-string'), + classes = require('./utils/classes'), + getAttribute = require('./utils/get-attribute'), + toArray = require('./utils/to-array') + +module.exports = function (id, options, values) { + var self = this, + init, + Item = require('./item')(self), + addAsync = require('./add-async')(self), + initPagination = require('./pagination')(self) + + init = { + start: function () { + self.listClass = 'list' + self.searchClass = 'search' + self.sortClass = 'sort' + self.page = 10000 + self.i = 1 + self.items = [] + self.visibleItems = [] + self.matchingItems = [] + self.searched = false + self.filtered = false + self.searchColumns = undefined + self.searchDelay = 0 + self.handlers = { updated: [] } + self.valueNames = [] + self.utils = { + getByClass: getByClass, + extend: extend, + indexOf: indexOf, + events: events, + toString: toString, + naturalSort: naturalSort, + classes: classes, + getAttribute: getAttribute, + toArray: toArray, + } + + self.utils.extend(self, options) + + self.listContainer = typeof id === 'string' ? document.getElementById(id) : id + if (!self.listContainer) { + return + } + self.list = getByClass(self.listContainer, self.listClass, true) + + self.parse = require('./parse')(self) + self.templater = require('./templater')(self) + self.search = require('./search')(self) + self.filter = require('./filter')(self) + self.sort = require('./sort')(self) + self.fuzzySearch = require('./fuzzy-search')(self, options.fuzzySearch) + + this.handlers() + this.items() + this.pagination() + + self.update() + }, + handlers: function () { + for (var handler in self.handlers) { + if (self[handler] && self.handlers.hasOwnProperty(handler)) { + self.on(handler, self[handler]) + } + } + }, + items: function () { + self.parse(self.list) + if (values !== undefined) { + self.add(values) + } + }, + pagination: function () { + if (options.pagination !== undefined) { + if (options.pagination === true) { + options.pagination = [{}] + } + if (options.pagination[0] === undefined) { + options.pagination = [options.pagination] + } + for (var i = 0, il = options.pagination.length; i < il; i++) { + initPagination(options.pagination[i]) + } + } + }, + } + + /* + * Re-parse the List, use if html have changed + */ + this.reIndex = function () { + self.items = [] + self.visibleItems = [] + self.matchingItems = [] + self.searched = false + self.filtered = false + self.parse(self.list) + } + + this.toJSON = function () { + var json = [] + for (var i = 0, il = self.items.length; i < il; i++) { + json.push(self.items[i].values()) + } + return json + } + + /* + * Add object to list + */ + this.add = function (values, callback) { + if (values.length === 0) { + return + } + if (callback) { + addAsync(values.slice(0), callback) + return + } + var added = [], + notCreate = false + if (values[0] === undefined) { + values = [values] + } + for (var i = 0, il = values.length; i < il; i++) { + var item = null + notCreate = self.items.length > self.page ? true : false + item = new Item(values[i], undefined, notCreate) + self.items.push(item) + added.push(item) + } + self.update() + return added + } + + this.show = function (i, page) { + this.i = i + this.page = page + self.update() + return self + } + + /* Removes object from list. + * Loops through the list and removes objects where + * property "valuename" === value + */ + this.remove = function (valueName, value, options) { + var found = 0 + for (var i = 0, il = self.items.length; i < il; i++) { + if (self.items[i].values()[valueName] == value) { + self.templater.remove(self.items[i], options) + self.items.splice(i, 1) + il-- + i-- + found++ + } + } + self.update() + return found + } + + /* Gets the objects in the list which + * property "valueName" === value + */ + this.get = function (valueName, value) { + var matchedItems = [] + for (var i = 0, il = self.items.length; i < il; i++) { + var item = self.items[i] + if (item.values()[valueName] == value) { + matchedItems.push(item) + } + } + return matchedItems + } + + /* + * Get size of the list + */ + this.size = function () { + return self.items.length + } + + /* + * Removes all items from the list + */ + this.clear = function () { + self.templater.clear() + self.items = [] + return self + } + + this.on = function (event, callback) { + self.handlers[event].push(callback) + return self + } + + this.off = function (event, callback) { + var e = self.handlers[event] + var index = indexOf(e, callback) + if (index > -1) { + e.splice(index, 1) + } + return self + } + + this.trigger = function (event) { + var i = self.handlers[event].length + while (i--) { + self.handlers[event][i](self) + } + return self + } + + this.reset = { + filter: function () { + var is = self.items, + il = is.length + while (il--) { + is[il].filtered = false + } + return self + }, + search: function () { + var is = self.items, + il = is.length + while (il--) { + is[il].found = false + } + return self + }, + } + + this.update = function () { + var is = self.items, + il = is.length + + self.visibleItems = [] + self.matchingItems = [] + self.templater.clear() + for (var i = 0; i < il; i++) { + if (is[i].matching() && self.matchingItems.length + 1 >= self.i && self.visibleItems.length < self.page) { + is[i].show() + self.visibleItems.push(is[i]) + self.matchingItems.push(is[i]) + } else if (is[i].matching()) { + self.matchingItems.push(is[i]) + is[i].hide() + } else { + is[i].hide() + } + } + self.trigger('updated') + return self + } + + init.start() +} diff --git a/src/item.js b/src/item.js index f5ab9a18..41410625 100644 --- a/src/item.js +++ b/src/item.js @@ -1,60 +1,60 @@ -module.exports = function(list) { - return function(initValues, element, notCreate) { - var item = this; +module.exports = function (list) { + return function (initValues, element, notCreate) { + var item = this - this._values = {}; + this._values = {} - this.found = false; // Show if list.searched == true and this.found == true - this.filtered = false;// Show if list.filtered == true and this.filtered == true + this.found = false // Show if list.searched == true and this.found == true + this.filtered = false // Show if list.filtered == true and this.filtered == true - var init = function(initValues, element, notCreate) { + var init = function (initValues, element, notCreate) { if (element === undefined) { if (notCreate) { - item.values(initValues, notCreate); + item.values(initValues, notCreate) } else { - item.values(initValues); + item.values(initValues) } } else { - item.elm = element; - var values = list.templater.get(item, initValues); - item.values(values); + item.elm = element + var values = list.templater.get(item, initValues) + item.values(values) } - }; + } - this.values = function(newValues, notCreate) { + this.values = function (newValues, notCreate) { if (newValues !== undefined) { - for(var name in newValues) { - item._values[name] = newValues[name]; + for (var name in newValues) { + item._values[name] = newValues[name] } if (notCreate !== true) { - list.templater.set(item, item.values()); + list.templater.set(item, item.values()) } } else { - return item._values; + return item._values } - }; + } - this.show = function() { - list.templater.show(item); - }; + this.show = function () { + list.templater.show(item) + } - this.hide = function() { - list.templater.hide(item); - }; + this.hide = function () { + list.templater.hide(item) + } - this.matching = function() { + this.matching = function () { return ( (list.filtered && list.searched && item.found && item.filtered) || (list.filtered && !list.searched && item.filtered) || (!list.filtered && list.searched && item.found) || (!list.filtered && !list.searched) - ); - }; + ) + } - this.visible = function() { - return (item.elm && (item.elm.parentNode == list.list)) ? true : false; - }; + this.visible = function () { + return item.elm && item.elm.parentNode == list.list ? true : false + } - init(initValues, element, notCreate); - }; -}; + init(initValues, element, notCreate) + } +} diff --git a/src/pagination.js b/src/pagination.js new file mode 100644 index 00000000..ae93b9f7 --- /dev/null +++ b/src/pagination.js @@ -0,0 +1,108 @@ +var classes = require('./utils/classes'), + events = require('./utils/events'), + List = require('./index') + +module.exports = function (list) { + var isHidden = false + + var refresh = function (pagingList, options) { + if (list.page < 1) { + list.listContainer.style.display = 'none' + isHidden = true + return + } else if (isHidden) { + list.listContainer.style.display = 'block' + } + + var item, + l = list.matchingItems.length, + index = list.i, + page = list.page, + pages = Math.ceil(l / page), + currentPage = Math.ceil(index / page), + innerWindow = options.innerWindow || 2, + left = options.left || options.outerWindow || 0, + right = options.right || options.outerWindow || 0 + + right = pages - right + pagingList.clear() + for (var i = 1; i <= pages; i++) { + var className = currentPage === i ? 'active' : '' + + //console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className); + + if (is.number(i, left, right, currentPage, innerWindow)) { + item = pagingList.add({ + page: i, + dotted: false, + })[0] + if (className) { + classes(item.elm).add(className) + } + item.elm.firstChild.setAttribute('data-i', i) + item.elm.firstChild.setAttribute('data-page', page) + } else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) { + item = pagingList.add({ + page: '...', + dotted: true, + })[0] + classes(item.elm).add('disabled') + } + } + } + + var is = { + number: function (i, left, right, currentPage, innerWindow) { + return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow) + }, + left: function (i, left) { + return i <= left + }, + right: function (i, right) { + return i > right + }, + innerWindow: function (i, currentPage, innerWindow) { + return i >= currentPage - innerWindow && i <= currentPage + innerWindow + }, + dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) { + return ( + this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) || + this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem) + ) + }, + dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) { + return i == left + 1 && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right) + }, + dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) { + if (pagingList.items[currentPageItem - 1].values().dotted) { + return false + } else { + return i == right && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right) + } + }, + } + + return function (options) { + var pagingList = new List(list.listContainer.id, { + listClass: options.paginationClass || 'pagination', + item: options.item || "
      • ", + valueNames: ['page', 'dotted'], + searchClass: 'pagination-search-that-is-not-supposed-to-exist', + sortClass: 'pagination-sort-that-is-not-supposed-to-exist', + }) + + events.bind(pagingList.listContainer, 'click', function (e) { + var target = e.target || e.srcElement, + page = list.utils.getAttribute(target, 'data-page'), + i = list.utils.getAttribute(target, 'data-i') + if (i) { + list.show((i - 1) * page + 1, page) + } + }) + + list.on('updated', function () { + refresh(pagingList, options) + }) + refresh(pagingList, options) + } +} diff --git a/src/parse.js b/src/parse.js index 2294a476..0abe5900 100644 --- a/src/parse.js +++ b/src/parse.js @@ -1,47 +1,46 @@ -module.exports = function(list) { +module.exports = function (list) { + var Item = require('./item')(list) - var Item = require('./item')(list); - - var getChildren = function(parent) { + var getChildren = function (parent) { var nodes = parent.childNodes, - items = []; + items = [] for (var i = 0, il = nodes.length; i < il; i++) { // Only textnodes have a data attribute if (nodes[i].data === undefined) { - items.push(nodes[i]); + items.push(nodes[i]) } } - return items; - }; + return items + } - var parse = function(itemElements, valueNames) { + var parse = function (itemElements, valueNames) { for (var i = 0, il = itemElements.length; i < il; i++) { - list.items.push(new Item(valueNames, itemElements[i])); + list.items.push(new Item(valueNames, itemElements[i])) } - }; - var parseAsync = function(itemElements, valueNames) { - var itemsToIndex = itemElements.splice(0, 50); // TODO: If < 100 items, what happens in IE etc? - parse(itemsToIndex, valueNames); + } + var parseAsync = function (itemElements, valueNames) { + var itemsToIndex = itemElements.splice(0, 50) // TODO: If < 100 items, what happens in IE etc? + parse(itemsToIndex, valueNames) if (itemElements.length > 0) { - setTimeout(function() { - parseAsync(itemElements, valueNames); - }, 1); + setTimeout(function () { + parseAsync(itemElements, valueNames) + }, 1) } else { - list.update(); - list.trigger('parseComplete'); + list.update() + list.trigger('parseComplete') } - }; + } - list.handlers.parseComplete = list.handlers.parseComplete || []; + list.handlers.parseComplete = list.handlers.parseComplete || [] - return function() { + return function () { var itemsToIndex = getChildren(list.list), - valueNames = list.valueNames; + valueNames = list.valueNames if (list.indexAsync) { - parseAsync(itemsToIndex, valueNames); + parseAsync(itemsToIndex, valueNames) } else { - parse(itemsToIndex, valueNames); + parse(itemsToIndex, valueNames) } - }; -}; + } +} diff --git a/src/search.js b/src/search.js old mode 100644 new mode 100755 index 2aeeb00f..06c2d4b1 --- a/src/search.js +++ b/src/search.js @@ -1,117 +1,136 @@ -module.exports = function(list) { - var item, - text, - columns, - searchString, - customSearch; +module.exports = function (list) { + var item, text, columns, searchString, customSearch var prepare = { - resetList: function() { - list.i = 1; - list.templater.clear(); - customSearch = undefined; + resetList: function () { + list.i = 1 + list.templater.clear() + customSearch = undefined }, - setOptions: function(args) { + setOptions: function (args) { if (args.length == 2 && args[1] instanceof Array) { - columns = args[1]; - } else if (args.length == 2 && typeof(args[1]) == "function") { - customSearch = args[1]; + columns = args[1] + } else if (args.length == 2 && typeof args[1] == 'function') { + columns = undefined + customSearch = args[1] } else if (args.length == 3) { - columns = args[1]; - customSearch = args[2]; + columns = args[1] + customSearch = args[2] + } else { + columns = undefined } }, - setColumns: function() { - if (list.items.length === 0) return; + setColumns: function () { + if (list.items.length === 0) return if (columns === undefined) { - columns = (list.searchColumns === undefined) ? prepare.toArray(list.items[0].values()) : list.searchColumns; + columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns } }, - setSearchString: function(s) { - s = list.utils.toString(s).toLowerCase(); - s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&"); // Escape regular expression characters - searchString = s; + setSearchString: function (s) { + s = list.utils.toString(s).toLowerCase() + s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&') // Escape regular expression characters + searchString = s }, - toArray: function(values) { - var tmpColumn = []; + toArray: function (values) { + var tmpColumn = [] for (var name in values) { - tmpColumn.push(name); + tmpColumn.push(name) } - return tmpColumn; - } - }; + return tmpColumn + }, + } var search = { - list: function() { - for (var k = 0, kl = list.items.length; k < kl; k++) { - search.item(list.items[k]); + list: function () { + // Extract quoted phrases "word1 word2" from original searchString + // searchString is converted to lowercase by List.js + var words = [], + phrase, + ss = searchString + while ((phrase = ss.match(/"([^"]+)"/)) !== null) { + words.push(phrase[1]) + ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length) } - }, - item: function(item) { - item.found = false; - for (var j = 0, jl = columns.length; j < jl; j++) { - if (search.values(item.values(), columns[j])) { - item.found = true; - return; + // Get remaining space-separated words (if any) + ss = ss.trim() + if (ss.length) words = words.concat(ss.split(/\s+/)) + for (var k = 0, kl = list.items.length; k < kl; k++) { + var item = list.items[k] + item.found = false + if (!words.length) continue + for (var i = 0, il = words.length; i < il; i++) { + var word_found = false + for (var j = 0, jl = columns.length; j < jl; j++) { + var values = item.values(), + column = columns[j] + if (values.hasOwnProperty(column) && values[column] !== undefined && values[column] !== null) { + var text = typeof values[column] !== 'string' ? values[column].toString() : values[column] + if (text.toLowerCase().indexOf(words[i]) !== -1) { + // word found, so no need to check it against any other columns + word_found = true + break + } + } + } + // this word not found? no need to check any other words, the item cannot match + if (!word_found) break } + item.found = word_found } }, - values: function(values, column) { - if (values.hasOwnProperty(column)) { - text = list.utils.toString(values[column]).toLowerCase(); - if ((searchString !== "") && (text.search(searchString) > -1)) { - return true; - } - } - return false; + // Removed search.item() and search.values() + reset: function () { + list.reset.search() + list.searched = false }, - reset: function() { - list.reset.search(); - list.searched = false; - } - }; + } - var searchMethod = function(str) { - list.trigger('searchStart'); + var searchMethod = function (str) { + list.trigger('searchStart') - prepare.resetList(); - prepare.setSearchString(str); - prepare.setOptions(arguments); // str, cols|searchFunction, searchFunction - prepare.setColumns(); + prepare.resetList() + prepare.setSearchString(str) + prepare.setOptions(arguments) // str, cols|searchFunction, searchFunction + prepare.setColumns() - if (searchString === "" ) { - search.reset(); + if (searchString === '') { + search.reset() } else { - list.searched = true; + list.searched = true if (customSearch) { - customSearch(searchString, columns); + customSearch(searchString, columns) } else { - search.list(); + search.list() } } - list.update(); - list.trigger('searchComplete'); - return list.visibleItems; - }; + list.update() + list.trigger('searchComplete') + return list.visibleItems + } - list.handlers.searchStart = list.handlers.searchStart || []; - list.handlers.searchComplete = list.handlers.searchComplete || []; + list.handlers.searchStart = list.handlers.searchStart || [] + list.handlers.searchComplete = list.handlers.searchComplete || [] - list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'keyup', function(e) { - var target = e.target || e.srcElement, // IE have srcElement - alreadyCleared = (target.value === "" && !list.searched); - if (!alreadyCleared) { // If oninput already have resetted the list, do nothing - searchMethod(target.value); - } - }); + list.utils.events.bind( + list.utils.getByClass(list.listContainer, list.searchClass), + 'keyup', + list.utils.events.debounce(function (e) { + var target = e.target || e.srcElement, // IE have srcElement + alreadyCleared = target.value === '' && !list.searched + if (!alreadyCleared) { + // If oninput already have resetted the list, do nothing + searchMethod(target.value) + } + }, list.searchDelay) + ) // Used to detect click on HTML5 clear button - list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function(e) { - var target = e.target || e.srcElement; - if (target.value === "") { - searchMethod(''); + list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function (e) { + var target = e.target || e.srcElement + if (target.value === '') { + searchMethod('') } - }); + }) - return searchMethod; -}; + return searchMethod +} diff --git a/src/sort.js b/src/sort.js index 18030f6a..4e4b415f 100644 --- a/src/sort.js +++ b/src/sort.js @@ -1,90 +1,104 @@ -module.exports = function(list) { - list.sortFunction = list.sortFunction || function(itemA, itemB, options) { - options.desc = options.order == "desc" ? true : false; // Natural sort uses this format - return list.utils.naturalSort(itemA.values()[options.valueName], itemB.values()[options.valueName], options); - }; - +module.exports = function (list) { var buttons = { els: undefined, - clear: function() { + clear: function () { for (var i = 0, il = buttons.els.length; i < il; i++) { - list.utils.classes(buttons.els[i]).remove('asc'); - list.utils.classes(buttons.els[i]).remove('desc'); + list.utils.classes(buttons.els[i]).remove('asc') + list.utils.classes(buttons.els[i]).remove('desc') } }, - getOrder: function(btn) { - var predefinedOrder = list.utils.getAttribute(btn, 'data-order'); - if (predefinedOrder == "asc" || predefinedOrder == "desc") { - return predefinedOrder; + getOrder: function (btn) { + var predefinedOrder = list.utils.getAttribute(btn, 'data-order') + if (predefinedOrder == 'asc' || predefinedOrder == 'desc') { + return predefinedOrder } else if (list.utils.classes(btn).has('desc')) { - return "asc"; + return 'asc' } else if (list.utils.classes(btn).has('asc')) { - return "desc"; + return 'desc' } else { - return "asc"; + return 'asc' } }, - getInSensitive: function(btn, options) { - var insensitive = list.utils.getAttribute(btn, 'data-insensitive'); - if (insensitive === "false") { - options.insensitive = false; + getInSensitive: function (btn, options) { + var insensitive = list.utils.getAttribute(btn, 'data-insensitive') + if (insensitive === 'false') { + options.insensitive = false } else { - options.insensitive = true; + options.insensitive = true } }, - setOrder: function(options) { + setOrder: function (options) { for (var i = 0, il = buttons.els.length; i < il; i++) { - var btn = buttons.els[i]; + var btn = buttons.els[i] if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) { - continue; + continue } - var predefinedOrder = list.utils.getAttribute(btn, 'data-order'); - if (predefinedOrder == "asc" || predefinedOrder == "desc") { + var predefinedOrder = list.utils.getAttribute(btn, 'data-order') + if (predefinedOrder == 'asc' || predefinedOrder == 'desc') { if (predefinedOrder == options.order) { - list.utils.classes(btn).add(options.order); + list.utils.classes(btn).add(options.order) } } else { - list.utils.classes(btn).add(options.order); + list.utils.classes(btn).add(options.order) } } - } - }; - var sort = function() { - list.trigger('sortStart'); - var options = {}; + }, + } - var target = arguments[0].currentTarget || arguments[0].srcElement || undefined; + var sort = function () { + list.trigger('sortStart') + var options = {} + + var target = arguments[0].currentTarget || arguments[0].srcElement || undefined if (target) { - options.valueName = list.utils.getAttribute(target, 'data-sort'); - buttons.getInSensitive(target, options); - options.order = buttons.getOrder(target); + options.valueName = list.utils.getAttribute(target, 'data-sort') + buttons.getInSensitive(target, options) + options.order = buttons.getOrder(target) + } else { + options = arguments[1] || options + options.valueName = arguments[0] + options.order = options.order || 'asc' + options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive + } + + buttons.clear() + buttons.setOrder(options) + + // caseInsensitive + // alphabet + var customSortFunction = options.sortFunction || list.sortFunction || null, + multi = options.order === 'desc' ? -1 : 1, + sortFunction + + if (customSortFunction) { + sortFunction = function (itemA, itemB) { + return customSortFunction(itemA, itemB, options) * multi + } } else { - options = arguments[1] || options; - options.valueName = arguments[0]; - options.order = options.order || "asc"; - options.insensitive = (typeof options.insensitive == "undefined") ? true : options.insensitive; + sortFunction = function (itemA, itemB) { + var sort = list.utils.naturalSort + sort.alphabet = list.alphabet || options.alphabet || undefined + if (!sort.alphabet && options.insensitive) { + sort = list.utils.naturalSort.caseInsensitive + } + return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi + } } - buttons.clear(); - buttons.setOrder(options); - options.sortFunction = options.sortFunction || list.sortFunction; - list.items.sort(function(a, b) { - var mult = (options.order === 'desc') ? -1 : 1; - return (options.sortFunction(a, b, options) * mult); - }); - list.update(); - list.trigger('sortComplete'); - }; + list.items.sort(sortFunction) + list.update() + list.trigger('sortComplete') + } // Add handlers - list.handlers.sortStart = list.handlers.sortStart || []; - list.handlers.sortComplete = list.handlers.sortComplete || []; + list.handlers.sortStart = list.handlers.sortStart || [] + list.handlers.sortComplete = list.handlers.sortComplete || [] - buttons.els = list.utils.getByClass(list.listContainer, list.sortClass); - list.utils.events.bind(buttons.els, 'click', sort); - list.on('searchStart', buttons.clear); - list.on('filterStart', buttons.clear); + buttons.els = list.utils.getByClass(list.listContainer, list.sortClass) + list.utils.events.bind(buttons.els, 'click', sort) + list.on('searchStart', buttons.clear) + list.on('filterStart', buttons.clear) - return sort; -}; + return sort +} diff --git a/src/templater.js b/src/templater.js index 782fd609..5d09973d 100644 --- a/src/templater.js +++ b/src/templater.js @@ -1,169 +1,195 @@ -var Templater = function(list) { - var itemSource, - templater = this; - - var init = function() { - itemSource = templater.getItemSource(list.item); - itemSource = templater.clearSourceItem(itemSource, list.valueNames); - }; - - this.clearSourceItem = function(el, valueNames) { - for(var i = 0, il = valueNames.length; i < il; i++) { - var elm; - if (valueNames[i].data) { - for (var j = 0, jl = valueNames[i].data.length; j < jl; j++) { - el.setAttribute('data-'+valueNames[i].data[j], ''); +var Templater = function (list) { + var createItem, + templater = this + + var init = function () { + var itemSource + + if (typeof list.item === 'function') { + createItem = function (values) { + var item = list.item(values) + return getItemSource(item) + } + return + } + + if (typeof list.item === 'string') { + if (list.item.indexOf('<') === -1) { + itemSource = document.getElementById(list.item) + } else { + itemSource = getItemSource(list.item) + } + } else { + /* If item source does not exists, use the first item in list as + source for new items */ + itemSource = getFirstListItem() + } + + if (!itemSource) { + throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.") + } + + itemSource = createCleanTemplateItem(itemSource, list.valueNames) + + createItem = function () { + return itemSource.cloneNode(true) + } + } + + var createCleanTemplateItem = function (templateNode, valueNames) { + var el = templateNode.cloneNode(true) + el.removeAttribute('id') + + for (var i = 0, il = valueNames.length; i < il; i++) { + var elm = undefined, + valueName = valueNames[i] + if (valueName.data) { + for (var j = 0, jl = valueName.data.length; j < jl; j++) { + el.setAttribute('data-' + valueName.data[j], '') } - } else if (valueNames[i].attr && valueNames[i].name) { - elm = list.utils.getByClass(el, valueNames[i].name, true); + } else if (valueName.attr && valueName.name) { + elm = list.utils.getByClass(el, valueName.name, true) if (elm) { - elm.setAttribute(valueNames[i].attr, ""); + elm.setAttribute(valueName.attr, '') } } else { - elm = list.utils.getByClass(el, valueNames[i], true); + elm = list.utils.getByClass(el, valueName, true) if (elm) { - elm.innerHTML = ""; + elm.innerHTML = '' } } - elm = undefined; } - return el; - }; - - this.getItemSource = function(item) { - if (item === undefined) { - var nodes = list.list.childNodes, - items = []; - - for (var i = 0, il = nodes.length; i < il; i++) { - // Only textnodes have a data attribute - if (nodes[i].data === undefined) { - return nodes[i].cloneNode(true); - } - } - } else if (/^tr[\s>]/.exec(item)) { - var table = document.createElement('table'); - table.innerHTML = item; - return table.firstChild; - } else if (item.indexOf("<") !== -1) { - var div = document.createElement('div'); - div.innerHTML = item; - return div.firstChild; - } else { - var source = document.getElementById(list.item); - if (source) { - return source; + return el + } + + var getFirstListItem = function () { + var nodes = list.list.childNodes + + for (var i = 0, il = nodes.length; i < il; i++) { + // Only textnodes have a data attribute + if (nodes[i].data === undefined) { + return nodes[i].cloneNode(true) } } - throw new Error("The list need to have at list one item on init otherwise you'll have to add a template."); - }; - - this.get = function(item, valueNames) { - templater.create(item); - var values = {}; - for(var i = 0, il = valueNames.length; i < il; i++) { - var elm; - if (valueNames[i].data) { - for (var j = 0, jl = valueNames[i].data.length; j < jl; j++) { - values[valueNames[i].data[j]] = list.utils.getAttribute(item.elm, 'data-'+valueNames[i].data[j]); - } - } else if (valueNames[i].attr && valueNames[i].name) { - elm = list.utils.getByClass(item.elm, valueNames[i].name, true); - values[valueNames[i].name] = elm ? list.utils.getAttribute(elm, valueNames[i].attr) : ""; - } else { - elm = list.utils.getByClass(item.elm, valueNames[i], true); - values[valueNames[i]] = elm ? elm.innerHTML : ""; - } - elm = undefined; + return undefined + } + + var getItemSource = function (itemHTML) { + if (typeof itemHTML !== 'string') return undefined + if (/]/g.exec(itemHTML)) { + var tbody = document.createElement('tbody') + tbody.innerHTML = itemHTML + return tbody.firstElementChild + } else if (itemHTML.indexOf('<') !== -1) { + var div = document.createElement('div') + div.innerHTML = itemHTML + return div.firstElementChild } - return values; - }; - - this.set = function(item, values) { - var getValueName = function(name) { - for (var i = 0, il = list.valueNames.length; i < il; i++) { - if (list.valueNames[i].data) { - var data = list.valueNames[i].data; - for (var j = 0, jl = data.length; j < jl; j++) { - if (data[j] === name) { - return { data: name }; - } + return undefined + } + + var getValueName = function (name) { + for (var i = 0, il = list.valueNames.length; i < il; i++) { + var valueName = list.valueNames[i] + if (valueName.data) { + var data = valueName.data + for (var j = 0, jl = data.length; j < jl; j++) { + if (data[j] === name) { + return { data: name } } - } else if (list.valueNames[i].attr && list.valueNames[i].name && list.valueNames[i].name == name) { - return list.valueNames[i]; - } else if (list.valueNames[i] === name) { - return name; } + } else if (valueName.attr && valueName.name && valueName.name == name) { + return valueName + } else if (valueName === name) { + return name } - }; - var setValue = function(name, value) { - var elm; - var valueName = getValueName(name); - if (!valueName) - return; + } + } + + var setValue = function (item, name, value) { + var elm = undefined, + valueName = getValueName(name) + if (!valueName) return + if (valueName.data) { + item.elm.setAttribute('data-' + valueName.data, value) + } else if (valueName.attr && valueName.name) { + elm = list.utils.getByClass(item.elm, valueName.name, true) + if (elm) { + elm.setAttribute(valueName.attr, value) + } + } else { + elm = list.utils.getByClass(item.elm, valueName, true) + if (elm) { + elm.innerHTML = value + } + } + } + + this.get = function (item, valueNames) { + templater.create(item) + var values = {} + for (var i = 0, il = valueNames.length; i < il; i++) { + var elm = undefined, + valueName = valueNames[i] if (valueName.data) { - item.elm.setAttribute('data-'+valueName.data, value); - } else if (valueName.attr && valueName.name) { - elm = list.utils.getByClass(item.elm, valueName.name, true); - if (elm) { - elm.setAttribute(valueName.attr, value); + for (var j = 0, jl = valueName.data.length; j < jl; j++) { + values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j]) } + } else if (valueName.attr && valueName.name) { + elm = list.utils.getByClass(item.elm, valueName.name, true) + values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : '' } else { - elm = list.utils.getByClass(item.elm, valueName, true); - if (elm) { - elm.innerHTML = value; - } + elm = list.utils.getByClass(item.elm, valueName, true) + values[valueName] = elm ? elm.innerHTML : '' } - elm = undefined; - }; + } + return values + } + + this.set = function (item, values) { if (!templater.create(item)) { - for(var v in values) { + for (var v in values) { if (values.hasOwnProperty(v)) { - setValue(v, values[v]); + setValue(item, v, values[v]) } } } - }; + } - this.create = function(item) { + this.create = function (item) { if (item.elm !== undefined) { - return false; + return false } - /* If item source does not exists, use the first item in list as - source for new items */ - var newItem = itemSource.cloneNode(true); - newItem.removeAttribute('id'); - item.elm = newItem; - templater.set(item, item.values()); - return true; - }; - this.remove = function(item) { + item.elm = createItem(item.values()) + templater.set(item, item.values()) + return true + } + this.remove = function (item) { if (item.elm.parentNode === list.list) { - list.list.removeChild(item.elm); + list.list.removeChild(item.elm) } - }; - this.show = function(item) { - templater.create(item); - list.list.appendChild(item.elm); - }; - this.hide = function(item) { + } + this.show = function (item) { + templater.create(item) + list.list.appendChild(item.elm) + } + this.hide = function (item) { if (item.elm !== undefined && item.elm.parentNode === list.list) { - list.list.removeChild(item.elm); + list.list.removeChild(item.elm) } - }; - this.clear = function() { + } + this.clear = function () { /* .innerHTML = ''; fucks up IE */ if (list.list.hasChildNodes()) { - while (list.list.childNodes.length >= 1) - { - list.list.removeChild(list.list.firstChild); + while (list.list.childNodes.length >= 1) { + list.list.removeChild(list.list.firstChild) } } - }; + } - init(); -}; + init() +} -module.exports = function(list) { - return new Templater(list); -}; +module.exports = function (list) { + return new Templater(list) +} diff --git a/src/utils/classes.js b/src/utils/classes.js index d7b5430e..523f277d 100644 --- a/src/utils/classes.js +++ b/src/utils/classes.js @@ -2,19 +2,19 @@ * Module dependencies. */ -var index = require('./index-of'); +var index = require('./index-of') /** * Whitespace regexp. */ -var re = /\s+/; +var re = /\s+/ /** * toString reference. */ -var toString = Object.prototype.toString; +var toString = Object.prototype.toString /** * Wrap `el` in a `ClassList`. @@ -24,9 +24,9 @@ var toString = Object.prototype.toString; * @api public */ -module.exports = function(el){ - return new ClassList(el); -}; +module.exports = function (el) { + return new ClassList(el) +} /** * Initialize a new ClassList for `el`. @@ -37,10 +37,10 @@ module.exports = function(el){ function ClassList(el) { if (!el || !el.nodeType) { - throw new Error('A DOM element reference is required'); + throw new Error('A DOM element reference is required') } - this.el = el; - this.list = el.classList; + this.el = el + this.list = el.classList } /** @@ -51,20 +51,20 @@ function ClassList(el) { * @api public */ -ClassList.prototype.add = function(name){ +ClassList.prototype.add = function (name) { // classList if (this.list) { - this.list.add(name); - return this; + this.list.add(name) + return this } // fallback - var arr = this.array(); - var i = index(arr, name); - if (!~i) arr.push(name); - this.el.className = arr.join(' '); - return this; -}; + var arr = this.array() + var i = index(arr, name) + if (!~i) arr.push(name) + this.el.className = arr.join(' ') + return this +} /** * Remove class `name` when present, or @@ -76,42 +76,20 @@ ClassList.prototype.add = function(name){ * @api public */ -ClassList.prototype.remove = function(name){ - if ('[object RegExp]' == toString.call(name)) { - return this.removeMatching(name); - } - +ClassList.prototype.remove = function (name) { // classList if (this.list) { - this.list.remove(name); - return this; + this.list.remove(name) + return this } // fallback - var arr = this.array(); - var i = index(arr, name); - if (~i) arr.splice(i, 1); - this.el.className = arr.join(' '); - return this; -}; - -/** - * Remove all classes matching `re`. - * - * @param {RegExp} re - * @return {ClassList} - * @api private - */ - -ClassList.prototype.removeMatching = function(re){ - var arr = this.array(); - for (var i = 0; i < arr.length; i++) { - if (re.test(arr[i])) { - this.remove(arr[i]); - } - } - return this; -}; + var arr = this.array() + var i = index(arr, name) + if (~i) arr.splice(i, 1) + this.el.className = arr.join(' ') + return this +} /** * Toggle class `name`, can force state via `force`. @@ -125,36 +103,36 @@ ClassList.prototype.removeMatching = function(re){ * @api public */ -ClassList.prototype.toggle = function(name, force){ +ClassList.prototype.toggle = function (name, force) { // classList if (this.list) { - if ("undefined" !== typeof force) { + if ('undefined' !== typeof force) { if (force !== this.list.toggle(name, force)) { - this.list.toggle(name); // toggle again to correct + this.list.toggle(name) // toggle again to correct } } else { - this.list.toggle(name); + this.list.toggle(name) } - return this; + return this } // fallback - if ("undefined" !== typeof force) { + if ('undefined' !== typeof force) { if (!force) { - this.remove(name); + this.remove(name) } else { - this.add(name); + this.add(name) } } else { if (this.has(name)) { - this.remove(name); + this.remove(name) } else { - this.add(name); + this.add(name) } } - return this; -}; + return this +} /** * Return an array of classes. @@ -163,13 +141,13 @@ ClassList.prototype.toggle = function(name, force){ * @api public */ -ClassList.prototype.array = function(){ - var className = this.el.getAttribute('class') || ''; - var str = className.replace(/^\s+|\s+$/g, ''); - var arr = str.split(re); - if ('' === arr[0]) arr.shift(); - return arr; -}; +ClassList.prototype.array = function () { + var className = this.el.getAttribute('class') || '' + var str = className.replace(/^\s+|\s+$/g, '') + var arr = str.split(re) + if ('' === arr[0]) arr.shift() + return arr +} /** * Check if class `name` is present. @@ -179,7 +157,6 @@ ClassList.prototype.array = function(){ * @api public */ -ClassList.prototype.has = -ClassList.prototype.contains = function(name){ - return this.list ? this.list.contains(name) : !! ~index(this.array(), name); -}; +ClassList.prototype.has = ClassList.prototype.contains = function (name) { + return this.list ? this.list.contains(name) : !!~index(this.array(), name) +} diff --git a/src/utils/events.js b/src/utils/events.js old mode 100644 new mode 100755 index 21695985..03f0b490 --- a/src/utils/events.js +++ b/src/utils/events.js @@ -1,7 +1,7 @@ var bind = window.addEventListener ? 'addEventListener' : 'attachEvent', - unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent', - prefix = bind !== 'addEventListener' ? 'on' : '', - toArray = require('./to-array'); + unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent', + prefix = bind !== 'addEventListener' ? 'on' : '', + toArray = require('./to-array') /** * Bind `el` event `type` to `fn`. @@ -13,12 +13,12 @@ var bind = window.addEventListener ? 'addEventListener' : 'attachEvent', * @api public */ -exports.bind = function(el, type, fn, capture){ - el = toArray(el); - for ( var i = 0; i < el.length; i++ ) { - el[i][bind](prefix + type, fn, capture || false); +exports.bind = function (el, type, fn, capture) { + el = toArray(el) + for (var i = 0, il = el.length; i < il; i++) { + el[i][bind](prefix + type, fn, capture || false) } -}; +} /** * Unbind `el` event `type`'s callback `fn`. @@ -30,9 +30,39 @@ exports.bind = function(el, type, fn, capture){ * @api public */ -exports.unbind = function(el, type, fn, capture){ - el = toArray(el); - for ( var i = 0; i < el.length; i++ ) { - el[i][unbind](prefix + type, fn, capture || false); +exports.unbind = function (el, type, fn, capture) { + el = toArray(el) + for (var i = 0, il = el.length; i < il; i++) { + el[i][unbind](prefix + type, fn, capture || false) } -}; +} + +/** + * Returns a function, that, as long as it continues to be invoked, will not + * be triggered. The function will be called after it stops being called for + * `wait` milliseconds. If `immediate` is true, trigger the function on the + * leading edge, instead of the trailing. + * + * @param {Function} fn + * @param {Integer} wait + * @param {Boolean} immediate + * @api public + */ + +exports.debounce = function (fn, wait, immediate) { + var timeout + return wait + ? function () { + var context = this, + args = arguments + var later = function () { + timeout = null + if (!immediate) fn.apply(context, args) + } + var callNow = immediate && !timeout + clearTimeout(timeout) + timeout = setTimeout(later, wait) + if (callNow) fn.apply(context, args) + } + : fn +} diff --git a/src/utils/extend.js b/src/utils/extend.js index 9fc60375..38cbe56b 100644 --- a/src/utils/extend.js +++ b/src/utils/extend.js @@ -2,17 +2,17 @@ * Source: https://github.com/segmentio/extend */ -module.exports = function extend (object) { - // Takes an unlimited number of extenders. - var args = Array.prototype.slice.call(arguments, 1); +module.exports = function extend(object) { + // Takes an unlimited number of extenders. + var args = Array.prototype.slice.call(arguments, 1) - // For each extender, copy their properties on our object. - for (var i = 0, source; source = args[i]; i++) { - if (!source) continue; - for (var property in source) { - object[property] = source[property]; - } + // For each extender, copy their properties on our object. + for (var i = 0, source; (source = args[i]); i++) { + if (!source) continue + for (var property in source) { + object[property] = source[property] } + } - return object; -}; + return object +} diff --git a/src/utils/fuzzy.js b/src/utils/fuzzy.js new file mode 100644 index 00000000..c123dfc4 --- /dev/null +++ b/src/utils/fuzzy.js @@ -0,0 +1,123 @@ +module.exports = function (text, pattern, options) { + // Aproximately where in the text is the pattern expected to be found? + var Match_Location = options.location || 0 + + //Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold. + var Match_Distance = options.distance || 100 + + // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything. + var Match_Threshold = options.threshold || 0.4 + + if (pattern === text) return true // Exact match + if (pattern.length > 32) return false // This algorithm cannot be used + + // Set starting location at beginning text and initialise the alphabet. + var loc = Match_Location, + s = (function () { + var q = {}, + i + + for (i = 0; i < pattern.length; i++) { + q[pattern.charAt(i)] = 0 + } + + for (i = 0; i < pattern.length; i++) { + q[pattern.charAt(i)] |= 1 << (pattern.length - i - 1) + } + + return q + })() + + // Compute and return the score for a match with e errors and x location. + // Accesses loc and pattern through being a closure. + + function match_bitapScore_(e, x) { + var accuracy = e / pattern.length, + proximity = Math.abs(loc - x) + + if (!Match_Distance) { + // Dodge divide by zero error. + return proximity ? 1.0 : accuracy + } + return accuracy + proximity / Match_Distance + } + + var score_threshold = Match_Threshold, // Highest score beyond which we give up. + best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup) + + if (best_loc != -1) { + score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold) + // What about in the other direction? (speedup) + best_loc = text.lastIndexOf(pattern, loc + pattern.length) + + if (best_loc != -1) { + score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold) + } + } + + // Initialise the bit arrays. + var matchmask = 1 << (pattern.length - 1) + best_loc = -1 + + var bin_min, bin_mid + var bin_max = pattern.length + text.length + var last_rd + for (var d = 0; d < pattern.length; d++) { + // Scan for the best match; each iteration allows for one more error. + // Run a binary search to determine how far from 'loc' we can stray at this + // error level. + bin_min = 0 + bin_mid = bin_max + while (bin_min < bin_mid) { + if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) { + bin_min = bin_mid + } else { + bin_max = bin_mid + } + bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min) + } + // Use the result from this iteration as the maximum for the next. + bin_max = bin_mid + var start = Math.max(1, loc - bin_mid + 1) + var finish = Math.min(loc + bin_mid, text.length) + pattern.length + + var rd = Array(finish + 2) + rd[finish + 1] = (1 << d) - 1 + for (var j = finish; j >= start; j--) { + // The alphabet (s) is a sparse hash, so the following line generates + // warnings. + var charMatch = s[text.charAt(j - 1)] + if (d === 0) { + // First pass: exact match. + rd[j] = ((rd[j + 1] << 1) | 1) & charMatch + } else { + // Subsequent passes: fuzzy match. + rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1] + } + if (rd[j] & matchmask) { + var score = match_bitapScore_(d, j - 1) + // This match will almost certainly be better than any existing match. + // But check anyway. + if (score <= score_threshold) { + // Told you so. + score_threshold = score + best_loc = j - 1 + if (best_loc > loc) { + // When passing loc, don't exceed our current distance from loc. + start = Math.max(1, 2 * loc - best_loc) + } else { + // Already passed loc, downhill from here on in. + break + } + } + } + } + // No hope for a (better) match at greater error levels. + if (match_bitapScore_(d + 1, loc) > score_threshold) { + break + } + last_rd = rd + } + + return best_loc < 0 ? false : true +} diff --git a/src/utils/get-attribute.js b/src/utils/get-attribute.js index 729e6514..8562a572 100644 --- a/src/utils/get-attribute.js +++ b/src/utils/get-attribute.js @@ -9,18 +9,18 @@ * @api public */ -module.exports = function(el, attr) { - var result = (el.getAttribute && el.getAttribute(attr)) || null; - if( !result ) { - var attrs = el.attributes; - var length = attrs.length; - for(var i = 0; i < length; i++) { - if (attr[i] !== undefined) { - if(attr[i].nodeName === attr) { - result = attr[i].nodeValue; +module.exports = function (el, attr) { + var result = (el.getAttribute && el.getAttribute(attr)) || null + if (!result) { + var attrs = el.attributes + var length = attrs.length + for (var i = 0; i < length; i++) { + if (attrs[i] !== undefined) { + if (attrs[i].nodeName === attr) { + result = attrs[i].nodeValue } } } } - return result; -}; + return result +} diff --git a/src/utils/get-by-class.js b/src/utils/get-by-class.js index f475fd82..46926f65 100644 --- a/src/utils/get-by-class.js +++ b/src/utils/get-by-class.js @@ -12,45 +12,52 @@ * @api public */ -module.exports = (function() { - if (document.getElementsByClassName) { - return function(container, className, single) { - if (single) { - return container.getElementsByClassName(className)[0]; - } else { - return container.getElementsByClassName(className); - } - }; - } else if (document.querySelector) { - return function(container, className, single) { - className = '.' + className; +var getElementsByClassName = function (container, className, single) { + if (single) { + return container.getElementsByClassName(className)[0] + } else { + return container.getElementsByClassName(className) + } +} + +var querySelector = function (container, className, single) { + className = '.' + className + if (single) { + return container.querySelector(className) + } else { + return container.querySelectorAll(className) + } +} + +var polyfill = function (container, className, single) { + var classElements = [], + tag = '*' + + var els = container.getElementsByTagName(tag) + var elsLen = els.length + var pattern = new RegExp('(^|\\s)' + className + '(\\s|$)') + for (var i = 0, j = 0; i < elsLen; i++) { + if (pattern.test(els[i].className)) { if (single) { - return container.querySelector(className); + return els[i] } else { - return container.querySelectorAll(className); - } - }; - } else { - return function(container, className, single) { - var classElements = [], - tag = '*'; - if (container === null) { - container = document; + classElements[j] = els[i] + j++ } - var els = container.getElementsByTagName(tag); - var elsLen = els.length; - var pattern = new RegExp("(^|\\s)"+className+"(\\s|$)"); - for (var i = 0, j = 0; i < elsLen; i++) { - if ( pattern.test(els[i].className) ) { - if (single) { - return els[i]; - } else { - classElements[j] = els[i]; - j++; - } - } - } - return classElements; - }; + } + } + return classElements +} + +module.exports = (function () { + return function (container, className, single, options) { + options = options || {} + if ((options.test && options.getElementsByClassName) || (!options.test && document.getElementsByClassName)) { + return getElementsByClassName(container, className, single) + } else if ((options.test && options.querySelector) || (!options.test && document.querySelector)) { + return querySelector(container, className, single) + } else { + return polyfill(container, className, single) + } } -})(); +})() diff --git a/src/utils/index-of.js b/src/utils/index-of.js index 4c261619..11415a5a 100644 --- a/src/utils/index-of.js +++ b/src/utils/index-of.js @@ -1,9 +1,9 @@ -var indexOf = [].indexOf; +var indexOf = [].indexOf module.exports = function(arr, obj){ if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { + for (var i = 0, il = arr.length; i < il; ++i) { if (arr[i] === obj) return i; } - return -1; -}; + return -1 +} diff --git a/src/utils/natural-sort.js b/src/utils/natural-sort.js deleted file mode 100644 index 76c1e70f..00000000 --- a/src/utils/natural-sort.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Natural Sort algorithm for Javascript - Version 0.8 - Released under MIT license - * Author: Jim Palmer (based on chunking idea from Dave Koelle) - */ -module.exports = function(a, b, opts) { - var re = /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[\da-fA-F]+$|\d+)/g, - sre = /^\s+|\s+$/g, // trim pre-post whitespace - snre = /\s+/g, // normalize all whitespace to single ' ' character - dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, - hre = /^0x[0-9a-f]+$/i, - ore = /^0/, - options = opts || {}, - i = function(s) { return options.insensitive && (''+s).toLowerCase() || ''+s; }, - // convert all to strings strip whitespace - x = i(a) || '', - y = i(b) || '', - // chunk/tokenize - xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), - yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), - // numeric, hex or date detection - xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && Date.parse(x)), - yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null, - normChunk = function(s, l) { - // normalize spaces; find floats not starting with '0', string or 0 if not defined (Clint Priest) - return (!s.match(ore) || l == 1) && parseFloat(s) || s.replace(snre, ' ').replace(sre, '') || 0; - }, - oFxNcL, oFyNcL; - // first try and sort Hex codes or Dates - if (yD) { - if ( xD < yD ) { return -1; } - else if ( xD > yD ) { return 1; } - } - // natural sorting through split numeric strings and default strings - for(var cLoc=0, xNl = xN.length, yNl = yN.length, numS=Math.max(xNl, yNl); cLoc < numS; cLoc++) { - oFxNcL = normChunk(xN[cLoc], xNl); - oFyNcL = normChunk(yN[cLoc], yNl); - // handle numeric vs string comparison - number < string - (Kyle Adams) - if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; } - // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' - else if (typeof oFxNcL !== typeof oFyNcL) { - oFxNcL += ''; - oFyNcL += ''; - } - if (oFxNcL < oFyNcL) { return -1; } - if (oFxNcL > oFyNcL) { return 1; } - } - return 0; -}; diff --git a/src/utils/to-array.js b/src/utils/to-array.js index 9fac2610..f1009b6b 100644 --- a/src/utils/to-array.js +++ b/src/utils/to-array.js @@ -10,24 +10,24 @@ */ module.exports = function toArray(collection) { - if (typeof collection === 'undefined') return []; - if (collection === null) return [null]; - if (collection === window) return [window]; - if (typeof collection === 'string') return [collection]; - if (isArray(collection)) return collection; - if (typeof collection.length != 'number') return [collection]; - if (typeof collection === 'function' && collection instanceof Function) return [collection]; + if (typeof collection === 'undefined') return [] + if (collection === null) return [null] + if (collection === window) return [window] + if (typeof collection === 'string') return [collection] + if (isArray(collection)) return collection + if (typeof collection.length != 'number') return [collection] + if (typeof collection === 'function' && collection instanceof Function) return [collection] var arr = []; - for (var i = 0; i < collection.length; i++) { + for (var i = 0, il = collection.length; i < il; i++) { if (Object.prototype.hasOwnProperty.call(collection, i) || i in collection) { - arr.push(collection[i]); + arr.push(collection[i]) } } - if (!arr.length) return []; - return arr; -}; + if (!arr.length) return [] + return arr +} function isArray(arr) { - return Object.prototype.toString.call(arr) === "[object Array]"; + return Object.prototype.toString.call(arr) === '[object Array]' } diff --git a/src/utils/to-string.js b/src/utils/to-string.js index cdda3bcf..8ec67ca0 100644 --- a/src/utils/to-string.js +++ b/src/utils/to-string.js @@ -1,6 +1,6 @@ -module.exports = function(s) { - s = (s === undefined) ? "" : s; - s = (s === null) ? "" : s; - s = s.toString(); - return s; -}; +module.exports = function (s) { + s = s === undefined ? '' : s + s = s === null ? '' : s + s = s.toString() + return s +} diff --git a/test/fixtures.js b/test/fixtures.js deleted file mode 100644 index fadfc37e..00000000 --- a/test/fixtures.js +++ /dev/null @@ -1,56 +0,0 @@ -var fixture = { - list: function(valueNames, items) { - var listHtml = $('
          '), - item = ""; - - item = "
        • "; - for (var i = 0; i < valueNames.length; i++) { - item += ''; - } - item += "
        • "; - - $(document.body).append(listHtml); - - items = items || []; - - return new List('list', { - valueNames: valueNames, - item: item - }, items); - }, - removeList: function() { - $('#list').remove(); - }, - jonny: { - name: "Jonny Strömberg", - born: '1986' - }, - martina: { - name: "Martina Elm", - born: '1986' - }, - angelica: { - name: "Angelica Abraham", - born: '1986' - }, - sebastian: { - name: "Sebastian Höglund", - born: '1989' - }, - imma: { - name: "Imma Grafström", - born: '1953' - }, - hasse: { - name: "Hasse Strömberg", - born: '1955' - } -}; -fixture.all = [ - fixture.jonny, - fixture.martina, - fixture.angelica, - fixture.sebastian, - fixture.imma, - fixture.hasse -]; diff --git a/test/index.html b/test/index.html deleted file mode 100755 index 89dcf54e..00000000 --- a/test/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - List.js Mocha Tests - - - - - -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/test.add-get-remove.js b/test/test.add-get-remove.js deleted file mode 100644 index 9d806af0..00000000 --- a/test/test.add-get-remove.js +++ /dev/null @@ -1,119 +0,0 @@ -describe('Add, get, remove', function() { - - var list; - - before(function() { - list = fixture.list(['name'], [ { name: "Jonny" } ]); - }); - - after(function() { - fixture.removeList(); - }); - - afterEach(function() { - list.clear(); - list.add({ name: "Jonny" }); - }); - - describe('Add', function() { - it('should add one item', function() { - list.add({ name: 'Jonas' }); - expect(list.items.length).to.equal(2); - }); - it('should add two items', function() { - list.add([ - { name: 'Martina' }, - { name: 'Angelica' } - ]); - expect(list.items.length).to.equal(3); - }); - it('should add async items', function(done) { - list.add([ -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'}, -{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'},{name:'Sven'} - ], function() { - expect(list.items.length).to.equal(91); - done(); - }); - }); - it('should add async items to empty list', function(done) { - list.clear(); - list.add([ - { name: 'Sven' } - ], function() { - expect(list.items.length).to.equal(1); - done(); - }); - }); - }); - - describe('Get', function() { - it('should return array with one item', function() { - var items = list.get('name', 'Jonny'); - expect(items[0].values().name).to.equal('Jonny'); - }); - it('should return empty array', function() { - var items = list.get('name', 'jonny'); - expect(items.length).to.be.zero; - }); - it('should return two items', function() { - list.add({ name: 'Jonny' }); - var items = list.get('name', 'Jonny'); - expect(items.length).to.equal(2); - expect(items[0].values().name).to.equal('Jonny'); - expect(items[1].values().name).to.equal('Jonny'); - }); - }); - - describe('Remove', function() { - it('should remove one item', function() { - list.add({ name: "Jonas" }); - expect(list.items.length).to.equal(2); - var count = list.remove('name', 'Jonas'); - expect(count).to.equal(1); - expect(list.items.length).to.equal(1); - }); - it('should not remove anything due to case sensitivity', function() { - var count = list.remove('name', 'jonny'); - expect(count).to.be.equal(0); - expect(list.items.length).to.equal(1); - }); - - it('should avoid node not found error', function() { - var item = list.get('name', 'Jonny')[0]; - list.list.removeChild(item.elm); - var count = list.remove('name', 'Jonny'); - expect(count).to.be.equal(1); - expect(list.items.length).to.equal(0); - }); - - it('should remove eight items', function() { - list.add({ name: 'Jonny' }); - list.add({ name: 'Jonny' }); - list.add({ name: 'Sven' }); - list.add({ name: 'Jonny' }); - list.add({ name: 'Jonny' }); - list.add({ name: 'Jonny' }); - list.add({ name: 'Jonas' }); - list.add({ name: 'Jonny' }); - list.add({ name: 'Jonny' }); - expect(list.items.length).to.equal(10); - var count = list.remove('name', 'Jonny'); - expect(count).to.equal(8); - expect(list.items.length).to.equal(2); - }); - }); -}); diff --git a/test/test.buttons.js b/test/test.buttons.js deleted file mode 100644 index 1249b0b2..00000000 --- a/test/test.buttons.js +++ /dev/null @@ -1,191 +0,0 @@ -function fireKeyup(el) { - if (document.createEvent) { - var evObj; - if (window.KeyEvent) { - evObj = document.createEvent('KeyEvents'); - evObj.initKeyEvent('keyup', true, true, window, false, false, false, false, 13, 0); - } else { - evObj = document.createEvent('UIEvents'); - evObj.initUIEvent('keyup', true, true, window, 1); - } - el.dispatchEvent(evObj); - } else if( document.createEventObject ) { - el.fireEvent('onkeyup'); - } else { - // IE 5.0, seriously? :) - } -} - -// http://stackoverflow.com/questions/5658849/whats-the-equivalent-of-jquerys-trigger-method-without-jquery -function fireClick(el) { - var evt; - if (document.createEvent) { - evt = document.createEvent("MouseEvents"); - evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - } - (evt) ? el.dispatchEvent(evt) : (el.click && el.click()); -} - -describe('Button', function() { - - var list; - - beforeEach(function() { - $('body').append($('
          \ - \ - Sort name\ - Sort name asc\ - Sort name desc\ -
          \ -
          Jonny1986
          \ -
          Jocke1985
          \ -
          \ -
          ')); - - list = new List('parse-list', { - valueNames: ['name', 'born'] - }); - }); - - afterEach(function() { - $('#parse-list').remove(); - }); - - describe('Sort', function() { - it('should trigger sortStart', function(done) { - list.on('sortComplete', function() { - done(); - }); - fireClick($('#sort-name')[0]); - }); - it('should trigger sortComplete', function(done) { - list.on('sortComplete', function() { - done(); - }); - fireClick($('#sort-name')[0]); - }); - - it('should switch sorting order when clicking multiple times', function(done) { - this.timeout(5000); - var sortRun = 0; - list.on('sortComplete', function() { - sortRun++; - if (sortRun == 1) { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - setTimeout(function() { - fireClick($('#sort-name')[0]); - }, 50); - } else if (sortRun == 2) { - expect($('#sort-name').hasClass('asc')).to.be(false); - expect($('#sort-name').hasClass('desc')).to.be(true); - setTimeout(function() { - fireClick($('#sort-name')[0]); - }, 50); - } else if (sortRun == 3) { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - done(); - } - }); - expect($('#sort-name').hasClass('asc')).to.be(false); - expect($('#sort-name').hasClass('desc')).to.be(false); - fireClick($('#sort-name')[0]); - }); - - it('should sort with predefined order', function(done) { - this.timeout(10000); - var sortRun = 0; - list.on('sortComplete', function() { - sortRun++; - if (sortRun == 1) { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - expect($('#sort-name-asc').hasClass('asc')).to.be(true); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(false); - setTimeout(function() { - fireClick($('#sort-name-asc')[0]); - }, 50); - } else if (sortRun == 2) { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - expect($('#sort-name-asc').hasClass('asc')).to.be(true); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(false); - setTimeout(function() { - fireClick($('#sort-name-asc')[0]); - }, 50); - } else if (sortRun == 3) { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - expect($('#sort-name-asc').hasClass('asc')).to.be(true); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(false); - setTimeout(function() { - fireClick($('#sort-name-desc')[0]); - }, 50); - } else if (sortRun == 4) { - expect($('#sort-name').hasClass('asc')).to.be(false); - expect($('#sort-name').hasClass('desc')).to.be(true); - expect($('#sort-name-asc').hasClass('asc')).to.be(false); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(true); - setTimeout(function() { - fireClick($('#sort-name-desc')[0]); - }, 50); - } else if (sortRun == 5) { - expect($('#sort-name').hasClass('asc')).to.be(false); - expect($('#sort-name').hasClass('desc')).to.be(true); - expect($('#sort-name-asc').hasClass('asc')).to.be(false); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(true); - done(); - } - }); - expect($('#sort-name').hasClass('asc')).to.be(false); - expect($('#sort-name').hasClass('desc')).to.be(false); - expect($('#sort-name-asc').hasClass('asc')).to.be(false); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(false); - fireClick($('#sort-name-asc')[0]); - }); - - it('buttons should change class when sorting programmatically', function(done) { - list.on('sortComplete', function() { - expect($('#sort-name').hasClass('asc')).to.be(true); - expect($('#sort-name').hasClass('desc')).to.be(false); - expect($('#sort-name-asc').hasClass('asc')).to.be(true); - expect($('#sort-name-asc').hasClass('desc')).to.be(false); - expect($('#sort-name-desc').hasClass('asc')).to.be(false); - expect($('#sort-name-desc').hasClass('desc')).to.be(false); - done(); - }); - list.sort('name', { order: "asc" }); - }) - }); - - - describe('Search', function() { - it('should trigger searchStart', function(done) { - list.on('searchStart', function() { - done(); - }); - $('#parse-list .search').val('jon'); - fireKeyup($('#parse-list .search')[0]); - }); - it('should trigger searchComplete', function(done) { - list.on('searchComplete', function() { - done(); - }); - $('#parse-list .search').val('jon'); - fireKeyup($('#parse-list .search')[0]); - }); - }); -}); diff --git a/test/test.defaults.js b/test/test.defaults.js deleted file mode 100644 index 0f3940cf..00000000 --- a/test/test.defaults.js +++ /dev/null @@ -1,64 +0,0 @@ -describe('Defaults', function() { - var list; - - before(function() { - list = fixture.list(['name'], [ { name: 'Jonny' }]); - }); - - after(function() { - fixture.removeList(); - }); - - it('should have all default attributes', function() { - expect(list.items).to.be.an('array'); - expect(list.visibleItems).to.be.an('array'); - expect(list.matchingItems).to.be.an('array'); - - expect(list.handlers.updated).to.be.an('array'); - expect(list.handlers.searchStart).to.be.an('array'); - expect(list.handlers.searchComplete).to.be.an('array'); - expect(list.handlers.sortStart).to.be.an('array'); - expect(list.handlers.sortComplete).to.be.an('array'); - expect(list.handlers.filterStart).to.be.an('array'); - expect(list.handlers.filterComplete).to.be.an('array'); - - expect(list.searched).to.be(false); - expect(list.filtered).to.be(false); - expect(list.i).to.equal(1); - expect(list.page).to.equal(10000); - expect(list.listClass).to.equal('list'); - expect(list.sortClass).to.equal('sort'); - expect(list.searchClass).to.equal('search'); - }); - - it('should have the right elements', function() { - expect(list.list).to.equal($('.list')[0]); - expect(list.listContainer).to.equal($('#list')[0]); - }); - - it('should have all default methods', function() { - expect(list.add).to.be.a('function'); - expect(list.remove).to.be.a('function'); - expect(list.get).to.be.a('function'); - expect(list.sort).to.be.a('function'); - expect(list.search).to.be.a('function'); - expect(list.clear).to.be.a('function'); - expect(list.filter).to.be.a('function'); - expect(list.size).to.be.a('function'); - expect(list.show).to.be.a('function'); - expect(list.update).to.be.a('function'); - expect(list.on).to.be.a('function'); - }); - - it('should have all helper methods', function() { - expect(list.utils.classes).to.be.a('function'); - expect(list.utils.getAttribute).to.be.a('function'); - expect(list.utils.getByClass).to.be.a('function'); - expect(list.utils.naturalSort).to.be.a('function'); - expect(list.utils.events.bind).to.be.a('function'); - expect(list.utils.events.unbind).to.be.a('function'); - expect(list.utils.extend).to.be.a('function'); - expect(list.utils.indexOf).to.be.a('function'); - expect(list.utils.toString).to.be.a('function'); - }); -}); diff --git a/test/test.filter.js b/test/test.filter.js deleted file mode 100644 index c6fe4224..00000000 --- a/test/test.filter.js +++ /dev/null @@ -1,101 +0,0 @@ -describe('Filter', function() { - - var list, jonny, martina, angelica, sebastian, imma, hasse; - - before(function() { - list = fixture.list(['name', 'born'], fixture.all); - jonny = list.get('name', 'Jonny Strömberg')[0]; - martina = list.get('name', 'Martina Elm')[0]; - angelica = list.get('name', 'Angelica Abraham')[0]; - sebastian = list.get('name', 'Sebastian Höglund')[0]; - imma = list.get('name', 'Imma Grafström')[0]; - hasse = list.get('name', 'Hasse Strömberg')[0]; - }); - - after(function() { - fixture.removeList(); - }); - - afterEach(function() { - list.filter(); - list.show(1, 200); - }); - - describe('Basics', function() { - it('should return everyone born after 1988', function() { - var result = list.filter(function(item) { - return (item.values().born > 1988); - }); - expect(result.length).to.equal(1); - expect(result[0]).to.eql(sebastian); - }); - it('should return everyone born 1986', function() { - var result = list.filter(function(item) { - return (item.values().born == 1986); - }); - expect(result.length).to.equal(3); - for (var i = 0; i < result.length; i++) { - expect(result[i].values().born).to.equal('1986'); - } - }); - }); - - describe('Show and pages', function() { - it('should return the visible items', function() { - list.show(1,2); - var result = list.filter(function(item) { - return (item.values().born > 1985); - }); - expect(result).to.eql(list.visibleItems); - }); - - it('should return be 2 visible items and 3 matching', function() { - list.show(1,2); - var result = list.filter(function(item) { - return (item.values().born > 1985); - }); - expect(result.length).to.equal(2); - expect(list.visibleItems.length).to.equal(2); - expect(list.matchingItems.length).to.equal(4); - }); - - describe('Specific items', function() { - beforeEach(function() { - list.show(1,2); - var result = list.filter(function(item) { - return (item.values().born > 1985); - }); - }); - it('should match jonny', function() { - expect(jonny.matching()).to.be(true); - expect(jonny.filtered).to.be(true); - expect(jonny.visible()).to.be(true); - }); - it('should match martina', function() { - expect(martina.matching()).to.be(true); - expect(martina.filtered).to.be(true); - expect(martina.visible()).to.be(true); - }); - it('should match but not show angelica', function() { - expect(angelica.matching()).to.be(true); - expect(angelica.filtered).to.be(true); - expect(angelica.visible()).to.be(false); - }); - it('should match but not show sebastian', function() { - expect(sebastian.matching()).to.be(true); - expect(sebastian.filtered).to.be(true); - expect(sebastian.visible()).to.be(false); - }); - it('should not match imma', function() { - expect(imma.matching()).to.be(false); - expect(imma.filtered).to.be(false); - expect(imma.visible()).to.be(false); - }); - it('should not match hasse', function() { - expect(hasse.matching()).to.be(false); - expect(hasse.filtered).to.be(false); - expect(hasse.visible()).to.be(false); - }); - }); - }); -}); diff --git a/test/test.item.js b/test/test.item.js deleted file mode 100644 index 0de3e980..00000000 --- a/test/test.item.js +++ /dev/null @@ -1,146 +0,0 @@ -describe('Item', function() { - - var list, item; - - before(function() { - list = fixture.list(['name', 'born', 'doin'], [{ - name: "Jonny", - born: "1986", - doin: "Living the dream" - }]); - item = list.get('name', 'Jonny')[0]; - }); - - - beforeEach(function() { - list.search(); - list.filter(); - list.show(1,200); - }); - - after(function() { - fixture.removeList(); - }); - - describe('Defaults', function() { - it('should have all default attributes', function() { - expect(item.found).to.be(false); - expect(item.filtered).to.be(false); - }); - - it('should have the right elements', function() { - expect(item.elm).to.equal($('#list li')[0]); - }); - - it('should have all default methods', function() { - expect(item.hide).to.be.a('function'); - expect(item.show).to.be.a('function'); - expect(item.values).to.be.a('function'); - expect(item.matching).to.be.a('function'); - expect(item.visible).to.be.a('function'); - }); - }); - - describe('Values()', function() { - it('should have the right values', function() { - expect(item.values()).to.eql({ - name: 'Jonny', - born: '1986', - doin: 'Living the dream' - }); - }); - it('should be able to change one value', function() { - expect(item.values().name).to.be.equal('Jonny'); - item.values({ name: 'Egon' }); - expect(item.values().name).to.be.equal('Egon'); - }); - it('should be able to change many value', function() { - expect(item.values()).to.eql({ - name: 'Egon', - born: '1986', - doin: 'Living the dream' - }); - item.values({ - name: 'Sven', - born: '1801', - doin: 'Is dead' - }); - expect(item.values()).to.eql({ - name: 'Sven', - born: '1801', - doin: 'Is dead' - }); - }); - }); - - describe('Hide, show, visible', function() { - it('should be hidden', function() { - expect($('#list li').size()).to.equal(1); - item.hide(); - expect(item.visible()).to.be(false); - expect($('#list li').size()).to.equal(0); - }); - it('should be visible', function() { - item.hide(); - expect($('#list li').size()).to.equal(0); - item.show(); - expect(item.visible()).to.be(true); - expect($('#list li').size()).to.equal(1); - }); - }); - - describe('Matching, found, filtered', function() { - describe('Searching', function() { - it('should not be visible, match, found or filtered', function() { - list.search('Fredrik'); - expect(item.matching()).to.be(false); - expect(item.found).to.be(false); - expect(item.filtered).to.be(false); - expect(item.visible()).to.be(false); - }); - it('should be visble, match and found but not filterd', function() { - var result = list.search('Sven'); - expect(item.matching()).to.be(true); - expect(item.found).to.be(true); - expect(item.filtered).to.be(false); - expect(item.visible()).to.be(true); - }); - it('reset: should be visible and matching but not found or filtered', function() { - list.search(); - expect(item.matching()).to.be(true); - expect(item.found).to.be(false); - expect(item.filtered).to.be(false); - expect(item.visible()).to.be(true); - }); - }); - describe('Filtering', function() { - it('should not be visble, match, found or filtered', function() { - list.filter(function(item) { - return (item.values().name == "Fredrik"); - }); - expect(item.matching()).to.be(false); - expect(item.found).to.be(false); - expect(item.filtered).to.be(false); - expect(item.visible()).to.be(false); - }); - it('should be visble, match and filtered but not found', function() { - list.filter(function(item) { - return (item.values().name == "Sven"); - }); - expect(item.matching()).to.be(true); - expect(item.found).to.be(false); - expect(item.filtered).to.be(true); - expect(item.visible()).to.be(true); - }); - it('reset: should be visble and match but not filtered or found', function() { - list.filter(); - expect(item.matching()).to.be(true); - expect(item.found).to.be(false); - expect(item.filtered).to.be(false); - expect(item.visible()).to.be(true); - }); - }); - }); - - fixture.removeList(); -}); diff --git a/test/test.off.js b/test/test.off.js deleted file mode 100644 index 5d1449e7..00000000 --- a/test/test.off.js +++ /dev/null @@ -1,39 +0,0 @@ -describe('Off', function() { - - var list; - - before(function() { - list = fixture.list(['name', 'born'], fixture.all); - }); - - after(function() { - fixture.removeList(); - }); - - describe('General', function() { - it('should be remove added handler', function(done) { - var updated = function(list) { - expect(list.handlers.updated.length).to.equal(1); - list.off('updated', updated); - expect(list.handlers.updated.length).to.equal(0); - done(); - }; - list.on('updated', updated); - list.search('jonny'); - }); - - it('should not remove unnamed handlers', function(done) { - var searchComplete = function(list) { - expect(list.handlers.searchComplete.length).to.equal(3); - list.off('searchComplete', function() {}); - list.off('searchComplete', searchComplete); - expect(list.handlers.searchComplete.length).to.equal(2); - done(); - }; - list.on('searchComplete', function() {}); - list.on('searchComplete', searchComplete); - list.on('searchComplete', function() {}); - list.search('jonny'); - }); - }); -}); diff --git a/test/test.on.js b/test/test.on.js deleted file mode 100644 index faca3534..00000000 --- a/test/test.on.js +++ /dev/null @@ -1,123 +0,0 @@ -describe('On', function() { - - var list; - - beforeEach(function() { - list = fixture.list(['name', 'born'], fixture.all); - }); - - afterEach(function() { - fixture.removeList(); - }); - - describe('Updated', function() { - it('should be triggered after search', function(done) { - list.on('updated', function(list) { - done(); - }); - list.search('jonny'); - }); - it('should be triggered after sort', function(done) { - list.on('updated', function(list) { - done(); - }); - list.sort('name'); - }); - it('should be triggered after filter', function(done) { - list.on('updated', function(list) { - done(); - }); - list.filter(function() { - return true; - }); - }); - it('should be triggered after show', function(done) { - list.on('updated', function(list) { - done(); - }); - list.show(1,10); - }); - - it('should be triggered after add', function(done) { - list.on('updated', function(list) { - done(); - }); - list.add({ name: 'Hej' }); - }); - it('should be triggered after remove', function(done) { - list.on('updated', function(list) { - done(); - }); - list.remove('name', 'Jonny'); - }); - }); - - describe('Multiple handlers', function() { - it('should be trigger both handlers', function(done) { - var done1 = false, - done2 = false, - isDone = function() { - if (done1 && done2) { - done(); - } - }; - - list.on('updated', function(list) { - done1 = true; - isDone(); - }); - list.on('updated', function(list) { - done2 = true; - isDone(); - }); - list.search('jonny'); - }); - }); - - describe('Search', function() { - it('should be triggered before and after search', function(done) { - var done1 = false; - list.on('searchStart', function(list) { - done1 = true; - }); - list.on('searchComplete', function(list) { - if (done1) { - done(); - } - }); - list.search('jonny'); - }); - }); - - describe('Sort', function() { - it('should be triggered before and after sort', function(done) { - var done1 = false; - list.on('sortStart', function(list) { - done1 = true; - }); - list.on('sortComplete', function(list) { - if (done1) { - done(); - } - }); - list.sort('name'); - }); - }); - - describe('Filter', function() { - it('should be triggered before and after filter', function(done) { - var done1 = false; - list.on('filterStart', function(list) { - done1 = true; - }); - list.on('filterComplete', function(list) { - if (done1) { - done(); - } - }); - list.filter(function() { - return true; - }); - }); - }); -}); diff --git a/test/test.parse.js b/test/test.parse.js deleted file mode 100644 index 117107d9..00000000 --- a/test/test.parse.js +++ /dev/null @@ -1,119 +0,0 @@ -describe('Parse', function() { - - describe('Parse class', function() { - var list; - beforeEach(function() { - $('body').append($('
          \ -
          \ -
          Jonny1986
          \ -
          Jocke1985
          \ -
          \ -
          ')); - - list = new List('parse-list', { - valueNames: ['name', 'born'] - }); - }); - - afterEach(function() { - $('#parse-list').remove(); - }); - - it('should have two items', function() { - expect(list.items.length).to.equal(2); - expect(list.items[0].values().name).to.equal("Jonny"); - expect(list.items[1].values().name).to.equal("Jocke"); - }); - it('should add item to parsed list', function() { - list.add({ name: "Sven", born: 1950 }); - expect(list.items.length).to.equal(3); - expect(list.items[0].values().name).to.equal("Jonny"); - expect(list.items[1].values().name).to.equal("Jocke"); - expect(list.items[2].values().name).to.equal("Sven"); - expect(list.items[0].values().born).to.equal("1986"); - expect(list.items[2].values().born).to.equal(1950); - var el = $($('#parse-list').find('.list div')[2]); - expect(el.find('span').size()).to.equal(2); - expect(el.find('span.name').text()).to.equal('Sven'); - expect(el.find('span.born').text()).to.equal('1950'); - }); - it('should parsed value always be string while added could be number', function() { - list.add({ name: "Sven", born: 1950 }); - expect(list.items[0].values().born).to.equal("1986"); - expect(list.items[0].values().born).not.to.equal(1986); - expect(list.items[2].values().born).not.to.equal("1950"); - expect(list.items[2].values().born).to.equal(1950); - }); - }); - - describe('Parse data', function() { - - var list; - - beforeEach(function() { - $('body').append($('
          \ -
          \ -
          \ - Jonny\ - 1986\ - \ - \ -
          \ -
          \ - Jocke\ - 1985\ - \ - \ -
          \ -
          \ -
          ')); - - list = new List('parse-list', { - valueNames: [ - 'name', - 'born', - { data: [ 'id' ] }, - { attr: 'src', name: 'image'}, - { attr: 'href', name: 'link'}, - { attr: 'value', name: 'foo'}, - { attr: 'data-timestamp', name: 'timestamp' } - ] - }); - }); - - afterEach(function() { - $('#parse-list').remove(); - }); - - it('should get values from class, data, src, value and child els data-attribute', function() { - expect(list.items.length).to.equal(2); - var jonny = list.items[0].values() - expect(jonny.name).to.equal("Jonny"); - expect(jonny.born).to.equal("1986"); - expect(jonny.id).to.equal("1"); - expect(jonny.image).to.equal("jonny.jpg"); - expect(jonny.timestamp).to.equal("54321"); - expect(jonny.foo).to.equal("Bar"); - }); - it('should add item to list with class, data and src', function() { - list.add({ name: "Sven", born: 1950, id: 4, image: 'sven.gif', link: 'localhost', timestamp: '1337', foo: 'hej' }); - expect(list.items.length).to.equal(3); - var sven = list.items[2].values(); - expect(sven.name).to.equal("Sven"); - expect(sven.born).to.equal(1950); - expect(sven.id).to.equal(4); - expect(sven.image).to.equal("sven.gif"); - expect(sven.link).to.equal("localhost"); - expect(sven.timestamp).to.equal("1337"); - expect(sven.foo).to.equal("hej"); - var el = $($('#parse-list').find('.list div')[2]); - expect(el.data('id')).to.equal(4); - expect(el.find('.name').text()).to.equal('Sven'); - expect(el.find('.born').text()).to.equal('1950'); - expect(el.find('.image').attr('src')).to.equal('sven.gif'); - expect(el.find('.link').attr('href')).to.equal('localhost'); - expect(el.find('.timestamp').data('timestamp')).to.equal(1337); - expect(el.find('.foo').val()).to.equal('hej'); - }); - }); -}); diff --git a/test/test.re-index.js b/test/test.re-index.js deleted file mode 100644 index ad04f85e..00000000 --- a/test/test.re-index.js +++ /dev/null @@ -1,34 +0,0 @@ -describe('ReIndex', function() { - - var list, jonny, martina, angelica, sebastian, imma, hasse; - - before(function() { - list = fixture.list(['name', 'born'], fixture.all); - }); - - after(function() { - fixture.removeList(); - }); - - afterEach(function() { - list.show(1, 200); - }); - it('should return everyone born after 1988', function() { - expect(list.toJSON()).to.eql([ - { name: "Jonny Strömberg", born: '1986' }, - { name: "Martina Elm", born: '1986' }, - { name: "Angelica Abraham", born: '1986' }, - { name: "Sebastian Höglund", born: '1989' }, - { name: "Imma Grafström", born: '1953' }, - { name: "Hasse Strömberg", born: '1955' } - ]); - var newHtml = '
        • Sven2013'; - newHtml = newHtml + '
        • Anna3043' - $(list.list).html(newHtml); - list.reIndex(); - expect(list.toJSON()).to.eql([ - { name: "Sven", born: '2013' }, - { name: "Anna", born: '3043' } - ]); - }); -}); diff --git a/test/test.search-filter.js b/test/test.search-filter.js deleted file mode 100644 index 3b9af3ed..00000000 --- a/test/test.search-filter.js +++ /dev/null @@ -1,66 +0,0 @@ -describe('Search and filter', function() { - - var list, jonny, martina, angelica, sebastian, imma, hasse; - - before(function() { - list = fixture.list(['name', 'born'], fixture.all); - - jonny = list.get('name', 'Jonny Strömberg')[0]; - martina = list.get('name', 'Martina Elm')[0]; - angelica = list.get('name', 'Angelica Abraham')[0]; - sebastian = list.get('name', 'Sebastian Höglund')[0]; - imma = list.get('name', 'Imma Grafström')[0]; - hasse = list.get('name', 'Hasse Strömberg')[0]; - }); - - after(function() { - fixture.removeList(); - }); - - afterEach(function() { - list.search(); - list.filter(); - }); - - describe('Search with filter', function() { - it('should find everyone born 1986', function() { - list.filter(function(item) { - return (item.values().born == '1986'); - }); - expect(list.matchingItems.length).to.equal(3); - expect(jonny.matching()).to.be(true); - expect(martina.matching()).to.be(true); - expect(angelica.matching()).to.be(true); - expect(sebastian.matching()).to.be(false); - expect(imma.matching()).to.be(false); - expect(hasse.matching()).to.be(false); - }); - it('should find everyone born 1986 and containes "ö"', function() { - list.filter(function(item) { - return (item.values().born == '1986'); - }); - list.search('ö'); - expect(list.matchingItems.length).to.equal(1); - expect(jonny.matching()).to.be(true); - expect(martina.matching()).to.be(false); - expect(angelica.matching()).to.be(false); - expect(sebastian.matching()).to.be(false); - expect(imma.matching()).to.be(false); - expect(hasse.matching()).to.be(false); - }); - it('should find everyone with a "ö"', function() { - list.filter(function(item) { - return (item.values().born == '1986'); - }); - list.search('ö'); - list.filter(); - expect(list.matchingItems.length).to.equal(4); - expect(jonny.matching()).to.be(true); - expect(martina.matching()).to.be(false); - expect(angelica.matching()).to.be(false); - expect(sebastian.matching()).to.be(true); - expect(imma.matching()).to.be(true); - expect(hasse.matching()).to.be(true); - }); - }); -}); diff --git a/test/test.search.js b/test/test.search.js deleted file mode 100644 index c98fc530..00000000 --- a/test/test.search.js +++ /dev/null @@ -1,148 +0,0 @@ -describe('Search', function() { - - var list, jonny, martina, angelica, sebastian, imma, hasse; - - beforeEach(function() { - list = fixture.list(['name', 'born'], fixture.all); - - jonny = list.get('name', 'Jonny Strömberg')[0]; - martina = list.get('name', 'Martina Elm')[0]; - angelica = list.get('name', 'Angelica Abraham')[0]; - sebastian = list.get('name', 'Sebastian Höglund')[0]; - imma = list.get('name', 'Imma Grafström')[0]; - hasse = list.get('name', 'Hasse Strömberg')[0]; - }); - - afterEach(function() { - fixture.removeList(); - }); - - describe('Case-sensitive', function() { - it('should not be case-sensitive', function() { - var result = list.search('jonny'); - expect(result.length).to.equal(1); - expect(result[0]).to.eql(jonny); - }); - }); - - describe('Number of results', function() { - it('should find jonny, martina, angelice', function() { - var result = list.search('1986'); - expect(result.length).to.equal(3); // 3!! - expect(jonny.matching()).to.be(true); - expect(martina.matching()).to.be(true); - expect(angelica.matching()).to.be(true); - expect(sebastian.matching()).to.be(false); - expect(imma.matching()).to.be(false); - expect(hasse.matching()).to.be(false); - }); - it('should find all with utf-8 char ö', function() { - var result = list.search('ö'); - expect(result.length).to.equal(4); // 4!! - expect(jonny.matching()).to.be(true); - expect(martina.matching()).to.be(false); - expect(angelica.matching()).to.be(false); - expect(sebastian.matching()).to.be(true); - expect(imma.matching()).to.be(true); - expect(hasse.matching()).to.be(true); - }); - it('should not break with weird searches', function() { - expect(list.search).withArgs(undefined).to.not.throwException(); - expect(list.search).withArgs(null).to.not.throwException(); - expect(list.search).withArgs(0).to.not.throwException(); - expect(list.search).withArgs(function() {}).to.not.throwException(); - expect(list.search).withArgs({ foo: "bar" }).to.not.throwException(); - }); - it('should not break with weird values', function() { - jonny.values({ name: undefined }); - martina.values({ name: null }); - angelica.values({ name: 0 }); - sebastian.values({ name: function() {} }); - imma.values({ name: { foo: "bar" } }); - - expect(list.search).withArgs("jonny").to.not.throwException(); - expect(list.search).withArgs(undefined).to.not.throwException(); - expect(list.search).withArgs(null).to.not.throwException(); - expect(list.search).withArgs(0).to.not.throwException(); - expect(list.search).withArgs(function() {}).to.not.throwException(); - expect(list.search).withArgs({ foo: "bar" }).to.not.throwException(); - }); - }); - - - describe('Default search columns', function() { - it('should find in the default match column', function() { - list.searchColumns = ['name']; - var result = list.search('jonny'); - expect(result.length).to.equal(1); - expect(result[0]).to.eql(jonny); - }); - it('should not find in the default match column', function() { - list.searchColumns = ['born']; - var result = list.search('jonny'); - expect(result.length).to.equal(0); - }); - }); - - - describe('Specfic columns', function() { - it('should find match in column', function() { - var result = list.search('jonny', [ 'name' ]); - expect(result.length).to.equal(1); - expect(result[0]).to.eql(jonny); - }); - it('should not find match in column', function() { - var result = list.search('jonny', [ 'born' ]); - expect(result.length).to.equal(0); - }); - it('should find match in column', function() { - var result = list.search('jonny', [ 'name' ]); - expect(result.length).to.equal(1); - expect(result[0]).to.eql(jonny); - }); - it('should not find match in column', function() { - var result = list.search('jonny', [ 'born' ]); - expect(result.length).to.equal(0); - }); - it('should work with columns that does not exist', function() { - var result = list.search('jonny', [ 'pet' ]); - expect(result.length).to.equal(0); - }); - }); - - describe('Custom search function', function() { - var customSearchFunction = function(searchString, columns) { - for (var k = 0, kl = list.items.length; k < kl; k++) { - if (list.items[k].values().born > 1985) { - list.items[k].found = true; - } - } - }; - it('should use custom function in third argument', function() { - var result = list.search('jonny', [ 'name' ], customSearchFunction); - expect(result.length).to.equal(4); - }); - it('should use custom function in second argument', function() { - var result = list.search('jonny', customSearchFunction); - expect(result.length).to.equal(4); - }); - }); - // - // describe('Special characters', function() { - // it('should escape and handle special characters', function() { - // list.add([ - // { name: 'Jonny&Jabba' }, - // { name: 'Luke' }, - // { name: '"Chewie"' }, - // { name: "'Ewok'" } - // ]); - // var result = list.search('Leia'); - // console.log(result); - // expect(result.length).to.equal(1); - // var result = list.search('<'); - // console.log(result); - // expect(result.length).to.equal(1); - // }); - // }); -}); diff --git a/test/test.show.js b/test/test.show.js deleted file mode 100644 index eb42ddb0..00000000 --- a/test/test.show.js +++ /dev/null @@ -1,208 +0,0 @@ -describe('Show', function() { - - var list, a, b, c, d, e, f; - - before(function() { - list = fixture.list(['id', 'id2'], [ - { id: "1", id2: "a" }, - { id: "2", id2: "a" }, - { id: "3", id2: "b" }, - { id: "4", id2: "b" }, - { id: "5", id2: "bc" }, - { id: "6", id2: "bc" } - ]); - a = list.get('id', '1')[0]; - b = list.get('id', '2')[0]; - c = list.get('id', '3')[0]; - d = list.get('id', '4')[0]; - e = list.get('id', '5')[0]; - f = list.get('id', '6')[0]; - }); - - after(function() { - fixture.removeList(); - }); - - afterEach(function() { - list.filter(); - list.show(1, 200); - }); - - describe('Basics', function() { - it('should be 1, 2', function() { - list.show(1,2); - expect(list.visibleItems.length).to.equal(2); - expect(a.visible()).to.be(true); - expect(b.visible()).to.be(true); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(false); - }); - it('should show item 6', function() { - list.show(6,2); - expect(list.visibleItems.length).to.equal(1); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(true); - }); - it('should show item 1, 2, 3, 4, 5, 6', function() { - list.show(1,200); - expect(list.visibleItems.length).to.equal(6); - expect(a.visible()).to.be(true); - expect(b.visible()).to.be(true); - expect(c.visible()).to.be(true); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(true); - }); - it('should show item 3, 4, 5', function() { - list.show(3,3); - expect(list.visibleItems.length).to.equal(3); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(true); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(false); - }); - it('should show item 5, 6', function() { - list.show(5,3); - expect(list.visibleItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(true); - }); - }); - - describe('Search', function() { - afterEach(function() { - list.search(); - }); - it('should show 3, 4', function() { - list.search('b'); - list.show(1,2); - expect(list.visibleItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(true); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(false); - }); - it('should show item 3,4,5,6', function() { - list.search('b'); - list.show(1,4); - expect(list.visibleItems.length).to.equal(4); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(true); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(true); - }); - it('should not show any items but match two', function() { - list.search('a'); - list.show(3,2); - expect(list.visibleItems.length).to.equal(0); - expect(list.matchingItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(false); - }); - }); - - describe('Filter', function() { - afterEach(function() { - list.filter(); - }); - it('should show 3, 4', function() { - list.filter(function(item) { - return (item.values().id2 == 'b'); - }); - list.show(1,2); - expect(list.visibleItems.length).to.equal(2); - expect(list.matchingItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(true); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(false); - }); - it('should show item 3,4,5,6', function() { - list.filter(function(item) { - return (item.values().id2 == 'bc'); - }); - list.show(1,4); - expect(list.visibleItems.length).to.equal(2); - expect(list.matchingItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(true); - }); - it('should not show any items but match two', function() { - list.filter(function(item) { - return (item.values().id2 == 'b'); - }); - list.show(3,2); - expect(list.visibleItems.length).to.equal(0); - expect(list.matchingItems.length).to.equal(2); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(false); - expect(f.visible()).to.be(false); - }); - }); - - describe('Filter and search', function() { - afterEach(function() { - list.filter(); - }); - it('should show 4, 5', function() { - list.show(1,2); - list.filter(function(item) { - return (item.values().id > '3'); - }); - list.search('b'); - expect(list.visibleItems.length).to.equal(2); - expect(list.matchingItems.length).to.equal(3); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(true); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(false); - }); - it('should show 5, 6', function() { - list.show(1,2); - list.filter(function(item) { - return (item.values().id > '3'); - }); - list.search('b'); - list.show(2,2); - expect(list.visibleItems.length).to.equal(2); - expect(list.matchingItems.length).to.equal(3); - expect(a.visible()).to.be(false); - expect(b.visible()).to.be(false); - expect(c.visible()).to.be(false); - expect(d.visible()).to.be(false); - expect(e.visible()).to.be(true); - expect(f.visible()).to.be(true); - }); - }); -}); diff --git a/test/test.sort.js b/test/test.sort.js deleted file mode 100644 index 0e9ca9c6..00000000 --- a/test/test.sort.js +++ /dev/null @@ -1,320 +0,0 @@ -describe('Sort', function() { - - var list, i1, i2, i3, i4, i5, i6; - - beforeEach(function() { - list = fixture.list(['id'], [ - { id: "1", val: "" }, - { id: "2", val: "" }, - { id: "3", val: "" }, - { id: "4", val: "" }, - { id: "5", val: "" }, - { id: "6", val: "" } - ]); - i1 = list.get('id', '1')[0]; - i2 = list.get('id', '2')[0]; - i3 = list.get('id', '3')[0]; - i4 = list.get('id', '4')[0]; - i5 = list.get('id', '5')[0]; - i6 = list.get('id', '6')[0]; - }); - - afterEach(function() { - fixture.removeList(); - }); - - describe('Basics', function() { - it('should sort letters asc', function() { - i1.values({ val: "b" }); - i2.values({ val: "a" }); - i3.values({ val: "c" }); - i4.values({ val: "z" }); - i5.values({ val: "s" }); - i6.values({ val: "y" }); - list.sort('val'); - expect(list.items[0].values().val).to.be.equal("a"); - expect(list.items[1].values().val).to.be.equal("b"); - expect(list.items[2].values().val).to.be.equal("c"); - expect(list.items[3].values().val).to.be.equal("s"); - expect(list.items[4].values().val).to.be.equal("y"); - expect(list.items[5].values().val).to.be.equal("z"); - }); - it('should sort letters desc', function() { - i1.values({ val: "b" }); - i2.values({ val: "a" }); - i3.values({ val: "c" }); - i4.values({ val: "z" }); - i5.values({ val: "s" }); - i6.values({ val: "y" }); - list.sort('val', { order: "desc" }); - expect(list.items[0].values().val).to.be.equal("z"); - expect(list.items[1].values().val).to.be.equal("y"); - expect(list.items[2].values().val).to.be.equal("s"); - expect(list.items[3].values().val).to.be.equal("c"); - expect(list.items[4].values().val).to.be.equal("b"); - expect(list.items[5].values().val).to.be.equal("a"); - }); - it('should fail to sort åäö desc (becomes äåö)', function() { - i1.values({ val: "a" }); - i2.values({ val: "å" }); - i3.values({ val: "ä" }); - i4.values({ val: "ö" }); - i5.values({ val: "o" }); - i6.values({ val: "s" }); - list.sort('val'); - expect(list.items[0].values().val).to.be.equal("a"); - expect(list.items[1].values().val).to.be.equal("o"); - expect(list.items[2].values().val).to.be.equal("s"); - expect(list.items[3].values().val).to.be.equal("ä"); - expect(list.items[4].values().val).to.be.equal("å"); - expect(list.items[5].values().val).to.be.equal("ö"); - }); - it('should fail to sort åäö asc (becomes öåä)', function() { - i1.values({ val: "a" }); - i2.values({ val: "å" }); - i3.values({ val: "ä" }); - i4.values({ val: "ö" }); - i5.values({ val: "o" }); - i6.values({ val: "s" }); - list.sort('val', { order: "desc" }); - expect(list.items[0].values().val).to.be.equal("ö"); - expect(list.items[1].values().val).to.be.equal("å"); - expect(list.items[2].values().val).to.be.equal("ä"); - expect(list.items[3].values().val).to.be.equal("s"); - expect(list.items[4].values().val).to.be.equal("o"); - expect(list.items[5].values().val).to.be.equal("a"); - }); - it('should handle case-insensitive by default', function() { - i1.values({ val: "e" }); - i2.values({ val: "b" }); - i4.values({ val: "F" }); - i3.values({ val: "D" }); - i5.values({ val: "A" }); - i6.values({ val: "C" }); - list.sort('val'); - expect(list.items[0].values().val).to.be.equal("A"); - expect(list.items[1].values().val).to.be.equal("b"); - expect(list.items[2].values().val).to.be.equal("C"); - expect(list.items[3].values().val).to.be.equal("D"); - expect(list.items[4].values().val).to.be.equal("e"); - expect(list.items[5].values().val).to.be.equal("F"); - }); - it('should disable insensitive', function() { - i1.values({ val: "e" }); - i2.values({ val: "b" }); - i4.values({ val: "F" }); - i3.values({ val: "D" }); - i5.values({ val: "A" }); - i6.values({ val: "C" }); - list.sort('val', { insensitive: false }); - expect(list.items[0].values().val).to.be.equal("A"); - expect(list.items[1].values().val).to.be.equal("C"); - expect(list.items[2].values().val).to.be.equal("D"); - expect(list.items[3].values().val).to.be.equal("F"); - expect(list.items[4].values().val).to.be.equal("b"); - expect(list.items[5].values().val).to.be.equal("e"); - }); - it('should sort dates', function() { - i1.values({ val: "10/12/2008" }); - i2.values({ val: "10/11/2008" }); - i3.values({ val: "10/11/2007" }); - i4.values({ val: "10/12/2009" }); - i5.values({ val: "4/01/2007" }); - i6.values({ val: "10/12/2006" }); - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal("10/12/2006"); - expect(list.items[1].values().val).to.be.equal("4/01/2007"); - expect(list.items[2].values().val).to.be.equal("10/11/2007"); - expect(list.items[3].values().val).to.be.equal("10/11/2008"); - expect(list.items[4].values().val).to.be.equal("10/12/2008"); - expect(list.items[5].values().val).to.be.equal("10/12/2009"); - }); - it('should sort file names', function() { - i1.values({ val: "car.mov" }); - i2.values({ val: "01alpha.sgi" }); - i3.values({ val: "001alpha.sgi" }); - i4.values({ val: "my.string_41299.tif" }); - i5.values({ val: "0003.zip" }); - i6.values({ val: "0002.asp" }); - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal("0002.asp"); - expect(list.items[1].values().val).to.be.equal("0003.zip"); - expect(list.items[2].values().val).to.be.equal("001alpha.sgi"); - expect(list.items[3].values().val).to.be.equal("01alpha.sgi"); - expect(list.items[4].values().val).to.be.equal("car.mov"); - expect(list.items[5].values().val).to.be.equal("my.string_41299.tif"); - }); - it('should sort floates', function() { - i1.values({ val: "10.0401" }); - i2.values({ val: "10.022" }); - i3.values({ val: "10.021999" }); - i4.values({ val: "11.231" }); - i5.values({ val: "0003.123" }); - i6.values({ val: "09.2123" }); - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal("0003.123"); - expect(list.items[1].values().val).to.be.equal("09.2123"); - expect(list.items[2].values().val).to.be.equal("10.021999"); - expect(list.items[3].values().val).to.be.equal("10.022"); - expect(list.items[4].values().val).to.be.equal("10.0401"); - expect(list.items[5].values().val).to.be.equal("11.231"); - }); - it('should sort IP addresses', function() { - i1.values({ val: "192.168.1.1" }); - i2.values({ val: "192.168.0.100" }); - i3.values({ val: "192.168.0.1" }); - i4.values({ val: "192.168.1.3" }); - i5.values({ val: "127.0.0.1" }); - i6.values({ val: "192.168.1.2" }); - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal("127.0.0.1"); - expect(list.items[1].values().val).to.be.equal("192.168.0.1"); - expect(list.items[2].values().val).to.be.equal("192.168.0.100"); - expect(list.items[3].values().val).to.be.equal("192.168.1.1"); - expect(list.items[4].values().val).to.be.equal("192.168.1.2"); - expect(list.items[5].values().val).to.be.equal("192.168.1.3"); - }); - it('should not break with weird values', function() { - i1.values({ val: undefined }); - i2.values({ val: null }); - i3.values({ val: 0 }); - i4.values({ val: function() {} }); - i5.values({ val: { foo: "bar" } }); - - expect(list.sort).withArgs('val').to.not.throwException(); - expect(list.sort).withArgs('val').to.not.throwException(); - expect(list.sort).withArgs('val').to.not.throwException(); - expect(list.sort).withArgs('val').to.not.throwException(); - expect(list.sort).withArgs('val').to.not.throwException(); - expect(list.sort).withArgs('val').to.not.throwException(); - }); - /* - it('should show how random values are sorted', function() { - list.add({ id: '7', val: "" }); - list.add({ id: '8', val: "" }); - list.add({ id: '9', val: "" }); - list.add({ id: '10', val: "" }); - list.add({ id: '11', val: "" }); - list.add({ id: '12', val: "" }); - - var i7 = list.get('id', '7')[0], - i8 = list.get('id', '8')[0], - i9 = list.get('id', '9')[0], - i10 = list.get('id', '10')[0], - i11 = list.get('id', '11')[0], - i12 = list.get('id', '12')[0]; - - i1.values({ val: undefined }); - i2.values({ val: "" }); - i3.values({ val: null }); - i4.values({ val: "a" }); - i5.values({ val: "0" }); - i6.values({ val: true }); - i7.values({ val: 0 }); - i8.values({ val: "z" }); - i9.values({ val: "!" }); - i10.values({ val: "?" }); - i11.values({ val: 100 }); - i12.values({ val: false }); - - list.sort('val', { order: "asc" }); - list.sort('val', { order: "desc" }); - list.sort('val', { order: "asc" }); - - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal("0"); - expect(list.items[2].values().val).to.be.equal(0); - expect(list.items[3].values().val).to.be.equal(100); - expect(list.items[4].values().val).to.be.equal("!"); - expect(list.items[5].values().val).to.be.equal("?"); - expect(list.items[6].values().val).to.be.equal("a"); - expect(list.items[7].values().val).to.be.equal(false); - expect(list.items[8].values().val).to.be.equal(null); - expect(list.items[9].values().val).to.be.equal(true); - expect(list.items[10].values().val).to.be.equal(undefined); - expect(list.items[11].values().val).to.be.equal("z"); - }); - - it('should handle space and zero the same for desc and asc (random)', function() { - list.clear(); - list.add({ val: "" }); - list.add({ val: "0" }); - list.add({ val: 0 }); - - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal("0"); - expect(list.items[2].values().val).to.be.equal(0); - list.sort('val', { order: "desc" }); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal("0"); - expect(list.items[2].values().val).to.be.equal(0); - list.sort('val', { order: "asc" }); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal("0"); - expect(list.items[2].values().val).to.be.equal(0); - }); - */ - }); - - describe('Custom sort function', function() { - it('should use custom sort option', function() { - i1.values({ val: "" }); - i2.values({ val: "" }); - i3.values({ val: "" }); - i4.values({ val: "" }); - i5.values({ val: "" }); - i6.values({ val: "" }); - list.sort('val', { - sortFunction: function(itemA, itemB, options) { - options.desc = false; - return list.utils.naturalSort($(itemA.values()[options.valueName]).val(), $(itemB.values()[options.valueName]).val(), options); - } - }); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal(""); - expect(list.items[2].values().val).to.be.equal(""); - expect(list.items[3].values().val).to.be.equal(""); - expect(list.items[4].values().val).to.be.equal(""); - expect(list.items[5].values().val).to.be.equal(""); - }); - it('should use default custom sort function', function() { - list.sortFunction = function(itemA, itemB, options) { - options.desc = false; - return list.utils.naturalSort($(itemA.values()[options.valueName]).val(), $(itemB.values()[options.valueName]).val(), options); - }; - i1.values({ val: "" }); - i2.values({ val: "" }); - i3.values({ val: "" }); - i4.values({ val: "" }); - i5.values({ val: "" }); - i6.values({ val: "" }); - list.sort('val'); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal(""); - expect(list.items[2].values().val).to.be.equal(""); - expect(list.items[3].values().val).to.be.equal(""); - expect(list.items[4].values().val).to.be.equal(""); - expect(list.items[5].values().val).to.be.equal(""); - }); - it('should use default custom sort function with options', function() { - list.sortFunction = function(itemA, itemB, options) { - options.desc = true; - return list.utils.naturalSort($(itemA.values()[options.valueName]).val(), $(itemB.values()[options.valueName]).val(), options); - }; - i1.values({ val: "" }); - i2.values({ val: "" }); - i3.values({ val: "" }); - i4.values({ val: "" }); - i5.values({ val: "" }); - i6.values({ val: "" }); - list.sort('val', { order: "desc"}); - expect(list.items[0].values().val).to.be.equal(""); - expect(list.items[1].values().val).to.be.equal(""); - expect(list.items[2].values().val).to.be.equal(""); - expect(list.items[3].values().val).to.be.equal(""); - expect(list.items[4].values().val).to.be.equal(""); - expect(list.items[5].values().val).to.be.equal(""); - }); - }); -}); diff --git a/test/test.trigger.js b/test/test.trigger.js deleted file mode 100644 index 12ad8890..00000000 --- a/test/test.trigger.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('Trigger', function() { - - var list; - - before(function() { - list = fixture.list(['name', 'born'], fixture.all); - }); - - after(function() { - fixture.removeList(); - }); - - describe('General', function() { - it('should be triggered by searchComplete', function(done) { - list.on('searchComplete', function() { - done(); - }); - list.trigger('searchComplete'); - }); - }); -}); \ No newline at end of file diff --git a/test/usage/main.js b/test/usage/main.js deleted file mode 100644 index 63cc377b..00000000 --- a/test/usage/main.js +++ /dev/null @@ -1,6 +0,0 @@ -require(['../../dist/list', '../../dist/list.min'], function(List, ListMin) { - var options = { - valueNames: [ 'name', 'born' ] - }; - var userList = new List('users', options); -}); diff --git a/test/usage/require.js b/test/usage/require.js deleted file mode 100644 index babfa9ad..00000000 --- a/test/usage/require.js +++ /dev/null @@ -1,2083 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -//Not using strict: uneven strict support in browsers, #392, and causes -//problems with requirejs.exec()/transpiler plugins that may not be strict. -/*jslint regexp: true, nomen: true, sloppy: true */ -/*global window, navigator, document, importScripts, setTimeout, opera */ - -var requirejs, require, define; -(function (global) { - var req, s, head, baseElement, dataMain, src, - interactiveScript, currentlyAddingScript, mainScript, subPath, - version = '2.1.17', - commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, - cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, - jsSuffixRegExp = /\.js$/, - currDirRegExp = /^\.\//, - op = Object.prototype, - ostring = op.toString, - hasOwn = op.hasOwnProperty, - ap = Array.prototype, - apsp = ap.splice, - isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), - isWebWorker = !isBrowser && typeof importScripts !== 'undefined', - //PS3 indicates loaded and complete, but need to wait for complete - //specifically. Sequence is 'loading', 'loaded', execution, - // then 'complete'. The UA check is unfortunate, but not sure how - //to feature test w/o causing perf issues. - readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? - /^complete$/ : /^(complete|loaded)$/, - defContextName = '_', - //Oh the tragedy, detecting opera. See the usage of isOpera for reason. - isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', - contexts = {}, - cfg = {}, - globalDefQueue = [], - useInteractive = false; - - function isFunction(it) { - return ostring.call(it) === '[object Function]'; - } - - function isArray(it) { - return ostring.call(it) === '[object Array]'; - } - - /** - * Helper function for iterating over an array. If the func returns - * a true value, it will break out of the loop. - */ - function each(ary, func) { - if (ary) { - var i; - for (i = 0; i < ary.length; i += 1) { - if (ary[i] && func(ary[i], i, ary)) { - break; - } - } - } - } - - /** - * Helper function for iterating over an array backwards. If the func - * returns a true value, it will break out of the loop. - */ - function eachReverse(ary, func) { - if (ary) { - var i; - for (i = ary.length - 1; i > -1; i -= 1) { - if (ary[i] && func(ary[i], i, ary)) { - break; - } - } - } - } - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - function getOwn(obj, prop) { - return hasProp(obj, prop) && obj[prop]; - } - - /** - * Cycles over properties in an object and calls a function for each - * property value. If the function returns a truthy value, then the - * iteration is stopped. - */ - function eachProp(obj, func) { - var prop; - for (prop in obj) { - if (hasProp(obj, prop)) { - if (func(obj[prop], prop)) { - break; - } - } - } - } - - /** - * Simple function to mix in properties from source into target, - * but only if target does not already have a property of the same name. - */ - function mixin(target, source, force, deepStringMixin) { - if (source) { - eachProp(source, function (value, prop) { - if (force || !hasProp(target, prop)) { - if (deepStringMixin && typeof value === 'object' && value && - !isArray(value) && !isFunction(value) && - !(value instanceof RegExp)) { - - if (!target[prop]) { - target[prop] = {}; - } - mixin(target[prop], value, force, deepStringMixin); - } else { - target[prop] = value; - } - } - }); - } - return target; - } - - //Similar to Function.prototype.bind, but the 'this' object is specified - //first, since it is easier to read/figure out what 'this' will be. - function bind(obj, fn) { - return function () { - return fn.apply(obj, arguments); - }; - } - - function scripts() { - return document.getElementsByTagName('script'); - } - - function defaultOnError(err) { - throw err; - } - - //Allow getting a global that is expressed in - //dot notation, like 'a.b.c'. - function getGlobal(value) { - if (!value) { - return value; - } - var g = global; - each(value.split('.'), function (part) { - g = g[part]; - }); - return g; - } - - /** - * Constructs an error with a pointer to an URL with more information. - * @param {String} id the error ID that maps to an ID on a web page. - * @param {String} message human readable error. - * @param {Error} [err] the original error, if there is one. - * - * @returns {Error} - */ - function makeError(id, msg, err, requireModules) { - var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); - e.requireType = id; - e.requireModules = requireModules; - if (err) { - e.originalError = err; - } - return e; - } - - if (typeof define !== 'undefined') { - //If a define is already in play via another AMD loader, - //do not overwrite. - return; - } - - if (typeof requirejs !== 'undefined') { - if (isFunction(requirejs)) { - //Do not overwrite an existing requirejs instance. - return; - } - cfg = requirejs; - requirejs = undefined; - } - - //Allow for a require config object - if (typeof require !== 'undefined' && !isFunction(require)) { - //assume it is a config object. - cfg = require; - require = undefined; - } - - function newContext(contextName) { - var inCheckLoaded, Module, context, handlers, - checkLoadedTimeoutId, - config = { - //Defaults. Do not set a default for map - //config to speed up normalize(), which - //will run faster if there is no default. - waitSeconds: 7, - baseUrl: './', - paths: {}, - bundles: {}, - pkgs: {}, - shim: {}, - config: {} - }, - registry = {}, - //registry of just enabled modules, to speed - //cycle breaking code when lots of modules - //are registered, but not activated. - enabledRegistry = {}, - undefEvents = {}, - defQueue = [], - defined = {}, - urlFetched = {}, - bundlesMap = {}, - requireCounter = 1, - unnormalizedCounter = 1; - - /** - * Trims the . and .. from an array of path segments. - * It will keep a leading path segment if a .. will become - * the first path segment, to help with module name lookups, - * which act like paths, but can be remapped. But the end result, - * all paths that use this function should look normalized. - * NOTE: this method MODIFIES the input array. - * @param {Array} ary the array of path segments. - */ - function trimDots(ary) { - var i, part; - for (i = 0; i < ary.length; i++) { - part = ary[i]; - if (part === '.') { - ary.splice(i, 1); - i -= 1; - } else if (part === '..') { - // If at the start, or previous value is still .., - // keep them so that when converted to a path it may - // still work when converted to a path, even though - // as an ID it is less than ideal. In larger point - // releases, may be better to just kick out an error. - if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { - continue; - } else if (i > 0) { - ary.splice(i - 1, 2); - i -= 2; - } - } - } - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @param {Boolean} applyMap apply the map config to the value. Should - * only be done if this normalization is for a dependency ID. - * @returns {String} normalized name - */ - function normalize(name, baseName, applyMap) { - var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, - foundMap, foundI, foundStarMap, starI, normalizedBaseParts, - baseParts = (baseName && baseName.split('/')), - map = config.map, - starMap = map && map['*']; - - //Adjust any relative paths. - if (name) { - name = name.split('/'); - lastIndex = name.length - 1; - - // If wanting node ID compatibility, strip .js from end - // of IDs. Have to do this here, and not in nameToUrl - // because node allows either .js or non .js to map - // to same file. - if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { - name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); - } - - // Starts with a '.' so need the baseName - if (name[0].charAt(0) === '.' && baseParts) { - //Convert baseName to array, and lop off the last part, - //so that . matches that 'directory' and not name of the baseName's - //module. For instance, baseName of 'one/two/three', maps to - //'one/two/three.js', but we want the directory, 'one/two' for - //this normalization. - normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); - name = normalizedBaseParts.concat(name); - } - - trimDots(name); - name = name.join('/'); - } - - //Apply map config if available. - if (applyMap && map && (baseParts || starMap)) { - nameParts = name.split('/'); - - outerLoop: for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join('/'); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = getOwn(map, baseParts.slice(0, j).join('/')); - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = getOwn(mapValue, nameSegment); - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break outerLoop; - } - } - } - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { - foundStarMap = getOwn(starMap, nameSegment); - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - // If the name points to a package's name, use - // the package main instead. - pkgMain = getOwn(config.pkgs, name); - - return pkgMain ? pkgMain : name; - } - - function removeScript(name) { - if (isBrowser) { - each(scripts(), function (scriptNode) { - if (scriptNode.getAttribute('data-requiremodule') === name && - scriptNode.getAttribute('data-requirecontext') === context.contextName) { - scriptNode.parentNode.removeChild(scriptNode); - return true; - } - }); - } - } - - function hasPathFallback(id) { - var pathConfig = getOwn(config.paths, id); - if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { - //Pop off the first array value, since it failed, and - //retry - pathConfig.shift(); - context.require.undef(id); - - //Custom require that does not do map translation, since - //ID is "absolute", already mapped/resolved. - context.makeRequire(null, { - skipMap: true - })([id]); - - return true; - } - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Creates a module mapping that includes plugin prefix, module - * name, and path. If parentModuleMap is provided it will - * also normalize the name via require.normalize() - * - * @param {String} name the module name - * @param {String} [parentModuleMap] parent module map - * for the module name, used to resolve relative names. - * @param {Boolean} isNormalized: is the ID already normalized. - * This is true if this call is done for a define() module ID. - * @param {Boolean} applyMap: apply the map config to the ID. - * Should only be true if this map is for a dependency. - * - * @returns {Object} - */ - function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { - var url, pluginModule, suffix, nameParts, - prefix = null, - parentName = parentModuleMap ? parentModuleMap.name : null, - originalName = name, - isDefine = true, - normalizedName = ''; - - //If no name, then it means it is a require call, generate an - //internal name. - if (!name) { - isDefine = false; - name = '_@r' + (requireCounter += 1); - } - - nameParts = splitPrefix(name); - prefix = nameParts[0]; - name = nameParts[1]; - - if (prefix) { - prefix = normalize(prefix, parentName, applyMap); - pluginModule = getOwn(defined, prefix); - } - - //Account for relative paths if there is a base name. - if (name) { - if (prefix) { - if (pluginModule && pluginModule.normalize) { - //Plugin is loaded, use its normalize method. - normalizedName = pluginModule.normalize(name, function (name) { - return normalize(name, parentName, applyMap); - }); - } else { - // If nested plugin references, then do not try to - // normalize, as it will not normalize correctly. This - // places a restriction on resourceIds, and the longer - // term solution is not to normalize until plugins are - // loaded and all normalizations to allow for async - // loading of a loader plugin. But for now, fixes the - // common uses. Details in #1131 - normalizedName = name.indexOf('!') === -1 ? - normalize(name, parentName, applyMap) : - name; - } - } else { - //A regular module. - normalizedName = normalize(name, parentName, applyMap); - - //Normalized name may be a plugin ID due to map config - //application in normalize. The map config values must - //already be normalized, so do not need to redo that part. - nameParts = splitPrefix(normalizedName); - prefix = nameParts[0]; - normalizedName = nameParts[1]; - isNormalized = true; - - url = context.nameToUrl(normalizedName); - } - } - - //If the id is a plugin id that cannot be determined if it needs - //normalization, stamp it with a unique ID so two matching relative - //ids that may conflict can be separate. - suffix = prefix && !pluginModule && !isNormalized ? - '_unnormalized' + (unnormalizedCounter += 1) : - ''; - - return { - prefix: prefix, - name: normalizedName, - parentMap: parentModuleMap, - unnormalized: !!suffix, - url: url, - originalName: originalName, - isDefine: isDefine, - id: (prefix ? - prefix + '!' + normalizedName : - normalizedName) + suffix - }; - } - - function getModule(depMap) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (!mod) { - mod = registry[id] = new context.Module(depMap); - } - - return mod; - } - - function on(depMap, name, fn) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (hasProp(defined, id) && - (!mod || mod.defineEmitComplete)) { - if (name === 'defined') { - fn(defined[id]); - } - } else { - mod = getModule(depMap); - if (mod.error && name === 'error') { - fn(mod.error); - } else { - mod.on(name, fn); - } - } - } - - function onError(err, errback) { - var ids = err.requireModules, - notified = false; - - if (errback) { - errback(err); - } else { - each(ids, function (id) { - var mod = getOwn(registry, id); - if (mod) { - //Set error on module, so it skips timeout checks. - mod.error = err; - if (mod.events.error) { - notified = true; - mod.emit('error', err); - } - } - }); - - if (!notified) { - req.onError(err); - } - } - } - - /** - * Internal method to transfer globalQueue items to this context's - * defQueue. - */ - function takeGlobalQueue() { - //Push all the globalDefQueue items into the context's defQueue - if (globalDefQueue.length) { - //Array splice in the values since the context code has a - //local var ref to defQueue, so cannot just reassign the one - //on context. - apsp.apply(defQueue, - [defQueue.length, 0].concat(globalDefQueue)); - globalDefQueue = []; - } - } - - handlers = { - 'require': function (mod) { - if (mod.require) { - return mod.require; - } else { - return (mod.require = context.makeRequire(mod.map)); - } - }, - 'exports': function (mod) { - mod.usingExports = true; - if (mod.map.isDefine) { - if (mod.exports) { - return (defined[mod.map.id] = mod.exports); - } else { - return (mod.exports = defined[mod.map.id] = {}); - } - } - }, - 'module': function (mod) { - if (mod.module) { - return mod.module; - } else { - return (mod.module = { - id: mod.map.id, - uri: mod.map.url, - config: function () { - return getOwn(config.config, mod.map.id) || {}; - }, - exports: mod.exports || (mod.exports = {}) - }); - } - } - }; - - function cleanRegistry(id) { - //Clean up machinery used for waiting modules. - delete registry[id]; - delete enabledRegistry[id]; - } - - function breakCycle(mod, traced, processed) { - var id = mod.map.id; - - if (mod.error) { - mod.emit('error', mod.error); - } else { - traced[id] = true; - each(mod.depMaps, function (depMap, i) { - var depId = depMap.id, - dep = getOwn(registry, depId); - - //Only force things that have not completed - //being defined, so still in the registry, - //and only if it has not been matched up - //in the module already. - if (dep && !mod.depMatched[i] && !processed[depId]) { - if (getOwn(traced, depId)) { - mod.defineDep(i, defined[depId]); - mod.check(); //pass false? - } else { - breakCycle(dep, traced, processed); - } - } - }); - processed[id] = true; - } - } - - function checkLoaded() { - var err, usingPathFallback, - waitInterval = config.waitSeconds * 1000, - //It is possible to disable the wait interval by using waitSeconds of 0. - expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), - noLoads = [], - reqCalls = [], - stillLoading = false, - needCycleCheck = true; - - //Do not bother if this call was a result of a cycle break. - if (inCheckLoaded) { - return; - } - - inCheckLoaded = true; - - //Figure out the state of all the modules. - eachProp(enabledRegistry, function (mod) { - var map = mod.map, - modId = map.id; - - //Skip things that are not enabled or in error state. - if (!mod.enabled) { - return; - } - - if (!map.isDefine) { - reqCalls.push(mod); - } - - if (!mod.error) { - //If the module should be executed, and it has not - //been inited and time is up, remember it. - if (!mod.inited && expired) { - if (hasPathFallback(modId)) { - usingPathFallback = true; - stillLoading = true; - } else { - noLoads.push(modId); - removeScript(modId); - } - } else if (!mod.inited && mod.fetched && map.isDefine) { - stillLoading = true; - if (!map.prefix) { - //No reason to keep looking for unfinished - //loading. If the only stillLoading is a - //plugin resource though, keep going, - //because it may be that a plugin resource - //is waiting on a non-plugin cycle. - return (needCycleCheck = false); - } - } - } - }); - - if (expired && noLoads.length) { - //If wait time expired, throw error of unloaded modules. - err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); - err.contextName = context.contextName; - return onError(err); - } - - //Not expired, check for a cycle. - if (needCycleCheck) { - each(reqCalls, function (mod) { - breakCycle(mod, {}, {}); - }); - } - - //If still waiting on loads, and the waiting load is something - //other than a plugin resource, or there are still outstanding - //scripts, then just try back later. - if ((!expired || usingPathFallback) && stillLoading) { - //Something is still waiting to load. Wait for it, but only - //if a timeout is not already in effect. - if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { - checkLoadedTimeoutId = setTimeout(function () { - checkLoadedTimeoutId = 0; - checkLoaded(); - }, 50); - } - } - - inCheckLoaded = false; - } - - Module = function (map) { - this.events = getOwn(undefEvents, map.id) || {}; - this.map = map; - this.shim = getOwn(config.shim, map.id); - this.depExports = []; - this.depMaps = []; - this.depMatched = []; - this.pluginMaps = {}; - this.depCount = 0; - - /* this.exports this.factory - this.depMaps = [], - this.enabled, this.fetched - */ - }; - - Module.prototype = { - init: function (depMaps, factory, errback, options) { - options = options || {}; - - //Do not do more inits if already done. Can happen if there - //are multiple define calls for the same module. That is not - //a normal, common case, but it is also not unexpected. - if (this.inited) { - return; - } - - this.factory = factory; - - if (errback) { - //Register for errors on this module. - this.on('error', errback); - } else if (this.events.error) { - //If no errback already, but there are error listeners - //on this module, set up an errback to pass to the deps. - errback = bind(this, function (err) { - this.emit('error', err); - }); - } - - //Do a copy of the dependency array, so that - //source inputs are not modified. For example - //"shim" deps are passed in here directly, and - //doing a direct modification of the depMaps array - //would affect that config. - this.depMaps = depMaps && depMaps.slice(0); - - this.errback = errback; - - //Indicate this module has be initialized - this.inited = true; - - this.ignore = options.ignore; - - //Could have option to init this module in enabled mode, - //or could have been previously marked as enabled. However, - //the dependencies are not known until init is called. So - //if enabled previously, now trigger dependencies as enabled. - if (options.enabled || this.enabled) { - //Enable this module and dependencies. - //Will call this.check() - this.enable(); - } else { - this.check(); - } - }, - - defineDep: function (i, depExports) { - //Because of cycles, defined callback for a given - //export can be called more than once. - if (!this.depMatched[i]) { - this.depMatched[i] = true; - this.depCount -= 1; - this.depExports[i] = depExports; - } - }, - - fetch: function () { - if (this.fetched) { - return; - } - this.fetched = true; - - context.startTime = (new Date()).getTime(); - - var map = this.map; - - //If the manager is for a plugin managed resource, - //ask the plugin to load it now. - if (this.shim) { - context.makeRequire(this.map, { - enableBuildCallback: true - })(this.shim.deps || [], bind(this, function () { - return map.prefix ? this.callPlugin() : this.load(); - })); - } else { - //Regular dependency. - return map.prefix ? this.callPlugin() : this.load(); - } - }, - - load: function () { - var url = this.map.url; - - //Regular dependency. - if (!urlFetched[url]) { - urlFetched[url] = true; - context.load(this.map.id, url); - } - }, - - /** - * Checks if the module is ready to define itself, and if so, - * define it. - */ - check: function () { - if (!this.enabled || this.enabling) { - return; - } - - var err, cjsModule, - id = this.map.id, - depExports = this.depExports, - exports = this.exports, - factory = this.factory; - - if (!this.inited) { - this.fetch(); - } else if (this.error) { - this.emit('error', this.error); - } else if (!this.defining) { - //The factory could trigger another require call - //that would result in checking this module to - //define itself again. If already in the process - //of doing that, skip this work. - this.defining = true; - - if (this.depCount < 1 && !this.defined) { - if (isFunction(factory)) { - //If there is an error listener, favor passing - //to that instead of throwing an error. However, - //only do it for define()'d modules. require - //errbacks should not be called for failures in - //their callbacks (#699). However if a global - //onError is set, use that. - if ((this.events.error && this.map.isDefine) || - req.onError !== defaultOnError) { - try { - exports = context.execCb(id, factory, depExports, exports); - } catch (e) { - err = e; - } - } else { - exports = context.execCb(id, factory, depExports, exports); - } - - // Favor return value over exports. If node/cjs in play, - // then will not have a return value anyway. Favor - // module.exports assignment over exports object. - if (this.map.isDefine && exports === undefined) { - cjsModule = this.module; - if (cjsModule) { - exports = cjsModule.exports; - } else if (this.usingExports) { - //exports already set the defined value. - exports = this.exports; - } - } - - if (err) { - err.requireMap = this.map; - err.requireModules = this.map.isDefine ? [this.map.id] : null; - err.requireType = this.map.isDefine ? 'define' : 'require'; - return onError((this.error = err)); - } - - } else { - //Just a literal value - exports = factory; - } - - this.exports = exports; - - if (this.map.isDefine && !this.ignore) { - defined[id] = exports; - - if (req.onResourceLoad) { - req.onResourceLoad(context, this.map, this.depMaps); - } - } - - //Clean up - cleanRegistry(id); - - this.defined = true; - } - - //Finished the define stage. Allow calling check again - //to allow define notifications below in the case of a - //cycle. - this.defining = false; - - if (this.defined && !this.defineEmitted) { - this.defineEmitted = true; - this.emit('defined', this.exports); - this.defineEmitComplete = true; - } - - } - }, - - callPlugin: function () { - var map = this.map, - id = map.id, - //Map already normalized the prefix. - pluginMap = makeModuleMap(map.prefix); - - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(pluginMap); - - on(pluginMap, 'defined', bind(this, function (plugin) { - var load, normalizedMap, normalizedMod, - bundleId = getOwn(bundlesMap, this.map.id), - name = this.map.name, - parentName = this.map.parentMap ? this.map.parentMap.name : null, - localRequire = context.makeRequire(map.parentMap, { - enableBuildCallback: true - }); - - //If current map is not normalized, wait for that - //normalized name to load instead of continuing. - if (this.map.unnormalized) { - //Normalize the ID if the plugin allows it. - if (plugin.normalize) { - name = plugin.normalize(name, function (name) { - return normalize(name, parentName, true); - }) || ''; - } - - //prefix and name should already be normalized, no need - //for applying map config again either. - normalizedMap = makeModuleMap(map.prefix + '!' + name, - this.map.parentMap); - on(normalizedMap, - 'defined', bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true, - ignore: true - }); - })); - - normalizedMod = getOwn(registry, normalizedMap.id); - if (normalizedMod) { - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(normalizedMap); - - if (this.events.error) { - normalizedMod.on('error', bind(this, function (err) { - this.emit('error', err); - })); - } - normalizedMod.enable(); - } - - return; - } - - //If a paths config, then just load that file instead to - //resolve the plugin, as it is built into that paths layer. - if (bundleId) { - this.map.url = context.nameToUrl(bundleId); - this.load(); - return; - } - - load = bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true - }); - }); - - load.error = bind(this, function (err) { - this.inited = true; - this.error = err; - err.requireModules = [id]; - - //Remove temp unnormalized modules for this module, - //since they will never be resolved otherwise now. - eachProp(registry, function (mod) { - if (mod.map.id.indexOf(id + '_unnormalized') === 0) { - cleanRegistry(mod.map.id); - } - }); - - onError(err); - }); - - //Allow plugins to load other code without having to know the - //context or how to 'complete' the load. - load.fromText = bind(this, function (text, textAlt) { - /*jslint evil: true */ - var moduleName = map.name, - moduleMap = makeModuleMap(moduleName), - hasInteractive = useInteractive; - - //As of 2.1.0, support just passing the text, to reinforce - //fromText only being called once per resource. Still - //support old style of passing moduleName but discard - //that moduleName in favor of the internal ref. - if (textAlt) { - text = textAlt; - } - - //Turn off interactive script matching for IE for any define - //calls in the text, then turn it back on at the end. - if (hasInteractive) { - useInteractive = false; - } - - //Prime the system by creating a module instance for - //it. - getModule(moduleMap); - - //Transfer any config to this other module. - if (hasProp(config.config, id)) { - config.config[moduleName] = config.config[id]; - } - - try { - req.exec(text); - } catch (e) { - return onError(makeError('fromtexteval', - 'fromText eval for ' + id + - ' failed: ' + e, - e, - [id])); - } - - if (hasInteractive) { - useInteractive = true; - } - - //Mark this as a dependency for the plugin - //resource - this.depMaps.push(moduleMap); - - //Support anonymous modules. - context.completeLoad(moduleName); - - //Bind the value of that module to the value for this - //resource ID. - localRequire([moduleName], load); - }); - - //Use parentName here since the plugin's name is not reliable, - //could be some weird string with no path that actually wants to - //reference the parentName's path. - plugin.load(map.name, localRequire, load, config); - })); - - context.enable(pluginMap, this); - this.pluginMaps[pluginMap.id] = pluginMap; - }, - - enable: function () { - enabledRegistry[this.map.id] = this; - this.enabled = true; - - //Set flag mentioning that the module is enabling, - //so that immediate calls to the defined callbacks - //for dependencies do not trigger inadvertent load - //with the depCount still being zero. - this.enabling = true; - - //Enable each dependency - each(this.depMaps, bind(this, function (depMap, i) { - var id, mod, handler; - - if (typeof depMap === 'string') { - //Dependency needs to be converted to a depMap - //and wired up to this module. - depMap = makeModuleMap(depMap, - (this.map.isDefine ? this.map : this.map.parentMap), - false, - !this.skipMap); - this.depMaps[i] = depMap; - - handler = getOwn(handlers, depMap.id); - - if (handler) { - this.depExports[i] = handler(this); - return; - } - - this.depCount += 1; - - on(depMap, 'defined', bind(this, function (depExports) { - this.defineDep(i, depExports); - this.check(); - })); - - if (this.errback) { - on(depMap, 'error', bind(this, this.errback)); - } else if (this.events.error) { - // No direct errback on this module, but something - // else is listening for errors, so be sure to - // propagate the error correctly. - on(depMap, 'error', bind(this, function(err) { - this.emit('error', err); - })); - } - } - - id = depMap.id; - mod = registry[id]; - - //Skip special modules like 'require', 'exports', 'module' - //Also, don't call enable if it is already enabled, - //important in circular dependency cases. - if (!hasProp(handlers, id) && mod && !mod.enabled) { - context.enable(depMap, this); - } - })); - - //Enable each plugin that is used in - //a dependency - eachProp(this.pluginMaps, bind(this, function (pluginMap) { - var mod = getOwn(registry, pluginMap.id); - if (mod && !mod.enabled) { - context.enable(pluginMap, this); - } - })); - - this.enabling = false; - - this.check(); - }, - - on: function (name, cb) { - var cbs = this.events[name]; - if (!cbs) { - cbs = this.events[name] = []; - } - cbs.push(cb); - }, - - emit: function (name, evt) { - each(this.events[name], function (cb) { - cb(evt); - }); - if (name === 'error') { - //Now that the error handler was triggered, remove - //the listeners, since this broken Module instance - //can stay around for a while in the registry. - delete this.events[name]; - } - } - }; - - function callGetModule(args) { - //Skip modules already defined. - if (!hasProp(defined, args[0])) { - getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); - } - } - - function removeListener(node, func, name, ieName) { - //Favor detachEvent because of IE9 - //issue, see attachEvent/addEventListener comment elsewhere - //in this file. - if (node.detachEvent && !isOpera) { - //Probably IE. If not it will throw an error, which will be - //useful to know. - if (ieName) { - node.detachEvent(ieName, func); - } - } else { - node.removeEventListener(name, func, false); - } - } - - /** - * Given an event from a script node, get the requirejs info from it, - * and then removes the event listeners on the node. - * @param {Event} evt - * @returns {Object} - */ - function getScriptData(evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - var node = evt.currentTarget || evt.srcElement; - - //Remove the listeners once here. - removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); - removeListener(node, context.onScriptError, 'error'); - - return { - node: node, - id: node && node.getAttribute('data-requiremodule') - }; - } - - function intakeDefines() { - var args; - - //Any defined modules in the global queue, intake them now. - takeGlobalQueue(); - - //Make sure any remaining defQueue items get properly processed. - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); - } else { - //args are id, deps, factory. Should be normalized by the - //define() function. - callGetModule(args); - } - } - } - - context = { - config: config, - contextName: contextName, - registry: registry, - defined: defined, - urlFetched: urlFetched, - defQueue: defQueue, - Module: Module, - makeModuleMap: makeModuleMap, - nextTick: req.nextTick, - onError: onError, - - /** - * Set a configuration for the context. - * @param {Object} cfg config object to integrate. - */ - configure: function (cfg) { - //Make sure the baseUrl ends in a slash. - if (cfg.baseUrl) { - if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { - cfg.baseUrl += '/'; - } - } - - //Save off the paths since they require special processing, - //they are additive. - var shim = config.shim, - objs = { - paths: true, - bundles: true, - config: true, - map: true - }; - - eachProp(cfg, function (value, prop) { - if (objs[prop]) { - if (!config[prop]) { - config[prop] = {}; - } - mixin(config[prop], value, true, true); - } else { - config[prop] = value; - } - }); - - //Reverse map the bundles - if (cfg.bundles) { - eachProp(cfg.bundles, function (value, prop) { - each(value, function (v) { - if (v !== prop) { - bundlesMap[v] = prop; - } - }); - }); - } - - //Merge shim - if (cfg.shim) { - eachProp(cfg.shim, function (value, id) { - //Normalize the structure - if (isArray(value)) { - value = { - deps: value - }; - } - if ((value.exports || value.init) && !value.exportsFn) { - value.exportsFn = context.makeShimExports(value); - } - shim[id] = value; - }); - config.shim = shim; - } - - //Adjust packages if necessary. - if (cfg.packages) { - each(cfg.packages, function (pkgObj) { - var location, name; - - pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; - - name = pkgObj.name; - location = pkgObj.location; - if (location) { - config.paths[name] = pkgObj.location; - } - - //Save pointer to main module ID for pkg name. - //Remove leading dot in main, so main paths are normalized, - //and remove any trailing .js, since different package - //envs have different conventions: some use a module name, - //some use a file name. - config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') - .replace(currDirRegExp, '') - .replace(jsSuffixRegExp, ''); - }); - } - - //If there are any "waiting to execute" modules in the registry, - //update the maps for them, since their info, like URLs to load, - //may have changed. - eachProp(registry, function (mod, id) { - //If module already has init called, since it is too - //late to modify them, and ignore unnormalized ones - //since they are transient. - if (!mod.inited && !mod.map.unnormalized) { - mod.map = makeModuleMap(id); - } - }); - - //If a deps array or a config callback is specified, then call - //require with those args. This is useful when require is defined as a - //config object before require.js is loaded. - if (cfg.deps || cfg.callback) { - context.require(cfg.deps || [], cfg.callback); - } - }, - - makeShimExports: function (value) { - function fn() { - var ret; - if (value.init) { - ret = value.init.apply(global, arguments); - } - return ret || (value.exports && getGlobal(value.exports)); - } - return fn; - }, - - makeRequire: function (relMap, options) { - options = options || {}; - - function localRequire(deps, callback, errback) { - var id, map, requireMod; - - if (options.enableBuildCallback && callback && isFunction(callback)) { - callback.__requireJsBuild = true; - } - - if (typeof deps === 'string') { - if (isFunction(callback)) { - //Invalid call - return onError(makeError('requireargs', 'Invalid require call'), errback); - } - - //If require|exports|module are requested, get the - //value for them from the special handlers. Caveat: - //this only works while module is being defined. - if (relMap && hasProp(handlers, deps)) { - return handlers[deps](registry[relMap.id]); - } - - //Synchronous access to one module. If require.get is - //available (as in the Node adapter), prefer that. - if (req.get) { - return req.get(context, deps, relMap, localRequire); - } - - //Normalize module name, if it contains . or .. - map = makeModuleMap(deps, relMap, false, true); - id = map.id; - - if (!hasProp(defined, id)) { - return onError(makeError('notloaded', 'Module name "' + - id + - '" has not been loaded yet for context: ' + - contextName + - (relMap ? '' : '. Use require([])'))); - } - return defined[id]; - } - - //Grab defines waiting in the global queue. - intakeDefines(); - - //Mark all the dependencies as needing to be loaded. - context.nextTick(function () { - //Some defines could have been added since the - //require call, collect them. - intakeDefines(); - - requireMod = getModule(makeModuleMap(null, relMap)); - - //Store if map config should be applied to this require - //call for dependencies. - requireMod.skipMap = options.skipMap; - - requireMod.init(deps, callback, errback, { - enabled: true - }); - - checkLoaded(); - }); - - return localRequire; - } - - mixin(localRequire, { - isBrowser: isBrowser, - - /** - * Converts a module name + .extension into an URL path. - * *Requires* the use of a module name. It does not support using - * plain URLs like nameToUrl. - */ - toUrl: function (moduleNamePlusExt) { - var ext, - index = moduleNamePlusExt.lastIndexOf('.'), - segment = moduleNamePlusExt.split('/')[0], - isRelative = segment === '.' || segment === '..'; - - //Have a file extension alias, and it is not the - //dots from a relative path. - if (index !== -1 && (!isRelative || index > 1)) { - ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); - moduleNamePlusExt = moduleNamePlusExt.substring(0, index); - } - - return context.nameToUrl(normalize(moduleNamePlusExt, - relMap && relMap.id, true), ext, true); - }, - - defined: function (id) { - return hasProp(defined, makeModuleMap(id, relMap, false, true).id); - }, - - specified: function (id) { - id = makeModuleMap(id, relMap, false, true).id; - return hasProp(defined, id) || hasProp(registry, id); - } - }); - - //Only allow undef on top level require calls - if (!relMap) { - localRequire.undef = function (id) { - //Bind any waiting define() calls to this context, - //fix for #408 - takeGlobalQueue(); - - var map = makeModuleMap(id, relMap, true), - mod = getOwn(registry, id); - - removeScript(id); - - delete defined[id]; - delete urlFetched[map.url]; - delete undefEvents[id]; - - //Clean queued defines too. Go backwards - //in array so that the splices do not - //mess up the iteration. - eachReverse(defQueue, function(args, i) { - if(args[0] === id) { - defQueue.splice(i, 1); - } - }); - - if (mod) { - //Hold on to listeners in case the - //module will be attempted to be reloaded - //using a different config. - if (mod.events.defined) { - undefEvents[id] = mod.events; - } - - cleanRegistry(id); - } - }; - } - - return localRequire; - }, - - /** - * Called to enable a module if it is still in the registry - * awaiting enablement. A second arg, parent, the parent module, - * is passed in for context, when this method is overridden by - * the optimizer. Not shown here to keep code compact. - */ - enable: function (depMap) { - var mod = getOwn(registry, depMap.id); - if (mod) { - getModule(depMap).enable(); - } - }, - - /** - * Internal method used by environment adapters to complete a load event. - * A load event could be a script load or just a load pass from a synchronous - * load call. - * @param {String} moduleName the name of the module to potentially complete. - */ - completeLoad: function (moduleName) { - var found, args, mod, - shim = getOwn(config.shim, moduleName) || {}, - shExports = shim.exports; - - takeGlobalQueue(); - - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - args[0] = moduleName; - //If already found an anonymous module and bound it - //to this name, then this is some other anon module - //waiting for its completeLoad to fire. - if (found) { - break; - } - found = true; - } else if (args[0] === moduleName) { - //Found matching define call for this script! - found = true; - } - - callGetModule(args); - } - - //Do this after the cycle of callGetModule in case the result - //of those calls/init calls changes the registry. - mod = getOwn(registry, moduleName); - - if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { - if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { - if (hasPathFallback(moduleName)) { - return; - } else { - return onError(makeError('nodefine', - 'No define call for ' + moduleName, - null, - [moduleName])); - } - } else { - //A script that does not call define(), so just simulate - //the call for it. - callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); - } - } - - checkLoaded(); - }, - - /** - * Converts a module name to a file path. Supports cases where - * moduleName may actually be just an URL. - * Note that it **does not** call normalize on the moduleName, - * it is assumed to have already been normalized. This is an - * internal API, not a public one. Use toUrl for the public API. - */ - nameToUrl: function (moduleName, ext, skipExt) { - var paths, syms, i, parentModule, url, - parentPath, bundleId, - pkgMain = getOwn(config.pkgs, moduleName); - - if (pkgMain) { - moduleName = pkgMain; - } - - bundleId = getOwn(bundlesMap, moduleName); - - if (bundleId) { - return context.nameToUrl(bundleId, ext, skipExt); - } - - //If a colon is in the URL, it indicates a protocol is used and it is just - //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) - //or ends with .js, then assume the user meant to use an url and not a module id. - //The slash is important for protocol-less URLs as well as full paths. - if (req.jsExtRegExp.test(moduleName)) { - //Just a plain path, not module name lookup, so just return it. - //Add extension if it is included. This is a bit wonky, only non-.js things pass - //an extension, this method probably needs to be reworked. - url = moduleName + (ext || ''); - } else { - //A module that needs to be converted to a path. - paths = config.paths; - - syms = moduleName.split('/'); - //For each module name segment, see if there is a path - //registered for it. Start with most specific name - //and work up from it. - for (i = syms.length; i > 0; i -= 1) { - parentModule = syms.slice(0, i).join('/'); - - parentPath = getOwn(paths, parentModule); - if (parentPath) { - //If an array, it means there are a few choices, - //Choose the one that is desired - if (isArray(parentPath)) { - parentPath = parentPath[0]; - } - syms.splice(0, i, parentPath); - break; - } - } - - //Join the path parts together, then figure out if baseUrl is needed. - url = syms.join('/'); - url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js')); - url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; - } - - return config.urlArgs ? url + - ((url.indexOf('?') === -1 ? '?' : '&') + - config.urlArgs) : url; - }, - - //Delegates to req.load. Broken out as a separate function to - //allow overriding in the optimizer. - load: function (id, url) { - req.load(context, id, url); - }, - - /** - * Executes a module callback function. Broken out as a separate function - * solely to allow the build system to sequence the files in the built - * layer in the right sequence. - * - * @private - */ - execCb: function (name, callback, args, exports) { - return callback.apply(exports, args); - }, - - /** - * callback for script loads, used to check status of loading. - * - * @param {Event} evt the event from the browser for the script - * that was loaded. - */ - onScriptLoad: function (evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - if (evt.type === 'load' || - (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { - //Reset interactive script so a script node is not held onto for - //to long. - interactiveScript = null; - - //Pull out the name of the module and the context. - var data = getScriptData(evt); - context.completeLoad(data.id); - } - }, - - /** - * Callback for script errors. - */ - onScriptError: function (evt) { - var data = getScriptData(evt); - if (!hasPathFallback(data.id)) { - return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])); - } - } - }; - - context.require = context.makeRequire(); - return context; - } - - /** - * Main entry point. - * - * If the only argument to require is a string, then the module that - * is represented by that string is fetched for the appropriate context. - * - * If the first argument is an array, then it will be treated as an array - * of dependency string names to fetch. An optional function callback can - * be specified to execute when all of those dependencies are available. - * - * Make a local req variable to help Caja compliance (it assumes things - * on a require that are not standardized), and to give a short - * name for minification/local scope use. - */ - req = requirejs = function (deps, callback, errback, optional) { - - //Find the right context, use default - var context, config, - contextName = defContextName; - - // Determine if have config object in the call. - if (!isArray(deps) && typeof deps !== 'string') { - // deps is a config object - config = deps; - if (isArray(callback)) { - // Adjust args if there are dependencies - deps = callback; - callback = errback; - errback = optional; - } else { - deps = []; - } - } - - if (config && config.context) { - contextName = config.context; - } - - context = getOwn(contexts, contextName); - if (!context) { - context = contexts[contextName] = req.s.newContext(contextName); - } - - if (config) { - context.configure(config); - } - - return context.require(deps, callback, errback); - }; - - /** - * Support require.config() to make it easier to cooperate with other - * AMD loaders on globally agreed names. - */ - req.config = function (config) { - return req(config); - }; - - /** - * Execute something after the current tick - * of the event loop. Override for other envs - * that have a better solution than setTimeout. - * @param {Function} fn function to execute later. - */ - req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { - setTimeout(fn, 4); - } : function (fn) { fn(); }; - - /** - * Export require as a global, but only if it does not already exist. - */ - if (!require) { - require = req; - } - - req.version = version; - - //Used to filter out dependencies that are already paths. - req.jsExtRegExp = /^\/|:|\?|\.js$/; - req.isBrowser = isBrowser; - s = req.s = { - contexts: contexts, - newContext: newContext - }; - - //Create default context. - req({}); - - //Exports some context-sensitive methods on global require. - each([ - 'toUrl', - 'undef', - 'defined', - 'specified' - ], function (prop) { - //Reference from contexts instead of early binding to default context, - //so that during builds, the latest instance of the default context - //with its config gets used. - req[prop] = function () { - var ctx = contexts[defContextName]; - return ctx.require[prop].apply(ctx, arguments); - }; - }); - - if (isBrowser) { - head = s.head = document.getElementsByTagName('head')[0]; - //If BASE tag is in play, using appendChild is a problem for IE6. - //When that browser dies, this can be removed. Details in this jQuery bug: - //http://dev.jquery.com/ticket/2709 - baseElement = document.getElementsByTagName('base')[0]; - if (baseElement) { - head = s.head = baseElement.parentNode; - } - } - - /** - * Any errors that require explicitly generates will be passed to this - * function. Intercept/override it if you want custom error handling. - * @param {Error} err the error object. - */ - req.onError = defaultOnError; - - /** - * Creates the node for the load command. Only used in browser envs. - */ - req.createNode = function (config, moduleName, url) { - var node = config.xhtml ? - document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : - document.createElement('script'); - node.type = config.scriptType || 'text/javascript'; - node.charset = 'utf-8'; - node.async = true; - return node; - }; - - /** - * Does the request to load a module for the browser case. - * Make this a separate function to allow other environments - * to override it. - * - * @param {Object} context the require context to find state. - * @param {String} moduleName the name of the module. - * @param {Object} url the URL to the module. - */ - req.load = function (context, moduleName, url) { - var config = (context && context.config) || {}, - node; - if (isBrowser) { - //In the browser so use a script tag - node = req.createNode(config, moduleName, url); - - node.setAttribute('data-requirecontext', context.contextName); - node.setAttribute('data-requiremodule', moduleName); - - //Set up load listener. Test attachEvent first because IE9 has - //a subtle issue in its addEventListener and script onload firings - //that do not match the behavior of all other browsers with - //addEventListener support, which fire the onload event for a - //script right after the script execution. See: - //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution - //UNFORTUNATELY Opera implements attachEvent but does not follow the script - //script execution mode. - if (node.attachEvent && - //Check if node.attachEvent is artificially added by custom script or - //natively supported by browser - //read https://github.com/jrburke/requirejs/issues/187 - //if we can NOT find [native code] then it must NOT natively supported. - //in IE8, node.attachEvent does not have toString() - //Note the test for "[native code" with no closing brace, see: - //https://github.com/jrburke/requirejs/issues/273 - !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && - !isOpera) { - //Probably IE. IE (at least 6-8) do not fire - //script onload right after executing the script, so - //we cannot tie the anonymous define call to a name. - //However, IE reports the script as being in 'interactive' - //readyState at the time of the define call. - useInteractive = true; - - node.attachEvent('onreadystatechange', context.onScriptLoad); - //It would be great to add an error handler here to catch - //404s in IE9+. However, onreadystatechange will fire before - //the error handler, so that does not help. If addEventListener - //is used, then IE will fire error before load, but we cannot - //use that pathway given the connect.microsoft.com issue - //mentioned above about not doing the 'script execute, - //then fire the script load event listener before execute - //next script' that other browsers do. - //Best hope: IE10 fixes the issues, - //and then destroys all installs of IE 6-9. - //node.attachEvent('onerror', context.onScriptError); - } else { - node.addEventListener('load', context.onScriptLoad, false); - node.addEventListener('error', context.onScriptError, false); - } - node.src = url; - - //For some cache cases in IE 6-8, the script executes before the end - //of the appendChild execution, so to tie an anonymous define - //call to the module name (which is stored on the node), hold on - //to a reference to this node, but clear after the DOM insertion. - currentlyAddingScript = node; - if (baseElement) { - head.insertBefore(node, baseElement); - } else { - head.appendChild(node); - } - currentlyAddingScript = null; - - return node; - } else if (isWebWorker) { - try { - //In a web worker, use importScripts. This is not a very - //efficient use of importScripts, importScripts will block until - //its script is downloaded and evaluated. However, if web workers - //are in play, the expectation that a build has been done so that - //only one script needs to be loaded anyway. This may need to be - //reevaluated if other use cases become common. - importScripts(url); - - //Account for anonymous modules - context.completeLoad(moduleName); - } catch (e) { - context.onError(makeError('importscripts', - 'importScripts failed for ' + - moduleName + ' at ' + url, - e, - [moduleName])); - } - } - }; - - function getInteractiveScript() { - if (interactiveScript && interactiveScript.readyState === 'interactive') { - return interactiveScript; - } - - eachReverse(scripts(), function (script) { - if (script.readyState === 'interactive') { - return (interactiveScript = script); - } - }); - return interactiveScript; - } - - //Look for a data-main script attribute, which could also adjust the baseUrl. - if (isBrowser && !cfg.skipDataMain) { - //Figure out baseUrl. Get it from the script tag with require.js in it. - eachReverse(scripts(), function (script) { - //Set the 'head' where we can append children by - //using the script's parent. - if (!head) { - head = script.parentNode; - } - - //Look for a data-main attribute to set main script for the page - //to load. If it is there, the path to data main becomes the - //baseUrl, if it is not already set. - dataMain = script.getAttribute('data-main'); - if (dataMain) { - //Preserve dataMain in case it is a path (i.e. contains '?') - mainScript = dataMain; - - //Set final baseUrl if there is not already an explicit one. - if (!cfg.baseUrl) { - //Pull off the directory of data-main for use as the - //baseUrl. - src = mainScript.split('/'); - mainScript = src.pop(); - subPath = src.length ? src.join('/') + '/' : './'; - - cfg.baseUrl = subPath; - } - - //Strip off any trailing .js since mainScript is now - //like a module name. - mainScript = mainScript.replace(jsSuffixRegExp, ''); - - //If mainScript is still a path, fall back to dataMain - if (req.jsExtRegExp.test(mainScript)) { - mainScript = dataMain; - } - - //Put the data-main script in the files to load. - cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; - - return true; - } - }); - } - - /** - * The function that handles definitions of modules. Differs from - * require() in that a string for the module should be the first argument, - * and the function to execute after dependencies are loaded should - * return a value to define the module corresponding to the first argument's - * name. - */ - define = function (name, deps, callback) { - var node, context; - - //Allow for anonymous modules - if (typeof name !== 'string') { - //Adjust args appropriately - callback = deps; - deps = name; - name = null; - } - - //This module may not have dependencies - if (!isArray(deps)) { - callback = deps; - deps = null; - } - - //If no name, and callback is a function, then figure out if it a - //CommonJS thing with dependencies. - if (!deps && isFunction(callback)) { - deps = []; - //Remove comments from the callback string, - //look for require calls, and pull them into the dependencies, - //but only if there are function args. - if (callback.length) { - callback - .toString() - .replace(commentRegExp, '') - .replace(cjsRequireRegExp, function (match, dep) { - deps.push(dep); - }); - - //May be a CommonJS thing even without require calls, but still - //could use exports, and module. Avoid doing exports and module - //work though if it just needs require. - //REQUIRES the function to expect the CommonJS variables in the - //order listed below. - deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); - } - } - - //If in IE 6-8 and hit an anonymous define() call, do the interactive - //work. - if (useInteractive) { - node = currentlyAddingScript || getInteractiveScript(); - if (node) { - if (!name) { - name = node.getAttribute('data-requiremodule'); - } - context = contexts[node.getAttribute('data-requirecontext')]; - } - } - - //Always save off evaluating the def call until the script onload handler. - //This allows multiple modules to be in a file without prematurely - //tracing dependencies, and allows for anonymous module support, - //where the module name is not known until the script onload event - //occurs. If no context, use the global queue, and get it processed - //in the onscript load callback. - (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); - }; - - define.amd = { - jQuery: true - }; - - - /** - * Executes the text. Normally just uses eval, but can be modified - * to use a better, environment-specific call. Only used for transpiling - * loader plugins, not for plain JS modules. - * @param {String} text the text to execute/evaluate. - */ - req.exec = function (text) { - /*jslint evil: true */ - return eval(text); - }; - - //Set up with config info. - req(cfg); -}(this)); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..529f6b11 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,49 @@ +const webpack = require('webpack') +const PACKAGE = require('./package.json') +const TerserPlugin = require('terser-webpack-plugin') + +module.exports = { + entry: { + list: './src/index.js', + 'list.min': './src/index.js', + }, + output: { + path: __dirname + '/dist', + filename: '[name].js', + library: 'List', + }, + devtool: 'cheap-module-source-map', + module: { + rules: [ + { + test: /\.js$/, + exclude: /(node_modules)/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env'], + }, + }, + }, + ], + }, + devServer: { + inline: true, + }, + plugins: [], + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + include: /\.min\.js$/, + extractComments: false, + terserOptions: { + format: { + comments: /^! List.js v.*/, + }, + mangle: true, + }, + }), + ], + }, +}