diff --git a/extensions/embed/js/dist/forum.js b/extensions/embed/js/dist/forum.js index efa387ce8..cc365e727 100644 --- a/extensions/embed/js/dist/forum.js +++ b/extensions/embed/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat["components/DiscussionPage"]},function(e,t){e.exports=flarum.core.compat["components/PostStream"]},function(e,t){e.exports=flarum.core.compat.ForumApplication},function(e,t){e.exports=flarum.core.compat["components/Composer"]},function(e,t){e.exports=flarum.core.compat["components/ModalManager"]},function(e,t){e.exports=flarum.core.compat["components/PostMeta"]},function(e,t,n){!function(t){"use strict";if("undefined"!=typeof window){var n=!0,o=10,r="",i=0,a="",c=null,u="",s=!1,l={resize:1,click:1},d=128,f=!0,m=1,p="bodyOffset",g=p,h=!0,v="",y={},b=32,w=null,T=!1,O="[iFrameSizer]",E=O.length,S="",x={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",I=!0,N=window.parent,C="*",k=0,A=!1,P=null,z=16,F=1,L="scroll",R=L,j=window,D=function(){ue("MessageCallback function not defined")},q=function(){},H=function(){},W={height:function(){return ue("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ue("Custom width calculation function not defined"),document.body.scrollWidth}},_={},B=!1;try{var V=Object.create({},{passive:{get:function(){B=!0}},once:{get:function(){!0}}});window.addEventListener("test",ne,V),window.removeEventListener("test",ne,V)}catch(e){}var J,U,$,K,Q,X,Y,G=Date.now||function(){return(new Date).getTime()},Z={bodyOffset:function(){return document.body.offsetHeight+be("marginTop")+be("marginBottom")},offset:function(){return Z.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return W.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Te(Z))},min:function(){return Math.min.apply(null,Te(Z))},grow:function(){return Z.max()},lowestElement:function(){return Math.max(Z.bodyOffset()||Z.documentElementOffset(),we("bottom",Ee()))},taggedElement:function(){return Oe("bottom","data-iframe-height")}},ee={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return W.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(ee.bodyScroll(),ee.documentElementScroll())},max:function(){return Math.max.apply(null,Te(ee))},min:function(){return Math.min.apply(null,Te(ee))},rightMostElement:function(){return we("right",Ee())},taggedElement:function(){return Oe("right","data-iframe-width")}},te=(J=Se,Q=null,X=0,Y=function(){X=G(),Q=null,K=J.apply(U,$),Q||(U=$=null)},function(){var e=G();X||(X=e);var t=z-(e-X);return U=this,$=arguments,t<=0||t>z?(Q&&(clearTimeout(Q),Q=null),X=e,K=J.apply(U,$),Q||(U=$=null)):Q||(Q=setTimeout(Y,t)),K});oe(window,"message",ke),oe(window,"readystatechange",Ae),Ae()}function ne(){}function oe(e,t,n,o){"addEventListener"in window?e.addEventListener(t,n,!!B&&(o||{})):"attachEvent"in window&&e.attachEvent("on"+t,n)}function re(e,t,n){"removeEventListener"in window?e.removeEventListener(t,n,!1):"detachEvent"in window&&e.detachEvent("on"+t,n)}function ie(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ae(e){return O+"["+S+"] "+e}function ce(e){T&&"object"==typeof window.console&&console.log(ae(e))}function ue(e){"object"==typeof window.console&&console.warn(ae(e))}function se(){var e;!function(){function e(e){return"true"===e}var o=v.substr(E).split(":");S=o[0],i=t!==o[1]?Number(o[1]):i,s=t!==o[2]?e(o[2]):s,T=t!==o[3]?e(o[3]):T,b=t!==o[4]?Number(o[4]):b,n=t!==o[6]?e(o[6]):n,a=o[7],g=t!==o[8]?o[8]:g,r=o[9],u=o[10],k=t!==o[11]?Number(o[11]):k,y.enable=t!==o[12]&&e(o[12]),M=t!==o[13]?o[13]:M,R=t!==o[14]?o[14]:R}(),ce("Initialising iFrame ("+location.href+")"),function(){function e(e,t){return"function"==typeof e&&(ce("Setup custom "+t+"CalcMethod"),W[t]=e,e="custom"),e}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(t=window.iFrameResizer,ce("Reading data from page: "+JSON.stringify(t)),D="messageCallback"in t?t.messageCallback:D,q="readyCallback"in t?t.readyCallback:q,C="targetOrigin"in t?t.targetOrigin:C,g="heightCalculationMethod"in t?t.heightCalculationMethod:g,R="widthCalculationMethod"in t?t.widthCalculationMethod:R,g=e(g,"height"),R=e(R,"width"));var t;ce("TargetOrigin for parent set to: "+C)}(),function(){t===a&&(a=i+"px");le("margin",function(e,t){-1!==t.indexOf("-")&&(ue("Negative CSS value ignored for "+e),t="");return t}("margin",a))}(),le("background",r),le("padding",u),(e=document.createElement("div")).style.clear="both",e.style.display="block",document.body.appendChild(e),pe(),ge(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),j.parentIFrame={autoResize:function(e){return!0===e&&!1===n?(n=!0,he()):!1===e&&!0===n&&(n=!1,ve()),n},close:function(){Ce(0,0,"close"),ce("Disable outgoing messages"),I=!1,ce("Remove event listener: Message"),re(window,"message",ke),!0===n&&ve()},getId:function(){return S},getPageInfo:function(e){"function"==typeof e?(H=e,Ce(0,0,"pageInfo")):(H=function(){},Ce(0,0,"pageInfoStop"))},moveToAnchor:function(e){y.findTarget(e)},reset:function(){Ne("parentIFrame.reset")},scrollTo:function(e,t){Ce(t,e,"scrollTo")},scrollToOffset:function(e,t){Ce(t,e,"scrollToOffset")},sendMessage:function(e,t){Ce(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){g=e,pe()},setWidthCalculationMethod:function(e){R=e,ge()},setTargetOrigin:function(e){ce("Set targetOrigin: "+e),C=e},size:function(e,t){var n=(e||"")+(t?","+t:"");xe("size","parentIFrame.size("+n+")",e,t)}},he(),y=function(){function e(e){var n=e.getBoundingClientRect(),o={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(n.left,10)+parseInt(o.x,10),y:parseInt(n.top,10)+parseInt(o.y,10)}}function n(n){var o=n.split("#")[1]||n,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];t!==i?function(t){var n=e(t);ce("Moving to in page link (#"+o+") at x: "+n.x+" y: "+n.y),Ce(n.y,n.x,"scrollToOffset")}(i):(ce("In page link (#"+o+") not found in iFrame, so sending to parent"),Ce(0,0,"inPageLink","#"+o))}function o(){""!==location.hash&&"#"!==location.hash&&n(location.href)}y.enable?Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(e){"#"!==e.getAttribute("href")&&oe(e,"click",function(e){e.preventDefault(),n(this.getAttribute("href"))})}),oe(window,"hashchange",o),setTimeout(o,d)):ue("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):ce("In page linking not enabled");return{findTarget:n}}(),xe("init","Init message from host page"),q()}function le(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,ce("Body "+e+' set to "'+n+'"'))}function de(e){var t={add:function(t){function n(){xe(e.eventName,e.eventType)}_[t]=n,oe(window,t,n,{passive:!0})},remove:function(e){var t=_[e];delete _[e],re(window,e,t)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),ce(ie(e.method)+" event listener: "+e.eventType)}function fe(e){de({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),de({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),de({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),de({method:e,eventType:"Input",eventName:"input"}),de({method:e,eventType:"Mouse Up",eventName:"mouseup"}),de({method:e,eventType:"Mouse Down",eventName:"mousedown"}),de({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),de({method:e,eventType:"Print",eventName:["afterprint","beforeprint"]}),de({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),de({method:e,eventType:"Touch Start",eventName:"touchstart"}),de({method:e,eventType:"Touch End",eventName:"touchend"}),de({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),de({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),de({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),de({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===M&&de({method:e,eventType:"IFrame Resized",eventName:"resize"})}function me(e,t,n,o){return t!==e&&(e in n||(ue(e+" is not a valid option for "+o+"CalculationMethod."),e=t),ce(o+' calculation method set to "'+e+'"')),e}function pe(){g=me(g,p,Z,"height")}function ge(){R=me(R,L,ee,"width")}function he(){var e;!0===n?(fe("add"),e=0>b,window.MutationObserver||window.WebKitMutationObserver?e?ye():c=function(){function e(e){function t(e){!1===e.complete&&(ce("Attach listeners to "+e.src),e.addEventListener("load",r,!1),e.addEventListener("error",i,!1),u.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function n(e){ce("Remove listeners from "+e.src),e.removeEventListener("load",r,!1),e.removeEventListener("error",i,!1),function(e){u.splice(u.indexOf(e),1)}(e)}function o(e,o,r){n(e.target),xe(o,r+": "+e.target.src,t,t)}function r(e){o(e,"imageLoad","Image loaded")}function i(e){o(e,"imageLoadFailed","Image load failed")}function a(t){xe("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}var c,u=[],s=window.MutationObserver||window.WebKitMutationObserver,l=(c=document.querySelector("body"),l=new s(a),ce("Create body MutationObserver"),l.observe(c,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),l);return{disconnect:function(){"disconnect"in l&&(ce("Disconnect body MutationObserver"),l.disconnect(),u.forEach(n))}}}():(ce("MutationObserver not supported in this browser!"),ye())):ce("Auto Resize disabled")}function ve(){fe("remove"),null!==c&&c.disconnect(),clearInterval(w)}function ye(){0!==b&&(ce("setInterval: "+b+"ms"),w=setInterval(function(){xe("interval","setInterval: "+b)},Math.abs(b)))}function be(e,t){var n=0;return t=t||document.body,n="defaultView"in document&&"getComputedStyle"in document.defaultView?null!==(n=document.defaultView.getComputedStyle(t,null))?n[e]:0:function(e){if(/^\d+(px)?$/i.test(e))return parseInt(e,o);var n=t.style.left,r=t.runtimeStyle.left;return t.runtimeStyle.left=t.currentStyle.left,t.style.left=e||0,e=t.style.pixelLeft,t.style.left=n,t.runtimeStyle.left=r,e}(t.currentStyle[e]),parseInt(n,o)}function we(e,t){for(var n=t.length,o=0,r=0,i=ie(e),a=G(),c=0;cr&&(r=o);return a=G()-a,ce("Parsed "+n+" HTML elements"),ce("Element position calculated in "+a+"ms"),function(e){e>z/2&&ce("Event throttle increased to "+(z=2*e)+"ms")}(a),r}function Te(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Oe(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(ue("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),we(e,n)}function Ee(){return document.querySelectorAll("body *")}function Se(e,n,o,r){var i,a;!function(){function e(e,t){return!(Math.abs(e-t)<=k)}return i=t!==o?o:Z[g](),a=t!==r?r:ee[R](),e(m,i)||s&&e(F,a)}()&&"init"!==e?e in{init:1,interval:1,size:1}||!(g in x||s&&R in x)?e in{interval:1}||ce("No change in size detected"):Ne(n):(Me(),Ce(m=i,F=a,e))}function xe(e,t,n,o){A&&e in l?ce("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+t),"init"===e?Se(e,t,n,o):te(e,t,n,o))}function Me(){A||(A=!0,ce("Trigger event lock on")),clearTimeout(P),P=setTimeout(function(){A=!1,ce("Trigger event lock off"),ce("--")},d)}function Ie(e){m=Z[g](),F=ee[R](),Ce(m,F,e)}function Ne(e){var t=g;g=p,ce("Reset trigger event: "+e),Me(),Ie("reset"),g=t}function Ce(e,n,o,r,i){var a;!0===I&&(t===i?i=C:ce("Message targetOrigin: "+i),ce("Sending message to host page ("+(a=S+":"+e+":"+n+":"+o+(t!==r?":"+r:""))+")"),N.postMessage(O+a,i))}function ke(t){var n={init:function(){v=t.data,N=t.source,se(),f=!1,setTimeout(function(){h=!1},d)},reset:function(){h?ce("Page reset ignored by init"):(ce("Page size reset by host page"),Ie("resetPage"))},resize:function(){xe("resizeParent","Parent window requested size check")},moveToAnchor:function(){y.findTarget(r())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=r();ce("PageInfoFromParent called from parent: "+e),H(JSON.parse(e)),ce(" --")},message:function(){var e=r();ce("MessageCallback called from parent: "+e),D(JSON.parse(e)),ce(" --")}};function o(){return t.data.split("]")[1].split(":")[0]}function r(){return t.data.substr(t.data.indexOf(":")+1)}function i(){return t.data.split(":")[2]in{true:1,false:1}}function a(){var r=o();r in n?n[r]():!e.exports&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||i()||ue("Unexpected message ("+t.data+")")}O===(""+t.data).substr(0,E)&&(!1===f?a():i()?n.init():ce('Ignored message of type "'+o()+'". Received before initialization.'))}function Ae(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()},function(e,t){e.exports=flarum.core.compat["components/AlertManager"]},function(e,t){e.exports=flarum.core.compat["utils/mapRoutes"]},function(e,t){e.exports=flarum.core.compat["utils/Pane"]},function(e,t){e.exports=flarum.core.compat["utils/Drawer"]},function(e,t){e.exports=flarum.core.compat["utils/ScrollListener"]},function(e,t,n){"use strict";n.r(t);n(8);var o=n(0),r=n(1),i=n.n(r),a=n(4),c=n.n(a),u=n(5),s=n.n(u),l=n(3),d=n.n(l),f=n(6),p=n.n(f),g=(n(9),n(7)),h=n.n(g),v=(n(10),n(11),n(12),n(13),n(2)),y=n.n(v);Object(o.extend)(c.a.prototype,"mount",function(){m.route.param("hideFirstPost")&&Object(o.extend)(d.a.prototype,"view",function(e){1===e.children[0].attrs["data-number"]&&e.children.splice(0,1)})}),m.route.mode="pathname",Object(o.override)(m,"route",function(e,t,n,o,r){if(1===arguments.length);else if(4===arguments.length&&"string"==typeof n);else if(t.addEventListener||t.attachEvent)return t.href=r.attrs.href.replace("/embed","/d"),void(t.target="_blank");return e.apply(this,Array.prototype.slice.call(arguments,1))}),Object(o.override)(h.a.prototype,"getPermalink",function(e,t){return e(t).replace("/embed","/d")}),i.a.pageInfo=m.prop({});var b=function(){var e=i.a.pageInfo();this.$().css("top",Math.max(0,e.scrollTop-e.offsetTop))};Object(o.extend)(p.a.prototype,"show",b),Object(o.extend)(s.a.prototype,"show",b),window.iFrameResizer={readyCallback:function(){window.parentIFrame.getPageInfo(i.a.pageInfo)}},Object(o.extend)(d.a.prototype,"goToNumber",function(e,t){if("reply"===t&&"parentIFrame"in window&&i.a.composer.isFullScreen()){var n=this.$(".PostStream-item:last").offset().top;window.parentIFrame.scrollToOffset(0,n)}}),Object(o.extend)(y.a.prototype,"sidebarItems",function(e){e.remove("scrubber");var t=this.discussion.replyCount();e.add("replies",m("h3",null,m("a",{href:i.a.route.discussion(this.discussion).replace("/embed","/d"),config:m.route},t," comment",1==t?"":"s")),100);var n=e.get("controls").props;n.className=n.className.replace("App-primaryControl","")}),delete i.a.routes["index.filter"],i.a.routes.discussion={path:"/embed/:id",component:y.a.component()},i.a.routes["discussion.near"]={path:"/embed/:id/:near",component:y.a.component()}}]); +module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat["components/DiscussionPage"]},function(e,t){e.exports=flarum.core.compat["components/PostStream"]},function(e,t){e.exports=flarum.core.compat.ForumApplication},function(e,t){e.exports=flarum.core.compat["components/Composer"]},function(e,t){e.exports=flarum.core.compat["components/ModalManager"]},function(e,t){e.exports=flarum.core.compat["components/PostMeta"]},function(e,t,n){!function(t){"use strict";if("undefined"!=typeof window){var n=!0,o=10,i="",r=0,a="",c=null,u="",s=!1,l={resize:1,click:1},d=128,f=!0,m=1,p="bodyOffset",g=p,h=!0,v="",y={},b=32,w=null,T=!1,O="[iFrameSizer]",E=O.length,S="",M={max:1,min:1,bodyScroll:1,documentElementScroll:1},I="child",x=!0,N=window.parent,C="*",k=0,A=!1,P=null,z=16,F=1,j="scroll",L=j,R=window,D=function(){ue("MessageCallback function not defined")},q=function(){},H=function(){},W={height:function(){return ue("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ue("Custom width calculation function not defined"),document.body.scrollWidth}},_={},B=!1;try{var V=Object.create({},{passive:{get:function(){B=!0}},once:{get:function(){!0}}});window.addEventListener("test",ne,V),window.removeEventListener("test",ne,V)}catch(e){}var J,U,$,K,Q,X,Y,G=Date.now||function(){return(new Date).getTime()},Z={bodyOffset:function(){return document.body.offsetHeight+be("marginTop")+be("marginBottom")},offset:function(){return Z.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return W.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Te(Z))},min:function(){return Math.min.apply(null,Te(Z))},grow:function(){return Z.max()},lowestElement:function(){return Math.max(Z.bodyOffset()||Z.documentElementOffset(),we("bottom",Ee()))},taggedElement:function(){return Oe("bottom","data-iframe-height")}},ee={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return W.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(ee.bodyScroll(),ee.documentElementScroll())},max:function(){return Math.max.apply(null,Te(ee))},min:function(){return Math.min.apply(null,Te(ee))},rightMostElement:function(){return we("right",Ee())},taggedElement:function(){return Oe("right","data-iframe-width")}},te=(J=Se,Q=null,X=0,Y=function(){X=G(),Q=null,K=J.apply(U,$),Q||(U=$=null)},function(){var e=G();X||(X=e);var t=z-(e-X);return U=this,$=arguments,t<=0||t>z?(Q&&(clearTimeout(Q),Q=null),X=e,K=J.apply(U,$),Q||(U=$=null)):Q||(Q=setTimeout(Y,t)),K});oe(window,"message",ke),oe(window,"readystatechange",Ae),Ae()}function ne(){}function oe(e,t,n,o){"addEventListener"in window?e.addEventListener(t,n,!!B&&(o||{})):"attachEvent"in window&&e.attachEvent("on"+t,n)}function ie(e,t,n){"removeEventListener"in window?e.removeEventListener(t,n,!1):"detachEvent"in window&&e.detachEvent("on"+t,n)}function re(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ae(e){return O+"["+S+"] "+e}function ce(e){T&&"object"==typeof window.console&&console.log(ae(e))}function ue(e){"object"==typeof window.console&&console.warn(ae(e))}function se(){var e;!function(){function e(e){return"true"===e}var o=v.substr(E).split(":");S=o[0],r=t!==o[1]?Number(o[1]):r,s=t!==o[2]?e(o[2]):s,T=t!==o[3]?e(o[3]):T,b=t!==o[4]?Number(o[4]):b,n=t!==o[6]?e(o[6]):n,a=o[7],g=t!==o[8]?o[8]:g,i=o[9],u=o[10],k=t!==o[11]?Number(o[11]):k,y.enable=t!==o[12]&&e(o[12]),I=t!==o[13]?o[13]:I,L=t!==o[14]?o[14]:L}(),ce("Initialising iFrame ("+location.href+")"),function(){function e(e,t){return"function"==typeof e&&(ce("Setup custom "+t+"CalcMethod"),W[t]=e,e="custom"),e}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(t=window.iFrameResizer,ce("Reading data from page: "+JSON.stringify(t)),D="messageCallback"in t?t.messageCallback:D,q="readyCallback"in t?t.readyCallback:q,C="targetOrigin"in t?t.targetOrigin:C,g="heightCalculationMethod"in t?t.heightCalculationMethod:g,L="widthCalculationMethod"in t?t.widthCalculationMethod:L,g=e(g,"height"),L=e(L,"width"));var t;ce("TargetOrigin for parent set to: "+C)}(),function(){t===a&&(a=r+"px");le("margin",function(e,t){-1!==t.indexOf("-")&&(ue("Negative CSS value ignored for "+e),t="");return t}("margin",a))}(),le("background",i),le("padding",u),(e=document.createElement("div")).style.clear="both",e.style.display="block",document.body.appendChild(e),pe(),ge(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),R.parentIFrame={autoResize:function(e){return!0===e&&!1===n?(n=!0,he()):!1===e&&!0===n&&(n=!1,ve()),n},close:function(){Ce(0,0,"close"),ce("Disable outgoing messages"),x=!1,ce("Remove event listener: Message"),ie(window,"message",ke),!0===n&&ve()},getId:function(){return S},getPageInfo:function(e){"function"==typeof e?(H=e,Ce(0,0,"pageInfo")):(H=function(){},Ce(0,0,"pageInfoStop"))},moveToAnchor:function(e){y.findTarget(e)},reset:function(){Ne("parentIFrame.reset")},scrollTo:function(e,t){Ce(t,e,"scrollTo")},scrollToOffset:function(e,t){Ce(t,e,"scrollToOffset")},sendMessage:function(e,t){Ce(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){g=e,pe()},setWidthCalculationMethod:function(e){L=e,ge()},setTargetOrigin:function(e){ce("Set targetOrigin: "+e),C=e},size:function(e,t){var n=(e||"")+(t?","+t:"");Me("size","parentIFrame.size("+n+")",e,t)}},he(),y=function(){function e(e){var n=e.getBoundingClientRect(),o={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(n.left,10)+parseInt(o.x,10),y:parseInt(n.top,10)+parseInt(o.y,10)}}function n(n){var o=n.split("#")[1]||n,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];t!==r?function(t){var n=e(t);ce("Moving to in page link (#"+o+") at x: "+n.x+" y: "+n.y),Ce(n.y,n.x,"scrollToOffset")}(r):(ce("In page link (#"+o+") not found in iFrame, so sending to parent"),Ce(0,0,"inPageLink","#"+o))}function o(){""!==location.hash&&"#"!==location.hash&&n(location.href)}y.enable?Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(e){"#"!==e.getAttribute("href")&&oe(e,"click",function(e){e.preventDefault(),n(this.getAttribute("href"))})}),oe(window,"hashchange",o),setTimeout(o,d)):ue("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):ce("In page linking not enabled");return{findTarget:n}}(),Me("init","Init message from host page"),q()}function le(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,ce("Body "+e+' set to "'+n+'"'))}function de(e){var t={add:function(t){function n(){Me(e.eventName,e.eventType)}_[t]=n,oe(window,t,n,{passive:!0})},remove:function(e){var t=_[e];delete _[e],ie(window,e,t)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),ce(re(e.method)+" event listener: "+e.eventType)}function fe(e){de({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),de({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),de({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),de({method:e,eventType:"Input",eventName:"input"}),de({method:e,eventType:"Mouse Up",eventName:"mouseup"}),de({method:e,eventType:"Mouse Down",eventName:"mousedown"}),de({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),de({method:e,eventType:"Print",eventName:["afterprint","beforeprint"]}),de({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),de({method:e,eventType:"Touch Start",eventName:"touchstart"}),de({method:e,eventType:"Touch End",eventName:"touchend"}),de({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),de({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),de({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),de({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===I&&de({method:e,eventType:"IFrame Resized",eventName:"resize"})}function me(e,t,n,o){return t!==e&&(e in n||(ue(e+" is not a valid option for "+o+"CalculationMethod."),e=t),ce(o+' calculation method set to "'+e+'"')),e}function pe(){g=me(g,p,Z,"height")}function ge(){L=me(L,j,ee,"width")}function he(){var e;!0===n?(fe("add"),e=0>b,window.MutationObserver||window.WebKitMutationObserver?e?ye():c=function(){function e(e){function t(e){!1===e.complete&&(ce("Attach listeners to "+e.src),e.addEventListener("load",i,!1),e.addEventListener("error",r,!1),u.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function n(e){ce("Remove listeners from "+e.src),e.removeEventListener("load",i,!1),e.removeEventListener("error",r,!1),function(e){u.splice(u.indexOf(e),1)}(e)}function o(e,o,i){n(e.target),Me(o,i+": "+e.target.src,t,t)}function i(e){o(e,"imageLoad","Image loaded")}function r(e){o(e,"imageLoadFailed","Image load failed")}function a(t){Me("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}var c,u=[],s=window.MutationObserver||window.WebKitMutationObserver,l=(c=document.querySelector("body"),l=new s(a),ce("Create body MutationObserver"),l.observe(c,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),l);return{disconnect:function(){"disconnect"in l&&(ce("Disconnect body MutationObserver"),l.disconnect(),u.forEach(n))}}}():(ce("MutationObserver not supported in this browser!"),ye())):ce("Auto Resize disabled")}function ve(){fe("remove"),null!==c&&c.disconnect(),clearInterval(w)}function ye(){0!==b&&(ce("setInterval: "+b+"ms"),w=setInterval(function(){Me("interval","setInterval: "+b)},Math.abs(b)))}function be(e,t){var n=0;return t=t||document.body,n="defaultView"in document&&"getComputedStyle"in document.defaultView?null!==(n=document.defaultView.getComputedStyle(t,null))?n[e]:0:function(e){if(/^\d+(px)?$/i.test(e))return parseInt(e,o);var n=t.style.left,i=t.runtimeStyle.left;return t.runtimeStyle.left=t.currentStyle.left,t.style.left=e||0,e=t.style.pixelLeft,t.style.left=n,t.runtimeStyle.left=i,e}(t.currentStyle[e]),parseInt(n,o)}function we(e,t){for(var n=t.length,o=0,i=0,r=re(e),a=G(),c=0;ci&&(i=o);return a=G()-a,ce("Parsed "+n+" HTML elements"),ce("Element position calculated in "+a+"ms"),function(e){e>z/2&&ce("Event throttle increased to "+(z=2*e)+"ms")}(a),i}function Te(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Oe(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(ue("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),we(e,n)}function Ee(){return document.querySelectorAll("body *")}function Se(e,n,o,i){var r,a;!function(){function e(e,t){return!(Math.abs(e-t)<=k)}return r=t!==o?o:Z[g](),a=t!==i?i:ee[L](),e(m,r)||s&&e(F,a)}()&&"init"!==e?e in{init:1,interval:1,size:1}||!(g in M||s&&L in M)?e in{interval:1}||ce("No change in size detected"):Ne(n):(Ie(),Ce(m=r,F=a,e))}function Me(e,t,n,o){A&&e in l?ce("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+t),"init"===e?Se(e,t,n,o):te(e,t,n,o))}function Ie(){A||(A=!0,ce("Trigger event lock on")),clearTimeout(P),P=setTimeout(function(){A=!1,ce("Trigger event lock off"),ce("--")},d)}function xe(e){m=Z[g](),F=ee[L](),Ce(m,F,e)}function Ne(e){var t=g;g=p,ce("Reset trigger event: "+e),Ie(),xe("reset"),g=t}function Ce(e,n,o,i,r){var a;!0===x&&(t===r?r=C:ce("Message targetOrigin: "+r),ce("Sending message to host page ("+(a=S+":"+e+":"+n+":"+o+(t!==i?":"+i:""))+")"),N.postMessage(O+a,r))}function ke(t){var n={init:function(){v=t.data,N=t.source,se(),f=!1,setTimeout(function(){h=!1},d)},reset:function(){h?ce("Page reset ignored by init"):(ce("Page size reset by host page"),xe("resetPage"))},resize:function(){Me("resizeParent","Parent window requested size check")},moveToAnchor:function(){y.findTarget(i())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=i();ce("PageInfoFromParent called from parent: "+e),H(JSON.parse(e)),ce(" --")},message:function(){var e=i();ce("MessageCallback called from parent: "+e),D(JSON.parse(e)),ce(" --")}};function o(){return t.data.split("]")[1].split(":")[0]}function i(){return t.data.substr(t.data.indexOf(":")+1)}function r(){return t.data.split(":")[2]in{true:1,false:1}}function a(){var i=o();i in n?n[i]():!e.exports&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||r()||ue("Unexpected message ("+t.data+")")}O===(""+t.data).substr(0,E)&&(!1===f?a():r()?n.init():ce('Ignored message of type "'+o()+'". Received before initialization.'))}function Ae(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()},function(e,t,n){"use strict";n.r(t);n(8);var o=n(0),i=n(1),r=n.n(i),a=n(4),c=n.n(a),u=n(5),s=n.n(u),l=n(3),d=n.n(l),f=n(6),p=n.n(f),g=n(7),h=n.n(g),v=n(2),y=n.n(v);Object(o.extend)(c.a.prototype,"mount",function(){m.route.param("hideFirstPost")&&Object(o.extend)(d.a.prototype,"view",function(e){1===e.children[0].attrs["data-number"]&&e.children.splice(0,1)})}),m.route.mode="pathname",Object(o.override)(m,"route",function(e,t,n,o,i){if(1===arguments.length);else if(4===arguments.length&&"string"==typeof n);else if(t.addEventListener||t.attachEvent)return t.href=i.attrs.href.replace("/embed","/d"),void(t.target="_blank");return e.apply(this,Array.prototype.slice.call(arguments,1))}),Object(o.override)(h.a.prototype,"getPermalink",function(e,t){return e(t).replace("/embed","/d")}),r.a.pageInfo=m.prop({});var b=function(){var e=r.a.pageInfo();this.$().css("top",Math.max(0,e.scrollTop-e.offsetTop))};Object(o.extend)(p.a.prototype,"show",b),Object(o.extend)(s.a.prototype,"show",b),window.iFrameResizer={readyCallback:function(){window.parentIFrame.getPageInfo(r.a.pageInfo)}},Object(o.extend)(d.a.prototype,"goToNumber",function(e,t){if("reply"===t&&"parentIFrame"in window&&r.a.composer.isFullScreen()){var n=this.$(".PostStream-item:last").offset().top;window.parentIFrame.scrollToOffset(0,n)}}),Object(o.extend)(y.a.prototype,"sidebarItems",function(e){e.remove("scrubber");var t=this.discussion.replyCount();e.add("replies",m("h3",null,m("a",{href:r.a.route.discussion(this.discussion).replace("/embed","/d"),config:m.route},t," comment",1==t?"":"s")),100);var n=e.get("controls").props;n.className=n.className.replace("App-primaryControl","")}),delete r.a.routes["index.filter"],r.a.routes.discussion={path:"/embed/:id",component:y.a.component()},r.a.routes["discussion.near"]={path:"/embed/:id/:near",component:y.a.component()}}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/embed/js/dist/forum.js.map b/extensions/embed/js/dist/forum.js.map index 877f1fd9d..5d4f520a0 100644 --- a/extensions/embed/js/dist/forum.js.map +++ b/extensions/embed/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/embed/webpack/bootstrap","webpack://@flarum/embed/external \"flarum.core.compat['extend']\"","webpack://@flarum/embed/external \"flarum.core.compat['app']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/PostStream']\"","webpack://@flarum/embed/external \"flarum.core.compat['ForumApplication']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/Composer']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/ModalManager']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/PostMeta']\"","webpack://@flarum/embed/./node_modules/iframe-resizer/js/iframeResizer.contentWindow.js","webpack://@flarum/embed/external \"flarum.core.compat['components/AlertManager']\"","webpack://@flarum/embed/external \"flarum.core.compat['utils/mapRoutes']\"","webpack://@flarum/embed/external \"flarum.core.compat['utils/Pane']\"","webpack://@flarum/embed/external \"flarum.core.compat['utils/Drawer']\"","webpack://@flarum/embed/external \"flarum.core.compat['utils/ScrollListener']\"","webpack://@flarum/embed/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","undefined","window","autoResize","base","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","msgID","msgIdLen","length","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","sendPermit","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","messageCallback","warn","readyCallback","pageInfoCallback","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","options","passive","once","addEventListener","noop","removeEventListener","e","func","context","args","result","timeout","previous","later","getNow","Date","now","getTime","getHeight","bodyOffset","getComputedStyle","offset","scrollHeight","custom","documentElementOffset","Math","apply","getAllMeasurements","grow","lowestElement","getMaxElement","getAllElements","taggedElement","getTaggedElements","getWidth","offsetWidth","scroll","rightMostElement","sizeIFrameThrottled","sizeIFrame","remaining","this","arguments","clearTimeout","setTimeout","receiver","chkLateLoaded","el","evt","attachEvent","detachEvent","capitalizeFirstLetter","string","charAt","toUpperCase","slice","formatLogMsg","msg","log","console","init","clearFix","strBool","str","data","substr","split","Number","enable","readDataFromParent","location","href","setupCustomCalcMethods","calcMode","calcFunc","iFrameResizer","constructor","JSON","stringify","targetOrigin","heightCalculationMethod","widthCalculationMethod","readDataFromPage","setBodyStyle","attr","indexOf","chkCSS","setMargin","createElement","style","clear","display","appendChild","checkHeightMode","checkWidthMode","parentIFrame","startEventListeners","stopEventListeners","close","sendMsg","getId","getPageInfo","callback","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollTo","x","y","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","size","customHeight","customWidth","valString","sendSize","getElementPosition","elPosition","getBoundingClientRect","pagePosition","pageXOffset","scrollLeft","pageYOffset","scrollTop","parseInt","left","top","hashData","decodeURIComponent","getElementById","getElementsByName","jumpPosition","jumpToTarget","checkLocationHash","Array","forEach","querySelectorAll","getAttribute","preventDefault","setupInPageLinks","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","map","method","manageEventListeners","checkCalcMode","calcModeDefault","modes","type","forceIntervalTimer","MutationObserver","WebKitMutationObserver","initInterval","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeImageLoadListener","splice","removeFromArray","imageEventTriggered","event","typeDesc","mutationObserved","mutations","observer","querySelector","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","disconnect","setupBodyMutationObserver","clearInterval","setInterval","abs","prop","retVal","defaultView","test","runtimeStyle","currentStyle","pixelLeft","convertUnitsToPxForIE8","side","elementsLength","elVal","maxVal","Side","timer","chkEventThottle","dimention","tag","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolarance","a","b","isSizeChangeDetected","lockTrigger","resetPage","triggerReset","hcm","message","postMessage","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","getMessageType","isInitMsg","true","false","callFromParent","messageType","jQuery","readyState","extend","ForumApplication","route","param","PostStream","vdom","children","attrs","override","original","root","arg1","arg2","replace","PostMeta","post","app","reposition","info","$","css","offsetTop","ModalManager","Composer","promise","number","composer","isFullScreen","itemTop","DiscussionPage","items","count","discussion","replyCount","config","props","className","routes","path","component"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAA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UAAYqI,EAAKG,aAGxDrB,iBAAOsB,IAAa1U,UAAW,OAAQqU,GACvCjB,iBAAOuB,IAAS3U,UAAW,OAAQqU,GAEnC7T,OAAOoI,cAAgB,CACrBrF,cAAe,WACb/C,OAAOwJ,aAAaM,YAAY8J,IAAI3B,YAIxCW,iBAAOI,IAAWxT,UAAW,aAAc,SAAS4U,EAASC,GAC3D,GAAe,UAAXA,GAAsB,iBAAkBrU,QAAU4T,IAAIU,SAASC,eAAgB,CACjF,IAAMC,EAAUtO,KAAK6N,EAAE,yBAAyBjP,SAAS8G,IACzD5L,OAAOwJ,aAAagB,eAAe,EAAGgK,MAI1C5B,iBAAO6B,IAAejV,UAAW,eAAgB,SAASkV,GACxDA,EAAM1H,OAAO,YAEb,IAAM2H,EAAQzO,KAAK0O,WAAWC,aAE9BH,EAAM9H,IAAI,UAAW5O,EAAA,UACnBA,EAAA,KAAGgK,KAAM4L,IAAId,MAAM8B,WAAW1O,KAAK0O,YAAYnB,QAAQ,SAAU,MAAOqB,OAAQ9W,EAAE8U,OAC/E6B,EADH,WAC2B,GAATA,EAAa,GAAK,MAE/B,KAEP,IAAMI,EAAQL,EAAMjW,IAAI,YAAYsW,MACpCA,EAAMC,UAAYD,EAAMC,UAAUvB,QAAQ,qBAAsB,aAG3DG,IAAIqB,OAAO,gBAClBrB,IAAIqB,OAAJ,WAA2B,CAACC,KAAM,aAAcC,UAAWV,IAAeU,aAC1EvB,IAAIqB,OAAO,mBAAqB,CAACC,KAAM,mBAAoBC,UAAWV,IAAeU","file":"forum.js","sourcesContent":[" \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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/PostStream'];","module.exports = flarum.core.compat['ForumApplication'];","module.exports = flarum.core.compat['components/Composer'];","module.exports = flarum.core.compat['components/ModalManager'];","module.exports = flarum.core.compat['components/PostMeta'];","/*\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 * Contributor: Jure Mav - jure.mav@gmail.com\n * Contributor: Ian Caunce - ian@hallnet.co.uk\n */\n\n(function(undefined) {\n 'use strict';\n\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 msgID = '[iFrameSizer]', //Must match host page msg ID\n msgIdLen = msgID.length,\n myID = '',\n observer = null,\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 messageCallback = function() {\n warn('MessageCallback function not defined');\n },\n readyCallback = function() {},\n pageInfoCallback = 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 onceSupported = 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 once: {\n get: function() {\n onceSupported = true;\n }\n }\n }\n );\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop, options);\n } catch (e) {\n /* */\n }\n\n function addEventListener(el, evt, func, options) {\n /* istanbul ignore else */ // Not testable in phantomJS\n if ('addEventListener' in window) {\n el.addEventListener(evt, func, passiveSupported ? options || {} : false);\n } else if ('attachEvent' in window) {\n //IE\n el.attachEvent('on' + evt, func);\n }\n }\n\n function removeEventListener(el, evt, func) {\n /* istanbul ignore else */ // Not testable in phantomJS\n if ('removeEventListener' in window) {\n el.removeEventListener(evt, func, false);\n } else if ('detachEvent' in window) {\n //IE\n el.detachEvent('on' + evt, func);\n }\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 = getNow();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n };\n\n return function() {\n var now = getNow();\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 context = args = null;\n }\n } else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n\n return result;\n };\n }\n\n var getNow =\n Date.now ||\n function() {\n /* istanbul ignore next */ // Not testable in PhantonJS\n return new Date().getTime();\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 console.log(formatLogMsg(msg));\n }\n }\n\n function warn(msg) {\n if ('object' === typeof window.console) {\n console.warn(formatLogMsg(msg));\n }\n }\n\n function init() {\n readDataFromParent();\n log('Initialising iFrame (' + 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 startEventListeners();\n inPageLinks = setupInPageLinks();\n sendSize('init', 'Init message from host page');\n readyCallback();\n }\n\n function readDataFromParent() {\n function strBool(str) {\n return 'true' === str ? true : false;\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 }\n\n function readDataFromPage() {\n function readData() {\n var data = window.iFrameResizer;\n\n log('Reading data from page: ' + JSON.stringify(data));\n\n messageCallback =\n 'messageCallback' in data ? data.messageCallback : messageCallback;\n readyCallback =\n 'readyCallback' in data ? data.readyCallback : readyCallback;\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 clearFix.style.display = 'block'; //Guard against this having been globally redefined in CSS.\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 if ('' !== location.hash && '#' !== location.hash) {\n findTarget(location.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 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 //sendSize('autoResize','Auto Resize enabled');\n } else if (false === resize && true === autoResize) {\n autoResize = false;\n stopEventListeners();\n }\n\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 pageInfoCallback = callback;\n sendMsg(0, 0, 'pageInfo');\n } else {\n pageInfoCallback = 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 '' +\n (customHeight ? customHeight : '') +\n (customWidth ? ',' + customWidth : '');\n //lockTrigger();\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 } //Not testable in PhantomJS\n\n /* istanbul ignore next */ 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, undefined, undefined);\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 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; // Not testable in PhantomJS\n\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 /* istanbul ignore next */ //Not testable in PhantomJS\n function convertUnitsToPxForIE8(value) {\n var PIXEL = /^\\d+(px)?$/i;\n\n if (PIXEL.test(value)) {\n return parseInt(value, base);\n }\n\n var style = el.style.left,\n runtimeStyle = el.runtimeStyle.left;\n\n el.runtimeStyle.left = el.currentStyle.left;\n el.style.left = value || 0;\n value = el.style.pixelLeft;\n el.style.left = style;\n el.runtimeStyle.left = runtimeStyle;\n\n return value;\n }\n\n var retVal = 0;\n el = el || document.body; // Not testable in phantonJS\n\n /* istanbul ignore else */ if (\n 'defaultView' in document &&\n 'getComputedStyle' in document.defaultView\n ) {\n retVal = document.defaultView.getComputedStyle(el, null);\n retVal = null !== retVal ? retVal[prop] : 0;\n } else {\n //IE8\n retVal = convertUnitsToPxForIE8(el.currentStyle[prop]);\n }\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 = getNow();\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 = getNow() - 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(dimention) {\n return [\n dimention.bodyOffset(),\n dimention.bodyScroll(),\n dimention.documentElementOffset(),\n dimention.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 (0 === elements.length) 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(\n getWidth.bodyScroll(),\n getWidth.documentElementScroll()\n );\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 pageInfoCallback(JSON.parse(msgBody));\n log(' --');\n },\n\n message: function messageFromParent() {\n var msgBody = getData();\n\n log('MessageCallback called from parent: ' + msgBody);\n messageCallback(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","module.exports = flarum.core.compat['components/AlertManager'];","module.exports = flarum.core.compat['utils/mapRoutes'];","module.exports = flarum.core.compat['utils/Pane'];","module.exports = flarum.core.compat['utils/Drawer'];","module.exports = flarum.core.compat['utils/ScrollListener'];","import 'iframe-resizer/js/iframeResizer.contentWindow.js';\n\nimport { override, extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport ForumApplication from 'flarum/ForumApplication';\nimport Composer from 'flarum/components/Composer';\nimport PostStream from 'flarum/components/PostStream';\nimport ModalManager from 'flarum/components/ModalManager';\nimport AlertManager from 'flarum/components/AlertManager';\nimport PostMeta from 'flarum/components/PostMeta';\nimport mapRoutes from 'flarum/utils/mapRoutes';\nimport Pane from 'flarum/utils/Pane';\nimport Drawer from 'flarum/utils/Drawer';\nimport ScrollListener from 'flarum/utils/ScrollListener';\n\nimport DiscussionPage from 'flarum/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\nm.route.mode = 'pathname';\n\noverride(m, 'route', function(original, root, arg1, arg2, vdom) {\n if (arguments.length === 1) {\n\n } else if (arguments.length === 4 && typeof arg1 === 'string') {\n\n } else if (root.addEventListener || root.attachEvent) {\n root.href = vdom.attrs.href.replace('/embed', '/d');\n root.target = '_blank';\n\n // TODO: If href leads to a post within this discussion that we have\n // already loaded, then scroll to it?\n return;\n }\n\n return original.apply(this, Array.prototype.slice.call(arguments, 1));\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 = m.prop({});\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('replies',

\n \n {count} comment{count == 1 ? '' : 's'}\n \n

, 100);\n\n const props = items.get('controls').props;\n props.className = props.className.replace('App-primaryControl', '');\n});\n\ndelete app.routes['index.filter'];\napp.routes['discussion'] = {path: '/embed/:id', component: DiscussionPage.component()};\napp.routes['discussion.near'] = {path: '/embed/:id/:near', component: DiscussionPage.component()};\n\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/embed/webpack/bootstrap","webpack://@flarum/embed/external \"flarum.core.compat['extend']\"","webpack://@flarum/embed/external \"flarum.core.compat['app']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/PostStream']\"","webpack://@flarum/embed/external \"flarum.core.compat['ForumApplication']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/Composer']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/ModalManager']\"","webpack://@flarum/embed/external \"flarum.core.compat['components/PostMeta']\"","webpack://@flarum/embed/./node_modules/iframe-resizer/js/iframeResizer.contentWindow.js","webpack://@flarum/embed/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","undefined","window","autoResize","base","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","msgID","msgIdLen","length","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","sendPermit","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","messageCallback","warn","readyCallback","pageInfoCallback","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","options","passive","once","addEventListener","noop","removeEventListener","e","func","context","args","result","timeout","previous","later","getNow","Date","now","getTime","getHeight","bodyOffset","getComputedStyle","offset","scrollHeight","custom","documentElementOffset","Math","apply","getAllMeasurements","grow","lowestElement","getMaxElement","getAllElements","taggedElement","getTaggedElements","getWidth","offsetWidth","scroll","rightMostElement","sizeIFrameThrottled","sizeIFrame","remaining","this","arguments","clearTimeout","setTimeout","receiver","chkLateLoaded","el","evt","attachEvent","detachEvent","capitalizeFirstLetter","string","charAt","toUpperCase","slice","formatLogMsg","msg","log","console","init","clearFix","strBool","str","data","substr","split","Number","enable","readDataFromParent","location","href","setupCustomCalcMethods","calcMode","calcFunc","iFrameResizer","constructor","JSON","stringify","targetOrigin","heightCalculationMethod","widthCalculationMethod","readDataFromPage","setBodyStyle","attr","indexOf","chkCSS","setMargin","createElement","style","clear","display","appendChild","checkHeightMode","checkWidthMode","parentIFrame","startEventListeners","stopEventListeners","close","sendMsg","getId","getPageInfo","callback","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollTo","x","y","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","size","customHeight","customWidth","valString","sendSize","getElementPosition","elPosition","getBoundingClientRect","pagePosition","pageXOffset","scrollLeft","pageYOffset","scrollTop","parseInt","left","top","hashData","decodeURIComponent","getElementById","getElementsByName","jumpPosition","jumpToTarget","checkLocationHash","Array","forEach","querySelectorAll","getAttribute","preventDefault","setupInPageLinks","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","map","method","manageEventListeners","checkCalcMode","calcModeDefault","modes","type","forceIntervalTimer","MutationObserver","WebKitMutationObserver","initInterval","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeImageLoadListener","splice","removeFromArray","imageEventTriggered","event","typeDesc","mutationObserved","mutations","observer","querySelector","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","disconnect","setupBodyMutationObserver","clearInterval","setInterval","abs","prop","retVal","defaultView","test","runtimeStyle","currentStyle","pixelLeft","convertUnitsToPxForIE8","side","elementsLength","elVal","maxVal","Side","timer","chkEventThottle","dimention","tag","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolarance","a","b","isSizeChangeDetected","lockTrigger","resetPage","triggerReset","hcm","message","postMessage","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","getMessageType","isInitMsg","true","false","callFromParent","messageType","jQuery","readyState","extend","ForumApplication","route","param","PostStream","vdom","children","attrs","override","original","root","arg1","arg2","replace","PostMeta","post","app","reposition","info","$","css","offsetTop","ModalManager","Composer","promise","number","composer","isFullScreen","itemTop","DiscussionPage","items","count","discussion","replyCount","config","props","className","routes","path","component"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN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,IAAejV,UAAW,eAAgB,SAASkV,GACxDA,EAAM1H,OAAO,YAEb,IAAM2H,EAAQzO,KAAK0O,WAAWC,aAE9BH,EAAM9H,IAAI,UAAW5O,EAAA,UACnBA,EAAA,KAAGgK,KAAM4L,IAAId,MAAM8B,WAAW1O,KAAK0O,YAAYnB,QAAQ,SAAU,MAAOqB,OAAQ9W,EAAE8U,OAC/E6B,EADH,WAC2B,GAATA,EAAa,GAAK,MAE/B,KAEP,IAAMI,EAAQL,EAAMjW,IAAI,YAAYsW,MACpCA,EAAMC,UAAYD,EAAMC,UAAUvB,QAAQ,qBAAsB,aAG3DG,IAAIqB,OAAO,gBAClBrB,IAAIqB,OAAJ,WAA2B,CAACC,KAAM,aAAcC,UAAWV,IAAeU,aAC1EvB,IAAIqB,OAAO,mBAAqB,CAACC,KAAM,mBAAoBC,UAAWV,IAAeU","file":"forum.js","sourcesContent":[" \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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/PostStream'];","module.exports = flarum.core.compat['ForumApplication'];","module.exports = flarum.core.compat['components/Composer'];","module.exports = flarum.core.compat['components/ModalManager'];","module.exports = flarum.core.compat['components/PostMeta'];","/*\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 * Contributor: Jure Mav - jure.mav@gmail.com\n * Contributor: Ian Caunce - ian@hallnet.co.uk\n */\n\n(function(undefined) {\n 'use strict';\n\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 msgID = '[iFrameSizer]', //Must match host page msg ID\n msgIdLen = msgID.length,\n myID = '',\n observer = null,\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 messageCallback = function() {\n warn('MessageCallback function not defined');\n },\n readyCallback = function() {},\n pageInfoCallback = 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 onceSupported = 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 once: {\n get: function() {\n onceSupported = true;\n }\n }\n }\n );\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop, options);\n } catch (e) {\n /* */\n }\n\n function addEventListener(el, evt, func, options) {\n /* istanbul ignore else */ // Not testable in phantomJS\n if ('addEventListener' in window) {\n el.addEventListener(evt, func, passiveSupported ? options || {} : false);\n } else if ('attachEvent' in window) {\n //IE\n el.attachEvent('on' + evt, func);\n }\n }\n\n function removeEventListener(el, evt, func) {\n /* istanbul ignore else */ // Not testable in phantomJS\n if ('removeEventListener' in window) {\n el.removeEventListener(evt, func, false);\n } else if ('detachEvent' in window) {\n //IE\n el.detachEvent('on' + evt, func);\n }\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 = getNow();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n };\n\n return function() {\n var now = getNow();\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 context = args = null;\n }\n } else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n\n return result;\n };\n }\n\n var getNow =\n Date.now ||\n function() {\n /* istanbul ignore next */ // Not testable in PhantonJS\n return new Date().getTime();\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 console.log(formatLogMsg(msg));\n }\n }\n\n function warn(msg) {\n if ('object' === typeof window.console) {\n console.warn(formatLogMsg(msg));\n }\n }\n\n function init() {\n readDataFromParent();\n log('Initialising iFrame (' + 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 startEventListeners();\n inPageLinks = setupInPageLinks();\n sendSize('init', 'Init message from host page');\n readyCallback();\n }\n\n function readDataFromParent() {\n function strBool(str) {\n return 'true' === str ? true : false;\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 }\n\n function readDataFromPage() {\n function readData() {\n var data = window.iFrameResizer;\n\n log('Reading data from page: ' + JSON.stringify(data));\n\n messageCallback =\n 'messageCallback' in data ? data.messageCallback : messageCallback;\n readyCallback =\n 'readyCallback' in data ? data.readyCallback : readyCallback;\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 clearFix.style.display = 'block'; //Guard against this having been globally redefined in CSS.\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 if ('' !== location.hash && '#' !== location.hash) {\n findTarget(location.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 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 //sendSize('autoResize','Auto Resize enabled');\n } else if (false === resize && true === autoResize) {\n autoResize = false;\n stopEventListeners();\n }\n\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 pageInfoCallback = callback;\n sendMsg(0, 0, 'pageInfo');\n } else {\n pageInfoCallback = 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 '' +\n (customHeight ? customHeight : '') +\n (customWidth ? ',' + customWidth : '');\n //lockTrigger();\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 } //Not testable in PhantomJS\n\n /* istanbul ignore next */ 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, undefined, undefined);\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 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; // Not testable in PhantomJS\n\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 /* istanbul ignore next */ //Not testable in PhantomJS\n function convertUnitsToPxForIE8(value) {\n var PIXEL = /^\\d+(px)?$/i;\n\n if (PIXEL.test(value)) {\n return parseInt(value, base);\n }\n\n var style = el.style.left,\n runtimeStyle = el.runtimeStyle.left;\n\n el.runtimeStyle.left = el.currentStyle.left;\n el.style.left = value || 0;\n value = el.style.pixelLeft;\n el.style.left = style;\n el.runtimeStyle.left = runtimeStyle;\n\n return value;\n }\n\n var retVal = 0;\n el = el || document.body; // Not testable in phantonJS\n\n /* istanbul ignore else */ if (\n 'defaultView' in document &&\n 'getComputedStyle' in document.defaultView\n ) {\n retVal = document.defaultView.getComputedStyle(el, null);\n retVal = null !== retVal ? retVal[prop] : 0;\n } else {\n //IE8\n retVal = convertUnitsToPxForIE8(el.currentStyle[prop]);\n }\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 = getNow();\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 = getNow() - 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(dimention) {\n return [\n dimention.bodyOffset(),\n dimention.bodyScroll(),\n dimention.documentElementOffset(),\n dimention.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 (0 === elements.length) 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(\n getWidth.bodyScroll(),\n getWidth.documentElementScroll()\n );\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 pageInfoCallback(JSON.parse(msgBody));\n log(' --');\n },\n\n message: function messageFromParent() {\n var msgBody = getData();\n\n log('MessageCallback called from parent: ' + msgBody);\n messageCallback(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","import 'iframe-resizer/js/iframeResizer.contentWindow.js';\n\nimport { override, extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport ForumApplication from 'flarum/ForumApplication';\nimport Composer from 'flarum/components/Composer';\nimport PostStream from 'flarum/components/PostStream';\nimport ModalManager from 'flarum/components/ModalManager';\nimport PostMeta from 'flarum/components/PostMeta';\n\nimport DiscussionPage from 'flarum/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\nm.route.mode = 'pathname';\n\noverride(m, 'route', function(original, root, arg1, arg2, vdom) {\n if (arguments.length === 1) {\n\n } else if (arguments.length === 4 && typeof arg1 === 'string') {\n\n } else if (root.addEventListener || root.attachEvent) {\n root.href = vdom.attrs.href.replace('/embed', '/d');\n root.target = '_blank';\n\n // TODO: If href leads to a post within this discussion that we have\n // already loaded, then scroll to it?\n return;\n }\n\n return original.apply(this, Array.prototype.slice.call(arguments, 1));\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 = m.prop({});\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('replies',

\n \n {count} comment{count == 1 ? '' : 's'}\n \n

, 100);\n\n const props = items.get('controls').props;\n props.className = props.className.replace('App-primaryControl', '');\n});\n\ndelete app.routes['index.filter'];\napp.routes['discussion'] = {path: '/embed/:id', component: DiscussionPage.component()};\napp.routes['discussion.near'] = {path: '/embed/:id/:near', component: DiscussionPage.component()};\n\n"],"sourceRoot":""} \ No newline at end of file