UNPKG

@orcden/odp-event-registration-form

Version:

OrcDen Platform Event Registration Form Component

1 lines 157 kB
(()=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?i(t):n}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e){var t="function"==typeof Map?new Map:void 0;return(r=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,l(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),s(i,e)})(e)}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&s(r,n.prototype),r}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}require("@orcden/od-forms");var u=document.createElement("template");u.innerHTML="\n <style>\n \n :host {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n #contact-form::part( field-label ) {\n white-space: pre;\n }\n\n </style>\n \n <od-form id='contact-form'>\n <od-form-input\n required\n name='contactFirstName'>First Name</od-form-input>\n <od-form-input\n required\n name='contactLastName'>Last Name</od-form-input>\n <od-form-input\n required\n type='email'\n name='contactEmail'>Email</od-form-input>\n <od-form-input\n type='tel'\n name='contactPhone'>Phone</od-form-input>\n <od-form-input\n name='companyName'>Company Name</od-form-input>\n <od-form-input\n name='contactTitle'>Job Title</od-form-input>\n <od-form-input name='howHear'>How Did You Hear<br> About This Event?</od-form-input>\n </od-form>\n <p>Note: The email address above will be used to send you a receipt of your purchase</p> \n",window.ShadyCSS&&window.ShadyCSS.prepareTemplate(u,"odp-contact-info-form");var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(p,e);var r,o,c,d,h,f=(r=p,o=a(),function(){var e,t=l(r);if(o){var i=l(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return n(this,e)});function p(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),e=f.call(this),window.ShadyCSS&&window.ShadyCSS.styleElement(i(e)),e.shadowRoot||(e.attachShadow({mode:"open"}),e.shadowRoot.appendChild(u.content.cloneNode(!0))),e}return c=p,h=[{key:"observedAttributes",get:function(){return["inline","company-required","phone-required"]}}],(d=[{key:"connectedCallback",value:function(){var e=this;this._form=this.shadowRoot.querySelector("#contact-form"),this._contactFirstNameInput=this.shadowRoot.querySelector('od-form-input[name="contactFirstName"]'),this._contactLastNameInput=this.shadowRoot.querySelector('od-form-input[name="contactLastName"]'),this._contactEmailInput=this.shadowRoot.querySelector('od-form-input[name="contactEmail"]'),this._contactPhoneInput=this.shadowRoot.querySelector('od-form-input[name="contactPhone"]'),this._companyNameInput=this.shadowRoot.querySelector('od-form-input[name="companyName"]'),this._contactTitleInput=this.shadowRoot.querySelector('od-form-input[name="contactTitle"]'),this._howHearInput=this.shadowRoot.querySelector('od-form-input[name="howHear"]'),this._upgradeProperty("inline"),this._upgradeProperty("companyRequired"),this._upgradeProperty("phoneRequired"),this._form.form.addEventListener("submit",(function(t){return t.stopPropagation(),t.preventDefault(),e.validate(),!1})),this._form.form.addEventListener("change",(function(t){e._notifyContactChanged(t)})),this._form.setAttribute("exportparts","form, table, table-row, table-cell, label-cell, input-cell, field-label, field-label-row, value-label ,form-input, form-select, form-textarea, form-richtext, richtext-editor"),this.setAttribute("exportparts","form : contact-form, table : contact-table, table-row : contact-table-row, table-cell : contact-table-cell, label-cell : contact-label-cell, input-cell : contact-input-cell, field-label : contact-field-label, field-label-row : contact-field-label-row, value-label : contact-value-label, form-input : contact-form-input, form-select : contact-form-select, form-textarea : contact-form-textarea, form-richtext : contact-form-richtext, richtext-editor : contact-richtext-editor")}},{key:"_upgradeProperty",value:function(e){if(Object.prototype.hasOwnProperty.call(this,e)){var t=this[e];delete this[e],this[e]=t}}},{key:"attributeChangedCallback",value:function(e,t,n){switch(e){case"inline":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setInlineAttribute(t);break}n!==t&&this._setInlineAttribute(n);break;case"company-required":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setCompanyRequiredAttribute(t);break}n!==t&&this._setCompanyRequiredAttribute(n);break;case"phone-required":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setPhoneRequiredAttribute(t);break}n!==t&&this._setPhoneRequiredAttribute(n)}}},{key:"_validateBoolean",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e}},{key:"_setBooleanAttribute",value:function(e,t){""===t||t&&"false"!==t?this.setAttribute(e,!0):this.removeAttribute(e)}},{key:"_setInlineAttribute",value:function(e){this._setBooleanAttribute("inline",e),this._contactFirstNameInput.inline=this.inline,this._contactLastNameInput.inline=this.inline,this._contactEmailInput.inline=this.inline,this._contactPhoneInput.inline=this.inline,this._companyNameInput.inline=this.inline,this._contactTitleInput.inline=this.inline,this._howHearInput.inline=this.inline}},{key:"_setPhoneRequiredAttribute",value:function(e){this._setBooleanAttribute("phone-required",e),this._contactPhoneInput.setAttribute("required",e)}},{key:"_setCompanyRequiredAttribute",value:function(e){this._setBooleanAttribute("company-required",e),this._companyNameInput.setAttribute("required",e)}},{key:"_notifyContactChanged",value:function(e){this.shadowRoot.dispatchEvent(new CustomEvent("contact-info-change",{bubbles:!0,composed:!0,detail:{contactInfo:this.getData()}}))}},{key:"validate",value:function(){return!!this._form.validate()||(this._form.htmlValidate(),!1)}},{key:"getData",value:function(){return this._form.getData()}},{key:"inline",get:function(){return this.hasAttribute("inline")},set:function(e){"boolean"==typeof e&&this._setInlineAttribute(e)}},{key:"phoneRequired",get:function(){return this.hasAttribute("phone-required")},set:function(e){"boolean"==typeof e&&this._setPhoneRequiredAttribute(e)}},{key:"companyRequired",get:function(){return this.hasAttribute("company-required")},set:function(e){"boolean"==typeof e&&this._setCompanyRequiredAttribute(e)}}])&&t(c.prototype,d),h&&t(c,h),p}(r(HTMLElement));function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}customElements.get("odp-contact-info-form")||window.customElements.define("odp-contact-info-form",c);var f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"deepCopy",value:function(e){for(var t=e,n={},i=0;i<Object.keys(t).length;i++){var r=Object.keys(t)[i];null!==t[r]&&void 0!==t[r]&&(Array.isArray(t[r])?n[r]=this.copyArray(t[r]):"object"===d(t[r])?n[r]=this.deepCopy(t[r]):n[r]=t[r])}return n}},{key:"copyArray",value:function(e){for(var t=e,n=[],i=0;i<t.length;i++){var r=t[i];null!==r&&null!=r&&(Array.isArray(r)?n.push(this.copyArray(r)):"object"===d(r)?n.push(this.deepCopy(r)):n.push(r))}return n}}])&&h(t.prototype,n),e}();function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var b=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"isSame",value:function(e,t){if(void 0===e&&void 0!==t)return!1;if(null===e&&null!==t)return!1;if(p(e)!==p(t))return!1;if(Array.isArray(e))return this.arraySame(e,t);if("object"!==p(e))return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0;n<Object.keys(e).length;n++){var i=Object.keys(e)[n],r=Object.keys(t)[n];if(i!==r)return!1;if(!this.isSame(e[i],t[r]))return!1}return!0}},{key:"arraySame",value:function(e,t){if(void 0===e&&void 0!==t)return!1;if(null===e&&null!==t)return!1;if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!this.isSame(e[n],t[n]))return!1;return!0}}])&&m(t.prototype,n),e}();function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e){var t="function"==typeof Map?new Map:void 0;return(k=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return x(e,arguments,S(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),I(i,e)})(e)}function x(e,t,n){return(x=w()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&I(r,n.prototype),r}).apply(null,arguments)}function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(s,e);var t,n,i,r,o,a=(t=s,n=w(),function(){var e,i=S(t);if(n){var r=S(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return v(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=a.call(this),window.ShadyCSS&&window.ShadyCSS.styleElement(_(t)),t.shadowRoot||(t.attachShadow({mode:"open"}),t.shadowRoot.appendChild(e.content.cloneNode(!0))),t}return i=s,o=[{key:"observedAttributes",get:function(){return["event-id","registration-id","regular-price","member-price","is-member","show-checkbox","checked","title","simple-form"]}}],(r=[{key:"connectedCallback",value:function(){var e=this;this._copy=new f,this._same=new b,this._init(),this._regItem={},this._quantity=1,this._discount=0,this._total=0,this.setAttribute("show-checkbox",!0),this._upgradeProperty("eventId"),this._upgradeProperty("registrationId"),this._upgradeProperty("regularPrice"),this._upgradeProperty("memberPrice"),this._upgradeProperty("title"),this._upgradeProperty("checked"),this._upgradeProperty("showCheckbox"),this._upgradeProperty("inline"),this._upgradeProperty("radioMode"),this._upgradeProperty("radioTitle"),this._upgradeProperty("eventData"),this._upgradeProperty("regItem"),this._upgradeProperty("totalCost"),this._upgradeProperty("totalDiscount"),this._titleCheckbox&&this._titleCheckbox.addEventListener("change",(function(t){return e.checked=t.target.checked})),this.dispatchEvent(new CustomEvent("add-member-hook",{bubbles:!0,composed:!0,detail:this}))}},{key:"_upgradeProperty",value:function(e){if(Object.prototype.hasOwnProperty.call(this,e)){var t=this[e];delete this[e],this[e]=t}}},{key:"attributeChangedCallback",value:function(e,t,n){switch(e){case"inline":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setInlineAttribute(t);break}n!==t&&this._setInlineAttribute(n);break;case"is-member":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setIsMemberAttribute(t);break}n!==t&&this._setIsMemberAttribute(n);break;case"checked":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setCheckedAttribute(t);break}n!==t&&this._setCheckedAttribute(n);break;case"show-checkbox":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setShowCheckboxAttribute(t);break}n!==t&&this._setShowCheckboxAttribute(n);break;case"event-id":if(null!==n&&""!==n&&!this._validateInt(n)){this._setEventIdAttribute(t);break}n!==t&&this._setEventIdAttribute(n);break;case"registration-id":if(null!==n&&""!==n&&!this._validateInt(n)){this._setRegistrationIdAttribute(t);break}n!==t&&this._setRegistrationIdAttribute(n);break;case"regular-price":if(null!==n&&""!==n&&!this._validateFloat(n)){this._setRegularPriceAttribute(t);break}n!==t&&this._setRegularPriceAttribute(n);break;case"member-price":if(null!==n&&""!==n&&!this._validateFloat(n)){this._setMemberPriceAttribute(t);break}n!==t&&this._setMemberPriceAttribute(n);break;case"title":n!==t&&this._setTitleAttribute(n);break;case"simple-form":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setSimpleFormAttribute(t);break}n!==t&&this._setSimpleFormAttribute(n)}this._dispatchChange()}},{key:"_validateInt",value:function(e){return"number"==typeof e||NaN!==Number.parseInt(e)}},{key:"_validateFloat",value:function(e){return"number"==typeof e||NaN!==Number.parseFloat(e)}},{key:"_setNumberAttribute",value:function(e,t){""===t||null===t?this.removeAttribute(e):this.setAttribute(e,t)}},{key:"_validateBoolean",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e}},{key:"_setBooleanAttribute",value:function(e,t){""===t||t&&"false"!==t?this.setAttribute(e,!0):this.removeAttribute(e)}},{key:"_setEventIdAttribute",value:function(e){this._setNumberAttribute("event-id",e)}},{key:"_setRegistrationIdAttribute",value:function(e){this._setNumberAttribute("registration-id",e)}},{key:"_setRegularPriceAttribute",value:function(e){this._setNumberAttribute("regular-price",e)}},{key:"_setMemberPriceAttribute",value:function(e){this._setNumberAttribute("member-price",e)}},{key:"_setIsMemberAttribute",value:function(e){this._setBooleanAttribute("is-member",e)}},{key:"_setCheckedAttribute",value:function(e){this._setBooleanAttribute("checked",e),this._titleCheckbox&&(this._titleCheckbox.checked=this.checked)}},{key:"_setShowCheckboxAttribute",value:function(e){this._setBooleanAttribute("show-checkbox",e),this._titleCheckbox&&(this.showCheckbox?this._titleCheckbox.removeAttribute("hide"):this._titleCheckbox.setAttribute("hide",!0))}},{key:"_setTitleAttribute",value:function(e){var t=this._parseTitle(e);this._setTitleInDom(t),""!==t?this.setAttribute("title",e):this.removeAttribute("title")}},{key:"_setInlineAttribute",value:function(e){this._setBooleanAttribute("inline",e)}},{key:"_setSimpleFormAttribute",value:function(e){this._setBooleanAttribute("simple-form",e)}},{key:"_requestInlineHook",value:function(){this.dispatchEvent(new CustomEvent("add-inline-hook",{bubbles:!0,composed:!0,detail:this}))}},{key:"_requestSimpleFormHook",value:function(){this.dispatchEvent(new CustomEvent("add-simple-form-hook",{bubbles:!0,composed:!0,detail:this}))}},{key:"_parseTitle",value:function(e){if(!e)return"";for(var t=e,n="\n ",i=0,r=t.indexOf(" - ");r>-1;)t=t.substring(0,r)+n+t.substring(r,t.length),i=r+n.length+1,r=t.indexOf(" - ",i);return t}},{key:"_setTitleInDom",value:function(e){this._titleCheckbox&&(this._titleCheckbox.value=e),this._titleLabel&&(this._titleLabel.innerHTML=e)}},{key:"_calculateTotals",value:function(){var e=0,t=0;this.isMember?(e=this.memberPrice,t=this.regularPrice-this.memberPrice):e=this.regularPrice,this._total=Number.parseInt(this._quantity)*Number.parseFloat(e),this._discount=Number.parseInt(this._quantity)*Number.parseFloat(t)}},{key:"getData",value:function(){return{}}},{key:"totalCost",get:function(){return this._calculateTotals(),this._total}},{key:"totalDiscount",get:function(){return this._calculateTotals(),this._discount}},{key:"eventData",get:function(){return this._eventData},set:function(e){this._eventData=e,this.eventId=e.id}},{key:"regItem",get:function(){return this._regItem},set:function(e){this._regItem=e,this.memberPrice=e.memberPrice,this.regularPrice=e.regularPrice,this.eventId=e.eventId,this.registrationId=e.id}},{key:"eventId",get:function(){return Number.parseInt(this.getAttribute("event-id"))},set:function(e){"number"==typeof e&&this._setEventIdAttribute(e)}},{key:"registrationId",get:function(){return Number.parseInt(this.getAttribute("registration-id"))},set:function(e){"number"==typeof e&&this._setRegistrationIdAttribute(e)}},{key:"regularPrice",get:function(){return Number.parseFloat(this.getAttribute("regular-price"))},set:function(e){"number"!=typeof e&&null!==e||this._setRegularPriceAttribute(e)}},{key:"memberPrice",get:function(){return Number.parseFloat(this.getAttribute("member-price"))},set:function(e){"number"!=typeof e&&null!==e||this._setMemberPriceAttribute(e)}},{key:"isMember",get:function(){return this.hasAttribute("is-member")},set:function(e){"boolean"==typeof e&&this._setIsMemberAttribute(e)}},{key:"checked",get:function(){return this.hasAttribute("checked")},set:function(e){"boolean"==typeof e&&this._setCheckedAttribute(e)}},{key:"showCheckbox",get:function(){return this.hasAttribute("show-checkbox")},set:function(e){"boolean"==typeof e&&this._setShowCheckboxAttribute(e)}},{key:"title",get:function(){return this.getAttribute("title")},set:function(e){this._setTitleAttribute(e)}},{key:"inline",get:function(){return this.hasAttribute("inline")},set:function(e){"boolean"==typeof e&&this._setInlineAttribute(e)}},{key:"simpleForm",get:function(){return this.hasAttribute("simple-form")},set:function(e){"boolean"==typeof e&&this._setSimpleFormAttribute(e)}}])&&g(i.prototype,r),o&&g(i,o),s}(k(HTMLElement));function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){P(o,i,r,a,s,"next",e)}function s(e){P(o,i,r,a,s,"throw",e)}a(void 0)}))}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function O(e,t,n){return(O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=T(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}(a,e);var t,n,i,r,o=(i=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=T(i);if(r){var n=T(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return q(this,e)});function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,e)}return t=a,(n=[{key:"connectedCallback",value:function(){var e=this;this._registrationInfo={attendeeGroups:[],childRegistrations:[]},this._storedData={},this._copy=new f,this._same=new b,O(T(a.prototype),"connectedCallback",this).call(this),this._itemsSlot&&(this._itemsSlot.addEventListener("parent-item-group-registration-change",(function(t){t.stopPropagation(),e._updateItemGroupRegistration(t)})),this._itemsSlot.addEventListener("parent-multi-registration-change",(function(t){t.stopPropagation(),e._updateMultiRegistration(t)})),this._itemsSlot.addEventListener("parent-single-registration-change",(function(t){t.stopPropagation(),e._updateMultiRegistration(t)})),this._itemsSlot.addEventListener("item-registration-change",(function(t){t.stopPropagation(),e._updateSingleVariableOrItem(t)})),this._itemsSlot.addEventListener("variable-registration-change",(function(t){t.stopPropagation(),e._updateSingleVariableOrItem(t)})))}},{key:"attributeChangedCallback",value:function(e,t,n){O(T(a.prototype),"attributeChangedCallback",this).call(this,e,t,n)}},{key:"_setRegistrationInfoIds",value:function(){this._registrationInfo.eventId=this.eventId,this._registrationInfo.registrationId=this.registrationId}},{key:"__dispatchRegInfoChange",value:function(e){var t=this._copy.deepCopy(this.getData());this._same.isSame(this._storedData,t)||(this._storedData=t,this.shadowRoot.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:this._storedData})))}},{key:"getData",value:function(){return this._calculateTotals(),this._setRegistrationInfoIds(),{registrationInfo:this._registrationInfo,eventId:this.eventId,registrationId:this.registrationId,quantity:this._quantity,discount:this.totalDiscount,total:this.totalCost,checked:this.checked}}},{key:"configureAddButton",value:function(e,t,n,i,r,o,a){var s=this;this._addButton.onclick=R(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t(e,n,i,r,o);case 2:s._dispatchChange();case 3:case"end":return a.stop()}}),a)}))),this._addButton.innerHTML=a,this._addButton.style.display="block"}}])&&E(t.prototype,n),a}(A);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function j(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function z(e,t,n){return(z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=G(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=document.createElement("template");B.innerHTML="\n <style>\n\n :host {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n #parent-item-group-registration {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n :host( [is-member] ) #reg-price {\n text-decoration: line-through;\n }\n\n :host( [is-member] ) #ag-reg-price {\n text-decoration: line-through;\n }\n\n :host( :not( [is-member] ) ) #mem-price {\n text-decoration: line-through;\n }\n\n :host( :not( [is-member] ) ) #ag-mem-price {\n text-decoration: line-through;\n }\n\n :host( :not( [show-all-option] ) ) #all-container {\n display: none;\n }\n\n :host( :not( [show-checkbox] ) ) #title-checkbox {\n display: none;\n }\n\n :host( :not( [show-checkbox] ) ) #item-container {\n border: none;\n }\n\n :host( [attendee-mode='true'] ) #all-container {\n display: none;\n }\n\n :host( :not( [attendee-mode] ) ) #attendee-group-prices {\n display: none;\n }\n\n :host( :not( [attendee-mode] ) ) #add-button {\n display: none;\n }\n\n :host( :not( [inline] ) ) .indent {\n padding-left: 0;\n }\n\n :host( :not( [inline] ) ) #parent-item-group-registration-inner {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host( :not( [inline] ) ) #item-container {\n padding-left: 1rem;\n }\n\n .price {\n white-space: pre;\n }\n\n .price[hide='true'] {\n display: none;\n }\n\n .price > span {\n font-weight: 600;\n }\n\n .container {\n display: flex;\n align-items: center;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .indent {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin-bottom: 1rem;\n padding-left: 2rem;\n }\n\n #parent-item-group-registration-inner {\n display: flex;\n align-items: center;\n }\n\n #prices {\n display: flex;\n flex-direction: column;\n\n margin-left: 4rem;\n }\n\n #attendee-group-prices {\n display: flex;\n flex-direction: column;\n\n margin-left: 4rem;\n }\n\n #title-container {\n display: flex;\n align-items: center;\n }\n \n #title {\n font-weight: 600;\n font-size: 1.25rem;\n margin: 0 1rem;\n }\n\n #all-label {\n white-space: pre;\n font-weight: 600;\n font-size: 1.1rem\n }\n\n #all-container {\n margin: 1rem 0 2rem 0;\n }\n\n #item-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding-left: 2rem;\n border-left: 1px solid darkgrey;\n }\n\n #qty {\n white-space: pre;\n margin-left: 2rem;\n }\n\n #qty-input {\n width: 2rem;\n }\n\n #add-button {\n display: none;\n margin-top: 1rem;\n }\n\n </style>\n \n <div id=\"parent-item-group-registration\">\n <div id='parent-item-group-registration-inner'>\n <div id='title-container'>\n <input id='title-checkbox' type='checkbox' part='mode-checkbox'>\n <label id='title' part='mode-item-group-title'></label>\n </div>\n <div id='attendee-group-prices'>\n <label id='ag-reg-price' class='price' part='mode-price'>Regular Price: $<span></span></label>\n <label id='ag-mem-price' class='price' part='mode-price'>Member Price: $<span></span></label>\n <label id='ag-free-price' class='price' part='mode-price'>FREE</label>\n </div>\n </div>\n <div class='indent'>\n <div class='container' id='all-container' >\n <div class='container'>\n <input id='all-checkbox' type='checkbox' part='mode-checkbox'>\n <label id='all-label' part='mode-item-title'> All</label>\n </div>\n <div id='prices'>\n <label id='reg-price' class='price' part='mode-price'>Regular Price: $<span></span></label>\n <label id='mem-price' class='price' part='mode-price'>Member Price: $<span></span></label>\n <label id='free-price' class='price' part='mode-price'>FREE</label>\n </div>\n <label id='qty' part='mode-qty-title'>qty: </label>\n <input id='qty-input' type='number' value=1 part='mode-qty-input'>\n </div>\n <div id='item-container'>\n <slot id='items'></slot>\n <button id='add-button' part='mode-add-button'></button>\n </div> \n </div>\n </div> \n",window.ShadyCSS&&window.ShadyCSS.prepareTemplate(B,"odp-event-parent-item-group-registration");var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(u,e);var t,n,i,r,o,a,s,l=(a=u,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=G(a);if(s){var n=G(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return H(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),l.call(this,B)}return t=u,i=[{key:"observedAttributes",get:function(){return["event-id","registration-id","regular-price","member-price","is-member","show-checkbox","checked","title","inline","show-all-option","attendee-mode"]}}],(n=[{key:"_init",value:function(){this._storedContactInfo={},this._storedAttendeeInfo={},this._hasSameAsContact=!1,this._children=[],this._allQuantity=1,this._titleLabel=this.shadowRoot.querySelector("#title"),this._titleCheckbox=this.shadowRoot.querySelector("#title-checkbox"),this._regularPriceLabel=this.shadowRoot.querySelector("#reg-price"),this._regularPriceSpan=this._regularPriceLabel.querySelector("span"),this._agRegularPriceLabel=this.shadowRoot.querySelector("#ag-reg-price"),this._agRegularPriceSpan=this._agRegularPriceLabel.querySelector("span"),this._memberPriceLabel=this.shadowRoot.querySelector("#mem-price"),this._memberPriceSpan=this._memberPriceLabel.querySelector("span"),this._agMemberPriceLabel=this.shadowRoot.querySelector("#ag-mem-price"),this._agMemberPriceSpan=this._agMemberPriceLabel.querySelector("span"),this._freeLabel=this.shadowRoot.querySelector("#free-price"),this._agFreeLabel=this.shadowRoot.querySelector("#ag-free-price"),this._allCheckbox=this.shadowRoot.querySelector("#all-checkbox"),this._qtyInput=this.shadowRoot.querySelector("#qty-input"),this._itemsSlot=this.shadowRoot.querySelector("#items"),this._addButton=this.shadowRoot.querySelector("#add-button"),this._invalidMessage=""}},{key:"connectedCallback",value:function(){var e=this;z(G(u.prototype),"connectedCallback",this).call(this),this.setAttribute("show-all-option",!0),this._upgradeProperty("showAllOption"),this._upgradeProperty("attendeeMode"),this._observer=new MutationObserver((function(t,n){for(var i=0;i<t.length;i++){var r=t[i];if(r.addedNodes&&r.addedNodes.length)for(var o=0;o<r.addedNodes.length;o++){var a=r.addedNodes[o];a.parentElement===e&&a.tagName.includes("ODP-EVENT")&&e._children.push(a)}if(r.removedNodes&&r.removedNodes.length)for(var s=0;s<r.removedNodes.length;s++){var l=r.removedNodes[s];if(l.tagName.includes("ODP-EVENT"))for(var u=0;u<e._children.length;u++)if(l===e._children[u]){e._children.splice(u,1),e._updateAttendeeModeGroupRegistrations();break}}}e.reIndexGroups(),e._checkAllOption(),e._mutationObserverCallback(t,n),e._dispatchChange()})),this._observer.observe(this,{attributes:!1,childList:!0,subtree:!0}),this._itemsSlot.addEventListener("attendee-group-registration-change",(function(t){t.stopPropagation(),e._updateAttendeeGroupRegistrations(t)})),this._itemsSlot.addEventListener("group-has-same-change",(function(t){t.stopPropagation(),e._hasSameListener(t)})),this._allCheckbox.addEventListener("change",(function(t){e._updateRegInfoAll(t.target.checked,e._allQuantity),t.target.checked&&0===e._allQuantity&&e._updateQuantity(1),e._dispatchChange()})),this._qtyInput.addEventListener("change",(function(t){e._updateQuantity(t.target.value)})),this._requestInlineHook(),this.setAttribute("exportparts","mode-radio, mode-item-group-title, mode-add-button, mode-qty-input, mode-qty-title, mode-item-title, mode-price, mode-attendee-group-title, mode-attendee-title, divider, mode-checkbox, mode-delete-button, mode-attendee-form, mode-attendee-table, mode-attendee-table-row, mode-attendee-table-cell, mode-attendee-label-cell, mode-attendee-input-cell, mode-attendee-field-label, mode-attendee-field-label-row, mode-attendee-value-label, mode-attendee-form-input, mode-attendee-form-select, mode-attendee-form-textarea, mode-attendee-form-richtext, mode-attendee-richtext-editor, mode-multi-form, mode-multi-table, mode-multi-table-row, mode-multi-table-cell, mode-multi-label-cell, mode-multi-input-cell, mode-multi-field-label, mode-multi-field-label-row, mode-multi-value-label, mode-multi-form-input, mode-multi-form-select, mode-multi-form-textarea, mode-multi-form-richtext, mode-multi-richtext-editor"),this._dispatchChange()}},{key:"attributeChangedCallback",value:function(e,t,n){switch(z(G(u.prototype),"attributeChangedCallback",this).call(this,e,t,n),e){case"show-all-option":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setShowAllOptionAttribute(t);break}n!==t&&this._setShowAllOptionAttribute(n);break;case"attendee-mode":if(null!==n&&""!==n&&!this._validateBoolean(n)){this._setAttendeeModeAttribute(t);break}n!==t&&this._setAttendeeModeAttribute(n)}this._dispatchChange()}},{key:"_setRegularPriceAttribute",value:function(e){this._setNumberAttribute("regular-price",e),this._setRegularPriceInDom(this.regularPrice)}},{key:"_setMemberPriceAttribute",value:function(e){this._setNumberAttribute("member-price",e),this._setMemberPriceInDom(this.memberPrice)}},{key:"_setShowAllOptionAttribute",value:function(e){this._setBooleanAttribute("show-all-option",e),this.showAllOption?this._allQuantity=Number.parseInt(this._qtyInput.value):this._allQuantity=1,this._updateRegInfoAll(this._allCheckbox.checked,this._allQuantity),this._dispatchChange()}},{key:"_setAttendeeModeAttribute",value:function(e){this._setBooleanAttribute("attendee-mode",e)}},{key:"_mutationObserverCallback",value:function(e,t){this.dispatchEvent(new CustomEvent("odp-event-item-group-mutation",{bubbles:!0,detail:{mutationsList:e,observer:t}}))}},{key:"mutationPromiseCallback",value:function(e,t){var n=this;e.stopPropagation(),this.removeEventListener("odp-event-item-group-mutation",(function(e){n.mutationPromiseCallback(e,t)})),t(e.detail)}},{key:"_setRegularPriceInDom",value:function(e){null===e||isNaN(e)?(this._regularPriceLabel.setAttribute("hide",!0),this._agRegularPriceLabel.setAttribute("hide",!0)):0===e?(this._regularPriceLabel.removeAttribute("hide"),this._regularPriceSpan.innerHTML="FREE",this._agRegularPriceLabel.removeAttribute("hide"),this._agRegularPriceSpan.innerHTML="FREE"):(this._regularPriceLabel.removeAttribute("hide"),this._regularPriceSpan.innerHTML=e.toFixed(2),this._agRegularPriceLabel.removeAttribute("hide"),this._agRegularPriceSpan.innerHTML=e.toFixed(2)),this._checkFree()}},{key:"_setMemberPriceInDom",value:function(e){null===e||isNaN(e)?(this._memberPriceLabel.setAttribute("hide",!0),this._agMemberPriceLabel.setAttribute("hide",!0)):0===e?(this._memberPriceLabel.removeAttribute("hide"),this._memberPriceSpan.innerHTML="FREE",this._agMemberPriceLabel.removeAttribute("hide"),this._agMemberPriceSpan.innerHTML="FREE"):(this._memberPriceLabel.removeAttribute("hide"),this._memberPriceSpan.innerHTML=e.toFixed(2),this._agMemberPriceLabel.removeAttribute("hide"),this._agMemberPriceSpan.innerHTML=e.toFixed(2)),this._checkFree()}},{key:"_checkFree",value:function(){this._freeLabel.setAttribute("hide",!0),this._agFreeLabel.setAttribute("hide",!0),0===this.memberPrice&&0===this.regularPrice&&(this._regularPriceLabel.setAttribute("hide",!0),this._memberPriceLabel.setAttribute("hide",!0)),this._regularPriceLabel.hasAttribute("hide")&&this._memberPriceLabel.hasAttribute("hide")&&(this._freeLabel.setAttribute("hide",!1),this._agFreeLabel.setAttribute("hide",!1)),this._checkAllOption()}},{key:"_checkAllOption",value:function(){for(var e=!0,t=0;t<this._children.length;t++)"ODP-EVENT-ITEM-REGISTRATION"!==this._children[t].tagName&&(e=!1);isNaN(this.regularPrice)&&isNaN(this.memberPrice)?this.showAllOption=!1:this.showAllOption=e}},{key:"_updateSingleVariableOrItem",value:function(e){var t={eventId:e.detail.eventId,registrationId:e.detail.registrationId,quantity:e.detail.quantity,attendeeGroups:null,childRegistrations:null};this._updateRegistrationInfo(t,e.detail.checked)}},{key:"_updateItemGroupRegistration",value:function(e){var t=this._copy.deepCopy(e.detail.registrationInfo);this._updateRegistrationInfo(t,e.detail.checked)}},{key:"_updateMultiRegistration",value:function(e){var t=this._copy.deepCopy(e.detail.registrationInfo);this._updateRegistrationInfo(t,e.detail.checked)}},{key:"_updateParentSingleRegistration",value:function(e){var t=this._copy.deepCopy(e.detail.registrationInfo);this._updateRegistrationInfo(t,e.detail.checked)}},{key:"_updateAttendeeGroupRegistrations",value:function(e){if(!isNaN(e.detail.index)){var t=e.detail.eventId,n=e.detail.registrationId,i=this._copy.deepCopy(e.detail.attendeeGroupInfo);if(t===this.eventId&&n==this.registrationId){for(;!this._registrationInfo.attendeeGroups[e.detail.index];)this._registrationInfo.attendeeGroups.push({});if(this._registrationInfo.attendeeGroups[e.detail.index]=i,!this._hasSameAsContact&&this._registrationInfo.attendeeGroups[0].attendees[0]&&this._saveAttendeeData(this._registrationInfo.attendeeGroups[0].attendees[0]),i.attendees)for(var r=0;r<i.attendees.length;r++)Object.keys(i.attendees[r]).length>0&&(this.checked=!0);this._dispatchChange()}}}},{key:"_hasSameListener",value:function(e){e.stopPropagation(),this._hasSameAsContact=e.detail.hasSameAsContact,this._hasSameAsContact?this._loadAttendeeData(this._storedContactInfo):this._loadAttendeeData(this._storedAttendeeInfo),this._dispatchChange()}},{key:"_saveAttendeeData",value:function(e){e&&(this._storedAttendeeInfo=this._copy.deepCopy(e))}},{key:"_loadAttendeeData",value:function(e){this._children[0]&&e&&this._children[0]._setFirstAttendee(e)}},{key:"_updateAttendeeModeGroupRegistrations",value:function(){if(this.attendeeMode){this._registrationInfo.attendeeGroups=[];for(var e=0;e<this._children.length;e++){var t=this._children[e];this._registrationInfo.attendeeGroups.push(t.getData().attendeeGroupInfo)}this._dispatchChange()}}},{key:"_updateQuantity",value:function(e){this._qtyInput.value=e,this._allQuantity=Number.parseInt(e),this._allCheckbox.checked=this._allQuantity>0,this._updateRegInfoAll(this._allCheckbox.checked,this._allQuantity),this._dispatchChange()}},{key:"_updateRegInfoAll",value:function(e,t){var n={eventId:this.eventId,registrationId:this.registrationId,quantity:t,attendeeGroups:null,childRegistrations:null};this._updateRegistrationInfo(n,e)}},{key:"_updateRegistrationInfo",value:function(e,t){t&&(this.checked=!0);for(var n=!1,i=0;i<this._registrationInfo.childRegistrations.length;i++){var r=this._registrationInfo.childRegistrations[i];r.eventId===e.eventId&&r.registrationId===e.registrationId&&(t?this._registrationInfo.childRegistrations[i]=e:this._registrationInfo.childRegistrations.splice(i,1),n=!0)}t&&!n&&this._registrationInfo.childRegistrations.push(e),this._dispatchChange()}},{key:"_calculateTotals",value:function(){var e=0,t=0;if(this.attendeeMode)for(var n=0;n<this._children.length;n++){var i=this._children[n];e+=i.totalCost,i.isMember&&(t+=i.totalDiscount)}else{this._allCheckbox.checked&&(this.isMember?(e+=this.memberPrice,t+=this.regularPrice-this.memberPrice):e+=this.regularPrice,e*=this._allQuantity,t*=this._allQuantity);for(var r=0;r<this._children.length;r++){var o=this._children[r];o.checked&&void 0!==o.checked&&(t+=o.totalDiscount,e+=o.totalCost)}}this._total=Number.parseInt(this._quantity)*Number.parseFloat(e),this._discount=Number.parseInt(this._quantity)*Number.parseFloat(t)}},{key:"_contactInfoChangedHook",value:function(e){var t=this._copy.deepCopy(e.detail.contactInfo);this._storedContactInfo={firstName:t.contactFirstName,lastName:t.contactLastName,email:t.contactEmail,phone:t.contactPhone,companyName:t.companyName,title:t.contactTitle},this._hasSameAsContact&&(this._loadAttendeeData(this._storedContactInfo),this._dispatchChange())}},{key:"_setFirstAttendee",value:function(){this.attendeeMode&&(this._hasSameAsContact?this._registrationInfo.attendeeGroups[0].attendees[0]=this._storedContactInfo:this._registrationInfo.attendeeGroups[0].attendees[0]=this._storedAttendeeInfo)}},{key:"_dispatchChange",value:function(){this._setFirstAttendee(),this.__dispatchRegInfoChange("parent-item-group-registration-change")}},{key:"validate",value:function(){for(var e=!0,t=!1,n=!1,i=0;i<this._children.length;i++){var r=this._children[i];r.checked&&(t=!0,r.validate()||(n||(this._invalidMessage=r.invalidMessage,n=!0),e=!1))}return t||(e=!1,this._invalidMessage=this.title+" must have at least one option selected."),e}},{key:"mutationPromise",value:(r=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){t.addEventListener("odp-event-item-group-mutation",(function(n){t.mutationPromiseCallback(n,e)}))})));case 1:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){M(o,n,i,a,s,"next",e)}function s(e){M(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{key:"reIndexGroups",value:function(){if(this.attendeeMode)for(var e=0;e<this._children.length;e++)this._children[e].index=e}},{key:"invalidMessage",get:function(){return this._invalidMessage}},{key:"showAllOption",get:function(){return this.hasAttribute("show-all-option")},set:function(e){"boolean"==typeof e&&this._setShowAllOptionAttribute(e)}},{key:"attendeeMode",get:function(){return this.hasAttribute("attendee-mode")},set:function(e){"boolean"==typeof e&&this._setAttendeeModeAttribute(e)}}])&&j(t.prototype,n),i&&j(t,i),u}(D);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function X(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Y(e,t,n){return(Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=K(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function U(e,t){return!t||"object"!==Q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var W=document.createElement("template");W.innerHTML="\n <style>\n\n :host {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n #parent-single-registration {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n :host( :not( [show-checkbox] ) ) #title-checkbox {\n display: none;\n }\n\n :host( :not( [inline] ) ) #item-container {\n padding-left: 1rem;\n }\n\n .container {\n display: flex;\n align-items: center;\n }\n\n #title-container {\n display: flex;\n align-items: center;\n }\n \n #title {\n font-weight: 600;\n font-size: 1.25rem;\n margin: 0 1rem;\n }\n\n #item-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n contain: content;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding-left: 4rem;\n margin-bottom: 1rem;\n }\n\n </style>\n \n <div id=\"parent-single-registration\">\n <div id='title-container'>\n <input id='title-checkbox' type='checkbox' part='mode-checkbox'>\n <label id='title' part='mode-item-group-title'></label>\n </div>\n <div id='item-container'>\n <slot id='items'></slot>\n </div>\n </div> \n",window.ShadyCSS&&window.ShadyCSS.prepareTemplate(W,"odp-event-parent-single-registration");var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(u,e);var t,n,i,r,o,a,s,l=(a=u,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,