PageSourceSearch

https://www.theglobeandmail.com/pf/dist/components/combinations/we…pe-partner-sdk.chunk.js?d=961&mxId=00000000

js theglobeandmail.com collected 2026-09-24 06:43:17 UTC 92,788 bytes, 2 lines download raw bytes

vendor: 1,178 bytes, lines 1-2
1/*! For license information please see wealthscope-partner-sdk.chunk.js.LICENSE.txt */
2(this.webpackChunkFusion_components=this.webpackChunkFusion_components||[]).push([[9562],{12796:function(module){var factory;window,factory=function(){return function(n){var e={};function t(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return n[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)t.d(i,r,function(e){return n[e]}.bind(null,r));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s="./src/index.js")}({
vendor: 299 bytes, line 2
2"./node_modules/iframe-resizer/index.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nmodule.exports = __webpack_require__(/*! ./js */ "./node_modules/iframe-resizer/js/index.js")\n\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./node_modules/iframe-resizer/index.js?')},
vendor: 35,879 bytes, line 2
2"./node_modules/iframe-resizer/js/iframeResizer.contentWindow.js":function(module,exports,__webpack_require__){eval("/*\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 - [email protected]\n *\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function(undefined) {\n  if (typeof window === 'undefined') return // don't run for server side render\n\n  var autoResize = true,\n    base = 10,\n    bodyBackground = '',\n    bodyMargin = 0,\n    bodyMarginStr = '',\n    bodyObserver = null,\n    bodyPadding = '',\n    calculateWidth = false,\n    doubleEventList = { resize: 1, click: 1 },\n    eventCancelTimer = 128,\n    firstRun = true,\n    height = 1,\n    heightCalcModeDefault = 'bodyOffset',\n    heightCalcMode = heightCalcModeDefault,\n    initLock = true,\n    initMsg = '',\n    inPageLinks = {},\n    interval = 32,\n    intervalTimer = null,\n    logging = false,\n    msgID = '[iFrameSizer]', // Must match host page msg ID\n    msgIdLen = msgID.length,\n    myID = '',\n    resetRequiredMethods = {\n      max: 1,\n      min: 1,\n      bodyScroll: 1,\n      documentElementScroll: 1\n    },\n    resizeFrom = 'child',\n    sendPermit = true,\n    target = window.parent,\n    targetOriginDefault = '*',\n    tolerance = 0,\n    triggerLocked = false,\n    triggerLockedTimer = null,\n    throttledTimer = 16,\n    width = 1,\n    widthCalcModeDefault = 'scroll',\n    widthCalcMode = widthCalcModeDefault,\n    win = window,\n    onMessage = function() {\n      warn('onMessage function not defined')\n    },\n    onReady = function() {},\n    onPageInfo = function() {},\n    customCalcMethods = {\n      height: function() {\n        warn('Custom height calculation function not defined')\n        return document.documentElement.offsetHeight\n      },\n      width: function() {\n        warn('Custom width calculation function not defined')\n        return document.body.scrollWidth\n      }\n    },\n    eventHandlersByName = {},\n    passiveSupported = false\n\n  function noop() {}\n\n  try {\n    var options = Object.create(\n      {},\n      {\n        passive: {\n          get: function() {\n            passiveSupported = true\n          }\n        }\n      }\n    )\n    window.addEventListener('test', noop, options)\n    window.removeEventListener('test', noop, options)\n  } catch (error) {\n    /* */\n  }\n\n  function addEventListener(el, evt, func, options) {\n    el.addEventListener(evt, func, passiveSupported ? options || {} : false)\n  }\n\n  function removeEventListener(el, evt, func) {\n    el.removeEventListener(evt, func, false)\n  }\n\n  function capitalizeFirstLetter(string) {\n    return string.charAt(0).toUpperCase() + string.slice(1)\n  }\n\n  // Based on underscore.js\n  function throttle(func) {\n    var context,\n      args,\n      result,\n      timeout = null,\n      previous = 0,\n      later = function() {\n        previous = getNow()\n        timeout = null\n        result = func.apply(context, args)\n        if (!timeout) {\n          // eslint-disable-next-line no-multi-assign\n          context = args = null\n        }\n      }\n\n    return function() {\n      var now = 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          // eslint-disable-next-line no-multi-assign\n          context = args = null\n        }\n      } else if (!timeout) {\n        timeout = setTimeout(later, remaining)\n      }\n\n      return result\n    }\n  }\n\n  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      // eslint-disable-next-line no-console\n      console.log(formatLogMsg(msg))\n    }\n  }\n\n  function warn(msg) {\n    if ('object' === typeof window.console) {\n      // eslint-disable-next-line no-console\n      console.warn(formatLogMsg(msg))\n    }\n  }\n\n  function init() {\n    readDataFromParent()\n    log('Initialising iFrame (' + 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    onReady()\n  }\n\n  function readDataFromParent() {\n    function strBool(str) {\n      return 'true' === str\n    }\n\n    var data = initMsg.substr(msgIdLen).split(':')\n\n    myID = data[0]\n    bodyMargin = undefined !== data[1] ? Number(data[1]) : bodyMargin // For V1 compatibility\n    calculateWidth = undefined !== data[2] ? strBool(data[2]) : calculateWidth\n    logging = undefined !== data[3] ? strBool(data[3]) : logging\n    interval = undefined !== data[4] ? Number(data[4]) : interval\n    autoResize = undefined !== data[6] ? strBool(data[6]) : autoResize\n    bodyMarginStr = data[7]\n    heightCalcMode = undefined !== data[8] ? data[8] : heightCalcMode\n    bodyBackground = data[9]\n    bodyPadding = data[10]\n    tolerance = undefined !== data[11] ? Number(data[11]) : tolerance\n    inPageLinks.enable = undefined !== data[12] ? strBool(data[12]) : false\n    resizeFrom = undefined !== data[13] ? data[13] : resizeFrom\n    widthCalcMode = undefined !== data[14] ? data[14] : widthCalcMode\n  }\n\n  function depricate(key) {\n    var splitName = key.split('Callback')\n\n    if (splitName.length === 2) {\n      var name =\n        'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n      this[name] = this[key]\n      delete this[key]\n      warn(\n        \"Deprecated: '\" +\n          key +\n          \"' has been renamed '\" +\n          name +\n          \"'. The old method will be removed in the next major version.\"\n      )\n    }\n  }\n\n  function readDataFromPage() {\n    function readData() {\n      var data = window.iFrameResizer\n\n      log('Reading data from page: ' + JSON.stringify(data))\n      Object.keys(data).forEach(depricate, data)\n\n      onMessage = 'onMessage' in data ? data.onMessage : onMessage\n      onReady = 'onReady' in data ? data.onReady : onReady\n      targetOriginDefault =\n        'targetOrigin' in data ? data.targetOrigin : targetOriginDefault\n      heightCalcMode =\n        'heightCalculationMethod' in data\n          ? data.heightCalculationMethod\n          : heightCalcMode\n      widthCalcMode =\n        'widthCalculationMethod' in data\n          ? data.widthCalculationMethod\n          : widthCalcMode\n    }\n\n    function setupCustomCalcMethods(calcMode, calcFunc) {\n      if ('function' === typeof calcMode) {\n        log('Setup custom ' + calcFunc + 'CalcMethod')\n        customCalcMethods[calcFunc] = calcMode\n        calcMode = 'custom'\n      }\n\n      return calcMode\n    }\n\n    if (\n      'iFrameResizer' in window &&\n      Object === window.iFrameResizer.constructor\n    ) {\n      readData()\n      heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n      widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n    }\n\n    log('TargetOrigin for parent set to: ' + targetOriginDefault)\n  }\n\n  function chkCSS(attr, value) {\n    if (-1 !== value.indexOf('-')) {\n      warn('Negative CSS value ignored for ' + attr)\n      value = ''\n    }\n    return value\n  }\n\n  function setBodyStyle(attr, value) {\n    if (undefined !== value && '' !== value && 'null' !== value) {\n      document.body.style[attr] = value\n      log('Body ' + attr + ' set to \"' + value + '\"')\n    }\n  }\n\n  function setMargin() {\n    // If called via V1 script, convert bodyMargin from int to str\n    if (undefined === bodyMarginStr) {\n      bodyMarginStr = bodyMargin + 'px'\n    }\n\n    setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n  }\n\n  function stopInfiniteResizingOfIFrame() {\n    document.documentElement.style.height = ''\n    document.body.style.height = ''\n    log('HTML & body height set to \"auto\"')\n  }\n\n  function manageTriggerEvent(options) {\n    var listener = {\n      add: function(eventName) {\n        function handleEvent() {\n          sendSize(options.eventName, options.eventType)\n        }\n\n        eventHandlersByName[eventName] = handleEvent\n\n        addEventListener(window, eventName, handleEvent, { passive: true })\n      },\n      remove: function(eventName) {\n        var handleEvent = eventHandlersByName[eventName]\n        delete eventHandlersByName[eventName]\n\n        removeEventListener(window, eventName, handleEvent)\n      }\n    }\n\n    if (options.eventNames && Array.prototype.map) {\n      options.eventName = options.eventNames[0]\n      options.eventNames.map(listener[options.method])\n    } else {\n      listener[options.method](options.eventName)\n    }\n\n    log(\n      capitalizeFirstLetter(options.method) +\n        ' event listener: ' +\n        options.eventType\n    )\n  }\n\n  function manageEventListeners(method) {\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Animation Start',\n      eventNames: ['animationstart', 'webkitAnimationStart']\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Animation Iteration',\n      eventNames: ['animationiteration', 'webkitAnimationIteration']\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Animation End',\n      eventNames: ['animationend', 'webkitAnimationEnd']\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Input',\n      eventName: 'input'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Mouse Up',\n      eventName: 'mouseup'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Mouse Down',\n      eventName: 'mousedown'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Orientation Change',\n      eventName: 'orientationchange'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Print',\n      eventName: ['afterprint', 'beforeprint']\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Ready State Change',\n      eventName: 'readystatechange'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Touch Start',\n      eventName: 'touchstart'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Touch End',\n      eventName: 'touchend'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Touch Cancel',\n      eventName: 'touchcancel'\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Transition Start',\n      eventNames: [\n        'transitionstart',\n        'webkitTransitionStart',\n        'MSTransitionStart',\n        'oTransitionStart',\n        'otransitionstart'\n      ]\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Transition Iteration',\n      eventNames: [\n        'transitioniteration',\n        'webkitTransitionIteration',\n        'MSTransitionIteration',\n        'oTransitionIteration',\n        'otransitioniteration'\n      ]\n    })\n    manageTriggerEvent({\n      method: method,\n      eventType: 'Transition End',\n      eventNames: [\n        'transitionend',\n        'webkitTransitionEnd',\n        'MSTransitionEnd',\n        'oTransitionEnd',\n        'otransitionend'\n      ]\n    })\n    if ('child' === resizeFrom) {\n      manageTriggerEvent({\n        method: method,\n        eventType: 'IFrame Resized',\n        eventName: 'resize'\n      })\n    }\n  }\n\n  function checkCalcMode(calcMode, calcModeDefault, modes, type) {\n    if (calcModeDefault !== calcMode) {\n      if (!(calcMode in modes)) {\n        warn(\n          calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'\n        )\n        calcMode = calcModeDefault\n      }\n      log(type + ' calculation method set to \"' + calcMode + '\"')\n    }\n\n    return calcMode\n  }\n\n  function checkHeightMode() {\n    heightCalcMode = checkCalcMode(\n      heightCalcMode,\n      heightCalcModeDefault,\n      getHeight,\n      'height'\n    )\n  }\n\n  function checkWidthMode() {\n    widthCalcMode = checkCalcMode(\n      widthCalcMode,\n      widthCalcModeDefault,\n      getWidth,\n      'width'\n    )\n  }\n\n  function startEventListeners() {\n    if (true === autoResize) {\n      manageEventListeners('add')\n      setupMutationObserver()\n    } else {\n      log('Auto Resize disabled')\n    }\n  }\n\n  //   function stopMsgsToParent() {\n  //     log('Disable outgoing messages')\n  //     sendPermit = false\n  //   }\n\n  //   function removeMsgListener() {\n  //     log('Remove event listener: Message')\n  //     removeEventListener(window, 'message', receiver)\n  //   }\n\n  function disconnectMutationObserver() {\n    if (null !== bodyObserver) {\n      /* istanbul ignore next */ // Not testable in PhantonJS\n      bodyObserver.disconnect()\n    }\n  }\n\n  function stopEventListeners() {\n    manageEventListeners('remove')\n    disconnectMutationObserver()\n    clearInterval(intervalTimer)\n  }\n\n  //   function teardown() {\n  //     stopMsgsToParent()\n  //     removeMsgListener()\n  //     if (true === autoResize) stopEventListeners()\n  //   }\n\n  function injectClearFixIntoBodyElement() {\n    var clearFix = document.createElement('div')\n    clearFix.style.clear = 'both'\n    // Guard against the following having been globally redefined in CSS.\n    clearFix.style.display = 'block'\n    clearFix.style.height = '0'\n    document.body.appendChild(clearFix)\n  }\n\n  function setupInPageLinks() {\n    function getPagePosition() {\n      return {\n        x:\n          window.pageXOffset !== undefined\n            ? window.pageXOffset\n            : document.documentElement.scrollLeft,\n        y:\n          window.pageYOffset !== undefined\n            ? window.pageYOffset\n            : document.documentElement.scrollTop\n      }\n    }\n\n    function getElementPosition(el) {\n      var elPosition = el.getBoundingClientRect(),\n        pagePosition = getPagePosition()\n\n      return {\n        x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),\n        y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)\n      }\n    }\n\n    function findTarget(location) {\n      function jumpToTarget(target) {\n        var jumpPosition = getElementPosition(target)\n\n        log(\n          'Moving to in page link (#' +\n            hash +\n            ') at x: ' +\n            jumpPosition.x +\n            ' y: ' +\n            jumpPosition.y\n        )\n        sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n      }\n\n      var hash = location.split('#')[1] || location, // Remove # if present\n        hashData = decodeURIComponent(hash),\n        target =\n          document.getElementById(hashData) ||\n          document.getElementsByName(hashData)[0]\n\n      if (undefined !== target) {\n        jumpToTarget(target)\n      } else {\n        log(\n          'In page link (#' +\n            hash +\n            ') not found in iFrame, so sending to parent'\n        )\n        sendMsg(0, 0, 'inPageLink', '#' + hash)\n      }\n    }\n\n    function checkLocationHash() {\n      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        } else if (false === resize && true === autoResize) {\n          autoResize = false\n          stopEventListeners()\n        }\n        sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n        return autoResize\n      },\n\n      close: function closeF() {\n        sendMsg(0, 0, 'close')\n        // teardown()\n      },\n\n      getId: function getIdF() {\n        return myID\n      },\n\n      getPageInfo: function getPageInfoF(callback) {\n        if ('function' === typeof callback) {\n          onPageInfo = callback\n          sendMsg(0, 0, 'pageInfo')\n        } else {\n          onPageInfo = function() {}\n          sendMsg(0, 0, 'pageInfoStop')\n        }\n      },\n\n      moveToAnchor: function moveToAnchorF(hash) {\n        inPageLinks.findTarget(hash)\n      },\n\n      reset: function resetF() {\n        resetIFrame('parentIFrame.reset')\n      },\n\n      scrollTo: function scrollToF(x, y) {\n        sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n      },\n\n      scrollToOffset: function scrollToF(x, y) {\n        sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n      },\n\n      sendMessage: function sendMessageF(msg, targetOrigin) {\n        sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n      },\n\n      setHeightCalculationMethod: function setHeightCalculationMethodF(\n        heightCalculationMethod\n      ) {\n        heightCalcMode = heightCalculationMethod\n        checkHeightMode()\n      },\n\n      setWidthCalculationMethod: function setWidthCalculationMethodF(\n        widthCalculationMethod\n      ) {\n        widthCalcMode = widthCalculationMethod\n        checkWidthMode()\n      },\n\n      setTargetOrigin: function setTargetOriginF(targetOrigin) {\n        log('Set targetOrigin: ' + targetOrigin)\n        targetOriginDefault = targetOrigin\n      },\n\n      size: function sizeF(customHeight, customWidth) {\n        var valString =\n          '' + (customHeight || '') + (customWidth ? ',' + customWidth : '')\n        sendSize(\n          'size',\n          'parentIFrame.size(' + valString + ')',\n          customHeight,\n          customWidth\n        )\n      }\n    }\n  }\n\n  function initInterval() {\n    if (0 !== interval) {\n      log('setInterval: ' + interval + 'ms')\n      intervalTimer = setInterval(function() {\n        sendSize('interval', 'setInterval: ' + interval)\n      }, Math.abs(interval))\n    }\n  }\n\n  // Not testable in PhantomJS\n  /* istanbul ignore next */\n  function setupBodyMutationObserver() {\n    function addImageLoadListners(mutation) {\n      function addImageLoadListener(element) {\n        if (false === element.complete) {\n          log('Attach listeners to ' + element.src)\n          element.addEventListener('load', imageLoaded, false)\n          element.addEventListener('error', imageError, false)\n          elements.push(element)\n        }\n      }\n\n      if (mutation.type === 'attributes' && mutation.attributeName === 'src') {\n        addImageLoadListener(mutation.target)\n      } else if (mutation.type === 'childList') {\n        Array.prototype.forEach.call(\n          mutation.target.querySelectorAll('img'),\n          addImageLoadListener\n        )\n      }\n    }\n\n    function removeFromArray(element) {\n      elements.splice(elements.indexOf(element), 1)\n    }\n\n    function removeImageLoadListener(element) {\n      log('Remove listeners from ' + element.src)\n      element.removeEventListener('load', imageLoaded, false)\n      element.removeEventListener('error', imageError, false)\n      removeFromArray(element)\n    }\n\n    function imageEventTriggered(event, type, typeDesc) {\n      removeImageLoadListener(event.target)\n      sendSize(type, typeDesc + ': ' + event.target.src, 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 / Blink asyncing image loading when tags are injected into the page\n      mutations.forEach(addImageLoadListners)\n    }\n\n    function createMutationObserver() {\n      var target = document.querySelector('body'),\n        config = {\n          attributes: true,\n          attributeOldValue: false,\n          characterData: true,\n          characterDataOldValue: false,\n          childList: true,\n          subtree: true\n        }\n\n      observer = new MutationObserver(mutationObserved)\n\n      log('Create body MutationObserver')\n      observer.observe(target, config)\n\n      return observer\n    }\n\n    var elements = [],\n      MutationObserver =\n        window.MutationObserver || window.WebKitMutationObserver,\n      observer = createMutationObserver()\n\n    return {\n      disconnect: function() {\n        if ('disconnect' in observer) {\n          log('Disconnect body MutationObserver')\n          observer.disconnect()\n          elements.forEach(removeImageLoadListener)\n        }\n      }\n    }\n  }\n\n  function setupMutationObserver() {\n    var forceIntervalTimer = 0 > interval\n\n    // Not testable in PhantomJS\n    /* istanbul ignore if */ if (\n      window.MutationObserver ||\n      window.WebKitMutationObserver\n    ) {\n      if (forceIntervalTimer) {\n        initInterval()\n      } else {\n        bodyObserver = setupBodyMutationObserver()\n      }\n    } else {\n      log('MutationObserver not supported in this browser!')\n      initInterval()\n    }\n  }\n\n  // document.documentElement.offsetHeight is not reliable, so\n  // we have to jump through hoops to get a better value.\n  function getComputedStyle(prop, el) {\n    var retVal = 0\n    el = el || document.body // Not testable in phantonJS\n\n    retVal = document.defaultView.getComputedStyle(el, null)\n    retVal = null !== retVal ? retVal[prop] : 0\n\n    return parseInt(retVal, base)\n  }\n\n  function chkEventThottle(timer) {\n    if (timer > throttledTimer / 2) {\n      throttledTimer = 2 * timer\n      log('Event throttle increased to ' + throttledTimer + 'ms')\n    }\n  }\n\n  // Idea from https://github.com/guardian/iframe-messenger\n  function getMaxElement(side, elements) {\n    var elementsLength = elements.length,\n      elVal = 0,\n      maxVal = 0,\n      Side = capitalizeFirstLetter(side),\n      timer = 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(getWidth.bodyScroll(), getWidth.documentElementScroll())\n      },\n\n      max: function getMaxWidth() {\n        return Math.max.apply(null, getAllMeasurements(getWidth))\n      },\n\n      min: function getMinWidth() {\n        return Math.min.apply(null, getAllMeasurements(getWidth))\n      },\n\n      rightMostElement: function rightMostElement() {\n        return getMaxElement('right', getAllElements())\n      },\n\n      taggedElement: function getTaggedElementsWidth() {\n        return getTaggedElements('right', 'data-iframe-width')\n      }\n    }\n\n  function sizeIFrame(\n    triggerEvent,\n    triggerEventDesc,\n    customHeight,\n    customWidth\n  ) {\n    function resizeIFrame() {\n      height = currentHeight\n      width = currentWidth\n\n      sendMsg(height, width, triggerEvent)\n    }\n\n    function isSizeChangeDetected() {\n      function checkTolarance(a, b) {\n        var retVal = Math.abs(a - b) <= tolerance\n        return !retVal\n      }\n\n      currentHeight =\n        undefined !== customHeight ? customHeight : getHeight[heightCalcMode]()\n      currentWidth =\n        undefined !== customWidth ? customWidth : getWidth[widthCalcMode]()\n\n      return (\n        checkTolarance(height, currentHeight) ||\n        (calculateWidth && checkTolarance(width, currentWidth))\n      )\n    }\n\n    function isForceResizableEvent() {\n      return !(triggerEvent in { init: 1, interval: 1, size: 1 })\n    }\n\n    function isForceResizableCalcMode() {\n      return (\n        heightCalcMode in resetRequiredMethods ||\n        (calculateWidth && widthCalcMode in resetRequiredMethods)\n      )\n    }\n\n    function logIgnored() {\n      log('No change in size detected')\n    }\n\n    function checkDownSizing() {\n      if (isForceResizableEvent() && isForceResizableCalcMode()) {\n        resetIFrame(triggerEventDesc)\n      } else if (!(triggerEvent in { interval: 1 })) {\n        logIgnored()\n      }\n    }\n\n    var currentHeight, currentWidth\n\n    if (isSizeChangeDetected() || 'init' === triggerEvent) {\n      lockTrigger()\n      resizeIFrame()\n    } else {\n      checkDownSizing()\n    }\n  }\n\n  var sizeIFrameThrottled = throttle(sizeIFrame)\n\n  function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {\n    function recordTrigger() {\n      if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {\n        log('Trigger event: ' + triggerEventDesc)\n      }\n    }\n\n    function isDoubleFiredEvent() {\n      return triggerLocked && triggerEvent in doubleEventList\n    }\n\n    if (!isDoubleFiredEvent()) {\n      recordTrigger()\n      if (triggerEvent === 'init') {\n        sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth)\n      } else {\n        sizeIFrameThrottled(\n          triggerEvent,\n          triggerEventDesc,\n          customHeight,\n          customWidth\n        )\n      }\n    } else {\n      log('Trigger event cancelled: ' + triggerEvent)\n    }\n  }\n\n  function lockTrigger() {\n    if (!triggerLocked) {\n      triggerLocked = true\n      log('Trigger event lock on')\n    }\n    clearTimeout(triggerLockedTimer)\n    triggerLockedTimer = setTimeout(function() {\n      triggerLocked = false\n      log('Trigger event lock off')\n      log('--')\n    }, eventCancelTimer)\n  }\n\n  function triggerReset(triggerEvent) {\n    height = getHeight[heightCalcMode]()\n    width = getWidth[widthCalcMode]()\n\n    sendMsg(height, width, triggerEvent)\n  }\n\n  function resetIFrame(triggerEventDesc) {\n    var hcm = heightCalcMode\n    heightCalcMode = heightCalcModeDefault\n\n    log('Reset trigger event: ' + triggerEventDesc)\n    lockTrigger()\n    triggerReset('reset')\n\n    heightCalcMode = hcm\n  }\n\n  function sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n    function setTargetOrigin() {\n      if (undefined === targetOrigin) {\n        targetOrigin = targetOriginDefault\n      } else {\n        log('Message targetOrigin: ' + targetOrigin)\n      }\n    }\n\n    function sendToParent() {\n      var size = height + ':' + width,\n        message =\n          myID +\n          ':' +\n          size +\n          ':' +\n          triggerEvent +\n          (undefined !== msg ? ':' + msg : '')\n\n      log('Sending message to host page (' + message + ')')\n      target.postMessage(msgID + message, targetOrigin)\n    }\n\n    if (true === sendPermit) {\n      setTargetOrigin()\n      sendToParent()\n    }\n  }\n\n  function receiver(event) {\n    var processRequestFromParent = {\n      init: function initFromParent() {\n        initMsg = event.data\n        target = event.source\n\n        init()\n        firstRun = false\n        setTimeout(function() {\n          initLock = false\n        }, eventCancelTimer)\n      },\n\n      reset: function resetFromParent() {\n        if (!initLock) {\n          log('Page size reset by host page')\n          triggerReset('resetPage')\n        } else {\n          log('Page reset ignored by init')\n        }\n      },\n\n      resize: function resizeFromParent() {\n        sendSize('resizeParent', 'Parent window requested size check')\n      },\n\n      moveToAnchor: function moveToAnchorF() {\n        inPageLinks.findTarget(getData())\n      },\n      inPageLink: function inPageLinkF() {\n        this.moveToAnchor()\n      }, // Backward compatability\n\n      pageInfo: function pageInfoFromParent() {\n        var msgBody = getData()\n        log('PageInfoFromParent called from parent: ' + msgBody)\n        onPageInfo(JSON.parse(msgBody))\n        log(' --')\n      },\n\n      message: function messageFromParent() {\n        var msgBody = getData()\n\n        log('onMessage called from parent: ' + msgBody)\n        // eslint-disable-next-line sonarjs/no-extra-arguments\n        onMessage(JSON.parse(msgBody))\n        log(' --')\n      }\n    }\n\n    function isMessageForUs() {\n      return msgID === ('' + event.data).substr(0, msgIdLen) // ''+ Protects against non-string messages\n    }\n\n    function getMessageType() {\n      return event.data.split(']')[1].split(':')[0]\n    }\n\n    function getData() {\n      return event.data.substr(event.data.indexOf(':') + 1)\n    }\n\n    function isMiddleTier() {\n      return (\n        (!( true && 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\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./node_modules/iframe-resizer/js/iframeResizer.contentWindow.js?")},
vendor: 36,953 bytes, line 2
2"./node_modules/iframe-resizer/js/iframeResizer.js":function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * File: iframeResizer.js\n * Desc: Force iframes to size to content.\n * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\n * Author: David J. Bradshaw - [email protected]\n * Contributor: Jure Mav - [email protected]\n * Contributor: Reed Dadoune - [email protected]\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function(undefined) {\n  if (typeof window === 'undefined') return // don't run for server side render\n\n  var count = 0,\n    logEnabled = false,\n    hiddenCheckEnabled = false,\n    msgHeader = 'message',\n    msgHeaderLen = msgHeader.length,\n    msgId = '[iFrameSizer]', // Must match iframe msg ID\n    msgIdLen = msgId.length,\n    pagePosition = null,\n    requestAnimationFrame = window.requestAnimationFrame,\n    resetRequiredMethods = {\n      max: 1,\n      scroll: 1,\n      bodyScroll: 1,\n      documentElementScroll: 1\n    },\n    settings = {},\n    timer = null,\n    defaults = {\n      autoResize: true,\n      bodyBackground: null,\n      bodyMargin: null,\n      bodyMarginV1: 8,\n      bodyPadding: null,\n      checkOrigin: true,\n      inPageLinks: false,\n      enablePublicMethods: true,\n      heightCalculationMethod: 'bodyOffset',\n      id: 'iFrameResizer',\n      interval: 32,\n      log: false,\n      maxHeight: Infinity,\n      maxWidth: Infinity,\n      minHeight: 0,\n      minWidth: 0,\n      resizeFrom: 'parent',\n      scrolling: false,\n      sizeHeight: true,\n      sizeWidth: false,\n      warningTimeout: 5000,\n      tolerance: 0,\n      widthCalculationMethod: 'scroll',\n      onClose: function() {\n        return true\n      },\n      onClosed: function() {},\n      onInit: function() {},\n      onMessage: function() {\n        warn('onMessage function not defined')\n      },\n      onResized: function() {},\n      onScroll: function() {\n        return true\n      }\n    }\n\n  function getMutationObserver() {\n    return (\n      window.MutationObserver ||\n      window.WebKitMutationObserver ||\n      window.MozMutationObserver\n    )\n  }\n\n  function addEventListener(el, evt, func) {\n    el.addEventListener(evt, func, false)\n  }\n\n  function removeEventListener(el, evt, func) {\n    el.removeEventListener(evt, func, false)\n  }\n\n  function setupRequestAnimationFrame() {\n    var vendors = ['moz', 'webkit', 'o', 'ms']\n    var x\n\n    // Remove vendor prefixing if prefixed and break early if not\n    for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {\n      requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']\n    }\n\n    if (!requestAnimationFrame) {\n      log('setup', 'RequestAnimationFrame not supported')\n    }\n  }\n\n  function getMyID(iframeId) {\n    var retStr = 'Host page: ' + iframeId\n\n    if (window.top !== window.self) {\n      if (window.parentIFrame && window.parentIFrame.getId) {\n        retStr = window.parentIFrame.getId() + ': ' + iframeId\n      } else {\n        retStr = 'Nested host page: ' + iframeId\n      }\n    }\n\n    return retStr\n  }\n\n  function formatLogHeader(iframeId) {\n    return msgId + '[' + getMyID(iframeId) + ']'\n  }\n\n  function isLogEnabled(iframeId) {\n    return settings[iframeId] ? settings[iframeId].log : logEnabled\n  }\n\n  function log(iframeId, msg) {\n    output('log', iframeId, msg, isLogEnabled(iframeId))\n  }\n\n  function info(iframeId, msg) {\n    output('info', iframeId, msg, isLogEnabled(iframeId))\n  }\n\n  function warn(iframeId, msg) {\n    output('warn', iframeId, msg, true)\n  }\n\n  function output(type, iframeId, msg, enabled) {\n    if (true === enabled && 'object' === typeof window.console) {\n      // eslint-disable-next-line no-console\n      console[type](formatLogHeader(iframeId), msg)\n    }\n  }\n\n  function iFrameListener(event) {\n    function resizeIFrame() {\n      function resize() {\n        setSize(messageData)\n        setPagePosition(iframeId)\n        on('onResized', messageData)\n      }\n\n      ensureInRange('Height')\n      ensureInRange('Width')\n\n      syncResize(resize, messageData, 'init')\n    }\n\n    function processMsg() {\n      var data = msg.substr(msgIdLen).split(':')\n\n      return {\n        iframe: settings[data[0]] && settings[data[0]].iframe,\n        id: data[0],\n        height: data[1],\n        width: data[2],\n        type: data[3]\n      }\n    }\n\n    function ensureInRange(Dimension) {\n      var max = Number(settings[iframeId]['max' + Dimension]),\n        min = Number(settings[iframeId]['min' + Dimension]),\n        dimension = Dimension.toLowerCase(),\n        size = Number(messageData[dimension])\n\n      log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max)\n\n      if (size < min) {\n        size = min\n        log(iframeId, 'Set ' + dimension + ' to min value')\n      }\n\n      if (size > max) {\n        size = max\n        log(iframeId, 'Set ' + dimension + ' to max value')\n      }\n\n      messageData[dimension] = '' + size\n    }\n\n    function isMessageFromIFrame() {\n      function checkAllowedOrigin() {\n        function checkList() {\n          var i = 0,\n            retCode = false\n\n          log(\n            iframeId,\n            'Checking connection is from allowed list of origins: ' +\n              checkOrigin\n          )\n\n          for (; i < checkOrigin.length; i++) {\n            if (checkOrigin[i] === origin) {\n              retCode = true\n              break\n            }\n          }\n          return retCode\n        }\n\n        function checkSingle() {\n          var remoteHost = settings[iframeId] && settings[iframeId].remoteHost\n          log(iframeId, 'Checking connection is from: ' + remoteHost)\n          return origin === remoteHost\n        }\n\n        return checkOrigin.constructor === Array ? checkList() : checkSingle()\n      }\n\n      var origin = event.origin,\n        checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin\n\n      if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {\n        throw new Error(\n          'Unexpected message received from: ' +\n            origin +\n            ' for ' +\n            messageData.iframe.id +\n            '. Message was: ' +\n            event.data +\n            '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'\n        )\n      }\n\n      return true\n    }\n\n    function isMessageForUs() {\n      return (\n        msgId === ('' + msg).substr(0, msgIdLen) &&\n        msg.substr(msgIdLen).split(':')[0] in settings\n      ) // ''+Protects against non-string msg\n    }\n\n    function isMessageFromMetaParent() {\n      // Test if this message is from a parent above us. This is an ugly test, however, updating\n      // the message format would break backwards compatibity.\n      var retCode = messageData.type in { true: 1, false: 1, undefined: 1 }\n\n      if (retCode) {\n        log(iframeId, 'Ignoring init message from meta parent page')\n      }\n\n      return retCode\n    }\n\n    function getMsgBody(offset) {\n      return msg.substr(msg.indexOf(':') + msgHeaderLen + offset)\n    }\n\n    function forwardMsgFromIFrame(msgBody) {\n      log(\n        iframeId,\n        'onMessage passed: {iframe: ' +\n          messageData.iframe.id +\n          ', message: ' +\n          msgBody +\n          '}'\n      )\n      on('onMessage', {\n        iframe: messageData.iframe,\n        message: JSON.parse(msgBody)\n      })\n      log(iframeId, '--')\n    }\n\n    function getPageInfo() {\n      var bodyPosition = document.body.getBoundingClientRect(),\n        iFramePosition = messageData.iframe.getBoundingClientRect()\n\n      return JSON.stringify({\n        iframeHeight: iFramePosition.height,\n        iframeWidth: iFramePosition.width,\n        clientHeight: Math.max(\n          document.documentElement.clientHeight,\n          window.innerHeight || 0\n        ),\n        clientWidth: Math.max(\n          document.documentElement.clientWidth,\n          window.innerWidth || 0\n        ),\n        offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),\n        offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),\n        scrollTop: window.pageYOffset,\n        scrollLeft: window.pageXOffset,\n        documentHeight: document.documentElement.clientHeight,\n        documentWidth: document.documentElement.clientWidth,\n        windowHeight: window.innerHeight,\n        windowWidth: window.innerWidth\n      })\n    }\n\n    function sendPageInfoToIframe(iframe, iframeId) {\n      function debouncedTrigger() {\n        trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId)\n      }\n      debounceFrameEvents(debouncedTrigger, 32, iframeId)\n    }\n\n    function startPageInfoMonitor() {\n      function setListener(type, func) {\n        function sendPageInfo() {\n          if (settings[id]) {\n            sendPageInfoToIframe(settings[id].iframe, id)\n          } else {\n            stop()\n          }\n        }\n\n        ;['scroll', 'resize'].forEach(function(evt) {\n          log(id, type + evt + ' listener for sendPageInfo')\n          func(window, evt, sendPageInfo)\n        })\n      }\n\n      function stop() {\n        setListener('Remove ', removeEventListener)\n      }\n\n      function start() {\n        setListener('Add ', addEventListener)\n      }\n\n      var id = iframeId // Create locally scoped copy of iFrame ID\n\n      start()\n\n      if (settings[id]) {\n        settings[id].stopPageInfo = stop\n      }\n    }\n\n    function stopPageInfoMonitor() {\n      if (settings[iframeId] && settings[iframeId].stopPageInfo) {\n        settings[iframeId].stopPageInfo()\n        delete settings[iframeId].stopPageInfo\n      }\n    }\n\n    function checkIFrameExists() {\n      var retBool = true\n\n      if (null === messageData.iframe) {\n        warn(iframeId, 'IFrame (' + messageData.id + ') not found')\n        retBool = false\n      }\n      return retBool\n    }\n\n    function getElementPosition(target) {\n      var iFramePosition = target.getBoundingClientRect()\n\n      getPagePosition(iframeId)\n\n      return {\n        x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),\n        y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))\n      }\n    }\n\n    function scrollRequestFromChild(addOffset) {\n      /* istanbul ignore next */ // Not testable in Karma\n      function reposition() {\n        pagePosition = newPosition\n        scrollTo()\n        log(iframeId, '--')\n      }\n\n      function calcOffset() {\n        return {\n          x: Number(messageData.width) + offset.x,\n          y: Number(messageData.height) + offset.y\n        }\n      }\n\n      function scrollParent() {\n        if (window.parentIFrame) {\n          window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](\n            newPosition.x,\n            newPosition.y\n          )\n        } else {\n          warn(\n            iframeId,\n            'Unable to scroll to requested position, window.parentIFrame not found'\n          )\n        }\n      }\n\n      var offset = addOffset\n          ? getElementPosition(messageData.iframe)\n          : { x: 0, y: 0 },\n        newPosition = calcOffset()\n\n      log(\n        iframeId,\n        'Reposition requested from iFrame (offset x:' +\n          offset.x +\n          ' y:' +\n          offset.y +\n          ')'\n      )\n\n      if (window.top !== window.self) {\n        scrollParent()\n      } else {\n        reposition()\n      }\n    }\n\n    function scrollTo() {\n      if (false !== on('onScroll', pagePosition)) {\n        setPagePosition(iframeId)\n      } else {\n        unsetPagePosition()\n      }\n    }\n\n    function findTarget(location) {\n      function jumpToTarget() {\n        var jumpPosition = getElementPosition(target)\n\n        log(\n          iframeId,\n          'Moving to in page link (#' +\n            hash +\n            ') at x: ' +\n            jumpPosition.x +\n            ' y: ' +\n            jumpPosition.y\n        )\n        pagePosition = {\n          x: jumpPosition.x,\n          y: jumpPosition.y\n        }\n\n        scrollTo()\n        log(iframeId, '--')\n      }\n\n      function jumpToParent() {\n        if (window.parentIFrame) {\n          window.parentIFrame.moveToAnchor(hash)\n        } else {\n          log(\n            iframeId,\n            'In page link #' +\n              hash +\n              ' not found and window.parentIFrame not found'\n          )\n        }\n      }\n\n      var hash = location.split('#')[1] || '',\n        hashData = decodeURIComponent(hash),\n        target =\n          document.getElementById(hashData) ||\n          document.getElementsByName(hashData)[0]\n\n      if (target) {\n        jumpToTarget()\n      } else if (window.top !== window.self) {\n        jumpToParent()\n      } else {\n        log(iframeId, 'In page link #' + hash + ' not found')\n      }\n    }\n\n    function on(funcName, val) {\n      return chkEvent(iframeId, funcName, val)\n    }\n\n    function actionMsg() {\n      if (settings[iframeId] && settings[iframeId].firstRun) firstRun()\n\n      switch (messageData.type) {\n        case 'close':\n          closeIFrame(messageData.iframe)\n          break\n\n        case 'message':\n          forwardMsgFromIFrame(getMsgBody(6))\n          break\n\n        case 'autoResize':\n          settings[iframeId].autoResize = JSON.parse(getMsgBody(9))\n          break\n\n        case 'scrollTo':\n          scrollRequestFromChild(false)\n          break\n\n        case 'scrollToOffset':\n          scrollRequestFromChild(true)\n          break\n\n        case 'pageInfo':\n          sendPageInfoToIframe(\n            settings[iframeId] && settings[iframeId].iframe,\n            iframeId\n          )\n          startPageInfoMonitor()\n          break\n\n        case 'pageInfoStop':\n          stopPageInfoMonitor()\n          break\n\n        case 'inPageLink':\n          findTarget(getMsgBody(9))\n          break\n\n        case 'reset':\n          resetIFrame(messageData)\n          break\n\n        case 'init':\n          resizeIFrame()\n          on('onInit', messageData.iframe)\n          break\n\n        default:\n          resizeIFrame()\n      }\n    }\n\n    function hasSettings(iframeId) {\n      var retBool = true\n\n      if (!settings[iframeId]) {\n        retBool = false\n        warn(\n          messageData.type +\n            ' No settings for ' +\n            iframeId +\n            '. Message was: ' +\n            msg\n        )\n      }\n\n      return retBool\n    }\n\n    function iFrameReadyMsgReceived() {\n      // eslint-disable-next-line no-restricted-syntax, guard-for-in\n      for (var iframeId in settings) {\n        trigger(\n          'iFrame requested init',\n          createOutgoingMsg(iframeId),\n          document.getElementById(iframeId),\n          iframeId\n        )\n      }\n    }\n\n    function firstRun() {\n      if (settings[iframeId]) {\n        settings[iframeId].firstRun = false\n      }\n    }\n\n    var msg = event.data,\n      messageData = {},\n      iframeId = null\n\n    if ('[iFrameResizerChild]Ready' === msg) {\n      iFrameReadyMsgReceived()\n    } else if (isMessageForUs()) {\n      messageData = processMsg()\n      iframeId = messageData.id\n      if (settings[iframeId]) {\n        settings[iframeId].loaded = true\n      }\n\n      if (!isMessageFromMetaParent() && hasSettings(iframeId)) {\n        log(iframeId, 'Received: ' + msg)\n\n        if (checkIFrameExists() && isMessageFromIFrame()) {\n          actionMsg()\n        }\n      }\n    } else {\n      info(iframeId, 'Ignored: ' + msg)\n    }\n  }\n\n  function chkEvent(iframeId, funcName, val) {\n    var func = null,\n      retVal = null\n\n    if (settings[iframeId]) {\n      func = settings[iframeId][funcName]\n\n      if ('function' === typeof func) {\n        retVal = func(val)\n      } else {\n        throw new TypeError(\n          funcName + ' on iFrame[' + iframeId + '] is not a function'\n        )\n      }\n    }\n\n    return retVal\n  }\n\n  function removeIframeListeners(iframe) {\n    var iframeId = iframe.id\n    delete settings[iframeId]\n  }\n\n  function closeIFrame(iframe) {\n    var iframeId = iframe.id\n    if (chkEvent(iframeId, 'onClose', iframeId) === false) {\n      log(iframeId, 'Close iframe cancelled by onClose event')\n      return\n    }\n    log(iframeId, 'Removing iFrame: ' + iframeId)\n\n    try {\n      // Catch race condition error with React\n      if (iframe.parentNode) {\n        iframe.parentNode.removeChild(iframe)\n      }\n    } catch (error) {\n      warn(error)\n    }\n\n    chkEvent(iframeId, 'onClosed', iframeId)\n    log(iframeId, '--')\n    removeIframeListeners(iframe)\n  }\n\n  function getPagePosition(iframeId) {\n    if (null === pagePosition) {\n      pagePosition = {\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      log(\n        iframeId,\n        'Get page position: ' + pagePosition.x + ',' + pagePosition.y\n      )\n    }\n  }\n\n  function setPagePosition(iframeId) {\n    if (null !== pagePosition) {\n      window.scrollTo(pagePosition.x, pagePosition.y)\n      log(\n        iframeId,\n        'Set page position: ' + pagePosition.x + ',' + pagePosition.y\n      )\n      unsetPagePosition()\n    }\n  }\n\n  function unsetPagePosition() {\n    pagePosition = null\n  }\n\n  function resetIFrame(messageData) {\n    function reset() {\n      setSize(messageData)\n      trigger('reset', 'reset', messageData.iframe, messageData.id)\n    }\n\n    log(\n      messageData.id,\n      'Size reset requested by ' +\n        ('init' === messageData.type ? 'host page' : 'iFrame')\n    )\n    getPagePosition(messageData.id)\n    syncResize(reset, messageData, 'reset')\n  }\n\n  function setSize(messageData) {\n    function setDimension(dimension) {\n      if (!messageData.id) {\n        log('undefined', 'messageData id not set')\n        return\n      }\n      messageData.iframe.style[dimension] = messageData[dimension] + 'px'\n      log(\n        messageData.id,\n        'IFrame (' +\n          iframeId +\n          ') ' +\n          dimension +\n          ' set to ' +\n          messageData[dimension] +\n          'px'\n      )\n    }\n\n    function chkZero(dimension) {\n      // FireFox sets dimension of hidden iFrames to zero.\n      // So if we detect that set up an event to check for\n      // when iFrame becomes visible.\n\n      /* istanbul ignore next */ // Not testable in PhantomJS\n      if (!hiddenCheckEnabled && '0' === messageData[dimension]) {\n        hiddenCheckEnabled = true\n        log(iframeId, 'Hidden iFrame detected, creating visibility listener')\n        fixHiddenIFrames()\n      }\n    }\n\n    function processDimension(dimension) {\n      setDimension(dimension)\n      chkZero(dimension)\n    }\n\n    var iframeId = messageData.iframe.id\n\n    if (settings[iframeId]) {\n      if (settings[iframeId].sizeHeight) {\n        processDimension('height')\n      }\n      if (settings[iframeId].sizeWidth) {\n        processDimension('width')\n      }\n    }\n  }\n\n  function syncResize(func, messageData, doNotSync) {\n    /* istanbul ignore if */ // Not testable in PhantomJS\n    if (doNotSync !== messageData.type && requestAnimationFrame) {\n      log(messageData.id, 'Requesting animation frame')\n      requestAnimationFrame(func)\n    } else {\n      func()\n    }\n  }\n\n  function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {\n    function postMessageToIFrame() {\n      var target = settings[id] && settings[id].targetOrigin\n      log(\n        id,\n        '[' +\n          calleeMsg +\n          '] Sending msg to iframe[' +\n          id +\n          '] (' +\n          msg +\n          ') targetOrigin: ' +\n          target\n      )\n      iframe.contentWindow.postMessage(msgId + msg, target)\n    }\n\n    function iFrameNotFound() {\n      warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found')\n    }\n\n    function chkAndSend() {\n      if (\n        iframe &&\n        'contentWindow' in iframe &&\n        null !== iframe.contentWindow\n      ) {\n        // Null test for PhantomJS\n        postMessageToIFrame()\n      } else {\n        iFrameNotFound()\n      }\n    }\n\n    function warnOnNoResponse() {\n      function warning() {\n        if (settings[id] && !settings[id].loaded && !errorShown) {\n          errorShown = true\n          warn(\n            id,\n            'IFrame has not responded within ' +\n              settings[id].warningTimeout / 1000 +\n              ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'\n          )\n        }\n      }\n\n      if (\n        !!noResponseWarning &&\n        settings[id] &&\n        !!settings[id].warningTimeout\n      ) {\n        settings[id].msgTimeout = setTimeout(\n          warning,\n          settings[id].warningTimeout\n        )\n      }\n    }\n\n    var errorShown = false\n\n    id = id || iframe.id\n\n    if (settings[id]) {\n      chkAndSend()\n      warnOnNoResponse()\n    }\n  }\n\n  function createOutgoingMsg(iframeId) {\n    return (\n      iframeId +\n      ':' +\n      settings[iframeId].bodyMarginV1 +\n      ':' +\n      settings[iframeId].sizeWidth +\n      ':' +\n      settings[iframeId].log +\n      ':' +\n      settings[iframeId].interval +\n      ':' +\n      settings[iframeId].enablePublicMethods +\n      ':' +\n      settings[iframeId].autoResize +\n      ':' +\n      settings[iframeId].bodyMargin +\n      ':' +\n      settings[iframeId].heightCalculationMethod +\n      ':' +\n      settings[iframeId].bodyBackground +\n      ':' +\n      settings[iframeId].bodyPadding +\n      ':' +\n      settings[iframeId].tolerance +\n      ':' +\n      settings[iframeId].inPageLinks +\n      ':' +\n      settings[iframeId].resizeFrom +\n      ':' +\n      settings[iframeId].widthCalculationMethod\n    )\n  }\n\n  function setupIFrame(iframe, options) {\n    function setLimits() {\n      function addStyle(style) {\n        if (\n          Infinity !== settings[iframeId][style] &&\n          0 !== settings[iframeId][style]\n        ) {\n          iframe.style[style] = settings[iframeId][style] + 'px'\n          log(\n            iframeId,\n            'Set ' + style + ' = ' + settings[iframeId][style] + 'px'\n          )\n        }\n      }\n\n      function chkMinMax(dimension) {\n        if (\n          settings[iframeId]['min' + dimension] >\n          settings[iframeId]['max' + dimension]\n        ) {\n          throw new Error(\n            'Value for min' +\n              dimension +\n              ' can not be greater than max' +\n              dimension\n          )\n        }\n      }\n\n      chkMinMax('Height')\n      chkMinMax('Width')\n\n      addStyle('maxHeight')\n      addStyle('minHeight')\n      addStyle('maxWidth')\n      addStyle('minWidth')\n    }\n\n    function newId() {\n      var id = (options && options.id) || defaults.id + count++\n      if (null !== document.getElementById(id)) {\n        id += count++\n      }\n      return id\n    }\n\n    function ensureHasId(iframeId) {\n      if ('' === iframeId) {\n        // eslint-disable-next-line no-multi-assign\n        iframe.id = iframeId = newId()\n        logEnabled = (options || {}).log\n        log(\n          iframeId,\n          'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'\n        )\n      }\n\n      return iframeId\n    }\n\n    function setScrolling() {\n      log(\n        iframeId,\n        'IFrame scrolling ' +\n          (settings[iframeId] && settings[iframeId].scrolling\n            ? 'enabled'\n            : 'disabled') +\n          ' for ' +\n          iframeId\n      )\n      iframe.style.overflow =\n        false === (settings[iframeId] && settings[iframeId].scrolling)\n          ? 'hidden'\n          : 'auto'\n      switch (settings[iframeId] && settings[iframeId].scrolling) {\n        case 'omit':\n          break\n\n        case true:\n          iframe.scrolling = 'yes'\n          break\n\n        case false:\n          iframe.scrolling = 'no'\n          break\n\n        default:\n          iframe.scrolling = settings[iframeId]\n            ? settings[iframeId].scrolling\n            : 'no'\n      }\n    }\n\n    // The V1 iFrame script expects an int, where as in V2 expects a CSS\n    // string value such as '1px 3em', so if we have an int for V2, set V1=V2\n    // and then convert V2 to a string PX value.\n    function setupBodyMarginValues() {\n      if (\n        'number' ===\n          typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||\n        '0' === (settings[iframeId] && settings[iframeId].bodyMargin)\n      ) {\n        settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin\n        settings[iframeId].bodyMargin =\n          '' + settings[iframeId].bodyMargin + 'px'\n      }\n    }\n\n    function checkReset() {\n      // Reduce scope of firstRun to function, because IE8's JS execution\n      // context stack is borked and this value gets externally\n      // changed midway through running this function!!!\n      var firstRun = settings[iframeId] && settings[iframeId].firstRun,\n        resetRequertMethod =\n          settings[iframeId] &&\n          settings[iframeId].heightCalculationMethod in resetRequiredMethods\n\n      if (!firstRun && resetRequertMethod) {\n        resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' })\n      }\n    }\n\n    function setupIFrameObject() {\n      if (settings[iframeId]) {\n        settings[iframeId].iframe.iFrameResizer = {\n          close: closeIFrame.bind(null, settings[iframeId].iframe),\n\n          removeListeners: removeIframeListeners.bind(\n            null,\n            settings[iframeId].iframe\n          ),\n\n          resize: trigger.bind(\n            null,\n            'Window resize',\n            'resize',\n            settings[iframeId].iframe\n          ),\n\n          moveToAnchor: function(anchor) {\n            trigger(\n              'Move to anchor',\n              'moveToAnchor:' + anchor,\n              settings[iframeId].iframe,\n              iframeId\n            )\n          },\n\n          sendMessage: function(message) {\n            message = JSON.stringify(message)\n            trigger(\n              'Send Message',\n              'message:' + message,\n              settings[iframeId].iframe,\n              iframeId\n            )\n          }\n        }\n      }\n    }\n\n    // We have to call trigger twice, as we can not be sure if all\n    // iframes have completed loading when this code runs. The\n    // event listener also catches the page changing in the iFrame.\n    function init(msg) {\n      function iFrameLoaded() {\n        trigger('iFrame.onload', msg, iframe, undefined, true)\n        checkReset()\n      }\n\n      function createDestroyObserver(MutationObserver) {\n        if (!iframe.parentNode) {\n          return\n        }\n\n        var destroyObserver = new MutationObserver(function(mutations) {\n          mutations.forEach(function(mutation) {\n            var removedNodes = Array.prototype.slice.call(mutation.removedNodes) // Transform NodeList into an Array\n            removedNodes.forEach(function(removedNode) {\n              if (removedNode === iframe) {\n                closeIFrame(iframe)\n              }\n            })\n          })\n        })\n        destroyObserver.observe(iframe.parentNode, {\n          childList: true\n        })\n      }\n\n      var MutationObserver = getMutationObserver()\n      if (MutationObserver) {\n        createDestroyObserver(MutationObserver)\n      }\n\n      addEventListener(iframe, 'load', iFrameLoaded)\n      trigger('init', msg, iframe, undefined, true)\n    }\n\n    function checkOptions(options) {\n      if ('object' !== typeof options) {\n        throw new TypeError('Options is not an object')\n      }\n    }\n\n    function copyOptions(options) {\n      // eslint-disable-next-line no-restricted-syntax\n      for (var option in defaults) {\n        if (Object.prototype.hasOwnProperty.call(defaults, option)) {\n          settings[iframeId][option] = Object.prototype.hasOwnProperty.call(\n            options,\n            option\n          )\n            ? options[option]\n            : defaults[option]\n        }\n      }\n    }\n\n    function getTargetOrigin(remoteHost) {\n      return '' === remoteHost || 'file://' === remoteHost ? '*' : remoteHost\n    }\n\n    function depricate(key) {\n      var splitName = key.split('Callback')\n\n      if (splitName.length === 2) {\n        var name =\n          'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n        this[name] = this[key]\n        delete this[key]\n        warn(\n          iframeId,\n          \"Deprecated: '\" +\n            key +\n            \"' has been renamed '\" +\n            name +\n            \"'. The old method will be removed in the next major version.\"\n        )\n      }\n    }\n\n    function processOptions(options) {\n      options = options || {}\n      settings[iframeId] = {\n        firstRun: true,\n        iframe: iframe,\n        remoteHost: iframe.src\n          .split('/')\n          .slice(0, 3)\n          .join('/')\n      }\n\n      checkOptions(options)\n      Object.keys(options).forEach(depricate, options)\n      copyOptions(options)\n\n      if (settings[iframeId]) {\n        settings[iframeId].targetOrigin =\n          true === settings[iframeId].checkOrigin\n            ? getTargetOrigin(settings[iframeId].remoteHost)\n            : '*'\n      }\n    }\n\n    function beenHere() {\n      return iframeId in settings && 'iFrameResizer' in iframe\n    }\n\n    var iframeId = ensureHasId(iframe.id)\n\n    if (!beenHere()) {\n      processOptions(options)\n      setScrolling()\n      setLimits()\n      setupBodyMarginValues()\n      init(createOutgoingMsg(iframeId))\n      setupIFrameObject()\n    } else {\n      warn(iframeId, 'Ignored iFrame, already setup.')\n    }\n  }\n\n  function debouce(fn, time) {\n    if (null === timer) {\n      timer = setTimeout(function() {\n        timer = null\n        fn()\n      }, time)\n    }\n  }\n\n  var frameTimer = {}\n  function debounceFrameEvents(fn, time, frameId) {\n    if (!frameTimer[frameId]) {\n      frameTimer[frameId] = setTimeout(function() {\n        frameTimer[frameId] = null\n        fn()\n      }, time)\n    }\n  }\n\n  // Not testable in PhantomJS\n  /* istanbul ignore next */\n\n  function fixHiddenIFrames() {\n    function checkIFrames() {\n      function checkIFrame(settingId) {\n        function chkDimension(dimension) {\n          return (\n            '0px' ===\n            (settings[settingId] && settings[settingId].iframe.style[dimension])\n          )\n        }\n\n        function isVisible(el) {\n          return null !== el.offsetParent\n        }\n\n        if (\n          settings[settingId] &&\n          isVisible(settings[settingId].iframe) &&\n          (chkDimension('height') || chkDimension('width'))\n        ) {\n          trigger(\n            'Visibility change',\n            'resize',\n            settings[settingId].iframe,\n            settingId\n          )\n        }\n      }\n\n      Object.keys(settings).forEach(function(key) {\n        checkIFrame(settings[key])\n      })\n    }\n\n    function mutationObserved(mutations) {\n      log(\n        'window',\n        'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type\n      )\n      debouce(checkIFrames, 16)\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        observer = new MutationObserver(mutationObserved)\n\n      observer.observe(target, config)\n    }\n\n    var MutationObserver = getMutationObserver()\n    if (MutationObserver) {\n      createMutationObserver()\n    }\n  }\n\n  function resizeIFrames(event) {\n    function resize() {\n      sendTriggerMsg('Window ' + event, 'resize')\n    }\n\n    log('window', 'Trigger event: ' + event)\n    debouce(resize, 16)\n  }\n\n  // Not testable in PhantomJS\n  /* istanbul ignore next */\n  function tabVisible() {\n    function resize() {\n      sendTriggerMsg('Tab Visable', 'resize')\n    }\n\n    if ('hidden' !== document.visibilityState) {\n      log('document', 'Trigger event: Visiblity change')\n      debouce(resize, 16)\n    }\n  }\n\n  function sendTriggerMsg(eventName, event) {\n    function isIFrameResizeEnabled(iframeId) {\n      return (\n        settings[iframeId] &&\n        'parent' === settings[iframeId].resizeFrom &&\n        settings[iframeId].autoResize &&\n        !settings[iframeId].firstRun\n      )\n    }\n\n    Object.keys(settings).forEach(function(iframeId) {\n      if (isIFrameResizeEnabled(iframeId)) {\n        trigger(eventName, event, document.getElementById(iframeId), iframeId)\n      }\n    })\n  }\n\n  function setupEventListeners() {\n    addEventListener(window, 'message', iFrameListener)\n\n    addEventListener(window, 'resize', function() {\n      resizeIFrames('resize')\n    })\n\n    addEventListener(document, 'visibilitychange', tabVisible)\n\n    addEventListener(document, '-webkit-visibilitychange', tabVisible)\n  }\n\n  function factory() {\n    function init(options, element) {\n      function chkType() {\n        if (!element.tagName) {\n          throw new TypeError('Object is not a valid DOM element')\n        } else if ('IFRAME' !== element.tagName.toUpperCase()) {\n          throw new TypeError(\n            'Expected <IFRAME> tag, found <' + element.tagName + '>'\n          )\n        }\n      }\n\n      if (element) {\n        chkType()\n        setupIFrame(element, options)\n        iFrames.push(element)\n      }\n    }\n\n    function warnDeprecatedOptions(options) {\n      if (options && options.enablePublicMethods) {\n        warn(\n          'enablePublicMethods option has been removed, public methods are now always available in the iFrame'\n        )\n      }\n    }\n\n    var iFrames\n\n    setupRequestAnimationFrame()\n    setupEventListeners()\n\n    return function iFrameResizeF(options, target) {\n      iFrames = [] // Only return iFrames past in on this call\n\n      warnDeprecatedOptions(options)\n\n      switch (typeof target) {\n        case 'undefined':\n        case 'string':\n          Array.prototype.forEach.call(\n            document.querySelectorAll(target || 'iframe'),\n            init.bind(undefined, options)\n          )\n          break\n\n        case 'object':\n          init(options, target)\n          break\n\n        default:\n          throw new TypeError('Unexpected data type (' + typeof target + ')')\n      }\n\n      return iFrames\n    }\n  }\n\n  function createJQueryPublicMethod($) {\n    if (!$.fn) {\n      info('', 'Unable to bind to jQuery, it is not fully loaded.')\n    } else if (!$.fn.iFrameResize) {\n      $.fn.iFrameResize = function $iFrameResizeF(options) {\n        function init(index, element) {\n          setupIFrame(element, options)\n        }\n\n        return this.filter('iframe')\n          .each(init)\n          .end()\n      }\n    }\n  }\n\n  if (window.jQuery) {\n    createJQueryPublicMethod(window.jQuery)\n  }\n\n  if (true) {\n    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n  } else {}\n  window.iFrameResize = window.iFrameResize || factory()\n})()\n\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./node_modules/iframe-resizer/js/iframeResizer.js?")},
vendor: 577 bytes, line 2
2"./node_modules/iframe-resizer/js/index.js":function(module,exports,__webpack_require__){eval('const iframeResize = __webpack_require__(/*! ./iframeResizer */ "./node_modules/iframe-resizer/js/iframeResizer.js")\n\nexports.iframeResize = iframeResize\nexports.iframeResizer = iframeResize // Backwards compatability\nexports.iframeResizerContentWindow = __webpack_require__(/*! ./iframeResizer.contentWindow */ "./node_modules/iframe-resizer/js/iframeResizer.contentWindow.js")\n\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./node_modules/iframe-resizer/js/index.js?')},
vendor: 3,063 bytes, line 2
2"./node_modules/url-join/lib/url-join.js":function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (name, context, definition) {\n  if ( true && module.exports) module.exports = definition();\n  else if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  else {}\n})('urljoin', this, function () {\n\n  function normalize (strArray) {\n    var resultArray = [];\n    if (strArray.length === 0) { return ''; }\n\n    if (typeof strArray[0] !== 'string') {\n      throw new TypeError('Url must be a string. Received ' + strArray[0]);\n    }\n\n    // If the first part is a plain protocol, we combine it with the next part.\n    if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n      var first = strArray.shift();\n      strArray[0] = first + strArray[0];\n    }\n\n    // There must be two or three slashes in the file protocol, two slashes in anything else.\n    if (strArray[0].match(/^file:\\/\\/\\//)) {\n      strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n    } else {\n      strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n    }\n\n    for (var i = 0; i < strArray.length; i++) {\n      var component = strArray[i];\n\n      if (typeof component !== 'string') {\n        throw new TypeError('Url must be a string. Received ' + component);\n      }\n\n      if (component === '') { continue; }\n\n      if (i > 0) {\n        // Removing the starting slashes for each component but the first.\n        component = component.replace(/^[\\/]+/, '');\n      }\n      if (i < strArray.length - 1) {\n        // Removing the ending slashes for each component but the last.\n        component = component.replace(/[\\/]+$/, '');\n      } else {\n        // For the last component we will combine multiple slashes to a single one.\n        component = component.replace(/[\\/]+$/, '/');\n      }\n\n      resultArray.push(component);\n\n    }\n\n    var str = resultArray.join('/');\n    // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n    // remove trailing slash before parameters or hash\n    str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n    // replace ? in parameters with &\n    var parts = str.split('?');\n    str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n    return str;\n  }\n\n  return function () {\n    var input;\n\n    if (typeof arguments[0] === 'object') {\n      input = arguments[0];\n    } else {\n      input = [].slice.call(arguments);\n    }\n\n    return normalize(input);\n  };\n\n});\n\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./node_modules/url-join/lib/url-join.js?")},
2"./package.json":function(module){eval('module.exports = {"name":"wealthscope-partner-sdk","version":"1.2.3","main":"lib/index.js","license":"MIT","scripts":{"start":"webpack --watch","test":"karma start --single-run --browsers ChromeHeadless karma.conf.js","build":"webpack"},"dependencies":{"iframe-resizer":"^4.2.1","url-join":"^4.0.1"},"devDependencies":{"@babel/core":"^7.1.6","@babel/preset-env":"^7.1.6","babel-core":"^6.26.3","babel-loader":"^8.0.4","chai":"^4.2.0","eslint":"^5.9.0","eslint-config-google":"^0.11.0","eslint-loader":"^2.1.1","karma":"^4.1.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-mocha":"^1.3.0","karma-requirejs":"^1.1.0","karma-webpack":"^3.0.5","mocha":"^5.2.0","nodemon":"^1.18.7","requirejs":"^2.3.6","webpack":"^4.26.1","webpack-cli":"^3.1.2"}};\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./package.json?')},
2"./src/index.js":function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WealthscopeSdk\", function() { return WealthscopeSdk; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WealthscopeApiClient\", function() { return WealthscopeApiClient; });\n/* harmony import */ var iframe_resizer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! iframe-resizer */ \"./node_modules/iframe-resizer/index.js\");\n/* harmony import */ var iframe_resizer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(iframe_resizer__WEBPACK_IMPORTED_MODULE_0__);\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar _require = __webpack_require__(/*! ../package.json */ \"./package.json\"),\n    _version = _require.version;\n\nvar urlJoin = __webpack_require__(/*! url-join */ \"./node_modules/url-join/lib/url-join.js\");\n\nvar SDK_READY = 'SDK_READY';\nvar WS_UI_LOADED = 'WS_UI_LOADED';\n\nvar WealthscopeSdk =\n/*#__PURE__*/\nfunction () {\n  function WealthscopeSdk(opts) {\n    _classCallCheck(this, WealthscopeSdk);\n\n    // A queue to hold messages that are to be dispatched\n    this.msgQueue = []; // Flag which signifies whether the iFrame is ready\n\n    this.isReady = false; // Flag which signifies if the SDK has been initiated\n\n    this.isInit = false; // A timeout which holds the next dequeue attempt\n\n    this.nextDequeueAttempt = null; // User options\n\n    this.opts = Object.assign({\n      // place defaults here\n      wealthscopeUrl: 'https://bus.wealthscope.ca',\n      width: '100%',\n      scrolling: 'no',\n      id: 'wealthscope'\n    }, opts);\n  }\n\n  _createClass(WealthscopeSdk, [{\n    key: \"render\",\n    value: function render(element) {\n      var _this = this;\n\n      return new Promise(function (resolve) {\n        _this.element = element;\n        var iframe = document.createElement('iframe');\n        iframe.id = _this.opts.id;\n        iframe.src = _this.opts.wealthscopeUrl;\n        iframe.width = _this.opts.width;\n        iframe.height = _this.opts.height;\n        element.appendChild(iframe);\n        _this.iframe = iframe;\n\n        if (!_this.isInit) {\n          window.addEventListener('message', function (msg) {\n            var data = msg.data;\n            var type = data.type;\n\n            if (type === SDK_READY) {\n              _this.isReady = true;\n              return resolve();\n            }\n\n            if (type === WS_UI_LOADED) {\n              var event = new CustomEvent('wealthscope_ui_load', {\n                detail: true\n              });\n              window.parent.document.dispatchEvent(event);\n            }\n          }); // Signify that the SDK has been initialized\n\n          _this.isInit = true;\n        }\n      });\n    } // This will load the SDK with the extra step of resetting it if already\n    // loaded.\n    // NOTE: When it's reset, you will have to log back in.\n\n  }, {\n    key: \"load\",\n    value: function load(element) {\n      if (this.isReady) {\
2n        this.logout();\n        this.isReady = false;\n      }\n\n      if (this.element) {\n        this.element.innerHTML = ''; // Clear previous element\n      }\n\n      return this.render(element);\n    }\n  }, {\n    key: \"login\",\n    value: function login(jwtData) {\n      var message = {\n        type: 'auth',\n        token: jwtData\n      };\n\n      this._enqueue(message);\n    }\n  }, {\n    key: \"logout\",\n    value: function logout() {\n      var message = {\n        type: 'logout'\n      };\n\n      this._enqueue(message);\n    } // Add a message to the queue\n\n  }, {\n    key: \"_enqueue\",\n    value: function _enqueue(message) {\n      this.msgQueue.push(message);\n\n      this._dequeue(); // Attempt to dequeue the message\n\n    } // Attempt to dequeue the entire queue of messages\n\n  }, {\n    key: \"_dequeue\",\n    value: function _dequeue() {\n      var _this2 = this;\n\n      // Clear the current task, if there is one\n      clearTimeout(this.nextDequeueAttempt);\n      this.nextDequeueAttempt = null;\n\n      if (this.msgQueue.length <= 0) {\n        return;\n      }\n\n      if (this.isReady) {\n        // Dequeue the queue if the iFrame is ready\n        var contentWindow = this.iframe.contentWindow;\n        this.iframe.onload = Object(iframe_resizer__WEBPACK_IMPORTED_MODULE_0__[\"iframeResizer\"])({\n          log: false\n        }, this.iframe);\n\n        while (this.msgQueue.length > 0) {\n          var message = this.msgQueue.shift();\n          contentWindow.postMessage(message, this.opts.wealthscopeUrl);\n        }\n      } else {\n        // Set a timeout to attempt again in 250ms\n        if (!this.nextDequeueAttempt) {\n          this.nextDequeueAttempt = setTimeout(function () {\n            return _this2._dequeue();\n          }, 250);\n        }\n      }\n    }\n  }], [{\n    key: \"version\",\n    value: function version() {\n      return _version;\n    }\n  }]);\n\n  return WealthscopeSdk;\n}();\nvar WealthscopeApiClient =\n/*#__PURE__*/\nfunction () {\n  /**\n   * Constructor for the Wealthscope Client API.\n   * Initializes authorization token for the current session to null, and the\n   * base URL.\n   * @param {object} opts options object.\n   */\n  function WealthscopeApiClient(opts) {\n    _classCallCheck(this, WealthscopeApiClient);\n\n    this.token = null;\n    this.opts = Object.assign({\n      wealthscopeUrl: 'https://api.bus.wealthscope.ca/v1'\n    }, opts);\n  }\n  /**\n   * Function that returns the current version from the package.json.\n   * @return {string} the current version of the package\n   */\n\n\n  _createClass(WealthscopeApiClient, [{\n    key: \"login\",\n\n    /**\n     * This generates an Authentication token and sets this.token to the\n     * generated token.\n     * @param {string} jwtData The login payload for your user.\n     * @return {Promise<Response>}\n     */\n    value: function login(jwtData) {\n      var _this3 = this;\n\n      return fetch(this._constructUrl('/auth/authenticate/'), {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: JSON.stringify({\n          token: jwtData\n        })\n      }).then(\n      /*#__PURE__*/\n      function () {\n        var _ref = _asyncToGenerator(\n        /*#__PURE__*/\n        regeneratorRuntime.mark(function _callee(response) {\n          var json;\n          return regeneratorRuntime.wrap(function _callee$(_context) {\n            while (1) {\n              switch (_context.prev = _context.next) {\n                case 0:\n                  _context.next = 2;\n                  return response.json();\n\n                case 2:\n                  json = _context.sent;\n                  _this3.token = json.token;\n                  return _context.abrupt(\"return\", response);\n\n                case 5:\n                case \"end\":\n                  return _context.stop();\n              }\n            }\n          }, _callee, this);\n        }));\n\n        return function (_x) {\n          return _ref.apply(this, arguments);\n        };\n      }());\n    }\n    /**\n     * This simply resets the token to null. No API call is actually made.\n     * @return {Promise}\n     */\n\n  }, {\n    key: \"logout\",\n    value: function logout() {\n      this.token = null;\n      return Promise.resolve();\n    }\n    /**\n     * This is an HTTP call using the GET method.  It requires a URL.\n     * Login must also succesfully be called before calling this method.\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @return {Promise<Response>}\n     */\n\n  }, {\n    key: \"get\",\n    value: function get(url) {\n      return this._doFetch(url, 'GET');\n    }\n    /**\n     * This is an HTTP call using the PUT method.  It requires a URL and a body.\n     * Login must also succesfully be called before calling this method.\n     * NOTE: Body needs to be a JSON object here, it gets stringified when it is\n     * added to the options object for the fetch.\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @param {object} body The json object that is the payload for the call\n     * @return {Promise<Response>}\n     */\n\n  }
2, {\n    key: \"put\",\n    value: function put(url, body) {\n      return this._doFetch(url, 'PUT', body);\n    }\n    /**\n     * This is an HTTP call using the POST method.  It requires a URL and a body.\n     * Login must also succesfully be called before calling this method.\n     * NOTE: Body needs to be a JSON object here, it gets stringified when it is\n     * added to the options object for the fetch.\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @param {object} body The json object that is the payload for the call\n     * @return {Promise<Response>}\n     */\n\n  }, {\n    key: \"post\",\n    value: function post(url, body) {\n      return this._doFetch(url, 'POST', body);\n    }\n    /**\n     * This is an HTTP call using the DELETE method. It requires a URL and a body\n     * Login must also succesfully be called before calling this method.\n     * NOTE: Body needs to be a JSON object here, it gets stringified when it is\n     * added to the options object for the fetch.\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @param {object} body The json object that is the payload for the call\n     * @return {Promise<Response>}\n     */\n\n  }, {\n    key: \"del\",\n    value: function del(url, body) {\n      return this._doFetch(url, 'DELETE', body);\n    }\n    /**\n     * @private\n     * Generates a URL based on options.wealthscopeUrl, and ensures a trailing '/'\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @return {string} A fully constructed URL\n     */\n\n  }, {\n    key: \"_constructUrl\",\n    value: function _constructUrl(url) {\n      // trailing slash is important in order for `fetch` to work with the Django\n      // backend.\n      return urlJoin(this.opts.wealthscopeUrl, url) + '/';\n    }\n    /**\n     * @private\n     * This function constructs the options object that will be used by the\n     * various fetch calls below.\n     * NOTE: method must be in ALL CAPS, body must be a json object\n     * @param {string} method The HTTP method for the fetch call (GET, PUT...)\n     * @param {object} body The json object that is the payload for the call\n     * @return {object}\n     */\n\n  }, {\n    key: \"_getFetchOptions\",\n    value: function _getFetchOptions(method, body) {\n      // An options object with empty headers\n      var fetchOption = {\n        headers: {}\n      }; // The Method portion of the object\n\n      fetchOption.method = method; // A check to make sure token is present before adding it to the options\n      // return an error if token isn't present\n\n      if (this.token !== null) {\n        fetchOption.headers.Authorization = 'JWT ' + this.token;\n      } else {\n        throw new Error('You must be logged in to perform this action.');\n      } // A check for a body before it's added to the options, allows the same\n      // construction functon to be used for calls without a body component\n      // Returns the object without the body if body is empty, adds the body to\n      // the object if it's present\n\n\n      if (body) {\n        fetchOption.headers['Content-Type'] = 'application/json';\n        fetchOption.body = JSON.stringify(body);\n      }\n\n      return fetchOption;\n    }\n    /**\n     * @private\n     * This function handles fetch calls by being passed parameters from each\n     * of GET, PUT, POST, and DELETE\n     * @param {string} url The URL of the desired Wealthscope endpoint\n     * @param {string} method The HTTP method (GET, PUT, POST, or DELETE)\n     * @param {object} body The json object that is the payload for the call\n     * @return {Promise<Response>}\n     */\n\n  }, {\n    key: \"_doFetch\",\n    value: function _doFetch(url, method, body) {\n      var options = this._getFetchOptions(method, body);\n\n      return fetch(this._constructUrl(url), options).catch(function (err) {\n        return console.error(err);\n      });\n    }\n  }], [{\n    key: \"version\",\n    value: function version() {\n      return _version;\n    }\n  }]);\n\n  return WealthscopeApiClient;\n}();\n\n//# sourceURL=webpack://wealthscope-partner-sdk/./src/index.js?")}
2})},module.exports=factory()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.