!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(A){var a,e=navigator.userAgent,R=/iphone/i.test(e),S=/chrome/i.test(e),T=/android/i.test(e);A.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},A.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden")&&this.get(0)===document.activeElement)return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&((n=this.createTextRange()).collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,l){var n,b,u,k,y,x,j,e;return!t&&0n.length){p(i+1,x);break}}else s[i]===n.charAt(r)&&r++,in.length){for(c(!0);0r;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move("character",e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){"use strict";function e(){}function r(){try{return document.activeElement}catch(t){}}function n(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(V);return(a||u)&&"true"===t.getAttribute(P)?(t.removeAttribute(P),t.value=t.value.replace(t.getAttribute(V),""),t.className=t.className.replace(R,""),n=t.getAttribute(z),parseInt(n,10)>=0&&(t.setAttribute("maxLength",n),t.removeAttribute(z)),r=t.getAttribute(D),r&&(t.type=r),!0):!1}function a(t){var e,r,n=t.getAttribute(V);return""===t.value&&n?(t.setAttribute(P,"true"),t.value=n,t.className+=" "+I,r=t.getAttribute(z),r||(t.setAttribute(z,t.maxLength),t.removeAttribute("maxLength")),e=t.getAttribute(D),e?t.type="text":"password"===t.type&&K.changeType(t,"text")&&t.setAttribute(D,"password"),!0):!1}function u(t,e){var r,n,a,u,i,l,o;if(t&&t.getAttribute(V))e(t);else for(a=t?t.getElementsByTagName("input"):f,u=t?t.getElementsByTagName("textarea"):h,r=a?a.length:0,n=u?u.length:0,o=0,l=r+n;l>o;o++)i=r>o?a[o]:u[o-r],e(i)}function i(t){u(t,n)}function l(t){u(t,a)}function o(t){return function(){b&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(P)?K.moveCaret(t,0):n(t)}}function c(t){return function(){a(t)}}function s(t){return function(e){return A=t.value,"true"===t.getAttribute(P)&&A===t.getAttribute(V)&&K.inArray(C,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function d(t){return function(){n(t,A),""===t.value&&(t.blur(),K.moveCaret(t,0))}}function v(t){return function(){t===r()&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(P)&&K.moveCaret(t,0)}}function g(t){return function(){i(t)}}function p(t){t.form&&(T=t.form,"string"==typeof T&&(T=document.getElementById(T)),T.getAttribute(U)||(K.addEventListener(T,"submit",g(T)),T.setAttribute(U,"true"))),K.addEventListener(t,"focus",o(t)),K.addEventListener(t,"blur",c(t)),b&&(K.addEventListener(t,"keydown",s(t)),K.addEventListener(t,"keyup",d(t)),K.addEventListener(t,"click",v(t))),t.setAttribute(j,"true"),t.setAttribute(V,x),(b||t!==r())&&a(t)}var f,h,b,m,A,y,E,x,L,T,S,N,w,B=["text","search","url","tel","email","password","number","textarea"],C=[27,33,34,35,36,37,38,39,40,8,46],k="#ccc",I="placeholdersjs",R=RegExp("(?:^|\\s)"+I+"(?!\\S)"),V="data-placeholder-value",P="data-placeholder-active",D="data-placeholder-type",U="data-placeholder-submit",j="data-placeholder-bound",q="data-placeholder-focus",Q="data-placeholder-live",z="data-placeholder-maxlength",F=document.createElement("input"),G=document.getElementsByTagName("head")[0],H=document.documentElement,J=t.Placeholders,K=J.Utils;if(J.nativeSupport=void 0!==F.placeholder,!J.nativeSupport){for(f=document.getElementsByTagName("input"),h=document.getElementsByTagName("textarea"),b="false"===H.getAttribute(q),m="false"!==H.getAttribute(Q),y=document.createElement("style"),y.type="text/css",E=document.createTextNode("."+I+" { color:"+k+"; }"),y.styleSheet?y.styleSheet.cssText=E.nodeValue:y.appendChild(E),G.insertBefore(y,G.firstChild),w=0,N=f.length+h.length;N>w;w++)S=f.length>w?f[w]:h[w-f.length],x=S.attributes.placeholder,x&&(x=x.nodeValue,x&&K.inArray(B,S.type)&&p(S));L=setInterval(function(){for(w=0,N=f.length+h.length;N>w;w++)S=f.length>w?f[w]:h[w-f.length],x=S.attributes.placeholder,x?(x=x.nodeValue,x&&K.inArray(B,S.type)&&(S.getAttribute(j)||p(S),(x!==S.getAttribute(V)||"password"===S.type&&!S.getAttribute(D))&&("password"===S.type&&!S.getAttribute(D)&&K.changeType(S,"text")&&S.setAttribute(D,"password"),S.value===S.getAttribute(V)&&(S.value=x),S.setAttribute(V,x)))):S.getAttribute(P)&&(n(S),S.removeAttribute(V));m||clearInterval(L)},100)}K.addEventListener(t,"beforeunload",function(){J.disable()}),J.disable=J.nativeSupport?e:i,J.enable=J.nativeSupport?e:l}(this),function(t){"use strict";var e=t.fn.val,r=t.fn.prop;Placeholders.nativeSupport||(t.fn.val=function(t){var r=e.apply(this,arguments),n=this.eq(0).data("placeholder-value");return void 0===t&&this.eq(0).data("placeholder-active")&&r===n?"":r},t.fn.prop=function(t,e){return void 0===e&&this.eq(0).data("placeholder-active")&&"value"===t?"":r.apply(this,arguments)})}(jQuery);;
"use strict";(self.webpackChunkgravityforms=self.webpackChunkgravityforms||[]).push([[499],{2487:function(t,n,r){var e=r(2409),o=r(8864),i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not a function")}},1601:function(t,n,r){var e=r(2409),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||e(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},3326:function(t,n,r){var e=r(8078),o=r(6082),i=r(8955).f,u=e("unscopables"),c=Array.prototype;void 0===c[u]&&i(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},3234:function(t,n,r){var e=r(6537),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not an object")}},5377:function(t,n,r){var e=r(9354),o=r(3163),i=r(3897),u=function(t){return function(n,r,u){var c,a=e(n),f=i(a),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},2322:function(t,n,r){var e=r(5322),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},6621:function(t,n,r){var e=r(4296),o=r(2126),i=r(8032),u=r(8955);t.exports=function(t,n,r){for(var c=o(n),a=u.f,f=i.f,s=0;s0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},6923:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9063:function(t,n,r){var e=r(1441),o=r(8032).f,i=r(9436),u=r(6362),c=r(8266),a=r(6621),f=r(4618);t.exports=function(t,n){var r,s,p,l,v,y=t.target,b=t.global,h=t.stat;if(r=b?e:h?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in n){if(l=n[s],p=t.dontCallGetSet?(v=o(r,s))&&v.value:r[s],!f(b?s:y+(h?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(r,s,l,t)}}},7672:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},8761:function(t,n,r){var e=r(7672);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6070:function(t,n,r){var e=r(8761),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},393:function(t,n,r){var e=r(9245),o=r(4296),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},3569:function(t,n,r){var e=r(5322),o=r(2487);t.exports=function(t,n,r){try{return e(o(Object.getOwnPropertyDescriptor(t,n)[r]))}catch(t){}}},5322:function(t,n,r){var e=r(8761),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},3745:function(t,n,r){var e=r(1441),o=r(2409);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:void 0):e[t]&&e[t][n];var r}},2079:function(t,n,r){var e=r(2487),o=r(228);t.exports=function(t,n){var r=t[n];return o(r)?void 0:e(r)}},1441:function(t,n,r){var e=function(t){return t&&t.Math===Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4296:function(t,n,r){var e=r(5322),o=r(5772),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},1637:function(t){t.exports={}},6379:function(t,n,r){var e=r(3745);t.exports=e("document","documentElement")},5750:function(t,n,r){var e=r(9245),o=r(7672),i=r(3022);t.exports=!e&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1241:function(t,n,r){var e=r(5322),o=r(7672),i=r(2322),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?c(t,""):u(t)}:u},8139:function(t,n,r){var e=r(5322),o=r(2409),i=r(2963),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},1982:function(t,n,r){var e,o,i,u=r(6329),c=r(1441),a=r(6537),f=r(9436),s=r(4296),p=r(2963),l=r(5492),v=r(1637),y="Object already initialized",b=c.TypeError,h=c.WeakMap;if(u||p.state){var g=p.state||(p.state=new h);g.get=g.get,g.has=g.has,g.set=g.set,e=function(t,n){if(g.has(t))throw new b(y);return n.facade=t,g.set(t,n),n},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var x=l("state");v[x]=!0,e=function(t,n){if(s(t,x))throw new b(y);return n.facade=t,f(t,x,n),n},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw new b("Incompatible receiver, "+t+" required");return r}}}},2409:function(t,n,r){var e=r(7900),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4618:function(t,n,r){var e=r(7672),o=r(2409),i=/#|\.prototype\./,u=function(t,n){var r=a[c(t)];return r===s||r!==f&&(o(n)?e(n):!!n)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},228:function(t){t.exports=function(t){return null==t}},6537:function(t,n,r){var e=r(2409),o=r(7900),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},1184:function(t){t.exports=!1},2991:function(t,n,r){var e=r(3745),o=r(2409),i=r(5178),u=r(7007),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var n=e("Symbol");return o(n)&&i(n.prototype,c(t))}},3895:function(t,n,r){var e=r(5468).IteratorPrototype,o=r(6082),i=r(7547),u=r(9732),c=r(5794),a=function(){return this};t.exports=function(t,n,r,f){var s=n+" Iterator";return t.prototype=o(e,{next:i(+!f,r)}),u(t,s,!1,!0),c[s]=a,t}},2984:function(t,n,r){var e=r(9063),o=r(6070),i=r(1184),u=r(393),c=r(2409),a=r(3895),f=r(2214),s=r(115),p=r(9732),l=r(9436),v=r(6362),y=r(8078),b=r(5794),h=r(5468),g=u.PROPER,x=u.CONFIGURABLE,m=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,O=y("iterator"),w="keys",S="values",j="entries",P=function(){return this};t.exports=function(t,n,r,u,y,h,E){a(r,n,u);var _,I,A,T=function(t){if(t===y&&M)return M;if(!d&&t&&t in R)return R[t];switch(t){case w:case S:case j:return function(){return new r(this,t)}}return function(){return new r(this)}},k=n+" Iterator",F=!1,R=t.prototype,C=R[O]||R["@@iterator"]||y&&R[y],M=!d&&C||T(y),D="Array"===n&&R.entries||C;if(D&&(_=f(D.call(new t)))!==Object.prototype&&_.next&&(i||f(_)===m||(s?s(_,m):c(_[O])||v(_,O,P)),p(_,k,!0,!0),i&&(b[k]=P)),g&&y===S&&C&&C.name!==S&&(!i&&x?l(R,"name",S):(F=!0,M=function(){return o(C,this)})),y)if(I={values:T(S),keys:h?M:T(w),entries:T(j)},E)for(A in I)(d||F||!(A in R))&&v(R,A,I[A]);else e({target:n,proto:!0,forced:d||F},I);return i&&!E||R[O]===M||v(R,O,M,{name:y}),b[n]=M,I}},5468:function(t,n,r){var e,o,i,u=r(7672),c=r(2409),a=r(6537),f=r(6082),s=r(2214),p=r(6362),l=r(8078),v=r(1184),y=l("iterator"),b=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):b=!0),!a(e)||u((function(){var t={};return e[y].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[y])||p(e,y,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:b}},5794:function(t){t.exports={}},3897:function(t,n,r){var e=r(3606);t.exports=function(t){return e(t.length)}},3793:function(t,n,r){var e=r(5322),o=r(7672),i=r(2409),u=r(4296),c=r(9245),a=r(393).CONFIGURABLE,f=r(8139),s=r(1982),p=s.enforce,l=s.get,v=String,y=Object.defineProperty,b=e("".slice),h=e("".replace),g=e([].join),x=c&&!o((function(){return 8!==y((function(){}),"length",{value:8}).length})),m=String(String).split("String"),d=t.exports=function(t,n,r){"Symbol("===b(v(n),0,7)&&(n="["+h(v(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!u(t,"name")||a&&t.name!==n)&&(c?y(t,"name",{value:n,configurable:!0}):t.name=n),x&&r&&u(r,"arity")&&t.length!==r.arity&&y(t,"length",{value:r.arity});try{r&&u(r,"constructor")&&r.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=g(m,"string"==typeof n?n:"")),t};Function.prototype.toString=d((function(){return i(this)&&l(this).source||f(this)}),"toString")},1090:function(t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},6082:function(t,n,r){var e,o=r(3234),i=r(8993),u=r(6923),c=r(1637),a=r(6379),f=r(3022),s=r(5492),p="prototype",l="script",v=s("IE_PROTO"),y=function(){},b=function(t){return"<"+l+">"+t+""},h=function(t){t.write(b("")),t.close();var n=t.parentWindow.Object;return t=null,n},g=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,n,r;g="undefined"!=typeof document?document.domain&&e?h(e):(n=f("iframe"),r="java"+l+":",n.style.display="none",a.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F):h(e);for(var o=u.length;o--;)delete g[p][u[o]];return g()};c[v]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(y[p]=o(t),r=new y,y[p]=null,r[v]=t):r=g(),void 0===n?r:i.f(r,n)}},8993:function(t,n,r){var e=r(9245),o=r(4580),i=r(8955),u=r(3234),c=r(9354),a=r(4523);n.f=e&&!o?Object.defineProperties:function(t,n){u(t);for(var r,e=c(n),o=a(n),f=o.length,s=0;f>s;)i.f(t,r=o[s++],e[r]);return t}},8955:function(t,n,r){var e=r(9245),o=r(5750),i=r(4580),u=r(3234),c=r(7520),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";n.f=e?i?function(t,n,r){if(u(t),n=c(n),u(r),"function"==typeof t&&"prototype"===n&&"value"in r&&v in r&&!r[v]){var e=s(t,n);e&&e[v]&&(t[n]=r.value,r={configurable:l in r?r[l]:e[l],enumerable:p in r?r[p]:e[p],writable:!1})}return f(t,n,r)}:f:function(t,n,r){if(u(t),n=c(n),u(r),o)try{return f(t,n,r)}catch(t){}if("get"in r||"set"in r)throw new a("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},8032:function(t,n,r){var e=r(9245),o=r(6070),i=r(524),u=r(7547),c=r(9354),a=r(7520),f=r(4296),s=r(5750),p=Object.getOwnPropertyDescriptor;n.f=e?p:function(t,n){if(t=c(t),n=a(n),s)try{return p(t,n)}catch(t){}if(f(t,n))return u(!o(i.f,t,n),t[n])}},15:function(t,n,r){var e=r(2204),o=r(6923).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},7733:function(t,n){n.f=Object.getOwnPropertySymbols},2214:function(t,n,r){var e=r(4296),o=r(2409),i=r(5772),u=r(5492),c=r(7018),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var n=i(t);if(e(n,a))return n[a];var r=n.constructor;return o(r)&&n instanceof r?r.prototype:n instanceof f?s:null}},5178:function(t,n,r){var e=r(5322);t.exports=e({}.isPrototypeOf)},2204:function(t,n,r){var e=r(5322),o=r(4296),i=r(9354),u=r(5377).indexOf,c=r(1637),a=e([].push);t.exports=function(t,n){var r,e=i(t),f=0,s=[];for(r in e)!o(c,r)&&o(e,r)&&a(s,r);for(;n.length>f;)o(e,r=n[f++])&&(~u(s,r)||a(s,r));return s}},4523:function(t,n,r){var e=r(2204),o=r(6923);t.exports=Object.keys||function(t){return e(t,o)}},524:function(t,n){var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!r.call({1:2},1);n.f=o?function(t){var n=e(this,t);return!!n&&n.enumerable}:r},115:function(t,n,r){var e=r(3569),o=r(3234),i=r(1601);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{(t=e(Object.prototype,"__proto__","set"))(r,[]),n=r instanceof Array}catch(t){}return function(r,e){return o(r),i(e),n?t(r,e):r.__proto__=e,r}}():void 0)},6946:function(t,n,r){var e=r(6070),o=r(2409),i=r(6537),u=TypeError;t.exports=function(t,n){var r,c;if("string"===n&&o(r=t.toString)&&!i(c=e(r,t)))return c;if(o(r=t.valueOf)&&!i(c=e(r,t)))return c;if("string"!==n&&o(r=t.toString)&&!i(c=e(r,t)))return c;throw new u("Can't convert object to primitive value")}},2126:function(t,n,r){var e=r(3745),o=r(5322),i=r(15),u=r(7733),c=r(3234),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?a(n,r(t)):n}},4836:function(t,n,r){var e=r(228),o=TypeError;t.exports=function(t){if(e(t))throw new o("Can't call method on "+t);return t}},9732:function(t,n,r){var e=r(8955).f,o=r(4296),i=r(8078)("toStringTag");t.exports=function(t,n,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:n})}},5492:function(t,n,r){var e=r(3334),o=r(8080),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},2963:function(t,n,r){var e=r(1441),o=r(8266),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},3334:function(t,n,r){var e=r(1184),o=r(2963);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.33.3",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE",source:"https://github.com/zloirock/core-js"})},1326:function(t,n,r){var e=r(6770),o=r(7672),i=r(1441).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},3163:function(t,n,r){var e=r(6993),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},9354:function(t,n,r){var e=r(1241),o=r(4836);t.exports=function(t){return e(o(t))}},6993:function(t,n,r){var e=r(1090);t.exports=function(t){var n=+t;return n!=n||0===n?0:e(n)}},3606:function(t,n,r){var e=r(6993),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5772:function(t,n,r){var e=r(4836),o=Object;t.exports=function(t){return o(e(t))}},6741:function(t,n,r){var e=r(6070),o=r(6537),i=r(2991),u=r(2079),c=r(6946),a=r(8078),f=TypeError,s=a("toPrimitive");t.exports=function(t,n){if(!o(t)||i(t))return t;var r,a=u(t,s);if(a){if(void 0===n&&(n="default"),r=e(a,t,n),!o(r)||i(r))return r;throw new f("Can't convert object to primitive value")}return void 0===n&&(n="number"),c(t,n)}},7520:function(t,n,r){var e=r(6741),o=r(2991);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},8864:function(t){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},8080:function(t,n,r){var e=r(5322),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},7007:function(t,n,r){var e=r(1326);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},4580:function(t,n,r){var e=r(9245),o=r(7672);t.exports=e&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},6329:function(t,n,r){var e=r(1441),o=r(2409),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},8078:function(t,n,r){var e=r(1441),o=r(3334),i=r(4296),u=r(8080),c=r(1326),a=r(7007),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},4051:function(t,n,r){var e=r(9354),o=r(3326),i=r(5794),u=r(1982),c=r(8955).f,a=r(2984),f=r(1897),s=r(1184),p=r(9245),l="Array Iterator",v=u.set,y=u.getterFor(l);t.exports=a(Array,"Array",(function(t,n){v(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var t=y(this),n=t.target,r=t.index++;if(!n||r>=n.length)return t.target=void 0,f(void 0,!0);switch(t.kind){case"keys":return f(r,!1);case"values":return f(n[r],!1)}return f([r,n[r]],!1)}),"values");var b=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==b.name)try{c(b,"name",{value:"values"})}catch(t){}}}]);;
!function(){"use strict";var n,e={3856:function(n,e,t){var o=gform.utils,r=function(){(0,o.consoleInfo)("Gravity Forms Common: Initialized all javascript that targeted document ready.")},i=function(){(0,o.ready)(r)},u=function(){i()},a=window.gform_theme_config,c={},d=window.gform,f=!1,w=function(n){var e=n.target;if((s(e)||m(e))&&!l()){var t='');e.insertAdjacentHTML("beforeend",t)}},m=function(n){var e=n.dataset.formid,t=(0,o.getNodes)("#gform_save_".concat(e),!0,n,!0);return t.length>0&&"1"===t[0].value},s=function(n){var e=n.dataset.formid,t=(0,o.getNodes)('input[name = "gform_target_page_number_'.concat(e,'"]'),!0,n,!0)[0];return void 0!==t&&(0===parseInt(t.value)||f)},l=function(){return window._phantom||window.callPhantom||window.__phantomas||window.Buffer||window.emit||window.spawn||window.webdriver||window._selenium||window._Selenium_IDE_Recorder||window.callSelenium||window.__nightmare||window.domAutomation||window.domAutomationController||window.document.__webdriver_evaluate||window.document.__selenium_evaluate||window.document.__webdriver_script_function||window.document.__webdriver_script_func||window.document.__webdriver_script_fn||window.document.__fxdriver_evaluate||window.document.__driver_unwrapped||window.document.__webdriver_unwrapped||window.document.__driver_evaluate||window.document.__selenium_unwrapped||window.document.__fxdriver_unwrapped||window.document.documentElement.getAttribute("selenium")||window.document.documentElement.getAttribute("webdriver")||window.document.documentElement.getAttribute("driver")},_=function(){c.forms=(0,o.getNodes)(".gform_wrapper form",!0,document,!0),c.forms.forEach((function(n){return jQuery(document).on("submit",n,w)})),d.addAction("gform_frontend_pages_evaluated",(function(n,e,t){var o=parseInt(document.querySelector("#gform_target_page_number_"+t.options.formId).value,10);(0===o||t.options.pages.length+1===o&&!t.options.pages[o-2].isVisible)&&(f=!0)})),(0,o.consoleInfo)("Gravity Forms Honeypot: Initialized.")},p=function(){_(),(0,o.consoleInfo)("Gravity Forms Form JS: Initialized..")},v=function(){u(),p()},g=function(){(0,o.ready)(v)},h=gform_theme_config,b=t.n(h);t.p=b().public_path,g()}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}o.m=e,n=[],o.O=function(e,t,r,i){if(!t){var u=1/0;for(f=0;f=i)&&Object.keys(o.O).every((function(n){return o.O[n](t[c])}))?t.splice(c--,1):(a=!1,i0&&n[f-1][2]>i;f--)n[f]=n[f-1];n[f]=[t,r,i]},o.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(e,{a:e}),e},o.d=function(n,e){for(var t in e)o.o(e,t)&&!o.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),o.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},function(){var n;o.g.importScripts&&(n=o.g.location+"");var e=o.g.document;if(!n&&e&&(e.currentScript&&(n=e.currentScript.src),!n)){var t=e.getElementsByTagName("script");if(t.length)for(var r=t.length-1;r>-1&&!n;)n=t[r--].src}if(!n)throw new Error("Automatic publicPath is not supported in this browser");n=n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=n}(),function(){var n={415:0};o.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,i,u=t[0],a=t[1],c=t[2],d=0;if(u.some((function(e){return 0!==n[e]}))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(c)var f=c(o)}for(e&&e(t);d 1 ) {
keypress.push( keydowns[ e.key ][1] );
}
keypresses.push( keypress );
}
}
delete keydowns[ e.key ];
lastKeyup = keyupTime;
}, supportsPassive ? { passive: true } : false );
form.addEventListener( "focusin", function ( e ) {
lastKeydown = null;
lastKeyup = null;
keydowns = {};
}, supportsPassive ? { passive: true } : false );
form.addEventListener( "focusout", function ( e ) {
lastKeydown = null;
lastKeyup = null;
keydowns = {};
}, supportsPassive ? { passive: true } : false );
}
document.addEventListener( 'mousedown', function ( e ) {
lastMousedown = ( new Date() ).getTime();
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'mouseup', function ( e ) {
if ( ! lastMousedown ) {
// If the mousedown happened before this script was loaded, but the mouseup happened after...
return;
}
var now = ( new Date() ).getTime();
var mouseclick = [];
mouseclick.push( now - lastMousedown );
if ( lastMouseup ) {
mouseclick.push( lastMousedown - lastMouseup );
}
mouseclicks.push( mouseclick );
lastMouseup = now;
// If the mouse has been clicked, don't record this time as an interval between keypresses.
lastKeydown = null;
lastKeyup = null;
keydowns = {};
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'mousemove', function ( e ) {
if ( mousemoveTimer ) {
clearTimeout( mousemoveTimer );
mousemoveTimer = null;
}
else {
mousemoveStart = ( new Date() ).getTime();
lastMousemoveX = e.offsetX;
lastMousemoveY = e.offsetY;
}
mousemoveTimer = setTimeout( function ( theEvent, originalMousemoveStart ) {
var now = ( new Date() ).getTime() - 500; // To account for the timer delay.
var mousemove = [];
mousemove.push( now - originalMousemoveStart );
mousemove.push(
Math.round(
Math.sqrt(
Math.pow( theEvent.offsetX - lastMousemoveX, 2 ) +
Math.pow( theEvent.offsetY - lastMousemoveY, 2 )
)
)
);
if ( mousemove[1] > 0 ) {
// If there was no measurable distance, then it wasn't really a move.
mousemoves.push( mousemove );
}
mousemoveStart = null;
mousemoveTimer = null;
}, 500, e, mousemoveStart );
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'touchmove', function ( e ) {
if ( touchmoveCountTimer ) {
clearTimeout( touchmoveCountTimer );
}
touchmoveCountTimer = setTimeout( function () {
touchmoveCount++;
}, 500 );
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'touchstart', function ( e ) {
lastTouchStart = ( new Date() ).getTime();
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'touchend', function ( e ) {
if ( ! lastTouchStart ) {
// If the touchstart happened before this script was loaded, but the touchend happened after...
return;
}
var now = ( new Date() ).getTime();
var touchEvent = [];
touchEvent.push( now - lastTouchStart );
if ( lastTouchEnd ) {
touchEvent.push( lastTouchStart - lastTouchEnd );
}
touchEvents.push( touchEvent );
lastTouchEnd = now;
// Don't record this time as an interval between keypresses.
lastKeydown = null;
lastKeyup = null;
keydowns = {};
}, supportsPassive ? { passive: true } : false );
document.addEventListener( 'scroll', function ( e ) {
if ( scrollCountTimer ) {
clearTimeout( scrollCountTimer );
}
scrollCountTimer = setTimeout( function () {
scrollCount++;
}, 500 );
}, supportsPassive ? { passive: true } : false );
}
/**
* For the timestamp data that is collected, don't send more than `limit` data points in the request.
* Choose a random slice and send those.
*/
function prepare_timestamp_array_for_request( a, limit ) {
if ( ! limit ) {
limit = 100;
}
var rv = '';
if ( a.length > 0 ) {
var random_starting_point = Math.max( 0, Math.floor( Math.random() * a.length - limit ) );
for ( var i = 0; i < limit && i < a.length; i++ ) {
rv += a[ random_starting_point + i ][0];
if ( a[ random_starting_point + i ].length >= 2 ) {
rv += "," + a[ random_starting_point + i ][1];
}
rv += ";";
}
}
return rv;
}
if ( document.readyState !== 'loading' ) {
init();
} else {
document.addEventListener( 'DOMContentLoaded', init );
}
})();;
/**
* jQuery WP-SmartCrop v2.0.6
* Copyright (c) 2017 Greg Schoppe
* License: http://www.opensource.org/licenses/mit-license.php
**/
!function(t){t.fn.extend({wpsmartcrop:function(e){e=t.extend({focal_point:null,compatibility:null,focus_mode:"power-lines"},e);for(var o=0,i=["webkit","moz"],n=window.requestAnimationFrame,a=window.cancelAnimationFrame,r=0;rr&&(n=r),n<0&&(n=0),-1*n},i=t.data("smartcrop-focus"),n=t.data("smartcrop-mode"),a=[t[0].naturalWidth?t[0].naturalWidth:t[0].getAttribute("width"),t[0].naturalHeight?t[0].naturalHeight:t[0].getAttribute("height")],r=[t.width(),t.height()],s=function(t,e){var o=t[0]/t[1];return o>e[0]/e[1]?[Math.round(e[1]*o),e[1]]:[e[0],Math.round(e[0]/o)]}(a,r),c=[0,0];return i||(i=e.focal_point),!(!i||i.length<2||!a[0]||!a[1]||!r[0]||!r[1])&&(n||(n=void 0!==window.wpsmartcrop_focus_mode?e.focus_mode:"power-lines"),r[0]/r[1]").addClass("wpsmartcrop-overlay").append(s).insertAfter(o)}d(o,r);var p=!1;t(window).resize(function(){a(p),p=n(function(){d(o,r)})}),t(window).on("load",function(){d(o,r)}),o.on("wpsmartcrop-redraw",function(){d(o,r)})}}})}})}(jQuery),jQuery(document).ready(function(t){"undefined"==typeof wpsmartcrop_options&&(wpsmartcrop_options={});var e=function(){t("img.wpsmartcrop-image").wpsmartcrop(wpsmartcrop_options)};e();var o=o||navigator.userAgent,i=-1!==o.indexOf("Trident/7");"MutationObserver"in window&&!i&&new MutationObserver(function(t){e()}).observe(document.documentElement,{attributes:!1,characterData:!1,childList:!0,subtree:!0})});
;
(function ($) {
const brookingsApp = {
hubspot: {
init: function () {
// view subscriptions
jQuery(document).on("submit", "form#hs-view-subscriptions", function (e) {
e.preventDefault();
brookingsApp.hubspot.trigger('brookingsViewSubscriptions');
});
jQuery(window).on('brookingsViewSubscriptions', function () {
brookingsApp.hubspot.viewSubscriptions();
});
// subscribe to newsletter(s) from main newsletter landing page
jQuery(document).on("submit", "form#hs-subscribe-all", function (e) {
e.preventDefault();
brookingsApp.hubspot.trigger('brookingsSubscribeAll');
});
jQuery(document).on("submit", "form#hs-subscribe-all-mobile", function (e) {
e.preventDefault();
brookingsApp.hubspot.trigger('brookingsSubscribeAll');
});
jQuery(window).on('brookingsSubscribeAll', function () {
brookingsApp.hubspot.subscribeToAll('subscribe', $('form#hs-subscribe-all').serialize());
});
// unsubscribe from all newsletter(s) on main newsletter landing page
jQuery(document).on("submit", "form#hs-unsubscribe-all", function (e) {
e.preventDefault();
brookingsApp.hubspot.trigger('brookingsUnsubscribeAll');
});
jQuery(window).on('brookingsUnsubscribeAll', function () {
const checkboxes = document.querySelectorAll('.cb-newsletter-subscribe');
checkboxes.forEach(function (checkbox) {
checkbox.checked = false;
});
brookingsApp.hubspot.subscribeToAll('unsubscribe', $('form#hs-unsubscribe-all').serialize());
$('#unsubscribe-modal .uk-modal-close').click();
});
// subscribe via component
jQuery(document).on("submit", "form.subscribe-component", function (e) {
e.preventDefault();
var formID = jQuery(this).attr('id');
brookingsApp.hubspot.trigger('subscribeFromComponent', formID);
});
jQuery(window).on('subscribeFromComponent', function (e) {
brookingsApp.hubspot.subscribeFromComponent(e);
});
},
trigger: function (tmAction, id=null) {
var customAction = tmAction;
var formId = id;
grecaptcha.execute(tmscripts.recaptchaKey, {action: 'forms'} ).then(function (token) {
var recaptchaElements = document.getElementsByName('g-recaptcha-response');
for ( var i = 0; i < recaptchaElements.length; i++ ) {
recaptchaElements[i].value = token;
}
window.dispatchEvent(new CustomEvent(customAction, {'detail': {
'formId': formId
}}));
});
},
viewSubscriptions: function () {
const validationCheck = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const email = jQuery('form#hs-view-subscriptions').find('input[type="email"]').val();
if ( email && String(email)
.toLowerCase()
.match(
validationCheck
) ) {
jQuery.ajax({
url: tmscripts.ajaxurl,
type: "POST",
data: {
action: "brookings_hubspot_get_lists",
email: email,
formData: jQuery('form#hs-view-subscriptions').serialize(),
nonce: tmscripts.security,
},
success: function (response) {
if (response.success && response.data && typeof response.data.lists === 'object' && Object.keys(response.data.lists).length > 0) {
// check and checkboxes with an ID that matches a list ID
jQuery.each(response.data.lists, function (index, value) {
if ( 'true' == value ) {
jQuery(`input#${index}`).prop('checked', true);
}
});
// populate email address on subscribe and unsubscribe forms
document.querySelector('#hs-subscribe-all input[type="email"]').value = response.data.email;
document.querySelector('#hs-unsubscribe-all input[type="email"]').value = response.data.email;
} else {
console.log('no lists found for email address');
}
$('#subscribe-modal .uk-modal-close').click();
},
error: function (error) {
console.log(error);
},
});
} else {
// invalid email address
}
},
subscribeToAll: function (type, formData) {
const checkboxes = document.querySelectorAll('.cb-newsletter-subscribe');
const properties = {};
var subscribeType = type;
var newsletterPrograms = [];
var newsletterNames = [];
checkboxes.forEach(function (checkbox) {
if (checkbox.checked) {
properties[checkbox.getAttribute('name')] = true;
newsletterPrograms.push(checkbox.getAttribute('data-program'));
newsletterNames.push(checkbox.getAttribute('data-name'));
} else {
properties[checkbox.getAttribute('name')] = false;
}
});
// add to window.subscriptionData for consumption in DataLayer event.
window.subscriptionData = {
'newsletterProgram': newsletterPrograms.join(','),
'newsletterName': newsletterNames.join(',')
};
jQuery.ajax({
url: tmscripts.ajaxurl,
type: "POST",
data: {
action: "brookings_newsletters_subscribe",
properties: properties,
formData: formData,
nonce: tmscripts.security,
},
success: function (response) {
if ( 'subscribe' == subscribeType ) {
if ( response.success ) {
document.querySelector('#hs-subscribe-all .email-and-submit').style.display = 'none';
document.querySelector('#hs-subscribe-all .disclaimer-text').style.display = 'none';
document.querySelector('#hs-subscribe-all .subscriber-disclaimer').style.display = 'none';
document.querySelector('#hs-subscribe-all .form-message').innerHTML = response.data;
window.dispatchEvent(new CustomEvent('brookings_newsletter_subscribe_success'));
} else {
console.log( response );
document.querySelector('#hs-subscribe-all .form-message').innerHTML = 'There was an error subscribing to the newsletter. Please try again later.';
}
} else {
console.log( response );
}
},
error: function (error) {
console.log(error);
if ( 'subscribe' == subscribeType ) {
document.querySelector('#hs-subscribe-all .form-message').innerHTML = "There was a problem subscribing to the newsletter(s). Please try again later.";
}
},
});
},
subscribeFromComponent: function (e) {
// check whether there are any checkboxes checked
var checkboxes = jQuery(`#${e.detail.formId}`).find('input[type="checkbox"]');
var checked = false;
var newsletterPrograms = [];
var newsletterNames = [];
checkboxes.each(function () {
if (jQuery(this).is(':checked')) {
checked = true;
newsletterPrograms.push(jQuery(this).data('program'));
newsletterNames.push(jQuery(this).data('name'));
}
});
// add to window.subscriptionData for consumption in DataLayer event.
window.subscriptionData = {
'newsletterProgram': newsletterPrograms.join(','),
'newsletterName': newsletterNames.join(',')
};
if ( false == checked ) {
jQuery(`#${e.detail.formId} .form-message`).text('Please select at least one newsletter to subscribe to.');
return;
}
var formData = jQuery(`#${e.detail.formId}`).serialize();
var formMessage = jQuery(`#${e.detail.formId}`).find('.form-message');
var formFields = jQuery(`#${e.detail.formId}`).find('.subscribe-form-fields');
jQuery.ajax({
url: tmscripts.ajaxurl,
type: "POST",
data: {
action: "brookings_newsletter_subscribe",
formData: formData,
nonce: tmscripts.security,
},
success: function (response) {
if (response.success) {
formMessage.html(response.data);
$(formFields).hide();
window.dispatchEvent(new CustomEvent('brookings_newsletter_subscribe_success'));
} else {
console.log(response);
formMessage.html(response.data);
}
},
error: function (error) {
console.log(error);
// formMessage.html(error.data);
},
});
},
},
filters: {
init: function () {
jQuery(document).ready(function () {
var url = new URL(window.location.href);
var expertTopics = url.searchParams.get("ext");
var expertPrograms = url.searchParams.get("exp");
if (expertTopics) {
expertTopics = expertTopics.replace(/[^a-zA-Z0-9-]/g, '');
jQuery(`#topicFilters .form-checkbox[data-slug="${expertTopics}"]`).click();
}
if ( expertPrograms ) {
expertPrograms = expertPrograms.replace(/[^a-zA-Z0-9-]/g, '');
jQuery(`#researchProgramFilters .form-checkbox[data-slug="${expertPrograms}"]`).click();
}
// jQuery(document).on('click', '.form-checkbox', function () {
// const slug = jQuery(this).data('slug');
// if (slug) {
// // var name = jQuery(this).attr('name');
// brookingsApp.filters.updateUrl({
// 'ext': slug
// });
// }
// });
});
},
updateUrl: function(params) {
var url = new URL(window.location.href);
var search_params = url.searchParams;
Object.entries(params).map(item => {
search_params.set(item[0], item[1]);
});
window.history.replaceState(null, null, url)
}
},
document: {
init: function () {
jQuery(document).ready(function () {
setTimeout(function () {
// scroll to interactive component if share link
if (window.location.href.indexOf("share") > -1) {
var interactiveId = window.location.href.split("share=")[1];
var interactiveComponent = document.getElementById(interactiveId);
if (interactiveComponent) {
const yOffset = -140;
const y = interactiveComponent.getBoundingClientRect().top + window.pageYOffset + yOffset;
window.scrollTo({top: y, behavior: 'instant'});
}
}
}, 500);
// add support for ol 'start' attribute
const lists = document.querySelectorAll('ol[start]');
lists.forEach(function(el, index) {
let count = el.getAttribute('start') - 1;
el.style.counterReset = 'ordered ' + count;
});
// responsive iframes
iFrameResize(
{
log: false,
scrolling: false,
checkOrigin: false,
autoResize: false,
},
"iframe.brookings-interactive:not(.autoresize)"
);
iFrameResize(
{
log: false,
scrolling: false,
checkOrigin: false,
autoResize: true,
},
"iframe.brookings-interactive.autoresize"
);
// add target="_blank" to external links
const allLinks = document.querySelectorAll('a');
if ( allLinks.length ) {
allLinks.forEach(link => {
var href = link.getAttribute('href');
if ( ! brookingsApp.document.isValidUrl(href) ) {
return false;
}
var url = new URL(href);
if (! url.hostname.includes('brookings') ) {
link.setAttribute('target', '_blank');
}
});
}
});
},
isValidUrl: urlString => {
try {
return Boolean(new URL(urlString));
}
catch(e){
return false;
}
}
},
dataLayer: {
init: function () {
// page load started
window.addEventListener('DOMContentLoaded', (event) => {
brookingsApp.dataLayer.pageLoadStarted();
});
// page load completed
window.addEventListener('load', (event) => {
brookingsApp.dataLayer.pageLoadCompleted();
});
// Content Interaction -- when users click on any CTA or links to download, print, or share content posts
jQuery(document).on('click', '.share-and-print a.btn-social, .slideout-nav .social-icons a.btn-social', function (e) {
// post share click
brookingsApp.dataLayer.contentInteraction('social share');
});
jQuery(document).on('click', '.print-btn', function (e) {
// post print click
brookingsApp.dataLayer.contentInteraction('print');
});
jQuery(document).on('click', '.sidebar-block.downloads a.btn', function (e) {
// download click
brookingsApp.dataLayer.contentInteraction('download');
});
jQuery(document).on('click', '.sidebar-block.print-sidebar a.btn', function (e) {
// print click
brookingsApp.dataLayer.contentInteraction('print');
});
jQuery(document).on('click', '.brookings-interactive .share-links a.btn', function (e) {
// interactive share click
brookingsApp.dataLayer.contentInteraction('interactive share');
});
// register for event
jQuery(document).on('click', '.event-actions a.btn', function (e) {
// get href
const href = jQuery(this).attr('href');
brookingsApp.dataLayer.eventRegistration(href);
});
// interactive view
window.addEventListener('load', (event) => {
const elements = document.querySelectorAll('.brookings-interactive');
if ( elements.length ) {
// callback function for when interactive is in view
const callback = (entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
const interactiveId = entry.target.getAttribute('data-identifier');
const interactiveName = entry.target.getAttribute('data-name');
const interactiveType = entry.target.getAttribute('data-type');
brookingsApp.dataLayer.interactiveView({
'interactiveId': interactiveId,
'interactiveName': interactiveName,
'interactiveType': interactiveType
});
observer.unobserve(entry.target);
}
});
};
// Create new observer instance
const observer = new IntersectionObserver(callback, {
root: null,
rootMargin: '0px',
threshold: 0.1
});
// Observe each interactive
elements.forEach((element) => {
observer.observe(element);
});
}
});
// algoliaInteraction
jQuery(document).on('algolia:search:init', function (e) {
brookingsApp.dataLayer.algoliaInteraction({key: 'algolia_search_init', label: 'Algolia Search Initialization', value: null});
});
jQuery('#contentStream, .algolia-modal').on('click', function (e) {
if ( jQuery(e.target).is('input[type="checkbox"]') ) {
brookingsApp.dataLayer.algoliaInteraction({key: 'algolia_filter', label: 'Algolia Filter', value: jQuery(e.target).val()});
} else if ( jQuery(e.target).is('input[type="radio"]') ) {
brookingsApp.dataLayer.algoliaInteraction({key: 'algolia_filter', label: 'Algolia Filter', value: jQuery(e.target).next().text()});
}
});
// algolia search input on blur
jQuery('#contentStream').on('blur', 'input[type="search"], #overlay-search .search-field, #searchFacet .search-field', function (e) {
console.log( 'Algolia Search' );
brookingsApp.dataLayer.algoliaInteraction({key: 'algolia_search', label: 'Algolia Search', value: jQuery(this).val()});
});
// home page link click events
if ( document.querySelector('body').classList.contains( 'home' ) ) {
const homepageClickEvents = {
'.byo-block.featured-content a' : 'Featured Content block',
'.byo-block.home--about a' : 'About Brookings block',
'.byo-block.home--experts a' : 'Experts block',
'.byo-block .home-events-block a' : 'Events block',
'.byo-block.home--programs a' : 'Programs block',
'.byo-block .explain-swiper a' : 'Brookings Explains block',
'.byo-block .podcast2-swiper a' : 'Podcasts block',
};
Object.entries(homepageClickEvents).forEach(( [key, value] ) => {
if ( document.querySelectorAll(key) ) {
jQuery(document).on('click', key, function (e) {
brookingsApp.dataLayer.navigationClick(value, e);
});
}
});
}
// global component click events
const componentClickEvents = {
'.byo-block .related-content-feed a' : 'Related Content block',
'.sidebar-block.read-the-series a' : 'Read More From widget',
'.byo-block.impact a' : 'Impact block',
};
Object.entries(componentClickEvents).forEach(( [key, value] ) => {
if ( document.querySelector(key) ) {
jQuery(document).on('click', key, function (e) {
brookingsApp.dataLayer.navigationClick(value, e);
});
}
});
// navigation click
jQuery(document).on('click', 'nav li.menu-item', function (e) {
const navName = jQuery(this).closest('nav').attr('data-nav');
brookingsApp.dataLayer.navigationClick(navName, e);
});
// sign up
jQuery(window).on('brookings_newsletter_subscribe_success', function (e) {
brookingsApp.dataLayer.newsletterSignup();
});
// Contact Us Completed
jQuery(document).on('gform_confirmation_loaded', function(event, formId) {
brookingsApp.dataLayer.contactUsCompleted(formId);
});
// Interactive click (used only on ECE Map as of 11/27/2024)
window.addEventListener('message', function(event) {
if (event.data.event === 'interactiveClick') {
brookingsApp.dataLayer.interactiveClick( event.data.details );
}
});
},
pageLoadStarted: function () {
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({ page_data: null }); // Clear the previous page_data object.
dataLayer.push({
"event": "page_load_started",
"detailed_event": "Page Load Started",
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"author_type": this.getData('author_type'),
"center": this.getData('center'),
"content_type": this.getData('content_type'),
"historical_url": this.getData('historical_url'),
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"program": this.getData('program'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
},
"page_data": {
"language": this.getData('language'),
"name": this.getData('title'),
"page_location": window.location.href,
}
});
},
pageLoadCompleted: function () {
window.dataLayer = window.dataLayer || [];
dataLayer.push({
"event": "page_view",
"detailed_event": "Page Load Completed"
});
},
contentInteraction: function (interactionType) {
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "content_interaction",
"detailed_event": "Content Interaction",
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"author_type": this.getData('author_type'),
"center": this.getData('center'),
"content_type": this.getData('content_type'),
"historical_url": this.getData('historical_url'),
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"program": this.getData('program'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"method": interactionType,
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
"language": this.getData('language'),
"interactive": interactionType === 'interactive share' ? 'Yes' : 'No',
}
});
},
navigationClick: function (navName, event) {
let navHref = null;
let navText = null;
if ( 'SPAN' == event.target.nodeName ) {
event.target = event.target.parentNode;
}
if ( 'A' === event.target.nodeName ) {
navHref = jQuery(event.target).attr('href');
navText = jQuery(event.target).text().trim();
}
let campaign = null;
let campaignElement = jQuery(event.target).closest('.block-campaign');
if ( campaignElement.length ) {
campaign = campaignElement.data('campaign');
}
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "navigation_click",
"detailed_event": "Navigation Click",
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"author_type": this.getData('author_type'),
"center": this.getData('center'),
"historical_url": this.getData('historical_url'),
"language": this.getData('language'),
"module_name": navName,
"module_link": navHref,
"module_text": navText,
"module_campaign": campaign,
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
}
});
},
newsletterSignup: function () {
var newsletterPrograms = '';
var newsletterNames = '';
if ( 'undefined' !== typeof window.subscriptionData.newsletterProgram ) {
newsletterPrograms = window.subscriptionData.newsletterProgram;
}
if ( 'undefined' !== typeof window.subscriptionData.newsletterName ) {
newsletterNames = window.subscriptionData.newsletterName;
}
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "sign_up",
"detailed_event": "Sign Up",
"event_data": {
// "event_count": "",
"newsletter_name": newsletterNames,
"program": newsletterPrograms
}
});
},
interactiveView: function (data) {
// check if data.interactiveId is null
if ( ! data.interactiveId ) {
return;
}
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "interactive_view",
"detailed_event": "Interactive View",
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"center": this.getData('center'),
"chart_name": data.interactiveName,
"chart_id": data.interactiveId,
"content_type": this.getData('content_type'),
"historical_url": this.getData('historical_url'),
"interactive_name": data.interactiveName,
"interactive_type": data.interactiveType,
"language": this.getData('language'),
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"program": this.getData('program'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
}
});
},
interactiveClick: function (data) {
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "interactive_click",
"detailed_event": "Interactive Click",
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"center": this.getData('center'),
"chart_name": data.interactiveName,
"chart_id": data.interactiveId,
"content_type": this.getData('content_type'),
"historical_url": this.getData('historical_url'),
"interactive": data.interactiveName,
"interactive_element": data.interactiveElement,
"interactive_name": data.interactiveName,
"interactive_type": data.interactiveType,
"language": this.getData('language'),
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"program": this.getData('program'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
}
});
},
eventRegistration: function (href) {
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "register_event",
"detailed_event": "Register Event",
"event_data": {
// "event_count": "",
"event_name": this.getData('title'),
"identifier": href
}
});
},
contactUsCompleted: function (formId) {
var contactPurpose = '';
var author = '';
if ( formId == 1 ) { // experts form
author = this.getData('title');
} else if ( formId == 2 ) { // Donation
contactPurpose = 'Donation';
} else if ( formId == 3 ) { // General contact
contactPurpose = 'General Contact';
// TODO: get purpose from contact form.
} else {
contactPurpose = 'Other';
}
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "contact_us_complete",
"detailed_event": "Contact Us Completed",
"event_data": {
"author": author,
"contact_purpose": contactPurpose,
// "method": ""
}
});
},
algoliaInteraction: function ( event ) {
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": event.key,
"detailed_event": event.label,
"event_data": {
"archived": this.getData('archived'),
"author": this.getData('author'),
"author_id": this.getData('author_id'),
"center": this.getData('center'),
"content_type": this.getData('content_type'),
"historical_url": this.getData('historical_url'),
"language": this.getData('language'),
"original_post_id": this.getData('original_post_id'),
"parent": this.getData('parent'),
"post_id": this.getData('post_id'),
"primary_topic": this.getData('primary_topic'),
"program": this.getData('program'),
"project": this.getData('project'),
"publish_date": this.getData('publish_date'),
"region": this.getData('region'),
"subtype": this.getData('subtype'),
"tag_id": this.getData('tag_id'),
"tags": this.getData('tags'),
"template": this.getData('template'),
"topic": this.getData('topic'),
"type": this.getData('type'),
"word_count": this.getData('word_count'),
"algolia_value": event.value
}
});
},
getData: function( key ) {
if (typeof window.brookings.dataLayer[key] !== 'undefined') {
return window.brookings.dataLayer[key];
}
return '';
}
},
init: function () {
brookingsApp.hubspot.init();
brookingsApp.filters.init();
brookingsApp.document.init();
brookingsApp.dataLayer.init();
},
};
brookingsApp.init();
})(jQuery);;