{"version":3,"file":"shared-lib.DRAFDGHr.mjs","names":[],"sources":["https:/framerusercontent.com/modules/yBHUd4DlS0e1gSSOiAye/zri8Au60XBmwmOiB1Gjh/siteMetadata.js"],"sourcesContent":["// Generated by Framer (838580a)\nexport default function metadata(params,activeLocale){return{customHTMLBodyEnd:\"\\n<script>\\n    /*\\n* Pym.js is library that resizes an iframe based on the width of the parent and the resulting height of the child.\\n* Check out the docs at http://blog.apps.npr.org/pym.js/ or the readme at README.md for usage.\\n*/\\n/** @module pym */\\n(function(factory) {\\n    if (typeof define === 'function' && define.amd) {\\n        define(factory);\\n    }\\n    else if (typeof module !== 'undefined' && module.exports) {\\n        module.exports = factory();\\n    } else {\\n        window.pym = factory.call(this);\\n    }\\n})(function() {\\n    var MESSAGE_DELIMITER = 'xPYMx';\\n    var lib = {};\\n    /**\\n    * Create and dispatch a custom pym event\\n    *\\n    * @method _raiseCustomEvent\\n    * @inner\\n    *\\n    * @param {String} eventName\\n    */\\n   var _raiseCustomEvent = function(eventName) {\\n     var event = document.createEvent('Event');\\n     event.initEvent('pym:' + eventName, true, true);\\n     document.dispatchEvent(event);\\n   };\\n    /**\\n    * Generic function for parsing URL params.\\n    * Via http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript\\n    *\\n    * @method _getParameterByName\\n    * @inner\\n    *\\n    * @param {String} name The name of the paramter to get from the URL.\\n    */\\n    var _getParameterByName = function(name) {\\n        var regex = new RegExp(\\\"[\\\\\\\\?&]\\\" + name.replace(/[\\\\[]/, '\\\\\\\\[').replace(/[\\\\]]/, '\\\\\\\\]') + '=([^&#]*)');\\n        var results = regex.exec(location.search);\\n        if (results === null) {\\n            return '';\\n        }\\n        return decodeURIComponent(results[1].replace(/\\\\+/g, \\\" \\\"));\\n    };\\n    /**\\n     * Check the message to make sure it comes from an acceptable xdomain.\\n     * Defaults to '*' but can be overriden in config.\\n     *\\n     * @method _isSafeMessage\\n     * @inner\\n     *\\n     * @param {Event} e The message event.\\n     * @param {Object} settings Configuration.\\n     */\\n    var _isSafeMessage = function(e, settings) {\\n        if (settings.xdomain !== '*') {\\n            // If origin doesn't match our xdomain, return.\\n            if (!e.origin.match(new RegExp(settings.xdomain + '$'))) { return; }\\n        }\\n        // Ignore events that do not carry string data #151\\n        if (typeof e.data !== 'string') { return; }\\n        return true;\\n    };\\n    /**\\n     * Construct a message to send between frames.\\n     *\\n     * NB: We use string-building here because JSON message passing is\\n     * not supported in all browsers.\\n     *\\n     * @method _makeMessage\\n     * @inner\\n     *\\n     * @param {String} id The unique id of the message recipient.\\n     * @param {String} messageType The type of message to send.\\n     * @param {String} message The message to send.\\n     */\\n    var _makeMessage = function(id, messageType, message) {\\n        var bits = ['pym', id, messageType, message];\\n        return bits.join(MESSAGE_DELIMITER);\\n    };\\n    /**\\n     * Construct a regex to validate and parse messages.\\n     *\\n     * @method _makeMessageRegex\\n     * @inner\\n     *\\n     * @param {String} id The unique id of the message recipient.\\n     */\\n    var _makeMessageRegex = function(id) {\\n        var bits = ['pym', id, '(\\\\\\\\S+)', '(.*)'];\\n        return new RegExp('^' + bits.join(MESSAGE_DELIMITER) + '$');\\n    };\\n    /**\\n    * Underscore implementation of getNow\\n    *\\n    * @method _getNow\\n    * @inner\\n    *\\n    */\\n    var _getNow = Date.now || function() {\\n        return new Date().getTime();\\n    };\\n    /**\\n    * Underscore implementation of throttle\\n    *\\n    * @method _throttle\\n    * @inner\\n    *\\n    * @param {function} func Throttled function\\n    * @param {number} wait Throttle wait time\\n    * @param {object} options Throttle settings\\n    */\\n    var _throttle = function(func, wait, options) {\\n        var context, args, result;\\n        var timeout = null;\\n        var previous = 0;\\n        if (!options) {options = {};}\\n        var later = function() {\\n            previous = options.leading === false ? 0 : _getNow();\\n            timeout = null;\\n            result = func.apply(context, args);\\n            if (!timeout) {context = args = null;}\\n        };\\n        return function() {\\n            var now = _getNow();\\n            if (!previous && options.leading === false) {previous = now;}\\n            var remaining = wait - (now - previous);\\n            context = this;\\n            args = arguments;\\n            if (remaining <= 0 || remaining > wait) {\\n                if (timeout) {\\n                    clearTimeout(timeout);\\n                    timeout = null;\\n                }\\n                previous = now;\\n                result = func.apply(context, args);\\n                if (!timeout) {context = args = null;}\\n            } else if (!timeout && options.trailing !== false) {\\n                timeout = setTimeout(later, remaining);\\n            }\\n            return result;\\n        };\\n    };\\n    /**\\n     * Clean autoInit Instances: those that point to contentless iframes\\n     * @method _cleanAutoInitInstances\\n     * @inner\\n     */\\n    var _cleanAutoInitInstances = function() {\\n        var length = lib.autoInitInstances.length;\\n        // Loop backwards to avoid index issues\\n        for (var idx = length - 1; idx >= 0; idx--) {\\n            var instance = lib.autoInitInstances[idx];\\n            // If instance has been removed or is contentless then remove it\\n            if (instance.el.getElementsByTagName('iframe').length &&\\n                instance.el.getElementsByTagName('iframe')[0].contentWindow) {\\n                continue;\\n            }\\n            else {\\n                // Remove the reference to the removed or orphan instance\\n                lib.autoInitInstances.splice(idx,1);\\n            }\\n        }\\n    };\\n    /**\\n     * Store auto initialized Pym instances for further reference\\n     * @name module:pym#autoInitInstances\\n     * @type Array\\n     * @default []\\n     */\\n    lib.autoInitInstances = [];\\n    /**\\n     * Initialize Pym for elements on page that have data-pym attributes.\\n     * Expose autoinit in case we need to call it from the outside\\n     * @instance\\n     * @method autoInit\\n     * @param {Boolean} doNotRaiseEvents flag to avoid sending custom events\\n     */\\n    lib.autoInit = function(doNotRaiseEvents) {\\n        var elements = document.querySelectorAll('[data-pym-src]:not([data-pym-auto-initialized])');\\n        var length = elements.length;\\n        // Clean stored instances in case needed\\n        _cleanAutoInitInstances();\\n        for (var idx = 0; idx < length; ++idx) {\\n            var element = elements[idx];\\n            /*\\n            * Mark automatically-initialized elements so they are not\\n            * re-initialized if the user includes pym.js more than once in the\\n            * same document.\\n            */\\n            element.setAttribute('data-pym-auto-initialized', '');\\n            // Ensure elements have an id\\n            if (element.id === '') {\\n                element.id = 'pym-' + idx + \\\"-\\\" + Math.random().toString(36).substr(2,5);\\n            }\\n            var src = element.getAttribute('data-pym-src');\\n            // List of data attributes to configure the component\\n            // structure: {'attribute name': 'type'}\\n            var settings = {'xdomain': 'string', 'title': 'string', 'name': 'string', 'id': 'string',\\n                            'sandbox': 'string', 'allowfullscreen': 'boolean',\\n                            'parenturlparam': 'string', 'parenturlvalue': 'string',\\n                            'optionalparams': 'boolean', 'trackscroll': 'boolean',\\n                            'scrollwait': 'number'};\\n            var config = {};\\n            for (var attribute in settings) {\\n                // via https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute#Notes\\n               if (element.getAttribute('data-pym-'+attribute) !== null) {\\n                  switch (settings[attribute]) {\\n                    case 'boolean':\\n                       config[attribute] = !(element.getAttribute('data-pym-'+attribute) === 'false'); // jshint ignore:line\\n                       break;\\n                    case 'string':\\n                       config[attribute] = element.getAttribute('data-pym-'+attribute);\\n                       break;\\n                    case 'number':\\n                        var n = Number(element.getAttribute('data-pym-'+attribute));\\n                        if (!isNaN(n)) {\\n                            config[attribute] = n;\\n                        }\\n                        break;\\n                    default:\\n                       console.err('unrecognized attribute type');\\n                  }\\n               }\\n            }\\n            // Store references to autoinitialized pym instances\\n            var parent = new lib.Parent(element.id, src, config);\\n            lib.autoInitInstances.push(parent);\\n        }\\n        // Fire customEvent\\n        if (!doNotRaiseEvents) {\\n            _raiseCustomEvent(\\\"pym-initialized\\\");\\n        }\\n        // Return stored autoinitalized pym instances\\n        return lib.autoInitInstances;\\n    };\\n    /**\\n     * The Parent half of a response iframe.\\n     *\\n     * @memberof module:pym\\n     * @class Parent\\n     * @param {String} id The id of the div into which the iframe will be rendered. sets {@link module:pym.Parent~id}\\n     * @param {String} url The url of the iframe source. sets {@link module:pym.Parent~url}\\n     * @param {Object} [config] Configuration for the parent instance. sets {@link module:pym.Parent~settings}\\n     * @param {string} [config.xdomain='*'] - xdomain to validate messages received\\n     * @param {string} [config.title] - if passed it will be assigned to the iframe title attribute\\n     * @param {string} [config.name] - if passed it will be assigned to the iframe name attribute\\n     * @param {string} [config.id] - if passed it will be assigned to the iframe id attribute\\n     * @param {boolean} [config.allowfullscreen] - if passed and different than false it will be assigned to the iframe allowfullscreen attribute\\n     * @param {string} [config.sandbox] - if passed it will be assigned to the iframe sandbox attribute (we do not validate the syntax so be careful!!)\\n     * @param {string} [config.parenturlparam] - if passed it will be override the default parentUrl query string parameter name passed to the iframe src\\n     * @param {string} [config.parenturlvalue] - if passed it will be override the default parentUrl query string parameter value passed to the iframe src\\n     * @param {string} [config.optionalparams] - if passed and different than false it will strip the querystring params parentUrl and parentTitle passed to the iframe src\\n     * @param {boolean} [config.trackscroll] - if passed it will activate scroll tracking on the parent\\n     * @param {number} [config.scrollwait] - if passed it will set the throttle wait in order to fire scroll messaging. Defaults to 100 ms.\\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe iFrame}\\n     */\\n    lib.Parent = function(id, url, config) {\\n        /**\\n         * The id of the container element\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {string} id\\n         * @inner\\n         */\\n        this.id = id;\\n        /**\\n         * The url that will be set as the iframe's src\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {String} url\\n         * @inner\\n         */\\n        this.url = url;\\n        /**\\n         * The container DOM object\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {HTMLElement} el\\n         * @inner\\n         */\\n        this.el = document.getElementById(id);\\n        /**\\n         * The contained child iframe\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {HTMLElement} iframe\\n         * @inner\\n         * @default null\\n         */\\n        this.iframe = null;\\n        /**\\n         * The parent instance settings, updated by the values passed in the config object\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {Object} settings\\n         * @inner\\n         */\\n        this.settings = {\\n            xdomain: '*',\\n            optionalparams: true,\\n            parenturlparam: 'parentUrl',\\n            parenturlvalue: window.location.href,\\n            trackscroll: false,\\n            scrollwait: 100,\\n        };\\n        /**\\n         * RegularExpression to validate the received messages\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {String} messageRegex\\n         * @inner\\n         */\\n        this.messageRegex = _makeMessageRegex(this.id);\\n        /**\\n         * Stores the registered messageHandlers for each messageType\\n         *\\n         * @memberof module:pym.Parent\\n         * @member {Object} messageHandlers\\n         * @inner\\n         */\\n        this.messageHandlers = {};\\n        // ensure a config object\\n        config = (config || {});\\n        /**\\n         * Construct the iframe.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _constructIframe\\n         * @inner\\n         */\\n        this._constructIframe = function() {\\n            // Calculate the width of this element.\\n            var width = this.el.offsetWidth.toString();\\n            // Create an iframe element attached to the document.\\n            this.iframe = document.createElement('iframe');\\n            // Save fragment id\\n            var hash = '';\\n            var hashIndex = this.url.indexOf('#');\\n            if (hashIndex > -1) {\\n                hash = this.url.substring(hashIndex, this.url.length);\\n                this.url = this.url.substring(0, hashIndex);\\n            }\\n            // If the URL contains querystring bits, use them.\\n            // Otherwise, just create a set of valid params.\\n            if (this.url.indexOf('?') < 0) {\\n                this.url += '?';\\n            } else {\\n                this.url += '&';\\n            }\\n            // Append the initial width as a querystring parameter\\n            // and optional params if configured to do so\\n            this.iframe.src = this.url + 'initialWidth=' + width +\\n                                         '&childId=' + this.id;\\n            if (this.settings.optionalparams) {\\n                this.iframe.src += '&parentTitle=' + encodeURIComponent(document.title);\\n                this.iframe.src += '&'+ this.settings.parenturlparam + '=' + encodeURIComponent(this.settings.parenturlvalue);\\n            }\\n            this.iframe.src +=hash;\\n            // Set some attributes to this proto-iframe.\\n            this.iframe.setAttribute('width', '100%');\\n            this.iframe.setAttribute('scrolling', 'no');\\n            this.iframe.setAttribute('marginheight', '0');\\n            this.iframe.setAttribute('frameborder', '0');\\n            if (this.settings.title) {\\n                this.iframe.setAttribute('title', this.settings.title);\\n            }\\n            if (this.settings.allowfullscreen !== undefined && this.settings.allowfullscreen !== false) {\\n                this.iframe.setAttribute('allowfullscreen','');\\n            }\\n            if (this.settings.sandbox !== undefined && typeof this.settings.sandbox === 'string') {\\n                this.iframe.setAttribute('sandbox', this.settings.sandbox);\\n            }\\n            if (this.settings.id) {\\n                if (!document.getElementById(this.settings.id)) {\\n                    this.iframe.setAttribute('id', this.settings.id);\\n                }\\n            }\\n            if (this.settings.name) {\\n                this.iframe.setAttribute('name', this.settings.name);\\n            }\\n            // Replace the child content if needed\\n            // (some CMSes might strip out empty elements)\\n            while(this.el.firstChild) { this.el.removeChild(this.el.firstChild); }\\n            // Append the iframe to our element.\\n            this.el.appendChild(this.iframe);\\n            // Add an event listener that will handle redrawing the child on resize.\\n            window.addEventListener('resize', this._onResize);\\n            // Add an event listener that will send the child the viewport.\\n            if (this.settings.trackscroll) {\\n                window.addEventListener('scroll', this._throttleOnScroll);\\n            }\\n        };\\n        /**\\n         * Send width on resize.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _onResize\\n         * @inner\\n         */\\n        this._onResize = function() {\\n            this.sendWidth();\\n            this.sendHeight();\\n            if (this.settings.trackscroll) {\\n                this.sendViewportAndIFramePosition();\\n            }\\n        }.bind(this);\\n        /**\\n         * Send viewport and iframe info on scroll.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _onScroll\\n         * @inner\\n         */\\n        this._onScroll = function() {\\n            this.sendViewportAndIFramePosition();\\n        }.bind(this);\\n        /**\\n         * Fire all event handlers for a given message type.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _fire\\n         * @inner\\n         *\\n         * @param {String} messageType The type of message.\\n         * @param {String} message The message data.\\n         */\\n        this._fire = function(messageType, message) {\\n            if (messageType in this.messageHandlers) {\\n                for (var i = 0; i < this.messageHandlers[messageType].length; i++) {\\n                   this.messageHandlers[messageType][i].call(this, message);\\n                }\\n            }\\n        };\\n        /**\\n         * Remove this parent from the page and unbind it's event handlers.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method remove\\n         * @instance\\n         */\\n        this.remove = function() {\\n            window.removeEventListener('message', this._processMessage);\\n            window.removeEventListener('resize', this._onResize);\\n            this.el.removeChild(this.iframe);\\n            // _cleanAutoInitInstances in case this parent was autoInitialized\\n            _cleanAutoInitInstances();\\n        };\\n        /**\\n         * Process a new message from the child.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _processMessage\\n         * @inner\\n         *\\n         * @param {Event} e A message event.\\n         */\\n        this._processMessage = function(e) {\\n            // First, punt if this isn't from an acceptable xdomain.\\n            if (!_isSafeMessage(e, this.settings)) {\\n                return;\\n            }\\n            // Discard object messages, we only care about strings\\n            if (typeof e.data !== 'string') {\\n                return;\\n            }\\n            // Grab the message from the child and parse it.\\n            var match = e.data.match(this.messageRegex);\\n            // If there's no match or too many matches in the message, punt.\\n            if (!match || match.length !== 3) {\\n                return false;\\n            }\\n            var messageType = match[1];\\n            var message = match[2];\\n            this._fire(messageType, message);\\n        }.bind(this);\\n        /**\\n         * Resize iframe in response to new height message from child.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _onHeightMessage\\n         * @inner\\n         *\\n         * @param {String} message The new height.\\n         */\\n        this._onHeightMessage = function(message) {\\n            /*\\n             * Handle parent height message from child.\\n             */\\n            var height = parseInt(message);\\n            this.iframe.setAttribute('height', height + 'px');\\n        };\\n        /**\\n         * Navigate parent to a new url.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _onNavigateToMessage\\n         * @inner\\n         *\\n         * @param {String} message The url to navigate to.\\n         */\\n        this._onNavigateToMessage = function(message) {\\n            /*\\n             * Handle parent scroll message from child.\\n             */\\n            document.location.href = message;\\n        };\\n        /**\\n         * Scroll parent to a given child position.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _onScrollToChildPosMessage\\n         * @inner\\n         *\\n         * @param {String} message The offset inside the child page.\\n         */\\n        this._onScrollToChildPosMessage = function(message) {\\n            // Get the child container position using getBoundingClientRect + pageYOffset\\n            // via https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect\\n            var iframePos = document.getElementById(this.id).getBoundingClientRect().top + window.pageYOffset;\\n            var totalOffset = iframePos + parseInt(message);\\n            window.scrollTo(0, totalOffset);\\n        };\\n        /**\\n         * Bind a callback to a given messageType from the child.\\n         *\\n         * Reserved message names are: \\\"height\\\", \\\"scrollTo\\\" and \\\"navigateTo\\\".\\n         *\\n         * @memberof module:pym.Parent\\n         * @method onMessage\\n         * @instance\\n         *\\n         * @param {String} messageType The type of message being listened for.\\n         * @param {module:pym.Parent~onMessageCallback} callback The callback to invoke when a message of the given type is received.\\n         */\\n        this.onMessage = function(messageType, callback) {\\n            if (!(messageType in this.messageHandlers)) {\\n                this.messageHandlers[messageType] = [];\\n            }\\n            this.messageHandlers[messageType].push(callback);\\n        };\\n        /**\\n         * @callback module:pym.Parent~onMessageCallback\\n         * @param {String} message The message data.\\n         */\\n        /**\\n         * Send a message to the the child.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method sendMessage\\n         * @instance\\n         *\\n         * @param {String} messageType The type of message to send.\\n         * @param {String} message The message data to send.\\n         */\\n        this.sendMessage = function(messageType, message) {\\n            // When used alongside with pjax some references are lost\\n            if (this.el.getElementsByTagName('iframe').length) {\\n                if (this.el.getElementsByTagName('iframe')[0].contentWindow) {\\n                    this.el.getElementsByTagName('iframe')[0].contentWindow\\n                        .postMessage(_makeMessage(this.id, messageType, message), '*');\\n                }\\n                else {\\n                    // Contentless child detected remove listeners and iframe\\n                    this.remove();\\n                }\\n            }\\n        };\\n        /**\\n         * Transmit the current iframe width to the child.\\n         *\\n         * You shouldn't need to call this directly.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method sendWidth\\n         * @instance\\n         */\\n        this.sendWidth = function() {\\n            var width = this.el.offsetWidth.toString();\\n            this.sendMessage('width', width);\\n        };\\n        /**\\n         * Transmit the current viewport and iframe position to the child.\\n         * Sends viewport width, viewport height\\n         * and iframe bounding rect top-left-bottom-right\\n         * all separated by spaces\\n         *\\n         * You shouldn't need to call this directly.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method sendViewportAndIFramePosition\\n         * @instance\\n         */\\n        this.sendViewportAndIFramePosition = function() {\\n            var iframeRect = this.iframe.getBoundingClientRect();\\n            var vWidth   = window.innerWidth || document.documentElement.clientWidth;\\n            var vHeight  = window.innerHeight || document.documentElement.clientHeight;\\n            var payload = vWidth + ' ' + vHeight;\\n            payload += ' ' + iframeRect.top + ' ' + iframeRect.left;\\n            payload += ' ' + iframeRect.bottom + ' ' + iframeRect.right;\\n            this.sendMessage('viewport-iframe-position', payload);\\n        };\\n        // Add any overrides to settings coming from config.\\n        for (var key in config) {\\n            this.settings[key] = config[key];\\n        }\\n        /**\\n         * Throttled scroll function.\\n         *\\n         * @memberof module:pym.Parent\\n         * @method _throttleOnScroll\\n         * @inner\\n         */\\n        this._throttleOnScroll = _throttle(this._onScroll.bind(this), this.settings.scrollwait);\\n        // Bind required message handlers\\n        this.onMessage('height', this._onHeightMessage);\\n        this.onMessage('navigateTo', this._onNavigateToMessage);\\n        this.onMessage('scrollToChildPos', this._onScrollToChildPosMessage);\\n        this.onMessage('parentPositionInfo', this.sendViewportAndIFramePosition);\\n        // Add a listener for processing messages from the child.\\n        window.addEventListener('message', this._processMessage, false);\\n        // Construct the iframe in the container element.\\n        this._constructIframe();\\n        return this;\\n    };\\n    /**\\n     * The Child half of a responsive iframe.\\n     *\\n     * @memberof module:pym\\n     * @class Child\\n     * @param {Object} [config] Configuration for the child instance. sets {@link module:pym.Child~settings}\\n     * @param {function} [config.renderCallback=null] Callback invoked after receiving a resize event from the parent, sets {@link module:pym.Child#settings.renderCallback}\\n     * @param {string} [config.xdomain='*'] - xdomain to validate messages received\\n     * @param {number} [config.polling=0] - polling frequency in milliseconds to send height to parent\\n     * @param {number} [config.id] - parent container id used when navigating the child iframe to a new page but we want to keep it responsive.\\n     * @param {string} [config.parenturlparam] - if passed it will be override the default parentUrl query string parameter name expected on the iframe src\\n     */\\n    lib.Child = function(config) {\\n        /**\\n         * The initial width of the parent page\\n         *\\n         * @memberof module:pym.Child\\n         * @member {string} parentWidth\\n         * @inner\\n         */\\n        this.parentWidth = null;\\n        /**\\n         * The id of the parent container\\n         *\\n         * @memberof module:pym.Child\\n         * @member {String} id\\n         * @inner\\n         */\\n        this.id = null;\\n        /**\\n         * The title of the parent page from document.title.\\n         *\\n         * @memberof module:pym.Child\\n         * @member {String} parentTitle\\n         * @inner\\n         */\\n        this.parentTitle = null;\\n        /**\\n         * The URL of the parent page from window.location.href.\\n         *\\n         * @memberof module:pym.Child\\n         * @member {String} parentUrl\\n         * @inner\\n         */\\n        this.parentUrl = null;\\n        /**\\n         * The settings for the child instance. Can be overriden by passing a config object to the child constructor\\n         * i.e.: var pymChild = new pym.Child({renderCallback: render, xdomain: \\\"\\\\\\\\*\\\\.npr\\\\.org\\\"})\\n         *\\n         * @memberof module:pym.Child.settings\\n         * @member {Object} settings - default settings for the child instance\\n         * @inner\\n         */\\n        this.settings = {\\n            renderCallback: null,\\n            xdomain: '*',\\n            polling: 0,\\n            parenturlparam: 'parentUrl'\\n        };\\n        /**\\n         * The timerId in order to be able to stop when polling is enabled\\n         *\\n         * @memberof module:pym.Child\\n         * @member {String} timerId\\n         * @inner\\n         */\\n        this.timerId = null;\\n        /**\\n         * RegularExpression to validate the received messages\\n         *\\n         * @memberof module:pym.Child\\n         * @member {String} messageRegex\\n         * @inner\\n         */\\n        this.messageRegex = null;\\n        /**\\n         * Stores the registered messageHandlers for each messageType\\n         *\\n         * @memberof module:pym.Child\\n         * @member {Object} messageHandlers\\n         * @inner\\n         */\\n        this.messageHandlers = {};\\n        // Ensure a config object\\n        config = (config || {});\\n        /**\\n         * Bind a callback to a given messageType from the child.\\n         *\\n         * Reserved message names are: \\\"width\\\".\\n         *\\n         * @memberof module:pym.Child\\n         * @method onMessage\\n         * @instance\\n         *\\n         * @param {String} messageType The type of message being listened for.\\n         * @param {module:pym.Child~onMessageCallback} callback The callback to invoke when a message of the given type is received.\\n         */\\n        this.onMessage = function(messageType, callback) {\\n            if (!(messageType in this.messageHandlers)) {\\n                this.messageHandlers[messageType] = [];\\n            }\\n            this.messageHandlers[messageType].push(callback);\\n        };\\n        /**\\n         * @callback module:pym.Child~onMessageCallback\\n         * @param {String} message The message data.\\n         */\\n        /**\\n         * Fire all event handlers for a given message type.\\n         *\\n         * @memberof module:pym.Child\\n         * @method _fire\\n         * @inner\\n         *\\n         * @param {String} messageType The type of message.\\n         * @param {String} message The message data.\\n         */\\n        this._fire = function(messageType, message) {\\n            /*\\n             * Fire all event handlers for a given message type.\\n             */\\n            if (messageType in this.messageHandlers) {\\n                for (var i = 0; i < this.messageHandlers[messageType].length; i++) {\\n                   this.messageHandlers[messageType][i].call(this, message);\\n                }\\n            }\\n        };\\n        /**\\n         * Process a new message from the parent.\\n         *\\n         * @memberof module:pym.Child\\n         * @method _processMessage\\n         * @inner\\n         *\\n         * @param {Event} e A message event.\\n         */\\n        this._processMessage = function(e) {\\n            /*\\n            * Process a new message from parent frame.\\n            */\\n            // First, punt if this isn't from an acceptable xdomain.\\n            if (!_isSafeMessage(e, this.settings)) {\\n                return;\\n            }\\n            // Discard object messages, we only care about strings\\n            if (typeof e.data !== 'string') {\\n                return;\\n            }\\n            // Get the message from the parent.\\n            var match = e.data.match(this.messageRegex);\\n            // If there's no match or it's a bad format, punt.\\n            if (!match || match.length !== 3) { return; }\\n            var messageType = match[1];\\n            var message = match[2];\\n            this._fire(messageType, message);\\n        }.bind(this);\\n        /**\\n         * Resize iframe in response to new width message from parent.\\n         *\\n         * @memberof module:pym.Child\\n         * @method _onWidthMessage\\n         * @inner\\n         *\\n         * @param {String} message The new width.\\n         */\\n        this._onWidthMessage = function(message) {\\n            /*\\n             * Handle width message from the child.\\n             */\\n            var width = parseInt(message);\\n            // Change the width if it's different.\\n            if (width !== this.parentWidth) {\\n                this.parentWidth = width;\\n                // Call the callback function if it exists.\\n                if (this.settings.renderCallback) {\\n                    this.settings.renderCallback(width);\\n                }\\n                // Send the height back to the parent.\\n                this.sendHeight();\\n                \\n            }\\n        };\\n        /**\\n         * Send a message to the the Parent.\\n         *\\n         * @memberof module:pym.Child\\n         * @method sendMessage\\n         * @instance\\n         *\\n         * @param {String} messageType The type of message to send.\\n         * @param {String} message The message data to send.\\n         */\\n        this.sendMessage = function(messageType, message) {\\n            /*\\n             * Send a message to the parent.\\n             */\\n            window.parent.postMessage(_makeMessage(this.id, messageType, message), '*');\\n        };\\n        /**\\n         * Transmit the current iframe height to the parent.\\n         *\\n         * Call this directly in cases where you manually alter the height of the iframe contents.\\n         *\\n         * @memberof module:pym.Child\\n         * @method sendHeight\\n         * @instance\\n         */\\n        this.sendHeight = function() {\\n            // Get the child's height.\\n            // Additional padding to prevent scrolling\\n            var height = (document.getElementsByTagName('body')[0].offsetHeight).toString();\\n            // Send the height to the parent.\\n            this.sendMessage('height', height);\\n            return height;\\n        }.bind(this);\\n        /**\\n         * Ask parent to send the current viewport and iframe position information\\n         *\\n         * @memberof module:pym.Child\\n         * @method sendHeight\\n         * @instance\\n         */\\n        this.getParentPositionInfo = function() {\\n            // Send the height to the parent.\\n            this.sendMessage('parentPositionInfo');\\n        };\\n        /**\\n         * Scroll parent to a given element id.\\n         *\\n         * @memberof module:pym.Child\\n         * @method scrollParentTo\\n         * @instance\\n         *\\n         * @param {String} hash The id of the element to scroll to.\\n         */\\n        this.scrollParentTo = function(hash) {\\n            this.sendMessage('navigateTo', '#' + hash);\\n        };\\n        /**\\n         * Navigate parent to a given url.\\n         *\\n         * @memberof module:pym.Child\\n         * @method navigateParentTo\\n         * @instance\\n         *\\n         * @param {String} url The url to navigate to.\\n         */\\n        this.navigateParentTo = function(url) {\\n            this.sendMessage('navigateTo', url);\\n        };\\n        /**\\n         * Scroll parent to a given child element id.\\n         *\\n         * @memberof module:pym.Child\\n         * @method scrollParentToChildEl\\n         * @instance\\n         *\\n         * @param {String} id The id of the child element to scroll to.\\n         */\\n        this.scrollParentToChildEl = function(id) {\\n            // Get the child element position using getBoundingClientRect + pageYOffset\\n            // via https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect\\n            var topPos = document.getElementById(id).getBoundingClientRect().top + window.pageYOffset;\\n            this.scrollParentToChildPos(topPos);\\n        };\\n        /**\\n         * Scroll parent to a particular child offset.\\n         *\\n         * @memberof module:pym.Child\\n         * @method scrollParentToChildPos\\n         * @instance\\n         *\\n         * @param {Number} pos The offset of the child element to scroll to.\\n         */\\n        this.scrollParentToChildPos = function(pos) {\\n            this.sendMessage('scrollToChildPos', pos.toString());\\n        };\\n        /**\\n         * Mark Whether the child is embedded or not\\n         * executes a callback in case it was passed to the config\\n         *\\n         * @memberof module:pym.Child\\n         * @method _markWhetherEmbedded\\n         * @inner\\n         *\\n         * @param {module:pym.Child~onMarkedEmbeddedStatus} The callback to execute after determining whether embedded or not.\\n         */\\n        var _markWhetherEmbedded = function(onMarkedEmbeddedStatus) {\\n          var htmlElement = document.getElementsByTagName('html')[0],\\n              newClassForHtml,\\n              originalHtmlClasses = htmlElement.className;\\n          try {\\n            if(window.self !== window.top) {\\n              newClassForHtml = \\\"embedded\\\";\\n            }else{\\n              newClassForHtml = \\\"not-embedded\\\";\\n            }\\n          }catch(e) {\\n            newClassForHtml = \\\"embedded\\\";\\n          }\\n          if(originalHtmlClasses.indexOf(newClassForHtml) < 0) {\\n            htmlElement.className = originalHtmlClasses ? originalHtmlClasses + ' ' + newClassForHtml : newClassForHtml;\\n            if(onMarkedEmbeddedStatus){\\n              onMarkedEmbeddedStatus(newClassForHtml);\\n            }\\n            _raiseCustomEvent(\\\"marked-embedded\\\");\\n          }\\n        };\\n        /**\\n         * @callback module:pym.Child~onMarkedEmbeddedStatus\\n         * @param {String} classname \\\"embedded\\\" or \\\"not-embedded\\\".\\n         */\\n        /**\\n         * Unbind child event handlers and timers.\\n         *\\n         * @memberof module:pym.Child\\n         * @method remove\\n         * @instance\\n         */\\n        this.remove = function() {\\n            window.removeEventListener('message', this._processMessage);\\n            if (this.timerId) {\\n                clearInterval(this.timerId);\\n            }\\n        };\\n        // Initialize settings with overrides.\\n        for (var key in config) {\\n            this.settings[key] = config[key];\\n        }\\n        // Identify what ID the parent knows this child as.\\n        this.id = _getParameterByName('childId') || config.id;\\n        this.messageRegex = new RegExp('^pym' + MESSAGE_DELIMITER + this.id + MESSAGE_DELIMITER + '(\\\\\\\\S+)' + MESSAGE_DELIMITER + '(.*)$');\\n        // Get the initial width from a URL parameter.\\n        var width = parseInt(_getParameterByName('initialWidth'));\\n        // Get the url of the parent frame\\n        this.parentUrl = _getParameterByName(this.settings.parenturlparam);\\n        // Get the title of the parent frame\\n        this.parentTitle = _getParameterByName('parentTitle');\\n        // Bind the required message handlers\\n        this.onMessage('width', this._onWidthMessage);\\n        // Set up a listener to handle any incoming messages.\\n        window.addEventListener('message', this._processMessage, false);\\n        // If there's a callback function, call it.\\n        if (this.settings.renderCallback) {\\n            this.settings.renderCallback(width);\\n        }\\n        // Send the initial height to the parent.\\n        this.sendHeight();\\n        let frameWidth = window.innerWidth;\\n         window.addEventListener('resize', () => {\\n             const thisFrameWidth = window.innerWidth;\\n\\n             if (frameWidth !== thisFrameWidth) {\\n                 this.sendHeight()\\n                 frameWidth = thisFrameWidth;\\n             }\\n         });\\n        // If we're configured to poll, create a setInterval to handle that.\\n        if (this.settings.polling) {\\n            this.timerId = window.setInterval(this.sendHeight, this.settings.polling);\\n        }\\n        _markWhetherEmbedded(config.onMarkedEmbeddedStatus);\\n        return this;\\n    };\\n    // @ifdef AUTOINIT\\n    // Initialize elements with pym data attributes\\n    // if we are not in server configuration\\n    if(typeof document !== \\\"undefined\\\") {\\n        lib.autoInit(true);\\n    }\\n    // @endif\\n    return lib;\\n});\\n</script>\\n\\n<script>\\n    try {\\n        var pymChild = new pym.Child();\\n    } catch(error) {\\n        console.log(error)\\n    }\\n</script>\\n\",customHTMLHeadEnd:'<!-- URL param setting  -->\\n<script>\\nfunction getQueryParams() {\\n    var params = {};\\n    var queryString = window.location?.search?.substring(1) || \\'\\';\\n    if (queryString) {\\n        var pairs = queryString.split(\\'&\\');\\n        pairs.forEach(pair=>{\\n            const [k,v] = pair.split(\\'=\\')\\n            params[decodeURIComponent(k)] = decodeURIComponent(v || \\'\\');\\n        })\\n    }\\n\\n    return params;\\n}\\n\\nwindow.getQueryParams = getQueryParams;\\n\\n// Function to set a cookie with a specified name and value\\nfunction setCookie(name, value, domain = \\'.bambee.com\\') {\\n    var cookie = [name, \\'=\\', JSON.stringify(value), \\'; domain=\\', domain, \\'; path=/;\\'].join(\\'\\');\\n    document.cookie = cookie;\\n}\\n\\nwindow.setCookie = setCookie;\\n\\n// Save the JSON object as a session cookie named \\'query\\' with the domain set to \\'bambee.com\\'\\nconst queryParams = getQueryParams();\\nif (Object.keys(queryParams).length) {\\n  setCookie(\\'query\\', getQueryParams());\\n}\\n\\nwindow.queryParams = queryParams;\\n</script>\\n\\n<script>\\nwindow.segmentSessionId = \"id\" + Math.random().toString(16).slice(2)\\n</script>\\n\\n<script>\\n  const getCookies = function(){\\n    var pairs = document.cookie.split(\";\");\\n    var cookies = {};\\n    for (var i=0; i<pairs.length; i++){\\n      var pair = pairs[i].split(\"=\");\\n      cookies[(pair[0]+\\'\\').trim()] = unescape(pair.slice(1).join(\\'=\\'));\\n    }\\n    return cookies;\\n  }\\n\\n  window.getCookies = getCookies\\n</script>\\n\\n<script defer=\"\">\\n  // Defer script to make sure all cookie setting has been completed and prevent page load delays for tracking scripts\\n  \\n\\n  !function(){var i=\"analytics\",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error(\"Segment snippet included twice.\");else{analytics.invoked=!0;analytics.methods=[\"trackSubmit\",\"trackClick\",\"trackLink\",\"trackForm\",\"pageview\",\"identify\",\"reset\",\"group\",\"track\",\"ready\",\"alias\",\"debug\",\"page\",\"screen\",\"once\",\"off\",\"on\",\"addSourceMiddleware\",\"addIntegrationMiddleware\",\"setAnonymousId\",\"addDestinationMiddleware\",\"register\"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if([\"track\",\"screen\",\"alias\",\"group\",\"page\",\"identify\"].indexOf(e)>-1){var c=document.querySelector(\"link[rel=\\'canonical\\']\");n.push({__t:\"bpc\",c:c&&c.getAttribute(\"href\")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement(\"script\");t.type=\"text/javascript\";t.async=!0;t.setAttribute(\"data-global-segment-analytics-key\",i);t.src=\"https://cdn.segment.com/analytics.js/v1/\" + key + \"/analytics.min.js\";var r=document.getElementsByTagName(\"script\")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey=\"XFjXBD4rMdZ02sCC6FyhthDQSm7BLG8G\";;analytics.SNIPPET_VERSION=\"5.2.0\";\\n  analytics.load(\"XFjXBD4rMdZ02sCC6FyhthDQSm7BLG8G\");\\n  const queryCookies = getCookies().query ? JSON.parse(getCookies().query) : {};\\n  analytics.page({\\n    query: queryCookies,\\n  });\\n  }}();\\n</script>\\n\\n<!-- Meta Pixel Code -->\\n<script>\\n!function(f,b,e,v,n,t,s)\\n{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\\nn.callMethod.apply(n,arguments):n.queue.push(arguments)};\\nif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=\\'2.0\\';\\nn.queue=[];t=b.createElement(e);t.async=!0;\\nt.src=v;s=b.getElementsByTagName(e)[0];\\ns.parentNode.insertBefore(t,s)}(window, document,\\'script\\',\\n\\'https://connect.facebook.net/en_US/fbevents.js\\');\\nfbq(\\'init\\', \\'774273266073680\\');\\nfbq(\\'track\\', \\'PageView\\');\\n</script>\\n<noscript></noscript>',description:\"HR Built For Small Businesses — Easy-to-use software to manage HR, payroll, & benefits. Get started with Bambee for $1! Comprehensive HR services that adapts to your company's needs. Start your trial today!\",favicon:\"https://framerusercontent.com/assets/Uq54XeNwiHPqjEgww8kMPGJXI.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/VfMO5yuONSOMaCWpt24IPZratSQ.png\",title:\"Bambee HR - Dedicated HR Guidance With All-In-One HR Software\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2DACA,SAAwB,EAAS,EAAO,EAAa,CAAC,MAAM,CAAC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4guC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAw0H,YAAY,iNAAiN,QAAQ,qEAAqE,OAAO,0BAA0B,YAAY,uEAAuE,MAAM,gEAAgE"}