tungsten 0.1.20 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tungsten/_icons.js +1 -1
- data/app/assets/javascripts/tungsten/enhancements/text-helpers.js +10 -0
- data/app/assets/stylesheets/tungsten/_colors.yml +1 -0
- data/app/assets/stylesheets/tungsten/components/_toggle-nav.scss +1 -0
- data/app/assets/stylesheets/tungsten/core/_banner.scss +44 -0
- data/app/assets/stylesheets/tungsten/core/_index.scss +2 -1
- data/app/assets/stylesheets/tungsten/core/_layout.scss +0 -41
- data/app/assets/stylesheets/tungsten/form/_base.scss +1 -1
- data/app/assets/stylesheets/tungsten/form/_copy-input.scss +5 -4
- data/app/assets/stylesheets/tungsten/form/_label-placeholder.scss +4 -4
- data/app/assets/svgs/tungsten/cluster.svg +1 -0
- data/app/assets/svgs/tungsten/copy.svg +1 -1
- data/app/helpers/tungsten/button_helper.rb +1 -1
- data/app/helpers/tungsten/form_helper.rb +1 -1
- data/app/views/layouts/tungsten/default.html.slim +1 -4
- data/lib/tungsten/version.rb +1 -1
- data/public/{code-0.1.20.js → code-0.1.21.js} +1 -1
- data/public/{code-0.1.20.js.gz → code-0.1.21.js.gz} +0 -0
- data/public/{code-0.1.20.map.json → code-0.1.21.map.json} +0 -0
- data/public/{tungsten-0.1.20.css → tungsten-0.1.21.css} +142 -161
- data/public/tungsten-0.1.21.css.gz +0 -0
- data/public/{tungsten-0.1.20.js → tungsten-0.1.21.js} +3 -3
- data/public/tungsten-0.1.21.js.gz +0 -0
- data/public/tungsten-0.1.21.map.json +1 -0
- metadata +12 -10
- data/public/tungsten-0.1.20.css.gz +0 -0
- data/public/tungsten-0.1.20.js.gz +0 -0
- data/public/tungsten-0.1.20.map.json +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["node_modules/browser-pack/_prelude.js","app/assets/javascripts/tungsten/_form-helpers.js","app/assets/javascripts/tungsten/_icons.js","app/assets/javascripts/tungsten/enhancements/clipboard.js","app/assets/javascripts/tungsten/enhancements/flash-messages.js","app/assets/javascripts/tungsten/enhancements/notify.js","app/assets/javascripts/tungsten/enhancements/text-helpers.js","app/assets/javascripts/tungsten/tungsten.js","node_modules/bean/bean.js","node_modules/component-emitter/index.js","node_modules/compose-event/index.js","node_modules/compose-event/lib/animation-events.js","node_modules/compose-event/lib/bubble-form-events.js","node_modules/compose-event/lib/callback-manager.js","node_modules/compose-event/lib/debounce.js","node_modules/compose-event/lib/delay.js","node_modules/compose-event/lib/media.js","node_modules/compose-event/lib/optimized-event-manager.js","node_modules/compose-event/lib/page.js","node_modules/compose-event/lib/repeat.js","node_modules/compose-event/lib/resize.js","node_modules/compose-event/lib/scroll.js","node_modules/compose-event/lib/shims/custom-event.js","node_modules/compose-event/lib/tap-events.js","node_modules/compose-event/lib/throttle.js","node_modules/compose-form-up/index.js","node_modules/compose-form-up/lib/progressive.js","node_modules/compose-form-up/lib/validation.js","node_modules/compose-slider/index.js","node_modules/compose-slider/lib/object.assign.js","node_modules/compose-toggler/index.js","node_modules/compose-toolbox/index.js","node_modules/compose-toolbox/lib/ease.js","node_modules/compose-toolbox/lib/fromtop.js","node_modules/compose-toolbox/lib/scrollto.js","node_modules/compose-toolbox/lib/shims/_classlist.js","node_modules/compose-toolbox/lib/shims/_object.assign.js","node_modules/keymaster/keymaster.js","node_modules/superagent/lib/client.js","node_modules/superagent/lib/is-object.js","node_modules/superagent/lib/request-base.js","node_modules/superagent/lib/request.js"],"names":["syncValue","input","target","classList","toggle","value","trim","length","toolbox","require","Event","event","textSelectors","change","each","document","querySelectorAll","on","embed","querySelector","insertAdjacentHTML","readyState","window","Turbolinks","addEventListener","clipboard","copy","console","log","copyTrigger","currentTarget","copyElement","dataset","copyTarget","preventDefault","select","execCommand","blur","add","setTimeout","remove","err","alert","module","exports","Notify","flash","type","textContent","notify","message","show","clearTimeout","autoDismissTimeout","messageEl","dismiss","body","template","lastChild","innerHTML","defaults","defaultsByType","dismissAfter","keyOne","one","callback","cb","timeout","afterAnimation","parentNode","removeChild","normal","success","autoSizeTextarea","textarea","parent","parentElement","contains","style","height","offset","offsetHeight","clientHeight","newHeight","scrollHeight","maxHeight","innerHeight","textareas","delay","Array","prototype","forEach","call","node","getAttribute","RegExp","matchUrl","test","location","pathname","toggler","formUp","ajax","scroll","disablePointer","Tungsten","merge","form","name","context","definition","define","amd","this","selectorEngine","win","old","namespaceRegex","nameRegex","addEvent","doc","root","documentElement","W3C_MODEL","eventSupport","ONE","slice","str2arr","s","d","split","isString","o","isFunction","isObject","buildOptions","originalDefaults","maybeOptions","key","hasOwnProperty","nativeEvents","hash","events","i","customEvents","isAncestor","element","container","compareDocumentPosition","nodeType","check","related","relatedTarget","prefix","toString","mouseenter","base","condition","mouseleave","mousewheel","navigator","userAgent","commonProps","mouseProps","concat","mouseWheelProps","keyProps","textProps","touchProps","messageProps","stateProps","overOutRegex","typeFixers","reg","fix","newEvent","keyCode","which","rightClick","button","pos","x","y","pageX","pageY","clientX","clientY","scrollLeft","scrollTop","typeFixerMap","isNative","arguments","ownerDocument","parentWindow","originalEvent","isBean","l","p","props","fixer","srcElement","returnValue","stopPropagation","cancelBubble","stop","stopped","stopImmediatePropagation","isImmediatePropagationStopped","clone","ne","targetElement","RegEntry","wrappedHandler","fn","args","eargs","apply","findTarget","eventElement","__beanDel","ft","handler","original","namespaces","customType","once","removeListener","eventType","inNamespaces","checkNamespaces","j","c","matches","checkElement","checkOriginal","checkHandler","registry","map","forAll","pfx","list","all","t","charAt","substr","has","get","entries","entry","push","put","del","splice","removed","setSelectorEngine","e","r","Error","rootListener","propertyName","listeners","listener","custom","useCapture","attachEvent","detachEvent","rm","originalFn","orgType","replace","handlers","delegate","selector","array","match","fireListener","evt","createEvent","dispatchEvent","fireEvent","createEventObject","off","typeSpec","k","isTypeStr","defaultOpts","opts","indexOf","types","first","undefined","delfn","options","fire","names","from","beanDel","bean","noConflict","cleanup","CollectGarbage","Emitter","obj","mixin","_callbacks","removeAllListeners","removeEventListener","callbacks","emit","len","hasListeners","setEvent","animationEvent","transform","isEmpty","join","registerType","transformArgs","arg","keys","scope","unbind","el","getComputedStyle","getPropertyValue","transformedArgs","newEvents","shift","objEvents","touchstart","tap","a","Object","page","debounce","throttle","repeat","bubbleFormEvents","resize","callbackManager","media","formBubbling","ready","keyOn","keyOff","camelCaseEventTypes","animationstart","animationend","animationiteration","lowerCaseEventTypes","getAnimationEventTypes","prefixes","animationName","toLowerCase","transformAnimationEvents","cssAnimEventTypes","env","error","supported","formEls","fireBubble","detail","triggered","ev","CustomEvent","bubbles","cancelable","defaultPrevented","tagName","bubbleOn","bubbleOff","Manager","new","manager","start","bool","enabled","now","Date","pickFunction","found","candidate","wait","max","leading","trailing","leadingFn","trailingFn","queued","handle","lastCalled","lastInvoked","leadingBlocked","invoke","callType","addToQueue","requestAnimationFrame","loop","removeFromQueue","cancelAnimationFrame","maxPassed","waitReached","debounced","argsStart","queueDelay","complete","parseQuery","query","dimension","result","min","size","num","limit","toPx","width","listen","minWidth","maxWidth","minHeight","matchMedia","addListener","optimizedEventManager","run","running","started","toUpperCase","substring","readyAlready","changed","cancel","disableAnimation","head","pointerEvents","params","initCustomEvent","Tap","e1","done","e2","timeout_id","endEvents","touches","validation","progressive","validate","invalidateField","next","reset","formCallbacks","registeredForms","newForm","currentStep","steps","stepIndex","nextStep","active","disabled","forward","showStep","index","Number","step","direction","disable","revisit","disableOtherFieldsets","firstInput","focus","setNav","nav","enableFieldsets","fieldset","trigger","formEl","getClosest","fireCallbacks","getCallbacks","formData","filter","Callback","formSelector","watching","nextSelector","backSelector","createElement","checkValidity","validateForm","invalidInput","inputs","some","checkInput","showMessage","statusEl","valid","isValid","activeElement","setAttribute","checkValue","checkLength","setCustomValidity","invalidValue","regexp","escapedRegex","cachedMessage","invalidValueMessage","str","checkCount","goal","lessThanGoal","wordCount","phrasing","display","nextSibling","submit","checkValidation","hideMessage","msg","label","validationMessage","existingMessage","invalidHandler","sliders","listening","Slider","self","refresh","slider","setLabels","setInput","setFill","setup","ranges","data","id","labels","externalLabels","assign","extractData","extractValues","getLabels","values","segments","camelCase","removeAttribute","inputClass","inputExists","getLineLabels","mark","getData","val","delimiter","external","default","labelCount","objectSize","lineLabels","containerHTML","templateHTML","classes","previousSibling","outerHTML","html","fills","labelTemplate","labelHTML","positionLabel","labelMeta","position","altKey","meta","attributes","nodeName","nodeValue","labelElements","internalSelector","externalSelector","sliderIndex","fill","offsetParent","labelEls","labelAtIndex","set","object","group","TypeError","output","source","nextKey","Toggler","checkboxSelector","radioSelector","selectSelector","hashChange","anchor","checked","getSelectFromOption","selectedIndex","ratchet","triggerToggling","toggleCheckboxes","setupSelects","setupRadios","actions","selectedOptions","action","dispatch","setClass","setState","selectors","sel","settings","classnames","classname","method","triggerTogglerEventsOnChildren","state","toggleAction","focusEl","hide","getLeafNodes","hasChildNodes","getElementsByTagName","elem","children","eventName","leafChildNodes","checkboxes","radio","togglerActive","radioName","siblings","parentForm","showSelectors","dataAttributes","addClassSelectors","addClass","removeClass","option","elements","attr","scrollTo","fromTop","ease","getNext","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","count","collection","rootEl","FormData","fields","field","append","inOutQuad","b","inOutCubic","inOutQuint","ts","tc","inOutCirc","Math","sqrt","round","getBoundingClientRect","top","pageYOffset","move","amount","to","duration","currentTime","animateScroll","testElement","createMethod","DOMTokenList","token","_toggle","force","view","elemCtrProto","Element","objCtr","strTrim","String","arrIndexOf","item","DOMEx","code","DOMException","checkTokenAndGetIndex","ClassList","trimmedClasses","_updateClassName","classListProto","classListGetter","tokens","iter","updated","defineProperty","classListPropDesc","enumerable","configurable","ex","number","__defineGetter__","global","compareArray","a1","a2","updateModifierKey","_mods","modifierMap","modifiersMatch","_downKeys","_MODIFIERS","assignKey","_handlers","getScope","mods","clearModifier","resetModifiers","getKeys","getMods","shortcut","unbindKey","multipleKeys","isPressed","getPressedKeyCodes","setScope","_scope","deleteScope","mi","previousKey","16","18","17","91","⇧","⌥","alt","⌃","ctrl","control","⌘","command","_MAP","backspace","tab","clear","enter","return","esc","escape","space","left","up","right","down","delete","home","end","pageup","pagedown",",",".","/","`","-","=",";","'","[","]","\\","charCodeAt","noop","serialize","pairs","pushEncodedKeyValuePair","isArray","v","subkey","encodeURIComponent","parseString","pair","decodeURIComponent","parseHeader","line","lines","pop","isJSON","mime","reduce","parts","Response","req","xhr","text","responseType","responseText","statusText","_setStatusProperties","status","header","headers","getAllResponseHeaders","getResponseHeader","_setHeaderProperties","_parseBody","response","Request","url","_query","_header","res","parse","rawResponse","statusCode","new_err","request","warn","requestBase","bind","getXHR","XMLHttpRequest","protocol","ActiveXObject","serializeObject","json","xml","urlencoded","form-data","application/x-www-form-urlencoded","application/json","JSON","stringify","ct","statusType","info","ok","clientError","serverError","toError","accepted","noContent","badRequest","unauthorized","notAcceptable","notFound","forbidden","_responseType","accept","auth","user","pass","btoa","username","password","attach","file","filename","_getFormData","_formData","_callback","crossDomainError","crossDomain","_timeoutError","_timeout","_appendQueryString","_data","onreadystatechange","timedout","_aborted","handleProgress","total","percent","loaded","onprogress","upload","_timer","abort","open","_withCredentials","withCredentials","_isHost","contentType","_serializer","setRequestHeader","send","patch","post","_parser","ms","then","resolve","reject","_fullfilledPromise","Promise","innerResolve","innerReject","catch","use","getHeader","unset","redirects","n","_maxRedirects","toJSON","RequestConstructor"],"mappings":"AAAA;YCIA,SAASA,WAAWC,GAGlBA,EAAUA,EAAMC,QAAUD,EAI1BA,EAAME,UAAUC,OAAQ,SAAUH,EAAMI,MAAMC,OAAOC,QAXvD,GAAIC,SAAUC,QAAS,mBACnBC,MAAQF,QAAQG,MAChBC,cAAgB,oJAapBF,OAAMG,OAAQ,WACZL,QAAQM,KAAMC,SAASC,iBAAkBJ,eAAiBZ,aAI5DU,MAAMO,GAAIF,SAAU,QAASH,cAAeZ;;cCpB5C,WAEE,QAASkB,KACFH,SAASI,cAAc,oBAC1BJ,SAASI,cAAc,QAAQC,mBAAmB,aAAc,q+SAKzC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if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","var toolbox = require( 'compose-toolbox' )\nvar Event = toolbox.event\nvar textSelectors = 'textarea, input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=hidden]):not([type=submit]):not([type=image]):not([type=reset])'\n\nfunction syncValue( input ) {\n\n // Allow calling from event handler\n input = ( input.target || input )\n\n // If element is empty (or contains only whitespace)\n // Add empty class\n input.classList.toggle( 'empty', !input.value.trim().length )\n}\n\n// Initialize input state\nEvent.change( function() {\n toolbox.each( document.querySelectorAll( textSelectors ), syncValue )\n})\n\n// Set input state on keyup (debounced)\nEvent.on( document, 'input', textSelectors, syncValue )\n","(function(){\n\n function embed() {\n if (!document.querySelector('#esvg-svg-icons')) {\n document.querySelector('body').insertAdjacentHTML('afterbegin', '<svg id=\"esvg-svg-icons\" data-symbol-class=\"svg-symbol\" data-prefix=\"svg\" version=\"1.1\" style=\"height:0;position:absolute\"><symbol id=\"svg-deployment\" data-name=\"deployment\" viewBox=\"0 0 176 201\" width=\"176\" height=\"201\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M88 5.985l82.272 47.5v95L88 195.985l-82.272-47.5v-95L88 5.985z\"/></symbol><symbol id=\"svg-copy\" data-name=\"copy\" viewBox=\"0 0 204 252\" width=\"204\" height=\"252\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M149.406 251.232H53.802C24.108 251.232 0 227.124 0 197.43V89.826c0-25.19 17.35-46.362 40.743-52.204v24.25c0 6.798 4.992 11.093 11.143 11.093h99.436c6.15 0 11.143-4.295 11.143-11.093v-24.25c23.393 5.842 40.743 27.013 40.743 52.204V197.43c0 29.694-24.107 53.8-53.802 53.802zm-2.748-154.255H56.55c-16.058 0-29.094 13.037-29.094 29.094v70.19c0 16.056 13.037 29.093 29.094 29.093h90.108c16.057 0 29.094-13.037 29.094-29.094v-70.19c0-16.056-13.036-29.092-29.094-29.093z\" fill-opacity=\".753\"/><path d=\"M64.252 57.763h74.704c4.676 0 8.47-2.964 8.47-7.657v-7.41c0-9.878-4.59-17.755-16.94-17.755h-12.94C117.545 8 110.97 0 101.603 0s-15.94 8-15.94 24.94h-12.94c-10.945 0-16.942 7.878-16.942 17.755v7.41c0 4.694 3.794 7.658 8.47 7.658\"/><path d=\"M97.72 142.456V114.35c0-7.105 4.267-9.29 9.427-4.828l52.21 41.772c2.6 2.23 2.587 5.824-.01 8.055l-52.222 40.96c-5.138 4.44-9.406 2.266-9.406-4.84v-26.275h-5.1c-17.433 2.183-33.966 11.9-39.675 31.502-.885 3.037-2.895 2.94-3.707-.115-1.476-5.56-2.383-11.385-2.29-17.414.367-23.442 22.557-40.877 50.77-40.712\" fill-rule=\"nonzero\"/></symbol><symbol id=\"svg-logo\" data-name=\"logo\" viewBox=\"0 0 256 256\" width=\"256\" height=\"256\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M152.89 179.214l-49.78 28.74-53.332-30.792L0 148.42V86.838l53.333-30.792 49.777 28.74 49.777-28.74 53.333 30.792 49.78 28.74v61.584l-53.333 30.792-49.778-28.74zm3.137-6.374v-49.052l42.975 24.635.01 49.27-42.985-24.853zm-99.14.217v-49.27l43.126 24.77.01 49.566-43.135-25.066zM7.11 144.317v-49.27l42.668 24.635.002 49.27-42.67-24.635zm96-51.32l42.67 24.634-42.67 24.636-42.67-24.634 42.67-24.634zm99.557 0l42.668 24.634-42.668 24.636-42.67-24.634 42.67-24.634zM53.333 64.257l42.67 24.633-42.67 24.635-42.67-24.634 42.67-24.633zm99.554 0l42.67 24.633-42.67 24.635-42.67-24.634 42.67-24.633z\"/><path d=\"M6.82 144.547l.023-50 93.295 53.877.04 50.06L6.82 144.547zm148.916 28.477l.14-49.667 43.428 24.894-.045 50.235-43.525-25.46z\" fill-opacity=\".349\"/></symbol><symbol id=\"svg-cluster\" data-name=\"cluster\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M256 510.897c-.898-.003-1.795-.027-2.692-.08-1.795-.108-3.583-.322-5.352-.643-5.29-.958-10.398-2.872-15.01-5.635-2.092-1.255-4.08-2.68-5.942-4.26-.88-.743-1.725-1.523-2.547-2.33C154.1 428.037 83.963 357.9 14.05 287.543c-1.206-1.228-2.348-2.515-3.41-3.87-2.008-2.558-3.736-5.336-5.14-8.27-1.414-2.95-2.5-6.054-3.238-9.24-.77-3.33-1.16-6.746-1.16-10.163s.39-6.834 1.16-10.163c.738-3.186 1.824-6.29 3.237-9.24 1.404-2.934 3.132-5.712 5.14-8.27 1.062-1.355 2.204-2.642 3.41-3.87C83.963 154.1 154.1 83.963 224.457 14.05c1.228-1.206 2.515-2.348 3.87-3.41 2.558-2.008 5.336-3.736 8.27-5.14 2.95-1.414 6.054-2.5 9.24-3.238 3.33-.77 6.746-1.16 10.163-1.16s6.834.39 10.163 1.16c3.186.738 6.29 1.824 9.24 3.237 2.934 1.404 5.712 3.132 8.27 5.14 1.355 1.062 2.642 2.204 3.87 3.41C357.9 83.963 428.037 154.1 497.95 224.457c1.206 1.228 2.348 2.515 3.41 3.87 2.008 2.558 3.736 5.336 5.14 8.27 1.414 2.95 2.5 6.054 3.238 9.24.77 3.33 1.16 6.746 1.16 10.163s-.39 6.834-1.16 10.163c-.738 3.186-1.824 6.29-3.237 9.24-1.404 2.934-3.132 5.712-5.14 8.27-1.062 1.355-2.204 2.642-3.41 3.87C428.037 357.9 357.9 428.037 287.543 497.95c-.822.807-1.668 1.587-2.547 2.33-1.86 1.58-3.85 3.005-5.942 4.26-4.38 2.623-9.207 4.482-14.213 5.482-1.763.353-3.548.6-5.342.74-.806.062-1.613.1-2.42.122-.36.007-.72.012-1.078.013zm0-30c.874-.003 1.746-.076 2.608-.227 1.71-.3 3.368-.9 4.87-1.773 1.09-.635 2.087-1.41 2.986-2.294 70.29-69.85 140.81-139.476 210.21-210.21.425-.44.827-.9 1.198-1.386.665-.87 1.233-1.813 1.688-2.81.81-1.773 1.257-3.706 1.327-5.654.082-2.31-.367-4.637-1.327-6.74-.455-.997-1.023-1.94-1.688-2.81-.37-.486-.773-.947-1.2-1.386-69.42-70.758-139.523-140.856-210.28-210.28-.438-.426-.9-.828-1.385-1.2-.87-.664-1.813-1.232-2.81-1.686-1.773-.81-3.706-1.257-5.654-1.327-2.31-.082-4.637.367-6.74 1.328-.97.442-1.886.99-2.735 1.63-.514.388-1 .81-1.46 1.257C174.85 104.75 104.75 174.85 35.327 245.607c-.45.462-.87.947-1.257 1.46-.64.85-1.188 1.767-1.63 2.735-.96 2.104-1.41 4.43-1.327 6.74.07 1.95.518 3.882 1.328 5.656.455.996 1.023 1.94 1.688 2.81.37.485.773.946 1.2 1.385 69.423 70.756 139.52 140.858 210.28 210.28.88.854 1.853 1.606 2.914 2.224 1.397.813 2.93 1.39 4.515 1.707.887.177 1.787.27 2.69.29l.273.002z\" fill-rule=\"nonzero\"/><path d=\"M279.612 430.108l-13.5 13.5c-2.682 2.682-6.32 4.188-10.112 4.188-3.793 0-7.43-1.506-10.112-4.188L68.392 266.112c-2.682-2.682-4.188-6.32-4.188-10.112 0-3.793 1.506-7.43 4.188-10.112L245.888 68.392c2.682-2.682 6.32-4.188 10.112-4.188 3.793 0 7.43 1.506 10.112 4.188l64.505 64.506v86.943c-1.64.454-3.25 1.02-4.812 1.693-4.292 1.847-8.226 4.504-11.55 7.788-3.158 3.122-5.757 6.802-7.637 10.825-1.637 3.502-2.723 7.256-3.21 11.09-.502 3.938-.378 7.956.37 11.854.65 3.397 1.778 6.7 3.337 9.788 1.965 3.893 4.613 7.434 7.787 10.425 3.07 2.893 6.63 5.265 10.484 6.98 3.178 1.416 6.553 2.382 10 2.865 1.733.243 3.48.358 5.23.363.323 0 .644-.004.965-.01 1.744-.05 3.48-.21 5.202-.495 3.422-.568 6.762-1.615 9.896-3.102 3.875-1.84 7.427-4.35 10.46-7.382 3.033-3.033 5.542-6.584 7.382-10.46 1.52-3.204 2.582-6.625 3.14-10.128.613-3.844.625-7.784.036-11.632-.582-3.81-1.76-7.525-3.475-10.976-1.975-3.972-4.66-7.585-7.888-10.627-3.405-3.208-7.406-5.772-11.747-7.516-1.296-.52-2.622-.967-3.968-1.34V152.9l92.99 92.99c2.683 2.682 4.19 6.32 4.19 10.112 0 3.793-1.507 7.43-4.19 10.112L337.84 371.88 266 300.04V196.347c2.08-.575 4.11-1.33 6.06-2.256 3.876-1.838 7.427-4.347 10.46-7.38 2.98-2.98 5.455-6.46 7.285-10.256 1.54-3.193 2.62-6.604 3.2-10.1.65-3.918.675-7.94.074-11.865-.584-3.81-1.76-7.526-3.476-10.977-1.975-3.972-4.66-7.585-7.89-10.627-3.404-3.208-7.406-5.773-11.747-7.517-2.293-.922-4.678-1.614-7.11-2.065-2.417-.448-4.88-.656-7.34-.625-2.372.03-4.74.284-7.066.76-2.49.51-4.927 1.276-7.262 2.28-4.292 1.85-8.226 4.506-11.55 7.79-3.158 3.12-5.758 6.8-7.638 10.824-1.636 3.502-2.722 7.256-3.21 11.09-.5 3.937-.378 7.955.37 11.854.652 3.397 1.78 6.7 3.338 9.79 1.93 3.825 4.522 7.312 7.624 10.27 3.108 2.962 6.723 5.388 10.647 7.134 1.693.755 3.443 1.38 5.23 1.875v107.835c.034.774.017.972.152 1.736.253 1.434.822 2.807 1.656 4 .446.636.598.764 1.12 1.335l74.77 74.77-29.944 29.943L182.85 305.06v-12.9c2.08-.576 4.11-1.332 6.06-2.257 3.875-1.84 7.426-4.35 10.46-7.382 3.033-3.033 5.542-6.584 7.382-10.46 1.52-3.204 2.58-6.625 3.14-10.128.612-3.844.625-7.783.036-11.63-.583-3.81-1.76-7.526-3.475-10.977-1.975-3.973-4.66-7.586-7.89-10.628-3.404-3.208-7.406-5.772-11.747-7.516-2.293-.92-4.678-1.613-7.11-2.063-2.417-.448-4.88-.657-7.34-.625-2.45.03-4.897.3-7.295.807-2.41.51-4.77 1.258-7.034 2.233-4.29 1.847-8.226 4.504-11.55 7.788-3.157 3.122-5.757 6.802-7.637 10.826-1.637 3.502-2.723 7.255-3.21 11.09-.503 3.937-.38 7.954.37 11.853.68 3.545 1.877 6.99 3.544 10.193 1.977 3.8 4.608 7.255 7.744 10.174 3.033 2.824 6.533 5.142 10.32 6.827 1.694.754 3.444 1.38 5.23 1.875V309.2c.023.634.012.795.103 1.424.204 1.414.714 2.78 1.486 3.983.258.4.543.78.855 1.14.157.18.326.35.488.523l113.834 113.835zM172.85 273.51c.894 0 1.788-.065 2.674-.2 1.524-.234 3.015-.67 4.424-1.298 1.64-.73 3.167-1.717 4.51-2.91 1.45-1.285 2.684-2.807 3.64-4.49.824-1.454 1.438-3.025 1.814-4.653.468-2.027.57-4.137.307-6.2-.223-1.744-.712-3.453-1.447-5.052-.883-1.92-2.117-3.676-3.62-5.16-1.554-1.537-3.393-2.78-5.4-3.645-2.105-.906-4.384-1.384-6.675-1.413-2.303-.03-4.604.39-6.74 1.25-1.997.8-3.838 1.976-5.412 3.442-1.547 1.44-2.832 3.156-3.773 5.048-.78 1.57-1.32 3.256-1.596 4.987-.328 2.054-.29 4.17.115 6.21.32 1.61.868 3.17 1.625 4.626.845 1.624 1.946 3.113 3.248 4.4 1.378 1.36 2.98 2.495 4.724 3.336 1.415.682 2.923 1.17 4.47 1.447.877.157 1.764.243 2.653.27.152.002.304.004.456.004zm167.767 0c.896 0 1.79-.065 2.675-.2 1.524-.234 3.016-.67 4.424-1.298 1.706-.76 3.287-1.795 4.67-3.05 1.38-1.256 2.56-2.73 3.48-4.35.807-1.423 1.412-2.958 1.79-4.548.49-2.058.598-4.206.33-6.304-.22-1.745-.71-3.454-1.444-5.052-.883-1.92-2.118-3.676-3.62-5.16-1.555-1.537-3.394-2.78-5.4-3.645-2.106-.906-4.385-1.384-6.676-1.413-2.302-.03-4.603.39-6.74 1.25-1.996.8-3.838 1.976-5.412 3.442-1.546 1.44-2.832 3.156-3.772 5.048-.78 1.57-1.32 3.256-1.597 4.987-.327 2.054-.29 4.17.115 6.21.333 1.68.917 3.306 1.724 4.814.898 1.676 2.07 3.203 3.454 4.506 1.307 1.232 2.802 2.263 4.42 3.043 1.416.682 2.924 1.17 4.472 1.447.876.157 1.762.243 2.652.27.152.002.303.004.455.004zM256 177.7c.896-.003 1.79-.067 2.676-.202 1.523-.233 3.015-.67 4.423-1.297 1.64-.73 3.167-1.717 4.51-2.91 1.448-1.284 2.684-2.807 3.64-4.49.805-1.422 1.41-2.957 1.788-4.548.49-2.057.6-4.205.332-6.303-.222-1.746-.71-3.455-1.445-5.054-.883-1.92-2.118-3.675-3.62-5.16-1.555-1.536-3.393-2.78-5.4-3.644-2.106-.907-4.385-1.384-6.677-1.413-2.302-.03-4.603.39-6.74 1.248-1.996.802-3.837 1.977-5.41 3.443-1.547 1.44-2.833 3.156-3.774 5.048-.78 1.57-1.32 3.256-1.596 4.987-.328 2.055-.29 4.17.115 6.212.333 1.678.916 3.304 1.724 4.812.914 1.706 2.113 3.258 3.53 4.577 1.29 1.2 2.757 2.206 4.343 2.97 1.45.7 2.995 1.195 4.58 1.468.842.145 1.692.225 2.544.25l.456.005z\"/></symbol></svg>')\n }\n }\n\n // If DOM is already ready, embed SVGs\n if (document.readyState == 'interactive') { embed() }\n\n // Handle Turbolinks page change events\n if ( window.Turbolinks ) {\n document.addEventListener(\"turbolinks:load\", function(event) { embed() })\n }\n\n // Handle standard DOM ready events\n document.addEventListener(\"DOMContentLoaded\", function(event) { embed() })\n})()","var event = require( 'compose-toolbox' ).event\n\n// Public API function\nvar clipboard = function() {\n\n // Listen for click events\n event.on( document, 'click', '[data-copy-target]', copy )\n\n // Copy to clipboard handler\n function copy( event ) {\n\n console.log( event )\n\n // Assignment\n var copyTrigger = event.currentTarget,\n copyElement = document.querySelector( copyTrigger.dataset.copyTarget )\n\n // Prevent default behavior\n event.preventDefault()\n\n // Is the element selectable?\n if ( copyElement && copyElement.select ) {\n\n // Select text\n copyElement.select();\n\n // Give it a try\n try {\n\n // Copy text\n document.execCommand( 'copy' )\n\n // Blur the element\n copyElement.blur()\n\n // Trigger copied state\n copyTrigger.classList.add( 'copied' )\n\n // Remove copied state after a couple seconds\n setTimeout( function() {\n copyTrigger.classList.remove( 'copied' )\n }, 2000 )\n\n // If it borks\n } catch ( err ) {\n\n // Go nuclear\n alert( 'please press Ctrl/Cmd+C to copy' )\n\n }\n\n }\n\n }\n}\n\nmodule.exports = clipboard\n","var Event = require('compose-event')\nvar Notify = require('./notify')\n\n// If a page has an element .form-flash, trigger a notification\n//\nEvent.change(function(){\n var flash = document.querySelector('.flash-message')\n if (flash) {\n flash.classList.add('hidden')\n var type = flash.dataset.type || 'error'\n Notify(type, flash.textContent.trim())\n }\n})\n\n","var Event = require( 'compose-event' )\n\nvar defaultsByType = {\n normal: { dismissAfter: 2500 },\n success: { dismissAfter: 2500 },\n}\n\n\nvar autoDismissTimeout,\n messageEl,\n template = '\\\n<div class=\"notification\">\\\n <div class=\"notification-content\">\\\n <div class=\"notification-message\" role=\"alert\"></div>\\\n <button class=\"notification-close\" href=\"#\" role=\"button\" aria-label=\"close message\">\\\n <span class=\"close-icon\" aria-hidden=\"true\"></span>\\\n </button>\\\n </div>\\\n</div>\\\n'\n\nfunction notify (type, message) {\n if ( !message ) {\n message = type\n type = 'normal'\n }\n\n return show( type, message )\n}\n\nfunction show ( type, message ) {\n clearTimeout( autoDismissTimeout )\n if ( messageEl ) return dismiss( function(){ show( type, message ) })\n\n document.body.insertAdjacentHTML( 'beforeend', template )\n messageEl = document.body.lastChild\n\n messageEl.querySelector( '.notification-message' ).innerHTML = message\n\n if ( type ) {\n\n messageEl.classList.add( type )\n var defaults = defaultsByType[ type ]\n\n if ( defaults && defaults.dismissAfter ){\n autoDismissTimeout = window.setTimeout( dismiss, defaults.dismissAfter )\n }\n }\n\n messageEl = document.body.lastChild\n\n Event.keyOne( 'esc', dismiss )\n Event.one( messageEl, 'click', '.notification-close', dismiss )\n\n return {\n dismiss: dismiss\n }\n}\n\nfunction dismiss ( callback ) {\n clearTimeout( autoDismissTimeout )\n\n var cb\n\n if ( typeof callback == 'function' ) {\n cb = function() { remove(); callback() }\n } else {\n cb = remove;\n }\n\n var timeout = window.setTimeout( cb, 500 )\n\n Event.one( messageEl, 'animationstart', function() {\n clearTimeout( timeout )\n\n Event.afterAnimation( messageEl, cb )\n })\n\n messageEl.classList.add( 'dismiss' )\n}\n\nfunction remove () {\n messageEl = document.querySelector('body > .notification')\n\n if (messageEl) {\n messageEl.parentNode.removeChild( messageEl )\n }\n messageEl = null\n}\n\nmodule.exports = notify\n","var toolbox = require( 'compose-toolbox' )\n\nfunction autoSizeTextarea( textarea ) {\n var parent = textarea.parentElement\n\n if ( textarea.value == '' ) return\n if ( parent.classList.contains('input-wrapper') ) {\n\n parent.style.height = textarea.style.height\n var offset = textarea.offsetHeight - textarea.clientHeight\n textarea.style.height = 'auto'\n var newHeight = ( textarea.scrollHeight + offset )\n var maxHeight = window.innerHeight * .95\n\n if ( newHeight < maxHeight )\n textarea.style.height = newHeight + 'px'\n else\n textarea.style.height = maxHeight + 'px'\n\n parent.style.height = 'auto'\n }\n}\n\ntoolbox.event.change(function(){\n var textareas = document.querySelectorAll('textarea')\n toolbox.event.delay( function(){ Array.prototype.forEach.call(textareas, autoSizeTextarea) } )\n})\n\ntoolbox.event.on(document, 'keyup toggler:show', 'textarea', function(event){\n autoSizeTextarea(event.currentTarget)\n})\n\n\ntoolbox.event.change(function(){\n Array.prototype.forEach.call(document.querySelectorAll('[data-match-url]'), function(node){\n var matcher = node.getAttribute('data-match-url')\n if (matcher && new RegExp(node.dataset.matchUrl, \"i\").test(location.pathname)) {\n node.classList.add('here')\n }\n })\n})\n","var toggler = require( 'compose-toggler' )\nvar formUp = require( 'compose-form-up' )\nvar toolbox = require( 'compose-toolbox' )\nvar ajax = require( 'superagent' )\nvar event = toolbox.event\nvar clipboard = require( './enhancements/clipboard' )\nvar notify = require( './enhancements/notify' )\n\nevent.scroll.disablePointer() // disable pointer events on scroll for performance (to avoid extra repaints)\nclipboard();\n\nrequire( 'compose-slider' ) // Our slider (range input) component\nrequire( './_icons' ) // Import svg icons (from Esvg)\nrequire( './_form-helpers' )\nrequire( './enhancements/flash-messages' )\nrequire( './enhancements/text-helpers' )\n\n// Public API object\nwindow.Tungsten = module.exports = toolbox.merge( {\n ajax : ajax,\n form : formUp,\n toggler : toggler,\n clipboard : clipboard,\n notify : notify\n}, toolbox )\n","/*!\n * Bean - copyright (c) Jacob Thornton 2011-2012\n * https://github.com/fat/bean\n * MIT license\n */\n(function (name, context, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(definition)\n else context[name] = definition()\n})('bean', this, function (name, context) {\n name = name || 'bean'\n context = context || this\n\n var win = window\n , old = context[name]\n , namespaceRegex = /[^\\.]*(?=\\..*)\\.|.*/\n , nameRegex = /\\..*/\n , addEvent = 'addEventListener'\n , removeEvent = 'removeEventListener'\n , doc = document || {}\n , root = doc.documentElement || {}\n , W3C_MODEL = root[addEvent]\n , eventSupport = W3C_MODEL ? addEvent : 'attachEvent'\n , ONE = {} // singleton for quick matching making add() do one()\n\n , slice = Array.prototype.slice\n , str2arr = function (s, d) { return s.split(d || ' ') }\n , isString = function (o) { return typeof o == 'string' }\n , isFunction = function (o) { return typeof o == 'function' }\n , isObject = function (o) { return typeof o == 'object' }\n\n // Try to build an options object. If any key in `maybeOptions`\n // matches a key in `defaults`, it will be copied into a clone\n // of `defaults`, thus overriding the default.\n , buildOptions = function (originalDefaults, maybeOptions) {\n var defaults = {}\n\n for (var key in originalDefaults) {\n if (originalDefaults.hasOwnProperty(key)) {\n defaults[key] = originalDefaults[key];\n }\n }\n\n if (!isObject(maybeOptions)) {\n return defaults;\n }\n\n for (key in defaults) {\n if (defaults.hasOwnProperty(key) && maybeOptions.hasOwnProperty(key)) {\n defaults[key] = maybeOptions[key]\n }\n }\n\n return defaults\n }\n\n // events that we consider to be 'native', anything not in this list will\n // be treated as a custom event\n , standardNativeEvents =\n 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons\n 'mousewheel mousemultiwheel DOMMouseScroll ' + // mouse wheel\n 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement\n 'keydown keypress keyup ' + // keyboard\n 'orientationchange ' + // mobile\n 'focus blur change reset select submit ' + // form elements\n 'load unload beforeunload resize move DOMContentLoaded ' + // window\n 'readystatechange message ' + // window\n 'error abort scroll ' // misc\n // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event\n // that doesn't actually exist, so make sure we only do these on newer browsers\n , w3cNativeEvents =\n 'show ' + // mouse buttons\n 'input invalid ' + // form elements\n 'touchstart touchmove touchend touchcancel ' + // touch\n 'gesturestart gesturechange gestureend ' + // gesture\n 'textinput ' + // TextEvent\n 'readystatechange pageshow pagehide popstate ' + // window\n 'hashchange offline online ' + // window\n 'afterprint beforeprint ' + // printing\n 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd\n 'loadstart progress suspend emptied stalled loadmetadata ' + // media\n 'loadeddata canplay canplaythrough playing waiting seeking ' + // media\n 'seeked ended durationchange timeupdate play pause ratechange ' + // media\n 'volumechange cuechange ' + // media\n 'checking noupdate downloading cached updateready obsolete ' // appcache\n\n // convert to a hash for quick lookups\n , nativeEvents = (function (hash, events, i) {\n for (i = 0; i < events.length; i++) events[i] && (hash[events[i]] = 1)\n return hash\n }({}, str2arr(standardNativeEvents + (W3C_MODEL ? w3cNativeEvents : ''))))\n\n // custom events are events that we *fake*, they are not provided natively but\n // we can use native events to generate them\n , customEvents = (function () {\n var isAncestor = 'compareDocumentPosition' in root\n ? function (element, container) {\n return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16\n }\n : 'contains' in root\n ? function (element, container) {\n container = container.nodeType === 9 || container === window ? root : container\n return container !== element && container.contains(element)\n }\n : function (element, container) {\n while (element = element.parentNode) if (element === container) return 1\n return 0\n }\n , check = function (event) {\n var related = event.relatedTarget\n return !related\n ? related == null\n : (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString())\n && !isAncestor(related, this))\n }\n\n return {\n mouseenter: { base: 'mouseover', condition: check }\n , mouseleave: { base: 'mouseout', condition: check }\n , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' }\n }\n }())\n\n // we provide a consistent Event object across browsers by taking the actual DOM\n // event object and generating a new one from its properties.\n , Event = (function () {\n // a whitelist of properties (for different event types) tells us what to check for and copy\n var commonProps = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' +\n 'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey ' +\n 'srcElement target timeStamp type view which propertyName path')\n , mouseProps = commonProps.concat(str2arr('button buttons clientX clientY dataTransfer ' +\n 'fromElement offsetX offsetY pageX pageY screenX screenY toElement movementX movementY region'))\n , mouseWheelProps = mouseProps.concat(str2arr('wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ ' +\n 'axis')) // 'axis' is FF specific\n , keyProps = commonProps.concat(str2arr('char charCode key keyCode keyIdentifier ' +\n 'keyLocation location isComposing code'))\n , textProps = commonProps.concat(str2arr('data'))\n , touchProps = commonProps.concat(str2arr('touches targetTouches changedTouches scale rotation'))\n , messageProps = commonProps.concat(str2arr('data origin source'))\n , stateProps = commonProps.concat(str2arr('state'))\n , overOutRegex = /over|out/\n // some event types need special handling and some need special properties, do that all here\n , typeFixers = [\n { // key events\n reg: /key/i\n , fix: function (event, newEvent) {\n newEvent.keyCode = event.keyCode || event.which\n return keyProps\n }\n }\n , { // mouse events\n reg: /click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i\n , fix: function (event, newEvent, type) {\n newEvent.rightClick = event.which === 3 || event.button === 2\n newEvent.pos = { x: 0, y: 0 }\n if (event.pageX || event.pageY) {\n newEvent.clientX = event.pageX\n newEvent.clientY = event.pageY\n } else if (event.clientX || event.clientY) {\n newEvent.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft\n newEvent.clientY = event.clientY + doc.body.scrollTop + root.scrollTop\n }\n if (overOutRegex.test(type)) {\n newEvent.relatedTarget = event.relatedTarget\n || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']\n }\n return mouseProps\n }\n }\n , { // mouse wheel events\n reg: /mouse.*(wheel|scroll)/i\n , fix: function () { return mouseWheelProps }\n }\n , { // TextEvent\n reg: /^text/i\n , fix: function () { return textProps }\n }\n , { // touch and gesture events\n reg: /^touch|^gesture/i\n , fix: function () { return touchProps }\n }\n , { // message events\n reg: /^message$/i\n , fix: function () { return messageProps }\n }\n , { // popstate events\n reg: /^popstate$/i\n , fix: function () { return stateProps }\n }\n , { // everything else\n reg: /.*/\n , fix: function () { return commonProps }\n }\n ]\n , typeFixerMap = {} // used to map event types to fixer functions (above), a basic cache mechanism\n\n , Event = function (event, element, isNative) {\n if (!arguments.length) return\n event = event || ((element.ownerDocument || element.document || element).parentWindow || win).event\n this.originalEvent = event\n this.isNative = isNative\n this.isBean = true\n\n if (!event) return\n\n var type = event.type\n , target = event.target || event.srcElement\n , i, l, p, props, fixer\n\n this.target = target && target.nodeType === 3 ? target.parentNode : target\n\n if (isNative) { // we only need basic augmentation on custom events, the rest expensive & pointless\n fixer = typeFixerMap[type]\n if (!fixer) { // haven't encountered this event type before, map a fixer function for it\n for (i = 0, l = typeFixers.length; i < l; i++) {\n if (typeFixers[i].reg.test(type)) { // guaranteed to match at least one, last is .*\n typeFixerMap[type] = fixer = typeFixers[i].fix\n break\n }\n }\n }\n\n props = fixer(event, this, type)\n for (i = props.length; i--;) {\n if (!((p = props[i]) in this) && p in event) this[p] = event[p]\n }\n }\n }\n\n // preventDefault() and stopPropagation() are a consistent interface to those functions\n // on the DOM, stop() is an alias for both of them together\n Event.prototype.preventDefault = function () {\n if (this.originalEvent.preventDefault) this.originalEvent.preventDefault()\n else this.originalEvent.returnValue = false\n }\n Event.prototype.stopPropagation = function () {\n if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation()\n else this.originalEvent.cancelBubble = true\n }\n Event.prototype.stop = function () {\n this.preventDefault()\n this.stopPropagation()\n this.stopped = true\n }\n // stopImmediatePropagation() has to be handled internally because we manage the event list for\n // each element\n // note that originalElement may be a Bean#Event object in some situations\n Event.prototype.stopImmediatePropagation = function () {\n if (this.originalEvent.stopImmediatePropagation) this.originalEvent.stopImmediatePropagation()\n this.isImmediatePropagationStopped = function () { return true }\n }\n Event.prototype.isImmediatePropagationStopped = function () {\n return this.originalEvent.isImmediatePropagationStopped && this.originalEvent.isImmediatePropagationStopped()\n }\n Event.prototype.clone = function (currentTarget) {\n //TODO: this is ripe for optimisation, new events are *expensive*\n // improving this will speed up delegated events\n var ne = new Event(this, this.element, this.isNative)\n ne.currentTarget = currentTarget\n return ne\n }\n\n return Event\n }())\n\n // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both\n , targetElement = function (element, isNative) {\n return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element\n }\n\n /**\n * Bean maintains an internal registry for event listeners. We don't touch elements, objects\n * or functions to identify them, instead we store everything in the registry.\n * Each event listener has a RegEntry object, we have one 'registry' for the whole instance.\n */\n , RegEntry = (function () {\n // each handler is wrapped so we can handle delegation and custom events\n var wrappedHandler = function (element, fn, condition, args) {\n var call = function (event, eargs) {\n return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs)\n }\n , findTarget = function (event, eventElement) {\n return fn.__beanDel ? fn.__beanDel.ft(event.target, element) : eventElement\n }\n , handler = condition\n ? function (event) {\n var target = findTarget(event, this) // deleated event\n if (condition.apply(target, arguments)) {\n if (event) event.currentTarget = target\n return call(event, arguments)\n }\n }\n : function (event) {\n if (fn.__beanDel) event = event.clone(findTarget(event)) // delegated event, fix the fix\n return call(event, arguments)\n }\n handler.__beanDel = fn.__beanDel\n return handler\n }\n\n , RegEntry = function (element, type, handler, original, namespaces, args, root) {\n var customType = customEvents[type]\n , isNative\n\n if (type == 'unload') {\n // self clean-up\n handler = once(removeListener, element, type, handler, original)\n }\n\n if (customType) {\n if (customType.condition) {\n handler = wrappedHandler(element, handler, customType.condition, args)\n }\n type = customType.base || type\n }\n\n this.isNative = isNative = nativeEvents[type] && !!element[eventSupport]\n this.customType = !W3C_MODEL && !isNative && type\n this.element = element\n this.type = type\n this.original = original\n this.namespaces = namespaces\n this.eventType = W3C_MODEL || isNative ? type : 'propertychange'\n this.target = targetElement(element, isNative)\n this[eventSupport] = !!this.target[eventSupport]\n this.root = root\n this.handler = wrappedHandler(element, handler, null, args)\n }\n\n // given a list of namespaces, is our entry in any of them?\n RegEntry.prototype.inNamespaces = function (checkNamespaces) {\n var i, j, c = 0\n if (!checkNamespaces) return true\n if (!this.namespaces) return false\n for (i = checkNamespaces.length; i--;) {\n for (j = this.namespaces.length; j--;) {\n if (checkNamespaces[i] == this.namespaces[j]) c++\n }\n }\n return checkNamespaces.length === c\n }\n\n // match by element, original fn (opt), handler fn (opt)\n RegEntry.prototype.matches = function (checkElement, checkOriginal, checkHandler) {\n return this.element === checkElement &&\n (!checkOriginal || this.original === checkOriginal) &&\n (!checkHandler || this.handler === checkHandler)\n }\n\n return RegEntry\n }())\n\n , registry = (function () {\n // our map stores arrays by event type, just because it's better than storing\n // everything in a single array.\n // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for\n // rootListeners so we can look them up fast\n var map = {}\n\n // generic functional search of our registry for matching listeners,\n // `fn` returns false to break out of the loop\n , forAll = function (element, type, original, handler, root, fn) {\n var pfx = root ? 'r' : '$'\n if (!type || type == '*') {\n // search the whole registry\n for (var t in map) {\n if (t.charAt(0) == pfx) {\n forAll(element, t.substr(1), original, handler, root, fn)\n }\n }\n } else {\n var i = 0, l, list = map[pfx + type], all = element == '*'\n if (!list) return\n for (l = list.length; i < l; i++) {\n if ((all || list[i].matches(element, original, handler)) && !fn(list[i], list, i, type)) return\n }\n }\n }\n\n , has = function (element, type, original, root) {\n // we're not using forAll here simply because it's a bit slower and this\n // needs to be fast\n var i, list = map[(root ? 'r' : '$') + type]\n if (list) {\n for (i = list.length; i--;) {\n if (!list[i].root && list[i].matches(element, original, null)) return true\n }\n }\n return false\n }\n\n , get = function (element, type, original, root) {\n var entries = []\n forAll(element, type, original, null, root, function (entry) {\n return entries.push(entry)\n })\n return entries\n }\n\n , put = function (entry) {\n var has = !entry.root && !this.has(entry.element, entry.type, null, false)\n , key = (entry.root ? 'r' : '$') + entry.type\n ;(map[key] || (map[key] = [])).push(entry)\n return has\n }\n\n , del = function (entry) {\n forAll(entry.element, entry.type, null, entry.handler, entry.root, function (entry, list, i) {\n list.splice(i, 1)\n entry.removed = true\n if (list.length === 0) delete map[(entry.root ? 'r' : '$') + entry.type]\n return false\n })\n }\n\n // dump all entries, used for onunload\n , entries = function () {\n var t, entries = []\n for (t in map) {\n if (t.charAt(0) == '$') entries = entries.concat(map[t])\n }\n return entries\n }\n\n return { has: has, get: get, put: put, del: del, entries: entries }\n }())\n\n // we need a selector engine for delegated events, use querySelectorAll if it exists\n // but for older browsers we need Qwery, Sizzle or similar\n , selectorEngine\n , setSelectorEngine = function (e) {\n if (!arguments.length) {\n selectorEngine = doc.querySelectorAll\n ? function (s, r) {\n return r.querySelectorAll(s)\n }\n : function () {\n throw new Error('Bean: No selector engine installed') // eeek\n }\n } else {\n selectorEngine = e\n }\n }\n\n // we attach this listener to each DOM event that we need to listen to, only once\n // per event type per DOM element\n , rootListener = function (event, type) {\n if (!W3C_MODEL && type && event && event.propertyName != '_on' + type) return\n\n var listeners = registry.get(this, type || event.type, null, false)\n , l = listeners.length\n , i = 0\n\n event = new Event(event, this, true)\n if (type) event.type = type\n\n // iterate through all handlers registered for this type, calling them unless they have\n // been removed by a previous handler or stopImmediatePropagation() has been called\n for (; i < l && !event.isImmediatePropagationStopped(); i++) {\n if (!listeners[i].removed) listeners[i].handler.call(this, event)\n }\n }\n\n // add and remove listeners to DOM elements\n , listener = W3C_MODEL\n ? function (element, type, add, custom, useCapture) {\n // new browsers\n element[add ? addEvent : removeEvent](type, rootListener, useCapture)\n }\n : function (element, type, add, custom /*, useCapture */) {\n // IE8 and below, use attachEvent/detachEvent and we have to piggy-back propertychange events\n // to simulate event bubbling etc.\n var entry\n if (add) {\n registry.put(entry = new RegEntry(\n element\n , custom || type\n , function (event) { // handler\n rootListener.call(element, event, custom)\n }\n , rootListener\n , null\n , null\n , true // is root\n ))\n if (custom && element['_on' + custom] == null) element['_on' + custom] = 0\n entry.target.attachEvent('on' + entry.eventType, entry.handler)\n } else {\n entry = registry.get(element, custom || type, rootListener, true)[0]\n if (entry) {\n entry.target.detachEvent('on' + entry.eventType, entry.handler)\n registry.del(entry)\n }\n }\n }\n\n , once = function (rm, element, type, fn, originalFn) {\n // wrap the handler in a handler that does a remove as well\n return function () {\n fn.apply(this, arguments)\n rm(element, type, originalFn)\n }\n }\n\n , removeListener = function (element, orgType, handler, namespaces, useCapture) {\n var type = orgType && orgType.replace(nameRegex, '')\n , handlers = registry.get(element, type, null, false)\n , removed = {}\n , i, l\n\n for (i = 0, l = handlers.length; i < l; i++) {\n if ((!handler || handlers[i].original === handler) && handlers[i].inNamespaces(namespaces)) {\n // TODO: this is problematic, we have a registry.get() and registry.del() that\n // both do registry searches so we waste cycles doing this. Needs to be rolled into\n // a single registry.forAll(fn) that removes while finding, but the catch is that\n // we'll be splicing the arrays that we're iterating over. Needs extra tests to\n // make sure we don't screw it up. @rvagg\n registry.del(handlers[i])\n if (!removed[handlers[i].eventType] && handlers[i][eventSupport])\n removed[handlers[i].eventType] = { t: handlers[i].eventType, c: handlers[i].type }\n }\n }\n // check each type/element for removed listeners and remove the rootListener where it's no longer needed\n for (i in removed) {\n if (!registry.has(element, removed[i].t, null, false)) {\n // last listener of this type, remove the rootListener\n listener(element, removed[i].t, false, removed[i].c, useCapture)\n }\n }\n }\n\n // set up a delegate helper using the given selector, wrap the handler function\n , delegate = function (selector, fn) {\n //TODO: findTarget (therefore $) is called twice, once for match and once for\n // setting e.currentTarget, fix this so it's only needed once\n var findTarget = function (target, root) {\n var i, array = isString(selector) ? selectorEngine(selector, root) : selector\n for (; target && target !== root; target = target.parentNode) {\n for (i = array.length; i--;) {\n if (array[i] === target) return target\n }\n }\n }\n , handler = function (e) {\n var match = findTarget(e.target, this)\n if (match) fn.apply(match, arguments)\n }\n\n // __beanDel isn't pleasant but it's a private function, not exposed outside of Bean\n handler.__beanDel = {\n ft : findTarget // attach it here for customEvents to use too\n , selector : selector\n }\n return handler\n }\n\n , fireListener = W3C_MODEL ? function (isNative, type, element) {\n // modern browsers, do a proper dispatchEvent()\n var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents')\n evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1)\n element.dispatchEvent(evt)\n } : function (isNative, type, element) {\n // old browser use onpropertychange, just increment a custom property to trigger the event\n element = targetElement(element, isNative)\n isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++\n }\n\n /**\n * Public API: off(), on(), add(), (remove()), one(), fire(), clone()\n */\n\n /**\n * off(element[, eventType(s)[, handler ], options])\n */\n , off = function (element, typeSpec, fn) {\n var isTypeStr = isString(typeSpec),\n defaultOpts = {\n useCapture: false\n }\n , opts = buildOptions(defaultOpts, arguments[arguments.length - 1])\n , k, type, namespaces, i\n\n if (isTypeStr && typeSpec.indexOf(' ') > 0) {\n // off(el, 't1 t2 t3', fn) or off(el, 't1 t2 t3')\n typeSpec = str2arr(typeSpec)\n for (i = typeSpec.length; i--;)\n off(element, typeSpec[i], fn)\n return element\n }\n\n type = isTypeStr && typeSpec.replace(nameRegex, '')\n if (type && customEvents[type]) type = customEvents[type].base\n\n if (!typeSpec || isTypeStr) {\n // off(el) or off(el, t1.ns) or off(el, .ns) or off(el, .ns1.ns2.ns3)\n if (namespaces = isTypeStr && typeSpec.replace(namespaceRegex, '')) namespaces = str2arr(namespaces, '.')\n removeListener(element, type, fn, namespaces, opts.useCapture)\n } else if (isFunction(typeSpec)) {\n // off(el, fn)\n removeListener(element, null, typeSpec, null, opts.useCapture)\n } else {\n // off(el, { t1: fn1, t2, fn2 })\n for (k in typeSpec) {\n if (typeSpec.hasOwnProperty(k)) off(element, k, typeSpec[k])\n }\n }\n\n return element\n }\n\n /**\n * on(element, eventType(s)[, selector], handler[, args ], [options])\n */\n , on = function(element, events, selector, fn) {\n var defaultOpts = {\n useCapture: false\n },\n originalFn, type, types, i, args, entry, first, opts\n\n //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps?\n if (selector === undefined && typeof events == 'object') {\n //TODO: this can't handle delegated events\n for (type in events) {\n if (events.hasOwnProperty(type)) {\n on.call(this, element, type, events[type])\n }\n }\n return\n }\n\n if (!isFunction(selector)) {\n // delegated event\n originalFn = fn\n args = slice.call(arguments, 4)\n fn = delegate(selector, originalFn, selectorEngine)\n } else {\n args = slice.call(arguments, 3)\n fn = originalFn = selector\n }\n\n opts = buildOptions(defaultOpts, args[args.length - 1])\n types = str2arr(events)\n\n // special case for one(), wrap in a self-removing handler\n if (this === ONE) {\n fn = once(off, element, events, fn, originalFn)\n }\n\n for (i = types.length; i--;) {\n // add new handler to the registry and check if it's the first for this element/type\n first = registry.put(entry = new RegEntry(\n element\n , types[i].replace(nameRegex, '') // event type\n , fn\n , originalFn\n , str2arr(types[i].replace(namespaceRegex, ''), '.') // namespaces\n , args\n , false // not root\n ))\n if (entry[eventSupport] && first) {\n // first event of this type on this element, add root listener\n listener(element, entry.eventType, true, entry.customType, opts.useCapture)\n }\n }\n\n return element\n }\n\n /**\n * add(element[, selector], eventType(s), handler[, args ])\n *\n * Deprecated: kept (for now) for backward-compatibility\n */\n , add = function (element, events, fn, delfn, options) {\n return on.apply(\n null\n , !isString(fn)\n ? slice.call(arguments)\n : [ element, fn, events, delfn ].concat(arguments.length > 3 ? slice.call(arguments, 4) : [])\n )\n }\n\n /**\n * one(element, eventType(s)[, selector], handler[, args ])\n */\n , one = function () {\n return on.apply(ONE, arguments)\n }\n\n /**\n * fire(element, eventType(s)[, args ])\n *\n * The optional 'args' argument must be an array, if no 'args' argument is provided\n * then we can use the browser's DOM event system, otherwise we trigger handlers manually\n */\n , fire = function (element, type, args) {\n var types = str2arr(type)\n , i, j, l, names, handlers\n\n for (i = types.length; i--;) {\n type = types[i].replace(nameRegex, '')\n if (names = types[i].replace(namespaceRegex, '')) names = str2arr(names, '.')\n if (!names && !args && element[eventSupport]) {\n fireListener(nativeEvents[type], type, element)\n } else {\n // non-native event, either because of a namespace, arguments or a non DOM element\n // iterate over all listeners and manually 'fire'\n handlers = registry.get(element, type, null, false)\n args = [false].concat(args)\n for (j = 0, l = handlers.length; j < l; j++) {\n if (handlers[j].inNamespaces(names)) {\n handlers[j].handler.apply(element, args)\n }\n }\n }\n }\n return element\n }\n\n /**\n * clone(dstElement, srcElement[, eventType ])\n *\n * TODO: perhaps for consistency we should allow the same flexibility in type specifiers?\n */\n , clone = function (element, from, type) {\n var handlers = registry.get(from, type, null, false)\n , l = handlers.length\n , i = 0\n , args, beanDel\n\n for (; i < l; i++) {\n if (handlers[i].original) {\n args = [ element, handlers[i].type ]\n if (beanDel = handlers[i].handler.__beanDel) args.push(beanDel.selector)\n args.push(handlers[i].original)\n on.apply(null, args)\n }\n }\n return element\n }\n\n , bean = {\n 'on' : on\n , 'add' : add\n , 'one' : one\n , 'off' : off\n , 'remove' : off\n , 'clone' : clone\n , 'fire' : fire\n , 'Event' : Event\n , 'setSelectorEngine' : setSelectorEngine\n , 'noConflict' : function () {\n context[name] = old\n return this\n }\n }\n\n // for IE, clean up on unload to avoid leaks\n if (win.attachEvent) {\n var cleanup = function () {\n var i, entries = registry.entries()\n for (i in entries) {\n if (entries[i].type && entries[i].type !== 'unload') off(entries[i].element, entries[i].type)\n }\n win.detachEvent('onunload', cleanup)\n win.CollectGarbage && win.CollectGarbage()\n }\n win.attachEvent('onunload', cleanup)\n }\n\n // initialize selector engine to internal default (qSA or throw Error)\n setSelectorEngine()\n\n return bean\n});\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","require( './lib/shims/custom-event' )\n\nvar bean = require( 'bean' )\nvar key = require( 'keymaster' ) \nvar animationEvent = require( './lib/animation-events' )\nvar page = require( './lib/page' )\nvar tap = require( './lib/tap-events' )\nvar debounce = require( './lib/debounce' )\nvar throttle = require( './lib/throttle' )\nvar delay = require( './lib/delay' )\nvar repeat = require( './lib/repeat' )\nvar bubbleFormEvents = require( './lib/bubble-form-events' )\nvar scroll = require( './lib/scroll' )\nvar resize = require( './lib/resize' )\nvar callbackManager = require( './lib/callback-manager' )\nvar media = require( './lib/media' )\n\nvar slice = Array.prototype.slice\nvar formBubbling = false\n\nmodule.exports = {\n\n // DOM events\n on: on,\n off: off,\n one: one,\n fire: fire,\n clone: bean.clone,\n ready: page.ready,\n change: page.change,\n afterAnimation: afterAnimation,\n\n // Media query events\n media: media,\n\n // Keyboard events\n key: key,\n keyOn: key,\n keyOff: key.unbind,\n keyOne: keyOne,\n\n // Timing utilities\n debounce: debounce,\n throttle: throttle,\n delay: delay,\n repeat: repeat,\n\n // Optimized Event Managers\n scroll: scroll,\n resize: resize,\n\n callbackManager: callbackManager,\n callback: callbackManager.callback,\n\n // Bubbling fix\n bubbleFormEvents: bubbleFormEvents\n}\n\n// Bean doesn't account for cross-browser support on animation events\n// So rather than pass through events to bean, we process them to add\n// vendor prefixes or remove events if browsers do not suppor them\n//\nfunction on () {\n setEvent( 'on', slice.call( arguments ) )\n}\n\nfunction off () {\n setEvent( 'off', slice.call( arguments ) )\n}\n\nfunction one () {\n setEvent( 'one', slice.call( arguments ) )\n}\n\nfunction fire () {\n\n args = slice.call( arguments )\n var el = args[0]\n var events = []\n\n args[1].split(' ').forEach( function( event ) {\n\n var event = animationEvent.transform( event )\n if ( !isEmpty( event ) ) events.push( event )\n\n })\n\n if ( !isEmpty( events ) ) {\n\n args[1] = events.join( ' ' )\n bean.fire.apply( this, args )\n\n }\n}\n\nfunction setEvent( registerType, args ) {\n\n transformArgs( args ).forEach( function( arg ) {\n bean[ registerType ].apply( null, arg )\n })\n\n}\n\n// Add support for unbinding a key event after it is called\n//\nfunction keyOne ( keys, scope, fn ) {\n\n if ( typeof scope == 'function' ) {\n fn = scope\n scope = 'all'\n }\n\n key( keys, scope, function( event ) {\n key.unbind( keys, scope )\n fn( event )\n })\n}\n\nfunction afterAnimation( el, callback ) {\n var hasAnimation = !!window.getComputedStyle( el ).getPropertyValue( 'animation-duration' )\n if ( hasAnimation ) {\n one( el, 'animationend', callback )\n } else {\n callback()\n }\n}\n\n// Transform event arguments to handle tap event and cross-browser animation events\n// Returns an array of events to be registered individually\n//\nfunction transformArgs( args ) {\n\n var transformedArgs = []\n var newEvents = {}\n var element = args.shift() // retrieve element\n var events = args.shift()\n\n // detect event delegate selector\n if ( typeof args[0] != 'function' ) {\n var delegate = args.shift()\n }\n\n // convert event strings to object based events for code simplification\n // example: arguments ('hover focus', function) would become ({ 'hover focus': function })\n if ( typeof events == 'string' ) {\n var objEvents = {}\n objEvents[events] = args.shift()\n events = objEvents\n }\n\n // Walk through each key in the events object and add vendor prefixes to 'animation' events\n // and wrap callback in the tap function for all 'tap' events.\n //\n for ( event in events ) {\n\n if ( events.hasOwnProperty( event ) ) {\n var callback = events[event]\n\n // Events can be registered as space separated groups like \"hover focus\"\n // This handles each event independantly\n //\n event.split(' ').forEach( function( e ){\n\n // If it is an animation event, vendor prefix it, or fire the callback according to browser support\n e = animationEvent.transform( e )\n\n if ( isEmpty( e ) ) {\n // If it's empty, it has been removed since animation events are not supported.\n // In that case, trigger the event immediately\n callback()\n\n } else if ( e.match( /tap/ ) ) {\n\n // If it's a tap event, wrap the callback and set the event to 'touchstart'\n // Tap isn't a real native event, but this wrapper lets us simulate what a\n // native tap event would be.\n //\n newEvents.touchstart = tap( callback )\n } else {\n newEvents[ e ] = callback\n }\n })\n }\n }\n\n for ( event in newEvents ) {\n var a = []\n a.push( element, event )\n\n if ( delegate ) a.push( delegate )\n\n a.push( newEvents[ event ] )\n transformedArgs.push( a.concat( args ) )\n }\n\n return transformedArgs\n}\n\n\nfunction isEmpty( obj ) {\n\n var hasOwnProperty = Object.prototype.hasOwnProperty\n\n if ( obj == null || obj.length === 0 ) return true\n\n if ( 0 < obj.length ) return false\n\n for (var key in obj) {\n if ( hasOwnProperty.call( obj, key ) ) return false\n }\n\n return true;\n}\n","var cssAnimEventTypes = getAnimationEventTypes()\nvar supported = cssAnimEventTypes.animationstart !== undefined\n\nmodule.exports = {\n transform: transformAnimationEvents\n}\n\nfunction camelCaseEventTypes(prefix) {\n prefix = prefix || '';\n\n return {\n animationstart: prefix + 'AnimationStart',\n animationend: prefix + 'AnimationEnd',\n animationiteration: prefix + 'AnimationIteration'\n };\n}\n\nfunction lowerCaseEventTypes(prefix) {\n prefix = prefix || '';\n\n return {\n animationstart: prefix + 'animationstart',\n animationend: prefix + 'animationend',\n animationiteration: prefix + 'animationiteration'\n };\n}\n\n/**\n * @return {Object} Animation event types {animationstart, animationend, animationiteration}\n */\n\nfunction getAnimationEventTypes() {\n var prefixes = ['webkit', 'Moz', 'O', ''];\n var style = document.documentElement.style;\n\n // browser compliant\n if (undefined !== style.animationName) {\n return lowerCaseEventTypes();\n }\n\n for (var i = 0, len = prefixes.length, prefix; i < len; i++) {\n prefix = prefixes[i];\n\n if (undefined !== style[prefix + 'AnimationName']) {\n // Webkit\n if (0 === i) {\n return camelCaseEventTypes(prefix.toLowerCase());\n }\n // Mozilla\n else if (1 === i) {\n return lowerCaseEventTypes();\n }\n // Opera\n else if (2 === i) {\n return lowerCaseEventTypes(prefix.toLowerCase());\n }\n }\n }\n\n return {};\n}\n\n\n// Adds necessary add vendor prefixes or camelCased event names\n//\nfunction transformAnimationEvents (event) {\n if (!event.match(/animation/i)) {\n return event\n } else {\n if (cssAnimEventTypes[event]) {\n return cssAnimEventTypes[event]\n } else {\n if(window.env != 'test') {\n console.error('\"' + event + '\" is not a supported animation event')\n }\n return ''\n }\n }\n}\n","var Event = require( 'bean' ),\n page = require( './page' ),\n formEls;\n\nvar formBubbling = false\n\nvar fireBubble = function ( event ) {\n if ( event.detail && event.detail.triggered ) { return false }\n\n var ev = new CustomEvent( event.type, { bubbles: true, cancelable: true, detail: { triggered: true } } )\n\n event.stopPropagation()\n event.target.dispatchEvent( ev ) \n\n // Prevent default on original event if custom event is prevented\n if ( ev.defaultPrevented ) event.preventDefault() \n}\n\n// Simplify setting the event type based on the element\nvar eventType = function ( el ) {\n return ( el.tagName == 'FORM' ) ? 'submit' : 'focus blur'\n}\n\n// Add event listeners\nvar bubbleOn = function ( el ) {\n Event.on( el, eventType( el ), fireBubble )\n}\n\n// Remove event listeners\nvar bubbleOff = function ( el ) {\n Event.off( el, eventType( el ), fireBubble )\n}\n\n// Add/Remove event listeners\nvar bubbleFormEvents = function () {\n if ( formBubbling ) { return } \n page.change( function() {\n\n // Remove listeners from previous page\n if ( formEls ) Array.prototype.forEach.call( formEls, bubbleOff )\n\n // Add new listeners to this page\n formEls = document.querySelectorAll( 'form, input' )\n\n Array.prototype.forEach.call( formEls, bubbleOn )\n })\n\n var formBubbling = true\n}\n\nmodule.exports = bubbleFormEvents\n","var Manager = {\n new: function() {\n var manager = {\n\n callbacks: [],\n\n add: function( fn ) {\n\n var cb = Manager.callback.new( fn )\n manager.callbacks.push( cb )\n \n return cb\n\n },\n\n stop: function() {\n manager.callbacks.forEach( function( cb ) { cb.stop() } )\n },\n\n start: function() {\n manager.callbacks.forEach( function( cb ) { cb.start() } )\n },\n\n toggle: function( bool ) {\n manager.callbacks.forEach( function( cb ) { cb.toggle( bool ) } )\n },\n\n remove: function() {\n manager.callbacks = []\n },\n\n fire: function() {\n var args = Array.prototype.slice.call( arguments )\n manager.callbacks.forEach( function( fn ) { fn.apply( this, args ) } )\n }\n }\n\n return manager\n },\n\n callback: {\n new: function( fn ) {\n var cb = function() {\n if ( cb.enabled ) { fn.apply( fn, arguments ) }\n }\n\n cb.stop = function() { cb.enabled = false }\n cb.start = function() { cb.enabled = true }\n cb.toggle = function( bool ) {\n cb.enabled = ( 0 in arguments ) ? bool : !cb.enabled\n }\n cb.enabled = true\n\n return cb\n }\n }\n}\n\nmodule.exports = Manager\n","var now = function() {\n return Date.now()\n}\n\nvar pickFunction = function() {\n var found\n Array.prototype.forEach.call( arguments, function( candidate ) {\n if ( typeof( candidate ) == 'function' && !found ) { found = candidate }\n })\n\n return found\n}\n\nvar debounce = function( fn, wait, options ) {\n\n // Allow options passed as the first argument\n if ( typeof( fn ) == 'object' ) { options = fn } \n\n // Options won't be null\n else { options = options || {} }\n\n wait = options.wait || wait || 0\n\n var max = options.max || false,\n leading = ( ( 'leading' in options ) ? options.leading : false ),\n trailing = ( ( 'trailing' in options ) ? options.trailing : true ),\n \n // Grab functions from options or default to first argument\n leadingFn = pickFunction( options.leading, options.trailing, options.callback, fn ),\n trailingFn = pickFunction( options.trailing, options.leading, options.callback, fn ),\n\n // State tracking vars\n args, // Track arguments passed to debounced callback\n queued = false, // Has a callback been added to the animation loop?\n handle = {}, // Object for tracking functions and callbacks\n lastCalled = 0, // Keep a timer for debouncing\n lastInvoked = 0, // Keep a timer for max\n leadingBlocked = false; // Track leading, throttling subsequent leading calls\n\n // Queue the function with requestAnimationFrame\n var invoke = function( callType ) {\n\n lastCalled = now()\n lastInvoked = now()\n queued = false\n leadingBlocked = true\n\n if ( callType === 'leading' ) {\n leadingFn.apply( leadingFn, args ) }\n else {\n trailingFn.apply( trailingFn, args ) }\n\n }\n\n // Load the loop into the animation queue\n var addToQueue = function () {\n\n if ( !queued ) {\n queued = true\n handle.value = requestAnimationFrame( loop ) // Add to browser's animation queue\n }\n\n }\n\n // Remove from animation queue and reset debounce \n var removeFromQueue = function() {\n\n if ( \"value\" in handle ) {\n cancelAnimationFrame( handle.value )\n queued = false\n lastCalled = 0\n lastInvoked = 0\n leadingBlocked = false\n }\n \n }\n\n // prevent infinite debouncing ( if options.max is set )\n var maxPassed = function() {\n return ( max && now() - lastInvoked >= max )\n }\n\n var waitReached = function() {\n return ( now() - lastCalled ) >= wait\n }\n\n // This gets loaded into the animation queue and determines whether to ivoke the debounced function\n var loop = function () {\n \n // Loop was executed so it's no longer in the animation queue\n queued = false\n \n if ( leading && !leadingBlocked ) {\n invoke( 'leading' )\n }\n\n // If function has been called to frequently to execute\n else if ( maxPassed() ) {\n\n if ( leading ) { invoke( 'leading' ) }\n else { invoke( 'trailing' ) }\n\n } \n \n // If function hasn't been called since last wait\n else if ( waitReached() ) {\n\n // If trailing it's safe to invoke\n if ( trailing ) { invoke( 'trailing' ) }\n\n // If leading, it's safe to remove block\n if ( leading ) { leadingBlocked = false }\n \n } else {\n addToQueue()\n }\n\n }\n\n // A wrapper function for queueing up function calls\n //\n var debounced = function() {\n lastCalled = now()\n args = arguments\n addToQueue()\n }\n\n debounced.stop = removeFromQueue\n\n return debounced\n}\n\nmodule.exports = debounce\n","var now = function() {\n return Date.now()\n}\n\nvar delay = function ( fn, wait ) {\n\n var argsStart = ( wait != null ) ? 2 : 1;\n var handle = {}\n\n handle.args = Array.prototype.slice.call( arguments, argsStart )\n handle.wait = wait || 0\n handle.start = now()\n\n handle.stop = function () {\n if ( \"value\" in handle ) {\n cancelAnimationFrame( handle.value );\n }\n }\n\n handle.loop = function () {\n\n // If wait limit has been reached\n if ( now() - handle.start >= handle.wait ) {\n fn.apply( fn, handle.args )\n\n // If repeat is set and is not 0\n if ( !!handle.repeat ) {\n handle.repeat = handle.repeat - 1\n handle.start = now()\n queueDelay( handle )\n } else if ( handle.repeat === 0 && handle.complete ) {\n handle.complete()\n }\n\n } else {\n queueDelay( handle )\n }\n\n }\n\n\n return queueDelay( handle )\n}\n\nvar queueDelay = function ( handle ) {\n handle.value = requestAnimationFrame( handle.loop )\n return handle\n}\n\nmodule.exports = delay\n","// This simplifies common uses for window.matchMedia \n// namely, adding listeners for width and height queries\n\nfunction parseQuery( query, dimension ) {\n var result = {}\n\n if ( typeof( query ) === 'string' ) { return query }\n\n result.min = size( query.min, 'min-' + dimension )\n result.max = size( query.max, 'max-' + dimension )\n\n if ( result.min && result.max )\n result.query = result.min + ' and ' + result.max\n\n return result.query || result.min || result.max\n}\n\nfunction size( num, limit ) {\n return ( num ) ? '('+limit+': ' + toPx( num ) + ')' : null\n}\n\nfunction toPx( width ) {\n if ( typeof( width ) === 'number' ) { return width + 'px'}\n return width\n}\n\nvar media = {\n\n width: function( query, fn ) {\n return media.listen( parseQuery( query, 'width' ), fn )\n },\n\n minWidth: function( size, fn ) { return media.width( { min: size }, fn ) },\n maxWidth: function( size, fn ) { return media.width( { max: size }, fn ) },\n\n height: function( query, fn ) {\n return media.listen( parseQuery( query, 'height' ), fn )\n },\n\n minHeight: function( size, fn ) { return media.height( { min: size }, fn ) },\n maxHeight: function( size, fn ) { return media.height( { max: size }, fn ) },\n\n listen: function( query, fn ) {\n var match = window.matchMedia( query )\n\n if ( fn ) {\n fn( match )\n match.addListener( fn )\n }\n\n return match\n }\n\n}\n\n\nmodule.exports = media\n","var Event = require( 'bean' )\nvar callbackManager = require( './callback-manager' )\nvar throttle = require( './throttle' )\nvar debounce = require( './debounce' )\n\nvar optimizedEventManager = {\n new: function( name ) {\n\n // Create a new callback manager\n var manager = {\n run: callbackManager.new(),\n start: callbackManager.new(),\n stop: callbackManager.new()\n }\n\n // run callbacks when event happens (at paint-ready frames)\n var running = throttle( manager.run.fire )\n\n // fire callbacks when event starts (at paint-ready frames)\n var started = debounce({\n leading: manager.start.fire,\n trailing: false,\n wait: 150\n })\n\n // fire callbacks when event starts (at paint-ready frames)\n var stopped = debounce( manager.stop.fire, 150 )\n\n Event.on( window, name, function() {\n running()\n started()\n stopped()\n })\n\n // Public API\n var run = function ( fn ) { return manager.run.add( fn ) }\n run.start = function ( fn ) { return manager.start.add( fn ) }\n run.stop = function ( fn ) { return manager.stop.add( fn ) }\n\n // Add custom events for to run optimized listeners. ( name -> Name )\n run( function() { Event.fire( window, 'optimized' + name[0].toUpperCase() + name.substring(1) ) } )\n run.start( function() { Event.fire( window, name + 'Start' ) } )\n run.stop( function() { Event.fire( window, name + 'Stop' ) } )\n\n return run\n }\n}\n\nmodule.exports = optimizedEventManager\n","var Event = require( 'bean' )\nvar callbackManager = require( './callback-manager' )\n\n// Create a new page event manager\nvar manager = {\n ready: callbackManager.new(),\n change: callbackManager.new(),\n readyAlready: false,\n changed: false,\n}\n\nmanager.ready.add( function(){\n manager.readyAlready = true \n})\n\nmanager.ready.add( function(){ \n if ( !window.Turbolinks && !manager.changed ) { \n manager.changed = true \n manager.change.fire()\n }\n})\n\nvar ready = function ( fn ) {\n if ( manager.readyAlready ) { fn() }\n return manager.ready.add( fn ) }\n\nvar change = function( fn ) {\n if ( manager.changed ) { fn() }\n return manager.change.add( fn ) }\n\n// Make it easy to trigger ready callbacks\nready.fire = function () {\n manager.ready.fire()\n // Be sure ready can only be fired once\n manager.ready.stop() }\n\n// Make it easy to trigger change callbacks\nchange.fire = function () {\n manager.change.fire() }\n\nEvent.on( document, 'DOMContentLoaded', ready.fire )\nEvent.on( document, 'page:change', change.fire ) // Support rails turbolinks page load event\n\nmodule.exports = {\n ready: ready,\n change: change\n}\n","var delay = require( './delay' )\n\nvar repeat = function( fn, wait, limit ) {\n\n var argsStart = 1,\n handle = delay ( fn, wait );\n\n if ( limit != null ) { argsStart = 3 }\n else if ( wait != null ) { argsStart = 2 }\n\n // Enable repeat ( -1 will repeat forever )\n handle.repeat = limit || -1\n handle.args = Array.prototype.slice.call( arguments, argsStart )\n handle.stop = handle.cancel\n\n return handle\n}\n\nmodule.exports = repeat\n","var manager = require( './optimized-event-manager' )\nvar resize = manager.new( 'resize' )\n\n// Pause animations during resizing for better performance\nresize.disableAnimation = function() {\n var style = '<style id=\"fullstop\">.no-animation *, .no-animation *:after, .no-animation *:before {\\\n transition: none !important; animation: none !important\\\n }</style>'\n\n // Inject style for easy classname manipulation\n if ( !document.querySelector('style#fullstop') ) { \n document.head.insertAdjacentHTML('beforeend', style)\n }\n\n resize.start( function() { document.body.classList.add( 'no-animation' ) } )\n resize.stop( function() { document.body.classList.remove( 'no-animation' ) } )\n}\n\nmodule.exports = resize\n","var manager = require( './optimized-event-manager' )\nvar scroll = manager.new( 'scroll' )\n\nscroll.disablePointer = function() {\n\n // Disable pointer interaction\n scroll.start( function() {\n document.documentElement.style.pointerEvents = 'none'\n })\n\n // Enable pointer interaction\n scroll.stop( function() {\n document.documentElement.style.pointerEvents = ''\n })\n}\n\nmodule.exports = scroll\n","// Custom Event Polyfill\n(function () {\n\n if ( typeof window.CustomEvent === \"function\" ) return false;\n\n function CustomEvent ( event, params ) {\n params = params || { bubbles: false, cancelable: false, detail: undefined };\n var evt = document.createEvent( 'CustomEvent' );\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );\n return evt;\n }\n\n CustomEvent.prototype = window.Event.prototype;\n\n window.CustomEvent = CustomEvent;\n})()\n","var endEvents = [\n 'touchend'\n]\n\nmodule.exports = Tap\n\n// default tap timeout in ms\nTap.timeout = 200\n\nfunction Tap(callback, options) {\n options = options || {}\n // if the user holds his/her finger down for more than 200ms,\n // then it's not really considered a tap.\n // however, you can make this configurable.\n var timeout = options.timeout || Tap.timeout\n\n // to keep track of the original listener\n listener.handler = callback\n\n return listener\n\n // el.addEventListener('touchstart', listener)\n function listener(e1) {\n // tap should only happen with a single finger\n if (!e1.touches || e1.touches.length > 1) return\n\n var el = e1.target\n var context = this\n var args = arguments;\n\n var timeout_id = setTimeout(cleanup, timeout)\n\n el.addEventListener('touchmove', cleanup)\n\n endEvents.forEach(function (event) {\n el.addEventListener(event, done)\n })\n\n function done(e2) {\n // since touchstart is added on the same tick\n // and because of bubbling,\n // it'll execute this on the same touchstart.\n // this filters out the same touchstart event.\n if (e1 === e2) return\n\n cleanup()\n\n // already handled\n if (e2.defaultPrevented) return\n\n // overwrite these functions so that they all to both start and events.\n var preventDefault = e1.preventDefault\n var stopPropagation = e1.stopPropagation\n\n e1.stopPropagation = function () {\n stopPropagation.call(e1)\n stopPropagation.call(e2)\n }\n\n e1.preventDefault = function () {\n preventDefault.call(e1)\n preventDefault.call(e2)\n }\n\n // calls the handler with the `end` event,\n // but i don't think it matters.\n callback.apply(context, args)\n }\n\n // cleanup end events\n // to cancel the tap, just run this early\n function cleanup(e2) {\n // if it's the same event as the origin,\n // then don't actually cleanup.\n // hit issues with this - don't remember\n if (e1 === e2) return\n\n clearTimeout(timeout_id)\n\n el.removeEventListener('touchmove', cleanup)\n\n endEvents.forEach(function (event) {\n el.removeEventListener(event, done)\n })\n }\n }\n}\n","var debounce = require( './debounce' )\n\nvar throttle = function( fn, wait, options ) {\n\n if ( typeof( fn ) == 'object' ) { options = fn; fn = undefined } \n else { options = options || {} }\n\n options.wait = options.wait || wait || 0\n options.max = options.max || options.wait\n options.callback = options.callback || fn\n options.leading = true\n options.trailing = true\n\n return debounce(options)\n}\n\n\nmodule.exports = throttle\n","var validation = require( './lib/validation' )\nvar progressive = require( './lib/progressive' )\n\nmodule.exports = {\n\n validate: validation.validate,\n invalidateField: validation.invalidateField,\n next: progressive.next,\n\n}\n","var toolbox = require( 'compose-toolbox' ),\n Event = toolbox.event,\n Callback = toolbox.event.callback,\n formSelector = 'form.progressive',\n watching = false,\n formCallbacks,\n registeredForms\n\n// Remove any existing callbacks and registered forms\nfunction reset () {\n\n formCallbacks = { next: [] }\n registeredForms = []\n\n}\n\nfunction newForm( form ) {\n\n if ( !form ) return\n\n var steps = toolbox.slice( form.querySelectorAll( '.form-step' ) ),\n stepIndex = 0,\n navItems = ''\n\n if ( steps.length == 0 ) return\n\n\n steps.forEach( function( step, index ) { \n\n // disable all steps but the current step\n step.disabled = step != currentStep()\n step.dataset.step = index\n\n })\n\n if ( form.dataset.nav ) {\n var nav = '<nav class=\"progressive-form-nav\">'\n\n steps.forEach( function( step, index ) {\n nav += '<a href=\"#\" class=\"progressive-form-nav-item\" data-step=\"'+( index + 1 )+'\">'\n nav += step.dataset.nav || \"Step \" + ( index + 1 )\n nav += '</a> '\n })\n\n nav += '</nav>'\n\n form.insertAdjacentHTML( 'afterbegin', nav )\n }\n\n show()\n\n function previousStep () { return steps[ stepIndex - 1] }\n function currentStep () { return steps[ stepIndex ] }\n function nextStep () { return steps[ stepIndex + 1] }\n function active () { return currentStep() && !currentStep().disabled }\n \n // Move to next fieldset\n function forward () {\n showStep( stepIndex + 1 )\n }\n\n // Move to next fieldset\n function back () {\n showStep( stepIndex - 1 )\n }\n\n // Accepts a step index\n function showStep ( index ) {\n\n index = Number( index )\n\n // Get the step from the index\n var step = steps[ index ]\n\n // Don't go to a non-existant step, or the current step\n if ( step && step != currentStep() ) {\n\n var direction = ( stepIndex < index ) ? 'forward' : 'reverse'\n\n // If a step is currently active\n // dismiss it before going to the specified step\n if ( active() ) {\n return dismiss( function() { showStep( index ) }, direction )\n }\n\n stepIndex = index\n\n show( direction )\n\n }\n }\n \n // Hide a completed step and move to the next\n function dismiss ( callback, direction ) {\n direction = direction || 'forward'\n\n currentStep().classList.remove( 'active', 'enter' )\n currentStep().classList.add( 'exit' )\n currentStep().dataset.direction = direction\n\n Event.afterAnimation( currentStep(), function() {\n disable()\n\n if ( typeof callback === 'function' ) callback()\n\n })\n\n }\n\n function revisit ( callback, direction ) {\n\n if ( !active() ) {\n direction = direction || 'reverse'\n\n currentStep().classList.remove( 'exit', 'completed' )\n currentStep().classList.add( 'active', 'enter' )\n currentStep().dataset.direction = direction\n\n disableOtherFieldsets()\n\n Event.afterAnimation( currentStep(), function() {\n if ( typeof callback === 'function' ) callback()\n })\n }\n }\n\n // Show the form-step\n function show ( direction ) {\n\n disableOtherFieldsets()\n currentStep().classList.remove( 'completed' )\n currentStep().dataset.direction = direction\n currentStep().classList.add( 'active', 'enter' )\n\n // focus on the first input\n var firstInput = currentStep().querySelector( 'input:not([hidden]), textarea, select' )\n if ( firstInput ) firstInput.focus()\n\n setNav()\n\n }\n\n // Disable a form step after it has been hidden\n function disable () {\n\n currentStep().disabled = true\n currentStep().classList.add( 'completed' )\n currentStep().classList.remove( 'enter', 'exit' )\n\n }\n\n function setNav () {\n toolbox.each( form.querySelectorAll( 'nav [data-step]' ), function ( nav ) {\n\n if ( nav.dataset.step < stepIndex + 1 ) {\n nav.classList.remove( 'here', 'next' )\n nav.classList.add( 'previous', 'completed' )\n }\n\n if ( nav.dataset.step == stepIndex + 1 ) {\n nav.classList.remove( 'previous', 'next' )\n nav.classList.add( 'here' )\n }\n\n if ( nav.dataset.step > stepIndex + 1 ) {\n nav.classList.remove( 'previous', 'here' )\n nav.classList.add( 'next' )\n }\n\n })\n }\n\n function enableFieldsets ( form ) {\n toolbox.each( form.querySelectorAll( 'fieldset.form-step[disabled]' ), function( fieldset ) {\n fieldset.disabled = false \n })\n }\n\n function disableOtherFieldsets ( ) {\n steps.forEach( function( fieldset ) {\n fieldset.disabled = fieldset != currentStep() \n })\n }\n\n registeredForms.push( function( event, trigger ) {\n var target = event.currentTarget\n\n if ( trigger === 'show-step' ) {\n event.preventDefault()\n\n if ( toolbox.matches( target, '.previous, .completed, .completed + a' ) )\n showStep( target.dataset.step - 1 )\n\n } else if ( trigger === 'next' ) {\n\n // Continue if submit was triggered on this form\n // and no invalid fields are found\n\n var formEl = ( target.tagName == \"FORM\" ) ? target : toolbox.getClosest( target, 'form')\n\n if ( form == formEl && !currentStep().querySelector( ':invalid' ) ) {\n\n // Get the function which triggers callbacks\n var fireCallbacks = getCallbacks( form )\n\n // This is the last stop, be sure all fieldsets are enabled!\n if ( !nextStep() ) enableFieldsets( form )\n else disableOtherFieldsets( form )\n\n // If there are callbacks, let them handle this!\n if ( fireCallbacks ) {\n\n // Since there are callbacks, stop the submission event\n event.preventDefault()\n\n fireCallbacks( event, {\n fieldset: currentStep(), // Valid fieldset element\n form: form, // Parent form element\n forward: forward, // Call forward() to move to the next fieldset\n dismiss: dismiss, // Hide and disable current step\n revisit: revisit, // Revisit current disabled step\n showStep: showStep, // Show a specific step by index (0 based)\n complete: !nextStep(), // is this is the final form step?\n formData: toolbox.formData( currentStep() ) // pass FormData for current fieldset\n })\n }\n\n // No callbacks? If there's a next step, stop submission and proceed\n else if ( nextStep() ) {\n event.preventDefault() \n forward()\n }\n }\n }\n })\n}\n\nfunction fire ( event, type ) {\n registeredForms.forEach( function( fn ) { fn( event, type ) })\n}\n\n\n// Returns a function which triggers callbacks\nfunction getCallbacks ( form, type ) {\n\n type = type || 'next'\n var callbacks = [], cb;\n\n formCallbacks[ type ].forEach( function( test ) {\n if ( cb = test( form ) ) {\n callbacks.push( cb )\n }\n })\n\n // Return a function which can trigger all callbacks\n // or returns fallse if none are called\n\n if ( callbacks.length )\n return function() {\n var args = toolbox.slice( arguments )\n\n callbacks.forEach( function( callback ) {\n callback.apply( callback, args ) }) }\n\n else return false\n}\n\nfunction next ( el, callback ) {\n on( el, 'next', callback )\n}\n\nfunction on ( el, event, callback ) {\n\n // Accept events list as an object e.g. { next: callback }\n if ( typeof event === 'object' ) {\n for ( type in event ) {\n on( el, type, event[ type ] )\n }\n }\n\n else if ( formCallbacks[ event ] ) {\n\n // Only allow access to a callback if the form matches\n var filter = function( form ) {\n if ( form == el ) return callback\n }\n\n // Add the test wrapper function to the callback list\n formCallbacks[ event ].push( filter )\n }\n}\n\nEvent.ready( function(){\n reset()\n\n // Add bubbling so we can listen for submission\n Event.bubbleFormEvents()\n\n var nextSelector = formSelector + ' [type=submit], ' + formSelector + ' .next-step'\n var backSelector = formSelector + ' .back-step'\n var navSelector = '.progressive-form-nav-item[data-step]'\n\n Event.on( document, 'click', nextSelector , fire, 'next' )\n Event.on( document, 'click', backSelector , fire, 'back' )\n Event.on( document, 'click', navSelector , fire, 'show-step' )\n// insert core styling for hiding disabled and completed form-steps\n document.head.insertAdjacentHTML( 'beforeend', \"<style>\\\n.form-step[disabled], .form-step.completed {\\\n position: absolute !important;\\\n top: -9999px !important;\\\n left: -9999px !important;\\\n left: 0 !important;\\\n right: 0 !important; }\\\n</style>\" )\n\n Event.change( function() {\n reset()\n\n toolbox.each( document.querySelectorAll( formSelector ), function( el ) {\n newForm( el )\n })\n })\n})\n\nmodule.exports = {\n next: next,\n new: newForm\n}\n","// Dependencies\nvar toolbox = require( 'compose-toolbox' ),\n Event = toolbox.event,\n getClosest = toolbox.getClosest,\n wordCount = toolbox.wordCount,\n textSelectors = '[required]';\n\n// Does this browser support HTML5 validation?\nfunction supported () {\n\n return typeof document.createElement( 'input' ).checkValidity === 'function'\n\n}\n\nvar invalidHandler = Event.callback.new( function( event ) { \n event.preventDefault() \n event.stopPropagation() \n})\n\n// Watch for events ( if validation is suported )\nEvent.ready( function(){\n\n if ( supported() ) { \n\n Event.bubbleFormEvents()\n\n document.addEventListener( 'invalid', invalidHandler, true )\n\n Event.on( document.body, 'click', '[type=submit]', submit )\n\n Event.on( document, 'validate', 'form', function( event ) { \n validateForm( event.target )\n })\n\n // Ensure all required inputs have aria-requrired attributes\n toolbox.slice( document.querySelectorAll( '[required]' ) ).forEach( function( element ) { \n element.setAttribute( 'aria-required', true )\n })\n\n // Watch input events\n Event.on( document, 'blur', '[required]', checkValidation )\n Event.on( document, 'keydown', '[required]', Event.debounce( checkValidation, 200 ) )\n Event.on( document, 'input', 'select[required]', Event.debounce( checkValidation, 200 ) )\n\n }\n})\n\nfunction validateForm ( form ) {\n\n // Scoped variables\n var inputs = form.querySelectorAll( '[required]' ),\n invalidInput;\n\n toolbox.slice( inputs ).some( function( input ) {\n\n // if invalid\n if ( !getClosest( input, '[disabled]' ) && !checkInput( input ) ) {\n invalidInput = input\n return true\n }\n })\n\n if ( invalidInput ) { \n\n // Show validation message\n focus( invalidInput )\n showMessage( invalidInput )\n\n return false\n }\n\n // The form is valid, skip it\n else { \n return true \n }\n\n}\n\n// Handler for validation events\nvar checkValidation = Event.callback.new( function( event ) {\n\n if ( checkInput( event.target, event.type ) ) {\n\n // Remove any pre-existing validation message\n hideMessage( event.target )\n }\n\n})\n\n\nfunction checkInput ( input, event ) {\n\n var el = statusEl( input ),\n valid = isValid( input ),\n neutral = event == 'keydown' && !valid;\n\n // Don't trigger invalid style while typing\n if ( neutral && input == document.activeElement ) {\n\n el.classList.remove( 'invalid', 'valid' )\n input.setAttribute( 'aria-invalid', false )\n\n } else {\n\n el.classList.toggle( 'invalid', !valid )\n el.classList.toggle( 'valid', valid )\n input.setAttribute( 'aria-invalid', valid )\n\n }\n\n return valid\n\n}\n\n// Is an input valid?\nfunction isValid ( input ) {\n\n // If element only contains whitespace, strip value\n if ( !input.value.replace( /\\s/g, '' ).length )\n input.value = ''\n\n // Set a custom validation message for word count\n var message = checkValue( input ) || checkLength( input ) || ''\n input.setCustomValidity( message )\n\n var valid = input.checkValidity()\n\n return valid\n\n}\n\n\nfunction checkValue( input ) {\n if ( input.dataset.invalidValue ) {\n\n // Does input value == invalid value? (case insensitive)\n var regexp = escapedRegex( input.dataset.invalidValue, 'i' )\n\n if ( input.value.match( regexp ) ) {\n\n // Remove any standard custom message\n input.dataset.cachedMessage = input.dataset.message\n input.dataset.message = ''\n\n return input.dataset.invalidValueMessage || \"Value '\"+input.value+\"' is not permitted\"\n\n // If not invalid value reset standard validation message\n } else if ( input.dataset.cachedMessage ) {\n\n input.dataset.message = input.dataset.cachedMessage\n input.dataset.cachedMessage = ''\n\n }\n }\n}\n\nfunction escapedRegex( input, options ) {\n var str = input.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n return new RegExp( \"^\" + str + '$', options )\n}\n\nfunction checkLength ( input ) {\n return checkCount( input, 'min' )\n || checkCount( input, 'max' )\n}\n\n// Test custom validation for maximum or minimum words present\nfunction checkCount ( input, limit ) {\n\n var goal = input.dataset[ limit + 'Words' ]\n\n if ( goal ) {\n\n var lessThanGoal = wordCount( input.value ) < goal\n phrasing = ( limit == 'min' ) ? 'at least ' : 'no more than ',\n valid = ( limit == 'min' ) ? !lessThanGoal : lessThanGoal\n\n // Return a custom error message\n if ( input.value && !valid )\n return 'Please write ' + phrasing + goal + ' words.'\n }\n\n\n}\n\n// If input is nested in a label, treat the label as the\n// target for assigning status (class names and messages).\nfunction statusEl ( input ) {\n\n return getClosest( input, 'label' ) || input\n\n}\n\n// Focus() if invalid element is not hidden\n// or Focus its immediate sibling (mostly used for upload buttons)\nfunction focus ( el ) {\n\n el = ( el.style.display !== 'none' ) ? el : el.nextSibling\n el.focus()\n\n}\n\n// Submission validation handler function\nfunction submit ( event ) {\n\n var form = ( event.target.tagName == \"FORM\" ) ? event.target : getClosest( event.target, 'form')\n\n // Skip validation if no invalid inputs found\n if ( !validateForm( form ) ) {\n\n // Pause keydown/blur triggers for the next second to avoid neutral empty style\n checkValidation.stop()\n Event.delay( checkValidation.start, 500 )\n\n // Stop the submission event\n event.preventDefault()\n event.stopImmediatePropagation()\n\n }\n\n}\n\nfunction invalidateField ( el, message ) {\n if ( el && el.value ) {\n el.dataset.invalidValue = el.value\n if ( message )\n el.dataset.invalidValueMessage = message\n }\n}\n\nfunction hideMessage ( el ) {\n\n var form = getClosest( el, 'form' ),\n msg = form.querySelector( '.validation-message' )\n\n if ( msg ) msg.parentNode.removeChild( msg )\n\n}\n\n\n// Validation message handler function\nfunction showMessage ( el ) {\n\n //hideMessage( el )\n\n var label = getClosest( el, 'label' ),\n message = el.dataset.message || el.validationMessage\n\n if ( label ) {\n var existingMessage = label.querySelector( '.validation-message-text' )\n\n if ( !existingMessage ) {\n label.insertAdjacentHTML( 'beforeend', '<span class=\"validation-message\"><span class=\"validation-message-text\" role=\"alert\">' + message + '</span></span>' )\n\n } else if ( existingMessage.textContent != message ) {\n existingMessage.innerHTML = message\n }\n }\n\n}\n\n// Public API\nmodule.exports = {\n validate: validateForm,\n invalidateField: invalidateField\n}\n","require ('./lib/object.assign')\n\nvar Event = require('compose-event')\n// Improves the utility and user interface for range inputs\n\nvar sliders = []\nvar listening\n\nvar Slider = {\n // When a slider is changed, update the associated label and input.\n change: function(event) {\n self.refresh(event.currentTarget)\n },\n\n // Update labels and inputs\n refresh: function (slider) {\n self.setLabels(slider)\n self.setInput(slider)\n self.setFill(slider)\n },\n \n // Some browsers don't focus when a slider input is changed, this lets us force focus.\n focus: function(event){\n event.currentTarget.focus()\n },\n \n // Inject slider templates into the DOM\n setup: function(){\n\n if (!listening) {\n Event.on(document, \"input toggler:show\", \"[type=range]\", self.change, { useCapture: true })\n Event.on(document, \"click change input\", \"[type=range]\", self.focus, { useCapture: true })\n listening = true\n }\n\n var ranges = document.querySelectorAll('[type=range]:not(.slider-input)')\n\n Array.prototype.forEach.call(ranges, function(slider){\n\n var data = self.data(slider)\n sliders.push(data)\n\n slider.dataset.id = data.id\n\n // Inject template and set inputs\n slider = self.template(slider)\n self.refresh(slider)\n\n })\n },\n\n data: function(el) {\n var data = {\n // Assign an incremental ID to track this slider with its data\n id: sliders.length,\n min: el.getAttribute('min') || 0,\n max: el.getAttribute('max') || 100,\n labels: {},\n externalLabels: {}\n }\n\n // Gets dataset as a hash\n Object.assign(data, self.extractData(el))\n\n data = self.extractValues(data)\n data = self.getLabels(data)\n\n if (data.values)\n data.max = (data.min + data.values.length - 1)\n\n data.segments = Number(data.max) - Number(data.min) + 1\n\n for (var key in data) {\n if(key.match(/-/)){\n data[this.camelCase(key)] = data[key]\n delete data[key]\n }\n }\n\n // Allow data-input or name attribute to set value for hidden input.\n //\n if (!data.input && el.getAttribute('name')) {\n data.input = el.getAttribute('name')\n el.removeAttribute('name')\n }\n\n if (data.input) {\n // Generate a class name for querying later (because some name attributes contain illegal characters for queries)\n data.inputClass = data.input.replace(/\\W/g,'-')\n data.inputExists = self.inputExists(el, data)\n }\n\n data = self.getLineLabels(data)\n\n if (data.mark) { \n data.mark = data.mark.split(',').map(Number) \n }\n\n return data\n },\n\n getData: function(slider) {\n if (typeof slider != 'string' && slider.dataset) {\n slider = slider.dataset.id\n }\n return sliders[slider]\n },\n\n extractValues: function(data) {\n if (data.values) { \n data.values = data.values.split(',').map(self.trim)\n } else {\n data.values = []\n for (var i = data.min; i <= data.max; i++ ) {\n data.values.push(i)\n }\n }\n\n return data\n },\n\n // Convert dataset strings into hashes of arrays\n // examples:\n // - data-label='one,two,three' => data.labels.default = ['one','two','three']\n // - data.external-label-awesome='one;two;three' => data.externalLabels.awesome = ['one','two','three']\n //\n // If labels have not been disabled (data-label='false') and there are no data labels,\n // an array of values is set to data.labels.default\n //\n getLabels: function(data) {\n if (data.label && data.label.match(/false|none/))\n data.label = false\n\n // Unless labels have been disabed with data-label='false'\n for (var val in data) {\n // Ignore non-native methods injected by some wayward lib\n if (!data.hasOwnProperty(val)) { continue }\n // Don't bother processing disabled labels\n if (data[val] === false) { continue }\n\n // Match properties: label, label-id, external-label-id\n var match = val.match(/^(external-)?label-(.+)|^label$/)\n\n if(match) {\n // Some labels may include commas, allow semicolons as an alternate separator\n //\n var delimiter = data[val].match(/;/) ? ';' : ','\n var labels = data[val].split(delimiter).map(self.trim)\n var external = match[1]\n var name = match[2]\n\n if(external){\n data.externalLabels[name] = labels\n } else if (val == 'label') {\n data.labels.default = labels\n delete data.label\n } else {\n data.labels[name] = labels\n }\n\n delete data[val]\n }\n\n var labelCount = self.objectSize(data.labels)\n\n // If there are no labels, use values for a label\n if (labelCount == 0)\n data.labels.default = data.values\n\n if (labelCount > 1)\n delete data.labels.default\n }\n\n return data\n },\n\n getLineLabels: function(data){\n var lineLabels = {}\n\n // Line labels may be in the following formats:\n // - 1:start,11:end - index specified, comma separated\n // - first,second,third,11:last - default to index for some labels\n // - 10,000;20,000;30,000 - semicolon separated\n //\n if(data.lineLabels) {\n var delimiter = data.lineLabels.match(/;/) ? ';' : ','\n data.lineLabels.split(delimiter).map(function(labels, index){\n var l = labels.split(':')\n label = (!l[1] ? l[0] : l[1])\n index = (!l[1] ? index + 1 : l[0])\n lineLabels[index] = label\n })\n data.lineLabels = lineLabels\n }\n\n return data\n },\n\n // \n template: function(slider){\n var data = self.getData(slider)\n\n slider.setAttribute('min', data.min)\n slider.setAttribute('max', data.max)\n\n slider.classList.add('slider-input')\n\n if(slider.classList.contains('left-label'))\n slider.classList.remove('left-label')\n\n var containerHTML = self.templateHTML(data)\n\n var classes = ['slider-container']\n\n if (containerHTML.match('slider-line-label'))\n classes.push('line-labels')\n\n if (containerHTML.match('slider-label'))\n classes.push(\"with-label\")\n else\n classes.push(\"without-label\")\n\n containerHTML = '<div class=\"'+classes.join(' ')+'\" id=\"slider'+data.id+'\">'\n + containerHTML\n +'</div>'\n\n slider.insertAdjacentHTML('beforebegin', containerHTML)\n var container = slider.previousSibling\n container.querySelector('.slider-input-container').insertAdjacentHTML('afterbegin', slider.outerHTML)\n slider.parentNode.removeChild(slider)\n\n slider = container.querySelector('.slider-input')\n \n // Update attributes from processed data\n //\n if(!slider.getAttribute('value'))\n slider.value = data.value || data.min\n return slider\n },\n \n templateHTML: function(data){\n var html = \"\"\n var fills = \"\"\n \n if (data.mark || data.lineLabels) {\n for(var i = 1; i <= data.segments; i++) {\n \n html += \"<div class='slider-segment'><span class='slider-segment-content'>\"\n\n if (data.mark && data.mark.indexOf(i) != -1)\n html += \"<span class='slider-segment-mark' data-index='\"+i+\"'></span>\"\n\n if (data.lineLabels && data.lineLabels[i]) \n html += \"<span class='slider-line-label'>\"+data.lineLabels[i]+\"</span>\"\n\n html += \"</span></div>\"\n }\n }\n\n // one less\n for(var i = 1; i < data.segments; i++) {\n fills += \"<span class='slider-fill' data-index='\"+i+\"'></span>\"\n }\n\n html = \"<div class='slider-input-container'>\"\n + \"<div class='slider-track'>\" + html + \"</div>\"\n + \"<div class='slider-fills'>\" + fills + \"</div>\"\n + \"</div>\"\n + self.labelTemplate(data)\n\n if (!data.inputExists && data.inputClass) {\n html += \"<input class='\"+data.inputClass+\"' type='hidden' name='\"+data.input+\"' value=''>\"\n }\n\n return html\n \n },\n\n labelTemplate: function(data){\n var html = \"\"\n\n if (data.label == false) { return html }\n\n for(var key in data.labels){\n html += '<span class=\"slider-label-'+key+' internal-label\" data-slider-label=\"'+key+'\">'\n html += self.labelHTML(data, key, '')\n html += '</span></span> '\n }\n\n if (html.length > 0) {\n html = \"<div class='slider-label align-\"+(data.positionLabel || 'right')+\"'>\" + html + \"</div>\"\n }\n\n return html\n },\n\n labelHTML: function(data, key, label) {\n return self.labelMeta(data, key, 'before')\n + \"<span class='label-content'>\" + label + \"</span>\"\n + self.labelMeta(data, key, 'after')\n },\n\n // Grab all prefixes or suffixes, for example:\n // - data-before-label='$'\n // - data-after-label='/mo'\n // - data-after-label-size='GB'\n //\n labelMeta: function(data, key, position) {\n var altKey = self.camelCase('-label-'+key)\n var meta = data[position+altKey] || data[position+'Label']\n if (meta)\n return \"<span class='\"+position+\"-label'>\"+meta+\"</span>\"\n else\n return ''\n },\n\n // Is there already an input matching this name?\n inputExists: function(slider, data) {\n if (data.inputClass) {\n var input = self.scope(slider).querySelector('input[name=\"'+data.input+'\"]')\n\n if(input) {\n input.classList.add(data.inputClass)\n return true\n }\n }\n },\n\n extractData: function(el) {\n var pattern = 'data-'\n var data = {}\n\n for (var i = 0; i < el.attributes.length; i++){\n var name = el.attributes[i].nodeName\n\n if(new RegExp(\"^\"+pattern).test(name)) {\n name = name.replace(pattern, '')\n data[name] = el.attributes[i].nodeValue\n }\n }\n return data\n },\n\n labelElements: function(id, key, external) {\n var selector = '[data-slider-label='+key+']'\n var internalSelector = \"#slider\"+id + ' ' + selector\n var externalSelector = selector += ':not(.internal-label)' \n if (external) { \n selector = externalSelector\n } else {\n selector = internalSelector + ', ' + externalSelector\n }\n\n return document.querySelectorAll(selector)\n },\n\n setFill: function(slider) {\n var data = self.getData(slider)\n var segments = document.querySelectorAll('#slider'+data.id+' .slider-segment')\n var fills = document.querySelectorAll('#slider'+data.id+' .slider-fill')\n var sliderIndex = self.sliderIndex(slider)\n \n Array.prototype.forEach.call(fills, function(fill, index){\n if (fill.dataset.index <= sliderIndex) {\n fill.classList.add('filled')\n if(segments[index]) {\n segments[index].classList.add('filled')\n }\n } else {\n fill.classList.remove('filled')\n if(segments[index]) {\n segments[index].classList.remove('filled')\n }\n }\n })\n \n },\n\n setInput: function(slider) {\n var data = self.getData(slider)\n\n // Don't update hidden sliders\n if (slider.offsetParent === null) { return }\n\n if (data.input && data.values) {\n var value = data.values[self.sliderIndex(slider)]\n var selector = \".\"+data.input.replace(/\\W/g,'-')\n var inputs = self.scope(slider).querySelectorAll(selector)\n\n Array.prototype.forEach.call(inputs, function(input){\n input.value = value\n })\n }\n },\n\n setLabels: function(slider) {\n var data = self.getData(slider)\n var index = self.sliderIndex(slider)\n\n if (slider.offsetParent === null) { return }\n\n Array.prototype.forEach.call(['labels', 'externalLabels'], function(type) {\n var external = (type == 'externalLabels')\n\n for (var key in data[type]) {\n var labelEls = self.labelElements(data.id, key, external)\n var labels = self.labelAtIndex(data[type], index)\n\n Array.prototype.forEach.call(labelEls, function(el) {\n var container = el.querySelector('.label-content')\n\n if ( container ) { container.innerHTML = labels[key] }\n else { el.innerHTML = self.labelHTML(data, key, labels[key]) }\n\n el.classList.toggle('empty-label', labels[key] === '')\n })\n }\n })\n },\n\n // Get all labels for the current slider position\n labelAtIndex: function(labels, index){\n var set = {}\n for (var key in labels) {\n set[key] = labels[key][index]\n }\n return set\n }, \n\n // Normalize the slider value by the minimum value\n sliderIndex: function(slider){\n return Number(slider.value) - Number(slider.getAttribute('min'))\n },\n\n // If slider is in a form, return that form.\n // This alows us to be sure that sliders in one\n // form do not update labels with the same name\n // in another form.\n //\n scope: function(slider) {\n var el = slider\n\n while (el && el.tagName != \"FORM\") {\n el = el.parentNode\n }\n\n return el || document\n },\n\n // Function for easy maping, as in: someArray.map(self.trim)\n trim: function(name){ \n return name.trim()\n },\n\n objectSize: function(object) {\n var length = 0; for(var i in object) { length++ }\n return length\n },\n\n camelCase: function(input) {\n return input.toLowerCase().replace(/-(.)/g, function(match, group) {\n return group.toUpperCase();\n });\n }\n}\n\nvar self = Slider\n\nEvent.change(Slider.setup)\n\nmodule.exports = Slider\n","if (typeof Object.assign != 'function') {\n (function () {\n Object.assign = function (target) {\n 'use strict';\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n })();\n}\n","var Event = require('compose-event')\n\nvar Toggler = {\n checkboxSelector: \"[type=checkbox][data-toggle], [type=checkbox][data-show], [type=checkbox][data-hide]\",\n radioSelector: \"input[type=radio][data-show], input[type=radio][data-hide], input[type=radio][data-add-class], input[type=radio][data-remove-class]\",\n selectSelector: \"option[data-hide], option[data-show]\",\n\n listen: function(){\n Event.on(document, \"click change\", \"[data-toggle], [data-show], [data-hide], [data-toggle-class], [data-add-class], [data-remove-class]\", Toggler.trigger)\n Event.on(document, \"change\", \".select-toggler\", Toggler.trigger)\n Event.on(window, 'hashchange', Toggler.hashChange)\n },\n\n hashChange: function() {\n if ( window.location.hash ) {\n\n var anchor = '[data-anchor=\"'+window.location.hash+'\"]'\n var target = document.querySelector( 'input'+anchor+ ', option'+anchor )\n\n if ( target ) {\n if ( target.type == 'radio' ) {\n target.checked = true\n } else {\n var select = Toggler.getSelectFromOption(target)\n select.selectedIndex = target.index\n target = select\n }\n ratchet.toggler.triggerToggling( target )\n }\n }\n },\n\n refresh: function(){\n Toggler.toggleCheckboxes()\n Toggler.setupSelects()\n Toggler.setupRadios()\n },\n\n trigger: function(event) {\n // Stop event and bubbling if link is only being used as a toggler\n if (event.currentTarget.getAttribute('href') == \"#\") {\n event.preventDefault()\n event.stop()\n } \n\n Toggler.triggerToggling(event.currentTarget, event)\n },\n\n triggerToggling: function(target, event) {\n var actions = ['hide', 'toggle', 'show', 'removeClass', 'toggleClass', 'addClass']\n var select\n\n // Store the select, and set the target to the current option\n // Events fire on the select, but the options have toggling attributes\n if (target.tagName.match(/select/i)) {\n select = target\n target = select.selectedOptions[0]\n }\n\n // Radio inputs and selects do not support toggling, so remove them\n if (select || target.type == 'radio') {\n actions = actions.filter(function(action) {\n return !action.match(/toggle/)\n })\n }\n\n // Dispatch all actions\n actions.forEach(function(action) {\n Toggler.dispatch(target, action)\n })\n },\n\n dispatch: function(el, type) {\n var action = type\n var data = el.dataset[type]\n\n // Abort if element doesn't have data for the action\n if (!data || typeof data == 'undefined' || data == '') return\n\n // Toggle and show are treated the same for checkboxes\n if (el.type == 'checkbox')\n action = (type.match(/hide|remove/i) ? !el.checked : el.checked)\n\n if (data){\n if (type.match(/class/i)){\n Toggler.setClass(data, action, el)\n } else {\n Toggler.setState(data, action)\n }\n }\n },\n\n // Add, remove, or toggle classnames, triggered by elements with:\n // data-hide-class, data-show-class, and data-toggle-class values\n //\n // Data value examples:\n // - \"classname\" - add/remove/toggle classname on current element\n // - \"foo bar\" - multiple classnames, separated by spaces (like html class property)\n // - \"foo bar; selector\" - change classnames on elements matched by selector\n // - \"foo bar; selector, selector\" - match multiple selectors\n //\n // You can perform multiple add/remove classes by joining values with an `&`\n // For example: \"classname & foo bar; selector\"\n // This would toggle classname on current element and toggle `foo bar` classnames\n // on an element matching the selector\n //\n\n setClass: function (selectors, action, el){\n if(typeof selectors == 'undefined' || selectors == '') return\n\n if (typeof(action) == 'boolean') {\n action = (action ? 'add' : 'remove')\n }\n\n if (selectors.match(/&/)) {\n selectors.split('&').forEach(function(sel){\n Toggler.setClass(sel.trim(), action, el) \n })\n return\n }\n\n // Get selector and classnames, format: \"classname classname; selector,selector\"\n var settings = selectors.split(';')\n var classnames = settings[0].trim()\n var matches = []\n selectors = settings[1]\n\n if (selectors) {\n matches = document.querySelectorAll(selectors)\n\n // If no slectors are present, and el is an OPTION, use its SELECT as the matched element\n } else if (el && el.tagName.match(/option/i)) {\n matches = [Toggler.getSelectFromOption(el)]\n \n // If no slectors are present, use the current el for classnames\n } else if (el) {\n matches = [el]\n }\n\n Array.prototype.forEach.call(matches, function(match){\n Array.prototype.forEach.call(classnames.split(' '), function(classname) {\n var method = action.replace(/Class/,'')\n match.classList[method](classname)\n })\n\n Toggler.triggerTogglerEventsOnChildren(match, 'class')\n })\n },\n\n setState: function(selectors, state) {\n var matches = document.querySelectorAll(selectors)\n\n Array.prototype.forEach.call(matches, function(match){\n var action = Toggler.toggleAction(match, state)\n\n Toggler[action](match)\n Toggler.triggerTogglerEventsOnChildren(match, action)\n })\n },\n\n toggleAction: function(el, action) {\n\n if (typeof(action) == 'boolean') {\n action = (action ? 'show' : 'hide')\n }\n\n if (action == 'toggle') {\n if (el.classList.contains('hidden')) {\n action = 'show'\n } else {\n action = 'hide'\n }\n }\n\n return action\n },\n\n show: function(el) {\n el.classList.remove('hidden')\n el.classList.add('visible')\n\n // Enable inputs, fieldsets or forms when shown\n if ( typeof el.disabled != 'undefined' ){\n el.disabled = false\n }\n\n // Focus on key element if an element expects focus\n var focusEl = el.querySelector('[data-focus]')\n if (focusEl) { focusEl.focus() }\n\n // Trigger input event on ranges that have been hidden\n var ranges = el.querySelectorAll('[type=range]')\n },\n\n hide: function(el) {\n el.classList.remove('visible')\n el.classList.add('hidden')\n\n // Disable inputs, fieldsets or forms when hidden\n if ( typeof el.disabled != 'undefined' ){\n el.disabled = true\n }\n },\n\n getLeafNodes: function (parent) {\n // is the parent itself a leaf node?\n if (!parent.hasChildNodes()) return [parent]\n\n var nodes = Array.prototype.slice.call(parent.getElementsByTagName(\"*\"), 0)\n\n return nodes.filter(function(elem) {\n return elem.children && elem.children.length === 0\n })\n },\n\n triggerTogglerEventsOnChildren: function(el, eventName){\n // we care about leaf nodes since the event will bubble to\n // non-leaf nodes from the leaf nodes\n var leafChildNodes = Toggler.getLeafNodes(el)\n\n Array.prototype.forEach.call(leafChildNodes, function(node) {\n // 'toggler:show', 'toggler:hide', etc\n Event.fire(node, \"toggler:\" + eventName)\n })\n },\n\n toggleCheckboxes: function(checkboxes) {\n checkboxes = checkboxes || document.querySelectorAll(Toggler.checkboxSelector)\n\n Array.prototype.forEach.call(checkboxes, Toggler.triggerToggling)\n },\n\n setupRadios: function() {\n Array.prototype.forEach.call(document.querySelectorAll(Toggler.radioSelector), function(radio, index){\n if (!radio.dataset.togglerActive) {\n\n var radioName = radio.getAttribute('name'),\n siblings = Toggler.parentForm(radio).querySelectorAll('[type=radio][name=\"'+radioName+'\"]'),\n showSelectors = Toggler.dataAttributes(siblings, 'show'),\n addClassSelectors = Toggler.dataAttributes(siblings, 'addClass'),\n checked\n\n Array.prototype.forEach.call(siblings, function(r){\n\n if (r.dataset.anchor && window.location.hash == ('#'+r.dataset.anchor.replace('#',''))) {\n r.checked = true\n }\n\n // Ensure that all radio buttons in a group have a default data-show value of ''\n // This means that unset data-show values will toggle off everything\n //\n r.dataset.show = r.dataset.show || ''\n r.dataset.addClass = r.dataset.addClass || ''\n\n // Append element's data-hide to showSelectors\n if ( r.dataset.hide && r.dataset.hide.length > 0 )\n showSelectors = showSelectors.concat( r.dataset.hide.split( ',' ) )\n\n r.dataset.hide = showSelectors.filter(function(selector){\n return r.dataset.show.indexOf( selector )\n }).join(',')\n\n // Ensure that all radio buttons in a group have a default data-add-class value of ''\n // This means that unset data-add-class values are toggle off all classes\n //\n r.dataset.addClass = r.dataset.addClass || ''\n\n // Ensure that selected radio buttons remove classes according\n // to the deselected radio buttons\n r.dataset.removeClass = addClassSelectors.filter(function(selector){\n return r.dataset.addClass.indexOf( selector )\n }).join('&')\n\n\n r.dataset.togglerActive = true\n\n\n if( r.checked ) checked = r\n\n })\n\n if ( checked ) {\n Toggler.triggerToggling( checked )\n } else {\n Toggler.setState( showSelectors.join(','), 'hide' )\n Toggler.setClass( addClassSelectors.join(' & '), 'removeClass' )\n }\n }\n\n })\n },\n\n // Add data-hide to each <option> containing the selectors from other\n // option's data-show. This makes the toggling of elements exclusive.\n //\n setupSelects: function(){\n Array.prototype.forEach.call(document.querySelectorAll(Toggler.selectSelector), function(option){\n // Prevent an option from being considered twice\n if (!option.dataset.togglerActive) {\n\n option.dataset.show = option.dataset.show || ''\n\n var select = Toggler.getSelectFromOption(option)\n select.classList.add('select-toggler')\n var options = select.querySelectorAll('option')\n\n var showSelectors = Toggler.dataAttributes(options, 'show')\n var addClassSelectors = Toggler.dataAttributes(options, 'addClass')\n\n Array.prototype.forEach.call(options, function(o, index) {\n\n if (o.dataset.anchor && window.location.hash == ('#'+o.dataset.anchor.replace('#',''))) {\n select.selectedIndex = index\n }\n\n o.dataset.show = o.dataset.show || ''\n o.dataset.addClass = o.dataset.addClass || ''\n\n // Append element's data-hide to showSelectors\n if ( o.dataset.hide && o.dataset.hide.length > 0 )\n showSelectors = showSelectors.concat( o.dataset.hide.split( ',' ) )\n\n // If show selectors are not present in element's data-show\n // Add them to the list of selectors to be hidden\n o.dataset.hide = showSelectors.filter(function(selector){\n return o.dataset.show.indexOf( selector )\n }).join(',')\n\n o.dataset.removeClass = addClassSelectors.filter(function(selector){\n return o.dataset.addClass.indexOf( selector )\n }).join(' & ')\n\n o.dataset.togglerActive = true\n })\n\n // Ensure that currently selected option is toggled properly\n //\n Toggler.triggerToggling(select)\n }\n })\n },\n\n // Find parent <select> for an option (accounts for option groups)\n //\n getSelectFromOption: function(el) {\n var p = el.parentElement\n\n if (p.tagName == 'SELECT') {\n return p\n } else {\n return Toggler.getSelectFromOption(p)\n }\n },\n\n\n // Find parent <form> or document if there is no form\n //\n parentForm: function(element) {\n var el = element\n\n while (el && el.tagName != \"FORM\") {\n el = el.parentNode\n }\n\n return el || document\n },\n\n // Return a unique array of all data attribute values from elements\n //\n dataAttributes: function(elements, attr) {\n return Array.prototype.map.call(elements, function(el) { \n return el.dataset[attr]\n }).filter(function(selectors, index, self) {\n return selectors != \"\" && typeof selectors != 'undefined' && self.indexOf(selectors) === index\n })\n }\n}\n\nEvent.ready(Toggler.listen)\nEvent.change(Toggler.refresh)\n\nmodule.exports = Toggler\n","// Shims\nrequire( './lib/shims/_classlist' )\nvar merge = require( './lib/shims/_object.assign' )\n\nvar event = require( 'compose-event' )\nvar scrollTo = require( './lib/scrollto' )\nvar fromTop = require( './lib/fromtop' )\nvar ease = require( './lib/ease' )\n\nvar toolbox = {\n\n event: event,\n scrollTo: scrollTo,\n fromTop: fromTop,\n merge: merge,\n ease: ease,\n\n // Get closest DOM element up the tree that matches a given selector\n getClosest: function ( el, selector ) {\n for ( ; el && el !== document; el = el.parentNode ) {\n if ( toolbox.matches( el, selector ) ) return el;\n }\n return false;\n },\n\n // Get next DOM element that matches a given selector\n getNext: function( el, selector ) {\n for ( ; el && el !== document; el = el.parentNode ) {\n if ( el.querySelector( selector ) ) return el.querySelector( selector );\n }\n return false;\n },\n\n // Matches selector function\n // @reference https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\n matches: function ( el, selector ) {\n return ( el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector ).call( el, selector );\n },\n\n wordCount: function( str ) {\n var matches = str.match( /\\S+/g );\n return matches ? matches.length : 0;\n },\n\n // Easy access to slice for converting objects into arrays of values.\n slice: function( obj, count ) {\n return Array.prototype.slice.call( obj, count )\n },\n\n each: function( collection, callback ) {\n return Array.prototype.forEach.call( collection, callback )\n },\n\n formData: function( rootEl ) {\n var formData = new FormData(),\n fields = rootEl.querySelectorAll( 'input[name]' )\n\n // Loop over fields\n toolbox.each( fields, function( field ) {\n // Append current field’s name/value to new formData object\n formData.append( field.name, field.value );\n })\n\n // Then return said formData object\n return formData;\n }\n\n}\n\n\nmodule.exports = toolbox\n","// easing functions http://gizma.com/easing/\nvar ease = {\n\n inOutQuad: function (t, b, c, d) {\n t /= d/2\n if (t < 1) { return c/2*t*t + b }\n t--\n return -c/2 * (t*(t-2) - 1) + b\n },\n\n inOutCubic: function (t, b, c, d) {\n\tt /= d/2;\n\tif (t < 1) return c/2*t*t*t + b;\n\tt -= 2;\n\treturn c/2*(t*t*t + 2) + b;\n },\n\n inOutQuint: function(t, b, c, d) {\n var ts = (t/=d)*t,\n tc = ts*t;\n return b+c*(6*tc*ts + -15*ts*ts + 10*tc);\n },\n\n inOutCirc: function (t, b, c, d) {\n t /= d/2;\n if (t < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n t -= 2;\n return c/2 * (Math.sqrt(1 - t*t) + 1) + b;\n }\n\n}\n\nease.default = ease.inOutQuad\n\nmodule.exports = ease\n","module.exports = function( el ) {\n return Math.round( el.getBoundingClientRect().top + window.pageYOffset );\n}\n","var ease = require( './ease' )\nvar fromTop = require( './fromtop' )\n\nfunction move(amount) {\n\n // Scroll all because document.scrollingElement is still expiremental\n document.documentElement.scrollTop = amount;\n document.body.parentNode.scrollTop = amount;\n document.body.scrollTop = amount;\n\n}\n\nfunction position() {\n return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;\n}\n\nfunction scrollTo(to, callback, duration) {\n\n // Making args flexible\n //\n // Allow for element or y-coordinates\n if( typeof( to ) === 'object' ) { to = fromTop( to ) }\n\n // Accept duration as the second argument\n if( typeof( callback ) === 'number' ) { duration = callback; callback = null }\n\n // Default duration = 500\n duration = ( typeof( duration ) === 'undefined' ) ? 500 : duration\n\n var start = position(),\n change = to - start,\n currentTime = 0,\n increment = 20;\n\n\n var animateScroll = function() {\n\n // increment the time\n currentTime += increment\n\n // find the value with the quadratic in-out easing function\n var val = ease.default(currentTime, start, change, duration)\n\n // move the document.body\n move(val);\n\n // do the animation unless its over\n if ( currentTime < duration ) {\n requestAnimationFrame( animateScroll )\n } else {\n if ( callback && typeof( callback ) === 'function') {\n callback()\n }\n }\n }\n\n animateScroll()\n}\n\nmodule.exports = scrollTo\n","/**\n * ClassList polyfill\n * Cross-browser full element.classList implementation\n * @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js\n * @author Eli Grey - http://eligrey.com\n * @license MIT\n **/\n\nif ( 'document' in self ) {\n\n // Full polyfill for browsers with no classList support\n if ( !( 'classList' in document.createElement( '_' ) ) ) {\n\n ( function( view ) {\n\n 'use strict';\n\n if ( !( 'Element' in view ) ) return;\n\n var\n classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[ protoProp ],\n objCtr = Object,\n\n strTrim = String[ protoProp ].trim || function() {\n return this.replace( /^\\s+|\\s+$/g, '' );\n },\n\n arrIndexOf = Array[ protoProp ].indexOf || function( item ) {\n for ( var i = 0; i < this.length; i++ ) {\n if ( i in this && this[ i ] === item ) {\n return i;\n }\n }\n return -1;\n },\n\n DOMEx = function( type, message ) {\n this.name = type;\n this.code = DOMException[ type ];\n this.message = message;\n },\n\n checkTokenAndGetIndex = function( classList, token ) {\n if ( token === '' ) {\n throw new DOMEx(\n 'SYNTAX_ERR',\n 'An invalid or illegal string was specified'\n );\n }\n if ( /\\s/.test( token ) ) {\n throw new DOMEx(\n 'INVALID_CHARACTER_ERR',\n 'String contains an invalid character'\n );\n }\n return arrIndexOf.call( classList, token );\n },\n\n ClassList = function( elem ) {\n var trimmedClasses = strTrim.call( elem.getAttribute( 'class' ) || '' ),\n classes = trimmedClasses ? trimmedClasses.split( /\\s+/ ) : [];\n\n for ( var i = 0; i < classes.length; i++ ) {\n this.push( classes[ i ] );\n }\n\n this._updateClassName = function() {\n elem.setAttribute( 'class', this.toString() );\n };\n },\n\n classListProto = ClassList[ protoProp ] = [],\n\n classListGetter = function() {\n return new ClassList( this );\n };\n\n DOMEx[ protoProp ] = Error[ protoProp ];\n\n classListProto.item = function( i ) {\n return this[ i ] || null;\n };\n\n classListProto.contains = function( token ) {\n token += '';\n return checkTokenAndGetIndex( this, token ) !== -1;\n };\n\n classListProto.add = function() {\n var\n tokens = arguments,\n iter = 0,\n len = tokens.length,\n updated = false,\n token;\n\n do {\n token = tokens[ iter ] + '';\n if ( checkTokenAndGetIndex( this, token ) === -1 ) {\n this.push( token );\n updated = true;\n }\n }\n\n while ( ++iter < len );\n\n if ( updated ) {\n this._updateClassName();\n }\n };\n\n classListProto.remove = function() {\n var\n tokens = arguments,\n iter = 0,\n len = tokens.length,\n updated = false,\n token,\n index;\n\n do {\n token = tokens[ iter ] + '';\n index = checkTokenAndGetIndex( this, token );\n\n while ( index !== -1 ) {\n this.splice( index, 1 );\n updated = true;\n index = checkTokenAndGetIndex( this, token );\n }\n }\n\n while ( ++iter < len );\n\n if ( updated ) {\n this._updateClassName();\n }\n };\n\n classListProto.toggle = function( token, force ) {\n token += '';\n\n var\n result = this.contains( token ),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n\n if ( method ) {\n this[ method ]( token );\n }\n\n if ( force === true || force === false ) {\n return force;\n } else {\n return !result;\n }\n };\n\n classListProto.toString = function() {\n return this.join( ' ' );\n };\n\n if ( objCtr.defineProperty ) {\n var classListPropDesc = {\n get : classListGetter,\n enumerable : true,\n configurable : true\n };\n\n try {\n objCtr.defineProperty( elemCtrProto, classListProp, classListPropDesc );\n }\n\n catch ( ex ) {\n if ( ex.number === -0x7FF5EC54 ) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty( elemCtrProto, classListProp, classListPropDesc );\n }\n }\n\n } else if ( objCtr[ protoProp ].__defineGetter__ ) {\n elemCtrProto.__defineGetter__( classListProp, classListGetter );\n }\n\n }( self ));\n\n } else {\n\n ( function() {\n\n 'use strict';\n\n var testElement = document.createElement( '_' );\n\n testElement.classList.add( 'c1', 'c2' );\n\n if ( !testElement.classList.contains( 'c2' ) ) {\n var createMethod = function( method ) {\n var original = DOMTokenList.prototype[ method ];\n\n DOMTokenList.prototype[ method ] = function( token ) {\n var i, len = arguments.length;\n\n for ( i = 0; i < len; i++ ) {\n token = arguments[ i ];\n original.call( this, token );\n }\n };\n };\n createMethod( 'add' );\n createMethod( 'remove' );\n }\n\n testElement.classList.toggle( 'c3', false );\n\n if ( testElement.classList.contains( 'c3' ) ) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function( token, force ) {\n if ( 1 in arguments && !this.contains( token ) === !force ) {\n return force;\n } else {\n return _toggle.call( this, token );\n }\n };\n\n }\n\n testElement = null;\n\n }());\n\n }\n}\n","/**\n * Object.assign polyfill\n * Cross-browser full Object.assign implementation\n * @source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill\n * @license MIT\n **/\n\nif ( typeof Object.assign != 'function' ) {\n ( function() {\n Object.assign = function( target ) {\n 'use strict';\n if ( target === undefined || target === null ) {\n throw new TypeError( 'Cannot convert undefined or null to object' );\n }\n\n var output = Object( target );\n for ( var index = 1; index < arguments.length; index++ ) {\n var source = arguments[ index ];\n if ( source !== undefined && source !== null ) {\n for ( var nextKey in source ) {\n if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) {\n output[ nextKey ] = source[ nextKey ];\n }\n }\n }\n }\n return output;\n };\n })();\n}\n\n// Make it easy to merge objects without overwriting the original objects\nvar merge = function() {\n var args = [{}].concat( Array.prototype.slice.call( arguments ) )\n return Object.assign.apply( this, args )\n}\n\nmodule.exports = merge\n","// keymaster.js\n// (c) 2011-2013 Thomas Fuchs\n// keymaster.js may be freely distributed under the MIT license.\n\n;(function(global){\n var k,\n _handlers = {},\n _mods = { 16: false, 18: false, 17: false, 91: false },\n _scope = 'all',\n // modifier keys\n _MODIFIERS = {\n '⇧': 16, shift: 16,\n '⌥': 18, alt: 18, option: 18,\n '⌃': 17, ctrl: 17, control: 17,\n '⌘': 91, command: 91\n },\n // special keys\n _MAP = {\n backspace: 8, tab: 9, clear: 12,\n enter: 13, 'return': 13,\n esc: 27, escape: 27, space: 32,\n left: 37, up: 38,\n right: 39, down: 40,\n del: 46, 'delete': 46,\n home: 36, end: 35,\n pageup: 33, pagedown: 34,\n ',': 188, '.': 190, '/': 191,\n '`': 192, '-': 189, '=': 187,\n ';': 186, '\\'': 222,\n '[': 219, ']': 221, '\\\\': 220\n },\n code = function(x){\n return _MAP[x] || x.toUpperCase().charCodeAt(0);\n },\n _downKeys = [];\n\n for(k=1;k<20;k++) _MAP['f'+k] = 111+k;\n\n // IE doesn't support Array#indexOf, so have a simple replacement\n function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }\n\n // for comparing mods before unassignment\n function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }\n\n var modifierMap = {\n 16:'shiftKey',\n 18:'altKey',\n 17:'ctrlKey',\n 91:'metaKey'\n };\n function updateModifierKey(event) {\n for(k in _mods) _mods[k] = event[modifierMap[k]];\n };\n\n // handle keydown event\n function dispatch(event) {\n var key, handler, k, i, modifiersMatch, scope;\n key = event.keyCode;\n\n if (index(_downKeys, key) == -1) {\n _downKeys.push(key);\n }\n\n // if a modifier key, set the key.<modifierkeyname> property to true and return\n if(key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko\n if(key in _mods) {\n _mods[key] = true;\n // 'assignKey' from inside this closure is exported to window.key\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = true;\n return;\n }\n updateModifierKey(event);\n\n // see if we need to ignore the keypress (filter() can can be overridden)\n // by default ignore key presses if a select, textarea, or input is focused\n if(!assignKey.filter.call(this, event)) return;\n\n // abort if no potentially matching shortcuts found\n if (!(key in _handlers)) return;\n\n scope = getScope();\n\n // for each potential shortcut\n for (i = 0; i < _handlers[key].length; i++) {\n handler = _handlers[key][i];\n\n // see if it's in the current scope\n if(handler.scope == scope || handler.scope == 'all'){\n // check if modifiers match if any\n modifiersMatch = handler.mods.length > 0;\n for(k in _mods)\n if((!_mods[k] && index(handler.mods, +k) > -1) ||\n (_mods[k] && index(handler.mods, +k) == -1)) modifiersMatch = false;\n // call the handler and stop the event if neccessary\n if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){\n if(handler.method(event, handler)===false){\n if(event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if(event.stopPropagation) event.stopPropagation();\n if(event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n }\n };\n\n // unset modifier keys on keyup\n function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n };\n\n function resetModifiers() {\n for(k in _mods) _mods[k] = false;\n for(k in _MODIFIERS) assignKey[k] = false;\n };\n\n // parse and assign shortcut\n function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n };\n\n // unbind all handlers for given key in current scope\n function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n };\n\n // Returns true if the key with code 'keyCode' is currently down\n // Converts strings into key codes.\n function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }\n\n function getPressedKeyCodes() {\n return _downKeys.slice(0);\n }\n\n function filter(event){\n var tagName = (event.target || event.srcElement).tagName;\n // ignore keypressed in any elements that support keyboard data input\n return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');\n }\n\n // initialize key.<modifier> to false\n for(k in _MODIFIERS) assignKey[k] = false;\n\n // set current scope (default 'all')\n function setScope(scope){ _scope = scope || 'all' };\n function getScope(){ return _scope || 'all' };\n\n // delete all handlers for a given scope\n function deleteScope(scope){\n var key, handlers, i;\n\n for (key in _handlers) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length; ) {\n if (handlers[i].scope === scope) handlers.splice(i, 1);\n else i++;\n }\n }\n };\n\n // abstract key logic for assign and unassign\n function getKeys(key) {\n var keys;\n key = key.replace(/\\s/g, '');\n keys = key.split(',');\n if ((keys[keys.length - 1]) == '') {\n keys[keys.length - 2] += ',';\n }\n return keys;\n }\n\n // abstract mods logic for assign and unassign\n function getMods(key) {\n var mods = key.slice(0, key.length - 1);\n for (var mi = 0; mi < mods.length; mi++)\n mods[mi] = _MODIFIERS[mods[mi]];\n return mods;\n }\n\n // cross-browser events\n function addEvent(object, event, method) {\n if (object.addEventListener)\n object.addEventListener(event, method, false);\n else if(object.attachEvent)\n object.attachEvent('on'+event, function(){ method(window.event) });\n };\n\n // set the handlers globally on document\n addEvent(document, 'keydown', function(event) { dispatch(event) }); // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48\n addEvent(document, 'keyup', clearModifier);\n\n // reset modifiers to false whenever the window is (re)focused.\n addEvent(window, 'focus', resetModifiers);\n\n // store previously defined key\n var previousKey = global.key;\n\n // restore previously defined key and return reference to our key object\n function noConflict() {\n var k = global.key;\n global.key = previousKey;\n return k;\n }\n\n // set window.key and window.key.set/get/deleteScope, and the default filter\n global.key = assignKey;\n global.key.setScope = setScope;\n global.key.getScope = getScope;\n global.key.deleteScope = deleteScope;\n global.key.filter = filter;\n global.key.isPressed = isPressed;\n global.key.getPressedKeyCodes = getPressedKeyCodes;\n global.key.noConflict = noConflict;\n global.key.unbind = unbindKey;\n\n if(typeof module !== 'undefined') module.exports = assignKey;\n\n})(this);\n","/**\n * Root reference for iframes.\n */\n\nvar root;\nif (typeof window !== 'undefined') { // Browser window\n root = window;\n} else if (typeof self !== 'undefined') { // Web Worker\n root = self;\n} else { // Other environments\n console.warn(\"Using browser-only version of superagent in non-browser environment\");\n root = this;\n}\n\nvar Emitter = require('emitter');\nvar requestBase = require('./request-base');\nvar isObject = require('./is-object');\n\n/**\n * Noop.\n */\n\nfunction noop(){};\n\n/**\n * Expose `request`.\n */\n\nvar request = module.exports = require('./request').bind(null, Request);\n\n/**\n * Determine XHR.\n */\n\nrequest.getXHR = function () {\n if (root.XMLHttpRequest\n && (!root.location || 'file:' != root.location.protocol\n || !root.ActiveXObject)) {\n return new XMLHttpRequest;\n } else {\n try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}\n }\n throw Error(\"Browser-only verison of superagent could not find XHR\");\n};\n\n/**\n * Removes leading and trailing whitespace, added to support IE.\n *\n * @param {String} s\n * @return {String}\n * @api private\n */\n\nvar trim = ''.trim\n ? function(s) { return s.trim(); }\n : function(s) { return s.replace(/(^\\s*|\\s*$)/g, ''); };\n\n/**\n * Serialize the given `obj`.\n *\n * @param {Object} obj\n * @return {String}\n * @api private\n */\n\nfunction serialize(obj) {\n if (!isObject(obj)) return obj;\n var pairs = [];\n for (var key in obj) {\n pushEncodedKeyValuePair(pairs, key, obj[key]);\n }\n return pairs.join('&');\n}\n\n/**\n * Helps 'serialize' with serializing arrays.\n * Mutates the pairs array.\n *\n * @param {Array} pairs\n * @param {String} key\n * @param {Mixed} val\n */\n\nfunction pushEncodedKeyValuePair(pairs, key, val) {\n if (val != null) {\n if (Array.isArray(val)) {\n val.forEach(function(v) {\n pushEncodedKeyValuePair(pairs, key, v);\n });\n } else if (isObject(val)) {\n for(var subkey in val) {\n pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]);\n }\n } else {\n pairs.push(encodeURIComponent(key)\n + '=' + encodeURIComponent(val));\n }\n } else if (val === null) {\n pairs.push(encodeURIComponent(key));\n }\n}\n\n/**\n * Expose serialization method.\n */\n\n request.serializeObject = serialize;\n\n /**\n * Parse the given x-www-form-urlencoded `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseString(str) {\n var obj = {};\n var pairs = str.split('&');\n var pair;\n var pos;\n\n for (var i = 0, len = pairs.length; i < len; ++i) {\n pair = pairs[i];\n pos = pair.indexOf('=');\n if (pos == -1) {\n obj[decodeURIComponent(pair)] = '';\n } else {\n obj[decodeURIComponent(pair.slice(0, pos))] =\n decodeURIComponent(pair.slice(pos + 1));\n }\n }\n\n return obj;\n}\n\n/**\n * Expose parser.\n */\n\nrequest.parseString = parseString;\n\n/**\n * Default MIME type map.\n *\n * superagent.types.xml = 'application/xml';\n *\n */\n\nrequest.types = {\n html: 'text/html',\n json: 'application/json',\n xml: 'application/xml',\n urlencoded: 'application/x-www-form-urlencoded',\n 'form': 'application/x-www-form-urlencoded',\n 'form-data': 'application/x-www-form-urlencoded'\n};\n\n/**\n * Default serialization map.\n *\n * superagent.serialize['application/xml'] = function(obj){\n * return 'generated xml here';\n * };\n *\n */\n\n request.serialize = {\n 'application/x-www-form-urlencoded': serialize,\n 'application/json': JSON.stringify\n };\n\n /**\n * Default parsers.\n *\n * superagent.parse['application/xml'] = function(str){\n * return { object parsed from str };\n * };\n *\n */\n\nrequest.parse = {\n 'application/x-www-form-urlencoded': parseString,\n 'application/json': JSON.parse\n};\n\n/**\n * Parse the given header `str` into\n * an object containing the mapped fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseHeader(str) {\n var lines = str.split(/\\r?\\n/);\n var fields = {};\n var index;\n var line;\n var field;\n var val;\n\n lines.pop(); // trailing CRLF\n\n for (var i = 0, len = lines.length; i < len; ++i) {\n line = lines[i];\n index = line.indexOf(':');\n field = line.slice(0, index).toLowerCase();\n val = trim(line.slice(index + 1));\n fields[field] = val;\n }\n\n return fields;\n}\n\n/**\n * Check if `mime` is json or has +json structured syntax suffix.\n *\n * @param {String} mime\n * @return {Boolean}\n * @api private\n */\n\nfunction isJSON(mime) {\n return /[\\/+]json\\b/.test(mime);\n}\n\n/**\n * Return the mime type for the given `str`.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction type(str){\n return str.split(/ *; */).shift();\n};\n\n/**\n * Return header field parameters.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction params(str){\n return str.split(/ *; */).reduce(function(obj, str){\n var parts = str.split(/ *= */),\n key = parts.shift(),\n val = parts.shift();\n\n if (key && val) obj[key] = val;\n return obj;\n }, {});\n};\n\n/**\n * Initialize a new `Response` with the given `xhr`.\n *\n * - set flags (.ok, .error, etc)\n * - parse header\n *\n * Examples:\n *\n * Aliasing `superagent` as `request` is nice:\n *\n * request = superagent;\n *\n * We can use the promise-like API, or pass callbacks:\n *\n * request.get('/').end(function(res){});\n * request.get('/', function(res){});\n *\n * Sending data can be chained:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' })\n * .end(function(res){});\n *\n * Or passed to `.send()`:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' }, function(res){});\n *\n * Or passed to `.post()`:\n *\n * request\n * .post('/user', { name: 'tj' })\n * .end(function(res){});\n *\n * Or further reduced to a single call for simple cases:\n *\n * request\n * .post('/user', { name: 'tj' }, function(res){});\n *\n * @param {XMLHTTPRequest} xhr\n * @param {Object} options\n * @api private\n */\n\nfunction Response(req, options) {\n options = options || {};\n this.req = req;\n this.xhr = this.req.xhr;\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')\n ? this.xhr.responseText\n : null;\n this.statusText = this.req.xhr.statusText;\n this._setStatusProperties(this.xhr.status);\n this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());\n // getAllResponseHeaders sometimes falsely returns \"\" for CORS requests, but\n // getResponseHeader still works. so we get content-type even if getting\n // other headers fails.\n this.header['content-type'] = this.xhr.getResponseHeader('content-type');\n this._setHeaderProperties(this.header);\n this.body = this.req.method != 'HEAD'\n ? this._parseBody(this.text ? this.text : this.xhr.response)\n : null;\n}\n\n/**\n * Get case-insensitive `field` value.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nResponse.prototype.get = function(field){\n return this.header[field.toLowerCase()];\n};\n\n/**\n * Set header related properties:\n *\n * - `.type` the content type without params\n *\n * A response of \"Content-Type: text/plain; charset=utf-8\"\n * will provide you with a `.type` of \"text/plain\".\n *\n * @param {Object} header\n * @api private\n */\n\nResponse.prototype._setHeaderProperties = function(header){\n // content-type\n var ct = this.header['content-type'] || '';\n this.type = type(ct);\n\n // params\n var obj = params(ct);\n for (var key in obj) this[key] = obj[key];\n};\n\n/**\n * Parse the given body `str`.\n *\n * Used for auto-parsing of bodies. Parsers\n * are defined on the `superagent.parse` object.\n *\n * @param {String} str\n * @return {Mixed}\n * @api private\n */\n\nResponse.prototype._parseBody = function(str){\n var parse = request.parse[this.type];\n if (!parse && isJSON(this.type)) {\n parse = request.parse['application/json'];\n }\n return parse && str && (str.length || str instanceof Object)\n ? parse(str)\n : null;\n};\n\n/**\n * Set flags such as `.ok` based on `status`.\n *\n * For example a 2xx response will give you a `.ok` of __true__\n * whereas 5xx will be __false__ and `.error` will be __true__. The\n * `.clientError` and `.serverError` are also available to be more\n * specific, and `.statusType` is the class of error ranging from 1..5\n * sometimes useful for mapping respond colors etc.\n *\n * \"sugar\" properties are also defined for common cases. Currently providing:\n *\n * - .noContent\n * - .badRequest\n * - .unauthorized\n * - .notAcceptable\n * - .notFound\n *\n * @param {Number} status\n * @api private\n */\n\nResponse.prototype._setStatusProperties = function(status){\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n if (status === 1223) {\n status = 204;\n }\n\n var type = status / 100 | 0;\n\n // status / class\n this.status = this.statusCode = status;\n this.statusType = type;\n\n // basics\n this.info = 1 == type;\n this.ok = 2 == type;\n this.clientError = 4 == type;\n this.serverError = 5 == type;\n this.error = (4 == type || 5 == type)\n ? this.toError()\n : false;\n\n // sugar\n this.accepted = 202 == status;\n this.noContent = 204 == status;\n this.badRequest = 400 == status;\n this.unauthorized = 401 == status;\n this.notAcceptable = 406 == status;\n this.notFound = 404 == status;\n this.forbidden = 403 == status;\n};\n\n/**\n * Return an `Error` representative of this response.\n *\n * @return {Error}\n * @api public\n */\n\nResponse.prototype.toError = function(){\n var req = this.req;\n var method = req.method;\n var url = req.url;\n\n var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';\n var err = new Error(msg);\n err.status = this.status;\n err.method = method;\n err.url = url;\n\n return err;\n};\n\n/**\n * Expose `Response`.\n */\n\nrequest.Response = Response;\n\n/**\n * Initialize a new `Request` with the given `method` and `url`.\n *\n * @param {String} method\n * @param {String} url\n * @api public\n */\n\nfunction Request(method, url) {\n var self = this;\n this._query = this._query || [];\n this.method = method;\n this.url = url;\n this.header = {}; // preserves header name case\n this._header = {}; // coerces header names to lowercase\n this.on('end', function(){\n var err = null;\n var res = null;\n\n try {\n res = new Response(self);\n } catch(e) {\n err = new Error('Parser is unable to parse the response');\n err.parse = true;\n err.original = e;\n // issue #675: return the raw response if the response parsing fails\n err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null;\n // issue #876: return the http status code if the response parsing fails\n err.statusCode = self.xhr && self.xhr.status ? self.xhr.status : null;\n return self.callback(err);\n }\n\n self.emit('response', res);\n\n var new_err;\n try {\n if (res.status < 200 || res.status >= 300) {\n new_err = new Error(res.statusText || 'Unsuccessful HTTP response');\n new_err.original = err;\n new_err.response = res;\n new_err.status = res.status;\n }\n } catch(e) {\n new_err = e; // #985 touching res may cause INVALID_STATE_ERR on old Android\n }\n\n // #1000 don't catch errors from the callback to avoid double calling it\n if (new_err) {\n self.callback(new_err, res);\n } else {\n self.callback(null, res);\n }\n });\n}\n\n/**\n * Mixin `Emitter` and `requestBase`.\n */\n\nEmitter(Request.prototype);\nfor (var key in requestBase) {\n Request.prototype[key] = requestBase[key];\n}\n\n/**\n * Set Content-Type to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.xml = 'application/xml';\n *\n * request.post('/')\n * .type('xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * request.post('/')\n * .type('application/xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * @param {String} type\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.type = function(type){\n this.set('Content-Type', request.types[type] || type);\n return this;\n};\n\n/**\n * Set responseType to `val`. Presently valid responseTypes are 'blob' and\n * 'arraybuffer'.\n *\n * Examples:\n *\n * req.get('/')\n * .responseType('blob')\n * .end(callback);\n *\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.responseType = function(val){\n this._responseType = val;\n return this;\n};\n\n/**\n * Set Accept to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.json = 'application/json';\n *\n * request.get('/agent')\n * .accept('json')\n * .end(callback);\n *\n * request.get('/agent')\n * .accept('application/json')\n * .end(callback);\n *\n * @param {String} accept\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.accept = function(type){\n this.set('Accept', request.types[type] || type);\n return this;\n};\n\n/**\n * Set Authorization field value with `user` and `pass`.\n *\n * @param {String} user\n * @param {String} pass\n * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic')\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.auth = function(user, pass, options){\n if (!options) {\n options = {\n type: 'basic'\n }\n }\n\n switch (options.type) {\n case 'basic':\n var str = btoa(user + ':' + pass);\n this.set('Authorization', 'Basic ' + str);\n break;\n\n case 'auto':\n this.username = user;\n this.password = pass;\n break;\n }\n return this;\n};\n\n/**\n* Add query-string `val`.\n*\n* Examples:\n*\n* request.get('/shoes')\n* .query('size=10')\n* .query({ color: 'blue' })\n*\n* @param {Object|String} val\n* @return {Request} for chaining\n* @api public\n*/\n\nRequest.prototype.query = function(val){\n if ('string' != typeof val) val = serialize(val);\n if (val) this._query.push(val);\n return this;\n};\n\n/**\n * Queue the given `file` as an attachment to the specified `field`,\n * with optional `filename`.\n *\n * ``` js\n * request.post('/upload')\n * .attach('content', new Blob(['<a id=\"a\"><b id=\"b\">hey!</b></a>'], { type: \"text/html\"}))\n * .end(callback);\n * ```\n *\n * @param {String} field\n * @param {Blob|File} file\n * @param {String} filename\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.attach = function(field, file, filename){\n this._getFormData().append(field, file, filename || file.name);\n return this;\n};\n\nRequest.prototype._getFormData = function(){\n if (!this._formData) {\n this._formData = new root.FormData();\n }\n return this._formData;\n};\n\n/**\n * Invoke the callback with `err` and `res`\n * and handle arity check.\n *\n * @param {Error} err\n * @param {Response} res\n * @api private\n */\n\nRequest.prototype.callback = function(err, res){\n var fn = this._callback;\n this.clearTimeout();\n fn(err, res);\n};\n\n/**\n * Invoke callback with x-domain error.\n *\n * @api private\n */\n\nRequest.prototype.crossDomainError = function(){\n var err = new Error('Request has been terminated\\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');\n err.crossDomain = true;\n\n err.status = this.status;\n err.method = this.method;\n err.url = this.url;\n\n this.callback(err);\n};\n\n/**\n * Invoke callback with timeout error.\n *\n * @api private\n */\n\nRequest.prototype._timeoutError = function(){\n var timeout = this._timeout;\n var err = new Error('timeout of ' + timeout + 'ms exceeded');\n err.timeout = timeout;\n this.callback(err);\n};\n\n/**\n * Compose querystring to append to req.url\n *\n * @api private\n */\n\nRequest.prototype._appendQueryString = function(){\n var query = this._query.join('&');\n if (query) {\n this.url += ~this.url.indexOf('?')\n ? '&' + query\n : '?' + query;\n }\n};\n\n/**\n * Initiate request, invoking callback `fn(res)`\n * with an instanceof `Response`.\n *\n * @param {Function} fn\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.end = function(fn){\n var self = this;\n var xhr = this.xhr = request.getXHR();\n var timeout = this._timeout;\n var data = this._formData || this._data;\n\n // store callback\n this._callback = fn || noop;\n\n // state change\n xhr.onreadystatechange = function(){\n if (4 != xhr.readyState) return;\n\n // In IE9, reads to any property (e.g. status) off of an aborted XHR will\n // result in the error \"Could not complete the operation due to error c00c023f\"\n var status;\n try { status = xhr.status } catch(e) { status = 0; }\n\n if (0 == status) {\n if (self.timedout) return self._timeoutError();\n if (self._aborted) return;\n return self.crossDomainError();\n }\n self.emit('end');\n };\n\n // progress\n var handleProgress = function(direction, e) {\n if (e.total > 0) {\n e.percent = e.loaded / e.total * 100;\n }\n e.direction = direction;\n self.emit('progress', e);\n }\n if (this.hasListeners('progress')) {\n try {\n xhr.onprogress = handleProgress.bind(null, 'download');\n if (xhr.upload) {\n xhr.upload.onprogress = handleProgress.bind(null, 'upload');\n }\n } catch(e) {\n // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.\n // Reported here:\n // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context\n }\n }\n\n // timeout\n if (timeout && !this._timer) {\n this._timer = setTimeout(function(){\n self.timedout = true;\n self.abort();\n }, timeout);\n }\n\n // querystring\n this._appendQueryString();\n\n // initiate request\n if (this.username && this.password) {\n xhr.open(this.method, this.url, true, this.username, this.password);\n } else {\n xhr.open(this.method, this.url, true);\n }\n\n // CORS\n if (this._withCredentials) xhr.withCredentials = true;\n\n // body\n if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !this._isHost(data)) {\n // serialize stuff\n var contentType = this._header['content-type'];\n var serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];\n if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json'];\n if (serialize) data = serialize(data);\n }\n\n // set header fields\n for (var field in this.header) {\n if (null == this.header[field]) continue;\n xhr.setRequestHeader(field, this.header[field]);\n }\n\n if (this._responseType) {\n xhr.responseType = this._responseType;\n }\n\n // send stuff\n this.emit('request', this);\n\n // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)\n // We need null here if data is undefined\n xhr.send(typeof data !== 'undefined' ? data : null);\n return this;\n};\n\n\n/**\n * Expose `Request`.\n */\n\nrequest.Request = Request;\n\n/**\n * GET `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.get = function(url, data, fn){\n var req = request('GET', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.query(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * HEAD `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.head = function(url, data, fn){\n var req = request('HEAD', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * OPTIONS query to `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.options = function(url, data, fn){\n var req = request('OPTIONS', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * DELETE `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nfunction del(url, fn){\n var req = request('DELETE', url);\n if (fn) req.end(fn);\n return req;\n};\n\nrequest['del'] = del;\nrequest['delete'] = del;\n\n/**\n * PATCH `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.patch = function(url, data, fn){\n var req = request('PATCH', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * POST `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.post = function(url, data, fn){\n var req = request('POST', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * PUT `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.put = function(url, data, fn){\n var req = request('PUT', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n","/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(obj) {\n return null !== obj && 'object' === typeof obj;\n}\n\nmodule.exports = isObject;\n","/**\n * Module of mixed-in functions shared between node and client code\n */\nvar isObject = require('./is-object');\n\n/**\n * Clear previous timeout.\n *\n * @return {Request} for chaining\n * @api public\n */\n\nexports.clearTimeout = function _clearTimeout(){\n this._timeout = 0;\n clearTimeout(this._timer);\n return this;\n};\n\n/**\n * Override default response body parser\n *\n * This function will be called to convert incoming data into request.body\n *\n * @param {Function}\n * @api public\n */\n\nexports.parse = function parse(fn){\n this._parser = fn;\n return this;\n};\n\n/**\n * Override default request body serializer\n *\n * This function will be called to convert data set via .send or .attach into payload to send\n *\n * @param {Function}\n * @api public\n */\n\nexports.serialize = function serialize(fn){\n this._serializer = fn;\n return this;\n};\n\n/**\n * Set timeout to `ms`.\n *\n * @param {Number} ms\n * @return {Request} for chaining\n * @api public\n */\n\nexports.timeout = function timeout(ms){\n this._timeout = ms;\n return this;\n};\n\n/**\n * Promise support\n *\n * @param {Function} resolve\n * @param {Function} reject\n * @return {Request}\n */\n\nexports.then = function then(resolve, reject) {\n if (!this._fullfilledPromise) {\n var self = this;\n this._fullfilledPromise = new Promise(function(innerResolve, innerReject){\n self.end(function(err, res){\n if (err) innerReject(err); else innerResolve(res);\n });\n });\n }\n return this._fullfilledPromise.then(resolve, reject);\n}\n\nexports.catch = function(cb) {\n return this.then(undefined, cb);\n};\n\n/**\n * Allow for extension\n */\n\nexports.use = function use(fn) {\n fn(this);\n return this;\n}\n\n\n/**\n * Get request header `field`.\n * Case-insensitive.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nexports.get = function(field){\n return this._header[field.toLowerCase()];\n};\n\n/**\n * Get case-insensitive header `field` value.\n * This is a deprecated internal API. Use `.get(field)` instead.\n *\n * (getHeader is no longer used internally by the superagent code base)\n *\n * @param {String} field\n * @return {String}\n * @api private\n * @deprecated\n */\n\nexports.getHeader = exports.get;\n\n/**\n * Set header `field` to `val`, or multiple fields with one object.\n * Case-insensitive.\n *\n * Examples:\n *\n * req.get('/')\n * .set('Accept', 'application/json')\n * .set('X-API-Key', 'foobar')\n * .end(callback);\n *\n * req.get('/')\n * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })\n * .end(callback);\n *\n * @param {String|Object} field\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nexports.set = function(field, val){\n if (isObject(field)) {\n for (var key in field) {\n this.set(key, field[key]);\n }\n return this;\n }\n this._header[field.toLowerCase()] = val;\n this.header[field] = val;\n return this;\n};\n\n/**\n * Remove header `field`.\n * Case-insensitive.\n *\n * Example:\n *\n * req.get('/')\n * .unset('User-Agent')\n * .end(callback);\n *\n * @param {String} field\n */\nexports.unset = function(field){\n delete this._header[field.toLowerCase()];\n delete this.header[field];\n return this;\n};\n\n/**\n * Write the field `name` and `val`, or multiple fields with one object\n * for \"multipart/form-data\" request bodies.\n *\n * ``` js\n * request.post('/upload')\n * .field('foo', 'bar')\n * .end(callback);\n *\n * request.post('/upload')\n * .field({ foo: 'bar', baz: 'qux' })\n * .end(callback);\n * ```\n *\n * @param {String|Object} name\n * @param {String|Blob|File|Buffer|fs.ReadStream} val\n * @return {Request} for chaining\n * @api public\n */\nexports.field = function(name, val) {\n\n // name should be either a string or an object.\n if (null === name || undefined === name) {\n throw new Error('.field(name, val) name can not be empty');\n }\n\n if (isObject(name)) {\n for (var key in name) {\n this.field(key, name[key]);\n }\n return this;\n }\n\n // val should be defined now\n if (null === val || undefined === val) {\n throw new Error('.field(name, val) val can not be empty');\n }\n this._getFormData().append(name, val);\n return this;\n};\n\n/**\n * Abort the request, and clear potential timeout.\n *\n * @return {Request}\n * @api public\n */\nexports.abort = function(){\n if (this._aborted) {\n return this;\n }\n this._aborted = true;\n this.xhr && this.xhr.abort(); // browser\n this.req && this.req.abort(); // node\n this.clearTimeout();\n this.emit('abort');\n return this;\n};\n\n/**\n * Enable transmission of cookies with x-domain requests.\n *\n * Note that for this to work the origin must not be\n * using \"Access-Control-Allow-Origin\" with a wildcard,\n * and also must set \"Access-Control-Allow-Credentials\"\n * to \"true\".\n *\n * @api public\n */\n\nexports.withCredentials = function(){\n // This is browser-only functionality. Node side is no-op.\n this._withCredentials = true;\n return this;\n};\n\n/**\n * Set the max redirects to `n`. Does noting in browser XHR implementation.\n *\n * @param {Number} n\n * @return {Request} for chaining\n * @api public\n */\n\nexports.redirects = function(n){\n this._maxRedirects = n;\n return this;\n};\n\n/**\n * Convert to a plain javascript object (not JSON string) of scalar properties.\n * Note as this method is designed to return a useful non-this value,\n * it cannot be chained.\n *\n * @return {Object} describing method, url, and data of this request\n * @api public\n */\n\nexports.toJSON = function(){\n return {\n method: this.method,\n url: this.url,\n data: this._data,\n headers: this._header\n };\n};\n\n/**\n * Check if `obj` is a host object,\n * we don't want to serialize these :)\n *\n * TODO: future proof, move to compoent land\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nexports._isHost = function _isHost(obj) {\n var str = {}.toString.call(obj);\n\n switch (str) {\n case '[object File]':\n case '[object Blob]':\n case '[object FormData]':\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Send `data` as the request body, defaulting the `.type()` to \"json\" when\n * an object is given.\n *\n * Examples:\n *\n * // manual json\n * request.post('/user')\n * .type('json')\n * .send('{\"name\":\"tj\"}')\n * .end(callback)\n *\n * // auto json\n * request.post('/user')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // manual x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send('name=tj')\n * .end(callback)\n *\n * // auto x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // defaults to x-www-form-urlencoded\n * request.post('/user')\n * .send('name=tobi')\n * .send('species=ferret')\n * .end(callback)\n *\n * @param {String|Object} data\n * @return {Request} for chaining\n * @api public\n */\n\nexports.send = function(data){\n var obj = isObject(data);\n var type = this._header['content-type'];\n\n // merge\n if (obj && isObject(this._data)) {\n for (var key in data) {\n this._data[key] = data[key];\n }\n } else if ('string' == typeof data) {\n // default to x-www-form-urlencoded\n if (!type) this.type('form');\n type = this._header['content-type'];\n if ('application/x-www-form-urlencoded' == type) {\n this._data = this._data\n ? this._data + '&' + data\n : data;\n } else {\n this._data = (this._data || '') + data;\n }\n } else {\n this._data = data;\n }\n\n if (!obj || this._isHost(data)) return this;\n\n // default to json\n if (!type) this.type('json');\n return this;\n};\n","// The node and browser modules expose versions of this with the\n// appropriate constructor function bound as first argument\n/**\n * Issue a request:\n *\n * Examples:\n *\n * request('GET', '/users').end(callback)\n * request('/users').end(callback)\n * request('/users', callback)\n *\n * @param {String} method\n * @param {String|Function} url or callback\n * @return {Request}\n * @api public\n */\n\nfunction request(RequestConstructor, method, url) {\n // callback\n if ('function' == typeof url) {\n return new RequestConstructor('GET', method).end(url);\n }\n\n // url first\n if (2 == arguments.length) {\n return new RequestConstructor('GET', method);\n }\n\n return new RequestConstructor(method, url);\n}\n\nmodule.exports = request;\n"]}
|