(()=>{var e={186(e,t,n){"use strict";var r=n(985);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,s,a){if(a!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n,n}},489(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;0!==o--;){var a=s[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},500(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React;var t=n.n(e);const r=window.lodash;var o=n(500),s=n.n(o),a=n(736),i=n.n(a);function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}function u(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const d=window.ReactDOM;var p=n.n(d);const f=t().createContext(null);var m=function(e){return e.scrollTop},h="unmounted",E="exited",b="entering",g="entered",v="exiting",w=function(e){function n(t,n){var r;r=e.call(this,t,n)||this;var o,s=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?s?(o=E,r.appearStatus=b):o=g:o=t.unmountOnExit||t.mountOnEnter?h:E,r.state={status:o},r.nextCallback=null,r}c(n,e),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===h?{status:E}:null};var r=n.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==b&&n!==g&&(t=b):n!==b&&n!==g||(t=v)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},r.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===b){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:p().findDOMNode(this);n&&m(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===E&&this.setState({status:h})},r.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[p().findDOMNode(this),r],s=o[0],a=o[1],i=this.getTimeouts(),l=r?i.appear:i.enter;e||n?(this.props.onEnter(s,a),this.safeSetState({status:b},function(){t.props.onEntering(s,a),t.onTransitionEnd(l,function(){t.safeSetState({status:g},function(){t.props.onEntered(s,a)})})})):this.safeSetState({status:g},function(){t.props.onEntered(s)})},r.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:p().findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:v},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:E},function(){e.props.onExited(r)})})})):this.safeSetState({status:E},function(){e.props.onExited(r)})},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:p().findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=o[0],a=o[1];this.props.addEndListener(s,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===h)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,u(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t().createElement(f.Provider,{value:null},"function"==typeof r?r(e,o):t().cloneElement(t().Children.only(r),o))},n}(t().Component);function S(){}w.contextType=f,w.propTypes={},w.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:S,onEntering:S,onEntered:S,onExit:S,onExiting:S,onExited:S},w.UNMOUNTED=h,w.EXITED=E,w.ENTERING=b,w.ENTERED=g,w.EXITING=v;const C=w;var y,O,x="out-in",N="in-out",A=function(e,t,n){return function(){var r;e.props[t]&&(r=e.props)[t].apply(r,arguments),n()}},R=((y={})[x]=function(e){var n=e.current,r=e.changeState;return t().cloneElement(n,{in:!1,onExited:A(n,"onExited",function(){r(b,null)})})},y[N]=function(e){var n=e.current,r=e.changeState,o=e.children;return[n,t().cloneElement(o,{in:!0,onEntered:A(o,"onEntered",function(){r(b)})})]},y),k=((O={})[x]=function(e){var n=e.children,r=e.changeState;return t().cloneElement(n,{in:!0,onEntered:A(n,"onEntered",function(){r(g,t().cloneElement(n,{in:!0}))})})},O[N]=function(e){var n=e.current,r=e.children,o=e.changeState;return[t().cloneElement(n,{in:!1,onExited:A(n,"onExited",function(){o(g,t().cloneElement(r,{in:!0}))})}),t().cloneElement(r,{in:!0})]},O),T=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),o=0;o(0,e.createElement)("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("g",{clipPath:"url(#clipThumbsUp)"},(0,e.createElement)("mask",{id:"maskThumbsUp","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"-1",width:"20",height:"20"},(0,e.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.35 6.24998H13.5658L14.4366 2.06081L14.4641 1.76748C14.4641 1.39165 14.3083 1.04331 14.0608 0.795813L13.0891 -0.166687L7.05748 5.87415C6.71831 6.20415 6.51664 6.66248 6.51664 7.16665L2.84998 7.16665V16.425H6.51664V16.3333C6.51664 17.3416 7.34164 18.1666 8.34998 18.1666H16.6C17.3608 18.1666 18.0116 17.7083 18.2866 17.0483L21.055 10.5858C21.1375 10.375 21.1833 10.155 21.1833 9.91665V8.08331C21.1833 7.07498 20.3583 6.24998 19.35 6.24998ZM19.35 9.91665L16.6 16.3333H8.34998V7.16665L12.3283 3.18831L11.3108 8.08331H19.35V9.91665Z",fill:"white"})),(0,e.createElement)("g",{mask:"url(#maskThumbsUp)"},(0,e.createElement)("rect",{x:"0.999878",y:"-3.05176e-05",width:"22",height:"22",fill:n}))),(0,e.createElement)("defs",null,(0,e.createElement)("clipPath",{id:"clipThumbsUp"},(0,e.createElement)("rect",{width:"24",height:"24",fill:"white"})))),j=({className:t,fillColor:n="black"})=>(0,e.createElement)("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("g",{clipPath:"url(#clipThumbsDown)"},(0,e.createElement)("mask",{id:"maskThumbsDown","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"5",width:"20",height:"20"},(0,e.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.65002 17.75H10.4342L9.56336 21.9392L9.53586 22.2325C9.53586 22.6083 9.69169 22.9567 9.93919 23.2042L10.9109 24.1667L16.9425 18.1258C17.2817 17.7958 17.4834 17.3375 17.4834 16.8333L21.15 16.8333L21.15 7.57499H17.4834V7.66666C17.4834 6.65832 16.6584 5.83332 15.65 5.83332H7.40003C6.63919 5.83332 5.98836 6.29165 5.71336 6.95166L2.94503 13.4142C2.86253 13.625 2.81669 13.845 2.81669 14.0833V15.9167C2.81669 16.925 3.64169 17.75 4.65002 17.75ZM4.65002 14.0833L7.40002 7.66666H15.65L15.65 16.8333L11.6717 20.8117L12.6892 15.9167H4.65002V14.0833Z",fill:"white"})),(0,e.createElement)("g",{mask:"url(#maskThumbsDown)"},(0,e.createElement)("rect",{x:"23.0001",y:"24",width:"22",height:"22",transform:"rotate(-180 23.0001 24)",fill:n}))),(0,e.createElement)("defs",null,(0,e.createElement)("clipPath",{id:"clipThumbsDown"},(0,e.createElement)("rect",{width:"24",height:"24",fill:"white"})))),V=t=>{const{attributes:n,voteCount:o,apiAnswerId:a,onVote:i,disabled:l,isVotedOn:c,hideCount:u,fallbackStyles:d,isInEditor:p}=t,{className:f,type:m}=n,[h,E]=(0,e.useState)(0),b=()=>{!l&&i&&(E(1),i(a))},g="up"===m?U:j,v=((e,...t)=>s()({"has-bg-color":e.backgroundColor,"has-text-color":e.textColor,"has-border-color":e.borderColor},t))(n,"crowdsignal-forms-vote-item",f,{"is-voted-on":c,"is-disabled":l,"is-in-editor":p},`is-type-${m}`),w=((e,t)=>{const n=(0,r.isEmpty)(e.textColor)?t.textColor:e.textColor,o=(0,r.isEmpty)(e.backgroundColor)?t.backgroundColor:e.backgroundColor;return(0,r.mapKeys)({borderColor:e.borderColor,bgColor:o,textColor:n,votedColor:t.accentColor},(e,t)=>`--crowdsignal-forms-vote-${(0,r.kebabCase)(t)}`)})(n,d),S=o+h;return(0,e.createElement)("div",{className:v,onClick:b,onKeyPress:b,role:"button",style:w,tabIndex:0},(0,e.createElement)(g,{className:"crowdsignal-forms-vote-item__icon",fillColor:"currentColor"}),!u&&(0,e.createElement)(L,{mode:"in-out"},(0,e.createElement)(M,{key:h,classNames:"crowdsignal-forms-vote-item__count",timeout:300},(0,e.createElement)("div",{className:"crowdsignal-forms-vote-item__count"},(C=S)?C>=1e7?`${(0,r.round)(C/1e6)}M`:C>=1e6?`${(C/1e6).toFixed(1)}M`:C>=1e4?`${(0,r.round)(C/1e3)}K`:C>=1e3?`${(C/1e3).toFixed(1)}K`:C.toString():"0"))));var C};V.propTypes={apiAnswerId:i().number,className:i().string,disabled:i().bool,isVotedOn:i().bool,onVote:i().func,type:i().string.isRequired,voteCount:i().number.isRequired};const F=V;function B(e){for(var t=1;t{const{data:r,error:o,loading:s}=((r,o)=>{const[s,a]=(0,e.useState)(null),[i,l]=(0,e.useState)(null),[c,u]=(0,e.useState)(!0);return(0,e.useEffect)(()=>{u(!0),l(null),a(null),(async(e,t=!0)=>t?window.fetch(`https://api.crowdsignal.com/v3/polls/${e}/results`,{method:"GET",headers:{"content-type":"application/json"}}).then(e=>{if(e.status>=200&&e.status<300)return e.json();throw e}).then(e=>{if(404===e.status)return{};if(e.error)throw new Error(e.message);return e.results.votes_by_answer}):null)(t,n).then(a).catch(l).finally(()=>u(!1))},o),{data:s,error:i,loading:c}})(0,[t]);return{error:o,loading:s,results:r}};var K=n(489),q=n.n(K);const Y=window.wp.element,J=window.wp.compose,Z=e=>{let t=window.getComputedStyle(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===window.Node.ELEMENT_NODE;)e=e.parentNode,t=window.getComputedStyle(e).backgroundColor;return t},X=()=>(0,e.createElement)("div",{className:"crowdsignal-forms__style-probe"},(0,e.createElement)("p",null),(0,e.createElement)("h3",null,"Text"),(0,e.createElement)("div",{className:"wp-block-button"},(0,e.createElement)("div",{className:"wp-block-button__link"})),(0,e.createElement)("div",{className:"entry-content"},(0,e.createElement)("div",{className:"alignwide"}))),Q=e=>{if(null===e)return{};const t=e.querySelector(".wp-block-button__link"),n=e.querySelector("p"),r=e.querySelector("h3"),o=e.querySelector(".alignwide");let s=Z(t);const a=Z(n),i=window.getComputedStyle(n).color;if(s===a){s=(l=t,"0px"!==window.getComputedStyle(l).borderBlockStartWidth?window.getComputedStyle(l).borderBlockStartColor:null)||i}var l;return{accentColor:s,backgroundColor:a,textColor:i,textColorInverted:window.getComputedStyle(t).color,textFont:window.getComputedStyle(n).fontFamily,textSize:window.getComputedStyle(n).fontSize,headingFont:window.getComputedStyle(r).fontFamily,contentWideWidth:window.getComputedStyle(o).maxWidth}},ee=({showBranding:t,referralCode:n})=>(0,e.createElement)("div",{className:"crowdsignal-forms__branding"},t&&(0,e.createElement)("a",{className:"crowdsignal-forms__branding-link with-external-icon",href:`https://crowdsignal.com?ref=${n}`,target:"blank",rel:"noopener noreferrer"},(0,$.__)("Powered by Crowdsignal","crowdsignal-forms")),!t&&(0,e.createElement)("span",{className:"crowdsignal-forms__branding-link"}," "));ee.propTypes={showBranding:i().bool,referralCode:i().string.isRequired};const te=ee,ne=(window.wp.blocks,Object.freeze({THANK_YOU:"thank-you",CUSTOM_TEXT:"custom-text",REDIRECT:"redirect",RESULTS:"results"}),Object.freeze({THEME_DEFAULT:"theme-default",GEORGIA:"georgia",PALATINO:"palatino",TIMES_NEW_ROMAN:"times-new-roman",ARIAL:"arial",IMPACT:"impact",LUCIDA:"lucida",TAHOMA:"tahoma",TREBUCHET:"trebuchet",VERDANA:"verdana",COURIER:"courier",CABIN:"Cabin",CHIVO:"Chivo",OPEN_SANS:"Open+Sans",FIRA_SANS:"Fira+Sans",ROBOTO:"Roboto",NUNITO:"Nunito",OVERPASS:"Overpass",LATO:"Lato",LIBRE_FRANKLIN:"Libre+Franklin",MONTSERRAT:"Montserrat",POPPINS:"Poppins",RUBIK:"Rubik",RALEWAY:"Raleway",JOSEFIN_SANS:"Josefin+Sans",ALEGREYA_SANS:"Alegreya+Sans",OSWALD:"Oswald"})),re=(Object.freeze([ne.CABIN,ne.CHIVO,ne.OPEN_SANS,ne.FIRA_SANS,ne.ROBOTO,ne.NUNITO,ne.OVERPASS,ne.LATO,ne.LIBRE_FRANKLIN,ne.MONTSERRAT,ne.POPPINS,ne.RUBIK,ne.RALEWAY,ne.JOSEFIN_SANS,ne.ALEGREYA_SANS,ne.OSWALD]),Object.freeze({[ne.THEME_DEFAULT]:null,[ne.GEORGIA]:"Georgia, serif",[ne.PALATINO]:'"Palatino Linotype", "Book Antiqua", Palatino, serif',[ne.TIMES_NEW_ROMAN]:'"Times New Roman", Times, serif',[ne.ARIAL]:"Arial, Helvetica, sans-serif",[ne.IMPACT]:"Impact, Charcoal, sans-serif",[ne.LUCIDA]:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',[ne.TAHOMA]:"Tahoma, Geneva, sans-serif",[ne.TREBUCHET]:'"Trebuchet MS", Helvetica, sans-serif',[ne.VERDANA]:"Verdana, Geneva, sans-serif",[ne.COURIER]:'"Courier New", Courier, monospace',[ne.CABIN]:'"Cabin", sans-serif',[ne.CHIVO]:'"Chivo", sans-serif',[ne.OPEN_SANS]:'"Open Sans", sans-serif',[ne.FIRA_SANS]:'"Fira Sans", sans-serif',[ne.ROBOTO]:'"Roboto", sans-serif',[ne.NUNITO]:'"Nunito", sans-serif',[ne.OVERPASS]:'"Overpass", sans-serif',[ne.LATO]:'"Lato", sans-serif',[ne.LIBRE_FRANKLIN]:'"Libre Franklin", sans-serif',[ne.MONTSERRAT]:'"Montserrat", sans-serif',[ne.POPPINS]:'"Poppins", sans-serif',[ne.RUBIK]:'"Rubik", sans-serif',[ne.RALEWAY]:'"Raleway", sans-serif',[ne.JOSEFIN_SANS]:'"Josefin Sans", sans-serif',[ne.ALEGREYA_SANS]:'"Alegreya Sans", sans-serif',[ne.OSWALD]:'"Oswald", sans-serif'}),Object.freeze({OPEN:"open",CLOSED:"closed",CLOSED_AFTER:"closed-after"})),oe=(Object.freeze({SHOW_RESULTS:"show-results",SHOW_CLOSED_BANNER:"show-closed-banner",HIDDEN:"hidden"}),Object.freeze({RADIO:"radio",BUTTON:"button"}),Object.freeze({LIST:"list",INLINE:"inline"}),ae=({attributes:t,fallbackStyles:n,renderStyleProbe:o})=>{const a=t.apiPollData.id,[i,l]=(0,e.useState)(0),{hasVoted:c,vote:u,storedCookieValue:d}=((t,n=!1,r=!1)=>{const o=`cs-poll-${t}`,[s,a]=(0,e.useState)(!1),[i,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)("");return(0,e.useEffect)(()=>{n&&void 0!==H.get(o)&&(l(!0),u(H.get(o)))},[]),{hasVoted:i,isVoting:s,vote:async(e,s=1)=>{try{a(!0);const i=await(async e=>{const t=(new Date).getTime(),n=await window.fetch(`https://poll.fm/n/5430eeac3911395001d731d9702fc38b/${e}?${t}&format=json`);if(!n.ok)throw new z;const r=await n.json();if(!r.nonce)throw new z;return r.nonce})(t);if(await(async(e,t,n,r)=>{const o=n.join(","),s=await window.fetch(`https://polls.polldaddy.com/vote-js.php?format=json&p=${t}&b=1&a=${o}&o=&va=16&cookie=0&n=${e}&url=${encodeURIComponent(window.location)}&vi=${r}`);if(!s.ok)throw new z;const a=await s.json();if("error"===a.status)throw new W(a.error)})(i,t,e,s),l(!0),n){const t=r?e.join(","):(new Date).getTime();H.set(o,t,{sameSite:"Strict",expires:365}),u(t)}}finally{a(!1)}},storedCookieValue:c}})(a,!0,!0),{results:p}=G(a,!t.hideResults);(0,e.useEffect)(()=>{""!==d&&l(parseInt(d.split(",")[0],10))},[d]);const f=async e=>{l(e),await u([e])},m=s()("crowdsignal-forms-vote",t.className,`size-${t.size}`),h=(0,r.zipObject)((0,r.map)(t.apiPollData.answers,"client_id"),(0,r.map)(t.apiPollData.answers,"id")),E=(e=>(0,r.mapKeys)({borderRadius:`${e.borderRadius}px`,borderWidth:`${e.borderWidth}px`},(e,t)=>`--crowdsignal-forms-vote-${(0,r.kebabCase)(t)}`))(t),b=((e,t,n=new Date)=>re.CLOSED===e||re.CLOSED_AFTER===e&&new Date(t){const o=h[r.answerId];return(0,e.createElement)(F,{attributes:r,fallbackStyles:n,key:r.answerId,apiAnswerId:o,onVote:f,disabled:c||0!==i||b,isVotedOn:o===i,voteCount:p?p[o]:0,hideCount:t.hideResults,type:r.type})})),(0,e.createElement)(te,{showBranding:c&&!t.hideBranding,referralCode:"cs-forms-vote"}),o())},(se=e=>({fallbackStyles:Q(e.querySelector(".crowdsignal-forms__style-probe"))}),(0,J.createHigherOrderComponent)(t=>class extends Y.Component{constructor(e){super(e),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:e,fallbackStyles:t}=this.state;if(this.nodeRef&&!e){const e=se(this.nodeRef,this.props);q()(e,t)||this.setState({fallbackStyles:e,grabStylesCompleted:Object.values(e).every(Boolean)})}}render(){const n=(0,e.createElement)(t,{...this.props,...this.state.fallbackStyles});return this.props.node?n:(0,e.createElement)("div",{ref:this.bindRef}," ",n," ")}},"withFallbackStyles"))(({fallbackStyles:t,...n})=>(0,e.createElement)(ae,{fallbackStyles:t||{},renderStyleProbe:()=>t?null:(0,e.createElement)(X,null),...n})));var se,ae;const ie=(e,t)=>(0,r.forEach)(document.querySelectorAll(`div[${e}]`),n=>{try{const o=JSON.parse(n.dataset[(0,r.camelCase)(e.substr(5))]),s=t(o,n);n.removeAttribute(e),(0,d.render)(s,n)}catch(t){console.error("Crowdsignal Forms: Failed to parse block data for: %s",e)}}),le=(e,t)=>{((0,r.isEmpty)(window.CrowdsignalMutationObservers)||!0!==window.CrowdsignalMutationObservers[e])&&(new window.MutationObserver(()=>ie(e,t)).observe(document.body,{attributes:!0,attributeFilter:[e],childList:!0,subtree:!0}),(0,r.isEmpty)(window.CrowdsignalMutationObservers)&&(window.CrowdsignalMutationObservers=[]),window.CrowdsignalMutationObservers[e]=!0,ie(e,t))};((e,t)=>{if("complete"===document.readyState||"interactive"===document.readyState)return le(e,t);document.addEventListener("DOMContentLoaded",()=>le(e,t))})("data-crowdsignal-vote",(t,n)=>{const o=[];(0,r.forEach)(n.children,e=>{(0,r.isEmpty)(e.dataset.crowdsignalVoteItem)||o.push(JSON.parse(e.dataset.crowdsignalVoteItem))});const s={...t,innerBlocks:o};return(0,e.createElement)(oe,{attributes:s})})})()})();; /** * Comment Likes - JavaScript * * This handles liking and unliking comments, as well as viewing who has * liked a particular comment. * * @dependency Swipe (dynamically loaded when needed) * * @package Comment_Likes * @subpackage JavaScript */ (function () { function init() { let extWin; let extWinCheck; let commentLikeEvent; // Only run once. if (window.comment_likes_loaded) { return; } window.comment_likes_loaded = true; // Client-side cache of who liked a particular comment to avoid // having to hit the server multiple times for the same data. const commentLikeCache = {}; let swipeLibPromise; // Load the Swipe library, if it's not already loaded. function swipeLibLoader() { if (!swipeLibPromise) { swipeLibPromise = new Promise((resolve, reject) => { if (window.Swipe) { resolve(window.Swipe); } else { const swipeScript = document.createElement('script'); swipeScript.src = comment_like_text.swipeUrl; swipeScript.async = true; document.body.appendChild(swipeScript); swipeScript.addEventListener('load', () => resolve(window.Swipe)); swipeScript.addEventListener('error', error => reject(error)); } }); } return swipeLibPromise; } /** * Parse the comment ID from a comment like link. */ function getCommentId(link) { const commentId = link && link.getAttribute('href') && link.getAttribute('href').split('like_comment='); return commentId[1].split('&_wpnonce=')[0]; } /** * Handle an ajax action on the comment like link. */ function handleLinkAction(link, action, commentId, callback) { const nonce = link && link.getAttribute('href') && link.getAttribute('href').split('_wpnonce=')[1]; fetch('/wp-admin/admin-ajax.php', { method: 'POST', body: new URLSearchParams({ action: action, _wpnonce: nonce, like_comment: commentId, blog_id: Number(link.dataset.blog), }), headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest', Accept: 'application/json', 'cache-control': 'no-cache', pragma: 'no-cache', }, }) .then(response => response.json()) .then(callback); } function startPolling() { // Append cookie polling login iframe to this window to wait for user to finish logging in (or cancel) const loginIframe = document.createElement('iframe'); loginIframe.id = 'wp-login-polling-iframe'; loginIframe.src = 'https://wordpress.com/public.api/connect/?iframe=true'; document.body.appendChild(loginIframe); loginIframe.style.display = 'none'; } function stopPolling() { const iframe = document.querySelector('#wp-login-polling-iframe'); if (iframe) { iframe.remove(); } } function hide(el) { if (el && el.style) { el.style.display = 'none'; } } function show(el) { if (el && el.style) { el.style.removeProperty('display'); } } // Overlay used for displaying comment like info. class Overlay { constructor() { // Overlay element. this.el = document.createElement('div'); this.el.classList.add('comment-likes-overlay'); document.body.appendChild(this.el); hide(this.el); this.el.addEventListener('mouseenter', () => { // Don't hide the overlay if the user is mousing over it. overlay.cancelHide(); }); this.el.addEventListener('mouseleave', () => overlay.requestHide()); // Inner contents of overlay. this.innerEl = null; // Instance of the Swipe library. this.swipe = null; // Timeout used for hiding the overlay. this.hideTimeout = null; } // Initialise the overlay for use, removing any old content. clear() { // Unload any previous instance of Swipe (to avoid leaking a global // event handler). This is done before clearing the contents of the // overlay because Swipe expects the slides to still be present. if (this.swipe) { this.swipe.kill(); this.swipe = null; } this.el.innerHTML = ''; this.innerEl = document.createElement('div'); this.innerEl.classList.add('inner'); this.el.appendChild(this.innerEl); } /** * Construct a list (
    ) of user (gravatar, name) details. * * @param data liker data returned from the server * @param klass CSS class to apply to the
      element * @param start index of user to start at * @param length number of users to include in the list * * @return A container element with the list */ getUserBits(data, klass, start, length) { start = start || 0; let last = start + (length || data.length); last = last > data.length ? data.length : last; const container = document.createElement('div'); container.classList.add('liker-list'); let html = `'; container.innerHTML = html; return container; } /** * Render the display of who has liked this comment. The type of * display depends on how many people have liked the comment. * If more than 10 people have liked the comment, this function * renders navigation controls and sets up the Swipe library for * changing between pages. * * @param link the element over which the user is hovering * @param data the results retrieved from the server */ showLikes(link, data) { this.clear(); link.dataset.likeCount = data.length; if (data.length === 0) { // No likers after all. hide(this.el); return; } this.innerEl.style.padding = '12px'; if (data.length < 6) { // Only one column needed. this.innerEl.style.maxWidth = '200px'; this.innerEl.innerHTML = ''; this.innerEl.appendChild(this.getUserBits(data, 'single')); this.setPosition(link); } else if (data.length < 11) { // Two columns, but only one page. this.innerEl.innerHTML = ''; this.innerEl.appendChild(this.getUserBits(data, 'double')); this.setPosition(link); } else { // Multiple pages. this.renderLikesWithPagination(data, link); } } /** * Render multiple pages of likes with pagination controls. * This function is intended to be called by `showLikes` above. * * @param data the results retrieved from the server */ renderLikesWithPagination(data, link) { swipeLibLoader().then(() => { const page_count = Math.ceil(data.length / 10); // Swipe requires two nested containers. const swipe = document.createElement('div'); swipe.classList.add('swipe'); this.innerEl.appendChild(swipe); const wrap = document.createElement('div'); wrap.classList.add('swipe-wrap'); swipe.appendChild(wrap); for (let i = 0; i < page_count; ++i) { wrap.appendChild(this.getUserBits(data, 'double', i * 10, 10)); } /** * Navigation controls. * This is based on the Newdash controls found in * reader/recommendations-templates.php */ const nav = document.createElement('nav'); nav.classList.add('slider-nav'); let navContents = ` `; for (let i = 0; i < page_count; ++i) { navContents += ``; } navContents += ` `; this.innerEl.appendChild(nav); nav.innerHTML = navContents; /** Set up Swipe. **/ // Swipe cannot be set up successfully unless its container // is visible, so we show it now. show(this.el); this.setPosition(link); this.swipe = new Swipe(swipe, { callback: function (pos) { // Update the pagination indicators. // // If there are exactly two pages, Swipe has a weird // special case where it duplicates both pages and // can return index 2 and 3 even though those aren't // real pages (see swipe.js, line 47). To deal with // this, we use the expression `pos % page_count`. pos = pos % page_count; nav.querySelectorAll('em').forEach(em => { const page = Number(em.dataset.page); em.setAttribute('class', pos === page ? 'on' : ''); }); }, }); nav.querySelectorAll('em').forEach(em => { em.addEventListener('click', e => { // Go to the page corresponding to the indicator clicked. this.swipe.slide(Number(em.dataset.page)); e.preventDefault(); }); }); // Previous and next buttons. nav.querySelector('.prev').addEventListener('click', e => { this.swipe.prev(); e.preventDefault(); }); nav.querySelector('.next').addEventListener('click', e => { this.swipe.next(); e.preventDefault(); }); }); } /** * Open the overlay and show a loading message. */ showLoadingMessage(link) { this.clear(); this.innerEl.textContent = comment_like_text.loading; this.setPosition(link); } /** * Position the overlay near the current comment. * * @param link element near which to position the overlay */ setPosition(link) { // Prepare a down arrow icon for the bottom of the overlay. const icon = document.createElement('span'); this.el.appendChild(icon); icon.classList.add('icon', 'noticon', 'noticon-downarrow'); icon.style.textShadow = '0px 1px 1px rgb(223, 223, 223)'; const rect = link.getBoundingClientRect(); const win = document.defaultView; const offset = { top: rect.top + win.scrollY, left: rect.left + win.scrollX, }; // Take measurements with the element fully visible. show(this.el); let left = offset.left - (this.el.offsetWidth - link.offsetWidth) / 2; left = left < 5 ? 5 : left; let top = offset.top - this.el.offsetHeight + 5; hide(this.el); const adminBar = document.querySelector('#wpadminbar'); // Check if the overlay would appear off the screen. if (top < win.scrollY + ((adminBar && adminBar.offsetHeight) || 0)) { // We'll display the overlay beneath the link instead. top = offset.top + link.offsetHeight; // Instead of using the down arrow icon, use an up arrow. icon.remove(); this.el.prepend(icon); icon.classList.remove('noticon-downarrow'); icon.classList.add('noticon-uparrow'); icon.style.textShadow = '0px -1px 1px rgb(223, 223, 223)'; icon.style.verticalAlign = 'bottom'; } this.el.style.left = `${left}px`; this.el.style.top = `${top}px`; show(this.el); // The height of the arrow icon differs slightly between browsers, // so we compute the margin here to make sure it isn't disjointed // from the overlay. icon.style.marginTop = `${icon.scrollHeight - 26}px`; icon.style.marginBottom = `${20 - icon.scrollHeight}px`; // Position the arrow to be horizontally centred on the link. icon.style.paddingLeft = `${ offset.left - left + (link.offsetWidth - icon.scrollWidth) / 2 }px`; } /** * Return whether the overlay is visible. */ isVisible() { return this.el.style.getPropertyValue('display') !== 'none'; } /** * Request that the overlay be hidden after a short delay. */ requestHide() { if (this.hideTimeout !== null) { return; } this.hideTimeout = setTimeout(() => { hide(this.el); this.clear(); }, 300); } /** * Cancel a request to hide the overlay. */ cancelHide() { if (this.hideTimeout !== null) { clearTimeout(this.hideTimeout); this.hideTimeout = null; } } } // Overlay used for displaying comment like info. const overlay = new Overlay(); // The most recent comment for which the user has requested to see // who liked it. var relevantComment; // Precache after this timeout. var precacheTimeout = null; /** * Fetch the like data for a particular comment. */ function fetchLikeData(link, commentId) { commentLikeCache[commentId] = null; const container = link && link.parentElement && link.parentElement.parentElement; const star = container.querySelector('a.comment-like-link'); star && handleLinkAction(star, 'view_comment_likes', commentId, data => { // Populate the cache. commentLikeCache[commentId] = data; // Only show the overlay if the user is interested. if (overlay.isVisible() && relevantComment === commentId) { overlay.showLikes(link, data); } }); } function readCookie(c) { const nameEQ = c + '='; const cookieStrings = document.cookie.split(';'); for (let i = 0; i < cookieStrings.length; i++) { let cookieString = cookieStrings[i]; while (cookieString.charAt(0) === ' ') { cookieString = cookieString.substring(1, cookieString.length); } if (cookieString.indexOf(nameEQ) === 0) { const chunk = cookieString.substring(nameEQ.length, cookieString.length); const pairs = chunk.split('&'); const cookieData = {}; for (let num = pairs.length - 1; num >= 0; num--) { const pair = pairs[num].split('='); cookieData[pair[0]] = decodeURIComponent(pair[1]); } return cookieData; } } return null; } function getServiceData() { const data = readCookie('wpc_wpc'); if (data === null || typeof data.access_token === 'undefined' || !data.access_token) { return false; } return data; } function readMessage(msg) { const event = msg.data; if (typeof event.event === 'undefined') { return; } if (event.event === 'login' && event.success) { extWinCheck = setInterval(function () { if (!extWin || extWin.closed) { clearInterval(extWinCheck); if (getServiceData()) { // Load page in an iframe to get the current comment nonce const nonceIframe = document.createElement('iframe'); nonceIframe.id = 'wp-login-comment-nonce-iframe'; nonceIframe.style.display = 'none'; nonceIframe.src = commentLikeEvent + ''; document.body.appendChild(nonceIframe); const commentLikeId = (commentLikeEvent + '') .split('like_comment=')[1] .split('&_wpnonce=')[0]; let c; // Set a 5 second timeout to redirect to the comment page without doing the Like as a fallback const commentLikeTimeout = setTimeout(() => { window.location = commentLikeEvent; }, 5000); // Check for a new nonced redirect and use that if available before timing out const commentLikeCheck = setInterval(() => { const iframe = document.querySelector('#wp-login-comment-nonce-iframe'); if (iframe) { c = iframe.querySelector(`#comment-like-${commentLikeId} .comment-like-link`); } if (c && typeof c.href !== 'undefined') { clearTimeout(commentLikeTimeout); clearInterval(commentLikeCheck); window.location = c.href; } }, 100); } } }, 100); if (extWin) { if (!extWin.closed) { extWin.close(); } extWin = false; } stopPolling(); } } if (typeof window.postMessage !== 'undefined') { window.addEventListener('message', e => { let message = e && e.data; if (typeof message === 'string') { try { message = JSON.parse(message); } catch (err) { return; } } const type = message && message.type; if (type === 'loginMessage') { readMessage(message); } }); } document.body.addEventListener('click', e => { let target = e.target; // Don't do anything when clicking on the "X people" link. if (target.matches('p.comment-likes a.view-likers')) { e.preventDefault(); return; } // Retrieve the surrounding paragraph to the star, if it hasn't been liked. const notLikedPar = target.closest('p.comment-not-liked'); // Return if not clicking on star or surrounding paragraph. if (!target.matches('a.comment-like-link') && !notLikedPar) { return; } // When a comment hasn't been liked, make the text clickable, too. if (notLikedPar) { target = notLikedPar.querySelector('a.comment-like-link'); if (!target) { return; } } if (target.classList.contains('needs-login')) { e.preventDefault(); commentLikeEvent = target; if (extWin) { if (!extWin.closed) { extWin.close(); } extWin = false; } stopPolling(); const url = 'https://wordpress.com/public.api/connect/?action=request&service=wordpress'; extWin = window.open( url, 'likeconn', 'status=0,toolbar=0,location=1,menubar=0,directories=0,resizable=1,scrollbars=1,height=560,width=500' ); startPolling(); return false; } // Record that the user likes or does not like this comment. const commentId = getCommentId(target); target.classList.add('loading'); let commentEl = document.querySelector(`p#comment-like-${commentId}`); // Determine whether to like or unlike based on whether the comment is // currently liked. const action = commentEl && commentEl.dataset.liked === 'comment-liked' ? 'unlike_comment' : 'like_comment'; handleLinkAction(target, action, commentId, data => { // Invalidate the like cache for this comment. delete commentLikeCache[commentId]; const countEl = document.querySelector(`#comment-like-count-${data.context}`); if (countEl) { countEl.innerHTML = data.display; } commentEl = document.querySelector(`p#comment-like-${data.context}`); if (action === 'like_comment') { commentEl.classList.remove('comment-not-liked'); commentEl.classList.add('comment-liked'); commentEl.dataset.liked = 'comment-liked'; } else { commentEl.classList.remove('comment-liked'); commentEl.classList.add('comment-not-liked'); commentEl.dataset.liked = 'comment-not-liked'; } // Prefetch new data for this comment (if there are likers left). const parent = target.closest('.comment-likes'); const link = parent && parent.querySelector('a.view-likers'); if (link) { fetchLikeData(link, commentId); } target.classList.remove('loading'); }); e.preventDefault(); e.stopPropagation(); }); document.body.addEventListener( 'mouseenter', function (e) { if (!e.target.matches('p.comment-likes a.view-likers')) { return; } // Show the user a list of who has liked this comment. const link = e.target; if (Number(link.dataset.likeCount || 0) === 0) { // No one has liked this comment. return; } // Don't hide the overlay. overlay.cancelHide(); // Get the comment ID. const container = link.parentElement && link.parentElement.parentElement; const star = container && container.querySelector('a.comment-like-link'); const commentId = star && getCommentId(star); relevantComment = commentId; // Check if the list of likes for this comment is already in // the cache. if (commentId in commentLikeCache) { const entry = commentLikeCache[commentId]; // Only display the likes if the ajax request is // actually done. if (entry !== null) { overlay.showLikes(link, entry); } else { // Make sure the overlay is visible (in case // the user moved the mouse away while loading // but then came back before it finished // loading). overlay.showLoadingMessage(link); } return; } // Position the "Loading..." overlay. overlay.showLoadingMessage(link); // Fetch the data. fetchLikeData(link, commentId); }, true ); document.body.addEventListener( 'mouseleave', e => { if (!e.target.matches('p.comment-likes a.view-likers')) { return; } // User has moved cursor away - hide the overlay. overlay.requestHide(); }, true ); document.body.addEventListener( 'mouseenter', e => { if (!e.target.matches('.comment') || !e.target.querySelector('a.comment-like-link')) { return; } // User is moving over a comment - precache the comment like data. if (precacheTimeout !== null) { clearTimeout(precacheTimeout); precacheTimeout = null; } const star = e.target.querySelector('a.comment-like-link'); const parent = star.closest('.comment-likes'); const link = parent && parent.querySelector('a.view-likers'); if (!link || Number(link.dataset.likeCount || 0) === 0) { // No likes. return; } const commentId = getCommentId(star); if (commentId in commentLikeCache) { // Already in cache. return; } precacheTimeout = setTimeout(() => { precacheTimeout = null; if (commentId in commentLikeCache) { // Was cached in the interim. return; } fetchLikeData(link, commentId); }, 1000); }, true ); } if (document.readyState !== 'loading') { init(); } else { document.addEventListener('DOMContentLoaded', init); } })(); ; !function(){"use strict";var e,n,t={998:function(e,n,t){t.d(n,{B$:function(){return f},NZ:function(){return i},Uq:function(){return a},a3:function(){return l},d6:function(){return c},hA:function(){return u},j4:function(){return s},pM:function(){return o},zq:function(){return r}});var o={NOTICE:"notice",GENERAL_SETTINGS:"general-settings",PURPOSE_SETTINGS:"purpose-settings",VENDORS_SETTINGS:"vendors-settings",HIDDEN:""},r=258,i="en",l={1:!0,2:!0,3:!0,4:!0,7:!0,9:!0,10:!0},u={2:!0,7:!0,9:!0,10:!0},c={UI_SHOWN:"cmpuishown",LOADED:"tcloaded",USER_ACTION_COMPLETE:"useractioncomplete"},a={VISIBLE:"visible",HIDDEN:"hidden",DISABLED:"disabled"},s={STUB:"stub",LOADED:"loaded",ERROR:"error"},f="euconsent-v2"},748:function(e,n,t){t.d(n,{HY:function(){return l.HY},Vx:function(){return I},n4:function(){return V},az:function(){return l.az},ZP:function(){return ie},Gp:function(){return N},Vo:function(){return R},I4:function(){return k},d4:function(){return y},sO:function(){return b},eJ:function(){return h}});var o,r,i,l=t(400),u=0,c=[],a=l.YM.__b,s=l.YM.__r,f=l.YM.diffed,_=l.YM.__c,d=l.YM.unmount;function p(e,n){l.YM.__h&&l.YM.__h(r,e,u||n),u=0;var t=r.__H||(r.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function h(e){return u=1,v(O,e)}function v(e,n,t){var i=p(o++,2);return i.t=e,i.__c||(i.__=[t?t(n):O(void 0,n),function(e){var n=i.t(i.__[0],e);i.__[0]!==n&&(i.__=[n,i.__[1]],i.__c.setState({}))}],i.__c=r),i.__}function y(e,n){var t=p(o++,3);!l.YM.__s&&A(t.__H,n)&&(t.__=e,t.__H=n,r.__H.__h.push(t))}function m(e,n){var t=p(o++,4);!l.YM.__s&&A(t.__H,n)&&(t.__=e,t.__H=n,r.__h.push(t))}function b(e){return u=5,g((function(){return{current:e}}),[])}function g(e,n){var t=p(o++,7);return A(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function k(e,n){return u=8,g((function(){return e}),n)}function C(){for(var e;e=c.shift();)if(e.__P)try{e.__H.__h.forEach(E),e.__H.__h.forEach(w),e.__H.__h=[]}catch(n){e.__H.__h=[],l.YM.__e(n,e.__v)}}l.YM.__b=function(e){r=null,a&&a(e)},l.YM.__r=function(e){s&&s(e),o=0;var n=(r=e.__c).__H;n&&(n.__h.forEach(E),n.__h.forEach(w),n.__h=[])},l.YM.diffed=function(e){f&&f(e);var n=e.__c;n&&n.__H&&n.__H.__h.length&&(1!==c.push(n)&&i===l.YM.requestAnimationFrame||((i=l.YM.requestAnimationFrame)||function(e){var n,t=function(){clearTimeout(o),S&&cancelAnimationFrame(n),setTimeout(e)},o=setTimeout(t,100);S&&(n=requestAnimationFrame(t))})(C)),r=null},l.YM.__c=function(e,n){n.some((function(e){try{e.__h.forEach(E),e.__h=e.__h.filter((function(e){return!e.__||w(e)}))}catch(t){n.some((function(e){e.__h&&(e.__h=[])})),n=[],l.YM.__e(t,e.__v)}})),_&&_(e,n)},l.YM.unmount=function(e){d&&d(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.forEach((function(e){try{E(e)}catch(e){n=e}})),n&&l.YM.__e(n,t.__v))};var S="function"==typeof requestAnimationFrame;function E(e){var n=r,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),r=n}function w(e){var n=r;e.__c=e.__(),r=n}function A(e,n){return!e||e.length!==n.length||n.some((function(n,t){return n!==e[t]}))}function O(e,n){return"function"==typeof n?n(e):n}function P(e,n){for(var t in n)e[t]=n[t];return e}function T(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var o in n)if("__source"!==o&&e[o]!==n[o])return!0;return!1}function I(e){this.props=e}(I.prototype=new l.wA).isPureReactComponent=!0,I.prototype.shouldComponentUpdate=function(e,n){return T(this.props,e)||T(this.state,n)};var L=l.YM.__b;l.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),L&&L(e)};var M="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function N(e){function n(n){var t=P({},n);return delete t.ref,e(t,n.ref||null)}return n.$$typeof=M,n.render=n,n.prototype.isReactComponent=n.__f=!0,n.displayName="ForwardRef("+(e.displayName||e.name)+")",n}var D=function(e,n){return null==e?null:(0,l.bR)((0,l.bR)(e).map(n))},j={map:D,forEach:D,count:function(e){return e?(0,l.bR)(e).length:0},only:function(e){var n=(0,l.bR)(e);if(1!==n.length)throw"Children.only";return n[0]},toArray:l.bR},U=l.YM.__e;l.YM.__e=function(e,n,t,o){if(e.then)for(var r,i=n;i=i.__;)if((r=i.__c)&&r.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),r.__c(e,n);U(e,n,t,o)};var H=l.YM.unmount;function V(){this.__u=0,this.t=null,this.__b=null}function x(e){var n=e.__.__c;return n&&n.__e&&n.__e(e)}function R(e){var n,t,o;function r(r){if(n||(n=e()).then((function(e){t=e.default||e}),(function(e){o=e})),o)throw o;if(!t)throw n;return(0,l.az)(t,r)}return r.displayName="Lazy",r.__f=!0,r}function Y(){this.u=null,this.o=null}l.YM.unmount=function(e){var n=e.__c;n&&n.__R&&n.__R(),n&&!0===e.__h&&(e.type=null),H&&H(e)},(V.prototype=new l.wA).__c=function(e,n){var t=n.__c,o=this;null==o.t&&(o.t=[]),o.t.push(t);var r=x(o.__v),i=!1,l=function(){i||(i=!0,t.__R=null,r?r(u):u())};t.__R=l;var u=function(){if(!--o.__u){if(o.state.__e){var e=o.state.__e;o.__v.__k[0]=function e(n,t,o){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map((function(n){return e(n,t,o)})),n.__c&&n.__c.__P===t&&(n.__e&&o.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=o)),n}(e,e.__c.__P,e.__c.__O)}var n;for(o.setState({__e:o.__b=null});n=o.t.pop();)n.forceUpdate()}},c=!0===n.__h;o.__u++||c||o.setState({__e:o.__b=o.__v.__k[0]}),e.then(l,l)},V.prototype.componentWillUnmount=function(){this.t=[]},V.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(n,t,o){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),n.__c.__H=null),null!=(n=P({},n)).__c&&(n.__c.__P===o&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map((function(n){return e(n,t,o)}))),n}(this.__b,t,o.__O=o.__P)}this.__b=null}var r=n.__e&&(0,l.az)(l.HY,null,e.fallback);return r&&(r.__h=null),[(0,l.az)(l.HY,null,n.__e?null:e.children),r]};var B=function(e,n,t){if(++t[1]===t[0]&&e.o.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(t=e.u;t;){for(;t.length>3;)t.pop()();if(t[1]>>1,1),n.i.removeChild(e)}}),(0,l.sY)((0,l.az)(F,{context:n.context},e.__v),n.l)):n.l&&n.componentWillUnmount()}(Y.prototype=new l.wA).__e=function(e){var n=this,t=x(n.__v),o=n.o.get(e);return o[0]++,function(r){var i=function(){n.props.revealOrder?(o.push(r),B(n,e,o)):r()};t?t(i):i()}},Y.prototype.render=function(e){this.u=null,this.o=new Map;var n=(0,l.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.o.set(n[t],this.u=[1,0,this.u]);return e.children},Y.prototype.componentDidUpdate=Y.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(n,t){B(e,t,n)}))};var q="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,W=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,G="undefined"!=typeof document,$=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};l.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(l.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}));var Z=l.YM.event;function J(){}function X(){return this.cancelBubble}function Q(){return this.defaultPrevented}l.YM.event=function(e){return Z&&(e=Z(e)),e.persist=J,e.isPropagationStopped=X,e.isDefaultPrevented=Q,e.nativeEvent=e};var K,ee={configurable:!0,get:function(){return this.class}},ne=l.YM.vnode;l.YM.vnode=function(e){var n=e.type,t=e.props,o=t;if("string"==typeof n){var r=-1===n.indexOf("-");for(var i in o={},t){var u=t[i];G&&"children"===i&&"noscript"===n||"value"===i&&"defaultValue"in t&&null==u||("defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===u?u="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+n)&&!$(t.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():r&&W.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===u&&(u=void 0),o[i]=u)}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,l.bR)(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=(0,l.bR)(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o,t.class!=t.className&&(ee.enumerable="className"in t,null!=t.className&&(o.class=t.className),Object.defineProperty(o,"className",ee))}e.$$typeof=q,ne&&ne(e)};var te=l.YM.__r;l.YM.__r=function(e){te&&te(e),K=e.__c};var oe={ReactCurrentDispatcher:{current:{readContext:function(e){return K.__n[e.__c].props.value}}}};function re(e){return!!e&&e.$$typeof===q}l.HY;var ie={useState:h,useReducer:v,useEffect:y,useLayoutEffect:m,useRef:b,useImperativeHandle:function(e,n,t){u=6,m((function(){return"function"==typeof e?(e(n()),function(){return e(null)}):e?(e.current=n(),function(){return e.current=null}):void 0}),null==t?t:t.concat(e))},useMemo:g,useCallback:k,useContext:function(e){var n=r.context[e.__c],t=p(o++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(r)),n.props.value):e.__},useDebugValue:function(e,n){l.YM.useDebugValue&&l.YM.useDebugValue(n?n(e):e)},version:"17.0.2",Children:j,render:function(e,n,t){return null==n.__k&&(n.textContent=""),(0,l.sY)(e,n),"function"==typeof t&&t(),e?e.__c:null},hydrate:function(e,n,t){return(0,l.ZB)(e,n),"function"==typeof t&&t(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&((0,l.sY)(null,e),!0)},createPortal:function(e,n){return(0,l.az)(z,{__v:e,i:n})},createElement:l.az,createContext:l.kr,createFactory:function(e){return l.az.bind(null,e)},cloneElement:function(e){return re(e)?l.Tm.apply(null,arguments):e},createRef:l.Vf,Fragment:l.HY,isValidElement:re,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:l.wA,PureComponent:I,memo:function(e,n){function t(e){var t=this.props.ref,o=t==e.ref;return!o&&t&&(t.call?t(null):t.current=null),n?!n(this.props,e)||!o:T(this.props,e)}function o(n){return this.shouldComponentUpdate=t,(0,l.az)(e,n)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o},forwardRef:N,flushSync:function(e,n){return e(n)},unstable_batchedUpdates:function(e,n){return e(n)},StrictMode:l.HY,Suspense:V,SuspenseList:Y,lazy:R,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:oe}},400:function(e,n,t){t.d(n,{HY:function(){return m},Tm:function(){return R},Vf:function(){return y},YM:function(){return r},ZB:function(){return x},az:function(){return h},bR:function(){return A},h:function(){return h},kr:function(){return Y},sY:function(){return V},wA:function(){return b}});var o,r,i,l,u,c,a,s={},f=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,n){for(var t in n)e[t]=n[t];return e}function p(e){var n=e.parentNode;n&&n.removeChild(e)}function h(e,n,t){var r,i,l,u={};for(l in n)"key"==l?r=n[l]:"ref"==l?i=n[l]:u[l]=n[l];if(arguments.length>2&&(u.children=arguments.length>3?o.call(arguments,2):t),"function"==typeof e&&null!=e.defaultProps)for(l in e.defaultProps)void 0===u[l]&&(u[l]=e.defaultProps[l]);return v(e,u,r,i,null)}function v(e,n,t,o,l){var u={type:e,props:n,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==l?++i:l};return null==l&&null!=r.vnode&&r.vnode(u),u}function y(){return{current:null}}function m(e){return e.children}function b(e,n){this.props=e,this.context=n}function g(e,n){if(null==n)return e.__?g(e.__,e.__.__k.indexOf(e)+1):null;for(var t;n0?v(h.type,h.props,h.key,null,h.__v):h)){if(h.__=t,h.__b=t.__b+1,null===(p=C[_])||p&&h.key==p.key&&h.type===p.type)C[_]=void 0;else for(d=0;d2&&(u.children=arguments.length>3?o.call(arguments,2):t),v(e.type,u,r||e.key,i||e.ref,null)}function Y(e,n){var t={__c:n="__cC"+a++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var t,o;return this.getChildContext||(t=[],(o={})[n]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(C)},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t}o=f.slice,r={__e:function(e,n,t,o){for(var r,i,l;n=n.__;)if((r=n.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(n){e=n}throw e}},i=0,b.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},t),this.props)),e&&d(t,e),null!=e&&this.__v&&(n&&this.__h.push(n),C(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},b.prototype.render=m,l=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,S.__r=0,a=0}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={id:e,exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,{a:n}),n},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(n,t){return r.f[t](e,n),n}),[]))},r.u=function(e){return{143:"app",571:"settings",664:"notice"}[e]+".bundle.js?id="+{143:"46d60d7bb2d22e26f485",571:"027f8387c2b29d7df161",664:"09a90b609879d5cf593b"}[e]},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},e={},n="a8c-cmp:",r.l=function(t,o,i,l){if(e[t])e[t].push(o);else{var u,c;if(void 0!==i)for(var a=document.getElementsByTagName("script"),s=0;se.length)&&(n=e.length);for(var t=0,o=new Array(n);t0&&void 0!==arguments[0]?arguments[0]:{};w(this,e),this.segmentType=T.SEGMENT_TYPE_DISCLOSED_VENDORS,this.vendors=n}));function O(e,n){for(var t=0;t=2&&r.slice(1).forEach((function(n){var r=new m(o.decode(n));if(e.getSegmentType(r)===e.SEGMENT_TYPE_DISCLOSED_VENDORS){var i=e.decodeFields(e.DisclosedVendorsFieldMap,r);t.vendor.vendorsDisclosed=i.vendors}})),t}},{key:"getSegmentType",value:function(n){var t;return null!==(t=e.decodeFields(e.SegmentFieldMap,n).segmentType)&&void 0!==t?t:null}},{key:"decodeFields",value:function(n,t){var o={};return n.forEach((function(n){if(n.children)o[n.key]=e.decodeFields(n.children,t);else if(void 0===n.bitLength){var r=n.codec.decode(t.peekToEnd());o[n.key]=r.value,t.advance(r.bitLength)}else o[n.key]=n.codec.decode(t.popBits(n.bitLength))})),o}},{key:"serialize",value:function(n){var t="",r=e.encodeFields(e.coreFieldMap,n);t=o.encode(r);var i=e.encodeFields(e.DisclosedVendorsFieldMap,new A(n.vendor.vendorsDisclosed||{}));return t+="."+o.encode(i)}},{key:"encodeFields",value:function(n,t){var o="";return n.forEach((function(n){n.children?o+=e.encodeFields(n.children,t[n.key]):void 0===n.bitLength?o+=n.codec.encode(t[n.key]):o+=n.codec.encode(t[n.key],n.bitLength)})),o}}],(t=null)&&O(n.prototype,t),r&&O(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();P(T,"SEGMENT_TYPE_CORE",0),P(T,"SEGMENT_TYPE_DISCLOSED_VENDORS",1),P(T,"SEGMENT_TYPE_PUBLISHER_TC",3),T.coreFieldMap=[{key:"version",codec:l,bitLength:6},{key:"created",codec:c,bitLength:36},{key:"lastUpdated",codec:c,bitLength:36},{key:"cmpId",codec:l,bitLength:12},{key:"cmpVersion",codec:l,bitLength:12},{key:"consentScreen",codec:l,bitLength:6},{key:"consentLanguage",codec:_,bitLength:12},{key:"vendorListVersion",codec:l,bitLength:12},{key:"tcfPolicyVersion",codec:l,bitLength:6},{key:"isServiceSpecific",codec:p,bitLength:1},{key:"useNonStandardStacks",codec:p,bitLength:1},{key:"specialFeatureOptins",codec:v,bitLength:12},{key:"purpose",children:[{key:"consents",codec:v,bitLength:24},{key:"legitimateInterests",codec:v,bitLength:24}]},{key:"purposeOneTreatment",codec:p,bitLength:1},{key:"publisherCC",codec:_,bitLength:12},{key:"vendor",children:[{key:"consents",codec:C},{key:"legitimateInterests",codec:C}]},{key:"numPubRestrictions",codec:l,bitLength:12}],T.SegmentFieldMap=[{key:"segmentType",codec:l,bitLength:3}],T.DisclosedVendorsFieldMap=[{key:"segmentType",codec:l,bitLength:3},{key:"vendors",codec:C}];var I=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},L=r(998);function M(e,n){for(var t=0;t1&&void 0!==arguments[1]&&arguments[1],i=(0,n.Vo)((function(){return r.e(143).then(r.bind(r,241))}));(0,e.sY)((0,e.h)(n.n4,null,(0,e.h)(i,{model:this.model,acceptAll:this.acceptAllHandler,rejectAll:this.rejectAllHandler,save:this.saveHandler,fetchGlobalVendorList:this.fetchGlobalVendorListHandler,path:this.config.modulePath,_:this.config._,mode:t,noticeAsModal:this.config.noticeAsModal,generalSettingsEnabled:this.config.generalSettingsEnabled,rejectAllEnabled:this.config.rejectAllEnabled,manualClose:this.config.manualClose,closable:o,closed:this.closeHandler,colorsConfig:this.config.colors})),this.getAppContainer())}},{key:"showUi",value:function(){this.displayStatus!==L.Uq.VISIBLE&&(this.renderApp(this.config.generalSettingsEnabled?L.pM.GENERAL_SETTINGS:L.pM.PURPOSE_SETTINGS,!0),this.bumpStat("wordads_cmp_view","cookie"),this.eventStatus=L.d6.UI_SHOWN,this.displayStatus=L.Uq.VISIBLE,this.notify())}},{key:"closeUi",value:function(){(0,e.sY)(null,this.getAppContainer())}},{key:"bumpStat",value:function(e,n){var t={};t["x_"+e]=n,window._stq=window._stq||[],window._stq.push(["extra",t])}},{key:"setConsentCookie",value:function(e){var n;if(!this.config.skipConsentSave){var t=new XMLHttpRequest;t.open("POST",this.config.ajaxUrl||"/wp-admin/admin-ajax.php",!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),(e=null!==(n=e)&&void 0!==n?n:{}).action="gdpr_set_consent",e.security=this.config.ajaxNonce,e.consent=T.serialize(this.model);var o=Object.keys(e).map((function(n){return n+"="+encodeURIComponent(e[n])})).join("&");t.send(o)}}},{key:"fetchGlobalVendorListHandler",value:function(){var e=this,n=new XMLHttpRequest;return new Promise((function(t,o){n.onreadystatechange=function(){4===n.readyState&&(200===this.status?t(JSON.parse(this.response)):o({status:n.status,statusText:n.statusText}))},n.open("GET",e.config.gvlPath,!0),n.send()}))}},{key:"acceptAllHandler",value:function(){this.model=new j(this.config),this.model.purpose={consents:this.config.defaultPurposes,legitimateInterests:L.hA},this.model.vendor={consents:this.config.vendorsAll,legitimateInterests:this.config.vendorsLegInterest,vendorsDisclosed:this.config.vendorsAll},this.model.nonIABVendor={consents:this.config.nonIABVendorsAll||{}},this.model.analyticsConsent=!0,this.eventStatus=L.d6.USER_ACTION_COMPLETE,this.displayStatus=L.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"accept_all"})}},{key:"rejectAllHandler",value:function(){this.model=new j(this.config),this.model.purpose={consents:{},legitimateInterests:L.hA},this.model.vendor={consents:{},legitimateInterests:this.config.vendorsLegInterest,vendorsDisclosed:this.config.vendorsAll},this.model.nonIABVendor={consents:{}},this.model.analyticsConsent=!1,this.eventStatus=L.d6.USER_ACTION_COMPLETE,this.displayStatus=L.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"reject_all"})}},{key:"saveHandler",value:function(e){this.model=new j(this.config),this.model.useConsentFrom(e),this.model.vendor.vendorsDisclosed=this.config.vendorsAll,this.eventStatus=L.d6.USER_ACTION_COMPLETE,this.displayStatus=L.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"custom"})}},{key:"closeHandler",value:function(){this.displayStatus=L.Uq.HIDDEN}},{key:"getTCData",value:function(){return{tcString:T.serialize(this.model),tcfPolicyVersion:this.model.tcfPolicyVersion,cmpId:this.model.cmpId,cmpVersion:this.model.cmpVersion,gdprApplies:!0,eventStatus:this.eventStatus,cmpStatus:this.cmpStatus,isServiceSpecific:this.model.isServiceSpecific,useNonStandardStacks:this.model.useNonStandardStacks,publisherCC:this.model.publisherCC,purposeOneTreatment:this.model.purposeOneTreatment,purpose:this.model.purpose,vendor:this.model.vendor,specialFeatureOptins:this.model.specialFeatureOptins}}},{key:"getNonIABVendorConsents",value:function(){return{gdprApplies:!0,nonIabVendorConsents:this.model.nonIABVendor.consents}}},{key:"getExtraConsents",value:function(){return{gdprApplies:!0,nonIabVendorConsents:this.model.nonIABVendor.consents,analyticsConsent:this.model.analyticsConsent}}},{key:"notify",value:function(){var e=this.getTCData();this.listeners.forEach((function(n){e.listenerId=n.listenerId,n.callback(e,!0)}))}},{key:"addListener",value:function(e){var n=Math.floor(999999*Math.random()),t={listenerId:n,callback:e};return this.listeners.push(t),n}},{key:"removeListener",value:function(e){this.listeners=this.listeners.filter((function(n){return n.listenerId!==e}))}},{key:"commandHandler",value:function(){var e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=2?void 0:arguments[2],t=arguments.length<=3?void 0:arguments[3];if("ping"===e){var o={gdprApplies:!0,cmpLoaded:!0,cmpStatus:this.cmpStatus,displayStatus:this.displayStatus,apiVersion:"2",cmpVersion:this.model.cmpVersion,cmpId:this.model.cmpId,gvlVersion:this.model.vendorListVersion,tcfPolicyVersion:this.model.tcfPolicyVersion};"function"==typeof n&&n(o,!0)}else if("addEventListener"===e){var r=this.addListener(n);n(H(H({},this.getTCData()),{},{listenerId:r}),!0)}else"removeEventListener"===e?(this.removeListener(t),n(!0)):"getTCData"===e?"function"==typeof n&&n(this.getTCData(),!0):"getNonIABVendorConsents"===e?"function"==typeof n&&n(this.getNonIABVendorConsents(),!0):"getExtraConsents"===e?"function"==typeof n&&n(this.getExtraConsents(),!0):"showUi"===e||"displayConsentUi"===e?this.showUi():"closeUi"===e&&this.closeUi()}}],l&&x(i.prototype,l),u&&x(i,u),Object.defineProperty(i,"prototype",{writable:!1}),t}();new R}()}();;