!function(){"use strict";var e,t={4896:function(e){e.exports=interceptClient},27997:function(e){e.exports=Drupal},38123:function(e){e.exports=moment},40140:function(e){e.exports=interceptTheme},41594:function(e){e.exports=React},73032:function(e){e.exports=drupalSettings},75206:function(e){e.exports=ReactDOM},95282:function(e,t,n){var r=n(41594),o=n.n(r),i=n(75206),s=n(27997),u=n.n(s),a=n(73032),c=n.n(a),p=n(5667),f=n(5556),l=n.n(f),d=n(84196),v=n(4896),h=n.n(v),g=n(38123),b=n.n(g),m=n(76702),y=n(7796);function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}const{api:O,select:T,utils:j}=h(),_=h().constants;class R extends o().Component{componentDidMount(){this.props.fetchEvent(this.props.eventId),this.props.fetchRegistration(this.props.eventId,this.props.user)}render(){return o().createElement("div",{className:"event-register-button__inner"},this.props.event&&o().createElement(m.A,E({},this.props,{event:this.props.event.data})),this.props.event&&o().createElement(y.A,E({},this.props,{event:this.props.event.data})))}}R.propTypes={event:l().object,eventId:l().string.isRequired,registrations:l().array,fetchEvent:l().func.isRequired,fetchRegistration:l().func.isRequired,user:l().object},R.defaultProps={event:null,registrations:[]};var x=(0,d.Ng)(((e,t)=>({event:T.record(T.getIdentifier(_.TYPE_EVENT,t.eventId))(e),registrations:T.eventRegistrationsByEventByUser(t.eventId,t.user.uuid)(e)})),(e=>({fetchEvent:t=>{e(O[_.TYPE_EVENT].fetchResource(t))},fetchRegistration:(t,n)=>{e(O[_.TYPE_EVENT_REGISTRATION].fetchAll({filters:{date:{value:b()().tz(j.getUserTimezone()).startOf("day").format(),path:"field_event.field_date_time.value",operator:">="},user:{value:n.uuid,path:"field_user.id"}}}))}})))(R);const I=(0,p.A)(x),w=c().intercept.user;function P(e){const t=e.getAttribute("data-event-uuid");(0,i.render)(o().createElement(I,{eventId:t,user:w}),e)}u().behaviors.eventRegisterButtonApp={attach:e=>{[...e.getElementsByClassName("js--event-register-button")].map(P)}}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return t[e](i,i.exports,r),i.loaded=!0,i.exports}r.m=t,e=[],r.O=function(t,n,o,i){if(!n){var s=1/0;for(p=0;p<e.length;p++){n=e[p][0],o=e[p][1],i=e[p][2];for(var u=!0,a=0;a<n.length;a++)(!1&i||s>=i)&&Object.keys(r.O).every((function(e){return r.O[e](n[a])}))?n.splice(a--,1):(u=!1,i<s&&(s=i));if(u){e.splice(p--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[n,o,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r.j=63,function(){var e={63:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,i,s=n[0],u=n[1],a=n[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(a)var p=a(r)}for(t&&t(n);c<s.length;c++)i=s[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(p)},n=self.wpJsonpIntercept=self.wpJsonpIntercept||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var o=r.O(void 0,[436],(function(){return r(95282)}));o=r.O(o)}();