framework/extensions/embed/js/dist/forum.js.map
flarum-bot 021793fc52 Bundled output for commit 9ab1680b17
Includes transpiled JS/TS.

[skip ci]
2022-07-29 12:54:55 +00:00

1 line
63 KiB
Plaintext
Generated

{"version":3,"file":"forum.js","mappings":"sBAWC,SAAWA,GACV,GAAsB,oBAAXC,OAAX,CAEA,IAAIC,GAAa,EAEfC,EAAiB,GACjBC,EAAa,EACbC,EAAgB,GAChBC,EAAe,KACfC,EAAc,GACdC,GAAiB,EACjBC,EAAkB,CAAEC,OAAQ,EAAGC,MAAO,GACtCC,EAAmB,IACnBC,GAAW,EACXC,EAAS,EACTC,EAAwB,aACxBC,EAAiBD,EACjBE,GAAW,EACXC,EAAU,GACVC,EAAc,CAAC,EACfC,EAAW,GACXC,EAAgB,KAChBC,GAAU,EACVC,GAAc,EACdC,EAAQ,gBACRC,EAAWD,EAAME,OACjBC,EAAO,GACPC,EAAuB,CACrBC,IAAK,EACLC,IAAK,EACLC,WAAY,EACZC,sBAAuB,GAEzBC,EAAa,QAEbC,EAASjC,OAAOkC,OAChBC,EAAsB,IACtBC,EAAY,EACZC,GAAgB,EAChBC,EAAqB,KACrBC,EAAiB,GACjBC,EAAQ,EACRC,EAAuB,SACvBC,EAAgBD,EAChBE,EAAM3C,OACN4C,EAAY,WACVC,GAAK,iCACN,EACDC,EAAU,WAAc,EACxBC,EAAa,WAAc,EAC3BC,EAAoB,CAClBnC,OAAQ,WAEN,OADAgC,GAAK,kDACEI,SAASC,gBAAgBC,YACjC,EACDX,MAAO,WAEL,OADAK,GAAK,iDACEI,SAASG,KAAKC,WACtB,GAEHC,EAAsB,CAAC,EACvBC,GAAmB,EAIrB,IACE,IAAIC,EAAUC,OAAOC,OACnB,CAAC,EACD,CACEC,QAAS,CACPC,IAAK,WACHL,GAAmB,CACpB,KAIPvD,OAAO6D,iBAAiB,OAAQC,GAAMN,GACtCxD,OAAO+D,oBAAoB,OAAQD,GAAMN,EAG1C,CAFC,MAAOQ,GAER,CA80BD,IA/zB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,EAAOH,IAAAA,WACb7P,KAAKiQ,IAAIC,IAAI,MAAOpR,KAAKnD,IAAI,EAAGqU,EAAKvK,UAAYuK,EAAKG,WACvD,GAEDtB,EAAAA,EAAAA,QAAOuB,IAAAA,UAAwB,OAAQL,IACvClB,EAAAA,EAAAA,QAAOwB,IAAAA,UAAoB,OAAQN,GAEnChW,OAAO0H,cAAgB,CACrB6O,cAAe,WACbvW,OAAOiJ,aAAaQ,YAAYqM,IAAAA,SACjC,IAGHhB,EAAAA,EAAAA,QAAOK,IAAAA,UAAsB,cAAc,SAAUqB,EAASC,GAC5D,GAAe,UAAXA,GAAsB,iBAAkBzW,QAAU8V,IAAAA,SAAAA,eAA6B,CACjF,IAAMY,EAAUzQ,KAAKiQ,EAAE,yBAAyBvR,SAASuH,IACzDlM,OAAOiJ,aAAakB,eAAe,EAAGuM,EACvC,CACF,KAED5B,EAAAA,EAAAA,QAAO6B,IAAAA,UAA0B,gBAAgB,SAAUC,GACzDA,EAAMvH,OAAO,YAEb,IAAMwH,EAAQ5Q,KAAK6Q,WAAWC,aAE9BH,EAAM3H,IACJ,UACA,YACE,OAAGgG,MAAOa,IAAAA,MAAAA,WAAqB7P,KAAK6Q,YAAYnB,QAAQ,SAAU,OAC/DkB,EADH,WAC2B,GAATA,EAAa,GAAK,MAGtC,KAGF,IAAMvB,EAAQsB,EAAMhT,IAAI,YAAY0R,MACpCA,EAAM0B,UAAY1B,EAAM0B,UAAUrB,QAAQ,qBAAsB,GACjE,IAEDG,IAAAA,OAAAA,WAA2B,CAAEmB,KAAM,aAAcC,UAAWP,KAC5Db,IAAAA,OAAAA,mBAAgC,CAAEmB,KAAM,mBAAoBC,UAAWP,I","sources":["webpack://@flarum/embed/../../../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js","webpack://@flarum/embed/webpack/bootstrap","webpack://@flarum/embed/webpack/runtime/compat get default export","webpack://@flarum/embed/webpack/runtime/define property getters","webpack://@flarum/embed/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/embed/webpack/runtime/make namespace object","webpack://@flarum/embed/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/embed/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/components/Composer']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/components/PostStream']\"","webpack://@flarum/embed/external root \"flarum.core.compat['common/components/ModalManager']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/components/PostMeta']\"","webpack://@flarum/embed/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/embed/./src/forum/index.js"],"sourcesContent":["/*\n * File: iframeResizer.contentWindow.js\n * Desc: Include this file in any page being loaded into an iframe\n * to force the iframe to resize to the content size.\n * Requires: iframeResizer.js on host page.\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\n * Author: David J. Bradshaw - dave@bradshaw.net\n *\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function (undefined) {\n if (typeof window === 'undefined') return // don't run for server side render\n\n var autoResize = true,\n base = 10,\n bodyBackground = '',\n bodyMargin = 0,\n bodyMarginStr = '',\n bodyObserver = null,\n bodyPadding = '',\n calculateWidth = false,\n doubleEventList = { resize: 1, click: 1 },\n eventCancelTimer = 128,\n firstRun = true,\n height = 1,\n heightCalcModeDefault = 'bodyOffset',\n heightCalcMode = heightCalcModeDefault,\n initLock = true,\n initMsg = '',\n inPageLinks = {},\n interval = 32,\n intervalTimer = null,\n logging = false,\n mouseEvents = false,\n msgID = '[iFrameSizer]', // Must match host page msg ID\n msgIdLen = msgID.length,\n myID = '',\n resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1\n },\n resizeFrom = 'child',\n sendPermit = true,\n target = window.parent,\n targetOriginDefault = '*',\n tolerance = 0,\n triggerLocked = false,\n triggerLockedTimer = null,\n throttledTimer = 16,\n width = 1,\n widthCalcModeDefault = 'scroll',\n widthCalcMode = widthCalcModeDefault,\n win = window,\n onMessage = function () {\n warn('onMessage function not defined')\n },\n onReady = function () {},\n onPageInfo = function () {},\n customCalcMethods = {\n height: function () {\n warn('Custom height calculation function not defined')\n return document.documentElement.offsetHeight\n },\n width: function () {\n warn('Custom width calculation function not defined')\n return document.body.scrollWidth\n }\n },\n eventHandlersByName = {},\n passiveSupported = false\n\n function noop() {}\n\n try {\n var options = Object.create(\n {},\n {\n passive: {\n get: function () {\n passiveSupported = true\n }\n }\n }\n )\n window.addEventListener('test', noop, options)\n window.removeEventListener('test', noop, options)\n } catch (error) {\n /* */\n }\n\n function addEventListener(el, evt, func, options) {\n el.addEventListener(evt, func, passiveSupported ? options || {} : false)\n }\n\n function removeEventListener(el, evt, func) {\n el.removeEventListener(evt, func, false)\n }\n\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n }\n\n // Based on underscore.js\n function throttle(func) {\n var context,\n args,\n result,\n timeout = null,\n previous = 0,\n later = function () {\n previous = Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n }\n\n return function () {\n var now = Date.now()\n\n if (!previous) {\n previous = now\n }\n\n var remaining = throttledTimer - (now - previous)\n\n context = this\n args = arguments\n\n if (remaining <= 0 || remaining > throttledTimer) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n\n previous = now\n result = func.apply(context, args)\n\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n } else if (!timeout) {\n timeout = setTimeout(later, remaining)\n }\n\n return result\n }\n }\n\n function formatLogMsg(msg) {\n return msgID + '[' + myID + '] ' + msg\n }\n\n function log(msg) {\n if (logging && 'object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.log(formatLogMsg(msg))\n }\n }\n\n function warn(msg) {\n if ('object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.warn(formatLogMsg(msg))\n }\n }\n\n function init() {\n readDataFromParent()\n log('Initialising iFrame (' + window.location.href + ')')\n readDataFromPage()\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n injectClearFixIntoBodyElement()\n checkHeightMode()\n checkWidthMode()\n stopInfiniteResizingOfIFrame()\n setupPublicMethods()\n setupMouseEvents()\n startEventListeners()\n inPageLinks = setupInPageLinks()\n sendSize('init', 'Init message from host page')\n onReady()\n }\n\n function readDataFromParent() {\n function strBool(str) {\n return 'true' === str\n }\n\n var data = initMsg.substr(msgIdLen).split(':')\n\n myID = data[0]\n bodyMargin = undefined !== data[1] ? Number(data[1]) : bodyMargin // For V1 compatibility\n calculateWidth = undefined !== data[2] ? strBool(data[2]) : calculateWidth\n logging = undefined !== data[3] ? strBool(data[3]) : logging\n interval = undefined !== data[4] ? Number(data[4]) : interval\n autoResize = undefined !== data[6] ? strBool(data[6]) : autoResize\n bodyMarginStr = data[7]\n heightCalcMode = undefined !== data[8] ? data[8] : heightCalcMode\n bodyBackground = data[9]\n bodyPadding = data[10]\n tolerance = undefined !== data[11] ? Number(data[11]) : tolerance\n inPageLinks.enable = undefined !== data[12] ? strBool(data[12]) : false\n resizeFrom = undefined !== data[13] ? data[13] : resizeFrom\n widthCalcMode = undefined !== data[14] ? data[14] : widthCalcMode\n mouseEvents = undefined !== data[15] ? Boolean(data[15]) : mouseEvents\n }\n\n function depricate(key) {\n var splitName = key.split('Callback')\n\n if (splitName.length === 2) {\n var name =\n 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n this[name] = this[key]\n delete this[key]\n warn(\n \"Deprecated: '\" +\n key +\n \"' has been renamed '\" +\n name +\n \"'. The old method will be removed in the next major version.\"\n )\n }\n }\n\n function readDataFromPage() {\n function readData() {\n var data = window.iFrameResizer\n\n log('Reading data from page: ' + JSON.stringify(data))\n Object.keys(data).forEach(depricate, data)\n\n onMessage = 'onMessage' in data ? data.onMessage : onMessage\n onReady = 'onReady' in data ? data.onReady : onReady\n targetOriginDefault =\n 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault\n heightCalcMode =\n 'heightCalculationMethod' in data\n ? data.heightCalculationMethod\n : heightCalcMode\n widthCalcMode =\n 'widthCalculationMethod' in data\n ? data.widthCalculationMethod\n : widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if ('function' === typeof calcMode) {\n log('Setup custom ' + calcFunc + 'CalcMethod')\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log('TargetOrigin for parent set to: ' + targetOriginDefault)\n }\n\n function chkCSS(attr, value) {\n if (-1 !== value.indexOf('-')) {\n warn('Negative CSS value ignored for ' + attr)\n value = ''\n }\n return value\n }\n\n function setBodyStyle(attr, value) {\n if (undefined !== value && '' !== value && 'null' !== value) {\n document.body.style[attr] = value\n log('Body ' + attr + ' set to \"' + value + '\"')\n }\n }\n\n function setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = bodyMargin + 'px'\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n }\n\n function stopInfiniteResizingOfIFrame() {\n document.documentElement.style.height = ''\n document.body.style.height = ''\n log('HTML & body height set to \"auto\"')\n }\n\n function manageTriggerEvent(options) {\n var listener = {\n add: function (eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove: function (eventName) {\n var handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n }\n }\n\n if (options.eventNames && Array.prototype.map) {\n options.eventName = options.eventNames[0]\n options.eventNames.map(listener[options.method])\n } else {\n listener[options.method](options.eventName)\n }\n\n log(\n capitalizeFirstLetter(options.method) +\n ' event listener: ' +\n options.eventType\n )\n }\n\n function manageEventListeners(method) {\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Start',\n eventNames: ['animationstart', 'webkitAnimationStart']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Iteration',\n eventNames: ['animationiteration', 'webkitAnimationIteration']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation End',\n eventNames: ['animationend', 'webkitAnimationEnd']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Input',\n eventName: 'input'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Up',\n eventName: 'mouseup'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Down',\n eventName: 'mousedown'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Orientation Change',\n eventName: 'orientationchange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Print',\n eventName: ['afterprint', 'beforeprint']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Start',\n eventName: 'touchstart'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch End',\n eventName: 'touchend'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Cancel',\n eventName: 'touchcancel'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Start',\n eventNames: [\n 'transitionstart',\n 'webkitTransitionStart',\n 'MSTransitionStart',\n 'oTransitionStart',\n 'otransitionstart'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Iteration',\n eventNames: [\n 'transitioniteration',\n 'webkitTransitionIteration',\n 'MSTransitionIteration',\n 'oTransitionIteration',\n 'otransitioniteration'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition End',\n eventNames: [\n 'transitionend',\n 'webkitTransitionEnd',\n 'MSTransitionEnd',\n 'oTransitionEnd',\n 'otransitionend'\n ]\n })\n if ('child' === resizeFrom) {\n manageTriggerEvent({\n method: method,\n eventType: 'IFrame Resized',\n eventName: 'resize'\n })\n }\n }\n\n function checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(\n calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'\n )\n calcMode = calcModeDefault\n }\n log(type + ' calculation method set to \"' + calcMode + '\"')\n }\n\n return calcMode\n }\n\n function checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height'\n )\n }\n\n function checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width'\n )\n }\n\n function startEventListeners() {\n if (true === autoResize) {\n manageEventListeners('add')\n setupMutationObserver()\n } else {\n log('Auto Resize disabled')\n }\n }\n\n // function stopMsgsToParent() {\n // log('Disable outgoing messages')\n // sendPermit = false\n // }\n\n // function removeMsgListener() {\n // log('Remove event listener: Message')\n // removeEventListener(window, 'message', receiver)\n // }\n\n function disconnectMutationObserver() {\n if (null !== bodyObserver) {\n /* istanbul ignore next */ // Not testable in PhantonJS\n bodyObserver.disconnect()\n }\n }\n\n function stopEventListeners() {\n manageEventListeners('remove')\n disconnectMutationObserver()\n clearInterval(intervalTimer)\n }\n\n // function teardown() {\n // stopMsgsToParent()\n // removeMsgListener()\n // if (true === autoResize) stopEventListeners()\n // }\n\n function injectClearFixIntoBodyElement() {\n var clearFix = document.createElement('div')\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.appendChild(clearFix)\n }\n\n function setupInPageLinks() {\n function getPagePosition() {\n return {\n x:\n window.pageXOffset !== undefined\n ? window.pageXOffset\n : document.documentElement.scrollLeft,\n y:\n window.pageYOffset !== undefined\n ? window.pageYOffset\n : document.documentElement.scrollTop\n }\n }\n\n function getElementPosition(el) {\n var elPosition = el.getBoundingClientRect(),\n pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),\n y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n var jumpPosition = getElementPosition(target)\n\n log(\n 'Moving to in page link (#' +\n hash +\n ') at x: ' +\n jumpPosition.x +\n ' y: ' +\n jumpPosition.y\n )\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n var hash = location.split('#')[1] || location, // Remove # if present\n hashData = decodeURIComponent(hash),\n target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (undefined !== target) {\n jumpToTarget(target)\n } else {\n log(\n 'In page link (#' +\n hash +\n ') not found in iFrame, so sending to parent'\n )\n sendMsg(0, 0, 'inPageLink', '#' + hash)\n }\n }\n\n function checkLocationHash() {\n var hash = window.location.hash\n var href = window.location.href\n\n if ('' !== hash && '#' !== hash) {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n /* jshint validthis:true */\n findTarget(this.getAttribute('href'))\n }\n\n if ('#' !== el.getAttribute('href')) {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n Array.prototype.forEach.call(\n document.querySelectorAll('a[href^=\"#\"]'),\n setupLink\n )\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n /* istanbul ignore else */ // Not testable in phantonJS\n if (Array.prototype.forEach && document.querySelectorAll) {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n } else {\n warn(\n 'In page linking not fully supported in this browser! (See README.md for IE8 workaround)'\n )\n }\n }\n\n if (inPageLinks.enable) {\n enableInPageLinks()\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget: findTarget\n }\n }\n\n function setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, e.screenY + ':' + e.screenX)\n }\n\n function addMouseListener(evt, name) {\n log('Add event listener: ' + name)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n }\n\n function setupPublicMethods() {\n log('Enable public methods')\n\n win.parentIFrame = {\n autoResize: function autoResizeF(resize) {\n if (true === resize && false === autoResize) {\n autoResize = true\n startEventListeners()\n } else if (false === resize && true === autoResize) {\n autoResize = false\n stopEventListeners()\n }\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n return autoResize\n },\n\n close: function closeF() {\n sendMsg(0, 0, 'close')\n // teardown()\n },\n\n getId: function getIdF() {\n return myID\n },\n\n getPageInfo: function getPageInfoF(callback) {\n if ('function' === typeof callback) {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n } else {\n onPageInfo = function () {}\n sendMsg(0, 0, 'pageInfoStop')\n }\n },\n\n moveToAnchor: function moveToAnchorF(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset: function resetF() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollTo: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage: function sendMessageF(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod: function setHeightCalculationMethodF(\n heightCalculationMethod\n ) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod: function setWidthCalculationMethodF(\n widthCalculationMethod\n ) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin: function setTargetOriginF(targetOrigin) {\n log('Set targetOrigin: ' + targetOrigin)\n targetOriginDefault = targetOrigin\n },\n\n size: function sizeF(customHeight, customWidth) {\n var valString =\n '' + (customHeight || '') + (customWidth ? ',' + customWidth : '')\n sendSize(\n 'size',\n 'parentIFrame.size(' + valString + ')',\n customHeight,\n customWidth\n )\n }\n }\n }\n\n function initInterval() {\n if (0 !== interval) {\n log('setInterval: ' + interval + 'ms')\n intervalTimer = setInterval(function () {\n sendSize('interval', 'setInterval: ' + interval)\n }, Math.abs(interval))\n }\n }\n\n // Not testable in PhantomJS\n /* istanbul ignore next */\n function setupBodyMutationObserver() {\n function addImageLoadListners(mutation) {\n function addImageLoadListener(element) {\n if (false === element.complete) {\n log('Attach listeners to ' + element.src)\n element.addEventListener('load', imageLoaded, false)\n element.addEventListener('error', imageError, false)\n elements.push(element)\n }\n }\n\n if (mutation.type === 'attributes' && mutation.attributeName === 'src') {\n addImageLoadListener(mutation.target)\n } else if (mutation.type === 'childList') {\n Array.prototype.forEach.call(\n mutation.target.querySelectorAll('img'),\n addImageLoadListener\n )\n }\n }\n\n function removeFromArray(element) {\n elements.splice(elements.indexOf(element), 1)\n }\n\n function removeImageLoadListener(element) {\n log('Remove listeners from ' + element.src)\n element.removeEventListener('load', imageLoaded, false)\n element.removeEventListener('error', imageError, false)\n removeFromArray(element)\n }\n\n function imageEventTriggered(event, type, typeDesc) {\n removeImageLoadListener(event.target)\n sendSize(type, typeDesc + ': ' + event.target.src)\n }\n\n function imageLoaded(event) {\n imageEventTriggered(event, 'imageLoad', 'Image loaded')\n }\n\n function imageError(event) {\n imageEventTriggered(event, 'imageLoadFailed', 'Image load failed')\n }\n\n function mutationObserved(mutations) {\n sendSize(\n 'mutationObserver',\n 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type\n )\n\n // Deal with WebKit / Blink asyncing image loading when tags are injected into the page\n mutations.forEach(addImageLoadListners)\n }\n\n function createMutationObserver() {\n var target = document.querySelector('body'),\n config = {\n attributes: true,\n attributeOldValue: false,\n characterData: true,\n characterDataOldValue: false,\n childList: true,\n subtree: true\n }\n\n observer = new MutationObserver(mutationObserved)\n\n log('Create body MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n var elements = [],\n MutationObserver =\n window.MutationObserver || window.WebKitMutationObserver,\n observer = createMutationObserver()\n\n return {\n disconnect: function () {\n if ('disconnect' in observer) {\n log('Disconnect body MutationObserver')\n observer.disconnect()\n elements.forEach(removeImageLoadListener)\n }\n }\n }\n }\n\n function setupMutationObserver() {\n var forceIntervalTimer = 0 > interval\n\n // Not testable in PhantomJS\n /* istanbul ignore if */ if (\n window.MutationObserver ||\n window.WebKitMutationObserver\n ) {\n if (forceIntervalTimer) {\n initInterval()\n } else {\n bodyObserver = setupBodyMutationObserver()\n }\n } else {\n log('MutationObserver not supported in this browser!')\n initInterval()\n }\n }\n\n // document.documentElement.offsetHeight is not reliable, so\n // we have to jump through hoops to get a better value.\n function getComputedStyle(prop, el) {\n var retVal = 0\n el = el || document.body // Not testable in phantonJS\n\n retVal = document.defaultView.getComputedStyle(el, null)\n retVal = null !== retVal ? retVal[prop] : 0\n\n return parseInt(retVal, base)\n }\n\n function chkEventThottle(timer) {\n if (timer > throttledTimer / 2) {\n throttledTimer = 2 * timer\n log('Event throttle increased to ' + throttledTimer + 'ms')\n }\n }\n\n // Idea from https://github.com/guardian/iframe-messenger\n function getMaxElement(side, elements) {\n var elementsLength = elements.length,\n elVal = 0,\n maxVal = 0,\n Side = capitalizeFirstLetter(side),\n timer = Date.now()\n\n for (var i = 0; i < elementsLength; i++) {\n elVal =\n elements[i].getBoundingClientRect()[side] +\n getComputedStyle('margin' + Side, elements[i])\n if (elVal > maxVal) {\n maxVal = elVal\n }\n }\n\n timer = Date.now() - timer\n\n log('Parsed ' + elementsLength + ' HTML elements')\n log('Element position calculated in ' + timer + 'ms')\n\n chkEventThottle(timer)\n\n return maxVal\n }\n\n function getAllMeasurements(dimensions) {\n return [\n dimensions.bodyOffset(),\n dimensions.bodyScroll(),\n dimensions.documentElementOffset(),\n dimensions.documentElementScroll()\n ]\n }\n\n function getTaggedElements(side, tag) {\n function noTaggedElementsFound() {\n warn('No tagged elements (' + tag + ') found on page')\n return document.querySelectorAll('body *')\n }\n\n var elements = document.querySelectorAll('[' + tag + ']')\n\n if (elements.length === 0) noTaggedElementsFound()\n\n return getMaxElement(side, elements)\n }\n\n function getAllElements() {\n return document.querySelectorAll('body *')\n }\n\n var getHeight = {\n bodyOffset: function getBodyOffsetHeight() {\n return (\n document.body.offsetHeight +\n getComputedStyle('marginTop') +\n getComputedStyle('marginBottom')\n )\n },\n\n offset: function () {\n return getHeight.bodyOffset() // Backwards compatability\n },\n\n bodyScroll: function getBodyScrollHeight() {\n return document.body.scrollHeight\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.height()\n },\n\n documentElementOffset: function getDEOffsetHeight() {\n return document.documentElement.offsetHeight\n },\n\n documentElementScroll: function getDEScrollHeight() {\n return document.documentElement.scrollHeight\n },\n\n max: function getMaxHeight() {\n return Math.max.apply(null, getAllMeasurements(getHeight))\n },\n\n min: function getMinHeight() {\n return Math.min.apply(null, getAllMeasurements(getHeight))\n },\n\n grow: function growHeight() {\n return getHeight.max() // Run max without the forced downsizing\n },\n\n lowestElement: function getBestHeight() {\n return Math.max(\n getHeight.bodyOffset() || getHeight.documentElementOffset(),\n getMaxElement('bottom', getAllElements())\n )\n },\n\n taggedElement: function getTaggedElementsHeight() {\n return getTaggedElements('bottom', 'data-iframe-height')\n }\n },\n getWidth = {\n bodyScroll: function getBodyScrollWidth() {\n return document.body.scrollWidth\n },\n\n bodyOffset: function getBodyOffsetWidth() {\n return document.body.offsetWidth\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.width()\n },\n\n documentElementScroll: function getDEScrollWidth() {\n return document.documentElement.scrollWidth\n },\n\n documentElementOffset: function getDEOffsetWidth() {\n return document.documentElement.offsetWidth\n },\n\n scroll: function getMaxWidth() {\n return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll())\n },\n\n max: function getMaxWidth() {\n return Math.max.apply(null, getAllMeasurements(getWidth))\n },\n\n min: function getMinWidth() {\n return Math.min.apply(null, getAllMeasurements(getWidth))\n },\n\n rightMostElement: function rightMostElement() {\n return getMaxElement('right', getAllElements())\n },\n\n taggedElement: function getTaggedElementsWidth() {\n return getTaggedElements('right', 'data-iframe-width')\n }\n }\n\n function sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n ) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n\n sendMsg(height, width, triggerEvent)\n }\n\n function isSizeChangeDetected() {\n function checkTolarance(a, b) {\n var retVal = Math.abs(a - b) <= tolerance\n return !retVal\n }\n\n currentHeight =\n undefined !== customHeight ? customHeight : getHeight[heightCalcMode]()\n currentWidth =\n undefined !== customWidth ? customWidth : getWidth[widthCalcMode]()\n\n return (\n checkTolarance(height, currentHeight) ||\n (calculateWidth && checkTolarance(width, currentWidth))\n )\n }\n\n function isForceResizableEvent() {\n return !(triggerEvent in { init: 1, interval: 1, size: 1 })\n }\n\n function isForceResizableCalcMode() {\n return (\n heightCalcMode in resetRequiredMethods ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n )\n }\n\n function logIgnored() {\n log('No change in size detected')\n }\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n } else if (!(triggerEvent in { interval: 1 })) {\n logIgnored()\n }\n }\n\n var currentHeight, currentWidth\n\n if (isSizeChangeDetected() || 'init' === triggerEvent) {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n }\n\n var sizeIFrameThrottled = throttle(sizeIFrame)\n\n function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {\n function recordTrigger() {\n if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {\n log('Trigger event: ' + triggerEventDesc)\n }\n }\n\n function isDoubleFiredEvent() {\n return triggerLocked && triggerEvent in doubleEventList\n }\n\n if (!isDoubleFiredEvent()) {\n recordTrigger()\n if (triggerEvent === 'init') {\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth)\n } else {\n sizeIFrameThrottled(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n )\n }\n } else {\n log('Trigger event cancelled: ' + triggerEvent)\n }\n }\n\n function lockTrigger() {\n if (!triggerLocked) {\n triggerLocked = true\n log('Trigger event lock on')\n }\n clearTimeout(triggerLockedTimer)\n triggerLockedTimer = setTimeout(function () {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n }, eventCancelTimer)\n }\n\n function triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n }\n\n function resetIFrame(triggerEventDesc) {\n var hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log('Reset trigger event: ' + triggerEventDesc)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n }\n\n function sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n } else {\n log('Message targetOrigin: ' + targetOrigin)\n }\n }\n\n function sendToParent() {\n var size = height + ':' + width,\n message =\n myID +\n ':' +\n size +\n ':' +\n triggerEvent +\n (undefined !== msg ? ':' + msg : '')\n\n log('Sending message to host page (' + message + ')')\n target.postMessage(msgID + message, targetOrigin)\n }\n\n if (true === sendPermit) {\n setTargetOrigin()\n sendToParent()\n }\n }\n\n function receiver(event) {\n var processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(function () {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset: function resetFromParent() {\n if (!initLock) {\n log('Page size reset by host page')\n triggerReset('resetPage')\n } else {\n log('Page reset ignored by init')\n }\n },\n\n resize: function resizeFromParent() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor: function moveToAnchorF() {\n inPageLinks.findTarget(getData())\n },\n inPageLink: function inPageLinkF() {\n this.moveToAnchor()\n }, // Backward compatability\n\n pageInfo: function pageInfoFromParent() {\n var msgBody = getData()\n log('PageInfoFromParent called from parent: ' + msgBody)\n onPageInfo(JSON.parse(msgBody))\n log(' --')\n },\n\n message: function messageFromParent() {\n var msgBody = getData()\n\n log('onMessage called from parent: ' + msgBody)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n }\n }\n\n function isMessageForUs() {\n return msgID === ('' + event.data).substr(0, msgIdLen) // ''+ Protects against non-string messages\n }\n\n function getMessageType() {\n return event.data.split(']')[1].split(':')[0]\n }\n\n function getData() {\n return event.data.substr(event.data.indexOf(':') + 1)\n }\n\n function isMiddleTier() {\n return (\n (!(typeof module !== 'undefined' && module.exports) &&\n 'iFrameResize' in window) ||\n ('jQuery' in window && 'iFrameResize' in window.jQuery.prototype)\n )\n }\n\n function isInitMsg() {\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibity.\n return event.data.split(':')[2] in { true: 1, false: 1 }\n }\n\n function callFromParent() {\n var messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n } else if (!isMiddleTier() && !isInitMsg()) {\n warn('Unexpected message (' + event.data + ')')\n }\n }\n\n function processMessage() {\n if (false === firstRun) {\n callFromParent()\n } else if (isInitMsg()) {\n processRequestFromParent.init()\n } else {\n log(\n 'Ignored message of type \"' +\n getMessageType() +\n '\". Received before initialization.'\n )\n }\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n }\n\n // Normally the parent kicks things off when it detects the iFrame has loaded.\n // If this script is async-loaded, then tell parent page to retry init.\n function chkLateLoaded() {\n if ('loading' !== document.readyState) {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n }\n\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n\n \n})()\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/ForumApplication'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Composer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostStream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/ModalManager'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import 'iframe-resizer/js/iframeResizer.contentWindow.js';\n\nimport { override, extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Stream from 'flarum/common/utils/Stream';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport Composer from 'flarum/forum/components/Composer';\nimport PostStream from 'flarum/forum/components/PostStream';\nimport ModalManager from 'flarum/common/components/ModalManager';\nimport PostMeta from 'flarum/forum/components/PostMeta';\n\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nextend(ForumApplication.prototype, 'mount', function () {\n if (m.route.param('hideFirstPost')) {\n extend(PostStream.prototype, 'view', (vdom) => {\n if (vdom.children[0].attrs['data-number'] === 1) {\n vdom.children.splice(0, 1);\n }\n });\n }\n});\n\noverride(m.route.Link, 'view', function (original, vnode) {\n vnode.attrs.href = vnode.attrs.href.replace('/embed', '/d');\n vnode.attrs.target = '_blank';\n // TODO: If href leads to a post within this discussion that we have\n // already loaded, then scroll to it?\n return original(vnode);\n});\n\n// Trim the /embed prefix off of post permalinks\noverride(PostMeta.prototype, 'getPermalink', (original, post) => {\n return original(post).replace('/embed', '/d');\n});\n\napp.pageInfo = Stream({});\n\nconst reposition = function () {\n const info = app.pageInfo();\n this.$().css('top', Math.max(0, info.scrollTop - info.offsetTop));\n};\n\nextend(ModalManager.prototype, 'show', reposition);\nextend(Composer.prototype, 'show', reposition);\n\nwindow.iFrameResizer = {\n readyCallback: function () {\n window.parentIFrame.getPageInfo(app.pageInfo);\n },\n};\n\nextend(PostStream.prototype, 'goToNumber', function (promise, number) {\n if (number === 'reply' && 'parentIFrame' in window && app.composer.isFullScreen()) {\n const itemTop = this.$('.PostStream-item:last').offset().top;\n window.parentIFrame.scrollToOffset(0, itemTop);\n }\n});\n\nextend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n items.remove('scrubber');\n\n const count = this.discussion.replyCount();\n\n items.add(\n 'replies',\n <h3>\n <a route={app.route.discussion(this.discussion).replace('/embed', '/d')}>\n {count} comment{count == 1 ? '' : 's'}\n </a>\n </h3>,\n 100\n );\n\n const attrs = items.get('controls').attrs;\n attrs.className = attrs.className.replace('App-primaryControl', '');\n});\n\napp.routes['discussion'] = { path: '/embed/:id', component: DiscussionPage };\napp.routes['discussion.near'] = { path: '/embed/:id/:near', component: DiscussionPage };\n"],"names":["undefined","window","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","mouseEvents","msgID","msgIdLen","length","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","onMessage","warn","onReady","onPageInfo","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","options","Object","create","passive","get","addEventListener","noop","removeEventListener","error","func","context","args","result","timeout","previous","later","getHeight","bodyOffset","getComputedStyle","offset","scrollHeight","custom","documentElementOffset","Math","apply","getAllMeasurements","grow","lowestElement","getMaxElement","getAllElements","taggedElement","getTaggedElements","getWidth","offsetWidth","scroll","rightMostElement","sizeIFrameThrottled","sizeIFrame","Date","now","remaining","this","arguments","clearTimeout","setTimeout","event","messageType","processRequestFromParent","init","clearFix","attr","value","data","source","strBool","str","substr","split","Number","enable","Boolean","readDataFromParent","log","location","href","readData","iFrameResizer","JSON","stringify","keys","forEach","depricate","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","setBodyStyle","indexOf","createElement","style","clear","display","appendChild","checkHeightMode","checkWidthMode","parentIFrame","startEventListeners","manageEventListeners","disconnect","clearInterval","sendMsg","close","getId","getPageInfo","callback","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollTo","x","y","scrollToOffset","sendMessage","msg","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","size","customHeight","customWidth","sendSize","sendMouse","e","type","screenY","screenX","addMouseListener","evt","name","setupMouseEvents","getPagePosition","pageXOffset","scrollLeft","pageYOffset","scrollTop","getElementPosition","el","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","bindAnchors","setupLink","linkClicked","preventDefault","getAttribute","Array","prototype","call","querySelectorAll","bindLocationHash","initCheck","enableInPageLinks","setupInPageLinks","triggerReset","getData","inPageLink","pageInfo","msgBody","parse","message","getMessageType","isInitMsg","true","false","module","exports","jQuery","chkLateLoaded","capitalizeFirstLetter","string","charAt","toUpperCase","slice","formatLogMsg","console","key","splitName","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","map","method","checkCalcMode","calcModeDefault","modes","forceIntervalTimer","MutationObserver","WebKitMutationObserver","initInterval","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeImageLoadListener","splice","removeFromArray","imageEventTriggered","typeDesc","mutationObserved","mutations","observer","querySelector","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","createMutationObserver","setupBodyMutationObserver","setInterval","abs","prop","retVal","defaultView","side","elementsLength","elVal","maxVal","Side","timer","i","chkEventThottle","dimensions","tag","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolarance","a","b","isSizeChangeDetected","lockTrigger","resetPage","hcm","postMessage","readyState","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","defineProperty","enumerable","obj","hasOwnProperty","r","Symbol","toStringTag","flarum","core","compat","extend","ForumApplication","m","route","param","PostStream","vdom","children","attrs","override","Link","original","vnode","replace","PostMeta","post","app","Stream","reposition","info","$","css","offsetTop","ModalManager","Composer","readyCallback","promise","number","itemTop","DiscussionPage","items","count","discussion","replyCount","className","path","component"],"sourceRoot":""}