mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 08:39:03 +08:00
1 line
1.2 MiB
1 line
1.2 MiB
{"version":3,"sources":["webpack://@flarum/core/webpack/bootstrap","webpack://@flarum/core/./forum.ts","webpack://@flarum/core/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@flarum/core/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/core/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/core/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/core/./node_modules/zepto/dist/zepto.js","webpack://@flarum/core/./node_modules/classNames/index.js","webpack://@flarum/core/./node_modules/dayjs/dayjs.min.js","webpack://@flarum/core/./node_modules/m.attrs.bidi/bidi.js","webpack://@flarum/core/./node_modules/mithril/index.js","webpack://@flarum/core/./node_modules/mousetrap/mousetrap.js","webpack://@flarum/core/./node_modules/bootstrap/js/dropdown.js","webpack://@flarum/core/./node_modules/bootstrap/js/transition.js","webpack://@flarum/core/./node_modules/dayjs/plugin/localizedFormat.js","webpack://@flarum/core/./node_modules/dayjs/plugin/relativeTime.js","webpack://@flarum/core/./node_modules/mousetrap/mousetrap.js-exposed","webpack://@flarum/core/./node_modules/classNames/index.js-exposed","webpack://@flarum/core/./node_modules/dayjs/dayjs.min.js-exposed","webpack://@flarum/core/./node_modules/zepto/dist/zepto.js-exposed","webpack://@flarum/core/./node_modules/mithril/index.js-exposed","webpack://@flarum/core/./node_modules/m.attrs.bidi/bidi.js-exposed","webpack://@flarum/core/./node_modules/dayjs/dayjs.min.js-exposed?da0f","webpack://@flarum/core/./node_modules/hc-sticky/dist/hc-sticky.js","webpack://@flarum/core/./node_modules/jump.js/dist/jump.module.js","webpack://@flarum/core/./node_modules/lodash/_Symbol.js","webpack://@flarum/core/./node_modules/lodash/_arrayPush.js","webpack://@flarum/core/./node_modules/lodash/_baseFlatten.js","webpack://@flarum/core/./node_modules/lodash/_baseGetTag.js","webpack://@flarum/core/./node_modules/lodash/_baseIsArguments.js","webpack://@flarum/core/./node_modules/lodash/_freeGlobal.js","webpack://@flarum/core/./node_modules/lodash/_getRawTag.js","webpack://@flarum/core/./node_modules/lodash/_isFlattenable.js","webpack://@flarum/core/./node_modules/lodash/_objectToString.js","webpack://@flarum/core/./node_modules/lodash/_root.js","webpack://@flarum/core/./node_modules/lodash/flattenDeep.js","webpack://@flarum/core/./node_modules/lodash/isArguments.js","webpack://@flarum/core/./node_modules/lodash/isArray.js","webpack://@flarum/core/./node_modules/lodash/isObjectLike.js","webpack://@flarum/core/./node_modules/micromodal/dist/micromodal.es.js","webpack://@flarum/core/./node_modules/mithril/api/mount-redraw.js","webpack://@flarum/core/./node_modules/mithril/api/router.js","webpack://@flarum/core/./node_modules/mithril/hyperscript.js","webpack://@flarum/core/./node_modules/mithril/mount-redraw.js","webpack://@flarum/core/./node_modules/mithril/pathname/assign.js","webpack://@flarum/core/./node_modules/mithril/pathname/build.js","webpack://@flarum/core/./node_modules/mithril/pathname/compileTemplate.js","webpack://@flarum/core/./node_modules/mithril/pathname/parse.js","webpack://@flarum/core/./node_modules/mithril/promise/polyfill.js","webpack://@flarum/core/./node_modules/mithril/promise/promise.js","webpack://@flarum/core/./node_modules/mithril/querystring/build.js","webpack://@flarum/core/./node_modules/mithril/querystring/parse.js","webpack://@flarum/core/./node_modules/mithril/render.js","webpack://@flarum/core/./node_modules/mithril/render/fragment.js","webpack://@flarum/core/./node_modules/mithril/render/hyperscript.js","webpack://@flarum/core/./node_modules/mithril/render/hyperscriptVnode.js","webpack://@flarum/core/./node_modules/mithril/render/render.js","webpack://@flarum/core/./node_modules/mithril/render/trust.js","webpack://@flarum/core/./node_modules/mithril/render/vnode.js","webpack://@flarum/core/./node_modules/mithril/request.js","webpack://@flarum/core/./node_modules/mithril/request/request.js","webpack://@flarum/core/./node_modules/mithril/route.js","webpack://@flarum/core/./node_modules/mithril/stream.js","webpack://@flarum/core/./node_modules/mithril/stream/stream.js","webpack://@flarum/core/../../src/utils/isBrowser.js","webpack://@flarum/core/../../src/utils/debounce.js","webpack://@flarum/core/../../src/utils/isFunction.js","webpack://@flarum/core/../../src/utils/getStyleComputedProperty.js","webpack://@flarum/core/../../src/utils/getParentNode.js","webpack://@flarum/core/../../src/utils/getScrollParent.js","webpack://@flarum/core/../../src/utils/getReferenceNode.js","webpack://@flarum/core/../../src/utils/isIE.js","webpack://@flarum/core/../../src/utils/getOffsetParent.js","webpack://@flarum/core/../../src/utils/isOffsetContainer.js","webpack://@flarum/core/../../src/utils/getRoot.js","webpack://@flarum/core/../../src/utils/findCommonOffsetParent.js","webpack://@flarum/core/../../src/utils/getScroll.js","webpack://@flarum/core/../../src/utils/includeScroll.js","webpack://@flarum/core/../../src/utils/getBordersSize.js","webpack://@flarum/core/../../src/utils/getWindowSizes.js","webpack://@flarum/core/../../src/utils/getClientRect.js","webpack://@flarum/core/../../src/utils/getBoundingClientRect.js","webpack://@flarum/core/../../src/utils/getOffsetRectRelativeToArbitraryNode.js","webpack://@flarum/core/../../src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","webpack://@flarum/core/../../src/utils/isFixed.js","webpack://@flarum/core/../../src/utils/getFixedPositionOffsetParent.js","webpack://@flarum/core/../../src/utils/getBoundaries.js","webpack://@flarum/core/../../src/utils/computeAutoPlacement.js","webpack://@flarum/core/../../src/utils/getReferenceOffsets.js","webpack://@flarum/core/../../src/utils/getOuterSizes.js","webpack://@flarum/core/../../src/utils/getOppositePlacement.js","webpack://@flarum/core/../../src/utils/getPopperOffsets.js","webpack://@flarum/core/../../src/utils/find.js","webpack://@flarum/core/../../src/utils/findIndex.js","webpack://@flarum/core/../../src/utils/runModifiers.js","webpack://@flarum/core/../../src/methods/update.js","webpack://@flarum/core/../../src/utils/isModifierEnabled.js","webpack://@flarum/core/../../src/utils/getSupportedPropertyName.js","webpack://@flarum/core/../../src/methods/destroy.js","webpack://@flarum/core/../../src/utils/getWindow.js","webpack://@flarum/core/../../src/utils/setupEventListeners.js","webpack://@flarum/core/../../src/methods/enableEventListeners.js","webpack://@flarum/core/../../src/utils/removeEventListeners.js","webpack://@flarum/core/../../src/methods/disableEventListeners.js","webpack://@flarum/core/../../src/utils/isNumeric.js","webpack://@flarum/core/../../src/utils/setStyles.js","webpack://@flarum/core/../../src/utils/setAttributes.js","webpack://@flarum/core/../../src/modifiers/applyStyle.js","webpack://@flarum/core/../../src/utils/getRoundedOffsets.js","webpack://@flarum/core/../../src/modifiers/computeStyle.js","webpack://@flarum/core/../../src/utils/isModifierRequired.js","webpack://@flarum/core/../../src/modifiers/arrow.js","webpack://@flarum/core/../../src/utils/getOppositeVariation.js","webpack://@flarum/core/../../src/methods/placements.js","webpack://@flarum/core/../../src/utils/clockwise.js","webpack://@flarum/core/../../src/modifiers/flip.js","webpack://@flarum/core/../../src/modifiers/keepTogether.js","webpack://@flarum/core/../../src/modifiers/offset.js","webpack://@flarum/core/../../src/modifiers/preventOverflow.js","webpack://@flarum/core/../../src/modifiers/shift.js","webpack://@flarum/core/../../src/modifiers/hide.js","webpack://@flarum/core/../../src/modifiers/inner.js","webpack://@flarum/core/../../src/modifiers/index.js","webpack://@flarum/core/../../src/methods/defaults.js","webpack://@flarum/core/../../src/index.js","webpack://@flarum/core/./node_modules/process/browser.js","webpack://@flarum/core/./node_modules/setimmediate/setImmediate.js","webpack://@flarum/core/./node_modules/spin.js/spin.js","webpack://@flarum/core/./node_modules/timers-browserify/main.js","webpack://@flarum/core/../../../popper/src/utils/isFunction.js","webpack://@flarum/core/(webpack)/buildin/amd-options.js","webpack://@flarum/core/(webpack)/buildin/global.js","webpack://@flarum/core/(webpack)/buildin/harmony-module.js","webpack://@flarum/core/./node_modules/zepto/src/data.js","webpack://@flarum/core/./node_modules/zepto/src/fx.js","webpack://@flarum/core/./node_modules/zepto/src/fx_methods.js","webpack://@flarum/core/./node_modules/zepto/src/selector.js","webpack://@flarum/core/./src/common/Application.ts","webpack://@flarum/core/./src/common/Component.ts","webpack://@flarum/core/./src/common/Model.ts","webpack://@flarum/core/./src/common/Session.ts","webpack://@flarum/core/./src/common/Store.ts","webpack://@flarum/core/./src/common/Translator.ts","webpack://@flarum/core/./src/common/compat.ts","webpack://@flarum/core/./src/common/components/Alert.tsx","webpack://@flarum/core/./src/common/components/AlertManager.tsx","webpack://@flarum/core/./src/common/components/Badge.tsx","webpack://@flarum/core/./src/common/components/Button.tsx","webpack://@flarum/core/./src/common/components/Checkbox.tsx","webpack://@flarum/core/./src/common/components/Dropdown.tsx","webpack://@flarum/core/./src/common/components/FieldSet.tsx","webpack://@flarum/core/./src/common/components/GroupBadge.ts","webpack://@flarum/core/./src/common/components/LinkButton.tsx","webpack://@flarum/core/./src/common/components/LoadingIndicator.tsx","webpack://@flarum/core/./src/common/components/Modal.tsx","webpack://@flarum/core/./src/common/components/ModalManager.tsx","webpack://@flarum/core/./src/common/components/Placeholder.tsx","webpack://@flarum/core/./src/common/components/RequestErrorModal.tsx","webpack://@flarum/core/./src/common/components/SelectDropdown.tsx","webpack://@flarum/core/./src/common/components/Separator.tsx","webpack://@flarum/core/./src/common/components/SplitDropdown.tsx","webpack://@flarum/core/./src/common/components/Switch.tsx","webpack://@flarum/core/./src/common/extend.ts","webpack://@flarum/core/./src/common/helpers/avatar.tsx","webpack://@flarum/core/./src/common/helpers/fullTime.tsx","webpack://@flarum/core/./src/common/helpers/highlight.ts","webpack://@flarum/core/./src/common/helpers/humanTime.tsx","webpack://@flarum/core/./src/common/helpers/icon.tsx","webpack://@flarum/core/./src/common/helpers/listItems.tsx","webpack://@flarum/core/./src/common/helpers/userOnline.tsx","webpack://@flarum/core/./src/common/helpers/username.tsx","webpack://@flarum/core/./src/common/index.ts","webpack://@flarum/core/./src/common/models/Discussion.tsx","webpack://@flarum/core/./src/common/models/Forum.ts","webpack://@flarum/core/./src/common/models/Group.ts","webpack://@flarum/core/./src/common/models/Notification.ts","webpack://@flarum/core/./src/common/models/Post.ts","webpack://@flarum/core/./src/common/models/User.ts","webpack://@flarum/core/./src/common/utils/Drawer.ts","webpack://@flarum/core/./src/common/utils/ItemList.ts","webpack://@flarum/core/./src/common/utils/RequestError.ts","webpack://@flarum/core/./src/common/utils/ScrollListener.ts","webpack://@flarum/core/./src/common/utils/SubtreeRetainer.ts","webpack://@flarum/core/./src/common/utils/abbreviateNumber.tsx","webpack://@flarum/core/./src/common/utils/anchorScroll.ts","webpack://@flarum/core/./src/common/utils/computed.ts","webpack://@flarum/core/./src/common/utils/evented.ts","webpack://@flarum/core/./src/common/utils/extract.ts","webpack://@flarum/core/./src/common/utils/extractText.ts","webpack://@flarum/core/./src/common/utils/formatNumber.ts","webpack://@flarum/core/./src/common/utils/humanTime.ts","webpack://@flarum/core/./src/common/utils/mapRoutes.ts","webpack://@flarum/core/./src/common/utils/patchMithril.ts","webpack://@flarum/core/./src/common/utils/patchZepto.ts","webpack://@flarum/core/./src/common/utils/string.ts","webpack://@flarum/core/./src/common/utils/stringToColor.ts","webpack://@flarum/core/./src/forum/Forum.ts","webpack://@flarum/core/./src/forum/compat.ts","webpack://@flarum/core/./src/forum/components/AvatarEditor.tsx","webpack://@flarum/core/./src/forum/components/ChangeEmailModal.tsx","webpack://@flarum/core/./src/forum/components/ChangePasswordModal.tsx","webpack://@flarum/core/./src/forum/components/CommentPost.tsx","webpack://@flarum/core/./src/forum/components/DiscussionHero.tsx","webpack://@flarum/core/./src/forum/components/DiscussionList.tsx","webpack://@flarum/core/./src/forum/components/DiscussionListItem.tsx","webpack://@flarum/core/./src/forum/components/DiscussionPage.tsx","webpack://@flarum/core/./src/forum/components/DiscussionsSearchSource.tsx","webpack://@flarum/core/./src/forum/components/DiscussionsUserPage.tsx","webpack://@flarum/core/./src/forum/components/HeaderPrimary.tsx","webpack://@flarum/core/./src/forum/components/HeaderSecondary.tsx","webpack://@flarum/core/./src/forum/components/IndexPage.tsx","webpack://@flarum/core/./src/forum/components/LoadingPost.tsx","webpack://@flarum/core/./src/forum/components/LogInButtons.tsx","webpack://@flarum/core/./src/forum/components/LogInModal.tsx","webpack://@flarum/core/./src/forum/components/NotificationGrid.tsx","webpack://@flarum/core/./src/forum/components/NotificationList.tsx","webpack://@flarum/core/./src/forum/components/NotificationsDropdown.tsx","webpack://@flarum/core/./src/forum/components/Page.tsx","webpack://@flarum/core/./src/forum/components/Post.tsx","webpack://@flarum/core/./src/forum/components/PostEdited.tsx","webpack://@flarum/core/./src/forum/components/PostMeta.tsx","webpack://@flarum/core/./src/forum/components/PostStream.tsx","webpack://@flarum/core/./src/forum/components/PostStreamScrubber.tsx","webpack://@flarum/core/./src/forum/components/PostUser.tsx","webpack://@flarum/core/./src/forum/components/PostsUserPage.tsx","webpack://@flarum/core/./src/forum/components/ReplyPlaceholder.tsx","webpack://@flarum/core/./src/forum/components/Search.tsx","webpack://@flarum/core/./src/forum/components/SearchSource.ts","webpack://@flarum/core/./src/forum/components/SessionDropdown.tsx","webpack://@flarum/core/./src/forum/components/SettingsPage.tsx","webpack://@flarum/core/./src/forum/components/SignUpModal.tsx","webpack://@flarum/core/./src/forum/components/TerminalPost.tsx","webpack://@flarum/core/./src/forum/components/UserCard.tsx","webpack://@flarum/core/./src/forum/components/UserPage.tsx","webpack://@flarum/core/./src/forum/components/UsersSearchSource.tsx","webpack://@flarum/core/./src/forum/components/WelcomeHero.tsx","webpack://@flarum/core/./src/forum/index.ts","webpack://@flarum/core/./src/forum/routes.ts","webpack://@flarum/core/./src/forum/utils/DiscussionControls.tsx","webpack://@flarum/core/./src/forum/utils/History.ts","webpack://@flarum/core/./src/forum/utils/KeyboardNavigatable.ts","webpack://@flarum/core/./src/forum/utils/PostControls.tsx","webpack://@flarum/core/./src/forum/utils/UserControls.ts","webpack://@flarum/core/./src/forum/utils/affixSidebar.ts","webpack://@flarum/core/external \"m\""],"names":["_assertThisInitialized","self","ReferenceError","_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_inheritsLoose","subClass","superClass","create","constructor","__proto__","_objectWithoutPropertiesLoose","excluded","sourceKeys","keys","indexOf","global","factory","define","window","Zepto","undefined","$","classList","emptyArray","concat","filter","slice","document","elementDisplay","classCache","cssNumber","fragmentRE","singleTagRE","tagExpanderRE","rootNodeRE","capitalRE","methodAttributes","adjacencyOperators","table","createElement","tableRow","containers","readyRE","simpleSelectorRE","class2type","toString","zepto","camelize","uniq","tempParent","propMap","isArray","Array","object","matches","element","selector","nodeType","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","match","parent","parentNode","temp","appendChild","qsa","removeChild","type","obj","String","isFunction","value","isWindow","isDocument","DOCUMENT_NODE","isObject","isPlainObject","getPrototypeOf","likeArray","compact","array","item","flatten","fn","str","replace","chr","toUpperCase","dasherize","toLowerCase","idx","classRE","name","RegExp","maybeAddPx","defaultDisplay","nodeName","display","body","getComputedStyle","getPropertyValue","children","map","childNodes","node","Z","dom","len","fragment","html","properties","nodes","container","test","$1","innerHTML","each","attr","isZ","init","context","trim","find","ready","extend","deep","args","shift","forEach","arg","found","maybeID","maybeClass","nameOnly","isSimple","getElementById","getElementsByClassName","getElementsByTagName","querySelectorAll","filtered","contains","documentElement","funcArg","payload","setAttribute","removeAttribute","className","klass","svg","baseVal","deserializeValue","parseJSON","e","isEmptyObject","isNumeric","val","num","Number","isNaN","isFinite","inArray","elem","camelCase","uuid","support","expr","noop","elements","callback","values","push","grep","JSON","parse","split","reduce","sort","splice","toArray","el","readyState","addEventListener","get","size","remove","every","not","add","is","excludes","has","eq","first","last","result","$this","some","closest","collection","_","parents","ancestors","pluck","contents","contentDocument","siblings","child","empty","property","show","style","replaceWith","newContent","before","wrap","structure","func","clone","index","wrapAll","cloneNode","append","wrapInner","unwrap","hide","css","toggle","setting","prev","next","originHtml","text","newText","textContent","join","getAttribute","removeAttr","attribute","prop","removeProp","data","attrName","multiple","selected","offset","coordinates","coords","parentOffset","offsetParent","props","top","left","getBoundingClientRect","pageXOffset","pageYOffset","width","Math","round","height","computedStyle","removeProperty","cssText","hasClass","addClass","cls","newName","removeClass","toggleClass","when","names","scrollTop","hasScrollTop","scrollTo","scrollX","scrollLeft","hasScrollLeft","scrollY","position","parseFloat","detach","dimension","dimensionProperty","m","traverseNode","fun","operator","operatorIndex","inside","argType","arr","copyByClone","nextSibling","firstChild","parentInDocument","insertBefore","src","ownerDocument","defaultView","_zid","isString","handlers","specialEvents","focusinSupported","focus","blur","hover","mouseenter","mouseleave","click","mousedown","mouseup","mousemove","zid","findHandlers","event","ns","matcher","matcherFor","handler","sel","parts","eventCapture","captureSetting","del","realEvent","events","delegator","capture","id","set","related","relatedTarget","proxy","compatible","isImmediatePropagationStopped","_args","preventDefault","stopPropagation","removeEventListener","proxyFn","unshift","TypeError","bind","on","unbind","off","one","returnTrue","returnFalse","ignoreProperties","eventMethods","stopImmediatePropagation","isDefaultPrevented","predicate","sourceMethod","timeStamp","Date","now","defaultPrevented","returnValue","getPreventDefault","createProxy","originalEvent","delegate","undelegate","live","die","autoRemove","evt","currentTarget","liveFired","trigger","Event","dispatchEvent","triggerHandler","createEvent","bubbles","initEvent","jsonpID","rscript","scriptTypeRE","xmlTypeRE","jsonType","htmlType","blankRE","originAnchor","href","location","triggerAndReturn","eventName","triggerGlobal","settings","active","ajaxStart","ajaxStop","ajaxBeforeSend","xhr","beforeSend","ajaxSuccess","deferred","status","success","resolveWith","ajaxComplete","ajaxError","error","rejectWith","complete","ajaxDataFilter","dataFilter","ajaxJSONP","options","ajax","_callbackName","jsonpCallback","callbackName","script","originalCallback","responseData","abort","errorType","abortTimeout","promise","clearTimeout","url","head","timeout","setTimeout","ajaxSettings","XMLHttpRequest","accepts","json","xml","crossDomain","processData","cache","mimeToDataType","mime","appendQuery","query","serializeData","param","traditional","dataType","Deferred","urlAnchor","hashIndex","protocol","host","hasPlaceholder","jsonp","headers","setHeader","nativeSetHeader","setRequestHeader","mimeType","overrideMimeType","contentType","onreadystatechange","getResponseHeader","responseType","response","responseText","eval","responseXML","statusText","async","open","username","password","xhrFields","send","parseArguments","post","getJSON","load","escape","encodeURIComponent","serialize","params","scope","hash","serializeArray","field","disabled","checked","elm","submit","nativeGetComputedStyle","pseudoElement","hasOwn","classNames","classes","inner","module","exports","default","t","n","r","s","u","o","a","h","f","c","d","z","utcOffset","abs","floor","year","month","ceil","p","M","y","w","D","ms","Q","weekdays","months","l","v","g","format","pl","date","locale","$L","utc","$u","$offset","$d","NaN","UTC","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","isSame","startOf","endOf","isAfter","isBefore","$g","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","$locale","weekStart","$set","min","daysInMonth","subtract","substr","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","isDayjs","en","Ls","_package","bidi","tag","attrs","multi","onchange","selectedOptions","x","oninput","option","view","ctrl","hyperscript","require","request","mountRedraw","trust","mount","route","render","redraw","parseQueryString","buildQueryString","parsePathname","buildPathname","vnode","PromisePolyfill","_MAP","_KEYCODE_MAP","_SHIFT_MAP","_SPECIAL_ALIASES","navigator","platform","_REVERSE_MAP","_addEvent","attachEvent","_characterFromEvent","character","fromCharCode","which","shiftKey","_modifiersMatch","modifiers1","modifiers2","_eventModifiers","modifiers","altKey","ctrlKey","metaKey","_preventDefault","_stopPropagation","cancelBubble","_isModifier","_getReverseMap","_pickBestAction","action","_keysFromString","combination","_getKeyInfo","_belongsTo","ancestor","Mousetrap","targetElement","_callbacks","_directMap","_sequenceLevels","_resetTimer","_ignoreNextKeyup","_ignoreNextKeypress","_nextExpectedAction","_resetSequences","doNotReset","activeSequences","_getMatches","sequenceName","level","seq","deleteCombo","combo","deleteSequence","_fireCallback","sequence","stopCallback","srcElement","_handleKey","callbacks","maxLevel","processedSequenceCallback","max","ignoreThisKeypress","_handleKeyEvent","keyCode","handleKey","_resetSequenceTimer","_bindSequence","_increaseSequence","nextAction","_callbackAndReset","isFinal","wrappedCallback","_bindSingle","info","_bindMultiple","combinations","reset","composedPath","initialEventTarget","tagName","isContentEditable","addKeycodes","documentMousetrap","method","charAt","backdrop","Dropdown","VERSION","getParent","$parent","clearMenus","isActive","insertAfter","keydown","desc","$items","Plugin","old","dropdown","Constructor","noConflict","jQuery","transitionEnd","transEndEventNames","WebkitTransition","MozTransition","OTransition","transition","end","emulateTransitionEnd","duration","called","$el","special","bsTransitionEnd","bindType","delegateType","handle","handleObj","LTS","LT","L","LL","LLL","LLLL","formats","relativeTime","future","past","yy","to","from","toNow","fromNow","Error","U","Y","bottom","bottomEnd","innerTop","innerSticker","stickyClass","stickTo","followScroll","responsive","mobileFirst","onStart","onStop","onBeforeResize","onResize","resizeDebounce","disable","queries","queryFlow","console","log","X","querySelector","Helpers","getStyle","innerWidth","stick","isAttached","attach","offsetLeft","release","stop","parseInt","positionLeft","marginLeft","b","S","k","E","T","j","O","C","getCascadedStyle","offsetHeight","right","verticalAlign","boxSizing","marginRight","marginTop","marginBottom","paddingLeft","paddingRight","float","cssFloat","MozBoxSizing","offsetWidth","HTMLDocument","Document","clientHeight","scrollHeight","innerHeight","offsetTop","N","R","B","I","q","F","P","debounce","W","V","refresh","update","destroy","triggerMethod","reinit","hcSticky","defineProperty","writable","configurable","handleEvent","detachEvent","currentStyle","borderTopWidth","borderLeftWidth","margin","easeInOutQuad","_typeof","Symbol","iterator","jumper","start","easing","a11y","distance","timeStart","timeElapsed","loop","timeCurrent","requestAnimationFrame","done","jump","singleton","root","arrayPush","isFlattenable","baseFlatten","depth","isStrict","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","toStringTag","baseGetTag","isObjectLike","argsTag","baseIsArguments","freeGlobal","objectProto","nativeObjectToString","isOwn","unmasked","isArguments","spreadableSymbol","isConcatSpreadable","freeSelf","Function","INFINITY","flattenDeep","propertyIsEnumerable","MicroModal","FOCUSABLE_ELEMENTS","Modal","targetModal","triggers","onShow","onClose","openTrigger","closeTrigger","disableScroll","disableFocus","awaitCloseAnimation","awaitOpenAnimation","debugMode","modal","config","registerTriggers","onClick","onKeydown","Boolean","showModal","activeElement","scrollBehaviour","addEventListeners","setFocusToFirstNode","closeModal","removeEventListeners","closeModalById","overflow","hasAttribute","maintainFocus","getFocusableNodes","focusableNodes","focusedItemIndex","activeModal","generateTriggerMap","triggerAttr","triggerMap","attributes","validateModalPresence","warn","validateTriggerPresence","validateArgs","close","Vnode","schedule","subscriptions","rendering","pending","sync","component","Promise","compileTemplate","sentinel","$window","fireAsync","setPath","path","state","title","history","replaceState","prefix","pushState","currentResolver","currentPath","lastUpdate","SKIP","defaultRoute","routes","compiled","SyntaxError","check","callAsync","setImmediate","resolve","scheduled","onremove","defaultData","resolveRoute","search","pathname","decodeURIComponent","fail","matchedRoute","localComp","comp","onmatch","then","onbeforeupdate","oncreate","Link","onclick","oninit","onupdate","onbeforeremove","button","template","queryIndex","queryEnd","pathEnd","resolved","variadic","newQueryIndex","newHashIndex","newQueryEnd","newPathEnd","querystring","templateData","templateKeys","regexp","extra","exec","executor","resolvers","rejectors","resolveCurrent","rejectCurrent","instance","_instance","list","shouldAbsorb","execute","executeOnce","retry","runs","run","onerror","onFulfilled","onRejection","resolveNext","rejectNext","reject","catch","finally","reason","all","total","count","consume","race","destructure","string","entries","counters","entry","levels","cursor","pop","nextLevel","isNumber","getOwnPropertyDescriptor","hyperscriptVnode","normalizeChildren","selectorParser","selectorCache","isEmpty","compileSelector","attrValue","execSelector","class","newAttrs","$doc","currentRedraw","nameSpace","math","getNameSpace","xmlns","checkState","original","callHook","createNodes","vnodes","hooks","createNode","initLifecycle","createText","createHTML","createFragment","createComponent","createTextNode","insertNode","possibleParents","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","domSize","createDocumentFragment","createElementNS","setAttrs","maybeSetContentEditable","setLateSelectAttrs","initComponent","$$reentrantLock$$","normalize","updateNodes","removeNodes","isOldKeyed","isKeyed","oldStart","commonLength","getNextSibling","removeNode","updateNode","oldEnd","oe","ve","topSibling","moveNodes","originalNextSibling","vnodesLength","oldIndices","li","pos","matched","lisIndices","getKeyMap","oldIndex","makeLisIndices","oldTag","shouldNotUpdate","updateLifecycle","updateText","updateHTML","updateFragment","updateElement","updateComponent","nodeValue","removeHTML","updateAttrs","lisTemp","il","frag","moveChildToFrag","contenteditable","contentEditable","content","mask","stateResult","attrsResult","reallyRemove","setAttr","isLifecycleMethod","isFormAttribute","updateEvent","setAttributeNS","updateStyle","hasPropertyKey","selectedIndex","nsLastIndex","normalized","uppercaseRegex","capital","normalizeKey","setProperty","EventDict","ev","force","namespace","namespaceURI","prevRedraw","input","oncompletion","callbackCount","PromiseProxy","makeRequest","background","hasHeader","assumeJSON","FormData","extract","aborted","replacedAbort","user","deserialize","withCredentials","message","code","stringify","random","callbackKey","Stream","lift","scan","merge","combine","scanMerge","warnedHalt","dependentStreams","dependentFns","stream","_changing","_state","_parents","_map","ignoreInitial","createEnd","_unregisterChild","s1","s2","childIndex","streams","changed","mappers","endStream","mapper","acc","origin","tuples","seed","tuple","timeoutDuration","longerTimeoutBrowsers","isBrowser","supportsMicroTasks","getType","functionToCheck","getStyleComputedProperty","overflowX","overflowY","getScrollParent","getParentNode","reference","isIE11","isIE10","version","noOffsetParent","isIE","getOffsetParent","getRoot","element1","element2","order","Node","range","commonAncestorContainer","isOffsetContainer","element1root","findCommonOffsetParent","side","upperSide","scrollingElement","getScroll","modifier","sideA","axis","sideB","styles","getSize","offsets","rect","sizes","getWindowSizes","horizScrollbar","vertScrollbar","getBordersSize","getClientRect","fixedPosition","runIsIE","isHTML","childrenRect","parentRect","scrollParent","includeScroll","excludeScroll","relativeOffset","getOffsetRectRelativeToArbitraryNode","isFixed","boundaries","getFixedPositionOffsetParent","getReferenceNode","boundariesElement","getViewportOffsetRectRelativeToArtbitraryNode","boundariesNode","popper","padding","isPaddingNumber","placement","getBoundaries","rects","refRect","sortedAreas","getArea","filteredAreas","computedPlacement","variation","commonOffsetParent","popperRect","getOuterSizes","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","referenceOffsets","getOppositePlacement","cur","modifiersToRun","ends","findIndex","getReferenceOffsets","computeAutoPlacement","getPopperOffsets","runModifiers","enabled","prefixes","upperProp","toCheck","isModifierEnabled","getSupportedPropertyName","isBody","passive","scrollElement","setupEventListeners","unit","noRound","referenceWidth","popperWidth","isVertical","isVariation","sameWidthParity","bothOddWidth","horizontalToInteger","verticalToInteger","isFirefox","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","getRoundedOffsets","prefixedProperty","invertTop","invertLeft","requesting","isRequired","requested","isModifierRequired","arrowElement","sideCapitalized","altSide","opSide","arrowElementSize","center","popperMarginSide","popperBorderSide","sideValue","validPlacements","placements","counter","BEHAVIORS","placementOpposite","flipOrder","clockwise","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariationByRef","flippedVariationByContent","flippedVariation","getOppositeVariation","useHeight","fragments","divider","splitRegex","ops","mergeWithPrevious","toValue","op","index2","basePlacement","parseOffset","transformProp","popperStyles","transform","shiftvariation","shiftOffsets","bound","subtractLength","keepTogether","Popper","modifierOptions","eventsEnabled","enableEventListeners","disableEventListeners","Utils","PopperUtils","Defaults","process","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","drainQueue","nextTick","Item","browser","env","argv","versions","addListener","once","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","nextHandle","tasksByHandle","currentlyRunningATask","doc","registerImmediate","task","clearImmediate","runIfPresent","installNextTickImplementation","canUsePostMessage","postMessage","importScripts","postMessageIsAsynchronous","oldOnMessage","onmessage","installPostMessageImplementation","messagePrefix","onGlobalMessage","installMessageChannelImplementation","channel","MessageChannel","port1","port2","installReadyStateChangeImplementation","installSetTimeoutImplementation","attachTo","__assign","defaults","lines","radius","scale","corners","color","fadeColor","animation","rotate","direction","speed","zIndex","shadow","Spinner","opts","spin","drawLines","cancelAnimationFrame","animateId","getColor","borderRadius","shadows","parseBoxShadow","degrees","backgroundLine","transformOrigin","delay","line","boxShadow","normalizeShadow","regex","_i","_a","xUnits","yUnits","shadows_1","xy","convertOffset","radians","PI","sin","cos","Timeout","setInterval","clearInterval","clearFn","_id","_clearFn","unref","ref","enroll","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","onTimeout","_onTimeout","DEFAULT_OPTIONS","Tooltip","allowHtml","tooltipGenerator","tooltipNode","titleNode","arrowSelector","directEvents","oppositeEvents","computedDelay","isSet","lastTitle","dispose","updateTitleContent","_events","_setTooltipNodeEvent","relatedreference","relatedreference2","evt2","originalModule","webpackPolyfill","enumerable","dataAttr","exp","expando","getData","store","setData","camelName","attributeData","hasData","removeData","methodName","origFn","eventPrefix","vendors","Webkit","Moz","testEl","supportedTransforms","transitionProperty","transitionDuration","transitionTiming","transitionDelay","animationName","animationDuration","animationTiming","animationDelay","cssReset","normalizeEvent","vendor","fx","speeds","_default","fast","slow","cssPrefix","animationEnd","animate","ease","anim","cssValues","cssProperties","transforms","that","endEvent","fired","clientLeft","docElem","origShow","origHide","origToggle","opacity","fadeTo","fadeIn","fadeOut","fadeToggle","oldQsa","oldMatches","visible","filters","hidden","filterRe","childRe","classTag","taggedParent","Application","forum","initializers","ItemList","session","translator","Translator","Store","forums","Forum","users","User","discussions","Discussion","posts","Post","groups","Group","notifications","Notification","booted","requestError","titleCount","drawer","Drawer","alerts","boot","initializer","pushPayload","resources","getById","Session","userId","csrfToken","bootExtensions","extensions","extension","extenders","extender","basePath","ModalManager","AlertManager","mapRoutes","ScrollListener","$app","preloadedApiDocument","apiDocument","results","setTitle","updateTitle","setTitleCount","queryString","originalOptions","errorHandler","RequestError","app","dismiss","alert","res","errors","detail","trans","isDebug","Alert","controls","Button","showDebug","RequestErrorModal","Component","setProps","$element","componentProps","initProps","Model","freshness","exists","pushData","innerKey","getIdentifier","pushAttributes","save","relationships","model","oldData","copyData","meta","apiEndpoint","delete","hasOne","relationship","hasMany","transformDate","login","logout","models","included","pushObject","createRecord","getBy","records","translations","addTranslations","parameters","translation","transText","extractText","transChoice","number","pluralize","hydrated","part","sPluralRegex","cPluralRegex","iPluralRegex","standardRules","explicitRules","rule","leftNumber","convertNumber","rightNumber","pluralPosition","NEGATIVE_INFINITY","POSITIVE_INFINITY","dismissible","ondismiss","dismissControl","listItems","components","clear","Badge","iconName","icon","label","tooltip","loading","getButtonContent","LoadingIndicator","Checkbox","withAttr","getDisplay","showing","buttonClassName","menuClassName","caretIcon","items","getButton","getMenu","onshow","$menu","isRight","onhide","FieldSet","GroupBadge","group","backgroundColor","nameSingular","LinkButton","vdom","sizeOptions","isDismissible","onsubmit","onready","select","loaded","pointer","hideTimeout","modalProps","appendTo","Placeholder","SelectDropdown","activeChild","defaultLabel","Separator","isListItem","SplitDropdown","getFirstChild","buttonProps","Switch","override","newMethod","avatar","hasTitle","displayName","avatarUrl","fullTime","time","mo","dayjs","datetime","full","highlight","phrase","highlighted","truncate","humanTime","ago","humanTimeUtil","fontClass","isSeparator","withoutUnnecessarySeparators","newItems","prevItem","itemClassName","itemName","userOnline","lastSeenAt","isOnline","localizedFormat","patchMithril","slug","createdAt","firstPost","lastPostedAt","lastPostedUser","lastPost","lastPostNumber","commentCount","replyCount","computed","mostRelevantPost","lastReadAt","lastReadPostNumber","isUnread","unreadCount","isRead","hiddenAt","hiddenUser","isHidden","canReply","canRename","canHide","canDelete","removePost","markedAllAsReadAt","badges","postIds","link","namePlural","ADMINISTRATOR_ID","GUEST_ID","MEMBER_ID","fromUser","subject","discussion","contentHtml","contentPlain","getPlainContent","editedAt","editedUser","isEdited","canEdit","email","isEmailConfirmed","preferences","joinTime","unreadNotificationCount","newNotificationCount","discussionCount","avatarColor","calculateAvatarColor","stringToColor","image","Image","onload","colorThief","ColorThief","crossOrigin","savePreferences","newPreferences","$backdrop","isOpen","priority","later","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","oRequestAnimationFrame","ticking","SubtreeRetainer","anchorScroll","relativeScroll","dependentKeys","compute","dependentValues","computedValue","recompute","Evented","getHandlers","wrapper","formatNumber","maximumSignificantDigits","toLocaleString","routeName","_m","cb","includes","Dimension","sides","leave","animatedScrollTop","slideUp","bindBeforeSpecialEvents","specialEvent","_init","originalHandler","$target","setup","substring","removeSelectors","ucfirst","hsvToRgb","charCodeAt","hue","rgb","History","postComponents","comment","CommentPost","previous","current","defaultAction","HeaderPrimary","HeaderSecondary","home","compat","IndexPage","AvatarEditor","isDraggedOver","quickUpload","enableDragover","disableDragover","dropUpload","controlItems","openPicker","upload","dataTransfer","files","$input","file","raw","failure","ChangeEmailModal","ChangePasswordModal","revealContent","postUser","subtree","cardVisible","isEditing","headerItems","configPreview","isInitialized","preview","updatePreview","composer","s9e","TextFormatter","updateInterval","onunload","toggleContent","DiscussionHero","DiscussionList","moreResults","loadMore","DiscussionListItem","requestParams","include","sortMap","relevance","latest","newest","oldest","loadResults","parseResults","preloadedDiscussions","page","links","removeDiscussion","addDiscussion","highlightRegExp","showUnread","showRepliesCount","jumpTo","DiscussionControls","markAsRead","infoItems","abbreviateNumber","slidableInstance","slidable","idParam","showFirstPost","excerpt","TerminalPost","DiscussionPage","near","scrubber","includedPosts","discussionList","bodyClass","goToNumber","postStream","positionChanged","oncreatePane","sidebarItems","preloadedDiscussion","discussionId","record","$list","pane","onmouseleave","hotEdge","pageX","$discussion","listTop","listBottom","outerHeight","discussionTop","discussionBottom","startNumber","endNumber","Page","DiscussionsSearchSource","limit","SearchSource","DiscussionsUserPage","loadUser","UserPage","Search","locales","reload","cookie","SignUpModal","LogInModal","lastDiscussion","hero","viewItems","actionItems","oldHeroHeight","heroHeight","scroll","indexTop","indexBottom","canStartDiscussion","newDiscussionAction","navItems","stickyParams","sortOptions","changeSort","markAllAsRead","searching","clearSearch","confirmation","confirm","LoadingPost","LogInButtons","identification","remember","footer","fields","forgotPassword","signUp","ForgotPasswordModal","NotificationGrid","methods","notificationMethods","inputs","types","notificationTypes","preferenceKey","preference","toggleMethod","toggleType","control","NotificationList","$scrollParent","scrollHandler","pages","notification","NotificationComponent","notificationComponents","$notifications","viewportHeight","contentTop","contentHeight","NotificationsDropdown","newNotifications","getNewCount","unread","getUnreadCount","menuClick","goToRoute","controlsOpen","PostControls","footerItems","$actions","$controls","existing","PostEdited","shouldUpdateTooltip","oldEditedInfo","editedInfo","PostMeta","permalink","getPermalink","touch","selectPermalink","ipAddress","PostStream","paused","scrollListener","onscroll","loadPageTimeouts","pagesLoading","calculatePositionTimeout","visibleStart","visibleEnd","viewingEnd","noAnimation","goToLast","flashItem","loadNearNumber","scrollToNumber","unpause","goToIndex","backwards","loadNearIndex","scrollToIndex","goToFirst","loadRange","sanitizeIndex","loadCount","fadedIn","lastTime","PostComponent","dt","period","loadNext","ReplyPlaceholder","getMarginTop","viewportTop","loadAheadDistance","$item","loadPrevious","calculatePosition","twoPagesAway","loadPage","anchorIndex","loadIds","scrollToItem","$container","itemTop","itemBottom","scrollBottom","PostStreamScrubber","description","dragging","mouseStart","indexStart","unreadPercent","viewing","styleUnread","newStyle","oldStyle","renderScrollbar","streamWasUnpaused","visibleTop","visibleBottom","visiblePost","ondestroy","onresize","resize","onmousedown","onmousemove","onmouseup","percentPerPost","$scrubber","heights","after","$part","minPercentVisible","percentPerVisiblePost","scrollbar","TouchEvent","touches","clientY","deltaPixels","deltaPercent","deltaIndex","newIndex","intIndex","$scrollbar","offsetPixels","offsetPercent","offsetIndex","PostUser","card","UserCard","controlsButtonClassName","showCard","hideCard","PostsUserPage","loadLimit","reply","replyAction","oncreatePreview","anchorToBottom","hasFocus","sources","loadingSources","searched","searchTimeout","currentSearch","getCurrentSearch","sourceItems","setIndex","getCurrentNumericIndex","selectableItems","KeyboardNavigatable","onUp","onDown","onSelect","selectResult","onCancel","bindTo","getItem","UsersSearchSource","$dropdown","fixedIndex","dropdownScroll","dropdownTop","dropdownBottom","SessionDropdown","SettingsPage","settingsItems","accountItems","notificationsItems","privacyItems","preferenceSaver","discloseOnline","isProvided","provided","token","logIn","submitData","UserControls","editable","online","affixSidebar","lassName","lowercaseUsername","lastIndexOf","localeCompare","WelcomeHero","localStorage","setItem","hasNear","section","moderation","renameAction","destructive","hideAction","restoreAction","deleteAction","forceRefresh","composingReplyTo","ReplyComposer","viewingDiscussion","isFullScreen","back","RenameDiscussionModal","currentTitle","stack","getCurrent","getPrevious","secondTop","canGoBack","backUrl","whenCallback","onRemove","selectionStart","selectionEnd","navigate","keyCallback","userControls","moderationControls","editAction","destructiveControls","EditPostComposer","showDeletionAlert","EditUserModal","$sidebar","$header","$affixElement"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;AASA;;;;;;;;;;;;;ACTA;AAAA;AAAe,SAASA,sBAAT,CAAgCC,IAAhC,EAAsC;AACnD,MAAIA,IAAI,KAAK,KAAK,CAAlB,EAAqB;AACnB,UAAM,IAAIC,cAAJ,CAAmB,2DAAnB,CAAN;AACD;;AAED,SAAOD,IAAP;AACD,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Content":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./forum.ts\");\n","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner <toby.zerner@gmail.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from './src/common';\nexport * from './src/forum';\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/*** IMPORTS FROM imports-loader ***/\n(function() {\n\n/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */\n(function(global, factory) {\n if (typeof define === 'function' && define.amd)\n define(function() { return factory(global) })\n else\n factory(global)\n}(this, function(window) {\n var Zepto = (function() {\n var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n document = window.document,\n elementDisplay = {}, classCache = {},\n cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n rootNodeRE = /^(?:body|html)$/i,\n capitalRE = /([A-Z])/g,\n\n // special attributes that should be get/set via method calls\n methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n table = document.createElement('table'),\n tableRow = document.createElement('tr'),\n containers = {\n 'tr': document.createElement('tbody'),\n 'tbody': table, 'thead': table, 'tfoot': table,\n 'td': tableRow, 'th': tableRow,\n '*': document.createElement('div')\n },\n readyRE = /complete|loaded|interactive/,\n simpleSelectorRE = /^[\\w-]*$/,\n class2type = {},\n toString = class2type.toString,\n zepto = {},\n camelize, uniq,\n tempParent = document.createElement('div'),\n propMap = {\n 'tabindex': 'tabIndex',\n 'readonly': 'readOnly',\n 'for': 'htmlFor',\n 'class': 'className',\n 'maxlength': 'maxLength',\n 'cellspacing': 'cellSpacing',\n 'cellpadding': 'cellPadding',\n 'rowspan': 'rowSpan',\n 'colspan': 'colSpan',\n 'usemap': 'useMap',\n 'frameborder': 'frameBorder',\n 'contenteditable': 'contentEditable'\n },\n isArray = Array.isArray ||\n function(object){ return object instanceof Array }\n\n zepto.matches = function(element, selector) {\n if (!selector || !element || element.nodeType !== 1) return false\n var matchesSelector = element.matches || element.webkitMatchesSelector ||\n element.mozMatchesSelector || element.oMatchesSelector ||\n element.matchesSelector\n if (matchesSelector) return matchesSelector.call(element, selector)\n // fall back to performing a selector:\n var match, parent = element.parentNode, temp = !parent\n if (temp) (parent = tempParent).appendChild(element)\n match = ~zepto.qsa(parent, selector).indexOf(element)\n temp && tempParent.removeChild(element)\n return match\n }\n\n function type(obj) {\n return obj == null ? String(obj) :\n class2type[toString.call(obj)] || \"object\"\n }\n\n function isFunction(value) { return type(value) == \"function\" }\n function isWindow(obj) { return obj != null && obj == obj.window }\n function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n function isObject(obj) { return type(obj) == \"object\" }\n function isPlainObject(obj) {\n return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n }\n\n function likeArray(obj) {\n var length = !!obj && 'length' in obj && obj.length,\n type = $.type(obj)\n\n return 'function' != type && !isWindow(obj) && (\n 'array' == type || length === 0 ||\n (typeof length == 'number' && length > 0 && (length - 1) in obj)\n )\n }\n\n function compact(array) { return filter.call(array, function(item){ return item != null }) }\n function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n function dasherize(str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase()\n }\n uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n function classRE(name) {\n return name in classCache ?\n classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n }\n\n function maybeAddPx(name, value) {\n return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n }\n\n function defaultDisplay(nodeName) {\n var element, display\n if (!elementDisplay[nodeName]) {\n element = document.createElement(nodeName)\n document.body.appendChild(element)\n display = getComputedStyle(element, '').getPropertyValue(\"display\")\n element.parentNode.removeChild(element)\n display == \"none\" && (display = \"block\")\n elementDisplay[nodeName] = display\n }\n return elementDisplay[nodeName]\n }\n\n function children(element) {\n return 'children' in element ?\n slice.call(element.children) :\n $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n }\n\n function Z(dom, selector) {\n var i, len = dom ? dom.length : 0\n for (i = 0; i < len; i++) this[i] = dom[i]\n this.length = len\n this.selector = selector || ''\n }\n\n // `$.zepto.fragment` takes a html string and an optional tag name\n // to generate DOM nodes from the given html string.\n // The generated DOM nodes are returned as an array.\n // This function can be overridden in plugins for example to make\n // it compatible with browsers that don't support the DOM fully.\n zepto.fragment = function(html, name, properties) {\n var dom, nodes, container\n\n // A special case optimization for a single tag\n if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n if (!dom) {\n if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n if (!(name in containers)) name = '*'\n\n container = containers[name]\n container.innerHTML = '' + html\n dom = $.each(slice.call(container.childNodes), function(){\n container.removeChild(this)\n })\n }\n\n if (isPlainObject(properties)) {\n nodes = $(dom)\n $.each(properties, function(key, value) {\n if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n else nodes.attr(key, value)\n })\n }\n\n return dom\n }\n\n // `$.zepto.Z` swaps out the prototype of the given `dom` array\n // of nodes with `$.fn` and thus supplying all the Zepto functions\n // to the array. This method can be overridden in plugins.\n zepto.Z = function(dom, selector) {\n return new Z(dom, selector)\n }\n\n // `$.zepto.isZ` should return `true` if the given object is a Zepto\n // collection. This method can be overridden in plugins.\n zepto.isZ = function(object) {\n return object instanceof zepto.Z\n }\n\n // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n // takes a CSS selector and an optional context (and handles various\n // special cases).\n // This method can be overridden in plugins.\n zepto.init = function(selector, context) {\n var dom\n // If nothing given, return an empty Zepto collection\n if (!selector) return zepto.Z()\n // Optimize for string selectors\n else if (typeof selector == 'string') {\n selector = selector.trim()\n // If it's a html fragment, create nodes from it\n // Note: In both Chrome 21 and Firefox 15, DOM error 12\n // is thrown if the fragment doesn't begin with <\n if (selector[0] == '<' && fragmentRE.test(selector))\n dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // If it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // If a function is given, call it when the DOM is ready\n else if (isFunction(selector)) return $(document).ready(selector)\n // If a Zepto collection is given, just return it\n else if (zepto.isZ(selector)) return selector\n else {\n // normalize array if an array of nodes is given\n if (isArray(selector)) dom = compact(selector)\n // Wrap DOM nodes.\n else if (isObject(selector))\n dom = [selector], selector = null\n // If it's a html fragment, create nodes from it\n else if (fragmentRE.test(selector))\n dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // And last but no least, if it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // create a new Zepto collection from the nodes found\n return zepto.Z(dom, selector)\n }\n\n // `$` will be the base `Zepto` object. When calling this\n // function just call `$.zepto.init, which makes the implementation\n // details of selecting nodes and creating Zepto collections\n // patchable in plugins.\n $ = function(selector, context){\n return zepto.init(selector, context)\n }\n\n function extend(target, source, deep) {\n for (key in source)\n if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n target[key] = {}\n if (isArray(source[key]) && !isArray(target[key]))\n target[key] = []\n extend(target[key], source[key], deep)\n }\n else if (source[key] !== undefined) target[key] = source[key]\n }\n\n // Copy all but undefined properties from one or more\n // objects to the `target` object.\n $.extend = function(target){\n var deep, args = slice.call(arguments, 1)\n if (typeof target == 'boolean') {\n deep = target\n target = args.shift()\n }\n args.forEach(function(arg){ extend(target, arg, deep) })\n return target\n }\n\n // `$.zepto.qsa` is Zepto's CSS selector implementation which\n // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n // This method can be overridden in plugins.\n zepto.qsa = function(element, selector){\n var found,\n maybeID = selector[0] == '#',\n maybeClass = !maybeID && selector[0] == '.',\n nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n isSimple = simpleSelectorRE.test(nameOnly)\n return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n slice.call(\n isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n element.getElementsByTagName(selector) : // Or a tag\n element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n )\n }\n\n function filtered(nodes, selector) {\n return selector == null ? $(nodes) : $(nodes).filter(selector)\n }\n\n $.contains = document.documentElement.contains ?\n function(parent, node) {\n return parent !== node && parent.contains(node)\n } :\n function(parent, node) {\n while (node && (node = node.parentNode))\n if (node === parent) return true\n return false\n }\n\n function funcArg(context, arg, idx, payload) {\n return isFunction(arg) ? arg.call(context, idx, payload) : arg\n }\n\n function setAttribute(node, name, value) {\n value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n }\n\n // access className property while respecting SVGAnimatedString\n function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }\n\n // \"true\" => true\n // \"false\" => false\n // \"null\" => null\n // \"42\" => 42\n // \"42.5\" => 42.5\n // \"08\" => \"08\"\n // JSON => parse if valid\n // String => self\n function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }\n\n $.type = type\n $.isFunction = isFunction\n $.isWindow = isWindow\n $.isArray = isArray\n $.isPlainObject = isPlainObject\n\n $.isEmptyObject = function(obj) {\n var name\n for (name in obj) return false\n return true\n }\n\n $.isNumeric = function(val) {\n var num = Number(val), type = typeof val\n return val != null && type != 'boolean' &&\n (type != 'string' || val.length) &&\n !isNaN(num) && isFinite(num) || false\n }\n\n $.inArray = function(elem, array, i){\n return emptyArray.indexOf.call(array, elem, i)\n }\n\n $.camelCase = camelize\n $.trim = function(str) {\n return str == null ? \"\" : String.prototype.trim.call(str)\n }\n\n // plugin compatibility\n $.uuid = 0\n $.support = { }\n $.expr = { }\n $.noop = function() {}\n\n $.map = function(elements, callback){\n var value, values = [], i, key\n if (likeArray(elements))\n for (i = 0; i < elements.length; i++) {\n value = callback(elements[i], i)\n if (value != null) values.push(value)\n }\n else\n for (key in elements) {\n value = callback(elements[key], key)\n if (value != null) values.push(value)\n }\n return flatten(values)\n }\n\n $.each = function(elements, callback){\n var i, key\n if (likeArray(elements)) {\n for (i = 0; i < elements.length; i++)\n if (callback.call(elements[i], i, elements[i]) === false) return elements\n } else {\n for (key in elements)\n if (callback.call(elements[key], key, elements[key]) === false) return elements\n }\n\n return elements\n }\n\n $.grep = function(elements, callback){\n return filter.call(elements, callback)\n }\n\n if (window.JSON) $.parseJSON = JSON.parse\n\n // Populate the class2type map\n $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n })\n\n // Define methods that will be available on all\n // Zepto collections\n $.fn = {\n constructor: zepto.Z,\n length: 0,\n\n // Because a collection acts like an array\n // copy over these useful array functions.\n forEach: emptyArray.forEach,\n reduce: emptyArray.reduce,\n push: emptyArray.push,\n sort: emptyArray.sort,\n splice: emptyArray.splice,\n indexOf: emptyArray.indexOf,\n concat: function(){\n var i, value, args = []\n for (i = 0; i < arguments.length; i++) {\n value = arguments[i]\n args[i] = zepto.isZ(value) ? value.toArray() : value\n }\n return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n },\n\n // `map` and `slice` in the jQuery API work differently\n // from their array counterparts\n map: function(fn){\n return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n },\n slice: function(){\n return $(slice.apply(this, arguments))\n },\n\n ready: function(callback){\n // need to check if document.body exists for IE as that browser reports\n // document ready when it hasn't yet created the body element\n if (readyRE.test(document.readyState) && document.body) callback($)\n else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n return this\n },\n get: function(idx){\n return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n },\n toArray: function(){ return this.get() },\n size: function(){\n return this.length\n },\n remove: function(){\n return this.each(function(){\n if (this.parentNode != null)\n this.parentNode.removeChild(this)\n })\n },\n each: function(callback){\n emptyArray.every.call(this, function(el, idx){\n return callback.call(el, idx, el) !== false\n })\n return this\n },\n filter: function(selector){\n if (isFunction(selector)) return this.not(this.not(selector))\n return $(filter.call(this, function(element){\n return zepto.matches(element, selector)\n }))\n },\n add: function(selector,context){\n return $(uniq(this.concat($(selector,context))))\n },\n is: function(selector){\n return this.length > 0 && zepto.matches(this[0], selector)\n },\n not: function(selector){\n var nodes=[]\n if (isFunction(selector) && selector.call !== undefined)\n this.each(function(idx){\n if (!selector.call(this,idx)) nodes.push(this)\n })\n else {\n var excludes = typeof selector == 'string' ? this.filter(selector) :\n (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n this.forEach(function(el){\n if (excludes.indexOf(el) < 0) nodes.push(el)\n })\n }\n return $(nodes)\n },\n has: function(selector){\n return this.filter(function(){\n return isObject(selector) ?\n $.contains(this, selector) :\n $(this).find(selector).size()\n })\n },\n eq: function(idx){\n return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n },\n first: function(){\n var el = this[0]\n return el && !isObject(el) ? el : $(el)\n },\n last: function(){\n var el = this[this.length - 1]\n return el && !isObject(el) ? el : $(el)\n },\n find: function(selector){\n var result, $this = this\n if (!selector) result = $()\n else if (typeof selector == 'object')\n result = $(selector).filter(function(){\n var node = this\n return emptyArray.some.call($this, function(parent){\n return $.contains(parent, node)\n })\n })\n else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n else result = this.map(function(){ return zepto.qsa(this, selector) })\n return result\n },\n closest: function(selector, context){\n var nodes = [], collection = typeof selector == 'object' && $(selector)\n this.each(function(_, node){\n while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n node = node !== context && !isDocument(node) && node.parentNode\n if (node && nodes.indexOf(node) < 0) nodes.push(node)\n })\n return $(nodes)\n },\n parents: function(selector){\n var ancestors = [], nodes = this\n while (nodes.length > 0)\n nodes = $.map(nodes, function(node){\n if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n ancestors.push(node)\n return node\n }\n })\n return filtered(ancestors, selector)\n },\n parent: function(selector){\n return filtered(uniq(this.pluck('parentNode')), selector)\n },\n children: function(selector){\n return filtered(this.map(function(){ return children(this) }), selector)\n },\n contents: function() {\n return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n },\n siblings: function(selector){\n return filtered(this.map(function(i, el){\n return filter.call(children(el.parentNode), function(child){ return child!==el })\n }), selector)\n },\n empty: function(){\n return this.each(function(){ this.innerHTML = '' })\n },\n // `pluck` is borrowed from Prototype.js\n pluck: function(property){\n return $.map(this, function(el){ return el[property] })\n },\n show: function(){\n return this.each(function(){\n this.style.display == \"none\" && (this.style.display = '')\n if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n this.style.display = defaultDisplay(this.nodeName)\n })\n },\n replaceWith: function(newContent){\n return this.before(newContent).remove()\n },\n wrap: function(structure){\n var func = isFunction(structure)\n if (this[0] && !func)\n var dom = $(structure).get(0),\n clone = dom.parentNode || this.length > 1\n\n return this.each(function(index){\n $(this).wrapAll(\n func ? structure.call(this, index) :\n clone ? dom.cloneNode(true) : dom\n )\n })\n },\n wrapAll: function(structure){\n if (this[0]) {\n $(this[0]).before(structure = $(structure))\n var children\n // drill down to the inmost element\n while ((children = structure.children()).length) structure = children.first()\n $(structure).append(this)\n }\n return this\n },\n wrapInner: function(structure){\n var func = isFunction(structure)\n return this.each(function(index){\n var self = $(this), contents = self.contents(),\n dom = func ? structure.call(this, index) : structure\n contents.length ? contents.wrapAll(dom) : self.append(dom)\n })\n },\n unwrap: function(){\n this.parent().each(function(){\n $(this).replaceWith($(this).children())\n })\n return this\n },\n clone: function(){\n return this.map(function(){ return this.cloneNode(true) })\n },\n hide: function(){\n return this.css(\"display\", \"none\")\n },\n toggle: function(setting){\n return this.each(function(){\n var el = $(this)\n ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n })\n },\n prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n html: function(html){\n return 0 in arguments ?\n this.each(function(idx){\n var originHtml = this.innerHTML\n $(this).empty().append( funcArg(this, html, idx, originHtml) )\n }) :\n (0 in this ? this[0].innerHTML : null)\n },\n text: function(text){\n return 0 in arguments ?\n this.each(function(idx){\n var newText = funcArg(this, text, idx, this.textContent)\n this.textContent = newText == null ? '' : ''+newText\n }) :\n (0 in this ? this.pluck('textContent').join(\"\") : null)\n },\n attr: function(name, value){\n var result\n return (typeof name == 'string' && !(1 in arguments)) ?\n (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n this.each(function(idx){\n if (this.nodeType !== 1) return\n if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n })\n },\n removeAttr: function(name){\n return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n setAttribute(this, attribute)\n }, this)})\n },\n prop: function(name, value){\n name = propMap[name] || name\n return (1 in arguments) ?\n this.each(function(idx){\n this[name] = funcArg(this, value, idx, this[name])\n }) :\n (this[0] && this[0][name])\n },\n removeProp: function(name){\n name = propMap[name] || name\n return this.each(function(){ delete this[name] })\n },\n data: function(name, value){\n var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n var data = (1 in arguments) ?\n this.attr(attrName, value) :\n this.attr(attrName)\n\n return data !== null ? deserializeValue(data) : undefined\n },\n val: function(value){\n if (0 in arguments) {\n if (value == null) value = \"\"\n return this.each(function(idx){\n this.value = funcArg(this, value, idx, this.value)\n })\n } else {\n return this[0] && (this[0].multiple ?\n $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n this[0].value)\n }\n },\n offset: function(coordinates){\n if (coordinates) return this.each(function(index){\n var $this = $(this),\n coords = funcArg(this, coordinates, index, $this.offset()),\n parentOffset = $this.offsetParent().offset(),\n props = {\n top: coords.top - parentOffset.top,\n left: coords.left - parentOffset.left\n }\n\n if ($this.css('position') == 'static') props['position'] = 'relative'\n $this.css(props)\n })\n if (!this.length) return null\n if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n return {top: 0, left: 0}\n var obj = this[0].getBoundingClientRect()\n return {\n left: obj.left + window.pageXOffset,\n top: obj.top + window.pageYOffset,\n width: Math.round(obj.width),\n height: Math.round(obj.height)\n }\n },\n css: function(property, value){\n if (arguments.length < 2) {\n var element = this[0]\n if (typeof property == 'string') {\n if (!element) return\n return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n } else if (isArray(property)) {\n if (!element) return\n var props = {}\n var computedStyle = getComputedStyle(element, '')\n $.each(property, function(_, prop){\n props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n })\n return props\n }\n }\n\n var css = ''\n if (type(property) == 'string') {\n if (!value && value !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(property)) })\n else\n css = dasherize(property) + \":\" + maybeAddPx(property, value)\n } else {\n for (key in property)\n if (!property[key] && property[key] !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(key)) })\n else\n css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n }\n\n return this.each(function(){ this.style.cssText += ';' + css })\n },\n index: function(element){\n return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n },\n hasClass: function(name){\n if (!name) return false\n return emptyArray.some.call(this, function(el){\n return this.test(className(el))\n }, classRE(name))\n },\n addClass: function(name){\n if (!name) return this\n return this.each(function(idx){\n if (!('className' in this)) return\n classList = []\n var cls = className(this), newName = funcArg(this, name, idx, cls)\n newName.split(/\\s+/g).forEach(function(klass){\n if (!$(this).hasClass(klass)) classList.push(klass)\n }, this)\n classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n })\n },\n removeClass: function(name){\n return this.each(function(idx){\n if (!('className' in this)) return\n if (name === undefined) return className(this, '')\n classList = className(this)\n funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n classList = classList.replace(classRE(klass), \" \")\n })\n className(this, classList.trim())\n })\n },\n toggleClass: function(name, when){\n if (!name) return this\n return this.each(function(idx){\n var $this = $(this), names = funcArg(this, name, idx, className(this))\n names.split(/\\s+/g).forEach(function(klass){\n (when === undefined ? !$this.hasClass(klass) : when) ?\n $this.addClass(klass) : $this.removeClass(klass)\n })\n })\n },\n scrollTop: function(value){\n if (!this.length) return\n var hasScrollTop = 'scrollTop' in this[0]\n if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n return this.each(hasScrollTop ?\n function(){ this.scrollTop = value } :\n function(){ this.scrollTo(this.scrollX, value) })\n },\n scrollLeft: function(value){\n if (!this.length) return\n var hasScrollLeft = 'scrollLeft' in this[0]\n if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n return this.each(hasScrollLeft ?\n function(){ this.scrollLeft = value } :\n function(){ this.scrollTo(value, this.scrollY) })\n },\n position: function() {\n if (!this.length) return\n\n var elem = this[0],\n // Get *real* offsetParent\n offsetParent = this.offsetParent(),\n // Get correct offsets\n offset = this.offset(),\n parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n // Subtract element margins\n // note: when an element has margin: auto the offsetLeft and marginLeft\n // are the same in Safari causing offset.left to incorrectly be 0\n offset.top -= parseFloat( $(elem).css('margin-top') ) || 0\n offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n // Add offsetParent borders\n parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n // Subtract the two offsets\n return {\n top: offset.top - parentOffset.top,\n left: offset.left - parentOffset.left\n }\n },\n offsetParent: function() {\n return this.map(function(){\n var parent = this.offsetParent || document.body\n while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n parent = parent.offsetParent\n return parent\n })\n }\n }\n\n // for now\n $.fn.detach = $.fn.remove\n\n // Generate the `width` and `height` functions\n ;['width', 'height'].forEach(function(dimension){\n var dimensionProperty =\n dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n $.fn[dimension] = function(value){\n var offset, el = this[0]\n if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n (offset = this.offset()) && offset[dimension]\n else return this.each(function(idx){\n el = $(this)\n el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n })\n }\n })\n\n function traverseNode(node, fun) {\n fun(node)\n for (var i = 0, len = node.childNodes.length; i < len; i++)\n traverseNode(node.childNodes[i], fun)\n }\n\n // Generate the `after`, `prepend`, `before`, `append`,\n // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n adjacencyOperators.forEach(function(operator, operatorIndex) {\n var inside = operatorIndex % 2 //=> prepend, append\n\n $.fn[operator] = function(){\n // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n var argType, nodes = $.map(arguments, function(arg) {\n var arr = []\n argType = type(arg)\n if (argType == \"array\") {\n arg.forEach(function(el) {\n if (el.nodeType !== undefined) return arr.push(el)\n else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n arr = arr.concat(zepto.fragment(el))\n })\n return arr\n }\n return argType == \"object\" || arg == null ?\n arg : zepto.fragment(arg)\n }),\n parent, copyByClone = this.length > 1\n if (nodes.length < 1) return this\n\n return this.each(function(_, target){\n parent = inside ? target : target.parentNode\n\n // convert all methods to a \"before\" operation\n target = operatorIndex == 0 ? target.nextSibling :\n operatorIndex == 1 ? target.firstChild :\n operatorIndex == 2 ? target :\n null\n\n var parentInDocument = $.contains(document.documentElement, parent)\n\n nodes.forEach(function(node){\n if (copyByClone) node = node.cloneNode(true)\n else if (!parent) return $(node).remove()\n\n parent.insertBefore(node, target)\n if (parentInDocument) traverseNode(node, function(el){\n if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n (!el.type || el.type === 'text/javascript') && !el.src){\n var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n target['eval'].call(target, el.innerHTML)\n }\n })\n })\n })\n }\n\n // after => insertAfter\n // prepend => prependTo\n // before => insertBefore\n // append => appendTo\n $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n $(html)[operator](this)\n return this\n }\n })\n\n zepto.Z.prototype = Z.prototype = $.fn\n\n // Export internal API functions in the `$.zepto` namespace\n zepto.uniq = uniq\n zepto.deserializeValue = deserializeValue\n $.zepto = zepto\n\n return $\n})()\n\nwindow.Zepto = Zepto\nwindow.$ === undefined && (window.$ = Zepto)\n\n;(function($){\n var _zid = 1, undefined,\n slice = Array.prototype.slice,\n isFunction = $.isFunction,\n isString = function(obj){ return typeof obj == 'string' },\n handlers = {},\n specialEvents={},\n focusinSupported = 'onfocusin' in window,\n focus = { focus: 'focusin', blur: 'focusout' },\n hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n function zid(element) {\n return element._zid || (element._zid = _zid++)\n }\n function findHandlers(element, event, fn, selector) {\n event = parse(event)\n if (event.ns) var matcher = matcherFor(event.ns)\n return (handlers[zid(element)] || []).filter(function(handler) {\n return handler\n && (!event.e || handler.e == event.e)\n && (!event.ns || matcher.test(handler.ns))\n && (!fn || zid(handler.fn) === zid(fn))\n && (!selector || handler.sel == selector)\n })\n }\n function parse(event) {\n var parts = ('' + event).split('.')\n return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n }\n function matcherFor(ns) {\n return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n }\n\n function eventCapture(handler, captureSetting) {\n return handler.del &&\n (!focusinSupported && (handler.e in focus)) ||\n !!captureSetting\n }\n\n function realEvent(type) {\n return hover[type] || (focusinSupported && focus[type]) || type\n }\n\n function add(element, events, fn, data, selector, delegator, capture){\n var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n events.split(/\\s/).forEach(function(event){\n if (event == 'ready') return $(document).ready(fn)\n var handler = parse(event)\n handler.fn = fn\n handler.sel = selector\n // emulate mouseenter, mouseleave\n if (handler.e in hover) fn = function(e){\n var related = e.relatedTarget\n if (!related || (related !== this && !$.contains(this, related)))\n return handler.fn.apply(this, arguments)\n }\n handler.del = delegator\n var callback = delegator || fn\n handler.proxy = function(e){\n e = compatible(e)\n if (e.isImmediatePropagationStopped()) return\n e.data = data\n var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n if (result === false) e.preventDefault(), e.stopPropagation()\n return result\n }\n handler.i = set.length\n set.push(handler)\n if ('addEventListener' in element)\n element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n }\n function remove(element, events, fn, selector, capture){\n var id = zid(element)\n ;(events || '').split(/\\s/).forEach(function(event){\n findHandlers(element, event, fn, selector).forEach(function(handler){\n delete handlers[id][handler.i]\n if ('removeEventListener' in element)\n element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n })\n }\n\n $.event = { add: add, remove: remove }\n\n $.proxy = function(fn, context) {\n var args = (2 in arguments) && slice.call(arguments, 2)\n if (isFunction(fn)) {\n var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n proxyFn._zid = zid(fn)\n return proxyFn\n } else if (isString(context)) {\n if (args) {\n args.unshift(fn[context], fn)\n return $.proxy.apply(null, args)\n } else {\n return $.proxy(fn[context], fn)\n }\n } else {\n throw new TypeError(\"expected function\")\n }\n }\n\n $.fn.bind = function(event, data, callback){\n return this.on(event, data, callback)\n }\n $.fn.unbind = function(event, callback){\n return this.off(event, callback)\n }\n $.fn.one = function(event, selector, data, callback){\n return this.on(event, selector, data, callback, 1)\n }\n\n var returnTrue = function(){return true},\n returnFalse = function(){return false},\n ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n eventMethods = {\n preventDefault: 'isDefaultPrevented',\n stopImmediatePropagation: 'isImmediatePropagationStopped',\n stopPropagation: 'isPropagationStopped'\n }\n\n function compatible(event, source) {\n if (source || !event.isDefaultPrevented) {\n source || (source = event)\n\n $.each(eventMethods, function(name, predicate) {\n var sourceMethod = source[name]\n event[name] = function(){\n this[predicate] = returnTrue\n return sourceMethod && sourceMethod.apply(source, arguments)\n }\n event[predicate] = returnFalse\n })\n\n event.timeStamp || (event.timeStamp = Date.now())\n\n if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n 'returnValue' in source ? source.returnValue === false :\n source.getPreventDefault && source.getPreventDefault())\n event.isDefaultPrevented = returnTrue\n }\n return event\n }\n\n function createProxy(event) {\n var key, proxy = { originalEvent: event }\n for (key in event)\n if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n return compatible(proxy, event)\n }\n\n $.fn.delegate = function(selector, event, callback){\n return this.on(event, selector, callback)\n }\n $.fn.undelegate = function(selector, event, callback){\n return this.off(event, selector, callback)\n }\n\n $.fn.live = function(event, callback){\n $(document.body).delegate(this.selector, event, callback)\n return this\n }\n $.fn.die = function(event, callback){\n $(document.body).undelegate(this.selector, event, callback)\n return this\n }\n\n $.fn.on = function(event, selector, data, callback, one){\n var autoRemove, delegator, $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.on(type, selector, data, fn, one)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = data, data = selector, selector = undefined\n if (callback === undefined || data === false)\n callback = data, data = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(_, element){\n if (one) autoRemove = function(e){\n remove(element, e.type, callback)\n return callback.apply(this, arguments)\n }\n\n if (selector) delegator = function(e){\n var evt, match = $(e.target).closest(selector, element).get(0)\n if (match && match !== element) {\n evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n }\n }\n\n add(element, event, callback, data, selector, delegator || autoRemove)\n })\n }\n $.fn.off = function(event, selector, callback){\n var $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.off(type, selector, fn)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = selector, selector = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(){\n remove(this, event, callback, selector)\n })\n }\n\n $.fn.trigger = function(event, args){\n event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n event._args = args\n return this.each(function(){\n // handle focus(), blur() by calling them directly\n if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n // items in the collection might not be DOM elements\n else if ('dispatchEvent' in this) this.dispatchEvent(event)\n else $(this).triggerHandler(event, args)\n })\n }\n\n // triggers event handlers on current element just as if an event occurred,\n // doesn't trigger an actual event, doesn't bubble\n $.fn.triggerHandler = function(event, args){\n var e, result\n this.each(function(i, element){\n e = createProxy(isString(event) ? $.Event(event) : event)\n e._args = args\n e.target = element\n $.each(findHandlers(element, event.type || event), function(i, handler){\n result = handler.proxy(e)\n if (e.isImmediatePropagationStopped()) return false\n })\n })\n return result\n }\n\n // shortcut methods for `.bind(event, fn)` for each event type\n ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n 'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n $.fn[event] = function(callback) {\n return (0 in arguments) ?\n this.bind(event, callback) :\n this.trigger(event)\n }\n })\n\n $.Event = function(type, props) {\n if (!isString(type)) props = type, type = props.type\n var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n event.initEvent(type, bubbles, true)\n return compatible(event)\n }\n\n})(Zepto)\n\n;(function($){\n var jsonpID = +new Date(),\n document = window.document,\n key,\n name,\n rscript = /<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\n scriptTypeRE = /^(?:text|application)\\/javascript/i,\n xmlTypeRE = /^(?:text|application)\\/xml/i,\n jsonType = 'application/json',\n htmlType = 'text/html',\n blankRE = /^\\s*$/,\n originAnchor = document.createElement('a')\n\n originAnchor.href = window.location.href\n\n // trigger a custom event and return false if it was cancelled\n function triggerAndReturn(context, eventName, data) {\n var event = $.Event(eventName)\n $(context).trigger(event, data)\n return !event.isDefaultPrevented()\n }\n\n // trigger an Ajax \"global\" event\n function triggerGlobal(settings, context, eventName, data) {\n if (settings.global) return triggerAndReturn(context || document, eventName, data)\n }\n\n // Number of active Ajax requests\n $.active = 0\n\n function ajaxStart(settings) {\n if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')\n }\n function ajaxStop(settings) {\n if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')\n }\n\n // triggers an extra global event \"ajaxBeforeSend\" that's like \"ajaxSend\" but cancelable\n function ajaxBeforeSend(xhr, settings) {\n var context = settings.context\n if (settings.beforeSend.call(context, xhr, settings) === false ||\n triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)\n return false\n\n triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])\n }\n function ajaxSuccess(data, xhr, settings, deferred) {\n var context = settings.context, status = 'success'\n settings.success.call(context, data, status, xhr)\n if (deferred) deferred.resolveWith(context, [data, status, xhr])\n triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])\n ajaxComplete(status, xhr, settings)\n }\n // type: \"timeout\", \"error\", \"abort\", \"parsererror\"\n function ajaxError(error, type, xhr, settings, deferred) {\n var context = settings.context\n settings.error.call(context, xhr, type, error)\n if (deferred) deferred.rejectWith(context, [xhr, type, error])\n triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])\n ajaxComplete(type, xhr, settings)\n }\n // status: \"success\", \"notmodified\", \"error\", \"timeout\", \"abort\", \"parsererror\"\n function ajaxComplete(status, xhr, settings) {\n var context = settings.context\n settings.complete.call(context, xhr, status)\n triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])\n ajaxStop(settings)\n }\n\n function ajaxDataFilter(data, type, settings) {\n if (settings.dataFilter == empty) return data\n var context = settings.context\n return settings.dataFilter.call(context, data, type)\n }\n\n // Empty function, used as default callback\n function empty() {}\n\n $.ajaxJSONP = function(options, deferred){\n if (!('type' in options)) return $.ajax(options)\n\n var _callbackName = options.jsonpCallback,\n callbackName = ($.isFunction(_callbackName) ?\n _callbackName() : _callbackName) || ('Zepto' + (jsonpID++)),\n script = document.createElement('script'),\n originalCallback = window[callbackName],\n responseData,\n abort = function(errorType) {\n $(script).triggerHandler('error', errorType || 'abort')\n },\n xhr = { abort: abort }, abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n $(script).on('load error', function(e, errorType){\n clearTimeout(abortTimeout)\n $(script).off().remove()\n\n if (e.type == 'error' || !responseData) {\n ajaxError(null, errorType || 'error', xhr, options, deferred)\n } else {\n ajaxSuccess(responseData[0], xhr, options, deferred)\n }\n\n window[callbackName] = originalCallback\n if (responseData && $.isFunction(originalCallback))\n originalCallback(responseData[0])\n\n originalCallback = responseData = undefined\n })\n\n if (ajaxBeforeSend(xhr, options) === false) {\n abort('abort')\n return xhr\n }\n\n window[callbackName] = function(){\n responseData = arguments\n }\n\n script.src = options.url.replace(/\\?(.+)=\\?/, '?$1=' + callbackName)\n document.head.appendChild(script)\n\n if (options.timeout > 0) abortTimeout = setTimeout(function(){\n abort('timeout')\n }, options.timeout)\n\n return xhr\n }\n\n $.ajaxSettings = {\n // Default type of request\n type: 'GET',\n // Callback that is executed before request\n beforeSend: empty,\n // Callback that is executed if the request succeeds\n success: empty,\n // Callback that is executed the the server drops error\n error: empty,\n // Callback that is executed on request complete (both: error and success)\n complete: empty,\n // The context for the callbacks\n context: null,\n // Whether to trigger \"global\" Ajax events\n global: true,\n // Transport\n xhr: function () {\n return new window.XMLHttpRequest()\n },\n // MIME types mapping\n // IIS returns Javascript as \"application/x-javascript\"\n accepts: {\n script: 'text/javascript, application/javascript, application/x-javascript',\n json: jsonType,\n xml: 'application/xml, text/xml',\n html: htmlType,\n text: 'text/plain'\n },\n // Whether the request is to another domain\n crossDomain: false,\n // Default timeout\n timeout: 0,\n // Whether data should be serialized to string\n processData: true,\n // Whether the browser should be allowed to cache GET responses\n cache: true,\n //Used to handle the raw response data of XMLHttpRequest.\n //This is a pre-filtering function to sanitize the response.\n //The sanitized response should be returned\n dataFilter: empty\n }\n\n function mimeToDataType(mime) {\n if (mime) mime = mime.split(';', 2)[0]\n return mime && ( mime == htmlType ? 'html' :\n mime == jsonType ? 'json' :\n scriptTypeRE.test(mime) ? 'script' :\n xmlTypeRE.test(mime) && 'xml' ) || 'text'\n }\n\n function appendQuery(url, query) {\n if (query == '') return url\n return (url + '&' + query).replace(/[&?]{1,2}/, '?')\n }\n\n // serialize payload and append it to the URL for GET requests\n function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }\n\n $.ajax = function(options){\n var settings = $.extend({}, options || {}),\n deferred = $.Deferred && $.Deferred(),\n urlAnchor, hashIndex\n for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]\n\n ajaxStart(settings)\n\n if (!settings.crossDomain) {\n urlAnchor = document.createElement('a')\n urlAnchor.href = settings.url\n // cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049\n urlAnchor.href = urlAnchor.href\n settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host)\n }\n\n if (!settings.url) settings.url = window.location.toString()\n if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex)\n serializeData(settings)\n\n var dataType = settings.dataType, hasPlaceholder = /\\?.+=\\?/.test(settings.url)\n if (hasPlaceholder) dataType = 'jsonp'\n\n if (settings.cache === false || (\n (!options || options.cache !== true) &&\n ('script' == dataType || 'jsonp' == dataType)\n ))\n settings.url = appendQuery(settings.url, '_=' + Date.now())\n\n if ('jsonp' == dataType) {\n if (!hasPlaceholder)\n settings.url = appendQuery(settings.url,\n settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?')\n return $.ajaxJSONP(settings, deferred)\n }\n\n var mime = settings.accepts[dataType],\n headers = { },\n setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },\n protocol = /^([\\w-]+:)\\/\\//.test(settings.url) ? RegExp.$1 : window.location.protocol,\n xhr = settings.xhr(),\n nativeSetHeader = xhr.setRequestHeader,\n abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest')\n setHeader('Accept', mime || '*/*')\n if (mime = settings.mimeType || mime) {\n if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]\n xhr.overrideMimeType && xhr.overrideMimeType(mime)\n }\n if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))\n setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')\n\n if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name])\n xhr.setRequestHeader = setHeader\n\n xhr.onreadystatechange = function(){\n if (xhr.readyState == 4) {\n xhr.onreadystatechange = empty\n clearTimeout(abortTimeout)\n var result, error = false\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {\n dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))\n\n if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob')\n result = xhr.response\n else {\n result = xhr.responseText\n\n try {\n // http://perfectionkills.com/global-eval-what-are-the-options/\n // sanitize response accordingly if data filter callback provided\n result = ajaxDataFilter(result, dataType, settings)\n if (dataType == 'script') (1,eval)(result)\n else if (dataType == 'xml') result = xhr.responseXML\n else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)\n } catch (e) { error = e }\n\n if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred)\n }\n\n ajaxSuccess(result, xhr, settings, deferred)\n } else {\n ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred)\n }\n }\n }\n\n if (ajaxBeforeSend(xhr, settings) === false) {\n xhr.abort()\n ajaxError(null, 'abort', xhr, settings, deferred)\n return xhr\n }\n\n var async = 'async' in settings ? settings.async : true\n xhr.open(settings.type, settings.url, async, settings.username, settings.password)\n\n if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]\n\n for (name in headers) nativeSetHeader.apply(xhr, headers[name])\n\n if (settings.timeout > 0) abortTimeout = setTimeout(function(){\n xhr.onreadystatechange = empty\n xhr.abort()\n ajaxError(null, 'timeout', xhr, settings, deferred)\n }, settings.timeout)\n\n // avoid sending empty string (#319)\n xhr.send(settings.data ? settings.data : null)\n return xhr\n }\n\n // handle optional data/success arguments\n function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }\n\n $.get = function(/* url, data, success, dataType */){\n return $.ajax(parseArguments.apply(null, arguments))\n }\n\n $.post = function(/* url, data, success, dataType */){\n var options = parseArguments.apply(null, arguments)\n options.type = 'POST'\n return $.ajax(options)\n }\n\n $.getJSON = function(/* url, data, success */){\n var options = parseArguments.apply(null, arguments)\n options.dataType = 'json'\n return $.ajax(options)\n }\n\n $.fn.load = function(url, data, success){\n if (!this.length) return this\n var self = this, parts = url.split(/\\s/), selector,\n options = parseArguments(url, data, success),\n callback = options.success\n if (parts.length > 1) options.url = parts[0], selector = parts[1]\n options.success = function(response){\n self.html(selector ?\n $('<div>').html(response.replace(rscript, \"\")).find(selector)\n : response)\n callback && callback.apply(self, arguments)\n }\n $.ajax(options)\n return this\n }\n\n var escape = encodeURIComponent\n\n function serialize(params, obj, traditional, scope){\n var type, array = $.isArray(obj), hash = $.isPlainObject(obj)\n $.each(obj, function(key, value) {\n type = $.type(value)\n if (scope) key = traditional ? scope :\n scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']'\n // handle data in serializeArray() format\n if (!scope && array) params.add(value.name, value.value)\n // recurse into nested objects\n else if (type == \"array\" || (!traditional && type == \"object\"))\n serialize(params, value, traditional, key)\n else params.add(key, value)\n })\n }\n\n $.param = function(obj, traditional){\n var params = []\n params.add = function(key, value) {\n if ($.isFunction(value)) value = value()\n if (value == null) value = \"\"\n this.push(escape(key) + '=' + escape(value))\n }\n serialize(params, obj, traditional)\n return params.join('&').replace(/%20/g, '+')\n }\n})(Zepto)\n\n;(function($){\n $.fn.serializeArray = function() {\n var name, type, result = [],\n add = function(value) {\n if (value.forEach) return value.forEach(add)\n result.push({ name: name, value: value })\n }\n if (this[0]) $.each(this[0].elements, function(_, field){\n type = field.type, name = field.name\n if (name && field.nodeName.toLowerCase() != 'fieldset' &&\n !field.disabled && type != 'submit' && type != 'reset' && type != 'button' && type != 'file' &&\n ((type != 'radio' && type != 'checkbox') || field.checked))\n add($(field).val())\n })\n return result\n }\n\n $.fn.serialize = function(){\n var result = []\n this.serializeArray().forEach(function(elm){\n result.push(encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value))\n })\n return result.join('&')\n }\n\n $.fn.submit = function(callback) {\n if (0 in arguments) this.bind('submit', callback)\n else if (this.length) {\n var event = $.Event('submit')\n this.eq(0).trigger(event)\n if (!event.isDefaultPrevented()) this.get(0).submit()\n }\n return this\n }\n\n})(Zepto)\n\n;(function(){\n // getComputedStyle shouldn't freak out when called\n // without a valid element as argument\n try {\n getComputedStyle(undefined)\n } catch(e) {\n var nativeGetComputedStyle = getComputedStyle\n window.getComputedStyle = function(element, pseudoElement){\n try {\n return nativeGetComputedStyle(element, pseudoElement)\n } catch(e) {\n return null\n }\n }\n }\n})()\n return Zepto\n}))\n\n}.call(window));","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",r=\"hour\",i=\"day\",s=\"week\",u=\"month\",o=\"quarter\",a=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var r=String(t);return!r||r.length>=n?t:\"\"+Array(n+1-r.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),r=Math.floor(e/60),i=e%60;return(n<=0?\"+\":\"-\")+c(r,2,\"0\")+\":\"+c(i,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(e,u),i=n-r<0,s=t.clone().add(e+(i?-1:1),u);return Number(-(e+(n-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:\"date\",h:r,m:e,s:n,ms:t,Q:o}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,n,e){var r;if(!t)return l;if(\"string\"==typeof t)m[t]&&(r=t),n&&(m[t]=n,r=t);else{var i=t.name;m[i]=t,r=i}return!e&&r&&(l=r),r||!e&&l},g=function(t,n,e){if(y(t))return t.clone();var r=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return r.date=t,new v(r)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u,$offset:n.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var r=n.match(h);if(r)return e?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t)<this.startOf(n)},d.isBefore=function(t,n){return this.endOf(n)<g(t)},d.$g=function(t,n,e){return D.u(t)?this[n]:this.set(e,t)},d.year=function(t){return this.$g(t,\"$y\",a)},d.month=function(t){return this.$g(t,\"$M\",u)},d.day=function(t){return this.$g(t,\"$W\",i)},d.date=function(t){return this.$g(t,\"$D\",\"date\")},d.hour=function(t){return this.$g(t,\"$H\",r)},d.minute=function(t){return this.$g(t,\"$m\",e)},d.second=function(t){return this.$g(t,\"$s\",n)},d.millisecond=function(n){return this.$g(n,\"$ms\",t)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,o){var h=this,f=!!D.u(o)||o,c=D.p(t),d=function(t,n){var e=D.w(h.$u?Date.UTC(h.$y,n,t):new Date(h.$y,n,t),h);return f?e:e.endOf(i)},$=function(t,n){return D.w(h.toDate()[t].apply(h.toDate(),(f?[0,0,0,0]:[23,59,59,999]).slice(n)),h)},l=this.$W,m=this.$M,y=this.$D,M=\"set\"+(this.$u?\"UTC\":\"\");switch(c){case a:return f?d(1,0):d(31,11);case u:return f?d(1,m):d(0,m+1);case s:var g=this.$locale().weekStart||0,v=(l<g?l+7:l)-g;return d(f?y-v:y+(6-v),m);case i:case\"date\":return $(M+\"Hours\",0);case r:return $(M+\"Minutes\",1);case e:return $(M+\"Seconds\",2);case n:return $(M+\"Milliseconds\",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(s,o){var h,f=D.p(s),c=\"set\"+(this.$u?\"UTC\":\"\"),d=(h={},h[i]=c+\"Date\",h.date=c+\"Date\",h[u]=c+\"Month\",h[a]=c+\"FullYear\",h[r]=c+\"Hours\",h[e]=c+\"Minutes\",h[n]=c+\"Seconds\",h[t]=c+\"Milliseconds\",h)[f],$=f===i?this.$D+(o-this.$W):o;if(f===u||f===a){var l=this.clone().set(\"date\",1);l.$d[d]($),l.init(),this.$d=l.set(\"date\",Math.min(this.$D,l.daysInMonth())).toDate()}else d&&this.$d[d]($);return this.init(),this},d.set=function(t,n){return this.clone().$set(t,n)},d.get=function(t){return this[D.p(t)]()},d.add=function(t,o){var h,f=this;t=Number(t);var c=D.p(o),d=function(n){var e=g(f);return D.w(e.date(e.date()+Math.round(n*t)),f)};if(c===u)return this.set(u,this.$M+t);if(c===a)return this.set(a,this.$y+t);if(c===i)return d(1);if(c===s)return d(7);var $=(h={},h[e]=6e4,h[r]=36e5,h[n]=1e3,h)[c]||1,l=this.$d.getTime()+t*$;return D.w(l,this)},d.subtract=function(t,n){return this.add(-1*t,n)},d.format=function(t){var n=this;if(!this.isValid())return\"Invalid Date\";var e=t||\"YYYY-MM-DDTHH:mm:ssZ\",r=D.z(this),i=this.$locale(),s=this.$H,u=this.$m,o=this.$M,a=i.weekdays,h=i.months,c=function(t,r,i,s){return t&&(t[r]||t(n,e))||i[r].substr(0,s)},d=function(t){return D.s(s%12||12,t,\"0\")},$=i.meridiem||function(t,n,e){var r=t<12?\"AM\":\"PM\";return e?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:o+1,MM:D.s(o+1,2,\"0\"),MMM:c(i.monthsShort,o,h,3),MMMM:h[o]||h(this,e),D:this.$D,DD:D.s(this.$D,2,\"0\"),d:String(this.$W),dd:c(i.weekdaysMin,this.$W,a,2),ddd:c(i.weekdaysShort,this.$W,a,3),dddd:a[this.$W],H:String(s),HH:D.s(s,2,\"0\"),h:d(1),hh:d(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:D.s(u,2,\"0\"),s:String(this.$s),ss:D.s(this.$s,2,\"0\"),SSS:D.s(this.$ms,3,\"0\"),Z:r};return e.replace(f,function(t,n){return n||l[t]||r.replace(\":\",\"\")})},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(t,h,f){var c,d=D.p(h),$=g(t),l=6e4*($.utcOffset()-this.utcOffset()),m=this-$,y=D.m(this,$);return y=(c={},c[a]=y/12,c[u]=y,c[o]=y/3,c[s]=(m-l)/6048e5,c[i]=(m-l)/864e5,c[r]=m/36e5,c[e]=m/6e4,c[n]=m/1e3,c)[d]||m,f?y:D.a(y)},d.daysInMonth=function(){return this.endOf(u).$D},d.$locale=function(){return m[this.$L]},d.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),r=M(t,n,!0);return r&&(e.$L=r),e},d.clone=function(){return D.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},c}();return g.prototype=v.prototype,g.extend=function(t,n){return t(n,v,g),g},g.locale=M,g.isDayjs=y,g.unix=function(t){return g(1e3*t)},g.en=m[l],g.Ls=m,g});\n","( function _package( factory ){\r\n\tif( typeof define === 'function' && define.amd ){\r\n\t\tdefine( [ 'mithril' ], factory )\r\n\t}\r\n\telse if( typeof exports === 'object' ){\r\n\t\tmodule.exports = factory( require( 'mithril' ) )\r\n\t}\r\n\telse{\r\n\t\tfactory( m )\r\n\t}\r\n}( function define( m ){\r\n\tfunction bidi( node, prop ){\r\n\t\tvar type = node.tag === 'select'\r\n\t\t\t? node.attrs.multi\r\n\t\t\t\t? 'multi'\r\n\t\t\t\t: 'select'\r\n\t\t\t: node.attrs.type\r\n\r\n\t\t// Setup: bind listeners\r\n\t\tif( type === 'multi' ){\r\n\t\t\tnode.attrs.onchange = function(){\r\n\t\t\t\tprop( [].slice.call( this.selectedOptions, function( x ){\r\n\t\t\t\t\treturn x.value\r\n\t\t\t\t} ) )\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if( type === 'select' ){\r\n\t\t\tnode.attrs.onchange = function( e ){\r\n\t\t\t\tprop( this.selectedOptions[ 0 ].value )\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if( type === 'checkbox' ){\r\n\t\t\tnode.attrs.onchange = function( e ){\r\n\t\t\t\tprop( this.checked )\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.attrs.onchange = node.attrs.oninput = function( e ){\r\n\t\t\t\tprop( this.value )\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( node.tag === 'select' ){\r\n\t\t\tnode.children.forEach( function( option ){\r\n\t\t\t\tif( option.attrs.value === prop() || option.children[ 0 ] === prop() ){\r\n\t\t\t\t\toption.attrs.selected = true\r\n\t\t\t\t}\r\n\t\t\t} )\r\n\t\t}\r\n\t\telse if( type === 'checkbox' ){\r\n\t\t\tnode.attrs.checked = prop()\r\n\t\t}\r\n\t\telse if( type === 'radio' ){\r\n\t\t\tnode.attrs.checked = prop() === node.attrs.value\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.attrs.value = prop()\r\n\t\t}\r\n\r\n\t\treturn node\r\n\t}\r\n\r\n\tbidi.view = function( ctrl, node, prop ){\r\n\t return bidi( node, node.attrs.bidi )\r\n\t}\r\n\r\n\tif( m.attrs ) m.attrs.bidi = bidi\r\n\t\r\n\tm.bidi = bidi\r\n\r\n\treturn bidi\r\n} ) )\r\n","\"use strict\"\n\nvar hyperscript = require(\"./hyperscript\")\nvar request = require(\"./request\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nvar m = function m() { return hyperscript.apply(this, arguments) }\nm.m = hyperscript\nm.trust = hyperscript.trust\nm.fragment = hyperscript.fragment\nm.mount = mountRedraw.mount\nm.route = require(\"./route\")\nm.render = require(\"./render\")\nm.redraw = mountRedraw.redraw\nm.request = request.request\nm.jsonp = request.jsonp\nm.parseQueryString = require(\"./querystring/parse\")\nm.buildQueryString = require(\"./querystring/build\")\nm.parsePathname = require(\"./pathname/parse\")\nm.buildPathname = require(\"./pathname/build\")\nm.vnode = require(\"./render/vnode\")\nm.PromisePolyfill = require(\"./promise/polyfill\")\n\nmodule.exports = m\n","/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n","/* ========================================================================\n * Bootstrap: dropdown.js v3.4.1\n * https://getbootstrap.com/docs/3.4/javascript/#dropdowns\n * ========================================================================\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n 'use strict';\n\n // DROPDOWN CLASS DEFINITION\n // =========================\n\n var backdrop = '.dropdown-backdrop'\n var toggle = '[data-toggle=\"dropdown\"]'\n var Dropdown = function (element) {\n $(element).on('click.bs.dropdown', this.toggle)\n }\n\n Dropdown.VERSION = '3.4.1'\n\n function getParent($this) {\n var selector = $this.attr('data-target')\n\n if (!selector) {\n selector = $this.attr('href')\n selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n }\n\n var $parent = selector !== '#' ? $(document).find(selector) : null\n\n return $parent && $parent.length ? $parent : $this.parent()\n }\n\n function clearMenus(e) {\n if (e && e.which === 3) return\n $(backdrop).remove()\n $(toggle).each(function () {\n var $this = $(this)\n var $parent = getParent($this)\n var relatedTarget = { relatedTarget: this }\n\n if (!$parent.hasClass('open')) return\n\n if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return\n\n $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))\n\n if (e.isDefaultPrevented()) return\n\n $this.attr('aria-expanded', 'false')\n $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))\n })\n }\n\n Dropdown.prototype.toggle = function (e) {\n var $this = $(this)\n\n if ($this.is('.disabled, :disabled')) return\n\n var $parent = getParent($this)\n var isActive = $parent.hasClass('open')\n\n clearMenus()\n\n if (!isActive) {\n if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {\n // if mobile we use a backdrop because click events don't delegate\n $(document.createElement('div'))\n .addClass('dropdown-backdrop')\n .insertAfter($(this))\n .on('click', clearMenus)\n }\n\n var relatedTarget = { relatedTarget: this }\n $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))\n\n if (e.isDefaultPrevented()) return\n\n $this\n .trigger('focus')\n .attr('aria-expanded', 'true')\n\n $parent\n .toggleClass('open')\n .trigger($.Event('shown.bs.dropdown', relatedTarget))\n }\n\n return false\n }\n\n Dropdown.prototype.keydown = function (e) {\n if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return\n\n var $this = $(this)\n\n e.preventDefault()\n e.stopPropagation()\n\n if ($this.is('.disabled, :disabled')) return\n\n var $parent = getParent($this)\n var isActive = $parent.hasClass('open')\n\n if (!isActive && e.which != 27 || isActive && e.which == 27) {\n if (e.which == 27) $parent.find(toggle).trigger('focus')\n return $this.trigger('click')\n }\n\n var desc = ' li:not(.disabled):visible a'\n var $items = $parent.find('.dropdown-menu' + desc)\n\n if (!$items.length) return\n\n var index = $items.index(e.target)\n\n if (e.which == 38 && index > 0) index-- // up\n if (e.which == 40 && index < $items.length - 1) index++ // down\n if (!~index) index = 0\n\n $items.eq(index).trigger('focus')\n }\n\n\n // DROPDOWN PLUGIN DEFINITION\n // ==========================\n\n function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.dropdown')\n\n if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))\n if (typeof option == 'string') data[option].call($this)\n })\n }\n\n var old = $.fn.dropdown\n\n $.fn.dropdown = Plugin\n $.fn.dropdown.Constructor = Dropdown\n\n\n // DROPDOWN NO CONFLICT\n // ====================\n\n $.fn.dropdown.noConflict = function () {\n $.fn.dropdown = old\n return this\n }\n\n\n // APPLY TO STANDARD DROPDOWN ELEMENTS\n // ===================================\n\n $(document)\n .on('click.bs.dropdown.data-api', clearMenus)\n .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })\n .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)\n .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)\n .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)\n\n}(jQuery);\n","/* ========================================================================\n * Bootstrap: transition.js v3.4.1\n * https://getbootstrap.com/docs/3.4/javascript/#transitions\n * ========================================================================\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n 'use strict';\n\n // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)\n // ============================================================\n\n function transitionEnd() {\n var el = document.createElement('bootstrap')\n\n var transEndEventNames = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n for (var name in transEndEventNames) {\n if (el.style[name] !== undefined) {\n return { end: transEndEventNames[name] }\n }\n }\n\n return false // explicit for ie8 ( ._.)\n }\n\n // https://blog.alexmaccaw.com/css-transitions\n $.fn.emulateTransitionEnd = function (duration) {\n var called = false\n var $el = this\n $(this).one('bsTransitionEnd', function () { called = true })\n var callback = function () { if (!called) $($el).trigger($.support.transition.end) }\n setTimeout(callback, duration)\n return this\n }\n\n $(function () {\n $.support.transition = transitionEnd()\n\n if (!$.support.transition) return\n\n $.event.special.bsTransitionEnd = {\n bindType: $.support.transition.end,\n delegateType: $.support.transition.end,\n handle: function (e) {\n if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)\n }\n }\n })\n\n}(jQuery);\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):e.dayjs_plugin_localizedFormat=t()}(this,function(){\"use strict\";return function(e,t,o){var n=t.prototype,r=n.format,M={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"};o.en.formats=M;n.format=function(e){void 0===e&&(e=\"YYYY-MM-DDTHH:mm:ssZ\");var t=this.$locale().formats,o=void 0===t?{}:t,n=e.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(e,t,n){var r=n&&n.toUpperCase();return t||o[n]||M[n]||o[r].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,o){return t||o.slice(1)})});return r.call(this,n)}}});\n","!function(r,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):r.dayjs_plugin_relativeTime=t()}(this,function(){\"use strict\";return function(r,t,e){var n=t.prototype;e.en.relativeTime={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"};var o=function(r,t,n,o){for(var d,i,u,a=n.$locale().relativeTime,f=[{l:\"s\",r:44,d:\"second\"},{l:\"m\",r:89},{l:\"mm\",r:44,d:\"minute\"},{l:\"h\",r:89},{l:\"hh\",r:21,d:\"hour\"},{l:\"d\",r:35},{l:\"dd\",r:25,d:\"day\"},{l:\"M\",r:45},{l:\"MM\",r:10,d:\"month\"},{l:\"y\",r:17},{l:\"yy\",d:\"year\"}],s=f.length,l=0;l<s;l+=1){var h=f[l];h.d&&(d=o?e(r).diff(n,h.d,!0):n.diff(r,h.d,!0));var m=Math.round(Math.abs(d));if(u=d>0,m<=h.r||!h.r){1===m&&l>0&&(h=f[l-1]);var c=a[h.l];i=\"string\"==typeof c?c.replace(\"%d\",m):c(m,t,h.l,u);break}}return t?i:(u?a.future:a.past).replace(\"%s\",i)};n.to=function(r,t){return o(r,t,this,!0)},n.from=function(r,t){return o(r,t,this)};var d=function(r){return r.$u?e.utc():e()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}});\n","module.exports = global[\"Mousetrap\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\mousetrap.js\");","module.exports = global[\"classNames\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\index.js\");","module.exports = global[\"dayjs\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\dayjs.min.js\");","module.exports = global[\"jQuery\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\imports-loader\\\\index.js?this=>window!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\zepto.js\");","module.exports = global[\"m\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\index.js\");","if(!global[\"m\"]) global[\"m\"] = {};\nmodule.exports = global[\"m\"][\"bidi\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\bidi.js\");","module.exports = global[\"moment\"] = require(\"-!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\expose-loader\\\\index.js?dayjs!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--5!E:\\\\sites\\\\flarum-new\\\\packages\\\\flarum-core\\\\js\\\\node_modules\\\\source-map-loader\\\\index.js!.\\\\dayjs.min.js\");","/*!\n * HC-Sticky\n * =========\n * Version: 2.2.3\n * Author: Some Web Media\n * Author URL: http://somewebmedia.com\n * Plugin URL: https://github.com/somewebmedia/hc-sticky\n * Description: Cross-browser plugin that makes any element on your page visible while you scroll\n * License: MIT\n */\n!function(t,e){\"use strict\";if(\"object\"==typeof module&&\"object\"==typeof module.exports){if(!t.document)throw new Error(\"HC-Sticky requires a browser to run.\");module.exports=e(t)}else\"function\"==typeof define&&define.amd?define(\"hcSticky\",[],e(t)):e(t)}(\"undefined\"!=typeof window?window:this,function(U){\"use strict\";var Y={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:\"sticky\",stickTo:null,followScroll:!0,responsive:null,mobileFirst:!1,onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1,queries:null,queryFlow:\"down\"},$=function(t,e,o){console.log(\"%c! HC Sticky:%c \"+t+\"%c \"+o+\" is now deprecated and will be removed. Use%c \"+e+\"%c instead.\",\"color: red\",\"color: darkviolet\",\"color: black\",\"color: darkviolet\",\"color: black\")},Q=U.document,X=function(n,f){var o=this;if(\"string\"==typeof n&&(n=Q.querySelector(n)),!n)return!1;f.queries&&$(\"queries\",\"responsive\",\"option\"),f.queryFlow&&$(\"queryFlow\",\"mobileFirst\",\"option\");var p={},d=X.Helpers,s=n.parentNode;\"static\"===d.getStyle(s,\"position\")&&(s.style.position=\"relative\");var u=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.isEmptyObject(t)&&!d.isEmptyObject(p)||(p=Object.assign({},Y,p,t))},t=function(){return p.disable},e=function(){var t,e=p.responsive||p.queries;if(e){var o=U.innerWidth;if(t=f,(p=Object.assign({},Y,t||{})).mobileFirst)for(var i in e)i<=o&&!d.isEmptyObject(e[i])&&u(e[i]);else{var n=[];for(var s in e){var r={};r[s]=e[s],n.push(r)}for(var l=n.length-1;0<=l;l--){var a=n[l],c=Object.keys(a)[0];o<=c&&!d.isEmptyObject(a[c])&&u(a[c])}}}},r={css:{},position:null,stick:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.hasClass(n,p.stickyClass)||(!1===l.isAttached&&l.attach(),r.position=\"fixed\",n.style.position=\"fixed\",n.style.left=l.offsetLeft+\"px\",n.style.width=l.width,void 0===t.bottom?n.style.bottom=\"auto\":n.style.bottom=t.bottom+\"px\",void 0===t.top?n.style.top=\"auto\":n.style.top=t.top+\"px\",n.classList?n.classList.add(p.stickyClass):n.className+=\" \"+p.stickyClass,p.onStart&&p.onStart.call(n,Object.assign({},p)))},release:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.stop=t.stop||!1,!0===t.stop||\"fixed\"===r.position||null===r.position||!(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(d.getStyle(n,\"top\"))||0)===t.top||void 0!==t.bottom&&(parseInt(d.getStyle(n,\"bottom\"))||0)===t.bottom)){!0===t.stop?!0===l.isAttached&&l.detach():!1===l.isAttached&&l.attach();var e=t.position||r.css.position;r.position=e,n.style.position=e,n.style.left=!0===t.stop?r.css.left:l.positionLeft+\"px\",n.style.width=\"absolute\"!==e?r.css.width:l.width,void 0===t.bottom?n.style.bottom=!0===t.stop?\"\":\"auto\":n.style.bottom=t.bottom+\"px\",void 0===t.top?n.style.top=!0===t.stop?\"\":\"auto\":n.style.top=t.top+\"px\",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp(\"(^|\\\\b)\"+p.stickyClass.split(\" \").join(\"|\")+\"(\\\\b|$)\",\"gi\"),\" \"),p.onStop&&p.onStop.call(n,Object.assign({},p))}}},l={el:Q.createElement(\"div\"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in l.el.className=\"sticky-spacer\",r.css)l.el.style[t]=r.css[t];l.el.style[\"z-index\"]=\"-1\";var e=d.getStyle(n);l.offsetLeft=d.offset(n).left-(parseInt(e.marginLeft)||0),l.positionLeft=d.position(n).left,l.width=d.getStyle(n,\"width\")},attach:function(){s.insertBefore(l.el,n),l.isAttached=!0},detach:function(){l.el=s.removeChild(l.el),l.isAttached=!1}},a=void 0,c=void 0,g=void 0,m=void 0,h=void 0,v=void 0,y=void 0,b=void 0,S=void 0,w=void 0,k=void 0,E=void 0,x=void 0,L=void 0,T=void 0,j=void 0,O=void 0,C=void 0,i=function(){var t,e,o,i;r.css=(t=n,e=d.getCascadedStyle(t),o=d.getStyle(t),i={height:t.offsetHeight+\"px\",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:o.position,display:o.display,verticalAlign:o.verticalAlign,boxSizing:o.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(i.float=e.float||\"none\"),e.cssFloat&&(i.cssFloat=e.cssFloat||\"none\"),o.MozBoxSizing&&(i.MozBoxSizing=o.MozBoxSizing),i.width=\"auto\"!==e.width?e.width:\"border-box\"===i.boxSizing||\"border-box\"===i.MozBoxSizing?t.offsetWidth+\"px\":o.width,i),l.init(),a=!(!p.stickTo||!(\"document\"===p.stickTo||p.stickTo.nodeType&&9===p.stickTo.nodeType||\"object\"==typeof p.stickTo&&p.stickTo instanceof(\"undefined\"!=typeof HTMLDocument?HTMLDocument:Document))),c=p.stickTo?a?Q:\"string\"==typeof p.stickTo?Q.querySelector(p.stickTo):p.stickTo:s,T=(C=function(){var t=n.offsetHeight+(parseInt(r.css.marginTop)||0)+(parseInt(r.css.marginBottom)||0),e=(T||0)-t;return-1<=e&&e<=1?T:t})(),m=(O=function(){return a?Math.max(Q.documentElement.clientHeight,Q.body.scrollHeight,Q.documentElement.scrollHeight,Q.body.offsetHeight,Q.documentElement.offsetHeight):c.offsetHeight})(),h=a?0:d.offset(c).top,v=p.stickTo?a?0:d.offset(s).top:h,y=U.innerHeight,j=n.offsetTop-(parseInt(r.css.marginTop)||0),g=p.innerSticker?\"string\"==typeof p.innerSticker?Q.querySelector(p.innerSticker):p.innerSticker:null,b=isNaN(p.top)&&-1<p.top.indexOf(\"%\")?parseFloat(p.top)/100*y:p.top,S=isNaN(p.bottom)&&-1<p.bottom.indexOf(\"%\")?parseFloat(p.bottom)/100*y:p.bottom,w=g?g.offsetTop:p.innerTop?p.innerTop:0,k=isNaN(p.bottomEnd)&&-1<p.bottomEnd.indexOf(\"%\")?parseFloat(p.bottomEnd)/100*y:p.bottomEnd,E=h-b+w+j},z=U.pageYOffset||Q.documentElement.scrollTop,N=0,H=void 0,R=function(){T=C(),m=O(),x=h+m-b-k,L=y<T;var t=U.pageYOffset||Q.documentElement.scrollTop,e=d.offset(n).top,o=e-t,i=void 0;H=t<z?\"up\":\"down\",N=t-z,E<(z=t)?x+b+(L?S:0)-(p.followScroll&&L?0:b)<=t+T-w-(y-(E-w)<T-w&&p.followScroll&&0<(i=T-y-w)?i:0)?r.release({position:\"absolute\",bottom:v+s.offsetHeight-x-b}):L&&p.followScroll?\"down\"===H?o+T+S<=y+.9?r.stick({bottom:S}):\"fixed\"===r.position&&r.release({position:\"absolute\",top:e-b-E-N+w}):Math.ceil(o+w)<0&&\"fixed\"===r.position?r.release({position:\"absolute\",top:e-b-E+w-N}):t+b-w<=e&&r.stick({top:b-w}):r.stick({top:b-w}):r.release({stop:!0})},A=!1,B=!1,I=function(){A&&(d.event.unbind(U,\"scroll\",R),A=!1)},q=function(){null!==n.offsetParent&&\"none\"!==d.getStyle(n,\"display\")?(i(),m<=T?I():(R(),A||(d.event.bind(U,\"scroll\",R),A=!0))):I()},F=function(){n.style.position=\"\",n.style.left=\"\",n.style.top=\"\",n.style.bottom=\"\",n.style.width=\"\",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp(\"(^|\\\\b)\"+p.stickyClass.split(\" \").join(\"|\")+\"(\\\\b|$)\",\"gi\"),\" \"),r.css={},!(r.position=null)===l.isAttached&&l.detach()},M=function(){F(),e(),t()?I():q()},D=function(){p.onBeforeResize&&p.onBeforeResize.call(n,Object.assign({},p)),M(),p.onResize&&p.onResize.call(n,Object.assign({},p))},P=p.resizeDebounce?d.debounce(D,p.resizeDebounce):D,W=function(){B&&(d.event.unbind(U,\"resize\",P),B=!1),I()},V=function(){B||(d.event.bind(U,\"resize\",P),B=!0),e(),t()?I():q()};this.options=function(t){return t?p[t]:Object.assign({},p)},this.refresh=M,this.update=function(t){u(t),f=Object.assign({},f,t||{}),M()},this.attach=V,this.detach=W,this.destroy=function(){W(),F()},this.triggerMethod=function(t,e){\"function\"==typeof o[t]&&o[t](e)},this.reinit=function(){$(\"reinit\",\"refresh\",\"method\"),M()},u(f),V(),d.event.bind(U,\"load\",M)};if(void 0!==U.jQuery){var i=U.jQuery,n=\"hcSticky\";i.fn.extend({hcSticky:function(e,o){return this.length?\"options\"===e?i.data(this.get(0),n).options():this.each(function(){var t=i.data(this,n);t?t.triggerMethod(e,o):(t=new X(this,e),i.data(this,n,t))}):this}})}return U.hcSticky=U.hcSticky||X,X}),function(c){\"use strict\";var t=c.hcSticky,f=c.document;\"function\"!=typeof Object.assign&&Object.defineProperty(Object,\"assign\",{value:function(t,e){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var o=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}return o},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,o;if(null==this)throw new TypeError(\"this is null or not defined\");var i=Object(this),n=i.length>>>0;if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");for(1<arguments.length&&(e=arguments[1]),o=0;o<n;){var s;o in i&&(s=i[o],t.call(e,s,o,i)),o++}});var e=function(){var t=f.documentElement,e=function(){};function i(t){var e=c.event;return e.target=e.target||e.srcElement||t,e}t.addEventListener?e=function(t,e,o){t.addEventListener(e,o,!1)}:t.attachEvent&&(e=function(e,t,o){e[t+o]=o.handleEvent?function(){var t=i(e);o.handleEvent.call(o,t)}:function(){var t=i(e);o.call(e,t)},e.attachEvent(\"on\"+t,e[t+o])});var o=function(){};return t.removeEventListener?o=function(t,e,o){t.removeEventListener(e,o,!1)}:t.detachEvent&&(o=function(e,o,i){e.detachEvent(\"on\"+o,e[o+i]);try{delete e[o+i]}catch(t){e[o+i]=void 0}}),{bind:e,unbind:o}}(),r=function(t,e){return c.getComputedStyle?e?f.defaultView.getComputedStyle(t,null).getPropertyValue(e):f.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\\w/g,function(t){return t.toUpperCase().replace(\"-\",\"\")})]:t.currentStyle:void 0},l=function(t){var e=t.getBoundingClientRect(),o=c.pageYOffset||f.documentElement.scrollTop,i=c.pageXOffset||f.documentElement.scrollLeft;return{top:e.top+o,left:e.left+i}};t.Helpers={isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(i,n,s){var r=void 0;return function(){var t=this,e=arguments,o=s&&!r;clearTimeout(r),r=setTimeout(function(){r=null,s||i.apply(t,e)},n),o&&i.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp(\"(^| )\"+e+\"( |$)\",\"gi\").test(t.className)},offset:l,position:function(t){var e=t.offsetParent,o=l(e),i=l(t),n=r(e),s=r(t);return o.top+=parseInt(n.borderTopWidth)||0,o.left+=parseInt(n.borderLeftWidth)||0,{top:i.top-o.top-(parseInt(s.marginTop)||0),left:i.left-o.left-(parseInt(s.marginLeft)||0)}},getStyle:r,getCascadedStyle:function(t){var e=t.cloneNode(!0);e.style.display=\"none\",Array.prototype.slice.call(e.querySelectorAll('input[type=\"radio\"]')).forEach(function(t){t.removeAttribute(\"name\")}),t.parentNode.insertBefore(e,t.nextSibling);var o=void 0;e.currentStyle?o=e.currentStyle:c.getComputedStyle&&(o=f.defaultView.getComputedStyle(e,null));var i={};for(var n in o)!isNaN(n)||\"string\"!=typeof o[n]&&\"number\"!=typeof o[n]||(i[n]=o[n]);if(Object.keys(i).length<3)for(var s in i={},o)isNaN(s)||(i[o[s].replace(/-\\w/g,function(t){return t.toUpperCase().replace(\"-\",\"\")})]=o.getPropertyValue(o[s]));if(i.margin||\"auto\"!==i.marginLeft?i.margin||i.marginLeft!==i.marginRight||i.marginLeft!==i.marginTop||i.marginLeft!==i.marginBottom||(i.margin=i.marginLeft):i.margin=\"auto\",!i.margin&&\"0px\"===i.marginLeft&&\"0px\"===i.marginRight){var r=t.offsetLeft-t.parentNode.offsetLeft,l=r-(parseInt(i.left)||0)-(parseInt(i.right)||0),a=t.parentNode.offsetWidth-t.offsetWidth-r-(parseInt(i.right)||0)+(parseInt(i.left)||0)-l;0!==a&&1!==a||(i.margin=\"auto\")}return e.parentNode.removeChild(e),e=null,i},event:e}}(window);","// Robert Penner's easeInOutQuad\n\n// find the rest of his easing functions here: http://robertpenner.com/easing/\n// find them exported for ES6 consumption here: https://github.com/jaxgeller/ez.js\n\nvar easeInOutQuad = function easeInOutQuad(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\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar jumper = function jumper() {\n // private variable cache\n // no variables are created during a jump, preventing memory leaks\n\n var element = void 0; // element to scroll to (node)\n\n var start = void 0; // where scroll starts (px)\n var stop = void 0; // where scroll stops (px)\n\n var offset = void 0; // adjustment from the stop position (px)\n var easing = void 0; // easing function (function)\n var a11y = void 0; // accessibility support flag (boolean)\n\n var distance = void 0; // distance of scroll (px)\n var duration = void 0; // scroll duration (ms)\n\n var timeStart = void 0; // time scroll started (ms)\n var timeElapsed = void 0; // time spent scrolling thus far (ms)\n\n var next = void 0; // next scroll position (px)\n\n var callback = void 0; // to call when done scrolling (function)\n\n // scroll position helper\n\n function location() {\n return window.scrollY || window.pageYOffset;\n }\n\n // element offset helper\n\n function top(element) {\n return element.getBoundingClientRect().top + start;\n }\n\n // rAF loop helper\n\n function loop(timeCurrent) {\n // store time scroll started, if not started already\n if (!timeStart) {\n timeStart = timeCurrent;\n }\n\n // determine time spent scrolling so far\n timeElapsed = timeCurrent - timeStart;\n\n // calculate next scroll position\n next = easing(timeElapsed, start, distance, duration);\n\n // scroll to it\n window.scrollTo(0, next);\n\n // check progress\n timeElapsed < duration ? window.requestAnimationFrame(loop) // continue scroll loop\n : done(); // scrolling is done\n }\n\n // scroll finished helper\n\n function done() {\n // account for rAF time rounding inaccuracies\n window.scrollTo(0, start + distance);\n\n // if scrolling to an element, and accessibility is enabled\n if (element && a11y) {\n // add tabindex indicating programmatic focus\n element.setAttribute('tabindex', '-1');\n\n // focus the element\n element.focus();\n }\n\n // if it exists, fire the callback\n if (typeof callback === 'function') {\n callback();\n }\n\n // reset time for next jump\n timeStart = false;\n }\n\n // API\n\n function jump(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // resolve options, or use defaults\n duration = options.duration || 1000;\n offset = options.offset || 0;\n callback = options.callback; // \"undefined\" is a suitable default, and won't be called\n easing = options.easing || easeInOutQuad;\n a11y = options.a11y || false;\n\n // cache starting position\n start = location();\n\n // resolve target\n switch (typeof target === 'undefined' ? 'undefined' : _typeof(target)) {\n // scroll from current position\n case 'number':\n element = undefined; // no element to scroll to\n a11y = false; // make sure accessibility is off\n stop = start + target;\n break;\n\n // scroll to element (node)\n // bounding rect is relative to the viewport\n case 'object':\n element = target;\n stop = top(element);\n break;\n\n // scroll to element (selector)\n // bounding rect is relative to the viewport\n case 'string':\n element = document.querySelector(target);\n stop = top(element);\n break;\n }\n\n // resolve scroll distance, accounting for offset\n distance = stop - start + offset;\n\n // resolve duration\n switch (_typeof(options.duration)) {\n // number in ms\n case 'number':\n duration = options.duration;\n break;\n\n // function passed the distance of the scroll\n case 'function':\n duration = options.duration(distance);\n break;\n }\n\n // start the loop\n window.requestAnimationFrame(loop);\n }\n\n // expose only the jump method\n return jump;\n};\n\n// export singleton\n\nvar singleton = jumper();\n\nexport default singleton;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var baseFlatten = require('./_baseFlatten');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","const MicroModal = (() => {\n\n const FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n class Modal {\n constructor({\n targetModal,\n triggers = [],\n onShow = () => {},\n onClose = () => {},\n openTrigger = 'data-micromodal-trigger',\n closeTrigger = 'data-micromodal-close',\n disableScroll = false,\n disableFocus = false,\n awaitCloseAnimation = false,\n awaitOpenAnimation = false,\n debugMode = false\n }) {\n // Save a reference of the modal\n this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n this.config = {\n debugMode,\n disableScroll,\n openTrigger,\n closeTrigger,\n onShow,\n onClose,\n awaitCloseAnimation,\n awaitOpenAnimation,\n disableFocus // Register click events only if pre binding eventListeners\n\n };\n if (triggers.length > 0) this.registerTriggers(...triggers); // pre bind functions for event listeners\n\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n }\n /**\n * Loops through all openTriggers and binds click event\n * @param {array} triggers [Array of node elements]\n * @return {void}\n */\n\n\n registerTriggers(...triggers) {\n triggers.filter(Boolean).forEach(trigger => {\n trigger.addEventListener('click', event => this.showModal(event));\n });\n }\n\n showModal() {\n this.activeElement = document.activeElement;\n this.modal.setAttribute('aria-hidden', 'false');\n this.modal.classList.add('is-open');\n this.scrollBehaviour('disable');\n this.addEventListeners();\n\n if (this.config.awaitOpenAnimation) {\n const handler = () => {\n this.modal.removeEventListener('animationend', handler, false);\n this.setFocusToFirstNode();\n };\n\n this.modal.addEventListener('animationend', handler, false);\n } else {\n this.setFocusToFirstNode();\n }\n\n this.config.onShow(this.modal, this.activeElement);\n }\n\n closeModal() {\n const modal = this.modal;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.scrollBehaviour('enable');\n\n if (this.activeElement) {\n this.activeElement.focus();\n }\n\n this.config.onClose(this.modal);\n\n if (this.config.awaitCloseAnimation) {\n this.modal.addEventListener('animationend', function handler() {\n modal.classList.remove('is-open');\n modal.removeEventListener('animationend', handler, false);\n }, false);\n } else {\n modal.classList.remove('is-open');\n }\n }\n\n closeModalById(targetModal) {\n this.modal = document.getElementById(targetModal);\n if (this.modal) this.closeModal();\n }\n\n scrollBehaviour(toggle) {\n if (!this.config.disableScroll) return;\n const body = document.querySelector('body');\n\n switch (toggle) {\n case 'enable':\n Object.assign(body.style, {\n overflow: '',\n height: ''\n });\n break;\n\n case 'disable':\n Object.assign(body.style, {\n overflow: 'hidden',\n height: '100vh'\n });\n break;\n\n default:\n }\n }\n\n addEventListeners() {\n this.modal.addEventListener('touchstart', this.onClick);\n this.modal.addEventListener('click', this.onClick);\n document.addEventListener('keydown', this.onKeydown);\n }\n\n removeEventListeners() {\n this.modal.removeEventListener('touchstart', this.onClick);\n this.modal.removeEventListener('click', this.onClick);\n document.removeEventListener('keydown', this.onKeydown);\n }\n\n onClick(event) {\n if (event.target.hasAttribute(this.config.closeTrigger)) {\n this.closeModal();\n event.preventDefault();\n }\n }\n\n onKeydown(event) {\n if (event.keyCode === 27) this.closeModal(event);\n if (event.keyCode === 9) this.maintainFocus(event);\n }\n\n getFocusableNodes() {\n const nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Array(...nodes);\n }\n\n setFocusToFirstNode() {\n if (this.config.disableFocus) return;\n const focusableNodes = this.getFocusableNodes();\n if (focusableNodes.length) focusableNodes[0].focus();\n }\n\n maintainFocus(event) {\n const focusableNodes = this.getFocusableNodes(); // if disableFocus is true\n\n if (!this.modal.contains(document.activeElement)) {\n focusableNodes[0].focus();\n } else {\n const focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus();\n event.preventDefault();\n }\n\n if (!event.shiftKey && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus();\n event.preventDefault();\n }\n }\n }\n\n }\n /**\n * Modal prototype ends.\n * Here on code is responsible for detecting and\n * auto binding event handlers on modal triggers\n */\n // Keep a reference to the opened modal\n\n\n let activeModal = null;\n /**\n * Generates an associative array of modals and it's\n * respective triggers\n * @param {array} triggers An array of all triggers\n * @param {string} triggerAttr The data-attribute which triggers the module\n * @return {array}\n */\n\n const generateTriggerMap = (triggers, triggerAttr) => {\n const triggerMap = [];\n triggers.forEach(trigger => {\n const targetModal = trigger.attributes[triggerAttr].value;\n if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n triggerMap[targetModal].push(trigger);\n });\n return triggerMap;\n };\n /**\n * Validates whether a modal of the given id exists\n * in the DOM\n * @param {number} id The id of the modal\n * @return {boolean}\n */\n\n\n const validateModalPresence = id => {\n if (!document.getElementById(id)) {\n console.warn(`MicroModal: \\u2757Seems like you have missed %c'${id}'`, 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n console.warn(`%cExample:`, 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', `<div class=\"modal\" id=\"${id}\"></div>`);\n return false;\n }\n };\n /**\n * Validates if there are modal triggers present\n * in the DOM\n * @param {array} triggers An array of data-triggers\n * @return {boolean}\n */\n\n\n const validateTriggerPresence = triggers => {\n if (triggers.length <= 0) {\n console.warn(`MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'`, 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n console.warn(`%cExample:`, 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', `<a href=\"#\" data-micromodal-trigger=\"my-modal\"></a>`);\n return false;\n }\n };\n /**\n * Checks if triggers and their corresponding modals\n * are present in the DOM\n * @param {array} triggers Array of DOM nodes which have data-triggers\n * @param {array} triggerMap Associative array of modals and their triggers\n * @return {boolean}\n */\n\n\n const validateArgs = (triggers, triggerMap) => {\n validateTriggerPresence(triggers);\n if (!triggerMap) return true;\n\n for (var id in triggerMap) validateModalPresence(id);\n\n return true;\n };\n /**\n * Binds click handlers to all modal triggers\n * @param {object} config [description]\n * @return void\n */\n\n\n const init = config => {\n // Create an config object with default openTrigger\n const options = Object.assign({}, {\n openTrigger: 'data-micromodal-trigger'\n }, config); // Collects all the nodes with the trigger\n\n const triggers = [...document.querySelectorAll(`[${options.openTrigger}]`)]; // Makes a mappings of modals with their trigger nodes\n\n const triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n for (var key in triggerMap) {\n let value = triggerMap[key];\n options.targetModal = key;\n options.triggers = [...value];\n activeModal = new Modal(options); // eslint-disable-line no-new\n }\n };\n /**\n * Shows a particular modal\n * @param {string} targetModal [The id of the modal to display]\n * @param {object} config [The configuration object to pass]\n * @return {void}\n */\n\n\n const show = (targetModal, config) => {\n const options = config || {};\n options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // stores reference to active modal\n\n activeModal = new Modal(options); // eslint-disable-line no-new\n\n activeModal.showModal();\n };\n /**\n * Closes the active modal\n * @param {string} targetModal [The id of the modal to close]\n * @return {void}\n */\n\n\n const close = targetModal => {\n targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n };\n\n return {\n init,\n show,\n close\n };\n})();\n\nexport default MicroModal;\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(render, schedule, console) {\n\tvar subscriptions = []\n\tvar rendering = false\n\tvar pending = false\n\n\tfunction sync() {\n\t\tif (rendering) throw new Error(\"Nested m.redraw.sync() call\")\n\t\trendering = true\n\t\tfor (var i = 0; i < subscriptions.length; i += 2) {\n\t\t\ttry { render(subscriptions[i], Vnode(subscriptions[i + 1]), redraw) }\n\t\t\tcatch (e) { console.error(e) }\n\t\t}\n\t\trendering = false\n\t}\n\n\tfunction redraw() {\n\t\tif (!pending) {\n\t\t\tpending = true\n\t\t\tschedule(function() {\n\t\t\t\tpending = false\n\t\t\t\tsync()\n\t\t\t})\n\t\t}\n\t}\n\n\tredraw.sync = sync\n\n\tfunction mount(root, component) {\n\t\tif (component != null && component.view == null && typeof component !== \"function\") {\n\t\t\tthrow new TypeError(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t}\n\n\t\tvar index = subscriptions.indexOf(root)\n\t\tif (index >= 0) {\n\t\t\tsubscriptions.splice(index, 2)\n\t\t\trender(root, [], redraw)\n\t\t}\n\n\t\tif (component != null) {\n\t\t\tsubscriptions.push(root, component)\n\t\t\trender(root, Vnode(component), redraw)\n\t\t}\n\t}\n\n\treturn {mount: mount, redraw: redraw}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar m = require(\"../render/hyperscript\")\nvar Promise = require(\"../promise/promise\")\n\nvar buildPathname = require(\"../pathname/build\")\nvar parsePathname = require(\"../pathname/parse\")\nvar compileTemplate = require(\"../pathname/compileTemplate\")\nvar assign = require(\"../pathname/assign\")\n\nvar sentinel = {}\n\nmodule.exports = function($window, mountRedraw) {\n\tvar fireAsync\n\n\tfunction setPath(path, data, options) {\n\t\tpath = buildPathname(path, data)\n\t\tif (fireAsync != null) {\n\t\t\tfireAsync()\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, route.prefix + path)\n\t\t\telse $window.history.pushState(state, title, route.prefix + path)\n\t\t}\n\t\telse {\n\t\t\t$window.location.href = route.prefix + path\n\t\t}\n\t}\n\n\tvar currentResolver = sentinel, component, attrs, currentPath, lastUpdate\n\n\tvar SKIP = route.SKIP = {}\n\n\tfunction route(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\t// 0 = start\n\t\t// 1 = init\n\t\t// 2 = ready\n\t\tvar state = 0\n\n\t\tvar compiled = Object.keys(routes).map(function(route) {\n\t\t\tif (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a `/`\")\n\t\t\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(route)) {\n\t\t\t\tthrow new SyntaxError(\"Route parameter names must be separated with either `/`, `.`, or `-`\")\n\t\t\t}\n\t\t\treturn {\n\t\t\t\troute: route,\n\t\t\t\tcomponent: routes[route],\n\t\t\t\tcheck: compileTemplate(route),\n\t\t\t}\n\t\t})\n\t\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\t\tvar p = Promise.resolve()\n\t\tvar scheduled = false\n\t\tvar onremove\n\n\t\tfireAsync = null\n\n\t\tif (defaultRoute != null) {\n\t\t\tvar defaultData = parsePathname(defaultRoute)\n\n\t\t\tif (!compiled.some(function (i) { return i.check(defaultData) })) {\n\t\t\t\tthrow new ReferenceError(\"Default route doesn't match any known routes\")\n\t\t\t}\n\t\t}\n\n\t\tfunction resolveRoute() {\n\t\t\tscheduled = false\n\t\t\t// Consider the pathname holistically. The prefix might even be invalid,\n\t\t\t// but that's not our problem.\n\t\t\tvar prefix = $window.location.hash\n\t\t\tif (route.prefix[0] !== \"#\") {\n\t\t\t\tprefix = $window.location.search + prefix\n\t\t\t\tif (route.prefix[0] !== \"?\") {\n\t\t\t\t\tprefix = $window.location.pathname + prefix\n\t\t\t\t\tif (prefix[0] !== \"/\") prefix = \"/\" + prefix\n\t\t\t\t}\n\t\t\t}\n\t\t\t// This seemingly useless `.concat()` speeds up the tests quite a bit,\n\t\t\t// since the representation is consistently a relatively poorly\n\t\t\t// optimized cons string.\n\t\t\tvar path = prefix.concat()\n\t\t\t\t.replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\t\t\t.slice(route.prefix.length)\n\t\t\tvar data = parsePathname(path)\n\n\t\t\tassign(data.params, $window.history.state)\n\n\t\t\tfunction fail() {\n\t\t\t\tif (path === defaultRoute) throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t\t\tsetPath(defaultRoute, null, {replace: true})\n\t\t\t}\n\n\t\t\tloop(0)\n\t\t\tfunction loop(i) {\n\t\t\t\t// 0 = init\n\t\t\t\t// 1 = scheduled\n\t\t\t\t// 2 = done\n\t\t\t\tfor (; i < compiled.length; i++) {\n\t\t\t\t\tif (compiled[i].check(data)) {\n\t\t\t\t\t\tvar payload = compiled[i].component\n\t\t\t\t\t\tvar matchedRoute = compiled[i].route\n\t\t\t\t\t\tvar localComp = payload\n\t\t\t\t\t\tvar update = lastUpdate = function(comp) {\n\t\t\t\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\t\t\t\tif (comp === SKIP) return loop(i + 1)\n\t\t\t\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\t\t\t\tattrs = data.params, currentPath = path, lastUpdate = null\n\t\t\t\t\t\t\tcurrentResolver = payload.render ? payload : null\n\t\t\t\t\t\t\tif (state === 2) mountRedraw.redraw()\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tstate = 2\n\t\t\t\t\t\t\t\tmountRedraw.redraw.sync()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// There's no understating how much I *wish* I could\n\t\t\t\t\t\t// use `async`/`await` here...\n\t\t\t\t\t\tif (payload.view || typeof payload === \"function\") {\n\t\t\t\t\t\t\tpayload = {}\n\t\t\t\t\t\t\tupdate(localComp)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (payload.onmatch) {\n\t\t\t\t\t\t\tp.then(function () {\n\t\t\t\t\t\t\t\treturn payload.onmatch(data.params, path, matchedRoute)\n\t\t\t\t\t\t\t}).then(update, fail)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse update(\"div\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfail()\n\t\t\t}\n\t\t}\n\n\t\t// Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n\t\t// even if neither `pushState` nor `hashchange` are supported. It's\n\t\t// cleared if `hashchange` is used, since that makes it automatically\n\t\t// async.\n\t\tfireAsync = function() {\n\t\t\tif (!scheduled) {\n\t\t\t\tscheduled = true\n\t\t\t\tcallAsync(resolveRoute)\n\t\t\t}\n\t\t}\n\n\t\tif (typeof $window.history.pushState === \"function\") {\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"popstate\", fireAsync, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"popstate\", fireAsync, false)\n\t\t} else if (route.prefix[0] === \"#\") {\n\t\t\tfireAsync = null\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"hashchange\", resolveRoute, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"hashchange\", resolveRoute, false)\n\t\t}\n\n\t\treturn mountRedraw.mount(root, {\n\t\t\tonbeforeupdate: function() {\n\t\t\t\tstate = state ? 2 : 1\n\t\t\t\treturn !(!state || sentinel === currentResolver)\n\t\t\t},\n\t\t\toncreate: resolveRoute,\n\t\t\tonremove: onremove,\n\t\t\tview: function() {\n\t\t\t\tif (!state || sentinel === currentResolver) return\n\t\t\t\t// Wrap in a fragment to preserve existing key semantics\n\t\t\t\tvar vnode = [Vnode(component, attrs.key, attrs)]\n\t\t\t\tif (currentResolver) vnode = currentResolver.render(vnode[0])\n\t\t\t\treturn vnode\n\t\t\t},\n\t\t})\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\tsetPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = \"#!\"\n\troute.Link = {\n\t\tview: function(vnode) {\n\t\t\tvar options = vnode.attrs.options\n\t\t\t// Remove these so they don't get overwritten\n\t\t\tvar attrs = {}, onclick, href\n\t\t\tassign(attrs, vnode.attrs)\n\t\t\t// The first two are internal, but the rest are magic attributes\n\t\t\t// that need censored to not screw up rendering.\n\t\t\tattrs.selector = attrs.options = attrs.key = attrs.oninit =\n\t\t\tattrs.oncreate = attrs.onbeforeupdate = attrs.onupdate =\n\t\t\tattrs.onbeforeremove = attrs.onremove = null\n\n\t\t\t// Do this now so we can get the most current `href` and `disabled`.\n\t\t\t// Those attributes may also be specified in the selector, and we\n\t\t\t// should honor that.\n\t\t\tvar child = m(vnode.attrs.selector || \"a\", attrs, vnode.children)\n\n\t\t\t// Let's provide a *right* way to disable a route link, rather than\n\t\t\t// letting people screw up accessibility on accident.\n\t\t\t//\n\t\t\t// The attribute is coerced so users don't get surprised over\n\t\t\t// `disabled: 0` resulting in a button that's somehow routable\n\t\t\t// despite being visibly disabled.\n\t\t\tif (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n\t\t\t\tchild.attrs.href = null\n\t\t\t\tchild.attrs[\"aria-disabled\"] = \"true\"\n\t\t\t\t// If you *really* do want to do this on a disabled link, use\n\t\t\t\t// an `oncreate` hook to add it.\n\t\t\t\tchild.attrs.onclick = null\n\t\t\t} else {\n\t\t\t\tonclick = child.attrs.onclick\n\t\t\t\thref = child.attrs.href\n\t\t\t\tchild.attrs.href = route.prefix + href\n\t\t\t\tchild.attrs.onclick = function(e) {\n\t\t\t\t\tvar result\n\t\t\t\t\tif (typeof onclick === \"function\") {\n\t\t\t\t\t\tresult = onclick.call(e.currentTarget, e)\n\t\t\t\t\t} else if (onclick == null || typeof onclick !== \"object\") {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t} else if (typeof onclick.handleEvent === \"function\") {\n\t\t\t\t\t\tonclick.handleEvent(e)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Adapted from React Router's implementation:\n\t\t\t\t\t// https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n\t\t\t\t\t//\n\t\t\t\t\t// Try to be flexible and intuitive in how we handle links.\n\t\t\t\t\t// Fun fact: links aren't as obvious to get right as you\n\t\t\t\t\t// would expect. There's a lot more valid ways to click a\n\t\t\t\t\t// link than this, and one might want to not simply click a\n\t\t\t\t\t// link, but right click or command-click it to copy the\n\t\t\t\t\t// link target, etc. Nope, this isn't just for blind people.\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip if `onclick` prevented default\n\t\t\t\t\t\tresult !== false && !e.defaultPrevented &&\n\t\t\t\t\t\t// Ignore everything but left clicks\n\t\t\t\t\t\t(e.button === 0 || e.which === 0 || e.which === 1) &&\n\t\t\t\t\t\t// Let the browser handle `target=_blank`, etc.\n\t\t\t\t\t\t(!e.currentTarget.target || e.currentTarget.target === \"_self\") &&\n\t\t\t\t\t\t// No modifier keys\n\t\t\t\t\t\t!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey\n\t\t\t\t\t) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\te.redraw = false\n\t\t\t\t\t\troute.set(href, null, options)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child\n\t\t},\n\t}\n\troute.param = function(key) {\n\t\treturn attrs && key != null ? attrs[key] : attrs\n\t}\n\n\treturn route\n}\n","\"use strict\"\n\nvar hyperscript = require(\"./render/hyperscript\")\n\nhyperscript.trust = require(\"./render/trust\")\nhyperscript.fragment = require(\"./render/fragment\")\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar render = require(\"./render\")\n\nmodule.exports = require(\"./api/mount-redraw\")(render, requestAnimationFrame, console)\n","\"use strict\"\n\nmodule.exports = Object.assign || function(target, source) {\n\tif(source) Object.keys(source).forEach(function(key) { target[key] = source[key] })\n}\n","\"use strict\"\n\nvar buildQueryString = require(\"../querystring/build\")\nvar assign = require(\"./assign\")\n\n// Returns `path` from `template` + `params`\nmodule.exports = function(template, params) {\n\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(template)) {\n\t\tthrow new SyntaxError(\"Template parameter names *must* be separated\")\n\t}\n\tif (params == null) return template\n\tvar queryIndex = template.indexOf(\"?\")\n\tvar hashIndex = template.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? template.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = template.slice(0, pathEnd)\n\tvar query = {}\n\n\tassign(query, params)\n\n\tvar resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function(m, key, variadic) {\n\t\tdelete query[key]\n\t\t// If no such parameter exists, don't interpolate it.\n\t\tif (params[key] == null) return m\n\t\t// Escape normal parameters, but not variadic ones.\n\t\treturn variadic ? params[key] : encodeURIComponent(String(params[key]))\n\t})\n\n\t// In case the template substitution adds new query/hash parameters.\n\tvar newQueryIndex = resolved.indexOf(\"?\")\n\tvar newHashIndex = resolved.indexOf(\"#\")\n\tvar newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex\n\tvar newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex\n\tvar result = resolved.slice(0, newPathEnd)\n\n\tif (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)\n\tif (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd)\n\tvar querystring = buildQueryString(query)\n\tif (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring\n\tif (hashIndex >= 0) result += template.slice(hashIndex)\n\tif (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex)\n\treturn result\n}\n","\"use strict\"\n\nvar parsePathname = require(\"./parse\")\n\n// Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\nmodule.exports = function(template) {\n\tvar templateData = parsePathname(template)\n\tvar templateKeys = Object.keys(templateData.params)\n\tvar keys = []\n\tvar regexp = new RegExp(\"^\" + templateData.path.replace(\n\t\t// I escape literal text so people can use things like `:file.:ext` or\n\t\t// `:lang-:locale` in routes. This is all merged into one pass so I\n\t\t// don't also accidentally escape `-` and make it harder to detect it to\n\t\t// ban it from template parameters.\n\t\t/:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g,\n\t\tfunction(m, key, extra) {\n\t\t\tif (key == null) return \"\\\\\" + m\n\t\t\tkeys.push({k: key, r: extra === \"...\"})\n\t\t\tif (extra === \"...\") return \"(.*)\"\n\t\t\tif (extra === \".\") return \"([^/]+)\\\\.\"\n\t\t\treturn \"([^/]+)\" + (extra || \"\")\n\t\t}\n\t) + \"$\")\n\treturn function(data) {\n\t\t// First, check the params. Usually, there isn't any, and it's just\n\t\t// checking a static set.\n\t\tfor (var i = 0; i < templateKeys.length; i++) {\n\t\t\tif (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false\n\t\t}\n\t\t// If no interpolations exist, let's skip all the ceremony\n\t\tif (!keys.length) return regexp.test(data.path)\n\t\tvar values = regexp.exec(data.path)\n\t\tif (values == null) return false\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tdata.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])\n\t\t}\n\t\treturn true\n\t}\n}\n","\"use strict\"\n\nvar parseQueryString = require(\"../querystring/parse\")\n\n// Returns `{path, params}` from `url`\nmodule.exports = function(url) {\n\tvar queryIndex = url.indexOf(\"?\")\n\tvar hashIndex = url.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? url.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\")\n\n\tif (!path) path = \"/\"\n\telse {\n\t\tif (path[0] !== \"/\") path = \"/\" + path\n\t\tif (path.length > 1 && path[path.length - 1] === \"/\") path = path.slice(0, -1)\n\t}\n\treturn {\n\t\tpath: path,\n\t\tparams: queryIndex < 0\n\t\t\t? {}\n\t\t\t: parseQueryString(url.slice(queryIndex + 1, queryEnd)),\n\t}\n}\n","\"use strict\"\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.prototype.finally = function(callback) {\n\treturn this.then(\n\t\tfunction(value) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn value\n\t\t\t})\n\t\t},\n\t\tfunction(reason) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn PromisePolyfill.reject(reason);\n\t\t\t})\n\t\t}\n\t)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\n\nmodule.exports = PromisePolyfill\n","\"use strict\"\n\nvar PromisePolyfill = require(\"./polyfill\")\n\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") {\n\t\twindow.Promise = PromisePolyfill\n\t} else if (!window.Promise.prototype.finally) {\n\t\twindow.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") {\n\t\tglobal.Promise = PromisePolyfill\n\t} else if (!global.Promise.prototype.finally) {\n\t\tglobal.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = global.Promise\n} else {\n\tmodule.exports = PromisePolyfill\n}\n","\"use strict\"\n\nmodule.exports = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\n\tvar args = []\n\tfor (var key in object) {\n\t\tdestructure(key, object[key])\n\t}\n\n\treturn args.join(\"&\")\n\n\tfunction destructure(key, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\n","\"use strict\"\n\nmodule.exports = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\n\tvar entries = string.split(\"&\"), counters = {}, data = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\n\t\tvar levels = key.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data\n\t\tif (key.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key = levels.slice(0, j).join()\n\t\t\t\tif (counters[key] == null) {\n\t\t\t\t\tcounters[key] = Array.isArray(cursor) ? cursor.length : 0\n\t\t\t\t}\n\t\t\t\tlevel = counters[key]++\n\t\t\t}\n\t\t\t// Disallow direct prototype pollution\n\t\t\telse if (level === \"__proto__\") break\n\t\t\tif (j === levels.length - 1) cursor[level] = value\n\t\t\telse {\n\t\t\t\t// Read own properties exclusively to disallow indirect\n\t\t\t\t// prototype pollution\n\t\t\t\tvar desc = Object.getOwnPropertyDescriptor(cursor, level)\n\t\t\t\tif (desc != null) desc = desc.value\n\t\t\t\tif (desc == null) cursor[level] = desc = isNumber ? [] : {}\n\t\t\t\tcursor = desc\n\t\t\t}\n\t\t}\n\t}\n\treturn data\n}\n","\"use strict\"\n\nmodule.exports = require(\"./render/render\")(window)\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nmodule.exports = function() {\n\tvar vnode = hyperscriptVnode.apply(0, arguments)\n\n\tvnode.tag = \"[\"\n\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\treturn vnode\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\n\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\n\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\n\nfunction execSelector(state, vnode) {\n\tvar attrs = vnode.attrs\n\tvar children = Vnode.normalizeChildren(vnode.children)\n\tvar hasClass = hasOwn.call(attrs, \"class\")\n\tvar className = hasClass ? attrs.class : attrs.className\n\n\tvnode.tag = state.tag\n\tvnode.attrs = null\n\tvnode.children = undefined\n\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]\n\t\t}\n\n\t\tattrs = newAttrs\n\t}\n\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)){\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className != null || state.attrs.className != null) attrs.className =\n\t\tclassName != null\n\t\t\t? state.attrs.className != null\n\t\t\t\t? String(state.attrs.className) + \" \" + String(className)\n\t\t\t\t: className\n\t\t\t: state.attrs.className != null\n\t\t\t\t? state.attrs.className\n\t\t\t\t: null\n\n\tif (hasClass) attrs.class = null\n\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\tvnode.attrs = attrs\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\tvnode.text = children[0].children\n\t} else {\n\t\tvnode.children = children\n\t}\n\n\treturn vnode\n}\n\nfunction hyperscript(selector) {\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\n\tvar vnode = hyperscriptVnode.apply(1, arguments)\n\n\tif (typeof selector === \"string\") {\n\t\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\t\tif (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)\n\t}\n\n\tvnode.tag = selector\n\treturn vnode\n}\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\n// Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n// another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n// than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n// if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n// if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n// } else {\n// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n// attrs = undefined\n// }\n//\n// if (attrs == null) attrs = {}\n// return Vnode(\"\", attrs.key, attrs, children)\n// }\nmodule.exports = function() {\n\tvar attrs = arguments[this], start = this + 1, children\n\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = this\n\t}\n\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\n\treturn Vnode(\"\", attrs.key, attrs, children)\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function($window) {\n\tvar $doc = $window && $window.document\n\tvar currentRedraw\n\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\n\t//sanity check to discourage people from doing `vnode.state = ...`\n\tfunction checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}\n\n\t//Note: the hook is passed as the `this` argument to allow proxying the\n\t//arguments without requiring a full array allocation to do so. It also\n\t//takes advantage of the fact the current `vnode` is the first argument in\n\t//all lifecycle methods.\n\tfunction callHook(vnode) {\n\t\tvar original = vnode.state\n\t\ttry {\n\t\t\treturn this.apply(original, arguments)\n\t\t} finally {\n\t\t\tcheckState(vnode, original)\n\t\t}\n\t}\n\n\t// IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n\t// inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\tfunction activeElement() {\n\t\ttry {\n\t\t\treturn $doc.activeElement\n\t\t} catch (e) {\n\t\t\treturn null\n\t\t}\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": createText(parent, vnode, nextSibling); break\n\t\t\t\tcase \"<\": createHTML(parent, vnode, ns, nextSibling); break\n\t\t\t\tcase \"[\": createFragment(parent, vnode, hooks, ns, nextSibling); break\n\t\t\t\tdefault: createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t}\n\tvar possibleParents = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}\n\tfunction createHTML(parent, vnode, ns, nextSibling) {\n\t\tvar match = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\t// not using the proper parent makes the child element(s) vanish.\n\t\t// var div = document.createElement(\"div\")\n\t\t// div.innerHTML = \"<td>i</td><td>j</td>\"\n\t\t// console.log(div.innerHTML)\n\t\t// --> \"ij\", no <td> in sight.\n\t\tvar temp = $doc.createElement(possibleParents[match[1]] || \"div\")\n\t\tif (ns === \"http://www.w3.org/2000/svg\") {\n\t\t\ttemp.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\">\" + vnode.children + \"</svg>\"\n\t\t\ttemp = temp.firstChild\n\t\t} else {\n\t\t\ttemp.innerHTML = vnode.children\n\t\t}\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\t// Capture nodes to remove, so we don't confuse them.\n\t\tvnode.instance = []\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tvnode.instance.push(child)\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs = vnode.attrs\n\t\tvar is = attrs && attrs.is\n\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\n\t\tif (attrs != null) {\n\t\t\tsetAttrs(vnode, attrs, ns)\n\t\t}\n\n\t\tinsertNode(parent, element, nextSibling)\n\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tif (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs)\n\t\t\t}\n\t\t}\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tinitLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tcreateNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t}\n\t}\n\n\t//update\n\t/**\n\t * @param {Element|Fragment} parent - the parent element\n\t * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n\t * this part of the tree\n\t * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n\t * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n\t * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n\t * fragment that is not the last item in its\n\t * parent\n\t * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n\t * @returns void\n\t */\n\t// This function diffs and patches lists of vnodes, both keyed and unkeyed.\n\t//\n\t// We will:\n\t//\n\t// 1. describe its general structure\n\t// 2. focus on the diff algorithm optimizations\n\t// 3. discuss DOM node operations.\n\n\t// ## Overview:\n\t//\n\t// The updateNodes() function:\n\t// - deals with trivial cases\n\t// - determines whether the lists are keyed or unkeyed based on the first non-null node\n\t// of each list.\n\t// - diffs them and patches the DOM if needed (that's the brunt of the code)\n\t// - manages the leftovers: after diffing, are there:\n\t// - old nodes left to remove?\n\t// \t - new nodes to insert?\n\t// \t deal with them!\n\t//\n\t// The lists are only iterated over once, with an exception for the nodes in `old` that\n\t// are visited in the fourth part of the diff and in the `removeNodes` loop.\n\n\t// ## Diffing\n\t//\n\t// Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n\t// may be good for context on longest increasing subsequence-based logic for moving nodes.\n\t//\n\t// In order to diff keyed lists, one has to\n\t//\n\t// 1) match nodes in both lists, per key, and update them accordingly\n\t// 2) create the nodes present in the new list, but absent in the old one\n\t// 3) remove the nodes present in the old list, but absent in the new one\n\t// 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n\t//\n\t// To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n\t// over the new list and for each new vnode, find the corresponding vnode in the old list using\n\t// the map.\n\t// 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n\t// and must be created.\n\t// For the removals, we actually remove the nodes that have been updated from the old list.\n\t// The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n\t// The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n\t// algorithm.\n\t//\n\t// the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n\t// from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n\t// corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n\t// match the above lists, for example).\n\t//\n\t// In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n\t// can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n\t//\n\t// @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n\t// the longest increasing subsequence *of old nodes still present in the new list*).\n\t//\n\t// It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n\t// and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n\t// the `LIS` and a temporary one to create the LIS).\n\t//\n\t// So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n\t// the LIS and can be updated without moving them.\n\t//\n\t// If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n\t// the exception of the last node if the list is fully reversed).\n\t//\n\t// ## Finding the next sibling.\n\t//\n\t// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n\t// When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n\t// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n\t// list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n\t//\n\t// In the other scenarios (swaps, upwards traversal, map-based diff),\n\t// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n\t// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node\n\t// as the next sibling (cached in the `nextSibling` variable).\n\n\n\t// ## DOM node moves\n\t//\n\t// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n\t// this is not the case if the node moved (second and fourth part of the diff algo). We move\n\t// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n\t// variable rather than fetching it using `getNextSibling()`.\n\t//\n\t// The fourth part of the diff currently inserts nodes unconditionally, leading to issues\n\t// like #1791 and #1999. We need to be smarter about those situations where adjascent old\n\t// nodes remain together in the new list in a way that isn't covered by parts one and\n\t// three of the diff algo.\n\n\tfunction updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)\n\t\telse {\n\t\t\tvar isOldKeyed = old[0] != null && old[0].key != null\n\t\t\tvar isKeyed = vnodes[0] != null && vnodes[0].key != null\n\t\t\tvar start = 0, oldStart = 0\n\t\t\tif (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) oldStart++\n\t\t\tif (!isKeyed) while (start < vnodes.length && vnodes[start] == null) start++\n\t\t\tif (isKeyed === null && isOldKeyed == null) return // both lists are full of nulls\n\t\t\tif (isOldKeyed !== isKeyed) {\n\t\t\t\tremoveNodes(parent, old, oldStart, old.length)\n\t\t\t\tcreateNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else if (!isKeyed) {\n\t\t\t\t// Don't index past the end of either list (causes deopts).\n\t\t\t\tvar commonLength = old.length < vnodes.length ? old.length : vnodes.length\n\t\t\t\t// Rewind if necessary to the first non-null index on either side.\n\t\t\t\t// We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n\t\t\t\t// but that would be optimizing for sparse lists which are more rare than dense ones.\n\t\t\t\tstart = start < oldStart ? start : oldStart\n\t\t\t\tfor (; start < commonLength; start++) {\n\t\t\t\t\to = old[start]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o === v || o == null && v == null) continue\n\t\t\t\t\telse if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))\n\t\t\t\t\telse if (v == null) removeNode(parent, o)\n\t\t\t\t\telse updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\tif (old.length > commonLength) removeNodes(parent, old, start, old.length)\n\t\t\t\tif (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else {\n\t\t\t\t// keyed diff\n\t\t\t\tvar oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling\n\n\t\t\t\t// bottom-up\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\t// top-down\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o.key !== v.key) break\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tif (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\t// swaps and list reversals\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (start === end) break\n\t\t\t\t\tif (o.key !== ve.key || oe.key !== v.key) break\n\t\t\t\t\ttopSibling = getNextSibling(old, oldStart, nextSibling)\n\t\t\t\t\tmoveNodes(parent, oe, topSibling)\n\t\t\t\t\tif (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)\n\t\t\t\t\tif (++start <= --end) moveNodes(parent, o, nextSibling)\n\t\t\t\t\tif (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldStart++; oldEnd--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t}\n\t\t\t\t// bottom up once again\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t}\n\t\t\t\tif (start > end) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\telse if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\telse {\n\t\t\t\t\t// inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n\t\t\t\t\tvar originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li=0, i=0, pos = 2147483647, matched = 0, map, lisIndices\n\t\t\t\t\tfor (i = 0; i < vnodesLength; i++) oldIndices[i] = -1\n\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\tif (map == null) map = getKeyMap(old, oldStart, oldEnd + 1)\n\t\t\t\t\t\tve = vnodes[i]\n\t\t\t\t\t\tvar oldIndex = map[ve.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tpos = (oldIndex < pos) ? oldIndex : -1 // becomes -1 if nodes were re-ordered\n\t\t\t\t\t\t\toldIndices[i-start] = oldIndex\n\t\t\t\t\t\t\toe = old[oldIndex]\n\t\t\t\t\t\t\told[oldIndex] = null\n\t\t\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\t\t\tmatched++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnextSibling = originalNextSibling\n\t\t\t\t\tif (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\t\tif (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (pos === -1) {\n\t\t\t\t\t\t\t// the indices of the indices of the items that are part of the\n\t\t\t\t\t\t\t// longest increasing subsequence in the oldIndices list\n\t\t\t\t\t\t\tlisIndices = makeLisIndices(oldIndices)\n\t\t\t\t\t\t\tli = lisIndices.length - 1\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (lisIndices[li] === i - start) li--\n\t\t\t\t\t\t\t\t\telse moveNodes(parent, v, nextSibling)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode.events = old.events\n\t\t\tif (shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tupdateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, ns, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(parent, old)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, ns, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\tremoveHTML(parent, old)\n\t\t\tcreateHTML(parent, vnode, ns, nextSibling)\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t}\n\t}\n\tfunction updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tif (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t\tupdateNodes(element, old.children, vnode.children, hooks, null, ns)\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tupdateLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(parent, old.instance)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction getKeyMap(vnodes, start, end) {\n\t\tvar map = Object.create(null)\n\t\tfor (; start < end; start++) {\n\t\t\tvar vnode = vnodes[start]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key = vnode.key\n\t\t\t\tif (key != null) map[key] = start\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\t// Lifted from ivi https://github.com/ivijs/ivi/\n\t// takes a list of unique numbers (-1 is special and can\n\t// occur multiple times) and returns an array with the indices\n\t// of the items that are part of the longest increasing\n\t// subsequece\n\tvar lisTemp = []\n\tfunction makeLisIndices(a) {\n\t\tvar result = [0]\n\t\tvar u = 0, v = 0, i = 0\n\t\tvar il = lisTemp.length = a.length\n\t\tfor (var i = 0; i < il; i++) lisTemp[i] = a[i]\n\t\tfor (var i = 0; i < il; ++i) {\n\t\t\tif (a[i] === -1) continue\n\t\t\tvar j = result[result.length - 1]\n\t\t\tif (a[j] < a[i]) {\n\t\t\t\tlisTemp[i] = j\n\t\t\t\tresult.push(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu = 0\n\t\t\tv = result.length - 1\n\t\t\twhile (u < v) {\n\t\t\t\t// Fast integer average without overflow.\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tvar c = (u >>> 1) + (v >>> 1) + (u & v & 1)\n\t\t\t\tif (a[result[c]] < a[i]) {\n\t\t\t\t\tu = c + 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tv = c\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a[i] < a[result[u]]) {\n\t\t\t\tif (u > 0) lisTemp[i] = result[u - 1]\n\t\t\t\tresult[u] = i\n\t\t\t}\n\t\t}\n\t\tu = result.length\n\t\tv = result[u - 1]\n\t\twhile (u-- > 0) {\n\t\t\tresult[u] = v\n\t\t\tv = lisTemp[v]\n\t\t}\n\t\tlisTemp.length = 0\n\t\treturn result\n\t}\n\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\n\t// This covers a really specific edge case:\n\t// - Parent node is keyed and contains child\n\t// - Child is removed, returns unresolved promise in `onbeforeremove`\n\t// - Parent node is moved in keyed diff\n\t// - Remaining children still need moved appropriately\n\t//\n\t// Ideally, I'd track removed nodes as well, but that introduces a lot more\n\t// complexity and I'm not exactly interested in doing that.\n\tfunction moveNodes(parent, vnode, nextSibling) {\n\t\tvar frag = $doc.createDocumentFragment()\n\t\tmoveChildToFrag(parent, frag, vnode)\n\t\tinsertNode(parent, frag, nextSibling)\n\t}\n\tfunction moveChildToFrag(parent, frag, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\t\t\tfrag.appendChild(vnode.instance[i])\n\t\t\t\t}\n\t\t\t} else if (vnode.tag !== \"[\") {\n\t\t\t\t// Don't recurse for text nodes *or* elements, just fragments\n\t\t\t\tfrag.appendChild(vnode.dom)\n\t\t\t} else if (vnode.children.length === 1) {\n\t\t\t\tvnode = vnode.children[0]\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\tif (child != null) moveChildToFrag(parent, frag, child)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling != null) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\n\tfunction maybeSetContentEditable(vnode) {\n\t\tif (vnode.attrs == null || (\n\t\t\tvnode.attrs.contenteditable == null && // attribute\n\t\t\tvnode.attrs.contentEditable == null // property\n\t\t)) return false\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t\treturn true\n\t}\n\n\t//remove\n\tfunction removeNodes(parent, vnodes, start, end) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) removeNode(parent, vnode)\n\t\t}\n\t}\n\tfunction removeNode(parent, vnode) {\n\t\tvar mask = 0\n\t\tvar original = vnode.state\n\t\tvar stateResult, attrsResult\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.state.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\tmask = 1\n\t\t\t\tstateResult = result\n\t\t\t}\n\t\t}\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.attrs.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tmask |= 2\n\t\t\t\tattrsResult = result\n\t\t\t}\n\t\t}\n\t\tcheckState(vnode, original)\n\n\t\t// If we can, try to fast-path it and avoid all the overhead of awaiting\n\t\tif (!mask) {\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t} else {\n\t\t\tif (stateResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 1) { mask &= 2; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tstateResult.then(next, next)\n\t\t\t}\n\t\t\tif (attrsResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 2) { mask &= 1; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tattrsResult.then(next, next)\n\t\t\t}\n\t\t}\n\n\t\tfunction reallyRemove() {\n\t\t\tcheckState(vnode, original)\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t}\n\t}\n\tfunction removeHTML(parent, vnode) {\n\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\tparent.removeChild(vnode.instance[i])\n\t\t}\n\t}\n\tfunction removeChild(parent, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tremoveHTML(parent, vnode)\n\t\t\t} else {\n\t\t\t\tif (vnode.tag !== \"[\") {\n\t\t\t\t\tparent.removeChild(vnode.dom)\n\t\t\t\t\tif (!Array.isArray(vnode.children)) break\n\t\t\t\t}\n\t\t\t\tif (vnode.children.length === 1) {\n\t\t\t\t\tvnode = vnode.children[0]\n\t\t\t\t\tif (vnode != null) continue\n\t\t\t\t} else {\n\t\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\t\tif (child != null) removeChild(parent, child)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tfunction onremove(vnode) {\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode)\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//attrs\n\tfunction setAttrs(vnode, attrs, ns) {\n\t\tfor (var key in attrs) {\n\t\t\tsetAttr(vnode, key, null, attrs[key], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key, old, value, ns) {\n\t\tif (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || (old === value && !isFormAttribute(vnode, key)) && typeof value !== \"object\") return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value)\n\t\tif (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, value)\n\t\telse if (hasPropertyKey(vnode, key, ns)) {\n\t\t\tif (key === \"value\") {\n\t\t\t\t// Only do the coercion if we're actually going to check the value.\n\t\t\t\t/* eslint-disable no-implicit-coercion */\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === \"\" + value && vnode.dom === activeElement()) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t/* eslint-enable no-implicit-coercion */\n\t\t\t}\n\t\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t\tif (vnode.tag === \"input\" && key === \"type\") vnode.dom.setAttribute(key, value)\n\t\t\telse vnode.dom[key] = value\n\t\t} else {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) vnode.dom.setAttribute(key, \"\")\n\t\t\t\telse vnode.dom.removeAttribute(key)\n\t\t\t}\n\t\t\telse vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value)\n\t\t}\n\t}\n\tfunction removeAttr(vnode, key, old, ns) {\n\t\tif (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return\n\t\tif (key[0] === \"o\" && key[1] === \"n\" && !isLifecycleMethod(key)) updateEvent(vnode, key, undefined)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, null)\n\t\telse if (\n\t\t\thasPropertyKey(vnode, key, ns)\n\t\t\t&& key !== \"className\"\n\t\t\t&& !(key === \"value\" && (\n\t\t\t\tvnode.tag === \"option\"\n\t\t\t\t|| vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement()\n\t\t\t))\n\t\t\t&& !(vnode.tag === \"input\" && key === \"type\")\n\t\t) {\n\t\t\tvnode.dom[key] = null\n\t\t} else {\n\t\t\tvar nsLastIndex = key.indexOf(\":\")\n\t\t\tif (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1)\n\t\t\tif (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key)\n\t\t}\n\t}\n\tfunction setLateSelectAttrs(vnode, attrs) {\n\t\tif (\"value\" in attrs) {\n\t\t\tif(attrs.value === null) {\n\t\t\t\tif (vnode.dom.selectedIndex !== -1) vnode.dom.value = null\n\t\t\t} else {\n\t\t\t\tvar normalized = \"\" + attrs.value // eslint-disable-line no-implicit-coercion\n\t\t\t\tif (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n\t\t\t\t\tvnode.dom.value = normalized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined)\n\t}\n\tfunction updateAttrs(vnode, old, attrs, ns) {\n\t\tif (attrs != null) {\n\t\t\tfor (var key in attrs) {\n\t\t\t\tsetAttr(vnode, key, old && old[key], attrs[key], ns)\n\t\t\t}\n\t\t}\n\t\tvar val\n\t\tif (old != null) {\n\t\t\tfor (var key in old) {\n\t\t\t\tif (((val = old[key]) != null) && (attrs == null || attrs[key] == null)) {\n\t\t\t\t\tremoveAttr(vnode, key, val, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === activeElement() || vnode.tag === \"option\" && vnode.dom.parentNode === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction hasPropertyKey(vnode, key, ns) {\n\t\t// Filter out namespaced keys\n\t\treturn ns === undefined && (\n\t\t\t// If it's a custom element, just keep it.\n\t\t\tvnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is ||\n\t\t\t// If it's a normal element, let's try to avoid a few browser bugs.\n\t\t\tkey !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\"// && key !== \"type\"\n\t\t\t// Defer the property check until *after* we check everything.\n\t\t) && key in vnode.dom\n\t}\n\n\t//style\n\tvar uppercaseRegex = /[A-Z]/g\n\tfunction toLowerCase(capital) { return \"-\" + capital.toLowerCase() }\n\tfunction normalizeKey(key) {\n\t\treturn key[0] === \"-\" && key[1] === \"-\" ? key :\n\t\t\tkey === \"cssFloat\" ? \"float\" :\n\t\t\t\tkey.replace(uppercaseRegex, toLowerCase)\n\t}\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) {\n\t\t\t// Styles are equivalent, do nothing.\n\t\t} else if (style == null) {\n\t\t\t// New style is missing, just clear it.\n\t\t\telement.style.cssText = \"\"\n\t\t} else if (typeof style !== \"object\") {\n\t\t\t// New style is a string, let engine deal with patching.\n\t\t\telement.style.cssText = style\n\t\t} else if (old == null || typeof old !== \"object\") {\n\t\t\t// `old` is missing or a string, `style` is an object.\n\t\t\telement.style.cssText = \"\"\n\t\t\t// Add new style properties\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null) element.style.setProperty(normalizeKey(key), String(value))\n\t\t\t}\n\t\t} else {\n\t\t\t// Both old & new are (different) objects.\n\t\t\t// Update style properties that have changed\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null && (value = String(value)) !== String(old[key])) {\n\t\t\t\t\telement.style.setProperty(normalizeKey(key), value)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove style properties that no longer exist\n\t\t\tfor (var key in old) {\n\t\t\t\tif (old[key] != null && style[key] == null) {\n\t\t\t\t\telement.style.removeProperty(normalizeKey(key))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Here's an explanation of how this works:\n\t// 1. The event names are always (by design) prefixed by `on`.\n\t// 2. The EventListener interface accepts either a function or an object\n\t// with a `handleEvent` method.\n\t// 3. The object does not inherit from `Object.prototype`, to avoid\n\t// any potential interference with that (e.g. setters).\n\t// 4. The event name is remapped to the handler before calling it.\n\t// 5. In function-based event handlers, `ev.target === this`. We replicate\n\t// that below.\n\t// 6. In function-based event handlers, `return false` prevents the default\n\t// action and stops event propagation. We replicate that below.\n\tfunction EventDict() {\n\t\t// Save this, so the current redraw is correctly tracked.\n\t\tthis._ = currentRedraw\n\t}\n\tEventDict.prototype = Object.create(null)\n\tEventDict.prototype.handleEvent = function (ev) {\n\t\tvar handler = this[\"on\" + ev.type]\n\t\tvar result\n\t\tif (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev)\n\t\telse if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev)\n\t\tif (this._ && ev.redraw !== false) (0, this._)()\n\t\tif (result === false) {\n\t\t\tev.preventDefault()\n\t\t\tev.stopPropagation()\n\t\t}\n\t}\n\n\t//event\n\tfunction updateEvent(vnode, key, value) {\n\t\tif (vnode.events != null) {\n\t\t\tif (vnode.events[key] === value) return\n\t\t\tif (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\t\tif (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = value\n\t\t\t} else {\n\t\t\t\tif (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = undefined\n\t\t\t}\n\t\t} else if (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\tvnode.events = new EventDict()\n\t\t\tvnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\tvnode.events[key] = value\n\t\t}\n\t}\n\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tdo {\n\t\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.state.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\treturn false\n\t\t} while (false); // eslint-disable-line no-constant-condition\n\t\tvnode.dom = old.dom\n\t\tvnode.domSize = old.domSize\n\t\tvnode.instance = old.instance\n\t\t// One would think having the actual latest attributes would be ideal,\n\t\t// but it doesn't let us properly diff based on our current internal\n\t\t// representation. We have to save not only the old DOM info, but also\n\t\t// the attributes used to create it, as we diff *that*, not against the\n\t\t// DOM directly (with a few exceptions in `setAttr`). And, of course, we\n\t\t// need to save the children and text as they are conceptually not\n\t\t// unlike special \"attributes\" internally.\n\t\tvnode.attrs = old.attrs\n\t\tvnode.children = old.children\n\t\tvnode.text = old.text\n\t\treturn true\n\t}\n\n\treturn function(dom, vnodes, redraw) {\n\t\tif (!dom) throw new TypeError(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = activeElement()\n\t\tvar namespace = dom.namespaceURI\n\n\t\t// First time rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\n\t\tvnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes])\n\t\tvar prevRedraw = currentRedraw\n\t\ttry {\n\t\t\tcurrentRedraw = typeof redraw === \"function\" ? redraw : undefined\n\t\t\tupdateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\t} finally {\n\t\t\tcurrentRedraw = prevRedraw\n\t\t}\n\t\tdom.vnodes = vnodes\n\t\t// `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\t\tif (active != null && activeElement() !== active && typeof active.focus === \"function\") active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\n","\"use strict\"\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node == null || typeof node === \"boolean\") return null\n\tif (typeof node === \"object\") return node\n\treturn Vnode(\"#\", undefined, undefined, String(node), undefined, undefined)\n}\nVnode.normalizeChildren = function(input) {\n\tvar children = []\n\tif (input.length) {\n\t\tvar isKeyed = input[0] != null && input[0].key != null\n\t\t// Note: this is a *very* perf-sensitive check.\n\t\t// Fun fact: merging the loop like this is somehow faster than splitting\n\t\t// it, noticeably so.\n\t\tfor (var i = 1; i < input.length; i++) {\n\t\t\tif ((input[i] != null && input[i].key != null) !== isKeyed) {\n\t\t\t\tthrow new TypeError(\"Vnodes must either always have keys or never have keys!\")\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\tchildren[i] = Vnode.normalize(input[i])\n\t\t}\n\t}\n\treturn children\n}\n\nmodule.exports = Vnode\n","\"use strict\"\n\nvar PromisePolyfill = require(\"./promise/promise\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./request/request\")(window, PromisePolyfill, mountRedraw.redraw)\n","\"use strict\"\n\nvar buildPathname = require(\"../pathname/build\")\n\nmodule.exports = function($window, Promise, oncompletion) {\n\tvar callbackCount = 0\n\n\tfunction PromiseProxy(executor) {\n\t\treturn new Promise(executor)\n\t}\n\n\t// In case the global Promise is some userland library's where they rely on\n\t// `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n\t// similar. Let's *not* break them.\n\tPromiseProxy.prototype = Promise.prototype\n\tPromiseProxy.__proto__ = Promise // eslint-disable-line no-proto\n\n\tfunction makeRequest(factory) {\n\t\treturn function(url, args) {\n\t\t\tif (typeof url !== \"string\") { args = url; url = url.url }\n\t\t\telse if (args == null) args = {}\n\t\t\tvar promise = new Promise(function(resolve, reject) {\n\t\t\t\tfactory(buildPathname(url, args.params), args, function (data) {\n\t\t\t\t\tif (typeof args.type === \"function\") {\n\t\t\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tdata[i] = new args.type(data[i])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse data = new args.type(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(data)\n\t\t\t\t}, reject)\n\t\t\t})\n\t\t\tif (args.background === true) return promise\n\t\t\tvar count = 0\n\t\t\tfunction complete() {\n\t\t\t\tif (--count === 0 && typeof oncompletion === \"function\") oncompletion()\n\t\t\t}\n\n\t\t\treturn wrap(promise)\n\n\t\t\tfunction wrap(promise) {\n\t\t\t\tvar then = promise.then\n\t\t\t\t// Set the constructor, so engines know to not await or resolve\n\t\t\t\t// this as a native promise. At the time of writing, this is\n\t\t\t\t// only necessary for V8, but their behavior is the correct\n\t\t\t\t// behavior per spec. See this spec issue for more details:\n\t\t\t\t// https://github.com/tc39/ecma262/issues/1577. Also, see the\n\t\t\t\t// corresponding comment in `request/tests/test-request.js` for\n\t\t\t\t// a bit more background on the issue at hand.\n\t\t\t\tpromise.constructor = PromiseProxy\n\t\t\t\tpromise.then = function() {\n\t\t\t\t\tcount++\n\t\t\t\t\tvar next = then.apply(promise, arguments)\n\t\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\t\tcomplete()\n\t\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t\t})\n\t\t\t\t\treturn wrap(next)\n\t\t\t\t}\n\t\t\t\treturn promise\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasHeader(args, name) {\n\t\tfor (var key in args.headers) {\n\t\t\tif ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true\n\t\t}\n\t\treturn false\n\t}\n\n\treturn {\n\t\trequest: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar method = args.method != null ? args.method.toUpperCase() : \"GET\"\n\t\t\tvar body = args.body\n\t\t\tvar assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData)\n\t\t\tvar responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\")\n\n\t\t\tvar xhr = new $window.XMLHttpRequest(), aborted = false\n\t\t\tvar original = xhr, replacedAbort\n\t\t\tvar abort = xhr.abort\n\n\t\t\txhr.abort = function() {\n\t\t\t\taborted = true\n\t\t\t\tabort.call(this)\n\t\t\t}\n\n\t\t\txhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\n\t\t\tif (assumeJSON && body != null && !hasHeader(args, /^content-type$/i)) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (typeof args.deserialize !== \"function\" && !hasHeader(args, /^accept$/i)) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tif (args.timeout) xhr.timeout = args.timeout\n\t\t\txhr.responseType = responseType\n\n\t\t\tfor (var key in args.headers) {\n\t\t\t\tif ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.onreadystatechange = function(ev) {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif (aborted) return\n\n\t\t\t\tif (ev.target.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar success = (ev.target.status >= 200 && ev.target.status < 300) || ev.target.status === 304 || (/^file:\\/\\//i).test(url)\n\t\t\t\t\t\t// When the response type isn't \"\" or \"text\",\n\t\t\t\t\t\t// `xhr.responseText` is the wrong thing to use.\n\t\t\t\t\t\t// Browsers do the right thing and throw here, and we\n\t\t\t\t\t\t// should honor that and do the right thing by\n\t\t\t\t\t\t// preferring `xhr.response` where possible/practical.\n\t\t\t\t\t\tvar response = ev.target.response, message\n\n\t\t\t\t\t\tif (responseType === \"json\") {\n\t\t\t\t\t\t\t// For IE and Edge, which don't implement\n\t\t\t\t\t\t\t// `responseType: \"json\"`.\n\t\t\t\t\t\t\tif (!ev.target.responseType && typeof args.extract !== \"function\") response = JSON.parse(ev.target.responseText)\n\t\t\t\t\t\t} else if (!responseType || responseType === \"text\") {\n\t\t\t\t\t\t\t// Only use this default if it's text. If a parsed\n\t\t\t\t\t\t\t// document is needed on old IE and friends (all\n\t\t\t\t\t\t\t// unsupported), the user should use a custom\n\t\t\t\t\t\t\t// `config` instead. They're already using this at\n\t\t\t\t\t\t\t// their own risk.\n\t\t\t\t\t\t\tif (response == null) response = ev.target.responseText\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof args.extract === \"function\") {\n\t\t\t\t\t\t\tresponse = args.extract(ev.target, args)\n\t\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\t} else if (typeof args.deserialize === \"function\") {\n\t\t\t\t\t\t\tresponse = args.deserialize(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (success) resolve(response)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttry { message = ev.target.responseText }\n\t\t\t\t\t\t\tcatch (e) { message = response }\n\t\t\t\t\t\t\tvar error = new Error(message)\n\t\t\t\t\t\t\terror.code = ev.target.status\n\t\t\t\t\t\t\terror.response = response\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof args.config === \"function\") {\n\t\t\t\txhr = args.config(xhr, args, url) || xhr\n\n\t\t\t\t// Propagate the `abort` to any replacement XHR as well.\n\t\t\t\tif (xhr !== original) {\n\t\t\t\t\treplacedAbort = xhr.abort\n\t\t\t\t\txhr.abort = function() {\n\t\t\t\t\t\taborted = true\n\t\t\t\t\t\treplacedAbort.call(this)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body == null) xhr.send()\n\t\t\telse if (typeof args.serialize === \"function\") xhr.send(args.serialize(body))\n\t\t\telse if (body instanceof $window.FormData) xhr.send(body)\n\t\t\telse xhr.send(JSON.stringify(body))\n\t\t}),\n\t\tjsonp: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(data)\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t}\n\t\t\tscript.src = url + (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") +\n\t\t\t\tencodeURIComponent(args.callbackKey || \"callback\") + \"=\" +\n\t\t\t\tencodeURIComponent(callbackName)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t}),\n\t}\n}\n","\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./api/router\")(window, mountRedraw)\n","\"use strict\"\n\nmodule.exports = require(\"./stream/stream\")\n","/* eslint-disable */\n;(function() {\n\"use strict\"\n/* eslint-enable */\nStream.SKIP = {}\nStream.lift = lift\nStream.scan = scan\nStream.merge = merge\nStream.combine = combine\nStream.scanMerge = scanMerge\nStream[\"fantasy-land/of\"] = Stream\n\nvar warnedHalt = false\nObject.defineProperty(Stream, \"HALT\", {\n\tget: function() {\n\t\twarnedHalt || console.log(\"HALT is deprecated and has been renamed to SKIP\");\n\t\twarnedHalt = true\n\t\treturn Stream.SKIP\n\t}\n})\n\nfunction Stream(value) {\n\tvar dependentStreams = []\n\tvar dependentFns = []\n\n\tfunction stream(v) {\n\t\tif (arguments.length && v !== Stream.SKIP) {\n\t\t\tvalue = v\n\t\t\tif (open(stream)) {\n\t\t\t\tstream._changing()\n\t\t\t\tstream._state = \"active\"\n\t\t\t\tdependentStreams.forEach(function(s, i) { s(dependentFns[i](value)) })\n\t\t\t}\n\t\t}\n\n\t\treturn value\n\t}\n\n\tstream.constructor = Stream\n\tstream._state = arguments.length && value !== Stream.SKIP ? \"active\" : \"pending\"\n\tstream._parents = []\n\n\tstream._changing = function() {\n\t\tif (open(stream)) stream._state = \"changing\"\n\t\tdependentStreams.forEach(function(s) {\n\t\t\ts._changing()\n\t\t})\n\t}\n\n\tstream._map = function(fn, ignoreInitial) {\n\t\tvar target = ignoreInitial ? Stream() : Stream(fn(value))\n\t\ttarget._parents.push(stream)\n\t\tdependentStreams.push(target)\n\t\tdependentFns.push(fn)\n\t\treturn target\n\t}\n\n\tstream.map = function(fn) {\n\t\treturn stream._map(fn, stream._state !== \"active\")\n\t}\n\n\tvar end\n\tfunction createEnd() {\n\t\tend = Stream()\n\t\tend.map(function(value) {\n\t\t\tif (value === true) {\n\t\t\t\tstream._parents.forEach(function (p) {p._unregisterChild(stream)})\n\t\t\t\tstream._state = \"ended\"\n\t\t\t\tstream._parents.length = dependentStreams.length = dependentFns.length = 0\n\t\t\t}\n\t\t\treturn value\n\t\t})\n\t\treturn end\n\t}\n\n\tstream.toJSON = function() { return value != null && typeof value.toJSON === \"function\" ? value.toJSON() : value }\n\n\tstream[\"fantasy-land/map\"] = stream.map\n\tstream[\"fantasy-land/ap\"] = function(x) { return combine(function(s1, s2) { return s1()(s2()) }, [x, stream]) }\n\n\tstream._unregisterChild = function(child) {\n\t\tvar childIndex = dependentStreams.indexOf(child)\n\t\tif (childIndex !== -1) {\n\t\t\tdependentStreams.splice(childIndex, 1)\n\t\t\tdependentFns.splice(childIndex, 1)\n\t\t}\n\t}\n\n\tObject.defineProperty(stream, \"end\", {\n\t\tget: function() { return end || createEnd() }\n\t})\n\n\treturn stream\n}\n\nfunction combine(fn, streams) {\n\tvar ready = streams.every(function(s) {\n\t\tif (s.constructor !== Stream)\n\t\t\tthrow new Error(\"Ensure that each item passed to stream.combine/stream.merge/lift is a stream\")\n\t\treturn s._state === \"active\"\n\t})\n\tvar stream = ready\n\t\t? Stream(fn.apply(null, streams.concat([streams])))\n\t\t: Stream()\n\n\tvar changed = []\n\n\tvar mappers = streams.map(function(s) {\n\t\treturn s._map(function(value) {\n\t\t\tchanged.push(s)\n\t\t\tif (ready || streams.every(function(s) { return s._state !== \"pending\" })) {\n\t\t\t\tready = true\n\t\t\t\tstream(fn.apply(null, streams.concat([changed])))\n\t\t\t\tchanged = []\n\t\t\t}\n\t\t\treturn value\n\t\t}, true)\n\t})\n\n\tvar endStream = stream.end.map(function(value) {\n\t\tif (value === true) {\n\t\t\tmappers.forEach(function(mapper) { mapper.end(true) })\n\t\t\tendStream.end(true)\n\t\t}\n\t\treturn undefined\n\t})\n\n\treturn stream\n}\n\nfunction merge(streams) {\n\treturn combine(function() { return streams.map(function(s) { return s() }) }, streams)\n}\n\nfunction scan(fn, acc, origin) {\n\tvar stream = origin.map(function(v) {\n\t\tvar next = fn(acc, v)\n\t\tif (next !== Stream.SKIP) acc = next\n\t\treturn next\n\t})\n\tstream(acc)\n\treturn stream\n}\n\nfunction scanMerge(tuples, seed) {\n\tvar streams = tuples.map(function(tuple) { return tuple[0] })\n\n\tvar stream = combine(function() {\n\t\tvar changed = arguments[arguments.length - 1]\n\t\tstreams.forEach(function(stream, i) {\n\t\t\tif (changed.indexOf(stream) > -1)\n\t\t\t\tseed = tuples[i][1](seed, stream())\n\t\t})\n\n\t\treturn seed\n\t}, streams)\n\n\tstream(seed)\n\n\treturn stream\n}\n\nfunction lift() {\n\tvar fn = arguments[0]\n\tvar streams = Array.prototype.slice.call(arguments, 1)\n\treturn merge(streams).map(function(streams) {\n\t\treturn fn.apply(undefined, streams)\n\t})\n}\n\nfunction open(s) {\n\treturn s._state === \"pending\" || s._state === \"active\" || s._state === \"changing\"\n}\n\nif (typeof module !== \"undefined\") module[\"exports\"] = Stream\nelse if (typeof window.m === \"function\" && !(\"stream\" in window.m)) window.m.stream = Stream\nelse window.m = {stream : Stream}\n\n}());\n","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n let called = false\n return () => {\n if (called) {\n return\n }\n called = true\n window.Promise.resolve().then(() => {\n called = false\n fn()\n })\n }\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n ? microtaskDebounce\n : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body\n case '#document':\n return element.body\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order =\n element1.compareDocumentPosition(element2) &\n Node.DOCUMENT_POSITION_FOLLOWING;\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n const { commonAncestorContainer } = range;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n const modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat(styles[`border${sideA}Width`]) +\n parseFloat(styles[`border${sideB}Width`])\n );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(\n body[`offset${axis}`],\n body[`scroll${axis}`],\n html[`client${axis}`],\n html[`offset${axis}`],\n html[`scroll${axis}`],\n isIE(10)\n ? (parseInt(html[`offset${axis}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n : 0 \n );\n}\n\nexport default function getWindowSizes(document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle),\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n return {\n ...offsets,\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height,\n };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n let rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n }\n else {\n rect = element.getBoundingClientRect();\n }\n }\n catch(e){}\n\n const result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n const width =\n sizes.width || element.clientWidth || result.width;\n const height =\n sizes.height || element.clientHeight || result.height;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n const isIE10 = runIsIE(10);\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if(fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n let offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height,\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (\n isIE10 && !fixedPosition\n ? parent.contains(scrollParent)\n : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n ) {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width,\n height,\n };\n\n return getClientRect(offset);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n const parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n let el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement,\n fixedPosition = false\n) {\n // NOTE: 1 DOM access here\n\n let boundaries = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport' ) {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n }\n\n else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(popper.ownerDocument);\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n const isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n return boundaries;\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n placement,\n refRect,\n popper,\n reference,\n boundariesElement,\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement\n );\n\n const rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top,\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height,\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom,\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height,\n },\n };\n\n const sortedAreas = Object.keys(rects)\n .map(key => ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const window = element.ownerDocument.defaultView;\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier['function']) { // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference,\n this.options.positionFixed\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n\n data.offsets.popper.position = this.options.positionFixed\n ? 'fixed'\n : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n const ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n const { popper, reference } = data.offsets;\n const { round, floor } = Math;\n const noRound = v => v;\n \n const referenceWidth = round(reference.width);\n const popperWidth = round(popper.width);\n \n const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n const isVariation = data.placement.indexOf('-') !== -1;\n const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n const horizontalToInteger = !shouldRound\n ? noRound\n : isVertical || isVariation || sameWidthParity\n ? round\n : floor;\n const verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(\n bothOddWidth && !isVariation && shouldRound\n ? popper.left - 1\n : popper.left\n ),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right),\n };\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n const offsets = getRoundedOffsets(\n data,\n window.devicePixelRatio < 2 || !isFirefox\n );\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.popper);\n const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n let sideValue =\n center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n };\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement,\n data.positionFixed\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n const flippedVariationByRef =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n // flips variation if popper content overflows boundaries\n const flippedVariationByContent =\n !!options.flipVariationsByContent &&\n ((isVertical && variation === 'start' && overflowsRight) ||\n (isVertical && variation === 'end' && overflowsLeft) ||\n (!isVertical && variation === 'start' && overflowsBottom) ||\n (!isVertical && variation === 'end' && overflowsTop));\n\n const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n const transformProp = getSupportedPropertyName('transform');\n const popperStyles = data.instance.popper.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = popperStyles;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement,\n data.positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side =\n ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false,\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","import Popper from 'popper.js';\nimport isFunction from '../../popper/src/utils/isFunction';\n\nconst DEFAULT_OPTIONS = {\n container: false,\n delay: 0,\n html: false,\n placement: 'top',\n title: '',\n template:\n '<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n offset: 0,\n arrowSelector: '.tooltip-arrow, .tooltip__arrow',\n innerSelector: '.tooltip-inner, .tooltip__inner',\n};\n\nexport default class Tooltip {\n /**\n * Create a new Tooltip.js instance\n * @class Tooltip\n * @param {HTMLElement} reference - The DOM node used as reference of the tooltip (it can be a jQuery element).\n * @param {Object} options\n * @param {String} options.placement='top'\n * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -end),\n * left(-start, -end)`\n * @param {String} [options.arrowSelector='.tooltip-arrow, .tooltip__arrow'] - className used to locate the DOM arrow element in the tooltip.\n * @param {String} [options.innerSelector='.tooltip-inner, .tooltip__inner'] - className used to locate the DOM inner element in the tooltip.\n * @param {HTMLElement|String|false} options.container=false - Append the tooltip to a specific element.\n * @param {Number|Object} options.delay=0\n * Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type.\n * If a number is supplied, delay is applied to both hide/show.\n * Object structure is: `{ show: 500, hide: 100 }`\n * @param {Boolean} options.html=false - Insert HTML into the tooltip. If false, the content will inserted with `textContent`.\n * @param {String} [options.template='<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>']\n * Base HTML to used when creating the tooltip.\n * The tooltip's `title` will be injected into the `.tooltip-inner` or `.tooltip__inner`.\n * `.tooltip-arrow` or `.tooltip__arrow` will become the tooltip's arrow.\n * The outermost wrapper element should have the `.tooltip` class.\n * @param {String|HTMLElement|TitleFunction} options.title='' - Default title value if `title` attribute isn't present.\n * @param {String} [options.trigger='hover focus']\n * How tooltip is triggered - click, hover, focus, manual.\n * You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger.\n * @param {Boolean} options.closeOnClickOutside=false - Close a popper on click outside of the popper and reference element. This has effect only when options.trigger is 'click'.\n * @param {String|HTMLElement} options.boundariesElement\n * The element used as boundaries for the tooltip. For more information refer to Popper.js'\n * [boundariesElement docs](https://popper.js.org/popper-documentation.html)\n * @param {Number|String} options.offset=0 - Offset of the tooltip relative to its reference. For more information refer to Popper.js'\n * [offset docs](https://popper.js.org/popper-documentation.html)\n * @param {Object} options.popperOptions={} - Popper options, will be passed directly to popper instance. For more information refer to Popper.js'\n * [options docs](https://popper.js.org/popper-documentation.html)\n * @return {Object} instance - The generated tooltip instance\n */\n constructor(reference, options) {\n // apply user options over default ones\n options = { ...DEFAULT_OPTIONS, ...options };\n\n reference.jquery && (reference = reference[0]);\n\n // cache reference and options\n this.reference = reference;\n this.options = options;\n\n // get events list\n const events =\n typeof options.trigger === 'string'\n ? options.trigger\n .split(' ')\n .filter(\n trigger => ['click', 'hover', 'focus'].indexOf(trigger) !== -1\n )\n : [];\n\n // set initial state\n this._isOpen = false;\n this._popperOptions = {};\n\n // set event listeners\n this._setEventListeners(reference, events, options);\n }\n\n //\n // Public methods\n //\n\n /**\n * Reveals an element's tooltip. This is considered a \"manual\" triggering of the tooltip.\n * Tooltips with zero-length titles are never displayed.\n * @method Tooltip#show\n * @memberof Tooltip\n */\n show = () => this._show(this.reference, this.options);\n\n /**\n * Hides an element’s tooltip. This is considered a “manual” triggering of the tooltip.\n * @method Tooltip#hide\n * @memberof Tooltip\n */\n hide = () => this._hide();\n\n /**\n * Hides and destroys an element’s tooltip.\n * @method Tooltip#dispose\n * @memberof Tooltip\n */\n dispose = () => this._dispose();\n\n /**\n * Toggles an element’s tooltip. This is considered a “manual” triggering of the tooltip.\n * @method Tooltip#toggle\n * @memberof Tooltip\n */\n toggle = () => {\n if (this._isOpen) {\n return this.hide();\n } else {\n return this.show();\n }\n };\n\n /**\n * Updates the tooltip's title content\n * @method Tooltip#updateTitleContent\n * @memberof Tooltip\n * @param {String|HTMLElement} title - The new content to use for the title\n */\n updateTitleContent = (title) => this._updateTitleContent(title);\n\n //\n // Private methods\n //\n\n _events = [];\n\n /**\n * Creates a new tooltip node\n * @memberof Tooltip\n * @private\n * @param {HTMLElement} reference\n * @param {String} template\n * @param {String|HTMLElement|TitleFunction} title\n * @param {Boolean} allowHtml\n * @return {HTMLElement} tooltipNode\n */\n _create(reference, template, title, allowHtml) {\n // create tooltip element\n const tooltipGenerator = window.document.createElement('div');\n tooltipGenerator.innerHTML = template.trim();\n const tooltipNode = tooltipGenerator.childNodes[0];\n\n // add unique ID to our tooltip (needed for accessibility reasons)\n tooltipNode.id = `tooltip_${Math.random()\n .toString(36)\n .substr(2, 10)}`;\n\n // set initial `aria-hidden` state to `false` (it's visible!)\n tooltipNode.setAttribute('aria-hidden', 'false');\n\n // add title to tooltip\n const titleNode = tooltipGenerator.querySelector(this.options.innerSelector);\n this._addTitleContent(reference, title, allowHtml, titleNode);\n\n // return the generated tooltip node\n return tooltipNode;\n }\n\n _addTitleContent(reference, title, allowHtml, titleNode) {\n if (title.nodeType === 1 || title.nodeType === 11) {\n // if title is a element node or document fragment, append it only if allowHtml is true\n allowHtml && titleNode.appendChild(title);\n } else if (isFunction(title)) {\n // Recursively call ourself so that the return value of the function gets handled appropriately - either\n // as a dom node, a string, or even as another function.\n this._addTitleContent(reference, title.call(reference), allowHtml, titleNode);\n } else {\n // if it's just a simple text, set textContent or innerHtml depending by `allowHtml` value\n allowHtml ? (titleNode.innerHTML = title) : (titleNode.textContent = title);\n }\n }\n\n _show(reference, options) {\n // don't show if it's already visible\n // or if it's not being showed\n if (this._isOpen && !this._isOpening) {\n return this;\n }\n this._isOpen = true;\n\n // if the tooltipNode already exists, just show it\n if (this._tooltipNode) {\n this._tooltipNode.style.visibility = 'visible';\n this._tooltipNode.setAttribute('aria-hidden', 'false');\n this.popperInstance.update();\n return this;\n }\n\n // get title\n const title = reference.getAttribute('title') || options.title;\n\n // don't show tooltip if no title is defined\n if (!title) {\n return this;\n }\n\n // create tooltip node\n const tooltipNode = this._create(\n reference,\n options.template,\n title,\n options.html\n );\n\n // Add `aria-describedby` to our reference element for accessibility reasons\n reference.setAttribute('aria-describedby', tooltipNode.id);\n\n // append tooltip to container\n const container = this._findContainer(options.container, reference);\n\n this._append(tooltipNode, container);\n\n this._popperOptions = {\n ...options.popperOptions,\n placement: options.placement,\n };\n\n this._popperOptions.modifiers = {\n ...this._popperOptions.modifiers,\n arrow: {\n ...(this._popperOptions.modifiers && this._popperOptions.modifiers.arrow),\n element: options.arrowSelector,\n },\n offset: {\n ...(this._popperOptions.modifiers && this._popperOptions.modifiers.offset),\n offset: options.offset ||\n this._popperOptions.modifiers && this._popperOptions.modifiers.offset && this._popperOptions.modifiers.offset.offset ||\n options.offset,\n },\n };\n\n if (options.boundariesElement) {\n this._popperOptions.modifiers.preventOverflow = {\n boundariesElement: options.boundariesElement,\n };\n }\n\n this.popperInstance = new Popper(\n reference,\n tooltipNode,\n this._popperOptions\n );\n\n this._tooltipNode = tooltipNode;\n\n return this;\n }\n\n _hide(/*reference, options*/) {\n // don't hide if it's already hidden\n if (!this._isOpen) {\n return this;\n }\n\n this._isOpen = false;\n\n // hide tooltipNode\n this._tooltipNode.style.visibility = 'hidden';\n this._tooltipNode.setAttribute('aria-hidden', 'true');\n\n return this;\n }\n\n _dispose() {\n // remove event listeners first to prevent any unexpected behaviour\n this._events.forEach(({ func, event }) => {\n this.reference.removeEventListener(event, func);\n });\n this._events = [];\n\n if (this._tooltipNode) {\n this._hide();\n\n // destroy instance\n this.popperInstance.destroy();\n\n // destroy tooltipNode if removeOnDestroy is not set, as popperInstance.destroy() already removes the element\n if (!this.popperInstance.options.removeOnDestroy) {\n this._tooltipNode.parentNode.removeChild(this._tooltipNode);\n this._tooltipNode = null;\n }\n }\n return this;\n }\n\n _findContainer(container, reference) {\n // if container is a query, get the relative element\n if (typeof container === 'string') {\n container = window.document.querySelector(container);\n } else if (container === false) {\n // if container is `false`, set it to reference parent\n container = reference.parentNode;\n }\n return container;\n }\n\n /**\n * Append tooltip to container\n * @memberof Tooltip\n * @private\n * @param {HTMLElement} tooltipNode\n * @param {HTMLElement|String|false} container\n */\n _append(tooltipNode, container) {\n container.appendChild(tooltipNode);\n }\n\n _setEventListeners(reference, events, options) {\n const directEvents = [];\n const oppositeEvents = [];\n\n events.forEach(event => {\n switch (event) {\n case 'hover':\n directEvents.push('mouseenter');\n oppositeEvents.push('mouseleave');\n break;\n case 'focus':\n directEvents.push('focus');\n oppositeEvents.push('blur');\n break;\n case 'click':\n directEvents.push('click');\n oppositeEvents.push('click');\n break;\n }\n });\n\n // schedule show tooltip\n directEvents.forEach(event => {\n const func = evt => {\n if (this._isOpening === true) {\n return;\n }\n evt.usedByTooltip = true;\n this._scheduleShow(reference, options.delay, options, evt);\n };\n this._events.push({ event, func });\n reference.addEventListener(event, func);\n });\n\n // schedule hide tooltip\n oppositeEvents.forEach(event => {\n const func = evt => {\n if (evt.usedByTooltip === true) {\n return;\n }\n this._scheduleHide(reference, options.delay, options, evt);\n };\n this._events.push({ event, func });\n reference.addEventListener(event, func);\n if (event === 'click' && options.closeOnClickOutside) {\n document.addEventListener('mousedown', e => {\n if (!this._isOpening) {\n return;\n }\n const popper = this.popperInstance.popper;\n if (reference.contains(e.target) ||\n popper.contains(e.target)) {\n return;\n }\n func(e);\n }, true);\n }\n });\n }\n\n _scheduleShow(reference, delay, options /*, evt */) {\n this._isOpening = true;\n // defaults to 0\n const computedDelay = (delay && delay.show) || delay || 0;\n this._showTimeout = window.setTimeout(\n () => this._show(reference, options),\n computedDelay\n );\n }\n\n _scheduleHide(reference, delay, options, evt) {\n this._isOpening = false;\n // defaults to 0\n const computedDelay = (delay && delay.hide) || delay || 0;\n window.clearTimeout(this._showTimeout);\n window.setTimeout(() => {\n if (this._isOpen === false) {\n return;\n }\n if (!document.body.contains(this._tooltipNode)) {\n return;\n }\n\n // if we are hiding because of a mouseleave, we must check that the new\n // reference isn't the tooltip, because in this case we don't want to hide it\n if (evt.type === 'mouseleave') {\n const isSet = this._setTooltipNodeEvent(evt, reference, delay, options);\n\n // if we set the new event, don't hide the tooltip yet\n // the new event will take care to hide it if necessary\n if (isSet) {\n return;\n }\n }\n\n this._hide(reference, options);\n }, computedDelay);\n }\n\n _setTooltipNodeEvent = (evt, reference, delay, options) => {\n const relatedreference =\n evt.relatedreference || evt.toElement || evt.relatedTarget;\n\n const callback = evt2 => {\n const relatedreference2 =\n evt2.relatedreference || evt2.toElement || evt2.relatedTarget;\n\n // Remove event listener after call\n this._tooltipNode.removeEventListener(evt.type, callback);\n\n // If the new reference is not the reference element\n if (!reference.contains(relatedreference2)) {\n // Schedule to hide tooltip\n this._scheduleHide(reference, options.delay, options, evt2);\n }\n };\n\n if (this._tooltipNode.contains(relatedreference)) {\n // listen to mouseleave on the tooltip element to be able to hide the tooltip\n this._tooltipNode.addEventListener(evt.type, callback);\n return true;\n }\n\n return false;\n };\n\n _updateTitleContent(title) {\n if(typeof this._tooltipNode === 'undefined') {\n if(typeof this.options.title !== 'undefined') {\n this.options.title = title;\n }\n return;\n }\n const titleNode = this._tooltipNode.querySelector(this.options.innerSelector);\n this._clearTitleContent(titleNode, this.options.html, this.reference.getAttribute('title') || this.options.title)\n this._addTitleContent(this.reference, title, this.options.html, titleNode);\n this.options.title = title;\n this.popperInstance.update();\n }\n\n _clearTitleContent(titleNode, allowHtml, lastTitle) {\n if(lastTitle.nodeType === 1 || lastTitle.nodeType === 11) {\n allowHtml && titleNode.removeChild(lastTitle);\n } else {\n allowHtml ? titleNode.innerHTML = '' : titleNode.textContent = '';\n }\n }\n\n}\n\n/**\n * Title function, its context is the Tooltip instance.\n * @memberof Tooltip\n * @callback TitleFunction\n * @return {String} placement - The desired title.\n */\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","var __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nvar defaults = {\r\n lines: 12,\r\n length: 7,\r\n width: 5,\r\n radius: 10,\r\n scale: 1.0,\r\n corners: 1,\r\n color: '#000',\r\n fadeColor: 'transparent',\r\n animation: 'spinner-line-fade-default',\r\n rotate: 0,\r\n direction: 1,\r\n speed: 1,\r\n zIndex: 2e9,\r\n className: 'spinner',\r\n top: '50%',\r\n left: '50%',\r\n shadow: '0 0 1px transparent',\r\n position: 'absolute',\r\n};\r\nvar Spinner = /** @class */ (function () {\r\n function Spinner(opts) {\r\n if (opts === void 0) { opts = {}; }\r\n this.opts = __assign(__assign({}, defaults), opts);\r\n }\r\n /**\r\n * Adds the spinner to the given target element. If this instance is already\r\n * spinning, it is automatically removed from its previous target by calling\r\n * stop() internally.\r\n */\r\n Spinner.prototype.spin = function (target) {\r\n this.stop();\r\n this.el = document.createElement('div');\r\n this.el.className = this.opts.className;\r\n this.el.setAttribute('role', 'progressbar');\r\n css(this.el, {\r\n position: this.opts.position,\r\n width: 0,\r\n zIndex: this.opts.zIndex,\r\n left: this.opts.left,\r\n top: this.opts.top,\r\n transform: \"scale(\" + this.opts.scale + \")\",\r\n });\r\n if (target) {\r\n target.insertBefore(this.el, target.firstChild || null);\r\n }\r\n drawLines(this.el, this.opts);\r\n return this;\r\n };\r\n /**\r\n * Stops and removes the Spinner.\r\n * Stopped spinners may be reused by calling spin() again.\r\n */\r\n Spinner.prototype.stop = function () {\r\n if (this.el) {\r\n if (typeof requestAnimationFrame !== 'undefined') {\r\n cancelAnimationFrame(this.animateId);\r\n }\r\n else {\r\n clearTimeout(this.animateId);\r\n }\r\n if (this.el.parentNode) {\r\n this.el.parentNode.removeChild(this.el);\r\n }\r\n this.el = undefined;\r\n }\r\n return this;\r\n };\r\n return Spinner;\r\n}());\r\nexport { Spinner };\r\n/**\r\n * Sets multiple style properties at once.\r\n */\r\nfunction css(el, props) {\r\n for (var prop in props) {\r\n el.style[prop] = props[prop];\r\n }\r\n return el;\r\n}\r\n/**\r\n * Returns the line color from the given string or array.\r\n */\r\nfunction getColor(color, idx) {\r\n return typeof color == 'string' ? color : color[idx % color.length];\r\n}\r\n/**\r\n * Internal method that draws the individual lines.\r\n */\r\nfunction drawLines(el, opts) {\r\n var borderRadius = (Math.round(opts.corners * opts.width * 500) / 1000) + 'px';\r\n var shadow = 'none';\r\n if (opts.shadow === true) {\r\n shadow = '0 2px 4px #000'; // default shadow\r\n }\r\n else if (typeof opts.shadow === 'string') {\r\n shadow = opts.shadow;\r\n }\r\n var shadows = parseBoxShadow(shadow);\r\n for (var i = 0; i < opts.lines; i++) {\r\n var degrees = ~~(360 / opts.lines * i + opts.rotate);\r\n var backgroundLine = css(document.createElement('div'), {\r\n position: 'absolute',\r\n top: -opts.width / 2 + \"px\",\r\n width: (opts.length + opts.width) + 'px',\r\n height: opts.width + 'px',\r\n background: getColor(opts.fadeColor, i),\r\n borderRadius: borderRadius,\r\n transformOrigin: 'left',\r\n transform: \"rotate(\" + degrees + \"deg) translateX(\" + opts.radius + \"px)\",\r\n });\r\n var delay = i * opts.direction / opts.lines / opts.speed;\r\n delay -= 1 / opts.speed; // so initial animation state will include trail\r\n var line = css(document.createElement('div'), {\r\n width: '100%',\r\n height: '100%',\r\n background: getColor(opts.color, i),\r\n borderRadius: borderRadius,\r\n boxShadow: normalizeShadow(shadows, degrees),\r\n animation: 1 / opts.speed + \"s linear \" + delay + \"s infinite \" + opts.animation,\r\n });\r\n backgroundLine.appendChild(line);\r\n el.appendChild(backgroundLine);\r\n }\r\n}\r\nfunction parseBoxShadow(boxShadow) {\r\n var regex = /^\\s*([a-zA-Z]+\\s+)?(-?\\d+(\\.\\d+)?)([a-zA-Z]*)\\s+(-?\\d+(\\.\\d+)?)([a-zA-Z]*)(.*)$/;\r\n var shadows = [];\r\n for (var _i = 0, _a = boxShadow.split(','); _i < _a.length; _i++) {\r\n var shadow = _a[_i];\r\n var matches = shadow.match(regex);\r\n if (matches === null) {\r\n continue; // invalid syntax\r\n }\r\n var x = +matches[2];\r\n var y = +matches[5];\r\n var xUnits = matches[4];\r\n var yUnits = matches[7];\r\n if (x === 0 && !xUnits) {\r\n xUnits = yUnits;\r\n }\r\n if (y === 0 && !yUnits) {\r\n yUnits = xUnits;\r\n }\r\n if (xUnits !== yUnits) {\r\n continue; // units must match to use as coordinates\r\n }\r\n shadows.push({\r\n prefix: matches[1] || '',\r\n x: x,\r\n y: y,\r\n xUnits: xUnits,\r\n yUnits: yUnits,\r\n end: matches[8],\r\n });\r\n }\r\n return shadows;\r\n}\r\n/**\r\n * Modify box-shadow x/y offsets to counteract rotation\r\n */\r\nfunction normalizeShadow(shadows, degrees) {\r\n var normalized = [];\r\n for (var _i = 0, shadows_1 = shadows; _i < shadows_1.length; _i++) {\r\n var shadow = shadows_1[_i];\r\n var xy = convertOffset(shadow.x, shadow.y, degrees);\r\n normalized.push(shadow.prefix + xy[0] + shadow.xUnits + ' ' + xy[1] + shadow.yUnits + shadow.end);\r\n }\r\n return normalized.join(', ');\r\n}\r\nfunction convertOffset(x, y, degrees) {\r\n var radians = degrees * Math.PI / 180;\r\n var sin = Math.sin(radians);\r\n var cos = Math.cos(radians);\r\n return [\r\n Math.round((x * cos + y * sin) * 1000) / 1000,\r\n Math.round((-x * sin + y * cos) * 1000) / 1000,\r\n ];\r\n}\r\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","// Zepto.js\n// (c) 2010-2016 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\n// The following code is heavily inspired by jQuery's $.fn.data()\n\n;(function($){\n var data = {}, dataAttr = $.fn.data, camelize = $.camelCase,\n exp = $.expando = 'Zepto' + (+new Date()), emptyArray = []\n\n // Get value from node:\n // 1. first try key as given,\n // 2. then try camelized key,\n // 3. fall back to reading \"data-*\" attribute.\n function getData(node, name) {\n var id = node[exp], store = id && data[id]\n if (name === undefined) return store || setData(node)\n else {\n if (store) {\n if (name in store) return store[name]\n var camelName = camelize(name)\n if (camelName in store) return store[camelName]\n }\n return dataAttr.call($(node), name)\n }\n }\n\n // Store value under camelized key on node\n function setData(node, name, value) {\n var id = node[exp] || (node[exp] = ++$.uuid),\n store = data[id] || (data[id] = attributeData(node))\n if (name !== undefined) store[camelize(name)] = value\n return store\n }\n\n // Read all \"data-*\" attributes from a node\n function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }\n\n $.fn.data = function(name, value) {\n return value === undefined ?\n // set multiple values via object\n $.isPlainObject(name) ?\n this.each(function(i, node){\n $.each(name, function(key, value){ setData(node, key, value) })\n }) :\n // get value from first element\n (0 in this ? getData(this[0], name) : undefined) :\n // set value on all elements\n this.each(function(){ setData(this, name, value) })\n }\n\n $.data = function(elem, name, value) {\n return $(elem).data(name, value)\n }\n\n $.hasData = function(elem) {\n var id = elem[exp], store = id && data[id]\n return store ? !$.isEmptyObject(store) : false\n }\n\n $.fn.removeData = function(names) {\n if (typeof names == 'string') names = names.split(/\\s+/)\n return this.each(function(){\n var id = this[exp], store = id && data[id]\n if (store) $.each(names || store, function(key){\n delete store[names ? camelize(this) : key]\n })\n })\n }\n\n // Generate extended `remove` and `empty` functions\n ;['remove', 'empty'].forEach(function(methodName){\n var origFn = $.fn[methodName]\n $.fn[methodName] = function() {\n var elements = this.find('*')\n if (methodName === 'remove') elements = elements.add(this)\n elements.removeData()\n return origFn.call(this)\n }\n })\n})(Zepto)\n","// Zepto.js\n// (c) 2010-2016 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\n;(function($, undefined){\n var prefix = '', eventPrefix,\n vendors = { Webkit: 'webkit', Moz: '', O: 'o' },\n testEl = document.createElement('div'),\n supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,\n transform,\n transitionProperty, transitionDuration, transitionTiming, transitionDelay,\n animationName, animationDuration, animationTiming, animationDelay,\n cssReset = {}\n\n function dasherize(str) { return str.replace(/([A-Z])/g, '-$1').toLowerCase() }\n function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() }\n\n if (testEl.style.transform === undefined) $.each(vendors, function(vendor, event){\n if (testEl.style[vendor + 'TransitionProperty'] !== undefined) {\n prefix = '-' + vendor.toLowerCase() + '-'\n eventPrefix = event\n return false\n }\n })\n\n transform = prefix + 'transform'\n cssReset[transitionProperty = prefix + 'transition-property'] =\n cssReset[transitionDuration = prefix + 'transition-duration'] =\n cssReset[transitionDelay = prefix + 'transition-delay'] =\n cssReset[transitionTiming = prefix + 'transition-timing-function'] =\n cssReset[animationName = prefix + 'animation-name'] =\n cssReset[animationDuration = prefix + 'animation-duration'] =\n cssReset[animationDelay = prefix + 'animation-delay'] =\n cssReset[animationTiming = prefix + 'animation-timing-function'] = ''\n\n $.fx = {\n off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined),\n speeds: { _default: 400, fast: 200, slow: 600 },\n cssPrefix: prefix,\n transitionEnd: normalizeEvent('TransitionEnd'),\n animationEnd: normalizeEvent('AnimationEnd')\n }\n\n $.fn.animate = function(properties, duration, ease, callback, delay){\n if ($.isFunction(duration))\n callback = duration, ease = undefined, duration = undefined\n if ($.isFunction(ease))\n callback = ease, ease = undefined\n if ($.isPlainObject(duration))\n ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration\n if (duration) duration = (typeof duration == 'number' ? duration :\n ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000\n if (delay) delay = parseFloat(delay) / 1000\n return this.anim(properties, duration, ease, callback, delay)\n }\n\n $.fn.anim = function(properties, duration, ease, callback, delay){\n var key, cssValues = {}, cssProperties, transforms = '',\n that = this, wrappedCallback, endEvent = $.fx.transitionEnd,\n fired = false\n\n if (duration === undefined) duration = $.fx.speeds._default / 1000\n if (delay === undefined) delay = 0\n if ($.fx.off) duration = 0\n\n if (typeof properties == 'string') {\n // keyframe animation\n cssValues[animationName] = properties\n cssValues[animationDuration] = duration + 's'\n cssValues[animationDelay] = delay + 's'\n cssValues[animationTiming] = (ease || 'linear')\n endEvent = $.fx.animationEnd\n } else {\n cssProperties = []\n // CSS transitions\n for (key in properties)\n if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') '\n else cssValues[key] = properties[key], cssProperties.push(dasherize(key))\n\n if (transforms) cssValues[transform] = transforms, cssProperties.push(transform)\n if (duration > 0 && typeof properties === 'object') {\n cssValues[transitionProperty] = cssProperties.join(', ')\n cssValues[transitionDuration] = duration + 's'\n cssValues[transitionDelay] = delay + 's'\n cssValues[transitionTiming] = (ease || 'linear')\n }\n }\n\n wrappedCallback = function(event){\n if (typeof event !== 'undefined') {\n if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from \"below\"\n $(event.target).unbind(endEvent, wrappedCallback)\n } else\n $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout\n\n fired = true\n $(this).css(cssReset)\n callback && callback.call(this)\n }\n if (duration > 0){\n this.bind(endEvent, wrappedCallback)\n // transitionEnd is not always firing on older Android phones\n // so make sure it gets fired\n setTimeout(function(){\n if (fired) return\n wrappedCallback.call(that)\n }, ((duration + delay) * 1000) + 25)\n }\n\n // trigger page reflow so new elements can animate\n this.size() && this.get(0).clientLeft\n\n this.css(cssValues)\n\n if (duration <= 0) setTimeout(function() {\n that.each(function(){ wrappedCallback.call(this) })\n }, 0)\n\n return this\n }\n\n testEl = null\n})(Zepto)\n","// Zepto.js\n// (c) 2010-2016 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\n;(function($, undefined){\n var document = window.document, docElem = document.documentElement,\n origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle\n\n function anim(el, speed, opacity, scale, callback) {\n if (typeof speed == 'function' && !callback) callback = speed, speed = undefined\n var props = { opacity: opacity }\n if (scale) {\n props.scale = scale\n el.css($.fx.cssPrefix + 'transform-origin', '0 0')\n }\n return el.animate(props, speed, null, callback)\n }\n\n function hide(el, speed, scale, callback) {\n return anim(el, speed, 0, scale, function(){\n origHide.call($(this))\n callback && callback.call(this)\n })\n }\n\n $.fn.show = function(speed, callback) {\n origShow.call(this)\n if (speed === undefined) speed = 0\n else this.css('opacity', 0)\n return anim(this, speed, 1, '1,1', callback)\n }\n\n $.fn.hide = function(speed, callback) {\n if (speed === undefined) return origHide.call(this)\n else return hide(this, speed, '0,0', callback)\n }\n\n $.fn.toggle = function(speed, callback) {\n if (speed === undefined || typeof speed == 'boolean')\n return origToggle.call(this, speed)\n else return this.each(function(){\n var el = $(this)\n el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback)\n })\n }\n\n $.fn.fadeTo = function(speed, opacity, callback) {\n return anim(this, speed, opacity, null, callback)\n }\n\n $.fn.fadeIn = function(speed, callback) {\n var target = this.css('opacity')\n if (target > 0) this.css('opacity', 0)\n else target = 1\n return origShow.call(this).fadeTo(speed, target, callback)\n }\n\n $.fn.fadeOut = function(speed, callback) {\n return hide(this, speed, null, callback)\n }\n\n $.fn.fadeToggle = function(speed, callback) {\n return this.each(function(){\n var el = $(this)\n el[\n (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut'\n ](speed, callback)\n })\n }\n\n})(Zepto)\n","// Zepto.js\n// (c) 2010-2016 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\n;(function($){\n var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches\n\n function visible(elem){\n elem = $(elem)\n return !!(elem.width() || elem.height()) && elem.css(\"display\") !== \"none\"\n }\n\n // Implements a subset from:\n // http://api.jquery.com/category/selectors/jquery-selector-extensions/\n //\n // Each filter function receives the current index, all nodes in the\n // considered set, and a value if there were parentheses. The value\n // of `this` is the node currently being considered. The function returns the\n // resulting node(s), null, or undefined.\n //\n // Complex selectors are not supported:\n // li:has(label:contains(\"foo\")) + li:has(label:contains(\"bar\"))\n // ul.inner:first > li\n var filters = $.expr[':'] = {\n visible: function(){ if (visible(this)) return this },\n hidden: function(){ if (!visible(this)) return this },\n selected: function(){ if (this.selected) return this },\n checked: function(){ if (this.checked) return this },\n parent: function(){ return this.parentNode },\n first: function(idx){ if (idx === 0) return this },\n last: function(idx, nodes){ if (idx === nodes.length - 1) return this },\n eq: function(idx, _, value){ if (idx === value) return this },\n contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this },\n has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this }\n }\n\n var filterRe = new RegExp('(.*):(\\\\w+)(?:\\\\(([^)]+)\\\\))?$\\\\s*'),\n childRe = /^\\s*>/,\n classTag = 'Zepto' + (+new Date())\n\n function process(sel, fn) {\n // quote the hash in `a[href^=#]` expression\n sel = sel.replace(/=#\\]/g, '=\"#\"]')\n var filter, arg, match = filterRe.exec(sel)\n if (match && match[2] in filters) {\n filter = filters[match[2]], arg = match[3]\n sel = match[1]\n if (arg) {\n var num = Number(arg)\n if (isNaN(num)) arg = arg.replace(/^[\"']|[\"']$/g, '')\n else arg = num\n }\n }\n return fn(sel, filter, arg)\n }\n\n zepto.qsa = function(node, selector) {\n return process(selector, function(sel, filter, arg){\n try {\n var taggedParent\n if (!sel && filter) sel = '*'\n else if (childRe.test(sel))\n // support \"> *\" child queries by tagging the parent node with a\n // unique class and prepending that classname onto the selector\n taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel\n\n var nodes = oldQsa(node, sel)\n } catch(e) {\n console.error('error performing selector: %o', selector)\n throw e\n } finally {\n if (taggedParent) taggedParent.removeClass(classTag)\n }\n return !filter ? nodes :\n zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) }))\n })\n }\n\n zepto.matches = function(node, selector){\n return process(selector, function(sel, filter, arg){\n return (!sel || oldMatches(node, sel)) &&\n (!filter || filter.call(node, null, arg) === node)\n })\n }\n})(Zepto)\n","import Mithril from 'mithril';\n\nimport Translator from './Translator';\nimport Session from './Session';\nimport Store from './Store';\nimport { extend } from './extend';\n\nimport extract from './utils/extract';\nimport mapRoutes from './utils/mapRoutes';\nimport Drawer from './utils/Drawer';\nimport RequestError from './utils/RequestError';\nimport ItemList from './utils/ItemList';\nimport ScrollListener from './utils/ScrollListener';\n\nimport Forum from './models/Forum';\nimport Discussion from './models/Discussion';\nimport User from './models/User';\nimport Post from './models/Post';\nimport Group from './models/Group';\nimport Notification from './models/Notification';\n\nimport Alert from './components/Alert';\nimport Button from './components/Button';\nimport ModalManager from './components/ModalManager';\nimport RequestErrorModal from './components/RequestErrorModal';\n\nimport flattenDeep from 'lodash/flattenDeep';\nimport AlertManager from './components/AlertManager';\n\nexport type ApplicationData = {\n apiDocument: any;\n locale: string;\n locales: any;\n resources: any[];\n session: any;\n};\n\nexport default abstract class Application {\n /**\n * The forum model for this application.\n */\n public forum!: Forum;\n\n /**\n * A map of routes, keyed by a unique route name. Each route is an object\n * containing the following properties:\n *\n * - `path` The path that the route is accessed at.\n * - `component` The Mithril component to render when this route is active.\n *\n * @example\n * app.routes.discussion = {path: '/d/:id', component: DiscussionPage.component()};\n */\n public routes: { [key: string]: { path: string; component: any; [key: string]: any } } = {};\n\n /**\n * An ordered list of initializers to bootstrap the application.\n */\n public initializers = new ItemList();\n\n /**\n * The app's session.\n */\n public session!: Session;\n\n /**\n * The app's translator.\n */\n public translator = new Translator();\n\n /**\n * The app's data store.\n */\n public store = new Store({\n forums: Forum,\n users: User,\n discussions: Discussion,\n posts: Post,\n groups: Group,\n notifications: Notification,\n });\n\n /**\n * A local cache that can be used to store data at the application level, so\n * that is persists between different routes.\n */\n public cache: { [key: string]: any } = {};\n\n /**\n * Whether or not the app has been booted.\n */\n public booted: boolean = false;\n\n /**\n * An Alert that was shown as a result of an AJAX request error. If present,\n * it will be dismissed on the next successful request.\n */\n private requestError: RequestError | null = null;\n\n data!: ApplicationData;\n\n title = '';\n titleCount = 0;\n\n drawer = new Drawer();\n\n modal!: ModalManager;\n alerts!: AlertManager;\n\n load(payload) {\n this.data = payload;\n this.translator.locale = payload.locale;\n }\n\n boot() {\n this.initializers.toArray().forEach(initializer => initializer(this));\n\n this.store.pushPayload({ data: this.data.resources });\n\n this.forum = this.store.getById('forums', 1);\n\n this.session = new Session(this.store.getById('users', this.data.session.userId), this.data.session.csrfToken);\n\n this.mount();\n\n this.booted = true;\n }\n\n bootExtensions(extensions) {\n Object.keys(extensions).forEach(name => {\n const extension = extensions[name];\n\n const extenders = flattenDeep(extension.extend);\n\n for (const extender of extenders) {\n extender.extend(this, { name, exports: extension });\n }\n });\n }\n\n mount(basePath = '') {\n m.mount(document.getElementById('modal'), (this.modal = new ModalManager()));\n\n m.mount(document.getElementById('alerts'), (this.alerts = new AlertManager({ oninit: vnode => (this.alerts = vnode.state) })));\n\n m.route(document.getElementById('content'), basePath + '/', mapRoutes(this.routes, basePath));\n\n // Add a class to the body which indicates that the page has been scrolled\n // down.\n new ScrollListener(top => {\n const $app = $('#app');\n const offset = $app.offset().top;\n\n $app.toggleClass('affix', top >= offset).toggleClass('scrolled', top > offset);\n }).start();\n\n $(() => {\n $('body').addClass('ontouchstart' in window ? 'touch' : 'no-touch');\n });\n }\n\n /**\n * Get the API response document that has been preloaded into the application.\n */\n preloadedApiDocument() {\n if (this.data.apiDocument) {\n const results = this.store.pushPayload(this.data.apiDocument);\n\n this.data.apiDocument = null;\n\n return results;\n }\n\n return null;\n }\n\n /**\n * Set the <title> of the page.\n */\n setTitle(title: string) {\n this.title = title;\n this.updateTitle();\n }\n\n /**\n * Set a number to display in the <title> of the page.\n */\n setTitleCount(count: number) {\n this.titleCount = count;\n this.updateTitle();\n }\n\n updateTitle() {\n document.title = (this.titleCount ? `(${this.titleCount}) ` : '') + (this.title ? this.title + ' - ' : '') + this.forum.attribute('title');\n }\n\n /**\n * Construct a URL to the route with the given name.\n */\n route(name: string, params: object = {}): string {\n const route = this.routes[name];\n\n if (!route) throw new Error(`Route '${name}' does not exist`);\n\n const url = route.path.replace(/:([^\\/]+)/g, (m, key) => extract(params, key));\n\n // Remove falsy values in params to avoid\n // having urls like '/?sort&q'\n for (const key in params) {\n if (params.hasOwnProperty(key) && !params[key]) delete params[key];\n }\n\n const queryString = m.buildQueryString(params);\n const prefix = m.route.prefix === '' ? this.forum.attribute('basePath') : '';\n\n return prefix + url + (queryString ? '?' + queryString : '');\n }\n\n /**\n * Make an AJAX request, handling any low-level errors that may occur.\n *\n * @see https://mithril.js.org/request.html\n */\n request(originalOptions: Mithril.RequestOptions | any): Promise<any> {\n const options: Mithril.RequestOptions = Object.assign({}, originalOptions);\n\n // Set some default options if they haven't been overridden. We want to\n // authenticate all requests with the session token. We also want all\n // requests to run asynchronously in the background, so that they don't\n // prevent redraws from occurring.\n options.background = options.background || true;\n\n extend(options, 'config', (result, xhr: XMLHttpRequest) => xhr.setRequestHeader('X-CSRF-Token', this.session.csrfToken));\n\n // If the method is something like PATCH or DELETE, which not all servers\n // and clients support, then we'll send it as a POST request with the\n // intended method specified in the X-HTTP-Method-Override header.\n if (options.method !== 'GET' && options.method !== 'POST') {\n const method = options.method;\n extend(options, 'config', (result, xhr: XMLHttpRequest) => xhr.setRequestHeader('X-HTTP-Method-Override', method));\n options.method = 'POST';\n }\n\n // When we deserialize JSON data, if for some reason the server has provided\n // a dud response, we don't want the application to crash. We'll show an\n // error message to the user instead.\n options.deserialize = options.deserialize || (responseText => responseText);\n\n options.errorHandler =\n options.errorHandler ||\n (error => {\n throw error;\n });\n\n // When extracting the data from the response, we can check the server\n // response code and show an error message to the user if something's gone\n // awry.\n const original = options.extract;\n options.extract = xhr => {\n let responseText;\n\n if (original) {\n responseText = original(xhr.responseText);\n } else {\n responseText = xhr.responseText || null;\n }\n\n const status = xhr.status;\n\n if (status < 200 || status > 299) {\n throw new RequestError(status, responseText, options, xhr);\n }\n\n if (xhr.getResponseHeader) {\n const csrfToken = xhr.getResponseHeader('X-CSRF-Token');\n if (csrfToken) app.session.csrfToken = csrfToken;\n }\n\n try {\n return JSON.parse(responseText);\n } catch (e) {\n throw new RequestError(500, responseText, options, xhr);\n }\n };\n\n if (this.requestError) this.alerts.dismiss(this.requestError.alert);\n\n // Now make the request. If it's a failure, inspect the error that was\n // returned and show an alert containing its contents.\n return m.request(options).then(\n res => res,\n error => {\n this.requestError = error;\n\n let children;\n\n switch (error.status) {\n case 422:\n children = error.response.errors\n .map(error => [error.detail, m('br')])\n .reduce((a, b) => a.concat(b), [])\n .slice(0, -1);\n break;\n\n case 401:\n case 403:\n children = this.translator.trans('core.lib.error.permission_denied_message');\n break;\n\n case 404:\n case 410:\n children = this.translator.trans('core.lib.error.not_found_message');\n break;\n\n case 429:\n children = this.translator.trans('core.lib.error.rate_limit_exceeded_message');\n break;\n\n default:\n children = this.translator.trans('core.lib.error.generic_message');\n }\n\n const isDebug = app.forum.attribute('debug');\n\n error.alert = Alert.component({\n type: 'error',\n children,\n controls: isDebug && [\n Button.component({\n className: 'Button Button--link',\n onclick: this.showDebug.bind(this, error),\n children: 'DEBUG', // TODO make translatable\n }),\n ],\n });\n\n try {\n options.errorHandler(error);\n } catch (error) {\n console.error(error);\n this.alerts.show(error.alert);\n }\n\n return Promise.reject(error);\n }\n );\n }\n\n private showDebug(error: RequestError) {\n this.alerts.dismiss(this.requestError.alert);\n\n this.modal.show(RequestErrorModal, { error });\n }\n}\n","import Mithril, { ClassComponent, Vnode } from 'mithril';\n\nexport type ComponentProps = {\n children?: Mithril.Children;\n\n className?: string;\n\n [key: string]: any;\n};\n\nexport default class Component<T extends ComponentProps = any> implements ClassComponent {\n element!: HTMLElement;\n\n props: T;\n\n constructor(props: T = <T>{}) {\n this.props = props.tag ? <T>{} : props;\n }\n\n view(vnode) {\n throw new Error('Component#view must be implemented by subclass');\n }\n\n oninit(vnode) {\n this.setProps(vnode);\n }\n\n oncreate(vnode) {\n this.setProps(vnode);\n this.element = vnode.dom;\n }\n\n onbeforeupdate(vnode) {\n this.setProps(vnode);\n }\n\n onupdate(vnode) {\n this.setProps(vnode);\n }\n\n onbeforeremove(vnode) {\n this.setProps(vnode);\n }\n\n onremove(vnode) {\n this.setProps(vnode);\n }\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param selector a jQuery-compatible selector string\n * @final\n */\n $(selector?: string): ZeptoCollection {\n const $element = $(this.element);\n\n return selector ? $element.find(selector) : $element;\n }\n\n render() {\n return m(this.constructor, this.props);\n }\n\n static component(props: ComponentProps | any = {}, children?: Mithril.Children) {\n const componentProps: ComponentProps = Object.assign({}, props);\n\n if (children) componentProps.children = children;\n\n return m(this, componentProps);\n }\n\n static initProps(props: ComponentProps = {}) {}\n\n private setProps(vnode: Vnode<T, this>) {\n const props = vnode.attrs || {};\n\n (this.constructor as typeof Component).initProps(props);\n\n if (!props.children) props.children = vnode.children;\n\n this.props = props;\n }\n}\n","/**\n * The `Model` class represents a local data resource. It provides methods to\n * persist changes via the API.\n *\n * @abstract\n */\nimport Store from './Store';\n\nexport interface Identifier {\n type: string;\n id: string;\n}\n\nexport interface Data extends Identifier {\n attributes?: { [key: string]: any };\n relationships?: { [key: string]: { data: Identifier | Identifier[] } };\n}\n\nexport default class Model {\n /**\n * The resource object from the API.\n */\n data: Data;\n\n payload: any;\n\n /**\n * The time at which the model's data was last updated. Watching the value\n * of this property is a fast way to retain/cache a subtree if data hasn't\n * changed.\n */\n freshness: Date;\n\n /**\n * Whether or not the resource exists on the server.\n */\n exists: boolean;\n\n /**\n * The data store that this resource should be persisted to.\n */\n protected store: Store;\n\n /**\n * @param {Object} data A resource object from the API.\n * @param {Store} store The data store that this model should be persisted to.\n */\n constructor(data = {}, store = null) {\n this.data = data;\n this.store = store;\n\n this.freshness = new Date();\n this.exists = false;\n }\n\n /**\n * Get the model's ID.\n * @final\n */\n id(): string {\n return this.data.id;\n }\n\n /**\n * Get one of the model's attributes.\n * @final\n */\n attribute(attribute: string): any {\n return this.data.attributes && this.data.attributes[attribute];\n }\n\n /**\n * Merge new data into this model locally.\n *\n * @param data A resource object to merge into this model\n * @public\n */\n pushData(data: {}) {\n // Since most of the top-level items in a resource object are objects\n // (e.g. relationships, attributes), we'll need to check and perform the\n // merge at the second level if that's the case.\n for (const key in data) {\n if (typeof data[key] === 'object') {\n this.data[key] = this.data[key] || {};\n\n // For every item in a second-level object, we want to check if we've\n // been handed a Model instance. If so, we will convert it to a\n // relationship data object.\n for (const innerKey in data[key]) {\n if (data[key][innerKey] instanceof Model) {\n data[key][innerKey] = { data: Model.getIdentifier(data[key][innerKey]) };\n }\n this.data[key][innerKey] = data[key][innerKey];\n }\n } else {\n this.data[key] = data[key];\n }\n }\n\n // Now that we've updated the data, we can say that the model is fresh.\n // This is an easy way to invalidate retained subtrees etc.\n this.freshness = new Date();\n }\n\n /**\n * Merge new attributes into this model locally.\n *\n * @param {Object} attributes The attributes to merge.\n */\n pushAttributes(attributes: any) {\n this.pushData({ attributes });\n }\n\n /**\n * Merge new attributes into this model, both locally and with persistence.\n *\n * @param attributes The attributes to save. If a 'relationships' key\n * exists, it will be extracted and relationships will also be saved.\n * @param [options]\n * @return {Promise}\n */\n save(attributes: any, options: any = {}): Promise<Model | Model[]> {\n const data: Data = {\n type: this.data.type,\n id: this.data.id,\n attributes,\n };\n\n // If a 'relationships' key exists, extract it from the attributes hash and\n // set it on the top-level data object instead. We will be sending this data\n // object to the API for persistence.\n if (attributes.relationships) {\n data.relationships = {};\n\n for (const key in attributes.relationships) {\n const model = attributes.relationships[key];\n\n data.relationships[key] = {\n data: model instanceof Array ? model.map(Model.getIdentifier) : Model.getIdentifier(model),\n };\n }\n\n delete attributes.relationships;\n }\n\n // Before we update the model's data, we should make a copy of the model's\n // old data so that we can revert back to it if something goes awry during\n // persistence.\n const oldData = this.copyData();\n\n this.pushData(data);\n\n const request = { data };\n if (options.meta) request.meta = options.meta;\n\n return app\n .request(\n Object.assign(\n {\n method: this.exists ? 'PATCH' : 'POST',\n url: app.forum.attribute('apiUrl') + this.apiEndpoint(),\n body: request,\n },\n options\n )\n )\n .then(\n // If everything went well, we'll make sure the store knows that this\n // model exists now (if it didn't already), and we'll push the data that\n // the API returned into the store.\n payload => {\n this.store.data[payload.data.type] = this.store.data[payload.data.type] || {};\n this.store.data[payload.data.type][payload.data.id] = this;\n return this.store.pushPayload(payload);\n },\n\n // If something went wrong, though... good thing we backed up our model's\n // old data! We'll revert to that and let others handle the error.\n response => {\n this.pushData(oldData);\n m.redraw();\n throw response;\n }\n );\n }\n\n /**\n * Send a request to delete the resource.\n *\n * @param {Object} body Data to send along with the DELETE request.\n * @param {Object} [options]\n * @return {Promise}\n * @public\n */\n delete(body = {}, options = {}) {\n if (!this.exists) return Promise.resolve();\n\n return app\n .request(\n Object.assign(\n {\n method: 'DELETE',\n url: app.forum.attribute('apiUrl') + this.apiEndpoint(),\n body,\n },\n options\n )\n )\n .then(() => {\n this.exists = false;\n this.store.remove(this);\n });\n }\n\n /**\n * Construct a path to the API endpoint for this resource.\n *\n * @return {String}\n * @protected\n */\n apiEndpoint() {\n return '/' + this.data.type + (this.exists ? '/' + this.data.id : '');\n }\n\n copyData() {\n return JSON.parse(JSON.stringify(this.data));\n }\n\n /**\n * Generate a function which returns the value of the given attribute.\n *\n * @param {String} name\n * @param [transform] A function to transform the attribute value\n */\n static attribute(name: string, transform?: Function): () => any {\n return function(this: Model) {\n const value = this.data.attributes && this.data.attributes[name];\n\n return transform ? transform(value) : value;\n };\n }\n\n /**\n * Generate a function which returns the value of the given has-one\n * relationship.\n *\n * @return false if no information about the\n * relationship exists; undefined if the relationship exists but the model\n * has not been loaded; or the model if it has been loaded.\n */\n static hasOne(name: string): () => Model | boolean {\n return function(this: Model) {\n if (this.data.relationships) {\n const relationship = this.data.relationships[name];\n\n if (relationship) {\n return app.store.getById(relationship.data.type, relationship.data.id);\n }\n }\n\n return false;\n };\n }\n\n /**\n * Generate a function which returns the value of the given has-many\n * relationship.\n *\n * @return false if no information about the relationship\n * exists; an array if it does, containing models if they have been\n * loaded, and undefined for those that have not.\n */\n static hasMany(name: string): () => any[] | false {\n return function(this: Model) {\n if (this.data.relationships) {\n const relationship = this.data.relationships[name];\n\n if (relationship) {\n return relationship.data.map(data => app.store.getById(data.type, data.id));\n }\n }\n\n return false;\n };\n }\n\n /**\n * Transform the given value into a Date object.\n */\n static transformDate(value: string): Date | null {\n return value ? new Date(value) : null;\n }\n\n /**\n * Get a resource identifier object for the given model.\n */\n protected static getIdentifier(model: Model): Identifier {\n return {\n type: model.data.type,\n id: model.data.id,\n };\n }\n}\n","import User from './models/User';\n\n/**\n * The `Session` class defines the current user session. It stores a reference\n * to the current authenticated user, and provides methods to log in/out.\n */\nexport default class Session {\n /**\n * The current authenticated user.\n */\n user: User;\n\n /**\n * The CSRF token.\n */\n csrfToken?: string;\n\n constructor(user, csrfToken) {\n this.user = user;\n\n this.csrfToken = csrfToken;\n }\n\n /**\n * Attempt to log in a user.\n */\n login(body: { identification: string; password: string; remember?: boolean }, options = {}) {\n return app.request(\n Object.assign(\n {\n method: 'POST',\n url: `${app.forum.attribute('baseUrl')}/login`,\n body,\n },\n options\n )\n );\n }\n\n /**\n * Log the user out.\n *\n * @public\n */\n logout() {\n window.location.href = `${app.forum.attribute('baseUrl')}/logout?token=${this.csrfToken}`;\n }\n}\n","import Model from './Model';\n\n/**\n * The `Store` class defines a local data store, and provides methods to\n * retrieve data from the API.\n */\nexport default class Store {\n /**\n * The local data store. A tree of resource types to IDs, such that\n * accessing data[type][id] will return the model for that type/ID.\n */\n data: { [key: string]: Model[] } = {};\n\n /**\n * The model registry. A map of resource types to the model class that\n * should be used to represent resources of that type.\n */\n models: {};\n\n constructor(models) {\n this.models = models;\n }\n\n /**\n * Push resources contained within an API payload into the store.\n *\n * @param payload\n * @return The model(s) representing the resource(s) contained\n * within the 'data' key of the payload.\n */\n pushPayload(payload: { included?: {}[]; data?: {} | {}[] }): Model | Model[] {\n if (payload.included) payload.included.map(this.pushObject.bind(this));\n\n const result: any = payload.data instanceof Array ? payload.data.map(this.pushObject.bind(this)) : this.pushObject(payload.data);\n\n // Attach the original payload to the model that we give back. This is\n // useful to consumers as it allows them to access meta information\n // associated with their request.\n result.payload = payload;\n\n return result;\n }\n\n /**\n * Create a model to represent a resource object (or update an existing one),\n * and push it into the store.\n *\n * @param {Object} data The resource object\n * @return The model, or null if no model class has been\n * registered for this resource type.\n */\n pushObject(data): Model | null {\n if (!this.models[data.type]) return null;\n\n const type = (this.data[data.type] = this.data[data.type] || {});\n\n if (type[data.id]) {\n type[data.id].pushData(data);\n } else {\n type[data.id] = this.createRecord(data.type, data);\n }\n\n type[data.id].exists = true;\n\n return type[data.id];\n }\n\n /**\n * Make a request to the API to find record(s) of a specific type.\n *\n * @param type The resource type.\n * @param [id] The ID(s) of the model(s) to retrieve.\n * Alternatively, if an object is passed, it will be handled as the\n * `query` parameter.\n * @param query\n * @param options\n */\n find<T extends Model = Model>(type: string, id?: number | number[] | any, query = {}, options = {}): Promise<T[]> {\n let params = query;\n let url = `${app.forum.attribute('apiUrl')}/${type}`;\n\n if (id instanceof Array) {\n url += `?filter[id]=${id.join(',')}`;\n } else if (typeof id === 'object') {\n params = id;\n } else if (id) {\n url += `/${id}`;\n }\n\n return <Promise<T[]>>app\n .request(\n Object.assign(\n {\n method: 'GET',\n url,\n params,\n },\n options\n )\n )\n .then(this.pushPayload.bind(this));\n }\n\n /**\n * Get a record from the store by ID.\n *\n * @param type The resource type.\n * @param id The resource ID.\n */\n getById<T extends Model = Model>(type: string, id: number | string): T {\n return this.data[type] && (this.data[type][id] as T);\n }\n\n /**\n * Get a record from the store by the value of a model attribute.\n *\n * @param type The resource type.\n * @param key The name of the method on the model.\n * @param value The value of the model attribute.\n */\n getBy<T extends Model = Model>(type: string, key: string, value: any): T {\n return this.all<T>(type).filter(model => model[key]() === value)[0];\n }\n\n /**\n * Get all loaded records of a specific type.\n */\n all<T extends Model = Model>(type: string): T[] {\n const records = this.data[type];\n\n return records ? Object.keys(records).map(id => records[id]) : [];\n }\n\n /**\n * Remove the given model from the store.\n */\n remove(model: Model) {\n delete this.data[model.data.type][model.id()];\n }\n\n /**\n * Create a new record of the given type.\n *\n * @param {String} type The resource type\n * @param {Object} [data] Any data to initialize the model with\n */\n createRecord<T extends Model = Model>(type: string, data: any = {}): T {\n data.type = data.type || type;\n\n return new this.models[type](data, this);\n }\n}\n","import extract from './utils/extract';\nimport extractText from './utils/extractText';\nimport username from './helpers/username';\n\ntype Translations = { [key: string]: string };\n\nexport default class Translator {\n /**\n * A map of translation keys to their translated values.\n */\n translations: Translations = {};\n locale?: string;\n\n addTranslations(translations) {\n Object.assign(this.translations, translations);\n }\n\n trans(id: string, parameters = null) {\n const translation = this.translations[id];\n\n if (translation) {\n return this.apply(translation, parameters || {});\n }\n\n return id;\n }\n\n transText(id: string, parameters = null) {\n return extractText(this.trans(id, parameters));\n }\n\n transChoice(id: string, number: string | number, parameters: any) {\n let translation = this.translations[id];\n\n if (translation) {\n number = parseInt(number, 10);\n\n translation = this.pluralize(translation, number);\n\n return this.apply(translation, parameters || {});\n }\n\n return id;\n }\n\n apply(translation: string, input: any) {\n if ('user' in input) {\n const user = extract(input, 'user');\n if (!input.username) input.username = username(user);\n }\n\n const parts = translation.split(new RegExp('({[a-z0-9_]+}|</?[a-z0-9_]+>)', 'gi'));\n\n const hydrated: any[] = [];\n const open: any[][] = [hydrated];\n\n parts.forEach(part => {\n const match = part.match(new RegExp('{([a-z0-9_]+)}|<(/?)([a-z0-9_]+)>', 'i'));\n\n if (match) {\n if (match[1]) {\n open[0].push(input[match[1]]);\n } else if (match[3]) {\n if (match[2]) {\n open.shift();\n } else {\n let tag = input[match[3]] || { tag: match[3], children: [] };\n open[0].push(tag);\n open.unshift(tag.children || tag);\n }\n }\n } else {\n open[0].push({ tag: 'span', text: part });\n }\n });\n\n return hydrated.filter(part => part);\n }\n\n pluralize(translation: string, number: number) {\n const sPluralRegex = new RegExp(/^\\w+\\: +(.+)$/),\n cPluralRegex = new RegExp(\n /^\\s*((\\{\\s*(\\-?\\d+[\\s*,\\s*\\-?\\d+]*)\\s*\\})|([\\[\\]])\\s*(-Inf|\\-?\\d+)\\s*,\\s*(\\+?Inf|\\-?\\d+)\\s*([\\[\\]]))\\s?(.+?)$/\n ),\n iPluralRegex = new RegExp(/^\\s*(\\{\\s*(\\-?\\d+[\\s*,\\s*\\-?\\d+]*)\\s*\\})|([\\[\\]])\\s*(-Inf|\\-?\\d+)\\s*,\\s*(\\+?Inf|\\-?\\d+)\\s*([\\[\\]])/),\n standardRules = [],\n explicitRules = [];\n\n translation.split('|').forEach(part => {\n if (cPluralRegex.test(part)) {\n const matches = part.match(cPluralRegex);\n explicitRules[matches[0]] = matches[matches.length - 1];\n } else if (sPluralRegex.test(part)) {\n const matches = part.match(sPluralRegex);\n standardRules.push(matches[1]);\n } else {\n standardRules.push(part);\n }\n });\n\n explicitRules.forEach((rule, e) => {\n if (iPluralRegex.test(e)) {\n const matches = e.match(iPluralRegex);\n\n if (matches[1]) {\n const ns = matches[2].split(',');\n\n for (let n in ns) {\n if (number == ns[n]) {\n return explicitRules[e];\n }\n }\n } else {\n const leftNumber = this.convertNumber(matches[4]);\n const rightNumber = this.convertNumber(matches[5]);\n\n if (\n ('[' === matches[3] ? number >= leftNumber : number > leftNumber) &&\n (']' === matches[6] ? number <= rightNumber : number < rightNumber)\n ) {\n return explicitRules[e];\n }\n }\n }\n });\n\n return standardRules[this.pluralPosition(number, this.locale)] || standardRules[0] || undefined;\n }\n\n convertNumber(number: string): number {\n if ('-Inf' === number) {\n return Number.NEGATIVE_INFINITY;\n } else if ('+Inf' === number || 'Inf' === number) {\n return Number.POSITIVE_INFINITY;\n }\n\n return parseInt(number, 10);\n }\n\n pluralPosition(number: number, locale: string) {\n if ('pt_BR' === locale) {\n locale = 'xbr';\n }\n\n if (locale.length > 3) {\n locale = locale.split('_')[0];\n }\n\n switch (locale) {\n case 'bo':\n case 'dz':\n case 'id':\n case 'ja':\n case 'jv':\n case 'ka':\n case 'km':\n case 'kn':\n case 'ko':\n case 'ms':\n case 'th':\n case 'vi':\n case 'zh':\n return 0;\n\n case 'af':\n case 'az':\n case 'bn':\n case 'bg':\n case 'ca':\n case 'da':\n case 'de':\n case 'el':\n case 'en':\n case 'eo':\n case 'es':\n case 'et':\n case 'eu':\n case 'fa':\n case 'fi':\n case 'fo':\n case 'fur':\n case 'fy':\n case 'gl':\n case 'gu':\n case 'ha':\n case 'he':\n case 'hu':\n case 'is':\n case 'it':\n case 'ku':\n case 'lb':\n case 'ml':\n case 'mn':\n case 'mr':\n case 'nah':\n case 'nb':\n case 'ne':\n case 'nl':\n case 'nn':\n case 'no':\n case 'om':\n case 'or':\n case 'pa':\n case 'pap':\n case 'ps':\n case 'pt':\n case 'so':\n case 'sq':\n case 'sv':\n case 'sw':\n case 'ta':\n case 'te':\n case 'tk':\n case 'tr':\n case 'ur':\n case 'zu':\n return number == 1 ? 0 : 1;\n\n case 'am':\n case 'bh':\n case 'fil':\n case 'fr':\n case 'gun':\n case 'hi':\n case 'ln':\n case 'mg':\n case 'nso':\n case 'xbr':\n case 'ti':\n case 'wa':\n return number === 0 || number == 1 ? 0 : 1;\n\n case 'be':\n case 'bs':\n case 'hr':\n case 'ru':\n case 'sr':\n case 'uk':\n return number % 10 == 1 && number % 100 != 11\n ? 0\n : number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)\n ? 1\n : 2;\n\n case 'cs':\n case 'sk':\n return number == 1 ? 0 : number >= 2 && number <= 4 ? 1 : 2;\n\n case 'ga':\n return number == 1 ? 0 : number == 2 ? 1 : 2;\n\n case 'lt':\n return number % 10 == 1 && number % 100 != 11 ? 0 : number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20) ? 1 : 2;\n\n case 'sl':\n return number % 100 == 1 ? 0 : number % 100 == 2 ? 1 : number % 100 == 3 || number % 100 == 4 ? 2 : 3;\n\n case 'mk':\n return number % 10 == 1 ? 0 : 1;\n\n case 'mt':\n return number == 1 ? 0 : number === 0 || (number % 100 > 1 && number % 100 < 11) ? 1 : number % 100 > 10 && number % 100 < 20 ? 2 : 3;\n\n case 'lv':\n return number === 0 ? 0 : number % 10 == 1 && number % 100 != 11 ? 1 : 2;\n\n case 'pl':\n return number == 1 ? 0 : number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 12 || number % 100 > 14) ? 1 : 2;\n\n case 'cy':\n return number == 1 ? 0 : number == 2 ? 1 : number == 8 || number == 11 ? 2 : 3;\n\n case 'ro':\n return number == 1 ? 0 : number === 0 || (number % 100 > 0 && number % 100 < 20) ? 1 : 2;\n\n case 'ar':\n return number === 0 ? 0 : number == 1 ? 1 : number == 2 ? 2 : number >= 3 && number <= 10 ? 3 : number >= 11 && number <= 99 ? 4 : 5;\n\n default:\n return 0;\n }\n }\n}\n","import * as extend from './extend';\n\nimport Modal from './components/Modal';\n\nexport default {\n extend: extend,\n\n 'components/Modal': Modal,\n};\n","import Component, { ComponentProps } from '../Component';\nimport Button from './Button';\nimport listItems from '../helpers/listItems';\nimport extract from '../utils/extract';\nimport * as Mithril from 'mithril';\n\nexport interface AlertProps extends ComponentProps {\n controls?: Mithril.ChildArray;\n type?: string;\n dismissible?: boolean;\n\n ondismiss?: () => any;\n}\n\n/**\n * The `Alert` component represents an alert box, which contains a message,\n * some controls, and may be dismissible.\n *\n * The alert may have the following special props:\n *\n * - `type` The type of alert this is. Will be used to give the alert a class\n * name of `Alert--{type}`.\n * - `controls` An array of controls to show in the alert.\n * - `dismissible` Whether or not the alert can be dismissed.\n * - `ondismiss` A callback to run when the alert is dismissed.\n *\n * All other props will be assigned as attributes on the alert element.\n */\nexport default class Alert extends Component<AlertProps> {\n view() {\n const attrs: AlertProps = Object.assign({}, this.props);\n\n const type: string = extract(attrs, 'type');\n attrs.className = `Alert Alert--${type} ${attrs.className || ''}`;\n\n const children: Mithril.Children = extract(attrs, 'children');\n const controls: Mithril.ChildArray = extract(attrs, 'controls') || [];\n\n // If the alert is meant to be dismissible (which is the case by default),\n // then we will create a dismiss button to append as the final control in\n // the alert.\n const dismissible: boolean | undefined = extract(attrs, 'dismissible');\n const ondismiss: () => any = extract(attrs, 'ondismiss');\n const dismissControl = [];\n\n if (dismissible || dismissible === undefined) {\n dismissControl.push(<Button icon=\"fas fa-times\" className=\"Button Button--link Button--icon Alert-dismiss\" onclick={ondismiss} />);\n }\n\n return (\n <div {...attrs}>\n <span className=\"Alert-body\">{children}</span>\n <ul className=\"Alert-controls\">{listItems(controls.concat(dismissControl))}</ul>\n </div>\n );\n }\n}\n","import Component, { ComponentProps } from '../Component';\nimport Alert from './Alert';\nimport { Vnode } from 'mithril';\n\n/**\n * The `AlertManager` component provides an area in which `Alert` components can\n * be shown and dismissed.\n */\nexport default class AlertManager extends Component {\n /**\n * An array of Alert components which are currently showing.\n */\n protected components: Vnode<ComponentProps, Alert>[] = [];\n\n view() {\n return (\n <div className=\"AlertManager\">\n {this.components.map(vnode => (\n <div className=\"AlertManager-alert\">{vnode}</div>\n ))}\n </div>\n );\n }\n\n /**\n * Show an Alert in the alerts area.\n */\n public show(vnode: Vnode<ComponentProps, Alert>) {\n vnode.attrs.ondismiss = this.dismiss.bind(this, vnode);\n\n this.components.push(vnode);\n m.redraw();\n }\n\n /**\n * Dismiss an alert.\n */\n public dismiss(vnode) {\n const index = this.components.indexOf(vnode);\n\n if (index !== -1) {\n this.components.splice(index, 1);\n m.redraw();\n }\n }\n\n /**\n * Clear all alerts.\n */\n public clear() {\n this.components = [];\n m.redraw();\n }\n}\n","import Component from '../Component';\nimport icon from '../helpers/icon';\nimport extract from '../utils/extract';\n\n/**\n * The `Badge` component represents a user/discussion badge, indicating some\n * status (e.g. a discussion is stickied, a user is an admin).\n *\n * A badge may have the following special props:\n *\n * - `type` The type of badge this is. This will be used to give the badge a\n * class name of `Badge--{type}`.\n * - `icon` The name of an icon to show inside the badge.\n * - `label`\n *\n * All other props will be assigned as attributes on the badge element.\n */\nexport default class Badge extends Component {\n view(vnode) {\n const attrs = vnode.attrs;\n const type = extract(attrs, 'type');\n const iconName = extract(attrs, 'icon');\n\n attrs.className = `Badge ${type ? `Badge--${type}` : ''} ${attrs.className || ''}`;\n attrs.title = extract(attrs, 'label') || '';\n\n return <span {...attrs}>{iconName ? icon(iconName, { className: 'Badge-icon' }) : m.trust(' ')}</span>;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n if (this.props.label) this.$().tooltip({ container: 'body' });\n }\n}\n","import Component, { ComponentProps } from '../Component';\nimport icon from '../helpers/icon';\nimport extract from '../utils/extract';\nimport extractText from '../utils/extractText';\nimport LoadingIndicator from './LoadingIndicator';\n\nexport interface ButtonProps extends ComponentProps {\n title?: string;\n type?: string;\n icon?: string;\n\n loading?: boolean;\n disabled?: boolean;\n onclick?: Function;\n}\n\n/**\n * The `Button` component defines an element which, when clicked, performs an\n * action. The button may have the following special props:\n *\n * - `icon` The name of the icon class. If specified, the button will be given a\n * 'has-icon' class name.\n * - `disabled` Whether or not the button is disabled. If truthy, the button\n * will be given a 'disabled' class name, and any `onclick` handler will be\n * removed.\n * - `loading` Whether or not the button should be in a disabled loading state.\n *\n * All other props will be assigned as attributes on the button element.\n *\n * Note that a Button has no default class names. This is because a Button can\n * be used to represent any generic clickable control, like a menu item.\n */\nexport default class Button<T extends ButtonProps = ButtonProps> extends Component<T> {\n view() {\n const { children, ...attrs } = this.props;\n\n attrs.className = attrs.className || '';\n attrs.type = attrs.type || 'button';\n\n // If a tooltip was provided for buttons without additional content, we also\n // use this tooltip as text for screen readers\n if (attrs.title && !this.props.children) {\n attrs['aria-label'] = attrs.title;\n }\n\n // If nothing else is provided, we use the textual button content as tooltip\n if (!attrs.title && this.props.children) {\n attrs.title = extractText(this.props.children);\n }\n\n const iconName = extract(attrs, 'icon');\n if (iconName) attrs.className += ' hasIcon';\n\n const loading = extract(attrs, 'loading');\n if (attrs.disabled || loading) {\n attrs.className = classNames(attrs.className, 'disabled', loading && 'loading');\n delete attrs.onclick;\n }\n\n return <button {...attrs}>{this.getButtonContent(iconName, loading, children)}</button>;\n }\n\n /**\n * Get the template for the button's content.\n */\n protected getButtonContent(iconName?: string | boolean, loading?: boolean, children?: any): any[] {\n return [\n iconName && iconName !== true ? icon(iconName, { className: 'Button-icon' }) : '',\n children ? <span className=\"Button-label\">{children}</span> : '',\n loading ? LoadingIndicator.component({ size: 'tiny', className: 'LoadingIndicator--inline' }) : '',\n ];\n }\n}\n","import Component, { ComponentProps } from '../Component';\nimport LoadingIndicator from './LoadingIndicator';\nimport icon from '../helpers/icon';\n\nexport interface CheckboxProps extends ComponentProps {\n /**\n * Whether or not the checkbox is checked\n */\n state: boolean;\n\n /**\n * Whether or not the checkbox is disabled.\n */\n disabled: boolean;\n\n /**\n * A callback to run when the checkbox is checked/unchecked.\n */\n onchange?: Function;\n}\n\n/**\n * The `Checkbox` component defines a checkbox input.\n */\nexport default class Checkbox<T extends CheckboxProps = CheckboxProps> extends Component<CheckboxProps> {\n /**\n * Whether or not the checkbox's value is in the process of being saved.\n */\n loading = false;\n\n view() {\n const className = classNames(\n 'Checkbox',\n this.props.className,\n this.props.state ? 'on' : 'off',\n this.loading && 'loading',\n this.props.disabled && 'disabled'\n );\n\n return (\n <label className={className}>\n <input\n type=\"checkbox\"\n checked={this.props.state}\n disabled={this.props.disabled}\n onchange={m.withAttr('checked', this.onchange.bind(this))}\n />\n <div className=\"Checkbox-display\">{this.getDisplay()}</div>\n {this.props.children}\n </label>\n );\n }\n\n /**\n * Get the template for the checkbox's display (tick/cross icon).\n */\n protected getDisplay() {\n return this.loading ? LoadingIndicator.component({ size: 'tiny' }) : icon(this.props.state ? 'fas fa-check' : 'fas fa-times');\n }\n\n /**\n * Run a callback when the state of the checkbox is changed.\n */\n protected onchange(checked: boolean) {\n if (this.props.onchange) this.props.onchange(checked, this);\n }\n}\n","import Component, { ComponentProps } from '../Component';\nimport icon from '../helpers/icon';\nimport listItems from '../helpers/listItems';\n\nexport interface DropdownProps extends ComponentProps {\n buttonClassName?: string;\n menuClassName?: string;\n label?: string;\n icon?: string;\n caretIcon?: undefined | string;\n\n onhide?: Function;\n onshow?: Function;\n onclick?: Function;\n}\n\n/**\n * The `Dropdown` component displays a button which, when clicked, shows a\n * dropdown menu beneath it.\n *\n * ### Props\n *\n * - `buttonClassName` A class name to apply to the dropdown toggle button.\n * - `menuClassName` A class name to apply to the dropdown menu.\n * - `icon` The name of an icon to show in the dropdown toggle button.\n * - `caretIcon` The name of an icon to show on the right of the button.\n * - `label` The label of the dropdown toggle button. Defaults to 'Controls'.\n * - `onhide`\n * - `onshow`\n *\n * The children will be displayed as a list inside of the dropdown menu.\n */\nexport default class Dropdown<T extends DropdownProps = DropdownProps> extends Component<T> {\n showing: boolean = false;\n\n static initProps(props: DropdownProps) {\n props.className = props.className || '';\n props.buttonClassName = props.buttonClassName || '';\n props.menuClassName = props.menuClassName || '';\n props.label = props.label || '';\n props.caretIcon = typeof props.caretIcon !== 'undefined' ? props.caretIcon : 'fas fa-caret-down';\n }\n\n view() {\n const items = this.props.children ? listItems(this.props.children) : [];\n\n return (\n <div className={`ButtonGroup Dropdown dropdown ${this.props.className} itemCount${items.length}${this.showing ? ' open' : ''}`}>\n {this.getButton()}\n {this.getMenu(items)}\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$('> .Dropdown-toggle').dropdown();\n\n // When opening the dropdown menu, work out if the menu goes beyond the\n // bottom of the viewport. If it does, we will apply class to make it show\n // above the toggle button instead of below it.\n this.element.addEventListener('shown.bs.dropdown', () => {\n this.showing = true;\n\n if (this.props.onshow) {\n this.props.onshow();\n }\n\n m.redraw();\n\n const $menu = this.$('.Dropdown-menu');\n const isRight = $menu.hasClass('Dropdown-menu--right');\n\n $menu.removeClass('Dropdown-menu--top Dropdown-menu--right');\n\n $menu.toggleClass('Dropdown-menu--top', $menu.offset().top + $menu.height() > $(window).scrollTop() + $(window).height());\n\n if ($menu.offset().top < 0) {\n $menu.removeClass('Dropdown-menu--top');\n }\n\n $menu.toggleClass('Dropdown-menu--right', isRight || $menu.offset().left + $menu.width() > $(window).scrollLeft() + $(window).width());\n });\n\n this.element.addEventListener('hidden.bs.dropdown', () => {\n this.showing = false;\n\n if (this.props.onhide) {\n this.props.onhide();\n }\n\n m.redraw();\n });\n }\n\n /**\n * Get the template for the button.\n */\n protected getButton(): any {\n return (\n <button className={'Dropdown-toggle ' + this.props.buttonClassName} data-toggle=\"dropdown\" onclick={this.props.onclick}>\n {this.getButtonContent()}\n </button>\n );\n }\n\n /**\n * Get the template for the button's content.\n *\n * @return {*}\n */\n protected getButtonContent() {\n const attrs = this.props;\n\n return [\n attrs.icon ? icon(attrs.icon, { className: 'Button-icon' }) : '',\n <span className=\"Button-label\">{attrs.label}</span>,\n attrs.caretIcon ? icon(attrs.caretIcon, { className: 'Button-caret' }) : '',\n ];\n }\n\n protected getMenu(items) {\n return <ul className={'Dropdown-menu dropdown-menu ' + this.props.menuClassName}>{items}</ul>;\n }\n}\n","import Component, { ComponentProps } from '../Component';\nimport listItems from '../helpers/listItems';\n\nexport interface FieldSetProps extends ComponentProps {\n /**\n * The title of this group of fields\n */\n label: string;\n}\n\n/**\n * The `FieldSet` component defines a collection of fields, displayed in a list\n * underneath a title.\n *\n * The children should be an array of items to show in the fieldset.\n */\nexport default class FieldSet extends Component<FieldSetProps> {\n view() {\n return (\n <fieldset className={this.props.className}>\n <legend>{this.props.label}</legend>\n <ul>{listItems(this.props.children)}</ul>\n </fieldset>\n );\n }\n}\n","import Badge from './Badge';\nimport extract from '../utils/extract';\n\nexport default class GroupBadge extends Badge {\n static initProps(props) {\n super.initProps(props);\n\n const group = extract(props, 'group');\n\n if (group) {\n props.icon = group.icon();\n props.style = { backgroundColor: group.color() };\n props.label = typeof props.label === 'undefined' ? group.nameSingular() : props.label;\n props.type = `group--${group.id()}`;\n }\n }\n}\n","import Button, { ButtonProps } from './Button';\n\ninterface LinkButtonProps extends ButtonProps {\n active?: boolean;\n oncreate?: Function;\n href?: string;\n}\n\n/**\n * The `LinkButton` component defines a `Button` which links to a route.\n *\n * ### Props\n *\n * All of the props accepted by `Button`, plus:\n *\n * - `active` Whether or not the page that this button links to is currently\n * active.\n * - `href` The URL to link to. If the current URL `m.route()` matches this,\n * the `active` prop will automatically be set to true.\n */\nexport default class LinkButton extends Button<LinkButtonProps> {\n static initProps(props: LinkButtonProps) {\n props.active = this.isActive(props);\n }\n\n view() {\n const vdom = super.view();\n\n vdom.tag = m.route.Link;\n vdom.attrs.active = String(vdom.attrs.active);\n\n return vdom;\n }\n\n /**\n * Determine whether a component with the given props is 'active'.\n */\n static isActive(props: LinkButtonProps): boolean {\n return typeof props.active !== 'undefined' ? props.active : m.route.get() === props.href;\n }\n}\n","import Component from '../Component';\nimport { Spinner, SpinnerOptions } from 'spin.js';\n\n/**\n * The `LoadingIndicator` component displays a loading spinner with spin.js. It\n * may have the following special props:\n *\n * - `size` The spin.js size preset to use. Defaults to 'small'.\n *\n * All other props will be assigned as attributes on the element.\n */\nexport default class LoadingIndicator extends Component {\n view(vnode) {\n const attrs = vnode.attrs;\n\n attrs.className = 'LoadingIndicator ' + (attrs.className || '');\n delete attrs.size;\n\n return <div {...attrs}>{m.trust(' ')}</div>;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const options: SpinnerOptions = { zIndex: 'auto', color: this.$().css('color') };\n let sizeOptions: SpinnerOptions = {};\n\n switch (vnode.attrs.size) {\n case 'large':\n sizeOptions = { lines: 10, length: 8, width: 4, radius: 8 };\n break;\n\n case 'tiny':\n sizeOptions = { lines: 8, length: 2, width: 2, radius: 3 };\n break;\n\n default:\n sizeOptions = { lines: 8, length: 4, width: 3, radius: 5 };\n }\n\n new Spinner({ ...options, ...sizeOptions }).spin(this.element);\n }\n}\n","import Mithril from 'mithril';\n\nimport Component, { ComponentProps } from '../Component';\nimport Button from './Button';\nimport RequestError from '../utils/RequestError';\n\n/**\n * The `Modal` component displays a modal dialog, wrapped in a form. Subclasses\n * should implement the `className`, `title`, and `content` methods.\n */\nexport default abstract class Modal<T extends ComponentProps = ComponentProps> extends Component<T> {\n /**\n * An alert component to show below the header.\n */\n alert: Mithril.Vnode;\n\n loading: boolean;\n\n view() {\n if (this.alert) {\n this.alert.attrs.dismissible = false;\n }\n\n return (\n <div className={`Modal modal-dialog ${this.className()}`}>\n <div className=\"Modal-content\">\n {this.isDismissible() ? (\n <div className=\"Modal-close App-backControl\">\n {Button.component({\n icon: 'fas fa-times',\n onclick: this.hide.bind(this),\n className: 'Button Button--icon Button--link',\n })}\n </div>\n ) : (\n ''\n )}\n\n <form onsubmit={this.onsubmit.bind(this)}>\n <div className=\"Modal-header\">\n <h3 className=\"App-titleControl App-titleControl--text\">{this.title()}</h3>\n </div>\n\n {this.alert && <div className=\"Modal-alert\">{this.alert}</div>}\n\n {this.content()}\n </form>\n </div>\n </div>\n );\n }\n\n /**\n * Determine whether or not the modal should be dismissible via an 'x' button.\n */\n isDismissible(): boolean {\n return true;\n }\n\n /**\n * Get the class name to apply to the modal.\n */\n abstract className(): string;\n\n /**\n * Get the title of the modal dialog.\n */\n abstract title(): string;\n\n /**\n * Get the content of the modal.\n */\n abstract content();\n\n /**\n * Handle the modal form's submit event.\n */\n onsubmit(e: Event) {}\n\n /**\n * Focus on the first input when the modal is ready to be used.\n */\n onready() {\n this.$('form')\n .find('input, select, textarea')\n .first()\n .focus()\n .select();\n }\n\n onhide() {}\n\n /**\n * Hide the modal.\n */\n hide() {\n app.modal.close();\n }\n\n /**\n * Stop loading.\n */\n loaded() {\n this.loading = false;\n m.redraw();\n }\n\n /**\n * Show an alert describing an error returned from the API, and give focus to\n * the first relevant field.\n */\n onerror(error: RequestError) {\n this.alert = error.alert;\n\n m.redraw();\n\n if (error.status === 422 && error.response.errors) {\n this.$(`form [name=\"${error.response.errors[0].source.pointer.replace('/data/attributes/', '')}\"]`).select();\n } else {\n this.onready();\n }\n }\n}\n","import MicroModal from 'micromodal';\n\nimport Component, { ComponentProps } from '../Component';\nimport { extend } from '../extend';\nimport Modal from './Modal';\n\n/**\n * The `ModalManager` component manages a modal dialog. Only one modal dialog\n * can be shown at once; loading a new component into the ModalManager will\n * overwrite the previous one.\n */\nexport default class ModalManager extends Component {\n showing!: boolean;\n hideTimeout!: number;\n\n modal: (new () => Modal) | null = null;\n modalProps: ComponentProps = {};\n\n component: Modal | null = null;\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.modal = this;\n }\n\n view() {\n return (\n <div className=\"ModalManager modal\" id=\"Modal\" onclick={this.onclick.bind(this)} key=\"modal\">\n {this.modal && m(this.modal, this.modalProps)}\n </div>\n );\n }\n\n /**\n * Show a modal dialog.\n */\n show(component: new () => Modal, props: ComponentProps = {}) {\n clearTimeout(this.hideTimeout);\n\n this.showing = true;\n this.modal = component;\n this.modalProps = props;\n this.component = null;\n\n // Store the vnode state in app.modal.component\n extend(this.modalProps, 'oninit', (v, vnode) => (this.component = vnode.state));\n\n // if (app.current) app.current.retain = true;\n\n m.redraw();\n\n if (!$('.modal-backdrop').length) {\n $('<div />')\n .addClass('modal-backdrop')\n .appendTo('body');\n }\n\n MicroModal.show('Modal', {\n awaitCloseAnimation: true,\n onClose: () => {\n const backdrop = $('.modal-backdrop');\n\n backdrop.fadeOut(200, () => {\n backdrop.remove();\n\n this.clear();\n });\n\n this.showing = false;\n },\n });\n\n this.$().one('animationend', () => this.onready());\n }\n\n onclick(e) {\n if (e.target === this.element) {\n this.close();\n }\n }\n\n /**\n * Close the modal dialog.\n */\n close() {\n if (!this.showing) return;\n\n // Don't hide the modal immediately, because if the consumer happens to call\n // the `show` method straight after to show another modal dialog, it will\n // cause the new modal dialog to disappear. Instead we will wait for a tiny\n // bit to give the `show` method the opportunity to prevent this from going\n // ahead.\n this.hideTimeout = setTimeout(() => MicroModal.close('Modal'));\n }\n\n /**\n * Clear content from the modal area.\n */\n protected clear() {\n if (this.component) {\n this.component.onhide();\n }\n\n this.modal = null;\n this.component = null;\n this.modalProps = {};\n\n // app.current.retain = false;\n\n m.redraw();\n }\n\n /**\n * When the modal dialog is ready to be used, tell it!\n */\n protected onready() {\n if (this.component) {\n this.component.onready();\n }\n }\n}\n","import Component, { ComponentProps } from '../Component';\n\nexport interface PlaceholderProps extends ComponentProps {\n text: string;\n}\n\n/**\n * The `Placeholder` component displays a muted text with some call to action,\n * usually used as an empty state.\n */\nexport default class Placeholder extends Component<PlaceholderProps> {\n view() {\n return (\n <div className=\"Placeholder\">\n <p>{this.props.text}</p>\n </div>\n );\n }\n}\n","import Modal from './Modal';\nimport { ComponentProps } from '../Component';\nimport RequestError from '../utils/RequestError';\n\nexport interface RequestErrorModalProps extends ComponentProps {\n error: RequestError;\n}\n\nexport default class RequestErrorModal<T extends RequestErrorModalProps = RequestErrorModalProps> extends Modal<T> {\n className(): string {\n return 'RequestErrorModal Modal--large';\n }\n\n title(): string {\n return this.props.error.xhr ? `${this.props.error.xhr.status} ${this.props.error.xhr.statusText}` : '';\n }\n\n content() {\n let responseText;\n\n try {\n responseText = JSON.stringify(JSON.parse(this.props.error.responseText), null, 2);\n } catch (e) {\n responseText = this.props.error.responseText;\n }\n\n return (\n <div className=\"Modal-body\">\n <pre>\n {this.props.error.options.method} {this.props.error.options.url}\n <br />\n <br />\n {responseText}\n </pre>\n </div>\n );\n }\n}\n","import Dropdown, { DropdownProps } from './Dropdown';\nimport icon from '../helpers/icon';\n\nexport interface SelectDropdownProps extends DropdownProps {\n defaultLabel?: string;\n}\n\n/**\n * The `SelectDropdown` component is the same as a `Dropdown`, except the toggle\n * button's label is set as the label of the first child which has a truthy\n * `active` prop.\n *\n * ### Props\n *\n * - `caretIcon`\n * - `defaultLabel`\n */\nexport default class SelectDropdown extends Dropdown<SelectDropdownProps> {\n static initProps(props: SelectDropdownProps) {\n props.caretIcon = typeof props.caretIcon !== 'undefined' ? props.caretIcon : 'fas fa-sort';\n\n super.initProps(props);\n\n props.className += ' Dropdown--select';\n }\n\n getButtonContent() {\n const activeChild = this.props.children.filter(child => child.attrs.active)[0];\n let label = (activeChild && activeChild.attrs.children) || this.props.defaultLabel;\n\n if (label instanceof Array) label = label[0];\n\n return [<span className=\"Button-label\">{label}</span>, icon(this.props.caretIcon, { className: 'Button-caret' })];\n }\n}\n","import Component from '../Component';\n\n/**\n * The `Separator` component defines a menu separator item.\n */\nexport default class Separator extends Component {\n static isListItem = true;\n\n view() {\n return <li className=\"Dropdown-separator\" />;\n }\n}\n","import Dropdown from './Dropdown';\nimport Button from './Button';\nimport icon from '../helpers/icon';\n\n/**\n * The `SplitDropdown` component is similar to `Dropdown`, but the first child\n * is displayed as its own button prior to the toggle button.\n */\nexport default class SplitDropdown extends Dropdown {\n static initProps(props) {\n super.initProps(props);\n\n props.className += ' Dropdown--split';\n props.menuClassName += ' Dropdown-menu--right';\n }\n\n getButton() {\n // Make a copy of the props of the first child component. We will assign\n // these props to a new button, so that it has exactly the same behaviour as\n // the first child.\n const firstChild = this.getFirstChild();\n const buttonProps = Object.assign({}, firstChild.attrs);\n buttonProps.className = classNames(buttonProps.className, 'SplitDropdown-button', 'Button', this.props.buttonClassName);\n\n return [\n Button.component(buttonProps),\n <button className={'Dropdown-toggle Button Button--icon ' + this.props.buttonClassName} data-toggle=\"dropdown\">\n {icon(this.props.icon, { className: 'Button-icon' })}\n {icon('fas fa-caret-down', { className: 'Button-caret' })}\n </button>,\n ];\n }\n\n /**\n * Get the first child. If the first child is an array, the first item in that\n * array will be returned.\n */\n protected getFirstChild() {\n let firstChild = this.props.children;\n\n while (firstChild instanceof Array) firstChild = firstChild[0];\n\n return firstChild;\n }\n}\n","import Checkbox from './Checkbox';\n\n/**\n * The `Switch` component is a `Checkbox`, but with a switch display instead of\n * a tick/cross one.\n */\nexport default class Switch extends Checkbox {\n static initProps(props) {\n super.initProps(props);\n\n props.className = `${props.className || ''} Checkbox--switch`;\n }\n\n getDisplay() {\n return this.loading ? super.getDisplay() : '';\n }\n}\n","/**\n * Extend an object's method by running its output through a mutating callback\n * every time it is called.\n *\n * The callback accepts the method's return value and should perform any\n * mutations directly on this value. For this reason, this function will not be\n * effective on methods which return scalar values (numbers, strings, booleans).\n *\n * Care should be taken to extend the correct object – in most cases, a class'\n * prototype will be the desired target of extension, not the class itself.\n *\n * @example\n * extend(Discussion.prototype, 'badges', function(badges) {\n * // do something with `badges`\n * });\n *\n * @param {Object} object The object that owns the method\n * @param {String} method The name of the method to extend\n * @param {function} callback A callback which mutates the method's output\n */\nexport function extend(object, method, callback) {\n const original = object[method];\n\n object[method] = (...args) => {\n // @ts-ignore\n const value = original ? original.apply(object, args) : undefined;\n\n // @ts-ignore\n callback.apply(object, [value].concat(args));\n\n return value;\n };\n\n Object.assign(object[method], original);\n}\n\n/**\n * Override an object's method by replacing it with a new function, so that the\n * new function will be run every time the object's method is called.\n *\n * The replacement function accepts the original method as its first argument,\n * which is like a call to 'super'. Any arguments passed to the original method\n * are also passed to the replacement.\n *\n * Care should be taken to extend the correct object – in most cases, a class'\n * prototype will be the desired target of extension, not the class itself.\n *\n * @example\n * override(Discussion.prototype, 'badges', function(original) {\n * const badges = original();\n * // do something with badges\n * return badges;\n * });\n *\n * @param {Object} object The object that owns the method\n * @param {String} method The name of the method to override\n * @param {function} newMethod The method to replace it with\n */\nexport function override(object, method, newMethod) {\n const original = object[method];\n\n object[method] = function(...args) {\n // @ts-ignore\n return newMethod.apply(this, [original.bind(this)].concat(args));\n };\n\n Object.assign(object[method], original);\n}\n","/**\n * The `avatar` helper displays a user's avatar.\n *\n * @param {User} user\n * @param {Object} attrs Attributes to apply to the avatar element\n * @return {Object}\n */\nexport default function avatar(user, attrs: any = {}) {\n attrs.className = 'Avatar ' + (attrs.className || '');\n let content = '';\n\n // If the `title` attribute is set to null or false, we don't want to give the\n // avatar a title. On the other hand, if it hasn't been given at all, we can\n // safely default it to the user's username.\n const hasTitle = attrs.title === 'undefined' || attrs.title;\n if (!hasTitle) delete attrs.title;\n\n // If a user has been passed, then we will set up an avatar using their\n // uploaded image, or the first letter of their username if they haven't\n // uploaded one.\n if (user) {\n const username = user.displayName() || '?';\n const avatarUrl = user.avatarUrl();\n\n if (hasTitle) attrs.title = attrs.title || username;\n\n if (avatarUrl) {\n return <img {...attrs} src={avatarUrl} />;\n }\n\n content = username.charAt(0).toUpperCase();\n attrs.style = { background: user.color() };\n }\n\n return <span {...attrs}>{content}</span>;\n}\n","/**\n * The `fullTime` helper displays a formatted time string wrapped in a <time>\n * tag.\n */\nexport default function fullTime(time: Date) {\n const mo = dayjs(time);\n\n const datetime = mo.format();\n const full = mo.format('LLLL');\n\n return (\n <time pubdate datetime={datetime}>\n {full}\n </time>\n );\n}\n","import { truncate } from '../utils/string';\n\n/**\n * The `highlight` helper searches for a word phrase in a string, and wraps\n * matches with the <mark> tag.\n *\n * @param {String} string The string to highlight.\n * @param {String|RegExp} phrase The word or words to highlight.\n * @param {Integer} [length] The number of characters to truncate the string to.\n * The string will be truncated surrounding the first match.\n */\nexport default function highlight(string: string, phrase: string | RegExp, length?: number): any {\n if (!phrase && !length) return string;\n\n // Convert the word phrase into a global regular expression (if it isn't\n // already) so we can search the string for matched.\n const regexp = phrase instanceof RegExp ? phrase : new RegExp(phrase, 'gi');\n\n let highlighted = string;\n let start = 0;\n\n // If a length was given, the truncate the string surrounding the first match.\n if (length) {\n if (phrase) start = Math.max(0, string.search(regexp) - length / 2);\n\n highlighted = truncate(highlighted, length, start);\n }\n\n // Convert the string into HTML entities, then highlight all matches with\n // <mark> tags. Then we will return the result as a trusted HTML string.\n highlighted = $('<div/>')\n .text(highlighted)\n .html();\n\n if (phrase) highlighted = highlighted.replace(regexp, '<mark>$&</mark>');\n\n return m.trust(highlighted);\n}\n","import humanTimeUtil from '../utils/humanTime';\n\n/**\n * The `humanTime` helper displays a time in a human-friendly time-ago format\n * (e.g. '12 days ago'), wrapped in a <time> tag with other information about\n * the time.\n */\nexport default function humanTime(time: Date) {\n const mo = dayjs(time);\n\n const datetime = mo.format();\n const full = mo.format('LLLL');\n const ago = humanTimeUtil(time);\n\n return (\n <time pubdate datetime={datetime} title={full} data-humantime>\n {ago}\n </time>\n );\n}\n","/**\n * The `icon` helper displays an icon.\n *\n * @param {String} fontClass The full icon class, prefix and the icon’s name.\n * @param {Object} attrs Any other attributes to apply.\n */\nexport default function icon(fontClass: string, attrs: any = {}) {\n attrs.className = 'icon ' + fontClass + ' ' + (attrs.className || '');\n\n return <i {...attrs} />;\n}\n","import Separator from '../components/Separator';\n\nexport function isSeparator(item) {\n return item?.tag === Separator;\n}\n\nexport function withoutUnnecessarySeparators(items) {\n const newItems = [];\n let prevItem;\n\n items.forEach((item, i) => {\n if (!isSeparator(item) || (prevItem && !isSeparator(prevItem) && i !== items.length - 1)) {\n prevItem = item;\n newItems.push(item);\n }\n });\n\n return newItems;\n}\n\n/**\n * The `listItems` helper wraps a collection of components in <li> tags,\n * stripping out any unnecessary `Separator` components.\n *\n * @param {*} items\n * @return {Array}\n */\nexport default function listItems(items) {\n if (!(items instanceof Array)) items = [items];\n\n return withoutUnnecessarySeparators(items).map(item => {\n const isListItem = item.tag?.isListItem;\n const active = item.tag?.isActive && item.tag.isActive(item.attrs);\n const className = item.attrs?.itemClassName || item.itemClassName;\n\n if (isListItem) {\n item.attrs = item.attrs || {};\n item.attrs.key = item.attrs.key || item.itemName;\n item.key = item.attrs.key;\n }\n\n const node = isListItem ? (\n item\n ) : (\n <li\n className={classNames(className, item.itemName && `item-${item.itemName}`, active && 'active')}\n key={item.attrs?.key || item.itemName}\n >\n {item}\n </li>\n );\n\n node.state = node.state || {};\n\n return node;\n });\n}\n","import icon from './icon';\nimport User from '../models/User';\n\n/**\n * The `useronline` helper displays a green circle if the user is online\n *\n * @param {User} user\n * @return {Object}\n */\nexport default function userOnline(user: User) {\n if (user.lastSeenAt() && user.isOnline()) {\n return <span className=\"UserOnline\">{icon('fas fa-circle')}</span>;\n }\n}\n","/**\n * The `username` helper displays a user's username in a <span class=\"username\">\n * tag. If the user doesn't exist, the username will be displayed as [deleted].\n *\n * @param {User} user\n */\nexport default function username(user): any {\n const name = (user && user.displayName()) || app.translator.trans('core.lib.username.deleted_text');\n\n return <span className=\"username\">{name}</span>;\n}\n","import 'expose-loader?jQuery!zepto';\nimport 'expose-loader?moment!expose-loader?dayjs!dayjs';\nimport 'expose-loader?m!mithril';\nimport 'expose-loader?m.bidi!m.attrs.bidi';\nimport 'expose-loader?Mousetrap!mousetrap';\nimport 'expose-loader?classNames!classNames';\n\nimport 'zepto/src/selector';\nimport 'zepto/src/data';\nimport 'zepto/src/fx';\nimport 'zepto/src/fx_methods';\n\nimport './utils/patchZepto';\n\nimport 'hc-sticky';\nimport 'bootstrap/js/dropdown';\nimport 'bootstrap/js/transition';\n\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\n\ndayjs.extend(relativeTime);\ndayjs.extend(localizedFormat);\n\nimport patchMithril from './utils/patchMithril';\n\npatchMithril();\n\n// import * as Extend from './extend/index';\n\n// export { Extend };\n","import Model from '../Model';\nimport computed from '../utils/computed';\nimport ItemList from '../utils/ItemList';\nimport Badge from '../components/Badge';\n\nimport User from './User';\nimport Post from './Post';\n\nexport default class Discussion extends Model {\n title = Model.attribute('title') as () => string;\n slug = Model.attribute('slug') as () => string;\n\n createdAt = Model.attribute('createdAt', Model.transformDate) as () => Date;\n user = Model.hasOne('user') as () => User;\n firstPost = Model.hasOne('firstPost') as () => Post;\n\n lastPostedAt = Model.attribute('lastPostedAt', Model.transformDate) as () => Date;\n lastPostedUser = Model.hasOne('lastPostedUser') as () => User;\n lastPost = Model.hasOne('lastPost') as () => Post;\n lastPostNumber = Model.attribute('lastPostNumber') as () => number;\n\n commentCount = Model.attribute('commentCount') as () => number;\n replyCount = computed('commentCount', commentCount => Math.max(0, commentCount - 1)) as () => number;\n posts = Model.hasMany('posts') as () => Post[];\n mostRelevantPost = Model.hasOne('mostRelevantPost') as () => Post;\n\n lastReadAt = Model.attribute('lastReadAt', Model.transformDate) as () => Date;\n lastReadPostNumber = Model.attribute('lastReadPostNumber') as () => number;\n isUnread = computed('unreadCount', unreadCount => !!unreadCount) as () => boolean;\n isRead = computed('unreadCount', unreadCount => app.session.user && !unreadCount) as () => boolean;\n\n hiddenAt = Model.attribute('hiddenAt', Model.transformDate) as () => Date;\n hiddenUser = Model.hasOne('hiddenUser') as () => User;\n isHidden = computed('hiddenAt', hiddenAt => !!hiddenAt) as () => boolean;\n\n canReply = Model.attribute('canReply') as () => boolean;\n canRename = Model.attribute('canRename') as () => boolean;\n canHide = Model.attribute('canHide') as () => boolean;\n canDelete = Model.attribute('canDelete') as () => boolean;\n\n /**\n * Remove a post from the discussion's posts relationship.\n *\n * @param id The ID of the post to remove.\n */\n removePost(id: number) {\n const relationships = this.data.relationships;\n const posts = relationships && relationships.posts;\n\n if (posts) {\n posts.data.some((data, i) => {\n if (id === data.id) {\n posts.data.splice(i, 1);\n return true;\n }\n });\n }\n }\n\n /**\n * Get the estimated number of unread posts in this discussion for the current\n * user.\n */\n unreadCount(): number {\n const user = app.session.user;\n\n if (user && user.markedAllAsReadAt() < this.lastPostedAt()) {\n return Math.max(0, this.lastPostNumber() - (this.lastReadPostNumber() || 0));\n }\n\n return 0;\n }\n\n /**\n * Get the Badge components that apply to this discussion.\n */\n badges(): ItemList {\n const items = new ItemList();\n\n if (this.isHidden()) {\n items.add('hidden', <Badge type=\"hidden\" icon=\"fas fa-trash\" label={app.translator.transText('core.lib.badge.hidden_tooltip')} />);\n }\n\n return items;\n }\n\n /**\n * Get a list of all of the post IDs in this discussion.\n */\n postIds(): string[] {\n const posts = this.data.relationships.posts;\n\n return posts ? posts.data.map(link => link.id) : [];\n }\n}\n","import Model from '../Model';\n\nexport default class Forum extends Model {\n apiEndpoint() {\n return '/';\n }\n}\n","import Model from '../Model';\n\nexport default class Group extends Model {\n static ADMINISTRATOR_ID = '1';\n static GUEST_ID = '2';\n static MEMBER_ID = '3';\n\n nameSingular = Model.attribute('nameSingular') as () => string;\n namePlural = Model.attribute('namePlural') as () => string;\n color = Model.attribute('color') as () => string;\n icon = Model.attribute('icon') as () => string;\n}\n","import Model from '../Model';\nimport User from './User';\n\nexport default class Notification extends Model {\n static ADMINISTRATOR_ID = '1';\n static GUEST_ID = '2';\n static MEMBER_ID = '3';\n\n contentType = Model.attribute('contentType') as () => string;\n content = Model.attribute('content') as () => string;\n createdAt = Model.attribute('createdAt', Model.transformDate) as () => Date;\n\n isRead = Model.attribute('isRead') as () => boolean;\n\n user = Model.hasOne('user') as () => User;\n fromUser = Model.hasOne('fromUser') as () => User;\n subject = Model.hasOne('subhect') as () => any;\n}\n","import Model from '../Model';\nimport computed from '../utils/computed';\nimport { getPlainContent } from '../utils/string';\n\nimport Discussion from './Discussion';\nimport User from './User';\n\nexport default class Post extends Model {\n number = Model.attribute('number') as () => number;\n discussion = Model.hasOne('discussion') as () => Discussion;\n\n createdAt = Model.attribute('createdAt', Model.transformDate) as () => Date;\n user = Model.hasOne('user') as () => User;\n contentType = Model.attribute('contentType') as () => string;\n content = Model.attribute('content') as () => string;\n contentHtml = Model.attribute('contentHtml') as () => string;\n contentPlain = computed('contentHtml', getPlainContent) as () => string;\n\n editedAt = Model.attribute('editedAt', Model.transformDate) as () => Date;\n editedUser = Model.hasOne('editedUser') as () => User;\n isEdited = computed('editedAt', editedAt => !!editedAt) as () => boolean;\n\n hiddenAt = Model.attribute('hiddenAt', Model.transformDate) as () => Date;\n hiddenUser = Model.hasOne('hiddenUser') as () => User;\n isHidden = computed('hiddenAt', hiddenAt => !!hiddenAt) as () => boolean;\n\n canEdit = Model.attribute('canEdit') as () => boolean;\n canHide = Model.attribute('canHide') as () => boolean;\n canDelete = Model.attribute('canDelete') as () => boolean;\n}\n","import Model from '../Model';\nimport stringToColor from '../utils/stringToColor';\nimport ItemList from '../utils/ItemList';\nimport computed from '../utils/computed';\nimport GroupBadge from '../components/GroupBadge';\nimport Group from './Group';\n\nexport interface UserPreferences {\n discloseOnline?: boolean;\n indexProfile?: boolean;\n locale?: string;\n\n [key: string]: any;\n}\n\nexport default class User extends Model {\n username = Model.attribute('username') as () => string;\n\n displayName = Model.attribute('displayName') as () => string;\n email = Model.attribute('email') as () => string;\n isEmailConfirmed = Model.attribute('isEmailConfirmed') as () => boolean;\n password = Model.attribute('password') as () => string;\n\n avatarUrl = Model.attribute('avatarUrl') as () => string;\n preferences = Model.attribute('preferences') as () => UserPreferences;\n groups = Model.hasMany('groups') as () => Group[];\n\n joinTime = Model.attribute('joinTime', Model.transformDate) as () => Date;\n lastSeenAt = Model.attribute('lastSeenAt', Model.transformDate) as () => Date;\n markedAllAsReadAt = Model.attribute('markedAllAsReadAt', Model.transformDate) as () => Date;\n unreadNotificationCount = Model.attribute('unreadNotificationCount') as () => number;\n newNotificationCount = Model.attribute('newNotificationCount') as () => number;\n\n discussionCount = Model.attribute('discussionCount') as () => number;\n commentCount = Model.attribute('commentCount') as () => number;\n\n canEdit = Model.attribute('canEdit') as () => boolean;\n canDelete = Model.attribute('canDelete') as () => boolean;\n\n avatarColor = null;\n color = computed(['username', 'avatarUrl', 'avatarColor'], function(username, avatarUrl, avatarColor) {\n // If we've already calculated and cached the dominant color of the user's\n // avatar, then we can return that in RGB format. If we haven't, we'll want\n // to calculate it. Unless the user doesn't have an avatar, in which case\n // we generate a color from their username.\n if (avatarColor) {\n return 'rgb(' + avatarColor.join(', ') + ')';\n } else if (avatarUrl) {\n this.calculateAvatarColor();\n return '';\n }\n\n return '#' + stringToColor(username);\n }) as () => string;\n\n isOnline(): boolean {\n return (\n this.lastSeenAt() >\n dayjs()\n .subtract(5, 'minutes')\n .toDate()\n );\n }\n\n /**\n * Get the Badge components that apply to this user.\n */\n badges(): ItemList {\n const items = new ItemList();\n const groups = this.groups();\n\n if (groups) {\n groups.forEach(group => {\n items.add('group' + group.id(), GroupBadge.component({ group }));\n });\n }\n\n return items;\n }\n\n /**\n * Calculate the dominant color of the user's avatar. The dominant color will\n * be set to the `avatarColor` property once it has been calculated.\n *\n * @protected\n */\n calculateAvatarColor() {\n const image = new Image();\n const user = this;\n\n image.onload = function() {\n const colorThief = new ColorThief();\n user.avatarColor = colorThief.getColor(this);\n user.freshness = new Date();\n m.redraw();\n };\n image.crossOrigin = 'anonymous';\n image.src = this.avatarUrl();\n }\n\n /**\n * Update the user's preferences.\n */\n savePreferences(newPreferences: UserPreferences): Promise<User> {\n const preferences = this.preferences();\n\n Object.assign(preferences, newPreferences);\n\n return <Promise<User>>this.save({ preferences });\n }\n}\n","/**\n * The `Drawer` class controls the page's drawer. The drawer is the area the\n * slides out from the left on mobile devices; it contains the header and the\n * footer.\n */\nexport default class Drawer {\n private $backdrop?: ZeptoCollection;\n\n constructor() {\n // Set up an event handler so that whenever the content area is tapped,\n // the drawer will close.\n $('#content').click(e => {\n if (this.isOpen()) {\n e.preventDefault();\n this.hide();\n }\n });\n }\n\n /**\n * Check whether or not the drawer is currently open.\n */\n isOpen(): boolean {\n return $('#app').hasClass('drawerOpen');\n }\n\n /**\n * Hide the drawer.\n */\n hide() {\n $('#app').removeClass('drawerOpen');\n\n if (this.$backdrop) this.$backdrop.remove();\n }\n\n /**\n * Show the drawer.\n *\n * @public\n */\n show() {\n $('#app').addClass('drawerOpen');\n\n this.$backdrop = $('<div/>')\n .addClass('drawer-backdrop fade')\n .appendTo('body')\n .click(() => this.hide());\n\n setTimeout(() => this.$backdrop.addClass('in'));\n }\n}\n","class Item<T> {\n content: T;\n priority: number;\n key: number = 0;\n\n constructor(content: any, priority: number) {\n this.content = content;\n this.priority = priority;\n }\n}\n\nexport default class ItemList<T = any> {\n private items: { [key: string]: Item<T> } = {};\n\n /**\n * Check whether the list is empty.\n *\n * @returns {boolean}\n * @public\n */\n isEmpty(): boolean {\n for (const i in this.items) {\n if (this.items.hasOwnProperty(i)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Check whether an item is present in the list.\n */\n has(key: any): boolean {\n return !!this.items[key];\n }\n\n /**\n * Get the content of an item.\n */\n get(key: any): T {\n return this.items[key]?.content;\n }\n\n /**\n * Add an item to the list.\n *\n * @param {String} key A unique key for the item.\n * @param {*} content The item's content.\n * @param {Integer} [priority] The priority of the item. Items with a higher\n * priority will be positioned before items with a lower priority.\n * @return {ItemList}\n * @public\n */\n add(key: any, content: T, priority = 0) {\n this.items[key] = new Item(content, priority);\n\n return this;\n }\n\n toArray(): T[] {\n const items: Item<T>[] = [];\n\n for (const i in this.items) {\n if (this.items.hasOwnProperty(i)) {\n if (this.items[i] !== null && this.items[i] instanceof Item) {\n this.items[i].content = Object(this.items[i].content);\n\n // @ts-ignore\n this.items[i].content.itemName = i;\n items.push(this.items[i]);\n this.items[i].key = items.length;\n }\n }\n }\n\n return items\n .sort((a, b) => {\n if (a.priority === b.priority) {\n return a.key - b.key;\n } else if (a.priority > b.priority) {\n return -1;\n }\n return 1;\n })\n .map(item => item.content);\n }\n}\n","import Mithril from 'mithril';\n\nexport interface RequestErrorResponse extends JSON {\n errors?: {\n code: string;\n source?: {\n pointer: string;\n };\n }[];\n}\n\nexport default class RequestError {\n status: number;\n responseText: string;\n options: Mithril.RequestOptions;\n xhr: XMLHttpRequest;\n response?: RequestErrorResponse;\n alert?: Mithril.Vnode;\n\n constructor(status, responseText, options, xhr) {\n this.status = status;\n this.responseText = responseText;\n this.options = options;\n this.xhr = xhr;\n\n try {\n this.response = JSON.parse(responseText);\n } catch (e) {\n this.response = null;\n }\n\n this.alert = null;\n }\n}\n","const later =\n window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n (callback => window.setTimeout(callback, 1000 / 60));\n\n/**\n * The `ScrollListener` class sets up a listener that handles window scroll\n * events.\n */\nexport default class ScrollListener {\n ticking: boolean = false;\n\n callback: Function;\n active: EventListener;\n\n /**\n * @param callback The callback to run when the scroll position\n * changes.\n */\n public constructor(callback: Function) {\n this.callback = callback;\n }\n\n /**\n * On each animation frame, as long as the listener is active, run the\n * `update` method.\n */\n protected loop() {\n // THROTTLE: If the callback is still running (or hasn't yet run), we ignore\n // further scroll events.\n if (this.ticking) return;\n\n // Schedule the callback to be executed soon (TM), and stop throttling once\n // the callback is done.\n later(() => {\n this.update();\n this.ticking = false;\n });\n\n this.ticking = true;\n }\n\n /**\n * Run the callback, whether there was a scroll event or not.\n */\n public update() {\n this.callback(window.pageYOffset);\n }\n\n /**\n * Start listening to and handling the window's scroll position.\n */\n public start() {\n if (!this.active) {\n window.addEventListener('scroll', (this.active = this.loop.bind(this)));\n }\n }\n\n /**\n * Stop listening to and handling the window's scroll position.\n */\n public stop() {\n window.removeEventListener('scroll', this.active);\n\n this.active = null;\n }\n}\n","export default class SubtreeRetainer {\n callbacks: Function[];\n data = {};\n\n constructor(...callbacks: Function[]) {\n this.callbacks = callbacks;\n }\n\n check(...callbacks: Function[]) {\n this.callbacks.push(...callbacks);\n }\n\n /**\n * Return whether the component should redraw.\n */\n update(): boolean {\n let update = false;\n\n this.callbacks.forEach((callback, i) => {\n const result = callback();\n\n if (result !== this.data[i]) {\n this.data[i] = result;\n update = true;\n }\n });\n\n return update;\n }\n}\n","/**\n * The `abbreviateNumber` utility converts a number to a shorter localized form.\n *\n * @example\n * abbreviateNumber(1234);\n * // \"1.2K\"\n */\nexport default (number: number): string => {\n // TODO: translation\n if (number >= 1000000) {\n return Math.floor(number / 1000000) + app.translator.transText('core.lib.number_suffix.mega_text');\n } else if (number >= 1000) {\n return Math.floor(number / 1000) + app.translator.transText('core.lib.number_suffix.kilo_text');\n } else {\n return number.toString();\n }\n};\n","/**\n * The `anchorScroll` utility saves the scroll position relative to an element,\n * and then restores it after a callback has been run.\n *\n * This is useful if a redraw will change the page's content above the viewport.\n * Normally doing this will result in the content in the viewport being pushed\n * down or pulled up. By wrapping the redraw with this utility, the scroll\n * position can be anchor to an element that is in or below the viewport, so\n * the content in the viewport will stay the same.\n *\n * @param element The element to anchor the scroll position to.\n * @param callback The callback to run that will change page content.\n */\nexport default function anchorScroll(element: Element, callback: Function) {\n const $window = $(window);\n const $el = $(element);\n\n if (!element || !$el.length) {\n return callback();\n }\n\n const relativeScroll = $el.offset().top - $window.scrollTop();\n\n callback();\n\n $window.scrollTop($el.offset().top - relativeScroll);\n}\n","/**\n * The `computed` utility creates a function that will cache its output until\n * any of the dependent values are dirty.\n *\n * @param dependentKeys The keys of the dependent values.\n * @param compute The function which computes the value using the\n * dependent values.\n */\nexport default function computed(dependentKeys: string | string[], compute: Function): () => any {\n const keys = [].concat(dependentKeys);\n\n const dependentValues = {};\n let computedValue;\n\n return function() {\n let recompute = false;\n\n // Read all of the dependent values. If any of them have changed since last\n // time, then we'll want to recompute our output.\n keys.forEach(key => {\n const value = typeof this[key] === 'function' ? this[key]() : this[key];\n\n if (dependentValues[key] !== value) {\n recompute = true;\n dependentValues[key] = value;\n }\n });\n\n if (recompute) {\n computedValue = compute.apply(\n this,\n keys.map(key => dependentValues[key])\n );\n }\n\n return computedValue;\n };\n}\n","export type EventHandler = (...args: any) => any;\n\nexport default class Evented {\n /**\n * Arrays of registered event handlers, grouped by the event name.\n */\n protected handlers: { [key: string]: EventHandler[] } = {};\n\n /**\n * Get all of the registered handlers for an event.\n *\n * @param event The name of the event.\n */\n protected getHandlers(event: string): EventHandler[] {\n this.handlers = this.handlers || {};\n\n this.handlers[event] = this.handlers[event] || [];\n\n return this.handlers[event];\n }\n\n /**\n * Trigger an event.\n *\n * @param event The name of the event.\n * @param args Arguments to pass to event handlers.\n */\n public trigger(event: string, ...args: any): this {\n this.getHandlers(event).forEach(handler => handler.apply(this, args));\n\n return this;\n }\n\n /**\n * Register an event handler.\n *\n * @param event The name of the event.\n * @param handler The function to handle the event.\n */\n on(event: string, handler: EventHandler): this {\n this.getHandlers(event).push(handler);\n\n return this;\n }\n\n /**\n * Register an event handler so that it will run only once, and then\n * unregister itself.\n *\n * @param event The name of the event.\n * @param handler The function to handle the event.\n */\n one(event: string, handler: EventHandler): this {\n const wrapper = function(this: Evented) {\n handler.apply(this, Array.from(arguments));\n\n this.off(event, wrapper);\n };\n\n this.getHandlers(event).push(wrapper);\n\n return this;\n }\n\n /**\n * Unregister an event handler.\n *\n * @param event The name of the event.\n * @param handler The function that handles the event.\n */\n off(event: string, handler: EventHandler): this {\n const handlers = this.getHandlers(event);\n const index = handlers.indexOf(handler);\n\n if (index !== -1) {\n handlers.splice(index, 1);\n }\n\n return this;\n }\n}\n","/**\n * The `extract` utility deletes a property from an object and returns its\n * value.\n */\nexport default function extract(object: object, property: string): any {\n const value = object[property];\n\n delete object[property];\n\n return value;\n}\n","/**\n * Extract the text nodes from a virtual element.\n *\n * @param {VirtualElement} vdom\n * @return {String}\n */\nexport default function extractText(vdom: any): string {\n if (vdom instanceof Array) {\n return vdom.map(element => extractText(element)).join('');\n } else if (typeof vdom === 'object' && vdom !== null) {\n return vdom.text || extractText(vdom.children);\n } else {\n return vdom;\n }\n}\n","/**\n * The `formatNumber` utility localizes a number into a string with the\n * appropriate punctuation.\n *\n * @param number Number to format\n * @param options Maximum significant digits or formatting options object\n *\n * @example\n * formatNumber(1234);\n * // 1,234\n */\nexport default function formatNumber(number: number, options: number | Intl.NumberFormatOptions = {}): string {\n const config = typeof options === 'number' ? { maximumSignificantDigits: options } : options;\n\n return number.toLocaleString(app.translator.locale, config);\n}\n","/**\n * The `humanTime` utility converts a date to a localized, human-readable time-\n * ago string.\n */\nexport default function humanTime(time: Date): string {\n let m = dayjs(time);\n const now = dayjs();\n\n // To prevent showing things like \"in a few seconds\" due to small offsets\n // between client and server time, we always reset future dates to the\n // current time. This will result in \"just now\" being shown instead.\n if (m.isAfter(now)) {\n m = now;\n }\n\n const day = 864e5;\n const diff = m.diff(dayjs());\n let ago = null;\n\n // If this date was more than a month ago, we'll show the name of the month\n // in the string. If it wasn't this year, we'll show the year as well.\n if (diff < -30 * day) {\n if (m.year() === dayjs().year()) {\n ago = m.format('D MMM');\n } else {\n ago = m.format(\"MMM 'YY\");\n }\n } else {\n ago = m.fromNow();\n }\n\n return ago;\n}\n","import { RouteDefs } from 'mithril';\n\n/**\n * The `mapRoutes` utility converts a map of named application routes into a\n * format that can be understood by Mithril.\n *\n * @see https://lhorie.github.io/mithril/mithril.route.html#defining-routes\n */\nexport default function mapRoutes(routes: object, basePath: string = ''): RouteDefs {\n const map = {};\n\n for (const key in routes) {\n const route = routes[key];\n\n if (route.component) {\n if (!route.component.attrs) route.component.attrs = {};\n route.component.attrs.routeName = key;\n }\n\n map[basePath + route.path] = route.component;\n }\n\n return map;\n}\n","import m from 'mithril';\nimport prop from 'mithril/stream';\n\nimport Component from '../Component';\n\nexport default () => {\n const mo = window['m'];\n\n const _m = function(comp, ...args) {\n if (!arguments[1]) arguments[1] = {};\n\n if (comp.prototype && comp.prototype instanceof Component) {\n // allow writing to children attribute\n Object.defineProperty(arguments[1], 'children', {\n writable: true,\n });\n }\n\n const node = mo.apply(this, arguments);\n\n if (!node.attrs) node.attrs = {};\n\n if (node.attrs.bidi) {\n m.bidi(node, node.attrs.bidi);\n }\n\n if (node.attrs.route) {\n node.attrs.href = node.attrs.route;\n node.attrs.tag = m.route.Link;\n\n delete node.attrs.route;\n }\n\n return node;\n };\n\n Object.keys(mo).forEach(key => (_m[key] = mo[key]));\n\n _m.withAttr = (key: string, cb: Function) =>\n function() {\n cb(this.getAttribute(key) || this[key]);\n };\n\n _m.prop = prop;\n\n window['m'] = _m;\n};\n","import jump from 'jump.js';\nimport Tooltip from 'tooltip.js';\n\n// add $.fn.tooltip\n$.fn.tooltip = function(option) {\n return this.each(function() {\n const $this = $(this);\n let data = $this.data('bs.tooltip');\n const options = (typeof option === 'object' && option) || {};\n\n if ($this.attr('title')) {\n options.title = $this.attr('title');\n $this.removeAttr('title');\n $this.attr('data-original-title', options.title);\n }\n\n if (option === 'destroy') option = 'dispose';\n\n if (!data && ['dispose', 'hide'].includes(option)) return;\n\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)));\n if (typeof option === 'string' && data[option]) data[option]();\n });\n};\n\n// add $.fn.outerWidth and $.fn.outerHeight\n['width', 'height'].forEach(function(dimension) {\n const Dimension = dimension.replace(/./, function(m) {\n return m[0].toUpperCase();\n });\n\n $.fn[`outer${Dimension}`] = function(margin) {\n const elem = this;\n\n if (elem) {\n const sides = { width: ['left', 'right'], height: ['top', 'bottom'] };\n let size = elem[dimension]();\n\n sides[dimension].forEach(function(side) {\n if (margin) size += parseInt(elem.css('margin-' + side), 10);\n });\n\n return size;\n } else {\n return null;\n }\n };\n});\n\n// allow use of $(':input')\n// @ts-ignore\n$.expr[':']['input'] = function() {\n if ('disabled' in this || ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.tagName)) return this;\n};\n\n// add $().hover() method\n$.fn.hover = function(hover, leave) {\n return this.on('mouseenter', hover).on('mouseleave', leave || hover);\n};\n\n// add animated scroll\n$.fn.animatedScrollTop = function(to, duration = $.fx.speeds._default, callback) {\n if (typeof to === 'number') to -= window.scrollY || window.pageYOffset;\n\n jump(to, {\n duration: $.fx.speeds[duration] || duration,\n callback,\n });\n\n return this;\n};\n\n// add basic $().slideUp() function\n$.fn.slideUp = function(duration = $.fx.speeds._default, easing?, callback?) {\n this.css({ overflow: 'hidden', height: this.height() });\n\n this.animate(\n {\n height: 0,\n },\n duration,\n easing,\n callback\n );\n\n return this;\n};\n\n// required for compatibility with jquery plugins\n// ex: bootstrap plugins\n$.fn.extend = $.extend.bind($);\n\n/**\n * Enable special events on Zepto\n * @license Original Copyright 2013 Enideo. Released under dual MIT and GPL licenses.\n */\n// @ts-ignore\n$.event.special = $.event.special || {};\n\nconst bindBeforeSpecialEvents = $.fn.bind;\n\n$.fn.bind = function(eventName, data, callback) {\n const el = this;\n\n if (!callback) {\n callback = data;\n data = null;\n }\n\n $.each(eventName.split(/\\s/), (key: string, value: any): boolean => {\n value = value.split(/\\./)[0];\n\n if (value in $.event.special) {\n let specialEvent = $.event.special[value];\n\n /// init enable special events on Zepto\n if (!specialEvent._init) {\n specialEvent._init = true;\n\n /// intercept and replace the special event handler to add functionality\n specialEvent.originalHandler = specialEvent.handler;\n specialEvent.handler = function() {\n /// make event argument writable, like on jQuery\n const args = Array.prototype.slice.call(arguments);\n\n args[0] = $.extend({}, args[0]);\n\n /// define the event handle, $.event.dispatch is only for newer versions of jQuery\n $.event.handle = function() {\n /// make context of trigger the event element\n const args = Array.prototype.slice.call(arguments);\n const event = args[0];\n const $target = $(event.target);\n\n $target.trigger.apply($target, arguments);\n };\n\n specialEvent.originalHandler.apply(this, args);\n };\n }\n\n /// setup special events on Zepto\n specialEvent.setup.apply(el, [data]);\n }\n\n return true;\n });\n\n return bindBeforeSpecialEvents.apply(this, [eventName, callback]);\n};\n","/**\n * Truncate a string to the given length, appending ellipses if necessary.\n */\nexport function truncate(string: string, length: number, start = 0): string {\n return (start > 0 ? '...' : '') + string.substring(start, start + length) + (string.length > start + length ? '...' : '');\n}\n\n/**\n * Create a slug out of the given string. Non-alphanumeric characters are\n * converted to hyphens.\n */\nexport function slug(string: string): string {\n return string\n .toLowerCase()\n .replace(/[^a-z0-9]/gi, '-')\n .replace(/-+/g, '-')\n .replace(/-$|^-/g, '');\n}\n\n/**\n * Strip HTML tags and quotes out of the given string, replacing them with\n * meaningful punctuation.\n */\nexport function getPlainContent(string: string): string {\n const html = string.replace(/(<\\/p>|<br>)/g, '$1 ').replace(/<img\\b[^>]*>/gi, ' ');\n\n const dom = $('<div/>').html(html);\n\n dom.find(getPlainContent.removeSelectors.join(',')).remove();\n\n return dom\n .text()\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * An array of DOM selectors to remove when getting plain content.\n *\n * @type {String[]}\n */\ngetPlainContent.removeSelectors = ['blockquote', 'script'];\n\n/**\n * Make a string's first character uppercase.\n */\nexport function ucfirst(string: string): string {\n return string.substr(0, 1).toUpperCase() + string.substr(1);\n}\n","export function hsvToRgb(h: number, s: number, v: number) {\n let r;\n let g;\n let b;\n\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n\n return {\n r: Math.floor(r * 255),\n g: Math.floor(g * 255),\n b: Math.floor(b * 255),\n };\n}\n\n/**\n * Convert the given string to a unique color.\n */\nexport default function stringToColor(string: string): string {\n let num = 0;\n\n // Convert the username into a number based on the ASCII value of each\n // character.\n for (let i = 0; i < string.length; i++) {\n num += string.charCodeAt(i);\n }\n\n // Construct a color using the remainder of that number divided by 360, and\n // some predefined saturation and value values.\n const hue = num % 360;\n const rgb = hsvToRgb(hue / 360, 0.3, 0.9);\n\n return '' + rgb.r.toString(16) + rgb.g.toString(16) + rgb.b.toString(16);\n}\n","import Application from '../common/Application';\nimport History from './utils/History';\n\nimport HeaderPrimary from './components/HeaderPrimary';\nimport HeaderSecondary from './components/HeaderSecondary';\nimport Page from './components/Page';\nimport DiscussionList from './components/DiscussionList';\nimport CommentPost from './components/CommentPost';\n\nimport Notification from '../common/models/Notification';\n\nimport routes from './routes';\n\nexport default class Forum extends Application {\n /**\n * The app's history stack, which keeps track of which routes the user visits\n * so that they can easily navigate back to the previous route.\n */\n history: History = new History();\n\n /**\n * {@inheritdoc}\n */\n cache: {\n notifications?: Notification[][];\n discussionList?: DiscussionList | null;\n [key: string]: any;\n } = {};\n\n postComponents = {\n comment: CommentPost,\n // discussionRenamed: DiscussionRenamedPost\n };\n\n previous: Page;\n current: Page;\n\n constructor() {\n super();\n\n routes(this);\n }\n\n mount() {\n // Get the configured default route and update that route's path to be '/'.\n // Push the homepage as the first route, so that the user will always be\n // able to click on the 'back' button to go home, regardless of which page\n // they started on.\n const defaultRoute = this.forum.attribute('defaultRoute');\n let defaultAction = 'index';\n\n for (const i in this.routes) {\n if (this.routes[i].path === defaultRoute) defaultAction = i;\n }\n\n this.routes[defaultAction].path = '/';\n this.history.push(defaultAction, this.translator.transText('core.forum.header.back_to_index_tooltip'), '/');\n\n // m.mount(document.getElementById('app-navigation'), Navigation.component({className: 'App-backControl', drawer: true}));\n // m.mount(document.getElementById('header-navigation'), Navigation.component());\n m.mount(document.getElementById('header-primary'), new HeaderPrimary());\n m.mount(document.getElementById('header-secondary'), new HeaderSecondary());\n\n // this.pane = new Pane(document.getElementById('app'));\n // this.composer = m.mount(document.getElementById('composer'), Composer.component());\n\n m.route.prefix = '';\n super.mount(this.forum.attribute('basePath'));\n\n // alertEmailConfirmation(this);\n\n // Route the home link back home when clicked. We do not want it to register\n // if the user is opening it in a new tab, however.\n $('#home-link').click((e: MouseEvent) => {\n if (e.ctrlKey || e.metaKey || e.which === 2) return;\n e.preventDefault();\n app.history.home();\n\n // Reload the current user so that their unread notification count is refreshed.\n if (app.session.user) {\n app.store.find('users', app.session.user.id());\n m.redraw();\n }\n });\n }\n}\n","import compat from '../common/compat';\n\nimport Forum from './Forum';\n\nimport IndexPage from './components/IndexPage';\n\nexport default Object.assign(compat, {\n 'components/IndexPage': IndexPage,\n Forum: Forum,\n}) as any;\n","import Component, { ComponentProps } from '../../common/Component';\nimport avatar from '../../common/helpers/avatar';\nimport icon from '../../common/helpers/icon';\nimport listItems from '../../common/helpers/listItems';\nimport ItemList from '../../common/utils/ItemList';\nimport Button from '../../common/components/Button';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport User from '../../common/models/User';\n\nexport interface AvatarEditorProps extends ComponentProps {\n user: User;\n}\n\n/**\n * The `AvatarEditor` component displays a user's avatar along with a dropdown\n * menu which allows the user to upload/remove the avatar.\n */\nexport default class AvatarEditor extends Component<AvatarEditorProps> {\n /**\n * Whether or not an avatar upload is in progress.\n */\n loading = false;\n\n /**\n * Whether or not an image has been dragged over the dropzone.\n */\n isDraggedOver = false;\n\n static initProps(props) {\n super.initProps(props);\n\n props.className = props.className || '';\n }\n\n view() {\n const user = this.props.user;\n\n return (\n <div\n className={\n 'AvatarEditor Dropdown ' + this.props.className + (this.loading ? ' loading' : '') + (this.isDraggedOver ? ' dragover' : '')\n }\n >\n {avatar(user)}\n <a\n className={user.avatarUrl() ? 'Dropdown-toggle' : 'Dropdown-toggle AvatarEditor--noAvatar'}\n title={app.translator.trans('core.forum.user.avatar_upload_tooltip')}\n data-toggle=\"dropdown\"\n onclick={this.quickUpload.bind(this)}\n ondragover={this.enableDragover.bind(this)}\n ondragenter={this.enableDragover.bind(this)}\n ondragleave={this.disableDragover.bind(this)}\n ondragend={this.disableDragover.bind(this)}\n ondrop={this.dropUpload.bind(this)}\n >\n {this.loading ? LoadingIndicator.component() : user.avatarUrl() ? icon('fas fa-pencil-alt') : icon('fas fa-plus-circle')}\n </a>\n <ul className=\"Dropdown-menu Menu\">{listItems(this.controlItems().toArray())}</ul>\n </div>\n );\n }\n\n /**\n * Get the items in the edit avatar dropdown menu.\n */\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'upload',\n Button.component({\n icon: 'fas fa-upload',\n children: app.translator.trans('core.forum.user.avatar_upload_button'),\n onclick: this.openPicker.bind(this),\n })\n );\n\n items.add(\n 'remove',\n Button.component({\n icon: 'fas fa-times',\n children: app.translator.trans('core.forum.user.avatar_remove_button'),\n onclick: this.remove.bind(this),\n })\n );\n\n return items;\n }\n\n /**\n * Enable dragover style\n */\n enableDragover(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n this.isDraggedOver = true;\n }\n\n /**\n * Disable dragover style\n */\n disableDragover(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n this.isDraggedOver = false;\n }\n\n /**\n * Upload avatar when file is dropped into dropzone.\n *\n * @param {Event} e\n */\n dropUpload(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n this.isDraggedOver = false;\n this.upload(e.dataTransfer.files[0]);\n }\n\n /**\n * If the user doesn't have an avatar, there's no point in showing the\n * controls dropdown, because only one option would be viable: uploading.\n * Thus, when the avatar editor's dropdown toggle button is clicked, we prompt\n * the user to upload an avatar immediately.\n */\n quickUpload(e: Event) {\n if (!this.props.user.avatarUrl()) {\n e.preventDefault();\n e.stopPropagation();\n this.openPicker();\n }\n }\n\n /**\n * Upload avatar using file picker\n */\n openPicker() {\n if (this.loading) return;\n\n // Create a hidden HTML input element and click on it so the user can select\n // an avatar file. Once they have, we will upload it via the API.\n const user = this.props.user;\n const $input = $('<input type=\"file\">');\n\n $input\n .appendTo('body')\n .hide()\n .click()\n .on('change', e => {\n this.upload($(e.target)[0].files[0]);\n });\n }\n\n /**\n * Upload avatar\n */\n upload(file: File) {\n if (this.loading) return;\n\n const user = this.props.user;\n const body = new FormData();\n body.append('avatar', file);\n\n this.loading = true;\n m.redraw();\n\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/users/${user.id()}/avatar`,\n serialize: raw => raw,\n body,\n }).then(this.success.bind(this), this.failure.bind(this));\n }\n\n /**\n * Remove the user's avatar.\n */\n remove() {\n const user = this.props.user;\n\n this.loading = true;\n m.redraw();\n\n app.request({\n method: 'DELETE',\n url: `${app.forum.attribute('apiUrl')}/users/${user.id()}/avatar`,\n }).then(this.success.bind(this), this.failure.bind(this));\n }\n\n /**\n * After a successful upload/removal, push the updated user data into the\n * store, and force a recomputation of the user's avatar color.\n */\n protected success(response: any) {\n app.store.pushPayload(response);\n delete this.props.user.avatarColor;\n\n this.loading = false;\n m.redraw();\n }\n\n /**\n * If avatar upload/removal fails, stop loading.\n */\n protected failure(response: any) {\n this.loading = false;\n m.redraw();\n }\n}\n","import Modal from '../../common/components/Modal';\nimport Button from '../../common/components/Button';\n\n/**\n * The `ChangeEmailModal` component shows a modal dialog which allows the user\n * to change their email address.\n */\nexport default class ChangeEmailModal extends Modal {\n /**\n * Whether or not the email has been changed successfully.\n */\n success = false;\n\n /**\n * The value of the email input.\n */\n email = m.prop(app.session.user.email());\n\n /**\n * The value of the password input.\n */\n password = m.prop('');\n\n className() {\n return 'ChangeEmailModal Modal--small';\n }\n\n title() {\n return app.translator.transText('core.forum.change_email.title');\n }\n\n content() {\n if (this.success) {\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <p className=\"helpText\">\n {app.translator.trans('core.forum.change_email.confirmation_message', { email: <strong>{this.email()}</strong> })}\n </p>\n <div className=\"Form-group\">\n <Button className=\"Button Button--primary Button--block\" onclick={this.hide.bind(this)}>\n {app.translator.trans('core.forum.change_email.dismiss_button')}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <div className=\"Form-group\">\n <input\n type=\"email\"\n name=\"email\"\n className=\"FormControl\"\n placeholder={app.session.user.email()}\n bidi={this.email}\n disabled={this.loading}\n />\n </div>\n <div className=\"Form-group\">\n <input\n type=\"password\"\n name=\"password\"\n className=\"FormControl\"\n placeholder={app.translator.transText('core.forum.change_email.confirm_password_placeholder')}\n bidi={this.password}\n disabled={this.loading}\n />\n </div>\n <div className=\"Form-group\">\n {Button.component({\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.loading,\n children: app.translator.trans('core.forum.change_email.submit_button'),\n })}\n </div>\n </div>\n </div>\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n // If the user hasn't actually entered a different email address, we don't\n // need to do anything. Woot!\n if (this.email() === app.session.user.email()) {\n this.hide();\n return;\n }\n\n this.loading = true;\n\n app.session.user\n .save(\n { email: this.email() },\n {\n errorHandler: this.onerror.bind(this),\n meta: { password: this.password() },\n }\n )\n .then(() => (this.success = true))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n onerror(error) {\n if (error.status === 401) {\n error.alert.children = app.translator.trans('core.forum.change_email.incorrect_password_message');\n }\n\n super.onerror(error);\n }\n}\n","import Modal from '../../common/components/Modal';\nimport Button from '../../common/components/Button';\n\n/**\n * The `ChangePasswordModal` component shows a modal dialog which allows the\n * user to send themself a password reset email.\n */\nexport default class ChangePasswordModal extends Modal {\n className() {\n return 'ChangePasswordModal Modal--small';\n }\n\n title() {\n return app.translator.transText('core.forum.change_password.title');\n }\n\n content() {\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <p className=\"helpText\">{app.translator.trans('core.forum.change_password.text')}</p>\n <div className=\"Form-group\">\n {Button.component({\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.loading,\n children: app.translator.trans('core.forum.change_password.send_button'),\n })}\n </div>\n </div>\n </div>\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/forgot',\n body: { email: app.session.user.email() },\n }).then(this.hide.bind(this), this.loaded.bind(this));\n }\n}\n","import Post from './Post';\nimport PostUser from './PostUser';\nimport PostMeta from './PostMeta';\nimport PostEdited from './PostEdited';\n// import EditPostComposer from './EditPostComposer';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\nimport Button from '../../common/components/Button';\nimport { Vnode } from 'mithril';\n\n/**\n * The `CommentPost` component displays a standard `comment`-typed post. This\n * includes a number of item lists (controls, header, and footer) surrounding\n * the post's HTML content.\n */\nexport default class CommentPost extends Post {\n /**\n * If the post has been hidden, then this flag determines whether or not its\n * content has been expanded.\n */\n revealContent: boolean = false;\n\n postUser!: Vnode<{}, PostUser>;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n // Create an instance of the component that displays the post's author so\n // that we can force the post to rerender when the user card is shown.\n this.postUser = <PostUser post={this.props.post} />;\n\n this.subtree.check(\n () => this.postUser.state?.cardVisible,\n () => this.revealContent,\n () => this.isEditing()\n );\n }\n\n content() {\n return super.content().concat([\n <header className=\"Post-header\">\n <ul>{listItems(this.headerItems().toArray())}</ul>\n </header>,\n <div className=\"Post-body\">\n {this.isEditing() ? <div className=\"Post-preview\" config={this.configPreview.bind(this)} /> : m.trust(this.props.post.contentHtml())}\n </div>,\n ]);\n }\n\n onupdate(vnode) {\n super.onupdate(vnode);\n\n const contentHtml = this.isEditing() ? '' : this.props.post.contentHtml();\n\n // TODO: idk what this is supposed to be\n\n // If the post content has changed since the last render, we'll run through\n // all of the <script> tags in the content and evaluate them. This is\n // necessary because TextFormatter outputs them for e.g. syntax highlighting.\n if (vnode.contentHtml !== contentHtml) {\n this.$('.Post-body script').each(function() {\n eval.call(window, $(this).text());\n });\n }\n\n vnode.contentHtml = contentHtml;\n }\n\n isEditing() {\n return false; // TODO\n // return app.composer?.component instanceof EditPostComposer &&\n // app.composer.component.props.post === this.props.post;\n }\n\n attrs() {\n const post = this.props.post;\n const attrs = super.attrs();\n\n attrs.className = classNames(\n attrs.className,\n 'CommentPost',\n post.isHidden() && 'Post--hidden',\n post.isEdited() && 'Post--edited',\n this.revealContent && 'revealContent',\n this.isEditing() && 'editing'\n );\n\n return attrs;\n }\n\n // TODO change so it works\n configPreview(element, isInitialized, context) {\n if (isInitialized) return;\n\n // Every 50ms, if the composer content has changed, then update the post's\n // body with a preview.\n let preview;\n const updatePreview = () => {\n const content = app.composer.component.content();\n\n if (preview === content) return;\n\n preview = content;\n\n s9e.TextFormatter.preview(preview || '', element);\n };\n updatePreview();\n\n const updateInterval = setInterval(updatePreview, 50);\n context.onunload = () => clearInterval(updateInterval);\n }\n\n /**\n * Toggle the visibility of a hidden post's content.\n */\n toggleContent() {\n this.revealContent = !this.revealContent;\n }\n\n /**\n * Build an item list for the post's header.\n */\n headerItems(): ItemList {\n const items = new ItemList();\n const post = this.props.post;\n const props = { post };\n\n items.add('user', <PostUser post={this.props.post} />, 100);\n items.add('meta', <PostMeta {...props} />);\n\n if (post.isEdited() && !post.isHidden()) {\n items.add('edited', <PostEdited {...props} />);\n }\n\n // If the post is hidden, add a button that allows toggling the visibility\n // of the post's content.\n if (post.isHidden()) {\n items.add(\n 'toggle',\n Button.component({\n className: 'Button Button--default Button--more',\n icon: 'fas fa-ellipsis-h',\n onclick: this.toggleContent.bind(this),\n })\n );\n }\n\n return items;\n }\n}\n","import Component from '../../common/Component';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\nimport { DiscussionProp } from '../../common/concerns/ComponentProps';\n\n/**\n * The `DiscussionHero` component displays the hero on a discussion page.\n */\nexport default class DiscussionHero<T extends DiscussionProp = DiscussionProp> extends Component<T> {\n view() {\n return (\n <header className=\"Hero DiscussionHero\">\n <div className=\"container\">\n <ul className=\"DiscussionHero-items\">{listItems(this.items().toArray())}</ul>\n </div>\n </header>\n );\n }\n\n /**\n * Build an item list for the contents of the discussion hero.\n *\n * @return {ItemList}\n */\n items() {\n const items = new ItemList();\n const discussion = this.props.discussion;\n const badges = discussion.badges().toArray();\n\n if (badges.length) {\n items.add('badges', <ul className=\"DiscussionHero-badges badges\">{listItems(badges)}</ul>, 10);\n }\n\n items.add('title', <h2 className=\"DiscussionHero-title\">{discussion.title()}</h2>);\n\n return items;\n }\n}\n","import Component, { ComponentProps } from '../../common/Component';\nimport DiscussionListItem from './DiscussionListItem';\nimport Button from '../../common/components/Button';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport Placeholder from '../../common/components/Placeholder';\nimport Discussion from '../../common/models/Discussion';\n\nexport interface DiscussionListProps extends ComponentProps {\n /**\n * A map of parameters used to construct a refined parameter object\n * to send along in the API request to get discussion results.\n */\n params: any;\n}\n\n/**\n * The `DiscussionList` component displays a list of discussions.\n */\nexport default class DiscussionList<T extends DiscussionListProps = DiscussionListProps> extends Component<T> {\n /**\n * Whether or not discussion results are loading.\n */\n loading = true;\n\n /**\n * Whether or not there are more results that can be loaded.\n */\n moreResults = false;\n\n /**\n * The discussions in the discussion list.\n */\n discussions: Discussion[] = [];\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.refresh();\n }\n\n view() {\n const params = this.props.params;\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component();\n } else if (this.moreResults) {\n loading = Button.component({\n children: app.translator.trans('core.forum.discussion_list.load_more_button'),\n className: 'Button',\n onclick: this.loadMore.bind(this),\n });\n }\n\n if (this.discussions.length === 0 && !this.loading) {\n const text = app.translator.trans('core.forum.discussion_list.empty_text');\n return <div className=\"DiscussionList\">{Placeholder.component({ text })}</div>;\n }\n\n return (\n <div className={'DiscussionList' + (this.props.params.q ? ' DiscussionList--searchResults' : '')}>\n <ul className=\"DiscussionList-discussions\">\n {this.discussions.map(discussion => {\n return (\n <li key={discussion.id()} data-id={discussion.id()}>\n {DiscussionListItem.component({ discussion, params })}\n </li>\n );\n })}\n </ul>\n <div className=\"DiscussionList-loadMore\">{loading}</div>\n </div>\n );\n }\n\n /**\n * Get the parameters that should be passed in the API request to get\n * discussion results.\n *\n * @api\n */\n requestParams(): any {\n const params = { include: ['user', 'lastPostedUser'], filter: {} };\n\n params.sort = this.sortMap()[this.props.params.sort];\n\n if (this.props.params.q) {\n params.filter.q = this.props.params.q;\n\n params.include.push('mostRelevantPost', 'mostRelevantPost.user');\n }\n\n return params;\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.props.params.q) {\n map.relevance = '';\n }\n map.latest = '-lastPostedAt';\n map.top = '-commentCount';\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * Clear and reload the discussion list.\n */\n public refresh(clear = true) {\n if (clear) {\n this.loading = true;\n this.discussions = [];\n }\n\n return this.loadResults().then(\n results => {\n this.discussions = [];\n this.parseResults(results);\n },\n () => {\n this.loading = false;\n m.redraw();\n }\n );\n }\n\n /**\n * Load a new page of discussion results.\n *\n * @param offset The index to start the page at.\n */\n loadResults(offset?: number): Promise<Discussion[]> {\n const preloadedDiscussions = app.preloadedApiDocument();\n\n if (preloadedDiscussions) {\n return Promise.resolve(preloadedDiscussions);\n }\n\n const params = this.requestParams();\n params.page = { offset };\n params.include = params.include.join(',');\n\n return app.store.find('discussions', params);\n }\n\n /**\n * Load the next page of discussion results.\n */\n public loadMore() {\n this.loading = true;\n\n this.loadResults(this.discussions.length).then(this.parseResults.bind(this));\n }\n\n /**\n * Parse results and append them to the discussion list.\n */\n parseResults(results: Discussion[]): Discussion[] {\n [].push.apply(this.discussions, results);\n\n this.loading = false;\n this.moreResults = !!results.payload.links.next;\n\n m.redraw();\n\n return results;\n }\n\n /**\n * Remove a discussion from the list if it is present.\n */\n public removeDiscussion(discussion: Discussion) {\n const index = this.discussions.indexOf(discussion);\n\n if (index !== -1) {\n this.discussions.splice(index, 1);\n }\n }\n\n /**\n * Add a discussion to the top of the list.\n */\n public addDiscussion(discussion: Discussion) {\n this.discussions.unshift(discussion);\n }\n}\n","import Component from '../../common/Component';\nimport avatar from '../../common/helpers/avatar';\nimport listItems from '../../common/helpers/listItems';\nimport highlight from '../../common/helpers/highlight';\nimport icon from '../../common/helpers/icon';\nimport humanTime from '../../common/utils/humanTime';\nimport ItemList from '../../common/utils/ItemList';\nimport Dropdown from '../../common/components/Dropdown';\nimport SubtreeRetainer from '../../common/utils/SubtreeRetainer';\nimport LinkButton from '../../common/components/LinkButton';\nimport abbreviateNumber from '../../common/utils/abbreviateNumber';\nimport TerminalPost from './TerminalPost';\nimport DiscussionControls from '../utils/DiscussionControls';\nimport { DiscussionProp } from '../../common/concerns/ComponentProps';\n\nexport interface DiscussionListItemProps extends DiscussionProp {\n params: any;\n}\n\n/**\n * The `DiscussionListItem` component shows a single discussion in the\n * discussion list.\n */\nexport default class DiscussionListItem<T extends DiscussionListItemProps = DiscussionListItemProps> extends Component<T> {\n /**\n * Set up a subtree retainer so that the discussion will not be redrawn\n * unless new data comes in.\n */\n subtree: SubtreeRetainer;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.subtree = new SubtreeRetainer(\n () => this.props.discussion.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n attrs() {\n return {\n className: classNames('DiscussionListItem', this.active() && 'active', this.props.discussion.isHidden() && 'DiscussionListItem--hidden'),\n };\n }\n\n view() {\n const discussion = this.props.discussion;\n const user = discussion.user();\n const isUnread = discussion.isUnread();\n const isRead = discussion.isRead();\n const showUnread = !this.showRepliesCount() && isUnread;\n let jumpTo = 0;\n const controls = DiscussionControls.controls(discussion, this).toArray();\n const attrs = this.attrs();\n\n if (this.props.params.q) {\n const post = discussion.mostRelevantPost();\n if (post) {\n jumpTo = post.number();\n }\n\n const phrase = this.props.params.q;\n this.highlightRegExp = new RegExp(phrase + '|' + phrase.trim().replace(/\\s+/g, '|'), 'gi');\n } else {\n jumpTo = Math.min(discussion.lastPostNumber(), (discussion.lastReadPostNumber() || 0) + 1);\n }\n\n return (\n <div {...attrs}>\n {controls.length\n ? Dropdown.component({\n icon: 'fas fa-ellipsis-v',\n children: controls,\n className: 'DiscussionListItem-controls',\n buttonClassName: 'Button Button--icon Button--flat Slidable-underneath Slidable-underneath--right',\n })\n : ''}\n\n <a\n className={'Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic' + (isUnread ? '' : ' disabled')}\n onclick={this.markAsRead.bind(this)}\n >\n {icon('fas fa-check')}\n </a>\n\n <div className={classNames('DiscussionListItem-content', 'Slidable-content', isUnread && 'unread', isRead && 'read')}>\n <LinkButton\n href={user ? app.route.user(user) : '#'}\n className=\"DiscussionListItem-author\"\n title={app.translator.transText('core.forum.discussion_list.started_text', {\n user: user,\n ago: humanTime(discussion.createdAt()),\n })}\n oncreate={vnode => $(vnode.dom).tooltip({ placement: 'right' })}\n >\n {avatar(user, { title: '' })}\n </LinkButton>\n\n <ul className=\"DiscussionListItem-badges badges\">{listItems(discussion.badges().toArray())}</ul>\n\n <LinkButton href={app.route.discussion(discussion, jumpTo)} className=\"DiscussionListItem-main\">\n <h3 className=\"DiscussionListItem-title\">{highlight(discussion.title(), this.highlightRegExp)}</h3>\n <ul className=\"DiscussionListItem-info\">{listItems(this.infoItems().toArray())}</ul>\n </LinkButton>\n\n <span\n className=\"DiscussionListItem-count\"\n onclick={this.markAsRead.bind(this)}\n title={showUnread ? app.translator.trans('core.forum.discussion_list.mark_as_read_tooltip') : ''}\n >\n {abbreviateNumber(discussion[showUnread ? 'unreadCount' : 'replyCount']())}\n </span>\n </div>\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.$().addClass('Slidable'));\n\n this.$('.DiscussionListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.update();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active(): boolean {\n const idParam = m.route.param('id');\n\n return !!idParam && idParam.split('-')[0] === this.props.discussion.id();\n }\n\n /**\n * Determine whether or not information about who started the discussion\n * should be displayed instead of information about the most recent reply to\n * the discussion.\n */\n showFirstPost(): boolean {\n return ['newest', 'oldest'].indexOf(this.props.params.sort) !== -1;\n }\n\n /**\n * Determine whether or not the number of replies should be shown instead of\n * the number of unread posts.\n */\n showRepliesCount(): boolean {\n return this.props.params.sort === 'replies';\n }\n\n /**\n * Mark the discussion as read.\n */\n markAsRead() {\n const discussion = this.props.discussion;\n\n if (discussion.isUnread()) {\n discussion.save({ lastReadPostNumber: discussion.lastPostNumber() });\n m.redraw();\n }\n }\n\n /**\n * Build an item list of info for a discussion listing. By default this is\n * just the first/last post indicator.\n */\n infoItems(): ItemList {\n const items = new ItemList();\n\n if (this.props.params.q) {\n const post = this.props.discussion.mostRelevantPost() || this.props.discussion.firstPost();\n\n if (post && post.contentType() === 'comment') {\n const excerpt = highlight(post.contentPlain(), this.highlightRegExp, 175);\n items.add('excerpt', excerpt, -100);\n }\n } else {\n items.add(\n 'terminalPost',\n TerminalPost.component({\n discussion: this.props.discussion,\n lastPost: !this.showFirstPost(),\n })\n );\n }\n\n return items;\n }\n}\n","import Page from './Page';\nimport ItemList from '../../common/utils/ItemList';\nimport DiscussionHero from './DiscussionHero';\nimport PostStream from './PostStream';\nimport PostStreamScrubber from './PostStreamScrubber';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport SplitDropdown from '../../common/components/SplitDropdown';\nimport listItems from '../../common/helpers/listItems';\nimport DiscussionControls from '../utils/DiscussionControls';\nimport Discussion from '../../common/models/Discussion';\nimport Post from '../../common/models/Post';\n\n/**\n * The `DiscussionPage` component displays a whole discussion page, including\n * the discussion list pane, the hero, the posts, and the sidebar.\n */\nexport default class DiscussionPage extends Page {\n /**\n * The discussion that is being viewed.\n */\n discussion?: Discussion;\n\n /**\n * The number of the first post that is currently visible in the viewport.\n */\n near?: number;\n\n stream!: PostStream;\n scrubber!: PostStreamScrubber;\n\n includedPosts: Post[] = [];\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.refresh();\n\n // If the discussion list has been loaded, then we'll enable the pane (and\n // hide it by default). Also, if we've just come from another discussion\n // page, then we don't want Mithril to redraw the whole page – if it did,\n // then the pane would which would be slow and would cause problems with\n // event handlers.\n if (app.cache.discussionList) {\n // TODO app pane\n // app.pane.enable();\n // app.pane.hide();\n }\n\n app.history.push('discussion');\n\n this.bodyClass = 'App--discussion';\n }\n\n onbeforeremove(vnode) {\n super.onbeforeremove(vnode);\n\n // If we have routed to the same discussion as we were viewing previously,\n // cancel the unloading of this controller and instead prompt the post\n // stream to jump to the new 'near' param.\n if (this.discussion) {\n const idParam = m.route.param('id');\n\n if (idParam && idParam.split('-')[0] === this.discussion.id()) {\n const near = m.route.param('near') || '1';\n\n if (near !== String(this.near)) {\n this.stream.goToNumber(near);\n }\n\n this.near = null;\n\n return false;\n }\n }\n\n // If we are indeed navigating away from this discussion, then disable the\n // discussion list pane. Also, if we're composing a reply to this\n // discussion, minimize the composer – unless it's empty, in which case\n // we'll just close it.\n // TODO pane & composer\n // app.pane.disable();\n\n // if (app.composingReplyTo(this.discussion) && !app.composer.component.content()) {\n // app.composer.hide();\n // } else {\n // app.composer.minimize();\n // }\n }\n\n view() {\n const discussion = this.discussion;\n\n // Set up the post stream for this discussion, along with the first page of\n // posts we want to display. Tell the stream to scroll down and highlight\n // the specific post that was routed to.\n const postStream = (\n <PostStream\n discussion={discussion}\n includedPosts={this.includedPosts}\n oninit={vnode => {\n this.stream = vnode.state;\n this.scrubber.stream = vnode.state;\n\n this.stream.on('positionChanged', this.positionChanged.bind(this));\n this.stream.goToNumber(m.route.param('near') || (this.includedPosts[0] && this.includedPosts[0].number()), true);\n }}\n />\n );\n\n return (\n <div className=\"DiscussionPage\">\n {app.cache.discussionList ? (\n <div className=\"DiscussionPage-list\" oncreate={this.oncreatePane.bind(this)} onbeforeupdate={() => false}>\n {!$('.App-navigation').is(':visible') ? app.cache.discussionList.render() : ''}\n </div>\n ) : (\n ''\n )}\n\n <div className=\"DiscussionPage-discussion\">\n {discussion\n ? [\n DiscussionHero.component({ discussion }),\n <div className=\"container\">\n <nav className=\"DiscussionPage-nav\">\n <ul>{listItems(this.sidebarItems().toArray())}</ul>\n </nav>\n <div className=\"DiscussionPage-stream\">{postStream}</div>\n </div>,\n ]\n : LoadingIndicator.component({ className: 'LoadingIndicator--block' })}\n </div>\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n if (this.discussion) {\n app.setTitle(this.discussion.title());\n }\n }\n\n /**\n * Clear and reload the discussion.\n */\n refresh() {\n this.near = Number(m.route.param('near') || 0);\n this.discussion = null;\n\n const preloadedDiscussion = app.preloadedApiDocument();\n if (preloadedDiscussion) {\n // We must wrap this in a setTimeout because if we are mounting this\n // component for the first time on page load, then any calls to m.redraw\n // will be ineffective and thus any configs (scroll code) will be run\n // before stuff is drawn to the page.\n setTimeout(this.show.bind(this, preloadedDiscussion), 0);\n } else {\n const params = this.requestParams();\n\n app.store.find('discussions', m.route.param('id').split('-')[0], params).then(this.show.bind(this));\n }\n\n m.redraw();\n }\n\n /**\n * Get the parameters that should be passed in the API request to get the\n * discussion.\n */\n requestParams(): any {\n return {\n page: { near: this.near },\n };\n }\n\n /**\n * Initialize the component to display the given discussion.\n */\n show(discussion: Discussion) {\n this.discussion = discussion;\n\n app.history.push('discussion', discussion.title());\n app.setTitleCount(0);\n\n // When the API responds with a discussion, it will also include a number of\n // posts. Some of these posts are included because they are on the first\n // page of posts we want to display (determined by the `near` parameter) –\n // others may be included because due to other relationships introduced by\n // extensions. We need to distinguish the two so we don't end up displaying\n // the wrong posts. We do so by filtering out the posts that don't have\n // the 'discussion' relationship linked, then sorting and splicing.\n if (discussion.payload && discussion.payload.included) {\n const discussionId = discussion.id();\n\n this.includedPosts = discussion.payload.included\n .filter(\n record =>\n record.type === 'posts' &&\n record.relationships &&\n record.relationships.discussion &&\n record.relationships.discussion.data.id === discussionId\n )\n .map(record => app.store.getById('posts', record.id))\n .sort((a, b) => a.id() - b.id())\n .slice(0, 20);\n }\n\n m.redraw();\n }\n\n /**\n * Configure the discussion list pane.\n */\n oncreatePane(vnode) {\n const $list = $(vnode.dom);\n\n // When the mouse enters and leaves the discussions pane, we want to show\n // and hide the pane respectively. We also create a 10px 'hot edge' on the\n // left of the screen to activate the pane.\n const pane = app.pane;\n $list.hover(pane.show.bind(pane), pane.onmouseleave.bind(pane));\n\n const hotEdge = e => {\n if (e.pageX < 10) pane.show();\n };\n $(document).on('mousemove', hotEdge);\n vnode.dom.onunload = () => $(document).off('mousemove', hotEdge);\n\n // If the discussion we are viewing is listed in the discussion list, then\n // we will make sure it is visible in the viewport – if it is not we will\n // scroll the list down to it.\n const $discussion = $list.find('.DiscussionListItem.active');\n if ($discussion.length) {\n const listTop = $list.offset().top;\n const listBottom = listTop + $list.outerHeight();\n const discussionTop = $discussion.offset().top;\n const discussionBottom = discussionTop + $discussion.outerHeight();\n\n if (discussionTop < listTop || discussionBottom > listBottom) {\n $list.scrollTop($list.scrollTop() - listTop + discussionTop);\n }\n }\n }\n\n /**\n * Build an item list for the contents of the sidebar.\n */\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'controls',\n SplitDropdown.component({\n children: DiscussionControls.controls(this.discussion, this).toArray(),\n icon: 'fas fa-ellipsis-v',\n className: 'App-primaryControl',\n buttonClassName: 'Button--primary',\n })\n );\n\n items.add('scrubber', <PostStreamScrubber oninit={vnode => (this.scrubber = vnode.state)} className=\"App-titleControl\" />, -100);\n\n return items;\n }\n\n /**\n * When the posts that are visible in the post stream change (i.e. the user\n * scrolls up or down), then we update the URL and mark the posts as read.\n */\n positionChanged(startNumber: number, endNumber: number) {\n const discussion = this.discussion;\n\n if (!discussion) return;\n\n // Construct a URL to this discussion with the updated position, then\n // replace it into the window's history and our own history stack.\n const url = app.route.discussion(discussion, (this.near = startNumber));\n\n m.route.set(url, true, { replace: true });\n\n app.history.push('discussion', discussion.title());\n\n // If the user hasn't read past here before, then we'll update their read\n // state and redraw.\n if (app.session.user && endNumber > (discussion.lastReadPostNumber() || 0)) {\n discussion.save({ lastReadPostNumber: endNumber });\n m.redraw();\n }\n }\n}\n","import highlight from '../../common/helpers/highlight';\nimport LinkButton from '../../common/components/LinkButton';\nimport SearchSource from './SearchSource';\nimport Discussion from '../../common/models/Discussion';\n\n/**\n * The `DiscussionsSearchSource` finds and displays discussion search results in\n * the search dropdown.\n */\nexport default class DiscussionsSearchSource extends SearchSource {\n protected results: { [key: string]: Discussion[] } = {};\n\n search(query: string) {\n query = query.toLowerCase();\n\n this.results[query] = [];\n\n const params = {\n filter: { q: query },\n page: { limit: 3 },\n include: 'mostRelevantPost',\n };\n\n return app.store.find<Discussion>('discussions', params).then(results => (this.results[query] = results));\n }\n\n view(query: string) {\n query = query.toLowerCase();\n\n const results = this.results[query] || [];\n\n return [\n <li className=\"Dropdown-header\">{app.translator.trans('core.forum.search.discussions_heading')}</li>,\n <li>\n {LinkButton.component({\n icon: 'fas fa-search',\n children: app.translator.trans('core.forum.search.all_discussions_button', { query }),\n href: app.route('index', { q: query }),\n })}\n </li>,\n results.map(discussion => {\n const mostRelevantPost = discussion.mostRelevantPost();\n\n return (\n <li className=\"DiscussionSearchResult\" data-index={'discussions' + discussion.id()}>\n <m.route.Link href={app.route.discussion(discussion, mostRelevantPost && mostRelevantPost.number())}>\n <div className=\"DiscussionSearchResult-title\">{highlight(discussion.title(), query)}</div>\n {mostRelevantPost ? (\n <div className=\"DiscussionSearchResult-excerpt\">{highlight(mostRelevantPost.contentPlain(), query, 100)}</div>\n ) : (\n ''\n )}\n </m.route.Link>\n </li>\n );\n }),\n ];\n }\n}\n","import UserPage from './UserPage';\nimport DiscussionList from './DiscussionList';\n\n/**\n * The `DiscussionsUserPage` component shows a discussion list inside of a user\n * page.\n */\nexport default class DiscussionsUserPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n <div className=\"DiscussionsUserPage\">\n {DiscussionList.component({\n params: {\n q: `author:${this.user.username()}`,\n sort: 'newest',\n },\n })}\n </div>\n );\n }\n}\n","import Component from '../../common/Component';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\n\n/**\n * The `HeaderPrimary` component displays primary header controls. On the\n * default skin, these are shown just to the right of the forum title.\n */\nexport default class HeaderPrimary extends Component {\n view() {\n return <ul className=\"Header-controls\">{listItems(this.items().toArray())}</ul>;\n }\n\n /**\n * Build an item list for the controls.\n */\n items(): ItemList {\n return new ItemList();\n }\n}\n","import { Vnode } from 'mithril';\n\nimport Component from '../../common/Component';\nimport Button from '../../common/components/Button';\nimport LogInModal from './LogInModal';\nimport SignUpModal from './SignUpModal';\nimport SessionDropdown from './SessionDropdown';\nimport SelectDropdown from '../../common/components/SelectDropdown';\nimport NotificationsDropdown from './NotificationsDropdown';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\n\nimport Search from './Search';\n\n/**\n * The `HeaderSecondary` component displays secondary header controls, such as\n * the search box and the user menu. On the default skin, these are shown on the\n * right side of the header.\n */\nexport default class HeaderSecondary extends Component {\n view() {\n return <ul className=\"Header-controls\">{listItems(this.items().toArray())}</ul>;\n }\n\n /**\n * Build an item list for the controls.\n */\n items(): ItemList {\n const items = new ItemList();\n\n items.add('search', Search.component(), 30);\n\n if (app.forum.attribute('showLanguageSelector') && Object.keys(app.data.locales).length > 1) {\n const locales: Vnode<any, any>[] = [];\n\n for (const locale in app.data.locales) {\n if (!app.data.locales.hasOwnProperty(locale)) continue;\n\n locales.push(\n Button.component({\n active: app.data.locale === locale,\n children: app.data.locales[locale],\n icon: app.data.locale === locale ? 'fas fa-check' : true,\n onclick: () => {\n if (app.session.user) {\n app.session.user.savePreferences({ locale }).then(() => window.location.reload());\n } else {\n document.cookie = `locale=${locale}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT`;\n window.location.reload();\n }\n },\n })\n );\n }\n\n items.add(\n 'locale',\n SelectDropdown.component({\n children: locales,\n buttonClassName: 'Button Button--link',\n }),\n 20\n );\n }\n\n if (app.session.user) {\n items.add('notifications', <NotificationsDropdown />, 10);\n items.add('session', <SessionDropdown />, 0);\n } else {\n if (app.forum.attribute('allowSignUp')) {\n items.add(\n 'signUp',\n Button.component({\n children: app.translator.trans('core.forum.header.sign_up_link'),\n className: 'Button Button--link',\n onclick: () => app.modal.show(SignUpModal),\n }),\n 10\n );\n }\n ``;\n\n items.add(\n 'logIn',\n Button.component({\n children: app.translator.trans('core.forum.header.log_in_link'),\n className: 'Button Button--link',\n onclick: () => app.modal.show(LogInModal),\n }),\n 0\n );\n }\n\n return items;\n }\n}\n","import { Params } from 'mithril';\n\nimport { extend } from '../../common/extend';\nimport listItems from '../../common/helpers/listItems';\nimport Discussion from '../../common/models/Discussion';\nimport ItemList from '../../common/utils/ItemList';\n\nimport Button from '../../common/components/Button';\nimport Dropdown from '../../common/components/Dropdown';\nimport LinkButton from '../../common/components/LinkButton';\nimport SelectDropdown from '../../common/components/SelectDropdown';\n// import DiscussionComposer from './DiscussionComposer';\nimport DiscussionList from './DiscussionList';\nimport DiscussionPage from './DiscussionPage';\nimport LogInModal from './LogInModal';\nimport Page from './Page';\nimport WelcomeHero from './WelcomeHero';\n\n/**\n * The `IndexPage` component displays the index page, including the welcome\n * hero, the sidebar, and the discussion list.\n */\nexport default class IndexPage extends Page {\n private lastDiscussion?: Discussion;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n // If the user is returning from a discussion page, then take note of which\n // discussion they have just visited. After the view is rendered, we will\n // scroll down so that this discussion is in view.\n if (app.previous instanceof DiscussionPage) {\n this.lastDiscussion = app.previous.discussion;\n }\n\n // If the user is coming from the discussion list, then they have either\n // just switched one of the parameters (filter, sort, search) or they\n // probably want to refresh the results. We will clear the discussion list\n // cache so that results are reloaded.\n if (app.previous instanceof IndexPage) {\n app.cache.discussionList = null;\n }\n\n const params = this.params();\n\n if (app.cache.discussionList) {\n // Compare the requested parameters (sort, search query) to the ones that\n // are currently present in the cached discussion list. If they differ, we\n // will clear the cache and set up a new discussion list component with\n // the new parameters.\n Object.keys(params).some(key => {\n if (app.cache.discussionList!.props.params[key] !== params[key]) {\n app.cache.discussionList = null;\n return true;\n }\n });\n }\n\n if (!app.cache.discussionList) {\n app.cache.discussionList = new DiscussionList({ params, oninit: vnode => (app.cache.discussionList = vnode.state) });\n }\n\n app.history.push('index', app.translator.transText('core.forum.header.back_to_index_tooltip'));\n\n this.bodyClass = 'App--index';\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n // Save the scroll position so we can restore it when we return to the\n // discussion list.\n app.cache.scrollTop = $(window).scrollTop();\n }\n\n view() {\n if (!app.cache.discussionList) return;\n\n const discussionList = app.cache.discussionList.render();\n\n return (\n <div className=\"IndexPage\">\n {this.hero()}\n <div className=\"container\">\n <div className=\"sideNavContainer\">\n <nav className=\"IndexPage-nav sideNav\">\n <ul>{listItems(this.sidebarItems().toArray())}</ul>\n </nav>\n <div className=\"IndexPage-results sideNavOffset\">\n <div className=\"IndexPage-toolbar\">\n <ul className=\"IndexPage-toolbar-view\">{listItems(this.viewItems().toArray())}</ul>\n <ul className=\"IndexPage-toolbar-action\">{listItems(this.actionItems().toArray())}</ul>\n </div>\n {discussionList}\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $app = $('#app');\n\n extend(vnode.dom, 'onunload', () => $app.css('min-height', ''));\n\n app.setTitle('');\n app.setTitleCount(0);\n\n // Work out the difference between the height of this hero and that of the\n // previous hero. Maintain the same scroll position relative to the bottom\n // of the hero so that the sidebar doesn't jump around.\n const oldHeroHeight = app.cache.heroHeight;\n const heroHeight = (app.cache.heroHeight = this.$('.Hero').outerHeight() || 0);\n const scrollTop = app.cache.scrollTop;\n\n $app.css('min-height', $(window).height() + heroHeight);\n\n // Scroll to the remembered position. We do this after a short delay so that\n // it happens after the browser has done its own \"back button\" scrolling,\n // which isn't right. https://github.com/flarum/core/issues/835\n const scroll = () => $(window).scrollTop(scrollTop - oldHeroHeight + heroHeight);\n scroll();\n setTimeout(scroll, 1);\n\n // If we've just returned from a discussion page, then the constructor will\n // have set the `lastDiscussion` property. If this is the case, we want to\n // scroll down to that discussion so that it's in view.\n if (this.lastDiscussion) {\n const $discussion = this.$(`.DiscussionListItem[data-id=\"${this.lastDiscussion.id()}\"]`);\n\n if ($discussion.length) {\n const indexTop = $('#header').outerHeight();\n const indexBottom = $(window).height();\n const discussionTop = $discussion.offset().top;\n const discussionBottom = discussionTop + $discussion.outerHeight();\n\n if (discussionTop < scrollTop + indexTop || discussionBottom > scrollTop + indexBottom) {\n $(window).scrollTop(discussionTop - indexTop);\n }\n }\n }\n }\n\n /**\n * Get the component to display as the hero.\n */\n hero() {\n return <WelcomeHero />;\n }\n\n /**\n * Build an item list for the sidebar of the index page. By default this is a\n * \"New Discussion\" button, and then a DropdownSelect component containing a\n * list of navigation items.\n */\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartDiscussion = app.forum.attribute('canStartDiscussion') || !app.session.user;\n\n items.add(\n 'newDiscussion',\n Button.component({\n children: app.translator.trans(\n canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'\n ),\n icon: 'fas fa-edit',\n className: 'Button Button--primary IndexPage-newDiscussion',\n itemClassName: 'App-primaryControl',\n onclick: this.newDiscussionAction.bind(this),\n disabled: !canStartDiscussion,\n })\n );\n\n items.add(\n 'nav',\n SelectDropdown.component({\n children: this.navItems().toArray(),\n buttonClassName: 'Button',\n className: 'App-titleControl',\n })\n );\n\n return items;\n }\n\n /**\n * Build an item list for the navigation in the sidebar of the index page. By\n * default this is just the 'All Discussions' link.\n */\n navItems(): ItemList {\n const items = new ItemList();\n const params = this.stickyParams();\n\n items.add(\n 'allDiscussions',\n LinkButton.component({\n href: app.route('index', params),\n children: app.translator.trans('core.forum.index.all_discussions_link'),\n icon: 'far fa-comments',\n }),\n 100\n );\n\n return items;\n }\n\n /**\n * Build an item list for the part of the toolbar which is concerned with how\n * the results are displayed. By default this is just a select box to change\n * the way discussions are sorted.\n */\n viewItems(): ItemList {\n const items = new ItemList();\n const sortMap = app.cache.discussionList.sortMap();\n\n const sortOptions = {};\n for (const i in sortMap) {\n sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');\n }\n\n items.add(\n 'sort',\n Dropdown.component({\n buttonClassName: 'Button',\n label: sortOptions[this.params().sort] || Object.keys(sortMap).map(key => sortOptions[key])[0],\n children: Object.keys(sortOptions).map(value => {\n const label = sortOptions[value];\n const active = (this.params().sort || Object.keys(sortMap)[0]) === value;\n\n return Button.component({\n children: label,\n icon: active ? 'fas fa-check' : true,\n onclick: this.changeSort.bind(this, value),\n active: active,\n });\n }),\n })\n );\n\n return items;\n }\n\n /**\n * Build an item list for the part of the toolbar which is about taking action\n * on the results. By default this is just a \"mark all as read\" button.\n */\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.transText('core.forum.index.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n app.cache.discussionList.refresh();\n if (app.session.user) {\n app.store.find('users', app.session.user.id());\n m.redraw();\n }\n },\n })\n );\n\n if (app.session.user) {\n items.add(\n 'markAllAsRead',\n Button.component({\n title: app.translator.transText('core.forum.index.mark_all_as_read_tooltip'),\n icon: 'fas fa-check',\n className: 'Button Button--icon',\n onclick: this.markAllAsRead.bind(this),\n })\n );\n }\n\n return items;\n }\n\n /**\n * Return the current search query, if any. This is implemented to activate\n * the search box in the header.\n *\n * @see Search\n */\n searching(): string {\n return this.params().q;\n }\n\n /**\n * Redirect to the index page without a search filter. This is called when the\n * 'x' is clicked in the search box in the header.\n *\n * @see Search\n */\n clearSearch() {\n const params = this.params();\n delete params.q;\n\n m.route.set(app.route(this.props.routeName, params));\n }\n\n /**\n * Redirect to the index page using the given sort parameter.\n */\n changeSort(sort: string) {\n const params = this.params();\n\n if (sort === Object.keys(app.cache.discussionList.sortMap())[0]) {\n delete params.sort;\n } else {\n params.sort = sort;\n }\n\n m.route(app.route(this.props.routeName, params));\n }\n\n /**\n * Get URL parameters that stick between filter changes.\n *\n * @return {Object}\n */\n stickyParams(): Params {\n return {\n sort: m.route.param('sort'),\n q: m.route.param('q'),\n };\n }\n\n /**\n * Get parameters to pass to the DiscussionList component.\n *\n * @return {Object}\n */\n params() {\n const params = this.stickyParams();\n\n params.filter = m.route.param('filter');\n\n return params;\n }\n\n /**\n * Open the composer for a new discussion or prompt the user to login.\n *\n * @return {Promise}\n */\n newDiscussionAction(): Promise<void> {\n if (app.session.user) {\n // const component = new DiscussionComposer({ user: app.session.user });\n\n // app.composer.load(component);\n // app.composer.show();\n\n return Promise.resolve();\n } else {\n app.modal.show(LogInModal);\n\n return Promise.reject();\n }\n }\n\n /**\n * Mark all discussions as read.\n */\n markAllAsRead(): void {\n const confirmation = confirm(app.translator.transText('core.forum.index.mark_all_as_read_confirmation'));\n\n if (confirmation) {\n app.session.user.save({ markedAllAsReadAt: new Date() });\n }\n }\n}\n","import Component from '../../common/Component';\nimport avatar from '../../common/helpers/avatar';\n\n/**\n * The `LoadingPost` component shows a placeholder that looks like a post,\n * indicating that the post is loading.\n */\nexport default class LoadingPost extends Component {\n view() {\n return (\n <div className=\"Post CommentPost LoadingPost\">\n <header className=\"Post-header\">\n {avatar(null, { className: 'PostUser-avatar' })}\n <div className=\"fakeText\" />\n </header>\n\n <div className=\"Post-body\">\n <div className=\"fakeText\" />\n <div className=\"fakeText\" />\n <div className=\"fakeText\" />\n </div>\n </div>\n );\n }\n}\n","import Component from '../../common/Component';\nimport ItemList from '../../common/utils/ItemList';\n\n/**\n * The `LogInButtons` component displays a collection of social login buttons.\n */\nexport default class LogInButtons extends Component {\n view() {\n return <div className=\"LogInButtons\">{this.items().toArray()}</div>;\n }\n\n /**\n * Build a list of LogInButton components.\n */\n items(): ItemList {\n return new ItemList();\n }\n}\n","import Stream from 'mithril/stream';\n\nimport { ComponentProps } from '../../common/Component';\nimport Modal from '../../common/components/Modal';\nimport ItemList from '../../common/utils/ItemList';\nimport Button from '../../common/components/Button';\n\nimport LogInButtons from './LogInButtons';\nimport SignUpModal from './SignUpModal';\n\nexport interface LogInModalProps extends ComponentProps {\n identification?: string;\n password?: string;\n remember?: boolean;\n}\n\n/**\n * The `LogInModal` component displays a modal dialog with a login form.\n */\nexport default class LogInModal extends Modal<LogInModalProps> {\n /**\n * The value of the identification input.\n */\n identification!: Stream<string>;\n\n /**\n * The value of the password input.\n */\n password!: Stream<string>;\n\n /**\n * The value of the remember me input.\n */\n remember!: Stream<boolean>;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.identification = m.prop(this.props.identification || '');\n\n this.password = m.prop(this.props.password || '');\n\n this.remember = m.prop(!!this.props.remember);\n }\n\n className(): string {\n return 'LogInModal Modal--small';\n }\n\n title(): string {\n return app.translator.transText('core.forum.log_in.title');\n }\n\n content() {\n return [<div className=\"Modal-body\">{this.body()}</div>, <div className=\"Modal-footer\">{this.footer()}</div>];\n }\n\n body() {\n return [<LogInButtons />, <div className=\"Form Form--centered\">{this.fields().toArray()}</div>];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add(\n 'identification',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"identification\"\n type=\"text\"\n placeholder={app.translator.transText('core.forum.log_in.username_or_email_placeholder')}\n bidi={this.identification}\n disabled={this.loading}\n />\n </div>,\n 30\n );\n\n items.add(\n 'password',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"password\"\n type=\"password\"\n placeholder={app.translator.transText('core.forum.log_in.password_placeholder')}\n bidi={this.password}\n disabled={this.loading}\n />\n </div>,\n 20\n );\n\n items.add(\n 'remember',\n <div className=\"Form-group\">\n <div>\n <label className=\"checkbox\">\n <input type=\"checkbox\" bidi={this.remember} disabled={this.loading} />\n {app.translator.trans('core.forum.log_in.remember_me_label')}\n </label>\n </div>\n </div>,\n 10\n );\n\n items.add(\n 'submit',\n <div className=\"Form-group\">\n {Button.component({\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.loading,\n children: app.translator.trans('core.forum.log_in.submit_button'),\n })}\n </div>,\n -10\n );\n\n return items;\n }\n\n footer() {\n return [\n <p className=\"LogInModal-forgotPassword\">\n <a onclick={this.forgotPassword.bind(this)}>{app.translator.trans('core.forum.log_in.forgot_password_link')}</a>\n </p>,\n\n app.forum.attribute('allowSignUp') && (\n <p className=\"LogInModal-signUp\">\n {app.translator.trans('core.forum.log_in.sign_up_text', { a: <a onclick={this.signUp.bind(this)} /> })}\n </p>\n ),\n ];\n }\n\n /**\n * Open the forgot password modal, prefilling it with an email if the user has\n * entered one.\n *\n * @public\n */\n forgotPassword() {\n const email = this.identification();\n const props = email.indexOf('@') !== -1 ? { email } : undefined;\n\n app.modal.show(ForgotPasswordModal, props);\n }\n\n /**\n * Open the sign up modal, prefilling it with an email/username/password if\n * the user has entered one.\n *\n * @public\n */\n signUp() {\n const props = { password: this.password() };\n const identification = this.identification();\n props[identification.indexOf('@') !== -1 ? 'email' : 'username'] = identification;\n\n app.modal.show(SignUpModal, props);\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$(`[name=\"${this.identification() ? 'password' : 'identification'}\"]`).select();\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const identification = this.identification();\n const password = this.password();\n const remember = this.remember();\n\n app.session\n .login({ identification, password, remember }, { errorHandler: this.onerror.bind(this) })\n .then(() => window.location.reload(), this.loaded.bind(this));\n }\n\n onerror(error) {\n if (error.status === 401) {\n error.alert.attrs.children = app.translator.trans('core.forum.log_in.invalid_login_message');\n }\n\n super.onerror(error);\n }\n}\n","import Component, { ComponentProps } from '../../common/Component';\nimport Checkbox from '../../common/components/Checkbox';\nimport icon from '../../common/helpers/icon';\nimport ItemList from '../../common/utils/ItemList';\nimport User from '../../common/models/User';\n\nexport interface NotificationGridProps extends ComponentProps {\n user: User;\n}\n\nexport type NotificationItem = {\n /**\n * The name of the notification type/method.\n */\n name: string;\n\n /**\n * The icon to display in the column header/notification grid row.\n */\n icon: string;\n\n /**\n * The label to display in the column header/notification grid row.\n */\n label: string;\n};\n\n/**\n * The `NotificationGrid` component displays a table of notification types and\n * methods, allowing the user to toggle each combination.\n */\nexport default class NotificationGrid extends Component<NotificationGridProps> {\n /**\n * Information about the available notification methods.\n */\n methods = this.notificationMethods().toArray();\n\n /**\n * A map of notification type-method combinations to the checkbox instances\n * that represent them.\n */\n inputs = {};\n\n /**\n * Information about the available notification types.\n */\n types = this.notificationTypes().toArray();\n\n oninit(vnode) {\n super.oninit(vnode);\n\n // For each of the notification type-method combinations, create and store a\n // new checkbox component instance, which we will render in the view.\n this.types.forEach(type =>\n this.methods.forEach(method => {\n const key = this.preferenceKey(type.name, method.name);\n const preference = this.props.user.preferences()[key];\n\n this.inputs[key] = new Checkbox({\n state: !!preference,\n disabled: typeof preference === 'undefined',\n onchange: () => this.toggle([key]),\n oninit: vnode => (this.inputs[key] = vnode.state),\n });\n })\n );\n }\n\n view() {\n return (\n <table className=\"NotificationGrid\">\n <thead>\n <tr>\n <td />\n {this.methods.map(method => (\n <th className=\"NotificationGrid-groupToggle\" onclick={this.toggleMethod.bind(this, method.name)}>\n {icon(method.icon)} {method.label}\n </th>\n ))}\n </tr>\n </thead>\n\n <tbody>\n {this.types.map(type => (\n <tr>\n <td className=\"NotificationGrid-groupToggle\" onclick={this.toggleType.bind(this, type.name)}>\n {icon(type.icon)} {type.label}\n </td>\n {this.methods.map(method => (\n <td className=\"NotificationGrid-checkbox\">{this.inputs[this.preferenceKey(type.name, method.name)].render()}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$('thead .NotificationGrid-groupToggle').bind('mouseenter mouseleave', function(e) {\n const i = parseInt($(this).index(), 10) + 1;\n $(this)\n .parents('table')\n .find('td:nth-child(' + i + ')')\n .toggleClass('highlighted', e.type === 'mouseenter');\n });\n\n this.$('tbody .NotificationGrid-groupToggle').bind('mouseenter mouseleave', function(e) {\n $(this)\n .parent()\n .find('td')\n .toggleClass('highlighted', e.type === 'mouseenter');\n });\n }\n\n /**\n * Toggle the state of the given preferences, based on the value of the first\n * one.\n */\n toggle(keys: string[]) {\n const user = this.props.user;\n const preferences = user.preferences();\n const enabled = !preferences[keys[0]];\n\n keys.forEach(key => {\n const control = this.inputs[key];\n\n control.loading = true;\n control.props.state = enabled;\n preferences[key] = control.props.state = enabled;\n });\n\n m.redraw();\n\n user.save({ preferences }).then(() => {\n keys.forEach(key => (this.inputs[key].loading = false));\n\n m.redraw();\n });\n }\n\n /**\n * Toggle all notification types for the given method.\n */\n toggleMethod(method: string) {\n const keys = this.types.map(type => this.preferenceKey(type.name, method)).filter(key => !this.inputs[key].props.disabled);\n\n this.toggle(keys);\n }\n\n /**\n * Toggle all notification methods for the given type.\n */\n toggleType(type: string) {\n const keys = this.methods.map(method => this.preferenceKey(type, method.name)).filter(key => !this.inputs[key].props.disabled);\n\n this.toggle(keys);\n }\n\n /**\n * Get the name of the preference key for the given notification type-method\n * combination.\n */\n preferenceKey(type: string, method: string): string {\n return `notify_${type}_${method}`;\n }\n\n /**\n * Build an item list for the notification methods to display in the grid.\n *\n * @see {NotificationItem}\n */\n notificationMethods() {\n const items = new ItemList<NotificationItem>();\n\n items.add('alert', {\n name: 'alert',\n icon: 'fas fa-bell',\n label: app.translator.trans('core.forum.settings.notify_by_web_heading'),\n });\n\n items.add('email', {\n name: 'email',\n icon: 'far fa-envelope',\n label: app.translator.trans('core.forum.settings.notify_by_email_heading'),\n });\n\n return items;\n }\n\n /**\n * Build an item list for the notification types to display in the grid.\n *\n * @see {NotificationItem}\n */\n notificationTypes() {\n const items = new ItemList<NotificationItem>();\n\n items.add('discussionRenamed', {\n name: 'discussionRenamed',\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('core.forum.settings.notify_discussion_renamed_label'),\n });\n\n return items;\n }\n}\n","import Component from '../../common/Component';\nimport listItems from '../../common/helpers/listItems';\nimport Button from '../../common/components/Button';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport Notification from '../../common/models/Notification';\nimport Discussion from '../../common/models/Discussion';\n\n/**\n * The `NotificationList` component displays a list of the logged-in user's\n * notifications, grouped by discussion.\n */\nexport default class NotificationList extends Component {\n /**\n * Whether or not the notifications are loading.\n */\n loading: boolean = false;\n\n /**\n * Whether or not there are more results that can be loaded.\n */\n moreResults: boolean = false;\n\n private $scrollParent: ZeptoCollection;\n private scrollHandler: () => void;\n\n view() {\n const pages = app.cache.notifications || [];\n\n return (\n <div className=\"NotificationList\">\n <div className=\"NotificationList-header\">\n <div className=\"App-primaryControl\">\n {Button.component({\n className: 'Button Button--icon Button--link',\n icon: 'fas fa-check',\n title: app.translator.transText('core.forum.notifications.mark_all_as_read_tooltip'),\n onclick: this.markAllAsRead.bind(this),\n })}\n </div>\n\n <h4 className=\"App-titleControl App-titleControl--text\">{app.translator.trans('core.forum.notifications.title')}</h4>\n </div>\n\n <div className=\"NotificationList-content\">\n {pages.length\n ? pages.map(notifications => {\n const groups: { discussion: Discussion; notifications: Notification[] }[] = [];\n const discussions = {};\n\n notifications.forEach(notification => {\n const subject = notification.subject();\n\n if (typeof subject === 'undefined') return;\n\n // Get the discussion that this notification is related to. If it's not\n // directly related to a discussion, it may be related to a post or\n // other entity which is related to a discussion.\n let discussion: any = false;\n if (subject instanceof Discussion) discussion = subject;\n else if (subject && subject.discussion) discussion = subject.discussion();\n\n // If the notification is not related to a discussion directly or\n // indirectly, then we will assign it to a neutral group.\n const key = discussion ? discussion.id() : 0;\n discussions[key] = discussions[key] || { discussion: discussion, notifications: [] };\n discussions[key].notifications.push(notification);\n\n if (groups.indexOf(discussions[key]) === -1) {\n groups.push(discussions[key]);\n }\n });\n\n return groups.map(group => {\n const badges = group.discussion?.badges().toArray();\n\n return (\n <div className=\"NotificationGroup\">\n {group.discussion ? (\n <m.route.Link className=\"NotificationGroup-header\" href={app.route.discussion(group.discussion)}>\n {badges && badges.length ? (\n <ul className=\"NotificationGroup-badges badges\">{listItems(badges)}</ul>\n ) : (\n ''\n )}\n {group.discussion.title()}\n </m.route.Link>\n ) : (\n <div className=\"NotificationGroup-header\">{app.forum.attribute('title')}</div>\n )}\n\n <ul className=\"NotificationGroup-content\">\n {group.notifications.map(notification => {\n const NotificationComponent = app.notificationComponents[notification.contentType()];\n return NotificationComponent ? <li>{NotificationComponent.component({ notification })}</li> : '';\n })}\n </ul>\n </div>\n );\n });\n })\n : ''}\n {this.loading ? (\n <LoadingIndicator className=\"LoadingIndicator--block\" />\n ) : pages.length ? (\n ''\n ) : (\n <div className=\"NotificationList-empty\">{app.translator.trans('core.forum.notifications.empty_text')}</div>\n )}\n </div>\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $notifications = this.$('.NotificationList-content');\n const $scrollParent = (this.$scrollParent = $notifications.css('overflow') === 'auto' ? $notifications : $(window));\n\n this.scrollHandler = () => {\n const scrollTop = $scrollParent.scrollTop();\n const viewportHeight = $scrollParent.height();\n const contentTop = $scrollParent === $notifications ? 0 : $notifications.offset().top;\n const contentHeight = $notifications[0].scrollHeight;\n\n if (this.moreResults && !this.loading && scrollTop + viewportHeight >= contentTop + contentHeight) {\n this.loadMore();\n }\n };\n\n $scrollParent.on('scroll', this.scrollHandler);\n\n this.load();\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n this.$scrollParent.off('scroll', this.scrollHandler);\n }\n\n /**\n * Load notifications into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (app.session.user.newNotificationCount()) {\n delete app.cache.notifications;\n }\n\n if (app.cache.notifications) {\n return;\n }\n\n app.session.user.pushAttributes({ newNotificationCount: 0 });\n\n this.loadMore();\n }\n\n /**\n * Load the next page of notification results.\n */\n loadMore() {\n this.loading = true;\n m.redraw();\n\n const params = app.cache.notifications ? { page: { offset: app.cache.notifications.length * 10 } } : null;\n\n return app.store\n .find<Notification>('notifications', params)\n .then(this.parseResults.bind(this))\n .catch(() => {})\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n /**\n * Parse results and append them to the notification list.\n */\n parseResults(results: Notification[]): Notification[] {\n app.cache.notifications = app.cache.notifications || [];\n\n if (results.length) app.cache.notifications.push(results);\n\n this.moreResults = !!results.payload.links.next;\n\n return results;\n }\n\n /**\n * Mark all of the notifications as read.\n */\n markAllAsRead() {\n if (!app.cache.notifications) return;\n\n app.session.user.pushAttributes({ unreadNotificationCount: 0 });\n\n app.cache.notifications.forEach(notifications => {\n notifications.forEach(notification => notification.pushAttributes({ isRead: true }));\n });\n\n app.request({\n url: `${app.forum.attribute('apiUrl')}/notifications/read`,\n method: 'POST',\n });\n }\n}\n","import Dropdown from '../../common/components/Dropdown';\nimport icon from '../../common/helpers/icon';\nimport NotificationList from './NotificationList';\n\nexport default class NotificationsDropdown extends Dropdown {\n list = (<NotificationList />);\n\n static initProps(props) {\n props.className = props.className || 'NotificationsDropdown';\n props.buttonClassName = props.buttonClassName || 'Button Button--flat';\n props.menuClassName = props.menuClassName || 'Dropdown-menu--right';\n props.label = props.label || app.translator.transText('core.forum.notifications.tooltip');\n props.icon = props.icon || 'fas fa-bell';\n\n super.initProps(props);\n }\n\n getButton() {\n const newNotifications = this.getNewCount();\n const vdom = super.getButton();\n\n vdom.attrs.title = this.props.label;\n\n vdom.attrs.className += newNotifications ? ' new' : '';\n vdom.attrs.onclick = this.onclick.bind(this);\n\n return vdom;\n }\n\n getButtonContent() {\n const unread = this.getUnreadCount();\n\n return [\n icon(this.props.icon, { className: 'Button-icon' }),\n unread ? <span className=\"NotificationsDropdown-unread\">{unread}</span> : '',\n <span className=\"Button-label\">{this.props.label}</span>,\n ];\n }\n\n getMenu() {\n return (\n <div className={'Dropdown-menu ' + this.props.menuClassName} onclick={this.menuClick.bind(this)}>\n {this.showing && this.list}\n </div>\n );\n }\n\n onclick() {\n if (app.drawer.isOpen()) {\n this.goToRoute();\n }\n }\n\n goToRoute() {\n m.route.set(app.route('notifications'));\n }\n\n getUnreadCount() {\n return app.session.user.unreadNotificationCount();\n }\n\n getNewCount() {\n return app.session.user.newNotificationCount();\n }\n\n menuClick(e: MouseEvent) {\n // Don't close the notifications dropdown if the user is opening a link in a\n // new tab or window.\n if (e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) e.stopPropagation();\n }\n}\n","import Component from '../../common/Component';\n\n/**\n * The `Page` component\n */\nexport default abstract class Page extends Component {\n /**\n * A class name to apply to the body while the route is active.\n */\n bodyClass: string = '';\n\n oninit(vnode) {\n super.oninit(vnode);\n\n if (this.bodyClass) {\n $('#app').addClass(this.bodyClass);\n }\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.previous = app.current;\n app.current = this;\n\n app.drawer.hide();\n app.modal.close();\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n $('#app').removeClass(this.bodyClass);\n }\n}\n","import Component, { ComponentProps } from '../../common/Component';\nimport Dropdown from '../../common/components/Dropdown';\nimport PostControls from '../utils/PostControls';\nimport listItems from '../../common/helpers/listItems';\nimport ItemList from '../../common/utils/ItemList';\nimport SubtreeRetainer from '../../common/utils/SubtreeRetainer';\nimport { PostProp } from '../../common/concerns/ComponentProps';\n\n/**\n * The `Post` component displays a single post. The basic post template just\n * includes a controls dropdown; subclasses must implement `content` and `attrs`\n * methods.\n *\n * @abstract\n */\nexport default class Post<T extends PostProp = PostProp> extends Component<T> {\n loading = false;\n controlsOpen = false;\n\n /**\n * Set up a subtree retainer so that the post will not be redrawn\n * unless new data comes in.\n */\n subtree = new SubtreeRetainer(\n () => this.props.post.freshness,\n () => {\n const user = this.props.post.user();\n return user?.freshness;\n },\n () => this.controlsOpen\n );\n\n view() {\n const controls = PostControls.controls(this.props.post, this).toArray();\n const attrs = this.attrs();\n\n attrs.className = classNames(this.classes(attrs.className));\n\n return (\n <article {...attrs}>\n <div>\n {this.content()}\n <aside className=\"Post-actions\">\n <ul>\n {listItems(this.actionItems().toArray())}\n {controls.length ? (\n <li>\n <Dropdown\n className=\"Post-controls\"\n buttonClassName=\"Button Button--icon Button--flat\"\n menuClassName=\"Dropdown-menu--right\"\n icon=\"fas fa-ellipsis-h\"\n onshow={() => this.$('.Post-actions').addClass('open')}\n onhide={() => this.$('.Post-actions').removeClass('open')}\n >\n {controls}\n </Dropdown>\n </li>\n ) : (\n ''\n )}\n </ul>\n </aside>\n <footer className=\"Post-footer\">\n <ul>{listItems(this.footerItems().toArray())}</ul>\n </footer>\n </div>\n </article>\n );\n }\n\n onbeforeupdate(vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.update();\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $actions = this.$('.Post-actions');\n const $controls = this.$('.Post-controls');\n\n $actions.toggleClass('open', $controls.hasClass('open'));\n }\n\n /**\n * Get attributes for the post element.\n */\n attrs(): ComponentProps {\n return {};\n }\n\n /**\n * Get the post's content.\n */\n content(): any[] {\n return [];\n }\n\n classes(existing) {\n let classes = (existing || '').split(' ').concat(['Post']);\n\n if (this.loading) {\n classes.push('Post--loading');\n }\n\n if (this.props.post.user() === app.session.user) {\n classes.push('Post--by-actor');\n }\n\n return classes;\n }\n\n /**\n * Build an item list for the post's actions.\n */\n actionItems() {\n return new ItemList();\n }\n\n /**\n * Build an item list for the post's footer.\n */\n footerItems() {\n return new ItemList();\n }\n}\n","import Component from '../../common/Component';\nimport { PostProp } from '../../common/concerns/ComponentProps';\nimport humanTime from '../../common/utils/humanTime';\n\n/**\n * The `PostEdited` component displays information about when and by whom a post\n * was edited.\n */\nexport default class PostEdited extends Component<PostProp> {\n shouldUpdateTooltip = false;\n oldEditedInfo?: string;\n\n view() {\n const post = this.props.post;\n const editedUser = post.editedUser();\n const editedInfo = app.translator.transText('core.forum.post.edited_tooltip', { user: editedUser, ago: humanTime(post.editedAt()) });\n\n if (editedInfo !== this.oldEditedInfo) {\n this.shouldUpdateTooltip = true;\n this.oldEditedInfo = editedInfo;\n }\n\n return (\n <span className=\"PostEdited\" title={editedInfo}>\n {app.translator.trans('core.forum.post.edited_text')}\n </span>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$().tooltip();\n }\n\n onupdate(vnode) {\n super.onupdate(vnode);\n\n if (this.shouldUpdateTooltip) {\n this.$()\n .tooltip('destroy')\n .tooltip();\n this.shouldUpdateTooltip = false;\n }\n }\n}\n","import Component from '../../common/Component';\nimport { PostProp } from '../../common/concerns/ComponentProps';\nimport humanTime from '../../common/helpers/humanTime';\nimport fullTime from '../../common/helpers/fullTime';\nimport Post from '../../common/models/Post';\n\nexport default class PostMeta extends Component<PostProp> {\n view() {\n const post = this.props.post;\n const time = post.createdAt();\n const permalink = this.getPermalink(post);\n const touch = 'ontouchstart' in document.documentElement;\n\n // When the dropdown menu is shown, select the contents of the permalink\n // input so that the user can quickly copy the URL.\n const selectPermalink = function(this: Element) {\n setTimeout(() =>\n $(this)\n .parent()\n .find('.PostMeta-permalink')\n .select()\n );\n };\n\n return (\n <div className=\"Dropdown PostMeta\">\n <a className=\"Dropdown-toggle\" onclick={selectPermalink} data-toggle=\"dropdown\">\n {humanTime(time)}\n </a>\n\n <div className=\"Dropdown-menu dropdown-menu\">\n <span className=\"PostMeta-number\">{app.translator.trans('core.forum.post.number_tooltip', { number: post.number() })}</span>{' '}\n <span className=\"PostMeta-time\">{fullTime(time)}</span> <span className=\"PostMeta-ip\">{post.data.attributes.ipAddress}</span>\n {touch ? (\n <a className=\"Button PostMeta-permalink\" href={permalink}>\n {permalink}\n </a>\n ) : (\n <input className=\"FormControl PostMeta-permalink\" value={permalink} onclick={e => e.stopPropagation()} />\n )}\n </div>\n </div>\n );\n }\n\n /**\n * Get the permalink for the given post.\n */\n getPermalink(post: Post): string {\n return window.location.origin + app.route.post(post);\n }\n}\n","import Component from '../../common/Component';\nimport ScrollListener from '../../common/utils/ScrollListener';\nimport PostLoading from './LoadingPost';\nimport anchorScroll from '../../common/utils/anchorScroll';\nimport ReplyPlaceholder from './ReplyPlaceholder';\nimport Button from '../../common/components/Button';\nimport Discussion from '../../common/models/Discussion';\nimport Post from '../../common/models/Post';\nimport Evented from '../../common/utils/evented';\nimport { DiscussionProp } from '../../common/concerns/ComponentProps';\nimport { Attributes } from 'mithril';\n\nexport interface PostStreamProps extends DiscussionProp {\n includedPosts: Post[];\n}\n\ninterface PostStream<T extends PostStreamProps = PostStreamProps> extends Component<T>, Evented {}\n\n/**\n * The `PostStream` component displays an infinitely-scrollable wall of posts in\n * a discussion. Posts that have not loaded will be displayed as placeholders.\n */\nclass PostStream<T extends PostStreamProps = PostStreamProps> extends Component<T> {\n /**\n * The number of posts to load per page.\n */\n static loadCount = 20;\n\n /**\n * The discussion to display the post stream for.\n */\n discussion: Discussion;\n\n /**\n * Whether or not the infinite-scrolling auto-load functionality is\n * disabled.\n */\n paused = false;\n\n scrollListener = new ScrollListener(this.onscroll.bind(this));\n loadPageTimeouts = {};\n pagesLoading = 0;\n\n calculatePositionTimeout: number = 0;\n visibleStart: number = 0;\n visibleEnd: number = 0;\n viewingEnd: boolean = true;\n\n constructor(...args) {\n super(...args);\n\n this.discussion = this.props.discussion;\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.discussion = this.props.discussion;\n\n this.show(this.props.includedPosts);\n }\n\n /**\n * Load and scroll to a post with a certain number.\n *\n * @param number The post number to go to. If 'reply', go to\n * the last post and scroll the reply preview into view.\n * @param noAnimation\n */\n goToNumber(number: string | number | 'reply', noAnimation?: boolean): Promise<void> {\n // If we want to go to the reply preview, then we will go to the end of the\n // discussion and then scroll to the very bottom of the page.\n if (number === 'reply') {\n return this.goToLast().then(() => {\n $('html,body').animate(\n {\n scrollTop: $(document).height() - $(window).height(),\n },\n 'fast',\n () => {\n this.flashItem(this.$('.PostStream-item:last-child'));\n }\n );\n });\n }\n\n this.paused = true;\n\n const promise = this.loadNearNumber(number);\n\n m.redraw();\n\n return promise.then(() => {\n m.redraw();\n\n this.scrollToNumber(number, noAnimation).then(this.unpause.bind(this));\n });\n }\n\n /**\n * Load and scroll to a certain index within the discussion.\n *\n * @param index\n * @param backwards Whether or not to load backwards from the given\n * index.\n * @param noAnimation\n */\n goToIndex(index: number, backwards?: boolean, noAnimation?: boolean): Promise<void> {\n this.paused = true;\n\n return this.loadNearIndex(index).then(() => {\n m.redraw.sync();\n\n anchorScroll(this.$('.PostStream-item:' + (backwards ? 'last' : 'first')), () => m.redraw());\n\n return this.scrollToIndex(index, noAnimation, backwards).then(this.unpause.bind(this));\n });\n }\n\n /**\n * Load and scroll up to the first post in the discussion.\n */\n goToFirst(): Promise<void> {\n return this.goToIndex(0);\n }\n\n /**\n * Load and scroll down to the last post in the discussion.\n */\n goToLast(): Promise<void> {\n return this.goToIndex(this.count() - 1, true);\n }\n\n /**\n * Update the stream so that it loads and includes the latest posts in the\n * discussion, if the end is being viewed.\n */\n update(): Promise<void> {\n if (!this.viewingEnd) return Promise.resolve();\n\n this.visibleEnd = this.count();\n\n return this.loadRange(this.visibleStart, this.visibleEnd).then(() => m.redraw());\n }\n\n /**\n * Get the total number of posts in the discussion.\n */\n count(): number {\n return this.discussion.postIds().length;\n }\n\n /**\n * Make sure that the given index is not outside of the possible range of\n * indexes in the discussion.\n */\n protected sanitizeIndex(index: number) {\n return Math.max(0, Math.min(this.count(), index));\n }\n\n /**\n * Set up the stream with the given array of posts.\n */\n show(posts: Post[]) {\n this.visibleStart = posts.length ? this.discussion.postIds().indexOf(posts[0].id()) : 0;\n this.visibleEnd = this.visibleStart + posts.length;\n }\n\n /**\n * Reset the stream so that a specific range of posts is displayed. If a range\n * is not specified, the first page of posts will be displayed.\n */\n reset(start?: number, end?: number) {\n this.visibleStart = start || 0;\n this.visibleEnd = this.sanitizeIndex(end || this.constructor.loadCount);\n }\n\n /**\n * Get the visible page of posts.\n */\n posts(): (Post | null)[] {\n return this.discussion\n .postIds()\n .slice(this.visibleStart, this.visibleEnd)\n .map(id => {\n const post = app.store.getById<Post>('posts', id);\n\n return post && post.discussion() && typeof post.canEdit() !== 'undefined' ? post : null;\n });\n }\n\n view() {\n function fadeIn(vnode) {\n if (!vnode.state.fadedIn)\n $(vnode.dom)\n .hide()\n .fadeIn();\n vnode.state.fadedIn = true;\n }\n\n let lastTime;\n\n this.visibleEnd = this.sanitizeIndex(this.visibleEnd);\n this.viewingEnd = this.visibleEnd === this.count();\n\n const posts = this.posts();\n const postIds = this.discussion.postIds();\n\n const items = posts.map((post, i) => {\n let content;\n const attrs: Attributes = { 'data-index': this.visibleStart + i };\n\n if (post) {\n const time = post.createdAt();\n const PostComponent = app.postComponents[post.contentType()];\n content = PostComponent ? <PostComponent post={post} /> : '';\n\n attrs.key = 'post' + post.id();\n attrs.oncreate = fadeIn;\n attrs['data-time'] = time.toISOString();\n attrs['data-number'] = post.number();\n attrs['data-id'] = post.id();\n attrs['data-type'] = post.contentType();\n\n // If the post before this one was more than 4 hours ago, we will\n // display a 'time gap' indicating how long it has been in between\n // the posts.\n const dt = time.valueOf() - lastTime;\n\n if (dt > 1000 * 60 * 60 * 24 * 4) {\n content = [\n <div className=\"PostStream-timeGap\">\n <span>\n {app.translator.trans('core.forum.post_stream.time_lapsed_text', { period: dayjs(time).from(dayjs(lastTime, true)) })}\n </span>\n </div>,\n content,\n ];\n }\n\n lastTime = time;\n } else {\n attrs.key = 'post' + postIds[this.visibleStart + i];\n\n content = <PostLoading />;\n }\n\n return (\n <div className=\"PostStream-item\" {...attrs}>\n {content}\n </div>\n );\n });\n\n if (!this.viewingEnd && posts[this.visibleEnd - this.visibleStart - 1]) {\n items.push(\n <div className=\"PostStream-loadMore\" key=\"loadMore\">\n <Button className=\"Button\" onclick={this.loadNext.bind(this)}>\n {app.translator.trans('core.forum.post_stream.load_more_button')}\n </Button>\n </div>\n );\n }\n\n // If we're viewing the end of the discussion, the user can reply, and\n // is not already doing so, then show a 'write a reply' placeholder.\n if (this.viewingEnd && (!app.session.user || this.discussion.canReply())) {\n items.push(\n <div className=\"PostStream-item\" key=\"reply\">\n {ReplyPlaceholder.component({ discussion: this.discussion })}\n </div>\n );\n }\n\n return <div className=\"PostStream\">{items}</div>;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.scrollListener.start();\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n this.scrollListener.stop();\n clearTimeout(this.calculatePositionTimeout);\n }\n\n /**\n * When the window is scrolled, check if either extreme of the post stream is\n * in the viewport, and if so, trigger loading the next/previous page.\n */\n onscroll(top: number) {\n if (this.paused) return;\n\n const marginTop = this.getMarginTop();\n const viewportHeight = $(window).height() - marginTop;\n const viewportTop = top + marginTop;\n const loadAheadDistance = 300;\n\n if (this.visibleStart > 0) {\n const $item = this.$(`.PostStream-item[data-index=\"${this.visibleStart}\"]`);\n\n if ($item.length && $item.offset().top > viewportTop - loadAheadDistance) {\n this.loadPrevious();\n }\n }\n\n if (this.visibleEnd < this.count()) {\n const $item = this.$(`.PostStream-item[data-index=\"${this.visibleEnd - 1}\"]`);\n\n if ($item.length && $item.offset().top + $item.outerHeight(true) < viewportTop + viewportHeight + loadAheadDistance) {\n this.loadNext();\n }\n }\n\n // Throttle calculation of our position (start/end numbers of posts in the\n // viewport) to 100ms.\n clearTimeout(this.calculatePositionTimeout);\n this.calculatePositionTimeout = setTimeout(this.calculatePosition.bind(this), 100);\n }\n\n /**\n * Load the next page of posts.\n */\n loadNext() {\n const start = this.visibleEnd;\n const end = (this.visibleEnd = this.sanitizeIndex(this.visibleEnd + this.constructor.loadCount));\n\n // Unload the posts which are two pages back from the page we're currently\n // loading.\n const twoPagesAway = start - this.constructor.loadCount * 2;\n if (twoPagesAway > this.visibleStart && twoPagesAway >= 0) {\n this.visibleStart = twoPagesAway + this.constructor.loadCount + 1;\n\n if (this.loadPageTimeouts[twoPagesAway]) {\n clearTimeout(this.loadPageTimeouts[twoPagesAway]);\n this.loadPageTimeouts[twoPagesAway] = null;\n this.pagesLoading--;\n }\n }\n\n this.loadPage(start, end);\n }\n\n /**\n * Load the previous page of posts.\n */\n loadPrevious() {\n const end = this.visibleStart;\n const start = (this.visibleStart = this.sanitizeIndex(this.visibleStart - this.constructor.loadCount));\n\n // Unload the posts which are two pages back from the page we're currently\n // loading.\n const twoPagesAway = start + this.constructor.loadCount * 2;\n if (twoPagesAway < this.visibleEnd && twoPagesAway <= this.count()) {\n this.visibleEnd = twoPagesAway;\n\n if (this.loadPageTimeouts[twoPagesAway]) {\n clearTimeout(this.loadPageTimeouts[twoPagesAway]);\n this.loadPageTimeouts[twoPagesAway] = null;\n this.pagesLoading--;\n }\n }\n\n this.loadPage(start, end, true);\n }\n\n /**\n * Load a page of posts into the stream and redraw.\n */\n loadPage(start: number, end: number, backwards?: boolean) {\n const redraw = () => {\n if (start < this.visibleStart || end > this.visibleEnd) return;\n\n const anchorIndex = backwards ? this.visibleEnd - 1 : this.visibleStart;\n anchorScroll(`.PostStream-item[data-index=\"${anchorIndex}\"]`, () => m.redraw(true));\n\n this.unpause();\n };\n redraw();\n\n this.loadPageTimeouts[start] = setTimeout(\n () => {\n this.loadRange(start, end).then(() => {\n redraw();\n this.pagesLoading--;\n });\n this.loadPageTimeouts[start] = null;\n },\n this.pagesLoading ? 1000 : 0\n );\n\n this.pagesLoading++;\n }\n\n /**\n * Load and inject the specified range of posts into the stream, without\n * clearing it.\n */\n loadRange(start?: number, end?: number): Promise<Post[]> {\n const loadIds: string[] = [];\n const loaded: Post[] = [];\n\n this.discussion\n .postIds()\n .slice(start, end)\n .forEach(id => {\n const post = app.store.getById<Post>('posts', id);\n\n if (post && post.discussion() && typeof post.canEdit() !== 'undefined') {\n loaded.push(post);\n } else {\n loadIds.push(id);\n }\n });\n\n return loadIds.length ? app.store.find('posts', loadIds) : Promise.resolve(loaded);\n }\n\n /**\n * Clear the stream and load posts near a certain number. Returns a promise.\n * If the post with the given number is already loaded, the promise will be\n * resolved immediately.\n */\n loadNearNumber(number: string | number): Promise<void> {\n if (this.posts().some(post => post && Number(post.number()) === Number(number))) {\n return Promise.resolve();\n }\n\n this.reset();\n\n return app.store\n .find<Post>('posts', {\n filter: { discussion: this.discussion.id() },\n page: { near: number },\n })\n .then(this.show.bind(this));\n }\n\n /**\n * Clear the stream and load posts near a certain index. A page of posts\n * surrounding the given index will be loaded. Returns a promise. If the given\n * index is already loaded, the promise will be resolved immediately.\n */\n loadNearIndex(index: number): Promise {\n if (index >= this.visibleStart && index <= this.visibleEnd) {\n return Promise.resolve();\n }\n\n const start = this.sanitizeIndex(index - this.constructor.loadCount / 2);\n const end = start + this.constructor.loadCount;\n\n this.reset(start, end);\n\n return this.loadRange(start, end).then(this.show.bind(this));\n }\n\n /**\n * Work out which posts (by number) are currently visible in the viewport, and\n * fire an event with the information.\n */\n calculatePosition() {\n const marginTop = this.getMarginTop();\n const $window = $(window);\n const viewportHeight = $window.height() - marginTop;\n const scrollTop = $window.scrollTop() + marginTop;\n let startNumber;\n let endNumber;\n\n this.$('.PostStream-item').each((index, item: Element) => {\n const $item = $(item);\n const top = $item.offset().top;\n const height = $item.outerHeight(true);\n\n if (top + height > scrollTop) {\n if (!startNumber) {\n startNumber = endNumber = $item.data('number');\n }\n\n if (top + height < scrollTop + viewportHeight) {\n if ($item.data('number')) {\n endNumber = $item.data('number');\n }\n } else return false;\n }\n\n return true;\n });\n\n if (startNumber) {\n this.trigger('positionChanged', startNumber || 1, endNumber);\n }\n }\n\n /**\n * Get the distance from the top of the viewport to the point at which we\n * would consider a post to be the first one visible.\n */\n getMarginTop(): number {\n return this.$() && $('#header').outerHeight() + parseInt(this.$().css('margin-top'), 10);\n }\n\n /**\n * Scroll down to a certain post by number and 'flash' it.\n */\n scrollToNumber(number: string | number, noAnimation?: boolean): Promise<void> {\n const $item = this.$(`.PostStream-item[data-number=\"${number}\"]`);\n\n return this.scrollToItem($item, noAnimation).then(() => this.flashItem($item));\n }\n\n /**\n * Scroll down to a certain post by index.\n *\n * @param index\n * @param noAnimation\n * @param bottom Whether or not to scroll to the bottom of the post\n * at the given index, instead of the top of it.\n */\n scrollToIndex(index: number, noAnimation?: boolean, bottom?: boolean): Promise<void> {\n const $item = this.$(`.PostStream-item[data-index=\"${index}\"]`);\n\n return this.scrollToItem($item, noAnimation, true, bottom);\n }\n\n /**\n * Scroll down to the given post.\n *\n * @param $item\n * @param noAnimation\n * @param force Whether or not to force scrolling to the item, even\n * if it is already in the viewport.\n * @param bottom Whether or not to scroll to the bottom of the post\n * at the given index, instead of the top of it.\n */\n scrollToItem($item, noAnimation?: boolean, force?: boolean, bottom?: boolean): Promise<void> {\n const $container = $('html, body');\n\n if ($item.length) {\n const itemTop = $item.offset().top - this.getMarginTop();\n const itemBottom = $item.offset().top + $item.height();\n const scrollTop = $container.scrollTop();\n const scrollBottom = scrollTop + $(window).height();\n\n // If the item is already in the viewport, we may not need to scroll.\n // If we're scrolling to the bottom of an item, then we'll make sure the\n // bottom will line up with the top of the composer.\n if (force || itemTop < scrollTop || itemBottom > scrollBottom) {\n // TODO const top = bottom ? itemBottom - $(window).height() + app.composer.computedHeight() : $item.is(':first-child') ? 0 : itemTop;\n const top = bottom ? itemBottom - $(window).height() : $item.is(':first-child') ? 0 : itemTop;\n\n return new Promise<void>(resolve => {\n if (noAnimation) {\n $container.scrollTop(top);\n resolve();\n } else if (top !== scrollTop) {\n $container.animatedScrollTop(top, 'fast', resolve);\n } else {\n resolve();\n }\n });\n }\n }\n\n return Promise.resolve();\n }\n\n /**\n * 'Flash' the given post, drawing the user's attention to it.\n *\n * @param {jQuery} $item\n */\n flashItem($item) {\n $item.addClass('flash').one('animationend webkitAnimationEnd', () => $item.removeClass('flash'));\n }\n\n /**\n * Resume the stream's ability to auto-load posts on scroll.\n */\n unpause() {\n this.paused = false;\n this.scrollListener.update();\n this.trigger('unpaused');\n }\n}\n\nObject.assign(PostStream.prototype, Evented.prototype);\n\nexport default PostStream;\n","import Component from '../../common/Component';\nimport icon from '../../common/helpers/icon';\nimport ScrollListener from '../../common/utils/ScrollListener';\nimport SubtreeRetainer from '../../common/utils/SubtreeRetainer';\nimport formatNumber from '../../common/utils/formatNumber';\nimport PostStream from './PostStream';\nimport { EventHandler } from '../../common/utils/Evented';\n/**\n * The `PostStreamScrubber` component displays a scrubber which can be used to\n * navigate/scrub through a post stream.\n */\nexport default class PostStreamScrubber extends Component {\n handlers: { [key: string]: EventHandler } = {};\n\n /**\n * The index of the post that is currently at the top of the viewport.\n */\n index: number = 0;\n\n /**\n * The number of posts that are currently visible in the viewport.\n */\n visible: number = 1;\n\n /**\n * The description to render on the scrubber.\n */\n description: string = '';\n\n // Define a handler to update the state of the scrollbar to reflect the\n // current scroll position of the page.\n scrollListener = new ScrollListener(this.onscroll.bind(this));\n\n // Create a subtree retainer that will always cache the subtree after the\n // initial draw. We render parts of the scrubber using this because we\n // modify their DOM directly, and do not want Mithril messing around with\n // our changes.\n subtree = new SubtreeRetainer(() => true);\n\n // When the mouse is pressed on the scrollbar handle, we capture some\n // information about its current position. We will store this\n // information in an object and pass it on to the document's\n // mousemove/mouseup events later.\n dragging = false;\n mouseStart = 0;\n indexStart = 0;\n\n // Added when Component is initialized through `oninit` prop\n stream!: PostStream;\n\n view() {\n const count = this.count();\n const unreadCount = this.stream?.discussion.unreadCount() || 0;\n const unreadPercent = count ? Math.min(count - this.index, unreadCount) / count : 0;\n\n const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {\n index: (\n <span className=\"Scrubber-index\" onbeforeupdate={() => this.subtree.update()}>\n {formatNumber(Math.min(Math.ceil(this.index + this.visible), count))}\n </span>\n ),\n count: <span className=\"Scrubber-count\">{formatNumber(count)}</span>,\n });\n\n function styleUnread(vnode) {\n const $element = $(vnode.dom);\n const newStyle = {\n top: 100 - unreadPercent * 100 + '%',\n height: unreadPercent * 100 + '%',\n display: unreadCount == 0 && 'none',\n };\n\n if (vnode.state.oldStyle) {\n $element.css(vnode.state.oldStyle).animate(newStyle);\n } else {\n $element.css(newStyle);\n }\n\n vnode.state.oldStyle = newStyle;\n }\n\n return (\n <div className={'PostStreamScrubber Dropdown ' + (this.disabled() ? 'disabled ' : '') + (this.props.className || '')}>\n <button className=\"Button Dropdown-toggle\" data-toggle=\"dropdown\">\n {viewing} {icon('fas fa-sort')}\n </button>\n\n <div className=\"Dropdown-menu dropdown-menu\">\n <div className=\"Scrubber\">\n <a className=\"Scrubber-first\" onclick={this.goToFirst.bind(this)}>\n {icon('fas fa-angle-double-up')} {app.translator.trans('core.forum.post_scrubber.original_post_link')}\n </a>\n\n <div className=\"Scrubber-scrollbar\">\n <div className=\"Scrubber-before\" />\n <div className=\"Scrubber-handle\">\n <div className=\"Scrubber-bar\" />\n <div className=\"Scrubber-info\">\n <strong>{viewing}</strong>\n <span className=\"Scrubber-description\" onbeforeupdate={() => this.subtree.update()}>\n {this.description}\n </span>\n </div>\n </div>\n <div className=\"Scrubber-after\" />\n\n <div className=\"Scrubber-unread\" oncreate={styleUnread}>\n {app.translator.trans('core.forum.post_scrubber.unread_text', { count: unreadCount })}\n </div>\n </div>\n\n <a className=\"Scrubber-last\" onclick={this.goToLast.bind(this)}>\n {icon('fas fa-angle-double-down')} {app.translator.trans('core.forum.post_scrubber.now_link')}\n </a>\n </div>\n </div>\n </div>\n );\n }\n\n /**\n * Go to the first post in the discussion.\n */\n goToFirst() {\n this.stream.goToFirst();\n this.index = 0;\n this.renderScrollbar(true);\n }\n\n /**\n * Go to the last post in the discussion.\n */\n goToLast() {\n this.stream.goToLast();\n this.index = this.count();\n this.renderScrollbar(true);\n }\n\n /**\n * Get the number of posts in the discussion.\n */\n count(): number {\n return this.stream?.count() || 0;\n }\n\n /**\n * When the stream is unpaused, update the scrubber to reflect its position.\n */\n streamWasUnpaused() {\n this.update(window.pageYOffset);\n this.renderScrollbar(true);\n }\n\n /**\n * Check whether or not the scrubber should be disabled, i.e. if all of the\n * posts are visible in the viewport.\n */\n disabled(): boolean {\n return this.visible >= this.count();\n }\n\n /**\n * When the page is scrolled, update the scrollbar to reflect the visible\n * posts.\n */\n onscroll(top: number) {\n const stream = this.stream;\n\n if (!stream || stream.paused || !stream.$()) return;\n\n this.update(top);\n this.renderScrollbar();\n }\n\n /**\n * Update the index/visible/description properties according to the window's\n * current scroll position.\n */\n update(scrollTop?: number) {\n const stream = this.stream;\n\n const marginTop = stream.getMarginTop();\n const viewportTop = scrollTop + marginTop;\n const viewportHeight = $(window).height() - marginTop;\n\n // Before looping through all of the posts, we reset the scrollbar\n // properties to a 'default' state. These values reflect what would be\n // seen if the browser were scrolled right up to the top of the page,\n // and the viewport had a height of 0.\n const $items = stream.$('.PostStream-item[data-index]');\n let index = $items.first().data('index') || 0;\n let visible = 0;\n let period = '';\n\n // Now loop through each of the items in the discussion. An 'item' is\n // either a single post or a 'gap' of one or more posts that haven't\n // been loaded yet.\n $items.each(function() {\n const $this = $(this);\n const top = $this.offset().top;\n const height = $this.outerHeight(true);\n\n // If this item is above the top of the viewport, skip to the next\n // one. If it's below the bottom of the viewport, break out of the\n // loop.\n if (top + height < viewportTop) {\n return true;\n }\n if (top > viewportTop + viewportHeight) {\n return false;\n }\n\n // Work out how many pixels of this item are visible inside the viewport.\n // Then add the proportion of this item's total height to the index.\n const visibleTop = Math.max(0, viewportTop - top);\n const visibleBottom = Math.min(height, viewportTop + viewportHeight - top);\n const visiblePost = visibleBottom - visibleTop;\n\n if (top <= viewportTop) {\n index = parseFloat($this.data('index')) + visibleTop / height;\n }\n\n if (visiblePost > 0) {\n visible += visiblePost / height;\n }\n\n // If this item has a time associated with it, then set the\n // scrollbar's current period to a formatted version of this time.\n const time = $this.data('time');\n if (time) period = time;\n });\n\n this.index = index;\n this.visible = visible;\n this.description = period ? dayjs(period).format('MMMM YYYY') : '';\n }\n\n onremove(vnode) {\n super.onremove(vnode);\n\n this.ondestroy();\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n // When the post stream begins loading posts at a certain index, we want our\n // scrubber scrollbar to jump to that position.\n this.stream.on('unpaused', (this.handlers.streamWasUnpaused = this.streamWasUnpaused.bind(this)));\n this.stream.on('update', () => this.update());\n\n this.scrollListener.start();\n\n // Whenever the window is resized, adjust the height of the scrollbar\n // so that it fills the height of the sidebar.\n $(window)\n .on('resize', (this.handlers.onresize = this.onresize.bind(this)))\n .resize();\n\n // When any part of the whole scrollbar is clicked, we want to jump to\n // that position.\n this.$('.Scrubber-scrollbar')\n .on('click', this.onclick.bind(this))\n\n // Now we want to make the scrollbar handle draggable. Let's start by\n // preventing default browser events from messing things up.\n .css({ cursor: 'pointer', 'user-select': 'none' })\n .on('dragstart mousedown touchstart', e => e.preventDefault());\n\n this.$('.Scrubber-handle')\n .css('cursor', 'move')\n .on('mousedown touchstart', this.onmousedown.bind(this))\n\n // Exempt the scrollbar handle from the 'jump to' click event.\n .click(e => e.stopPropagation());\n\n // When the mouse moves and when it is released, we pass the\n // information that we captured when the mouse was first pressed onto\n // some event handlers. These handlers will move the scrollbar/stream-\n // content as appropriate.\n $(document)\n .on('mousemove touchmove', (this.handlers.onmousemove = this.onmousemove.bind(this)))\n .on('mouseup touchend', (this.handlers.onmouseup = this.onmouseup.bind(this)));\n }\n\n ondestroy() {\n this.scrollListener.stop();\n\n this.stream.off('unpaused', this.handlers.streamWasUnpaused);\n\n $(window).off('resize', this.handlers.onresize);\n\n $(document)\n .off('mousemove touchmove', this.handlers.onmousemove)\n .off('mouseup touchend', this.handlers.onmouseup);\n }\n\n /**\n * Update the scrollbar's position to reflect the current values of the\n * index/visible properties.\n */\n renderScrollbar(animate?: boolean) {\n const percentPerPost = this.percentPerPost();\n const index = this.index;\n const count = this.count();\n const visible = this.visible || 1;\n\n const $scrubber = this.$();\n $scrubber.find('.Scrubber-index').text(formatNumber(Math.min(Math.ceil(index + visible), count)));\n $scrubber.find('.Scrubber-description').text(this.description);\n $scrubber.toggleClass('disabled', this.disabled());\n\n const heights = {};\n heights.before = Math.max(0, percentPerPost.index * Math.min(index, count - visible));\n heights.handle = Math.min(100 - heights.before, percentPerPost.visible * visible);\n heights.after = 100 - heights.before - heights.handle;\n\n const func = animate ? 'animate' : 'css';\n for (const part in heights) {\n const $part = $scrubber.find(`.Scrubber-${part}`);\n $part[func]({ height: heights[part] + '%' }, 'fast');\n\n // jQuery likes to put overflow:hidden, but because the scrollbar handle\n // has a negative margin-left, we need to override.\n if (func === 'animate') $part.css('overflow', 'visible');\n }\n }\n\n /**\n * Get the percentage of the height of the scrubber that should be allocated\n * to each post.\n *\n * @property index The percent per post for posts on either side of\n * the visible part of the scrubber.\n * @property visible The percent per post for the visible part of the\n * scrubber.\n */\n percentPerPost(): { index: number; visible: number } {\n const count = this.count() || 1;\n const visible = this.visible || 1;\n\n // To stop the handle of the scrollbar from getting too small when there\n // are many posts, we define a minimum percentage height for the handle\n // calculated from a 50 pixel limit. From this, we can calculate the\n // minimum percentage per visible post. If this is greater than the actual\n // percentage per post, then we need to adjust the 'before' percentage to\n // account for it.\n const minPercentVisible = (50 / this.$('.Scrubber-scrollbar').outerHeight()) * 100;\n const percentPerVisiblePost = Math.max(100 / count, minPercentVisible / visible);\n const percentPerPost = count === visible ? 0 : (100 - percentPerVisiblePost * visible) / (count - visible);\n\n return {\n index: percentPerPost,\n visible: percentPerVisiblePost,\n };\n }\n\n onresize() {\n this.scrollListener.update();\n\n // Adjust the height of the scrollbar so that it fills the height of\n // the sidebar and doesn't overlap the footer.\n const scrubber = this.$();\n const scrollbar = this.$('.Scrubber-scrollbar');\n\n scrollbar.css(\n 'max-height',\n $(window).height() -\n scrubber.offset().top +\n $(window).scrollTop() -\n parseInt($('#app').css('padding-bottom'), 10) -\n (scrubber.outerHeight() - scrollbar.outerHeight())\n );\n }\n\n onmousedown(e: MouseEvent) {\n this.mouseStart = window.TouchEvent && e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;\n this.indexStart = this.index;\n this.dragging = true;\n this.stream.paused = true;\n $('body').css('cursor', 'move');\n }\n\n onmousemove(e: MouseEvent) {\n if (!this.dragging) return;\n\n let y = window.TouchEvent && e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;\n\n // Work out how much the mouse has moved by - first in pixels, then\n // convert it to a percentage of the scrollbar's height, and then\n // finally convert it into an index. Add this delta index onto\n // the index at which the drag was started, and then scroll there.\n const deltaPixels = y - this.mouseStart;\n const deltaPercent = (deltaPixels / this.$('.Scrubber-scrollbar').outerHeight()) * 100;\n const deltaIndex = deltaPercent / this.percentPerPost().index || 0;\n const newIndex = Math.min(this.indexStart + deltaIndex, this.count() - 1);\n\n this.index = Math.max(0, newIndex);\n this.renderScrollbar();\n }\n\n onmouseup() {\n if (!this.dragging) return;\n\n this.mouseStart = 0;\n this.indexStart = 0;\n this.dragging = false;\n $('body').css('cursor', '');\n\n this.$().removeClass('open');\n\n // If the index we've landed on is in a gap, then tell the stream-\n // content that we want to load those posts.\n const intIndex = Math.floor(this.index);\n this.stream.goToIndex(intIndex);\n this.renderScrollbar(true);\n }\n\n onclick(e) {\n // Calculate the index which we want to jump to based on the click position.\n\n // 1. Get the offset of the click from the top of the scrollbar, as a\n // percentage of the scrollbar's height.\n const $scrollbar = this.$('.Scrubber-scrollbar');\n const offsetPixels = (e.clientY || e.originalEvent.touches[0].clientY) - $scrollbar.offset().top + $('body').scrollTop();\n let offsetPercent = (offsetPixels / $scrollbar.outerHeight()) * 100;\n\n // 2. We want the handle of the scrollbar to end up centered on the click\n // position. Thus, we calculate the height of the handle in percent and\n // use that to find a new offset percentage.\n offsetPercent = offsetPercent - parseFloat($scrollbar.find('.Scrubber-handle')[0].style.height) / 2;\n\n // 3. Now we can convert the percentage into an index, and tell the stream-\n // content component to jump to that index.\n let offsetIndex = offsetPercent / this.percentPerPost().index;\n offsetIndex = Math.max(0, Math.min(this.count() - 1, offsetIndex));\n this.stream.goToIndex(Math.floor(offsetIndex));\n this.index = offsetIndex;\n this.renderScrollbar(true);\n\n this.$().removeClass('open');\n }\n}\n","import Component from '../../common/Component';\nimport UserCard from './UserCard';\nimport avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport userOnline from '../../common/helpers/userOnline';\nimport listItems from '../../common/helpers/listItems';\nimport { PostProp } from '../../common/concerns/ComponentProps';\n\n/**\n * The `PostUser` component shows the avatar and username of a post's author.\n */\nexport default class PostUser extends Component<PostProp> {\n /**\n * Whether or not the user hover card is visible.\n */\n cardVisible = false;\n\n view() {\n const post = this.props.post;\n const user = post.user();\n\n if (!user) {\n return (\n <div className=\"PostUser\">\n <h3>\n {avatar(user, { className: 'PostUser-avatar' })} {username(user)}\n </h3>\n </div>\n );\n }\n\n let card = '';\n\n if (!post.isHidden() && this.cardVisible) {\n card = UserCard.component({\n user,\n className: 'UserCard--popover',\n controlsButtonClassName: 'Button Button--icon Button--flat',\n });\n }\n\n return (\n <div className=\"PostUser\">\n <h3>\n <m.route.Link href={app.route.user(user)}>\n {avatar(user, { className: 'PostUser-avatar' })}\n {userOnline(user)}\n {username(user)}\n </m.route.Link>\n </h3>\n <ul className=\"PostUser-badges badges\">{listItems(user.badges().toArray())}</ul>\n {card}\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n let timeout;\n\n this.$()\n .on('mouseover', 'h3 a, .UserCard', () => {\n clearTimeout(timeout);\n timeout = setTimeout(this.showCard.bind(this), 500);\n })\n .on('mouseout', 'h3 a, .UserCard', () => {\n clearTimeout(timeout);\n timeout = setTimeout(this.hideCard.bind(this), 250);\n });\n }\n\n /**\n * Show the user card.\n */\n showCard() {\n this.cardVisible = true;\n\n m.redraw();\n\n setTimeout(() => this.$('.UserCard').addClass('in'));\n }\n\n /**\n * Hide the user card.\n */\n hideCard() {\n this.$('.UserCard')\n .removeClass('in')\n .one('transitionend webkitTransitionEnd oTransitionEnd', () => {\n this.cardVisible = false;\n m.redraw();\n });\n }\n}\n","import UserPage from './UserPage';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport Button from '../../common/components/Button';\nimport Placeholder from '../../common/components/Placeholder';\nimport CommentPost from './CommentPost';\nimport Post from '../../common/models/Post';\n\n/**\n * The `PostsUserPage` component shows a user's activity feed inside of their\n * profile.\n */\nexport default class PostsUserPage extends UserPage {\n /**\n * Whether or not the activity feed is currently loading.\n */\n loading = true;\n\n /**\n * Whether or not there are any more activity items that can be loaded.\n */\n moreResults = false;\n\n /**\n * The Post models in the feed.\n */\n posts: Post[] = [];\n\n /**\n * The number of activity items to load per request.\n */\n loadLimit = 20;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(vnode.attrs.username);\n }\n\n onupdate(vnode) {\n super.onupdate(vnode);\n\n this.loadUser(vnode.attrs.username);\n }\n\n content() {\n if (this.posts.length === 0 && !this.loading) {\n return (\n <div className=\"PostsUserPage\">\n <Placeholder text={app.translator.trans('core.forum.user.posts_empty_text')} />\n </div>\n );\n }\n\n let footer;\n\n if (this.loading) {\n footer = LoadingIndicator.component();\n } else if (this.moreResults) {\n footer = (\n <div className=\"PostsUserPage-loadMore\">\n {Button.component({\n children: app.translator.trans('core.forum.user.posts_load_more_button'),\n className: 'Button',\n onclick: this.loadMore.bind(this),\n })}\n </div>\n );\n }\n\n return (\n <div className=\"PostsUserPage\">\n <ul className=\"PostsUserPage-list\">\n {this.posts.map(post => (\n <li>\n <div className=\"PostsUserPage-discussion\">\n {app.translator.trans('core.forum.user.in_discussion_text', {\n discussion: <m.route.Link href={app.route.post(post)}>{post.discussion().title()}</m.route.Link>,\n })}\n </div>\n {CommentPost.component({ post })}\n </li>\n ))}\n </ul>\n <div className=\"PostsUserPage-loadMore\">{footer}</div>\n </div>\n );\n }\n\n /**\n * Initialize the component with a user, and trigger the loading of their\n * activity feed.\n */\n show(user) {\n super.show(user);\n\n this.refresh();\n }\n\n /**\n * Clear and reload the user's activity feed.\n */\n refresh() {\n this.loading = true;\n this.posts = [];\n\n m.redraw();\n\n this.loadResults().then(this.parseResults.bind(this));\n }\n\n /**\n * Load a new page of the user's activity feed.\n *\n * @param offset The position to start getting results from.\n */\n protected loadResults(offset?: number): Promise<Post[]> {\n return app.store.find<Post>('posts', {\n filter: {\n user: this.user.id(),\n type: 'comment',\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n\n /**\n * Load the next page of results.\n */\n loadMore() {\n this.loading = true;\n this.loadResults(this.posts.length).then(this.parseResults.bind(this));\n }\n\n /**\n * Parse results and append them to the activity feed.\n */\n parseResults(results: Post[]): Post[] {\n this.loading = false;\n\n [].push.apply(this.posts, results);\n\n this.moreResults = results.length >= this.loadLimit;\n m.redraw();\n\n return results;\n }\n}\n","import Component from '../../common/Component';\nimport avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport DiscussionControls from '../utils/DiscussionControls';\nimport { DiscussionProp } from '../../common/concerns/ComponentProps';\n\n/**\n * The `ReplyPlaceholder` component displays a placeholder for a reply, which,\n * when clicked, opens the reply composer.\n */\nexport default class ReplyPlaceholder<T extends DiscussionProp = DiscussionProp> extends Component<T> {\n view() {\n // TODO: add method & remove `false &&`\n if (false && app.composingReplyTo(this.props.discussion)) {\n return (\n <article className=\"Post CommentPost editing\">\n <header className=\"Post-header\">\n <div className=\"PostUser\">\n <h3>\n {avatar(app.session.user, { className: 'PostUser-avatar' })}\n {username(app.session.user)}\n </h3>\n </div>\n </header>\n <div className=\"Post-body\" oncreate={this.oncreatePreview.bind(this)} />\n </article>\n );\n }\n\n const reply = () => DiscussionControls.replyAction.call(this.props.discussion, true);\n\n return (\n <article className=\"Post ReplyPlaceholder\" onclick={reply}>\n <header className=\"Post-header\">\n {avatar(app.session.user, { className: 'PostUser-avatar' })} {app.translator.trans('core.forum.post_stream.reply_placeholder')}\n </header>\n </article>\n );\n }\n\n oncreatePreview(vnode) {\n // Every 50ms, if the composer content has changed, then update the post's\n // body with a preview.\n let preview;\n const updateInterval = setInterval(() => {\n // Since we're polling, the composer may have been closed in the meantime,\n // so we bail in that case.\n if (!app.composer.component) return;\n\n const content = app.composer.component.content();\n\n if (preview === content) return;\n\n preview = content;\n\n const anchorToBottom = $(window).scrollTop() + $(window).height() >= $(document).height();\n\n s9e.TextFormatter.preview(preview || '', vnode.dom);\n\n if (anchorToBottom) {\n $(window).scrollTop($(document).height());\n }\n }, 50);\n\n vnode.attrs.onunload = () => clearInterval(updateInterval);\n }\n}\n","import Component from '../../common/Component';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport ItemList from '../../common/utils/ItemList';\nimport KeyboardNavigatable from '../utils/KeyboardNavigatable';\nimport icon from '../../common/helpers/icon';\nimport DiscussionsSearchSource from './DiscussionsSearchSource';\nimport UsersSearchSource from './UsersSearchSource';\nimport SearchSource from './SearchSource';\n\nimport Stream from 'mithril/stream';\n\n/**\n * The `Search` component displays a menu of as-you-type results from a variety\n * of sources.\n *\n * The search box will be 'activated' if the app's current controller implements\n * a `searching` method that returns a truthy value. If this is the case, an 'x'\n * button will be shown next to the search field, and clicking it will call the\n * `clearSearch` method on the controller.\n */\nexport default class Search extends Component {\n /**\n * The value of the search input.\n */\n value: Stream<string> = m.prop('');\n\n /**\n * Whether or not the search input has focus.\n */\n hasFocus: boolean = false;\n\n /**\n * An array of SearchSources.\n */\n sources: SearchSource[] = null;\n\n /**\n * The number of sources that are still loading results.\n */\n loadingSources = 0;\n\n /**\n * A list of queries that have been searched for.\n */\n searched: string[] = [];\n\n /**\n * The index of the currently-selected <li> in the results list. This can be\n * a unique string (to account for the fact that an item's position may jump\n * around as new results load), but otherwise it will be numeric (the\n * sequential position within the list).\n */\n index: string | number = 0;\n\n navigator: KeyboardNavigatable;\n\n searchTimeout: number;\n\n view() {\n const currentSearch = this.getCurrentSearch();\n\n // Initialize search input value in the view rather than the constructor so\n // that we have access to app.current.\n if (typeof this.value() === 'undefined') {\n this.value(currentSearch || '');\n }\n\n // Initialize search sources in the view rather than the constructor so\n // that we have access to app.forum.\n if (!this.sources) {\n this.sources = this.sourceItems().toArray();\n }\n\n // Hide the search view if no sources were loaded\n if (!this.sources.length) return <div />;\n\n return (\n <div\n className={classNames(\n 'Search',\n this.value() && this.hasFocus && 'open',\n this.hasFocus && 'focused',\n !!currentSearch && 'active',\n !!this.loadingSources && 'loading'\n )}\n >\n <div className=\"Search-input\">\n <input\n className=\"FormControl\"\n type=\"search\"\n placeholder={app.translator.transText('core.forum.header.search_placeholder')}\n value={this.value()}\n oninput={m.withAttr('value', this.value)}\n onfocus={() => (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n />\n {this.loadingSources ? (\n LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' })\n ) : currentSearch ? (\n <button className=\"Search-clear Button Button--icon Button--link\" onclick={this.clear.bind(this)}>\n {icon('fas fa-times-circle')}\n </button>\n ) : (\n ''\n )}\n </div>\n <ul className=\"Dropdown-menu Search-results\">\n {this.value() && this.hasFocus ? this.sources.map(source => source.view(this.value())) : ''}\n </ul>\n </div>\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n // Highlight the item that is currently selected.\n this.setIndex(this.getCurrentNumericIndex());\n\n const search = this;\n\n this.$('.Search-results')\n .on('mousedown', e => e.preventDefault())\n .on('click', () => this.$('input').blur())\n\n // Whenever the mouse is hovered over a search result, highlight it.\n .on('mouseenter', '> li:not(.Dropdown-header)', function() {\n search.setIndex(search.selectableItems().index(this));\n });\n\n const $input = this.$('input');\n\n this.navigator = new KeyboardNavigatable();\n\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.selectResult.bind(this))\n .onCancel(this.clear.bind(this))\n .bindTo($input);\n\n // Handle input key events on the search input, triggering results to load.\n $input\n .on('input focus', function(this: HTMLInputElement) {\n const query = this.value.toLowerCase();\n\n if (!query) return;\n\n clearTimeout(search.searchTimeout);\n search.searchTimeout = setTimeout(() => {\n if (search.searched.indexOf(query) !== -1) return;\n\n if (query.length >= 3) {\n search.sources.map(source => {\n if (!source.search) return;\n\n search.loadingSources++;\n\n source.search(query).then(() => {\n search.loadingSources = Math.max(0, search.loadingSources - 1);\n m.redraw();\n });\n });\n }\n\n search.searched.push(query);\n m.redraw();\n }, 250);\n })\n\n .on('focus', function() {\n $(this)\n .one('mouseup', e => e.preventDefault())\n .select();\n });\n }\n\n /**\n * Get the active search in the app's current controller.\n *\n * @return {String}\n */\n getCurrentSearch() {\n return app.current && typeof app.current.searching === 'function' && app.current.searching();\n }\n\n /**\n * Navigate to the currently selected search result and close the list.\n */\n selectResult() {\n clearTimeout(this.searchTimeout);\n this.loadingSources = 0;\n\n if (this.value()) {\n m.route.set(\n this.getItem(this.index)\n .find('a')\n .attr('href')\n );\n } else {\n this.clear();\n }\n\n this.$('input').blur();\n }\n\n /**\n * Clear the search input and the current controller's active search.\n */\n clear() {\n this.value('');\n\n if (this.getCurrentSearch()) {\n app.current.clearSearch();\n } else {\n m.redraw();\n }\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n if (app.forum.attribute('canViewDiscussions')) items.add('discussions', new DiscussionsSearchSource());\n if (app.forum.attribute('canViewUserList')) items.add('users', new UsersSearchSource());\n\n return items;\n }\n\n /**\n * Get all of the search result items that are selectable.\n *\n * @return {jQuery}\n */\n selectableItems() {\n return this.$('.Search-results > li:not(.Dropdown-header)');\n }\n\n /**\n * Get the position of the currently selected search result item.\n *\n * @return {Integer}\n */\n getCurrentNumericIndex() {\n return this.selectableItems().index(this.getItem(this.index));\n }\n\n /**\n * Get the <li> in the search results with the given index (numeric or named).\n *\n * @param {String} index\n * @return {DOMElement}\n */\n getItem(index) {\n const $items = this.selectableItems();\n let $item = $items.filter(`[data-index=\"${index}\"]`);\n\n if (!$item.length) {\n $item = $items.eq(index);\n }\n\n return $item;\n }\n\n /**\n * Set the currently-selected search result item to the one with the given\n * index.\n *\n * @param index\n * @param scrollToItem Whether or not to scroll the dropdown so that\n * the item is in view.\n */\n setIndex(index: number, scrollToItem?: boolean) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n let fixedIndex = index;\n if (index < 0) {\n fixedIndex = $items.length - 1;\n } else if (index >= $items.length) {\n fixedIndex = 0;\n }\n\n const $item = $items\n .removeClass('active')\n .eq(fixedIndex)\n .addClass('active');\n\n this.index = $item.attr('data-index') || fixedIndex;\n\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.animate({ scrollTop }, 100);\n }\n }\n }\n}\n","export default abstract class SearchSource {\n abstract view(vnode: string);\n\n abstract search(query: string);\n}\n","import avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport Dropdown from '../../common/components/Dropdown';\nimport LinkButton from '../../common/components/LinkButton';\nimport Button from '../../common/components/Button';\nimport ItemList from '../../common/utils/ItemList';\nimport Separator from '../../common/components/Separator';\nimport Group from '../../common/models/Group';\n\n/**\n * The `SessionDropdown` component shows a button with the current user's\n * avatar/name, with a dropdown of session controls.\n */\nexport default class SessionDropdown extends Dropdown {\n static initProps(props) {\n super.initProps(props);\n\n props.className = 'SessionDropdown';\n props.buttonClassName = 'Button Button--user Button--flat';\n props.menuClassName = 'Dropdown-menu--right';\n }\n\n view() {\n this.props.children = this.items().toArray();\n\n return super.view();\n }\n\n getButtonContent() {\n const user = app.session.user;\n\n return [avatar(user), ' ', <span className=\"Button-label\">{username(user)}</span>];\n }\n\n /**\n * Build an item list for the contents of the dropdown menu.\n */\n items(): ItemList {\n const items = new ItemList();\n const user = app.session.user;\n\n items.add(\n 'profile',\n LinkButton.component({\n icon: 'fas fa-user',\n children: app.translator.trans('core.forum.header.profile_button'),\n href: app.route.user(user),\n }),\n 100\n );\n\n items.add(\n 'settings',\n LinkButton.component({\n icon: 'fas fa-cog',\n children: app.translator.trans('core.forum.header.settings_button'),\n href: app.route('settings'),\n }),\n 50\n );\n\n if (app.forum.attribute('adminUrl')) {\n items.add(\n 'administration',\n LinkButton.component({\n icon: 'fas fa-wrench',\n children: app.translator.trans('core.forum.header.admin_button'),\n href: app.forum.attribute('adminUrl'),\n target: '_blank',\n }),\n 0\n );\n }\n\n items.add('separator', Separator.component(), -90);\n\n items.add(\n 'logOut',\n Button.component({\n icon: 'fas fa-sign-out-alt',\n children: app.translator.trans('core.forum.header.log_out_button'),\n onclick: app.session.logout.bind(app.session),\n }),\n -100\n );\n\n return items;\n }\n}\n","import listItems from '../../common/helpers/listItems';\nimport ItemList from '../../common/utils/ItemList';\nimport Button from '../../common/components/Button';\nimport FieldSet from '../../common/components/FieldSet';\nimport Switch from '../../common/components/Switch';\nimport UserPage from './UserPage';\nimport NotificationGrid from './NotificationGrid';\nimport ChangePasswordModal from './ChangePasswordModal';\nimport ChangeEmailModal from './ChangeEmailModal';\n\nexport default class SettingsPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.show(app.session.user);\n app.setTitle(app.translator.transText('core.forum.settings.title'));\n }\n\n content() {\n return (\n <div className=\"SettingsPage\">\n <ul>{listItems(this.settingsItems().toArray())}</ul>\n </div>\n );\n }\n\n /**\n * Build an item list for the user's settings controls.\n */\n settingsItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'account',\n FieldSet.component({\n label: app.translator.trans('core.forum.settings.account_heading'),\n className: 'Settings-account',\n children: this.accountItems().toArray(),\n })\n );\n\n items.add(\n 'notifications',\n FieldSet.component({\n label: app.translator.trans('core.forum.settings.notifications_heading'),\n className: 'Settings-notifications',\n children: this.notificationsItems().toArray(),\n })\n );\n\n items.add(\n 'privacy',\n FieldSet.component({\n label: app.translator.trans('core.forum.settings.privacy_heading'),\n className: 'Settings-privacy',\n children: this.privacyItems().toArray(),\n })\n );\n\n return items;\n }\n\n /**\n * Build an item list for the user's account settings.\n */\n accountItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'changePassword',\n Button.component({\n children: app.translator.trans('core.forum.settings.change_password_button'),\n className: 'Button',\n onclick: () => app.modal.show(ChangePasswordModal),\n })\n );\n\n items.add(\n 'changeEmail',\n Button.component({\n children: app.translator.trans('core.forum.settings.change_email_button'),\n className: 'Button',\n onclick: () => app.modal.show(ChangeEmailModal),\n })\n );\n\n return items;\n }\n\n /**\n * Build an item list for the user's notification settings.\n */\n notificationsItems(): ItemList {\n const items = new ItemList();\n\n items.add('notificationGrid', NotificationGrid.component({ user: this.user }));\n\n return items;\n }\n\n /**\n * Generate a callback that will save a value to the given preference.\n */\n preferenceSaver(key: string): Function {\n return (value, component) => {\n if (component) component.loading = true;\n m.redraw();\n\n this.user.savePreferences({ [key]: value }).then(() => {\n if (component) component.loading = false;\n m.redraw();\n });\n };\n }\n\n /**\n * Build an item list for the user's privacy settings.\n */\n privacyItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'discloseOnline',\n Switch.component({\n children: app.translator.trans('core.forum.settings.privacy_disclose_online_label'),\n state: this.user.preferences().discloseOnline,\n onchange: (value, component) => this.preferenceSaver('discloseOnline')(value, component),\n })\n );\n\n return items;\n }\n}\n","import Stream from 'mithril/stream';\n\nimport { ComponentProps } from '../../common/Component';\nimport Modal from '../../common/components/Modal';\nimport ItemList from '../../common/utils/ItemList';\nimport Button from '../../common/components/Button';\n\nimport LogInButtons from './LogInButtons';\nimport LogInModal from './LogInModal';\n\nexport interface SignUpModalProps extends ComponentProps {\n username?: string;\n email?: string;\n password?: string;\n\n /**\n * An email token to sign up with\n */\n token?: string;\n\n provided?: string[];\n}\n\n/**\n * The `SignUpModal` component displays a modal dialog with a singup form.\n */\nexport default class SignUpModal extends Modal<SignUpModalProps> {\n /**\n * The value of the username input.\n */\n username!: Stream<string>;\n\n /**\n * The value of the email input.\n */\n email!: Stream<string>;\n\n /**\n * The value of the password input.\n */\n password!: Stream<string>;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.username = m.prop(this.props.username || '');\n\n this.email = m.prop(this.props.email || '');\n\n this.password = m.prop(this.props.password || '');\n }\n\n className() {\n return 'Modal--small SignUpModal';\n }\n\n title() {\n return app.translator.transText('core.forum.sign_up.title');\n }\n\n content() {\n return [<div className=\"Modal-body\">{this.body()}</div>, <div className=\"Modal-footer\">{this.footer()}</div>];\n }\n\n isProvided(field) {\n return this.props.provided && this.props.provided.indexOf(field) !== -1;\n }\n\n body() {\n return [this.props.token ? '' : <LogInButtons />, <div className=\"Form Form--centered\">{this.fields().toArray()}</div>];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add(\n 'username',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"username\"\n type=\"text\"\n placeholder={app.translator.transText('core.forum.sign_up.username_placeholder')}\n value={this.username()}\n onchange={m.withAttr('value', this.username)}\n disabled={this.loading || this.isProvided('username')}\n />\n </div>,\n 30\n );\n\n items.add(\n 'email',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"email\"\n type=\"email\"\n placeholder={app.translator.transText('core.forum.sign_up.email_placeholder')}\n value={this.email()}\n onchange={m.withAttr('value', this.email)}\n disabled={this.loading || this.isProvided('email')}\n />\n </div>,\n 20\n );\n\n if (!this.props.token) {\n items.add(\n 'password',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"password\"\n type=\"password\"\n placeholder={app.translator.transText('core.forum.sign_up.password_placeholder')}\n value={this.password()}\n onchange={m.withAttr('value', this.password)}\n disabled={this.loading}\n />\n </div>,\n 10\n );\n }\n\n items.add(\n 'submit',\n <div className=\"Form-group\">\n <Button className=\"Button Button--primary Button--block\" type=\"submit\" loading={this.loading}>\n {app.translator.trans('core.forum.sign_up.submit_button')}\n </Button>\n </div>,\n -10\n );\n\n return items;\n }\n\n footer() {\n return [\n <p className=\"SignUpModal-logIn\">\n {app.translator.trans('core.forum.sign_up.log_in_text', {\n a: <a onclick={this.logIn.bind(this)} />,\n })}\n </p>,\n ];\n }\n\n /**\n * Open the log in modal, prefilling it with an email/username/password if\n * the user has entered one.\n *\n * @public\n */\n logIn() {\n const props = {\n identification: this.email() || this.username(),\n password: this.password(),\n };\n\n app.modal.show(LogInModal, props);\n }\n\n onready() {\n if (this.props.username && !this.props.email) {\n this.$('[name=email]').select();\n } else {\n this.$('[name=username]').select();\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const data = this.submitData();\n\n app.request({\n url: app.forum.attribute('baseUrl') + '/register',\n method: 'POST',\n data,\n errorHandler: this.onerror.bind(this),\n }).then(() => window.location.reload(), this.loaded.bind(this));\n }\n\n /**\n * Get the data that should be submitted in the sign-up request.\n *\n * @return {Object}\n * @public\n */\n submitData() {\n const data = {\n username: this.username(),\n email: this.email(),\n };\n\n if (this.props.token) {\n data.token = this.props.token;\n } else {\n data.password = this.password();\n }\n\n return data;\n }\n}\n","import Component from '../../common/Component';\nimport humanTime from '../../common/helpers/humanTime';\nimport icon from '../../common/helpers/icon';\nimport Post from '../../common/models/Post';\nimport { DiscussionProp } from '../../common/concerns/ComponentProps';\n\nexport interface TerminalPostProps extends DiscussionProp {\n lastPost: Post;\n}\n\n/**\n * Displays information about a the first or last post in a discussion.\n */\nexport default class TerminalPost<T extends TerminalPostProps = TerminalPostProps> extends Component<T> {\n view() {\n const discussion = this.props.discussion;\n const lastPost = this.props.lastPost && discussion.replyCount();\n\n const user = discussion[lastPost ? 'lastPostedUser' : 'user']();\n const time = discussion[lastPost ? 'lastPostedAt' : 'createdAt']();\n\n return (\n <span>\n {lastPost ? icon('fas fa-reply') : ''}{' '}\n {app.translator.trans(`core.forum.discussion_list.${lastPost ? 'replied' : 'started'}_text`, {\n user,\n ago: humanTime(time),\n })}\n </span>\n );\n }\n}\n","import Component, { ComponentProps } from '../../common/Component';\nimport humanTime from '../../common/utils/humanTime';\nimport ItemList from '../../common/utils/ItemList';\nimport UserControls from '../utils/UserControls';\nimport avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport icon from '../../common/helpers/icon';\nimport Dropdown from '../../common/components/Dropdown';\nimport AvatarEditor from './AvatarEditor';\nimport listItems from '../../common/helpers/listItems';\nimport User from '../../common/models/User';\n\nexport interface UserCardProps extends ComponentProps {\n user: User;\n editable: boolean;\n controlsButtonClassName: string;\n}\n\n/**\n * The `UserCard` component displays a user's profile card. This is used both on\n * the `UserPage` (in the hero) and in discussions, shown when hovering over a\n * post author.\n */\nexport default class UserCard extends Component<UserCardProps> {\n view() {\n const user = this.props.user;\n const controls = UserControls.controls(user, this).toArray();\n const color = user.color();\n const badges = user.badges().toArray();\n\n return (\n <div className={'UserCard ' + (this.props.className || '')} style={color ? { backgroundColor: color } : ''}>\n <div className=\"darkenBackground\">\n <div className=\"container\">\n {controls.length\n ? Dropdown.component({\n children: controls,\n className: 'UserCard-controls App-primaryControl',\n menuClassName: 'Dropdown-menu--right',\n buttonClassName: this.props.controlsButtonClassName,\n label: app.translator.trans('core.forum.user_controls.button'),\n icon: 'fas fa-ellipsis-v',\n })\n : ''}\n\n <div className=\"UserCard-profile\">\n <h2 className=\"UserCard-identity\">\n {this.props.editable ? (\n [AvatarEditor.component({ user, className: 'UserCard-avatar' }), username(user)]\n ) : (\n <m.route.Link href={app.route.user(user)}>\n <div className=\"UserCard-avatar\">{avatar(user)}</div>\n {username(user)}\n </m.route.Link>\n )}\n </h2>\n\n {badges.length ? <ul className=\"UserCard-badges badges\">{listItems(badges)}</ul> : ''}\n\n <ul className=\"UserCard-info\">{listItems(this.infoItems().toArray())}</ul>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n /**\n * Build an item list of tidbits of info to show on this user's profile.\n *\n * @return {ItemList}\n */\n infoItems() {\n const items = new ItemList();\n const user = this.props.user;\n const lastSeenAt = user.lastSeenAt();\n\n if (lastSeenAt) {\n const online = user.isOnline();\n\n items.add(\n 'lastSeen',\n <span className={'UserCard-lastSeen' + (online ? ' online' : '')}>\n {online\n ? [icon('fas fa-circle'), ' ', app.translator.trans('core.forum.user.online_text')]\n : [icon('far fa-clock'), ' ', humanTime(lastSeenAt)]}\n </span>\n );\n }\n\n items.add('joined', app.translator.trans('core.forum.user.joined_date_text', { ago: humanTime(user.joinTime()) }));\n\n return items;\n }\n}\n","import Page from './Page';\nimport ItemList from '../../common/utils/ItemList';\nimport affixSidebar from '../utils/affixSidebar';\nimport UserCard from './UserCard';\nimport LoadingIndicator from '../../common/components/LoadingIndicator';\nimport SelectDropdown from '../../common/components/SelectDropdown';\nimport LinkButton from '../../common/components/LinkButton';\nimport Separator from '../../common/components/Separator';\nimport listItems from '../../common/helpers/listItems';\n\nimport User from '../../common/models/User';\n\n/**\n * The `UserPage` component shows a user's profile. It can be extended to show\n * content inside of the content area. See `ActivityPage` and `SettingsPage` for\n * examples.\n */\nexport default abstract class UserPage extends Page {\n /**\n * The user this page is for.\n */\n user: User;\n bodyClass: string = 'App--user';\n\n /**\n * The username of the currently loaded user\n */\n username: string;\n\n view() {\n return (\n <div className=\"UserPage\">\n {this.user\n ? [\n UserCard.component({\n user: this.user,\n className: 'Hero UserHero',\n editable: this.user.canEdit() || this.user === app.session.user,\n controlsButtonClassName: 'Button',\n }),\n <div className=\"container\">\n <div className=\"sideNavContainer\">\n <nav className=\"sideNav UserPage-nav\" config={affixSidebar}>\n <ul>{listItems(this.sidebarItems().toArray())}</ul>\n </nav>\n <div className=\"sideNavOffset UserPage-content\">{this.content()}</div>\n </div>\n </div>,\n ]\n : [LoadingIndicator.component({ lassName: 'LoadingIndicator--block' })]}\n </div>\n );\n }\n\n /**\n * Get the content to display in the user page.\n */\n abstract content();\n\n /**\n * Initialize the component with a user, and trigger the loading of their\n * activity feed.\n */\n protected show(user: User) {\n this.user = user;\n\n app.setTitle(user.displayName());\n\n m.redraw();\n }\n\n /**\n * Given a username, load the user's profile from the store, or make a request\n * if we don't have it yet. Then initialize the profile page with that user.\n */\n loadUser(username: string) {\n const lowercaseUsername = username.toLowerCase();\n\n // Load the preloaded user object, if any, into the global app store\n // We don't use the output of the method because it returns raw JSON\n // instead of the parsed models\n app.preloadedApiDocument();\n\n if (lowercaseUsername == this.username) return;\n\n this.username = lowercaseUsername;\n\n app.store.all<User>('users').some(user => {\n if ((user.username().toLowerCase() === lowercaseUsername || user.id() === username) && user.joinTime()) {\n this.show(user);\n return true;\n }\n });\n\n if (!this.user) {\n app.store.find('users', username).then(this.show.bind(this));\n }\n }\n\n /**\n * Build an item list for the content of the sidebar.\n */\n sidebarItems() {\n const items = new ItemList();\n\n items.add(\n 'nav',\n SelectDropdown.component({\n children: this.navItems().toArray(),\n className: 'App-titleControl',\n buttonClassName: 'Button',\n })\n );\n\n return items;\n }\n\n /**\n * Build an item list for the navigation in the sidebar.\n */\n navItems() {\n const items = new ItemList();\n const user = this.user;\n\n items.add(\n 'posts',\n LinkButton.component({\n href: app.route('user.posts', { username: user.username() }),\n children: [app.translator.trans('core.forum.user.posts_link'), <span className=\"Button-badge\">{user.commentCount()}</span>],\n icon: 'far fa-comment',\n }),\n 100\n );\n\n items.add(\n 'discussions',\n LinkButton.component({\n href: app.route('user.discussions', { username: user.username() }),\n children: [app.translator.trans('core.forum.user.discussions_link'), <span className=\"Button-badge\">{user.discussionCount()}</span>],\n icon: 'fas fa-bars',\n }),\n 90\n );\n\n if (app.session.user === user) {\n items.add('separator', Separator.component(), -90);\n items.add(\n 'settings',\n LinkButton.component({\n href: app.route('settings'),\n children: app.translator.trans('core.forum.user.settings_link'),\n icon: 'fas fa-cog',\n }),\n -100\n );\n }\n\n return items;\n }\n}\n","import highlight from '../../common/helpers/highlight';\nimport avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport SearchSource from './SearchSource';\nimport User from '../../common/models/User';\n\n/**\n * The `UsersSearchSource` finds and displays user search results in the search\n * dropdown.\n *\n * @implements SearchSource\n */\nexport default class UsersSearchSource extends SearchSource {\n protected results: { [key: string]: User[] } = {};\n\n search(query: string) {\n return app.store\n .find<User>('users', {\n filter: { q: query },\n page: { limit: 5 },\n })\n .then(results => {\n this.results[query] = results;\n m.redraw();\n });\n }\n\n view(query: string) {\n query = query.toLowerCase();\n\n const results = (this.results[query] || [])\n .concat(\n app.store\n .all<User>('users')\n .filter(user => [user.username(), user.displayName()].some(value => value.toLowerCase().substr(0, query.length) === query))\n )\n .filter((e, i, arr) => arr.lastIndexOf(e) === i)\n .sort((a, b) => a.displayName().localeCompare(b.displayName()));\n\n if (!results.length) return '';\n\n return [\n <li className=\"Dropdown-header\">{app.translator.trans('core.forum.search.users_heading')}</li>,\n results.map(user => {\n const name = username(user);\n\n if (!name.children) {\n name.children = [name.text];\n delete name.text;\n }\n\n name.children[0] = highlight(name.children[0], query);\n\n return (\n <li className=\"UserSearchResult\" data-index={'users' + user.id()}>\n <m.route.Link href={app.route.user(user)}>\n {avatar(user)}\n {name}\n </m.route.Link>\n </li>\n );\n }),\n ];\n }\n}\n","import Component from '../../common/Component';\nimport Button from '../../common/components/Button';\n\n/**\n * The `WelcomeHero` component displays a hero that welcomes the user to the\n * forum.\n */\nexport default class WelcomeHero extends Component {\n hidden = !!localStorage.getItem('welcomeHidden');\n\n view() {\n if (this.hidden) return <div />;\n\n const slideUp = () => this.$().slideUp(this.hide.bind(this));\n\n return (\n <header className=\"Hero WelcomeHero\">\n <div class=\"container\">\n <Button icon=\"fas fa-times\" className=\"Hero-close Button Button--icon Button--link\" onclick={slideUp} />\n\n <div className=\"containerNarrow\">\n <h2 className=\"Hero-title\">{app.forum.attribute('welcomeTitle')}</h2>\n <div className=\"Hero-subtitle\">{m.trust(app.forum.attribute('welcomeMessage'))}</div>\n </div>\n </div>\n </header>\n );\n }\n\n /**\n * Hide the welcome hero.\n */\n hide() {\n localStorage.setItem('welcomeHidden', 'true');\n\n this.hidden = true;\n }\n}\n","import Forum from './Forum';\n\nconst app = new Forum();\n\n// @ts-ignore\nwindow.app = app;\n\nexport { app };\n\n// Export compat API\nimport compat from './compat';\n\ncompat.app = app;\n\nexport { compat };\n","import IndexPage from './components/IndexPage';\nimport DiscussionPage from './components/DiscussionPage';\nimport PostsUserPage from './components/PostsUserPage';\nimport DiscussionsUserPage from './components/DiscussionsUserPage';\nimport SettingsPage from './components/SettingsPage';\n\nimport Discussion from '../common/models/Discussion';\nimport Post from '../common/models/Post';\nimport User from '../common/models/User';\n\nexport default app => {\n app.routes = {\n index: { path: '/all', component: IndexPage },\n\n discussion: { path: '/d/:id', component: DiscussionPage },\n 'discussion.near': { path: '/d/:id/:near', component: DiscussionPage },\n\n user: { path: '/u/:username', component: PostsUserPage },\n 'user.posts': { path: '/u/:username', component: PostsUserPage },\n 'user.discussions': { path: '/u/:username/discussions', component: DiscussionsUserPage },\n\n settings: { path: '/settings', component: SettingsPage },\n\n 'index.filter': { path: '/:filter', component: IndexPage },\n };\n\n /**\n * Generate a URL to a discussion.\n */\n app.route.discussion = (discussion: Discussion, near?: number): string => {\n const slug = discussion?.slug();\n const hasNear = near && near !== 1;\n\n return app.route(hasNear ? 'discussion.near' : 'discussion', {\n id: discussion.id() + (slug.trim() ? '-' + slug : ''),\n near: hasNear && near,\n });\n };\n\n /**\n * Generate a URL to a post.\n */\n app.route.post = (post: Post): string => {\n return app.route.discussion(post.discussion(), post.number());\n };\n\n /**\n * Generate a URL to a user.\n */\n app.route.user = (user: User): string => {\n return app.route('user', {\n username: user.username(),\n });\n };\n};\n","import DiscussionPage from '../components/DiscussionPage';\n// import ReplyComposer from '../components/ReplyComposer';\nimport LogInModal from '../components/LogInModal';\nimport Button from '../../common/components/Button';\nimport Separator from '../../common/components/Separator';\n// import RenameDiscussionModal from '../components/RenameDiscussionModal';\nimport ItemList from '../../common/utils/ItemList';\nimport extractText from '../../common/utils/extractText';\nimport Discussion from '../../common/models/Discussion';\n\n/**\n * The `DiscussionControls` utility constructs a list of buttons for a\n * discussion which perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a discussion.\n *\n * @param discussion\n * @param context The parent component under which the controls menu will\n * be displayed\n * @public\n */\n controls(discussion: Discussion, context): ItemList {\n const items = new ItemList();\n\n ['user', 'moderation', 'destructive'].forEach(section => {\n const controls = this[section](discussion, context).toArray();\n if (controls.length) {\n controls.forEach(item => items.add(item.itemName, item));\n items.add(section + 'Separator', Separator.component());\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for a discussion pertaining to the current user (e.g. reply,\n * follow).\n *\n * @param discussion\n * @param context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n user(discussion: Discussion, context: any): ItemList {\n const items = new ItemList();\n\n // Only add a reply control if this is the discussion's controls dropdown\n // for the discussion page itself. We don't want it to show up for\n // discussions in the discussion list, etc.\n if (context instanceof DiscussionPage) {\n items.add(\n 'reply',\n !app.session.user || discussion.canReply()\n ? Button.component({\n icon: 'fas fa-reply',\n children: app.translator.trans(\n app.session.user\n ? 'core.forum.discussion_controls.reply_button'\n : 'core.forum.discussion_controls.log_in_to_reply_button'\n ),\n onclick: this.replyAction.bind(discussion, true, false),\n })\n : Button.component({\n icon: 'fas fa-reply',\n children: app.translator.trans('core.forum.discussion_controls.cannot_reply_button'),\n className: 'disabled',\n title: app.translator.transText('core.forum.discussion_controls.cannot_reply_text'),\n })\n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a discussion pertaining to moderation (e.g. rename, lock).\n *\n * @param discussion\n * @param context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n moderation(discussion): ItemList {\n const items = new ItemList();\n\n if (discussion.canRename()) {\n items.add(\n 'rename',\n Button.component({\n icon: 'fas fa-pencil-alt',\n children: app.translator.trans('core.forum.discussion_controls.rename_button'),\n onclick: this.renameAction.bind(discussion),\n })\n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a discussion which are destructive (e.g. delete).\n *\n * @param discussion\n * @param context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n destructive(discussion: Discussion): ItemList {\n const items = new ItemList();\n\n if (!discussion.isHidden()) {\n if (discussion.canHide()) {\n items.add(\n 'hide',\n Button.component({\n icon: 'far fa-trash-alt',\n children: app.translator.trans('core.forum.discussion_controls.delete_button'),\n onclick: this.hideAction.bind(discussion),\n })\n );\n }\n } else {\n if (discussion.canHide()) {\n items.add(\n 'restore',\n Button.component({\n icon: 'fas fa-reply',\n children: app.translator.trans('core.forum.discussion_controls.restore_button'),\n onclick: this.restoreAction.bind(discussion),\n })\n );\n }\n\n if (discussion.canDelete()) {\n items.add(\n 'delete',\n Button.component({\n icon: 'fas fa-times',\n children: app.translator.trans('core.forum.discussion_controls.delete_forever_button'),\n onclick: this.deleteAction.bind(discussion),\n })\n );\n }\n }\n\n return items;\n },\n\n /**\n * Open the reply composer for the discussion. A promise will be returned,\n * which resolves when the composer opens successfully. If the user is not\n * logged in, they will be prompted. If they don't have permission to\n * reply, the promise will be rejected.\n *\n * @param goToLast Whether or not to scroll down to the last post if\n * the discussion is being viewed.\n * @param forceRefresh Whether or not to force a reload of the\n * composer component, even if it is already open for this discussion.\n */\n replyAction(this: Discussion, goToLast: boolean, forceRefresh: boolean): Promise<any> {\n return new Promise((resolve, reject) => {\n if (app.session.user) {\n if (this.canReply()) {\n let component = app.composer.component;\n if (!app.composingReplyTo(this) || forceRefresh) {\n component = new ReplyComposer({\n user: app.session.user,\n discussion: this,\n });\n app.composer.load(component);\n }\n\n app.composer.show();\n\n if (goToLast && app.viewingDiscussion(this) && !app.composer.isFullScreen()) {\n app.current.stream.goToNumber('reply');\n }\n\n return resolve(component);\n } else {\n return reject();\n }\n }\n\n app.modal.show(LogInModal);\n\n reject();\n });\n },\n\n /**\n * Hide a discussion.\n */\n hideAction(this: Discussion) {\n this.pushAttributes({ hiddenAt: new Date(), hiddenUser: app.session.user });\n\n return this.save({ isHidden: true });\n },\n\n /**\n * Restore a discussion.\n */\n restoreAction(this: Discussion) {\n this.pushAttributes({ hiddenAt: null, hiddenUser: null });\n\n return this.save({ isHidden: false });\n },\n\n /**\n * Delete the discussion after confirming with the user.\n */\n deleteAction(this: Discussion) {\n if (confirm(extractText(app.translator.trans('core.forum.discussion_controls.delete_confirmation')))) {\n // If we're currently viewing the discussion that was deleted, go back\n // to the previous page.\n if (app.viewingDiscussion(this)) {\n app.history.back();\n }\n\n return this.delete().then(() => {\n // If there is a discussion list in the cache, remove this discussion.\n if (app.cache.discussionList) {\n app.cache.discussionList.removeDiscussion(this);\n m.redraw();\n }\n });\n }\n },\n\n /**\n * Rename the discussion.\n */\n renameAction(this: Discussion) {\n return app.modal.show(RenameDiscussionModal, {\n currentTitle: this.title(),\n discussion: this,\n });\n },\n};\n","export interface StackItem {\n name: string;\n title: string;\n url?: string;\n}\n\n/**\n * The `History` class keeps track and manages a stack of routes that the user\n * has navigated to in their session.\n *\n * An item can be pushed to the top of the stack using the `push` method. An\n * item in the stack has a name and a URL. The name need not be unique; if it is\n * the same as the item before it, that will be overwritten with the new URL. In\n * this way, if a user visits a discussion, and then visits another discussion,\n * popping the history stack will still take them back to the discussion list\n * rather than the previous discussion.\n */\nexport default class History {\n /**\n * The stack of routes that have been navigated to.\n */\n protected stack: StackItem[] = [];\n\n /**\n * Get the item on the top of the stack.\n */\n getCurrent(): StackItem {\n return this.stack[this.stack.length - 1];\n }\n\n /**\n * Get the previous item on the stack.\n */\n getPrevious(): StackItem {\n return this.stack[this.stack.length - 2];\n }\n\n /**\n * Push an item to the top of the stack.\n *\n * @param {String} name The name of the route.\n * @param {String} title The title of the route.\n * @param {String} [url] The URL of the route. The current URL will be used if\n * not provided.\n */\n push(name: string, title?: string, url: string = m.route.get()) {\n // If we're pushing an item with the same name as second-to-top item in the\n // stack, we will assume that the user has clicked the 'back' button in\n // their browser. In this case, we don't want to push a new item, so we will\n // pop off the top item, and then the second-to-top item will be overwritten\n // below.\n const secondTop = this.stack[this.stack.length - 2];\n if (secondTop && secondTop.name === name) {\n this.stack.pop();\n }\n\n // If we're pushing an item with the same name as the top item in the stack,\n // then we'll overwrite it with the new URL.\n const top = this.getCurrent();\n if (top && top.name === name) {\n Object.assign(top, { url, title });\n } else {\n this.stack.push({ name, url, title });\n }\n }\n\n /**\n * Check whether or not the history stack is able to be popped.\n */\n canGoBack(): boolean {\n return this.stack.length > 1;\n }\n\n /**\n * Go back to the previous route in the history stack.\n */\n back() {\n if (!this.canGoBack()) {\n return this.home();\n }\n\n this.stack.pop();\n\n m.route.set(this.getCurrent().url);\n }\n\n /**\n * Get the URL of the previous page.\n */\n backUrl(): string {\n const secondTop = this.stack[this.stack.length - 2];\n\n return secondTop.url;\n }\n\n /**\n * Go to the first route in the history stack.\n */\n home() {\n this.stack.splice(0);\n\n m.route.set('/');\n }\n}\n","export type KeyboardEventCallback = (KeyboardEvent) => boolean | void;\n\n/**\n * The `KeyboardNavigatable` class manages lists that can be navigated with the\n * keyboard, calling callbacks for each actions.\n *\n * This helper encapsulates the key binding logic, providing a simple fluent\n * API for use.\n */\nexport default class KeyboardNavigatable {\n /**\n * Callback to be executed for a specified input.\n *\n * @callback KeyboardNavigatable~keyCallback\n * @param {KeyboardEvent} event\n * @returns {boolean}\n */\n callbacks: { [key: number]: KeyboardEventCallback } = {};\n\n // By default, always handle keyboard navigation.\n whenCallback: KeyboardEventCallback = () => true;\n\n /**\n * Provide a callback to be executed when navigating upwards.\n *\n * This will be triggered by the Up key.\n */\n onUp(callback: KeyboardEventCallback): this {\n this.callbacks[38] = e => {\n e.preventDefault();\n callback(e);\n };\n\n return this;\n }\n\n /**\n * Provide a callback to be executed when navigating downwards.\n *\n * This will be triggered by the Down key.\n */\n onDown(callback: KeyboardEventCallback): this {\n this.callbacks[40] = e => {\n e.preventDefault();\n callback(e);\n };\n\n return this;\n }\n\n /**\n * Provide a callback to be executed when the current item is selected..\n *\n * This will be triggered by the Return and Tab keys..\n */\n onSelect(callback: KeyboardEventCallback): this {\n this.callbacks[9] = this.callbacks[13] = e => {\n e.preventDefault();\n callback(e);\n };\n\n return this;\n }\n\n /**\n * Provide a callback to be executed when the navigation is canceled.\n *\n * This will be triggered by the Escape key.\n */\n onCancel(callback: Function): this {\n this.callbacks[27] = e => {\n e.stopPropagation();\n e.preventDefault();\n callback(e);\n };\n\n return this;\n }\n\n /**\n * Provide a callback to be executed when previous input is removed.\n *\n * This will be triggered by the Backspace key.\n */\n onRemove(callback: Function): this {\n this.callbacks[8] = e => {\n if (e.target.selectionStart === 0 && e.target.selectionEnd === 0) {\n callback(e);\n e.preventDefault();\n }\n };\n\n return this;\n }\n\n /**\n * Provide a callback that determines whether keyboard input should be handled.\n */\n when(callback: KeyboardEventCallback): this {\n this.whenCallback = callback;\n\n return this;\n }\n\n /**\n * Set up the navigation key bindings on the given jQuery element.\n */\n bindTo($element: any) {\n // Handle navigation key events on the navigatable element.\n $element.on('keydown', this.navigate.bind(this));\n }\n\n /**\n * Interpret the given keyboard event as navigation commands.\n */\n navigate(event: KeyboardEvent) {\n // This callback determines whether keyboard should be handled or ignored.\n if (!this.whenCallback(event)) return;\n\n const keyCallback = this.callbacks[event.which];\n if (keyCallback) {\n keyCallback(event);\n }\n }\n}\n","import { Vnode } from 'mithril';\n\n// import EditPostComposer from '../components/EditPostComposer';\nimport Button from '../../common/components/Button';\nimport Separator from '../../common/components/Separator';\nimport ItemList from '../../common/utils/ItemList';\nimport Post from '../../common/models/Post';\nimport PostComponent from '../../forum/components/Post';\n\n/**\n * The `PostControls` utility constructs a list of buttons for a post which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a post.\n *\n * @param {Post} post\n * @param {*} context The parent component under which the controls menu will\n * be displayed.\n * @public\n */\n controls(post: Post, context) {\n const items = new ItemList();\n\n ['user', 'moderation', 'destructive'].forEach(section => {\n const controls = this[section + 'Controls'](post, context).toArray();\n\n if (controls.length) {\n controls.forEach(item => items.add(item.itemName, item));\n items.add(section + 'Separator', Separator.component());\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for a post pertaining to the current user (e.g. report).\n *\n * @param {Post} post\n * @param {*} context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n userControls(post: Post, context) {\n return new ItemList();\n },\n\n /**\n * Get controls for a post pertaining to moderation (e.g. edit).\n *\n * @param {Post} post\n * @param {*} context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n moderationControls(post: Post, context) {\n const items = new ItemList();\n\n if (post.contentType() === 'comment' && post.canEdit()) {\n if (!post.isHidden()) {\n items.add(\n 'edit',\n Button.component(\n {\n icon: 'fas fa-pencil-alt',\n onclick: this.editAction.bind(post),\n },\n app.translator.trans('core.forum.post_controls.edit_button')\n )\n );\n }\n }\n\n return items;\n },\n\n /**\n * Get controls for a post that are destructive (e.g. delete).\n *\n * @param {Post} post\n * @param {*} context The parent component under which the controls menu will\n * be displayed.\n * @protected\n */\n destructiveControls(post: Post, context) {\n const items = new ItemList();\n\n if (post.contentType() === 'comment' && !post.isHidden()) {\n if (post.canHide()) {\n items.add(\n 'hide',\n Button.component({\n icon: 'far fa-trash-alt',\n children: app.translator.trans('core.forum.post_controls.delete_button'),\n onclick: this.hideAction.bind(post),\n })\n );\n }\n } else {\n if (post.contentType() === 'comment' && post.canHide()) {\n items.add(\n 'restore',\n Button.component({\n icon: 'fas fa-reply',\n children: app.translator.trans('core.forum.post_controls.restore_button'),\n onclick: this.restoreAction.bind(post),\n })\n );\n }\n if (post.canDelete()) {\n items.add(\n 'delete',\n Button.component({\n icon: 'fas fa-times',\n children: app.translator.trans('core.forum.post_controls.delete_forever_button'),\n onclick: this.deleteAction.bind(post, context),\n })\n );\n }\n }\n\n return items;\n },\n\n /**\n * Open the composer to edit a post.\n */\n editAction(this: Post) {\n return new Promise<EditPostComposer>(resolve => {\n const component = new EditPostComposer({ post: this });\n\n app.composer.load(component);\n app.composer.show();\n\n resolve(component);\n });\n },\n\n /**\n * Hide a post.\n */\n hideAction(this: Post) {\n this.pushAttributes({ hiddenAt: new Date(), hiddenUser: app.session.user });\n\n return this.save({ isHidden: true }).then(() => m.redraw());\n },\n\n /**\n * Restore a post.\n */\n restoreAction(this: Post) {\n this.pushAttributes({ hiddenAt: null, hiddenUser: null });\n\n return this.save({ isHidden: false }).then(() => m.redraw());\n },\n\n /**\n * Delete a post.\n */\n deleteAction(this: Post, context: PostComponent) {\n if (context) context.loading = true;\n\n return this.delete()\n .then(() => {\n const discussion = this.discussion();\n\n discussion.removePost(this.id());\n\n // If this was the last post in the discussion, then we will assume that\n // the whole discussion was deleted too.\n if (!discussion.postIds().length) {\n // If there is a discussion list in the cache, remove this discussion.\n if (app.cache.discussionList) {\n app.cache.discussionList.removeDiscussion(discussion);\n }\n\n if (app.viewingDiscussion(discussion)) {\n app.history.back();\n }\n }\n })\n .catch(() => {})\n .then(() => {\n if (context) context.loading = false;\n m.redraw();\n });\n },\n};\n","import Alert from '../../common/components/Alert';\nimport Button from '../../common/components/Button';\nimport Separator from '../../common/components/Separator';\n// import EditUserModal from '../components/EditUserModal';\nimport UserPage from '../components/UserPage';\nimport ItemList from '../../common/utils/ItemList';\nimport User from '../../common/models/User';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n *\n * @param user\n * @param context The parent component under which the controls menu will\n * be displayed.\n */\n controls(user: User, context: any): ItemList {\n const items = new ItemList();\n\n ['user', 'moderation', 'destructive'].forEach(section => {\n const controls = this[section + 'Controls'](user, context).toArray();\n if (controls.length) {\n controls.forEach(item => items.add(item.itemName, item));\n items.add(section + 'Separator', Separator.component());\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to the current user (e.g. poke, follow).\n */\n userControls(): ItemList {\n return new ItemList();\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(user: User): ItemList {\n const items = new ItemList();\n\n if (user.canEdit()) {\n items.add(\n 'edit',\n Button.component({\n icon: 'fas fa-pencil-alt',\n children: app.translator.trans('core.forum.user_controls.edit_button'),\n onclick: this.editAction.bind(this, user),\n })\n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n */\n destructiveControls(user: User): ItemList {\n const items = new ItemList();\n\n if (user.id() !== '1' && user.canDelete()) {\n items.add(\n 'delete',\n Button.component({\n icon: 'fas fa-times',\n children: app.translator.trans('core.forum.user_controls.delete_button'),\n onclick: this.deleteAction.bind(this, user),\n })\n );\n }\n\n return items;\n },\n\n /**\n * Delete the user.\n */\n deleteAction(user: User) {\n if (!confirm(app.translator.transText('core.forum.user_controls.delete_confirmation'))) {\n return;\n }\n\n user.delete()\n .then(() => {\n this.showDeletionAlert(user, 'success');\n if (app.current instanceof UserPage && app.current.user === user) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(user, 'error'));\n },\n\n /**\n * Show deletion alert of user.\n */\n showDeletionAlert(user: User, type: string) {\n const { username, email } = user.data.attributes;\n const message = `core.forum.user_controls.delete_${type}_message`;\n\n app.alerts.show(\n Alert.component({\n type,\n children: app.translator.trans(message, { username, email }),\n })\n );\n },\n\n /**\n * Edit the user.\n */\n editAction(user: User) {\n app.modal.show(EditUserModal, { user });\n },\n};\n","/**\n * Setup the sidebar DOM element to be affixed to the top of the viewport\n * using hcSticky.\n */\nexport default function affixSidebar(vnode) {\n const element = vnode.dom;\n const $sidebar = $(element);\n const $header = $('#header');\n const $affixElement = $sidebar.find('> ul')[0];\n\n $(window).off('.affix');\n\n new hcSticky($affixElement, {\n stickTo: element,\n top: $header.outerHeight(true) + parseInt($sidebar.css('margin-top'), 10),\n });\n}\n","module.exports = m;"],"sourceRoot":""} |