mmRequestCallbacks[1]({"Scripts":[{"Name":"InfinityPowerglove","Type":"script","Attrs":{"type":"text/javascript"},"Data":"function projectJsCode(event){\n\n    var pages = {\n        WholeSite: [\n            '*uclahealth.org*'\n        ]\n    };\n\n    var guid = 'b35nnsdk6l';\n\n    var projectJS = \n    [\n        {\n            name: 'Powerglove',\n            active: true,\n            page: pages.WholeSite,\n            code: function(){\n\n                var powerglove = {};\n\n                // Creating my own Promise library so that I can use .done, .fail, and .always                \n                // A new promise instance accepts instructions on when to resolve and when to reject\n                // Two possibilites are being handled here:\n                //   1. .done/.fail/.always are called first before resolve/rejct\n                //   2. resolve/reject are called before .done/.fail/.always\n                powerglove.Promise = function(instructions) {\n                    var state = 'pending',\n                        deferredDone,\n                        deferredFail,\n                        deferredAlways,\n                        value,\n                        _t = this;\n\n                    this.done = function(usersSuccessCode){\n                        handle({scenario:'done', code:usersSuccessCode});\n                        return _t;\n                    }\n\n                    this.fail = function(usersFailCode){\n                        handle({scenario:'fail', code:usersFailCode});\n                        return _t;\n                    }\n\n                    this.always = function(usersAlwaysCode){\n                        handle({scenario:'always', code:usersAlwaysCode});\n                        return _t;\n                    }\n\n                    function handle(scenario){\n                        var ss = scenario.scenario;\n                        if (state === 'pending') {\n                            // will only keep track of one .done, one .fail, and one .always at a time, meaning you can't do doSomething().done(func).done(func)\n                            if (ss === 'done') deferredDone = scenario;\n                            if (ss === 'fail') deferredFail = scenario;\n                            if (ss === 'always') deferredAlways = scenario;\n                        } else if ((state === 'resolved' && ss === 'done') || (state === 'rejected' && ss === 'fail') || ss === 'always') {\n                            // run this async no matter what just to make sure the coder doesn't for some\n                            // reason expect sync execution when they resolve/reject something synchronously\n                            setTimeout(function(){\n                                scenario.code(value);\n                            }, 0);\n                        }\n                    }\n                    function resolve(successValue) {\n                        if (state === 'pending') {\n                            state = 'resolved';\n                            value = successValue;\n                            // run stuff the user wanted to run from \".done\"\n                            if (deferredDone) handle(deferredDone);\n                            if (deferredAlways) handle(deferredAlways);\n                        }\n                    }\n                    function reject(failValue) {\n                        if (state === 'pending') {\n                            state = 'rejected';\n                            value = failValue;\n                            // run stuff from \".fail\"\n                            if (deferredFail) handle(deferredFail);\n                            if (deferredAlways) handle(deferredAlways);\n                        }\n                    }\n\n                    // initiate the instructions so we know what the function writer wants\n                    instructions(resolve, reject);\n                }\n\n                var PowerPromise = powerglove.Promise;\n\n\n                powerglove.waitFor = function(condition, timeout, frequency) {\n                    var cond = condition();\n                    frequency = frequency || 50;\n                    if (!timeout) console.log('Infinity Powerglove: powerglove.waitFor was called without a timeout argument. Defaulting to 0.');\n                    return new PowerPromise(function(resolve, reject) {\n                        if (cond) return resolve();\n                        var timer = setTimeout(function(){\n                            clearInterval(valer);\n                            reject();\n                        }, timeout);\n                        var valer = setInterval(function(){\n                            cond = condition();\n                            if (cond) {\n                                clearInterval(valer);\n                                clearTimeout(timer);\n                                resolve();\n                            }\n                        }, frequency);\n                    });\n                }\n\n                // usage: powerglove.domReady(function(){})\n                // callback function runs when the page has fully loaded\n                powerglove.domReady=function(a,b){function f(){if(!d){d=!0;for(var a=0;a<c.length;a++)c[a].fn.call(window,c[a].ctx);c=[]}}function g(){\"complete\"===document.readyState&&f()}var c=[],d=!1,e=!1;if(\"function\"!=typeof a)throw new TypeError(\"callback for docReady(fn) must be a function\");if(d)return void setTimeout(function(){a(b)},1);c.push({fn:a,ctx:b}),\"complete\"===document.readyState?setTimeout(f,1):e||(document.addEventListener?(document.addEventListener(\"DOMContentLoaded\",f,!1),window.addEventListener(\"load\",f,!1)):(document.attachEvent(\"onreadystatechange\",g),window.attachEvent(\"onload\",f)),e=!0)};\n\n\n                // renderer\n                powerglove.renderer = {};\n\n                powerglove.renderer.hide = function(sel, alias, unhideAfter){\n                    unhideAfter = unhideAfter || 5000;\n                    var props = (sel.match(/.*({.*})/) || [])[1] || '{position:relative; left:-10000px; top:-10000px}',\n                        sel = sel.replace(props, ''),\n                        css = sel + props,\n                        head = document.head || document.getElementsByTagName('head')[0],\n                        style = document.createElement('style');\n                    style.type = 'text/css';\n                    style.setAttribute('class', 'infinity-renderer-hide');\n                    if (alias && typeof alias === 'string') style.setAttribute('inf-alias', alias);\n                    style.appendChild(document.createTextNode(css));\n                    head.appendChild(style);\n                    if (unhideAfter !== 'never') {\n                        if (typeof unhideAfter === 'number') {\n                            setTimeout(function(){\n                                // this check is because the style tag could have already been removed by showAll\n                                if (style && style.parentNode) style.parentNode.removeChild(style);\n                            }, unhideAfter);\n                        }\n                    }\n                }\n                powerglove.renderer.show = function(alias) {\n                    var els = document.querySelectorAll('[inf-alias=\"' + alias + '\"]');\n                    if (els.length) {\n                        for (var i = 0; i < els.length; i++) {\n                            els[i].parentNode.removeChild(els[i]);\n                        }\n                    }\n                }\n                powerglove.renderer.showAll = function() {\n                    var els = document.querySelectorAll('.infinity-renderer-hide');\n                    if (els.length) {\n                        for (var i = 0; i < els.length; i++) {\n                            els[i].parentNode.removeChild(els[i]);\n                        }\n                    }\n                }\n\n                // cookies\n                powerglove.cookies = {};\n                powerglove.cookies.set = function(name, value, days, domain) {\n                    if ((typeof value !== 'string' && typeof value !== 'number') || typeof name !== 'string') return console.warn('Infinity Powerglove: powerglove.cookies.set: name and value must be a string');\n                    var expires;\n                    var cookieDomain = location.hostname.match(/^[\\d.]+$|/)[0] || ('.' + (location.hostname.match(/[^.]+\\.(\\w{2,3}\\.\\w{2}|\\w{2,})$/) || [location.hostname])[0]);\n                    domain = domain || cookieDomain;\n                    if (domain === 'blank') domain = '';\n                    if (days) {\n                        var date = new Date();\n                        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n                        expires = '; expires=' + date.toGMTString();\n                    } else {\n                        expires = '';\n                    }\n                    document.cookie = name + '=' + value + expires + '; path=/; domain=' + domain + ';';\n                }\n                powerglove.cookies.get = function(cname) {\n                    if (typeof cname !== 'string') return;\n                    var name = cname + '=';\n                    var decodedCookie = decodeURIComponent(document.cookie);\n                    var cookies = decodedCookie.split(';');\n                    for(var i = 0; i < cookies.length; i++) {\n                        var cookie = cookies[i];\n                        while (cookie.charAt(0) == ' ') {\n                            cookie = cookie.substring(1);\n                        }\n                        if (cookie.indexOf(name) == 0) {\n                            return cookie.substring(name.length, cookie.length);\n                        }\n                    }\n                    return '';\n                }\n\n                // user\n                powerglove.user = {};\n                powerglove.user.setData = function(name, value, days) {\n                    if (!name || typeof value === 'undefined' || typeof days === 'undefined') return console.warn('Infinity Powerglove: powerglove.user.setData: No data was set. You must specify a name, value, and expiration (in days) as arguments');\n                    var pStorage = powerglove.cookies.get('inf.pgStore.p.0') || '{}';\n                    var sStorage = powerglove.cookies.get('inf.pgStore.s.0') || '{}';\n                    pStorage = JSON.parse(pStorage);\n                    sStorage = JSON.parse(sStorage);\n                    if (days < 0) {\n                        delete pStorage[name];\n                        delete sStorage[name];\n                    } else if (days === 0) {\n                        sStorage[name] = value;\n                    } else {\n                        var date = new Date();\n                        var millis = date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n                        pStorage[name] = {value:value, exp:millis};\n                    }\n                    pStorage = JSON.stringify(pStorage);\n                    sStorage = JSON.stringify(sStorage);\n                    powerglove.cookies.set('inf.pgStore.p.0', pStorage, 365);\n                    powerglove.cookies.set('inf.pgStore.s.0', sStorage, 0);\n                }\n                powerglove.user.getData = function(name) {\n                    var ret = '';\n                    var sStorage = powerglove.cookies.get('inf.pgStore.s.0') || '{}';\n                    sStorage = JSON.parse(sStorage);\n                    if (sStorage[name]) return sStorage[name];\n                    // if it's past date, delete it and return ''\n                    var pStorage = powerglove.cookies.get('inf.pgStore.p.0') || '{}';\n                    pStorage = JSON.parse(pStorage);\n                    var now = new Date().getTime();\n                    if (pStorage[name]) {\n                        if (now >= pStorage[name].exp) {\n                            delete pStorage[name];\n                        } else {\n                            ret = pStorage[name].value;\n                        }\n                    }\n                    pStorage = JSON.stringify(pStorage);\n                    powerglove.cookies.set('inf.pgStore.p.0', pStorage, 365);\n                    return ret;\n                }\n                powerglove.user.cleanData = function() {\n                    var storage = powerglove.cookies.get('inf.pgStore.p.0') || '{}';\n                    if (storage === '{}') return;\n                    storage = JSON.parse(storage);\n                    var now = new Date().getTime();\n                    for (var prop in storage) {\n                        if (now >= storage[prop].exp) delete storage[prop];\n                    }\n                    storage = JSON.stringify(storage);\n                    powerglove.cookies.set('inf.pgStore.p.0', storage, 365);\n                }\n                // clean the data once per pageload so that the cookie doesn't grow unnecessarily\n                powerglove.domReady(function(){\n                    powerglove.user.cleanData();\n                });\n                // pagesArr: an array of strings specifying URLs with wildcard characters (*) (0 or more of any character)\n                powerglove.user.isOnPage = function(pagesArr) {\n                    if (!Array.isArray(pagesArr)) return console.warn('Infinity Powerglove: powerglove.user.isOnPage\\'s argument must be an array');\n                    var isOnOne = false;\n                    for (var i = 0; i < pagesArr.length; i++) {\n                        var regexText = pagesArr[i].replace(/[-[\\]{}()+?.,\\\\^$|#\\s]/g, '\\\\$&').replace(/\\*/g, '.*');\n                        var regex = new RegExp('^' + regexText + '$', 'i');\n                        if (regex.test(location.href)) {\n                            isOnOne = true;\n                            break;\n                        }\n                    }\n                    return isOnOne;\n                }\n\n                // Actions\n                powerglove.actions = {};\n                powerglove.actions.click = function(name, value) {\n                    if (!window.ORA) return console.warn('Infinity Powerglove: powerglove.actions.click could not execute. Infinity\\'s ORA function was not found.')\n                    if (!name || !value) return console.warn('Infinity Powerglove: powerglove.actions.click\\'s must have two arguments, name and value.');\n                    ORA.click({\n                        \"config\": {\n                            \"endpoints\": [\n                                {\n                                    \"endpoint\": (\"http://dc.infinitycloud.io/\" + guid),\n                                    \"protocolType\": \"gif\",\n                                    \"timeout\": 5000\n                                }\n                            ],\n                        },\n                        \"data\":{\n                            [name]: value,\n                        }\n                    })\n                }\n                powerglove.actions.view = function(name, value) {\n                    if (!window.ORA) return console.warn('Infinity Powerglove: powerglove.actions.view could not execute. Infinity\\'s ORA function was not found.')\n                    if (!name || !value) return console.warn('Infinity Powerglove: powerglove.actions.view\\'s must have two arguments, name and value.');\n                    ORA.view({\n                        \"config\": {\n                            \"endpoints\": [\n                                {\n                                    \"endpoint\": (\"http://dc.infinitycloud.io/\" + guid),\n                                    \"protocolType\": \"gif\",\n                                    \"timeout\": 5000\n                                }\n                            ],\n                        },\n                        \"data\":{\n                            [name]: value,\n                        }\n                    })\n                }\n                powerglove.actions.collect = function(name, value) {\n                    if (!window.ORA) return console.warn('Infinity Powerglove: powerglove.actions.collect could not execute. Infinity\\'s ORA function was not found.')\n                    if (!name || !value) return console.warn('Infinity Powerglove: powerglove.actions.collect\\'s must have two arguments, name and value.');\n                    ORA.collect({\n                        \"config\": {\n                            \"endpoints\": [\n                                {\n                                    \"endpoint\": (\"http://dc.infinitycloud.io/\" + guid),\n                                    \"protocolType\": \"gif\",\n                                    \"timeout\": 5000\n                                }\n                            ],\n                        },\n                        \"data\":{\n                            [name]: value,\n                        }\n                    })\n                }\n\n                // Implement this to the global window object\n                if(!window.DEVGRU) window.DEVGRU = {};\n                if (!window.DEVGRU.inf) window.DEVGRU.inf = {};\n                window.DEVGRU.inf.powerglove = powerglove;\n\n                // Other\n                console.mark = function(str) {\n                    console.info('%c' + str, 'color:cyan;');\n                }\n\n            }\n        },\n    ];\n\n    // Execute each code block above only if the specified set of URL \"masks\" matches the user's current URL.\n    for (var i = 0; i < projectJS.length; i++) {\n        if (projectJS[i].active) {\n            var page = projectJS[i].page;\n            for (var j = 0; j < page.length; j++) {\n                var regexText = page[j].replace(/[-[\\]{}()+?.,\\\\^$|#\\s]/g, '\\\\$&').replace(/\\*/g, '.*');\n                var regex = new RegExp('^' + regexText + '$', 'i');\n                if (regex.test(location.href)) {\n                    projectJS[i].code();\n                    break;\n                }\n            }\n        }\n    }\n}\nprojectJsCode();","Order":1,"HighLevelApiVersion":"1.26"},{"Name":"ScopeFunctions","Type":"script","Attrs":{"type":"text/javascript"},"Data":"console.mark = function(str) {\n  console.info('%c' + str, 'color:cyan;');\n}\n\n\nmodules.define('powerglove', {}, function(){\n    \n    // powerglove.waitFor\n    this.waitFor = function(condition, timeout){\n        var timedOut = false;\n        setTimeout(function(){ \n            timedOut = true; \n        }, timeout);\n        return when(condition, function(){\n            return timedOut;\n        });\n    }\n\n    // powerglove.sendClickAction\n    this.sendClickAction = function(el, act, val, attr) {\n        var $ = jQuery; if (!$) return;\n        $(el).on('click', function(){\n            actions.send(act, val || 1, attr || '');\n        });\n    }\n    \n    // powerglove.postponeClickAction\n    this.postponeClickAction = function(el, act, val, attr) {\n        var $ = jQuery; if (!$) return;\n        $(el).on('click', function(){\n            actions.postpone(act, val || 1, attr || '');\n        });\n    }\n      \n    // Send an action when the user event (click) immediately brings the user to a destination page without Maxymiser implemented\n    // powerglove.actionDelayDefault\n    this.actionDelayDefault = function(el, act, val, attr) {\n        var $ = jQuery, getMethod; if (!$) return;\n        getMethod = function () {\n            var method = 'on';\n            if (!$.fn[method]) {\n                method = ($.fn.delegate)? 'delegate' : 'live';\n                if (!$.fn[method]) {\n                    method = 'one'\n                }\n            }\n            return method\n        };\n        $(el)[getMethod()]('click', function(e){\n            var href = this.href,\n            cb = function(){\n                if(/Firefox/i.test(navigator.userAgent)) location.hash = 'mm';\n                location.assign(href); \n            };\n            \n            actions.send(act, val || 1, attr  || '').always(cb);\n            setTimeout(cb, 3e3);\n            \n            e.preventDefault();\n            return false;\n        });\n    }\n\n});","Order":1,"HighLevelApiVersion":"1.26"},{"Name":"InfinityMetrics","Type":"script","Attrs":{"type":"text/javascript"},"Data":"var ip = window.DEVGRU.inf.powerglove;\nip.domReady(function(){\n  setTimeout(function(){\n \n    var $ = window.jQuery; if (!$) return console.error('Scott D. of DEVGRU says: \"jQuery did not exist when needed.\"');\n  \n    // for URL: All Pages\n    if (ip.user.isOnPage(['*uclahealth.org*'])) {\n\n      $('#block-alert-banner-header a').on('click', function(e){\n        var attr = $(this).text().trim();\n        ip.actions.click('CovidBanner', attr);\n      });\n\n      // Top Dark Blue Nav Items\n      $('#block-universal-links-header ul > li > a').on('click', function(e){\n        var attr = $(this).text().trim();\n        ip.actions.click('NavClick', attr);\n      });\n      // Top Global White Nav main items\n      $('#block-primary-navigation > div > div > div > button').on('click', function(e){\n        var thisLinkTxt = $(this).find('span').text().trim();\n        ip.actions.click('NavClick', thisLinkTxt);\n      });\n      // Top Global White Nav sub items\n      $('#block-primary-navigation > div > div > div > div.absolute a').on('click', function(e){\n        var thisNavMenuTxt = $(this).text().trim();\n        ip.actions.click('NavClick', thisNavMenuTxt);\n      });\n      \n      // //  REMOVED BECAUSE NOW WITH THE NEW SITE YOU CAN JUST LOOK AT PAGE VIEWS OF /patients-families/make-appointment\n      // $(document).on('click', 'button:contains(\"Book an Appointment\") + ul > li > a', function(e){\n      //   var attr = $(this).text().trim();\n      //   ip.actions.click('BookApptClks', attr);  \n      // });\n\n      // Homepage and Main Nav Search Term\n      $('[action=\"/search\"]').on('submit', function(e){\n        var attr = $(this).find('#edit-s').val() || $(this).find('#search-form__keyword').val(); // 1st is main nav, 2nd is hp bar\n        ip.actions.click('SearchTerm', attr);\n      });\n    }\n\n    // for URL: https://www.uclahealth.org/locations\n    if (ip.user.isOnPage(['*uclahealth.org/locations','*uclahealth.org/locations?*','*uclahealth.org/locations#*'])) {\n\n      $('[action=\"/locations/search\"]').on('submit', function(e){\n        var attr = $(this).find('#edit-s').val();\n        ip.actions.click('LocationsPgSearch', attr);\n      });\n\n      $('a.button').on('click', function(e){\n        var attr = $(this).text().trim();\n        ip.actions.click('LocationsPageButtons', attr);\n      });\n    }\n\n    // for URL: https://www.uclahealth.org/medical-services\n    if (ip.user.isOnPage(['*uclahealth.org/conditions-we-treat/medical-services','*uclahealth.org/conditions-we-treat/medical-services?*','*uclahealth.org/conditions-we-treat/medical-services#*'])) {\n      $('a.rounded, .rounded-md a').on('click', function(e){\n        var attr1 = $(this).text().trim();\n        var attr2 = $(this).parents('.rounded-md').find('h2').text().trim();\n        ip.actions.click('MedServicesPageLinks', attr1 + (attr2 ? (' - ' + attr2) : ''));\n      });\n    }\n    \n    // for URL: https://www.uclahealth.org/providers  \n    // if (ip.user.isOnPage(['*uclahealth.org/providers*'])) {\n    //   $('#container_search .introduction a').on('click', function(e){\n    //     var attr = $(this).text().trim();\n    //     ip.actions.click('FindAProviderLinkClk', attr);\n    //   });\n      \n    //   // ProviderSearch and ProviderSearchTerm\n    //   $('#form_search').on('submit', function(e){\n    //     var inputsAttr = '';\n    //     var termAttr = '';\n    //     var inputsWithValues = [];\n    //     var inputValues = [];\n    //     $(this).find('input[type=\"text\"], select').each(function(i, el){\n    //       if ($(el).val() && !~$(el).val().indexOf('Enter a')) {\n    //         inputsWithValues.push($(el).attr('id'));\n    //         if ($(el).attr('id') === 'limit_ext_languages' || $(el).attr('id') === 'limit_ext_interests') {\n    //           inputValues.push($(el).find('option[value=\"' + $(el).val() + '\"]').text().trim());\n    //         } else {\n    //           inputValues.push($(el).val().trim());\n    //         }\n    //       }\n    //     });\n    //     if (inputsWithValues.length === 1) {\n    //       inputsAttr = $('#' + inputsWithValues[0]).parents().eq(1).find('label').text().trim().replace(/:/g, '');\n    //       termAttr = inputsAttr + ':' + inputValues[0];\n    //     } else if (inputsWithValues.length === 0) {\n    //       inputsAttr = 'All Empty';\n    //       termAttr = 'All Empty';\n    //     } else {\n    //       inputsAttr = 'Multiple';\n    //       termAttr = 'Multiple: ';\n    //       for (var i = 0; i < inputsWithValues.length; i++) {\n    //         termAttr += $('#' + inputsWithValues[i]).parents().eq(1).find('label').text().trim().replace(/:/g, '') + ':\"' + inputValues[i] + '\"';\n    //         if (i !== inputsWithValues.length - 1) termAttr += ',';\n    //       }\n    //     }\n    //     ip.actions.click('ProviderSearch', inputsAttr);\n    //     ip.actions.click('ProviderSearchTerm', termAttr);\n    //   });\n    //   $('a[id*=\"alpha\"]').on('click', function(e){\n    //     var attr = $(this).find('strong').text().trim();\n    //     ip.actions.click('ProviderSearch', 'Letter Search');\n    //     ip.actions.click('ProviderSearchTerm', 'Letter Search: ' + attr);\n    //   });\n    // }\n\n  }, 0);\n});","Order":20,"HighLevelApiVersion":"1.26"},{"Name":"act_MainNavClk","Type":"script","Attrs":{"type":"text/javascript"},"Data":"events.domReady(function(){\n  var $ = window.jQuery;\n  $('#container-navigation ul.navbar-nav > li > a').on('click', function(e){\n    var attr = $(this).text().trim();\n    actions.postpone('MainNavClk', 1, attr);\n  });\n  $('#container-navigation ul.navbar-nav > li > .dropdown-menu a').on('click', function(e){\n    var thisLinkTxt = $(this).text().trim();\n    var thisNavMenuTxt = $(this).parents('li.dropdown').find('a.dropdown-toggle').text().trim();\n    actions.postpone('MainNavClk', 1, thisNavMenuTxt + ' - ' + thisLinkTxt);\n  });\n});","Order":40,"HighLevelApiVersion":"1.26"}],"Campaigns":[],"MRRules":[],"PersistData":[{"Name":"srv","IsGlobal":false,"Value":"prodiadcgus11","Expiration":365},{"Name":"bid","IsGlobal":false,"Value":"prodiadcgus11","Expiration":0.00694},{"Name":"pd","IsGlobal":false,"Value":"xDsyc_EYQWVapLPLkxZlGQKxrOl5LGwZuhnar8syHu4=|AQAAAApDH4sIAAAAAAAEAGNhSPO_wq0vyryRgTkzMYVRiIHRieFK-2JxRoaciLhuv4U3PWA0AxD8hwIGNpfMotTkEkZ9UUaQOBjAJEE0VIjRFQDT8bQlYQAAAA==","Expiration":365}],"SiteInfo":[{"Url":"uclahealth.org","ID":2198}],"SystemData":[{"Version":"1.0","RequestId":1,"ResponseId":1}],"GenInfo":{},"ServerAttributes":{},"Iteration":"ru9KkAxKg-jnYj8ABZmpP5cYkHI","Packages":["mmpackage-1.26.js"]});