├── .babelrc ├── .editorconfig ├── .gitignore ├── .npmrc ├── .travis.yml ├── docs ├── assets │ ├── css │ │ └── main.css │ ├── favicons │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-256x256.png │ │ ├── apple-touch-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── mstile-150x150.png │ │ ├── safari-pinned-tab.svg │ │ └── site.webmanifest │ ├── fonts │ │ ├── Objectivity-Bold.woff2 │ │ └── Objectivity-Regular.woff2 │ ├── img │ │ └── loading.gif │ └── js │ │ ├── main.js │ │ └── main.map └── index.html ├── gulpfile.js ├── license.md ├── package-lock.json ├── package.json ├── readme.md └── src ├── js ├── components │ ├── api.js │ ├── config.js │ ├── render.js │ └── tabs.js └── main.js ├── pug └── index.pug └── stylus ├── app ├── default.styl ├── fonts.styl └── settings.styl ├── components ├── candidate.styl └── tabs.styl ├── main.styl └── pages └── home.styl /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": ["transform-async-to-generator"] 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 2 | # http://editorconfig.org 3 | # 4 | 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | temp 3 | *.log 4 | .idea 5 | .DS_Store 6 | .cache 7 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8" 4 | before_script: 5 | - npm install -g gulp 6 | script: 7 | - "gulp build" 8 | deploy: 9 | provider: surge 10 | project: ./docs/ 11 | domain: eleicoes2018.surge.sh 12 | -------------------------------------------------------------------------------- /docs/assets/css/main.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Objectivity'; 3 | font-weight: bold; 4 | src: url("../fonts/Objectivity-Bold.woff2") format("woff2"); 5 | } 6 | @font-face { 7 | font-family: 'Objectivity'; 8 | font-weight: normal; 9 | src: url("../fonts/Objectivity-Regular.woff2") format("woff2"); 10 | } 11 | html { 12 | box-sizing: border-box; 13 | } 14 | *, 15 | *:before, 16 | *:after { 17 | box-sizing: inherit; 18 | } 19 | html { 20 | font-family: sans-serif; 21 | line-height: 1.15; 22 | -ms-text-size-adjust: 100%; 23 | -webkit-text-size-adjust: 100%; 24 | } 25 | body { 26 | margin: 0; 27 | } 28 | article, 29 | aside, 30 | footer, 31 | header, 32 | nav, 33 | section { 34 | display: block; 35 | } 36 | h1 { 37 | font-size: 2em; 38 | margin: 0.67em 0; 39 | } 40 | figcaption, 41 | figure, 42 | main { 43 | display: block; 44 | } 45 | figure { 46 | margin: 1em 40px; 47 | } 48 | hr { 49 | box-sizing: content-box; 50 | height: 0; 51 | overflow: visible; 52 | } 53 | pre { 54 | font-family: monospace, monospace; 55 | font-size: 1em; 56 | } 57 | a { 58 | background-color: transparent; 59 | -webkit-text-decoration-skip: objects; 60 | } 61 | a:active, 62 | a:hover { 63 | outline-width: 0; 64 | } 65 | abbr[title] { 66 | border-bottom: none; 67 | text-decoration: underline; 68 | text-decoration: underline dotted; 69 | } 70 | b, 71 | strong { 72 | font-weight: inherit; 73 | } 74 | b, 75 | strong { 76 | font-weight: bolder; 77 | } 78 | code, 79 | kbd, 80 | samp { 81 | font-family: monospace, monospace; 82 | font-size: 1em; 83 | } 84 | dfn { 85 | font-style: italic; 86 | } 87 | mark { 88 | background-color: #ff0; 89 | color: #000; 90 | } 91 | small { 92 | font-size: 80%; 93 | } 94 | sub, 95 | sup { 96 | font-size: 75%; 97 | line-height: 0; 98 | position: relative; 99 | vertical-align: baseline; 100 | } 101 | sub { 102 | bottom: -0.25em; 103 | } 104 | sup { 105 | top: -0.5em; 106 | } 107 | audio, 108 | video { 109 | display: inline-block; 110 | } 111 | audio:not([controls]) { 112 | display: none; 113 | height: 0; 114 | } 115 | img { 116 | border-style: none; 117 | } 118 | svg:not(:root) { 119 | overflow: hidden; 120 | } 121 | button, 122 | input, 123 | optgroup, 124 | select, 125 | textarea { 126 | font-family: sans-serif; 127 | font-size: 100%; 128 | line-height: 1.15; 129 | margin: 0; 130 | } 131 | button, 132 | input { 133 | overflow: visible; 134 | } 135 | button, 136 | select { 137 | text-transform: none; 138 | } 139 | button, 140 | html [type="button"], 141 | [type="reset"], 142 | [type="submit"] { 143 | -webkit-appearance: button; 144 | } 145 | button::-moz-focus-inner, 146 | [type="button"]::-moz-focus-inner, 147 | [type="reset"]::-moz-focus-inner, 148 | [type="submit"]::-moz-focus-inner { 149 | border-style: none; 150 | padding: 0; 151 | } 152 | button:-moz-focusring, 153 | [type="button"]:-moz-focusring, 154 | [type="reset"]:-moz-focusring, 155 | [type="submit"]:-moz-focusring { 156 | outline: 1px dotted ButtonText; 157 | } 158 | fieldset { 159 | border: 1px solid #c0c0c0; 160 | margin: 0 2px; 161 | padding: 0.35em 0.625em 0.75em; 162 | } 163 | legend { 164 | box-sizing: border-box; 165 | color: inherit; 166 | display: table; 167 | max-width: 100%; 168 | padding: 0; 169 | white-space: normal; 170 | } 171 | progress { 172 | display: inline-block; 173 | vertical-align: baseline; 174 | } 175 | textarea { 176 | overflow: auto; 177 | } 178 | [type="checkbox"], 179 | [type="radio"] { 180 | box-sizing: border-box; 181 | padding: 0; 182 | } 183 | [type="number"]::-webkit-inner-spin-button, 184 | [type="number"]::-webkit-outer-spin-button { 185 | height: auto; 186 | } 187 | [type="search"] { 188 | -webkit-appearance: textfield; 189 | outline-offset: -2px; 190 | } 191 | [type="search"]::-webkit-search-cancel-button, 192 | [type="search"]::-webkit-search-decoration { 193 | -webkit-appearance: none; 194 | } 195 | ::-webkit-file-upload-button { 196 | -webkit-appearance: button; 197 | font: inherit; 198 | } 199 | details, 200 | menu { 201 | display: block; 202 | } 203 | summary { 204 | display: list-item; 205 | } 206 | canvas { 207 | display: inline-block; 208 | } 209 | template { 210 | display: none; 211 | } 212 | [hidden] { 213 | display: none; 214 | } 215 | html { 216 | font-size: 10px; 217 | } 218 | body { 219 | cursor: default; 220 | font-size: 1rem; 221 | font-family: 'Objectivity', Arial, sans-serif; 222 | font-variant-ligatures: none; 223 | background: #fff; 224 | } 225 | .site-wrapper { 226 | max-width: 750px; 227 | margin: 0 auto; 228 | padding: 0 1.5em; 229 | } 230 | .loading { 231 | display: block; 232 | max-width: 30px; 233 | margin: 1em auto; 234 | } 235 | .tab-list { 236 | list-style: none; 237 | margin: 0; 238 | padding: 0; 239 | display: -webkit-box; 240 | display: -webkit-flex; 241 | display: -ms-flexbox; 242 | display: flex; 243 | border-bottom: 1px solid #eee; 244 | } 245 | .tab-list__item { 246 | position: relative; 247 | -webkit-flex: 1; 248 | -ms-flex: 1; 249 | flex: 1; 250 | color: #aaa; 251 | text-align: center; 252 | font-size: 1.5rem; 253 | padding-bottom: 1.2em; 254 | padding-top: 1em; 255 | cursor: pointer; 256 | -webkit-transition: color 0.5s ease; 257 | transition: color 0.5s ease; 258 | } 259 | .tab-list__item .abbr { 260 | display: none; 261 | } 262 | @media (max-width: 580px) { 263 | .tab-list__item { 264 | font-size: 1.3rem; 265 | } 266 | .tab-list__item .full { 267 | display: none; 268 | } 269 | .tab-list__item .abbr { 270 | display: block; 271 | } 272 | } 273 | .tab-list__item:after { 274 | content: ''; 275 | position: absolute; 276 | display: block; 277 | left: 0; 278 | right: 0; 279 | height: 3px; 280 | bottom: -2px; 281 | background: transparent; 282 | -webkit-transition: background 0.5s ease; 283 | transition: background 0.5s ease; 284 | } 285 | .tab-list__item:hover { 286 | color: #c3c3c3; 287 | } 288 | .tab-list__item.active { 289 | color: #000; 290 | } 291 | .tab-list__item.active:after { 292 | background: #000; 293 | } 294 | .tab-content { 295 | padding-top: 3em; 296 | } 297 | .tab-content__item { 298 | display: none; 299 | } 300 | .tab-content__item.active { 301 | display: block; 302 | } 303 | .candidate-item { 304 | display: -webkit-box; 305 | display: -webkit-flex; 306 | display: -ms-flexbox; 307 | display: flex; 308 | margin: 1em 0 5em; 309 | box-shadow: 0 5px 10px rgba(204,204,204,0.1); 310 | } 311 | .candidate-item-column__photo { 312 | -webkit-flex-basis: 25%; 313 | -ms-flex-basis: 25%; 314 | flex-basis: 25%; 315 | } 316 | @media (max-width: 580px) { 317 | .candidate-item-column__photo { 318 | -webkit-flex-basis: 35%; 319 | -ms-flex-basis: 35%; 320 | flex-basis: 35%; 321 | padding-right: 2em; 322 | } 323 | } 324 | .candidate-item-column__content { 325 | -webkit-flex: 1; 326 | -ms-flex: 1; 327 | flex: 1; 328 | padding-top: 1em; 329 | } 330 | .candidate-item__photo { 331 | display: block; 332 | height: 170px; 333 | width: 122px; 334 | background: url("../img/loading.gif") center no-repeat #fff; 335 | background-size: 30px auto; 336 | border: 1px solid #eee; 337 | border-radius: 10px; 338 | overflow: hidden; 339 | } 340 | @media (max-width: 580px) { 341 | .candidate-item__photo { 342 | width: 100%; 343 | } 344 | } 345 | .candidate-item__photo[src] { 346 | filter: grayscale(100%); 347 | max-width: 100%; 348 | width: auto; 349 | border-color: transparent; 350 | } 351 | @media (max-width: 580px) { 352 | .candidate-item__photo[src] { 353 | height: auto; 354 | } 355 | } 356 | .candidate-item__number { 357 | background: #2f4858; 358 | font-size: 2.2rem; 359 | font-weight: bold; 360 | color: #fff; 361 | border-radius: 5px; 362 | padding: 0.3em 0.5em 0.2em; 363 | } 364 | @media (max-width: 580px) { 365 | .candidate-item__number { 366 | font-size: 2rem; 367 | } 368 | } 369 | .candidate-item__name { 370 | margin: 0.6em 0; 371 | font-size: 2.7rem; 372 | } 373 | @media (max-width: 580px) { 374 | .candidate-item__name { 375 | font-size: 2.5rem; 376 | } 377 | } 378 | .candidate-item__coalition { 379 | margin: 0.4em 0; 380 | color: #aaa; 381 | font-weight: normal; 382 | font-size: 1.6rem; 383 | line-height: 1.6; 384 | } 385 | @media (max-width: 580px) { 386 | .candidate-item__coalition { 387 | font-size: 1.6rem; 388 | } 389 | } 390 | .header { 391 | padding: 5em 0; 392 | } 393 | .header-title { 394 | margin: 0; 395 | font-size: 4rem; 396 | letter-spacing: -0.05em; 397 | background-image: -webkit-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 398 | background-image: -moz-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 399 | background-image: -ms-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 400 | background-image: -o-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 401 | background-image: -webkit-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 402 | background-image: -moz-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 403 | background-image: -ms-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 404 | background-image: -o-linear-gradient(top,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 405 | background-image: linear-gradient(to bottom,#2ed72a 0%,#2ed72a 40%,#ebff39 40%,#ebff39 80%,#fff 80%,#fff 100%); 406 | overflow: hidden; 407 | border-radius: 2px; 408 | } 409 | .header-title span { 410 | background: #fff; 411 | padding: 0.3em 0; 412 | box-shadow: 10px 0 15px 20px #fff; 413 | } 414 | .header-description { 415 | margin: 0.5em 0 0 0; 416 | padding-left: 0.4em; 417 | font-size: 1rem; 418 | color: #aaa; 419 | letter-spacing: 0.5em; 420 | text-transform: uppercase; 421 | } 422 | .footer { 423 | border-top: 1px solid #eee; 424 | padding-top: 1em; 425 | } 426 | .footer-description { 427 | font-size: 1.2rem; 428 | line-height: 1.6; 429 | color: #aaa; 430 | } 431 | .footer-description a { 432 | color: #777; 433 | border-bottom: 1px solid #777; 434 | text-decoration: none; 435 | -webkit-transition: all 0.5s ease; 436 | transition: all 0.5s ease; 437 | } 438 | .footer-description a:hover { 439 | color: #000; 440 | border-color: #000; 441 | } 442 | -------------------------------------------------------------------------------- /docs/assets/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/assets/favicons/android-chrome-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/android-chrome-256x256.png -------------------------------------------------------------------------------- /docs/assets/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/assets/favicons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #ffffff 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/assets/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /docs/assets/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /docs/assets/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/favicon.ico -------------------------------------------------------------------------------- /docs/assets/favicons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/favicons/mstile-150x150.png -------------------------------------------------------------------------------- /docs/assets/favicons/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.11, written by Peter Selinger 2001-2013 9 | 10 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/assets/favicons/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "android-chrome-256x256.png", 12 | "sizes": "256x256", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /docs/assets/fonts/Objectivity-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/fonts/Objectivity-Bold.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/Objectivity-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/fonts/Objectivity-Regular.woff2 -------------------------------------------------------------------------------- /docs/assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diogomoretti/eleicoes2018/e14874fd9ec550a03df5f28b6be5d8bdf75c1c48/docs/assets/img/loading.gif -------------------------------------------------------------------------------- /docs/assets/js/main.js: -------------------------------------------------------------------------------- 1 | parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f{const t=e.length,o=new Array(t);for(let r=0;r{const r=e.length;if(void 0!==r&&void 0===e.nodeType)for(let n=0;n(t.forEach(t=>{for(let o in t)e[o]=t[o]}),e)),n=exports.uniq=(e=>e.filter((t,o)=>e.indexOf(t)===o)); 3 | },{}],"WX3E":[function(require,module,exports) { 4 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DOMtastic=exports.matches=exports.find=exports.$=void 0;var e=require("../util");let t=!1;const n=/^\s*<(\w+|!)[^>]*>/,r=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,o=/^[.#]?[\w-]*$/,s=function(e,t=document){let r;if(e){if(e instanceof m)return e;"string"!=typeof e?r=e.nodeType||e===window?[e]:e:n.test(e)?r=p(e):(t="string"==typeof t?document.querySelector(t):t.length?t[0]:t,r=u(e,t))}else r=document.querySelectorAll(null);return a(r)},c=exports.$=s,l=exports.find=function(t){const n=[];return(0,e.each)(this,r=>(0,e.each)(u(t,r),e=>{-1===n.indexOf(e)&&n.push(e)})),c(n)},i=exports.matches=(()=>{const t="undefined"!=typeof Element?Element.prototype:e.win,n=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return(e,t)=>n.call(e,t)})(),u=(e,t)=>{if(o.test(e)){if("#"===e[0]){const n=(t.getElementById?t:document).getElementById(e.slice(1));return n?[n]:[]}return"."===e[0]?t.getElementsByClassName(e.slice(1)):t.getElementsByTagName(e)}return t.querySelectorAll(e)},p=e=>{if(r.test(e))return[document.createElement(RegExp.$1)];const t=[],n=document.createElement("div"),o=n.childNodes;n.innerHTML=e;for(let e=0,n=o.length;e(t||(m.prototype=c.fn,m.prototype.constructor=m,t=!0),new m(e)),m=exports.DOMtastic=function(e){let t=0;const n=e.length;for(;t(0,r.matches)(t,e);return(0,r.$)(t.filter.call(this,o,s))},p=exports.forEach=function(r,t){return(0,e.each)(this,r,t)},x=exports.each=p,i=exports.indexOf=t.indexOf,u=exports.map=t.map,c=exports.pop=t.pop,h=exports.push=t.push,n=exports.reduce=t.reduce,f=exports.reduceRight=t.reduceRight,a=exports.reverse=function(){return(0,r.$)((0,e.toArray)(this).reverse())},d=exports.shift=t.shift,l=exports.some=t.some,v=exports.unshift=t.unshift; 7 | },{"./util":"1MNa","./selector/index":"WX3E"}],"k2ol":[function(require,module,exports) { 8 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(r){class s{constructor(){e.DOMtastic.call(this,(0,e.$)(...arguments))}}return(0,t.extend)(s.prototype,r),s};var e=require("./selector/index"),t=require("./util"); 9 | },{"./selector/index":"WX3E","./util":"1MNa"}],"Dsow":[function(require,module,exports) { 10 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.css=void 0;var e=require("./util");const t=e=>!isNaN(parseFloat(e))&&isFinite(e),s=e=>e.replace(/-([\da-z])/gi,(e,t)=>t.toUpperCase()),r=e=>e.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),i=exports.css=function(i,o){let a,l,p;if("string"==typeof i){if(i=s(i),void 0===o){let e=this.nodeType?this:this[0];return e?(p=e.style[i],t(p)?parseFloat(p):p):void 0}(a={})[i]=o}else for(l in a=i)p=a[l],delete a[l],a[s(l)]=p;return(0,e.each)(this,e=>{for(l in a)a[l]||0===a[l]?e.style[l]=a[l]:e.style.removeProperty(r(l))}),this}; 11 | },{"./util":"1MNa"}],"vSMz":[function(require,module,exports) { 12 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports._each=exports._clone=exports.clone=exports.after=exports.before=exports.prepend=exports.append=void 0;var e=require("../util"),t=require("../selector/index");const s=Array.prototype.forEach,i=exports.append=function(t){if(this instanceof Node)if("string"==typeof t)this.insertAdjacentHTML("beforeend",t);else if(t instanceof Node)this.appendChild(t);else{const i=t instanceof NodeList?(0,e.toArray)(t):t;s.call(i,this.appendChild.bind(this))}else a(this,i,t);return this},n=exports.prepend=function(t){if(this instanceof Node)if("string"==typeof t)this.insertAdjacentHTML("afterbegin",t);else if(t instanceof Node)this.insertBefore(t,this.firstChild);else{let i=t instanceof NodeList?(0,e.toArray)(t):t;s.call(i.reverse(),n.bind(this))}else a(this,n,t);return this},o=exports.before=function(t){if(this instanceof Node)if("string"==typeof t)this.insertAdjacentHTML("beforebegin",t);else if(t instanceof Node)this.parentNode.insertBefore(t,this);else{const i=t instanceof NodeList?(0,e.toArray)(t):t;s.call(i,o.bind(this))}else a(this,o,t);return this},r=exports.after=function(t){if(this instanceof Node)if("string"==typeof t)this.insertAdjacentHTML("afterend",t);else if(t instanceof Node)this.parentNode.insertBefore(t,this.nextSibling);else{const i=t instanceof NodeList?(0,e.toArray)(t):t;s.call(i.reverse(),r.bind(this))}else a(this,r,t);return this},f=exports.clone=function(){return(0,t.$)(c(this))},c=exports._clone=(e=>"string"==typeof e?e:e instanceof Node?e.cloneNode(!0):"length"in e?[].map.call(e,e=>e.cloneNode(!0)):e),a=exports._each=((e,t,s)=>{let i=e.length;for(;i--;){const n=0===i?s:c(s);t.call(e[i],n)}}); 13 | },{"../util":"1MNa","../selector/index":"WX3E"}],"QWIW":[function(require,module,exports) { 14 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.removeAttr=exports.attr=void 0;var t=require("../util");const e=exports.attr=function(e,r){if("string"==typeof e&&void 0===r){const t=this.nodeType?this:this[0];return t?t.getAttribute(e):void 0}return(0,t.each)(this,t=>{if("object"==typeof e)for(let r in e)t.setAttribute(r,e[r]);else t.setAttribute(e,r)})},r=exports.removeAttr=function(e){return(0,t.each)(this,t=>t.removeAttribute(e))}; 15 | },{"../util":"1MNa"}],"Z3cy":[function(require,module,exports) { 16 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasClass=exports.toggleClass=exports.removeClass=exports.addClass=void 0;var s=require("../util");const t=exports.addClass=function(t){return t&&t.length&&(0,s.each)(t.split(" "),r.bind(this,"add")),this},e=exports.removeClass=function(t){return t&&t.length&&(0,s.each)(t.split(" "),r.bind(this,"remove")),this},o=exports.toggleClass=function(t,e){if(t&&t.length){const o="boolean"==typeof e?e?"add":"remove":"toggle";(0,s.each)(t.split(" "),r.bind(this,o))}return this},i=exports.hasClass=function(s){return(this.nodeType?[this]:this).some(t=>t.classList.contains(s))},r=function(t,e){return(0,s.each)(this,s=>s.classList[t](e))}; 17 | },{"../util":"1MNa"}],"nDHX":[function(require,module,exports) { 18 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const o=exports.contains=((o,e)=>!(!o||!e||o===e)&&(o.contains?o.contains(e):!!o.compareDocumentPosition&&!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_DISCONNECTED))); 19 | },{}],"yIPv":[function(require,module,exports) { 20 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.prop=exports.data=void 0;var t=require("../util");const e="undefined"!=typeof document&&"dataset"in document.documentElement,o=e?"dataset":"__DOMTASTIC_DATA__",i=t=>t.replace(/-+(.)?/g,(t,e)=>e?e.toUpperCase():""),r=exports.data=function(r,n){if("string"==typeof r&&void 0===n){const t=this.nodeType?this:this[0];return t&&o in t?t[o][i(r)]:void 0}return(0,t.each)(this,t=>{e||(t[o]=t[o]||{}),t[o][i(r)]=n})},n=exports.prop=function(e,o){if("string"==typeof e&&void 0===o){const t=this.nodeType?this:this[0];return t&&t?t[e]:void 0}return(0,t.each)(this,t=>t[e]=o)}; 21 | },{"../util":"1MNa"}],"5+Jk":[function(require,module,exports) { 22 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.val=exports.text=exports.replaceWith=exports.remove=exports.empty=exports.appendTo=void 0;var e=require("../util"),t=require("./index"),r=require("../selector/index");const o=exports.appendTo=function(e){const o="string"==typeof e?(0,r.$)(e):e;return t.append.call(o,this),this},n=exports.empty=function(){return(0,e.each)(this,e=>e.innerHTML="")},i=exports.remove=function(){return(0,e.each)(this,e=>{e.parentNode&&e.parentNode.removeChild(e)})},s=exports.replaceWith=function(){return t.before.apply(this,arguments).remove()},p=exports.text=function(t){return void 0===t?this[0].textContent:(0,e.each)(this,e=>e.textContent=""+t)},u=exports.val=function(t){return void 0===t?this.length>0?this[0].value:void 0:(0,e.each)(this,e=>e.value=t)}; 23 | },{"../util":"1MNa","./index":"vSMz","../selector/index":"WX3E"}],"NNnC":[function(require,module,exports) { 24 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.html=void 0;var e=require("../util");const t=exports.html=function(t){if(void 0===t){const e=this.nodeType?this:this[0];return e?e.innerHTML:void 0}return(0,e.each)(this,e=>e.innerHTML=t)}; 25 | },{"../util":"1MNa"}],"2Mkq":[function(require,module,exports) { 26 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.closest=void 0;var e=require("./index"),t=require("../util");const s=exports.closest=(()=>{const s=function(s,n){const r=[];return(0,t.each)(this,t=>{for(;t&&t!==n;){if((0,e.matches)(t,s)){r.push(t);break}t=t.parentElement}}),(0,e.$)((0,t.uniq)(r))};return"undefined"!=typeof Element&&Element.prototype.closest?function(n,r){if(r)return s.call(this,n,r);{const s=[];return(0,t.each)(this,e=>{const t=e.closest(n);t&&s.push(t)}),(0,e.$)((0,t.uniq)(s))}}:s})(); 27 | },{"./index":"WX3E","../util":"1MNa"}],"AwLU":[function(require,module,exports) { 28 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unbind=exports.bind=exports.delegateHandler=exports.proxyHandler=exports.clearHandlers=exports.getHandlers=exports.one=exports.off=exports.on=void 0;var e=require("../util"),t=require("../selector/closest");const n=exports.on=function(t,n,r,s,l){let i,a,c;return"function"==typeof n&&(r=n,n=null),t.split(" ").forEach(d=>{i=d.split("."),d=i[0]||null,a=i[1]||null,c=u(r),(0,e.each)(this,e=>{if(n&&(c=v.bind(e,n,c)),l){const l=c;c=(i=>{o.call(e,t,n,r,s),l.call(e,i)})}e.addEventListener(d,c,s||!1),p(e).push({eventName:d,handler:r,eventListener:c,selector:n,namespace:a})})},this),this},o=exports.off=function(t="",n,o,r){let s,l,i;return"function"==typeof n&&(o=n,n=null),t.split(" ").forEach(t=>(s=t.split("."),t=s[0]||null,l=s[1]||null,(0,e.each)(this,s=>{i=p(s),(0,e.each)(i.filter(e=>!(t&&e.eventName!==t||l&&e.namespace!==l||o&&e.handler!==o||n&&e.selector!==n)),e=>{s.removeEventListener(e.eventName,e.eventListener,r||!1),i.splice(i.indexOf(e),1)}),t||l||n||o?0===i.length&&c(s):c(s)})),this),this},r=exports.one=function(e,t,o,r){return n.call(this,e,t,o,r,1)},s="__domtastic_event__";let l=1,i={},a=[];const p=exports.getHandlers=(e=>{e[s]||(e[s]=0===a.length?++l:a.pop());const t=e[s];return i[t]||(i[t]=[])}),c=exports.clearHandlers=(e=>{const t=e[s];i[t]&&(i[t]=null,e[s]=null,a.push(t))}),u=exports.proxyHandler=(e=>(function(t){return e.call(this,x(t))})),d={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"},f=()=>!0,h=()=>!1,x=e=>{if(!e.isDefaultPrevented||e.stopImmediatePropagation||e.stopPropagation){for(const t in d)!function(t,n,o){e[t]=function(){return this[n]=f,o&&o.apply(this,arguments)},e[n]=h}(t,d[t],e[t]);e._preventDefault&&e.preventDefault()}return e},v=exports.delegateHandler=function(e,n,o){const r=o._target||o.target,s=t.closest.call([r],e,this)[0];s&&s!==this&&(s!==r&&o.isPropagationStopped&&o.isPropagationStopped()||n.call(s,o))},g=exports.bind=n,m=exports.unbind=o; 29 | },{"../util":"1MNa","../selector/closest":"2Mkq"}],"OO3Q":[function(require,module,exports) { 30 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.triggerHandler=exports.trigger=void 0;var e=require("../util"),t=require("../dom/contains");const n=/^(mouse(down|up|over|out|enter|leave|move)|contextmenu|(dbl)?click)$/,o=/^key(down|press|up)$/,u=exports.trigger=function(t,n,{bubbles:o=!0,cancelable:u=!0,preventDefault:l=!1}={}){const i=new(r(t))(t,{bubbles:o,cancelable:u,preventDefault:l,detail:n});return i._preventDefault=l,(0,e.each)(this,e=>{!o||b||s(e)?a(e,i):c(e,t,{bubbles:o,cancelable:u,preventDefault:l,detail:n})})},r=e=>d?n.test(e)?MouseEvent:o.test(e)?KeyboardEvent:CustomEvent:CustomEvent,l=exports.triggerHandler=function(e,t){this[0]&&u.call(this[0],e,t,{bubbles:!1,preventDefault:!0})},s=e=>e===window||e===document||(0,t.contains)(e.ownerDocument.documentElement,e),c=(e,t,n={})=>{n.bubbles=!1;const o=new CustomEvent(t,n);o._target=e;do{a(e,o)}while(e=e.parentNode)},i=["blur","focus","select","submit"],a=(e,t)=>{-1===i.indexOf(t.type)||"function"!=typeof e[t.type]||t._preventDefault||t.cancelable?e.dispatchEvent(t):e[t.type]()};(()=>{const t=function(e,t={bubbles:!1,cancelable:!1,detail:void 0}){let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};t.prototype=e.win.CustomEvent&&e.win.CustomEvent.prototype,e.win.CustomEvent=t})();const b=(()=>{let t=!1;const n=e.win.document;if(n){const e=n.createElement("div"),o=e.cloneNode();e.appendChild(o),e.addEventListener("e",function(){t=!0}),o.dispatchEvent(new CustomEvent("e",{bubbles:!0}))}return t})(),d=(()=>{try{new MouseEvent("click")}catch(e){return!1}return!0})(); 31 | },{"../util":"1MNa","../dom/contains":"nDHX"}],"8Ikd":[function(require,module,exports) { 32 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=exports.ready=function(e){return/complete|loaded|interactive/.test(document.readyState)&&document.body?e():document.addEventListener("DOMContentLoaded",e,!1),this}; 33 | },{}],"kILk":[function(require,module,exports) { 34 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.noConflict=void 0;var e=require("./util");const t=e.win.$,o=exports.noConflict=function(){return e.win.$=t,this}; 35 | },{"./util":"1MNa"}],"0+qR":[function(require,module,exports) { 36 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.slice=exports.siblings=exports.parent=exports.get=exports.first=exports.eq=exports.contents=exports.concat=exports.children=void 0;var t=require("../util"),e=require("./index");const r=exports.children=function(r){const s=[];return(0,t.each)(this,n=>{n.children&&(0,t.each)(n.children,t=>{(!r||r&&(0,e.matches)(t,r))&&s.push(t)})}),(0,e.$)(s)},s=exports.concat=function(r){return(0,t.each)((0,e.$)(r),t=>{-1===[].indexOf.call(this,t)&&[].push.call(this,t)}),this},n=exports.contents=function(){const r=[];return(0,t.each)(this,e=>r.push.apply(r,(0,t.toArray)(e.childNodes))),(0,e.$)(r)},c=exports.eq=function(t){return u.call(this,t,t+1)},o=exports.first=function(){return u.call(this,0,1)},i=exports.get=function(t){return this[t]},p=exports.parent=function(r){const s=[];return(0,t.each)(this,t=>{(!r||r&&(0,e.matches)(t.parentNode,r))&&s.push(t.parentNode)}),(0,e.$)(s)},h=exports.siblings=function(r){const s=[];return(0,t.each)(this,n=>(0,t.each)(n.parentNode.children,t=>{t!==n&&(!r||r&&(0,e.matches)(t,r))&&s.push(t)})),(0,e.$)(s)},u=exports.slice=function(t,r){return(0,e.$)([].slice.apply(this,arguments))}; 37 | },{"../util":"1MNa","./index":"WX3E"}],"lyoE":[function(require,module,exports) { 38 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=exports.isFunction=(e=>"function"==typeof e),r=exports.isArray=Array.isArray; 39 | },{}],"kAI6":[function(require,module,exports) { 40 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./util"),r=require("./array"),t=z(r),i=require("./baseClass"),u=k(i),n=require("./css"),o=z(n),d=require("./dom/index"),s=z(d),a=require("./dom/attr"),l=z(a),q=require("./dom/class"),c=z(q),f=require("./dom/contains"),x=z(f),m=require("./dom/data"),v=z(m),_=require("./dom/extra"),p=z(_),y=require("./dom/html"),h=z(y),O=require("./event/index"),b=z(O),M=require("./event/trigger"),g=z(M),j=require("./event/ready"),C=z(j),P=require("./noconflict"),w=z(P),B=require("./selector/index"),E=z(B),I=require("./selector/closest"),N=z(I),R=require("./selector/extra"),S=z(R),V=require("./type"),$=z(V);function k(e){return e&&e.__esModule?e:{default:e}}function z(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}const A={};let D={};void 0!==E&&((D=E.$).matches=E.matches,A.find=E.find),(0,e.extend)(D,x,w,$),(0,e.extend)(A,t,o,l,s,c,v,p,h,b,g,C,N,S),D.fn=A,D.version="__VERSION__",D.extend=e.extend,void 0!==u.default&&(D.BaseClass=(0,u.default)(D.fn)),exports.default=D; 41 | },{"./util":"1MNa","./array":"8F8P","./baseClass":"k2ol","./css":"Dsow","./dom/index":"vSMz","./dom/attr":"QWIW","./dom/class":"Z3cy","./dom/contains":"nDHX","./dom/data":"yIPv","./dom/extra":"5+Jk","./dom/html":"NNnC","./event/index":"AwLU","./event/trigger":"OO3Q","./event/ready":"8Ikd","./noconflict":"kILk","./selector/index":"WX3E","./selector/closest":"2Mkq","./selector/extra":"0+qR","./type":"lyoE"}],"wGzv":[function(require,module,exports) { 42 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){function t(t,e){for(var a=0;a'),(0,i.getList)(e).then(function(a){n.html(d(a.candidatos,a.unidadeEleitoral.sigla))})})}var d=function(a,n){var e="";return a.map(function(a){"Deferido"===a.descricaoSituacao&&(e+='\n
\n
\n \n
\n
\n '+a.numero+'\n

'+a.nomeUrna+' \n

'+a.partido.sigla+" • "+a.nomeColigacao+"

\n

\n
\n "),(0,i.getPhoto)(a.id,n).then(function(a){(0,t.default)('[data-photo-candidate="'+a.id+'"]').attr("src",a.fotoUrl)})}),e}; 49 | },{"domtastic":"kAI6","./api":"lrfs"}],"epB2":[function(require,module,exports) { 50 | "use strict";var e=require("./components/tabs"),r=u(e),t=require("./components/render"),n=u(t);function u(e){return e&&e.__esModule?e:{default:e}}var a=new r.default(".tabs");a.render(),(0,n.default)(); 51 | },{"./components/tabs":"wGzv","./components/render":"0Pft"}]},{},["epB2"], null) 52 | //# sourceMappingURL=/main.map -------------------------------------------------------------------------------- /docs/assets/js/main.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../node_modules/domtastic/src/util.js","../../node_modules/domtastic/src/selector/index.js","../../node_modules/domtastic/src/array.js","../../node_modules/domtastic/src/baseClass.js","../../node_modules/domtastic/src/css.js","../../node_modules/domtastic/src/dom/index.js","../../node_modules/domtastic/src/dom/attr.js","../../node_modules/domtastic/src/dom/class.js","../../node_modules/domtastic/src/dom/contains.js","../../node_modules/domtastic/src/dom/data.js","../../node_modules/domtastic/src/dom/extra.js","../../node_modules/domtastic/src/dom/html.js","../../node_modules/domtastic/src/selector/closest.js","../../node_modules/domtastic/src/event/index.js","../../node_modules/domtastic/src/event/trigger.js","../../node_modules/domtastic/src/event/ready.js","../../node_modules/domtastic/src/noconflict.js","../../node_modules/domtastic/src/selector/extra.js","../../node_modules/domtastic/src/type.js","../../node_modules/domtastic/src/index.js","components/tabs.js","components/config.js","components/api.js","components/render.js","main.js"],"names":["win","window","toArray","collection","length","result","Array","i","each","callback","thisArg","undefined","nodeType","call","extend","target","sources","forEach","src","prop","uniq","filter","item","index","indexOf","isPrototypeSet","reFragment","reSingleTag","reSimpleSelector","domtastic","selector","context","document","DOMtastic","test","createFragment","querySelector","querySelectorAll","wrap","$","find","nodes","node","child","push","matches","Element","prototype","_matches","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","element","isSimpleSelector","getElementById","slice","getElementsByClassName","getElementsByTagName","html","createElement","RegExp","$1","elements","container","children","childNodes","innerHTML","l","fn","constructor","ArrayProto","every","map","pop","reduce","reduceRight","reverse","shift","some","unshift","api","BaseClass","arguments","isNumeric","value","isNaN","parseFloat","isFinite","camelize","replace","letter","toUpperCase","dasherize","toLowerCase","css","key","styleProps","val","style","removeProperty","append","Node","insertAdjacentHTML","appendChild","NodeList","bind","prepend","insertBefore","firstChild","before","parentNode","after","nextSibling","clone","_clone","cloneNode","el","_each","elm","attr","getAttribute","setAttribute","removeAttr","removeAttribute","addClass","split","removeClass","toggleClass","state","action","hasClass","classList","contains","fnName","className","compareDocumentPosition","DOCUMENT_POSITION_DISCONNECTED","isSupportsDataSet","documentElement","DATAKEYPROP","str","match","char","data","appendTo","empty","remove","removeChild","replaceWith","apply","text","textContent","fragment","closest","parentElement","n","on","eventNames","handler","useCapture","once","parts","namespace","eventListener","eventName","proxyHandler","delegateHandler","listener","event","addEventListener","off","handlers","getHandlers","removeEventListener","splice","one","eventKeyProp","id","unusedKeys","clearHandlers","augmentEvent","eventMethods","returnTrue","returnFalse","isDefaultPrevented","stopImmediatePropagation","stopPropagation","methodName","testMethodName","originalMethod","_preventDefault","preventDefault","eventTarget","_target","currentTarget","isPropagationStopped","unbind","reMouseEvent","reKeyEvent","trigger","type","bubbles","cancelable","EventConstructor","getEventConstructor","isEventBubblingInDetachedTree","isAttachedToDocument","isSupportsOtherEventConstructors","MouseEvent","KeyboardEvent","CustomEvent","triggerHandler","ownerDocument","triggerForPath","params","directEventMethods","dispatchEvent","customEvent","createEvent","initCustomEvent","detail","isBubbling","doc","parent","e","ready","readyState","body","previousLib","noConflict","concat","contents","eq","first","get","siblings","sibling","start","end","isFunction","obj","isArray","array","dom","dom_attr","dom_class","dom_contains","dom_data","dom_extra","dom_html","event_trigger","event_ready","noconflict","selector_closest","selector_extra","version","Tabs","listenClick","tab","render","STATE","ELECTION","getPhoto","makeAPIUrl","getList","fetch","then","response","json","candidateDiv","candidate","renderCandidates","res","candidatos","unidadeEleitoral","sigla","renderized","descricaoSituacao","numero","nomeUrna","partido","nomeColigacao","fotoUrl","tabs"],"mappings":";AA+EO,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAtEA,MAAMA,EAAM,QAAA,IAAkB,oBAAXC,OAAyBA,OAAS,GAU/CC,EAAUC,QAAAA,QAAAA,CAAAA,IACfC,MAAAA,EAASD,EAAWC,OACpBC,EAAS,IAAIC,MAAMF,GACrB,IAAA,IAAIG,EAAI,EAAGA,EAAIH,EAAQG,IAClBA,EAAAA,GAAKJ,EAAWI,GAElBF,OAAAA,IAYIG,EAAO,QAAA,KAAA,EAACL,EAAYM,EAAUC,KACnCN,MAAAA,EAASD,EAAWC,OACvBA,QAAWO,IAAXP,QAAgDO,IAAxBR,EAAWS,SAChC,IAAA,IAAIL,EAAI,EAAGA,EAAIH,EAAQG,IAChBM,EAAAA,KAAKH,EAASP,EAAWI,GAAIA,EAAGJ,QAGlCU,EAAAA,KAAKH,EAASP,EAAY,EAAGA,GAEjCA,OAAAA,IAgBIW,EAAS,QAAA,OAAA,EAACC,KAAWC,KACxBC,EAAAA,QAAQC,IACV,IAAA,IAAIC,KAAQD,EACPC,EAAAA,GAAQD,EAAIC,KAGhBJ,IAWIK,EAAOjB,QAAAA,KAAAA,CAAAA,GAAcA,EAAWkB,OAAO,CAACC,EAAMC,IAAUpB,EAAWqB,QAAQF,KAAUC;;ACsG3F,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,UAAA,QAAA,QAAA,QAAA,KAAA,QAAA,OAAA,EAjLP,IAAA,EAAA,QAAA,WAEA,IAAIE,GAAiB,EAErB,MAAMC,EAAa,qBACbC,EAAc,6BACdC,EAAmB,gB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AA,EAAKkQ,OACTlQ,yDAAAA,EAAKmQ,SACDnQ,iEAAAA,EAAKoQ,QAAQL,MAAW/P,MAAAA,EAAKqQ,cAR1E,mDAcOrQ,EAAAA,EAAAA,UAAAA,EAAK6J,GAAIjD,GACf0I,KAAK,SAAO,IACiBM,EAAAA,EAAAA,SAAAA,0BAAAA,EAAI/F,GAAQ1D,MAAAA,KAAK,MAAOyJ,EAAIU,aAIvDN;;ACrCT,aANA,IAAA,EAAA,QAAA,qBAMA,EAAA,EAAA,GALA,EAAA,QAAA,uBAKA,EAAA,EAAA,GAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAHA,IAAMO,EAAO,IAAI3B,EAAJ,QAAS,SACtB2B,EAAKxB,UAEL,EAAA,EAAA","file":"main.map","sourceRoot":"../../../src/js","sourcesContent":["/*\n * @module Util\n */\n\n/*\n * Reference to the window object\n * @private\n */\n\nexport const win = typeof window !== 'undefined' ? window : {};\n\n/**\n * Convert `NodeList` to `Array`.\n *\n * @param {NodeList|Array} collection\n * @return {Array}\n * @private\n */\n\nexport const toArray = collection => {\n const length = collection.length;\n const result = new Array(length);\n for(let i = 0; i < length; i++) {\n result[i] = collection[i];\n }\n return result;\n};\n\n/**\n * Faster alternative to [].forEach method\n *\n * @param {Node|NodeList|Array} collection\n * @param {Function} callback\n * @return {Node|NodeList|Array}\n * @private\n */\n\nexport const each = (collection, callback, thisArg) => {\n const length = collection.length;\n if(length !== undefined && collection.nodeType === undefined) {\n for(let i = 0; i < length; i++) {\n callback.call(thisArg, collection[i], i, collection);\n }\n } else {\n callback.call(thisArg, collection, 0, collection);\n }\n return collection;\n};\n\n/**\n * Assign enumerable properties from source object(s) to target object\n *\n * @method extend\n * @param {Object} target Object to extend\n * @param {Object} [source] Object to extend from\n * @return {Object} Extended object\n * @example\n * $.extend({a: 1}, {b: 2}); // {a: 1, b: 2}\n * @example\n * $.extend({a: 1}, {b: 2}, {a: 3}); // {a: 3, b: 2}\n */\n\nexport const extend = (target, ...sources) => {\n sources.forEach(src => {\n for(let prop in src) {\n target[prop] = src[prop];\n }\n });\n return target;\n};\n\n/**\n * Return the collection without duplicates\n *\n * @param collection Collection to remove duplicates from\n * @return {Node|NodeList|Array}\n * @private\n */\n\nexport const uniq = collection => collection.filter((item, index) => collection.indexOf(item) === index);\n","/**\n * @module Selector\n */\n\nimport { win, each } from '../util';\n\nlet isPrototypeSet = false;\n\nconst reFragment = /^\\s*<(\\w+|!)[^>]*>/;\nconst reSingleTag = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/;\nconst reSimpleSelector = /^[.#]?[\\w-]*$/;\n\n/*\n * Versatile wrapper for `querySelectorAll`.\n *\n * @param {String|Node|NodeList|Array} selector Query selector, `Node`, `NodeList`, array of elements, or HTML fragment string.\n * @param {String|Node|NodeList} context=document The context for the selector to query elements.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * var $items = $(.items');\n * @example\n * var $element = $(domElement);\n * @example\n * var $list = $(nodeList, document.body);\n * @example\n * var $element = $('

evergreen

');\n */\n\nconst domtastic = function domtastic(selector, context = document) {\n\n let collection;\n\n if(!selector) {\n\n collection = document.querySelectorAll(null);\n\n } else if(selector instanceof DOMtastic) {\n\n return selector;\n\n } else if(typeof selector !== 'string') {\n\n collection = selector.nodeType || selector === window ? [selector] : selector;\n\n } else if(reFragment.test(selector)) {\n\n collection = createFragment(selector);\n\n } else {\n\n context = typeof context === 'string' ? document.querySelector(context) : context.length ? context[0] : context;\n\n collection = querySelector(selector, context);\n\n }\n\n return wrap(collection);\n\n};\n\nexport const $ = domtastic;\n\n/*\n * Find descendants matching the provided `selector` for each element in the collection.\n *\n * @param {String|Node|NodeList|Array} selector Query selector, `Node`, `NodeList`, array of elements, or HTML fragment string.\n * @return {Object} The wrapped collection\n * @example\n * $('.selector').find('.deep').$('.deepest');\n */\n\nexport const find = function(selector) {\n const nodes = [];\n each(this, node => each(querySelector(selector, node), child => {\n if(nodes.indexOf(child) === -1) {\n nodes.push(child);\n }\n }));\n return $(nodes);\n};\n\n/*\n * Returns `true` if the element would be selected by the specified selector string; otherwise, returns `false`.\n *\n * @param {Node} element Element to test\n * @param {String} selector Selector to match against element\n * @return {Boolean}\n *\n * @example\n * $.matches(element, '.match');\n */\n\nexport const matches = (() => {\n const context = typeof Element !== 'undefined' ? Element.prototype : win;\n const _matches = context.matches || context.matchesSelector || context.mozMatchesSelector || context.msMatchesSelector || context.oMatchesSelector || context.webkitMatchesSelector;\n return (element, selector) => _matches.call(element, selector);\n})();\n\n/*\n * Use the faster `getElementById`, `getElementsByClassName` or `getElementsByTagName` over `querySelectorAll` if possible.\n *\n * @private\n * @param {String} selector Query selector.\n * @param {Node} context The context for the selector to query elements.\n * @return {Object} NodeList, HTMLCollection, or Array of matching elements (depending on method used).\n */\n\nconst querySelector = (selector, context) => {\n\n const isSimpleSelector = reSimpleSelector.test(selector);\n\n if(isSimpleSelector) {\n if(selector[0] === '#') {\n const element = (context.getElementById ? context : document).getElementById(selector.slice(1));\n return element ? [element] : [];\n }\n if(selector[0] === '.') {\n return context.getElementsByClassName(selector.slice(1));\n }\n return context.getElementsByTagName(selector);\n }\n\n return context.querySelectorAll(selector);\n\n};\n\n/*\n * Create DOM fragment from an HTML string\n *\n * @private\n * @param {String} html String representing HTML.\n * @return {NodeList}\n */\n\nconst createFragment = html => {\n\n if(reSingleTag.test(html)) {\n return [document.createElement(RegExp.$1)];\n }\n\n const elements = [];\n const container = document.createElement('div');\n const children = container.childNodes;\n\n container.innerHTML = html;\n\n for(let i = 0, l = children.length; i < l; i++) {\n elements.push(children[i]);\n }\n\n return elements;\n};\n\n/*\n * Calling `$(selector)` returns a wrapped collection of elements.\n *\n * @private\n * @param {NodeList|Array} collection Element(s) to wrap.\n * @return Object) The wrapped collection\n */\n\nconst wrap = collection => {\n\n if(!isPrototypeSet) {\n DOMtastic.prototype = $.fn;\n DOMtastic.prototype.constructor = DOMtastic;\n isPrototypeSet = true;\n }\n\n return new DOMtastic(collection);\n};\n\n/*\n * Constructor for the Object.prototype strategy\n *\n * @constructor\n * @private\n * @param {NodeList|Array} collection Element(s) to wrap.\n */\n\nexport const DOMtastic = function DOMtastic(collection) {\n let i = 0;\n const length = collection.length;\n for(; i < length;) {\n this[i] = collection[i++];\n }\n this.length = length;\n};\n","/**\n * @module Array\n */\n\nimport { each as _each, toArray } from './util';\nimport { $, matches } from './selector/index';\n\nconst ArrayProto = Array.prototype;\n\n/**\n * Checks if the given callback returns a true(-ish) value for each element in the collection.\n *\n * @param {Function} callback Function to execute for each element, invoked with `element` as argument.\n * @param {Object} [thisArg] Value to use as `this` when executing `callback`.\n * @return {Boolean} Whether each element passed the callback check.\n * @example\n * // Test whether every element in the collection has the \"active\" attribute\n * $('.items').every(function(element) {\n * return element.hasAttribute('active')\n * });\n */\n\nexport const every = ArrayProto.every;\n\n/**\n * Filter the collection by selector or function, and return a new collection with the result.\n *\n * @param {String|Function} selector Selector or function to filter the collection.\n * @param {Object} [thisArg] Value to use as `this` when executing `callback`.\n * @return {Object} A new wrapped collection\n * @chainable\n * @example\n * $('.items').filter('.active');\n * @example\n * $('.items').filter(function(element) {\n * return element.hasAttribute('active')\n * });\n */\n\nexport const filter = function(selector, thisArg) {\n const callback = typeof selector === 'function' ? selector : element => matches(element, selector);\n return $(ArrayProto.filter.call(this, callback, thisArg));\n};\n\n/**\n * Execute a function for each element in the collection.\n *\n * @param {Function} callback Function to execute for each element, invoked with `element` as argument.\n * @param {Object} [thisArg] Value to use as `this` when executing `callback`.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.items').forEach(function(element) {\n * element.style.color = 'evergreen';\n * );\n */\n\nexport const forEach = function(callback, thisArg) {\n return _each(this, callback, thisArg);\n};\n\nexport const each = forEach;\n\n/**\n * Returns the index of an element in the collection.\n *\n * @param {Node} element\n * @return {Number} The zero-based index, -1 if not found.\n * @example\n * $('.items').indexOf(element); // 2\n */\n\nexport const indexOf = ArrayProto.indexOf;\n\n/**\n * Create a new collection by executing the callback for each element in the collection.\n *\n * @param {Function} callback Function to execute for each element, invoked with `element` as argument.\n * @param {Object} [thisArg] Value to use as `this` when executing `callback`.\n * @return {Array} Collection with the return value of the executed callback for each element.\n * @example\n * // Create a new array with the attribute value of each element:\n * $('.items').map(function(element) {\n * return element.getAttribute('name')\n */\n\nexport const map = ArrayProto.map;\n\n/**\n * Removes the last element from the collection, and returns that element.\n *\n * @return {Object} The last element from the collection.\n * @example\n * var lastElement = $('.items').pop();\n */\n\nexport const pop = ArrayProto.pop;\n\n/**\n * Adds one or more elements to the end of the collection, and returns the new length of the collection.\n *\n * @param {Object} element Element(s) to add to the collection\n * @return {Number} The new length of the collection\n * @example\n * $('.items').push(element);\n */\n\nexport const push = ArrayProto.push;\n\n/**\n * Apply a function against each element in the collection, and this accumulator function has to reduce it\n * to a single value.\n *\n * @param {Function} callback Function to execute on each value in the array, taking four arguments (see example).\n * @param {Mixed} initialValue Object to use as the first argument to the first call of the callback.\n * @example\n * // Calculate the combined height of elements:\n * $('.items').reduce(function(previousValue, element, index, collection) {\n * return previousValue + element.clientHeight;\n * }, 0);\n */\n\nexport const reduce = ArrayProto.reduce;\n\n/**\n * Apply a function against each element in the collection (from right-to-left), and this accumulator function has\n * to reduce it to a single value.\n *\n * @param {Function} callback Function to execute on each value in the array, taking four arguments (see example).\n * @param {Mixed} initialValue Object to use as the first argument to the first call of the callback.\n * @example\n * // Concatenate the text of elements in reversed order:\n * $('.items').reduceRight(function(previousValue, element, index, collection) {\n * return previousValue + element.textContent;\n * }, '');\n */\n\nexport const reduceRight = ArrayProto.reduceRight;\n\n/**\n * Reverses an array in place. The first array element becomes the last and the last becomes the first.\n *\n * @return {Object} The wrapped collection, reversed\n * @chainable\n * @example\n * $('.items').reverse();\n */\n\nexport const reverse = function() {\n return $(toArray(this).reverse());\n};\n\n/**\n * Removes the first element from the collection, and returns that element.\n *\n * @return {Object} The first element from the collection.\n * @example\n * var firstElement = $('.items').shift();\n */\n\nexport const shift = ArrayProto.shift;\n\n/**\n * Checks if the given callback returns a true(-ish) value for any of the elements in the collection.\n *\n * @param {Function} callback Function to execute for each element, invoked with `element` as argument.\n * @return {Boolean} Whether any element passed the callback check.\n * @example\n * $('.items').some(function(element) {\n * return element.hasAttribute('active')\n * }); // true/false\n */\n\nexport const some = ArrayProto.some;\n\n/**\n * Adds one or more elements to the beginning of the collection, and returns the new length of the collection.\n *\n * @param {Object} element Element(s) to add to the collection\n * @return {Number} The new length of the collection\n * @example\n * $('.items').unshift(element);\n */\n\nexport const unshift = ArrayProto.unshift;\n","/**\n * @module BaseClass\n */\n\nimport { $ as selector, DOMtastic } from './selector/index';\nimport { extend } from './util';\n\nexport default function(api) {\n\n /**\n * Provide subclass for classes or components to extend from.\n * The opposite and successor of plugins (no need to extend `$.fn` anymore, complete control).\n *\n * @return {Class} The class to extend from, including all `$.fn` methods.\n * @example\n * import { BaseClass } from 'domtastic';\n *\n * class MyComponent extends BaseClass {\n * doSomething() {\n * return this.addClass('.foo');\n * }\n * }\n *\n * let component = new MyComponent('body');\n * component.doSomething();\n *\n * @example\n * import $ from 'domtastic';\n *\n * class MyComponent extends $.BaseClass {\n * progress(value) {\n * return this.attr('data-progress', value);\n * }\n * }\n *\n * let component = new MyComponent(document.body);\n * component.progress('ive').append('

enhancement

');\n */\n\n class BaseClass {\n constructor() {\n DOMtastic.call(this, selector(...arguments));\n }\n }\n extend(BaseClass.prototype, api);\n return BaseClass;\n}\n","/**\n * @module CSS\n */\n\nimport { each } from './util';\n\nconst isNumeric = value => !isNaN(parseFloat(value)) && isFinite(value);\n\nconst camelize = value => value.replace(/-([\\da-z])/gi, (matches, letter) => letter.toUpperCase());\n\nconst dasherize = value => value.replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Get the value of a style property for the first element, or set one or more style properties for each element in the collection.\n *\n * @param {String|Object} key The name of the style property to get or set. Or an object containing key-value pairs to set as style properties.\n * @param {String} [value] The value of the style property to set.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').css('padding-left'); // get\n * $('.item').css('color', '#f00'); // set\n * $('.item').css({'border-width': '1px', display: 'inline-block'}); // set multiple\n */\n\nexport const css = function(key, value) {\n\n let styleProps, prop, val;\n\n if(typeof key === 'string') {\n key = camelize(key);\n\n if(typeof value === 'undefined') {\n let element = this.nodeType ? this : this[0];\n if(element) {\n val = element.style[key];\n return isNumeric(val) ? parseFloat(val) : val;\n }\n return undefined;\n }\n\n styleProps = {};\n styleProps[key] = value;\n } else {\n styleProps = key;\n for(prop in styleProps) {\n val = styleProps[prop];\n delete styleProps[prop];\n styleProps[camelize(prop)] = val;\n }\n }\n\n each(this, element => {\n for(prop in styleProps) {\n if(styleProps[prop] || styleProps[prop] === 0) {\n element.style[prop] = styleProps[prop];\n } else {\n element.style.removeProperty(dasherize(prop));\n }\n }\n });\n\n return this;\n};\n","/**\n * @module DOM\n */\n\nimport { toArray } from '../util';\nimport { $ } from '../selector/index';\n\nconst forEach = Array.prototype.forEach;\n\n/**\n * Append element(s) to each element in the collection.\n *\n * @param {String|Node|NodeList|Object} element What to append to the element(s).\n * Clones elements as necessary.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').append('

more

');\n */\n\nexport const append = function(element) {\n if(this instanceof Node) {\n if(typeof element === 'string') {\n this.insertAdjacentHTML('beforeend', element);\n } else {\n if(element instanceof Node) {\n this.appendChild(element);\n } else {\n const elements = element instanceof NodeList ? toArray(element) : element;\n forEach.call(elements, this.appendChild.bind(this));\n }\n }\n } else {\n _each(this, append, element);\n }\n return this;\n};\n\n/**\n * Place element(s) at the beginning of each element in the collection.\n *\n * @param {String|Node|NodeList|Object} element What to place at the beginning of the element(s).\n * Clones elements as necessary.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').prepend('start');\n */\n\nexport const prepend = function(element) {\n if(this instanceof Node) {\n if(typeof element === 'string') {\n this.insertAdjacentHTML('afterbegin', element);\n } else {\n if(element instanceof Node) {\n this.insertBefore(element, this.firstChild);\n } else {\n let elements = element instanceof NodeList ? toArray(element) : element;\n forEach.call(elements.reverse(), prepend.bind(this));\n }\n }\n } else {\n _each(this, prepend, element);\n }\n return this;\n};\n\n/**\n * Place element(s) before each element in the collection.\n *\n * @param {String|Node|NodeList|Object} element What to place as sibling(s) before to the element(s).\n * Clones elements as necessary.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.items').before('

prefix

');\n */\n\nexport const before = function(element) {\n if(this instanceof Node) {\n if(typeof element === 'string') {\n this.insertAdjacentHTML('beforebegin', element);\n } else {\n if(element instanceof Node) {\n this.parentNode.insertBefore(element, this);\n } else {\n const elements = element instanceof NodeList ? toArray(element) : element;\n forEach.call(elements, before.bind(this));\n }\n }\n } else {\n _each(this, before, element);\n }\n return this;\n};\n\n/**\n * Place element(s) after each element in the collection.\n *\n * @param {String|Node|NodeList|Object} element What to place as sibling(s) after to the element(s). Clones elements as necessary.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.items').after('suffix');\n */\n\nexport const after = function(element) {\n if(this instanceof Node) {\n if(typeof element === 'string') {\n this.insertAdjacentHTML('afterend', element);\n } else {\n if(element instanceof Node) {\n this.parentNode.insertBefore(element, this.nextSibling);\n } else {\n const elements = element instanceof NodeList ? toArray(element) : element;\n forEach.call(elements.reverse(), after.bind(this));\n }\n }\n } else {\n _each(this, after, element);\n }\n return this;\n};\n\n/**\n * Clone a wrapped object.\n *\n * @return {Object} Wrapped collection of cloned nodes.\n * @example\n * $(element).clone();\n */\n\nexport const clone = function() {\n return $(_clone(this));\n};\n\n/**\n * Clone an object\n *\n * @param {String|Node|NodeList|Array} element The element(s) to clone.\n * @return {String|Node|NodeList|Array} The cloned element(s)\n * @private\n */\n\nexport const _clone = element => {\n if(typeof element === 'string') {\n return element;\n } else if(element instanceof Node) {\n return element.cloneNode(true);\n } else if('length' in element) {\n return [].map.call(element, el => el.cloneNode(true));\n }\n return element;\n};\n\n/**\n * Specialized iteration, applying `fn` in reversed manner to a clone of each element, but the provided one.\n *\n * @param {NodeList|Array} collection\n * @param {Function} fn\n * @param {Node} element\n * @private\n */\n\nexport const _each = (collection, fn, element) => {\n let l = collection.length;\n while(l--) {\n const elm = l === 0 ? element : _clone(element);\n fn.call(collection[l], elm);\n }\n};\n","/**\n * @module Attr\n */\n\nimport { each } from '../util';\n\n/**\n * Get the value of an attribute for the first element, or set one or more attributes for each element in the collection.\n *\n * @param {String|Object} key The name of the attribute to get or set. Or an object containing key-value pairs to set as attributes.\n * @param {String} [value] The value of the attribute to set.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').attr('attrName'); // get\n * $('.item').attr('attrName', 'attrValue'); // set\n * $('.item').attr({attr1: 'value1', 'attr-2': 'value2'}); // set multiple\n */\n\nexport const attr = function(key, value) {\n\n if(typeof key === 'string' && typeof value === 'undefined') {\n const element = this.nodeType ? this : this[0];\n return element ? element.getAttribute(key) : undefined;\n }\n\n return each(this, element => {\n if(typeof key === 'object') {\n for(let attr in key) {\n element.setAttribute(attr, key[attr]);\n }\n } else {\n element.setAttribute(key, value);\n }\n });\n};\n\n/**\n * Remove attribute from each element in the collection.\n *\n * @param {String} key Attribute name\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.items').removeAttr('attrName');\n */\n\nexport const removeAttr = function(key) {\n return each(this, element => element.removeAttribute(key));\n};\n","/**\n * @module Class\n */\n\nimport { each } from '../util';\n\n/**\n * Add a class to the element(s)\n *\n * @param {String} value Space-separated class name(s) to add to the element(s).\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').addClass('bar');\n * $('.item').addClass('bar foo');\n */\n\nexport const addClass = function(value) {\n if(value && value.length) {\n each(value.split(' '), _each.bind(this, 'add'));\n }\n return this;\n};\n\n/**\n * Remove a class from the element(s)\n *\n * @param {String} value Space-separated class name(s) to remove from the element(s).\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.items').removeClass('bar');\n * $('.items').removeClass('bar foo');\n */\n\nexport const removeClass = function(value) {\n if(value && value.length) {\n each(value.split(' '), _each.bind(this, 'remove'));\n }\n return this;\n};\n\n/**\n * Toggle a class at the element(s)\n *\n * @param {String} value Space-separated class name(s) to toggle at the element(s).\n * @param {Boolean} [state] A Boolean value to determine whether the class should be added or removed.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').toggleClass('bar');\n * $('.item').toggleClass('bar foo');\n * $('.item').toggleClass('bar', true);\n */\n\nexport const toggleClass = function(value, state) {\n if(value && value.length) {\n const action = typeof state === 'boolean' ? state ? 'add' : 'remove' : 'toggle';\n each(value.split(' '), _each.bind(this, action));\n }\n return this;\n};\n\n/**\n * Check if the element(s) have a class.\n *\n * @param {String} value Check if the DOM element contains the class name. When applied to multiple elements,\n * returns `true` if _any_ of them contains the class name.\n * @return {Boolean} Whether the element's class attribute contains the class name.\n * @example\n * $('.item').hasClass('bar');\n */\n\nexport const hasClass = function(value) {\n return (this.nodeType ? [this] : this).some(element => element.classList.contains(value));\n};\n\n/**\n * Specialized iteration, applying `fn` of the classList API to each element.\n *\n * @param {String} fnName\n * @param {String} className\n * @private\n */\n\nconst _each = function(fnName, className) {\n return each(this, element => element.classList[fnName](className));\n};\n","/**\n * @module contains\n */\n\n/**\n * Test whether an element contains another element in the DOM.\n *\n * @param {Element} container The element that may contain the other element.\n * @param {Element} element The element that may be a descendant of the other element.\n * @return {Boolean} Whether the `container` element contains the `element`.\n * @example\n * $.contains(parentElement, childElement); // true/false\n */\n\nexport const contains = (container, element) => {\n if(!container || !element || container === element) {\n return false;\n } else if(container.contains) {\n return container.contains(element);\n } else if(container.compareDocumentPosition) {\n return !(container.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_DISCONNECTED);\n }\n return false;\n};\n","/**\n * @module Data\n */\n\nimport { each } from '../util';\n\nconst isSupportsDataSet = typeof document !== 'undefined' && 'dataset' in document.documentElement;\nconst DATAKEYPROP = isSupportsDataSet ? 'dataset' : '__DOMTASTIC_DATA__';\n\nconst camelize = str => str.replace(/-+(.)?/g, (match, char) => char ? char.toUpperCase() : '');\n\n/**\n * Get data from first element, or set data for each element in the collection.\n *\n * @param {String} key The key for the data to get or set.\n * @param {String} [value] The data to set.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').data('attrName'); // get\n * $('.item').data('attrName', {any: 'data'}); // set\n */\n\nexport const data = function(key, value) {\n\n if(typeof key === 'string' && typeof value === 'undefined') {\n const element = this.nodeType ? this : this[0];\n return element && DATAKEYPROP in element ? element[DATAKEYPROP][camelize(key)] : undefined;\n }\n\n return each(this, element => {\n if(!isSupportsDataSet) {\n element[DATAKEYPROP] = element[DATAKEYPROP] || {};\n }\n\n element[DATAKEYPROP][camelize(key)] = value;\n });\n};\n\n/**\n * Get property from first element, or set property on each element in the collection.\n *\n * @param {String} key The name of the property to get or set.\n * @param {String} [value] The value of the property to set.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').prop('attrName'); // get\n * $('.item').prop('attrName', 'attrValue'); // set\n */\n\nexport const prop = function(key, value) {\n\n if(typeof key === 'string' && typeof value === 'undefined') {\n const element = this.nodeType ? this : this[0];\n return element && element ? element[key] : undefined;\n }\n\n return each(this, element => element[key] = value);\n};\n","/**\n * @module DOM (extra)\n */\n\nimport { each } from '../util';\nimport { append, before } from './index';\nimport { $ } from '../selector/index';\n\n/**\n * Append each element in the collection to the specified element(s).\n *\n * @param {Node|NodeList|Object} element What to append the element(s) to. Clones elements as necessary.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').appendTo(container);\n */\n\nexport const appendTo = function(element) {\n const context = typeof element === 'string' ? $(element) : element;\n append.call(context, this);\n return this;\n};\n\n/*\n * Empty each element in the collection.\n *\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').empty();\n */\n\nexport const empty = function() {\n return each(this, element => element.innerHTML = '');\n};\n\n/**\n * Remove the collection from the DOM.\n *\n * @return {Array} Array containing the removed elements\n * @example\n * $('.item').remove();\n */\n\nexport const remove = function() {\n return each(this, element => {\n if(element.parentNode) {\n element.parentNode.removeChild(element);\n }\n });\n};\n\n/**\n * Replace each element in the collection with the provided new content, and return the array of elements that were replaced.\n *\n * @return {Array} Array containing the replaced elements\n */\n\nexport const replaceWith = function() {\n return before.apply(this, arguments).remove();\n};\n\n/**\n * Get the `textContent` from the first, or set the `textContent` of each element in the collection.\n *\n * @param {String} [value]\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').text('New content');\n */\n\nexport const text = function(value) {\n\n if(value === undefined) {\n return this[0].textContent;\n }\n\n return each(this, element => element.textContent = '' + value);\n};\n\n/**\n * Get the `value` from the first, or set the `value` of each element in the collection.\n *\n * @param {String} [value]\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('input.firstName').val('New value');\n */\n\nexport const val = function(value) {\n\n if(value === undefined) {\n return this.length > 0 ? this[0].value : undefined;\n }\n\n return each(this, element => element.value = value);\n};\n","/**\n * @module HTML\n */\n\nimport { each } from '../util';\n\n/*\n * Get the HTML contents of the first element, or set the HTML contents for each element in the collection.\n *\n * @param {String} [fragment] HTML fragment to set for the element. If this argument is omitted, the HTML contents are returned.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').html();\n * $('.item').html('more');\n */\n\nexport const html = function(fragment) {\n\n if(fragment === undefined) {\n const element = this.nodeType ? this : this[0];\n return element ? element.innerHTML : undefined;\n }\n\n return each(this, element => element.innerHTML = fragment);\n};\n","/**\n * @module closest\n */\n\nimport { $, matches } from './index';\nimport { each, uniq } from '../util';\n\n/**\n * Return the closest element matching the selector (starting by itself) for each element in the collection.\n *\n * @param {String} selector Filter\n * @param {Object} [context] If provided, matching elements must be a descendant of this element\n * @return {Object} New wrapped collection (containing zero or one element)\n * @chainable\n * @example\n * $('.selector').closest('.container');\n */\n\nexport const closest = (() => {\n\n const closest = function(selector, context) {\n const nodes = [];\n each(this, node => {\n while(node && node !== context) {\n if(matches(node, selector)) {\n nodes.push(node);\n break;\n }\n node = node.parentElement;\n }\n });\n return $(uniq(nodes));\n };\n\n return typeof Element === 'undefined' || !Element.prototype.closest ? closest : function(selector, context) {\n if(!context) {\n const nodes = [];\n each(this, node => {\n const n = node.closest(selector);\n if(n) {\n nodes.push(n);\n }\n });\n return $(uniq(nodes));\n } else {\n return closest.call(this, selector, context);\n }\n };\n})();\n","/**\n * @module Events\n */\n\nimport { each } from '../util';\nimport { closest } from '../selector/closest';\n\n/**\n * Shorthand for `addEventListener`. Supports event delegation if a filter (`selector`) is provided.\n *\n * @param {String} eventNames List of space-separated event types to be added to the element(s)\n * @param {String} [selector] Selector to filter descendants that delegate the event to this element.\n * @param {Function} handler Event handler\n * @param {Boolean} useCapture=false\n * @param {Boolean} once=false\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').on('click', callback);\n * $('.container').on('click focus', '.item', handler);\n */\n\nexport const on = function(eventNames, selector, handler, useCapture, once) {\n\n if(typeof selector === 'function') {\n handler = selector;\n selector = null;\n }\n\n let parts,\n namespace,\n eventListener;\n\n eventNames.split(' ').forEach(eventName => {\n\n parts = eventName.split('.');\n eventName = parts[0] || null;\n namespace = parts[1] || null;\n\n eventListener = proxyHandler(handler);\n\n each(this, element => {\n\n if(selector) {\n eventListener = delegateHandler.bind(element, selector, eventListener);\n }\n\n if(once) {\n const listener = eventListener;\n eventListener = event => {\n off.call(element, eventNames, selector, handler, useCapture);\n listener.call(element, event);\n };\n }\n\n element.addEventListener(eventName, eventListener, useCapture || false);\n\n getHandlers(element).push({\n eventName,\n handler,\n eventListener,\n selector,\n namespace\n });\n });\n\n }, this);\n\n return this;\n};\n\n/**\n * Shorthand for `removeEventListener`.\n *\n * @param {String} eventNames List of space-separated event types to be removed from the element(s)\n * @param {String} [selector] Selector to filter descendants that undelegate the event to this element.\n * @param {Function} handler Event handler\n * @param {Boolean} useCapture=false\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').off('click', callback);\n * $('#my-element').off('myEvent myOtherEvent');\n * $('.item').off();\n */\n\nexport const off = function(eventNames = '', selector, handler, useCapture) {\n\n if(typeof selector === 'function') {\n handler = selector;\n selector = null;\n }\n\n let parts,\n namespace,\n handlers;\n\n eventNames.split(' ').forEach(eventName => {\n\n parts = eventName.split('.');\n eventName = parts[0] || null;\n namespace = parts[1] || null;\n\n return each(this, element => {\n\n handlers = getHandlers(element);\n\n each(handlers.filter(item => {\n return (\n (!eventName || item.eventName === eventName) &&\n (!namespace || item.namespace === namespace) &&\n (!handler || item.handler === handler) &&\n (!selector || item.selector === selector)\n );\n }), item => {\n element.removeEventListener(item.eventName, item.eventListener, useCapture || false);\n handlers.splice(handlers.indexOf(item), 1);\n });\n\n if(!eventName && !namespace && !selector && !handler) {\n clearHandlers(element);\n } else if(handlers.length === 0) {\n clearHandlers(element);\n }\n\n });\n\n }, this);\n\n return this;\n};\n\n/**\n * Add event listener and execute the handler at most once per element.\n *\n * @param eventNames\n * @param selector\n * @param handler\n * @param useCapture\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').one('click', callback);\n */\n\nexport const one = function(eventNames, selector, handler, useCapture) {\n return on.call(this, eventNames, selector, handler, useCapture, 1);\n};\n\n/**\n * Get event handlers from an element\n *\n * @private\n * @param {Node} element\n * @return {Array}\n */\n\nconst eventKeyProp = '__domtastic_event__';\nlet id = 1;\nlet handlers = {};\nlet unusedKeys = [];\n\nexport const getHandlers = element => {\n if(!element[eventKeyProp]) {\n element[eventKeyProp] = unusedKeys.length === 0 ? ++id : unusedKeys.pop();\n }\n const key = element[eventKeyProp];\n return handlers[key] || (handlers[key] = []);\n};\n\n/**\n * Clear event handlers for an element\n *\n * @private\n * @param {Node} element\n */\n\nexport const clearHandlers = element => {\n const key = element[eventKeyProp];\n if(handlers[key]) {\n handlers[key] = null;\n element[eventKeyProp] = null;\n unusedKeys.push(key);\n }\n};\n\n/**\n * Function to create a handler that augments the event object with some extra methods,\n * and executes the callback with the event and the event data (i.e. `event.detail`).\n *\n * @private\n * @param handler Callback to execute as `handler(event, data)`\n * @return {Function}\n */\n\nexport const proxyHandler = handler => function(event) {\n return handler.call(this, augmentEvent(event));\n};\n\nconst eventMethods = {\n preventDefault: 'isDefaultPrevented',\n stopImmediatePropagation: 'isImmediatePropagationStopped',\n stopPropagation: 'isPropagationStopped'\n};\nconst returnTrue = () => true;\nconst returnFalse = () => false;\n\n/**\n * Attempt to augment events and implement something closer to DOM Level 3 Events.\n *\n * @private\n * @param {Object} event\n * @return {Function}\n */\n\nconst augmentEvent = event => {\n if(!event.isDefaultPrevented || event.stopImmediatePropagation || event.stopPropagation) {\n for(const methodName in eventMethods) {\n (function(methodName, testMethodName, originalMethod) {\n event[methodName] = function() {\n this[testMethodName] = returnTrue;\n return originalMethod && originalMethod.apply(this, arguments);\n };\n event[testMethodName] = returnFalse;\n }(methodName, eventMethods[methodName], event[methodName]));\n }\n if(event._preventDefault) {\n event.preventDefault();\n }\n }\n return event;\n};\n\n/**\n * Function to test whether delegated events match the provided `selector` (filter),\n * if the event propagation was stopped, and then actually call the provided event handler.\n * Use `this` instead of `event.currentTarget` on the event object.\n *\n * @private\n * @param {String} selector Selector to filter descendants that undelegate the event to this element.\n * @param {Function} handler Event handler\n * @param {Event} event\n */\n\nexport const delegateHandler = function(selector, handler, event) {\n const eventTarget = event._target || event.target;\n const currentTarget = closest.call([eventTarget], selector, this)[0];\n if(currentTarget && currentTarget !== this) {\n if(currentTarget === eventTarget || !(event.isPropagationStopped && event.isPropagationStopped())) {\n handler.call(currentTarget, event);\n }\n }\n};\n\nexport const bind = on;\nexport const unbind = off;\n","/**\n * @module trigger\n */\n\nimport { win, each } from '../util';\nimport { contains } from '../dom/contains';\n\nconst reMouseEvent = /^(mouse(down|up|over|out|enter|leave|move)|contextmenu|(dbl)?click)$/;\nconst reKeyEvent = /^key(down|press|up)$/;\n\n/**\n * Trigger event at element(s)\n *\n * @param {String} type Type of the event\n * @param {Object} data Data to be sent with the event (`params.detail` will be set to this).\n * @param {Object} [params] Event parameters (optional)\n * @param {Boolean} params.bubbles=true Does the event bubble up through the DOM or not.\n * @param {Boolean} params.cancelable=true Is the event cancelable or not.\n * @param {Mixed} params.detail=undefined Additional information about the event.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $('.item').trigger('anyEventType');\n */\n\nexport const trigger = function(type, data, {bubbles = true, cancelable = true, preventDefault = false} = {}) {\n\n const EventConstructor = getEventConstructor(type);\n const event = new EventConstructor(type, {\n bubbles,\n cancelable,\n preventDefault,\n detail: data\n });\n\n event._preventDefault = preventDefault;\n\n return each(this, element => {\n if(!bubbles || isEventBubblingInDetachedTree || isAttachedToDocument(element)) {\n dispatchEvent(element, event);\n } else {\n triggerForPath(element, type, {\n bubbles,\n cancelable,\n preventDefault,\n detail: data\n });\n }\n });\n};\n\nconst getEventConstructor = type => isSupportsOtherEventConstructors ? (reMouseEvent.test(type) ? MouseEvent : (reKeyEvent.test(type) ? KeyboardEvent : CustomEvent)) : CustomEvent;\n\n/**\n * Trigger event at first element in the collection. Similar to `trigger()`, except:\n *\n * - Event does not bubble\n * - Default event behavior is prevented\n * - Only triggers handler for first matching element\n *\n * @param {String} type Type of the event\n * @param {Object} data Data to be sent with the event\n * @example\n * $('form').triggerHandler('submit');\n */\n\nexport const triggerHandler = function(type, data) {\n if(this[0]) {\n trigger.call(this[0], type, data, {\n bubbles: false,\n preventDefault: true\n });\n }\n};\n\n/**\n * Check whether the element is attached to or detached from) the document\n *\n * @private\n * @param {Node} element Element to test\n * @return {Boolean}\n */\n\nconst isAttachedToDocument = element => {\n if(element === window || element === document) {\n return true;\n }\n return contains(element.ownerDocument.documentElement, element);\n};\n\n/**\n * Dispatch the event at the element and its ancestors.\n * Required to support delegated events in browsers that don't bubble events in detached DOM trees.\n *\n * @private\n * @param {Node} element First element to dispatch the event at\n * @param {String} type Type of the event\n * @param {Object} [params] Event parameters (optional)\n * @param {Boolean} params.bubbles=true Does the event bubble up through the DOM or not.\n * Will be set to false (but shouldn't matter since events don't bubble anyway).\n * @param {Boolean} params.cancelable=true Is the event cancelable or not.\n * @param {Mixed} params.detail=undefined Additional information about the event.\n */\n\nconst triggerForPath = (element, type, params = {}) => {\n params.bubbles = false;\n const event = new CustomEvent(type, params);\n event._target = element;\n do {\n dispatchEvent(element, event);\n } while(element = element.parentNode); // eslint-disable-line no-cond-assign\n};\n\n/**\n * Dispatch event to element, but call direct event methods instead if available\n * (e.g. \"blur()\", \"submit()\") and if the event is non-cancelable.\n *\n * @private\n * @param {Node} element Element to dispatch the event at\n * @param {Object} event Event to dispatch\n */\n\nconst directEventMethods = ['blur', 'focus', 'select', 'submit'];\n\nconst dispatchEvent = (element, event) => {\n if(directEventMethods.indexOf(event.type) !== -1 && typeof element[event.type] === 'function' && !event._preventDefault && !event.cancelable) {\n element[event.type]();\n } else {\n element.dispatchEvent(event);\n }\n};\n\n/**\n * Polyfill for CustomEvent, borrowed from [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill).\n * Needed to support IE (9, 10, 11) & PhantomJS\n */\n\n(() => {\n const CustomEvent = function(event, params = {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }) {\n let customEvent = document.createEvent('CustomEvent');\n customEvent.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return customEvent;\n };\n\n CustomEvent.prototype = win.CustomEvent && win.CustomEvent.prototype;\n win.CustomEvent = CustomEvent;\n\n})();\n\n/*\n * Are events bubbling in detached DOM trees?\n * @private\n */\n\nconst isEventBubblingInDetachedTree = (() =>{\n let isBubbling = false;\n const doc = win.document;\n if(doc) {\n const parent = doc.createElement('div');\n const child = parent.cloneNode();\n parent.appendChild(child);\n parent.addEventListener('e', function() {\n isBubbling = true;\n });\n child.dispatchEvent(new CustomEvent('e', {bubbles: true}));\n }\n return isBubbling;\n})();\n\nconst isSupportsOtherEventConstructors = (() => {\n try {\n new MouseEvent('click');\n } catch(e) {\n return false;\n }\n return true;\n})();\n","/**\n * @module Ready\n */\n\n/**\n * Execute callback when `DOMContentLoaded` fires for `document`, or immediately if called afterwards.\n *\n * @param handler Callback to execute when initial DOM content is loaded.\n * @return {Object} The wrapped collection\n * @chainable\n * @example\n * $(document).ready(callback);\n */\n\nexport const ready = function(handler) {\n if(/complete|loaded|interactive/.test(document.readyState) && document.body) {\n handler();\n } else {\n document.addEventListener('DOMContentLoaded', handler, false);\n }\n return this;\n};\n","/**\n * @module noConflict\n */\n\nimport { win } from './util';\n\n/*\n * Save the previous value of the global `$` variable, so that it can be restored later on.\n * @private\n */\n\nconst previousLib = win.$;\n\n/**\n * In case another library sets the global `$` variable before DOMtastic does,\n * this method can be used to return the global `$` to that other library.\n *\n * @return {Object} Reference to DOMtastic.\n * @example\n * var domtastic = $.noConflict();\n */\n\nexport const noConflict = function() {\n win.$ = previousLib;\n return this;\n};\n","/**\n * @module Selector (extra)\n */\n\nimport { each, toArray } from '../util';\nimport { $, matches } from './index';\n\n/**\n * Return children of each element in the collection, optionally filtered by a selector.\n *\n * @param {String} [selector] Filter\n * @return {Object} New wrapped collection\n * @chainable\n * @example\n * $('.selector').children();\n * $('.selector').children('.filter');\n */\n\nexport const children = function(selector) {\n const nodes = [];\n each(this, element => {\n if(element.children) {\n each(element.children, child => {\n if(!selector || (selector && matches(child, selector))) {\n nodes.push(child);\n }\n });\n }\n });\n return $(nodes);\n};\n\n/**\n * Add the elements of a wrapped collection to another.\n *\n * @param {String|Node|NodeList|Array} selector Query selector, `Node`, `NodeList`, array of elements, or HTML fragment string.\n * @return {Object} The extended wrapped collection\n * @example\n * $('.items').concat($('.more-items));\n * $('.items').concat('.more-items);\n * $('.items').concat('
more
');\n */\n\nexport const concat = function(selector) {\n each($(selector), element => {\n if([].indexOf.call(this, element) === -1) {\n [].push.call(this, element);\n }\n });\n return this;\n};\n\n/**\n * Return child nodes of each element in the collection, including text and comment nodes.\n *\n * @return {Object} New wrapped collection\n * @example\n * $('.selector').contents();\n */\n\nexport const contents = function() {\n const nodes = [];\n each(this, element => nodes.push.apply(nodes, toArray(element.childNodes)));\n return $(nodes);\n};\n\n/**\n * Return a collection containing only the one at the specified index.\n *\n * @param {Number} index\n * @return {Object} New wrapped collection\n * @chainable\n * @example\n * $('.items').eq(1)\n * // The second item; result is the same as doing $($('.items')[1]);\n */\n\nexport const eq = function(index) {\n return slice.call(this, index, index + 1);\n};\n\n/**\n * Return a collection containing only the first item.\n *\n * @return {Object} New wrapped collection\n * @chainable\n * @example\n * $('.items').first()\n * // The first item; result is the same as doing $($('.items')[0]);\n */\n\nexport const first = function() {\n return slice.call(this, 0, 1);\n};\n\n/**\n * Return the DOM element at the specified index.\n *\n * @param {Number} index\n * @return {Node} Element at the specified index\n * @example\n * $('.items').get(1)\n * // The second element; result is the same as doing $('.items')[1];\n */\n\nexport const get = function(index) {\n return this[index];\n};\n\n/**\n * Return the parent elements of each element in the collection, optionally filtered by a selector.\n *\n * @param {String} [selector] Filter\n * @return {Object} New wrapped collection\n * @chainable\n * @example\n * $('.selector').parent();\n * $('.selector').parent('.filter');\n */\n\nexport const parent = function(selector) {\n const nodes = [];\n each(this, element => {\n if(!selector || (selector && matches(element.parentNode, selector))) {\n nodes.push(element.parentNode);\n }\n });\n return $(nodes);\n};\n\n/**\n * Return the sibling elements of each element in the collection, optionally filtered by a selector.\n *\n * @param {String} [selector] Filter\n * @return {Object} New wrapped collection\n * @chainable\n * @example\n * $('.selector').siblings();\n * $('.selector').siblings('.filter');\n */\n\nexport const siblings = function(selector) {\n const nodes = [];\n each(this, element => each(element.parentNode.children, sibling => {\n if(sibling !== element && (!selector || (selector && matches(sibling, selector)))) {\n nodes.push(sibling);\n }\n }));\n return $(nodes);\n};\n\n/**\n * Create a new, sliced collection.\n *\n * @param {Number} start\n * @param {Number} end\n * @return {Object} New wrapped collection\n * @example\n * $('.items').slice(1, 3)\n * // New wrapped collection containing the second, third, and fourth element.\n */\n\nexport const slice = function(start, end) { // eslint-disable-line no-unused-vars\n return $([].slice.apply(this, arguments));\n};\n","/**\n * @module Type\n */\n\n/*\n * Determine if the argument passed is a Javascript function object.\n *\n * @param {Object} [obj] Object to test whether or not it is a function.\n * @return {boolean}\n * @example\n * $.isFunction(function(){}); // true\n * @example\n * $.isFunction({}); // false\n */\n\nexport const isFunction = obj => typeof obj === 'function';\n\n/*\n * Determine whether the argument is an array.\n *\n * @param {Object} [obj] Object to test whether or not it is an array.\n * @return {boolean}\n * @example\n * $.isArray([]); // true\n * @example\n * $.isArray({}); // false\n */\n\nexport const isArray = Array.isArray;\n","/**\n * @module API\n */\n\nimport { extend } from './util';\n\nconst api = {};\nlet $ = {};\n\n// Import modules to build up the API\n\nimport * as array from './array';\nimport BaseClass from './baseClass';\nimport * as css from './css';\nimport * as dom from './dom/index';\nimport * as dom_attr from './dom/attr';\nimport * as dom_class from './dom/class';\nimport * as dom_contains from './dom/contains';\nimport * as dom_data from './dom/data';\nimport * as dom_extra from './dom/extra';\nimport * as dom_html from './dom/html';\nimport * as event from './event/index';\nimport * as event_trigger from './event/trigger';\nimport * as event_ready from './event/ready';\nimport * as noconflict from './noconflict';\nimport * as selector from './selector/index';\nimport * as selector_closest from './selector/closest';\nimport * as selector_extra from './selector/extra';\nimport * as type from './type';\n\nif(typeof selector !== 'undefined') {\n $ = selector.$;\n $.matches = selector.matches;\n api.find = selector.find;\n}\n\nextend($, dom_contains, noconflict, type);\nextend(api, array, css, dom_attr, dom, dom_class, dom_data, dom_extra, dom_html, event, event_trigger, event_ready, selector_closest, selector_extra);\n\n$.fn = api;\n\n// Version\n\n$.version = '__VERSION__';\n\n// Util\n\n$.extend = extend;\n\n// Provide base class to extend from\n\nif(typeof BaseClass !== 'undefined') {\n $.BaseClass = BaseClass($.fn);\n}\n\n// Export interface\n\nexport default $;\n","import $ from 'domtastic'\n\nclass Tabs {\n constructor (trigger) {\n this.trigger = trigger\n this.listenClick(trigger)\n }\n\n render () {\n let context = $(this.trigger)\n let tabActive = context.find('.tab-list__item.active')\n let tab = tabActive.data('tab')\n\n $('.tab-content__item').removeClass('active')\n context.find(`.tab-content__item[data-tab=\"${tab}\"]`).addClass('active')\n }\n\n listenClick () {\n let changeTab = () => this.render()\n let tab = $('.tab-list__item')\n\n tab.on('click', function () {\n tab.removeClass('active')\n $(this).addClass('active')\n changeTab()\n })\n }\n}\n\nexport default Tabs\n","const ELECTION = '2022802018'\nconst STATE = 'SC'\n\nexport { ELECTION, STATE }\n","import { ELECTION, STATE } from './config'\n\nconst makeAPIUrl = (state, type) => {\n return `http://divulgacandcontas.tse.jus.br/divulga/rest/v1/candidatura/listar/2018/${state}/${ELECTION}/${type}/candidatos`\n}\n\nconst getList = type => {\n let api = ''\n\n switch (type) {\n case 'presidente':\n api = makeAPIUrl('BR', '1')\n break\n case 'governador':\n api = makeAPIUrl(STATE, '3')\n break\n case 'senador':\n api = makeAPIUrl(STATE, '5')\n break\n case 'federal':\n api = makeAPIUrl(STATE, '6')\n break\n case 'estadual':\n api = makeAPIUrl(STATE, '7')\n break\n }\n\n return fetch(api).then(response => response.json()) // eslint-disable-line\n}\n\nconst getPhoto = (id, state) => {\n return fetch(`http://divulgacandcontas.tse.jus.br/divulga/rest/v1/candidatura/buscar/2018/${state}/${ELECTION}/candidato/${id}`).then(response => response.json()) // eslint-disable-line\n}\n\nexport { getList, getPhoto }\n","import $ from 'domtastic'\nimport { getList, getPhoto } from './api'\n\nexport default function render () {\n let candidates = $('[data-candidate]')\n\n candidates.each(item => {\n let candidateDiv = $(item)\n let candidate = candidateDiv.data('candidate')\n\n candidateDiv.html('')\n\n getList(candidate).then(res => {\n candidateDiv.html(renderCandidates(res.candidatos, res.unidadeEleitoral.sigla))\n })\n })\n}\n\nconst renderCandidates = (data, state) => {\n let renderized = ''\n\n data.map(item => {\n if (item.descricaoSituacao === 'Deferido') {\n renderized += `\n
\n
\n \n
\n
\n ${item.numero}\n

${item.nomeUrna} \n

${item.partido.sigla} • ${item.nomeColigacao}

\n

\n
\n `\n }\n\n getPhoto(item.id, state)\n .then(res => {\n $(`[data-photo-candidate=\"${res.id}\"]`).attr('src', res.fotoUrl)\n })\n })\n\n return renderized\n}\n","import Tabs from './components/tabs'\nimport Render from './components/render'\n\nconst tabs = new Tabs('.tabs')\ntabs.render()\n\nRender()\n"]} -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Eleições 2018

Eleições 2018

santa catarina

  • Presidente Presidente
  • Governador Governo
  • Senador Senado
  • Federal Federal
  • Estadual Estadual
-------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp') 2 | const connect = require('gulp-connect') 3 | const plumber = require('gulp-plumber') 4 | const pug = require('gulp-pug') 5 | const stylus = require('gulp-stylus') 6 | const nib = require('nib') 7 | const koutoSwiss = require('kouto-swiss') 8 | const shell = require('gulp-shell') 9 | const standard = require('gulp-standard') 10 | const surge = require('gulp-surge') 11 | 12 | const paths = { 13 | html: './src/pug/**/*', 14 | css: './src/stylus/**/*', 15 | js: './src/js/**/*' 16 | } 17 | 18 | gulp.task('connect', () => { 19 | connect.server({ 20 | root: './docs', 21 | port: 5001, 22 | livereload: true 23 | }) 24 | }) 25 | 26 | gulp.task('standard', () => { 27 | gulp.src(paths.js) 28 | .pipe(standard()) 29 | .pipe(standard.reporter('default', { 30 | breakOnError: false, 31 | quiet: true 32 | })) 33 | .pipe(connect.reload()) 34 | }) 35 | 36 | gulp.task('js', () => { 37 | gulp.src('./src/js/*.js', {read: false}) 38 | .pipe(plumber()) 39 | .pipe(shell([ 40 | './node_modules/parcel-bundler/bin/cli.js build <%= file.path %> --out-dir ./docs/assets/js' 41 | ])) 42 | .pipe(connect.reload()) 43 | }) 44 | 45 | gulp.task('stylus', () => { 46 | gulp.src('./src/stylus/*.styl') 47 | .pipe(plumber()) 48 | .pipe(stylus({ 49 | compress: false, 50 | use: [nib(), koutoSwiss()], 51 | import: ['nib', 'kouto-swiss'] 52 | })) 53 | .pipe(gulp.dest('./docs/assets/css')) 54 | .pipe(connect.reload()) 55 | }) 56 | 57 | gulp.task('pug', () => { 58 | gulp.src('./src/pug/*.pug') 59 | .pipe(plumber()) 60 | .pipe(pug()) 61 | .pipe(gulp.dest('./docs')) 62 | .pipe(connect.reload()) 63 | }) 64 | 65 | gulp.task('deploy', [], () => { 66 | return surge({ 67 | project: './docs', 68 | domain: 'eleicoes2018.surge.sh' 69 | }) 70 | }) 71 | 72 | gulp.task('watch', () => { 73 | gulp.watch(paths.css, ['stylus']) 74 | gulp.watch(paths.html, ['pug']) 75 | gulp.watch(paths.js, ['js']) 76 | }) 77 | 78 | gulp.task('build', ['pug', 'stylus', 'standard', 'js']) 79 | gulp.task('server', ['build', 'connect', 'watch']) 80 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2018 – Diogo Moretti 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eleicoes-2018", 3 | "description": "Eleições 2018", 4 | "version": "0.1.0", 5 | "author": { 6 | "name": "Diogo Moretti", 7 | "url": "diogo.pearljam@gmail.com" 8 | }, 9 | "devDependencies": { 10 | "babel-plugin-transform-async-to-generator": "^6.24.1", 11 | "babel-plugin-transform-runtime": "^6.23.0", 12 | "babel-preset-es2015": "^6.24.1", 13 | "babel-runtime": "^6.26.0", 14 | "domtastic": "^0.15.9", 15 | "gulp": "3.9.1", 16 | "gulp-connect": "^5.0.0", 17 | "gulp-plumber": "~0.5.6", 18 | "gulp-pug": "^4.0.1", 19 | "gulp-shell": "^0.6.5", 20 | "gulp-standard": "^11.0.0", 21 | "gulp-stylus": "^2.7.0", 22 | "gulp-surge": "^0.1.0", 23 | "kouto-swiss": "^1.1.0", 24 | "nib": "^1.1.2", 25 | "parcel-bundler": "^1.9.7" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | screen shot 2018-09-08 at 17 23 48 2 | 3 | [![Travis Build](https://img.shields.io/travis/diogomoretti/eleicoes2018.svg?style=flat-square)](https://travis-ci.org/diogomoretti/eleicoes2018) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?longCache=true&style=flat-square)](https://standardjs.com) [![Deploy on surge](https://img.shields.io/badge/deploy-surge.sh-yellow.svg?longCache=true&style=flat-square)](https://surge.sh) 4 |
5 | -------------------------------------------------------------------------------- /src/js/components/api.js: -------------------------------------------------------------------------------- 1 | import { ELECTION, STATE } from './config' 2 | 3 | const makeAPIUrl = (state, type) => { 4 | return `http://divulgacandcontas.tse.jus.br/divulga/rest/v1/candidatura/listar/2018/${state}/${ELECTION}/${type}/candidatos` 5 | } 6 | 7 | const getList = type => { 8 | let api = '' 9 | 10 | switch (type) { 11 | case 'presidente': 12 | api = makeAPIUrl('BR', '1') 13 | break 14 | case 'governador': 15 | api = makeAPIUrl(STATE, '3') 16 | break 17 | case 'senador': 18 | api = makeAPIUrl(STATE, '5') 19 | break 20 | case 'federal': 21 | api = makeAPIUrl(STATE, '6') 22 | break 23 | case 'estadual': 24 | api = makeAPIUrl(STATE, '7') 25 | break 26 | } 27 | 28 | return fetch(api).then(response => response.json()) // eslint-disable-line 29 | } 30 | 31 | const getPhoto = (id, state) => { 32 | return fetch(`http://divulgacandcontas.tse.jus.br/divulga/rest/v1/candidatura/buscar/2018/${state}/${ELECTION}/candidato/${id}`).then(response => response.json()) // eslint-disable-line 33 | } 34 | 35 | export { getList, getPhoto } 36 | -------------------------------------------------------------------------------- /src/js/components/config.js: -------------------------------------------------------------------------------- 1 | const ELECTION = '2022802018' 2 | const STATE = 'SC' 3 | 4 | export { ELECTION, STATE } 5 | -------------------------------------------------------------------------------- /src/js/components/render.js: -------------------------------------------------------------------------------- 1 | import $ from 'domtastic' 2 | import { getList, getPhoto } from './api' 3 | 4 | export default function render () { 5 | let candidates = $('[data-candidate]') 6 | 7 | candidates.each(item => { 8 | let candidateDiv = $(item) 9 | let candidate = candidateDiv.data('candidate') 10 | 11 | candidateDiv.html('') 12 | 13 | getList(candidate).then(res => { 14 | candidateDiv.html(renderCandidates(res.candidatos, res.unidadeEleitoral.sigla)) 15 | }) 16 | }) 17 | } 18 | 19 | const renderCandidates = (data, state) => { 20 | let renderized = '' 21 | 22 | data.map(item => { 23 | if (item.descricaoSituacao === 'Deferido') { 24 | renderized += ` 25 |
26 |
27 | 28 |
29 |
30 | ${item.numero} 31 |

${item.nomeUrna} 32 |

${item.partido.sigla} • ${item.nomeColigacao}

33 |

34 |
35 | ` 36 | } 37 | 38 | getPhoto(item.id, state) 39 | .then(res => { 40 | $(`[data-photo-candidate="${res.id}"]`).attr('src', res.fotoUrl) 41 | }) 42 | }) 43 | 44 | return renderized 45 | } 46 | -------------------------------------------------------------------------------- /src/js/components/tabs.js: -------------------------------------------------------------------------------- 1 | import $ from 'domtastic' 2 | 3 | class Tabs { 4 | constructor (trigger) { 5 | this.trigger = trigger 6 | this.listenClick(trigger) 7 | } 8 | 9 | render () { 10 | let context = $(this.trigger) 11 | let tabActive = context.find('.tab-list__item.active') 12 | let tab = tabActive.data('tab') 13 | 14 | $('.tab-content__item').removeClass('active') 15 | context.find(`.tab-content__item[data-tab="${tab}"]`).addClass('active') 16 | } 17 | 18 | listenClick () { 19 | let changeTab = () => this.render() 20 | let tab = $('.tab-list__item') 21 | 22 | tab.on('click', function () { 23 | tab.removeClass('active') 24 | $(this).addClass('active') 25 | changeTab() 26 | }) 27 | } 28 | } 29 | 30 | export default Tabs 31 | -------------------------------------------------------------------------------- /src/js/main.js: -------------------------------------------------------------------------------- 1 | import Tabs from './components/tabs' 2 | import Render from './components/render' 3 | 4 | const tabs = new Tabs('.tabs') 5 | tabs.render() 6 | 7 | Render() 8 | -------------------------------------------------------------------------------- /src/pug/index.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta(charset='UTF-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no') 7 | 8 | title Eleições 2018 9 | 10 | link(rel='apple-touch-icon' sizes='180x180' href='assets/favicons/apple-touch-icon.png') 11 | link(rel='icon' type='image/png' sizes='32x32' href='assets/favicons/favicon-32x32.png') 12 | link(rel='icon' type='image/png' sizes='16x16' href='assets/favicons/favicon-16x16.png') 13 | link(rel='manifest', href='assets/favicons/site.webmanifest') 14 | link(rel='mask-icon' href='assets/favicons/safari-pinned-tab.svg' color='#5bbad5') 15 | link(rel='shortcut icon' href='assets/favicons/favicon.ico') 16 | meta(name='msapplication-TileColor' content='#ffffff') 17 | meta(name='msapplication-config' content='assets/favicons/browserconfig.xml') 18 | meta(name='theme-color' content='#ffffff') 19 | 20 | link(rel='stylesheet' href='assets/css/main.css') 21 | body 22 | .site-wrapper 23 | header.header 24 | h1.header-title 25 | span Eleições 2018 26 | p.header-description santa catarina 27 | main.main 28 | .tabs 29 | ul.tab-list 30 | li.tab-list__item.active(data-tab='tab1') #[span.full Presidente] #[span.abbr Presidente] 31 | li.tab-list__item(data-tab='tab2') #[span.full Governador] #[span.abbr Governo] 32 | li.tab-list__item(data-tab='tab3') #[span.full Senador] #[span.abbr Senado] 33 | li.tab-list__item(data-tab='tab4') #[span.full Federal] #[span.abbr Federal] 34 | li.tab-list__item(data-tab='tab5') #[span.full Estadual] #[span.abbr Estadual] 35 | 36 | .tab-content 37 | .tab-content__item(data-tab='tab1' data-candidate='presidente') 38 | .tab-content__item(data-tab='tab2' data-candidate='governador') 39 | .tab-content__item(data-tab='tab3' data-candidate='senador') 40 | .tab-content__item(data-tab='tab4' data-candidate='federal') 41 | .tab-content__item(data-tab='tab5' data-candidate='estadual') 42 | footer.footer 43 | p.footer-description As informações contidas nessa página foram retiradas do #[a(href="http://divulgacandcontas.tse.jus.br" target="_blank") Site Oficial do TSE]. 44 | p.footer-description Este projeto tem o #[a(href="https://github.com/diogomoretti/eleicoes2018" target="_blank") código aberto] sob a #[a(href="https://pt.wikipedia.org/wiki/Licen%C3%A7a_MIT" target="_blank") Licença MIT]. 45 | 46 | script(src='assets/js/main.js') 47 | -------------------------------------------------------------------------------- /src/stylus/app/default.styl: -------------------------------------------------------------------------------- 1 | box-sizing-reset() 2 | normalize() 3 | 4 | html 5 | font-size 10px 6 | 7 | body 8 | cursor default 9 | font-size 1rem 10 | font-family 'Objectivity', Arial, sans-serif 11 | font-variant-ligatures none 12 | background #fff 13 | 14 | .site-wrapper 15 | max-width 750px 16 | margin 0 auto 17 | padding 0 1.5em 18 | 19 | .loading 20 | display block 21 | max-width 30px 22 | margin 1em auto 23 | -------------------------------------------------------------------------------- /src/stylus/app/fonts.styl: -------------------------------------------------------------------------------- 1 | font-face('Objectivity', '../fonts/Objectivity-Bold', bold, formats: woff2 ) 2 | font-face('Objectivity', '../fonts/Objectivity-Regular', normal, formats: woff2 ) 3 | -------------------------------------------------------------------------------- /src/stylus/app/settings.styl: -------------------------------------------------------------------------------- 1 | $brazil-green = #2ED72A 2 | $brazil-yellow = #EBFF39 3 | 4 | $bp-phone = '(max-width: 580px)' 5 | -------------------------------------------------------------------------------- /src/stylus/components/candidate.styl: -------------------------------------------------------------------------------- 1 | .candidate-item 2 | display flex 3 | margin 1em 0 5em 4 | box-shadow 0 5px 10px rgba(#ccc, .1) 5 | 6 | &-column__photo 7 | flex-basis 25% 8 | 9 | @media $bp-phone 10 | flex-basis 35% 11 | padding-right 2em 12 | 13 | &-column__content 14 | flex 1 15 | padding-top 1em 16 | 17 | &__photo 18 | display block 19 | height 170px 20 | width 122px 21 | background url('../img/loading.gif') center no-repeat #fff 22 | background-size 30px auto 23 | border 1px solid #eee 24 | border-radius 10px 25 | overflow hidden 26 | 27 | @media $bp-phone 28 | width 100% 29 | 30 | &[src] 31 | filter grayscale(100%) 32 | max-width 100% 33 | width auto 34 | border-color transparent 35 | 36 | @media $bp-phone 37 | height auto 38 | 39 | &__number 40 | background #2f4858 41 | font-size 2.2rem 42 | font-weight bold 43 | color #fff 44 | border-radius 5px 45 | padding .3em .5em .2em 46 | 47 | @media $bp-phone 48 | font-size 2rem 49 | 50 | &__name 51 | margin .6em 0 52 | font-size 2.7rem 53 | 54 | @media $bp-phone 55 | font-size 2.5rem 56 | 57 | &__coalition 58 | margin .4em 0 59 | color #aaa 60 | font-weight normal 61 | font-size 1.6rem 62 | line-height 1.6 63 | 64 | @media $bp-phone 65 | font-size 1.6rem 66 | -------------------------------------------------------------------------------- /src/stylus/components/tabs.styl: -------------------------------------------------------------------------------- 1 | .tab-list 2 | list-style none 3 | margin 0 4 | padding 0 5 | display flex 6 | border-bottom 1px solid #eee 7 | 8 | &__item 9 | position relative 10 | flex 1 11 | color #aaa 12 | text-align center 13 | font-size 1.5rem 14 | padding-bottom 1.2em 15 | padding-top 1em 16 | cursor pointer 17 | transition color .5s ease 18 | 19 | .abbr 20 | display none 21 | 22 | @media $bp-phone 23 | font-size 1.3rem 24 | 25 | .full 26 | display none 27 | 28 | .abbr 29 | display block 30 | 31 | &:after 32 | content '' 33 | position absolute 34 | display block 35 | left 0 36 | right 0 37 | height 3px 38 | bottom -2px 39 | background transparent 40 | transition background .5s ease 41 | 42 | &:hover 43 | color @color + 30% 44 | 45 | &.active 46 | color #000 47 | 48 | &:after 49 | background #000 50 | 51 | .tab-content 52 | padding-top 3em 53 | 54 | &__item 55 | display none 56 | 57 | &.active 58 | display block 59 | -------------------------------------------------------------------------------- /src/stylus/main.styl: -------------------------------------------------------------------------------- 1 | @import 'app/settings' 2 | @import 'app/fonts' 3 | @import 'app/default' 4 | @import 'components/tabs' 5 | @import 'components/candidate' 6 | @import 'pages/home' 7 | -------------------------------------------------------------------------------- /src/stylus/pages/home.styl: -------------------------------------------------------------------------------- 1 | .header 2 | padding 5em 0 3 | 4 | &-title 5 | margin 0 6 | font-size 4rem 7 | letter-spacing -.05em 8 | background-image linear-gradient(to bottom, $brazil-green 0%, $brazil-green 40%, $brazil-yellow 40%, $brazil-yellow 80%, #fff 80%, #fff 100%) 9 | overflow hidden 10 | border-radius 2px 11 | 12 | span 13 | background #fff 14 | padding .3em 0 15 | box-shadow 10px 0 15px 20px #fff 16 | 17 | &-description 18 | margin .5em 0 0 0 19 | padding-left .4em 20 | font-size 1rem 21 | color #aaa 22 | letter-spacing .5em 23 | text-transform uppercase 24 | 25 | .footer 26 | border-top 1px solid #eee 27 | padding-top 1em 28 | 29 | &-description 30 | font-size 1.2rem 31 | line-height 1.6 32 | color #aaa 33 | 34 | a 35 | color #777 36 | border-bottom 1px solid @color 37 | text-decoration none 38 | transition all .5s ease 39 | 40 | &:hover 41 | color #000 42 | border-color @color 43 | --------------------------------------------------------------------------------