text: !function(e){function t(t){for(var i,o,s=t[0],l=t[1],u=t[2],d=0,p=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&p.push(r[o][0]),r[o]=0;for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i]);for(c&&c(t);p.length;)p.shift()();return a.push.apply(a,u||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],i=!0,s=1;s<n.length;s++){var l=n[s];0!==r[l]&&(i=!1)}i&&(a.splice(t--,1),e=o(o.s=n[0]))}return e}var i={},r={2:0},a=[];function o(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var c=l;a.push([203,1,0]),n()}({158:function(e,t){},176:function(e,t){},177:function(e,t){},178:function(e,t){},194:function(e,t){},203:function(e,t,n){"use strict";n.r(t);var i=n(19),r=n.n(i),a=n(3),o=n.n(a),s=n(4),l=n.n(s),u=n(5),c=n.n(u),d=n(10),p=n.n(d),h=n(6),g=n.n(h),_=n(7),f=n.n(_),y=n(2),E=n.n(y),m=n(0),v=n.n(m),T=n(1),O=n(14),C=n(9),N=n(11),A=n.n(N),b=n(15),R=function(){function e(t,n){o()(this,e),v()(this,"buffer",void 0),v()(this,"result",void 0),v()(this,"plugins",void 0),this.buffer=t,this.plugins=n,this.result=""}return l()(e,[{key:"parse",value:function(){if("^"===this.buffer.substr(0,1))return this.escapeHTML(this.buffer.substr(1));var e=String(this.buffer||"").replace(/(^[ ]{1,}|[ ]{1,}$)/g," ").replace(/\r\n/g,"\n").replace(/\r/g,"\n");return this.parseLine(e,!1)}},{key:"readUntil",value:function(e,t,n){for(var i=n,r=e.length;i<r;i++)if(e[i]===t)return{result:e.substr(n,i-n),consume:i-n+1};return null}},{key:"readLink",value:function(e,t){var n,i={url:"",anchor:"",consume:0};return(n=this.readUntil(e,"]",t+1))?(i.anchor=n.result,t=t+1+n.consume,i.consume+=1+n.consume,"("!==e[t]?null:(t++,(n=this.readUntil(e,")",t))?(i.url=n.result,i.consume+=n.consume,i):null)):null}},{key:"escapeHTML",value:function(e){for(var t,n="",i=0,r=e.length;i<r;i++)switch(t=e[i]){case'"':n+="&quot;";break;case"<":n+="&lt;";break;case">":n+="&gt;";break;default:n+=t}return n}},{key:"parseLine",value:function(e,t){for(var n,i,r,a="",o=!this.plugins||(void 0===this.plugins.bold||this.plugins.bold),s=!this.plugins||(void 0===this.plugins.italic||this.plugins.italic),l=!this.plugins||(void 0===this.plugins.underline||this.plugins.underline),u=!this.plugins||(void 0===this.plugins.strike||this.plugins.strike),c=!this.plugins||(void 0===this.plugins.link||this.plugins.link),d=0,p=e.length;d<p;d++)switch(n=e.charAt(d)){case"*":o&&null!==(i=this.readUntil(e,"*",d+1))?(a+="<b>".concat(this.parseLine(i.result,!1),"</b>"),d+=i.consume):a+="*";break;case"_":s&&null!==(i=this.readUntil(e,"_",d+1))?(a+="<i>".concat(this.parseLine(i.result,!1),"</i>"),d+=i.consume):a+="_";break;case"+":l&&null!==(i=this.readUntil(e,"+",d+1))?(a+="<u>".concat(this.parseLine(i.result,!1),"</u>"),d+=i.consume):a+="+";break;case"-":u&&null!==(i=this.readUntil(e,"-",d+1))?(a+="<strike>".concat(this.parseLine(i.result,!1),"</strike>"),d+=i.consume):a+="-";break;case"[":c&&null!==(r=this.readLink(e,d))?(a+='<a href="'.concat(this.escapeHTML(r.url),'" target="_blank" rel="nofollow ugc">').concat(this.parseLine(r.anchor,!1),"</a>"),d+=r.consume):a+="[";break;case'"':a+="&quot;";break;case"<":a+="&lt;";break;case">":a+="&gt;";break;case"\n":a+="<br />";break;default:a+=n}return a+(t?"<br/>":"")}}],[{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new e(t,n).parse().replace(/%(ST|UN|PL|MI)%/g,(function(e){switch(e){case"%ST%":return"*";case"%UN%":return"_";case"%PL%":return"+";case"%MI%":return"-";default:return e}}))}},{key:"toPlainText",value:function(e){this.unescaper.innerHTML=this.parse(e);var t=this.unescaper.textContent;return this.unescaper.innerHTML="",t}}]),e}();v()(R,"unescaper",document.createElement("span"));var I=n(95),P=n.n(I),S=function(){function e(){o()(this,e)}return l()(e,null,[{key:"sanitizeHTML",value:function(e){return P()(e,{allowedTags:this.HTML_TAGS,allowedAttributes:this.ALLOWED_ATTRIBUTES})}},{key:"sanitizeHTMLUsingUserRights",value:function(e){return P()(e,{allowedTags:this.HTML_TAGS.concat(this.USER_HTML_TAGS),allowedAttributes:this.ALLOWED_ATTRIBUTES})}}]),e}();v()(S,"HTML_TAGS",["a","abbr","acronym","address","area","article","aside","b","bdi","bdo","big","blockquote","br","button","canvas","caption","center","cite","code","col","colgroup","datalist","dd","del","details","dfn","dir","div","dl","dt","em","fieldset","figcaption","font","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","input","ins","kbd","legend","li","nav","ol","p","pre","q","rp","rt","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","tt","u","ul","wbr"]),v()(S,"ALLOWED_ATTRIBUTES",{a:["href","name","target","rel","type"],iframe:["src","width","height","sandbox","allow","allowfullscreen","frameborder"],img:["src","width","height","alt"],font:["font-size"],p:["align"],table:["bgcolor","width","border","align","cellpadding","summary"],td:["align","valign","bgcolor","char","charoff","colspan","rowspan","width","height","nowrap"],tr:["align","valign","bgcolor","char","charoff"],ul:["compact","type"],"*":["style","id","class","tabindex","title"]}),v()(S,"USER_HTML_TAGS",[]);var D=function(){function e(){o()(this,e)}return l()(e,null,[{key:"addVirtualProperty",value:function(e,t,n,i,r){if("string"!==typeof e||""===e)throw new Error("Invalid argument: string expected!");var a=e.split("."),o=a[0]||"",s=a[1]||"";if(a.length>2||""===o||""===s)throw new Error('Invalid argument: propertyFQN must be in format "attributeName.propertyName"');if("string"!==typeof t||""===t)throw new Error("Invalid argument: string expected!");this.properties.push({propertyName:e,elementList:n,runtimePropertyTypeNameHint:t,get:i,set:r})}},{key:"isVirtualProperty",value:function(e,t){if(e&&t)for(var n=t.getTypeId(),i=0,r=this.properties.length;i<r;i++)if(this.properties[i].propertyName===e){if(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(n)>-1)return!0;break}return!1}},{key:"isReadableProperty",value:function(e,t){if(e&&t)for(var n=t.getTypeId(),i=0,r=this.properties.length;i<r;i++)if(this.properties[i].propertyName===e&&(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(n)>-1))return!!this.properties[i].get;return!1}},{key:"isWritableProperty",value:function(e,t){if(e&&t)for(var n=t.getTypeId(),i=0,r=this.properties.length;i<r;i++)if(this.properties[i].propertyName===e&&(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(n)>-1))return!!this.properties[i].set;return!1}},{key:"getPropertyReadCallback",value:function(e,t){if(e&&t)for(var n=t.getTypeId(),i=0,r=this.properties.length;i<r;i++)if(this.properties[i].propertyName===e&&(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(n)>-1))return this.properties[i].get||null;return null}},{key:"getPropertyWriteCallback",value:function(e,t){if(e&&t)for(var n=t.getTypeId(),i=0,r=this.properties.length;i<r;i++)if(this.properties[i].propertyName===e&&(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(n)>-1))return this.properties[i].set||null;return null}},{key:"enumerateVirtualProperties",value:function(e){if(!e)return null;for(var t=e.getTypeId(),n=[],i=0,r=this.properties.length;i<r;i++)(null===this.properties[i].elementList||this.properties[i].elementList.indexOf(t)>-1)&&n.push({name:this.properties[i].propertyName,type:this.properties[i].runtimePropertyTypeNameHint,optional:!0,virtual:!0});return n}}]),e}();v()(D,"properties",[]);var L=function(){function e(t){o()(this,e),v()(this,"element",void 0),v()(this,"isContentEditable",void 0),this.element=t,this.isContentEditable=t.hasAttribute("contenteditable")&&"true"===t.getAttribute("contenteditable")}return l()(e,[{key:"position",value:function(e){if(void 0===e)return this.getCaretPosition();this.setCaretPosition(e)}},{key:"getCaretPosition",value:function(){if(document.body.contains(this.element)){if(this.isContentEditable){this.element.focus();var e=0;if(document.getSelection().rangeCount){var t=document.getSelection().getRangeAt(0),n=t.cloneRange();n.selectNodeContents(this.element),n.setEnd(t.endContainer,t.endOffset),e=n.toString().length}return e}return this.element.selectionStart||0}}},{key:"setCaretPosition",value:function(e){if(document.body.contains(this.element))if(this.isContentEditable){this.element.focus();for(var t=this.element.childNodes,n=0,i=t.length;n<i;n++){if(!(t[n].textContent.length<e)){if(t[n].nodeType!==Node.TEXT_NODE){e=0;continue}document.getSelection().collapse(t[n],e);break}e-=t[n].textContent.length}}else this.element.setSelectionRange(e,e)}}]),e}();function k(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var M=function(e){g()(n,e);var t=k(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div";return o()(this,n),i=t.call(this),v()(c()(i),"elementTypeName",void 0),v()(c()(i),"rootNode",void 0),v()(c()(i),"disabled",!1),v()(c()(i),"readOnly",!1),i.elementTypeName=e,i.rootNode=document.createElement(r),i.rootNode.setAttribute("data-ui-role","ui-element"),i.rootNode.setAttribute("data-type",e),i.rootNode.tabIndex=0,i.enableSyncMode(),i}return l()(n,[{key:"getElementTypeName",value:function(){return this.elementTypeName}},{key:"getRootNode",value:function(){return this.rootNode}},{key:"isDisabled",value:function(){return this.disabled}},{key:"setDisabled",value:function(e){if((e=!!e)!==this.disabled)switch(this.disabled=e,this.disabled){case!0:this.rootNode.setAttribute("disabled","disabled"),this.rootNode.tabIndex=null;break;case!1:this.rootNode.removeAttribute("disabled"),this.rootNode.tabIndex=0}}},{key:"isReadOnly",value:function(){return this.readOnly}},{key:"setReadOnly",value:function(e){if((e=!!e)!==this.readOnly)switch(this.readOnly=e,this.readOnly){case!0:this.rootNode.setAttribute("readonly","readonly");break;case!1:this.rootNode.removeAttribute("readonly")}}},{key:"getAttribute",value:function(e){return this.rootNode.getAttribute(e)}},{key:"setAttribute",value:function(e,t){this.rootNode.setAttribute(e,t)}},{key:"hasAttribute",value:function(e){return this.rootNode.hasAttribute(e)}},{key:"removeAttribute",value:function(e){this.rootNode.removeAttribute(e)}},{key:"getId",value:function(){return this.rootNode.id}},{key:"setId",value:function(e){this.rootNode.id=String(e||"")}},{key:"append",value:function(e,t){switch(t){case n.APPEND_POSITION_BEFORE:e.insertAdjacentElement("beforebegin",this.rootNode);break;case n.APPEND_POSITION_AFTER:e.insertAdjacentElement("afterend",this.rootNode);break;case n.APPEND_POSITION_INSIDE:default:e.insertAdjacentElement("beforeend",this.rootNode)}this.trigger("append")}},{key:"replace",value:function(e){e.parentNode.replaceChild(this.rootNode,e),this.trigger("replace")}},{key:"insert",value:function(e){for(var t=e.childNodes,i=new L(e).position(),r=null,a=0,o=t.length;a<o;a++){var s=t[a].textContent.length;if(!(i>=s)){r=t[a];break}i-=s}if(null!==r){if(this.disableEvents(),r.nodeType===Node.TEXT_NODE){this.replace(r);var l=r.textContent.substr(0,i),u=r.textContent.substr(i);void 0===t[a-1]||t[a-1].nodeType!==Node.TEXT_NODE?(this.rootNode.insertAdjacentText("beforebegin",l),a++):t[a-1].nodeType===Node.TEXT_NODE&&(t[a-1].nodeValue=l+t[a-1].nodeValue),void 0===t[a+1]||t[a+1].nodeType!==Node.TEXT_NODE?this.rootNode.insertAdjacentText("afterend",u):t[a+1].nodeType===Node.TEXT_NODE&&(t[a+1].nodeValue+=u)}else this.append(r,n.APPEND_POSITION_BEFORE);this.enableEvents()}else this.append(e,n.APPEND_POSITION_INSIDE);this.trigger("insert")}},{key:"delete",value:function(){this.rootNode.parentNode&&this.rootNode.parentNode.removeChild(this.rootNode),this.trigger("delete")}}]),n}(b.a);v()(M,"APPEND_POSITION_INSIDE",0),v()(M,"APPEND_POSITION_BEFORE",1),v()(M,"APPEND_POSITION_AFTER",2),v()(M,"APPEND_POSITION_REPLACE",3),v()(M,"APPEND_POSITION_AT_CURSOR",4);var x=function(){function e(){o()(this,e)}return l()(e,[{key:"clearElementDOMNodeRoot",value:function(e){for(var t=e.getRootNode();t.childNodes.length;)t.removeChild(t.firstChild)}},{key:"getSizeAttributeValue",value:function(e){switch(e){case T.y.HALF:return"half";case T.y.QUARTER:return"quarter";case T.y.THIRD:return"third";case T.y.FILL:return"fill";case T.y.ONE_UNIT:return"1u";case T.y.TWO_UNITS:return"2u";case T.y.THREE_UNITS:return"3u";case T.y.FOUR_UNITS:return"4u";case null:return null;case T.y.FULL:default:return"full"}}},{key:"getSizeInUnits",value:function(e,t){switch(t){case T.y.FULL:return~~e;case T.y.HALF:return~~(e/2)||1;case T.y.QUARTER:return~~(e/4)||1;case T.y.THIRD:return~~(e/3)||1;case T.y.ONE_UNIT:return Math.min(e,1);case T.y.TWO_UNITS:return Math.min(e,2);case T.y.THREE_UNITS:return Math.min(e,3);case T.y.FOUR_UNITS:return Math.min(e,4);default:return 0}}},{key:"getElementLayoutSize",value:function(e){var t=~~e.getColspan(),n={labelWidthInUnits:0,inputWidthInUnits:t},i=e.hasProperty("label.widthInUnits")?e.getProperty("label.widthInUnits"):null;return n.labelWidthInUnits=null!==i&&i>0?i:e.getForm().getProperty("options.labelWidthInUnits"),n.labelWidthInUnits>t&&(n.labelWidthInUnits=t),n.inputWidthInUnits-=n.labelWidthInUnits,0===n.inputWidthInUnits&&(n.inputWidthInUnits=1,n.labelWidthInUnits--),n.labelWidthInUnits+n.inputWidthInUnits>t&&(n.inputWidthInUnits>=t&&(n.inputWidthInUnits=t-1),n.labelWidthInUnits=t-n.inputWidthInUnits),n}},{key:"isLabelSuppressed",value:function(e){return e.hasProperty("label.isRemoved")&&e.getProperty("label.isRemoved")}}],[{key:"setLabelCompactFieldState",value:function(t,n,i,r){if(null!==i&&1===i.length&&i[0]&&i[0].inputs&&1===i[0].inputs.length&&i[0].inputs[0]&&i[0].inputs[0].input){var a=e.castToDOMElement(i[0].inputs[0].input);t?a.setAttribute("placeholder",r?"":String(n||"")):a.removeAttribute("placeholder")}}},{key:"castToDOMElement",value:function(e){return e&&A()(e,M)?e.getRootNode():e}}]),e}();v()(x,"LABEL_PLACEMENT_TOP_RENDERERS",[T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL]);var w=function(){function e(){o()(this,e)}return l()(e,[{key:"updateRootNode",value:function(e){console.log("CustomControlRenderer: update: ",e.getHash())}},{key:"getRendererType",value:function(){return T.n.CUSTOM_CONTROL_RENDERER}}]),e}();function U(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var F=function(e){g()(n,e);var t=U(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","tln"),r.removeAttribute("data-label-width"),null!==a&&r.appendChild(a),null!==o&&r.appendChild(o),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,a.textContent,l,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL}}]),n}(x);function Y(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var B=function(e){g()(n,e);var t=Y(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","tfn"),r.removeAttribute("data-label-width"),null!==a&&r.appendChild(a),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==o&&r.appendChild(o),null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,a.textContent,l,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD}}]),n}(x);function V(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var H=function(e){g()(n,e);var t=V(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=document.createElement("div"),o=document.createElement("div"),s=e.getLabelDOMNode(),l=e.getInstructionsDOMNode(),u=e.getErrorDOMNode(),c=e.getInputDOMNodes(),d=this.getElementLayoutSize(e),p=d.inputWidthInUnits;if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>p?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","lln"),r.setAttribute("data-label-width",String(d.labelWidthInUnits)),a.setAttribute("data-role","label-column"),a.setAttribute("data-colspan",String(d.labelWidthInUnits)),o.setAttribute("data-role","input-column"),o.setAttribute("data-colspan",String(d.inputWidthInUnits)),r.appendChild(a),r.appendChild(o),null!==s&&a.appendChild(s),null!==l&&a.appendChild(l),null!==c)for(var h=0,g=c.length;h<g;h++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===h&&t.setAttribute("data-is-first-row","1"),g-1===h&&t.setAttribute("data-is-last-row","1"),i=0;for(var _=0,f=c[h].inputs.length;_<f;_++)t.appendChild(x.castToDOMElement(c[h].inputs[_].input)),null!==(n=this.getSizeAttributeValue(c[h].inputs[_].width))?(c[h].inputs[_].input.setAttribute("data-size",n),i+=this.getSizeInUnits(p,c[h].inputs[_].width)):c[h].inputs[_].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(p-i)),o.appendChild(t)}null!==u&&o.appendChild(u),null!==s&&null!==c&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,s.textContent,c,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL}}]),n}(x);function G(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var W=function(e){g()(n,e);var t=G(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=document.createElement("div"),o=document.createElement("div"),s=e.getLabelDOMNode(),l=e.getInstructionsDOMNode(),u=e.getErrorDOMNode(),c=e.getInputDOMNodes(),d=this.getElementLayoutSize(e),p=d.inputWidthInUnits;if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>p?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","rln"),r.setAttribute("data-label-width",String(d.inputWidthInUnits)),a.setAttribute("data-role","label-column"),a.setAttribute("data-colspan",String(d.labelWidthInUnits)),o.setAttribute("data-role","input-column"),o.setAttribute("data-colspan",String(d.inputWidthInUnits)),r.appendChild(o),r.appendChild(a),null!==s&&a.appendChild(s),null!==l&&a.appendChild(l),null!==c)for(var h=0,g=c.length;h<g;h++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===h&&t.setAttribute("data-is-first-row","1"),g-1===h&&t.setAttribute("data-is-last-row","1"),i=0;for(var _=0,f=c[h].inputs.length;_<f;_++)t.appendChild(x.castToDOMElement(c[h].inputs[_].input)),null!==(n=this.getSizeAttributeValue(c[h].inputs[_].width))?(c[h].inputs[_].input.setAttribute("data-size",n),i+=this.getSizeInUnits(p,c[h].inputs[_].width)):c[h].inputs[_].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(p-i)),o.appendChild(t)}null!==u&&o.appendChild(u),null!==s&&null!==c&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,s.textContent,c,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL}}]),n}(x);function K(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var z=function(e){g()(n,e);var t=K(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=document.createElement("div"),o=document.createElement("div"),s=e.getLabelDOMNode(),l=e.getInstructionsDOMNode(),u=e.getErrorDOMNode(),c=e.getInputDOMNodes(),d=this.getElementLayoutSize(e),p=d.inputWidthInUnits;if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>p?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","lfn"),r.setAttribute("data-label-width",String(d.labelWidthInUnits)),a.setAttribute("data-role","label-column"),a.setAttribute("data-colspan",String(d.labelWidthInUnits)),o.setAttribute("data-role","input-column"),o.setAttribute("data-colspan",String(d.inputWidthInUnits)),r.appendChild(a),r.appendChild(o),null!==s&&a.appendChild(s),null!==c)for(var h=0,g=c.length;h<g;h++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===h&&t.setAttribute("data-is-first-row","1"),g-1===h&&t.setAttribute("data-is-last-row","1"),i=0;for(var _=0,f=c[h].inputs.length;_<f;_++)t.appendChild(x.castToDOMElement(c[h].inputs[_].input)),null!==(n=this.getSizeAttributeValue(c[h].inputs[_].width))?(c[h].inputs[_].input.setAttribute("data-size",n),i+=this.getSizeInUnits(p,c[h].inputs[_].width)):c[h].inputs[_].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(p-i)),o.appendChild(t)}null!==l&&o.appendChild(l),null!==u&&o.appendChild(u),null!==s&&null!==c&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,s.textContent,c,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD}}]),n}(x);function q(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var X=function(e){g()(n,e);var t=q(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=document.createElement("div"),o=document.createElement("div"),s=e.getLabelDOMNode(),l=e.getInstructionsDOMNode(),u=e.getErrorDOMNode(),c=e.getInputDOMNodes(),d=this.getElementLayoutSize(e),p=d.inputWidthInUnits;if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>p?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","rfn"),r.setAttribute("data-label-width",String(d.inputWidthInUnits)),a.setAttribute("data-role","label-column"),a.setAttribute("data-colspan",String(d.labelWidthInUnits)),o.setAttribute("data-role","input-column"),o.setAttribute("data-colspan",String(d.inputWidthInUnits)),r.appendChild(o),r.appendChild(a),null!==s&&a.appendChild(s),null!==c)for(var h=0,g=c.length;h<g;h++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===h&&t.setAttribute("data-is-first-row","1"),g-1===h&&t.setAttribute("data-is-last-row","1"),i=0;for(var _=0,f=c[h].inputs.length;_<f;_++)t.appendChild(x.castToDOMElement(c[h].inputs[_].input)),null!==(n=this.getSizeAttributeValue(c[h].inputs[_].width))?(c[h].inputs[_].input.setAttribute("data-size",n),i+=this.getSizeInUnits(p,c[h].inputs[_].width)):c[h].inputs[_].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(p-i)),o.appendChild(t)}null!==l&&o.appendChild(l),null!==u&&o.appendChild(u),null!==s&&null!==c&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!1,s.textContent,c,!1)}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD}}]),n}(x);function Q(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var j=function(e){g()(n,e);var t=Q(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","tlc"),r.removeAttribute("data-label-width"),null!==o&&r.appendChild(o),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD}}]),n}(x);function J(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Z=function(e){g()(n,e);var t=J(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","tfc"),r.removeAttribute("data-label-width"),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==o&&r.appendChild(o),null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD}}]),n}(x);function ee(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var te=function(e){g()(n,e);var t=ee(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","llc"),r.removeAttribute("data-label-width"),null!==o&&r.appendChild(o),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD}}]),n}(x);function ne(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var ie=function(e){g()(n,e);var t=ne(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","lfc"),r.removeAttribute("data-label-width"),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==o&&r.appendChild(o),null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD}}]),n}(x);function re(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var ae=function(e){g()(n,e);var t=re(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","rlc"),r.removeAttribute("data-label-width"),null!==o&&r.appendChild(o),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD}}]),n}(x);function oe(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var se=function(e){g()(n,e);var t=oe(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"updateRootNode",value:function(e){this.clearElementDOMNodeRoot(e);var t,n,i,r=e.getRootNode(),a=e.getLabelDOMNode(),o=e.getInstructionsDOMNode(),s=e.getErrorDOMNode(),l=e.getInputDOMNodes(),u=e.getColspan();if(e.getElementKind()===T.m.CONTROL&&(e.getMinInputRowWidth()>u?r.setAttribute("data-force-mobile-rendering","1"):r.removeAttribute("data-force-mobile-rendering")),r.setAttribute("data-renderer-type","rfc"),r.removeAttribute("data-label-width"),null!==l)for(var c=0,d=l.length;c<d;c++){(t=document.createElement("div")).setAttribute("data-role","input-row"),0===c&&t.setAttribute("data-is-first-row","1"),d-1===c&&t.setAttribute("data-is-last-row","1"),i=0;for(var p=0,h=l[c].inputs.length;p<h;p++)t.appendChild(x.castToDOMElement(l[c].inputs[p].input)),null!==(n=this.getSizeAttributeValue(l[c].inputs[p].width))?(l[c].inputs[p].input.setAttribute("data-size",n),i+=this.getSizeInUnits(u,l[c].inputs[p].width)):l[c].inputs[p].input.removeAttribute("data-size");t.setAttribute("data-fill-colspan",String(u-i)),r.appendChild(t)}null!==o&&r.appendChild(o),null!==s&&r.appendChild(s),null!==a&&null!==l&&e.isCompactFieldPlaceholderSupported()&&x.setLabelCompactFieldState(!0,a.textContent,l,this.isLabelSuppressed(e))}},{key:"getRendererType",value:function(){return T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD}}]),n}(x),le=function(){function e(){o()(this,e),v()(this,"CUSTOM_CONTROL_RENDERER",null),v()(this,"LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL",null),v()(this,"LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD",null),v()(this,"LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL",null),v()(this,"LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD",null),v()(this,"LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL",null),v()(this,"LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD",null),v()(this,"LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD",null),v()(this,"LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD",null),v()(this,"LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD",null),v()(this,"LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD",null),v()(this,"LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD",null),v()(this,"LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD",null),this.CUSTOM_CONTROL_RENDERER=new w,this.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL=new F,this.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD=new B,this.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL=new H,this.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD=new z,this.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL=new W,this.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD=new X,this.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD=new j,this.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD=new Z,this.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD=new te,this.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD=new ie,this.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD=new ae,this.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD=new se}return l()(e,null,[{key:"getInstance",value:function(){return void 0===e.instance?e.instance=new e:e.instance}},{key:"getRendererByType",value:function(t){switch(t){case T.n.CUSTOM_CONTROL_RENDERER:return e.getInstance().CUSTOM_CONTROL_RENDERER;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL:return e.getInstance().LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD:return e.getInstance().LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL:return e.getInstance().LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD:return e.getInstance().LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD;case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL:return e.getInstance().LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL;case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD:return e.getInstance().LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD;case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD;case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:return e.getInstance().LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD;default:throw new Error("Renderers Factory: Unknown renderer type "+JSON.stringify(t))}}},{key:"getSuggestedRenderer",value:function(e,t,n){var i=e.hasProperty("label.isRemoved")&&e.getProperty("label.isRemoved")||e.hasProperty("label.isCompactField")&&e.getProperty("label.isCompactField");switch(t){case T.u.TOP_ALIGNED:switch(n){case T.t.BELOW_FIELD:return i?T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD;case T.t.BELOW_LABEL:default:return i?T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL}case T.u.RIGHT_ALIGNED:switch(n){case T.t.BELOW_FIELD:return i?T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD;case T.t.BELOW_LABEL:default:return i?T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL}case T.u.LEFT_ALIGNED:default:switch(n){case T.t.BELOW_FIELD:return i?T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD;case T.t.BELOW_LABEL:default:return i?T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL}}}}]),e}();v()(le,"instance",void 0);var ue,ce,de,pe,he,ge=n(34);!function(e){e[e.ANDROID=0]="ANDROID",e[e.IOS=1]="IOS",e[e.MAC=2]="MAC",e[e.WINDOWS_MOBILE=3]="WINDOWS_MOBILE",e[e.WINDOWS=4]="WINDOWS",e[e.LINUX=5]="LINUX",e[e.UNIX=6]="UNIX",e[e.OTHER=7]="OTHER"}(ue||(ue={})),function(e){e[e.WIN_95=0]="WIN_95",e[e.WIN_98=1]="WIN_98",e[e.WIN_2000=2]="WIN_2000",e[e.WIN_NT=3]="WIN_NT",e[e.WIN_ME=4]="WIN_ME",e[e.WIN_XP=5]="WIN_XP",e[e.WIN_SERVER_2003=6]="WIN_SERVER_2003",e[e.WIN_VISTA=7]="WIN_VISTA",e[e.WIN_7=8]="WIN_7",e[e.WIN_8=9]="WIN_8",e[e.WIN_10=10]="WIN_10",e[e.WIN_OTHER=11]="WIN_OTHER",e[e.UNKNOWN=12]="UNKNOWN"}(ce||(ce={})),function(e){e[e.CHROME=0]="CHROME",e[e.FIREFOX=1]="FIREFOX",e[e.MSIE=2]="MSIE",e[e.EDGE=3]="EDGE",e[e.SAFARI=4]="SAFARI",e[e.OPERA=5]="OPERA",e[e.UNKNOWN=6]="UNKNOWN"}(de||(de={})),function(e){e[e.DESKTOP=0]="DESKTOP",e[e.MOBILE=1]="MOBILE",e[e.SMART_TV=2]="SMART_TV"}(pe||(pe={})),function(e){e[e.E_NONE=0]="E_NONE",e[e.E_SYNTAX_ERROR=1]="E_SYNTAX_ERROR",e[e.E_BAD_OS=2]="E_BAD_OS",e[e.E_MOBILE_APP=3]="E_MOBILE_APP",e[e.E_DESKTOP_APP=4]="E_DESKTOP_APP",e[e.E_BAD_CPU_CLASS=5]="E_BAD_CPU_CLASS",e[e.E_BROWSER_VERSION=6]="E_BROWSER_VERSION",e[e.E_BROWSER_TYPE=7]="E_BROWSER_TYPE",e[e.E_API_MISSING=8]="E_API_MISSING",e[e.E_UNKNOWN_ERROR=9]="E_UNKNOWN_ERROR"}(he||(he={}));var _e=function(){function e(){o()(this,e)}return l()(e,null,[{key:"winVersionCompare",value:function(t,n){var i=e.WIN_VERSIONS_RELEASE_ORDER.indexOf(t);return e.WIN_VERSIONS_RELEASE_ORDER.indexOf(n)-i}},{key:"isTouchDevice",value:function(){return!0}},{key:"explainMissingApis",value:function(t){if(!t||!t.length)return"An error occured while detecting your browser capabilities";var n=[],i=0,r=t.length;for(i=0;i<r;i++)e.API_NAMES[t[i]]?n.push('"'.concat(t[i].toUpperCase(),'" (').concat(e.API_NAMES[t[i]],")")):n.push('"'.concat(t[i].toUpperCase(),'"'));return n.join(" or ")}},{key:"meetsRequirements",value:function(t){var n=/^(\*|win((95|98|2k|nt4|me|xp|2k3|vista|7|8|10|other)(\+)?)?|android|ios|mac|winmobile|linux|unix|other|\*) (32|64|\*) (desktop|mobile|\*) (chrome|firefox|msie|edge|opera|safari|other|\*) ([\d\.]+(\+)?|\*)( apis\=([a-z\_\,\|\d]+))?$/i.exec(String(t||""));if(!n)return"E_SYNTAX_ERROR: Invalid requirement: ".concat(JSON.stringify(t));var i=n[1],r=~~n[5],a=n[6],o=n[7],s=parseFloat(n[8])||-1,l=!!n[4],u=(l&&i.substr(0,i.length-1),n[8]&&n[8].match(/\+$/)?"gte":"eq"),c=n[11]?String(n[11]).split(","):[];if(!(n=/^(win((95|98|2k|nt4|me|xp|2k3|vista|7|8|10|other)(\+)?)?|android|ios|mac|winmobile|linux|unix|other) (32|64|\*) (desktop|mobile) (chrome|firefox|msie|edge|opera|safari|other) (.+) apis\=([a-z\_\,\d]+)$/i.exec(e.toString)))return"E_SYNTAX_ERROR: Invalid browser information: ".concat(JSON.stringify(e.toString));var d,p,h,g,_,f,y=n[1],E=~~n[5],m=n[6],v=n[7],T=parseFloat(n[8]),O=/^win/.test(y)&&"mobile"!=m,C=n[9]?String(n[9]).split(","):null;if("*"!=i){if(l&&!O)return"E_BAD_OS: Sorry, you need Windows in order to enjoy this application";if(l){if(i=i.substr(0,i.length-1),e.winVersionCompare(i,y)<0)return"E_BAD_OS:".concat(i,": Sorry, you need at least ").concat(e.WIN_VERSIONS_NAMES[i]||"an Unknown Windows (".concat(i,") version"),", but you have ").concat(e.WIN_VERSIONS_NAMES[y]||"an Unknown Windows (".concat(y,") version")," installed on your PC")}else if(i!=y)switch(i){case"win95":case"win98":case"win2k":case"winnt4":case"winme":case"winxp":case"win2k3":case"winvista":case"win7":case"win8":case"win10":case"winother":return"E_BAD_OS: This application requires the '".concat(e.WIN_VERSIONS_NAMES[y],"' operating system in order to run properly.");case"android":return"E_BAD_OS: This applicatoin requires the Android operating system in order to run properly.";case"mac":return"E_BAD_OS: This application requires the Mac OS operating system in order to run properly.";case"ios":return"E_BAD_OS: This application requires the IOS operating system in order to run properly.";case"winmobile":return"E_BAD_OS: This application requires the Windows Mobile operating system in order to run properly.";case"linux":return"E_BAD_OS: This application requires the Linux operating system in order to run properly";case"unix":return"E_BAD_OS: This application requires a Unix operating system in order to run properly";case"other":default:return"E_BAD_OS: Your operating system is not compatible with this application"}}if(0!=r&&E!=r)return"E_BAD_CPU_CLASS: This application requires a ".concat(String(r),"bit CPU in order to run properly, and we detected that you have a ").concat(String(E),"bit CPU");if("*"!=o&&v!=o)return"E_BAD_BROWSER: Sorry, you need a ".concat(e.BROWSER_NAMES[o]||"Special"," web browser in order to run this application, but we detected that you have ").concat(e.BROWSER_NAMES[v]||"Special"," web browser");if("*"!=a&&m!=a)switch(a){case"mobile":return"E_MOBILE_APP: This application is not intended to be used on desktop computers. Please try using a mobile device";case"desktop":return"E_DESKTOP_APP: This application is not intended to be used on mobile devices. Please try using a desktop computer or a laptop"}if(s>-1&&T<s&&"gte"==u)return"E_BROWSER_VERSION: You need at least ".concat(e.BROWSER_NAMES[v]||"Special"," web browser version ").concat(s.toFixed(2)," in order to run this application, but we detected that you have a lower version (").concat(T.toFixed(2),")");if(s>-1&&~~T!=~~s&&"eq"==u)return"E_BROWSER_VERSION: You need the ".concat(e.BROWSER_NAMES[v]||"Special"," web browser version ").concat(~~s," in order to run this application, but we detected that you have a different version (").concat(~~T,"), which is ").concat(T>s?"greater":"lower"," that the designed browser version of this application");if(c&&c.length)for(d=0,h=c.length;d<h;d++)if(g=(_=c[d].split("|")).length){for(f=!1,p=0;p<g;p++)if(C.indexOf(_[p])>-1){f=!0;break}if(!f)return"E_API_MISSING: Some plugins, browser capabilities or extensions, were not detected: ".concat(e.explainMissingApis(_))}return""}},{key:"getRequirementErrorCode",value:function(e){if(""==e)return he.E_NONE;var t=/^([A-Z\d\_]+)\:/.exec(e);if(!t)return he.E_NONE;switch(t[1]){case"E_SYNTAX_ERROR":return he.E_SYNTAX_ERROR;case"E_BAD_OS":return he.E_BAD_OS;case"E_MOBILE_APP":return he.E_MOBILE_APP;case"E_DESKTOP_APP":return he.E_DESKTOP_APP;case"E_BAD_CPU_CLASS":return he.E_BAD_CPU_CLASS;case"E_BROWSER_VERSION":return he.E_BROWSER_VERSION;case"E_BROWSER_TYPE":return he.E_BROWSER_TYPE;case"E_API_MISSING":return he.E_API_MISSING;default:return he.E_UNKNOWN_ERROR}}},{key:"isMobileDefaultBrowser",value:function(){return""!=e.meetsRequirements("android * mobile chrome 42+")&&""==e.meetsRequirements("android * mobile chrome *")}},{key:"isMobile",value:function(){return""===e.meetsRequirements("* * mobile * *")}},{key:"isIOS",value:function(){return""===e.meetsRequirements("* * mobile safari *")}},{key:"isMAC",value:function(){return""===e.meetsRequirements("mac * desktop safari *")}},{key:"isFirefox",value:function(){return""===e.meetsRequirements("* * firefox * *")}},{key:"isIE",value:function(){return!!window.MSInputMethodContext&&!!document.documentMode}},{key:"isIPad",get:function(){return!!navigator.userAgent.match(/iPad/i)}},{key:"isIPod",get:function(){return!!navigator.userAgent.match(/iPod/i)}},{key:"isIPhone",get:function(){return!!navigator.userAgent.match(/iPhone/i)}},{key:"isAndroid",get:function(){return!!navigator.userAgent.match(/Android/i)}},{key:"isWindowsPhone",get:function(){return!!navigator.userAgent.match(/(Windows (Phone )?8.1|Windows NT 6.3|Windows Phone [\d\.]+)/i)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1}},{key:"isChrome",get:function(){return!!window.chrome&&/google/i.test(navigator.vendor)}},{key:"isInternetExplorer",get:function(){return"Microsoft Internet Explorer"==navigator.appName&&!!/MSIE([0-9]{1,}[\.0-9]{0,})/.test(navigator.userAgent)}},{key:"cpuClass",get:function(){var t=navigator.userAgent,n=0,i=e.CPU_64_CLASSES.length;for(n=0;n<i;n++)if(t.indexOf(e.CPU_64_CLASSES[n])>-1)return 64;return 32}},{key:"operatingSystem",get:function(){return e.isWindowsPhone?ue.WINDOWS_MOBILE:e.isAndroid?ue.ANDROID:e.isIPad||e.isIPhone||e.isIPod?ue.IOS:navigator.userAgent.indexOf("Mac")>-1?ue.MAC:navigator.userAgent.indexOf("Linux")>-1?ue.LINUX:navigator.userAgent.indexOf("Windows")?ue.WINDOWS:navigator.userAgent.indexOf("X11")>-1?ue.UNIX:ue.OTHER}},{key:"operatingSystemVersion",get:function(){if(e.operatingSystem!=ue.WINDOWS)return ce.UNKNOWN;switch(!0){case/(Windows 10\.0|Windows NT 10\.0)/.test(navigator.userAgent):return ce.WIN_10;case/(Windows 8|Windows NT 6\.(2|3))/.test(navigator.userAgent):return ce.WIN_8;case/(Windows 7|Windows NT 6\.1)/.test(navigator.userAgent):return ce.WIN_7;case/Windows NT 6\.0/.test(navigator.userAgent):return ce.WIN_VISTA;case/Windows NT 5\.2/.test(navigator.userAgent):return ce.WIN_SERVER_2003;case/(Windows NT 5\.1|Windows XP)/.test(navigator.userAgent):return ce.WIN_XP;case/(Windows NT 5\.0|Windows 2000)/.test(navigator.userAgent):return ce.WIN_2000;case/(Win 9x 4\.90|Windows ME)/.test(navigator.userAgent):return ce.WIN_ME;case/(Windows 98|Win98)/.test(navigator.userAgent):return ce.WIN_98;case/(Windows 95|Win95|Windows_95)/.test(navigator.userAgent):return ce.WIN_95;case/(Windows NT 4\.0|WinNT4\.0|WinNT|Windows NT)/.test(navigator.userAgent):return ce.WIN_NT;default:return ce.WIN_OTHER}}},{key:"browserType",get:function(){switch(!0){case!!navigator.userAgent.match(new RegExp("[\\s]+Edge\\/[\\d]+","i")):return de.EDGE;case navigator.userAgent.indexOf("Opera")>-1:case navigator.userAgent.indexOf("OPR")>-1:return de.OPERA;case navigator.userAgent.indexOf("MSIE")>-1:return de.MSIE;case navigator.userAgent.indexOf("Chrome")>-1:return de.CHROME;case navigator.userAgent.indexOf("Safari")>-1:return de.SAFARI;case navigator.userAgent.indexOf("Firefox")>-1:return de.FIREFOX;case navigator.userAgent.indexOf("Trident/")>-1:return de.MSIE;default:return de.UNKNOWN}}},{key:"browserVersion",get:function(){navigator.appVersion;var e,t,n,i=navigator.userAgent,r="".concat(parseFloat(navigator.appVersion));return(e=i.indexOf("Edge/"))>-1?r=i.substr(e+5):(e=i.indexOf("Opera"))>-1?(r=i.substring(e+6),-1!=(e=i.indexOf("Version"))&&(r=i.substring(e+8))):-1!=(e=i.indexOf("OPR"))?r=i.substring(e+4):-1!=(e=i.indexOf("MSIE"))?r=i.substring(e+5):-1!=(e=i.indexOf("Chrome"))?r=i.substring(e+7):-1!=(e=i.indexOf("Safari"))?(r=i.substring(e+7),-1!=(e=i.indexOf("Version"))&&(r=i.substring(e+8))):-1!=(e=i.indexOf("Firefox"))?r=i.substring(e+8):-1!=i.indexOf("Trident/")?r=i.substring(i.indexOf("rv:")+3):i.lastIndexOf(" ")+1<(e=i.lastIndexOf("/"))&&(r=i.substring(e+1)),-1!=(t=r.indexOf(";"))&&(r=r.substring(0,t)),-1!=(t=r.indexOf(" "))&&(r=r.substring(0,t)),-1!=(t=r.indexOf(")"))&&(r=r.substring(0,t)),n=parseInt("".concat(r),10),isNaN(n)&&(r="".concat(parseFloat(navigator.appVersion))),parseFloat(r)}},{key:"browserTechnologies",get:function(){var t=[],n=0,i=e.APIS_LIST.length;for(n=0;n<i;n++)try{(window[e.APIS_LIST[n]]||window["moz".concat(e.APIS_LIST[n])]||window["webkit".concat(e.APIS_LIST[n])]||window["ms".concat(e.APIS_LIST[n])]||window["o".concat(e.APIS_LIST[n])])&&t.push(e.APIS_LIST[n].toLowerCase())}catch(l){}var r=navigator.plugins||[],a=!1,o=0,s=0;for(n=0,i=r.length;n<i;n++)if(r[n].description.toString().toLowerCase().indexOf("flash")>-1)a=!0;else if("undefined"!=typeof r[n]["application/x-nmpcbrowserplugin"])t.push("nagra");else if(r[n].length)for(o=0,s=r[n].length;o<s;o++)if("application/vnd.rcsrds.secureplayer.pepper.plugin"==r[n][o].type){t.push("nagrapepper");break}return a&&t.push("flash"),t.join(",")}},{key:"toString",get:function(){if(void 0!==e.CACHED_VERSION)return e.CACHED_VERSION;var t="";switch(e.operatingSystemVersion){case ce.WIN_95:t+="win95";break;case ce.WIN_98:t+="win98";break;case ce.WIN_2000:t+="win2k";break;case ce.WIN_NT:t+="winnt4";break;case ce.WIN_ME:t+="winme";break;case ce.WIN_XP:t+="winxp";break;case ce.WIN_SERVER_2003:t+="win2k3";break;case ce.WIN_VISTA:t+="winvista";break;case ce.WIN_7:t+="win7";break;case ce.WIN_8:t+="win8";break;case ce.WIN_10:t+="win10";break;case ce.WIN_OTHER:t+="winother";break;case ce.UNKNOWN:switch(e.operatingSystem){case ue.ANDROID:t+="android";break;case ue.IOS:t+="ios";break;case ue.MAC:t+="mac";break;case ue.WINDOWS_MOBILE:t+="winmobile";break;case ue.WINDOWS:t+="winother";break;case ue.LINUX:t+="linux";break;case ue.UNIX:t+="unix";break;case ue.OTHER:t+="other";break;default:t+="unknown"}break;default:t+="unknown"}switch(e.cpuClass){case 32:t+=" 32";break;case 64:t+=" 64"}switch(/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion)?t+=" mobile":t+=" desktop",e.browserType){case de.CHROME:t+=" chrome";break;case de.FIREFOX:t+=" firefox";break;case de.MSIE:t+=" msie";break;case de.EDGE:t+=" edge";break;case de.SAFARI:t+=" safari";break;case de.OPERA:t+=" opera";break;case de.UNKNOWN:t+=" other";break;default:t+=" other"}return e.CACHED_VERSION="".concat(t," ").concat(e.browserVersion.toFixed(2).replace(/[0]+$/g,"").replace(/\.$/,"")," apis=").concat(e.browserTechnologies)}}]),e}();v()(_e,"CPU_64_CLASSES",["x86_64","x86-64","Win64","x64;","amd64","amd64","AMD64","WOW64","x64_64","ia64","sparc64","ppc64","IRIX64"]),v()(_e,"WIN_VERSIONS_NAMES",{win95:"Windows 95",win98:"Windows 98",win2k:"Windows 2000",winnt4:"Windows NT 4.0",winme:"Windows Millenium",winxp:"Windows XP",win2k3:"Windows 2003 Server",winvista:"Windows Vista",win7:"Windows 7",win8:"Windows 8",win10:"Windows 10",winother:"Windows > 10",win:"Windows"}),v()(_e,"WIN_VERSIONS_RELEASE_ORDER",["win","win95","win98","winnt4","winme","win2k","winxp","win2k3","winvista","win7","win8","win10","winother"]),v()(_e,"BROWSER_NAMES",{chrome:"Google Chrome",firefox:"Mozilla Firefox",msie:"Microsoft Internet Explorer",edge:"Microsoft Edge",opera:"Opera",safari:"Safari",other:"Non Standard"}),v()(_e,"APIS_LIST",["ArrayBuffer","Audio","localStorage","sessionStorage","DataView","Crypto","CryptoKey","File","FileReader","Blob","Int16Array","Int32Array","Int8Array","HTMLCanvasElement","HTMLVideoElement","HTMLAudioElement","HTMLShadowElement","CanvasRenderingContext2D","URL","MediaSource","MediaStream","AudioBuffer","Promise","Worker","postMessage","XMLHttpRequest"]),v()(_e,"API_NAMES",{arraybuffer:"HTML5 ArrayBuffer API ( fixed length, raw binary data buffer )",audio:"HTML5 Audio element API ( support for playing audio )",localStorage:"HTML5 Local Storage API ( support for storing data on your browser )",sessionStorage:"HTML5 Session Storage API ( support for storing data on your browser )",dataview:"HTML5 DataView API ( low-level interface for reading data from and writing it to an ArrayBuffer )",crypto:"HTML5 Crpytography functions",cryptokey:"HTML5 Cryptography functions",file:"HTML5 File API ( provides information about files and allows to access their contents )",filereader:"HTML5 FileReader API ( lets web applications asynchronously read the contents of files / raw data buffers stored on your device or computer, using File or Blob objects to specify the file or data to read )",blob:"HTML5 Blob API ( a file-like object of immutable, raw data )",int16array:"HTML5 Int16Array API ( an array of twos-complement 16-bit signed integers in the platform byte order )",int8array:"HTML5 Int8Array API ( an array of twos-complement 8-bit signed integers )",int32array:"HTML5 Int32Array API ( an array of twos-complement 32-bit signed integers )",htmlcanvaselement:"HTML5 Canvas API ( allows application to draw 2D or 3D graphics using accelerated techniques / and your video card's hardware )",htmlvideoelement:"HTML5 Video Element API ( allows playing videos on your web browser, without the need of using external plugins )",htmlaudioelement:"HTML5 Audio Element API ( allows playing sounds on your web browser, without the need of using external plugins )",htmlshadowelement:"HTML5 Shadow DOM API ( provides encapsulation for the JavaScript, CSS and HTML support for web developers, in order to create high speed web pages )",canvasrenderingcontext2d:"HTML5 Canvas element 2D drawing routines API",url:"HTML5 URL API ( allows functions related with URL's and in-memory URL's for your web browser, including Video Streaming and Audio Streaming related ones )",mediasource:"HTLM5 MediaSource API ( technology that provides video and audio streaming for your web browser )",audiobuffer:"HTML5 AudioBuffer API ( technology that provides audio streaming and buffer for your web browser )",flash:"Adobe Flash plugin",nagra:"Encrypted video streaming support Player",nagrapepper:"Encrypted video streaming support Player Google Chrome browser extension",promise:"Asynchronous data types, which make your browser run smoothly",worker:"HTML5 Web Worker API",postmessage:"A technology used for inter-frame communication",xmlhttprequest:"HTML async transport inside browser (AJAX)"}),v()(_e,"CACHED_VERSION",void 0);var fe=n(38),ye=n(80),Ee=function(){function e(t,n,i){o()(this,e),v()(this,"config",void 0),v()(this,"i18n",void 0),v()(this,"phoneUtils",void 0),v()(this,"capabilities",void 0),v()(this,"userService",void 0),this.i18n=t,this.capabilities=n,this.phoneUtils=i,this.userService=ye.a.getInstance()}return l()(e,[{key:"enumerateValidators",value:function(){return void 0===this.config&&(this.config=[{name:"none",id:"",isSupported:!0,i18n:"edt_UI_validator_type_none"},{name:"email",id:e.VALIDATOR_TYPE_EMAIL,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_EMAIL),i18n:"edt_UI_validator_type_email"},{name:"password",id:e.VALIDATOR_TYPE_PASSWORD,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD),i18n:"edt_UI_validator_type_password"},{name:"integer",id:e.VALIDATOR_TYPE_UNSIGNED_INTEGER,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_UNSIGNED_INTEGER),i18n:"edt_UI_validator_type_unsigned_integer"},{name:"alpha",id:e.VALIDATOR_TYPE_ALPHA,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_ALPHA),i18n:"edt_UI_validator_type_alpha"},{name:"alpha numeric",id:e.VALIDATOR_TYPE_ALPHANUMERIC,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_ALPHANUMERIC),i18n:"edt_UI_validator_type_alphanumeric"},{name:"alpha space",id:e.VALIDATOR_TYPE_ALPHASPACE,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_ALPHASPACE),i18n:"edt_UI_validator_type_alphaspace"},{name:"alpha numeric space",id:e.VALIDATOR_TYPE_ALPHANUMERICSPACE,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_ALPHANUMERICSPACE),i18n:"edt_UI_validator_type_alphanumericspace"},{name:"numeric",id:e.VALIDATOR_TYPE_NUMERIC,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_NUMERIC),i18n:"edt_UI_validator_type_numeric"},{name:"numeric plus",id:e.VALIDATOR_TYPE_NUMERICPLUS,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_NUMERICPLUS),i18n:"edt_UI_validator_type_numericplus"},{name:"Url Web Page",id:e.VALIDATOR_TYPE_URL_WEB_PAGE,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_URL_WEB_PAGE),i18n:"edt_UI_validator_type_web_page"},{name:"Url Image",id:e.VALIDATOR_TYPE_URL_IMAGE,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_URL_IMAGE),i18n:"edt_UI_validator_type_url_image"},{name:"yy/mm/dd",id:e.VALIDATOR_TYPE_DATE_YYYYMMDD,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_DATE_YYYYMMDD),i18n:"edt_UI_validator_type_date_yyyymmdd"},{name:"dd/mm/yyyy",id:e.VALIDATOR_TYPE_DATE_DDMMYYYY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_DATE_DDMMYYYY),i18n:"edt_UI_validator_type_date_ddmmyyyy"},{name:"mm/dd/yyyy",id:e.VALIDATOR_TYPE_DATE_MMDDYYYY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_DATE_MMDDYYYY),i18n:"edt_UI_validator_type_date_mmddyyyy"},{name:"mm/yyyy",id:e.VALIDATOR_TYPE_DATE_MMYYYY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_DATE_MMYYYY),i18n:"edt_UI_validator_type_date_mmyyyy"},{name:"Time",id:e.VALIDATOR_TYPE_TIME,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_TIME),i18n:"edt_UI_validator_type_time"},{name:"Time AM/PM",id:e.VALIDATOR_TYPE_TIME_AMPM,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_TIME_AMPM),i18n:"edt_UI_validator_type_time_ampm"},{name:"full name",id:e.VALIDATOR_TYPE_FULL_NAME,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_FULL_NAME),i18n:"edt_UI_validator_type_full_name"},{name:"regular expression",id:e.VALIDATOR_TYPE_REGEX,isSupported:this.userService.canUseValidator(e.VALIDATOR_TYPE_REGEX),i18n:"edt_UI_validator_type_regex"},{name:"custom",id:e.VALIDATOR_TYPE_CUSTOM,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_CUSTOM),i18n:"edt_UI_validator_type_custom"},{name:"blank",id:e.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY_INCLUDING_BLANK_PASSWORDS,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY_INCLUDING_BLANK_PASSWORDS),i18n:"edt_UI_validator_type_password_any_complexity_including_blank"},{name:"any",id:e.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY),i18n:"edt_UI_validator_type_password_any_complexity"},{name:"minimal",id:e.VALIDATOR_TYPE_PASSWORD_MIN_COMPLEXITY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD_MIN_COMPLEXITY),i18n:"edt_UI_validator_type_password_min_complexity"},{name:"medium",id:e.VALIDATOR_TYPE_PASSWORD_MED_COMPLEXITY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD_MED_COMPLEXITY),i18n:"edt_UI_validator_type_password_med_complexity"},{name:"corporate",id:e.VALIDATOR_TYPE_PASSWORD_CORPORATE_COMPLEXITY,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PASSWORD_CORPORATE_COMPLEXITY),i18n:"edt_UI_validator_type_password_corporate_complexity"},{name:"extra-low",id:e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_EXTRA_LOW,isSupported:this.isValidatorSupported(String(e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_EXTRA_LOW)),i18n:"edt_UI_validator_type_signature_complexity_extra_low"},{name:"low",id:e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_LOW,isSupported:this.isValidatorSupported(String(e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_LOW)),i18n:"edt_UI_validator_type_signature_complexity_low"},{name:"medium",id:e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_AVERAGE,isSupported:this.isValidatorSupported(String(e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_AVERAGE)),i18n:"edt_UI_validator_type_signature_complexity_average"},{name:"high",id:e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_HIGH,isSupported:this.isValidatorSupported(String(e.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_HIGH)),i18n:"edt_UI_validator_type_signature_complexity_high"},{name:"2-2-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_2_2_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_2_2_4),i18n:""},{name:"2-3-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_4),i18n:""},{name:"2-3-8",id:e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_8,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_8),i18n:""},{name:"2-4-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_2_4_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_2_4_4),i18n:""},{name:"2-5-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_2_5_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_2_5_4),i18n:""},{name:"3-3-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_4),i18n:""},{name:"3-3-3",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_3,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_3),i18n:""},{name:"3-3-7",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_7,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_7),i18n:""},{name:"3-4-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_4_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_4_4),i18n:""},{name:"3-2-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_4),i18n:""},{name:"3-2-6",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_6,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_6),i18n:""},{name:"3-2-7",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_7,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_7),i18n:""},{name:"3-5-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_3_5_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_3_5_4),i18n:""},{name:"4-3-3",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3),i18n:""},{name:"4-3-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_4),i18n:""},{name:"4-3-6",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_6,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_6),i18n:""},{name:"4-3-7",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_7,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_7),i18n:""},{name:"4-2-8",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_2_8,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_2_8),i18n:""},{name:"4-4-6",id:e.VALIDATOR_TYPE_PHONE_FORMAT_4_4_6,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_4_4_6),i18n:""},{name:"5-3-3",id:e.VALIDATOR_TYPE_PHONE_FORMAT_5_3_3,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_5_3_3),i18n:""},{name:"5-4-4",id:e.VALIDATOR_TYPE_PHONE_FORMAT_5_4_4,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_5_4_4),i18n:""},{name:"5-6",id:e.VALIDATOR_TYPE_PHONE_FORMAT_5_6,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_FORMAT_5_6),i18n:""},{name:"phone-any-format",id:e.VALIDATOR_TYPE_PHONE_ANY_FORMAT,isSupported:this.isValidatorSupported(e.VALIDATOR_TYPE_PHONE_ANY_FORMAT),i18n:""}],this.config.sort((function(e,t){var n=e.name.toLowerCase(),i=t.name.toLowerCase();return n===i?0:n<i?-1:1}))),this.config.slice(0)}},{key:"isValidatorSupported",value:function(e){for(var t=String(e),n=0,i=this.capabilities.factory.supportedValidationTypes.length;n<i;n++)if(String(this.capabilities.factory.supportedValidationTypes[n])===t)return!0;return!1}},{key:"getValidatorById",value:function(e){void 0===this.config&&this.enumerateValidators();for(var t=0,n=this.config.length;t<n;t++)if(this.config[t].id===e||null===e&&""===this.config[t].id)return this.config[t];return null}},{key:"validate",value:function(t,n){if(!n)return!0;switch(n){case e.VALIDATOR_TYPE_EMAIL:return this.validateEmailAddress(t);case e.VALIDATOR_TYPE_URL_WEB_PAGE:return this.validateWebAddress(t);case e.VALIDATOR_TYPE_PHONE_FORMAT_2_2_4:return this.validatePhoneNumberFormat(t,[2,2,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_4:return this.validatePhoneNumberFormat(t,[2,3,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_2_3_8:return this.validatePhoneNumberFormat(t,[2,3,8]);case e.VALIDATOR_TYPE_PHONE_FORMAT_2_4_4:return this.validatePhoneNumberFormat(t,[2,4,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_2_5_4:return this.validatePhoneNumberFormat(t,[2,5,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_4:return this.validatePhoneNumberFormat(t,[3,3,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_3:return this.validatePhoneNumberFormat(t,[3,3,3]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_3_7:return this.validatePhoneNumberFormat(t,[3,3,7]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_4_4:return this.validatePhoneNumberFormat(t,[3,4,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_4:return this.validatePhoneNumberFormat(t,[3,2,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_6:return this.validatePhoneNumberFormat(t,[3,2,6]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_2_7:return this.validatePhoneNumberFormat(t,[3,2,7]);case e.VALIDATOR_TYPE_PHONE_FORMAT_3_5_4:return this.validatePhoneNumberFormat(t,[3,5,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3:return this.validatePhoneNumberFormat(t,[4,3,3]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_4:return this.validatePhoneNumberFormat(t,[4,3,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_6:return this.validatePhoneNumberFormat(t,[4,3,6]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_3_7:return this.validatePhoneNumberFormat(t,[4,3,7]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_2_8:return this.validatePhoneNumberFormat(t,[4,2,8]);case e.VALIDATOR_TYPE_PHONE_FORMAT_4_4_6:return this.validatePhoneNumberFormat(t,[4,4,6]);case e.VALIDATOR_TYPE_PHONE_FORMAT_5_3_3:return this.validatePhoneNumberFormat(t,[5,3,3]);case e.VALIDATOR_TYPE_PHONE_FORMAT_5_4_4:return this.validatePhoneNumberFormat(t,[5,4,4]);case e.VALIDATOR_TYPE_PHONE_FORMAT_5_6:return this.validatePhoneNumberFormat(t,[5,6]);case e.VALIDATOR_TYPE_PHONE_ANY_FORMAT:return this.validatePhoneNumberWithAnyFormat(t);case e.VALIDATOR_TYPE_YOUTUBE_URL:return!!this.validateYoutubeVideoURL(t);case e.VALIDATOR_TYPE_VIMEO_URL:return!!this.validateVimeoVideoURL(t);case e.VALIDATOR_TYPE_WORDPRESS_TV_URL:return!!this.validateWordpressTVVideoUrl(t);case e.VALIDATOR_TYPE_TED_TALKS_URL:return!!this.validateTedTalksVideoURL(t);case e.VALIDATOR_TYPE_DAILYMOTION_URL:return!!this.validateDailyMotionVideoURL(t);case e.VALIDATOR_TYPE_MIXCLOUD_URL:return!!this.validateMixCloudAudioURL(t);case e.VALIDATOR_TYPE_SOUNDCLOUD_URL:return!!this.validateSoundCloudAudioURL(t);case e.VALIDATOR_TYPE_NFB_URL:return!!this.validateNFBVideoURL(t);case e.VALIDATOR_TYPE_KICKSTARTER_URL:return!!this.validateKickstarterVideoURL(t);case e.VALIDATOR_TYPE_TWITCH_URL:return!!this.validateTwitchVideoURL(t);case e.VALIDATOR_TYPE_PDF_URL:return!!this.validatePDFFileUrl(t);case e.FACEBOOK_POST_URL:return!!this.validateFacebookPostURL(t);case e.FACEBOOK_PAGE_URL:return!!this.validateFacebookPageURL(t);case e.VALIDATOR_TYPE_EMBEDDABLE_URL:return!!this.validateEmbeddableURL(t);case e.VALIDATOR_TYPE_EMBEDDABLE_FACEBOOK_URL:return!!this.validateEmbeddableFacebookURL(t);case e.VALIDATOR_TYPE_EMBEDDABLE_PDF_URL:return!!this.validateEmbeddablePdfURL(t);case e.VALIDATOR_TYPE_EMBEDDABLE_VIDEO_URL:return!!this.validateEmbeddableVideoURL(t);default:return!1}}},{key:"validateEmailAddress",value:function(e){return"string"===typeof e&&(""!==e&&/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e))}},{key:"validatePhoneNumberWithAnyFormat",value:function(e){return""!==e&&(!(e.toString().replace(/\D+/g,"").length<4)&&/^\+?([0-9. \- \( \)]+)$/.test(e))}},{key:"validatePhoneNumberFormat",value:function(e,t){if("string"!==typeof e)return!1;if(""===e)return!1;var n=this.phoneUtils.parsePhoneNumber(e);if(null==n)return!0;if(null==n.localPhoneNumber)return!0;var i="";return i=void 0!==t[2]?"^[0-9]{".concat(t[0]+t[1]+t[2],"}$"):"^[0-9]{".concat(t[0]+t[1],"}$"),new RegExp(i).test(n.localPhoneNumber)}},{key:"getSupportedUserPlanValidators",value:function(e){for(var t=[],n=0,i=e||[],r=i.length;n<r;n++)i[n].isSupported&&t.push(i[n]);return t.length?t:null}},{key:"validateWebAddress",value:function(e){return"string"===typeof e&&(""!==e&&/^(?:http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/i.test(e))}},{key:"validateYoutubeVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:y2u\.be\/|youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|v=)?)((\w|-){11})(?:\S+)?$/)&&(t={type:T.W.YOUTUBE_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateVimeoVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:player\.)?(?:vimeo\.com\/(?:video\/)?)((\w|-){9})(?:\S+)?$/)&&(t={type:T.W.VIMEO_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateWordpressTVVideoUrl",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:videopress\.com)(?:\/embed)?\/((\w|-){8,})(?:\S+)?$/)&&(t={type:T.W.WORDPRESS_TV_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateTedTalksVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:embed\.)?(?:ted\.com\/talks\/)(.+)$/)&&(t={type:T.W.TED_TALKS_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateDailyMotionVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:dailymotion\.com)\/(?:embed\/)?(?:video\/)(.+)$/)&&(t={type:T.W.DAILYMOTION_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateMixCloudAudioURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:mixcloud\.com)\/(?:widget\/iframe\/)?(?:\?feed=)(?:https?:\/\/)?(?:www\.)?(?:mixcloud\.com)\/(.+)$/)&&(t={type:T.W.MIXCLOUD_AUDIO,identifier:RegExp.$1,url:e}),t}},{key:"validateSoundCloudAudioURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:api\.)(?:soundcloud\.com)\/(?:tracks\/)(.+)$/)&&(t={type:T.W.SOUNDCLOUD_AUDIO,identifier:RegExp.$1,url:e}),t}},{key:"validateNFBVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:nfb\.ca\/film\/)(.+)(?:\/embed\/player\/)$/)&&(t={type:T.W.NFB_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateKickstarterVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:kickstarter\.com\/)(?:projects\/)?(.+)(?:\/widget\/video\.html)$/)&&(t={type:T.W.KICKSTARTER_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validateTwitchVideoURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:player\.)?(?:twitch\.tv\/)(?:\?video=|videos\/)(.+)$/)&&(t={type:T.W.TWITCH_VIDEO,identifier:RegExp.$1,url:e}),t}},{key:"validatePDFFileUrl",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(.*)(?:\.pdf)$/)&&(t={type:T.W.PDF_FILE,identifier:RegExp.$1,url:e}),t}},{key:"validateFacebookPostURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:facebook\.com\/)(.*\/posts\/.*)$/)&&(t={type:T.W.FACEBOOK_POST,identifier:RegExp.$1,url:e}),t}},{key:"validateFacebookPageURL",value:function(e){var t=null;if("string"!==typeof e)return null;if(""===e)return null;return e.match(/^(?:https?:\/\/)?(?:(?:[a-z]{2})-(?:[a-z]{2})\.|(?:www)\.)?(?:facebook\.com\/)(.+)(?:\/)?$/)&&(t={type:T.W.FACEBOOK_PAGE,identifier:RegExp.$1,url:e}),t}},{key:"validateEmbeddableURL",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T.V.ANY;if(n===T.V.VIDEO_OR_AUDIO){if(t=this.validateYoutubeVideoURL(e))return t;if(t=this.validateVimeoVideoURL(e))return t;if(t=this.validateWordpressTVVideoUrl(e))return t;if(t=this.validateTedTalksVideoURL(e))return t;if(t=this.validateDailyMotionVideoURL(e))return t;if(t=this.validateMixCloudAudioURL(e))return t;if(t=this.validateSoundCloudAudioURL(e))return t;if(t=this.validateNFBVideoURL(e))return t;if(t=this.validateKickstarterVideoURL(e))return t;if(t=this.validateTwitchVideoURL(e))return t}if(n===T.V.PDF&&(t=this.validatePDFFileUrl(e)))return t;if(n===T.V.FACEBOOK){if(t=this.validateFacebookPostURL(e))return t;if(t=this.validateFacebookPageURL(e))return t}return null}},{key:"validateEmbeddableVideoURL",value:function(e){return this.validateEmbeddableURL(e,T.V.VIDEO_OR_AUDIO)}},{key:"validateEmbeddableFacebookURL",value:function(e){return this.validateEmbeddableURL(e,T.V.FACEBOOK)}},{key:"validateEmbeddablePdfURL",value:function(e){return this.validateEmbeddableURL(e,T.V.PDF)}}]),e}();function me(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ee,"VALIDATOR_TYPE_NONE",null),v()(Ee,"VALIDATOR_TYPE_EMAIL","email"),v()(Ee,"VALIDATOR_TYPE_PASSWORD","password"),v()(Ee,"VALIDATOR_TYPE_UNSIGNED_INTEGER","integer"),v()(Ee,"VALIDATOR_TYPE_ALPHA","alpha"),v()(Ee,"VALIDATOR_TYPE_ALPHANUMERIC","alphanumeric"),v()(Ee,"VALIDATOR_TYPE_ALPHASPACE","alphaspace"),v()(Ee,"VALIDATOR_TYPE_ALPHANUMERICSPACE","alphanumericspace"),v()(Ee,"VALIDATOR_TYPE_NUMERIC","numeric"),v()(Ee,"VALIDATOR_TYPE_NUMERICPLUS","numericplus"),v()(Ee,"VALIDATOR_TYPE_URL_WEB_PAGE","url"),v()(Ee,"VALIDATOR_TYPE_URL_IMAGE","url-image"),v()(Ee,"VALIDATOR_TYPE_DATE_YYYYMMDD","dateyyyymmdd"),v()(Ee,"VALIDATOR_TYPE_DATE_DDMMYYYY","dateddmmyyyy"),v()(Ee,"VALIDATOR_TYPE_DATE_MMDDYYYY","datemmddyyyy"),v()(Ee,"VALIDATOR_TYPE_DATE_MMYYYY","datemmyyyy"),v()(Ee,"VALIDATOR_TYPE_TIME","time"),v()(Ee,"VALIDATOR_TYPE_TIME_AMPM","time_ampm"),v()(Ee,"VALIDATOR_TYPE_FULL_NAME","full_name"),v()(Ee,"VALIDATOR_TYPE_REGEX","regex"),v()(Ee,"VALIDATOR_TYPE_CUSTOM","custom"),v()(Ee,"VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY_INCLUDING_BLANK_PASSWORDS","password-complexity-any-inluding-blank-passwords"),v()(Ee,"VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY","password-complexity-any"),v()(Ee,"VALIDATOR_TYPE_PASSWORD_MIN_COMPLEXITY","password-complexity-minimum"),v()(Ee,"VALIDATOR_TYPE_PASSWORD_MED_COMPLEXITY","password-complexity-medium"),v()(Ee,"VALIDATOR_TYPE_PASSWORD_CORPORATE_COMPLEXITY","password-complexity-master"),v()(Ee,"VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_EXTRA_LOW",0),v()(Ee,"VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_LOW",1),v()(Ee,"VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_AVERAGE",2),v()(Ee,"VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_HIGH",3),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_2_2_4","2-2-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_2_3_4","2-3-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_2_3_8","2-3-8"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_2_4_4","2-4-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_2_5_4","2-5-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_3_4","3-3-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_3_3","3-3-3"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_3_7","3-3-7"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_4_4","3-4-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_2_4","3-2-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_2_6","3-2-6"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_2_7","3-2-7"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_3_5_4","3-5-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_3_3","4-3-3"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_3_4","4-3-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_3_6","4-3-6"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_3_7","4-3-7"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_2_8","4-2-8"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_4_4_6","4-4-6"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_5_3_3","5-3-3"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_5_4_4","5-4-4"),v()(Ee,"VALIDATOR_TYPE_PHONE_FORMAT_5_6","5-6"),v()(Ee,"VALIDATOR_TYPE_PHONE_ANY_FORMAT","phone-any-format"),v()(Ee,"VALIDATOR_TYPE_YOUTUBE_URL","youtube-url"),v()(Ee,"VALIDATOR_TYPE_VIMEO_URL","vimeo-url"),v()(Ee,"VALIDATOR_TYPE_WORDPRESS_TV_URL","wordpress-tv-url"),v()(Ee,"VALIDATOR_TYPE_TED_TALKS_URL","ted-talks-url"),v()(Ee,"VALIDATOR_TYPE_DAILYMOTION_URL","dailymotion-url"),v()(Ee,"VALIDATOR_TYPE_MIXCLOUD_URL","mixcloud-url"),v()(Ee,"VALIDATOR_TYPE_SOUNDCLOUD_URL","soundcloud-url"),v()(Ee,"VALIDATOR_TYPE_NFB_URL","nfb-url"),v()(Ee,"VALIDATOR_TYPE_KICKSTARTER_URL","kickstarter-url"),v()(Ee,"VALIDATOR_TYPE_TWITCH_URL","twitch-url"),v()(Ee,"VALIDATOR_TYPE_PDF_URL","pdf-url"),v()(Ee,"FACEBOOK_POST_URL","facebook-post-url"),v()(Ee,"FACEBOOK_PAGE_URL","facebook-page-url"),v()(Ee,"VALIDATOR_TYPE_EMBEDDABLE_URL","embeddable-url"),v()(Ee,"VALIDATOR_TYPE_EMBEDDABLE_VIDEO_URL","embeddable-video-url"),v()(Ee,"VALIDATOR_TYPE_EMBEDDABLE_PDF_URL","embeddable-pdf-url"),v()(Ee,"VALIDATOR_TYPE_EMBEDDABLE_FACEBOOK_URL","embeddable-facebook-url");var ve=function(e){g()(n,e);var t=me(n);function n(e){var i;return o()(this,n),(i=t.call(this,e.componentName,"span")).rootNode.setAttribute("contenteditable","false"),i.rootNode.innerText=e.caption,i.rootNode.dataset.value=e.value,!0===e.isVariable&&i.rootNode.classList.add("is-variable"),e.isDeleted&&i.rootNode.setAttribute("data-is-deleted-field","".concat(e.isDeleted)),i.rootNode.addEventListener("click",(function(e){if(!i.rootNode.parentElement.hasAttribute("data-fully-disabled")){var t=i.rootNode.nextSibling;null!==t&&t.nodeType===Node.TEXT_NODE&&(0===t.textContent.trim().length?i.rootNode.parentNode.removeChild(i.rootNode.nextSibling):t.nodeValue=t.textContent.trim()),i.delete()}})),i.on("append",(function(){i.appendSpacesBeforeAndAfter()})),i.on("replace",(function(){i.appendSpacesBeforeAndAfter()})),i.on("insert",(function(){i.appendSpacesBeforeAndAfter()})),i}return l()(n,[{key:"getValue",value:function(){return this.rootNode.dataset.value}},{key:"setValue",value:function(e){}},{key:"appendSpacesBeforeAndAfter",value:function(){for(var e=this.rootNode.parentNode.childNodes,t=0,i=e.length;t<i;t++)if(e[t]===this.rootNode){t>0&&e[t-1].nodeType!==Node.TEXT_NODE?this.rootNode.insertAdjacentText("beforebegin",String.fromCharCode(n.THIN_SPACE_CHAR_CODE)):t>0&&e[t-1].nodeType===Node.TEXT_NODE&&e[t-1].nodeValue.charCodeAt(e[t-1].nodeValue.length-1)!==n.THIN_SPACE_CHAR_CODE&&(e[t-1].nodeValue=e[t-1].nodeValue+String.fromCharCode(n.THIN_SPACE_CHAR_CODE)),e[t+1]&&e[t+1].nodeType===Node.TEXT_NODE?e[t+1].nodeType===Node.TEXT_NODE&&e[t+1].nodeValue.charCodeAt(0)!==n.THIN_SPACE_CHAR_CODE&&(e[t+1].nodeValue=String.fromCharCode(n.THIN_SPACE_CHAR_CODE)+e[t+1].nodeValue):this.rootNode.insertAdjacentHTML("afterend",String.fromCharCode(n.THIN_SPACE_CHAR_CODE));break}0===i&&this.rootNode.insertAdjacentHTML("afterend",String.fromCharCode(n.THIN_SPACE_CHAR_CODE))}}]),n}(M);v()(ve,"THIN_SPACE_CHAR_CODE",8201);var Te=function(){function e(){o()(this,e)}return l()(e,null,[{key:"HSVtoRGB",value:function(e){var t,n,i,r,a,o,s,l,u=e[1],c=e[2],d=e[0];switch(o=c*(1-u),s=c*(1-(a=6*d-(r=6*d|0))*u),l=c*(1-(1-a)*u),r%6){case 0:t=c,n=l,i=o;break;case 1:t=s,n=c,i=o;break;case 2:t=o,n=c,i=l;break;case 3:t=o,n=s,i=c;break;case 4:t=l,n=o,i=c;break;case 5:t=c,n=o,i=s}return[255*t|0,255*n|0,255*i|0,void 0===e[3]?1:e[3]]}},{key:"diffc",value:function(e,t,n){return(t-e)/6/n+.5}},{key:"RGBtoHSV",value:function(e){var t,n,i,r,a,o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l);return 0==c?r=a=0:(a=c/u,t=this.diffc(o,u,c),n=this.diffc(s,u,c),i=this.diffc(l,u,c),o===u?r=i-n:s===u?r=1/3+t-i:l===u&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[r,a,u,void 0===e[3]?1:e[3]]}},{key:"strPad",value:function(e){return e.length<2?"0".concat(e):e}},{key:"RGBToString",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t[3]||t[3]>.99){var i="#".concat(this.strPad(t[0].toString(16))).concat(e.strPad(t[1].toString(16))).concat(e.strPad(t[2].toString(16)));if(n)for(var r in this.standardHTMLColors)if(this.standardHTMLColors[r]===i)return r;return i}return 0===t[3]?"transparent":"rgba(".concat(t[0],",").concat(t[1],",").concat(t[2],",").concat(t[3].toFixed(2).replace(/^0\./,".").replace(/\.00$/,"").replace(/[0]+$/,"").replace(/^\.$/,"")||"0",")")}},{key:"HSVToString",value:function(t){return e.RGBToString(e.HSVtoRGB(t))}},{key:"stringToRGB",value:function(t){var n,i=[0,0,0,1],r=String(t||"").toLowerCase();switch(!0){case"transparent"===r:i[3]=0;break;case void 0!==e.standardHTMLColors[r]:return e.stringToRGB(e.standardHTMLColors[r]);case!!(n=/^#[a-f0-9]{3}$/.exec(r)):i[0]=parseInt(r[1]+r[1],16),i[1]=parseInt(r[2]+r[2],16),i[2]=parseInt(r[3]+r[3],16);break;case!!(n=/^#[a-f0-9]{6}$/.exec(r)):i[0]=parseInt(r[1]+r[2],16),i[1]=parseInt(r[3]+r[4],16),i[2]=parseInt(r[5]+r[6],16);break;case!!(n=/^rgb\(([\s]+)?([\d]+)([\s]+)?,([\s]+)?([\d]+)([\s]+)?,([\s]+)?([\d]+)([\s]+)?\)$/.exec(r)):if(i[0]=parseInt(n[2]),i[1]=parseInt(n[5]),i[2]=parseInt(n[8]),i[0]>255||i[1]>255||i[2]>255)return null;break;case!!(n=/^rgba\(([\s]+)?([\d]+)([\s]+)?,([\s]+)?([\d]+)([\s]+)?,([\s]+)?([\d]+)([\s]+)?,([\s]+)?([\d\.]+)([\s]+)?\)$/.exec(r)):if(i[0]=parseInt(n[2]),i[1]=parseInt(n[5]),i[2]=parseInt(n[8]),i[3]=parseFloat(n[11]),i[0]>255||i[1]>255||i[2]>255||isNaN(i[3])||!isFinite(i[3])||i[3]>1)return null;break;default:return null}return i}},{key:"areEqualRGBColors",value:function(e,t){return!(!e||!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3])}},{key:"removeAlpha",value:function(e){var t=e.slice(0,3);return t.push(1),t}}]),e}();v()(Te,"standardHTMLColors",{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred  ":"#cd5c5c","indigo   ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});var Oe=function e(){o()(this,e)};function Ce(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ne(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}v()(Oe,"ELEMENT_NOT_SUPPORTED",-2),v()(Oe,"ELEMENT_TYPE_FORM",-1),v()(Oe,"CONTAINER_TYPE_ROW",0),v()(Oe,"CONTROL_TYPE_ADDRESS",1),v()(Oe,"CONTROL_TYPE_CHECKBOX",2),v()(Oe,"CONTROL_TYPE_DATE",3),v()(Oe,"CONTROL_TYPE_DROPDOWN",4),v()(Oe,"CONTROL_TYPE_EMAIL",5),v()(Oe,"CONTROL_TYPE_FILE",6),v()(Oe,"CONTROL_TYPE_HEADING",7),v()(Oe,"CONTROL_TYPE_HTML_BLOCK",8),v()(Oe,"CONTROL_TYPE_IMAGE",9),v()(Oe,"CONTROL_TYPE_LIKERT_SCALE",10),v()(Oe,"CONTROL_TYPE_MAP",11),v()(Oe,"CONTROL_TYPE_NAME",12),v()(Oe,"CONTROL_TYPE_NUMBER",13),v()(Oe,"CONTROL_TYPE_PAGE_BREAK",14),v()(Oe,"CONTROL_TYPE_PASSWORD",15),v()(Oe,"CONTROL_TYPE_PHONE",16),v()(Oe,"CONTROL_TYPE_PRICE",17),v()(Oe,"CONTROL_TYPE_RADIO",18),v()(Oe,"CONTROL_TYPE_SIGNATURE",19),v()(Oe,"CONTROL_TYPE_SOCIAL",20),v()(Oe,"CONTROL_TYPE_STAR_RATING",21),v()(Oe,"CONTROL_TYPE_TERMS_OF_SERVICE",22),v()(Oe,"CONTROL_TYPE_TEXT",23),v()(Oe,"CONTROL_TYPE_TEXTAREA",24),v()(Oe,"CONTROL_TYPE_TIME",25),v()(Oe,"CONTROL_TYPE_WEBSITE",26),v()(Oe,"CONTROL_TYPE_FORM_HEADER",27),v()(Oe,"CONTROL_TYPE_CAPTCHA",28),v()(Oe,"CONTROL_TYPE_ACTION_BAR",29),v()(Oe,"CONTROL_TYPE_WIDGET_VIDEO",30),v()(Oe,"CONTROL_TYPE_WIDGET_FACEBOOK",31),v()(Oe,"CONTROL_TYPE_WIDGET_PDF",32),v()(Oe,"CONTROL_TYPE_FORMULA",33),v()(Oe,"CONTROL_TYPE_FEE",34),v()(Oe,"CONTROL_TYPE_COUPON",100),v()(Oe,"CONTROL_TYPE_SEPARATOR",9999),v()(Oe,"VIRTUAL_SELECTION_CONTROL",1e4),v()(Oe,"CONTAINER_TYPE_DIV",9e4),v()(Oe,"CONTAINER_TYPE_PAGE",90001),v()(Oe,"CONTAINER_TYPE_LIKERT_WRAPPER",90002),v()(Oe,"CONTAINER_TYPE_REPEATABLE",90003),v()(Oe,"CONTAINER_TYPE_REPEATABLE_GROUP",90004),v()(Oe,"CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE",91001),v()(Oe,"LAYOUT_TYPE_FIELDSET",null);var Ae,be,Re=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getLanguagesList",value:function(){return this.LANGUAGES_LIST}},{key:"getLanguageObjectByCode",value:function(e){var t,n=Ce(this.LANGUAGES_LIST);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.code2===e||i.code3===e)return i}}catch(r){n.e(r)}finally{n.f()}return null}}]),e}();v()(Re,"LANGUAGES_LIST",[{code3:"afr",code2:"af",name:"Afrikaans",native_name:"Afrikaans"},{code3:"alb",code2:"al",name:"Albanian",native_name:"Shqip"},{code3:"anp",code2:null,name:"Angika",native_name:"Angika"},{code3:"ara",code2:"sa",name:"Arabic",native_name:"\u0627\u0644\u0639\u064e\u0631\u064e\u0628\u0650\u064a\u064e\u0651\u0629"},{code3:"arm",code2:"am",name:"Armenian",native_name:" \u0540\u0561\u0575\u0565\u0580\u0565\u0576"},{code3:"asm",code2:"as",name:"Assamese",native_name:"\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be"},{code3:"ast",code2:null,name:"Asturian",native_name:"Asturianu"},{code3:"ave",code2:"ae",name:"Avestan",native_name:"Avestan"},{code3:"awa",code2:null,name:"Awadhi",native_name:"\u0905\u0935\u0927\u0940"},{code3:"aym",code2:"ay",name:"Aymara",native_name:"Aymar aru"},{code3:"aze",code2:"az",name:"Azerbaijani",native_name:"Az\u0259rbaycan dil"},{code3:"bam",code2:"bm",name:"Bambara",native_name:"Bambara"},{code3:"bas",code2:null,name:"Basa",native_name:"Mbene; \u0181asa\xe1"},{code3:"bak",code2:"ba",name:"Bashkir",native_name:"\u0411\u0430\u0448\u04a1\u043e\u0440\u0442 \u0442\u0435\u043b\u0435"},{code3:"baq",code2:"eu",name:"Basque",native_name:"euskara"},{code3:"bel",code2:"by",name:"Belarusian",native_name:"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f \u043c\u043e\u0432\u0430"},{code3:"ben",code2:"bn",name:"Bengali",native_name:"\u09ac\u09be\u0982\u09b2\u09be"},{code3:"bho",code2:null,name:"Bhojpuri",native_name:"\u092d\u094b\u091c\u092a\u0941\u0930\u0940"},{code3:"bih",code2:"bh",name:"Bihari languages",native_name:"Bihari languages"},{code3:"bis",code2:"bi",name:"Bislama",native_name:"Bislama"},{code3:"bos",code2:"bs",name:"Bosnian",native_name:"\u0431\u043e\u0441\u0430\u043d\u0441\u043a\u0438"},{code3:"bre",code2:"br",name:"Breton",native_name:"Brezhoneg"},{code3:"bul",code2:"bg",name:"Bulgarian",native_name:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a"},{code3:"bur",code2:null,name:"Burmese",native_name:"Burmese"},{code3:"cas",code2:null,name:"Castilian",native_name:"Castellano"},{code3:"cat",code2:"ca",name:"Catalan",native_name:"Catal\xe0"},{code3:"khm",code2:"km",name:"Central Khmer",native_name:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a"},{code3:"che",code2:"ce",name:"Chechen",native_name:"\u041d\u043e\u0445\u0447\u0438\u0439\u043d \u043c\u043e\u0442\u0442"},{code3:"chi",code2:"cn",name:"Chinese",native_name:"\u4e2d\u6587"},{code3:"chv",code2:"cv",name:"Chuvash",native_name:"\u0427\u04d1\u0432\u0430\u0448\u043b\u0430"},{code3:"cor",code2:"kw",name:"Cornish",native_name:"Kernowek"},{code3:"cos",code2:"co",name:"Corsican",native_name:"Corsu"},{code3:"cre",code2:"cr",name:"Cree",native_name:"Cree"},{code3:"cro",code2:"hr",name:"Croatian",native_name:"Croatian"},{code3:"ces",code2:"cz",name:"Czech",native_name:"\u010de\u0161tina"},{code3:"dan",code2:"dk",name:"Danish",native_name:"Dansk"},{code3:"dut",code2:"nl",name:"Dutch",native_name:"Nederlands"},{code3:"dzo",code2:"dz",name:"Dzongkha",native_name:"Dzongkha"},{code3:"eng",code2:"en",name:"English",native_name:"English"},{code3:"epo",code2:"eo",name:"Esperanto",native_name:"Esperanto"},{code3:"est",code2:"ee",name:"Estonian",native_name:"Eesti keel"},{code3:"ewe",code2:null,name:"Ewe",native_name:"\xc8\u028begbe"},{code3:"fao",code2:"fo",name:"Faroese",native_name:"f\xf8royskt"},{code3:"fij",code2:"fj",name:"Fijian",native_name:"Na Vosa Vakaviti"},{code3:"fil",code2:"ph",name:"Filipino",native_name:"Wikang Filipino"},{code3:"fin",code2:"fi",name:"Finnish",native_name:"Suomen kieli"},{code3:"fle",code2:"be",name:"Flemish",native_name:"Flemish"},{code3:"fra",code2:"fr",name:"French",native_name:"Fran\xe7ais"},{code3:"gla",code2:"gd",name:"Gaelic; Scottish Gaelic",native_name:"G\xe0idhlig"},{code3:"glg",code2:"gl",name:"Galician",native_name:"galego"},{code3:"lug",code2:"lg",name:"Ganda",native_name:"Luganda"},{code3:"geo",code2:"ka",name:"Georgian",native_name:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8"},{code3:"deu",code2:"de",name:"German",native_name:"Deutsch"},{code3:"grc",code2:"gr",name:"Greek",native_name:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},{code3:"grn",code2:"gn",name:"Guarani",native_name:"Ava\xf1e'\u1ebd"},{code3:"guj",code2:"gu",name:"Gujarati",native_name:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0"},{code3:"hat",code2:"ht",name:"Haitian; Haitian Creole",native_name:"Krey\xf2l ayisyen"},{code3:"hau",code2:"ha",name:"Hausa",native_name:" \u0647\u064e\u0631\u0652\u0634\u064e\u0646"},{code3:"heb",code2:"il",name:"Hebrew",native_name:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200e"},{code3:"her",code2:"hz",name:"Herero",native_name:"Otjiherero"},{code3:"hil",code2:null,name:"Hiligaynon",native_name:"Ilonggo"},{code3:"hin",code2:null,name:"Hindi-Urdu",native_name:"\u0939\u093f\u0928\u094d\u0926\u0940"},{code3:"hmo",code2:"ho",name:"Hiri Motu",native_name:"Hiri Motu"},{code3:"hun",code2:"hu",name:"Hungarian",native_name:"Magyar"},{code3:"ice",code2:"is",name:"Icelandic",native_name:"\xedslenska"},{code3:"ido",code2:"io",name:"Ido",native_name:"Ido"},{code3:"ibo",code2:"ig",name:"Igbo",native_name:"As\u1ee5s\u1ee5 Igbo"},{code3:"ind",code2:"id",name:"Indonesian",native_name:"Bahasa Indonesia"},{code3:"iku",code2:"iu",name:"Inuktitut",native_name:"Inuktitut"},{code3:"ipk",code2:"ik",name:"Inupiaq",native_name:"I\xf1upiaq"},{code3:"gle",code2:"ie",name:"Irish",native_name:"Gaeilge"},{code3:"ita",code2:"it",name:"Italian",native_name:"Italiano"},{code3:"jpn",code2:"jp",name:"Japanese",native_name:"\u65e5\u672c\u8a9e"},{code3:"jav",code2:"jv",name:"Javanese",native_name:"Javanese"},{code3:"kan",code2:"kn",name:"Kannada",native_name:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1"},{code3:"kau",code2:null,name:"Kanuri",native_name:"Kanuri"},{code3:"kas",code2:"ks",name:"Kashmiri",native_name:"\u0915\u0949\u0936\u0941\u0930 / \u0643\u0623\u0634\u064f\u0631"},{code3:"kaz",code2:"kk",name:"Kazakh",native_name:"\u049b\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456"},{code3:"kon",code2:"kg",name:"Kongo",native_name:"Kongo"},{code3:"kor",code2:"kr",name:"Korean",native_name:"\ud55c\uad6d\uc5b4"},{code3:"kos",code2:null,name:"Kosraean",native_name:"Kosraean"},{code3:"kua",code2:"kj",name:"Kuanyama; Kwanyama",native_name:"Kuanyama"},{code3:"kur",code2:"ku",name:"Kurdish",native_name:"Kurd\xee / \u06a9\u0648\u0631\u062f\u06cc\u200e"},{code3:"lao",code2:"lo",name:"Lao",native_name:"\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7"},{code3:"lat",code2:"la",name:"Latin",native_name:"Lingua lat\u012bna"},{code3:"lav",code2:"lv",name:"Latvian",native_name:"Latvie\u0161u"},{code3:"lin",code2:"ln",name:"Lingala",native_name:"Lingala"},{code3:"lit",code2:"lt",name:"Lithuanian",native_name:"lietuvi\u0173 kalba"},{code3:"ltz",code2:"lu",name:"Luxembourgish; Letzeburgesch",native_name:"L\xebtzebuergesch"},{code3:"mac",code2:"mk",name:"Macedonian",native_name:"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 \u0458\u0430\u0437\u0438\u043a"},{code3:"mlg",code2:"mg",name:"Malagasy",native_name:"Malagasy"},{code3:"may",code2:"my",name:"Malay",native_name:"Bahasa Melayu"},{code3:"mlt",code2:"mt",name:"Maltese",native_name:"Malti"},{code3:"glv",code2:"gv",name:"Manx",native_name:"Gaelg; Gailck"},{code3:"mao",code2:"mi",name:"Maori",native_name:"Te Reo M\u0101ori"},{code3:"mar",code2:null,name:"Marathi",native_name:"\u092e\u0930\u093e\u0920\u0940"},{code3:"mah",code2:"mh",name:"Marshallese",native_name:"Kajin M\u0327aje\u013c"},{code3:"mon",code2:"mn",name:"Mongolian",native_name:"\u043c\u043e\u043d\u0433\u043e\u043b \u0445\u044d\u043b"},{code3:"cnr",code2:"me",name:"Montenegrin",native_name:"c\u0446\u0440\u043d\u043e\u0433\u043e\u0440\u0441\u043a\u0438"},{code3:"nep",code2:null,name:"Nepali",native_name:"\u0928\u0947\u092a\u093e\u0932\u0940 \u092d\u093e\u0937\u093e"},{code3:"nor",code2:"no",name:"Norwegian",native_name:"Norsk"},{code3:"nob",code2:"nb",name:"Norwegian Bokm\xe5l",native_name:"Bokm\xe5l"},{code3:"nno",code2:"nn",name:"Norwegian Nynorsk",native_name:"Nynorsk"},{code3:"oji",code2:"oj",name:"Ojibwa",native_name:"Ojibwa"},{code3:"ori",code2:"or",name:"Oriya",native_name:"\u0b13\u0b21\u0b3c\u0b3f\u0b06"},{code3:"orm",code2:"om",name:"Oromo",native_name:"Afaan Oromoo"},{code3:"oss",code2:"os",name:"Ossetian; Ossetic",native_name:"\u0418\u0440\u043e\u043d \xe6\u0432\u0437\u0430\u0433"},{code3:"pli",code2:"pi",name:"Pali",native_name:"P\u0101li"},{code3:"pas",code2:null,name:"Pashto",native_name:"\u067e\u069a\u062a\u0648"},{code3:"fas",code2:"fa",name:"Persian",native_name:"\u0641\u0627\u0631\u0633\u06cc"},{code3:"pol",code2:"pl",name:"Polish",native_name:"Polski"},{code3:"por",code2:"pt",name:"Portuguese",native_name:"Portugu\xeas"},{code3:"pun",code2:null,name:"Punjabi",native_name:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 / \u067e\u0646\u062c\u0627\u0628\u06cc\u200e"},{code3:"que",code2:"qu",name:"Quechua",native_name:"kichwa simii"},{code3:"ron",code2:"ro",name:"Romanian",native_name:"Rom\xe2n\u0103"},{code3:"run",code2:"rn",name:"Rundi",native_name:"Ikirundi"},{code3:"rus",code2:"ru",name:"Russian",native_name:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},{code3:"smo",code2:"sm",name:"Samoan",native_name:"Gagana fa\u02bba S\u0101moa"},{code3:"sag",code2:"sg",name:"Sango",native_name:"Y\xe2ng\xe2 t\xee s\xe4ng\xf6"},{code3:"san",code2:null,name:"Sanskrit",native_name:"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d"},{code3:"srd",code2:"sc",name:"Sardinian",native_name:"Sardu"},{code3:"srp",code2:"cs",name:"Serbo/Croatian",native_name:"Serbo/Croatian"},{code3:"sna",code2:"sn",name:"Shona",native_name:"ChiShona"},{code3:"iii",code2:"ii",name:"Sichuan Yi",native_name:"Sichuan Yi"},{code3:"bla",code2:null,name:"Siksika",native_name:"Siksika"},{code3:"snd",code2:"sd",name:"Sindhi",native_name:"\u0633\u0646\u068c\u064a / \u0938\u093f\u0928\u094d\u0927\u0940 / \u0a38\u0a3f\u0a70\u0a27\u0a40"},{code3:"sin",code2:null,name:"Sinhala; Sinhalese",native_name:"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd"},{code3:"slo",code2:"sk",name:"Slovak",native_name:"Sloven\u010dina"},{code3:"slv",code2:"si",name:"Slovenian",native_name:"Slovenski jezik"},{code3:"som",code2:"so",name:"Somali",native_name:"af Soomaali"},{code3:"sot",code2:"st",name:"Southern Sotho",native_name:"Sesotho [southern]"},{code3:"spa",code2:"es",name:"Spanish",native_name:"Espa\xf1ol"},{code3:"sun",code2:"su",name:"Sundanese",native_name:"Basa Sunda"},{code3:"swa",code2:"sw",name:"Swahili",native_name:"Kiswahili"},{code3:"ssw",code2:"ss",name:"Swati",native_name:"SiSwati"},{code3:"swe",code2:"se",name:"Swedish",native_name:"Svenska"},{code3:"gsw",code2:null,name:"Swiss German",native_name:"Schwiizerd\xfctsch"},{code3:"tgl",code2:"tl",name:"Tagalog",native_name:"Wikang Tagalog"},{code3:"tah",code2:"ty",name:"Tahitian",native_name:"Reo Tahiti"},{code3:"tam",code2:null,name:"Tamil",native_name:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"},{code3:"tel",code2:null,name:"Telugu",native_name:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"},{code3:"tha",code2:"th",name:"Thai",native_name:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22"},{code3:"bod",code2:"bo",name:"Tibetan",native_name:"Tibetan"},{code3:"tir",code2:"ti",name:"Tigrinya",native_name:"Tigrinya"},{code3:"ton",code2:"to",name:"Tonga (Tonga Islands)",native_name:"lea faka-Tonga"},{code3:"tso",code2:"ts",name:"Tsonga",native_name:"Xitsonga"},{code3:"tsn",code2:"tn",name:"Tswana",native_name:"Setswana"},{code3:"tur",code2:"tr",name:"Turkish",native_name:"T\xfcrk\xe7e"},{code3:"tuk",code2:"tk",name:"Turkmen",native_name:"T\xfcrkmen\xe7e"},{code3:"twi",code2:"tw",name:"Twi",native_name:"Twi"},{code3:"uig",code2:"ug",name:"Uighur; Uyghur",native_name:"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5  ; \u0626\u06c7\u064a\u063a\u06c7\u0631 \u062a\u0649\u0644\u0649"},{code3:"ukr",code2:"ua",name:"Ukrainian",native_name:"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430 \u043c\u043e\u0432\u0430"},{code3:"urd",code2:"ur",name:"Urdu",native_name:"\u0627\u064f\u0631\u062f\u064f\u0648\u200e"},{code3:"uzb",code2:"uz",name:"Uzbek",native_name:"\u0626\u0648\u0628\u06d0\u06a9 "},{code3:"val",code2:null,name:"Valencian",native_name:"Valenci\xe0"},{code3:"ven",code2:"ve",name:"Venda",native_name:"Tshiven\u1e13a"},{code3:"vie",code2:"vn",name:"Vietnamese",native_name:"Ti\u1ebfng Vi\u1ec7t"},{code3:"vol",code2:"vo",name:"Volap\xfck",native_name:"Volap\xfck"},{code3:"wak",code2:null,name:"Wakashan languages",native_name:"Wakashan languages"},{code3:"wln",code2:"wa",name:"Walloon",native_name:"Walon"},{code3:"cym",code2:"cy",name:"Welsh",native_name:"Cymraeg"},{code3:"wol",code2:"wo",name:"Wolof",native_name:"Wolof"},{code3:"wuu",code2:"wu",name:"Wu",native_name:"Wu"},{code3:"xho",code2:"xh",name:"Xhosa",native_name:"isiXhosa"},{code3:"yor",code2:"yo",name:"Yoruba",native_name:"\xe8d\xe8 Yor\xf9b\xe1"},{code3:"yue",code2:null,name:"Yue",native_name:"Yue"},{code3:"zha",code2:"za",name:"Zhuang; Chuang",native_name:"Vahcuengh / \u8a71\u50ee"}]),function(e){e.TEXT="text",e.TAG="tag"}(Ae||(Ae={})),function(e){e.SEARCHABLE_DROPDOWN="searchable-dropdown",e.DROPDOWN="dropdown",e.COLOR="color",e.DATE="date",e.TIME="time",e.FILE="file",e.STAR_RATING="star-rating",e.TAGS="tags",e.TAGS_LIST="tags-list",e.SINGLE_TAGS_LIST="single-tags-list",e.TAG="tag"}(be||(be={}));var Ie,Pe,Se=n(210),De=n(209),Le=function(){function e(){o()(this,e),v()(this,"rootNode",void 0),v()(this,"dropdown",void 0),this.rootNode=document.createElement("div"),this.rootNode.setAttribute("data-role","dropdown-component"),this.dropdown=document.createElement("select"),this.rootNode.appendChild(this.dropdown),this.rootNode.appendChild(document.createElement("div"))}return l()(e,[{key:"getRoot",value:function(){return this.rootNode}},{key:"getSelectedIndex",value:function(){return this.dropdown.selectedIndex}},{key:"setSelectedIndex",value:function(e){return this.dropdown.selectedIndex=e,this}},{key:"addGroup",value:function(e,t){var n=document.createElement("optgroup");return n.setAttribute("data-id",e),n.setAttribute("label",t),this.dropdown.appendChild(n),this}},{key:"addOption",value:function(e,t,n,i){var r=document.createElement("option");if(r.text=e.text,r.value=e.value,r.disabled=!!e.isSeparator||!!e.disabled,r.hidden=!!e.hidden,r.setAttribute("data-is-default",e.isDefault),i)this.dropdown.add(r,i.previousSibling);else if(t)this.dropdown.add(r,t.nextSibling);else if(n){var a=this.dropdown.querySelector('optgroup[data-id="'.concat(n,'"]'));a&&a.appendChild(r)}else this.dropdown.add(r);return this}},{key:"getOptionByValue",value:function(e){return Object(Se.a)(this.dropdown.options,(function(t){return t.value===e}))}},{key:"getOptionAt",value:function(e){return this.dropdown.options.item(e)}},{key:"removeOption",value:function(e){return this.dropdown.remove(e),this}},{key:"getValue",value:function(){return this.dropdown.value}},{key:"setValue",value:function(e){return this.dropdown.value=e,this}},{key:"hasValue",value:function(e){return Object(De.a)(this.dropdown.options,(function(t){return t.value===e}))}},{key:"getValues",value:function(){for(var e=[],t=0,n=this.dropdown.options.length;t<n;t++)e.push(this.dropdown.options[t].value);return e}},{key:"getTexts",value:function(){for(var e=[],t=0,n=this.dropdown.options.length;t<n;t++)e.push(this.dropdown.options[t].text);return e}},{key:"setValueByText",value:function(e){for(var t=0,n=this.dropdown.options.length;t<n;t++)if(this.dropdown.options[t].text===e){this.dropdown.selectedIndex=t;break}}},{key:"getText",value:function(){return this.dropdown.options[this.dropdown.selectedIndex].text}},{key:"clear",value:function(){for(;this.dropdown.options.length;)this.dropdown.remove(0);for(var e=this.dropdown.getElementsByTagName("optgroup");e.length;)this.dropdown.removeChild(e[0]);return this}},{key:"setOptions",value:function(e){this.clear();for(var t=0,n=e.length;t<n;t++)this.addOption(e[t]);return this}},{key:"setSelectedOptionByValue",value:function(e){this.dropdown.value=e}}]),e}();function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}!function(e){e[e.AND=0]="AND",e[e.OR=1]="OR"}(Ie||(Ie={})),function(e){e[e.and=Ie.AND]="and",e[e.or=Ie.OR]="or"}(Pe||(Pe={}));var Me,xe,we,Ue,Fe=function(){function e(t,n){o()(this,e),v()(this,"CONFIGURATION",void 0),v()(this,"rootNode",void 0),v()(this,"statementNode",void 0),v()(this,"statementComponent",void 0),v()(this,"i18n",void 0),v()(this,"statementPosition",void 0),t>e.MAX_NR_OF_STATEMENTS?console.error("reached MAX_NR_OF_STATEMENTS"):(this.statementPosition=t,this.CONFIGURATION=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){v()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.createDefaultConfiguration(),{},n),this.rootNode=document.createElement("div"),this.statementNode=document.createElement("div"),this.statementComponent=new Le,this.statementNode.setAttribute("data-role","rules-statement-component"),this.statementNode.appendChild(this.statementComponent.getRoot()),this.statementComponent.getRoot().onclick=function(e){e.stopPropagation()},this.getRootNode().setAttribute("data-role","rules-statement"),this.getRootNode().appendChild(this.statementNode))}return l()(e,[{key:"getStatementPosition",get:function(){return this.statementPosition}}]),l()(e,[{key:"withI18n",value:function(e){return this.i18n=e,this}},{key:"getRootNode",value:function(){return this.rootNode}},{key:"initialize",value:function(){var e=this,t=function(t,n){return e.i18n.translateTextDefault(t,n)},n=[{value:Ie.AND,text:t("notifications_rule_statement_and","and")},{value:Ie.OR,text:t("notifications_rule_statement_or","or")}];this.statementComponent.setOptions(n);var i=this.CONFIGURATION.selectedStatement;null!==i&&this.statementComponent.setValue(String(i))}},{key:"updateStatementPosition",value:function(e){this.statementPosition=e}},{key:"getSelectedStatement",value:function(){return parseInt(this.statementComponent.getValue(),10)}}],[{key:"createDefaultConfiguration",value:function(){return{selectedStatement:null}}}]),e}();function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Be(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Fe,"MAX_NR_OF_STATEMENTS",9),function(e){e[e.IS=0]="IS",e[e.IS_NOT=1]="IS_NOT",e[e.CONTAINS=2]="CONTAINS",e[e.DOES_NOT_CONTAIN=3]="DOES_NOT_CONTAIN",e[e.BEGINS_WITH=4]="BEGINS_WITH",e[e.ENDS_WITH=5]="ENDS_WITH",e[e.IS_GREATER_THAN=6]="IS_GREATER_THAN",e[e.IS_LESS_THAN=7]="IS_LESS_THAN",e[e.IS_CHECKED=8]="IS_CHECKED",e[e.IS_NOT_CHECKED=9]="IS_NOT_CHECKED",e[e.IS_SELECTED=10]="IS_SELECTED",e[e.IS_NOT_SELECTED=11]="IS_NOT_SELECTED"}(Me||(Me={})),function(e){e[e.is=Me.IS]="is",e[e.is_not=Me.IS_NOT]="is_not",e[e.contains=Me.CONTAINS]="contains",e[e.does_not_contain=Me.DOES_NOT_CONTAIN]="does_not_contain",e[e.begins_with=Me.BEGINS_WITH]="begins_with",e[e.ends_with=Me.ENDS_WITH]="ends_with",e[e.is_greater_than=Me.IS_GREATER_THAN]="is_greater_than",e[e.is_less_than=Me.IS_LESS_THAN]="is_less_than",e[e.is_checked=Me.IS_CHECKED]="is_checked",e[e.is_not_checked=Me.IS_NOT_CHECKED]="is_not_checked",e[e.is_selected=Me.IS_SELECTED]="is_selected",e[e.is_not_selected=Me.IS_NOT_SELECTED]="is_not_selected"}(xe||(xe={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.CHECKABLE=1]="CHECKABLE",e[e.SELECTABLE=2]="SELECTABLE",e[e.COMPARABLE=3]="COMPARABLE",e[e.MISSING=4]="MISSING"}(we||(we={})),function(e){e.ADD="add",e.REMOVE="remove",e.BOTH="both",e.NONE="none"}(Ue||(Ue={}));var Ve=function(e){g()(n,e);var t=Be(n);function n(e,i,r){var a;o()(this,n),a=t.call(this),v()(c()(a),"CONFIGURATION",void 0),v()(c()(a),"variableValueToConfigurationMap",void 0),v()(c()(a),"rootNode",void 0),v()(c()(a),"variableNode",void 0),v()(c()(a),"operatorNode",void 0),v()(c()(a),"valueNode",void 0),v()(c()(a),"optionNode",void 0),v()(c()(a),"variableComponent",void 0),v()(c()(a),"operatorComponent",void 0),v()(c()(a),"valueComponent",void 0),v()(c()(a),"valueInput",void 0),v()(c()(a),"i18n",void 0),v()(c()(a),"onVariableChanged",void 0),v()(c()(a),"onVariableBeforeChange",void 0),v()(c()(a),"onConditionAdded",void 0),v()(c()(a),"onConditionRemoved",void 0),v()(c()(a),"canAddCondition",void 0),v()(c()(a),"canRemoveCondition",void 0),v()(c()(a),"conditionPosition",void 0),v()(c()(a),"lastSelectedVariable",void 0),v()(c()(a),"onStatementAdded",void 0),v()(c()(a),"onStatementRemoved",void 0),a.conditionPosition=e,a.onVariableChanged=i,a.CONFIGURATION=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(n),!0).forEach((function(t){v()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.createDefaultConfiguration(),{},r),a.variableValueToConfigurationMap={},a.canAddCondition=!1,a.canRemoveCondition=!1,a.rootNode=document.createElement("div"),a.variableNode=document.createElement("div"),a.operatorNode=document.createElement("div"),a.valueNode=document.createElement("div"),a.optionNode=document.createElement("div"),a.variableComponent=new Le,a.operatorComponent=new Le,a.valueComponent=new Le,a.valueInput=document.createElement("input"),a.variableNode.setAttribute("data-role","rules-condition-variable"),a.variableNode.onclick=function(e){e.stopPropagation()},a.variableNode.appendChild(a.variableComponent.getRoot()),a.operatorNode.setAttribute("data-role","rules-condition-operator"),a.operatorNode.onclick=function(e){e.stopPropagation()},a.operatorNode.appendChild(a.operatorComponent.getRoot()),a.valueNode.setAttribute("data-role","rules-condition-value"),a.valueNode.onclick=function(e){e.stopPropagation()},a.valueNode.appendChild(a.valueComponent.getRoot()),a.valueNode.appendChild(a.valueInput),a.optionNode.setAttribute("data-role","rules-condition-option");var s=document.createElement("span");s.setAttribute("class","i123-close"),s.setAttribute("data-role","rules-condition-remove"),s.onclick=function(e){e.stopPropagation(),a.removeCondition()};var l=document.createElement("span");return l.setAttribute("class","i123-add"),l.setAttribute("data-role","rules-condition-add"),l.onclick=function(e){e.stopPropagation(),a.addCondition()},a.optionNode.appendChild(s),a.optionNode.appendChild(l),a.updateOptionVisibility(Ue.NONE,!0),a.getRootNode().setAttribute("data-role","rules-condition"),a.getRootNode().appendChild(a.variableNode),a.getRootNode().appendChild(a.operatorNode),a.getRootNode().appendChild(a.valueNode),a.getRootNode().appendChild(a.optionNode),a}return l()(n,[{key:"setCanAddCondition",set:function(e){this.canAddCondition=e}},{key:"setCanRemoveCondition",set:function(e){this.canRemoveCondition=e}},{key:"getConditionPosition",get:function(){return this.conditionPosition}}]),l()(n,[{key:"withI18n",value:function(e){return this.i18n=e,this}},{key:"getRootNode",value:function(){return this.rootNode}},{key:"initialize",value:function(){var e=this;this.updateVariableComponentOptions();var t=function(){var t=e.getVariable();t.type===we.MISSING?e.variableNode.setAttribute("data-missing","true"):e.variableNode.removeAttribute("data-missing"),t.skipConditions?e.getRootNode().setAttribute("data-skip","operator"):t.type===we.CHECKABLE||t.type===we.SELECTABLE?e.getRootNode().setAttribute("data-skip","value"):e.getRootNode().setAttribute("data-skip","")},i=this.variableComponent.getSelectedIndex();if(this.variableComponent.getRoot().addEventListener("focus",(function(){i=e.variableComponent.getSelectedIndex()})),this.variableComponent.getRoot().addEventListener("change",(function(){if(!e.onVariableBeforeChange)throw new Error("onVariableBeforeChange must be assigned!");if(!e.onVariableBeforeChange())return e.variableComponent.setSelectedIndex(i),void e.trigger("count-email-rules-not-supported");t(),e.updateOperator()&&e.updateValue();var n=e.getVariable(),r=e.lastSelectedVariable.value!==n.value&&n.skipConditions||e.lastSelectedVariable.skipConditions&&e.lastSelectedVariable.value!==n.value;e.onVariableChanged&&r&&e.onVariableChanged(n.skipConditions),n.skipConditions||1!==e.conditionPosition||e.autoUpdateOptionVisibility(),e.lastSelectedVariable=n})),this.operatorComponent.getRoot().addEventListener("change",(function(){e.updateValue(!0)})),this.valueComponent.getRoot().addEventListener("change",(function(){e.valueNode.hasAttribute("data-missing")&&e.valueNode.removeAttribute("data-missing")})),t(),this.updateOperator()){var r=this.CONFIGURATION.selectedOperator;if(null!==r&&this.operatorComponent.setValue(String(r)),this.updateValue()){var a=this.CONFIGURATION.selectedValue;null!==a&&(this.getValueType()===n.VALUE_TYPE_SELECT?-1!==this.valueComponent.getValues().indexOf(a)?this.valueComponent.setValue(a):-1!==this.valueComponent.getTexts().indexOf(a)?this.valueComponent.setValueByText(a):(this.valueComponent.addOption({value:a,text:this.i18n.translateText("payments_deletedField"),isSeparator:!0,hidden:!0}),this.valueComponent.setValue(a),this.valueNode.setAttribute("data-missing","true")):this.valueInput.value=a)}}this.initEventListeners(),this.lastSelectedVariable=this.getVariable()}},{key:"initEventListeners",value:function(){var e=this;if(!_e.isMobile()){var t=!1;this.getRootNode().onmouseenter=function(){e.getVariable().skipConditions||(t="none"===e.getRootNode().getAttribute("data-option-type"))&&e.autoUpdateOptionVisibility()},this.getRootNode().onmouseleave=function(){t&&!e.getVariable().skipConditions&&e.updateOptionVisibility(Ue.NONE)}}}},{key:"getOperator",value:function(){return parseInt(this.operatorComponent.getValue(),10)}},{key:"getValue",value:function(){return this.getValueType()===n.VALUE_TYPE_SELECT?this.valueComponent.getValue():this.valueInput.value}},{key:"getValueType",value:function(){return parseInt(this.getRootNode().getAttribute("data-value-type"),10)}},{key:"setValueType",value:function(e){this.getRootNode().setAttribute("data-value-type",String(e))}},{key:"updateOperator",value:function(){var e=this;if("operator"===this.getRootNode().getAttribute("data-skip"))return!1;var t=[],n=function(t,n){return e.i18n.translateTextDefault(t,n)};switch(this.getVariable().type){case we.CHECKABLE:t=[{value:Me.IS_CHECKED,text:n("notifications_ROPischecked","is checked")},{value:Me.IS_NOT_CHECKED,text:n("notifications_ROPisnotchecked","is not checked")}];break;case we.SELECTABLE:t=[{value:Me.IS_SELECTED,text:n("notifications_ROPisselected","is selected")},{value:Me.IS_NOT_SELECTED,text:n("notifications_ROPisnotselected","is not selected")}];break;case we.COMPARABLE:t=[{value:Me.IS,text:n("notifications_ROPis","is")},{value:Me.IS_GREATER_THAN,text:n("reports_rulesGreaterThan","is greater than")},{value:Me.IS_LESS_THAN,text:n("reports_rulesLessThan","is less than")}];break;default:t=[{value:Me.IS,text:n("notifications_ROPis","is")},{value:Me.IS_NOT,text:n("notifications_ROPisnot","is not")},{value:Me.CONTAINS,text:n("notifications_ROPcontains","contains")},{value:Me.DOES_NOT_CONTAIN,text:n("notifications_ROPdoesntcontain","does not contain")},{value:Me.BEGINS_WITH,text:n("notifications_ROPbeginswith","begins with")},{value:Me.ENDS_WITH,text:n("notifications_ROPendswith","ends with")},{value:Me.IS_GREATER_THAN,text:n("reports_rulesGreaterThan","is greater than")},{value:Me.IS_LESS_THAN,text:n("reports_rulesLessThan","is less than")}]}return this.operatorComponent.setOptions(t),!0}},{key:"updateValue",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(""!==this.getRootNode().getAttribute("data-skip"))return!1;var i=this.getVariable(),r=this.getOperator(),a=this.getValueType();return i.values?t?r!==Me.IS&&r!==Me.IS_NOT?a!==n.VALUE_TYPE_INPUT&&this.setValueType(n.VALUE_TYPE_INPUT):a!==n.VALUE_TYPE_SELECT&&this.setValueType(n.VALUE_TYPE_SELECT):(a!==n.VALUE_TYPE_SELECT&&this.setValueType(n.VALUE_TYPE_SELECT),this.valueComponent.clear(),this.valueInput.value="",i.values.forEach((function(t,n){e.valueComponent.addOption({value:n,text:t,isDefault:0===n})}))):t||(a!==n.VALUE_TYPE_INPUT&&this.setValueType(n.VALUE_TYPE_INPUT),this.valueInput.placeholder=i.placeholder||"",this.valueInput.value=""),!0}},{key:"selectedVariableHasGroup",value:function(){return void 0!=this.variableValueToConfigurationMap[this.getSelectedVariable()].group}},{key:"isSelectedVariableControlTypeOf",value:function(e){return this.getVariable().controlType&&this.getVariable().controlType===e}},{key:"updateVariableComponentOptions",value:function(){var e=this;this.variableComponent.clear();var t={};this.CONFIGURATION.variables.forEach((function(n){n.group?("undefined"===typeof t[n.group.id]&&(t[n.group.id]=!0,e.variableComponent.addGroup(n.group.id,n.group.name)),e.variableComponent.addOption({value:n.value,text:n.text},null,n.group.id)):e.variableComponent.addOption({value:n.value,text:n.text}),e.variableValueToConfigurationMap[n.value]=n}));var n=this.CONFIGURATION.selectedVariable;if(null!==n)if(this.variableValueToConfigurationMap.hasOwnProperty(n))this.variableComponent.getOptionByValue(n)?this.variableComponent.setValue(n):(this.variableComponent.addOption({value:this.variableValueToConfigurationMap[n].value,text:this.variableValueToConfigurationMap[n].text,isSeparator:!0}),this.variableComponent.setValue(this.variableValueToConfigurationMap[n].value));else{var i={value:n,text:this.i18n.translateText("payments_deletedField"),type:we.MISSING};this.variableValueToConfigurationMap[i.value]=i,this.variableComponent.addOption({value:i.value,text:i.text,isSeparator:!0}),this.variableComponent.setValue(i.value)}}},{key:"getVariable",value:function(){return this.variableValueToConfigurationMap[this.getSelectedVariable()]}},{key:"getVariables",value:function(){return this.CONFIGURATION.variables}},{key:"getSelectedVariable",value:function(){return this.variableComponent.getValue()}},{key:"getSelectedGroup",value:function(){return this.selectedVariableHasGroup()?this.variableValueToConfigurationMap[this.getSelectedVariable()].group.id:""}},{key:"getSelectedVariableControlType",value:function(){return this.getVariable().controlType}},{key:"isSelectedVariableAnyControlTypeOf",value:function(e){for(var t=0,n=e.length;t<n;t++)if(this.isSelectedVariableControlTypeOf(e[t]))return!0;return!1}},{key:"getNotificationSelectedVariable",value:function(){return this.variableValueToConfigurationMap[this.getSelectedVariable()].value===this.getSelectedVariable()?this.variableValueToConfigurationMap[this.getSelectedVariable()].text:this.getSelectedValue()}},{key:"getNotificationSelectedValue",value:function(){return this.getValueType()===n.VALUE_TYPE_SELECT?this.valueComponent.getText():this.getSelectedValue()}},{key:"updateVariables",value:function(e){this.CONFIGURATION.variables=e,this.updateVariableComponentOptions()}},{key:"getSelectedOperator",value:function(){return this.getOperator()}},{key:"getSelectedValue",value:function(){return this.getValue()}},{key:"updateConditionPosition",value:function(e){this.conditionPosition=e}},{key:"addCondition",value:function(){if(this.canAddCondition){_e.isMobile()||this.updateOptionVisibility(Ue.NONE),this.addStatement();var e=this.getVariables().filter((function(e){return!e.skipConditions})),t=this.conditionPosition<e.length?this.conditionPosition:e.length-1,i=new n(this.conditionPosition+1,this.onVariableChanged,{variables:e,selectedVariable:e[t].value,selectedOperator:null,selectedValue:null}).withI18n(this.i18n);i.onConditionAdded=this.onConditionAdded,i.onConditionRemoved=this.onConditionRemoved,i.onStatementAdded=this.onStatementAdded,i.onStatementRemoved=this.onStatementRemoved,i.onVariableBeforeChange=this.onVariableBeforeChange,i.initialize(),this.onConditionAdded&&this.onConditionAdded(i),_e.isMobile()&&this.autoUpdateOptionVisibility()}}},{key:"removeCondition",value:function(){this.canRemoveCondition&&(_e.isMobile()||this.updateOptionVisibility(Ue.NONE),this.removeStatement(),this.onConditionRemoved&&this.onConditionRemoved(this),_e.isMobile()&&this.autoUpdateOptionVisibility())}},{key:"autoUpdateOptionVisibility",value:function(){this.canAddCondition&&this.canRemoveCondition?this.updateOptionVisibility(Ue.BOTH):this.canAddCondition?this.updateOptionVisibility(Ue.ADD):this.canRemoveCondition?this.updateOptionVisibility(Ue.REMOVE):this.updateOptionVisibility(Ue.NONE,!0)}},{key:"updateOptionVisibility",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!t&&_e.isMobile()&&e===Ue.NONE||this.getRootNode().setAttribute("data-option-type",e)}},{key:"addStatement",value:function(e){var t=new Fe(this.conditionPosition,e).withI18n(this.i18n);t.initialize(),this.onStatementAdded&&this.onStatementAdded(t)}},{key:"removeStatement",value:function(){if(this.onStatementRemoved){var e=this.getConditionPosition>1?this.getConditionPosition-2:0;this.onStatementRemoved(e)}}}],[{key:"createDefaultConfiguration",value:function(){return{variables:[],selectedVariable:null,selectedOperator:null,selectedValue:null}}}]),n}(b.a);v()(Ve,"MAX_NR_OF_CONDITIONS",10),v()(Ve,"VALUE_TYPE_INPUT",1),v()(Ve,"VALUE_TYPE_SELECT",2);var He,Ge=n(20),We=n.n(Ge);function Ke(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}!function(e){e.LANGUAGE="language",e.COUPON_CODE="couponCode",e.QUIZ_SCORE="quizScore"}(He||(He={}));var ze=function(e){g()(n,e);var t=Ke(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o()(this,n),r=t.call(this),v()(c()(r),"cloneDivRuleContainer",void 0),v()(c()(r),"rootNode",void 0),v()(c()(r),"ruleConditionConfigurations",void 0),v()(c()(r),"ruleStatementConfigurations",void 0),v()(c()(r),"i18n",void 0),v()(c()(r),"divRuleContent",void 0),v()(c()(r),"divRuleCondition",void 0),v()(c()(r),"divRuleStatement",void 0),v()(c()(r),"ruleConditionList",void 0),v()(c()(r),"nrOfConditions",void 0),v()(c()(r),"ruleStatementList",void 0),v()(c()(r),"nrOfStatements",void 0),v()(c()(r),"rulePosition",void 0),v()(c()(r),"isRuleSelected",void 0),v()(c()(r),"ruleDuplicateBtn",void 0),v()(c()(r),"ruleDeleteBtn",void 0),v()(c()(r),"canTrackMetrics",!0),v()(c()(r),"onRuleConditionVariableChanged",void 0),v()(c()(r),"onRuleSelected",void 0),v()(c()(r),"onRuleDeselected",void 0),v()(c()(r),"onDeselectAllRules",void 0),v()(c()(r),"onRuleDuplicated",void 0),v()(c()(r),"onRuleDeleted",void 0),v()(c()(r),"onStatementChanged",void 0),v()(c()(r),"onSendToFocus",void 0),v()(c()(r),"onSendToVariableOpen",void 0),v()(c()(r),"onSendToVariableInsert",void 0),r.cloneDivRuleContainer=e,r.rootNode=r.cloneDivRuleContainer.cloneNode(!0),r.rulePosition=i,a.ruleConditionConfigurations&&a.ruleConditionConfigurations.length>0?r.ruleConditionConfigurations=We()(a.ruleConditionConfigurations):r.ruleConditionConfigurations=[],a.ruleStatementConfigurations&&a.ruleStatementConfigurations.length>0?r.ruleStatementConfigurations=We()(a.ruleStatementConfigurations):r.ruleStatementConfigurations=[],r}return l()(n,[{key:"getRootNode",value:function(){return this.rootNode}},{key:"getRuleConditionList",value:function(){return this.ruleConditionList}},{key:"getRuleStatementList",value:function(){return this.ruleStatementList}},{key:"getCanTrackMetrics",value:function(){return this.canTrackMetrics}},{key:"getNrOfConditions",get:function(){return this.nrOfConditions}},{key:"getRulePosition",get:function(){return this.rulePosition}},{key:"getIsRuleSelected",get:function(){return this.isRuleSelected}}]),l()(n,[{key:"withI18n",value:function(e){return this.i18n=e,this}},{key:"initialize",value:function(){this.initVars(),this.initRuleComponent(),this.initEventListeners()}},{key:"initVars",value:function(){this.isRuleSelected=!1,this.ruleConditionList=[],this.nrOfConditions=0,this.ruleStatementList=[],this.nrOfStatements=0,this.divRuleContent=this.getRootNode().querySelector(n.QUERY_SELECTOR_RULE_CONTENT),this.ruleDuplicateBtn=this.getRootNode().querySelector(n.QUERY_SELECTOR_RULE_DUPLICATE),this.ruleDeleteBtn=this.getRootNode().querySelector(n.QUERY_SELECTOR_RULE_DELETE),this.divRuleCondition=this.divRuleContent.querySelector(n.QUERY_SELECTOR_RULE_CONDITION),this.divRuleStatement=this.divRuleContent.querySelector(n.QUERY_SELECTOR_RULE_STATEMENT),this.divRuleContent.removeChild(this.divRuleCondition),this.divRuleContent.removeChild(this.divRuleStatement)}},{key:"initRuleComponent",value:function(){var e=this;if(this.getRootNode().querySelector(n.QUERY_SELECTOR_RULE_POSITION).textContent="#".concat(this.rulePosition.toString()),this.getRootNode().setAttribute("data-rule-position",this.rulePosition.toString()),this.initCustomRuleComponent(),0===this.ruleConditionConfigurations.length){var t={variables:this.getRuleConditionConfigVariables(!0)};this.rulePosition>1&&(t.selectedVariable=t.variables[1].value),this.ruleConditionConfigurations.push(t)}this.ruleConditionConfigurations.forEach((function(t,n){t.variables||(t.variables=e.getRuleConditionConfigVariables(!0),e.rulePosition>1&&(t.selectedVariable=t.variables[1].value)),e.nrOfConditions++;var i=new Ve(e.nrOfConditions,e.onConditionVariableChanged.bind(e),t).withI18n(e.i18n);e.ruleConditionList.push(i),i.onConditionAdded=e.onConditionAdded.bind(e),i.onConditionRemoved=e.onConditionRemoved.bind(e),i.onStatementAdded=e.onStatementAdded.bind(e),i.onStatementRemoved=e.onStatementRemoved.bind(e),i.onVariableBeforeChange=e.onVariableBeforeChange.bind(e),i.initialize(),e.onConditionVariableChanged(!0);var r=e.divRuleCondition.cloneNode(!0);r.appendChild(i.getRootNode()),e.divRuleContent.appendChild(r),i.on("count-email-rules-not-supported",(function(){e.trigger("count-email-rules-not-supported")})),i.updateOptionVisibility(T.L.NONE),e.ruleStatementConfigurations[n]&&i.addStatement(e.ruleStatementConfigurations[n])})),this.updateRuleConditionOptions(),1===this.getRuleConditionList()[0].getVariables().length&&this.getRuleConditionList()[0].getVariable().skipConditions&&(this.ruleDuplicateBtn.style.pointerEvents="none",this.ruleDuplicateBtn.style.color="rgba(170, 170, 170, 0.5)")}},{key:"initCustomRuleComponent",value:function(){}},{key:"initEventListeners",value:function(){var e=this;_e.isMobile()?(this.ruleDuplicateBtn.ontouchend=this.ruleDuplicateBtn.ontouchcancel=function(){setTimeout((function(){e.ruleDuplicateBtn.classList.remove("ruleHasHover")}),300)},this.ruleDuplicateBtn.ontouchstart=function(){e.ruleDuplicateBtn.classList.add("ruleHasHover")}):(this.getRootNode().onmouseenter=function(){e.divRuleContent.setAttribute("data-role-hover","rule-content"),[e.ruleDuplicateBtn,e.ruleDeleteBtn].forEach((function(e){e.style.display="block"}))},this.getRootNode().onmouseleave=function(){e.divRuleContent.removeAttribute("data-role-hover"),[e.ruleDuplicateBtn,e.ruleDeleteBtn].forEach((function(e){e.style.display="none"}))}),this.ruleDuplicateBtn.onclick=function(t){t.stopPropagation(),e.onDuplicateBtnClick()},this.ruleDeleteBtn.onclick=function(t){t.stopPropagation(),e.deleteRule()}}},{key:"onDuplicateBtnClick",value:function(){this.duplicateRule()}},{key:"getRuleConditionConfigVariables",value:function(e){return[{value:"test",text:"Test",type:we.DEFAULT}]}},{key:"getRuleContainerInstance",value:function(e,t){return new n(this.cloneDivRuleContainer,this.rulePosition,{ruleConditionConfigurations:e,ruleStatementConfigurations:t}).withI18n(this.i18n)}},{key:"onConditionVariableChanged",value:function(e){this.onRuleConditionVariableChanged&&this.onRuleConditionVariableChanged(!e,this.getRulePosition),this.updateRuleConditionOptions()}},{key:"onConditionAdded",value:function(e){this.nrOfConditions++;var t=this.divRuleCondition.cloneNode(!0);t.appendChild(e.getRootNode()),e.getConditionPosition===this.nrOfConditions?(this.divRuleContent.appendChild(t),this.ruleConditionList.push(e)):(this.divRuleContent.insertBefore(t,this.ruleStatementList[e.getConditionPosition-1].getRootNode().parentElement),this.ruleConditionList.splice(e.getConditionPosition-1,0,e)),this.updateConditionsPosition(),2===this.nrOfConditions&&this.ruleConditionList[0].getVariables()[0].skipConditions&&this.updateRuleConditionVariables(!1),this.updateRuleConditionOptions()}},{key:"onConditionRemoved",value:function(e){this.nrOfConditions--,this.divRuleContent.removeChild(e.getRootNode().parentElement),this.ruleConditionList.splice(e.getConditionPosition-1,1),this.updateConditionsPosition(),1===this.nrOfConditions&&this.ruleConditionList[0].onVariableChanged(!1),this.updateRuleConditionOptions()}},{key:"onStatementAdded",value:function(e){this.nrOfStatements++;var t=this.divRuleStatement.cloneNode(!0);t.appendChild(e.getRootNode()),e.getStatementPosition===this.nrOfStatements?(this.divRuleContent.appendChild(t),this.ruleStatementList.push(e)):(this.divRuleContent.insertBefore(t,this.ruleStatementList[e.getStatementPosition-1].getRootNode().parentElement),this.ruleStatementList.splice(e.getStatementPosition-1,0,e)),this.updateStatementsPosition(),this.onStatementChanged&&this.onStatementChanged()}},{key:"onStatementRemoved",value:function(e){this.nrOfStatements--,this.divRuleContent.removeChild(this.ruleStatementList[e].getRootNode().parentElement),this.ruleStatementList.splice(e,1),this.updateStatementsPosition(),this.onStatementChanged&&this.onStatementChanged()}},{key:"updateRuleConditionOptions",value:function(){if(this.ruleConditionList[0].getVariable().skipConditions)this.ruleConditionList[0].setCanAddCondition=!1,this.ruleConditionList[0].setCanRemoveCondition=!1;else for(var e=0;e<this.nrOfConditions;e++)this.nrOfConditions<2?(this.ruleConditionList[e].setCanAddCondition=!0,this.ruleConditionList[e].setCanRemoveCondition=!1):this.nrOfConditions<Ve.MAX_NR_OF_CONDITIONS?(this.ruleConditionList[e].setCanAddCondition=!0,this.ruleConditionList[e].setCanRemoveCondition=!0):(this.ruleConditionList[e].setCanAddCondition=!1,this.ruleConditionList[e].setCanRemoveCondition=!0),_e.isMobile()&&this.ruleConditionList[e].autoUpdateOptionVisibility();_e.isMobile()||(this.nrOfConditions<Ve.MAX_NR_OF_CONDITIONS?this.ruleConditionList[this.nrOfConditions-1].autoUpdateOptionVisibility():this.ruleConditionList[this.nrOfConditions-1].updateOptionVisibility(T.L.NONE))}},{key:"updateConditionsPosition",value:function(){for(var e=0;e<this.nrOfConditions;e++)this.ruleConditionList[e].updateConditionPosition(e+1)}},{key:"updateStatementsPosition",value:function(){for(var e=0;e<this.nrOfStatements;e++)this.ruleStatementList[e].updateStatementPosition(e+1)}},{key:"getRuleConditionAt",value:function(e){return this.ruleConditionList[e]}},{key:"updateRuleConditionVariables",value:function(e){this.ruleConditionList[0].updateVariables(this.getRuleConditionConfigVariables(e))}},{key:"updateRulePosition",value:function(e){this.rulePosition=e,this.getRootNode().querySelector(n.QUERY_SELECTOR_RULE_POSITION).textContent="#".concat(this.rulePosition.toString()),this.getRootNode().setAttribute("data-rule-position",this.rulePosition.toString())}},{key:"selectRule",value:function(){this.isRuleSelected||(this.divRuleContent.classList.add("ruleContentSelected"),this.isRuleSelected=!0,this.onRuleSelected&&this.onRuleSelected(this))}},{key:"deselectRule",value:function(){this.isRuleSelected&&(this.divRuleContent.classList.remove("ruleContentSelected"),this.isRuleSelected=!1,this.onRuleDeselected&&this.onRuleDeselected(this))}},{key:"duplicateRule",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.canTrackMetrics=e;var t=[];this.ruleConditionList.forEach((function(e){var n=e.getVariable().skipConditions?e.getVariables()[1].value:e.getSelectedVariable(),i=e.getVariable().skipConditions?null:e.getSelectedOperator(),r=e.getVariable().skipConditions?null:e.getSelectedValue();t.push({variables:e.getVariables(),selectedVariable:n,selectedOperator:i,selectedValue:r})}));var n=[];this.ruleStatementList.forEach((function(e){n.push({selectedStatement:e.getSelectedStatement()})}));var i=this.getRuleContainerInstance(t,n);i.initialize(),i.onRuleConditionVariableChanged=this.onRuleConditionVariableChanged,i.onRuleSelected=this.onRuleSelected,i.onRuleDeselected=this.onRuleDeselected,i.onDeselectAllRules=this.onDeselectAllRules,i.onRuleDuplicated=this.onRuleDuplicated,i.onRuleDeleted=this.onRuleDeleted,i.onStatementChanged=this.onStatementChanged,this.deselectRule(),this.onRuleDuplicated&&this.onRuleDuplicated(i),this.onConditionVariableChanged(!0)}},{key:"deleteRule",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.canTrackMetrics=e,this.deselectRule(),this.onRuleDeleted&&this.onRuleDeleted(this),this.onConditionVariableChanged(!1)}},{key:"onVariableBeforeChange",value:function(){return!0}}]),n}(b.a);v()(ze,"RULE_ALLOWED_CONTROL_TYPES",[C.a.CONTROL_TYPE_TEXT,C.a.CONTROL_TYPE_TEXTAREA,C.a.CONTROL_TYPE_DROPDOWN,C.a.CONTROL_TYPE_RADIO,C.a.CONTROL_TYPE_CHECKBOX,C.a.CONTROL_TYPE_NUMBER,C.a.CONTROL_TYPE_FORMULA,C.a.CONTROL_TYPE_EMAIL,C.a.CONTROL_TYPE_LIKERT_SCALE,C.a.CONTROL_TYPE_NAME,C.a.CONTROL_TYPE_ADDRESS,C.a.CONTROL_TYPE_PHONE,C.a.CONTROL_TYPE_DATE,C.a.CONTROL_TYPE_TIME,C.a.CONTROL_TYPE_PRICE,C.a.CONTROL_TYPE_WEBSITE,C.a.CONTROL_TYPE_PASSWORD,C.a.CONTROL_TYPE_STAR_RATING,C.a.CONTROL_TYPE_TERMS_OF_SERVICE,C.a.CONTROL_TYPE_COUPON]),v()(ze,"RULE_EXTRA_VARIABLES",[He.LANGUAGE,He.COUPON_CODE,He.QUIZ_SCORE]),v()(ze,"RULE_ALLOWED_EXTRA",[T.Y.LANGUAGE,T.Y.PAYMENT_COUPON,T.Y.QUIZ_SCORE]),v()(ze,"QUERY_SELECTOR_RULE_CONTENT",'div[data-role="rule-content"]'),v()(ze,"QUERY_SELECTOR_RULE_POSITION",'div[data-role="rule-position"]'),v()(ze,"QUERY_SELECTOR_RULE_DUPLICATE",'div[data-role="rule-duplicate"]'),v()(ze,"QUERY_SELECTOR_RULE_DELETE",'div[data-role="rule-delete"]'),v()(ze,"QUERY_SELECTOR_RULE_CONDITION",'div[data-role="placeholder"][data-control-name="rule-condition"]'),v()(ze,"QUERY_SELECTOR_RULE_STATEMENT",'div[data-role="placeholder"][data-control-name="rule-statement"]');var qe=n(8),Xe=n(43);function Qe(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}Xe.a;function $e(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}Xe.a;var je=function(){function e(){o()(this,e),v()(this,"tracker",void 0),v()(this,"isDebugOn",!1),window.CFTracker?(this.tracker=window.CFTracker,this.checkDebugger()):(this.tracker={track:function(){return!1}},console.error("CFTracker is not defined"))}return l()(e,[{key:"track",value:function(e,t,n){this.tracker.track(e,t,n),this.debugEvent(e,t,n)}},{key:"checkDebugger",value:function(){"local.123contactform.com"===location.hostname&&(this.isDebugOn=!0)}},{key:"debugEvent",value:function(e,t,n){this.isDebugOn&&(console.warn("Tracking event: ".concat(e)),t&&console.warn("Event has value: ".concat(JSON.stringify(t))),n&&console.warn("Event has tags: ".concat(JSON.stringify(n))))}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();v()(je,"instance",void 0);var Je;n(26),n(206);!function(e){e.NEW_SMS="notifications_new_sms",e.NEW_EMAIL="notifications_new_email",e.COUNT_EMAIL_RECIPIENTS="notifications_count_email_recipients",e.COUNT_EMAIL_RULES="notifications_count_email_rules",e.ADD_FILE_ATTACHMENTS="notifications_add_file_attachments",e.ADD_SUBMISSION_PDF_ATTACHMENTS="notifications_add_submission_pdf_attachments",e.ADD_FORM_LAYOUT_ATTACHMENTS="notifications_add_form_layout_attachments",e.CUSTOMIZE_EMAIL_TEMPLATES="notifications_customize_email_templates",e.USE_SMTP="notifications_use_smtp"}(Je||(Je={}));var Ze;!function(e){e.TRIGGER_SEND_TO="SEND_TO",e.TRIGGER_ONLY_SEND_TO="ONLY_SEND_TO"}(Ze||(Ze={}));var et=function(){function e(){o()(this,e),v()(this,"root",void 0),v()(this,"sendToComponentValue",void 0),this.root=document.createElement("div"),this.root.setAttribute("data-role","notification-to-who-hook-type-config"),this.sendToComponentValue={hookType:Ze.TRIGGER_SEND_TO}}return l()(e,[{key:"getRoot",value:function(){return this.root}},{key:"getValue",value:function(){return this.sendToComponentValue}},{key:"setValue",value:function(e){this.sendToComponentValue=e}}]),e}(),tt=function(){function e(){o()(this,e),v()(this,"root",void 0),v()(this,"onlySendToComponentValue",void 0),this.root=document.createElement("div"),this.root.setAttribute("data-role","notification-to-who-hook-type-config"),this.onlySendToComponentValue={hookType:Ze.TRIGGER_ONLY_SEND_TO}}return l()(e,[{key:"getRoot",value:function(){return this.root}},{key:"getValue",value:function(){return this.onlySendToComponentValue}},{key:"setValue",value:function(e){this.onlySendToComponentValue=e}}]),e}(),nt=function(){function e(){o()(this,e),v()(this,"root",void 0),v()(this,"dropDown",void 0),v()(this,"value",void 0),this.root=document.createElement("div"),this.root.setAttribute("data-role","to-who-component"),this.dropDown=document.createElement("select"),this.dropDown.setAttribute("data-role","hook-type"),this.addDropDownEvents(),this.addDropDownOptions(),this.root.appendChild(this.dropDown),this.root.appendChild(document.createElement("div")),this.value=e.createValue(Ze.TRIGGER_SEND_TO),this.getRoot().appendChild(this.value.getRoot())}return l()(e,[{key:"getRoot",value:function(){return this.root}},{key:"getValue",value:function(){return this.value.getValue()}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hookType:Ze.TRIGGER_SEND_TO};t.hookType!==this.value.getValue().hookType&&(this.value.getRoot().parentNode.removeChild(this.value.getRoot()),this.value=e.createValue(t.hookType),this.root.appendChild(this.value.getRoot())),this.value.setValue(t),this.dropDown.value=t.hookType}},{key:"addDropDownEvents",value:function(){var t=this;this.dropDown.onchange=function(){t.value.getRoot().parentNode.removeChild(t.value.getRoot()),t.value=e.createValue(t.dropDown.value),t.getRoot().appendChild(t.value.getRoot())}}},{key:"addDropDownOptions",value:function(){for(var e=[{text:"Send to",value:Ze.TRIGGER_SEND_TO,intlKey:"edt_notification_rules_send_to"},{text:"Only send to",value:Ze.TRIGGER_ONLY_SEND_TO,intlKey:"edt_notification_rules_only_send_to"}],t=0;t<e.length;t++){var n=document.createElement("option");n.text=e[t].text,n.value=e[t].value,n.setAttribute("data-i18n-text",e[t].intlKey),this.dropDown.add(n)}}}],[{key:"createValue",value:function(e){switch(e){case Ze.TRIGGER_SEND_TO:return new et;case Ze.TRIGGER_ONLY_SEND_TO:return new tt;default:throw new Error("Unknown hook type")}}}]),e}(),it=function e(){o()(this,e)};v()(it,"NOTIFICATIONS_PANEL_ID","notifications"),v()(it,"NOTIFICATIONS_EDITOR_EMPTY_ID","notifications-editor-empty");var rt=function e(){o()(this,e)};v()(rt,"COMPONENT_TYPE_SEND_TO","send-to"),v()(rt,"COMPONENT_TYPE_WHEN","when"),v()(rt,"COMPONENT_TYPE_FROM_NAME","from-name"),v()(rt,"COMPONENT_TYPE_FROM_EMAIL","from-email"),v()(rt,"COMPONENT_TYPE_REPLY_TO_EMAIL","reply-to-email"),v()(rt,"COMPONENT_TYPE_SUBJECT","subject"),v()(rt,"COMPONENT_TYPE_BODY","body"),v()(rt,"COMPONENT_TYPE_ADD_ATTACHMENT","add-attachment"),v()(rt,"COMPONENT_TYPE_PDF_NAME","pdf-name"),v()(rt,"COMPONENT_TYPE_ADD_RULES_BUTTON","add-rule-button"),v()(rt,"COMPONENT_TYPE_HIDE_EMPTY_FIELDS","hide-empty-fields");var at=function e(){o()(this,e)};v()(at,"KEY_0",48),v()(at,"KEY_1",49),v()(at,"KEY_2",50),v()(at,"KEY_3",51),v()(at,"KEY_4",52),v()(at,"KEY_5",53),v()(at,"KEY_6",54),v()(at,"KEY_7",55),v()(at,"KEY_8",56),v()(at,"KEY_9",57),v()(at,"KEY_PAD_0",96),v()(at,"KEY_PAD_1",97),v()(at,"KEY_PAD_2",98),v()(at,"KEY_PAD_3",99),v()(at,"KEY_PAD_4",100),v()(at,"KEY_PAD_5",101),v()(at,"KEY_PAD_6",102),v()(at,"KEY_PAD_7",103),v()(at,"KEY_PAD_8",104),v()(at,"KEY_PAD_9",105),v()(at,"KEY_DOT",190),v()(at,"KEY_PAD_DOT",110),v()(at,"KEY_BACKSPACE",8),v()(at,"KEY_DELETE",46),v()(at,"KEY_LEFT",37),v()(at,"KEY_RIGHT",39),v()(at,"KEY_UP",38),v()(at,"KEY_DOWN",40),v()(at,"KEY_SPACE",32),v()(at,"KEY_HOME",36),v()(at,"KEY_END",35),v()(at,"KEY_TAB",9),v()(at,"KEY_ENTER",13),v()(at,"KEY_ESC",27);var ot=n(96),st=function(){function e(){o()(this,e)}return l()(e,null,[{key:"isElementASpace",value:function(t){return t.textContent===String.fromCharCode(e.THIN_SPACE_CHAR_CODE)}},{key:"addNoFollowOnLinks",value:function(e){var t=document.createElement("div"),n=t.getElementsByTagName("a");return t.innerHTML=e,Array.prototype.forEach.call(n,(function(e){return e.setAttribute("rel","nofollow ugc")})),t.innerHTML}}]),e}();function lt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(st,"THIN_SPACE_CHAR_CODE",8201);var ut=function(e){g()(n,e);var t=lt(n);function n(e){var i;if(o()(this,n),i=t.call(this,e.componentName),v()(c()(i),"maxNumOfTags",1/0),v()(c()(i),"isSingleTagsList",!1),v()(c()(i),"configuration",void 0),v()(c()(i),"valuesSection",void 0),v()(c()(i),"nativeDropdown",void 0),i.configuration=e,i.valuesSection=document.createElement("div"),i.valuesSection.dataset.role="values",i.valuesSection.setAttribute("contenteditable","true"),i.rootNode.dataset.name=e.componentName,i.rootNode.dataset.type=be.TAGS,i.rootNode.appendChild(i.valuesSection),e.placeholder){var r=document.createElement("span");r.dataset.role="tag-placeholder",r.appendChild(document.createTextNode(e.placeholder)),i.rootNode.appendChild(r)}return i.configuration.allowKeywords&&i.initializeNativeDropdown(),i.valuesSection.onfocus=function(){i.trigger("focus")},$(i.valuesSection).on("keydown",(function(e){var t,n=window.getSelection().anchorNode;switch(i.valuesSection.hasChildNodes()&&(t=i.valuesSection.childNodes),e.keyCode){case at.KEY_ENTER:e.preventDefault();break;case at.KEY_BACKSPACE:if(t&&t.length>=2){if(st.isElementASpace(n))for(var r=0,a=t.length;r<a;r++)t[r]===n&&t[r-1]&&i.isElementATag(t[r-1])&&i.valuesSection.removeChild(t[r-1]);if(i.isElementATag(n))for(var o=0,s=t.length;o<s;o++)t[o]===n&&t[o-1]&&st.isElementASpace(t[o-1])&&i.valuesSection.removeChild(t[o-1])}break;case at.KEY_DELETE:if(t&&t.length>=2){if(st.isElementASpace(n))for(var l=0,u=t.length;l<u;l++)t[l]===n&&t[l+1]&&i.isElementATag(t[l+1])&&i.valuesSection.removeChild(t[l+1]);if(i.isElementATag(n))for(var c=0,d=t.length;c<d;c++)t[c]===n&&t[c+1]&&st.isElementASpace(t[c+1])&&i.valuesSection.removeChild(t[c+1]);st.isElementASpace(n)&&n===t[t.length-1]&&e.preventDefault()}}1===i.valuesSection.childNodes.length&&i.valuesSection.childNodes[0].nodeName===T.D.BR&&i.valuesSection.removeChild(i.valuesSection.childNodes[0]),i.trigger("keydown")})),i.valuesSection.addEventListener("paste",(function(e){var t=(e.clipboardData||window.clipboardData).getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t.replace(/\r\n|\r|\n/g," "))),e.preventDefault()})),i.valuesSection.addEventListener("blur",(function(){for(var e=0,t=i.valuesSection.childNodes.length;e<t;e++)i.valuesSection.childNodes[e].nodeName===T.D.BR&&i.valuesSection.removeChild(i.valuesSection.childNodes[e])})),i.valuesSection.addEventListener("mscontrolselect",(function(e){e.preventDefault()})),i}return l()(n,[{key:"resetNativeDropdown",value:function(){var e=this.rootNode.querySelector('[data-role="dropdown"]');e&&this.rootNode.removeChild(e),this.configuration.allowKeywords&&this.initializeNativeDropdown()}},{key:"isElementATag",value:function(e){return e.nodeName===T.D.SPAN&&"ui-element"===e.dataset.uiRole&&"tag"===e.dataset.type}},{key:"initializeNativeDropdown",value:function(){var e=this,t=document.createElement("div");if(t.setAttribute("data-role","dropdown"),this.rootNode.setAttribute("data-expandable","1"),this.nativeDropdown=document.createElement("select"),t.appendChild(this.nativeDropdown),this.configuration.createValuesCallback){for(var n=this.configuration.createValuesCallback(),i=0,r=n.length;i<r;i++){var a=document.createElement("option");a.text=n[i].text||n[i].value,a.value=n[i].value,a.disabled=!!n[i].disabled&&n[i].disabled,this.nativeDropdown.add(a)}var o=document.createElement("span");o.className="i123-add",t.appendChild(o)}this.nativeDropdown.value=null,this.nativeDropdown.selectedIndex=-1,this.nativeDropdown.addEventListener("change",(function(t){var n=e.nativeDropdown.value,i=e.nativeDropdown.options[e.nativeDropdown.selectedIndex].text;e.nativeDropdown.value=null,e.nativeDropdown.selectedIndex=-1,e.addTag(i,n,!1,n!==i,M.APPEND_POSITION_AT_CURSOR),e.trigger("ui_tags_container_variable_insert")}),!0),this.nativeDropdown.onmouseover=function(){e.nativeDropdown.value=null},this.rootNode.appendChild(t),t.onclick=function(t){t.clientX&&t.clientY&&e.trigger("dropdown-open")}}},{key:"addTag",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:M.APPEND_POSITION_INSIDE,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.valuesSection,s=function(){for(var e=n.valuesSection.childNodes,i=0,r=e.length;i<r;i++)if(e[i].nodeValue&&e[i].nodeValue.trim()===t)return void(_e.isFirefox()&&1===e.length?n.valuesSection.removeChild(e[i]):e[i].nodeValue=e[i].nodeValue.replace(t,""))};if(!1===r&&!1===this.configuration.textValidationCallback(t))return this.addError(this.configuration.customErrorMessage),s();if(this.configuration.tagsLimit&&this.configuration.tagsLimit<=this.getNumberOfTagValues())return this.trigger("tags-limit-reached"),s();if(this.configuration.validationTagLimit&&(this.maxNumOfTags=this.configuration.validationTagLimit),this.getNumberOfTagValues()>=this.maxNumOfTags)return this.addError(this.configuration.validationError||""),void s();var l=new ve({componentName:be.TAG,caption:e,value:t,isVariable:r,isDeleted:i}),u=new L(this.valuesSection),c=u.position();switch(l.on("append",(function(){n.isSingleTagsList||u.position(c+1)})),l.on("replace",(function(){n.isSingleTagsList||u.position(c+1)})),l.on("insert",(function(){n.isSingleTagsList||u.position(c+e.length+1)})),0===this.valuesSection.childNodes.length&&(o=this.valuesSection,a=M.APPEND_POSITION_INSIDE),a){case M.APPEND_POSITION_REPLACE:l.replace(o);break;case M.APPEND_POSITION_AT_CURSOR:l.insert(o);break;default:l.append(o,a)}this.trigger("tag-add",l)}},{key:"getValue",value:function(){for(var e=[],t=this.valuesSection.childNodes,n=0,i=t.length;n<i;n++){var r=t[n],a=void 0;if(r.nodeType===Node.TEXT_NODE){if(1===r.nodeValue.length&&r.nodeValue.charCodeAt(0)===ve.THIN_SPACE_CHAR_CODE)continue;a={type:Ae.TEXT,value:r.nodeValue,caption:r.nodeValue}}else r.nodeType!==Node.TEXT_NODE&&r.textContent&&0!==r.textContent.trim().length&&(a={type:Ae.TAG,value:r.dataset.value,caption:r.textContent});void 0!==a&&e.push(a)}return e}},{key:"setValue",value:function(e){this.clearValues();for(var t=0,n=e.length;t<n;t++)if(e[t].type===Ae.TAG){var i=!e[t].isRegularTag;this.addTag(e[t].caption,e[t].value,e[t].isDeleted,i)}else this.valuesSection.appendChild(document.createTextNode(e[t].value))}},{key:"clearValues",value:function(){for(;this.valuesSection.hasChildNodes();)this.valuesSection.removeChild(this.valuesSection.lastChild)}},{key:"addError",value:function(e){var t=this;if(null===this.rootNode.querySelector('[data-role="error"]')){var n=document.createElement("div");n.dataset.role="error",n.appendChild(document.createTextNode(e)),this.rootNode.appendChild(n),setTimeout((function(){t.rootNode.removeChild(n)}),5e3)}}},{key:"setState",value:function(e){switch(e){case T.U.FULLY_DISABLED:this.valuesSection.removeAttribute("contenteditable"),this.nativeDropdown.setAttribute("disabled","disabled"),this.valuesSection.setAttribute("data-fully-disabled","");break;case T.U.DISABLED:this.valuesSection.removeAttribute("contenteditable"),this.nativeDropdown.setAttribute("disabled","disabled"),this.valuesSection.hasAttribute("data-fully-disabled")&&this.valuesSection.removeAttribute("data-fully-disabled");break;case T.U.ENABLED:default:this.valuesSection.setAttribute("contenteditable","true"),this.nativeDropdown.removeAttribute("disabled"),this.valuesSection.hasAttribute("data-fully-disabled")&&this.valuesSection.removeAttribute("data-fully-disabled")}}},{key:"getState",value:function(){return this.nativeDropdown.hasAttribute("disabled")&&this.valuesSection.hasAttribute("data-fully-disabled")?T.U.FULLY_DISABLED:this.nativeDropdown.hasAttribute("disabled")?T.U.DISABLED:T.U.ENABLED}},{key:"getNumberOfTagValues",value:function(){var e=this.getValue(),t=0;return Object(ot.a)(e,(function(e){e.type===Ae.TAG&&t++})),t}},{key:"getDropdownContainer",value:function(){return this.rootNode.querySelector('[data-role="dropdown"]')}}]),n}(M);function ct(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var dt=function(e){g()(n,e);var t=ct(n);function n(e){var i;return o()(this,n),i=t.call(this,e),$(i.valuesSection).on("keydown",(function(e){e.keyCode!==at.KEY_SPACE&&e.keyCode!==at.KEY_ENTER||(i.replaceFirstTextNodeWithTag(),e.preventDefault())})),i.valuesSection.addEventListener("blur",(function(e){i.replaceFirstTextNodeWithTag(),i.valuesSection.blur()})),i}return l()(n,[{key:"replaceFirstTextNodeWithTag",value:function(){for(var e=this.valuesSection.childNodes,t=null,n=0,i=e.length;n<i;n++)if(e[n].nodeType===Node.TEXT_NODE&&e[n].textContent.trim().length>0){t=e[n];break}null!==t&&this.addTag(t.textContent.trim(),t.textContent.trim(),!1,!1,M.APPEND_POSITION_REPLACE,t)}}]),n}(ut);function pt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var ht=function(e){g()(n,e);var t=pt(n);function n(e){var i;return o()(this,n),(i=t.call(this,e)).isSingleTagsList=!0,i.on("tag-add",(function(t){var n=i.getDropdownContainer();i.setState(T.U.DISABLED),n.setAttribute("title",e.disabledTitle||""),t.on("delete",(function(){i.setState(T.U.ENABLED),n.setAttribute("title",e.title||"")}))})),i}return n}(dt),gt=function(){function e(t,n,i){o()(this,e),v()(this,"attrs",{text:"",value:""}),v()(this,"host",void 0),this.host=t,this.attrs.text=i,this.attrs.value=n}return l()(e,[{key:"setAttribute",value:function(e,t){this.attrs[e]=t}},{key:"getAttribute",value:function(e){return void 0===this.attrs[e]?null:this.attrs[e]}},{key:"removeAttribute",value:function(e){delete this.attrs[e]}},{key:"hasAttribute",value:function(e){return void 0!==this.attrs[e]}},{key:"convertToHTMLOptionElement",value:function(){var e=document.createElement("option");for(var t in e.text=this.attrs.text,e.value=this.attrs.value,this.attrs)"text"!==t&&"value"!==t&&this.attrs.hasOwnProperty(t)&&this.attrs.propertyIsEnumerable(t)&&e.setAttribute(t,this.attrs[t]);return e}},{key:"text",get:function(){return this.attrs.text},set:function(e){this.attrs.text=String(e||"")}},{key:"value",get:function(){return this.attrs.value},set:function(e){this.attrs.value=String(e||"")}}],[{key:"create",value:function(t,n,i){return new e(t,n,i)}},{key:"createFromHTMLOptionElement",value:function(t,n){for(var i=e.create(t,n.value,n.text),r=n.attributes,a=r.length,o=0;o<a;o++)i.setAttribute(r[o].name,r[o].value);return i}}]),e}(),_t=function(){function e(){o()(this,e)}return l()(e,null,[{key:"canAnchorElementToTargetBottomRight",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=document.body.getBoundingClientRect();return e.right+n+t.width<=i.width&&e.top+t.height<=window.innerHeight}},{key:"canAnchorElementToTargetTopRight",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=document.body.getBoundingClientRect();return e.right+n+t.width<=i.width&&e.top-t.height>=0}},{key:"canAnchorElementToTargetTopLeft",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.left-n+t.width>=0&&e.bottom-t.height>=0}},{key:"canAnchorElementToTargetBottomLeft",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.left-n+t.width>=0&&e.top+t.height<=window.innerHeight}},{key:"canAnchorElementToTargetCenterTop",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.left+e.width/2-t.width/2>=0&&e.top-n-t.height>=0}},{key:"canAnchorElementToTargetCenterBottom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=window.scrollY||0;return e.left+e.width/2-t.width/2>=0&&e.bottom+n+i+t.height<=window.innerHeight}},{key:"canAnchorElementToTargetCenterLeft",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.left-n-t.width>=0&&e.top+e.height/2-t.height>=0}},{key:"canAnchorElementToTargetCenterRight",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=document.body.getBoundingClientRect();return e.right+n+t.width<=i.width&&e.top+e.height/2-t.height>=0}},{key:"getAnchorPosition",value:function(t,n){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,a=0,o=r.length;a<o;a++)switch(r[a]){case"center-top":if(e.canAnchorElementToTargetCenterTop(t,n,i))return{left:t.left+t.width/2-n.width/2,top:t.top-n.height-i,mode:"center-top"};break;case"center-bottom":if(e.canAnchorElementToTargetCenterBottom(t,n,i))return{left:t.left+t.width/2-n.width/2,top:t.bottom+i,mode:"center-bottom"};break;case"center-right":if(e.canAnchorElementToTargetCenterRight(t,n,i))return{left:t.right+i,top:t.top+t.height/2-n.height/2,mode:"center-right"};break;case"center-left":if(e.canAnchorElementToTargetCenterLeft(t,n,i))return{left:t.left-i-n.width,top:t.top+t.height/2-n.height/2,mode:"center-left"};break;default:throw new Error("Positioning mode ".concat(JSON.stringify(r[a])," is not implemented"))}switch(r[0]){case"center-top":return{left:t.left+t.width/2-n.width/2,top:t.top-n.height-i,mode:"center-top"};case"center-bottom":return{left:t.left+t.width/2-n.width/2,top:t.bottom+i,mode:"center-bottom"};case"center-right":return{left:t.right+i,top:t.top+t.height/2-n.height/2,mode:"center-right"};case"center-left":return{left:t.left-i-n.width,top:t.top+t.height/2-n.height/2,mode:"center-left"};default:throw new Error("Positioning mode ".concat(JSON.stringify(r[0])," is not implemented"))}}}]),e}();function ft(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var yt=function(e){g()(n,e);var t=ft(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_SEARCHABLE_DROPDOWN),v()(c()(e),"options",[]),v()(c()(e),"selectedIndex",-1),v()(c()(e),"opened",!1),v()(c()(e),"overlay",void 0),v()(c()(e),"overlayModal",void 0),v()(c()(e),"caption",void 0),v()(c()(e),"expander",void 0),v()(c()(e),"bodyMouseDownEventListener",void 0),v()(c()(e),"userFilter",null),v()(c()(e),"selectedIndexBeforeOpen",-1),e.caption=document.createElement("input"),e.caption.setAttribute("type","text"),e.caption.setAttribute("autocomplete","none"),e.expander=document.createElement("button"),e.rootNode.appendChild(e.caption),e.rootNode.appendChild(e.expander),e.overlay=document.createElement("div"),e.overlay.setAttribute("data-role","dropdown-overlay"),e.overlayModal=document.createElement("div"),e.overlayModal.className="ui-modal",e.overlayModal.setAttribute("data-transparent","1"),e.init(),e}return l()(n,[{key:"getSelectedIndex",value:function(){return this.selectedIndex}},{key:"add",value:function(e,t){if(!e)throw new Error("Invalid argument: option: IUIOption expected!");var n=A()(e,HTMLOptionElement)?gt.createFromHTMLOptionElement(this,e):e;if(void 0===t)this.options.push(n);else{if(t<0||t>this.options.length)throw new Error("Invalid argument: index: int >= 0 <= ".concat(this.options.length," expected"));this.options.splice(t,0,n)}this.isOpened()?(this.userFilter=null,this.refreshOptions(),this.setSelectedIndex(-1)):-1===this.selectedIndex&&this.setSelectedIndex(0)}},{key:"remove",value:function(e){if(null===e||e<0||e>=this.options.length)throw new Error("Invalid argument index: int >= 0 < ".concat(this.options.length," expected!"));this.options.splice(e,1),this.isOpened()?(this.userFilter=null,this.refreshOptions(),this.selectedIndex=void 0,this.setSelectedIndex(Math.max(-1,this.options.length?0:-1))):(this.selectedIndex=void 0,this.setSelectedIndex(Math.max(-1,this.options.length?0:-1)))}},{key:"getValue",value:function(){return-1===this.selectedIndex?null:this.options[this.selectedIndex].value}},{key:"setValue",value:function(e){for(var t=-1,n=0,i=this.options.length;n<i;n++)if(e===this.options[n].value){t=n;break}this.setSelectedIndex(t)}},{key:"setSelectedIndex",value:function(e){if((e=~~e)<-1&&(e=-1),e>=this.options.length&&(e=this.options.length-1),this.options[e]&&!this.options[e].hasAttribute("disabled")||(e=-1),e!==this.selectedIndex){if(this.selectedIndex=this.selectedIndexBeforeOpen=e,this.userFilter=null,this.caption.value=String(-1===this.selectedIndex?"":this.options[this.selectedIndex].text),this.options[this.selectedIndex])if(this.selectedIndex||this.options[this.selectedIndex].value||!this.caption.hasAttribute("placeholder")){if(this.options[this.selectedIndex].hasAttribute("data-i18n-text")&&Bt.getI18n()){var t=this.options[this.selectedIndex].getAttribute("data-i18n-text"),n=Bt.getI18n().translateText(t);n&&n!==t&&(this.caption.value=n)}}else this.caption.value="";this.updateSelectedIndexInOverlay(),this.trigger("change"),Bt.getJQuery()(this.rootNode).trigger("change")}}},{key:"isOpened",value:function(){return this.opened}},{key:"refreshOptions",value:function(){var e;this.overlay.innerHTML="";for(var t=0,n=this.options.length;t<n;t++)(e=document.createElement("div")).setAttribute("data-index",String(t)),e.textContent=this.options[t].text,this.options[t].hasAttribute("disabled")&&e.setAttribute("data-is-disabled","true"),this.options[t].hasAttribute("data-i18n-text")&&e.setAttribute("data-i18n-text",this.options[t].getAttribute("data-i18n-text")),this.options[t].hasAttribute("data-i18n-placeholder")&&e.setAttribute("data-i18n-placeholder",this.options[t].getAttribute("data-i18n-placeholder")),this.overlay.appendChild(e);Bt.getI18n()&&Bt.getI18n().translateDOMNode(this.overlay),document.body.appendChild(this.overlayModal)}},{key:"setOpened",value:function(e){if((e=!!e)!==this.opened){switch(this.opened=e,this.opened&&(this.selectedIndexBeforeOpen=this.selectedIndex),this.areAllOptionsHiddenByUserFilter()&&(this.userFilter=null,this.removeHiddenAttributeFromAllDOMOptions(),this.overlay.removeAttribute("empty"),this.setSelectedIndex(this.opened?this.selectedIndex:this.selectedIndexBeforeOpen)),this.opened){case!0:this.rootNode.setAttribute("data-is-opened","1");var t=jt.getComputedStyle(this.caption);t&&"rtl"===t.direction?this.overlay.style.direction="rtl":this.overlay.style.direction="",this.caption.value="",Bt.getI18n()&&Bt.getI18n().translateDOMNode(this.overlay);break;case!1:if(this.rootNode.removeAttribute("data-is-opened"),this.caption.value=-1===this.selectedIndex?"":this.options[this.selectedIndex].text,this.options[this.selectedIndex])if(this.selectedIndex||this.options[this.selectedIndex].value||!this.caption.hasAttribute("placeholder")){if(this.options[this.selectedIndex].hasAttribute("data-i18n-text")&&Bt.getI18n()){var n=this.options[this.selectedIndex].getAttribute("data-i18n-text"),i=Bt.getI18n().translateText(n);i&&i!==n&&(this.caption.value=i)}}else this.caption.value=""}if(!this.opened)return this.overlay.parentNode.removeChild(this.overlay),this.overlayModal.parentNode.removeChild(this.overlayModal),this.overlay.innerHTML="",void document.body.removeEventListener("mousedown",this.bodyMouseDownEventListener,!0);this.refreshOptions(),document.body.appendChild(this.overlay),this.reanchorOverlayElement(),document.body.addEventListener("mousedown",this.bodyMouseDownEventListener,!0),this.updateSelectedIndexInOverlay()}}},{key:"reanchorOverlayElement",value:function(){var e=this.rootNode.getBoundingClientRect();this.overlay.style.width="".concat(e.width,"px");var t=this.overlay.getBoundingClientRect(),n=_t.getAnchorPosition(e,t,0,["center-bottom","center-top"]);this.overlay.style.left="".concat(n.left,"px"),this.overlay.style.top="".concat(n.top,"px")}},{key:"updateSelectedIndexInOverlay",value:function(){if(this.opened)for(var e=0,t=this.overlay.childNodes,i=t.length;e<i;e++)e===this.selectedIndex?(t[e].setAttribute("selected","selected"),n.scrollOptionIntoView(t[e])):t[e].removeAttribute("selected")}},{key:"removeHiddenAttributeFromAllDOMOptions",value:function(){for(var e=0,t=this.overlay.childNodes.length;e<t;e++)this.overlay.childNodes[e].removeAttribute("hidden")}},{key:"filterOptionsInOverlay",value:function(){this.isOpened()||this.setOpened(!0);for(var e=!1,t=!1,i=!1,r=!0,a=0,o=this.overlay.childNodes,s=o.length;a<s;a++)this.overlay.childNodes[a]!==this.overlayModal&&(null===this.userFilter||""===this.userFilter||String(this.options[a].text||"").toLowerCase().indexOf(this.userFilter)>-1?(r=!1,o[a].removeAttribute("hidden"),e?o[a].removeAttribute("selected"):e=t=!0):(o[a].setAttribute("hidden","hidden"),o[a].removeAttribute("selected")),t&&(this.selectedIndex=a,o[a].setAttribute("selected","selected"),i=!0,t=!1,n.scrollOptionIntoView(o[a])),r?this.overlay.setAttribute("empty","empty"):this.overlay.removeAttribute("empty"));i||(this.selectedIndex=-1),this.reanchorOverlayElement()}},{key:"cycleSelectedOption",value:function(e){this.isOpened()||this.setOpened(!0);var t,n=0,i=this.options.length,r=this.overlay.childNodes,a=null;if(0!==i){var o,s;t=-1===this.selectedIndex?-1===e?0:i-1:this.selectedIndex;do{(t+=e)<0?t=i-1:t>=i&&(t=0),n++,this.options[t]&&(o=this.options[t].hasAttribute("disabled"),s=r[t].hasAttribute("hidden"),o||s||(a=t))}while(n<=i&&(o||s));null!==a&&this.setSelectedIndex(a)}}},{key:"areAllOptionsHiddenByUserFilter",value:function(){if(null===this.userFilter||""===this.userFilter)return!1;for(var e=0,t=this.options||[],n=t.length;e<n;e++)if(String(t[e].text||"").toLowerCase().indexOf(this.userFilter)>-1)return!1;return!0}},{key:"init",value:function(){!function(e,t){t.on("update",(function(){t.caption.value=String(-1===t.selectedIndex?"":t.options[t.selectedIndex].text)})),e(t.caption).on("focus",(function(){e(t.rootNode).attr("data-is-focused-child-element","1")})),e(t.caption).on("blur",(function(){e(t.rootNode).removeAttr("data-is-focused-child-element")})),Object.defineProperty(t.rootNode,"selectedIndex",{get:function(){return t.getSelectedIndex()},set:function(e){t.setSelectedIndex(e)}}),Object.defineProperty(t.rootNode,"value",{get:function(){return t.getValue()},set:function(e){t.setValue(String(e||""))}}),Object.defineProperty(t.rootNode,"disabled",{get:function(){return t.isDisabled()},set:function(e){t.setDisabled(!!e)}}),Object.defineProperty(t.rootNode,"readOnly",{get:function(){return t.isReadOnly()},set:function(e){t.setReadOnly(!!e)}}),Object.defineProperty(t.rootNode,"add",{get:function(){return function(){t.add.apply(t,arguments)}}}),Object.defineProperty(t.rootNode,"remove",{get:function(){return function(){t.remove.apply(t,arguments)}}}),Object.defineProperty(t.rootNode,"placeholder",{get:function(){return function(){t.getPlaceholder.apply(t,arguments)}},set:function(e){return function(){t.setPlaceholder.apply(t,arguments)}}}),t.expander.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.isDisabled()||t.isReadOnly()||void 0!==e.pageX&&void 0!==e.pageY&&0===e.pageX&&0===e.pageY||(t.caption&&t.caption.focus(),t.setOpened(!t.isOpened()))}),!0),e(t.caption).on("click",(function(){t.isDisabled()||t.isReadOnly()||t.setOpened(!0)})),e(t.caption).on("blur",(function(){t.isDisabled()||t.isReadOnly()||t.setOpened(!1)})),e(t.caption).on("keydown",(function(e){if(!t.isDisabled()&&!t.isReadOnly()){var n=null;switch(e.keyCode||e.charCode){case at.KEY_DOWN:n=1,e.preventDefault(),e.stopPropagation();break;case at.KEY_UP:n=-1,e.preventDefault(),e.stopPropagation();break;case at.KEY_ESC:return t.isOpened()&&t.setOpened(!1),e.preventDefault(),void e.stopPropagation();case at.KEY_ENTER:if(t.isOpened()){var i=t.getSelectedIndex();t.optionIsDisabled(t.overlay.childNodes[i])||(t.setOpened(!1),t.selectedIndex=void 0,t.setSelectedIndex(i))}else t.setOpened(!0);return e.preventDefault(),void e.stopPropagation();case at.KEY_HOME:t.selectedIndex=-1,n=1,t.userFilter=null,e.preventDefault(),e.stopPropagation();break;case at.KEY_END:t.selectedIndex=-1,n=-1,t.userFilter=null,e.preventDefault(),e.stopPropagation()}null!==n&&(e.preventDefault(),e.stopPropagation(),t.cycleSelectedOption(n))}})),e(t.overlay).on("click","> div[data-index]",(function(e){t.isDisabled()||t.isReadOnly()||t.optionIsDisabled(this)||t.setOpened(!1)})),e(t.caption).on("input",(function(e){if(!t.isDisabled()&&!t.isReadOnly()){try{if(document.activeElement!==t.caption)return}catch(e){}t.userFilter=this.value.toLowerCase(),t.filterOptionsInOverlay()}})),t.bodyMouseDownEventListener=function(n){if(!t.isDisabled()&&!t.isReadOnly()){var i=n.target||n.srcElement;if(e(i).is("body > [data-role=dropdown-overlay] > div[data-index]")||i===t.caption||i===t.expander){n.preventDefault(),n.stopPropagation();var r=~~e(i).attr("data-index");if(t.options[r]&&t.options[r].hasAttribute("disabled"))return;t.setSelectedIndex(r),t.setOpened(!1)}else e(i).is("body > [data-role=dropdown-overlay]")?(n.preventDefault(),n.stopPropagation()):t.setOpened(!1)}},e(window).on("scroll",(function(){t.isOpened()&&t.setOpened(!1)}))}(Bt.getJQuery(),this)}},{key:"setDisabled",value:function(e){p()(E()(n.prototype),"setDisabled",this).call(this,e),this.caption.disabled=this.expander.disabled=this.isDisabled(),this.isDisabled()&&this.isOpened()&&this.setOpened(!1)}},{key:"setReadOnly",value:function(e){p()(E()(n.prototype),"setReadOnly",this).call(this,e),this.caption.readOnly=this.isReadOnly(),this.isReadOnly()&&this.isOpened()&&this.setOpened(!1)}},{key:"getOptions",value:function(){return this.options}},{key:"setPlaceholder",value:function(e){this.caption.placeholder=String(e||"")}},{key:"getPlaceholder",value:function(){return this.caption.placeholder||null}},{key:"setAttribute",value:function(e,t){switch(e){case"data-i18n-placeholder":case"placeholder":this.caption.setAttribute(e,t);break;default:p()(E()(n.prototype),"setAttribute",this).call(this,e,t)}}},{key:"optionIsDisabled",value:function(e){var t=e.getAttribute("data-index");return this.options[t].hasAttribute("disabled")}}],[{key:"scrollOptionIntoView",value:function(e){e.parentNode.scrollTop=e.offsetTop}}]),n}(M);function Et(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var mt=function(e){g()(n,e);var t=Et(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_DROPDOWN),v()(c()(e),"nativeDropDown",void 0),v()(c()(e),"selectedOption",void 0),v()(c()(e),"updateSelectedOptionThrottled",void 0),v()(c()(e),"initSelectedIndex",null),e.nativeDropDown=document.createElement("select"),e.rootNode.appendChild(e.nativeDropDown),e.selectedOption=document.createElement("div"),e.selectedOption.setAttribute("data-role","dropdown-skin"),e.rootNode.appendChild(e.selectedOption),e.updateSelectedOptionThrottled=O.a.create((function(){e.updateSelectedOption()}),0),e.rootNode.removeAttribute("tabindex"),e.init(),e}return l()(n,[{key:"getValue",value:function(){return this.nativeDropDown.value}},{key:"setValue",value:function(e){var t=this.nativeDropDown.selectedIndex;this.nativeDropDown.value=e,this.updateSelectedOptionThrottled(),t!==this.nativeDropDown.selectedIndex&&Bt.getJQuery()(this.rootNode).trigger("change")}},{key:"getSelectedIndex",value:function(){return this.nativeDropDown.selectedIndex}},{key:"setSelectedIndex",value:function(e){this.nativeDropDown.selectedIndex=e,this.updateSelectedOptionThrottled()}},{key:"add",value:function(e,t){if(!e)throw new Error("Invalid argument: option: IUIOption|HTMLOptionElement expected!");var n=A()(e,HTMLOptionElement)?e:e.convertToHTMLOptionElement();n!==e&&(n.text=e.text,n.value=e.value),this.nativeDropDown.add(n,t),n.hasAttribute("selected")&&(this.initSelectedIndex=void 0===t?this.nativeDropDown.options.length-1:t),this.updateSelectedOptionThrottled()}},{key:"getOptions",value:function(){return this.nativeDropDown.options}},{key:"remove",value:function(e){this.nativeDropDown.remove(e),this.updateSelectedOptionThrottled()}},{key:"updateSelectedOption",value:function(){if(null!==this.initSelectedIndex&&(this.nativeDropDown.selectedIndex=this.initSelectedIndex,this.initSelectedIndex=null),-1!==this.nativeDropDown.selectedIndex){var e=this.nativeDropDown.options[this.nativeDropDown.selectedIndex];this.selectedOption.textContent=e.text}else this.selectedOption.textContent=""}},{key:"init",value:function(){!function(e,t){t.on("update",(function(){t.updateSelectedOption()})),e(t.nativeDropDown).on("change",(function(n){t.updateSelectedOptionThrottled(),e(t.rootNode).trigger("change"),n.stopPropagation()})),e(t.nativeDropDown).on("focus",(function(){e(t.rootNode).attr("data-is-focused-child-element","1")})).on("blur",(function(){e(t.rootNode).removeAttr("data-is-focused-child-element")})),Object.defineProperty(t.rootNode,"selectedIndex",{get:function(){return t.getSelectedIndex()},set:function(e){t.setSelectedIndex(e)}}),Object.defineProperty(t.rootNode,"value",{get:function(){return t.getValue()},set:function(e){t.setValue(String(e||""))}}),Object.defineProperty(t.rootNode,"disabled",{get:function(){return t.isDisabled()},set:function(e){t.setDisabled(!!e)}}),Object.defineProperty(t.rootNode,"readOnly",{get:function(){return t.isReadOnly()},set:function(e){t.setReadOnly(!!e)}}),Object.defineProperty(t.rootNode,"add",{get:function(){return function(){t.add.apply(t,arguments)}}}),Object.defineProperty(t.rootNode,"remove",{get:function(){return function(){t.remove.apply(t,arguments)}}}),Object.defineProperty(t.rootNode,"options",{get:function(){return t.getOptions()}})}(Bt.getJQuery(),this)}},{key:"setDisabled",value:function(e){p()(E()(n.prototype),"setDisabled",this).call(this,e),this.nativeDropDown.disabled=this.isDisabled()}},{key:"setReadOnly",value:function(e){p()(E()(n.prototype),"setReadOnly",this).call(this,e),this.nativeDropDown.readOnly=this.isReadOnly()}},{key:"setAttribute",value:function(e,t){switch(e){case"json-options":try{for(var i=JSON.parse(t);this.getOptions().length;)this.remove(0);if(!i||!i.length)return;for(var r=0,a=i.length;r<a;r++){var o=gt.create(this,String(i[r].id||""),String(i[r].name||i[r].id||""));this.add(o)}}catch(l){console.warn('Failed to set UIDropdown attribute "json-options": ',l)}break;case"json-value":try{var s=JSON.parse(t||"");this.setValue(s)}catch(l){console.warn('Failed to set UIDropdown attribute "json-value": ',l)}break;default:p()(E()(n.prototype),"setAttribute",this).call(this,e,t)}}}],[{key:"upgradeDropdown",value:function(e){for(var t,i=new n,r=0,a=e.options.length;r<a;r++)t=gt.create(i,e.options[r].value,e.options[r].text),i.add(t);return i.setValue(e.value),e.parentNode&&(e.parentNode.insertBefore(i.getRootNode(),e),e.parentNode.removeChild(e)),i}}]),n}(M);function vt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Tt=function(e){g()(n,e);var t=vt(n);function n(){var e;return o()(this,n),e=t.call(this,"color"),v()(c()(e),"value",[0,0,0,1]),v()(c()(e),"rollbackColor",[0,0,0,1]),v()(c()(e),"expanded",!1),v()(c()(e),"colorDiv",void 0),n.initializeOverlay(),e.colorDiv=document.createElement("div"),e.rootNode.appendChild(e.colorDiv),e.updateInputColor(),e.init(),e}return l()(n,[{key:"getValue",value:function(){return Te.RGBToString(this.value)}},{key:"getRGB",value:function(){return this.value}},{key:"getHSL",value:function(){return Te.RGBtoHSV(this.value)}},{key:"updateInputColor",value:function(){this.colorDiv.style.backgroundColor=Te.RGBToString(this.value)}},{key:"setValue",value:function(e){var t=Te.stringToRGB(e);null===t&&(t=[0,0,0,1]),Te.areEqualRGBColors(this.value,t)||(this.value=t,this.updateInputColor(),this.expanded&&n.expandedInstance===this&&(n.overlayColor=Te.RGBtoHSV(this.value),n.repaint()))}},{key:"rollback",value:function(){this.setValue(Te.RGBToString(this.rollbackColor))}},{key:"reanchorOverlayElement",value:function(){var e=n.overlay.getBoundingClientRect(),t=this.rootNode.parentElement.getBoundingClientRect(),i=document.documentElement.clientHeight||window.innerHeight;n.overlay.style.left="".concat((t.width-e.width)/2+t.left,"px"),n.overlay.style.top=n.overlay.style.top="".concat(t.top+t.height,"px"),e.height>i-t.top&&(n.overlay.style.top="".concat(t.top-e.height,"px"))}},{key:"setExpanded",value:function(e){(e=!!e)!==this.expanded&&(e&&null!==n.expandedInstance&&n.expandedInstance.setExpanded(!1),e?(this.rollbackColor[0]=this.value[0],this.rollbackColor[1]=this.value[1],this.rollbackColor[2]=this.value[2],this.rollbackColor[3]=this.value[3],n.expandedInstance&&n.expandedInstance!==this&&n.expandedInstance.setExpanded(!1),n.expandedInstance=this,n.overlayColor=Te.RGBtoHSV(this.value),document.body.appendChild(n.overlay),this.reanchorOverlayElement(),this.expanded&&n.expandedInstance===this&&(n.overlayColor=Te.RGBtoHSV(this.value),n.repaint()),n.repaint()):(n.expandedInstance&&n.expandedInstance===this&&(n.expandedInstance=null),n.overlay.parentNode&&n.overlay.parentNode.removeChild(n.overlay)),this.expanded=e)}},{key:"isExpanded",value:function(){return this.expanded}},{key:"setChangeCallback",value:function(e){n.changeCallback=e}},{key:"init",value:function(){!function(e,t){t(e.rootNode).on("click",(function(){e.isDisabled()||e.isReadOnly()||(e.setExpanded(!0),n.tryFocusColorTextInput())})),Object.defineProperty(e.getRootNode(),"value",{get:function(){return e.getValue()},set:function(t){e.setValue(t)}}),Object.defineProperty(e.getRootNode(),"disabled",{get:function(){return e.isDisabled()},set:function(t){e.setDisabled(!!t)}}),Object.defineProperty(e.getRootNode(),"readOnly",{get:function(){return e.isReadOnly()},set:function(t){e.setReadOnly(!!t)}})}(this,Bt.getJQuery())}}],[{key:"paintHueOverlay",value:function(){for(var e,t=1/this.OVERLAY_WIDTH,n=this.hueCanvas.getContext("2d"),i=0;i<this.OVERLAY_WIDTH;i++)e=i*t,n.fillStyle=Te.HSVToString([e,.5,.66,1]),n.fillRect(i,0,1,this.HORIZONTAL_SLIDER_HEIGHT);if(this.sliderSpriteLoaded){var r=~~(this.overlayColor[0]*this.OVERLAY_WIDTH);n.drawImage(this.sliderSprite,r+this.sliderSpritePaintTranslateX,this.sliderSpritePaintTranslateY)}}},{key:"paintSaturationOverlay",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1/this.OVERLAY_WIDTH,r=1/this.COLOR_CANVAS_HEIGHT,a=this.saturationCanvas.getContext("2d");if(t&&this.saturationCanvasCacheReady)a.drawImage(this.saturationCanvasCache,0,0);else{for(var o=0;o<this.OVERLAY_WIDTH;o++)for(var s=0;s<this.COLOR_CANVAS_HEIGHT;s++)a.fillStyle=Te.RGBToString(Te.HSVtoRGB([e,1-s*r,o*i,1]),!1),a.fillRect(o,s,1,1);n&&(this.saturationCanvasCacheReady=!1,this.saturationCanvasCache.src=this.saturationCanvas.toDataURL("image/png"))}if(this.crossSpriteLoaded){var l={top:~~(this.COLOR_CANVAS_HEIGHT*(1-this.overlayColor[1])),left:~~(this.OVERLAY_WIDTH*this.overlayColor[2])};a.drawImage(this.crossSprite,l.left+this.crossSpritePaintTranslateX,l.top+this.crossSpritePaintTranslateY)}}},{key:"paintLightOverlay",value:function(e,t){for(var n=1/this.OVERLAY_WIDTH,i=this.lightCanvas.getContext("2d"),r=0;r<this.OVERLAY_WIDTH;r++)i.fillStyle=Te.HSVToString([e,t,r*n,1]),i.fillRect(r,0,1,this.HORIZONTAL_SLIDER_HEIGHT);if(this.sliderSpriteLoaded){var a=~~(this.overlayColor[2]*this.OVERLAY_WIDTH);i.drawImage(this.sliderSprite,a+this.sliderSpritePaintTranslateX,this.sliderSpritePaintTranslateY)}}},{key:"paintAlphaOverlay",value:function(e,t,n){var i=1/this.OVERLAY_WIDTH,r=this.alphaCanvas.getContext("2d"),a=[e,t,n,1];if(r.fillStyle="white",r.fillRect(0,0,this.OVERLAY_WIDTH,this.HORIZONTAL_SLIDER_HEIGHT),this.patternLoaded){var o=r.createPattern(this.transparencyPattern,"repeat");r.rect(0,0,this.OVERLAY_WIDTH,this.HORIZONTAL_SLIDER_HEIGHT),r.fillStyle=o,r.fill()}else r.fillStyle="#ffffff",r.fillRect(0,0,this.OVERLAY_WIDTH,this.HORIZONTAL_SLIDER_HEIGHT);for(var s=0;s<this.OVERLAY_WIDTH;s++)a[3]=s*i,r.fillStyle=Te.HSVToString(a),r.fillRect(s,0,1,this.HORIZONTAL_SLIDER_HEIGHT);if(this.sliderSpriteLoaded){var l=~~(this.overlayColor[3]*this.OVERLAY_WIDTH);r.drawImage(this.sliderSprite,l+this.sliderSpritePaintTranslateX,this.sliderSpritePaintTranslateY)}}},{key:"updateColorText",value:function(){if(this.setOpaque.style.backgroundColor=Te.HSVToString(Te.removeAlpha(this.overlayColor)),this.updateColorModel)switch(this.colorModel){case T.g.RGBA:this.colorTextInput.value=Te.RGBToString(Te.HSVtoRGB(this.overlayColor));break;case T.g.HSLA:this.colorTextInput.value=Te.HSVToString(this.overlayColor);break;default:console.warn("Don't know how to update the color text")}}},{key:"forcePointInClientRect",value:function(e,t){return e.left<0&&(e.left=0),e.left>=t.width&&(e.left=t.width-1),e.top<0&&(e.top=0),e.top>=t.height&&(e.top=t.height-1),e}},{key:"initializeOverlay",value:function(){var e;this.initialized||(this.overlay=document.createElement("div"),this.overlay.setAttribute("data-role","color-overlay"),this.overlayModal=document.createElement("div"),this.overlayModal.className="ui-modal",this.overlayModal.setAttribute("data-transparent","1"),this.overlay.appendChild(this.overlayModal),this.hueCanvas=document.createElement("canvas"),this.hueCanvas.setAttribute("data-role","hue"),this.saturationCanvas=document.createElement("canvas"),this.saturationCanvas.setAttribute("data-role","saturation"),this.lightCanvas=document.createElement("canvas"),this.lightCanvas.setAttribute("data-role","light"),this.alphaCanvas=document.createElement("canvas"),this.alphaCanvas.setAttribute("data-role","transparency"),this.transparencyPattern=document.createElement("img"),this.sliderSprite=document.createElement("img"),this.crossSprite=document.createElement("img"),this.colorTextInput=document.createElement("input"),this.colorTextInput.setAttribute("type","text"),this.colorTextInput.setAttribute("data-role","color-text"),this.colorTextInput.setAttribute("placeholder","Type a color..."),this.setTransparent=document.createElement("button"),this.setTransparent.setAttribute("data-role","set-transparent"),this.setOpaque=document.createElement("button"),this.setOpaque.title="Set opaque color",this.setOpaque.setAttribute("data-role","set-opaque"),this.setTransparent.title="Set full transparent",this.saturationCanvasCache=document.createElement("img"),(e=this).saveColorToTargetInputThrottle=O.a.create((function(){if(e.setColorToTargetInput(),null!==e.changeCallback)try{e.changeCallback()}catch(t){console.error(t)}}),50),e.transparencyPattern.addEventListener("load",(function(){e.patternLoaded=!0})),e.sliderSprite.addEventListener("load",(function(){e.sliderSpriteLoaded=!0})),e.crossSprite.addEventListener("load",(function(){e.crossSpriteLoaded=!0})),e.saturationCanvasCache.addEventListener("load",(function(){e.saturationCanvasCacheReady=!0})),this.transparencyPattern.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAAAAACo4kLRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QkbEgM2YPFhLAAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAP0lEQVQY02P8zwADp+EsJgZkwMjA8P8fAwMLiuB/BgZGRnSVWLXTW5AF4Q9TZJX//jMwMKKqhJjwfxA5HqsgAFYwCPaivXxiAAAAAElFTkSuQmCC",this.sliderSprite.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAHVSURBVCiRldIxaBNxFAbw995d+//uSlxKS4TiUBM4sSLdwoGrDhZBQoPQDLbQQoe0FEqLW3DpKlQ7qDWSzbTqUFRcnZNARRKwKW6CTjWDd/euSZ1SurS13/SG78d7w2M6kXfl8jBcd6HfmLsukDYAAfjuGPPBdd31ZCr1u9fl3lDa2Jg0xmw6wIEBXjuOUwfQRX//GICHAJJ9tj0z4nnbx/DJ2tqkA7wB8NIZHFzM5XLByUuq1WpfQuQxgFVLJDfiedtcXF4eHkgkWgb4VFhZecDMR3RK9nZ3n8GYvG1ZKekSLaiqCYJg6SxERERB8EhVu51OpyBRFE2o6pfVYvHnmYiI0plMW1U/xoeHE6Kqo6q6fx7qJVZtaRSlbFUlEXH/F4ZRNMAiR7aq7ouIf4GNvmVZLYmiaEdVry7Ozt47D33e2vI1jjMaRTsSMK+rajtWfb40Pz96GqqUSskwjsuq2g7D8KnVaDT+jqXTeyQyzURTt3z/143x8UatVusSEVUqFeu2798n5rfCfIWJpu5ks/Xjl8tns1kHeAXgEoADB/hmgC6AazBmCMAfA0zn5+beExFZPfi12Wze9LxNJgpZZIiZrzPRZWH+QcwvbOb8TKFQ7/X/AQl6styfo0m+AAAAAElFTkSuQmCC",this.crossSprite.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAHVSURBVCiRldIxaBNxFAbw995d+//uSlxKS4TiUBM4sSLdwoGrDhZBQoPQDLbQQoe0FEqLW3DpKlQ7qDWSzbTqUFRcnZNARRKwKW6CTjWDd/euSZ1SurS13/SG78d7w2M6kXfl8jBcd6HfmLsukDYAAfjuGPPBdd31ZCr1u9fl3lDa2Jg0xmw6wIEBXjuOUwfQRX//GICHAJJ9tj0z4nnbx/DJ2tqkA7wB8NIZHFzM5XLByUuq1WpfQuQxgFVLJDfiedtcXF4eHkgkWgb4VFhZecDMR3RK9nZ3n8GYvG1ZKekSLaiqCYJg6SxERERB8EhVu51OpyBRFE2o6pfVYvHnmYiI0plMW1U/xoeHE6Kqo6q6fx7qJVZtaRSlbFUlEXH/F4ZRNMAiR7aq7ouIf4GNvmVZLYmiaEdVry7Ozt47D33e2vI1jjMaRTsSMK+rajtWfb40Pz96GqqUSskwjsuq2g7D8KnVaDT+jqXTeyQyzURTt3z/143x8UatVusSEVUqFeu2798n5rfCfIWJpu5ks/Xjl8tns1kHeAXgEoADB/hmgC6AazBmCMAfA0zn5+beExFZPfi12Wze9LxNJgpZZIiZrzPRZWH+QcwvbOb8TKFQ7/X/AQl6styfo0m+AAAAAElFTkSuQmCC",this.overlay.appendChild(this.hueCanvas),this.overlay.appendChild(this.saturationCanvas),this.overlay.appendChild(this.lightCanvas),this.overlay.appendChild(this.alphaCanvas),this.overlay.appendChild(this.colorTextInput),this.overlay.appendChild(this.setTransparent),this.overlay.appendChild(this.setOpaque),this.hueCanvas.width=n.lightCanvas.width=n.saturationCanvas.width=n.alphaCanvas.width=this.OVERLAY_WIDTH,this.hueCanvas.height=n.lightCanvas.height=n.alphaCanvas.height=this.HORIZONTAL_SLIDER_HEIGHT,this.saturationCanvas.height=this.COLOR_CANVAS_HEIGHT,this.paintHueOverlay(),this.updateColorText(),function(e,t){var n=T.h.NONE;t(document.body).on("mousedown",(function(r){if(1===r.which){var a=r.target||r.srcElement;if(e.expandedInstance){if((!t.contains(e.overlay,a)||a===e.overlayModal)&&!t.contains(e.expandedInstance.getRootNode(),a)&&a!==e.expandedInstance.getRootNode()&&a!==e.overlay)return void e.expandedInstance.setExpanded(!1);switch(a){case e.hueCanvas:n=T.h.HUE,e.hueCanvas.getBoundingClientRect(),i(r);break;case e.saturationCanvas:n=T.h.SATURATION,e.saturationCanvas.getBoundingClientRect(),i(r);break;case e.lightCanvas:n=T.h.LIGHT,e.lightCanvas.getBoundingClientRect(),i(r);break;case e.alphaCanvas:n=T.h.ALPHA,e.alphaCanvas.getBoundingClientRect(),i(r);break;default:n=T.h.NONE,null}}}})),t(document.body).on("mouseup",(function(e){n=T.h.NONE,null}));var i=function(t){if(n!==T.h.NONE){var i=null,r=null;switch(n){case T.h.HUE:r=e.hueCanvas.getBoundingClientRect(),i=e.forcePointInClientRect({left:t.clientX-r.left,top:t.clientY-r.top},r),e.setHueByPixels(i),t.preventDefault(),t.stopPropagation();break;case T.h.SATURATION:r=e.saturationCanvas.getBoundingClientRect(),i=e.forcePointInClientRect({left:t.clientX-r.left,top:t.clientY-r.top},r),e.setSaturationByPixels(i),t.preventDefault(),t.stopPropagation();break;case T.h.LIGHT:r=e.lightCanvas.getBoundingClientRect(),i=e.forcePointInClientRect({left:t.clientX-r.left,top:t.clientY-r.top},r),e.setLightByPixels(i),t.preventDefault(),t.stopPropagation();break;case T.h.ALPHA:r=e.alphaCanvas.getBoundingClientRect(),i=e.forcePointInClientRect({left:t.clientX-r.left,top:t.clientY-r.top},r),e.setAlphaByPixels(i),t.preventDefault(),t.stopPropagation()}}};document.body.addEventListener("mousemove",i,!0),t(e.overlay).on("click","button[data-role]",(function(n){var i=t(this).attr("data-role");e.execButtonCommand(i)})),t(e.colorTextInput).on("input",(function(t){var n=Te.stringToRGB(this.value);null!==n&&(e.updateColorModel=!1,e.overlayColor=Te.RGBtoHSV(n),e.repaint(),e.updateColorModel=!0,e.saveColorToTargetInputThrottle())})).on("keyup",(function(t){switch(t.keyCode||t.charCode){case 13:e.expandedInstance&&(setTimeout(e.expandedInstance.getRootNode().focus,1),e.expandedInstance.setExpanded(!1));break;case 27:e.expandedInstance&&(e.expandedInstance.rollback(),setTimeout(function(e){return e.getRootNode().focus}(e.expandedInstance),1),e.expandedInstance.setExpanded(!1))}}))}(this,Bt.getJQuery()),this.initialized=!0)}},{key:"setHueByPixels",value:function(e){var t=e.left*(1/this.OVERLAY_WIDTH);this.overlayColor[0]=t,this.paintHueOverlay(),this.paintSaturationOverlay(this.overlayColor[0],!1,!0),this.paintLightOverlay(this.overlayColor[0],this.overlayColor[1]),this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput()}},{key:"setSaturationByPixels",value:function(e){var t=e.left*(1/this.OVERLAY_WIDTH),i=1-e.top*(1/this.COLOR_CANVAS_HEIGHT);this.overlayColor[2]=t,this.overlayColor[1]=i,this.paintSaturationOverlay(this.overlayColor[0],!0),this.paintLightOverlay(this.overlayColor[0],this.overlayColor[1]),this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput()}},{key:"setLightByPixels",value:function(e){var t=e.left*(1/this.OVERLAY_WIDTH);this.overlayColor[2]=t,this.paintLightOverlay(this.overlayColor[0],this.overlayColor[1]),this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput()}},{key:"setAlphaByPixels",value:function(e){var t=e.left*(1/this.OVERLAY_WIDTH);this.overlayColor[3]=t,this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput()}},{key:"repaint",value:function(){this.paintHueOverlay(),this.paintSaturationOverlay(this.overlayColor[0],!1,!0),this.paintLightOverlay(this.overlayColor[0],this.overlayColor[1]),this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),n.tryFocusColorTextInput()}},{key:"execButtonCommand",value:function(e){switch(e){case"set-transparent":this.overlayColor[3]=0,this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput();break;case"set-opaque":this.overlayColor[3]=1,this.paintAlphaOverlay(this.overlayColor[0],this.overlayColor[1],this.overlayColor[2]),this.updateColorText(),this.saveColorToTargetInputThrottle(),n.tryFocusColorTextInput();break;default:console.warn("UIColorPicker.execButtonCommand: command ".concat(JSON.stringify(e)," is not implemented or unknown"))}}},{key:"setColorToTargetInput",value:function(){null!==this.expandedInstance&&(this.expandedInstance.value=Te.HSVtoRGB(this.overlayColor),this.expandedInstance.updateInputColor(),Bt.getJQuery()(this.expandedInstance.getRootNode()).trigger("change"))}},{key:"tryFocusColorTextInput",value:function(){_e.isMobile()||n.colorTextInput.focus()}}]),n}(M);v()(Tt,"HORIZONTAL_SLIDER_HEIGHT",20),v()(Tt,"OVERLAY_WIDTH",220),v()(Tt,"COLOR_CANVAS_HEIGHT",160),v()(Tt,"initialized",!1),v()(Tt,"overlay",void 0),v()(Tt,"overlayModal",void 0),v()(Tt,"hueCanvas",void 0),v()(Tt,"saturationCanvas",void 0),v()(Tt,"lightCanvas",void 0),v()(Tt,"alphaCanvas",void 0),v()(Tt,"expandedInstance",null),v()(Tt,"transparencyPattern",void 0),v()(Tt,"patternLoaded",!1),v()(Tt,"sliderSprite",void 0),v()(Tt,"sliderSpriteLoaded",!1),v()(Tt,"sliderSpritePaintTranslateX",-5),v()(Tt,"sliderSpritePaintTranslateY",3),v()(Tt,"crossSprite",void 0),v()(Tt,"crossSpriteLoaded",!1),v()(Tt,"crossSpritePaintTranslateX",-6),v()(Tt,"crossSpritePaintTranslateY",-7),v()(Tt,"colorTextInput",void 0),v()(Tt,"colorModel",T.g.RGBA),v()(Tt,"setTransparent",void 0),v()(Tt,"setOpaque",void 0),v()(Tt,"updateColorModel",!0),v()(Tt,"overlayColor",[0,0,0,1]),v()(Tt,"saturationCanvasCache",void 0),v()(Tt,"saturationCanvasCacheReady",!1),v()(Tt,"saveColorToTargetInputThrottle",void 0),v()(Tt,"changeCallback",null);var Ot=n(33),Ct=function(){function e(t,n){switch(o()(this,e),v()(this,"min",void 0),v()(this,"max",void 0),v()(this,"padLength",void 0),v()(this,"role",void 0),v()(this,"input",void 0),v()(this,"root",void 0),v()(this,"disabled",void 0),v()(this,"readOnly",void 0),v()(this,"value",void 0),this.role=t,this.input=n,this.root=document.createElement("div"),this.root.setAttribute("data-role","date-part"),this.root.setAttribute("data-part",this.getDatePartRoleName(t)),this.root.setAttribute("aria-labelledby","date-".concat(this.input.getHash(),"-").concat(this.getDatePartRoleName(t))),this.disabled=!1,this.readOnly=!1,t){case T.i.DAY:this.min=1,this.max=31,this.padLength=2;break;case T.i.MONTH:this.min=1,this.max=12,this.padLength=2;break;case T.i.YEAR:this.min=0,this.max=9999,this.padLength=4;break;case T.i.HOUR_24:this.min=0,this.max=23,this.padLength=2;break;case T.i.HOUR_12:this.min=0,this.max=12,this.padLength=2;break;case T.i.MINUTE:case T.i.SECOND:this.min=0,this.max=59,this.padLength=2;break;case T.i.MILLISECOND:this.min=0,this.max=999,this.padLength=3;break;case T.i.AM_PM:this.min=0,this.max=1,this.padLength=1}}return l()(e,[{key:"withDisabled",value:function(e){return this.disabled=!!e,this.disabled?this.root.setAttribute("disabled",""):this.root.removeAttribute("disabled"),this}},{key:"isDisabled",value:function(){return this.disabled}},{key:"withReadOnly",value:function(e){return this.readOnly=!!e,this.readOnly?this.root.setAttribute("readonly",""):this.root.removeAttribute("readonly"),this}},{key:"extractDatePartFrom",value:function(e){if(null===e)this.value=null;else switch(this.role){case T.i.DAY:this.value=e.getDate();break;case T.i.MONTH:this.value=e.getMonth()+1;break;case T.i.YEAR:this.value=e.getFullYear();break;case T.i.HOUR_24:this.value=e.getHours();break;case T.i.HOUR_12:this.value=e.getHours()>12?e.getHours()-12:e.getHours();break;case T.i.MINUTE:this.value=e.getMinutes();break;case T.i.SECOND:this.value=e.getSeconds();break;case T.i.MILLISECOND:this.value=e.getMilliseconds();break;case T.i.AM_PM:this.value=e.getHours()>=12?1:0}return this.render(),this}},{key:"render",value:function(){if(null===this.value){this.root.setAttribute("data-is-null","");var e=this.getPlaceholder();this.root.textContent=e.text,e.intlKey&&this.root.setAttribute("data-i18n-text",e.intlKey)}else if(this.root.removeAttribute("data-is-null"),this.root.removeAttribute("data-i18n-text"),this.role===T.i.AM_PM)this.root.textContent=0===this.value?"AM":"PM";else{for(var t=String(this.value);t.length<this.padLength;)t="0".concat(t);this.root.textContent=t}}},{key:"getPlaceholder",value:function(){var e,t;switch(this.role){case T.i.DAY:e="dd",t="textdef_63";break;case T.i.MONTH:e="mm",t="textdef_62";break;case T.i.YEAR:e="yyyy",t="textdef_64";break;case T.i.HOUR_24:case T.i.HOUR_12:e="hh",t="textdef_65";break;case T.i.MINUTE:e="mm",t="textdef_66";break;case T.i.SECOND:e="ss";break;case T.i.MILLISECOND:e="ms";break;case T.i.AM_PM:e="AM"}return t?{text:Bt.getI18n()?Bt.getI18n().translateText(t):e,intlKey:t}:{text:e,intlKey:""}}},{key:"getDatePartRoleName",value:function(e){switch(e){case T.i.DAY:return"day";case T.i.MONTH:return"month";case T.i.YEAR:return"year";case T.i.HOUR_24:return"hour-24";case T.i.HOUR_12:return"hour-12";case T.i.MINUTE:return"minute";case T.i.SECOND:return"second";case T.i.MILLISECOND:return"millisecond";case T.i.AM_PM:return"am-pm";default:return"invalid"}}},{key:"addDigit",value:function(e){var t;if(null===e)t=null;else if((null===this.value||(t=10*this.value+e)>this.max)&&(t=e),String(t).length>this.padLength&&(t=~~String(t).substr(1)),t<this.min||t>this.max)return;this.value=t,this.input.rebuildDateFromParts(),this.input.trigger("date-part-changed"),this.render()}},{key:"incDec",value:function(e){var t=this.value;null===t?t=1===e?this.min:this.max:(t+=e)>this.max?t=this.min:t<this.min&&(t=this.max),this.value=t,this.input.rebuildDateFromParts(),this.input.trigger("date-part-changed"),this.render()}},{key:"handleKeyEvent",value:function(e){if(!this.disabled&&!this.readOnly){var t=0|(e.keyCode||e.charCode),n=this.input.getDateValue(),i=!1;switch(0|t){case 37:this.input.focusPreviousDatePartGroup(),e.preventDefault(),e.stopPropagation();break;case 38:this.incDec(1),i=!0,e.preventDefault(),e.stopPropagation();break;case 39:this.input.focusNextDatePartGroup(),e.preventDefault(),e.stopPropagation();break;case 40:this.incDec(-1),i=!0,e.preventDefault(),e.stopPropagation();break;case 8:case 46:this.addDigit(null),i=!0,e.preventDefault(),e.stopPropagation();break;case 48:case 96:this.addDigit(0),i=!0,e.preventDefault(),e.stopPropagation();break;case 49:case 97:this.role!==T.i.AM_PM&&(this.addDigit(1),i=!0,e.preventDefault(),e.stopPropagation());break;case 50:case 98:this.role!==T.i.AM_PM&&(this.addDigit(2),i=!0,e.preventDefault(),e.stopPropagation());break;case 51:case 99:this.role!==T.i.AM_PM&&(this.addDigit(3),i=!0,e.preventDefault(),e.stopPropagation());break;case 52:case 100:this.role!==T.i.AM_PM&&(this.addDigit(4),i=!0,e.preventDefault(),e.stopPropagation());break;case 53:case 101:this.role!==T.i.AM_PM&&(this.addDigit(5),i=!0,e.preventDefault(),e.stopPropagation());break;case 54:case 102:this.role!==T.i.AM_PM&&(this.addDigit(6),i=!0,e.preventDefault(),e.stopPropagation());break;case 55:case 103:this.role!==T.i.AM_PM&&(this.addDigit(7),i=!0,e.preventDefault(),e.stopPropagation());break;case 56:case 104:this.role!==T.i.AM_PM&&(this.addDigit(8),i=!0,e.preventDefault(),e.stopPropagation());break;case 57:case 105:this.role!==T.i.AM_PM&&(this.addDigit(9),i=!0,e.preventDefault(),e.stopPropagation());break;case 65:this.role===T.i.AM_PM&&(this.addDigit(0),i=!0,e.preventDefault(),e.stopPropagation());break;case 80:this.role===T.i.AM_PM&&(this.addDigit(1),i=!0,e.preventDefault(),e.stopPropagation());break;case 9:e.shiftKey?this.input.focusPreviousDatePartGroup():this.input.focusNextDatePartGroup(),this.getRootNode().hasAttribute("data-is-focused")||(e.preventDefault(),e.stopPropagation())}if(i){var r;try{r=this.input.getDateValue()}catch(e){r=null}Ot.a.dateEquals(r,n)||Bt.getJQuery()(this.input.getRootNode()).trigger("input")}}}},{key:"getRootNode",value:function(){return this.root}},{key:"getRole",value:function(){return this.role}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){this.value=e,this.input.rebuildDateFromParts(),this.render()}}]),e}(),Nt=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getMouseButtonFromEvent",value:function(e){return this.isSafariOnMac?e.which:e.buttons}},{key:"init",value:function(){this.isSafariOnMac=""===_e.meetsRequirements("mac * desktop safari *"),this.mobileOnAndroid=""===_e.meetsRequirements("android * * * *"),""===_e.meetsRequirements("* * mobile * *")?this.mobile=!0:this.mobile=!1}},{key:"isMobile",value:function(){return this.mobile}},{key:"isAndroid",value:function(){return this.mobileOnAndroid}},{key:"setCanMakeResize",value:function(e){this._canMakeResize=e}},{key:"canMakeResize",get:function(){return this._canMakeResize}}]),e}();function At(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Nt,"isSafariOnMac",void 0),v()(Nt,"mobile",void 0),v()(Nt,"mobileOnAndroid",void 0),v()(Nt,"_canMakeResize",!0),Nt.init();var bt=function(e){g()(n,e);var t=At(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_DATE),v()(c()(e),"dateGroups",[]),v()(c()(e),"format",void 0),v()(c()(e),"currentDateGroup",void 0),v()(c()(e),"value",null),v()(c()(e),"expander",void 0),v()(c()(e),"expanded",!1),v()(c()(e),"weekStart",T.k.SUNDAY),v()(c()(e),"acceptedDaysOfWeek",null),v()(c()(e),"hash",void 0),v()(c()(e),"hasAccessibilityEnabled",void 0),v()(c()(e),"i18n",void 0),v()(c()(e),"hiddenInput",void 0),e.expander=document.createElement("div"),e.expander.setAttribute("data-role","expander"),e.expander.setAttribute("role","application"),Nt.isMobile()&&(e.hiddenInput=document.createElement("input"),e.hiddenInput.style.display="block",e.hiddenInput.style.border="none",e.hiddenInput.style.width="1px",e.hiddenInput.style.height="1px",e.hiddenInput.style.opacity=".1",e.hiddenInput.style.position="absolute",e.hiddenInput.style.right=e.hiddenInput.style.top="0",e.rootNode.appendChild(e.hiddenInput)),e.init(),e}return l()(n,[{key:"padNumber",value:function(e,t){for(var n=String(e||0);n.length<t;)n="0".concat(n);return n}},{key:"withWeekStart",value:function(e){return this.weekStart=~~e||T.k.SUNDAY,this}},{key:"getWeekStart",value:function(){return this.weekStart}},{key:"withAcceptedDaysOfWeek",value:function(e){return this.acceptedDaysOfWeek=e,this}},{key:"getAcceptedDaysOfWeek",value:function(){return this.acceptedDaysOfWeek}},{key:"getValue",value:function(){if(null===this.value)return"";switch(this.format){case Ee.VALIDATOR_TYPE_DATE_MMYYYY:return"".concat(this.padNumber(this.value.getMonth()+1,2),"/").concat(this.padNumber(this.value.getFullYear(),4));case Ee.VALIDATOR_TYPE_DATE_YYYYMMDD:return"".concat(this.padNumber(this.value.getFullYear(),4),"/").concat(this.padNumber(this.value.getMonth()+1,2),"/").concat(this.padNumber(this.value.getDate(),2));case Ee.VALIDATOR_TYPE_DATE_DDMMYYYY:return"".concat(this.padNumber(this.value.getDate(),2),"/").concat(this.padNumber(this.value.getMonth()+1,2),"/").concat(this.padNumber(this.value.getFullYear(),4));case Ee.VALIDATOR_TYPE_DATE_MMDDYYYY:default:return"".concat(this.padNumber(this.value.getMonth()+1,2),"/").concat(this.padNumber(this.value.getDate(),2),"/").concat(this.padNumber(this.value.getFullYear(),4))}}},{key:"setValue",value:function(e){var t;if("string"!==typeof e)t=null,console.warn("Invalid date: ",e);else{var n,i=1,r=null,a=null;switch(this.format){case Ee.VALIDATOR_TYPE_DATE_DDMMYYYY:(n=/^([\d]{2})[\/\-\.]{1}([\d]{2})[\/\-\.]{1}([\d]{4})$/.exec(e))&&(i=parseInt(n[1]),r=parseInt(n[2]),a=parseInt(n[3]));break;case Ee.VALIDATOR_TYPE_DATE_MMYYYY:(n=/^([\d]{2})[\/\-\.]{1}([\d]{4})$/.exec(e))&&(r=parseInt(n[1]),a=parseInt(n[2]));break;case Ee.VALIDATOR_TYPE_DATE_YYYYMMDD:(n=/^([\d]{4})[\/\-\.]{1}([\d]{2})[\/\-\.]{1}([\d]{2})$/.exec(e))&&(a=parseInt(n[1]),r=parseInt(n[2]),i=parseInt(n[3]));break;case Ee.VALIDATOR_TYPE_DATE_MMDDYYYY:default:(n=/^([\d]{2})[\/\-\.]{1}([\d]{2})[\/\-\.]{1}([\d]{4})$/.exec(e))&&(r=parseInt(n[1]),i=parseInt(n[2]),a=parseInt(n[3]))}if(null==r||null==a?(t=null,console.warn("Invalid date: ",e)):((t=new Date).setHours(12),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setMonth(r-1),t.setDate(i),t.setFullYear(a)),Ot.a.dateEquals(this.value,t))return;this.value=t;for(var o=0,s=this.dateGroups.length;o<s;o++)this.dateGroups[o].extractDatePartFrom(this.value)}}},{key:"withHash",value:function(e){return this.hash=e,this}},{key:"getHash",value:function(){return this.hash}},{key:"setAccessibilityEnabled",value:function(e){this.hasAccessibilityEnabled=e}},{key:"setFormat",value:function(e){var t;this.format=e,this.dateGroups=this.getFormatDateGroups(e),this.rootNode.textContent="";var n=document.createElement("div");n.setAttribute("data-role","date-wrapper");for(var i=0,r=this.dateGroups.length;i<r;i++){var a=this.getDateGroupAttribute(this.dateGroups[i].getRole(),this.hash);this.dateGroups[i].getRootNode().setAttribute("id",a),this.dateGroups[i].withDisabled(this.disabled).withReadOnly(this.readOnly),this.dateGroups[i].extractDatePartFrom(this.value),n.appendChild(this.dateGroups[i].getRootNode()),i<r-1&&((t=n.appendChild(document.createElement("span"))).setAttribute("data-delimiter","1"),t.textContent="/")}this.updateAccessibilityFeature(),this.rootNode.appendChild(n),this.rootNode.appendChild(this.expander),this.setCurrentDateGroup(this.dateGroups[0]||null),this.hiddenInput&&this.rootNode.appendChild(this.hiddenInput)}},{key:"getDateGroupAttribute",value:function(e,t){switch(e){case T.i.DAY:return"date-".concat(t,"-day");case T.i.MONTH:return"date-".concat(t,"-month");case T.i.YEAR:return"date-".concat(t,"-year")}return""}},{key:"getFormatDateGroups",value:function(e){var t;switch(e){case Ee.VALIDATOR_TYPE_DATE_DDMMYYYY:t=[new Ct(T.i.DAY,this),new Ct(T.i.MONTH,this),new Ct(T.i.YEAR,this)];break;case Ee.VALIDATOR_TYPE_DATE_MMDDYYYY:t=[new Ct(T.i.MONTH,this),new Ct(T.i.DAY,this),new Ct(T.i.YEAR,this)];break;case Ee.VALIDATOR_TYPE_DATE_MMYYYY:t=[new Ct(T.i.MONTH,this),new Ct(T.i.YEAR,this)];break;case Ee.VALIDATOR_TYPE_DATE_YYYYMMDD:t=[new Ct(T.i.YEAR,this),new Ct(T.i.MONTH,this),new Ct(T.i.DAY,this)];break;default:throw new Error("Invalid date format! Expected DDMMYYYY, MMDDYYYY, MMYYYY, YYYYMMDD")}return t}},{key:"updateAccessibilityFeature",value:function(){if(this.hasAccessibilityEnabled){var e=document.createElement("div");e.setAttribute("id","date-expander-text-acc"),e.appendChild(document.createTextNode("Click to choose time")),e.style.display="none",this.expander.tabIndex=0,this.expander.appendChild(e),this.expander.setAttribute("aria-labelledby","date-expander-text-acc")}else this.expander.removeAttribute("tabindex")}},{key:"getFormat",value:function(){return this.format}},{key:"getDateValue",value:function(){return this.value}},{key:"setDateValue",value:function(e){if(null!==e&&!A()(e,Date))throw new Error("Invalid argument: Expected Date|null");this.value=e;for(var t=0,n=this.dateGroups.length;t<n;t++)this.dateGroups[t].extractDatePartFrom(this.value)}},{key:"setCurrentDateGroup",value:function(e){this.currentDateGroup&&this.currentDateGroup.getRootNode().removeAttribute("data-is-focused"),this.currentDateGroup=e||null,this.currentDateGroup&&this.currentDateGroup.getRootNode().setAttribute("data-is-focused","data-is-focused")}},{key:"isDateValidIfDatePartIs",value:function(e,t){if(e===T.i.AM_PM)return 0===t||1===t;for(var n=new Date,i=new Date,r=1,a=0,o=0,s=0,l=this.dateGroups.length;s<l;s++)switch(this.dateGroups[s].getRole()){case 0:r=this.dateGroups[s].getValue();break;case 1:a=this.dateGroups[s].getValue();break;case 2:o=this.dateGroups[s].getValue()}if(!a&&!o)return!0;switch(n.setFullYear(o,a-1,r),i.setFullYear(o,a-1,r),e){case T.i.DAY:return n.setDate(t),n.getMonth()===i.getMonth()&&n.getFullYear()===i.getFullYear();case T.i.MONTH:return n.setMonth(t-1),n.getDate()===i.getDate()&&n.getFullYear()===i.getFullYear();case T.i.YEAR:return n.setFullYear(t),n.getDate()===i.getDate()&&n.getMonth()===i.getMonth();default:return!0}}},{key:"rebuildDateFromParts",value:function(){for(var e=1,t=null,n=null,i=0,r=this.dateGroups.length;i<r;i++)switch(this.dateGroups[i].getRole()){case T.i.YEAR:n=this.dateGroups[i].getValue();break;case T.i.MONTH:t=this.dateGroups[i].getValue();break;case T.i.DAY:e=this.dateGroups[i].getValue()}if(null===t||null===n)this.value=null;else{var a=new Date;a.setFullYear(n),a.setMonth(t-1,e),a.setDate(e),a.getDate()===e&&a.getMonth()===t-1&&a.getFullYear()===n?(this.value=new Date,this.value.setTime(a.getTime())):this.value=null}}},{key:"setExpanded",value:function(e){if(!this.isReadOnly()){if((e=!!e)===this.expanded)return;this.expanded=e,n.initOverlay(e?this:null),e?this.expander.setAttribute("data-expanded","1"):this.expander.removeAttribute("data-expanded")}}},{key:"init",value:function(){!function(e,t){e.expander.addEventListener("keydown",(function(t){var i=!1,r=t.keyCode||t.charCode;switch(r){case at.KEY_TAB:if(!e.expanded)return e.expander.removeAttribute("tabindex"),void setTimeout((function(){e.expander.tabIndex=0}),1e3);n.focusNextOverlayElement(t),i=!0;break;case at.KEY_UP:case at.KEY_DOWN:case at.KEY_LEFT:case at.KEY_RIGHT:n.handleKeyboardPressButtonOnCurrentFocusedElement(t,r),i=!0;break;case at.KEY_ENTER:e.setExpanded(!0),i=!0;break;case at.KEY_ESC:e.setExpanded(!1),i=!0;break;default:i=!1}i&&(t.preventDefault(),t.stopPropagation())}),!0),t(e.rootNode).on("keydown",(function(t){if(null!==e.currentDateGroup){if(Nt.isMobile())for(var n=0,i=e.dateGroups.length;n<i;n++)if(document.activeElement===e.dateGroups[n].getRootNode()&&e.dateGroups[n]!==e.currentDateGroup){e.setCurrentDateGroup(e.dateGroups[n]);break}e.currentDateGroup.handleKeyEvent(t)}})),t(e.rootNode).on("blur",(function(){e.setCurrentDateGroup(e.dateGroups[0])})),t(e.hiddenInput).on("focus",(function(){setTimeout((function(){t(e.rootNode).focus().click(),e.setExpanded(!0)}),100)})),t(e.rootNode).on("mousedown",(function(t){var n=t.target||t.srcElement;if(Nt.isMobile())e.setExpanded(!0);else if(n===e.expander)setTimeout((function(){e.setExpanded(!0)}),50);else for(var i=0,r=e.dateGroups.length;i<r;i++)if(e.dateGroups[i].getRootNode()===n)return void e.setCurrentDateGroup(e.dateGroups[i])})),Object.defineProperty(e.rootNode,"value",{get:function(){return e.getValue()},set:function(t){t&&A()(t,Date)?e.setDateValue(t):e.setValue(t)}}),Object.defineProperty(e.rootNode,"disabled",{get:function(){return e.isDisabled()},set:function(t){e.setDisabled(t)}}),Object.defineProperty(e.rootNode,"readOnly",{get:function(){return e.isReadOnly()},set:function(t){e.setReadOnly(t)}})}(this,Bt.getJQuery())}},{key:"focusPreviousDatePartGroup",value:function(){for(var e=null,t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t]===this.currentDateGroup){e=t;break}this.setCurrentDateGroup(this.dateGroups[(e||0)-1]||this.dateGroups[0]||null)}},{key:"focusNextDatePartGroup",value:function(){for(var e=null,t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t]===this.currentDateGroup){e=t;break}this.setCurrentDateGroup(this.dateGroups[(e||0)+1]||this.dateGroups[this.dateGroups.length-1]||null)}},{key:"setDisabled",value:function(e){p()(E()(n.prototype),"setDisabled",this).call(this,e);for(var t=0,i=this.dateGroups.length;t<i;t++)this.dateGroups[t].withDisabled(this.disabled)}},{key:"setReadOnly",value:function(e){p()(E()(n.prototype),"setReadOnly",this).call(this,e);for(var t=0,i=this.dateGroups.length;t<i;t++)this.dateGroups[t].withReadOnly(this.readOnly)}},{key:"setI18n",value:function(e){return this.i18n=e||null,this}},{key:"getI18n",value:function(){return this.i18n||null}},{key:"isDateFieldEmpty",value:function(){for(var e=!0,t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t].getValue()){e=!1;break}return e}}],[{key:"emulateBlurOnOverlayActiveElement",value:function(){null!==this.overlayFocusedElement&&this.overlayFocusedElement.removeAttribute("data-soft-focused")}},{key:"emulateFocusOnOverlayActiveElement",value:function(){null!==this.overlayFocusedElement&&this.overlayFocusedElement.setAttribute("data-soft-focused","1")}},{key:"focusNextOverlayElement",value:function(e){if(this.expandedInstance){if(this.emulateBlurOnOverlayActiveElement(),e.shiftKey)switch(this.overlayFocusedElement){case this.overlayHeader:this.overlayFocusedElement=this.dateLayerDaysHolder;break;case this.dateLayerDaysHolder:this.overlayFocusedElement=this.dateLayerNavigation;break;case this.dateLayerNavigation:default:this.overlayFocusedElement=this.overlayHeader}else switch(this.overlayFocusedElement){case this.overlayHeader:this.overlayFocusedElement=this.dateLayerNavigation;break;case this.dateLayerNavigation:this.overlayFocusedElement=this.dateLayerDaysHolder;break;case this.dateLayerDaysHolder:default:this.overlayFocusedElement=this.overlayHeader}this.emulateFocusOnOverlayActiveElement()}}},{key:"handleKeyboardPressButtonOnCurrentFocusedElement",value:function(e,t){if(this.expandedInstance)switch(this.overlayFocusedElement){case this.overlayHeader:break;case this.dateLayerNavigation:switch(t){case at.KEY_LEFT:this.incrementDatePart("months",-1);break;case at.KEY_RIGHT:this.incrementDatePart("months",1)}break;case this.dateLayerDaysHolder:switch(t){case at.KEY_UP:this.incrementDatePart("days",-7);break;case at.KEY_DOWN:this.incrementDatePart("days",7);break;case at.KEY_LEFT:this.incrementDatePart("days",-1);break;case at.KEY_RIGHT:this.incrementDatePart("days",1)}}}},{key:"incrementDatePart",value:function(e,t){var n=this.localDate.getDate();switch(e){case"months":this.localDate.setMonth(this.localDate.getMonth()+t),this.localDate.setFullYear(this.localDate.getFullYear()),this.localDate.setDate(n);break;case"days":this.localDate.setDate(this.localDate.getDate()+t),this.localDate.setFullYear(this.localDate.getFullYear()),this.localDate.setMonth(this.localDate.getMonth())}this.expandedInstance.setDateValue(this.localDate),this.paintMonthOverlay(),this.paintDateOverlay(),Bt.getJQuery()(this.expandedInstance.getRootNode()).trigger("input");var i=this.expandedInstance.expander.querySelector("div");i&&(i.textContent=this.expandedInstance.getValue()),this.expandedInstance.expander.focus()}},{key:"initOverlayElements",value:function(){var e;this.overlay=document.createElement("div"),this.overlay.setAttribute("data-role","date-overlay"),this.overlayModal=document.createElement("div"),this.overlayModal.className="ui-modal",this.overlayModal.setAttribute("data-transparent","1"),Nt.isMobile()||this.overlay.appendChild(this.overlayModal),this.overlayHeader=document.createElement("div"),this.overlayHeader.setAttribute("data-component","header"),this.overlay.appendChild(this.overlayHeader),this.dateLayer=document.createElement("div"),this.dateLayer.setAttribute("data-component","date"),this.dateLayerNavigation=document.createElement("div"),this.dateLayerNavigation.setAttribute("data-role","navigation"),this.dateLayerNavigationBTNPrevMonth=document.createElement("div"),this.dateLayerNavigationBTNPrevMonth.setAttribute("data-action","btn-prev-month"),this.dateLayerNavigationBTNNextMonth=document.createElement("div"),this.dateLayerNavigationBTNNextMonth.setAttribute("data-action","btn-next-month"),this.dateLayerNavigationLABELCurrentMonth=document.createElement("div"),this.dateLayerNavigationLABELCurrentMonth.setAttribute("data-action","select-year"),this.dateLayerDaysHolder=document.createElement("div"),this.dateLayerDaysHolder.setAttribute("data-role","calendar"),this.dateLayerNavigation.appendChild(this.dateLayerNavigationBTNPrevMonth),this.dateLayerNavigation.appendChild(this.dateLayerNavigationLABELCurrentMonth),this.dateLayerNavigation.appendChild(this.dateLayerNavigationBTNNextMonth),this.dateLayer.appendChild(this.dateLayerNavigation),this.dateLayer.appendChild(this.dateLayerDaysHolder),this.weekDays=this.weekDaysI18n||this.weekDays;for(var t=0;t<7;t++)this.dateLayerDaysHolder.appendChild(this.dayOfWeekColumns[String(t)]),this.dayOfWeekColumns[String(t)].setAttribute("data-role","day-of-week"),(e=document.createElement("div")).setAttribute("data-role","week-day-header"),e.textContent=this.weekDays[t],this.dayOfWeekColumns[String(t)].appendChild(e);this.monthLayer=document.createElement("div"),this.monthLayer.setAttribute("data-component","month"),this.yearLayer=document.createElement("div"),this.yearLayer.setAttribute("data-component","year"),this.overlay.appendChild(this.dateLayer),this.overlay.appendChild(this.monthLayer),this.overlay.appendChild(this.yearLayer)}},{key:"initListeners",value:function(){!function(e,t){t.bodyMouseDownListener=function(n){var i=n.target||n.srcElement;(i===t.overlayModal||!e.contains(t.overlay,i)&&i!==t.overlay)&&null!==t.expandedInstance&&t.expandedInstance.setExpanded(!1)},t.bodyClickListener=function(n){var i=n.target||n.srcElement,r=!1;if(e.contains(t.overlay,i)||i===t.overlay)switch(i){case t.dateLayerNavigationBTNPrevMonth:t.monthNavigate(-1),r=!0;break;case t.dateLayerNavigationBTNNextMonth:t.monthNavigate(1),r=!0;break;case t.dateLayerNavigationLABELCurrentMonth:t.setPickerDateSelectionPhase(T.j.YEAR),r=!0;break;default:e(i).is("div[data-role=day][data-day][data-month]")?(t.onDayCellClicked(parseInt(i.getAttribute("data-day")),parseInt(i.getAttribute("data-month"))-1),r=!0):e(i).is("div[data-component=year] > [data-year]")?(t.onYearRowClicked(parseInt(i.getAttribute("data-year"))),r=!0):e(i).is("div[data-component=month] > [data-month]")&&(t.onMonthRowClicked(parseInt(i.getAttribute("data-month"))-1),r=!0)}r&&(n.preventDefault(),n.stopPropagation())},t.touchMoveListener=function(n){var i=n.target||n.srcElement;(e.contains(t.overlay,i)||i===t.overlay)&&n.preventDefault(),t.clickStarted=!1},t.touchStartListener=function(n){var i=n.target||n.srcElement;(e.contains(t.overlay,i)||i===t.overlay)&&(t.lastTouchPosition.left=n.touches[0].pageX,t.lastTouchPosition.top=n.touches[0].pageY),t.clickStarted=!0},t.touchEndListener=function(e){t.clickStarted&&t.bodyClickListener(e)},window.addEventListener("scroll",(function(){t.expandedInstance&&!Nt.isMobile()&&t.expandedInstance.setExpanded(!1)}),!0),window.addEventListener("resize",(function(e){t.expandedInstance&&t.expandedInstance.setExpanded(!1)}),!0),e(t.yearLayer).on("mousewheel wheel touchmove",(function(e){if("mousewheel"==e.type||"wheel"==e.type)t.yearScroll(e.originalEvent.deltaY<0?-1:1);else{var n=t.getVerticalScrollDirection(e.originalEvent);if(0===n)return;t.yearScroll(n)}e.preventDefault()})),e(t.monthLayer).on("mousewheel wheel touchmove",(function(e){if("mousewheel"===e.type||"wheel"==e.type)t.monthScroll(e.originalEvent.deltaY<0?-1:1);else{var n=t.getVerticalScrollDirection(e.originalEvent);if(0===n)return;t.monthScroll(n)}e.preventDefault()}))}(Bt.getJQuery(),this)}},{key:"initOverlay",value:function(e){if(this.firstTime=!0,this.expandedInstance&&this.expandedInstance.setExpanded(!1),this.timeUtils||(this.timeUtils=Ot.a.createInstanceInNonSingletonModeWithoutInternationalizationSupport()),e&&e.getI18n()&&(this.timeUtils.setI18nService(),this.weekDaysI18n=e&&e.getI18n().translateText("edt_date_picker_week_days")&&"edt_date_picker_week_days"!==e.getI18n().translateText("edt_date_picker_week_days")&&e.getI18n().translateText("edt_date_picker_week_days").split(",")),null!==e&&this.initOverlayElements(),this.expandedInstance=e||null,this.expandedInstance){this.initListeners(),document.body.addEventListener("mousedown",this.bodyMouseDownListener,!0),Nt.isMobile()?(document.body.addEventListener("touchstart",this.touchStartListener,!0),document.body.addEventListener("touchmove",this.touchMoveListener,{passive:!1}),document.body.addEventListener("touchend",this.touchEndListener,!0)):document.body.addEventListener("click",this.bodyClickListener,!0),document.body.appendChild(this.overlay);var t=this.expandedInstance.rootNode.getBoundingClientRect(),i=this.overlay.getBoundingClientRect(),r=_t.getAnchorPosition(t,i,n.DISTANCE_BETWEEN_THE_OVERLAY_AND_THE_INPUT,["center-bottom","center-top"]);this.overlay.style.top="".concat(r.top,"px"),this.overlay.style.left="".concat(r.left,"px"),Nt.isMobile()?(screen.height-t.bottom-n.DISTANCE_BETWEEN_THE_OVERLAY_AND_THE_INPUT-i.height-100<0&&"center-top"!==r.mode&&(document.body.offsetHeight>screen.height?(this.overlay.style.top="".concat(~~t.top+~~(t.height/2)-~~(i.width/2),"px"),jt.allBrowsersCompatibleScrollIntoView(this.expandedInstance.rootNode,{block:"center"})):(this.overlay.style.top="".concat(~~(screen.height/2)-~~(i.height/2),"px"),this.overlay.style.left="".concat(~~(screen.width/2)-~~(i.width/2),"px"))),document.body.hasAttribute("data-is-wix-embedded")&&(this.overlay.style.top="".concat(~~r.top,"px"),this.overlay.style.left="".concat(~~(t.left/2),"px"))):(this.overlay.style.top="".concat(r.top,"px"),this.overlay.style.left="".concat(t.left+(t.width-i.width),"px")),this.resetOverlay()}else document.body.removeEventListener("mousedown",this.bodyMouseDownListener,!0),Nt.isMobile()?(document.body.removeEventListener("touchstart",this.touchStartListener,!0),document.body.removeEventListener("touchmove",this.touchMoveListener,!0),document.body.removeEventListener("touchend",this.touchEndListener,!0)):document.body.removeEventListener("click",this.bodyClickListener,!0),this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},{key:"getVerticalScrollDirection",value:function(e){var t={left:e.touches[0].screenX,top:e.touches[0].screenY},n=t.top-this.lastTouchPosition.top;return Math.abs(n)>10?(this.lastTouchPosition.top=t.top,n>0?1:-1):0}},{key:"monthNavigate",value:function(e){this.localDate.setMonth(this.localDate.getMonth()+e),this.paintDateOverlay()}},{key:"yearScroll",value:function(e){this.localDate.setFullYear(this.localDate.getFullYear()+e),this.paintYearOverlay()}},{key:"monthScroll",value:function(e){this.localDate.setMonth(this.localDate.getMonth()+e),this.paintMonthOverlay()}},{key:"onMonthRowClicked",value:function(e){this.firstTime=!0,this.localDate.setMonth(e),this.expandedInstance.getFormat()!==Ee.VALIDATOR_TYPE_DATE_MMYYYY?this.setPickerDateSelectionPhase(T.j.DAY):(this.localDate.setDate(1),this.expandedInstance.setDateValue(this.localDate),Bt.getJQuery()(this.expandedInstance.getRootNode()).trigger("input"),this.expandedInstance.setExpanded(!1))}},{key:"onYearRowClicked",value:function(e){this.firstTime=!0,this.localDate.setFullYear(e),this.setPickerDateSelectionPhase(T.j.MONTH)}},{key:"onDayCellClicked",value:function(e,t){this.localDate.setMonth(t),this.localDate.setDate(e),this.paintDateOverlay();var n=!0,i=this.expandedInstance.getAcceptedDaysOfWeek();null!==i&&-1===i.indexOf(this.localDate.getDay())&&(n=!1),n&&(this.expandedInstance.setDateValue(this.localDate),Bt.getJQuery()(this.expandedInstance.getRootNode()).trigger("input"),this.expandedInstance.setExpanded(!1))}},{key:"setPickerDateSelectionPhase",value:function(e){switch(this.selectionPhase=e,e){case T.j.DAY:this.overlay.setAttribute("data-selection-phase","day"),this.paintDateOverlay();break;case T.j.MONTH:this.overlay.setAttribute("data-selection-phase","month"),this.paintMonthOverlay();break;case T.j.YEAR:this.overlay.setAttribute("data-selection-phase","year"),this.paintYearOverlay();break;case T.j.TIME:this.overlay.setAttribute("data-selection-phase","time")}}},{key:"updateOverlayHeaderText",value:function(){var e=this.expandedInstance.getDateValue()||new Date,t=this.expandedInstance.getFormat()!==Ee.VALIDATOR_TYPE_DATE_MMYYYY;this.overlayHeader.textContent=this.timeUtils.formatTime(Math.floor(e.getTime()/1e3),t?"%a, %b %e, %Y":"%b %Y")}},{key:"paintDateOverlay",value:function(){for(var e=0;e<7;e++)for(;this.dayOfWeekColumns[String(e)].childNodes.length>1;)this.dayOfWeekColumns[String(e)].childNodes[0].textContent!==this.weekDays[e]&&(this.dayOfWeekColumns[String(e)].childNodes[0].textContent=this.weekDays[e]),this.dayOfWeekColumns[String(e)].removeChild(this.dayOfWeekColumns[String(e)].childNodes[1]);var t,n,i,r,a=new Date,o=new Date,s=this.expandedInstance.getDateValue();for(a.setTime(this.localDate.getTime()),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),n=a.getMonth(),i=a.getFullYear(),this.dateLayerNavigationLABELCurrentMonth.textContent=this.timeUtils.formatTime(Math.round(a.getTime()/1e3),"%M %Y");a.getDay()!=this.expandedInstance.getWeekStart();)a.setDate(a.getDate()-1);for(;a.getMonth()<=n&&a.getFullYear()===i||a.getMonth()>n&&a.getFullYear()<i;)(t=document.createElement("div")).setAttribute("data-role","day"),r=a.getDay(),a.getMonth()===n&&(t.textContent=String(a.getDate()),t.setAttribute("data-day",String(a.getDate())),t.setAttribute("data-month",String(n+1)),a.getDate()===o.getDate()&&a.getMonth()===o.getMonth()&&a.getFullYear()===o.getFullYear()&&(t.className="".concat(t.className||"","today ")),null!==s&&a.getDate()===s.getDate()&&a.getMonth()===s.getMonth()&&a.getFullYear()===s.getFullYear()&&(t.className="".concat(t.className||"","selected "))),this.dayOfWeekColumns[String(r)].appendChild(t),a.setDate(a.getDate()+1)}},{key:"paintMonthOverlay",value:function(){var e,t=new Date;t.setTime(this.localDate.getTime()),t.setDate(1),t.setMonth(t.getMonth()-6);for(var n=0;n<12;n++)(e=this.firstTime?document.createElement("div"):this.monthLayer.children.item(n)).classList.remove("current"),e.setAttribute("data-month",String(t.getMonth()+1)),e.textContent=this.timeUtils.formatTime(Math.round(t.getTime()/1e3),"%M"),t.getMonth()===this.localDate.getMonth()&&(e.className="current"),!0===this.firstTime&&this.monthLayer.appendChild(e),t.setMonth(t.getMonth()+1);this.firstTime=!1}},{key:"paintYearOverlay",value:function(){var e,t=new Date;t.setTime(this.localDate.getTime()),t.setDate(1),t.setFullYear(t.getFullYear()-6);for(var n=0;n<12;n++)(e=this.firstTime?document.createElement("div"):this.yearLayer.children.item(n)).classList.remove("current"),e.setAttribute("data-year",String(t.getFullYear())),e.textContent=this.timeUtils.formatTime(Math.round(t.getTime()/1e3),"%Y"),t.getFullYear()===this.localDate.getFullYear()&&(e.className="current"),this.firstTime&&this.yearLayer.appendChild(e),t.setFullYear(t.getFullYear()+1);this.firstTime=!1}},{key:"paintCurrentOverlay",value:function(){switch(this.selectionPhase){case T.j.DAY:this.paintDateOverlay();break;case T.j.MONTH:this.paintMonthOverlay();break;case T.j.YEAR:this.paintYearOverlay();break;case T.j.TIME:}}},{key:"resetOverlay",value:function(){var e=this.expandedInstance.getFormat()!==Ee.VALIDATOR_TYPE_DATE_MMYYYY,t=this.expandedInstance.getWeekStart(),n=this.expandedInstance.getAcceptedDaysOfWeek();this.dayOfWeekColumns[0].parentNode.removeChild(this.dayOfWeekColumns[0]),t===T.k.MONDAY?this.dateLayerDaysHolder.appendChild(this.dayOfWeekColumns[0]):this.dateLayerDaysHolder.insertBefore(this.dayOfWeekColumns[0],this.dateLayerDaysHolder.firstChild);for(var i=0;i<7;i++)null===n||n.indexOf(i)>-1?this.dayOfWeekColumns[String(i)].removeAttribute("data-forbidden-week-day"):this.dayOfWeekColumns[String(i)].setAttribute("data-forbidden-week-day","");this.localDate=this.expandedInstance.getDateValue()||new Date,this.setPickerDateSelectionPhase(e?T.j.DAY:T.j.YEAR),this.updateOverlayHeaderText(),this.paintCurrentOverlay()}}]),n}(M);v()(bt,"DISTANCE_BETWEEN_THE_OVERLAY_AND_THE_INPUT",5),v()(bt,"overlay",void 0),v()(bt,"overlayModal",void 0),v()(bt,"overlayHeader",void 0),v()(bt,"dateLayer",void 0),v()(bt,"dateLayerNavigation",void 0),v()(bt,"dateLayerNavigationBTNPrevMonth",void 0),v()(bt,"dateLayerNavigationBTNNextMonth",void 0),v()(bt,"dateLayerNavigationLABELCurrentMonth",void 0),v()(bt,"dateLayerDaysHolder",void 0),v()(bt,"monthLayer",void 0),v()(bt,"yearLayer",void 0),v()(bt,"expandedInstance",void 0),v()(bt,"bodyMouseDownListener",void 0),v()(bt,"bodyClickListener",void 0),v()(bt,"touchMoveListener",void 0),v()(bt,"touchStartListener",void 0),v()(bt,"touchEndListener",void 0),v()(bt,"selectionPhase",void 0),v()(bt,"timeUtils",void 0),v()(bt,"localDate",void 0),v()(bt,"lastTouchPosition",{left:0,top:0}),v()(bt,"overlayFocusedElement",null),v()(bt,"dayOfWeekColumns",{0:document.createElement("div"),1:document.createElement("div"),2:document.createElement("div"),3:document.createElement("div"),4:document.createElement("div"),5:document.createElement("div"),6:document.createElement("div")}),v()(bt,"weekDaysI18n",null),v()(bt,"weekDays",["S","M","T","W","T","F","S"]),v()(bt,"clickStarted",!1),v()(bt,"firstTime",!0);var Rt=function e(){o()(this,e)};function It(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Rt,"ALLOW_I18N_DROPDOWN_SELECTOR",!0),v()(Rt,"ALLOW_QUIZ_TIMER",!0),v()(Rt,"ENABLE_SUBMISSION_PREVENTION_ON_QUIZ_TIMER_EXPIRATION",!0),v()(Rt,"ALLOW_PAYMENTS_SELECTOR",!0),v()(Rt,"ALLOW_THEME_ADVANCED_SETTINGS",!1),v()(Rt,"ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL",!1),v()(Rt,"ALLOW_COUPON_CODES_ON_LAST_PAGE_FOOTER",!0),v()(Rt,"ALLOW_REAL_TIME_CALCULATIONS",!0),v()(Rt,"ALLOW_PAYMENTS_SUMMARY",!0),v()(Rt,"VERBOSE_CONSOLE",!1),v()(Rt,"ALLOW_CSS_OPTIMIZATIONS",!0);var Pt=function(e){g()(n,e);var t=It(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_TIME),v()(c()(e),"dateGroups",[]),v()(c()(e),"format",void 0),v()(c()(e),"currentDateGroup",void 0),v()(c()(e),"value",null),v()(c()(e),"expander",void 0),v()(c()(e),"expanded",!1),v()(c()(e),"hash",void 0),v()(c()(e),"hasAccessibilityEnabled",void 0),v()(c()(e),"inputErrorState",T.x.FILLED),v()(c()(e),"hiddenInput",void 0),e.expander=document.createElement("div"),e.expander.setAttribute("data-role","expander"),e.expander.setAttribute("role","application"),Nt.isMobile()&&(e.hiddenInput=document.createElement("input"),e.hiddenInput.style.display="block",e.hiddenInput.style.border="none",e.hiddenInput.style.width="1px",e.hiddenInput.style.height="1px",e.hiddenInput.style.opacity=".1",e.hiddenInput.style.position="absolute",e.hiddenInput.style.right=e.hiddenInput.style.top="0",e.rootNode.appendChild(e.hiddenInput)),e.init(),e}return l()(n,[{key:"padNumber",value:function(e,t){for(var n=String(e||0);n.length<t;)n="0".concat(n);return n}},{key:"getAMPMHourPart",value:function(e){return e<12?e:e-12}},{key:"getValue",value:function(){if(null===this.value)return"";switch(this.format){case Ee.VALIDATOR_TYPE_TIME_AMPM:return"".concat(this.padNumber(this.getAMPMHourPart(this.value.getHours()),2),":").concat(this.padNumber(this.value.getMinutes(),2)).concat(Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?":".concat(this.padNumber(this.value.getSeconds(),2)):""," ").concat(this.value.getHours()<12?"AM":"PM");case Ee.VALIDATOR_TYPE_TIME:default:return"".concat(this.padNumber(this.value.getHours(),2),":").concat(this.padNumber(this.value.getMinutes(),2),":").concat(this.padNumber(this.value.getSeconds(),2))}}},{key:"hasDatePart",value:function(e){for(var t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t].getRole()===e)return!0;return!1}},{key:"setValue",value:function(e){var t;if("string"!==typeof e)t=null,console.warn("Invalid date: ",e);else{e=e.trim();var n,i=null,r=null,a=null,o=null;switch(this.format){case Ee.VALIDATOR_TYPE_TIME_AMPM:(n=/^([\d]{2}):([\d]{2})(:([\d]{2}))? (am|pm)$/i.exec(e))&&(i=parseInt(n[1]),r=parseInt(n[2]),a=parseInt(n[4]||"0"),o=~~("pm"===n[5].toLowerCase()),i>12||r>59||a>59?i=r=a=null:0===i&&1===o?i=12:12===i&&0===o?i=0:1===o&&12!==i&&(i+=12));break;case Ee.VALIDATOR_TYPE_TIME:default:(n=/^([\d]{2}):([\d]{2})(:([\d]{2}))?$/.exec(e))&&(i=parseInt(n[1]),r=parseInt(n[2]),a=parseInt(n[4]||"0"),(i>23||r>59||a>59)&&(i=r=a=null))}if(null===i||null===r||null===a?(t=null,console.warn("Invalid date: ",e)):((t=new Date).setHours(i),t.setMinutes(r),t.setSeconds(a),t.setMilliseconds(0),t.setDate(1),t.setMonth(1),t.setFullYear(1970)),Ot.a.dateEquals(this.value,t))return;this.value=t;for(var s=0,l=this.dateGroups.length;s<l;s++)this.dateGroups[s].extractDatePartFrom(this.value)}}},{key:"withHash",value:function(e){return this.hash=e,this}},{key:"getHash",value:function(){return this.hash}},{key:"setAccessibilityEnabled",value:function(e){this.hasAccessibilityEnabled=e}},{key:"setFormat",value:function(e){switch(e){case Ee.VALIDATOR_TYPE_TIME_AMPM:this.dateGroups=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?[new Ct(T.i.HOUR_12,this),new Ct(T.i.MINUTE,this),new Ct(T.i.SECOND,this),new Ct(T.i.AM_PM,this)]:[new Ct(T.i.HOUR_12,this),new Ct(T.i.MINUTE,this),new Ct(T.i.AM_PM,this)];break;case Ee.VALIDATOR_TYPE_TIME:this.dateGroups=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?[new Ct(T.i.HOUR_24,this),new Ct(T.i.MINUTE,this),new Ct(T.i.SECOND,this)]:[new Ct(T.i.HOUR_24,this),new Ct(T.i.MINUTE,this)];break;default:throw new Error("Invalid date format! Expected time, time_ampm!")}this.format=e,this.rootNode.textContent="";var t=document.createElement("div");t.setAttribute("data-role","time-wrapper");for(var n=0,i=this.dateGroups.length;n<i;n++){switch(this.dateGroups[n].withDisabled(this.disabled).withReadOnly(this.readOnly),this.dateGroups[n].extractDatePartFrom(this.value),t.appendChild(this.dateGroups[n].getRootNode()),this.dateGroups[n].getRole()){case T.i.HOUR_12:case T.i.HOUR_24:this.dateGroups[n].getRootNode().setAttribute("id","time-".concat(this.hash,"-hour"));break;case T.i.MINUTE:this.dateGroups[n].getRootNode().setAttribute("id","time-".concat(this.hash,"-minute"));break;case T.i.SECOND:this.dateGroups[n].getRootNode().setAttribute("id","time-".concat(this.hash,"-second"));break;case T.i.AM_PM:this.dateGroups[n].getRootNode().setAttribute("id","time-".concat(this.hash,"-am-pm"))}t.appendChild(this.dateGroups[n].getRootNode()),n<i-1&&t.appendChild(document.createTextNode(n===i-2&&Ee.VALIDATOR_TYPE_TIME_AMPM===this.format?" ":":"))}this.updateAccessibilityFeature(),this.rootNode.appendChild(t),this.rootNode.appendChild(this.expander),this.setCurrentDateGroup(this.dateGroups[0]||null),this.hiddenInput&&this.rootNode.appendChild(this.hiddenInput)}},{key:"updateAccessibilityFeature",value:function(){if(this.hasAccessibilityEnabled){var e=document.createElement("div");e.setAttribute("id","time-expander-text-acc"),e.appendChild(document.createTextNode("Click to choose time")),e.style.display="none",this.expander.tabIndex=0,this.expander.appendChild(e),this.expander.setAttribute("aria-labelledby","time-expander-text-acc")}else this.expander.removeAttribute("tabindex")}},{key:"getFormat",value:function(){return this.format}},{key:"getDateValue",value:function(){return this.value}},{key:"setDateValue",value:function(e){if(null!==e&&!A()(e,Date))throw new Error("Invalid argument: Expected Date|null");this.value=e,this.inputErrorState=null===e?T.x.UNFILLED:T.x.FILLED;for(var t=0,n=this.dateGroups.length;t<n;t++)this.dateGroups[t].extractDatePartFrom(this.value)}},{key:"setCurrentDateGroup",value:function(e){this.currentDateGroup&&this.currentDateGroup.getRootNode().removeAttribute("data-is-focused"),this.currentDateGroup=e||null,this.currentDateGroup&&this.currentDateGroup.getRootNode().setAttribute("data-is-focused","data-is-focused")}},{key:"queryDatePart",value:function(e){for(var t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t].getRole()===e)return this.dateGroups[t].getValue();return null}},{key:"setDatePart",value:function(e,t){for(var n=0,i=this.dateGroups.length;n<i;n++)this.dateGroups[n].getRole()===e&&this.dateGroups[n].setValue(t)}},{key:"isDateValidIfDatePartIs",value:function(e,t){return!0}},{key:"rebuildDateFromParts",value:function(){for(var e,t=null,n=null,i=null,r=0,a=0,o=this.dateGroups.length;a<o;a++)switch(this.dateGroups[a].getRole()){case T.i.HOUR_12:case T.i.HOUR_24:t=this.dateGroups[a].getValue();break;case T.i.MINUTE:n=this.dateGroups[a].getValue();break;case T.i.SECOND:i=this.dateGroups[a].getValue();break;case T.i.AM_PM:r=null===this.dateGroups[a].getValue()?T.S.AM:this.dateGroups[a].getValue()}switch(!0){case null===t&&null===n:this.inputErrorState=T.x.UNFILLED,this.value=null;break;case null===t||null===n:this.inputErrorState=T.x.ERROR;break;default:(e=new Date).setDate(1),e.setMonth(0),e.setFullYear(1970),e.setHours(t+12*r),e.setMinutes(n),e.setSeconds(i),e.setMilliseconds(0),this.value=e,this.inputErrorState=T.x.FILLED}}},{key:"setExpanded",value:function(e){if(!this.isReadOnly()){if(e=!!e,this.expander.querySelector("div")&&(this.expander.querySelector("div").textContent="Click to expand"),e===this.expanded)return;this.expanded=e;var t=this.getValue();n.initOverlay(e?this:null),t!==this.getValue()&&Bt.getJQuery()(this.rootNode).trigger("input"),e?this.expander.setAttribute("data-expanded","1"):this.expander.removeAttribute("data-expanded")}}},{key:"init",value:function(){!function(e,t){e.expander.addEventListener("keydown",(function(t){var i=!1,r=t.keyCode||t.charCode;switch(r){case at.KEY_TAB:if(!e.expanded)return e.expander.removeAttribute("tabindex"),void setTimeout((function(){e.expander.tabIndex=0}),1e3);n.focusNextOverlayElement(t),i=!0;break;case at.KEY_UP:case at.KEY_DOWN:case at.KEY_LEFT:case at.KEY_RIGHT:n.handleKeyboardPressButtonOnCurrentFocusedElement(t,r),i=!0;break;case at.KEY_ENTER:e.setExpanded(!0),i=!0;break;case at.KEY_ESC:e.setExpanded(!1),i=!0;break;default:i=!1}i&&(t.preventDefault(),t.stopPropagation())}),!0),t(e.rootNode).on("keydown",(function(t){if(!e.expanded){if(null!==e.currentDateGroup){if(Nt.isMobile())for(var n=0,i=e.dateGroups.length;n<i;n++)if(document.activeElement===e.dateGroups[n].getRootNode()&&e.dateGroups[n]!==e.currentDateGroup){e.setCurrentDateGroup(e.dateGroups[n]);break}e.currentDateGroup.handleKeyEvent(t)}e.trigger("keydown")}})),t(e.rootNode).on("blur",(function(){e.setCurrentDateGroup(e.dateGroups[0])})),t(e.hiddenInput).on("focus",(function(n){setTimeout((function(){t(e.rootNode).focus().click(),e.setExpanded(!0)}),100)})),t(e.rootNode).on("mousedown",(function(t){var n=t.target||t.srcElement;if(Nt.isMobile())e.setExpanded(!0);else if(n===e.expander)e.setExpanded(!0);else for(var i=0,r=e.dateGroups.length;i<r;i++)if(e.dateGroups[i].getRootNode()===n)return void e.setCurrentDateGroup(e.dateGroups[i])})),Object.defineProperty(e.rootNode,"value",{get:function(){return e.getValue()},set:function(t){t&&A()(t,Date)?e.setDateValue(t):e.setValue(t)}}),Object.defineProperty(e.rootNode,"dateValue",{get:function(){return e.getDateValue()},set:function(t){t&&A()(t,Date)?this.setDateValue(t):e.setDateValue(null)}}),Object.defineProperty(e.rootNode,"disabled",{get:function(){return e.isDisabled()},set:function(t){e.setDisabled(t)}}),Object.defineProperty(e.rootNode,"readOnly",{get:function(){return e.isReadOnly()},set:function(t){e.setReadOnly(t)}})}(this,Bt.getJQuery())}},{key:"focusPreviousDatePartGroup",value:function(){for(var e=null,t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t]===this.currentDateGroup){e=t;break}this.setCurrentDateGroup(this.dateGroups[(e||0)-1]||this.dateGroups[0]||null)}},{key:"focusNextDatePartGroup",value:function(){for(var e=null,t=0,n=this.dateGroups.length;t<n;t++)if(this.dateGroups[t]===this.currentDateGroup){e=t;break}this.setCurrentDateGroup(this.dateGroups[(e||0)+1]||this.dateGroups[this.dateGroups.length-1]||null)}},{key:"setDisabled",value:function(e){p()(E()(n.prototype),"setDisabled",this).call(this,e);for(var t=0,i=this.dateGroups.length;t<i;t++)this.dateGroups[t].withDisabled(this.disabled)}},{key:"setReadOnly",value:function(e){p()(E()(n.prototype),"setReadOnly",this).call(this,e);for(var t=0,i=this.dateGroups.length;t<i;t++)this.dateGroups[t].withReadOnly(this.readOnly)}},{key:"getInputErrorState",value:function(){return this.inputErrorState}}],[{key:"getVerticalScrollDirection",value:function(e){var t,n={left:e.touches[0].screenX,top:e.touches[0].screenY};return Math.abs(t=n.top-this.lastTouchPosition.top)>10?(this.lastTouchPosition.top=n.top,t>0?1:-1):0}},{key:"emulateFocusOnOverlayActiveElement",value:function(){null!==this.overlayFocusedElement&&this.overlayFocusedElement.setAttribute("data-soft-focused","1")}},{key:"emulateBlurOnOverlayActiveElement",value:function(){null!==this.overlayFocusedElement&&this.overlayFocusedElement.removeAttribute("data-soft-focused")}},{key:"focusNextOverlayElement",value:function(e){if(this.expandedInstance){if(this.emulateBlurOnOverlayActiveElement(),e.shiftKey)switch(this.overlayFocusedElement){case this.overlayHeader:this.overlayFocusedElement=this.timeMinutesColumn;break;case this.timeMinutesColumn:this.overlayFocusedElement=this.timeHoursColumn;break;case this.timeHoursColumn:default:this.overlayFocusedElement=this.overlayHeader}else switch(this.overlayFocusedElement){case this.overlayHeader:this.overlayFocusedElement=this.timeHoursColumn;break;case this.timeHoursColumn:this.overlayFocusedElement=this.timeMinutesColumn;break;case this.timeMinutesColumn:default:this.overlayFocusedElement=this.overlayHeader}this.emulateFocusOnOverlayActiveElement()}}},{key:"handleKeyboardPressButtonOnCurrentFocusedElement",value:function(e,t){if(this.expandedInstance)switch(this.overlayFocusedElement){case this.overlayHeader:switch(t){case at.KEY_LEFT:case at.KEY_RIGHT:this.incrementDatePart("hours",12)}break;case this.timeHoursColumn:switch(t){case at.KEY_UP:this.incrementDatePart("hours",-1);break;case at.KEY_DOWN:this.incrementDatePart("hours",1)}break;case this.timeMinutesColumn:switch(t){case at.KEY_UP:this.incrementDatePart("minutes",-1);break;case at.KEY_DOWN:this.incrementDatePart("minutes",1)}}}},{key:"initOverlay",value:function(e){if(this.expandedInstance&&this.expandedInstance.setExpanded(!1),this.overlayFocusedElement=null,this.timeUtils||(this.timeUtils=Ot.a.createInstanceInNonSingletonModeWithoutInternationalizationSupport()),this.overlay||null===e||(this.overlay=document.createElement("div"),this.overlay.setAttribute("data-role","date-overlay"),this.overlay.setAttribute("data-selection-phase","time"),this.overlayModal=document.createElement("div"),this.overlayModal.className="ui-modal",this.overlayModal.setAttribute("data-transparent","1"),Nt.isMobile()||this.overlay.appendChild(this.overlayModal),this.overlayHeader=document.createElement("div"),this.overlayHeader.setAttribute("data-component","header"),this.overlay.appendChild(this.overlayHeader),this.overlayHeaderAMButton=document.createElement("div"),this.overlayHeaderAMButton.textContent="AM",this.overlayHeaderAMButton.setAttribute("data-role","button"),this.overlayHeaderAMButton.setAttribute("data-value","0"),this.overlayHeaderPMButton=document.createElement("div"),this.overlayHeaderPMButton.textContent="PM",this.overlayHeaderPMButton.setAttribute("data-role","button"),this.overlayHeaderPMButton.setAttribute("data-value","1"),this.overlayHeader.appendChild(this.overlayHeaderAMButton),this.overlayHeader.appendChild(this.overlayHeaderPMButton),this.timeLayer=document.createElement("div"),this.timeLayer.setAttribute("data-component","time"),this.timeHoursColumn=document.createElement("div"),this.timeHoursColumn.setAttribute("data-role","hours"),this.timeMinutesColumn=document.createElement("div"),this.timeMinutesColumn.setAttribute("data-role","minutes"),Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL&&(this.timeSecondsColumn=document.createElement("div"),this.timeSecondsColumn.setAttribute("data-role","seconds")),this.timeLayer.appendChild(this.timeHoursColumn),this.timeLayer.appendChild(this.timeMinutesColumn),Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL&&this.timeLayer.appendChild(this.timeSecondsColumn),this.overlay.appendChild(this.timeLayer)),this.bodyMouseDownListener||function(e,t){t.bodyMouseDownListener=function(n){var i=n.target||n.srcElement;(i===t.overlayModal||!e.contains(t.overlay,i)&&i!==t.overlay)&&null!==t.expandedInstance&&t.expandedInstance.setExpanded(!1)},t.bodyClickListener=function(n){var i=n.target||n.srcElement;e.contains(t.overlay,i)||t.overlay},t.touchMoveListener=function(n){var i=n.target||n.srcElement;(e.contains(t.overlay,i)||i===t.overlay)&&n.preventDefault()},t.touchStartListener=function(n){var i=n.target||n.srcElement;(e.contains(t.overlay,i)||i===t.overlay)&&(t.lastTouchPosition.left=n.touches[0].pageX,t.lastTouchPosition.top=n.touches[0].pageY)},window.addEventListener("scroll",(function(e){t.expandedInstance&&t.expandedInstance.setExpanded(!1)}),!0),window.addEventListener("resize",(function(e){t.expandedInstance&&t.expandedInstance.setExpanded(!1)}),!0),e(t.timeLayer).on("mousewheel wheel touchmove","[data-role=hours], [data-role=minutes], [data-role=seconds]",(function(e){var n,i=this.getAttribute("data-role");if("mousewheel"===e.type||"wheel"==e.type)n=e.originalEvent.deltaY<0?-1:1;else if(0===(n=t.getVerticalScrollDirection(e.originalEvent)))return;t.incrementDatePart(i,n),e.preventDefault()})),e(t.overlayHeader).on("click","[data-role=button][data-value]",(function(e){switch(~~this.getAttribute("data-value")){case 0:t.localDate.getHours()>=12&&(t.localDate.setHours(t.localDate.getHours()-12),t.paintHours(),t.expandedInstance.setDateValue(t.localDate),Bt.getJQuery()(t.expandedInstance.getRootNode()).trigger("input"));break;case 1:t.localDate.getHours()<12&&(t.localDate.setHours(t.localDate.getHours()+12),t.paintHours(),t.expandedInstance.setDateValue(t.localDate),Bt.getJQuery()(t.expandedInstance.getRootNode()).trigger("input"))}})),e(t.timeLayer).on("click","[data-role=hours] > div, [data-role=minutes] > div, [data-role=seconds] > div",(function(e){var n;switch(!0){case this.hasAttribute("data-hour"):"hours",n=~~this.getAttribute("data-hour"),t.localDate.setHours(n),t.paintHours();break;case this.hasAttribute("data-minute"):"minutes",n=~~this.getAttribute("data-minute"),t.localDate.setMinutes(n),t.paintMinutes();break;case this.hasAttribute("data-second"):"seconds",n=~~this.getAttribute("data-second"),t.localDate.setSeconds(n),t.paintSeconds()}t.expandedInstance.setDateValue(t.localDate),Bt.getJQuery()(t.expandedInstance.getRootNode()).trigger("input")}))}(Bt.getJQuery(),this),this.expandedInstance=e||null,this.expandedInstance){document.body.addEventListener("mousedown",this.bodyMouseDownListener,!0),document.body.addEventListener("click",this.bodyClickListener,!0),document.body.addEventListener("touchstart",this.touchStartListener,!0),document.body.addEventListener("touchmove",this.touchMoveListener,{passive:!1}),document.body.appendChild(this.overlay);var t=this.expandedInstance.rootNode.getBoundingClientRect(),i=this.overlay.getBoundingClientRect(),r=_t.getAnchorPosition(t,i,n.DISTANCE_BETWEEN_OVERLAY_AND_INPUT,["center-bottom","center-top"]);this.overlay.style.top="".concat(r.top,"px"),this.overlay.style.left="".concat(r.left,"px"),Nt.isMobile()?(screen.height-t.bottom-n.DISTANCE_BETWEEN_OVERLAY_AND_INPUT-i.height-100<0&&"center-top"!==r.mode&&(document.body.offsetHeight>screen.height?(this.overlay.style.top="".concat(~~t.top+~~(t.height/2)-~~(i.width/2),"px"),jt.allBrowsersCompatibleScrollIntoView(this.expandedInstance.rootNode,{block:"center"})):(this.overlay.style.top="".concat(~~(screen.height/2)-~~(i.height/2),"px"),this.overlay.style.left="".concat(~~(screen.width/2)-~~(i.width/2),"px"))),document.body.hasAttribute("data-is-wix-embedded")&&(this.overlay.style.top="".concat(~~r.top,"px"),this.overlay.style.left="".concat(~~(t.left/2),"px"))):(this.overlay.style.top="".concat(r.top,"px"),screen.width-t.left+(t.width-i.width)>0&&(this.overlay.style.left="".concat(t.left+(t.width-i.width),"px"))),this.resetOverlay()}else document.body.removeEventListener("mousedown",this.bodyMouseDownListener,!0),document.body.removeEventListener("click",this.bodyClickListener,!0),document.body.removeEventListener("touchmove",this.touchMoveListener,!0),document.body.removeEventListener("touchstart",this.touchStartListener,!0),this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},{key:"incrementDatePart",value:function(e,t){var n=this.localDate.getMinutes(),i=this.localDate.getSeconds(),r=this.localDate.getHours();switch(e){case"hours":this.localDate.setHours(this.localDate.getHours()+t),this.localDate.setMinutes(n),this.localDate.setSeconds(i),this.paintHours();break;case"minutes":this.localDate.setMinutes(this.localDate.getMinutes()+t),this.localDate.setHours(r),this.localDate.setSeconds(i),this.paintMinutes();break;case"seconds":this.localDate.setSeconds(this.localDate.getSeconds()+t),this.localDate.setMinutes(n),this.localDate.setHours(r),this.paintSeconds()}this.expandedInstance.setDateValue(this.localDate),Bt.getJQuery()(this.expandedInstance.getRootNode()).trigger("input");var a=this.expandedInstance.expander.querySelector("div");a&&(a.textContent=this.expandedInstance.getValue()),this.expandedInstance.expander.focus()}},{key:"paintHours",value:function(){var e,t=this.expandedInstance.hasDatePart(T.i.AM_PM),n=new Date;this.localDate&&n.setTime(this.localDate.getTime()),n.getHours()<12?(this.overlayHeaderAMButton.setAttribute("data-is-active",""),this.overlayHeaderPMButton.removeAttribute("data-is-active")):(this.overlayHeaderPMButton.setAttribute("data-is-active",""),this.overlayHeaderAMButton.removeAttribute("data-is-active")),n.setHours(n.getHours()-5);for(var i=0;i<11;i++)(e=this.firstTimeHours?document.createElement("div"):this.timeHoursColumn.children.item(i)).setAttribute("data-hour",String(n.getHours())),e.textContent=t?n.getHours()<13?String(n.getHours()):String(n.getHours()-12):String(n.getHours()),5===i&&e.setAttribute("data-is-current",""),this.firstTimeHours&&this.timeHoursColumn.appendChild(e),n.setHours(n.getHours()+1);this.firstTimeHours=!1}},{key:"paintMinutes",value:function(){var e,t=new Date;this.localDate&&t.setTime(this.localDate.getTime()),t.setMinutes(t.getMinutes()-5);for(var n=0;n<11;n++){(e=this.firstTimeMinutes?document.createElement("div"):this.timeMinutesColumn.children.item(n)).setAttribute("data-minute",String(t.getMinutes()));var i=String(t.getMinutes());parseInt(i)<10&&(i="0".concat(i)),e.textContent=i,5===n&&e.setAttribute("data-is-current",""),this.firstTimeMinutes&&this.timeMinutesColumn.appendChild(e),t.setMinutes(t.getMinutes()+1)}this.firstTimeMinutes=!1}},{key:"paintSeconds",value:function(){if(Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL){var e,t=new Date;for(this.localDate&&t.setTime(this.localDate.getTime()),t.setSeconds(t.getSeconds()-5);this.timeSecondsColumn.firstChild;)this.timeSecondsColumn.removeChild(this.timeSecondsColumn.firstChild);for(var n=0;n<11;n++)(e=document.createElement("div")).setAttribute("data-second",String(t.getSeconds())),e.textContent=String(t.getSeconds()),5===n&&e.setAttribute("data-is-current",""),this.timeSecondsColumn.appendChild(e),t.setSeconds(t.getSeconds()+1)}}},{key:"resetOverlay",value:function(){var e;this.localDate=this.expandedInstance.getDateValue()||((e=new Date).setDate(1),e.setMonth(0),e.setFullYear(1970),e),this.expandedInstance.hasDatePart(T.i.AM_PM)?(this.overlayHeader.setAttribute("data-format","12"),this.overlay.setAttribute("time-overlay-data-format","12")):(this.overlayHeader.setAttribute("data-format","24"),this.overlay.setAttribute("time-overlay-data-format","24"));var t=[];(this.expandedInstance.hasDatePart(T.i.HOUR_12)||this.expandedInstance.hasDatePart(T.i.HOUR_24))&&(t.push("has-hours"),this.paintHours()),this.expandedInstance.hasDatePart(T.i.MINUTE)&&(t.push("has-minutes"),this.paintMinutes()),this.expandedInstance.hasDatePart(T.i.SECOND)&&(t.push("has-seconds"),this.paintSeconds()),this.timeLayer.className=t.join(" "),this.timeLayer.setAttribute("data-num-groups",String(t.length)),this.expandedInstance.setDateValue(this.localDate)}}]),n}(M);v()(Pt,"DISTANCE_BETWEEN_OVERLAY_AND_INPUT",5),v()(Pt,"overlay",void 0),v()(Pt,"overlayModal",void 0),v()(Pt,"overlayHeader",void 0),v()(Pt,"overlayHeaderAMButton",void 0),v()(Pt,"overlayHeaderPMButton",void 0),v()(Pt,"timeLayer",void 0),v()(Pt,"timeHoursColumn",void 0),v()(Pt,"timeMinutesColumn",void 0),v()(Pt,"timeSecondsColumn",void 0),v()(Pt,"expandedInstance",void 0),v()(Pt,"bodyMouseDownListener",void 0),v()(Pt,"bodyClickListener",void 0),v()(Pt,"touchMoveListener",void 0),v()(Pt,"touchStartListener",void 0),v()(Pt,"selectionPhase",void 0),v()(Pt,"timeUtils",void 0),v()(Pt,"localDate",void 0),v()(Pt,"lastTouchPosition",{left:0,top:0}),v()(Pt,"overlayFocusedElement",null),v()(Pt,"firstTimeHours",!0),v()(Pt,"firstTimeMinutes",!0);var St=function(){function e(){o()(this,e)}return l()(e,null,[{key:"init",value:function(){var t=0,n=0,i="";Object.defineProperty(e,"nextNumber",{get:function(){return t++,n=t},configurable:!1}),Object.defineProperty(e,"nextString",{get:function(){return t++,i=String(t)},configurable:!1}),Object.defineProperty(e,"lastNumber",{get:function(){return n}}),Object.defineProperty(e,"lastString",{get:function(){return i}})}}]),e}();v()(St,"nextNumber",void 0),v()(St,"nextString",void 0),v()(St,"lastNumber",void 0),v()(St,"lastString",void 0),St.init();var Dt=function e(){o()(this,e)};v()(Dt,"ERR_TOO_FEW_CHOICES_SELECTED",100),v()(Dt,"ERR_TOO_MANY_CHOICES_SELECTED",101),v()(Dt,"ERR_TOO_MANY_CHARACTERS",102),v()(Dt,"ERR_TOO_FEW_CHARACTERS",103),v()(Dt,"ERR_TOO_MANY_WORDS",104),v()(Dt,"ERR_TOO_FEW_WORDS",105),v()(Dt,"ERR_INVALID_EMAIL",106),v()(Dt,"ERR_NUMBER_TOO_LONG",107),v()(Dt,"ERR_NUMBER_TOO_SHORT",108),v()(Dt,"ERR_NUMBER_TOO_BIG",109),v()(Dt,"ERR_NUMBER_TOO_SMALL",110),v()(Dt,"ERR_PRICE_TOO_MANY_DECIMALS",111),v()(Dt,"ERR_INVALID_URL",113),v()(Dt,"ERR_DATE_TOO_BIG",114),v()(Dt,"ERR_DATE_TOO_SMALL",115),v()(Dt,"ERR_TIME_NOT_COMPLETE",116),v()(Dt,"ERR_INVALID_PHONE_FORMAT",117),v()(Dt,"ERR_INTEGER_VALUE_EXPECTED",118),v()(Dt,"ERR_NEGATIVE_PRICE",119),v()(Dt,"ERR_NUMBER_EXPECTED",120),v()(Dt,"ERR_FILE_UPLOAD",121),v()(Dt,"ERR_CONTROL_VALUES_DONT_MATCH",122),v()(Dt,"ERR_MAX_ACCEPTED_VALUE_EXCEEDED",123),v()(Dt,"ERR_INVALID_DATE",124),v()(Dt,"ERR_INVALID_NUMBER",125),v()(Dt,"ERR_NOT_NUMERIC",126);var Lt=function(){function e(){o()(this,e),v()(this,"allowedUserFileExtensions",void 0),v()(this,"forbiddenUserFileExtensions",void 0),v()(this,"ui",void 0),v()(this,"resourceManager",void 0)}return l()(e,[{key:"getAllowedUserFileExtensions",value:function(){return this.allowedUserFileExtensions}},{key:"getForbiddenUserFileExtensions",value:function(){return this.forbiddenUserFileExtensions}},{key:"withAllowedUserFileExtensions",value:function(e){return this.allowedUserFileExtensions=(e||[]).sort(),this}},{key:"withForbiddenUserFileExtensions",value:function(e){return this.forbiddenUserFileExtensions=(e||[]).sort(),this}},{key:"withUI",value:function(e){return this.ui=e,this}},{key:"withResourceManager",value:function(e){return this.resourceManager=e,this}},{key:"createExtensionDialog",value:function(e,t,n,i){return function(r,a){return a.Deferred((function(a){r.resourceManager.get(t).then((function(t){var o=r.ui.createDialog(e,[{type:qe.c.OK,callback:function(){n(o)}},{type:qe.c.CANCEL,callback:function(){i(o)}}],{width:"500px",onCloseButtonClick:function(){i(o)}});o.body.innerHTML=t,a.resolve(o)}))})).promise()}(this,Bt.getJQuery())}},{key:"isValidExtensionName",value:function(e){return/^[a-z0-9\-]{1,10}$/.test(e)}},{key:"canAddFileExtension",value:function(e){return!(this.forbiddenUserFileExtensions.indexOf(e)>-1)&&!(this.allowedUserFileExtensions.indexOf(e)>-1)}},{key:"addUserFileExtension",value:function(){return function(e,t){return e.Deferred((function(n){var i=function(t,n){var i=document.createElement("span");i.setAttribute("data-role","error"),i.textContent=n,e(t.body).find("input[name=extension]").after(i)},r=function(t){e(t.body).find("span[data-role=error]").remove()};t.createExtensionDialog("Add user file extension","/modules/Typescript/Form/resources/add-allowed-file-extension-dialog.html",(function(a){r(a);var o=e(a.body).find("input[name=extension]").val().toLowerCase();o?t.isValidExtensionName(o)?t.canAddFileExtension(o)?e.post("/modules/FormEditor/ajax-user-extension-service.php",{do:"add-user-extension",extension:o}).then((function(){a.close(),t.allowedUserFileExtensions.push(o),t.allowedUserFileExtensions.sort(),n.resolve(o)})).fail((function(){t.ui.alert("Error adding extension",'Failed to add extension "'.concat(o,'" on server!'))})):i(a,"".concat(JSON.stringify(o)," extension cannot be added. Check if the extension is not already added in your supported extensions list, and if the extension is supported")):i(a,"".concat(JSON.stringify(o)," is not a supported file extension!")):i(a,"Please specify a non-empty file extension!")}),(function(e){e.close(),n.reject(new Error("User aborted operation"))})).then((function(t){t.body.setAttribute("data-dialog-type","add-file-extension"),e(t.body).on("input","input[name=extension]",(function(){r(t)}))}))})).promise()}(Bt.getJQuery(),this)}}],[{key:"getInstance",value:function(){return window.UserFileExtensionsService?window.UserFileExtensionsService.getInstance():void 0===this.instance?this.instance=new e:this.instance}}]),e}();v()(Lt,"instance",void 0);var kt=function(){function e(){o()(this,e),v()(this,"rootNode",void 0),v()(this,"fileNameContainer",void 0),v()(this,"fileSizeContainer",void 0),v()(this,"progressBarOuter",void 0),v()(this,"progressBarInner",void 0),v()(this,"removeButton",void 0),v()(this,"upload",void 0),v()(this,"uploadDetails",void 0),v()(this,"errorNode",void 0),v()(this,"fileUtils",void 0),v()(this,"fileSize",void 0),v()(this,"fileData",void 0),v()(this,"error",null),this.rootNode=document.createElement("div"),this.rootNode.setAttribute("data-role","upload"),this.fileNameContainer=document.createElement("div"),this.fileNameContainer.setAttribute("data-role","name"),this.rootNode.appendChild(this.fileNameContainer),this.fileSizeContainer=document.createElement("span"),this.fileSizeContainer.setAttribute("data-role","size"),this.rootNode.appendChild(this.fileSizeContainer),this.progressBarOuter=document.createElement("div"),this.progressBarOuter.setAttribute("data-role","progress-bar"),this.progressBarInner=document.createElement("div"),this.progressBarInner.setAttribute("data-role","progress"),this.progressBarOuter.appendChild(this.progressBarInner),this.removeButton=document.createElement("div"),this.removeButton.setAttribute("data-role","button-remove"),this.removeButton.setAttribute("aria-labelledby","file-control-remove-button-acc"),this.rootNode.appendChild(this.removeButton)}return l()(e,[{key:"withFileUtils",value:function(e){return this.fileUtils=e,this}},{key:"updateAccessibilityAttributes",value:function(e,t){if(this.rootNode.setAttribute("aria-labelledby","fileupload-name-".concat(e,"-acc fileupload-size-").concat(e,"-acc file-control-error-").concat(e,"-acc")),this.rootNode.setAttribute("index",e),t){var n=document.createElement("span");n.setAttribute("id","file-control-remove-button-acc"),n.appendChild(document.createTextNode("Remove Button")),n.style.display="none",this.removeButton.appendChild(n),this.rootNode.setAttribute("tabindex","0"),this.removeButton.setAttribute("tabindex","0")}else this.rootNode.removeAttribute("tabindex"),this.removeButton.removeAttribute("tabindex"),this.removeButton.textContent="";this.fileNameContainer.setAttribute("id","fileupload-name-".concat(e,"-acc")),this.fileSizeContainer.setAttribute("id","fileupload-size-".concat(e,"-acc")),this.getError()&&this.errorNode.setAttribute("id","file-control-error-".concat(e,"-acc"))}},{key:"withError",value:function(e){return this.error=e,null===e?(this.errorNode&&(this.errorNode.parentNode&&this.errorNode.removeChild(this.errorNode),this.errorNode=void 0),this.rootNode.removeAttribute("data-has-error")):(this.errorNode||(this.errorNode=document.createElement("div"),this.errorNode.setAttribute("data-role","error")),this.errorNode.textContent=String(e||"Error").replace(/^Error\: /g,""),this.rootNode.appendChild(this.errorNode),this.rootNode.setAttribute("data-has-error","")),this}},{key:"getError",value:function(){return null===this.error?null:String(this.error).replace(/^Error: /,"")}},{key:"withName",value:function(e){return this.fileNameContainer.textContent=String(e||"File"),this.uploadDetails=this.uploadDetails||{name:"",progress:0,size:0},this.uploadDetails.name=e,this}},{key:"getName",value:function(){return this.uploadDetails?this.uploadDetails.name:null}},{key:"withData",value:function(e){return this.fileData=e,this}},{key:"getData",value:function(){return this.fileData}},{key:"withUrlLinkToDownload",value:function(e,t){if(e&&t&&null!==t.getTable("session").getRowAt(0)[0]){var n=document.createElement("a");n.setAttribute("class","download-url"),n.href=e,n.textContent=this.getName()||"File",n.target="_blank",this.fileNameContainer.textContent="",this.fileNameContainer.appendChild(n)}return this}},{key:"withProgress",value:function(e){return(e=~~e)<0&&(e=0),e>100&&(e=100),this.progressBarInner.style.width="".concat(e,"%"),this.uploadDetails=this.uploadDetails||{name:"",progress:0,size:0},this.uploadDetails.progress=e,this}},{key:"withUpload",value:function(e){var t=this;return this.upload=e||null,this.upload?(this.withFileSize(this.upload.getSize()).withName(this.upload.getStoredFileNameOnServer()||this.upload.getName()).withProgress(0),this.upload.on("start",(function(){t.withError(null),t.progressBarOuter.parentNode||t.rootNode.appendChild(t.progressBarOuter)})),this.upload.on("progress",(function(e){return t.withProgress(e)})),this.upload.on("success",(function(){t.progressBarOuter.parentNode&&t.progressBarOuter.parentNode.removeChild(t.progressBarOuter),t.withName(t.upload.getStoredFileNameOnServer()||t.upload.getName())})),this.upload.on("error",(function(e){return t.withError(e)})),this.upload.on("got-file-data",(function(e){return t.withData(e)}))):this.uploadDetails&&this.withFileSize(this.uploadDetails.size||null).withName(this.uploadDetails.name).withProgress(100),this}},{key:"getUploadStatus",value:function(){return this.upload?this.upload.getState():T.X.SUCCESS}},{key:"getRootNode",value:function(){return this.rootNode}},{key:"getSize",value:function(){return this.upload?this.upload.getSize():null}},{key:"cancel",value:function(){return function(e,t){return t.Deferred((function(t){e.upload?e.upload.remove().always((function(){t.resolve(!0)})):t.resolve(!0)})).promise()}(this,Bt.getJQuery())}},{key:"withFileSize",value:function(e){return this.fileSize=Math.max(0,~~e),this.fileUtils&&null!==this.fileSize&&void 0!==this.fileSize&&0<this.fileSize?this.fileSizeContainer.textContent="(".concat(this.fileUtils.convertFileSizeToString(this.fileSize),")"):this.fileSizeContainer.textContent="",this}},{key:"getTransferType",value:function(){return T.s.UPLOAD}},{key:"getHash",value:function(){return null}}]),e}();function Mt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var xt=function(e){g()(n,e);var t=Mt(n);function n(e){var i;return o()(this,n),i=t.call(this),v()(c()(i),"downloadURL",void 0),v()(c()(i),"submissionId",void 0),v()(c()(i),"uploaderInstanceIndex",void 0),v()(c()(i),"sessionId",void 0),v()(c()(i),"uploadsService",void 0),v()(c()(i),"fileControl",void 0),i.fileControl=e,i.rootNode.setAttribute("data-role","download"),i}return l()(n,[{key:"withDownloadURL",value:function(e){return this.downloadURL=e,this}},{key:"withSubmissionId",value:function(e){return this.submissionId=e,this}},{key:"withUploaderInstanceIndex",value:function(e){return this.uploaderInstanceIndex=e,this}},{key:"withSessionId",value:function(e){return this.sessionId=e,this}},{key:"withUploadsService",value:function(e){return this.uploadsService=e,this}},{key:"getTransferType",value:function(){return T.s.DOWNLOAD}},{key:"getDownloadURL",value:function(){return this.downloadURL}},{key:"cancel",value:function(){var e=this;return this.uploadsService.removeSubmittedUpload(this.sessionId,this.submissionId,this.uploaderInstanceIndex).then((function(){e.fileControl.setDownloadInfo(null)}))}},{key:"getUploadStatus",value:function(){return T.X.SUCCESS}},{key:"getHash",value:function(){return this.downloadURL&&(/fileid=([a-f\d]+)/i.exec(this.downloadURL)||[])[1]||null}}]),n}(kt);function wt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Ut=function(e){g()(n,e);var t=wt(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_FILE),v()(c()(e),"instanceId",void 0),v()(c()(e),"files",[]),v()(c()(e),"uploadOverlay",void 0),v()(c()(e),"uploadInput",void 0),v()(c()(e),"placeholder",void 0),v()(c()(e),"control",void 0),v()(c()(e),"multiple",void 0),v()(c()(e),"minUploadSizeInBytes",null),v()(c()(e),"maxUploadSizeInBytes",null),v()(c()(e),"uploadsContainer",void 0),v()(c()(e),"dropFiles",void 0),v()(c()(e),"dropFilesThrottler",void 0),v()(c()(e),"allowedExtensions",null),v()(c()(e),"forbiddenExtensions",null),v()(c()(e),"abortAllUploadsButton",void 0),v()(c()(e),"hasAccessibilityEnabled",void 0),v()(c()(e),"fileUtils",void 0),e.instanceId=n.INSTANCE_ID,n.INSTANCE_ID++,e.uploadOverlay=document.createElement("div"),e.uploadOverlay.setAttribute("data-role","upload-overlay"),e.uploadInput=document.createElement("input"),e.uploadInput.setAttribute("type","file"),e.placeholder=document.createElement("div"),e.placeholder.setAttribute("data-role","placeholder"),e.placeholder.textContent="Choose files or drag here",e.placeholder.setAttribute("data-i18n-text","textdef_216"),e.uploadsContainer=document.createElement("div"),e.uploadsContainer.setAttribute("data-role","files-container"),e.rootNode.appendChild(e.uploadsContainer),e.abortAllUploadsButton=document.createElement("div"),e.abortAllUploadsButton.setAttribute("data-role","abort-all-uploads"),e.abortAllUploadsButton.textContent="Delete all uploads",e.abortAllUploadsButton.setAttribute("data-i18n-text","textdef_217"),e.rootNode.appendChild(e.abortAllUploadsButton),e.rootNode.appendChild(e.uploadOverlay),e.uploadOverlay.appendChild(e.uploadInput),e.uploadOverlay.appendChild(e.placeholder),e.hasAccessibilityEnabled?e.uploadOverlay.setAttribute("tabindex","0"):e.uploadOverlay.removeAttribute("tabindex"),e.rootNode.removeAttribute("tabindex"),e.onUploadNumberChanged(),e.init(),e}return l()(n,[{key:"withControl",value:function(e){return this.control=e,this.updateAccessibilityAttributes(),this}},{key:"setAccessibility",value:function(e){this.hasAccessibilityEnabled=e}},{key:"getFilesList",value:function(){for(var e=[],t=0,n=this.files.length;t<n;t++)this.files[t].getUploadStatus()===T.X.SUCCESS&&e.push({id:0,name:this.files[t].getName(),mimeType:this.control.getForm().getEngine().getUploadsService().getMimeType(this.files[t].getName()),size:this.files[t].getSize(),hash:this.files[t].getHash(),data:this.files[t].getData()||""});return e.length?e:null}},{key:"getValue",value:function(){for(var e=[],t=0,n=this.getFilesList()||[],i=n.length;t<i;t++)e.push(n[t].name.indexOf(" ")>-1?'"'.concat(n[t].name,'"'):n[t].name);return e.length?e.join(" "):""}},{key:"setValue",value:function(e){var t,n=[],i=!1,r="";if(""!==(e=String(e||""))){for(var a=0,o=e.length;a<o;a++)switch(t=e.charAt(a)){case'"':if(!(i=!i)){if(""===r)throw new Error("Invalid value: Empty file name not allowed!");n.push(r),r=""}break;case" ":if(i)r+=" ";else{if(""===r)throw new Error("Invalid value: Empty file name not allowed!");n.push(r),r=""}break;default:r=r.concat(t)}""!==r&&n.push(r)}if(n.length>1&&!this.isMultiple())throw new Error("Too many files!");!function(e,t){e.when.apply(e,function(){for(var e=[],n=0,i=t.files.length;n<i;n++)e.push(t.files[n].cancel());return e||!0}()).then((function(){for(t.files=[];t.uploadsContainer.firstChild;)t.uploadsContainer.removeChild(t.uploadsContainer.firstChild);for(var e,i=0,r=n.length;i<r;i++)(e=new kt).updateAccessibilityAttributes(St.nextString,this.hasAccessibilityEnabled),e.withName(n[i]).withFileUtils(this.fileUtils),t.files.push(e),t.uploadsContainer.appendChild(e.getRootNode());t.onUploadNumberChanged()}))}(Bt.getJQuery(),this)}},{key:"onUploadNumberChanged",value:function(){var e=this.files.length;this.rootNode.setAttribute("data-num-files",String(e)),e<n.MIN_NUMBER_OF_CONTROLS_IN_ORDER_TO_DISPLAY_THE_ABORT_ALL_DOWNLOADS_BUTTON?this.rootNode.removeAttribute("data-has-abort-all-uploads"):this.rootNode.setAttribute("data-has-abort-all-uploads",""),jt.refreshFrameHeightOnWix()}},{key:"addFile",value:function(e){var t=this;if(this.control&&this.control.isAttached())if(this.isMultiple()){var n=new kt;this.files.push(n),n.withName(e.file.name).withFileUtils(this.fileUtils),n.updateAccessibilityAttributes(St.nextString,this.hasAccessibilityEnabled),this.uploadsContainer.appendChild(n.getRootNode()),n.withUpload(this.control.getForm().getEngine().getUploadsService().addToQOS(this.control.getForm().getEngine().getUploadsService().createUpload(e.file).withUploaderInstanceIndex(this.instanceId).withControlId(this.control.getId()).withArchivePacking(this.isMultiple()).on("success",(function(){t.onChange()})))),this.onUploadNumberChanged()}else(function(e,t){return 0===t.files.length?e.Deferred((function(e){e.resolve(!0)})).promise():e.Deferred((function(e){t.files[0].cancel().then((function(){t.uploadsContainer.removeChild(t.files[0].getRootNode()),t.files.splice(0,1),t.onUploadNumberChanged(),e.resolve(!0)}))})).promise()})(Bt.getJQuery(),this).then((function(){var n=new kt;t.files.push(n),n.withName(e.file.name).withFileUtils(t.fileUtils),n.updateAccessibilityAttributes(St.nextString,t.hasAccessibilityEnabled),t.uploadsContainer.appendChild(n.getRootNode()),n.withUpload(t.control.getForm().getEngine().getUploadsService().addToQOS(t.control.getForm().getEngine().getUploadsService().createUpload(e.file).withUploaderInstanceIndex(t.instanceId).withControlId(t.control.getId()).withArchivePacking(t.isMultiple()).on("success",(function(){t.onChange()})))),t.onUploadNumberChanged()}))}},{key:"removeUpload",value:function(e){for(var t=this,n=null,i=0,r=this.files.length;i<r;i++)if(this.files[i].getRootNode()===e){n=this.files[i];break}null!==n&&n.cancel().then((function(){t.uploadsContainer.removeChild(e),t.files.splice(t.files.indexOf(n),1),t.onUploadNumberChanged(),t.onChange()}))}},{key:"addFilesList",value:function(e){if(e.length){var t=[];if(!this.isMultiple()&&e.length>1)t.push("Only a single file is accepted!");else for(var n=0,i=e.length;n<i;n++)switch(!0){case null!==this.getMinUploadSizeInBytes()&&e[n].file.size<this.getMinUploadSizeInBytes():t.push(this.control.getForm().getEngine().getI18n().translateText("textdef_234",e[n].file.name,this.control.getForm().getEngine().getFileUtils().convertFileSizeToString(this.getMinUploadSizeInBytes()))||'File "'.concat(e[n].file.name,'" is too small, ')+"min accepted file size is ".concat(this.control.getForm().getEngine().getFileUtils().convertFileSizeToString(this.getMinUploadSizeInBytes())));break;case null!==this.getMaxUploadSizeInBytes()&&e[n].file.size>this.getMaxUploadSizeInBytes():t.push(this.control.getForm().getEngine().getI18n().translateText("textdef_226",e[n].file.name,this.control.getForm().getEngine().getFileUtils().convertFileSizeToString(this.getMaxUploadSizeInBytes()))||'File "'.concat(e[n].file.name,'" is too large, ')+"max accepted file size is ".concat(this.control.getForm().getEngine().getFileUtils().convertFileSizeToString(this.getMaxUploadSizeInBytes())));break;case!this.isFileNamePermitted(e[n].file.name):t.push(this.control.getForm().getEngine().getI18n().translateText("textdef_227")||'File "'.concat(e[n].file.name,'" is not allowed'))}if(t.length>0){if(t.length>3){var r="+ ".concat(t.length-3," more errors...");(t=t.slice(0,3)).push(r)}this.control.getForm().getEngine().getLoader().getUI().alert("Error",t.join("\n"))}else for(var a=0,o=e.length;a<o;a++)this.addFile(e[a])}}},{key:"handleDragEnter",value:function(){console.warn("drag enter")}},{key:"handleDragLeave",value:function(){console.warn("drag leave")}},{key:"extractFiles",value:function(e){for(var t=[],n=0,i=e.length;n<i;n++)(""!==e[n].type||e[n].size)&&t.push({path:"",file:e[n]});return t}},{key:"handleDropEvent",value:function(e){this.dropFiles=[];var t=this,n=function e(n,i){if(n.isFile)n.file((function(e){t.dropFiles.push({path:i,file:e}),t.dropFilesThrottler()}));else if(n.isDirectory){n.createReader().readEntries((function(t){for(var r=0;r<t.length;r++)e(t[r],"".concat(i).concat(n.name,"/"))}))}},i=e.dataTransfer.items;if("undefined"!==typeof i)for(var r=0;r<i.length;r++){if(!i[r].webkitGetAsEntry)return;var a=i[r].webkitGetAsEntry();a&&n(a,"")}else t.addFilesList(t.extractFiles(e.dataTransfer.files))}},{key:"init",value:function(){!function(e,t){e.uploadInput.addEventListener("change",(function(t){e.addFilesList(e.extractFiles(e.uploadInput.files)),setTimeout((function(){e.uploadInput.value=null}),0)}),!0),t(e.uploadsContainer).on("click","> div[data-role=upload] > [data-role=button-remove], > div[data-role=download] > [data-role=button-remove]",(function(n){t(this).closest("[data-role=upload], [data-role=download]").each((function(){e.removeUpload(this)}))})),t(e.abortAllUploadsButton).on("click",(function(){e.abortAllFiles()})),e.uploadInput.addEventListener("dragenter",(function(){e.handleDragEnter()}),!0),e.uploadInput.addEventListener("dragleave",(function(){e.handleDragLeave()}),!0),e.uploadInput.addEventListener("dragover",(function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"}),!0),e.uploadInput.addEventListener("drop",(function(t){e.handleDropEvent(t),t.preventDefault()}),!0),t(document).on({dragover:function(){return!1},drop:function(){return!1}}),t(e.uploadInput).on("focus",(function(){t(e.rootNode).attr("data-file-tab-focus-state","1")})).on("blur",(function(){t(e.rootNode).removeAttr("data-file-tab-focus-state")})),e.dropFilesThrottler=O.a.create((function(){e.addDroppedFiles()}),500)}(this,Bt.getJQuery())}},{key:"addDroppedFiles",value:function(){this.addFilesList(this.dropFiles),this.dropFiles=void 0}},{key:"isMultiple",value:function(){return!!this.multiple}},{key:"withMultiple",value:function(e){return this.multiple=!!e,this.multiple?(this.rootNode.setAttribute("data-is-multiple",""),this.uploadInput.setAttribute("multiple","")):(this.rootNode.removeAttribute("data-is-multiple"),this.uploadInput.removeAttribute("multiple")),this}},{key:"withMinUploadSizeInBytes",value:function(e){return this.minUploadSizeInBytes=e,this}},{key:"getMinUploadSizeInBytes",value:function(){return this.minUploadSizeInBytes}},{key:"withMaxUploadSizeInBytes",value:function(e){return this.maxUploadSizeInBytes=e,this}},{key:"withAllowedFileExtensions",value:function(e){return this.allowedExtensions=e&&e.length?e:null,this}},{key:"withForbiddenFileExtensions",value:function(e){return this.forbiddenExtensions=e&&e.length?e:null,this}},{key:"getMaxUploadSizeInBytes",value:function(){return this.maxUploadSizeInBytes}},{key:"onChange",value:function(){Bt.getJQuery()(this.rootNode).trigger("change")}},{key:"isFileNamePermitted",value:function(e){if(!e)return!1;if("string"!==typeof e)return!1;var t=((/\.([^\.]+)$/.exec(e)||[])[1]||"").toLowerCase();return""!==t&&(!(3>t.length&&"ai"!==t)&&(!(Lt.getInstance().getForbiddenUserFileExtensions().indexOf(t)>-1)&&(null!==this.allowedExtensions?this.allowedExtensions.indexOf(t)>-1:null===this.forbiddenExtensions||-1===this.forbiddenExtensions.indexOf(t))))}},{key:"withFileUtils",value:function(e){return this.fileUtils=e,this}},{key:"abortAllFiles",value:function(){return function(e,t){for(var n=[],i=0,r=t.files.length;i<r;i++)n.push(t.files[i].cancel());return e.when.apply(t,n).then((function(){for(t.files=[];t.uploadsContainer.firstChild;)t.uploadsContainer.removeChild(t.uploadsContainer.firstChild);t.onUploadNumberChanged(),t.onChange()}))}(Bt.getJQuery(),this)}},{key:"setDownloadInfo",value:function(e){for(var t=0,n=this.files.length;t<n;t++)if(this.files[t].getTransferType()===T.s.UPLOAD){this.uploadsContainer.removeChild(this.files[t].getRootNode()),this.files.slice(t,1);break}if(null!==e){for(var i=new xt(this),r=0,a=this.files.length;r<a;r++)if(this.files[r].getDownloadURL()===e.url)return;this.files.push(i),i.withFileUtils(this.fileUtils).withName(e.name).withFileSize(e.size).withDownloadURL(e.url).withUrlLinkToDownload(e.url,this.control.getForm().getEngine().getLoader().getRules().getDatabase()).withProgress(100).withSubmissionId(this.control.getForm().getEngine().getLoader().getLoaderDependency(T.A.SUBMISSION_ID)).withUploaderInstanceIndex(this.instanceId).withSessionId(this.control.getForm().getEngine().getLoader().getLoaderDependency(T.A.SESSION_ID)).withUploadsService(this.control.getForm().getEngine().getUploadsService()),this.uploadsContainer.appendChild(i.getRootNode()),this.rootNode.setAttribute("data-is-download","")}else this.rootNode.removeAttribute("data-is-download");this.onUploadNumberChanged()}},{key:"getDownloadInfo",value:function(){for(var e=0,t=this.files.length;e<t;e++)if(this.files[e].getTransferType()===T.s.UPLOAD)return{url:this.files[e].getDownloadURL(),name:this.files[e].getName(),size:this.files[e].getSize()};return null}},{key:"withAllowDirectoryUpload",value:function(e){return e?""===_e.meetsRequirements("* * * firefox *")?this.uploadInput.setAttribute("allowdirs",""):""!==_e.meetsRequirements("android * * chrome *")&&this.uploadInput.setAttribute("webkitdirectory",""):""===_e.meetsRequirements("* * * firefox *")?this.uploadInput.removeAttribute("allowdirs"):this.uploadInput.removeAttribute("webkitdirectory"),this}},{key:"getErrors",value:function(){for(var e,t=[],n={},i=0,r=this.files.length;i<r;i++)null!==(e=this.files[i].getError())&&void 0===n[e]&&(t.push({code:Dt.ERR_FILE_UPLOAD,message:e}),n[e]="1");return t}},{key:"updateAccessibilityAttributes",value:function(){var e=this.control.getHash();this.uploadOverlay.setAttribute("aria-labelledby","file-placeholder-".concat(e,"-acc")),this.placeholder.setAttribute("id","file-placeholder-".concat(e,"-acc"))}},{key:"clearFiles",value:function(){!function(e,t){t(e.uploadsContainer).find("[data-role=upload], [data-role=download]").each((function(){e.removeUpload(this)}))}(this,Bt.getJQuery())}}]),n}(M);function Ft(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ut,"MIN_NUMBER_OF_CONTROLS_IN_ORDER_TO_DISPLAY_THE_ABORT_ALL_DOWNLOADS_BUTTON",6),v()(Ut,"INSTANCE_ID",1);var Yt=function(e){g()(n,e);var t=Ft(n);function n(){var e;return o()(this,n),e=t.call(this,Bt.ELEMENT_TYPE_STAR_RATING),v()(c()(e),"value",0),v()(c()(e),"minValue",0),v()(c()(e),"maxValue",10),v()(c()(e),"stars",[]),v()(c()(e),"starShapeType","stars"),v()(c()(e),"hash",void 0),e.withMaxValue(e.maxValue),e.setValue(e.value),e.init(),e.rootNode.removeAttribute("tabindex"),e}return l()(n,[{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){if((e=~~e)<this.minValue)throw new Error("Illegal value: Expected values >= ".concat(this.minValue));if(e>this.maxValue)throw new Error("Illegal value: Expected values <= ".concat(this.maxValue));this.value=e;for(var t=0,n=this.stars.length;t<n;t++){t+1<=this.value?this.stars[t].setAttribute("data-is-checked","1"):this.stars[t].removeAttribute("data-is-checked");var i=this.rootNode.querySelector("span[id='starrating-".concat(this.hash,"-").concat(t,"']"));i&&(i.textContent="".concat(t+1," of ").concat(this.maxValue)),this.stars[t].removeAttribute("aria-label")}var r=this.rootNode.querySelector("span[id='starrating-".concat(this.hash,"-").concat(this.value-1,"']"));r&&(r.setAttribute("role","alert"),r.textContent="Selected ".concat(this.value," of ").concat(this.maxValue));var a=this.value-1;this.stars[a]&&this.stars[a].setAttribute("aria-label","Selected ".concat(this.value," of ").concat(this.maxValue))}},{key:"getMinValue",value:function(){return this.minValue}},{key:"withMinValue",value:function(e){if((e=~~e)<0)throw new Error("Invalid argument: Min value should be >= 0");if(e>this.maxValue)throw new Error("Invalid argument: Min value should not be greater than maxValue");return this.minValue=e,this}},{key:"getMaxValue",value:function(){return this.maxValue}},{key:"withHash",value:function(e){return this.hash=e,this}},{key:"withMaxValue",value:function(e){var t,n;if((e=~~e)<this.minValue)throw new Error("Invalid argument: Max value should be >= MinValue");for(this.maxValue=e,t=this.stars.length;t!==this.maxValue;)t>this.maxValue?(t--,this.rootNode.removeChild(this.stars[t]),this.stars.splice(t,1)):(t++,(n=document.createElement("div")).setAttribute("data-role","star"),n.setAttribute("data-star-index",String(t)),n.tabIndex=0,this.rootNode.appendChild(n),this.stars.push(n));return this.value>this.maxValue&&this.setValue(this.maxValue),this.onAccessibilitySettingsChanged(),this}},{key:"onAccessibilitySettingsChanged",value:function(){for(var e=0,t=this.stars.length;e<t;e++)if(this.hash){var n=document.createElement("span");n.setAttribute("id","starrating-".concat(this.hash,"-").concat(e)),n.appendChild(document.createTextNode("".concat(String(e+1)," of ").concat(this.maxValue))),n.style.display="none",this.stars[e].appendChild(n),this.stars[e].setAttribute("aria-labelledby","starrating-".concat(this.hash,"-").concat(e))}else this.stars[e].textContent=""}},{key:"init",value:function(){!function(e,t,n){e.rootNode.setAttribute("data-star-shape-type",e.starShapeType),Object.defineProperty(n,"value",{get:function(){return e.getValue()},set:function(t){e.setValue(t)}}),Object.defineProperty(n,"minValue",{get:function(){return e.getMinValue()},set:function(t){e.withMinValue(t)}}),Object.defineProperty(n,"maxValue",{get:function(){return e.getMaxValue()},set:function(t){e.withMaxValue(t)}}),Object.defineProperty(n,"starShapeType",{get:function(){return e.getStarShapeType()},set:function(t){e.withStarShapeType(t)}}),t(n).on("click","div[data-role=star]",(function(i){if(!e.isReadOnly()){var r=~~t(this).attr("data-star-index");e.setValue(r),t(n).trigger("input")}})),t(n).on("mouseover","div[data-role=star]",(function(t){if(!e.isReadOnly())for(var n=!0,i=0,r=e.stars.length;i<r;i++)n?e.stars[i].setAttribute("data-is-hover","1"):e.stars[i].removeAttribute("data-is-hover"),e.stars[i]===this&&(n=!1)})),t(n).on("mouseout","div[data-role=star]",(function(t){if(!e.isReadOnly())for(var n=0,i=e.stars.length;n<i;n++)e.stars[n].removeAttribute("data-is-hover")})).on("focus","div[data-role=star]",(function(){t(this).attr("data-rating-tab-focus-state","1")})).on("blur","div[data-role=star]",(function(){t(this).removeAttr("data-rating-tab-focus-state")}))}(this,Bt.getJQuery(),this.rootNode)}},{key:"withStarShapeType",value:function(e){switch(e){case"adults":case"children":case"stars":this.starShapeType=e;break;default:this.starShapeType="stars",console.warn("UIStarRating: Invalid star shape type: ".concat(JSON.stringify(e)))}return this.rootNode.setAttribute("data-star-shape-type",this.starShapeType),this}},{key:"getStarShapeType",value:function(){return this.starShapeType}}]),n}(M),Bt=function(){function e(){o()(this,e)}return l()(e,null,[{key:"createElement",value:function(t,n){switch(t){case e.ELEMENT_TYPE_TAGS:return new ut(n);case e.ELEMENT_TYPE_TAGS_LIST:return new dt(n);case e.ELEMENT_TYPE_SINGLE_TAGS_LIST:return new ht(n);case e.ELEMENT_TYPE_SEARCHABLE_DROPDOWN:return""===_e.meetsRequirements("* * desktop * *")?new yt:new mt;case e.ELEMENT_TYPE_DROPDOWN:return new mt;case e.ELEMENT_TYPE_COLOR:return new Tt;case e.ELEMENT_TYPE_DATE:return new bt;case e.ELEMENT_TYPE_TIME:return new Pt;case e.ELEMENT_TYPE_FILE:return new Ut;case e.ELEMENT_TYPE_STAR_RATING:return new Yt;default:throw new Error("Unrecognized UI element type: ".concat(JSON.stringify(t)))}}},{key:"withJQuery",value:function(t){e.jq=t}},{key:"getJQuery",value:function(){return window.UI.jq}},{key:"withI18n",value:function(t){e.i18n=t}},{key:"getI18n",value:function(){return e.i18n}},{key:"withResourceManager",value:function(e){this.resourceManager=e}},{key:"getResourceManager",value:function(){return this.resourceManager}},{key:"upgradeDOMNodeFromForm",value:function(t){e.jq(t).find("select").each((function(){var t=e.createElement(e.ELEMENT_TYPE_DROPDOWN),n=this.options;t.setAttribute("data-role","i123-input");for(var i=0,r=n.length;i<r;i++)t.add(n[i].cloneNode(!0));this.parentNode.insertBefore(t.getRootNode(),this),this.parentNode.removeChild(this);for(var a=t.getRootNode().querySelector("select"),o=0,s=this.attributes.length;o<s;o++)a.setAttribute(this.attributes[o].name,this.attributes[o].value);a.setAttribute("data-secondary","")}))}}]),e}();v()(Bt,"ELEMENT_TYPE_SEARCHABLE_DROPDOWN","searchable-dropdown"),v()(Bt,"ELEMENT_TYPE_DROPDOWN","dropdown"),v()(Bt,"ELEMENT_TYPE_COLOR","color"),v()(Bt,"ELEMENT_TYPE_DATE","date"),v()(Bt,"ELEMENT_TYPE_TIME","time"),v()(Bt,"ELEMENT_TYPE_FILE","file"),v()(Bt,"ELEMENT_TYPE_STAR_RATING","star-rating"),v()(Bt,"ELEMENT_TYPE_TAGS","tags"),v()(Bt,"ELEMENT_TYPE_TAGS_LIST","tags-list"),v()(Bt,"ELEMENT_TYPE_SINGLE_TAGS_LIST","single-tags-list"),v()(Bt,"ELEMENT_TYPE_TAG","tag"),v()(Bt,"ELEMENT_TYPE_COLLECTION",[Bt.ELEMENT_TYPE_SEARCHABLE_DROPDOWN,Bt.ELEMENT_TYPE_DROPDOWN,Bt.ELEMENT_TYPE_COLOR,Bt.ELEMENT_TYPE_DATE,Bt.ELEMENT_TYPE_TIME,Bt.ELEMENT_TYPE_FILE,Bt.ELEMENT_TYPE_STAR_RATING,Bt.ELEMENT_TYPE_TAGS,Bt.ELEMENT_TYPE_TAGS_LIST,Bt.ELEMENT_TYPE_SINGLE_TAGS_LIST,Bt.ELEMENT_TYPE_TAG]),v()(Bt,"jq",void 0),v()(Bt,"i18n",void 0),v()(Bt,"resourceManager",void 0);var Vt=n(13);function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Gt=function(){function e(t){o()(this,e),v()(this,"CONFIGURATION",void 0),v()(this,"rootNode",void 0),v()(this,"toWhoComponent",void 0),v()(this,"toWhoEmailComponent",void 0),v()(this,"i18n",void 0),v()(this,"recipientEmailValidator",void 0),v()(this,"setTagsLimit",void 0),v()(this,"triggerRecipientPaywall",void 0),v()(this,"onSendToFocus",void 0),v()(this,"onSendToVariableOpen",void 0),v()(this,"onSendToVariableInsert",void 0),this.CONFIGURATION=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){v()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.createDefaultConfiguration(),{},t)}return l()(e,[{key:"getRootNode",value:function(){return this.rootNode}}]),l()(e,[{key:"withI18n",value:function(e){return this.i18n=e,this}},{key:"withRecipientEmailValidator",value:function(e){return this.recipientEmailValidator=e,this}},{key:"initialize",value:function(){var e=this;this.rootNode=document.createElement("div"),this.getRootNode().setAttribute("data-role","rule-recipient"),this.toWhoComponent=new nt,this.toWhoComponent.getRoot().setAttribute("data-name","to-who"),this.toWhoComponent.getRoot().onclick=function(e){e.stopPropagation()},this.toWhoComponent.setValue(this.CONFIGURATION.selectedValue),this.i18n.translateDOMNode(this.toWhoComponent.getRoot());var t="You can only add a maximum of ".concat(Vt.b.VALIDATION_TAG_LIMIT," recipients.");this.toWhoEmailComponent=Bt.createElement(Bt.ELEMENT_TYPE_TAGS_LIST,{componentName:rt.COMPONENT_TYPE_SEND_TO,allowText:!0,allowKeywords:!0,customErrorMessage:"Please provide a valid email address",textValidationCallback:this.recipientEmailValidator,createValuesCallback:function(){return e.CONFIGURATION.emailValuesList},placeholder:"Type an email",tagsLimit:this.setTagsLimit?this.setTagsLimit():0,validationTagLimit:Vt.b.VALIDATION_TAG_LIMIT,validationError:this.i18n.translateTextDefault("notifications_recipients_limit_reached_error",t,Vt.b.VALIDATION_TAG_LIMIT.toString())}),this.toWhoEmailComponent.getDropdownContainer().setAttribute("title",jt.getUiTranslatedString("notifications_tooltip_add_fields","Add fields from the form and variables")),this.toWhoEmailComponent.getRootNode().setAttribute("data-name","to-who-email"),this.toWhoEmailComponent.on("tags-limit-reached",(function(){e.triggerRecipientPaywall()})),this.toWhoEmailComponent.on("focus",(function(){e.onSendToFocus&&e.onSendToFocus()})),this.toWhoEmailComponent.on("dropdown-open",(function(){e.onSendToVariableOpen&&e.onSendToVariableOpen()})),this.toWhoEmailComponent.on("ui_tags_container_variable_insert",(function(){e.onSendToVariableInsert&&e.onSendToVariableInsert()})),this.setTagValues(this.CONFIGURATION.defaultTagValues),this.getRootNode().appendChild(this.toWhoComponent.getRoot()),this.getRootNode().appendChild(this.toWhoEmailComponent.getRootNode())}},{key:"getEmailValuesList",value:function(){return this.CONFIGURATION.emailValuesList}},{key:"getTagValues",value:function(){for(var e=this.toWhoEmailComponent.getValue(),t=0,n=e.length;t<n;t++)e[t].value===e[t].caption&&(e[t].isRegularTag=!0);return e}},{key:"setTagValues",value:function(e){this.toWhoEmailComponent.setValue(e)}},{key:"getSelectedValue",value:function(){return this.toWhoComponent.getValue()}}],[{key:"createDefaultConfiguration",value:function(){return{emailValuesList:[],defaultTagValues:[]}}}]),e}();function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Kt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var zt=function(e){g()(n,e);var t=Kt(n);function n(e,i,r,a,s){var l;return o()(this,n),l=t.call(this,e,i,r),v()(c()(l),"formDocument",void 0),v()(c()(l),"abilityService",void 0),v()(c()(l),"ruleRecipientConfiguration",void 0),v()(c()(l),"divRuleRecipient",void 0),v()(c()(l),"ruleRecipient",void 0),v()(c()(l),"currentModel",void 0),l.abilityService=a,l.currentModel=s,l.ruleRecipientConfiguration=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){v()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r.ruleRecipientConfiguration),l}return l()(n,[{key:"withFormDocument",value:function(e){return this.formDocument=e,this}},{key:"initVars",value:function(){p()(E()(n.prototype),"initVars",this).call(this),this.divRuleRecipient=this.divRuleContent.querySelector(n.QUERY_SELECTOR_RULE_RECIPIENT)}},{key:"initCustomRuleComponent",value:function(){this.ruleRecipient=new Gt(this.ruleRecipientConfiguration).withI18n(this.i18n).withRecipientEmailValidator(this.getRecipientEmailValidator.bind(this)),this.ruleRecipient.setTagsLimit=this.setTagsLimitToRecipients.bind(this),this.ruleRecipient.triggerRecipientPaywall=this.triggerRecipientsPaywall.bind(this),this.ruleRecipient.onSendToFocus=this.onSendToFocus,this.ruleRecipient.onSendToVariableOpen=this.onSendToVariableOpen,this.ruleRecipient.onSendToVariableInsert=this.onSendToVariableInsert,this.ruleRecipient.initialize(),this.divRuleRecipient.appendChild(this.ruleRecipient.getRootNode())}},{key:"onDuplicateBtnClick",value:function(){this.abilityService.can(Je.COUNT_EMAIL_RULES,this.currentModel)&&p()(E()(n.prototype),"onDuplicateBtnClick",this).call(this)}},{key:"getRuleConditionConfigVariables",value:function(e){return Xt(e,this.formDocument,this.i18n)}},{key:"getRuleContainerInstance",value:function(e,t){return new n(this.cloneDivRuleContainer,this.rulePosition,{ruleRecipientConfiguration:{emailValuesList:this.ruleRecipient.getEmailValuesList(),defaultTagValues:this.ruleRecipient.getTagValues(),selectedValue:this.ruleRecipient.getSelectedValue()},ruleConditionConfigurations:e,ruleStatementConfigurations:t},this.abilityService).withFormDocument(this.formDocument).withI18n(this.i18n)}},{key:"onVariableBeforeChange",value:function(){return this.abilityService.can(Je.COUNT_EMAIL_RULES,this.currentModel)}},{key:"getRecipientEmailValidator",value:function(e){return this.formDocument.getEngine().getValidator().validate(e,Ee.VALIDATOR_TYPE_EMAIL)}},{key:"setTagsLimitToRecipients",value:function(){return this.abilityService.getTotalLimit(Je.COUNT_EMAIL_RULES)}},{key:"triggerRecipientsPaywall",value:function(){this.abilityService.can(Je.COUNT_EMAIL_RECIPIENTS,this.currentModel)||this.trigger("count-email-recipients-not-supported")}},{key:"getSendToOnly",value:function(){return this.ruleRecipient.getSelectedValue().hookType===Ze.TRIGGER_ONLY_SEND_TO}},{key:"getRuleRecipients",value:function(){return this.ruleRecipient.getTagValues()}},{key:"updateRuleRecipients",value:function(e){this.ruleRecipient.setTagValues(e)}}]),n}(ze);v()(zt,"QUERY_SELECTOR_RULE_RECIPIENT",'div[data-role="placeholder"][data-control-name="rule-recipient"]');n(124);var qt=function e(){o()(this,e)};v()(qt,"CONTROL_VARIABLE_PREFIX","controlId:"),v()(qt,"COMPANY_NAME","123FormBuilder"),v()(qt,"NO_REPLAY_EMAIL","noreply@123formbuilder.com"),v()(qt,"DELETED_FIELD","Deleted field"),v()(qt,"PROTECTED_FIELD","Protected field"),v()(qt,"CONTROL_HIPAA_POSTFIX","(HIPAA)");var Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=[];e&&i.push({value:"0",text:n.translateText("notifications_allSubmissions"),type:we.DEFAULT,skipConditions:!0});for(var r=Qt(zt.RULE_ALLOWED_EXTRA,jt.getExtraVariables()),a=t.flatten(),o=function(e,t){var r=a[e],o=r.getTypeId();if(!r.getLabelDOMNode()||-1==zt.RULE_ALLOWED_CONTROL_TYPES.indexOf(o)||jt.getRepeatableContainerParent(r))return"continue";var s=String(r.getId()),l=r.getLabelDOMNode().innerText,u=r.getInputDOMNodes();switch(o){case Oe.CONTROL_TYPE_NAME:case Oe.CONTROL_TYPE_ADDRESS:for(var c=0,d=u.length;c<d;c++)for(var p=u[c].inputs,h=0,g=p.length;h<g;h++){var _=p[h],f=A()(_.input,HTMLElement)?_.input:_.input.getRootNode(),y=f.hasAttribute("data-i18n-placeholder")?f.getAttribute("data-i18n-placeholder"):$("input[data-i18n-placeholder]",f).attr("data-i18n-placeholder");i.push({value:"".concat(s,"-").concat(f.getAttribute("data-index")),text:n.translateText(y),type:we.DEFAULT,controlType:o,group:{id:s,name:l}})}break;case Oe.CONTROL_TYPE_RADIO:case Oe.CONTROL_TYPE_CHECKBOX:case Oe.CONTROL_TYPE_TERMS_OF_SERVICE:for(var E=0,m=u.length;E<m;E++)for(var v=u[E].inputs,T=0,O=v.length;T<O;T++){var C=v[T],N=C.input.querySelector("input[data-index]"),b=!!Number(N.getAttribute("data-is-other"));i.push({value:"".concat(s,"-").concat(N.getAttribute("data-index")),text:C.input.textContent,type:b?we.DEFAULT:we.CHECKABLE,controlType:o,group:{id:s,name:l}})}break;case Oe.CONTROL_TYPE_LIKERT_SCALE:for(var R=0,I=u.length;R<I;R++)for(var P=u[R].inputs,S=0,D=P.length;S<D;S++){var L=P[S];[].slice.call(L.input.querySelectorAll("input[data-index]")).forEach((function(e){i.push({value:"".concat(s,"-").concat(e.getAttribute("data-index")),text:e.getAttribute("value"),type:we.CHECKABLE,controlType:o,group:{id:s,name:l}})}))}break;default:var k={value:s,text:l,type:we.DEFAULT,controlType:o};o===Oe.CONTROL_TYPE_DROPDOWN?(k.values=[],[].slice.call(r.getRootNode().querySelectorAll("option[data-index]")).forEach((function(e){k.values.push(e.textContent)}))):o===Oe.CONTROL_TYPE_DATE?k.placeholder="mm/dd/yyyy":o===Oe.CONTROL_TYPE_TIME&&(k.placeholder="hh:mm"),i.push(k)}},s=0,l=a.length;s<l;s++)o(s,l);for(var u=0,c=r.length;u<c;u++){var d=r[u],p=d.value.substr(1,d.value.length-2);switch(d.value){case T.Y.LANGUAGE:var h=t.getEngine().getLoader().getLoaderDependency(T.A.TRANSLATIONS_LANGUAGE_CODES);h&&function(){var e=jt.getUiTranslatedString("applications_locale","Language");h.forEach((function(t){var n=Re.getLanguageObjectByCode(t);n&&i.push({value:n.code2?n.code2:n.code3,text:n.name,type:we.SELECTABLE,controlType:He.LANGUAGE,group:{id:e,name:e}})}))}();break;case T.Y.PAYMENT_COUPON:i.push({value:He.COUPON_CODE,text:d.text,type:we.DEFAULT,controlType:He.COUPON_CODE});break;case T.Y.QUIZ_SCORE:i.push({value:He.QUIZ_SCORE,text:d.text,type:we.COMPARABLE,controlType:He.QUIZ_SCORE});break;default:i.push({value:p,text:d.text,type:we.DEFAULT,controlType:p})}}return i},Qt=function(e,t){for(var n=[],i=0,r=t.length;i<r;i++)e.indexOf(t[i].value)>-1&&n.push(t[i]);return n},$t=function(e){return{type:Ae.TAG,value:e,caption:jt.getUiTranslatedString("edt_notifications_deleted_field",qt.DELETED_FIELD),isDeleted:!0,isRegularTag:!1}},jt=function(){function e(){o()(this,e)}return l()(e,null,[{key:"isImageURL",value:function(e){return/^((http(s)?:)?\/\/([^\/]+))?([^:]+)([^\/.]+)(\.(png|gif|jpg|jpeg|tiff|bmp))(\?(.*)?|#(.*)?)?$/i.test(String(e||""))}},{key:"getNormalizedCSSColorNotationFromString",value:function(e){if(!e||"string"!==typeof e)return null;if(/^#[0-9a-f]{3}$/i.test(e))return"#".concat(e.charAt(1)).concat(e.charAt(1)).concat(e.charAt(2)).concat(e.charAt(2)).concat(e.charAt(3)).concat(e.charAt(3));if(e.match(/^(#(?:[0-9a-f]{2}){2,4}|#[0-9a-f]{3}|(?:rgba?|hsla?)\((?:\d+%?(?:deg|rad|grad|turn)?(?:,|\s)+){2,3}[\s\/]*[\d\.]+%?\))$/i))return e;var t=e.toLowerCase();return"undefined"!==typeof Te.standardHTMLColors[t]?Te.standardHTMLColors[t]:null}},{key:"shuffle",value:function(e,t){for(var n,i,r=void 0===t?e.length:Math.min(t,e.length);0!==r;)i=Math.floor(Math.random()*r),n=e[--r],e[r]=e[i],e[i]=n;return e}},{key:"computeDistance",value:function(e,t){return~~Math.sqrt(Math.pow(t.left-e.left,2)+Math.pow(t.top-e.top,2))}},{key:"rectangleIntersects",value:function(e,t){return!(e.left+e.width<t.left||e.left>t.left+t.width||e.top+e.height<t.top||e.top>t.top+t.height)}},{key:"nullFunction",value:function(){return null}},{key:"padString",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T.F.RIGHT,r=String(e||""),a=r.length,o=String(t||""),s=o.length,l=~~n;if(0===s)return e;for(;a<l;)r=i===T.F.RIGHT?r.concat(o):o.concat(r),a+=s;return r}},{key:"scrollIntoView",value:function(e){e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView&&e.scrollIntoView())}},{key:"synchronizeControlValue",value:function(e,t){var n,i,r,a=(i=A()(e,M))?e.getValue():(n="input"===e.nodeName.toLowerCase()&&["radio","checkbox"].indexOf(e.type)>-1)?e.checked:String(e.value);(r=!0===a||!1===a?!!t:0===t?"0":String(t||""))!==a&&(i?e.setValue(r):e[n?"checked":"value"]=r)}},{key:"getComputedStyle",value:function(e){try{return window.getComputedStyle(e)}catch(t){return null}}},{key:"areTheSame",value:function(e,t){if(e===t)return!0;var n,i;if((n=r()(e))===r()(t)){if("object"===n){if(A()(e,Array)){if(A()(t,Array)){if((i=e.length)===t.length){for(var a=0;a<i;a++)if(!this.areTheSame(e[a],t[a]))return!1;return!0}return!1}return!1}if(e){if(t){var o=[];for(var s in e)if(e.hasOwnProperty(s)&&(o.push(s),!this.areTheSame(e[s],t[s])))return!1;for(var l in t)if(t.hasOwnProperty(l)&&-1===o.indexOf(l))return!1;return!0}return!1}}return!1}return!1}},{key:"getImageURLAntiCache",value:function(e){return e?"string"!==typeof e||/^data\:/.test(e)?e:-1===e.indexOf("?")?"".concat(e,"?_=").concat(+new Date):"".concat(e,"&_=").concat(+new Date):e}},{key:"getTextNumberOfWords",value:function(e){var t=String(e||"").replace(/(^[\s]+|[\s]+$)/g,"");return""===t?0:t.split(/[\s]+/).length}},{key:"getURLEmbedIframeSource",value:function(e){switch(e.type){case T.W.YOUTUBE_VIDEO:return"https://www.youtube.com/embed/".concat(e.identifier,"?enablejsapi=1");case T.W.VIMEO_VIDEO:return"https://player.vimeo.com/video/".concat(e.identifier);case T.W.WORDPRESS_TV_VIDEO:return"https://videopress.com/embed/".concat(e.identifier);case T.W.TED_TALKS_VIDEO:return"https://embed.ted.com/talks/".concat(e.identifier);case T.W.DAILYMOTION_VIDEO:return"https://www.dailymotion.com/embed/video/".concat(e.identifier);case T.W.MIXCLOUD_AUDIO:return"https://www.mixcloud.com/widget/iframe/?feed=https://www.mixcloud.com/".concat(e.identifier);case T.W.SOUNDCLOUD_AUDIO:return"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/".concat(e.identifier,"&auto_play=false&visual=true");case T.W.NFB_VIDEO:return"https://www.nfb.ca/film/".concat(e.identifier,"/embed/player/");case T.W.KICKSTARTER_VIDEO:return"https://www.kickstarter.com/projects/".concat(e.identifier,"/widget/video.html");case T.W.TWITCH_VIDEO:return"https://player.twitch.tv/?video=".concat(e.identifier);case T.W.PDF_FILE:return e.url;case T.W.FACEBOOK_POST:return"https://www.facebook.com/plugins/post.php?href=https://www.facebook.com/".concat(e.identifier);case T.W.FACEBOOK_PAGE:return"https://www.facebook.com/plugins/page.php?href=https://www.facebook.com/".concat(e.identifier,"&tabs=timeline&small_header=false&adapt_container_width=true&show_facepile=true&width=500px");case T.W.MOBILE_EMBED:return"https://docs.google.com/gview?url=".concat(e.url,"&embedded=true");default:return null}}},{key:"getFormTotalPoints",value:function(e){for(var t=0,n=e.flatten(),i=0,r=n.length;i<r;i++)if(n[i].hasProperty("choices.values"))for(var a=n[i].getProperty("choices.values"),o=0,s=a.length;o<s;o++)if(a[o].isCorrect){t+=a[o].quizPoints;break}return t}},{key:"getFormPointsWithoutElements",value:function(e,t){for(var n=0,i=e.flatten(),r=0,a=i.length;r<a;r++)if(i[r].hasProperty("choices.values")&&-1==t.indexOf(i[r].getHash()))for(var o=i[r].getProperty("choices.values"),s=0,l=o.length;s<l;s++)if(o[s].isCorrect){n+=o[s].quizPoints;break}return n}},{key:"scrollElementIntoView",value:function(t,n){setTimeout((function(){try{if(_e.isIE()){var i=t.getBoundingClientRect(),r=i.top,a=i.height;document.documentElement.scrollTop=r-a}else t.scrollIntoView(n)}catch(s){}try{if(void 0===e.iframeID){var o=Object(fe.b)(window.location.search.substr(1));e.iframeID=o&&o._iframeID_?o._iframeID_:null}}catch(s){}}),10),setTimeout((function(){try{null!==e.iframeID&&window.parent.postMessage({command:"scroll-into-view",iframeId:e.iframeID,top:t.getBoundingClientRect().top},"*")}catch(n){}}),100)}},{key:"refreshFrameHeightOnWix",value:function(){if(window.Wix){var e=document.getElementById("form"),t=void 0!==e?e.offsetHeight:document.body.offsetHeight;window.Wix.setHeight(t)}}},{key:"getUserSessionTokenForWix",value:function(){window.Wix&&ge.Wix.Activities.getUserSessionToken((function(e){document.body.setAttribute("data-wix-user-token",e)}))}},{key:"addEditorModeChangeEventListenerForWix",value:function(t){window.Wix&&(ge.Wix.addEventListener(ge.Wix.Events.EDIT_MODE_CHANGE,(function(t){t&&void 0!==t.editMode&&(document.body.setAttribute("data-wix-edit-mode",t.editMode),e.refreshFrameHeightOnWix())})),ge.Wix.addEventListener(ge.Wix.Events.COMPONENT_DELETED,(function(){t.ajax({type:"POST",url:"/ajax_call.php",data:{module:"modules/wixNew/class.WixFunctions.php",class:"wixFunctions",function:"deleteWixInstance",iframeInstance:ge.Wix.Utils.getInstanceId(),iframeInstanceCompid:ge.Wix.Utils.getCompId(),iframeInstanceUserID:ge.Wix.Utils.getUid(),iframeInstanceSiteOwnerId:ge.Wix.Utils.getSiteOwnerId()}})})))}},{key:"isRealCSSUrl",value:function(e,t){return function(t,n){return e?t.validate(e,Ee.VALIDATOR_TYPE_URL_WEB_PAGE)?n.Deferred((function(t){var n=window.document.createElement("link"),i=document.createElement("iframe");i.setAttribute("contenteditable","true"),i.style.width=i.style.height="1px",n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",e),n.addEventListener("load",(function(){document.body.removeChild(i),t.resolve(!0)})),n.addEventListener("error",(function(){document.body.removeChild(i),t.resolve(!1)})),document.body.appendChild(i),(i.contentWindow.document||i.contentDocument).getElementsByTagName("head")[0].appendChild(n)})).promise():n.Deferred((function(e){e.resolve(!1)})).promise():n.Deferred((function(e){e.resolve(!1)}))}(t.getValidator(),t.getJQuery())}},{key:"clone",value:function(e){var t;if(null===e)return null;switch(r()(e)){case"boolean":case"number":case"string":case"function":return e;case"object":if(Array.isArray(e)){t=[];for(var n=0,i=e.length;n<i;n++)t.push(this.clone(e[n]))}else{if(!e)return null;for(var a in t={},e)e.hasOwnProperty(a)&&e.propertyIsEnumerable(a)&&(t[a]=this.clone(e[a]))}return t}}},{key:"merge",value:function(e,t){var n=[];if(Array.isArray(e))for(var i=0,r=e.length;i<r;i++)n.push(e[i]);if(Array.isArray(t))for(var a=0,o=t.length;a<o;a++)n.push(t[a]);return n}},{key:"scrollElementIntoViewOnWix",value:function(){window.Wix&&window.Wix.getBoundingRectAndOffsets((function(e){window.Wix.scrollTo(e.offsets.x,e.offsets.y)}))}},{key:"getRepeatableContainerParent",value:function(t){return t.getParent()?t.getParent().getTypeId()!==C.a.CONTAINER_TYPE_REPEATABLE?e.getRepeatableContainerParent(t.getParent()):t.getParent():null}},{key:"htmlEntities",value:function(e){this.escaper.textContent=String(0===e?"0":e||"");var t=this.escaper.innerHTML;return this.escaper.textContent="",t}},{key:"htmlEntitiesWithBR",value:function(e){for(var t=String(0===e?"0":e||"").split("\n"),n=0,i=t.length;n<i;n++)t[n]=this.htmlEntities(t[n]);return t.join("<br />")}},{key:"getRootPanelComponent",value:function(t){return t.getParent()?e.getRootPanelComponent(t.getParent()):t}},{key:"getIframeID",value:function(){try{if(void 0===e.iframeID){var t=Object(fe.b)(window.location.search.substr(1));e.iframeID=t&&t._iframeID_?t._iframeID_:null}}catch(n){}return e.iframeID||null}},{key:"scrollToTopOfFormWhenFormIsEmbeddedUnderIOS",value:function(){try{window.parent&&this.getIframeID()&&_e.isIOS()&&window.parent.postMessage({iframeId:e.getIframeID(),top:10,command:"scroll-into-view"},"*")}catch(t){}}},{key:"getDefaultLabelValue",value:function(t){if(!t)return"";switch(t.getTypeId()){case C.a.CONTROL_TYPE_LIKERT_SCALE:return e.getUiTranslatedString("edt_notifications_undefined_statement","Undefined statement");default:return e.getUiTranslatedString("edt_notifications_undefined_label","Undefined label")}}},{key:"getLabelOfFormControl",value:function(t){var n=t.getProperty("label.labelText")?t.getProperty("label.labelText"):e.getDefaultLabelValue(t);return t?this.getUiTranslatedString(t.getProperty("label.i18nLabelKey"),R.toPlainText(n)):e.getUiTranslatedString("edt_notifications_deleted_field",qt.DELETED_FIELD)}},{key:"getUiTranslatedString",value:function(e,t){for(var n,i,r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return i=(n=window.UI.getI18n()).translateText.apply(n,[e].concat(a)),e&&i&&i!==e?i:t}},{key:"allBrowsersCompatibleScrollIntoView",value:function(t,n){var i=t.getBoundingClientRect(),r=i.top,a=i.height;(_e.isIOS()||_e.isMAC())&&window.Wix?window.Wix.getBoundingRectAndOffsets((function(e){window.Wix.scrollTo(e.offsets.x,e.offsets.y+r-a)})):_e.isMAC()&&window.parentIFrame?window.parentIFrame.scrollToOffset(0,r-a):_e.isIE()?document.documentElement.scrollTop=r-a:(setTimeout((function(){n?t.scrollIntoView(n):t.scrollIntoView();try{if(void 0===e.iframeID){var i=Object(fe.b)(window.location.search.substr(1));e.iframeID=i&&i._iframeID_?i._iframeID_:null}}catch(r){}}),10),setTimeout((function(){try{null!==e.iframeID&&window.parent.postMessage({command:"scroll-into-view",iframeId:e.iframeID,top:t.getBoundingClientRect().top},"*")}catch(n){}}),100))}},{key:"addNoFollowOnLinks",value:function(e){var t=document.createElement("div"),n=t.getElementsByTagName("a");return t.innerHTML=e,Array.prototype.forEach.call(n,(function(e){return e.setAttribute("rel","nofollow ugc")})),t.innerHTML}},{key:"getVariablesFromText",value:function(t,n,i){var r=t.match(/(\:([a-zA-Z0-9_\-]+)\:|(controlId:repeatable:)([0-9]+)|(controlId:)([0-9]+)(:[a-zA-Z0-9]+)?)/gm),a=i?e.generateFormVariables(n,void 0,void 0,!0):e.generateFormVariables(n),o=[];if(r)for(var s=0,l=r.length;s<l;s++){var u=e.getVariableInfoByCode(a,r[s]),c=t.split(r[s])[0].trim();if(c&&o.push({type:Ae.TEXT,value:c,caption:c,isRegularTag:!0}),u){var d={type:Ae.TAG,value:u.value,caption:u.text};u.id&&(d.id=u.id),o.push(d)}else o.push($t(r[s]));t=t.slice(t.indexOf(r[s])+r[s].length)}return t&&o.push({type:Ae.TEXT,value:t,caption:t,isRegularTag:!0}),o}},{key:"generateFormVariables",value:function(t,n,i,r){var a=this,o=0;n||(n=[C.a.CONTROL_TYPE_TEXT,C.a.CONTROL_TYPE_TEXTAREA,C.a.CONTROL_TYPE_DROPDOWN,C.a.CONTROL_TYPE_NAME,C.a.CONTROL_TYPE_RADIO,C.a.CONTROL_TYPE_CHECKBOX,C.a.CONTROL_TYPE_FILE,C.a.CONTROL_TYPE_NUMBER,C.a.CONTROL_TYPE_EMAIL,C.a.CONTROL_TYPE_LIKERT_SCALE,C.a.CONTROL_TYPE_ADDRESS,C.a.CONTROL_TYPE_PHONE,C.a.CONTROL_TYPE_DATE,C.a.CONTROL_TYPE_TIME,C.a.CONTROL_TYPE_PRICE,C.a.CONTROL_TYPE_WEBSITE,C.a.CONTROL_TYPE_PASSWORD,C.a.CONTROL_TYPE_SIGNATURE,C.a.CONTROL_TYPE_STAR_RATING,C.a.CONTROL_TYPE_TERMS_OF_SERVICE,C.a.CONTROL_TYPE_FORMULA,C.a.CONTROL_TYPE_COUPON,C.a.CONTROL_TYPE_FEE,C.a.CONTAINER_TYPE_REPEATABLE]);var s=[],l=void 0!==i?i:e.getExtraVariables();return t.forEach((function(t){var i=[];if(n.indexOf(t.getTypeId())>-1&&(!e.getRepeatableContainerParent(t)||r&&e.getRepeatableContainerParent(t))){switch(t.getTypeId()){case C.a.CONTROL_TYPE_NAME:i=a.nameControlFields(t);break;case C.a.CONTROL_TYPE_ADDRESS:i=e.addressControlFields(t);break;case C.a.CONTROL_TYPE_RADIO:i=e.singleChoiceControlFields(t);break;case C.a.CONTROL_TYPE_CHECKBOX:i=e.multipleChoiceControlFields(t);break;default:t.getId()?s.push({text:e.getLabelOfFormControl(t),value:"controlId:".concat(t.getId()),id:t.getId()}):t.getTypeId()===C.a.CONTAINER_TYPE_REPEATABLE&&s.push({text:e.getLabelOfFormControl(t),value:"controlId:repeatable:".concat(o++)})}i.length&&(s=s.concat(i))}})),l.forEach((function(e){s.push(e)})),s}},{key:"nameControlFields",value:function(t){var n=[],i=e.getLabelOfFormControl(t);return n.push({text:i,value:"controlId:".concat(t.getId()),id:t.getId()}),n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_first","First")),value:"controlId:".concat(t.getId(),":first"),id:t.getId()}),n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_last","Last")),value:"controlId:".concat(t.getId(),":last"),id:t.getId()}),t.hasProperty("configuration.fieldMiddleName")&&t.getProperty("configuration.fieldMiddleName")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_middle","Middle")),value:"controlId:".concat(t.getId(),":middle"),id:t.getId()}),t.hasProperty("configuration.fieldInitials")&&t.getProperty("configuration.fieldInitials")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_initials","Initials")),value:"controlId:".concat(t.getId(),":initials"),id:t.getId()}),t.hasProperty("configuration.fieldTitle")&&t.getProperty("configuration.fieldTitle")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_title","Title")),value:"controlId:".concat(t.getId(),":title"),id:t.getId()}),n}},{key:"addressControlFields",value:function(t){var n=[],i=e.getLabelOfFormControl(t);return n.push({text:i,value:"controlId:".concat(t.getId()),id:t.getId()}),t.hasProperty("configuration.fieldAddress1")&&t.getProperty("configuration.fieldAddress1")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_street_address","Street Address")),value:"controlId:".concat(t.getId(),":fieldAddress1"),id:t.getId()}),t.hasProperty("configuration.fieldAddress2")&&t.getProperty("configuration.fieldAddress2")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_street_address_line2","Street Address Line 2")),value:"controlId:".concat(t.getId(),":fieldAddress2"),id:t.getId()}),t.hasProperty("configuration.fieldCity")&&t.getProperty("configuration.fieldCity")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_city","City")),value:"controlId:".concat(t.getId(),":city"),id:t.getId()}),t.hasProperty("configuration.fieldZone")&&t.getProperty("configuration.fieldZone")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_region_state","Region/State")),value:"controlId:".concat(t.getId(),":region"),id:t.getId()}),t.hasProperty("configuration.fieldZipCode")&&t.getProperty("configuration.fieldZipCode")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_zip_code","Zip code")),value:"controlId:".concat(t.getId(),":zipcode"),id:t.getId()}),t.hasProperty("configuration.fieldCountry")&&t.getProperty("configuration.fieldCountry")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_country","Country")),value:"controlId:".concat(t.getId(),":country"),id:t.getId()}),n}},{key:"singleChoiceControlFields",value:function(t){var n=[],i=e.getLabelOfFormControl(t);return n.push({text:i,value:"controlId:".concat(t.getId()),id:t.getId()}),t.hasProperty("choices.allowOther")&&t.getProperty("choices.allowOther")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_other","Other")),value:"controlId:".concat(t.getId(),":other"),id:t.getId()}),n}},{key:"multipleChoiceControlFields",value:function(t){var n=[],i=e.getLabelOfFormControl(t);(n.push({text:i,value:"controlId:".concat(t.getId()),id:t.getId()}),t.hasProperty("choices.values")&&t.getProperty("choices.values").length)&&t.getProperty("choices.values").forEach((function(r,a){n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString(r.i18nLabel,r.text)),value:"controlId:".concat(t.getId(),":").concat(a),id:t.getId()})}));return t.hasProperty("choices.allowOther")&&t.getProperty("choices.allowOther")&&n.push({text:"".concat(i," - ").concat(e.getUiTranslatedString("notifications_other","Other")),value:"controlId:".concat(t.getId(),":other"),id:t.getId()}),n}},{key:"getExtraVariables",value:function(){return[{text:e.getUiTranslatedString("notifications_entry_id","Entry ID"),value:T.Y.ENTRY_ID},{text:e.getUiTranslatedString("notifications_ip","IP"),value:T.Y.IP},{text:e.getUiTranslatedString("notifications_country","Country"),value:T.Y.COUNTRY_CODE},{text:e.getUiTranslatedString("notifications_browser","Browser"),value:T.Y.BROWSER},{text:e.getUiTranslatedString("notifications_device_type","Device type"),value:T.Y.DEVICE_TYPE},{text:e.getUiTranslatedString("notifications_referrer","Referrer"),value:T.Y.REFERRER},{text:e.getUiTranslatedString("notifications_form_host","Form Host"),value:T.Y.FORM_HOST},{text:e.getUiTranslatedString("notifications_reference_id","Reference ID"),value:T.Y.REFERENCE_ID},{text:e.getUiTranslatedString("notifications_edit_submission_link","Edit submission link"),value:T.Y.EDIT_SUBMISSION_LINK},{text:e.getUiTranslatedString("notifications_quiz_score","Quiz score"),value:T.Y.QUIZ_SCORE},{text:e.getUiTranslatedString("notifications_approval_link","Approval Link"),value:T.Y.APPROVAL_LINK},{text:e.getUiTranslatedString("notifications_approval_history","Approval History"),value:T.Y.APPROVALS_HISTORY},{text:e.getUiTranslatedString("notifications_payment_summary","Payment Summary"),value:T.Y.PAYMENT_SUMMARY},{text:e.getUiTranslatedString("notifications_payment_link","Payment Link"),value:T.Y.PAYMENT_LINK},{text:e.getUiTranslatedString("notifications_payment_amount","Payment Amount"),value:T.Y.PAYMENT_AMOUNT},{text:e.getUiTranslatedString("notifications_payment_currency","Payment Currency"),value:T.Y.PAYMENT_CURRENCY},{text:e.getUiTranslatedString("notifications_payment_status","Payment Status"),value:T.Y.PAYMENT_STATUS},{text:e.getUiTranslatedString("notifications_payment_processor_name","Payment Processor Name"),value:T.Y.PAYMENT_PROCESSOR_NAME},{text:e.getUiTranslatedString("notifications_coupon_codes","Coupon codes"),value:T.Y.PAYMENT_COUPON},{text:e.getUiTranslatedString("notifications_submission_status","Submission Status"),value:T.Y.SUBMISSION_STATUS},{text:e.getUiTranslatedString("notifications_submission_summary","Submission Summary"),value:T.Y.SUBMISSION_SUMMARY},{text:e.getUiTranslatedString("notifications_submission_language","Submission Language"),value:T.Y.LANGUAGE},{text:e.getUiTranslatedString("notifications_quiz_summary","Quiz Summary"),value:T.Y.QUIZ_SUMMARY},{text:e.getUiTranslatedString("notifications_submission_date","Submission Date"),value:T.Y.SUBMISSION_DATE},{text:e.getUiTranslatedString("notifications_submission_date_time","Submission Date and Time"),value:T.Y.SUBMISSION_DATE_TIME},{text:e.getUiTranslatedString("notifications_submission_time","Submission Time"),value:T.Y.SUBMISSION_TIME},{text:e.getUiTranslatedString("notifications_form_name","Form Name"),value:T.Y.FORM_NAME}]}},{key:"getVariableInfoByCode",value:function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n].value===t)return e[n];return null}},{key:"setAndRemoveMessageOnElement",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T.T.SUCCESS;e.textContent=t,e.setAttribute("data-is-".concat(n,"-message"),""),e.setAttribute("data-show-message",""),e.setAttribute("data-is-visible",""),setTimeout((function(){e.removeAttribute("data-show-message"),setTimeout((function(){e.removeAttribute("data-is-".concat(n,"-message")),e.removeAttribute("data-is-visible"),e.textContent=""}),500)}),5e3)}},{key:"isMobileInteractionActive",value:function(){return document.body.hasAttribute("data-mobile-interactions")}},{key:"isElementASpace",value:function(e){return e.textContent===String.fromCharCode(ve.THIN_SPACE_CHAR_CODE)}},{key:"getRandomID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=Math.floor(Math.random()*n)+t;return 1e3===e.randomGeneratedIDs.length?NaN:-1!==e.randomGeneratedIDs.indexOf(i)?e.getRandomID():(e.randomGeneratedIDs.push(i),i)}},{key:"removeRandomID",value:function(t){-1!==e.randomGeneratedIDs.indexOf(t)&&e.randomGeneratedIDs.splice(t,1)}},{key:"removeAllRandomIDs",value:function(){for(;e.randomGeneratedIDs.length>0;)e.randomGeneratedIDs.pop()}},{key:"isInputTextSelected",value:function(e){if("number"==typeof e.selectionStart)return 0==e.selectionStart&&e.selectionEnd==e.value.length}},{key:"trimChoices",value:function(e){var t=[];return Object(ot.a)(e,(function(e){e.text=e.text.trim(),t.push(e)})),t}}]),e}();function Jt(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(jt,"iframeID",void 0),v()(jt,"randomGeneratedIDs",[]),v()(jt,"escaper",document.createElement("div"));var Zt=function(e){g()(n,e);var t=Jt(n);function n(e,i){var r;if(o()(this,n),r=t.call(this),v()(c()(r),"store",void 0),v()(c()(r),"height",void 0),v()(c()(r),"colspan",void 0),v()(c()(r),"form",void 0),v()(c()(r),"parent",void 0),v()(c()(r),"id",void 0),v()(c()(r),"hash",void 0),v()(c()(r),"attached",void 0),v()(c()(r),"properties",{}),v()(c()(r),"rootNode",void 0),v()(c()(r),"errors",void 0),v()(c()(r),"rendererType",void 0),v()(c()(r),"labelDOMNode",void 0),v()(c()(r),"errorDOMNode",void 0),v()(c()(r),"instructionsDOMNode",void 0),r.form=e,void 0!==i&&null!==i&&(r.properties=i),!window.builderStore)throw new Error("Dependency not found: builderStore");for(r.store=window.builderStore,r.colspan=r.getDefaultColspan(),n.HASH_UID++,r.hash=n.HASH_UID.toString(16);8>r.hash.length;)r.hash="0".concat(r.hash);return r.createRootNodeElement(),null!==r.colspan&&r.rootNode&&r.rootNode.setAttribute("data-colspan",String(r.colspan)),r}return l()(n,[{key:"getHeight",value:function(){return void 0!==this.height?this.height:null}},{key:"getMinHeight",value:function(){return 0}},{key:"withHeight",value:function(e){null!==e&&e<this.getMinHeight()&&(e=this.getMinHeight()),0===e&&(e=null);var t=e!==this.height;return this.height=e,t&&this.form&&this.isAttached()&&this.form.trigger("node-attribute-changed",this,"height",this.height),t&&(this.getRootNode().style.height=e?"".concat(String(~~e),"px"):""),this}},{key:"getColspan",value:function(){return void 0!==this.colspan?this.colspan:null}},{key:"withColspan",value:function(e){null!==e&&(e>this.getMaxColspan()&&(e=this.getMaxColspan()),e<this.getMinColspan()&&(e=this.getMinColspan()));var t=this.colspan!==e;return null!==this.colspan?t&&this.getRootNode().setAttribute("data-colspan",String(e)):t&&this.getRootNode().removeAttribute("data-colspan"),this.colspan=e,t&&this.form&&this.isAttached()&&this.form.trigger("node-attribute-changed",this,"colspan",e),t&&this.isRenderingSupported()&&this.reRender(),this}},{key:"getForm",value:function(){return this.form||null}},{key:"getParent",value:function(){return this.parent||null}},{key:"withParent",value:function(e){return this.parent=e||null,this}},{key:"getNextSibling",value:function(){if(this.parent)for(var e=this.parent.getChildren(),t=0,n=e.length-1;t<n;t++)if(this===e[t])return e[t+1];return null}},{key:"getPreviousSibling",value:function(){if(this.parent)for(var e=this.parent.getChildren(),t=1,n=e.length;t<n;t++)if(this===e[t])return e[t-1];return null}},{key:"flatten",value:function(){return[this]}},{key:"getId",value:function(){return this.id||null}},{key:"withId",value:function(e){return this.id=e||null,null!==this.id?(this.getRootNode().setAttribute("data-id",String(this.id)),this.setupI18n()):this.getRootNode().removeAttribute("data-id"),this.form&&this.isAttached()&&this.form.trigger("node-attribute-changed",this,"id",this.id),this}},{key:"getHash",value:function(){return this.hash}},{key:"_static",value:function(){var e=this.constructor,t=this;return{getSupportedValidators:this.getSupportedValidators?function(){return t.getSupportedValidators(t)}:null,attributes:e.attributes,runtime:e.runtime,nodeName:e.nodeName,getConfiguration:e.getConfiguration,getDropDestinationCSSSelector:"function"===typeof this.constructor.getDropDestinationCSSSelector?this.constructor.getDropDestinationCSSSelector:jt.nullFunction,getDropSupportedEdges:"function"===typeof this.constructor.getDropSupportedEdges?this.constructor.getDropSupportedEdges:jt.nullFunction}}},{key:"hasAttribute",value:function(e){var t=this._static();return!("string"!==typeof e||!e||!t.attributes.hasOwnProperty(e))}},{key:"getAttributeType",value:function(e){var t=this._static();return this.hasAttribute(e)&&t.attributes[e].type||null}},{key:"hasAttributeProperty",value:function(e,t){var n=this._static();return"string"===typeof t&&t&&n.attributes[e].properties.hasOwnProperty(t)&&void 0!==n.attributes[e].properties[t]}},{key:"getAttributePropertyDescriptor",value:function(e,t){return this._static().attributes[e].properties[t]}},{key:"getProperty",value:function(e){var t,n=String(e||"").split("."),i=n[0]||"",r=n[1]||"";if(""===i||""===r||2!==n.length)throw new Error("Illegal attribute accessor: ".concat(JSON.stringify(e)));if(this.hasAttribute(i)){if(!this.hasAttributeProperty(i,r)){if(null!==(t=D.getPropertyReadCallback(e,this)))return t.call(this);if(D.isVirtualProperty(e,this))return;throw new Error("Property ".concat(JSON.stringify(r)," does not exist on a attribute of type ").concat(JSON.stringify(this.getAttributeType(i))))}return void 0===this.properties[i]||void 0===this.properties[i][r]?this._static().attributes[i].properties[r].defaultValue:this.properties[i][r]}if(null!==(t=D.getPropertyReadCallback(e,this)))return t.call(this);if(!D.isVirtualProperty(e,this))throw new Error("Property ".concat(JSON.stringify(r)," does not exist on a attribute of type ").concat(JSON.stringify(this.getAttributeType(i))))}},{key:"hasProperty",value:function(e){var t=String(e||"").split("."),n=t[0]||"",i=t[1]||"";return""!==n&&""!==i&&2===t.length&&(this.hasAttribute(n)&&!!this.hasAttributeProperty(n,i)||D.isVirtualProperty(e,this))}},{key:"setProperty",value:function(e,t){var n,i,r,a,o=String(e||"").split("."),s=o[0]||"",l=o[1]||"",u=this._static(),c=!1;if(""===s||""===l||2!==o.length)throw new Error("Illegal attribute accessor: ".concat(JSON.stringify(e)));if(!this.hasAttribute(s)){if(null===(a=D.getPropertyWriteCallback(e,this)))throw new Error("Attribute ".concat(JSON.stringify(s)," was not found"));a.call(this,t),c=!0}if(!c&&!this.hasAttributeProperty(s,l)){if(null===(a=D.getPropertyWriteCallback(e,this)))throw new Error("Property ".concat(JSON.stringify(l)," does not exist on a attribute of type ").concat(JSON.stringify(this.getAttributeType(s))));a.call(this,t),c=!0}if(c||void 0!==this.properties[s]||(this.properties[s]={}),c)r&&this.isAttached()&&(r.trigger("node-property-changed",this,e,t,null),r.trigger("change"));else{if(n=this.getAttributePropertyDescriptor(s,l),null===t&&!n.optional)switch(n.type){case"string":t="";break;case"number":case"int":case"float":t=0;break;case"boolean":case"bool":t=!1}if(!(null===t&&n.optional||u.runtime.isTypeOf(t,n.type)))throw new Error("Value ".concat(JSON.stringify(t)," is not of type ").concat(JSON.stringify(n)));i=this.properties[s][l],this.properties[s][l]=t,(r=this.getForm())&&!jt.areTheSame(i,t)&&this.isAttached()&&(r.trigger("node-property-changed",this,e,t,i),r.trigger("change"))}return this}},{key:"enumerateProperties",value:function(){var e,t=[],n=this._static(),i=this.getParent()?this.getParent().enumerateDisabledProperties():null;for(var r in n.attributes)if(n.attributes.hasOwnProperty(r))for(var a in n.attributes[r].properties)n.attributes[r].properties.hasOwnProperty(a)&&t.push({name:"".concat(r,".").concat(a),type:n.attributes[r].properties[a].type,optional:n.attributes[r].properties[a].optional,virtual:!1});if(null!==(e=D.enumerateVirtualProperties(this)))for(var o=0,s=e.length;o<s;o++)t.push(e[o]);if(i)for(var l=t.length-1;l>=0;l--)i.indexOf(t[l].name)>-1&&t.splice(l,1);return t}},{key:"getRootNode",value:function(){return this.rootNode}},{key:"isAttached",value:function(){return void 0!==this.attached&&this.attached}},{key:"onCreated",value:function(){}},{key:"withProperties",value:function(e){return this.properties=e,this}},{key:"getDefaultColspan",value:function(){return 20}},{key:"setAttached",value:function(e){this.attached=e}},{key:"getComputedProperties",value:function(){var e=this._static(),t={};for(var n in e.attributes)if(e.attributes.hasOwnProperty(n))for(var i in t[n]={},e.attributes[n].properties)e.attributes[n].properties.hasOwnProperty(i)&&(t[n][i]=this.getProperty("".concat(n,".").concat(i)));return t}},{key:"isRemovable",value:function(){return!0}},{key:"isDuplicatable",value:function(){return!0}},{key:"isResizable",value:function(){return!0}},{key:"isDragable",value:function(){return!0}},{key:"isSelectable",value:function(){return!0}},{key:"getErrors",value:function(){return this.errors||null}},{key:"withErrors",value:function(e){var t;if(null!==e&&!A()(e,Array))throw new Error("Invalid argument: array expected!");if(e&&(t=e.length)){for(var n,i=[],r=0;r<t;r++){if(!e[r]||"number"!==typeof e[r].code||"string"!==typeof e[r].message)throw new Error("Invalid argument: errors: IElementError[] expected!");if(n={code:~~e[r].code,message:e[r].message},void 0!==e[r].propertyName&&null!==e[r].propertyName){if("string"!==typeof e[r].propertyName)throw new Error("Invalid argument!");n.propertyName=e[r].propertyName}if(void 0!==e[r].fieldName&&null!==e[r].fieldName){if("string"!==typeof e[r].propertyName)throw new Error("Invalid argument!");n.fieldName=e[r].fieldName}i.push(n)}if(!this.errors&&!i.length)return;this.errors=i.length?i:void 0,this.errors?this.getRootNode().setAttribute("data-has-errors","1"):this.getRootNode().removeAttribute("data-has-errors"),this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this))}else this.errors=void 0,this.getRootNode().removeAttribute("data-has-errors"),this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this));return this}},{key:"addError",value:function(e,t,n,i){var r;if("number"!==typeof e)throw new Error("Invalid argument: int expected!");if(e=~~e,"string"!==typeof t)throw new Error("Invalid arugment: string expected!");if(r={code:e,message:t},void 0!==n&&null!==n){if("string"!==typeof n)throw new Error("Invalid argument: undefined|string expected");r.propertyName=n}if(void 0!==i&&null!==i){if("string"!==typeof i)throw new Error("Invalid argument: undefined|string expected");r.fieldName=i}if(void 0===this.errors)return this.errors=[r],this.getRootNode().setAttribute("data-has-errors","1"),this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this)),!0;for(var a=0,o=this.errors.length;a<o;a++)if(this.errors[a].code===e&&this.errors[a].fieldName===r.fieldName&&this.errors[a].propertyName===r.propertyName)return this.errors[a].message!==t&&(this.errors[a].message=t,this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this)),!0);return this.errors.push(r),1===this.errors.length&&this.getRootNode().setAttribute("data-has-errors","1"),this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this)),!0}},{key:"getErrorByCode",value:function(e){if(this.errors)for(var t=0,n=this.errors.length;t<n;t++)if(this.errors[t].code===e)return{code:this.errors[t].code,message:this.errors[t].message};return null}},{key:"removeError",value:function(e,t,n){if(this.errors)for(var i=0,r=this.errors.length;i<r;i++)if(e===this.errors[i].code&&t===this.errors[i].propertyName&&n===this.errors[i].fieldName)return this.errors.splice(i,1),0===this.errors.length&&(this.errors=void 0,this.getRootNode().removeAttribute("data-has-errors")),this.isAttached()&&(this.form.trigger("change"),this.form.trigger("errors-changed",this)),!0;return!1}},{key:"removeAllBackendErrors",value:function(){var e=!1;if(this.errors)for(var t=this.errors.length-1;t>=0;t--)n.ALL_BACKEND_ERRORS.indexOf(this.errors[t].code)>-1&&(this.errors.splice(t,1),e=!0,0===this.errors.length&&(this.errors=void 0,this.getRootNode().removeAttribute("data-has-errors")));return e&&this.isAttached()&&(this.getForm().trigger("change"),this.getForm().trigger("errors-changed",this)),e}},{key:"getResizingCapability",value:function(){return T.K.NONE}},{key:"getParentPage",value:function(){return this.parent?this.parent.getParentPage():null}},{key:"getMinColspan",value:function(){return 0}},{key:"getMaxColspan",value:function(){return this.parent?this.parent.getMaxColspan():20}},{key:"getFirstParentContainer",value:function(){var e=this;do{if(e&&e.getElementKind()===T.m.CONTAINER&&e.getTypeId()!==C.a.CONTAINER_TYPE_ROW&&e.getTypeId()!==C.a.CONTAINER_TYPE_PAGE&&e.getTypeId()!==C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE&&e.getTypeId()!==C.a.ELEMENT_TYPE_FORM&&e.getTypeId()!==C.a.CONTAINER_TYPE_LIKERT_WRAPPER)break;e=e.getParent()}while(e);return e||null}},{key:"cloneNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=jt.clone(this.properties),i=this.getForm().getEngine().createElement(this.getTypeId(),n,this.getForm());return e&&(i.withColspan(this.getColspan()),t&&i.withId(this.getId()),i.withHeight(this.getHeight())),this.getElementKind()===T.m.CONTAINER&&function(n,i){if(n.getTypeId()===C.a.CONTAINER_TYPE_REPEATABLE){var r=n.getChildren();i.appendChild(r[0].cloneNode(!0,!1))}else for(var a=0,o=n.getChildren(),s=o.length;a<s;a++)i.appendChild(o[a].cloneNode(e,t))}(this,i),i}},{key:"onDuplicate",value:function(){if(this.hasProperty("label.labelText")){var e=String(this.getProperty("label.labelText")||"").replace(/(^[\s]+|[\s]+$)/g,"");e="Copy of ".concat(e||this.getElementName()),this.setProperty("label.labelText",e),this.updateLabelText()}}},{key:"hasError",value:function(e){if(void 0!==this.errors&&this.errors&&this.errors.length){for(var t=0,n=this.errors.length;t<n;t++)if(this.errors[t].code===e)return!0;return!1}return!1}},{key:"isRenderingSupported",value:function(){return!1}},{key:"setRendererType",value:function(e){if("number"!=typeof e)throw new Error("Invalid argument: newRendererType: EControlRendererType expected");this.rendererType!==e&&(this.rendererType=e,le.getRendererByType(this.rendererType).updateRootNode(this))}},{key:"getRendererType",value:function(){return void 0===this.rendererType?null:this.rendererType}},{key:"getRenderedLabelPlacement",value:function(){var e=this.getRendererType();if(null===e||!this.isRenderingSupported())return null;switch(e){case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return T.u.LEFT_ALIGNED;case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return T.u.RIGHT_ALIGNED;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:return T.u.TOP_ALIGNED;default:return null}}},{key:"reRender",value:function(){this.rendererType=void 0,this.setRendererType(le.getSuggestedRenderer(this,this.getForm().getLabelPlacement(),this.getForm().getInstructionsPlacement()))}},{key:"getInputDOMNodes",value:function(){return null}},{key:"getLabelDOMNode",value:function(){return this.labelDOMNode||null}},{key:"getInstructionsDOMNode",value:function(){return this.instructionsDOMNode||null}},{key:"getErrorDOMNode",value:function(){return this.errorDOMNode||null}},{key:"updateLabelText",value:function(){if(void 0!==this.labelDOMNode&&this.hasProperty("label.labelText")){var e=this.getProperty("label.labelText"),t=this.hasProperty("label.isRemoved")&&this.getProperty("label.isRemoved"),n=t||this.hasProperty("label.isCompactField")&&this.getProperty("label.isCompactField");null===e||""===e?(this.labelDOMNode.setAttribute("data-is-empty","1"),this.labelDOMNode.textContent="",this.isCompactFieldPlaceholderSupported()&&n&&x.setLabelCompactFieldState(!0,"",this.getInputDOMNodes(),t)):(this.labelDOMNode.removeAttribute("data-is-empty"),this.labelDOMNode.innerHTML=S.sanitizeHTML(R.parse(e)),this.isCompactFieldPlaceholderSupported()&&n&&(e=R.toPlainText(e),x.setLabelCompactFieldState(!0,e,this.getInputDOMNodes(),t)))}}},{key:"updateInstructionsText",value:function(){if(void 0!==this.instructionsDOMNode&&this.hasProperty("instructions.text")){var e=this.getProperty("instructions.text");null===e||""===e?(this.instructionsDOMNode.setAttribute("data-is-empty","1"),this.instructionsDOMNode.textContent=""):(this.instructionsDOMNode.removeAttribute("data-is-empty"),this.instructionsDOMNode.innerHTML=S.sanitizeHTML(R.parse(e)))}}},{key:"updateShowInstructionsOnClick",value:function(){this.hasProperty("instructions.showInstructionsOnClick")&&this.getProperty("instructions.showInstructionsOnClick")?this.rootNode.setAttribute("data-instructions-on-click","1"):this.rootNode.removeAttribute("data-instructions-on-click")}},{key:"updateErrorsText",value:function(){if(void 0!==this.errorDOMNode){var e=this.getErrors();null===e?(this.errorDOMNode.setAttribute("data-is-empty","1"),this.errorDOMNode.textContent=""):(this.errorDOMNode.removeAttribute("data-is-empty"),this.errorDOMNode.innerHTML=function(){for(var t=[],n=0,i=e.length;n<i;n++)(void 0===e[n].propertyName||/^value\./.test(e[n].propertyName))&&-1===t.indexOf(e[n].message)&&t.push(e[n].message);return t.join("; ")}())}}},{key:"updateLabelBoldState",value:function(){this.hasProperty("label.isBold")&&(this.getProperty("label.isBold")?this.getRootNode().setAttribute("data-label-is-bold","1"):this.getRootNode().removeAttribute("data-label-is-bold"))}},{key:"updateLabelItalicState",value:function(){this.hasProperty("label.isItalic")&&(this.getProperty("label.isItalic")?this.getRootNode().setAttribute("data-label-is-italic","1"):this.getRootNode().removeAttribute("data-label-is-italic"))}},{key:"updateLabelHiddenState",value:function(){this.hasProperty("label.isHidden")&&(this.getProperty("label.isHidden")?this.getRootNode().setAttribute("data-label-is-hidden","1"):this.getRootNode().removeAttribute("data-label-is-hidden"))}},{key:"updateRequiredState",value:function(){this.hasProperty("options.required")&&this.getProperty("options.required")?this.getRootNode().setAttribute("data-is-required","1"):this.getRootNode().removeAttribute("data-is-required")}},{key:"setupDefaults",value:function(){return this}},{key:"updateHiddenAttribute",value:function(){this.hasProperty("options.hidden")&&this.getProperty("options.hidden")?this.rootNode.setAttribute("data-is-hidden","1"):this.rootNode.removeAttribute("data-is-hidden")}},{key:"onBlur",value:function(){console.warn("blur: not implemented")}},{key:"isCompactFieldPlaceholderSupported",value:function(){return!0}},{key:"getVisibilityMode",value:function(){var e=this.hasProperty("label.isHidden")&&this.getProperty("label.isHidden"),t=this.hasProperty("label.isRemoved")&&this.getProperty("label.isRemoved"),n=this.hasProperty("label.isCompactField")&&this.getProperty("label.isCompactField");switch(!0){case!e&&!t&&!n:return T.o.SHOWN;case e&&!t&&!n:return T.o.HIDDEN;case t&&!e&&!n:return T.o.REMOVED;case n&&!e&&!t:return T.o.COMPACT;default:return T.o.OTHER}}},{key:"setVisibilityMode",value:function(e){switch(e){case T.o.HIDDEN:this.hasProperty("label.isHidden")&&this.setProperty("label.isHidden",!0),this.hasProperty("label.isRemoved")&&this.setProperty("label.isRemoved",!1),this.hasProperty("label.isCompactField")&&this.setProperty("label.isCompactField",!1);break;case T.o.REMOVED:this.hasProperty("label.isHidden")&&this.setProperty("label.isHidden",!1),this.hasProperty("label.isRemoved")&&this.setProperty("label.isRemoved",!0),this.hasProperty("label.isCompactField")&&this.setProperty("label.isCompactField",!1);break;case T.o.COMPACT:this.hasProperty("label.isHidden")&&this.setProperty("label.isHidden",!1),this.hasProperty("label.isRemoved")&&this.setProperty("label.isRemoved",!1),this.hasProperty("label.isCompactField")&&this.setProperty("label.isCompactField",!0);break;case T.o.OTHER:break;case T.o.SHOWN:default:this.hasProperty("label.isHidden")&&this.setProperty("label.isHidden",!1),this.hasProperty("label.isRemoved")&&this.setProperty("label.isRemoved",!1),this.hasProperty("label.isCompactField")&&this.setProperty("label.isCompactField",!1)}}},{key:"setupI18n",value:function(){if(this.id){if(this.hasProperty("label.isCompactField")&&this.getProperty("label.isCompactField")){var e=this.getRootNode().querySelector("input, textarea");e&&(e.setAttribute("data-i18n-placeholder","control_label_".concat(this.id)),e.setAttribute("data-i18n-markdown-text",""))}else this.labelDOMNode&&this.labelDOMNode.setAttribute("data-i18n-text","control_label_".concat(this.id));this.instructionsDOMNode&&this.instructionsDOMNode.setAttribute("data-i18n-text","control_instructions_".concat(this.id))}return this}},{key:"onEnterSelection",value:function(){this.rootNode&&this.rootNode.setAttribute("data-is-selected","1")}},{key:"onLeaveSelection",value:function(){this.rootNode&&this.rootNode.removeAttribute("data-is-selected")}},{key:"updateAccessibilityTabIndexes",value:function(){var e=this._static().getConfiguration();if(e&&T.r.NONE!==e.accessibilityFields&&T.r.OTHER!==e.accessibilityFields&&null!==e.accessibilityFields){var t=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);(e.accessibilityFields&T.r.ROOT_NODE)===T.r.ROOT_NODE&&(t?this.rootNode&&(this.rootNode.tabIndex=0):this.rootNode&&this.rootNode.removeAttribute("tabindex")),(e.accessibilityFields&T.r.ERROR_NODE)===T.r.ERROR_NODE&&(t?this.errorDOMNode&&(this.errorDOMNode.tabIndex=0):this.errorDOMNode&&this.errorDOMNode.removeAttribute("tabindex"))}}},{key:"onFocusEnter",value:function(){}},{key:"onFocusLeave",value:function(){}},{key:"enumerateTranslations",value:function(){return[]}},{key:"isChildOf",value:function(e,t){if(t&&this.getTypeId()===e)return!0;for(var n=this.getParent();n&&n.getTypeId()!==C.a.ELEMENT_TYPE_FORM;){if(n.getTypeId()===e)return!0;n=n.getParent()}return!1}},{key:"getFirstParentOfType",value:function(e){for(var t=this.getParent();t&&t.getTypeId()!==C.a.ELEMENT_TYPE_FORM;){if(t.getTypeId()===e)return t;t=t.getParent()}return null}}]),n}(b.a);function en(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Zt,"BACKEND_ERR_INVALID_SETTINGS",1e3),v()(Zt,"BACKEND_ERR_VALUE_IS_REQUIRED",1001),v()(Zt,"BACKEND_ERR_INVALID_VALUE_FORMAT",1002),v()(Zt,"BACKEND_ERR_INVALID_VALUE",1003),v()(Zt,"BACKEND_ERR_FATAL_FORM_GENERIC_EXCEPTION",2e3),v()(Zt,"BACKEND_ERR_FATAL_FORM_IS_INACTIVE",2001),v()(Zt,"BACKEND_ERR_FATAL_FORM_IS_UNAVAILABLE",2002),v()(Zt,"BACKEND_ERR_FATAL_INVALID_FORM_DOMAIN",2003),v()(Zt,"BACKEND_ERR_FATAL_FORM_GENERAL_MAINTENANCE",2004),v()(Zt,"BACKEND_ERR_UNKNOWN_LEGACY",1e4),v()(Zt,"NET_ERR_FATAL_SUBMISSION_BAD_RESPONSE",2099),v()(Zt,"ALL_BACKEND_ERRORS",[Zt.BACKEND_ERR_INVALID_SETTINGS,Zt.BACKEND_ERR_VALUE_IS_REQUIRED,Zt.BACKEND_ERR_INVALID_VALUE_FORMAT,Zt.BACKEND_ERR_INVALID_VALUE,Zt.BACKEND_ERR_FATAL_FORM_GENERIC_EXCEPTION,Zt.BACKEND_ERR_FATAL_FORM_IS_INACTIVE,Zt.BACKEND_ERR_FATAL_FORM_IS_UNAVAILABLE,Zt.BACKEND_ERR_FATAL_INVALID_FORM_DOMAIN,Zt.BACKEND_ERR_FATAL_FORM_GENERAL_MAINTENANCE,Zt.NET_ERR_FATAL_SUBMISSION_BAD_RESPONSE,Zt.BACKEND_ERR_UNKNOWN_LEGACY]),v()(Zt,"HASH_UID",0);var tn=function(e){g()(n,e);var t=en(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"synchronizationEnabled",!0),v()(c()(r),"visible",void 0),v()(c()(r),"readOnly",void 0),v()(c()(r),"disabled",void 0),v()(c()(r),"changeByRulesDebouncer",void 0),v()(c()(r),"hasSuggestions",!1),r.changeByRulesDebouncer=O.a.create((function(){r.emulateUserInput()}),100),r.on("change.rules",(function(){r.changeByRulesDebouncer()})),r}return l()(n,[{key:"createRootNodeElement",value:function(){this.rootNode=document.createElement("div"),this.rootNode.setAttribute("data-role","control"),this.rootNode.setAttribute("data-type",this._static().nodeName),this.rootNode.setAttribute("data-hash",this.getHash()),this.rootNode.setAttribute("data-type-id",String(this.getTypeId())),this.rootNode.setAttribute("data-colspan",String(this.getColspan())),this.updateLabelItalicState(),this.updateLabelBoldState(),this.updateLabelHiddenState()}},{key:"serialize",value:function(){return[this.getTypeId(),this.getId(),this.getHash(),this.properties||null,this.errors||null,null,this.getColspan(),this.getHeight()]}},{key:"getElementKind",value:function(){return T.m.CONTROL}},{key:"withErrors",value:function(e){return p()(E()(n.prototype),"withErrors",this).call(this,e),this.updateErrorsText(),this}},{key:"addError",value:function(e,t,i,r){var a=p()(E()(n.prototype),"addError",this).call(this,e,t,i,r);return a&&this.updateErrorsText(),a}},{key:"removeError",value:function(e){var t=p()(E()(n.prototype),"removeError",this).call(this,e);return t&&this.updateErrorsText(),t}},{key:"removeAllBackendErrors",value:function(){var e=p()(E()(n.prototype),"removeAllBackendErrors",this).call(this);return e&&this.updateErrorsText(),e}},{key:"getSupportedValidators",value:function(){return null}},{key:"getResizingCapability",value:function(){return T.K.LEFT_AND_RIGHT}},{key:"getMinColspan",value:function(){return 2}},{key:"getValue",value:function(){if(this.hasAttribute("value")){for(var e,t={},n=this.enumerateProperties()||[],i=0,r=n.length;i<r;i++)(e=/^value\.(.*)$/.exec(n[i].name))&&!n[i].virtual&&(t[e[1]]=this.getProperty(n[i].name));return t}}},{key:"onValueChanged",value:function(){}},{key:"synchronizeValue",value:function(){console.warn("synchronize value")}},{key:"setValue",value:function(e){if(!this.hasAttribute("value"))throw new Error("This control does not support a value");if("object"!==r()(e))throw new Error("Invalid argument: object expected!");var t;this.synchronizationEnabled=!1;try{for(var n=this.enumerateProperties()||[],i=0,a=n.length;i<a;i++)if(t=/^value\.(.*)$/.exec(n[i].name))if(n[i].optional)void 0!==e[t[1]]?this.setProperty(n[i].name,e[t[1]]):this.setProperty(n[i].name,null);else{if(void 0===e[t[1]])throw new Error("Property ".concat(JSON.stringify(t[1])," is not present in value object!"));this.setProperty(n[i].name,e[t[1]])}}catch(o){throw this.synchronizationEnabled=!0,o}this.synchronizeValue()}},{key:"isReadOnly",value:function(e){return null===e&&(void 0===this.readOnly||!0===this.readOnly)}},{key:"setReadOnly",value:function(e,t){if(this.readOnly=!!t,this.readOnly){this.rootNode.setAttribute("data-is-readonly","");for(var n=0,i=this.rootNode.querySelectorAll("input, select, textarea"),r=i.length;n<r;n++)i[n].readOnly=!0}else{this.rootNode.removeAttribute("data-is-readonly");for(var a=0,o=this.rootNode.querySelectorAll("input, select, textarea"),s=o.length;a<s;a++)o[a].readOnly=!1}}},{key:"isDisabled",value:function(e){return null===e&&(void 0===this.disabled||!0===this.disabled)}},{key:"setDisabled",value:function(e,t){null===e&&(this.disabled=!!t,this.disabled?this.getRootNode().setAttribute("data-is-disabled",""):this.getRootNode().removeAttribute("data-is-disabled"))}},{key:"isVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.visible||e?void 0===this.visible||this.visible:!(this.hasProperty("options.hidden")&&this.getProperty("options.hidden"))}},{key:"setVisible",value:function(e){e=!!e,this.visible=e,this.visible?(this.getRootNode().removeAttribute("data-is-hidden"),this.getForm().getEngine().getLoader().execCommand("control-has-changed-visibility",{controlId:this.getId(),visibility:this.visible,element:this})):this.getRootNode().setAttribute("data-is-hidden",""),jt.refreshFrameHeightOnWix()}},{key:"enumerateIndexes",value:function(){return null}},{key:"getMinInputRowWidth",value:function(){return 2}},{key:"isRenderingSupported",value:function(){return!0}},{key:"onReset",value:function(){console.warn("reset: not implemented on ",this)}},{key:"getValueInterfaceName",value:function(){try{return this._static().attributes.value.type}catch(e){return null}}},{key:"hasValueCompatibleWith",value:function(e){if(e&&T.m.CONTROL===e.getElementKind()){var t=e.getValueInterfaceName(),n=e.getTypeId(),i=e&&e.hasProperty("validation.type")&&e.getProperty("validation.type")||null;return null!==t&&(t===this.getValueInterfaceName()?n===C.a.CONTROL_TYPE_WEBSITE?this.getTypeId()===C.a.CONTROL_TYPE_WEBSITE||this.getTypeId()===C.a.CONTROL_TYPE_TEXT&&this.hasProperty("validation.type")&&!this.getProperty("validation.type"):n===C.a.CONTROL_TYPE_EMAIL?this.getTypeId()===C.a.CONTROL_TYPE_EMAIL||this.getTypeId()===C.a.CONTROL_TYPE_TEXT&&this.hasProperty("validation.type")&&!this.getProperty("validation.type"):n!==C.a.CONTROL_TYPE_TEXT||(this.getTypeId()===C.a.CONTROL_TYPE_TEXT&&i&&i===this.getProperty("validation.type")||this.hasProperty("validation.type")&&!this.getProperty("validation.type")||!i):n===C.a.CONTROL_TYPE_NUMBER?this.getTypeId()===C.a.CONTROL_TYPE_TEXT&&this.hasProperty("validation.type")&&!this.getProperty("validation.type"):n===C.a.CONTROL_TYPE_TEXT&&(this.getTypeId()===C.a.CONTROL_TYPE_NUMBER&&!i))}}},{key:"displayValidationUpgradePopupIfNeeded",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.hasProperty("validation.type")){var t=this.getProperty("validation.type");if(null!==t&&t!==e){var n=this.getForm().getEngine().getValidator(),i=n.getValidatorById(t);null!==i&&(i.isSupported||(this.setProperty("validation.type",null),this.getForm().getEngine().getLoader().execCommand("show-validator-upgrade-dialog")))}}}},{key:"emulateUserInput",value:function(){}}]),n}(Zt);function nn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var rn=function(e){g()(n,e);var t=nn(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"onSynchronizeWithControlIdPropertyChanged",value:function(){for(var e=this.getForm().flatten(),t=0,n=e.length;t<n;t++)this.hasProperty("synchronize.withControlId")&&e[t].hasProperty("synchronize.withControlId")&&(e[t].getProperty("synchronize.withControlId")===this.getId()&&this.getProperty("synchronize.withControlId")!==e[t].getId()&&(e[t].setProperty("synchronize.enabled",!1),e[t].setProperty("synchronize.withControlId",null)),e[t].getId()===this.getProperty("synchronize.withControlId")&&(e[t].setProperty("synchronize.enabled",this.getProperty("synchronize.enabled")),e[t].setProperty("synchronize.withControlId",this.getId())))}},{key:"onSynchronizeEnabledPropertyChanged",value:function(){if(this.hasProperty("synchronize.enabled")&&this.hasProperty("synchronize.withControlId")&&this.getProperty("synchronize.withControlId"))for(var e=this.getForm().flatten(),t=0,n=e.length;t<n;t++)e[t].hasProperty("synchronize.withControlId")&&e[t].getProperty("synchronize.withControlId")===this.getId()&&e[t].setProperty("synchronize.enabled",this.getProperty("synchronize.enabled"))}},{key:"checkIfElementValueIsSynchronized",value:function(){if(this.hasProperty("value.value")&&this.getProperty("value.value")&&this.hasProperty("synchronize.enabled")&&this.getProperty("synchronize.enabled")&&this.hasProperty("synchronize.withControlId")&&this.getProperty("synchronize.withControlId"))for(var e=this.getForm().flatten(),t=0,n=e.length;t<n;t++)if(e[t].hasProperty("synchronize.enabled")&&e[t].getProperty("synchronize.enabled")&&e[t].hasProperty("synchronize.withControlId")&&e[t].hasProperty("value.value")&&e[t].getProperty("value.value")&&this.getId()===e[t].getProperty("synchronize.withControlId")){var i=e[t].getProperty("value.value"),r=this.getProperty("value.value");r!==i&&String(r||"")!==String(i||"")?this.addError(Dt.ERR_CONTROL_VALUES_DONT_MATCH,this.getForm().getEngine().getI18n().translateText("textdef_86",this.getProperty("label.labelText"),e[t].getProperty("label.labelText"))||"".concat(this.getProperty("label.labelText")," and ").concat(e[t].getProperty("label.labelText")," field values must be identical!")):(this.removeError(Dt.ERR_CONTROL_VALUES_DONT_MATCH),e[t].removeError(Dt.ERR_CONTROL_VALUES_DONT_MATCH),this.removeAllBackendErrors(),e[t].removeAllBackendErrors())}}}]),n}(tn);function an(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var on=function(e){g()(n,e);var t=an(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_ACTION_BAR}},{key:"getElementName",value:function(){var e=this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_action_bar_name");return e&&"edt_UI_control_type_action_bar_name"!==e?e:"Action bar"}},{key:"isRemovable",value:function(){return!1}},{key:"setRendererType",value:function(e){}},{key:"onCreated",value:function(){this.updateDOMAttributes()}},{key:"updateDOMAttributes",value:function(){this.hasProperty("configuration.buttonsPosition")&&this.rootNode.setAttribute("data-buttons-position",String(this.getProperty("configuration.buttonsPosition")||0))}},{key:"getResizingCapability",value:function(){return T.K.NONE}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"isDuplicatable",value:function(){return!1}},{key:"getConfigurableButtons",value:function(){var e=[];return this.getProperty("configuration.hasApproveButton")&&e.push(String(T.b.APPROVE)),this.getProperty("configuration.hasCalculateButton")&&e.push(String(T.b.CALCULATE)),this.getProperty("configuration.hasPreviewButton")&&e.push(String(T.b.PREVIEW)),this.getProperty("configuration.hasPrintButton")&&e.push(String(T.b.PRINT)),this.getProperty("configuration.hasResetButton")&&e.push(String(T.b.RESET)),this.getProperty("configuration.hasSaveForLaterButton")&&e.push(String(T.b.SAVE_FOR_LATER)),this.getProperty("configuration.hasPurchaseButton")&&e.push(String(T.b.PURCHASE)),e}},{key:"setConfigurableButtons",value:function(e){for(var t=[],n=0,i=(e=e||[]).length;n<i;n++)t.push(~~e[n]);this.setProperty("configuration.hasApproveButton",t.indexOf(T.b.APPROVE)>-1),this.setProperty("configuration.hasCalculateButton",t.indexOf(T.b.CALCULATE)>-1),this.setProperty("configuration.hasPreviewButton",t.indexOf(T.b.PREVIEW)>-1),this.setProperty("configuration.hasPrintButton",t.indexOf(T.b.PRINT)>-1),this.setProperty("configuration.hasResetButton",t.indexOf(T.b.RESET)>-1),this.setProperty("configuration.hasSaveForLaterButton",t.indexOf(T.b.SAVE_FOR_LATER)>-1),this.setProperty("configuration.hasPurchaseButton",t.indexOf(T.b.PURCHASE)>-1)}},{key:"getProperty",value:function(e){switch(e){case"configuration.hasSubmitButton":return!(p()(E()(n.prototype),"getProperty",this).call(this,"configuration.hasUpdateButton")||p()(E()(n.prototype),"getProperty",this).call(this,"configuration.hasApproveButton"));case"configuration.hasNextButton":case"configuration.hasPreviousButton":return this.getForm().getNumberOfPages()>1;case"configuration.hasPurchaseButton":return this.getForm().getHasPaymentSummaryPage();case"configuration.hasPreviewButton":return this.getForm().getEngine().getLoader().getLoaderDependency(T.A.FORM_SETTINGS).allowPreviewMode;case"configuration.hasCalculateButton":return this.getForm().getEngine().getLoader().getLoaderDependency(T.A.HAS_CALCULATE_BUTTON);default:return p()(E()(n.prototype),"getProperty",this).call(this,e)}}},{key:"onReset",value:function(){}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"onEnterSelection",value:function(){p()(E()(n.prototype),"onEnterSelection",this).call(this);var e=this.getForm().getEngine().getLoader().getFormSettings(),t="undefined"!==typeof e.autoSubmit&&!0===e.autoSubmit?1:0;!function(e,n){e(n).find("[data-role=control][data-type=form-action-bar]").attr("data-is-selected","1"),setTimeout((function(){e('div[data-role="editor-panel"][data-target-element-type="action bar"]').attr("data-autosubmit-enabled",t)}),500)}(this.getForm().getEngine().getJQuery(),this.getForm().getRootNode())}},{key:"onLeaveSelection",value:function(){p()(E()(n.prototype),"onLeaveSelection",this).call(this),function(e,t){e(t).find("[data-role=control][data-type=form-action-bar]").removeAttr("data-is-selected")}(this.getForm().getEngine().getJQuery(),this.getForm().getRootNode())}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getForm().getEngine().getI18n();return e.push({key:"SendButton",sourceText:this.getProperty("label.submitButtonText")||t.translateText("form_sendDefaultText")}),e.push({key:"textdef_136",sourceText:t.translateText("textdef_136")}),e.push({key:"textdef_254",sourceText:this.getProperty("label.autoSubmitButtonText")||t.translateText("textdef_254")}),e.push({key:"textdef_201",sourceText:this.getProperty("label.resetButtonText")||t.translateText("textdef_201")}),e.push({key:"textdef_84",sourceText:t.translateText("textdef_84")}),e}}],[{key:"getConfiguration",value:function(){return null}}]),n}(tn);function sn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(on,"nodeName","form-action-bar"),v()(on,"attributes",{}),v()(on,"runtime",null);var ln=function(e){g()(n,e);var t=sn(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"streetAddress1DOMNode",void 0),v()(c()(r),"streetAddress2DOMNode",void 0),v()(c()(r),"cityDOMNode",void 0),v()(c()(r),"regionDOMNode",void 0),v()(c()(r),"zipCodeDOMNode",void 0),v()(c()(r),"countryDOMNode",void 0),v()(c()(r),"valueUpdateInterval",void 0),v()(c()(r),"syncCallback",void 0),v()(c()(r),"syncMapControl",!1);var a=r.getHash();return r.rootNode.setAttribute("aria-labelledby","address-".concat(a,"-acc ")+"address-".concat(a,"-error-acc ")+"address-".concat(a,"-instr-acc")),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","address-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","address-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","address-".concat(a,"-instr-acc")),r.streetAddress1DOMNode=document.createElement("input"),r.streetAddress1DOMNode.setAttribute("type","text"),r.streetAddress1DOMNode.setAttribute("data-role","i123-input"),r.streetAddress1DOMNode.setAttribute("data-index",String(n.INDEX_STREET_ADDRESS_1)),r.streetAddress1DOMNode.placeholder="Address 1",r.streetAddress1DOMNode.setAttribute("data-i18n-placeholder","textdef_24"),r.streetAddress2DOMNode=document.createElement("input"),r.streetAddress2DOMNode.setAttribute("type","text"),r.streetAddress2DOMNode.setAttribute("data-role","i123-input"),r.streetAddress2DOMNode.setAttribute("data-index",String(n.INDEX_STREET_ADDRESS_2)),r.streetAddress2DOMNode.placeholder="Address 2",r.streetAddress2DOMNode.setAttribute("data-i18n-placeholder","textdef_25"),r.cityDOMNode=document.createElement("input"),r.cityDOMNode.setAttribute("type","text"),r.cityDOMNode.setAttribute("data-role","i123-input"),r.cityDOMNode.setAttribute("data-index",String(n.INDEX_CITY)),r.cityDOMNode.setAttribute("data-i18n-placeholder","textdef_26"),r.cityDOMNode.placeholder="City",r.zipCodeDOMNode=document.createElement("input"),r.zipCodeDOMNode.setAttribute("type","text"),r.zipCodeDOMNode.setAttribute("data-role","i123-input"),r.zipCodeDOMNode.setAttribute("data-index",String(n.INDEX_ZIPCODE)),r.zipCodeDOMNode.setAttribute("data-i18n-placeholder","textdef_28"),r.zipCodeDOMNode.placeholder="Zip Code",r.countryDOMNode=Bt.createElement(Bt.ELEMENT_TYPE_SEARCHABLE_DROPDOWN),r.countryDOMNode.setAttribute("data-role","i123-input"),r.countryDOMNode.setAttribute("data-index",String(n.INDEX_COUNTRY)),r.countryDOMNode.setAttribute("data-i18n-placeholder","textdef_29"),r.countryDOMNode.setAttribute("placeholder","Country"),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_ADDRESS}},{key:"getElementName",value:function(){return"Address"}},{key:"getInputDOMNodes",value:function(){var e=this.getProperty("configuration.fieldAddress1"),t=this.getProperty("configuration.fieldAddress2"),n=this.getProperty("configuration.fieldCity"),i=this.getProperty("configuration.fieldZone"),r=this.getProperty("configuration.fieldZipCode"),a=this.getProperty("configuration.fieldCountry"),o="".concat(~~n).concat(~~i).concat(~~r).concat(~~a),s=[];switch(e&&s.push({inputs:[{input:this.streetAddress1DOMNode,width:T.y.FULL}]}),t&&s.push({inputs:[{input:this.streetAddress2DOMNode,width:T.y.FULL}]}),o){case"0000":break;case"0001":s.push({inputs:[{input:this.countryDOMNode,width:T.y.FULL}]});break;case"0010":s.push({inputs:[{input:this.zipCodeDOMNode,width:T.y.FULL}]});break;case"0011":s.push({inputs:[{input:this.zipCodeDOMNode,width:T.y.HALF},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"0100":s.push({inputs:[{input:this.regionDOMNode,width:T.y.FULL}]});break;case"0101":s.push({inputs:[{input:this.regionDOMNode,width:T.y.HALF},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"0110":s.push({inputs:[{input:this.regionDOMNode,width:T.y.FILL},{input:this.zipCodeDOMNode,width:T.y.HALF}]});break;case"0111":s.push({inputs:[{input:this.regionDOMNode,width:T.y.THIRD},{input:this.zipCodeDOMNode,width:T.y.THIRD},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"1000":s.push({inputs:[{input:this.cityDOMNode,width:T.y.FULL}]});break;case"1001":s.push({inputs:[{input:this.cityDOMNode,width:T.y.HALF},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"1010":s.push({inputs:[{input:this.cityDOMNode,width:T.y.FILL},{input:this.zipCodeDOMNode,width:T.y.HALF}]});break;case"1011":s.push({inputs:[{input:this.cityDOMNode,width:T.y.THIRD},{input:this.zipCodeDOMNode,width:T.y.THIRD},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"1100":s.push({inputs:[{input:this.cityDOMNode,width:T.y.FILL},{input:this.regionDOMNode,width:T.y.HALF}]});break;case"1101":s.push({inputs:[{input:this.cityDOMNode,width:T.y.THIRD},{input:this.regionDOMNode,width:T.y.THIRD},{input:this.countryDOMNode,width:T.y.FILL}]});break;case"1110":s.push({inputs:[{input:this.cityDOMNode,width:T.y.FILL},{input:this.regionDOMNode,width:T.y.THIRD},{input:this.zipCodeDOMNode,width:T.y.THIRD}]});break;case"1111":s.push({inputs:[{input:this.cityDOMNode,width:T.y.HALF},{input:this.regionDOMNode,width:T.y.FILL}]}),s.push({inputs:[{input:this.zipCodeDOMNode,width:T.y.HALF},{input:this.countryDOMNode,width:T.y.FILL}]})}return s}},{key:"configureRegionDOMNode",value:function(){var e,t=this.getProperty("configuration.addressStyle"),i=this.getForm().getEngine().getGeolocation(),r=null;switch(t){case n.ADDRESS_STYLE_US:r=i.getCountryByISOCode("US").regions;break;case n.ADDRESS_STYLE_UNITED_KINGDOM:r=i.getCountryByISOCode("GB").regions;break;case n.ADDRESS_STYLE_CANADA:r=i.getCountryByISOCode("CA").regions;break;case n.ADDRESS_STYLE_AUSTRALIA:r=i.getCountryByISOCode("AU").regions}if(null===r)this.regionDOMNode=document.createElement("input"),this.regionDOMNode.setAttribute("type","text");else{this.regionDOMNode=Bt.createElement(Bt.ELEMENT_TYPE_SEARCHABLE_DROPDOWN);for(var a=0,o=r.length;a<o;a++)e=gt.create(this.countryDOMNode,r[a],r[a]),this.regionDOMNode.add(e)}this.regionDOMNode.setAttribute("data-role","i123-input"),this.regionDOMNode.setAttribute("data-index",String(n.INDEX_REGION))}},{key:"populateCountryDOMNode",value:function(){var e,t,i=this.getProperty("configuration.addressStyle"),r=this.getForm().getEngine().getGeolocation(),a=this.getProperty("configuration.countries")||null;switch((null!==a&&0===a.length||a&&1===a.length&&!a[0])&&(a=null),i){case n.ADDRESS_STYLE_US:e=[r.getCountryByISOCode("US")];break;case n.ADDRESS_STYLE_UNITED_KINGDOM:e=[r.getCountryByISOCode("GB")];break;case n.ADDRESS_STYLE_CANADA:e=[r.getCountryByISOCode("CA")];break;case n.ADDRESS_STYLE_AUSTRALIA:e=[r.getCountryByISOCode("AU")];break;case n.ADDRESS_STYLE_ANY:default:e=r.getCountriesList();var o=JSON.parse(JSON.stringify(this.getProperty("configuration.countries")).toLowerCase());Array.isArray(o)&&o.length&&(e=e.filter((function(e){return o.indexOf(e.code.toLowerCase())>-1||o.indexOf(e.name.toLowerCase())>-1})))}for(;this.countryDOMNode.getOptions().length;)this.countryDOMNode.remove(0);(t=gt.create(this.countryDOMNode,null,null)).value="",t.text="Country",t.setAttribute("data-i18n-text","textdef_29"),this.countryDOMNode.add(t);for(var s=0,l=e.length;s<l;s++)t=gt.create(this.countryDOMNode,e[s].code,e[s].name),this.countryDOMNode.add(t)}},{key:"setDefaultCountry",value:function(){var e=this.getProperty("configuration.defaultCountry"),t=this.countryDOMNode.getOptions(),n=this.getForm().getEngine().getGeolocation();if(e){for(var i=0,r=t.length;i<r;i++)if(e===t[i].value){this.countryDOMNode.setValue(e),this.setProperty("value.country",e),this.synchronizeValue();break}}else{var a=n.getUserCountryCode();this.countryDOMNode.setValue(a),this.setProperty("value.country",a),this.synchronizeValue()}}},{key:"updateCountry",value:function(e){var t=this.getForm().getEngine().getGeolocation(),n=t.getCorrectedCountryName(e),i=t.getCountryISOCodeByCountryName(n);this.countryDOMNode.setValue(i),this.setProperty("value.country",i)}},{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.configureRegionDOMNode(),this.updateZoneLabelPlaceholder(),this.populateCountryDOMNode(),this.updatePostalCodeLabelPlaceholder(),this.clearValue(),this.setDefaultCountry(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.synchronizeValue(),setTimeout((function(){e.getForm().getEngine().getI18n().translateDOMNode(e.rootNode)}),50)}},{key:"onValueChanged",value:function(){this.setProperty("value.address1",this.streetAddress1DOMNode.value||null),this.setProperty("value.address2",this.streetAddress2DOMNode.value||null),this.setProperty("value.city",this.cityDOMNode.value||null),A()(this.regionDOMNode,HTMLInputElement)?this.setProperty("value.zone",this.regionDOMNode.value||null):this.setProperty("value.zone",this.regionDOMNode.getValue()||null),this.setProperty("value.zipCode",this.zipCodeDOMNode.value||null),this.setProperty("value.country",this.countryDOMNode.getValue()||null),this.updateFieldsWithErrors(),this.onValueUpdated()}},{key:"setSyncronizeCallback",value:function(e){this.syncCallback=e}},{key:"onValueUpdated",value:function(){var e;e=this,clearInterval(e.valueUpdateInterval),e.valueUpdateInterval=setTimeout((function(){null!==e.syncCallback&&e.syncMapControl&&e.syncCallback()}),1e3)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.streetAddress1DOMNode,this.getProperty("value.address1")),jt.synchronizeControlValue(this.streetAddress2DOMNode,this.getProperty("value.address2")),jt.synchronizeControlValue(this.cityDOMNode,this.getProperty("value.city")),jt.synchronizeControlValue(this.regionDOMNode,this.getProperty("value.zone")),jt.synchronizeControlValue(this.zipCodeDOMNode,this.getProperty("value.zipCode")),jt.synchronizeControlValue(this.countryDOMNode,this.getProperty("value.country"))}},{key:"updateFieldsWithErrors",value:function(){if(this.streetAddress1DOMNode.hasAttribute("data-field-with-error")&&this.streetAddress1DOMNode.removeAttribute("data-field-with-error"),this.streetAddress2DOMNode.hasAttribute("data-field-with-error")&&this.streetAddress2DOMNode.removeAttribute("data-field-with-error"),this.cityDOMNode.hasAttribute("data-field-with-error")&&this.cityDOMNode.removeAttribute("data-field-with-error"),this.regionDOMNode.hasAttribute("data-field-with-error")&&this.regionDOMNode.removeAttribute("data-field-with-error"),this.zipCodeDOMNode.hasAttribute("data-field-with-error")&&this.zipCodeDOMNode.removeAttribute("data-field-with-error"),this.countryDOMNode.hasAttribute("data-field-with-error")&&this.countryDOMNode.removeAttribute("data-field-with-error"),this.errors)for(var e=0,t=this.errors.length;e<t;e++)switch(this.errors[e].propertyName){case"value.address1":this.streetAddress1DOMNode.setAttribute("data-field-with-error","1");break;case"value.address2":this.streetAddress2DOMNode.setAttribute("data-field-with-error","1");break;case"value.city":this.cityDOMNode.setAttribute("data-field-with-error","1");break;case"value.zone":this.regionDOMNode.setAttribute("data-field-with-error","1");break;case"value.zipCode":this.zipCodeDOMNode.setAttribute("data-field-with-error","1");break;case"value.country":this.countryDOMNode.setAttribute("data-field-with-error","1")}}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case n.INDEX_STREET_ADDRESS_1:return{targetPropertyFQN:"value.address1",optional:!0,type:"string"};case n.INDEX_STREET_ADDRESS_2:return{targetPropertyFQN:"value.address2",optional:!0,type:"string"};case n.INDEX_CITY:return{targetPropertyFQN:"value.city",optional:!0,type:"string"};case n.INDEX_REGION:return{targetPropertyFQN:"value.zone",optional:!0,type:"string"};case n.INDEX_ZIPCODE:return{targetPropertyFQN:"value.zipCode",optional:!0,type:"string"};case n.INDEX_COUNTRY:return{targetPropertyFQN:"value.fullCountryName",optional:!0,type:"string"};default:return null}}},{key:"enumerateIndexes",value:function(){return[n.INDEX_STREET_ADDRESS_1,n.INDEX_STREET_ADDRESS_2,n.INDEX_CITY,n.INDEX_REGION,n.INDEX_ZIPCODE,n.INDEX_COUNTRY]}},{key:"getMinInputRowWidth",value:function(){return 12}},{key:"getRequiredFields",value:function(){var e=[],t=0;return this.getProperty("configuration.fieldAddress1")&&this.getProperty("options.isRequiredFieldAddress1")&&(e.push(T.c.ADDRESS_1),t++),this.getProperty("configuration.fieldAddress2")&&this.getProperty("options.isRequiredFieldAddress2")&&(e.push(T.c.ADDRESS_2),t++),this.getProperty("configuration.fieldCity")&&this.getProperty("options.isRequiredFieldCity")&&(e.push(T.c.CITY),t++),this.getProperty("configuration.fieldZone")&&this.getProperty("options.isRequiredFieldZone")&&(e.push(T.c.ZONE),t++),this.getProperty("configuration.fieldZipCode")&&this.getProperty("options.isRequiredFieldZipCode")&&(e.push(T.c.ZIP_CODE),t++),this.getProperty("configuration.fieldCountry")&&this.getProperty("options.isRequiredFieldCountry")&&(e.push(T.c.COUNTRY),t++),6===t&&e.push(T.c.ALL),e}},{key:"setRequiredFields",value:function(e){if(e)for(var t=0,n=e.length;t<n;t++)e[t]=~~e[t];e&&e.length?(this.setProperty("options.isRequiredFieldAddress1",e.indexOf(T.c.ADDRESS_1)>-1),this.setProperty("options.isRequiredFieldAddress2",e.indexOf(T.c.ADDRESS_2)>-1),this.setProperty("options.isRequiredFieldCity",e.indexOf(T.c.CITY)>-1),this.setProperty("options.isRequiredFieldZone",e.indexOf(T.c.ZONE)>-1),this.setProperty("options.isRequiredFieldZipCode",e.indexOf(T.c.ZIP_CODE)>-1),this.setProperty("options.isRequiredFieldCountry",e.indexOf(T.c.COUNTRY)>-1),this.setProperty("options.required",e.length>0)):(this.setProperty("options.isRequiredFieldAddress1",!1),this.setProperty("options.isRequiredFieldAddress2",!1),this.setProperty("options.isRequiredFieldCity",!1),this.setProperty("options.isRequiredFieldZone",!1),this.setProperty("options.isRequiredFieldZipCode",!1),this.setProperty("options.isRequiredFieldCountry",!1),this.setProperty("options.required",!1))}},{key:"getAllowedFields",value:function(){var e=[];return this.getProperty("configuration.fieldAddress1")&&e.push(T.c.ADDRESS_1),this.getProperty("configuration.fieldAddress2")&&e.push(T.c.ADDRESS_2),this.getProperty("configuration.fieldCity")&&e.push(T.c.CITY),this.getProperty("configuration.fieldZone")&&e.push(T.c.ZONE),this.getProperty("configuration.fieldZipCode")&&e.push(T.c.ZIP_CODE),this.getProperty("configuration.fieldCountry")&&e.push(T.c.COUNTRY),e}},{key:"setAllowedFields",value:function(e){if(e)for(var t=0,n=e.length;t<n;t++)e[t]=~~e[t];!e||!e.length||1===e.length&&e[0]===T.c.ALL?(this.setProperty("configuration.fieldAddress1",!0),this.setProperty("configuration.fieldAddress2",!0),this.setProperty("configuration.fieldCity",!0),this.setProperty("configuration.fieldZone",!0),this.setProperty("configuration.fieldZipCode",!0),this.setProperty("configuration.fieldCountry",!0)):(this.setProperty("configuration.fieldAddress1",e.indexOf(T.c.ADDRESS_1)>-1),this.setProperty("configuration.fieldAddress2",e.indexOf(T.c.ADDRESS_2)>-1),this.setProperty("configuration.fieldCity",e.indexOf(T.c.CITY)>-1),this.setProperty("configuration.fieldZone",e.indexOf(T.c.ZONE)>-1),this.setProperty("configuration.fieldZipCode",e.indexOf(T.c.ZIP_CODE)>-1),this.setProperty("configuration.fieldCountry",e.indexOf(T.c.COUNTRY)>-1)),this.reRender()}},{key:"updateZoneLabelPlaceholder",value:function(){var e=this.getProperty("configuration.zoneLabel");switch(this.getProperty("configuration.addressStyle")){case n.ADDRESS_STYLE_US:case n.ADDRESS_STYLE_AUSTRALIA:case n.ADDRESS_STYLE_CANADA:e="state";break;case n.ADDRESS_STYLE_UNITED_KINGDOM:e="region"}switch(e){case"region":this.regionDOMNode.setAttribute("data-i18n-placeholder","textdef_27"),this.regionDOMNode.setAttribute("placeholder","Region");break;case"county":this.regionDOMNode.setAttribute("data-i18n-placeholder","textdef_202"),this.regionDOMNode.setAttribute("placeholder","County");break;case"state":default:this.regionDOMNode.setAttribute("placeholder","State"),this.regionDOMNode.setAttribute("data-i18n-placeholder","textdef_74")}this.getForm().getEngine().getI18n().translateDOMNode(this.rootNode)}},{key:"updatePostalCodeLabelPlaceholder",value:function(){switch(this.getProperty("configuration.postalCodeLabel")){case"zipCode":this.zipCodeDOMNode.setAttribute("placeholder","Zip Code"),this.zipCodeDOMNode.setAttribute("data-i18n-placeholder","textdef_125");break;case"postalCode":this.zipCodeDOMNode.setAttribute("placeholder","Postal Code"),this.zipCodeDOMNode.setAttribute("data-i18n-placeholder","textdef_239");break;case"postalZipCode":default:this.zipCodeDOMNode.setAttribute("placeholder","Postal/Zip Code"),this.zipCodeDOMNode.setAttribute("data-i18n-placeholder","textdef_28")}this.getForm().getEngine().getI18n().translateDOMNode(this.rootNode)}},{key:"onReset",value:function(){this.setValue({address1:null,address2:null,city:null,country:null,zipCode:null,zone:null})}},{key:"setupDefaults",value:function(){this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_address_name"));var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DEFAULT_USER_PREFERENCES);return e&&(this.setProperty("configuration.postalCodeLabel",e.postalZipCodeFormat),this.updatePostalCodeLabelPlaceholder()),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"getFullCountryName",value:function(){var e=this.getProperty("value.country");return e?this.getForm().getEngine().getGeolocation().getCountryNameByISOCode(e):""}},{key:"setCountryByCountryName",value:function(e){var t=this.getForm().getEngine().getGeolocation().getCountryISOCodeByCountryName(e);t?this.setProperty("value.country",t):this.setProperty("value.country",null)}},{key:"setCountryByCountryCode",value:function(e){e?this.setProperty("value.country",e):this.setProperty("value.country",null)}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"setMapSync",value:function(e){this.syncMapControl=e}},{key:"emulateUserInput",value:function(){var e=this;!function(t){t([e.streetAddress1DOMNode,e.streetAddress2DOMNode,e.cityDOMNode,e.zipCodeDOMNode]).trigger("input"),e.countryDOMNode&&e.countryDOMNode.trigger("change")}(this.getForm().getEngine().getJQuery())}},{key:"clearValue",value:function(){this.setProperty("value.address1",null),this.setProperty("value.address2",null),this.setProperty("value.city",null),this.setProperty("value.zipCode",null),this.setProperty("value.zone",null)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_ADDRESS,name:"Address",isContainer:!1,category:"advanced",keywords:"address street",icon:"i123-address",isVirtual:!1,i18nName:"edt_UI_control_type_address_name",i18nKeywords:"edt_UI_control_type_address_keywords",index:120,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);function un(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(ln,"INDEX_STREET_ADDRESS_1",1),v()(ln,"INDEX_STREET_ADDRESS_2",2),v()(ln,"INDEX_CITY",3),v()(ln,"INDEX_REGION",4),v()(ln,"INDEX_ZIPCODE",5),v()(ln,"INDEX_COUNTRY",6),v()(ln,"ADDRESS_STYLE_ANY","all"),v()(ln,"ADDRESS_STYLE_US","us"),v()(ln,"ADDRESS_STYLE_CANADA","ca"),v()(ln,"ADDRESS_STYLE_AUSTRALIA","au"),v()(ln,"ADDRESS_STYLE_UNITED_KINGDOM","uk"),v()(ln,"attributes",{}),v()(ln,"runtime",null),v()(ln,"nodeName","address");var cn=function(e){g()(n,e);var t=un(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),v()(c()(r),"captchaPicture",void 0),v()(c()(r),"recaptchaRenderContainer",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","captcha-".concat(a,"-acc")),r.labelDOMNode.setAttribute("data-i18n-text","textdef_1"),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.captchaPicture=document.createElement("img"),r.captchaPicture.setAttribute("data-role","i123-captcha"),r.captchaPicture.addEventListener("load",(function(){jt.refreshFrameHeightOnWix()}),!0),r.recaptchaRenderContainer=document.createElement("div"),r.recaptchaRenderContainer.setAttribute("class","recaptcha-container"),r.input=document.createElement("input"),r.input.setAttribute("type","text"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","captcha-".concat(a,"-acc")),r}return l()(n,[{key:"updateRequiredState",value:function(){this.getRootNode().setAttribute("data-is-required","1")}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_CAPTCHA}},{key:"getElementName",value:function(){var e=this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_captcha_name");return e&&"edt_UI_control_type_captcha_name"!==e?e:"Verification"}},{key:"isRemovable",value:function(){return!1}},{key:"getResizingCapability",value:function(){return T.K.LEFT_AND_RIGHT}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"getInputDOMNodes",value:function(){var e=this.getProperty("configuration.type"),t=this.getForm().getEngine().getLoader().getLoaderType();switch(e){case T.e.DAILY:case T.e.ALWAYS:case T.e.SMART:return[{inputs:[{input:this.captchaPicture,width:T.y.FOUR_UNITS},{input:this.input,width:T.y.FILL}]}];case T.e.RECAPTCHA:return t===T.v.EDIT?[{inputs:[{input:this.captchaPicture,width:null}]}]:[{inputs:[{input:this.recaptchaRenderContainer,width:null}]}];case T.e.NONE:default:return[]}}},{key:"onCaptchaTypeChanged",value:function(){var e=this.getProperty("configuration.type"),t=this.getForm().getEngine().getLoader().getLoaderType(),i=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.SESSION_ID);switch(e){case T.e.NONE:this.captchaPicture.src="",this.captchaPicture.setAttribute("data-captcha-type","none");break;case T.e.ALWAYS:this.captchaPicture.setAttribute("data-captcha-type","always"),t===T.v.VIEW?this.captchaPicture.src=this.captchaPicture.src||"".concat(n.PATH_TO_CAPTCHA_IN_VIEW_FORM_MODE,"?t=").concat(+new Date,"&fid=").concat(String(this.getForm().getEngine().getLoader().getFormId()||"0"),"&needsRandomCaptchaGeneration=true&PHPSESSID=").concat(i):this.captchaPicture.src=n.PATH_TO_CAPTCHA_TYPE_ALWAYS_IN_EDIT_MODE;break;case T.e.DAILY:this.captchaPicture.setAttribute("data-captcha-type","daily"),t===T.v.VIEW?this.captchaPicture.src=this.captchaPicture.src||"".concat(n.PATH_TO_CAPTCHA_TYPE_DAILY_IN_VIEW_FORM_MODE.replace(/\%FORMID\%/g,String(this.getForm().getId()||"0")),"?t=").concat(+new Date,"&PHPSESSID=").concat(i):this.captchaPicture.src=n.PATH_TO_CAPTCHA_TYPE_DAILY_IN_EDIT_MODE;break;case T.e.RECAPTCHA:this.captchaPicture.setAttribute("data-captcha-type","recaptcha"),t===T.v.VIEW?(this.captchaPicture.removeAttribute("src"),function(e){var t,i=_e.isIOS();if(i){var r=e.recaptchaRenderContainer.getBoundingClientRect();t=r.top}e.whenRecaptchaLibraryIsLoaded().then((function(){grecaptcha.render(e.recaptchaRenderContainer,{sitekey:n.RECAPTCHA_SITE_KEY,"expired-callback":function(e){i&&void 0!==t&&window.parent.postMessage({top:t,command:"scroll-into-view"},"*")},callback:function(e){i&&void 0!==t&&window.parent.postMessage({top:t,command:"scroll-into-view"},"*")}})}))}(this)):this.captchaPicture.src=n.PATH_TO_CAPTCHA_TYPE_RECAPTCHA_IN_EDIT_MODE;break;case T.e.SMART:this.captchaPicture.setAttribute("data-captcha-type","smart"),t===T.v.VIEW?this.captchaPicture.src=this.captchaPicture.src||"".concat(n.PATH_TO_CAPTCHA_IN_VIEW_FORM_MODE,"?t=").concat(+new Date,"&fid=").concat(String(this.getForm().getEngine().getLoader().getFormId()||"0"),"&needsRandomCaptchaGeneration=true&PHPSESSID=").concat(i):this.captchaPicture.src=n.PATH_TO_CAPTCHA_TYPE_SMART_IN_EDIT_MODE}this.updateCaptchaTypeAttribute()}},{key:"updateCaptchaTypeAttribute",value:function(){switch(this.getProperty("configuration.type")){case T.e.NONE:this.rootNode.setAttribute("data-captcha-type","none");break;case T.e.DAILY:this.rootNode.setAttribute("data-captcha-type","daily");break;case T.e.RECAPTCHA:this.rootNode.setAttribute("data-captcha-type","recaptcha");break;case T.e.RESERVED:this.rootNode.setAttribute("data-captcha-type","");break;case T.e.SMART:this.rootNode.setAttribute("data-captcha-type","smart");break;case T.e.ALWAYS:this.rootNode.setAttribute("data-captcha-type","always")}}},{key:"whenRecaptchaLibraryIsLoaded",value:function(){return function(e,t){return n.isRecaptchaLibraryLoaded?t.Deferred((function(e){e.resolve(!0)})).promise():(void 0!==n.theOnlyOneRecaptchaAPIPromise||(n.theOnlyOneRecaptchaAPIPromise=t.Deferred((function(t){window.RECAPTCHA_READY_CALBACK_612388123=function(){n.isRecaptchaLibraryLoaded=!0,delete window.RECAPTCHA_READY_CALBACK_612388123,t.resolve(!0)},e.getForm().getEngine().getResourceManager().loadJavascript("//www.google.com/recaptcha/api.js?onload=RECAPTCHA_READY_CALBACK_612388123&render=explicit").then((function(){setTimeout((function(){jt.refreshFrameHeightOnWix()}),100)})).fail((function(){t.reject(new Error("Failed to load google Recaptcha Library"))}))})).promise()),n.theOnlyOneRecaptchaAPIPromise)}(this,Bt.getJQuery())}},{key:"onCreated",value:function(){var e=this;setTimeout((function(){e.updateLabelText(),e.updateErrorsText(),e.updateRequiredState(),e.updateCaptchaTypeAttribute();for(var t=0,n=e.enumerateProperties(),i=n.length;t<i;t++)e.getForm().trigger("node-property-changed",e,n[t].name,e.getProperty(n[t].name),null);jt.refreshFrameHeightOnWix()}),0)}},{key:"setRendererType",value:function(e){var t=this.getProperty("configuration.type"),i=this.getForm().getEngine().getLoader().getLoaderType();if(t===T.e.NONE)if(this.getRootNode().innerHTML="",i===T.v.EDIT){var r=document.createElement("p");r.textContent="Configure your captcha",this.getRootNode().appendChild(r)}else this.getRootNode().style.display="none";else this.getRootNode().style.display="",p()(E()(n.prototype),"setRendererType",this).call(this,e)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"isSubmittable",value:function(){var e=this.getProperty("configuration.type");return e!==T.e.NONE&&e!==T.e.SMART}},{key:"getProperty",value:function(e){var t=p()(E()(n.prototype),"getProperty",this).call(this,e);switch(e){case"label.labelText":if(null===t){var i=this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_captcha_name");return i&&"edt_UI_control_type_captcha_name"!==i?i:"Verification"}return t;case"value.value":var r=this.getProperty("configuration.type"),a=this.getForm().getEngine().getLoader().getLoaderType();if(r===T.e.RECAPTCHA&&a===T.v.VIEW){var o=document.getElementById("g-recaptcha-response");if(o)return o.value}return t;default:return t}}},{key:"isDuplicatable",value:function(){return!1}},{key:"onReset",value:function(){this.setValue({value:null})}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getElementName()),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"getParentPage",value:function(){return this.getForm().getPageByIndex(this.getForm().getNumberOfPages()-1)}},{key:"withColspan",value:function(e){var t=this,i=p()(E()(n.prototype),"withColspan",this).call(this,e);return null!==e&&20!==e?(this.getForm().getConfiguration().withProperty("captchaWidthInUnits",e),setTimeout((function(){var e=t.getParent().getChildren();e[0]!==t&&t.getForm().getConfiguration().withProperty("captchaLeftMarginInUnits",e[0].getColspan())}),100)):(this.getForm().getConfiguration().deleteProperty("captchaWidthInUnits"),this.getForm().getConfiguration().deleteProperty("captchaLeftMarginInUnits")),i}},{key:"setMarginLeft",value:function(e){var t=this.getParent().getChildren();if(null===e||e<=0)t[0]!==this&&this.getParent().removeChild(t[0]);else if(t[0]!==this)t[0].withColspan(e);else{var n=this.getForm().getEngine().createElement(C.a.CONTROL_TYPE_SEPARATOR,void 0,this.getForm());this.getParent().insertBefore(this,n),n.withColspan(e)}}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getForm().getEngine().getI18n();return e.push({key:"textdef_1",sourceText:this.getProperty("label.labelText")||t.translateText("textdef_1")}),e}},{key:"setupI18n",value:function(){var e=this;return setTimeout((function(){var t=e.getForm().getEngine().getLoader();e.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&t.getCurrentLanguage()===t.getDefaultLanguage()&&e.getProperty("label.labelText")&&(e.labelDOMNode.innerHTML=S.sanitizeHTML(R.parse(e.getProperty("label.labelText"))))}),100),p()(E()(n.prototype),"setupI18n",this).call(this)}}],[{key:"getConfiguration",value:function(){return null}}]),n}(tn);function dn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(cn,"isRecaptchaLibraryLoaded",!1),v()(cn,"theOnlyOneRecaptchaAPIPromise",void 0),v()(cn,"PATH_TO_CAPTCHA_TYPE_SMART_IN_EDIT_MODE","/images3/editor/captcha_smart.png"),v()(cn,"PATH_TO_CAPTCHA_TYPE_DAILY_IN_EDIT_MODE","/images3/editor/captcha_daily.png"),v()(cn,"PATH_TO_CAPTCHA_TYPE_ALWAYS_IN_EDIT_MODE","/images3/editor/captcha_always.png"),v()(cn,"PATH_TO_CAPTCHA_TYPE_RECAPTCHA_IN_EDIT_MODE","/images3/editor/captcha_recaptcha.gif"),v()(cn,"PATH_TO_CAPTCHA_IN_VIEW_FORM_MODE","/random.php"),v()(cn,"PATH_TO_CAPTCHA_TYPE_DAILY_IN_VIEW_FORM_MODE","/random-%FORMID%.png"),v()(cn,"RECAPTCHA_SITE_KEY","6LdMNiMTAAAAAGr0ibqKRZc3e5Z6wfLBraX9NuOY"),v()(cn,"nodeName","form-captcha"),v()(cn,"attributes",{}),v()(cn,"runtime",null);var pn=function(e){g()(n,e);var t=dn(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"choices",[]),v()(c()(r),"warningContainer",void 0);var a=r.getHash();return r.rootNode.setAttribute("aria-labelledby","checkbox-".concat(a,"-acc ")+"checkbox-".concat(a,"-error-acc ")+"checkbox-".concat(a,"-instr-acc")),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","checkbox-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","checkbox-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","checkbox-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_CHECKBOX}},{key:"getElementName",value:function(){return"Checkbox"}},{key:"updateChoices",value:function(){if(this.hasProperty("choices.values")){var e,t,n,i,r,a,o,s=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),l=this.getHash(),u=this.getProperty("options.showNumberOfChoicesLeft");u?this.rootNode.setAttribute("data-show-number-of-choices","1"):this.rootNode.removeAttribute("data-show-number-of-choices");for(var c=0,d=s.length;c<d;c++)s[c].index=c;this.hasProperty("options.randomizeOrder")&&this.getProperty("options.randomizeOrder")&&jt.shuffle(s),this.hasProperty("choices.allowOther")&&this.getProperty("choices.allowOther")&&s.push({text:"Other...",isOther:!0,index:s.length});for(var p=0,h=this.choices.length;p<h;p++)this.choices[p].parentNode&&this.choices[p].parentNode.removeChild(this.choices[p]);this.choices.splice(0,this.choices.length);for(var g=0,_=s.length;g<_;g++){if((i=document.createElement("div")).setAttribute("data-role","choice"),i.setAttribute("data-index",String(s[g].index)),(e=document.createElement("input")).setAttribute("type","checkbox"),e.setAttribute("id","".concat(l,"_").concat(g)),e.setAttribute("data-role","i123-input"),e.setAttribute("data-index",String(s[g].index)),s[g].isOther?e.setAttribute("data-is-other","1"):e.setAttribute("data-value",s[g].text),(t=document.createElement("label")).setAttribute("data-role","choice"),t.setAttribute("id","checkbox-".concat(l,"-").concat(g)),t.appendChild(e),s[g].isDefault&&(e.checked=!0,t.setAttribute("aria-checked","true")),(n=document.createElement("label")).setAttribute("data-role","checkbox"),n.setAttribute("for","".concat(l,"_").concat(g)),n.setAttribute("aria-labelledby","checkbox-".concat(l,"-").concat(g)),n.setAttribute("role","checkbox"),t.appendChild(n),i.appendChild(t),s[g].isOther)(r=document.createElement("input")).setAttribute("data-role","other"),r.setAttribute("type","text"),r.setAttribute("data-size","full"),(o=document.createElement("span")).innerHTML=s[g].text||"",o.setAttribute("data-i18n-text","textdef_15"),t.appendChild(o),i.appendChild(r);else jt.isImageURL(s[g].text||"")?((a=document.createElement("img")).setAttribute("src",s[g].text),a.setAttribute("data-choice-is-image","1"),t.appendChild(a)):((o=document.createElement("span")).setAttribute("data-role","option-text"),o.innerHTML=s[g].text||"",t.appendChild(o));this.setupNumberOfTimesAnOptionCanBeChosen(s[g],u,t,i,e),this.choices.push(i)}this.isAttached()&&this.reRender()}}},{key:"setupNumberOfTimesAnOptionCanBeChosen",value:function(e,t,n,i,r){if(e.numberOfTimesThisOptionCanBeChosen&&null!==e.numberOfTimesThisOptionCanBeChosen&&e.numberOfTimesThisOptionCanBeChosen>=-1){var a=~~e.numberOfTimesThisOptionHasBeenChosen;a<0&&(a=0);var o=e.numberOfTimesThisOptionCanBeChosen-a;if(t){var s=document.createElement("span");s.setAttribute("data-role","label-info");var l=document.createElement("span");s.appendChild(document.createTextNode("".concat(String(o<0||0===o?0:o)," "))),l.textContent=1===o?"choice left":"choices left",l.setAttribute("data-i18n-text",1===o?"textdef_173":"textdef_174"),s.appendChild(l),n.appendChild(s)}(this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT||this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.getForm().getEngine().getLoader().getViewFormContext()!==T.Z.EDIT_SUBMISSION)&&o<1&&(n.setAttribute("data-disabled","1"),i.setAttribute("data-disabled","1"),r.setAttribute("disabled","true"),r.setAttribute("data-disabled","1"))}}},{key:"updateSideBySideAttribute",value:function(){this.getProperty("layout.isSideBySide")?this.rootNode.setAttribute("data-is-side-by-side-layout","1"):this.rootNode.removeAttribute("data-is-side-by-side-layout")}},{key:"getNumberOfColumns",value:function(){var e=this.hasProperty("layout.columns")?~~this.getProperty("layout.columns"):1;return e<1&&(e=1),e>4&&(e=4),e}},{key:"getChoiceWidth",value:function(e){switch(e){case 2:return T.y.HALF;case 3:return T.y.THIRD;case 4:return T.y.QUARTER}return T.y.FULL}},{key:"getInputObject",value:function(e,t){switch(e){case 2:return{width:T.y.HALF,input:t};case 3:return{width:T.y.THIRD,input:t};case 4:return{width:T.y.QUARTER,input:t};case 1:default:return{width:T.y.FULL,input:t}}}},{key:"getIsSideBySideLayout",value:function(){return!!this.hasProperty("layout.isSideBySide")&&!!this.getProperty("layout.isSideBySide")}},{key:"getIsDirectionVertical",value:function(){return!!this.hasProperty("layout.direction")&&"vertical"===this.getProperty("layout.direction")}},{key:"getVerticalChoicesLayoutRows",value:function(e,t){var n=Math.ceil(e/t),i=this.getChoiceWidth(t),r=0,a=[];n!==~~n&&(n=1+~~n);for(var o=0,s=e;o<s;o++)a[r]=a[r]||{inputs:[]},a[r].inputs.push({width:i,input:this.choices[o]}),++r>=n&&(r=0);return a}},{key:"getHorizontalChoicesLayoutRows",value:function(e,t){for(var n=null,i=0,r=[],a=0,o=e;a<o;a++)null===n&&(n={inputs:[]},r.push(n)),n.inputs.push(this.getInputObject(t,this.choices[a])),++i>=t&&(i=0,a<o-1&&(n={inputs:[]},r.push(n)));return r}},{key:"getSideBySideChoicesLayoutRows",value:function(e){for(var t=[],n={inputs:[]},i=0,r=e;i<r;i++)n.inputs.push({width:null,input:this.choices[i]});return t.push(n),t}},{key:"getInputDOMNodes",value:function(){var e=this.getNumberOfColumns(),t=this.getIsSideBySideLayout(),n=this.getIsDirectionVertical(),i=this.choices.length;switch(!0){case t:return this.getSideBySideChoicesLayoutRows(i);case n:if(!this.getForm().getEngine().getTheme().isMobileLayout())return this.getVerticalChoicesLayoutRows(i,e)}return this.getHorizontalChoicesLayoutRows(i,e)}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateChoices(),this.updateSideBySideAttribute(),this.updateHiddenAttribute(),this.updateShowInstructionsOnClick(),this.addCustomInputInvalidation(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.onValueChanged()}},{key:"addCustomInputInvalidation",value:function(){var e=this.getForm().getEngine().getJQuery(),t=this,n=function(e){var n=this.getAttribute("data-index"),i=n&&t.rootNode.querySelector('div[data-index="'.concat(n,'"]'));if("undefined"!=typeof i&&(!e.keyCode||e.keyCode===at.KEY_SPACE)){var r=i&&i.hasAttribute("data-disabled");if(e.keyCode===at.KEY_SPACE?this.checked||r:!this.checked||r)return t.warningContainer&&t.getErrorDOMNode().removeChild(t.warningContainer),t.warningContainer&&!t.getErrorDOMNode().hasChildNodes()&&t.getErrorDOMNode().setAttribute("data-is-empty","1"),void(t.warningContainer=null);var a=t.getProperty("choices.maxNumberOfChoices"),o=t.choices.filter((function(e){var t=e.querySelector("input[type=checkbox]");return t&&t.checked})).length;null!==a&&o>a&&(t.warningContainer||(t.warningContainer=document.createElement("div"),t.warningContainer.setAttribute("data-warning-container","1")),t.warningContainer.innerText="".concat(t.getForm().getEngine().getI18n().translateText("textdef_61")," (").concat(a,")")||!1,t.getErrorDOMNode().removeAttribute("data-is-empty"),t.getErrorDOMNode().appendChild(t.warningContainer),e.stopPropagation(),e.preventDefault())}};e(this.rootNode).on("keydown","input[type=checkbox]",n),e(this.rootNode).on("click","input[type=checkbox]",n)}},{key:"onValueChanged",value:function(){for(var e,t,n,i,r,a=[],o=this.getProperty("choices.maxNumberOfChoices"),s=this.getProperty("choices.minNumberOfChoices"),l=0,u=this.choices.length;l<u;l++)e=this.choices[l].querySelector("input[type=checkbox]"),r=this.choices[l].querySelector("label[data-role=checkbox]"),e&&e.checked?(e.hasAttribute("data-is-other")?(t=this.choices[l].querySelector("input[type=text][data-role=other]"))&&t.value&&a.push(t.value):a.push(e.getAttribute("data-value")),(i=(n=this.choices[l].querySelector("label[data-role=choice]"))?n.parentNode:null)&&i.setAttribute("data-is-checked","1"),r.setAttribute("aria-checked","true")):((i=(n=this.choices[l].querySelector("label[data-role=choice]"))?n.parentNode:null)&&i.hasAttribute("data-is-checked")&&i.removeAttribute("data-is-checked"),r&&r.removeAttribute("aria-checked"));this.updateControlErrorState(a,o,s),this.setProperty("value.values",a),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateControlErrorState",value:function(e,t,n){e.length>t&&null!=t&&t>0?this.addError(Dt.ERR_TOO_MANY_CHOICES_SELECTED,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_61")," (").concat(t,")")||!1):this.removeError(Dt.ERR_TOO_MANY_CHOICES_SELECTED),e.length<n&&e.length>=1&&null!=n&&n>0?this.addError(Dt.ERR_TOO_FEW_CHOICES_SELECTED,this.getForm().getEngine().getI18n().translateText("textdef_164",String(n))||"You must select at least ".concat(n," options")):this.removeError(Dt.ERR_TOO_FEW_CHOICES_SELECTED)}},{key:"getPropertyDescriptorByInputIndex",value:function(e){var t=(this.getProperty("choices.values")||[]).length;return e<t?{element:this,targetPropertyFQN:"value.values",optional:!1,type:"boolean",inputIndex:e}:e>t?null:this.getProperty("choices.allowOther")?{element:this,targetPropertyFQN:"value.values",optional:!1,type:"string",inputIndex:e}:null}},{key:"synchronizeValue",value:function(){for(var e,t,n,i,r,a,o=JSON.parse(JSON.stringify(this.getProperty("value.values")))||[],s=this.getProperty("choices.values"),l=0,u=this.choices.length;l<u;l++)void 0!==s[i=parseInt(this.choices[l].getAttribute("data-index"))]&&(t=s[i].text,n=(r=o.indexOf(t))>-1,this.choices[l].querySelector("input[type=checkbox]").checked=n,n&&o.splice(r,1));if(o.length>0&&this.choices.length&&this.getProperty("choices.allowOther"))try{var c=this.choices[this.choices.length-1],d=String(o[0]).replace(/^yes,\s/,"");c.setAttribute("data-is-checked","1"),c.querySelector("input[type=checkbox]").checked=!!o[0],c.querySelector("input[type=text]").value=d,c.querySelector("label[data-role=checkbox]").setAttribute("aria-checked","true")}catch(g){console.error(g)}if(o.length){if(a=!1,e=this.getProperty("value.values"),o[0]||(e.splice(e.indexOf(o[0]),1),a=!0),o.length>1){for(var p=1,h=o.length;p<h;p++)e.splice(e.indexOf(o[p]),1);a=!0}a&&this.setProperty("value.values",e)}}},{key:"isNumberOfTimesAnOptionCanBeChosen",value:function(){for(var e=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),t=0,n=e.length;t<n;t++)if(null!==e[t].numberOfTimesThisOptionCanBeChosen&&void 0!==e[t].numberOfTimesThisOptionCanBeChosen)return!0;return!1}},{key:"setIsNumberOfTimesAnOptionCanBeChosen",value:function(e){for(var t=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),n=0,i=t.length;n<i;n++)e?void 0!==t[n].numberOfTimesThisOptionCanBeChosen&&null!==t[n].numberOfTimesThisOptionCanBeChosen||(t[n].numberOfTimesThisOptionCanBeChosen=0):t[n].numberOfTimesThisOptionCanBeChosen=null;this.setProperty("choices.values",t)}},{key:"getChoicesValues",value:function(){return JSON.parse(JSON.stringify(this.getProperty("choices.values")||[]))}},{key:"setChoicesValues",value:function(e){e&&Object(ot.a)(e,(function(e){return e.text=e.text.trim()})),this.setProperty("choices.values",e)}},{key:"getChoicesDOMNodes",value:function(){return this.choices}},{key:"onReset",value:function(){this.updateChoices(),this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_checkbox_name")),this.updateLabelText(),this}},{key:"setupI18n",value:function(){var e=this.getId();if(e)for(var t=0,i=this.choices.length;t<i;t++){var r=this.choices[t].querySelector("input[type=checkbox][data-index]");if(r){var a=~~r.getAttribute("data-index"),o=this.choices[t].querySelector("span[data-role=option-text]");o&&(o.setAttribute("data-i18n-html","control_label_".concat(e,"_choice_").concat(a)),o.setAttribute("data-skip-markdown","true"))}}return p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=(this.getForm().getEngine().getI18n(),this.getProperty("label.labelText")||""),n=this.getProperty("instructions.text")||"";t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n});for(var i=this.getProperty("choices.values")||[],r=0,a=i.length;r<a;r++)i[r].text&&e.push({key:"control_label_".concat(this.getId(),"_choice_").concat(r),sourceText:i[r].text});return e}},{key:"cloneNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return p()(E()(n.prototype),"cloneNode",this).call(this,e,t)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_CHECKBOX,name:"Checkbox",isContainer:!1,category:"basic",keywords:"multiple choice checkbox checkboxes choices",icon:"i123-multiple_choice",isVirtual:!1,i18nName:"edt_UI_control_type_checkbox_name",i18nKeywords:"edt_UI_control_type_checkbox_keywords",index:50,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE}}}]),n}(tn);function hn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(pn,"attributes",{}),v()(pn,"runtime",null),v()(pn,"nodeName","check-box");var gn=function(e){g()(n,e);var t=hn(n);function n(e,i,r,a,s){var l;return o()(this,n),l=t.call(this),v()(c()(l),"runtime",void 0),v()(c()(l),"properties",void 0),v()(c()(l),"propertyDescriptors",void 0),v()(c()(l),"configuration",void 0),v()(c()(l),"document",void 0),v()(c()(l),"typescriptInterfaceName",void 0),v()(c()(l),"errors",void 0),l.properties=jt.clone(e),l.configuration=i,l.typescriptInterfaceName=r,l.document=a,l.runtime=s,l.propertyDescriptors=l.runtime.getTypeDescriptor(l.typescriptInterfaceName).properties,l}return l()(n,[{key:"getConfiguration",value:function(){return this.configuration}},{key:"hasProperty",value:function(e){return void 0!==this.properties[e]}},{key:"getProperty",value:function(e){if(!this.hasProperty(e))throw new Error("Property ".concat(JSON.stringify(e)," does not exist!"));return this.properties[e]}},{key:"setProperty",value:function(e,t){if("string"!==typeof e||!e)throw new Error("Invalid argument: propertyFQN: string not empty expected!");if(void 0===this.propertyDescriptors[e])throw new Error("Property ".concat(JSON.stringify(e)," does not exist!"));var n=this.properties[e];t!==n&&(this.properties[e]=t,this.trigger("property-change",e,t,n,this),this.document.trigger("change"))}},{key:"enumerateProperties",value:function(){var e=[];for(var t in this.propertyDescriptors)this.propertyDescriptors.propertyIsEnumerable(t)&&e.push({name:t,type:this.propertyDescriptors[t].type,optional:this.propertyDescriptors[t].optional,value:void 0===this.properties[t]?null:this.properties[t]});return e}},{key:"hasErrors",value:function(){return!!this.errors&&!!this.errors.length}},{key:"withError",value:function(e){return this.errors=void 0===this.errors?[]:this.errors,this.errors.push(e),this.document&&(this.document.trigger("change"),this.document.trigger("errors-changed",this)),this}},{key:"withoutError",value:function(e){if(void 0!==this.errors){for(var t=!1,n=this.errors.length-1;n>-1;n--)this.errors[n].code===e&&(this.errors.splice(n,1),t=!0);this.errors.length||(this.errors=void 0),t&&this.document&&(this.document.trigger("change"),this.document.trigger("errors-changed",this))}return this}},{key:"serialize",value:function(){return[this.getTypeId(),this.properties,this.errors||null]}},{key:"getForm",value:function(){return this.document}},{key:"isVisible",value:function(){return this.configuration.visible}},{key:"getErrors",value:function(){return this.errors||null}},{key:"withErrors",value:function(e){var t;if(null!==e&&!A()(e,Array))throw new Error("Invalid argument: array expected!");if(e&&(t=e.length)){for(var n,i=[],r=0;r<t;r++){if(!e[r]||"number"!==typeof e[r].code||"string"!==typeof e[r].message)throw new Error("Invalid argument: errors: ISettingError[] expected!");if(n={code:~~e[r].code,message:e[r].message,isHTML:!!e[r].isHTML},void 0!==e[r].propertyName&&null!==e[r].propertyName){if("string"!==typeof e[r].propertyName)throw new Error("Invalid argument!");n.propertyName=e[r].propertyName}i.push(n)}if(!this.errors&&!i.length)return;this.errors=i.length?i:void 0,this.document&&(this.document.trigger("change"),this.document.trigger("errors-changed",this))}else this.errors=void 0,this.document&&(this.document.trigger("change"),this.document.trigger("errors-changed",this));return this}}]),n}(b.a),_n=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getGroupLabelTextByGroupTypeId",value:function(e){switch(e){case this.PAYMENT_PROCESSORS:return"Payment Processors";case this.PAYMENT_PROCESSORS_SANDBOX:return"Payment Processors (Testing Mode)";case this.PAYMENT_SETTINGS:return"Payments";default:return"Setting group not defined: ".concat(JSON.stringify(e))}}},{key:"getGroupLabelI18nTextByGroupTypeId",value:function(e){switch(e){case this.PAYMENT_PROCESSORS:return"edt_UI_setting_group_payment_processors";case this.PAYMENT_PROCESSORS_SANDBOX:return"edt_UI_setting_group_payment_processors_sandbox";case this.PAYMENT_SETTINGS:return"edt_UI_setting_group_payment_settings";default:return""}}},{key:"getGroupSortIndex",value:function(e){switch(e){case this.PAYMENT_SETTINGS:return 5;case this.PAYMENT_PROCESSORS:return 10;default:return 1e4}}},{key:"getGroupSettingTypeIds",value:function(e){var t=[];return ei.getAllSettingTypeIds().forEach((function(n){ei.getSettingClassByTypeId(n).getConfiguration().group===e&&t.push(n)})),t}}]),e}();function fn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(_n,"PAYMENT_PROCESSORS","payment-processors"),v()(_n,"PAYMENT_PROCESSORS_SANDBOX","payment-processors-sandbox"),v()(_n,"PAYMENT_SETTINGS","payment-settings");var yn=function(e){g()(n,e);var t=fn(n);function n(e,i,r){var a;return o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IProductsSetting",i,r),$("#notifications-area").on("click","div.notification a[data-trigger=products-trigger]",(function(){i.getEngine().getLoader().execCommand("track-event","payment_processors_reminder_click")})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PRODUCTS_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_SETTINGS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!1,groups:[]}}}],[{key:"getConfiguration",value:function(){return{name:"Products settings",keywords:"",typeId:ei.PAYMENT_PRODUCTS_EDITOR_SETTING,group:_n.PAYMENT_SETTINGS,category:"basic",visible:!1,i18nName:"",i18nKeywords:"",icon:"i123-settings",index:20}}}]),n}(gn);function En(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(yn,"defaultProperties",void 0);var mn=function(e){g()(n,e);var t=En(n);function n(e,i,r){var a;o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"ISummarySetting",i,r);var s=i.getForm().getEngine().getJQuery(),l=c()(a);return s("#item").off("mouseover","div[data-role=review-products-trigger] > button").on("mouseover","div[data-role=review-products-trigger] > button",(function(){s(this).addClass("_hover")})).off("mouseout","div[data-role=review-products-trigger] > button").on("mouseout","div[data-role=review-products-trigger] > button",(function(){s(this).removeClass("_hover")})).off("change, input","input").on("change, input","input",(function(e){if(s('div[id="item"][data-target-setting-id="setting_payment_summary"]').length)switch(s(this).closest("div[data-role=property]").attr("data-property-name")){case T.H.SHOW_SUMMARY_AFTER_SUBMIT:"true"===this.value?(i.getEngine().getLoader().trigger("payments_summary_show_after_submit"),i.getEngine().getLoader().execCommand("track-event","payments_summary_show_after_submit")):(i.getEngine().getLoader().trigger("payments_summary_show_on_form"),i.getEngine().getLoader().execCommand("track-event","payments_summary_show_on_form")),i.getEngine().getLoader().trigger("payments_status_changed");break;case T.H.SHOW_REALTIME_SUMMARY:this.checked?i.getEngine().getLoader().execCommand("track-event","payments_summary_realtime_on"):i.getEngine().getLoader().execCommand("track-event","payments_summary_realtime_off");break;case T.H.COLUMNS:l.updateColumnName(this,T.q.INPUT);break;default:i.getEngine().getLoader().trigger("payments_status_changed")}})).off("click","button.visibility-button").on("click","button.visibility-button",(function(e){a.updateColumnVisibility(e.target)})).off("blur",'[data-property-name="columns"] .list-element > input').on("blur",'[data-property-name="columns"] .list-element > input',(function(e){a.updateColumnName(e.target,T.q.BLUR)})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_SUMMARY_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_SETTINGS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!1,hasProductsTrigger:!0,groups:[{name:"order details",i18nName:"edt_UI_setting_type_order_details_group_name",label:"ORDER DETAILS",properties:[{label:"Currency",type:"int",propertyFQN:"currencyId",i18nName:"edt_UI_setting_summary_currency"},{label:"Discount on total",type:"int",propertyFQN:"discountOnTotal",i18nName:"edt_UI_setting_summary_discount_on_total"},{label:"Tax on total",type:"int",propertyFQN:"taxOnTotal",i18nName:"edt_UI_setting_summary_tax_on_total"}]},{name:"rows",i18nName:"edt_UI_setting_type_rows_group_name",label:"ROWS",properties:[{label:"Show detailed formula",type:"boolean",propertyFQN:"showDetailedFormula",i18nName:"edt_UI_setting_summary_show_detailed_formula"},{label:"Show Discount & Tax",type:"boolean",propertyFQN:"showDiscountAndTax",i18nName:"edt_UI_setting_summary_show_discount_and_tax"}]},{name:"payment summary",i18nName:"edt_UI_setting_type_summary_group_name",label:"SUMMARY",properties:[{label:"Show summary",type:"boolean",propertyFQN:"showSummaryAfterSubmit",i18nName:"payment_summary_show_summary"},{label:"Show live order summary",type:"boolean",propertyFQN:"showRealTimeSummary",i18nName:"payment_summary_show_live_order_summary"}]},{name:"columns",i18nName:"edt_UI_setting_type_columns_group_name",label:"COLUMNS",properties:[{label:null,type:"array",propertyFQN:"columns",i18nName:null}]}]}}},{key:"updateColumnName",value:function(e,t){var n={name:e.parentElement.getAttribute("data-name"),value:e.value};this.document.getEngine().getLoader().trigger("payments_column_name_changed",t,n)}},{key:"updateColumnVisibility",value:function(e){var t={name:e.parentElement.getAttribute("data-name"),isVisible:"true"===e.getAttribute("data-column-is-visible")};this.document.getEngine().getLoader().trigger("payments_column_visibility_changed",t)}}],[{key:"getConfiguration",value:function(){return{name:"Payment summary",keywords:"",typeId:ei.PAYMENT_SUMMARY_EDITOR_SETTING,group:_n.PAYMENT_SETTINGS,category:"basic",visible:!0,i18nName:"edt_UI_setting_type_summary_name",i18nKeywords:"edt_UI_setting_type_summary_keywords",icon:"i123-setting_payment_summary",index:30}}}]),n}(gn);function vn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(mn,"defaultProperties",void 0);var Tn=function(e){g()(n,e);var t=vn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"ICouponSettings",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_COUPON_CODES_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_SETTINGS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,groups:[{name:"settings",i18nName:null,label:"Settings",properties:[{label:"Coupon Codes",propertyFQN:"codes",i18nName:null,type:"ICouponCodeSettings[]"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Coupon Codes",keywords:"coupon codes payments",typeId:ei.PAYMENT_COUPON_CODES_EDITOR_SETTING,group:_n.PAYMENT_SETTINGS,category:"basic",visible:!1,i18nName:"edt_UI_attribute_coupons",i18nKeywords:"edt_UI_attribute_coupons",icon:"i123-field_coupon",index:10}}}]),n}(gn);function On(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Tn,"defaultProperties",void 0);var Cn=function(e){g()(n,e);var t=On(n);function n(e,i,r){var a;o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPaypalSettings",i,r);var s=i.getEngine().getLoader();return a.on("property-change",(function(e,t,n,i){var r=["useRecurrentPayment","isDonation","useDetailedInvoice"];if(r.indexOf(e)>-1){var a=!1;t?(a=!0,r.forEach((function(t){t!==e&&i.setProperty(t,!1)}))):"useRecurrentPayment"===e&&(a=!0),a&&s.getCommandDispatcher().loadEditorSettingIntoPanel(i,!0)}})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"Email address",type:"string",propertyFQN:"clientId",i18nName:"edt_UI_setting_processor_attribute_account_property_email"},{label:"Language",type:"string",propertyFQN:"language",i18nName:"edt_UI_setting_processor_attribute_account_property_language"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"Billing",properties:[{label:"Use recurrent payment",type:"boolean",propertyFQN:"useRecurrentPayment",i18nName:"edt_UI_setting_processor_attribute_billing_property_useRecurrentPayment"}]},{name:"shipping_information",i18nName:"edt_UI_setting_processor_attribute_shipping_label",label:"Shipping information",properties:[{label:"",type:"IPaypalShippingInformationSettings",propertyFQN:"shippingInformation",i18nName:null}]}]};return this.getProperty("useRecurrentPayment")&&(e.groups[1].properties=e.groups[1].properties.concat([{label:"Frequency",type:"int",propertyFQN:"recurrenceFrequency",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceFrequency"},{label:"Time expressed in",type:"int",propertyFQN:"recurrenceTimeUnit",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceTimeUnit"},{label:"Recurring cycles",type:"int",propertyFQN:"recurrenceCycles",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceCycles"}])),e.groups[1].properties=e.groups[1].properties.concat([{label:"Payment represents a donation",type:"boolean",propertyFQN:"isDonation",i18nName:"edt_UI_setting_processor_attribute_billing_property_isDonation"},{label:"Use detailed invoice",type:"boolean",propertyFQN:"useDetailedInvoice",i18nName:"edt_UI_setting_processor_attribute_billing_property_useDetailedInvoice"},{label:"Use shipping",type:"boolean",propertyFQN:"useShipping",i18nName:"edt_UI_setting_processor_attribute_billing_property_useShipping"}]),e}}],[{key:"getConfiguration",value:function(){return{name:"PayPal",keywords:"paypal",typeId:ei.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_paypal",index:50}}}]),n}(gn);function Nn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Cn,"defaultProperties",void 0);var An=function(e){g()(n,e);var t=Nn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPaypalCheckoutSettings",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"Client ID",type:"string",propertyFQN:"clientId",i18nName:"edt_UI_setting_processor_attribute_account_property_clientId"},{label:"Language",type:"string",propertyFQN:"language",i18nName:"edt_UI_setting_processor_attribute_account_property_language"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"Billing",properties:[{label:"Use detailed invoice",type:"boolean",propertyFQN:"useDetailedInvoice",i18nName:"edt_UI_setting_processor_attribute_billing_property_useDetailedInvoice"},{label:"Use shipping",type:"boolean",propertyFQN:"useShipping",i18nName:"edt_UI_setting_processor_attribute_billing_property_useShipping"}]},{name:"shipping_information",i18nName:"edt_UI_setting_processor_attribute_shipping_label",label:"Shipping information",properties:[{label:"",type:"IPaypalShippingInformationSettings",propertyFQN:"shippingInformation",i18nName:null}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"PayPal Express Checkout",keywords:"paypal express checkout",typeId:ei.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_paypal",index:10}}}]),n}(gn);function bn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(An,"defaultProperties",void 0);var Rn=function(e){g()(n,e);var t=bn(n);function n(e,i,r){var a;o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPaypalProSettings",i,r);var s=i.getEngine().getLoader();return a.on("property-change",(function(e,t,n,i){"useRecurrentPayment"===e&&s.getCommandDispatcher().loadEditorSettingIntoPanel(i,!0)})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYPAL_PRO_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"API Username",type:"string",propertyFQN:"apiUsername",i18nName:"edt_UI_setting_processor_attribute_account_property_apiUsername"},{label:"API Password",type:"string",propertyFQN:"apiPassword",i18nName:"edt_UI_setting_processor_attribute_account_property_apiPassword"},{label:"API Signature",type:"string",propertyFQN:"apiSignature",i18nName:"edt_UI_setting_processor_attribute_account_property_apiSignature"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"Billing",properties:[{label:"Use recurrent payment",type:"boolean",propertyFQN:"useRecurrentPayment",i18nName:"edt_UI_setting_processor_attribute_billing_property_useRecurrentPayment"}]}]};return this.getProperty("useRecurrentPayment")&&(e.groups[1].properties=e.groups[1].properties.concat([{label:"Frequency",type:"int",propertyFQN:"recurrenceFrequency",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceFrequency"},{label:"Time expressed in",type:"int",propertyFQN:"recurrenceTimeUnit",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceTimeUnit"},{label:"Recurring cycles",type:"int",propertyFQN:"recurrenceCycles",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceCycles"}])),e}}],[{key:"getConfiguration",value:function(){return{name:"PayPal Pro",keywords:"paypal pro",typeId:ei.PAYMENT_PROCESSOR_PAYPAL_PRO_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_paypal",index:60}}}]),n}(gn);function In(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Rn,"defaultProperties",void 0);var Pn=function(e){g()(n,e);var t=In(n);function n(e,i,r){var a;o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPaypalPayflowSetting",i,r);var s=i.getEngine().getLoader();return a.on("property-change",(function(e,t,n,i){"useRecurrentPayment"===e&&s.getCommandDispatcher().loadEditorSettingIntoPanel(i,!0)})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYPAL_PAYFLOW_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Username",type:"string",propertyFQN:"userId",i18nName:"edt_UI_setting_processor_attribute_account_property_userId"},{label:"Merchant",type:"string",propertyFQN:"merchantId",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantId_paypalPayflow"},{label:"Partner",type:"string",propertyFQN:"partner",i18nName:"edt_UI_setting_processor_attribute_account_property_partner"},{label:"Password",type:"string",propertyFQN:"password",i18nName:"edt_UI_setting_processor_attribute_account_property_password"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"BILLING",properties:[{label:"User recurrent payment",type:"boolean",propertyFQN:"useRecurrentPayment",i18nName:"edt_UI_setting_processor_attribute_billing_property_useRecurrentPayment"}]}]};return!0===this.getProperty("useRecurrentPayment")&&(e.groups[1].properties=e.groups[1].properties.concat([{label:"Frequency",type:"int",propertyFQN:"recurrenceFrequency",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceFrequency"},{label:"Time expressed in",type:"int",propertyFQN:"recurrenceTimeUnit",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceTimeUnit"},{label:"Recurrence cycles",type:"int",propertyFQN:"recurrenceCycles",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceCycles"}])),e}}],[{key:"getConfiguration",value:function(){return{name:"Paypal Payflow",keywords:"paypal payflow",typeId:ei.PAYMENT_PROCESSOR_PAYPAL_PAYFLOW_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_paypal",index:80}}}]),n}(gn);function Sn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Pn,"defaultProperties",void 0);var Dn=function(e){g()(n,e);var t=Sn(n);function n(e,i,r){var a;o()(this,n),a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IStripeSetting",i,r);var s=i.getEngine().getLoader();return a.on("property-change",(function(e,t,n,i){"useRecurrentPayment"===e&&s.getCommandDispatcher().loadEditorSettingIntoPanel(i,!0)})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e=this.getProperty("userPubKey"),t={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!1,isEnabled:this.getProperty("isEnabled"),needsOAuthConnect:!0,groups:[]};return null!==e&&(t.isToggleable=!0,t.groups=[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Connected Account",type:"string",propertyFQN:"userEmail",i18nName:"edt_UI_setting_processor_attribute_account_property_email_stripeCheckout"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"BILLING",properties:[{label:"Required billing address",type:"boolean",propertyFQN:"isBillingAddressRequired",i18nName:"edt_UI_setting_processor_attribute_billing_property_isBillingAddressRequired"},{label:"User recurrent payment",type:"boolean",propertyFQN:"useRecurrentPayment",i18nName:"edt_UI_setting_processor_attribute_billing_property_useRecurrentPayment"}]},{name:"description_information",i18nName:"edt_UI_setting_processor_attribute_description_label",label:"DESCRIPTION",properties:[{label:"",type:"string",propertyFQN:"description",i18nName:null}]}],!0===this.getProperty("useRecurrentPayment")&&(t.groups[1].properties=t.groups[1].properties.concat([{label:"Frequency",type:"int",propertyFQN:"recurrenceFrequency",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceFrequency"},{label:"Time expressed in",type:"int",propertyFQN:"recurrenceTimeUnit",i18nName:"edt_UI_setting_processor_attribute_billing_property_recurrenceTimeUnit"}]))),t}},{key:"oAuthDisconnect",value:function(){this.setProperty("isEnabled",!1),this.setProperty("userEmail",null),this.setProperty("userId",null),this.setProperty("userPubKey",null),this.setProperty("userSecKey",null),this.getForm().getEngine().getLoader().getCommandDispatcher().loadEditorSettingIntoPanel(this)}}],[{key:"getConfiguration",value:function(){return{name:"Stripe",keywords:"stripe",typeId:ei.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_stripe",index:30}}}]),n}(gn);function Ln(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Dn,"defaultProperties",void 0);var kn=function(e){g()(n,e);var t=Ln(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IStripeCheckoutSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_STRIPE_CHECKOUT_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e=this.getProperty("userPubKey"),t={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!1,isEnabled:this.getProperty("isEnabled"),needsOAuthConnect:!0,groups:[]};return null!==e&&(t.isToggleable=!0,t.groups=[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Connected Account",type:"string",propertyFQN:"userEmail",i18nName:"edt_UI_setting_processor_attribute_account_property_email_stripeCheckout"},{label:"Store Name",type:"string",propertyFQN:"storeName",i18nName:"edt_UI_setting_processor_attribute_account_property_storeName"},{label:"Store short description",type:"string",propertyFQN:"storeDescription",i18nName:"edt_UI_setting_processor_attribute_account_property_storeDescription"},{label:"Store image URL",type:"string",propertyFQN:"storeImage",i18nName:"edt_UI_setting_processor_attribute_account_property_storeImage"}]}]),t}},{key:"oAuthDisconnect",value:function(){this.setProperty("isEnabled",!1),this.setProperty("userEmail",null),this.setProperty("userId",null),this.setProperty("userPubKey",null),this.setProperty("userSecKey",null),this.getForm().getEngine().getLoader().getCommandDispatcher().loadEditorSettingIntoPanel(this)}}],[{key:"getConfiguration",value:function(){return{name:"Stripe Checkout",keywords:"stripe checkout",typeId:ei.PAYMENT_PROCESSOR_STRIPE_CHECKOUT_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_stripe",index:120}}}]),n}(gn);function Mn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(kn,"defaultProperties",void 0);var xn=function(e){g()(n,e);var t=Mn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"ISquareSettings",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!1,isEnabled:this.getProperty("isEnabled"),needsOAuthConnect:!0,groups:[]};return null!==this.getProperty("oAuthToken")&&(e.isToggleable=!0,e.groups=[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Location",type:"string",propertyFQN:"locationId",i18nName:"edt_UI_setting_processor_attribute_account_property_locationId"},{label:"Locations",type:"string",propertyFQN:"locations",i18nName:"edt_UI_setting_processor_attribute_square_property_locations"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"BILLING",properties:[{label:"Use detailed invoice",type:"boolean",propertyFQN:"useDetailedInvoice",i18nName:"edt_UI_setting_processor_attribute_billing_property_useDetailedInvoice"}]}]),e}},{key:"oAuthDisconnect",value:function(){this.setProperty("isEnabled",!1),this.setProperty("oAuthToken",null),this.setProperty("locations",n.defaultProperties.locations),this.setProperty("locationId",null),this.setProperty("useDetailedInvoice",n.defaultProperties.useDetailedInvoice),this.getForm().getEngine().getLoader().getCommandDispatcher().loadEditorSettingIntoPanel(this)}}],[{key:"getConfiguration",value:function(){return{name:"Square",keywords:"square",typeId:ei.PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_square",index:20}}}]),n}(gn);function wn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(xn,"defaultProperties",void 0);var Un=function(e){g()(n,e);var t=wn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IBraintreeSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_BRAINTREE_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Merchant ID",type:"string",propertyFQN:"merchantId",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantId"},{label:"Public Key",type:"string",propertyFQN:"publicKey",i18nName:"edt_UI_setting_processor_attribute_account_property_publicKey"},{label:"Private Key",type:"string",propertyFQN:"privateKey",i18nName:"edt_UI_setting_processor_attribute_account_property_privateKey"},{label:"Plan ID",type:"string",propertyFQN:"planId",i18nName:"edt_UI_setting_processor_attribute_account_property_planId"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"BILLING",properties:[{label:"Settlement",type:"boolean",propertyFQN:"automaticPaymentSettlement",i18nName:"edt_UI_setting_processor_attribute_billing_property_settlement"},{label:"Billing Address",type:"boolean",propertyFQN:"requireBillingAddress",i18nName:"edt_UI_setting_processor_attribute_billing_property_billingAddress"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Braintree",keywords:"braintree",typeId:ei.PAYMENT_PROCESSOR_BRAINTREE_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_braintree",index:90}}}]),n}(gn);function Fn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Un,"defaultProperties",void 0);var Yn=function(e){g()(n,e);var t=Fn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPayUSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYU_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Merchant ID",type:"string",propertyFQN:"merchantId",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantId"},{label:"Encryption Key",type:"string",propertyFQN:"encryptionKey",i18nName:"edt_UI_setting_processor_attribute_account_property_encryptionKey"},{label:"Collect VAT",type:"boolean",propertyFQN:"collectVat",i18nName:"edt_UI_setting_processor_attribute_account_property_collectVat"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"PayU",keywords:"payu",typeId:ei.PAYMENT_PROCESSOR_PAYU_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_payu",index:100}}}]),n}(gn);function Bn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Yn,"defaultProperties",void 0);var Vn=function(e){g()(n,e);var t=Bn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"ISisowSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_SISOW_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"Merchant ID",type:"string",propertyFQN:"merchantId",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantId"},{label:"Merchant Key",type:"string",propertyFQN:"merchantKey",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantKey"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Sisow",keywords:"sisow",typeId:ei.PAYMENT_PROCESSOR_SISOW_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_sisow",index:140}}}]),n}(gn);function Hn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Vn,"defaultProperties",void 0);var Gn=function(e){g()(n,e);var t=Hn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IPayfastSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_PAYFAST_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Merchant ID",type:"string",propertyFQN:"merchantId",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantId"},{label:"Merchant Key",type:"string",propertyFQN:"merchantKey",i18nName:"edt_UI_setting_processor_attribute_account_property_merchantKey"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Payfast",keywords:"payfast",typeId:ei.PAYMENT_PROCESSOR_PAYFAST_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_payfast",index:130}}}]),n}(gn);function Wn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Gn,"defaultProperties",void 0);var Kn=function(e){g()(n,e);var t=Wn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IWorldpaySetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_WORLDPAY_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Client Key",type:"string",propertyFQN:"clientKey",i18nName:"edt_UI_setting_processor_attribute_account_property_clientKey"},{label:"Service Key",type:"string",propertyFQN:"serviceKey",i18nName:"edt_UI_setting_processor_attribute_account_property_serviceKey"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Worldpay",keywords:"worldpay",typeId:ei.PAYMENT_PROCESSOR_WORLDPAY_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_worldpay",index:150}}}]),n}(gn);function zn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Kn,"defaultProperties",void 0);var qn=function(e){g()(n,e);var t=zn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"IAuthorizeSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_AUTHORIZE_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"API Login ID",type:"string",propertyFQN:"apiLoginId",i18nName:"edt_UI_setting_processor_attribute_account_property_apiLoginId"},{label:"Transaction Key",type:"string",propertyFQN:"transactionKey",i18nName:"edt_UI_setting_processor_attribute_account_property_transactionKey"},{label:"Create a Customer Information Profile (CIM)",type:"boolean",propertyFQN:"cimFlag",i18nName:"edt_UI_setting_processor_attribute_account_property_cimFlag"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Authorize.Net",keywords:"authorize net",typeId:ei.PAYMENT_PROCESSOR_AUTHORIZE_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_authorize_net",index:40}}}]),n}(gn);function Xn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(qn,"defaultProperties",void 0);var Qn=function(e){g()(n,e);var t=Xn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"ISagepaySetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_SAGEPAY_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"Vendor name",type:"string",propertyFQN:"vendorName",i18nName:"edt_UI_setting_processor_attribute_account_property_vendorName"},{label:"Encryption password",type:"string",propertyFQN:"encryptionPassword",i18nName:"edt_UI_setting_processor_attribute_account_property_encryptionPassword"},{label:"Vendor email (optional)",type:"string",propertyFQN:"vendorEmail",i18nName:"edt_UI_setting_processor_attribute_account_property_vendorEmail"},{label:"Partner ID (optional)",type:"string",propertyFQN:"partnerId",i18nName:"edt_UI_setting_processor_attribute_account_property_partnerId"}]},{name:"billing",i18nName:"edt_UI_setting_processor_attribute_billing_label",label:"Billing",properties:[{label:"Customer email",type:"string",propertyFQN:"customerEmail",i18nName:"edt_UI_setting_processor_attribute_billing_property_customerEmail"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"SagePay",keywords:"sagepay",typeId:ei.PAYMENT_PROCESSOR_SAGEPAY_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_sagepay",index:70}}}]),n}(gn);function $n(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Qn,"defaultProperties",void 0);var jn=function(e){g()(n,e);var t=$n(n);function n(e,i,r){var a;return o()(this,n),(a=t.call(this,e||n.defaultProperties,n.getConfiguration(),"IFreshbooksSetting",i,r)).on("property-change",(function(e,t,n,r){"useOAuth"===e&&i.getEngine().getLoader().getCommandDispatcher().loadEditorSettingIntoPanel(r)})),a}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){var e={hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!1,isEnabled:this.getProperty("isEnabled"),needsOAuthConnect:!1,groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"ACCOUNT",properties:[{label:"Use OAuth authorization",type:"boolean",propertyFQN:"useOAuth",i18nName:"edt_UI_setting_processor_attribute_account_property_useOAuth"}]},{name:"client_information",i18nName:"edt_UI_setting_processor_attribute_clientInformation_label",label:"CLIENT INFORMATION",properties:[{label:"",type:"IFreshbooksClientInformationSettings",propertyFQN:"clientInformation",i18nName:null},{label:"Update client if email exists",type:"boolean",propertyFQN:"updateMatchingEmailClient",i18nName:"edt_UI_setting_processor_attribute_billing_property_updateClient"}]},{name:"invoice_information",i18nName:"edt_UI_setting_processor_attribute_invoiceInformation_label",label:"INVOICE / ESTIMATE",properties:[{label:"",type:"IFreshbooksInvoiceInformationSettings",propertyFQN:"invoiceInformation",i18nName:null}]},{name:"options",i18nName:"edt_UI_setting_processor_attribute_options_label",label:"OPTIONS",properties:[{label:"Email on failure",type:"string",propertyFQN:"failureEmail",i18nName:"edt_UI_setting_processor_attribute_billing_property_failureEmail"}]}]};return this.getProperty("useOAuth")?(e.needsOAuthConnect=!0,this.getProperty("oAuthToken")&&(e.isToggleable=!0)):(e.isToggleable=!0,e.groups[0].properties.push({label:"URL",type:"string",propertyFQN:"oAuthCustomUrl",i18nName:"edt_UI_setting_processor_attribute_account_property_oAuthCustomUrl"},{label:"Token",type:"string",propertyFQN:"oAuthCustomToken",i18nName:"edt_UI_setting_processor_attribute_account_property_oAuthCustomToken"})),e}},{key:"oAuthDisconnect",value:function(){this.setProperty("isEnabled",!1),this.setProperty("oAuthToken",null),this.getForm().getEngine().getLoader().getCommandDispatcher().loadEditorSettingIntoPanel(this)}}],[{key:"getConfiguration",value:function(){return{name:"FreshBooks",keywords:"freshbooks",typeId:ei.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_freshbooks",index:110}}}]),n}(gn);function Jn(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(jn,"defaultProperties",void 0);var Zn=function(e){g()(n,e);var t=Jn(n);function n(e,i,r){return o()(this,n),t.call(this,e||n.defaultProperties,n.getConfiguration(),"ICivicaSetting",i,r)}return l()(n,[{key:"getTypeId",value:function(){return ei.PAYMENT_PROCESSOR_CIVICA_EDITOR_SETTING}},{key:"getGroupTypeId",value:function(){return _n.PAYMENT_PROCESSORS}},{key:"getSettingsModelForInspectorPanel",value:function(){return{hasEditingCapabilities:!0,isRemovable:!0,isToggleable:!0,isEnabled:this.getProperty("isEnabled"),groups:[{name:"account",i18nName:"edt_UI_setting_processor_attribute_account_label",label:"Account",properties:[{label:"Paylink",type:"string",propertyFQN:"payLink",i18nName:"edt_UI_setting_processor_attribute_account_property_payLink"},{label:"Calling application ID",type:"string",propertyFQN:"callingApplicationId",i18nName:"edt_UI_setting_processor_attribute_account_property_callingApplicationId"},{label:"Account Reference",type:"string",propertyFQN:"accountReference",i18nName:"edt_UI_setting_processor_attribute_account_property_accountReference"},{label:"Fund code",type:"string",propertyFQN:"fundCode",i18nName:"edt_UI_setting_processor_attribute_account_property_fundCode"},{label:"VAT code (optional)",type:"string",propertyFQN:"vatCode",i18nName:"edt_UI_setting_processor_attribute_account_property_vatCode"},{label:"General ledger code (optional)",type:"string",propertyFQN:"generalLedgerCode",i18nName:"edt_UI_setting_processor_attribute_account_property_generalLedgerCode"}]},{name:"description",i18nName:"edt_UI_setting_processor_attribute_description_label",label:"Description",properties:[{label:"Description",type:"string",propertyFQN:"description",i18nName:"edt_UI_setting_processor_attribute_description_property_description_civica"}]},{name:"testing_mode",i18nName:"edt_UI_setting_processor_attribute_testing_label",label:"Testing mode",properties:[{label:"Paylink for testing",type:"string",propertyFQN:"payLinkForTesting",i18nName:"edt_UI_setting_processor_attribute_account_property_payLinkForTesting"}]}]}}}],[{key:"getConfiguration",value:function(){return{name:"Civica",keywords:"civica",typeId:ei.PAYMENT_PROCESSOR_CIVICA_EDITOR_SETTING,group:_n.PAYMENT_PROCESSORS,category:"e-commerce",visible:!0,i18nName:"",i18nKeywords:"",icon:"i123-processor_civica",index:160}}}]),n}(gn);v()(Zn,"defaultProperties",void 0);var ei=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAllSettingTypeIds",value:function(){return[e.PAYMENT_PRODUCTS_EDITOR_SETTING,e.PAYMENT_COUPON_CODES_EDITOR_SETTING,e.PAYMENT_SUMMARY_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYPAL_PAYFLOW_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYPAL_PRO_EDITOR_SETTING,e.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING,e.PAYMENT_PROCESSOR_STRIPE_CHECKOUT_EDITOR_SETTING,e.PAYMENT_PROCESSOR_BRAINTREE_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYU_EDITOR_SETTING,e.PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING,e.PAYMENT_PROCESSOR_SISOW_EDITOR_SETTING,e.PAYMENT_PROCESSOR_PAYFAST_EDITOR_SETTING,e.PAYMENT_PROCESSOR_WORLDPAY_EDITOR_SETTING,e.PAYMENT_PROCESSOR_AUTHORIZE_EDITOR_SETTING,e.PAYMENT_PROCESSOR_SAGEPAY_EDITOR_SETTING,e.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING,e.PAYMENT_PROCESSOR_CIVICA_EDITOR_SETTING]}},{key:"getSettingClassByTypeId",value:function(e){switch(e){case this.PAYMENT_PRODUCTS_EDITOR_SETTING:return yn;case this.PAYMENT_SUMMARY_EDITOR_SETTING:return mn;case this.PAYMENT_COUPON_CODES_EDITOR_SETTING:return Tn;case this.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING:return Cn;case this.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING:return An;case this.PAYMENT_PROCESSOR_PAYPAL_PRO_EDITOR_SETTING:return Rn;case this.PAYMENT_PROCESSOR_PAYPAL_PAYFLOW_EDITOR_SETTING:return Pn;case this.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING:return Dn;case this.PAYMENT_PROCESSOR_STRIPE_CHECKOUT_EDITOR_SETTING:return kn;case this.PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING:return xn;case this.PAYMENT_PROCESSOR_BRAINTREE_EDITOR_SETTING:return Un;case this.PAYMENT_PROCESSOR_PAYU_EDITOR_SETTING:return Yn;case this.PAYMENT_PROCESSOR_SISOW_EDITOR_SETTING:return Vn;case this.PAYMENT_PROCESSOR_PAYFAST_EDITOR_SETTING:return Gn;case this.PAYMENT_PROCESSOR_WORLDPAY_EDITOR_SETTING:return Kn;case this.PAYMENT_PROCESSOR_AUTHORIZE_EDITOR_SETTING:return qn;case this.PAYMENT_PROCESSOR_SAGEPAY_EDITOR_SETTING:return Qn;case this.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING:return jn;case this.PAYMENT_PROCESSOR_CIVICA_EDITOR_SETTING:return Zn;default:return null}}}]),e}();function ti(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(ei,"PAYMENT_PRODUCTS_EDITOR_SETTING","setting_payment_products"),v()(ei,"PAYMENT_COUPON_CODES_EDITOR_SETTING","setting_payment_coupons"),v()(ei,"PAYMENT_SUMMARY_EDITOR_SETTING","setting_payment_summary"),v()(ei,"PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING","setting_payment_processor_paypal"),v()(ei,"PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING","setting_payment_processor_paypal_checkout"),v()(ei,"PAYMENT_PROCESSOR_PAYPAL_PAYFLOW_EDITOR_SETTING","setting_payment_processor_paypal_payflow"),v()(ei,"PAYMENT_PROCESSOR_PAYPAL_PRO_EDITOR_SETTING","setting_payment_processor_paypal_pro"),v()(ei,"PAYMENT_PROCESSOR_BRAINTREE_EDITOR_SETTING","setting_payment_processor_braintree"),v()(ei,"PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING","setting_payment_processor_stripe"),v()(ei,"PAYMENT_PROCESSOR_STRIPE_CHECKOUT_EDITOR_SETTING","setting_payment_processor_stripe_checkout"),v()(ei,"PAYMENT_PROCESSOR_PAYU_EDITOR_SETTING","setting_payment_processor_payu"),v()(ei,"PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING","setting_payment_processor_square"),v()(ei,"PAYMENT_PROCESSOR_SISOW_EDITOR_SETTING","setting_payment_processor_sisow"),v()(ei,"PAYMENT_PROCESSOR_PAYFAST_EDITOR_SETTING","setting_payment_processor_payfast"),v()(ei,"PAYMENT_PROCESSOR_WORLDPAY_EDITOR_SETTING","setting_payment_processor_worldpay"),v()(ei,"PAYMENT_PROCESSOR_AUTHORIZE_EDITOR_SETTING","setting_payment_processor_authorize"),v()(ei,"PAYMENT_PROCESSOR_SAGEPAY_EDITOR_SETTING","setting_payment_processor_sagepay"),v()(ei,"PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING","setting_payment_processor_freshbooks"),v()(ei,"PAYMENT_PROCESSOR_CIVICA_EDITOR_SETTING","setting_payment_processor_civica");var ni=function(e){g()(n,e);var t=ti(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","number-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","number-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","text-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","text"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","text-".concat(a,"-acc ")+"text-".concat(a,"-error-acc ")+"text-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_COUPON}},{key:"getElementName",value:function(){return"Coupon"}},{key:"getSupportedValidators",value:function(){return[this.getForm().getEngine().getValidator().getValidatorById(Ee.VALIDATOR_TYPE_NONE)]}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_coupon_name")),this.updateLabelText(),this}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged()}},{key:"onReset",value:function(){this.synchronizeValue()}},{key:"onDuplicate",value:function(){p()(E()(n.prototype),"onDuplicate",this).call(this)}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"getCouponCodes",value:function(){var e=this.getForm();return e.hasEditorSetting(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING)||e.withEditorSetting(e.getEngine().getFactory().createEditorSettingByTypeId(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING,e)),e.getEditorSettingByTypeId(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING).getProperty("codes")}},{key:"setCouponCodes",value:function(e){var t=this.getForm();return t.hasEditorSetting(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING)||t.withEditorSetting(t.getEngine().getFactory().createEditorSettingByTypeId(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING,t)),t.getEditorSettingByTypeId(ei.PAYMENT_COUPON_CODES_EDITOR_SETTING).setProperty("codes",e)}},{key:"isDuplicatable",value:function(){return!1}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_COUPON,name:"Coupon",isContainer:!1,category:"e-commerce",keywords:"coupon voucher",icon:"i123-field_coupon",isVirtual:!1,i18nName:"edt_UI_control_type_coupon_name",i18nKeywords:"edt_UI_control_type_coupon_keywords",index:2,accessibilityFields:T.r.NONE}}}]),n}(tn);function ii(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(ni,"nodeName","coupon"),v()(ni,"attributes",{}),v()(ni,"runtime",null);var ri=function(e){g()(n,e);var t=ii(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash(),s=r.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);return r.rootNode.setAttribute("aria-labelledby","date-".concat(a,"-acc ")+"date-".concat(a,"-error-acc ")+"date-".concat(a,"-instr-acc")),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","date-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","date-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","date-".concat(a,"-instr-acc")),r.input=Bt.createElement(Bt.ELEMENT_TYPE_DATE),r.input.setI18n(e.getEngine().getI18n()),r.input.setAttribute("data-role","i123-input"),r.input.withHash(a).setAccessibilityEnabled(s),r.input.setFormat(r.getProperty("validation.type")||Ee.VALIDATOR_TYPE_DATE_MMDDYYYY),r.input.setAttribute("aria-live","assertive"),r.input.setAttribute("role","alert"),r.input.setAttribute("aria-labelledby","date-".concat(a,"-acc")+" date-".concat(a,"-error-acc")+" date-".concat(a,"-instr-acc")+" date-".concat(a,"-day")+" date-".concat(a,"-month")+" date-".concat(a,"-year")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getDateValue",value:function(){var e=this.getProperty("value.value");if(null===e)return null;var t=new Date;return t.setTime(1e3*e),t}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_DATE}},{key:"getElementName",value:function(){return"Date"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.updateShowInstructionsOnClick(),this.setDateControlOptions(),this.updateHiddenAttribute(),this.loadDefaultDateValueIntoForm(),this.validateDateInterval(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_DATE_MMDDYYYY),e.getValidatorById(Ee.VALIDATOR_TYPE_DATE_DDMMYYYY),e.getValidatorById(Ee.VALIDATOR_TYPE_DATE_YYYYMMDD),e.getValidatorById(Ee.VALIDATOR_TYPE_DATE_MMYYYY)]}},{key:"onValueChanged",value:function(){var e=this.input.getDateValue();this.setProperty("value.value",null===e?null:Math.floor(e.getTime()/1e3)),this.validateDateInterval(),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"getStringValue",value:function(){return this.input.getValue()}},{key:"setStringValue",value:function(e){try{this.input.setValue(e)}catch(t){this.input.setDateValue(null)}this.onValueChanged()}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.stringValue",type:"string",optional:!0};default:return null}}},{key:"setDateControlOptions",value:function(){this.input.withWeekStart(this.getProperty("configuration.weekStart")),this.input.withAcceptedDaysOfWeek(this.getProperty("configuration.acceptedDaysOfWeek")),this.input.withHash(this.getHash()),this.input.setFormat(this.getProperty("validation.type"))}},{key:"synchronizeValue",value:function(){var e,t=this.getProperty("value.value");null===t?e=null:(e=new Date).setTime(1e3*t),this.input.setDateValue(e),null!==e&&this.hasError(Dt.ERR_INVALID_DATE)&&this.removeError(Dt.ERR_INVALID_DATE)}},{key:"setupDefaults",value:function(){this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_date_name"));var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DEFAULT_USER_PREFERENCES);return e&&(this.setProperty("validation.type",e.dateFormat),this.setDateControlOptions()),this.updateLabelText(),this}},{key:"getAcceptedDaysOfWeekString",value:function(){var e=[];return this.hasProperty("configuration.acceptedDaysOfWeek")&&this.getProperty("configuration.acceptedDaysOfWeek")&&(e=this.getProperty("configuration.acceptedDaysOfWeek").map(String)),e}},{key:"setAcceptedDaysOfWeekString",value:function(e){var t=[];if(e)for(var n=0,i=e.length;n<i;n++)t[n]=~~e[n];this.hasProperty("configuration.acceptedDaysOfWeek")&&this.setProperty("configuration.acceptedDaysOfWeek",t)}},{key:"loadDefaultDateValueIntoForm",value:function(){var e="",t=this.hasProperty("validation.type")&&this.getProperty("validation.type")?this.getProperty("validation.type"):Ee.VALIDATOR_TYPE_DATE_MMDDYYYY,n=this.hasProperty("configuration.defaultValue")?this.getProperty("configuration.defaultValue"):void 0;"string"!==typeof n&&(e=this.convertDateTimestampToString(n)),n||0===n?(this.input.setDateValue(this.getForm().getEngine().getTimeUtils().stringToTime(e||n,t)),this.onValueChanged()):this.input.setDateValue(null)}},{key:"formatDateString",value:function(e){var t=e.length>10?new Date(e).getTime()/1e3:new Date(e.replace(/-/g,"/")).getTime()/1e3;if(25294===this.getForm().getId()&&"salesforce-eu.123formbuilder.com"===window.location.hostname){var n=this.hasProperty("validation.type")?this.getProperty("validation.type"):"",i=""!==n?n:Ee.VALIDATOR_TYPE_DATE_MMDDYYYY;t=this.getForm().getEngine().getTimeUtils().stringToTime(e||String(e),i).getTime()/1e3}else{var r,a=this.hasProperty("validation.type")?this.getProperty("validation.type"):void 0;switch(this.getTimeFormatFromValidatorType(String(a))){case"%m-%Y":(r=/^([\d]{2})[\/\-\.]{1}([\d]{4})$/.exec(e))&&(t=new Date("".concat(r[1],"/01/").concat(r[2])).getTime()/1e3);break;case"%d-%m-%Y":(r=/^([\d]{2})[\/\-\.]{1}([\d]{2})[\/\-\.]{1}([\d]{4})$/.exec(e))&&(t=new Date("".concat(r[2],"/").concat(r[1],"/").concat(r[3])).getTime()/1e3);break;default:t=e.length>10?new Date(e).getTime()/1e3:new Date(e.replace(/-/g,"/")).getTime()/1e3}}return this.convertDateTimestampToString(t)}},{key:"convertDateTimestampToString",value:function(e){var t,n=this.hasProperty("validation.type")?this.getProperty("validation.type"):void 0;return n&&(t=this.getTimeFormatFromValidatorType(String(n))),this.getForm().getEngine().getTimeUtils().formatTime(e,t)}},{key:"getTimeFormatFromValidatorType",value:function(e){switch(e){case Ee.VALIDATOR_TYPE_DATE_YYYYMMDD:e="%Y-%m-%d";break;case Ee.VALIDATOR_TYPE_DATE_MMDDYYYY:e="%m-%d-%Y";break;case Ee.VALIDATOR_TYPE_DATE_MMYYYY:e="%m-%Y";break;case Ee.VALIDATOR_TYPE_DATE_DDMMYYYY:default:e="%d-%m-%Y"}return e}},{key:"checkDateRelativeValues",value:function(e){var t,n,i="",r="",a=this.getProperty("configuration.maxDateRelativeValue")||void 0,o=this.getProperty("configuration.minDateRelativeValue")||void 0,s=(this.hasProperty("validation.type")?this.getProperty("validation.type"):void 0)||Ee.VALIDATOR_TYPE_DATE_MMDDYYYY;"string"!==typeof a&&(i=this.convertDateTimestampToString(a)),"string"!==typeof o&&(r=this.convertDateTimestampToString(o)),t=void 0!==a?this.getForm().getEngine().getTimeUtils().stringToTime(i||String(a),s):null,n=void 0!==o?this.getForm().getEngine().getTimeUtils().stringToTime(r||String(o),s):null,this.updateDateControlErrorState(e,t,n)}},{key:"updateDateControlErrorState",value:function(e,t,n){var i=this;if(null!==n&&e.getTime()<n.setHours(0,0,0,0)){var r=this.getTimeFormatFromValidatorType(this.getProperty("validation.type")),a=this.getForm().getEngine().getTimeUtils().formatTime(n.getTime()/1e3,r),o=this.getForm().getEngine().getI18n().translateText("textdef_221",a,a),s="The selected date must be ".concat(a," or after ").concat(a);setTimeout((function(){i.addError(Dt.ERR_DATE_TOO_SMALL,o||s)}),50)}else this.removeError(Dt.ERR_DATE_TOO_SMALL);if(null!==t&&e.getTime()>t.setHours(23,59,59,999)){var l=this.getTimeFormatFromValidatorType(this.getProperty("validation.type")),u=this.getForm().getEngine().getTimeUtils().formatTime(t.getTime()/1e3,l),c=this.getForm().getEngine().getI18n().translateText("textdef_220",u,u),d="The selected date must be ".concat(u," or before ").concat(u);setTimeout((function(){i.addError(Dt.ERR_DATE_TOO_BIG,c||d)}),50)}else this.removeError(Dt.ERR_DATE_TOO_BIG)}},{key:"onReset",value:function(){this.loadDefaultDateValueIntoForm(),this.validateDateInterval()}},{key:"validateDateInterval",value:function(){var e=new Date,t=this.getProperty("value.value");if(null===t)return this.removeError(Dt.ERR_DATE_TOO_BIG),void this.removeError(Dt.ERR_DATE_TOO_SMALL);e.setTime(1e3*t),this.checkDateRelativeValues(e)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onBlur",value:function(){var e=this.input.getDateValue();if(this.isValidDate(e))e==this.getDateValue()&&(this.setProperty("value.value",null===e?null:Math.floor(e.getTime()/1e3)),this.validateDateInterval(),this.isAttached()&&this.getForm().trigger("input",this),this.hasError(Dt.ERR_INVALID_DATE)&&this.removeError(Dt.ERR_INVALID_DATE));else if(!this.input.isDateFieldEmpty()){var t=this.getForm().getEngine().getI18n().translateText("textdef_228");this.addError(Dt.ERR_INVALID_DATE,t||"The selected date is invalid.")}}},{key:"isValidDate",value:function(e){return!!e}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.input.setReadOnly(e)}},{key:"setProperty",value:function(e,t){if(p()(E()(n.prototype),"setProperty",this).apply(this,arguments),"value.value"===e){var i=this.getProperty("value.value"),r=null;if(i){var a=new Date(1e3*i);r="".concat(a.getFullYear(),"-").concat("0".concat(a.getMonth()+1).slice(-2),"-").concat("0".concat(a.getDate()).slice(-2))}this.setProperty("value.dateString",r)}return this}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_DATE,name:"Date",isContainer:!1,category:"advanced",keywords:"date time day",icon:"i123-editor_field_date",isVirtual:!1,i18nName:"edt_UI_control_type_date_name",i18nKeywords:"edt_UI_control_type_date_keywords",index:140,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);function ai(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(ri,"attributes",{}),v()(ri,"runtime",null),v()(ri,"nodeName","date");var oi=function(e){g()(n,e);var t=ai(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),v()(c()(r),"defaultOptionIndex",-1),v()(c()(r),"forceSelectedIndex",void 0);var a=r.getHash();return r.properties&&r.properties.choices&&r.properties.choices.values&&(r.properties.choices.values=r.trimChoiceValues(r.properties.choices.values)),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","dropdown-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","dropdown-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","dropdown-".concat(a,"-instr-acc")),r.getProperty("options.searchable")?r.input=Bt.createElement(Bt.ELEMENT_TYPE_SEARCHABLE_DROPDOWN):r.input=Bt.createElement(Bt.ELEMENT_TYPE_DROPDOWN),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","dropdown-".concat(a,"-acc ")+"dropdown-".concat(a,"-error-acc ")+"dropdown-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_DROPDOWN}},{key:"getElementName",value:function(){return"Dropdown"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"updateChoices",value:function(){if(this.hasProperty("choices.values")){for(;this.input.getOptions().length;)this.input.remove(0);var e;if(this.hasProperty("choices.isDropdownWithForms")&&this.getProperty("choices.isDropdownWithForms"))this.updateChoicesWithForms();else{if(this.hasProperty("choices.isWorkflowsUserDropdown")&&this.getProperty("choices.isWorkflowsUserDropdownSelectAll")){var t=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.WORKFLOWS_USERS_LIST);e=[];for(var n=0,i=t.length;n<i;n++)e.push({index:n,numberOfTimesThisOptionHasBeenChosen:0,text:t[n].email,value:t[n].email})}else e=jt.clone(this.getProperty("choices.values")||[]);this.updateChoicesFunctionality(e)}}}},{key:"updateChoicesFunctionality",value:function(e){this.getProperty("choices.displayPlaceholderText")&&this.input.add(gt.create(this.input,"",this.getProperty("options.placeholderText")));for(var t=0,n=e.length;t<n;t++)e[t].index=t;this.hasProperty("options.randomizeOrder")&&this.getProperty("options.randomizeOrder")&&(e=jt.shuffle(e)),this.defaultOptionIndex=null;for(var i=0,r=e.length;i<r;i++)if(e[i].isDefault){e[i].numberOfTimesThisOptionCanBeChosen&&e[i].numberOfTimesThisOptionCanBeChosen-e[i].numberOfTimesThisOptionHasBeenChosen<=0&&e[i].numberOfTimesThisOptionCanBeChosen>=-1?this.defaultOptionIndex=-1:this.defaultOptionIndex=i;break}if(-1===this.defaultOptionIndex)for(var a=0,o=e.length;a<o;a++)if(e[a].numberOfTimesThisOptionCanBeChosen&&e[a].numberOfTimesThisOptionCanBeChosen-e[a].numberOfTimesThisOptionHasBeenChosen>0&&e[a].numberOfTimesThisOptionCanBeChosen>=-1){this.defaultOptionIndex=a;break}null===this.defaultOptionIndex&&(this.defaultOptionIndex=-1),this.hasProperty("choices.allowOther")&&this.getProperty("choices.allowOther")&&e.push({text:"Other...",isOther:!0,index:-1});for(var s,l=this.hasProperty("options.showNumberOfChoicesLeft")&&this.getProperty("options.showNumberOfChoicesLeft"),u=0,c=e.length;u<c;u++)e[u].value=e[u].value||e[u].text,this.setupChoiceTextNumberOfChoicesLeft(e[u],l,null),s=gt.create(this.input,void 0===e[u].value?e[u].text:e[u].value,e[u].text),this.setupOptionDisabledStateIfNoChoicesLeft(e[u],s),s.setAttribute("data-index",String(e[u].index)),e[u].isOther&&s.setAttribute("data-role","other-option"),this.input.add(s);var d=null;if(!this.getProperty("choices.displayPlaceholderText")){for(var p=0,h=e.length;p<h;p++)if(e[p].isDefault){e[p].numberOfTimesThisOptionCanBeChosen&&e[p].numberOfTimesThisOptionCanBeChosen-e[p].numberOfTimesThisOptionHasBeenChosen<=0&&e[p].numberOfTimesThisOptionCanBeChosen>=-1?(d="",this.setProperty("value.value",d),this.setProperty("value.index",-1)):d=e[p].value;break}null!==d&&""!==d?this.input.setValue(d):-1!==this.defaultOptionIndex&&this.input.setValue(e[this.defaultOptionIndex].value)}}},{key:"updateChoicesWithForms",value:function(){!function(e){var t=e.getForm().getEngine().getJQuery(),n=jt.clone(e.getProperty("choices.values")||[]);e.getFormsByGroups(t,n,e.getForm().getEngine().getLoader().getFormId()).then((function(t){for(var n=[],i=0,r=t.length||0;i<r;i++)n.push({index:i,numberOfTimesThisOptionHasBeenChosen:0,text:t[i].name,value:t[i].id>0?t[i].id:""});e.updateChoicesFunctionality(n)})).fail((function(t){e.getForm().getEngine().getLoader().getUI().alert("Error loading forms","There was a network error obtaining groups. Please retry. If the problem persists, contact support")}))}(this)}},{key:"getFormsByGroups",value:function(e,t,n){return e.Deferred((function(i){e.post("/modules/CustomScripts/classes/Hilti/DropdownForms/ajaxCall.php",{do:"getFormsByGroupsNewEditor",formID:n,groups:t},(function(e){i.resolve(e)}),"json").fail((function(e){i.reject(e)}))})).promise()}},{key:"setupChoiceTextNumberOfChoicesLeft",value:function(e,t,n){if(e.numberOfTimesThisOptionCanBeChosen&&null!==e.numberOfTimesThisOptionCanBeChosen&&e.numberOfTimesThisOptionCanBeChosen>=-1){var i=~~e.numberOfTimesThisOptionHasBeenChosen;i<0&&(i=0);var r=e.numberOfTimesThisOptionCanBeChosen-i,a=this.getForm().getEngine().getI18n(),o="",s=null!==n?n:e.text;switch(!0){case e.numberOfTimesThisOptionCanBeChosen-e.numberOfTimesThisOptionHasBeenChosen<=0:o="textdef_174";break;case e.numberOfTimesThisOptionCanBeChosen-e.numberOfTimesThisOptionHasBeenChosen===1:o="textdef_173";break;default:o="textdef_174"}var l=a.translateText(o);t&&(e.text=1===r?"".concat(s," (1 ").concat(l&&l!==o?"".concat(l,")"):"choice left)"):"".concat(s," (").concat(Math.max(r,0)," ").concat(l&&l!==o?"".concat(l,")"):"choices left)"))}}},{key:"onCreated",value:function(){var e=this.getProperty("options.placeholderText");this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateChoices(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.getForm().getEngine().getLoader().getLoaderType()!==T.v.EDIT||e?this.onValueChanged():this.input.setSelectedIndex(this.getDefaultOptionIndex())}},{key:"getProperty",value:function(e){return void 0!==this.forceSelectedIndex&&"value.index"===e?this.forceSelectedIndex:p()(E()(n.prototype),"getProperty",this).call(this,e)}},{key:"onValueChanged",value:function(){var e=this.input.getValue(),t=-1;this.setProperty("value.value",""===e?null:e);for(var n=0,i=this.getProperty("choices.values")||[],r=i.length;n<r;n++)if(i[n].text===e){t=n;break}this.getProperty("options.placeholderText")||this.resetValueIfValueIsPlaceholder(e),this.setProperty("value.index",-1===t?null:t),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value")),this.input.setSelectedIndex(null===this.input.getSelectedIndex()?-1:this.input.getSelectedIndex())}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",optional:!0,type:"string"};default:return null}}},{key:"isNumberOfTimesAnOptionCanBeChosen",value:function(){for(var e=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),t=0,n=e.length;t<n;t++)if(e[t].numberOfTimesThisOptionCanBeChosen)return!0;return!1}},{key:"setIsNumberOfTimesAnOptionCanBeChosen",value:function(e){for(var t=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),n=0,i=t.length;n<i;n++)e?void 0!==t[n].numberOfTimesThisOptionCanBeChosen&&null!==t[n].numberOfTimesThisOptionCanBeChosen||(t[n].numberOfTimesThisOptionCanBeChosen=0):t[n].numberOfTimesThisOptionCanBeChosen=null;this.setProperty("choices.values",t)}},{key:"getChoicesValues",value:function(){return JSON.parse(JSON.stringify(this.getProperty("choices.values")||[]))}},{key:"setChoicesValues",value:function(e){if(null!==e)for(var t=0;t<e.length;t++)e[t].text=e[t].text.replace(/^\s+|\s+$/g,"");this.setProperty("choices.values",e)}},{key:"onReset",value:function(){this.updateChoices(),this.onValueChanged()}},{key:"setupDefaults",value:function(){this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_dropdown_name")),this.updateLabelText();var e=JSON.parse(JSON.stringify(this.getProperty("choices.values")));if(e&&e.length)for(var t=this.getForm().getEngine().getI18n(),n=0,i=Math.min(e.length,5);n<i;n++)e[n].text=t.translateText("formeditor_dropdownChoice".concat(n+1));return this.getProperty("options.placeholderText")&&e[0].isDefault&&(e[0].isDefault=!1),this.setProperty("choices.values",e),this.setProperty("options.placeholderText","Please select"),this.updateChoices(),this}},{key:"setProperty",value:function(e,t){return"choices.values"===e?p()(E()(n.prototype),"setProperty",this).call(this,e,this.trimChoiceValues(t)):p()(E()(n.prototype),"setProperty",this).call(this,e,t)}},{key:"getDefaultOptionIndex",value:function(){return this.defaultOptionIndex}},{key:"setValue",value:function(e){if(p()(E()(n.prototype),"setValue",this).call(this,e),e&&void 0===e.index)for(var t=this.getProperty("choices.values")||[],i=0,r=t.length;i<r;i++)if(t[i].text===e.value){this.setProperty("value.index",i);break}}},{key:"setupOptionDisabledStateIfNoChoicesLeft",value:function(e,t){e.numberOfTimesThisOptionCanBeChosen&&null!==e.numberOfTimesThisOptionCanBeChosen&&e.numberOfTimesThisOptionCanBeChosen>=-1&&(e.numberOfTimesThisOptionCanBeChosen-~~e.numberOfTimesThisOptionHasBeenChosen>0?t.removeAttribute("disabled"):t.setAttribute("disabled","true"))}},{key:"setupI18n",value:function(){var e,t,i=this.getProperty("options.placeholderText"),r=this.getId(),a=this.getForm().getEngine().getI18n(),o=JSON.parse(JSON.stringify(this.getProperty("choices.values"))),s=this.getProperty("options.showNumberOfChoicesLeft"),l=this.getProperty("value.value");if(r&&this.input.getOptions){for(var u=this.input.getOptions(),c=0,d=u.length;c<d;c++)if(u[c].hasAttribute&&u[c].hasAttribute("data-index")){var h=~~u[c].getAttribute("data-index");(e="control_label_".concat(r,"_choice_").concat(h))!==(t=a.translateText(e))&&t&&(s&&o[h].numberOfTimesThisOptionCanBeChosen&&null!==o[h].numberOfTimesThisOptionCanBeChosen&&o[h].numberOfTimesThisOptionCanBeChosen>=-1?(this.setupChoiceTextNumberOfChoicesLeft(o[h],s,t),u[c].text=o[h].text,this.setupOptionDisabledStateIfNoChoicesLeft(o[h],u[c])):u[c].text=t)}else i&&(u[c].text=a.translateTextDefault("control_placeholder_".concat(r),i));i||this.resetValueIfValueIsPlaceholder(l),this.input.trigger("update")}return p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"withForceSelectedIndex",value:function(e){return this.forceSelectedIndex=e,this}},{key:"enumerateTranslations",value:function(){var e=[],t=(this.getForm().getEngine().getI18n(),this.getProperty("label.labelText")||""),n=this.getProperty("instructions.text")||"",i=this.getProperty("options.placeholderText")||"";t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),i&&e.push({key:"control_placeholder_".concat(this.getId()),sourceText:i});for(var r=this.getProperty("choices.values")||[],a=0,o=r.length;a<o;a++)r[a].text&&e.push({key:"control_label_".concat(this.getId(),"_choice_").concat(a),sourceText:r[a].text});return e}},{key:"resetValueIfValueIsPlaceholder",value:function(e){var t=String(this.getForm().getEngine().getI18n().translateText("edt_placeholder_dropdown_option")||"");e&&this.getForm().getEngine().getI18n().translateText("edt_placeholder_dropdown_option")&&(this.isOriginalEqualWithTranslated(e,t)||!this.isOriginalEqualWithTranslated(e,t)&&"please select"===e.toLowerCase())&&this.setProperty("value.value","")}},{key:"isOriginalEqualWithTranslated",value:function(e,t){return e.toLowerCase()===t.toLowerCase()}},{key:"trimChoiceValues",value:function(e){if(Array.isArray(e)){for(var t=jt.clone(e),n=0,i=t.length;n<i;n++)t[n].text=String(t[n].text||"").trim();return t}return e}},{key:"getPlaceholderTextVisibility",value:function(){return null!==this.getProperty("options.placeholderText")}},{key:"setPlaceholderTextVisibility",value:function(e){var t=this.getProperty("options.placeholderText")||"Please select";e?this.setProperty("options.placeholderText",t):this.setProperty("options.placeholderText",null),document.querySelector("#item .placeholder-text-input").value=t}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_DROPDOWN,name:"DropDown",isContainer:!1,category:"basic",keywords:"dropdown select drop down",icon:"i123-editor_field_dropdown",isVirtual:!1,i18nName:"edt_UI_control_type_dropdown_name",i18nKeywords:"edt_UI_control_type_dropdown_keywords",index:30,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);function si(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(oi,"attributes",{}),v()(oi,"runtime",null),v()(oi,"nodeName","drop-down");var li=function(e){g()(n,e);var t=si(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash(),s=r.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","file".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","file-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","file-".concat(a,"-instr-acc")),r.input=Bt.createElement(Bt.ELEMENT_TYPE_FILE).withControl(c()(r)),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("type","file"),r.input.setAttribute("aria-labelledby","file".concat(a,"-acc file-control-placeholder-acc ")+"file-".concat(a,"-error-acc ")+"file-".concat(a,"-instr-acc")),r.input.setAccessibility(s),r.input.withMultiple(r.getProperty("options.multiple")).withMinUploadSizeInBytes(r.getProperty("configuration.minSizeInBytes")||null).withMaxUploadSizeInBytes(r.getProperty("configuration.maxSizeInBytes")||null).withFileUtils(e.getEngine().getFileUtils()).withAllowDirectoryUpload(r.getProperty("options.multiple")&&r.getProperty("configuration.isAllowFolderUpload")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_FILE}},{key:"getElementName",value:function(){return"File"}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateInstructionsText(),this.updateErrorsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.synchronizeValue(),this.updateDisabledFileExtensions(),this.updateAllowedFileExtensions(),this.updateHiddenAttribute()}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"setDownloadURL",value:function(e){if(null===e)this.input.setDownloadInfo(null);else{var t={name:null,size:null,url:e},n=e.split("#").slice(1).join("#");if(n)try{var i=JSON.parse(atob(n));i&&("string"===typeof i.name&&i.name&&(t.name=i.name),"number"===typeof i.size&&i.size>=0&&(t.size=i.size))}catch(r){}this.input.setDownloadInfo(t)}this.onValueChanged()}},{key:"getDownloadURL",value:function(){var e=this.input.getDownloadInfo();return e?e.url:null}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.downloadURL",optional:!0,type:"string"};default:return null}}},{key:"onValueChanged",value:function(){this.setProperty("value.files",this.input.getFilesList()),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateAllowedFileExtensions",value:function(){this.input.withAllowedFileExtensions(this.getProperty("configuration.allowExtensions"))}},{key:"updateDisabledFileExtensions",value:function(){this.input.withForbiddenFileExtensions(this.getProperty("configuration.forbidExtensions"))}},{key:"getMinInputRowWidth",value:function(){return 15}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_file_name")),this.updateLabelText(),this}},{key:"getErrors",value:function(){for(var e=p()(E()(n.prototype),"getErrors",this).call(this)||[],t=this.input.getErrors(),i=0,r=t.length;i<r;i++)e.push(t[i]);return e.length?e:null}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"onReset",value:function(){this.input.clearFiles()}},{key:"setProperty",value:function(e,t){var i=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.VIEW_FORM_CONTEXT);return"value.files"===e&&i===T.Z.PDF_EXPORT?this:p()(E()(n.prototype),"setProperty",this).call(this,e,t)}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"getMinSizeInKiloBytes",value:function(){var e=this.getProperty("configuration.minSizeInBytes"),t=null;return null!==e&&(t=Math.floor(e/n.KILOBYTE_CONVERSION_FACTOR)),t}},{key:"setMinSizeInKiloBytes",value:function(e){null!==e?this.setProperty("configuration.minSizeInBytes",e*n.KILOBYTE_CONVERSION_FACTOR):this.setProperty("configuration.minSizeInBytes",null)}},{key:"getMaxSizeInKiloBytes",value:function(){var e=this.getProperty("configuration.maxSizeInBytes"),t=null;return null!==e&&(t=Math.floor(e/n.KILOBYTE_CONVERSION_FACTOR)),t}},{key:"setMaxSizeInKiloBytes",value:function(e){null!==e?this.setProperty("configuration.maxSizeInBytes",e*n.KILOBYTE_CONVERSION_FACTOR):this.setProperty("configuration.maxSizeInBytes",null)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_FILE,name:"File",isContainer:!1,category:"basic",keywords:"file upload",icon:"i123-file_upload",isVirtual:!1,i18nName:"edt_UI_control_type_file_name",i18nKeywords:"edt_UI_control_type_file_keywords",index:60,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);v()(li,"attributes",{}),v()(li,"runtime",null),v()(li,"nodeName","file"),v()(li,"KILOBYTE_CONVERSION_FACTOR",1024);var ui=function(){function e(){o()(this,e)}return l()(e,null,[{key:"init",value:function(){if(null===this.diacriticsMap){this.diacriticsMap={};for(var e=0;e<this.replacementList.length;e+=1)for(var t=this.replacementList[e].chars,n=0;n<t.length;n+=1)this.diacriticsMap[t[n]]=this.replacementList[e].base}}},{key:"removeDiacritics",value:function(e){var t=this;return this.init(),e.replace(/[^\u0000-\u007e]/g,(function(e){return t.diacriticsMap[e]||e}))}},{key:"getDOMWidth",value:function(e){try{var t=document.createElement("canvas").getContext("2d");return t.font="14px Open sans",Math.round(t.measureText(e).width)}catch(n){}}}]),e}();v()(ui,"diacriticsMap",null),v()(ui,"replacementList",[{base:" ",chars:"\xa0"},{base:"0",chars:"\u07c0"},{base:"A",chars:"\u24b6\uff21\xc0\xc1\xc2\u1ea6\u1ea4\u1eaa\u1ea8\xc3\u0100\u0102\u1eb0\u1eae\u1eb4\u1eb2\u0226\u01e0\xc4\u01de\u1ea2\xc5\u01fa\u01cd\u0200\u0202\u1ea0\u1eac\u1eb6\u1e00\u0104\u023a\u2c6f"},{base:"AA",chars:"\ua732"},{base:"AE",chars:"\xc6\u01fc\u01e2"},{base:"AO",chars:"\ua734"},{base:"AU",chars:"\ua736"},{base:"AV",chars:"\ua738\ua73a"},{base:"AY",chars:"\ua73c"},{base:"B",chars:"\u24b7\uff22\u1e02\u1e04\u1e06\u0243\u0181"},{base:"C",chars:"\u24b8\uff23\ua73e\u1e08\u0106C\u0108\u010a\u010c\xc7\u0187\u023b"},{base:"D",chars:"\u24b9\uff24\u1e0a\u010e\u1e0c\u1e10\u1e12\u1e0e\u0110\u018a\u0189\u1d05\ua779"},{base:"Dh",chars:"\xd0"},{base:"DZ",chars:"\u01f1\u01c4"},{base:"Dz",chars:"\u01f2\u01c5"},{base:"E",chars:"\u025b\u24ba\uff25\xc8\xc9\xca\u1ec0\u1ebe\u1ec4\u1ec2\u1ebc\u0112\u1e14\u1e16\u0114\u0116\xcb\u1eba\u011a\u0204\u0206\u1eb8\u1ec6\u0228\u1e1c\u0118\u1e18\u1e1a\u0190\u018e\u1d07"},{base:"F",chars:"\ua77c\u24bb\uff26\u1e1e\u0191\ua77b"},{base:"G",chars:"\u24bc\uff27\u01f4\u011c\u1e20\u011e\u0120\u01e6\u0122\u01e4\u0193\ua7a0\ua77d\ua77e\u0262"},{base:"H",chars:"\u24bd\uff28\u0124\u1e22\u1e26\u021e\u1e24\u1e28\u1e2a\u0126\u2c67\u2c75\ua78d"},{base:"I",chars:"\u24be\uff29\xcc\xcd\xce\u0128\u012a\u012c\u0130\xcf\u1e2e\u1ec8\u01cf\u0208\u020a\u1eca\u012e\u1e2c\u0197"},{base:"J",chars:"\u24bf\uff2a\u0134\u0248\u0237"},{base:"K",chars:"\u24c0\uff2b\u1e30\u01e8\u1e32\u0136\u1e34\u0198\u2c69\ua740\ua742\ua744\ua7a2"},{base:"L",chars:"\u24c1\uff2c\u013f\u0139\u013d\u1e36\u1e38\u013b\u1e3c\u1e3a\u0141\u023d\u2c62\u2c60\ua748\ua746\ua780"},{base:"LJ",chars:"\u01c7"},{base:"Lj",chars:"\u01c8"},{base:"M",chars:"\u24c2\uff2d\u1e3e\u1e40\u1e42\u2c6e\u019c\u03fb"},{base:"N",chars:"\ua7a4\u0220\u24c3\uff2e\u01f8\u0143\xd1\u1e44\u0147\u1e46\u0145\u1e4a\u1e48\u019d\ua790\u1d0e"},{base:"NJ",chars:"\u01ca"},{base:"Nj",chars:"\u01cb"},{base:"O",chars:"\u24c4\uff2f\xd2\xd3\xd4\u1ed2\u1ed0\u1ed6\u1ed4\xd5\u1e4c\u022c\u1e4e\u014c\u1e50\u1e52\u014e\u022e\u0230\xd6\u022a\u1ece\u0150\u01d1\u020c\u020e\u01a0\u1edc\u1eda\u1ee0\u1ede\u1ee2\u1ecc\u1ed8\u01ea\u01ec\xd8\u01fe\u0186\u019f\ua74a\ua74c"},{base:"OE",chars:"\u0152"},{base:"OI",chars:"\u01a2"},{base:"OO",chars:"\ua74e"},{base:"OU",chars:"\u0222"},{base:"P",chars:"\u24c5\uff30\u1e54\u1e56\u01a4\u2c63\ua750\ua752\ua754"},{base:"Q",chars:"\u24c6\uff31\ua756\ua758\u024a"},{base:"R",chars:"\u24c7\uff32\u0154\u1e58\u0158\u0210\u0212\u1e5a\u1e5c\u0156\u1e5e\u024c\u2c64\ua75a\ua7a6\ua782"},{base:"S",chars:"\u24c8\uff33\u1e9e\u015a\u1e64\u015c\u1e60\u0160\u1e66\u1e62\u1e68\u0218\u015e\u2c7e\ua7a8\ua784"},{base:"T",chars:"\u24c9\uff34\u1e6a\u0164\u1e6c\u021a\u0162\u1e70\u1e6e\u0166\u01ac\u01ae\u023e\ua786"},{base:"Th",chars:"\xde"},{base:"TZ",chars:"\ua728"},{base:"U",chars:"\u24ca\uff35\xd9\xda\xdb\u0168\u1e78\u016a\u1e7a\u016c\xdc\u01db\u01d7\u01d5\u01d9\u1ee6\u016e\u0170\u01d3\u0214\u0216\u01af\u1eea\u1ee8\u1eee\u1eec\u1ef0\u1ee4\u1e72\u0172\u1e76\u1e74\u0244"},{base:"V",chars:"\u24cb\uff36\u1e7c\u1e7e\u01b2\ua75e\u0245"},{base:"VY",chars:"\ua760"},{base:"W",chars:"\u24cc\uff37\u1e80\u1e82\u0174\u1e86\u1e84\u1e88\u2c72"},{base:"X",chars:"\u24cd\uff38\u1e8a\u1e8c"},{base:"Y",chars:"\u24ce\uff39\u1ef2\xdd\u0176\u1ef8\u0232\u1e8e\u0178\u1ef6\u1ef4\u01b3\u024e\u1efe"},{base:"Z",chars:"\u24cf\uff3a\u0179\u1e90\u017b\u017d\u1e92\u1e94\u01b5\u0224\u2c7f\u2c6b\ua762"},{base:"a",chars:"\u24d0\uff41\u1e9a\xe0\xe1\xe2\u1ea7\u1ea5\u1eab\u1ea9\xe3\u0101\u0103\u1eb1\u1eaf\u1eb5\u1eb3\u0227\u01e1\xe4\u01df\u1ea3\xe5\u01fb\u01ce\u0201\u0203\u1ea1\u1ead\u1eb7\u1e01\u0105\u2c65\u0250\u0251"},{base:"aa",chars:"\ua733"},{base:"ae",chars:"\xe6\u01fd\u01e3"},{base:"ao",chars:"\ua735"},{base:"au",chars:"\ua737"},{base:"av",chars:"\ua739\ua73b"},{base:"ay",chars:"\ua73d"},{base:"b",chars:"\u24d1\uff42\u1e03\u1e05\u1e07\u0180\u0183\u0253\u0182"},{base:"c",chars:"\uff43\u24d2\u0107\u0109\u010b\u010d\xe7\u1e09\u0188\u023c\ua73f\u2184"},{base:"d",chars:"\u24d3\uff44\u1e0b\u010f\u1e0d\u1e11\u1e13\u1e0f\u0111\u018c\u0256\u0257\u018b\u13e7\u0501\ua7aa"},{base:"dh",chars:"\xf0"},{base:"dz",chars:"\u01f3\u01c6"},{base:"e",chars:"\u24d4\uff45\xe8\xe9\xea\u1ec1\u1ebf\u1ec5\u1ec3\u1ebd\u0113\u1e15\u1e17\u0115\u0117\xeb\u1ebb\u011b\u0205\u0207\u1eb9\u1ec7\u0229\u1e1d\u0119\u1e19\u1e1b\u0247\u01dd"},{base:"f",chars:"\u24d5\uff46\u1e1f\u0192"},{base:"ff",chars:"\ufb00"},{base:"fi",chars:"\ufb01"},{base:"fl",chars:"\ufb02"},{base:"ffi",chars:"\ufb03"},{base:"ffl",chars:"\ufb04"},{base:"g",chars:"\u24d6\uff47\u01f5\u011d\u1e21\u011f\u0121\u01e7\u0123\u01e5\u0260\ua7a1\ua77f\u1d79"},{base:"h",chars:"\u24d7\uff48\u0125\u1e23\u1e27\u021f\u1e25\u1e29\u1e2b\u1e96\u0127\u2c68\u2c76\u0265"},{base:"hv",chars:"\u0195"},{base:"i",chars:"\u24d8\uff49\xec\xed\xee\u0129\u012b\u012d\xef\u1e2f\u1ec9\u01d0\u0209\u020b\u1ecb\u012f\u1e2d\u0268\u0131"},{base:"j",chars:"\u24d9\uff4a\u0135\u01f0\u0249"},{base:"k",chars:"\u24da\uff4b\u1e31\u01e9\u1e33\u0137\u1e35\u0199\u2c6a\ua741\ua743\ua745\ua7a3"},{base:"l",chars:"\u24db\uff4c\u0140\u013a\u013e\u1e37\u1e39\u013c\u1e3d\u1e3b\u017f\u0142\u019a\u026b\u2c61\ua749\ua781\ua747\u026d"},{base:"lj",chars:"\u01c9"},{base:"m",chars:"\u24dc\uff4d\u1e3f\u1e41\u1e43\u0271\u026f"},{base:"n",chars:"\u24dd\uff4e\u01f9\u0144\xf1\u1e45\u0148\u1e47\u0146\u1e4b\u1e49\u019e\u0272\u0149\ua791\ua7a5\u043b\u0509"},{base:"nj",chars:"\u01cc"},{base:"o",chars:"\u24de\uff4f\xf2\xf3\xf4\u1ed3\u1ed1\u1ed7\u1ed5\xf5\u1e4d\u022d\u1e4f\u014d\u1e51\u1e53\u014f\u022f\u0231\xf6\u022b\u1ecf\u0151\u01d2\u020d\u020f\u01a1\u1edd\u1edb\u1ee1\u1edf\u1ee3\u1ecd\u1ed9\u01eb\u01ed\xf8\u01ff\ua74b\ua74d\u0275\u0254\u1d11"},{base:"oe",chars:"\u0153"},{base:"oi",chars:"\u01a3"},{base:"oo",chars:"\ua74f"},{base:"ou",chars:"\u0223"},{base:"p",chars:"\u24df\uff50\u1e55\u1e57\u01a5\u1d7d\ua751\ua753\ua755\u03c1"},{base:"q",chars:"\u24e0\uff51\u024b\ua757\ua759"},{base:"r",chars:"\u24e1\uff52\u0155\u1e59\u0159\u0211\u0213\u1e5b\u1e5d\u0157\u1e5f\u024d\u027d\ua75b\ua7a7\ua783"},{base:"s",chars:"\u24e2\uff53\u015b\u1e65\u015d\u1e61\u0161\u1e67\u1e63\u1e69\u0219\u015f\u023f\ua7a9\ua785\u1e9b\u0282"},{base:"ss",chars:"\xdf"},{base:"t",chars:"\u24e3\uff54\u1e6b\u1e97\u0165\u1e6d\u021b\u0163\u1e71\u1e6f\u0167\u01ad\u0288\u2c66\ua787"},{base:"th",chars:"\xfe"},{base:"tz",chars:"\ua729"},{base:"u",chars:"\u24e4\uff55\xf9\xfa\xfb\u0169\u1e79\u016b\u1e7b\u016d\xfc\u01dc\u01d8\u01d6\u01da\u1ee7\u016f\u0171\u01d4\u0215\u0217\u01b0\u1eeb\u1ee9\u1eef\u1eed\u1ef1\u1ee5\u1e73\u0173\u1e77\u1e75\u0289"},{base:"v",chars:"\u24e5\uff56\u1e7d\u1e7f\u028b\ua75f\u028c"},{base:"vy",chars:"\ua761"},{base:"w",chars:"\u24e6\uff57\u1e81\u1e83\u0175\u1e87\u1e85\u1e98\u1e89\u2c73"},{base:"x",chars:"\u24e7\uff58\u1e8b\u1e8d"},{base:"y",chars:"\u24e8\uff59\u1ef3\xfd\u0177\u1ef9\u0233\u1e8f\xff\u1ef7\u1e99\u1ef5\u01b4\u024f\u1eff"},{base:"z",chars:"\u24e9\uff5a\u017a\u1e91\u017c\u017e\u1e93\u1e95\u01b6\u0225\u0240\u2c6c\ua763"}]);var ci=n(211);function di(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var pi=function(e){g()(n,e);var t=di(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"inputContainer",void 0),v()(c()(r),"prefixLabel",void 0),v()(c()(r),"input",void 0),v()(c()(r),"onValueCalculatedThrottler",void 0),v()(c()(r),"recalculateThrottler",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","formula-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","formula-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","number-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","number"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("data-type","formula"),r.input.setAttribute("data-no-theme",""),r.input.setAttribute("readOnly","true"),r.prefixLabel=document.createElement("span"),r.prefixLabel.setAttribute("data-role","prefix-label"),r.prefixLabel.setAttribute("id","price-".concat(a,"-prefix-acc")),r.inputContainer=document.createElement("div"),r.inputContainer.setAttribute("data-role","input-container"),r.inputContainer.setAttribute("data-ui-role","ui-element"),r.inputContainer.appendChild(r.prefixLabel),r.inputContainer.appendChild(r.input),r.recalculateThrottler=O.a.create((function(){r.recalculate()}),100),r.input.setAttribute("aria-labelledby","formula-".concat(a,"-acc ")+"formula-".concat(a,"-error-acc ")+"number-".concat(a,"-instr-acc")),r.onValueCalculatedThrottler=O.a.create((function(){r.validateValue()}),100),r.updateAccessibilityTabIndexes(),r.getForm().getEngine().getLoader().getRules().on("dispatch",(function(t){var n=parseInt(t.replace(/^control_/,""),10),i=e.getElementById(n);i&&i.getElementKind()===T.m.CONTROL&&i.getTypeId()!==C.a.CONTROL_TYPE_FORMULA&&r.recalculateThrottler()})),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_FORMULA}},{key:"getElementName",value:function(){return"Formula"}},{key:"updatePrefixLabel",value:function(){this.prefixLabel.textContent=this.getProperty("configuration.prefix")||"",this.adjustInputPadding()}},{key:"syncInputCompactField",value:function(){this.input.placeholder=this.inputContainer.hasAttribute("placeholder")?this.inputContainer.getAttribute("placeholder"):""}},{key:"adjustInputPadding",value:function(){var e=this;setTimeout((function(){var t=e.getForm().getEngine().getTheme().properties.input.padding.horizontal,n=e.getForm().getRootNode().getAttribute("data-text-direction"),i=e.prefixLabel.offsetWidth>parseInt(t,10)?"".concat(e.prefixLabel.offsetWidth+8,"px"):t;"ltr"===n?(e.input.style.paddingLeft=i,e.input.style.removeProperty("padding-right")):(e.input.style.paddingRight=i,e.input.style.removeProperty("padding-left"))}),1)}},{key:"getSupportedValidators",value:function(){return[this.getForm().getEngine().getValidator().getValidatorById(Ee.VALIDATOR_TYPE_NUMERIC)]}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.inputContainer,width:T.y.FULL}]}]}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"number",optional:!0};default:return null}}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.updatePrefixLabel(),this.syncInputCompactField(),this.addEventListeners(),setTimeout((function(){e.hidePrefixLabelIfNeeded()}),1e3)}},{key:"addEventListeners",value:function(){var e=this,t=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.UNDO_SERVICE),n=this.getForm().getEngine();t&&t.on("user-action",(function(t){"resize-end"===t&&e.hidePrefixLabelIfNeeded()})),window.addEventListener("resize",Object(ci.a)((function(){e.hidePrefixLabelIfNeeded()}),500)),this.input.addEventListener("focus",(function(){e.rootNode.querySelector('div[data-role="input-container"]').setAttribute("data-is-focused-child-element","1")})),this.input.addEventListener("blur",(function(){e.rootNode.querySelector('div[data-role="input-container"]').removeAttribute("data-is-focused-child-element")})),n.getDocument().on("update-text-direction",(function(){e.adjustInputPadding()})),n.getLoader().on("navigate-to-relative-page-number",(function(){e.hidePrefixLabelIfNeeded()}))}},{key:"hidePrefixLabelIfNeeded",value:function(){var e=this.getProperty("configuration.prefix")||"",t=parseInt(getComputedStyle(this.prefixLabel).paddingLeft,10),n=parseInt(getComputedStyle(this.input).paddingRight,10),i=ui.getDOMWidth(e);this.inputContainer.offsetWidth<i+t+n+30?this.prefixLabel.style.display="none":this.prefixLabel.style.removeProperty("display"),this.adjustInputPadding()}},{key:"onFocusEnter",value:function(){var e=this,t=setInterval((function(){e.getPrefixInspectorInput()&&(e.updateInspectorPrefix(),clearInterval(t))}),500)}},{key:"onReset",value:function(){this.validateValue()}},{key:"onDuplicate",value:function(){p()(E()(n.prototype),"onDuplicate",this).call(this),this.hasProperty("configuration.isLimitSubmissionsEnabled")&&this.getProperty("configuration.isLimitSubmissionsEnabled")&&(this.hasProperty("configuration.currentSubmissionsValue")&&this.setProperty("configuration.currentSubmissionsValue",null),this.updateInstructionsText())}},{key:"onValueChanged",value:function(){}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_formula_name")),this.updateLabelText(),this}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"updateInstructionsText",value:function(){if(void 0!==this.instructionsDOMNode){var e=this.getProperty("instructions.text"),t=this.hasProperty("configuration.limitSubmissionsTotal")&&this.getProperty("configuration.limitSubmissionsTotal")||null,n=this.hasProperty("configuration.currentSubmissionsValue")?this.getProperty("configuration.currentSubmissionsValue"):null,i=null!==t?Math.max(0,t-n):null,r="The maximum accepted value is ".concat(i),a=this.hasProperty("configuration.isLimitSubmissionsEnabled")?this.getProperty("configuration.isLimitSubmissionsEnabled"):null;null!==i&&a?(this.instructionsDOMNode.removeAttribute("data-is-empty"),e?(this.instructionsDOMNode.textContent=e,this.instructionsDOMNode.appendChild(document.createElement("br"))):this.instructionsDOMNode.textContent="",this.instructionsDOMNode.appendChild(document.createTextNode(r))):null===e||""===e?(this.instructionsDOMNode.setAttribute("data-is-empty","1"),this.instructionsDOMNode.textContent=""):(this.instructionsDOMNode.removeAttribute("data-is-empty"),this.instructionsDOMNode.textContent=e)}}},{key:"validateValue",value:function(){var e=this.getProperty("value.value");if(0===e||e||(e=null),null===e)return this.removeError(Dt.ERR_NUMBER_TOO_BIG),this.removeError(Dt.ERR_NUMBER_TOO_LONG),this.removeError(Dt.ERR_NUMBER_TOO_SHORT),this.removeError(Dt.ERR_NUMBER_TOO_SMALL),void this.removeError(Dt.ERR_MAX_ACCEPTED_VALUE_EXCEEDED);var t=this.hasProperty("configuration.minLength")?this.getProperty("configuration.minLength"):null,n=this.hasProperty("configuration.maxLength")?this.getProperty("configuration.maxLength"):null,i=this.hasProperty("configuration.minValue")?this.getProperty("configuration.minValue"):null,r=this.hasProperty("configuration.maxValue")?this.getProperty("configuration.maxValue"):null,a=this.hasProperty("configuration.isLimitSubmissionsEnabled")&&this.getProperty("configuration.isLimitSubmissionsEnabled");if(null!=n&&n>0&&(String(e).length>n?this.addError(Dt.ERR_NUMBER_TOO_LONG,this.getForm().getEngine().getI18n().translateText("textdef_71",String(n))||"The number is too long"):this.removeError(Dt.ERR_NUMBER_TOO_LONG)),null!=t&&t>0&&(String(e).length<t?this.addError(Dt.ERR_NUMBER_TOO_SHORT,this.getForm().getEngine().getI18n().translateText("textdef_70",String(t))||"The number is too short"):this.removeError(Dt.ERR_NUMBER_TOO_SHORT)),null!=r&&(e>r?this.addError(Dt.ERR_NUMBER_TOO_BIG,this.getForm().getEngine().getI18n().translateText("textdef_73",String(r))||"The value you have provided is too big"):this.removeError(Dt.ERR_NUMBER_TOO_BIG)),null!=i&&(e<i?this.addError(Dt.ERR_NUMBER_TOO_SMALL,this.getForm().getEngine().getI18n().translateText("textdef_72",String(i))||"The value you have provided is too small"):this.removeError(Dt.ERR_NUMBER_TOO_SMALL)),a){var o=this.getProperty("configuration.currentSubmissionsValue"),s=this.getProperty("configuration.limitSubmissionsTotal");if(null!==s){var l=Math.max(0,s-o);e>l&&(null===r||l<r)?(this.removeError(Dt.ERR_NUMBER_TOO_BIG),this.addError(Dt.ERR_MAX_ACCEPTED_VALUE_EXCEEDED,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_41")||"The maximum accepted value is "," ").concat(l))):this.removeError(Dt.ERR_MAX_ACCEPTED_VALUE_EXCEEDED)}}}},{key:"getPrefixVisibility",value:function(){return(this.getProperty("configuration.prefix")||"").length>0}},{key:"setPrefixVisibility",value:function(e){var t=this.getProperty("configuration.prefix")||"USD";e?this.setProperty("configuration.prefix",this.getProperty("configuration.prefix")||"USD"):this.setProperty("configuration.prefix",null),this.getPrefixInspectorInput().value=t}},{key:"updateInspectorPrefix",value:function(){var e=this.getPrefixInspectorInput();e.addEventListener("keypress",(function(t){if(!jt.isInputTextSelected(e)){var n=0;n+=e.value.replace(/[^a-z0-9]/gi,"").length;for(var i=0;i<e.value.length;i++)e.value.charCodeAt(i)>127&&n++;n>=4&&(t.key.match(/[a-z0-9]/gi)||t.key.charCodeAt(0)>127)&&t.preventDefault()}}))}},{key:"getPrefixInspectorInput",value:function(){return document.querySelector('#item [data-property-name="configuration-prefix"] input')}},{key:"setVisible",value:function(e){p()(E()(n.prototype),"setVisible",this).call(this,e),this.recalculateThrottler(),this.hidePrefixLabelIfNeeded()}},{key:"recalculate",value:function(){if(this.isVisible(!0)&&this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW){var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.RULES_QUERY_BUILDER),t=this.getForm().getEngine().getLoader().getRules().getDatabase();if(e){var n=e.getCalculationSQLStatements(String(this.getId()));if(n&&n.length)for(var i=0,r=n.length;i<r;i++){var a=t.createStatement(n[i]);t.executeStatement(a)}}}}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_FORMULA,name:"Formula",isContainer:!1,category:"advanced",keywords:"formula calculation",icon:"i123-field_formula",isVirtual:!1,i18nName:"edt_UI_control_type_formula_name",i18nKeywords:"edt_UI_control_type_formula_keywords",index:99,accessibilityFields:T.r.NONE}}}]),n}(rn);function hi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(pi,"nodeName","formula"),v()(pi,"attributes",{}),v()(pi,"runtime",null);var gi=function(e){g()(n,e);var t=hi(n);function n(e,i){var r;o()(this,n);var a=(r=t.call(this,e,i)).getHash();return r.rootNode.setAttribute("id","htmlblock-".concat(a,"-acc")),r.rootNode.setAttribute("aria-labelledby","htmlblock-".concat(a,"-acc")),r.updateAccessibilityTabIndexes(),n.instanceID++,r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_HTML_BLOCK}},{key:"getElementName",value:function(){return"HTML block"}},{key:"setRendererType",value:function(e){}},{key:"updateHTMLContent",value:function(){var e=this.getProperty("configuration.innerHTML");e=jt.addNoFollowOnLinks(e),this.rootNode.innerHTML=S.sanitizeHTMLUsingUserRights(e||"")}},{key:"updateFieldNameAttribute",value:function(){var e=String(this.getProperty("configuration.fieldName"))||"";this.rootNode.setAttribute("field-name",e)}},{key:"onCreated",value:function(){this.updateHTMLContent(),this.updateFieldNameAttribute()}},{key:"onReset",value:function(){}},{key:"setupDefaults",value:function(){var e;return this.setProperty("configuration.fieldName",e="".concat(this.getForm().getEngine().getI18n().translateText("formeditor_fieldTypeHtmlBlock")," ").concat(n.instanceID)),this.rootNode.setAttribute("field-name",e),this}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"configuration.innerHTML",type:"string",optional:!0};default:return null}}},{key:"cloneNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=p()(E()(n.prototype),"cloneNode",this).call(this,!!e,t);return i.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_html_block_name")," ").concat(n.instanceID)),i}},{key:"setupI18n",value:function(){var e=this.getId();return e&&this.rootNode.setAttribute("data-i18n-html","control_label_".concat(e)),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("configuration.innerHTML")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),e}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_HTML_BLOCK,name:"HTML Block",isContainer:!1,category:"basic",keywords:"html block text",icon:"i123-code",isVirtual:!1,i18nName:"edt_UI_control_type_html_block_name",i18nKeywords:"edt_UI_control_type_html_block_keywords",index:80,accessibilityFields:T.r.ROOT_NODE}}}]),n}(tn);function _i(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(gi,"instanceID",0),v()(gi,"attributes",{}),v()(gi,"runtime",null),v()(gi,"nodeName","html-block");var fi=function(e){g()(n,e);var t=_i(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"elementTypeId",void 0),e}return l()(n,[{key:"getTypeId",value:function(){return void 0===this.elementTypeId?C.a.ELEMENT_NOT_SUPPORTED:this.elementTypeId}},{key:"getElementName",value:function(){return"Unsupported element"}},{key:"setRendererType",value:function(e){}},{key:"updateHTMLContent",value:function(){this.getRootNode().innerHTML="This element is not supported on your Plan. Please Upgrade.";var e="unknown";switch(this.elementTypeId){case C.a.CONTROL_TYPE_FILE:e=li.getConfiguration().name;break;case C.a.CONTROL_TYPE_HTML_BLOCK:e=gi.getConfiguration().name;break;case C.a.CONTROL_TYPE_FORMULA:e=pi.getConfiguration().name;break;case C.a.CONTROL_TYPE_COUPON:e=ni.getConfiguration().name;break;default:e=this.getElementName()}this.getRootNode().setAttribute("data-i18n-text","userAccountUpgrade_81"),this.getRootNode().setAttribute("data-i18n-param","controlName=".concat(e))}},{key:"onCreated",value:function(){this.updateHTMLContent()}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"withTypeId",value:function(e){return this.elementTypeId=e,this}},{key:"setProperty",value:function(e,t){return this}},{key:"getProperty",value:function(e){return null}},{key:"enumerateProperties",value:function(){return[]}},{key:"hasProperty",value:function(e){return!1}},{key:"isDuplicatable",value:function(){return!1}},{key:"isDragable",value:function(){return!1}},{key:"onReset",value:function(){}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.ELEMENT_NOT_SUPPORTED,name:"Not Supported",isContainer:!1,category:"basic",keywords:"not supported element anymore",icon:"i123-code",isVirtual:!0,index:99999,accessibilityFields:T.r.NONE}}}]),n}(tn);function yi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(fi,"attributes",{}),v()(fi,"runtime",null),v()(fi,"nodeName","not-supported");var Ei=function(e){g()(n,e);var t=yi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"inputContainer",void 0),v()(c()(r),"prefixLabel",void 0),v()(c()(r),"input",void 0),v()(c()(r),"hasSuggestions",!0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","text-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","text-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","text-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","text"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("data-no-theme",""),r.input.setAttribute("aria-labelledby","text-".concat(a,"-acc ")+"text-".concat(a,"-error-acc ")+"text-".concat(a,"-instr-acc")),r.prefixLabel=document.createElement("span"),r.prefixLabel.setAttribute("data-role","prefix-label"),r.prefixLabel.setAttribute("id","price-".concat(a,"-prefix-acc")),r.inputContainer=document.createElement("div"),r.inputContainer.setAttribute("data-role","input-container"),r.inputContainer.setAttribute("data-ui-role","ui-element"),r.inputContainer.appendChild(r.prefixLabel),r.inputContainer.appendChild(r.input),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_TEXT}},{key:"getElementName",value:function(){return"Text"}},{key:"updatePrefixLabel",value:function(){this.prefixLabel.textContent=this.getProperty("configuration.prefix")||"",this.adjustInputPadding()}},{key:"syncInputCompactField",value:function(){this.input.placeholder=this.inputContainer.hasAttribute("placeholder")?this.inputContainer.getAttribute("placeholder"):""}},{key:"adjustInputPadding",value:function(){var e=this;setTimeout((function(){var t=e.getForm().getEngine().getTheme().properties.input.padding.horizontal,n=e.getForm().getRootNode().getAttribute("data-text-direction"),i=e.prefixLabel.offsetWidth>parseInt(t,10)?"".concat(e.prefixLabel.offsetWidth+8,"px"):t;"ltr"===n?(e.input.style.paddingLeft=i,e.input.style.removeProperty("padding-right")):(e.input.style.paddingRight=i,e.input.style.removeProperty("padding-left"))}),1)}},{key:"adjustPrefixLabelOpacity",value:function(){this.input.value.length>0||null!==this.getErrors()?this.prefixLabel.style.removeProperty("opacity"):this.prefixLabel.style.opacity=".5"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.inputContainer,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateDefaultValue(),this.validateValue(),this.updateHiddenAttribute(),this.initializeSuggestions(),this.updatePrefixLabel(),this.adjustPrefixLabelOpacity(),this.syncInputCompactField(),this.addEventListeners(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.onReadonlyStateChanged(),setTimeout((function(){e.hidePrefixLabelIfNeeded()}),1e3)}},{key:"addEventListeners",value:function(){var e=this,t=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.UNDO_SERVICE),n=this.getForm().getEngine();t&&t.on("user-action",(function(t){"resize-end"===t&&e.hidePrefixLabelIfNeeded()})),window.addEventListener("resize",Object(ci.a)((function(){e.hidePrefixLabelIfNeeded()}),500)),this.input.addEventListener("focus",(function(){e.rootNode.querySelector('div[data-role="input-container"]').setAttribute("data-is-focused-child-element","1")})),this.input.addEventListener("blur",(function(){e.rootNode.querySelector('div[data-role="input-container"]').removeAttribute("data-is-focused-child-element")})),n.getDocument().on("update-text-direction",(function(){e.adjustInputPadding()})),n.getLoader().on("navigate-to-relative-page-number",(function(){e.hidePrefixLabelIfNeeded()}))}},{key:"hidePrefixLabelIfNeeded",value:function(){var e=this.getProperty("configuration.prefix")||"",t=parseInt(getComputedStyle(this.prefixLabel).paddingLeft,10),n=parseInt(getComputedStyle(this.input).paddingRight,10),i=ui.getDOMWidth(e);this.inputContainer.offsetWidth<i+t+n+30?this.prefixLabel.style.display="none":this.prefixLabel.style.removeProperty("display"),this.adjustInputPadding()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_NONE),e.getValidatorById(Ee.VALIDATOR_TYPE_ALPHA),e.getValidatorById(Ee.VALIDATOR_TYPE_ALPHANUMERIC),e.getValidatorById(Ee.VALIDATOR_TYPE_ALPHASPACE),e.getValidatorById(Ee.VALIDATOR_TYPE_ALPHANUMERICSPACE),e.getValidatorById(Ee.VALIDATOR_TYPE_FULL_NAME),e.getValidatorById(Ee.VALIDATOR_TYPE_REGEX),e.getValidatorById(Ee.VALIDATOR_TYPE_NUMERIC)]}},{key:"onFocusEnter",value:function(){var e=this,t=setInterval((function(){e.getPrefixInspectorInput()&&(e.updateInspectorPrefix(),clearInterval(t))}),500)}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.validateValue(),this.adjustPrefixLabelOpacity(),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"validateValue",value:function(){var e=this.getProperty("configuration.minLength"),t=this.getProperty("configuration.maxLength"),n=this.getProperty("value.value")||"";n?(null!==t&&t>0&&(n.length>t?this.addError(Dt.ERR_TOO_MANY_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_71",String(t))||"You have more characters than allowed"):this.removeError(Dt.ERR_TOO_MANY_CHARACTERS)),null!==e&&e>0&&(n.length<e?this.addError(Dt.ERR_TOO_FEW_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_70",String(e))||"You have fewer characters than allowed"):this.removeError(Dt.ERR_TOO_FEW_CHARACTERS))):(this.removeError(Dt.ERR_TOO_FEW_CHARACTERS),this.removeError(Dt.ERR_TOO_MANY_CHARACTERS))}},{key:"updateDefaultValue",value:function(){var e=this.getProperty("configuration.defaultValue"),t=e&&e.trim();this.getProperty("configuration.defaultValueIsUniqueId")?this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW?this.setProperty("value.value",String((+new Date).toString(32))):this.setProperty("value.value","<UNIQUE_ID>"):(this.setProperty("value.value",""===e?null:t),this.setProperty("configuration.defaultValue",t)),this.onReadonlyStateChanged(),this.synchronizeValue()}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.setValue({value:this.getProperty("configuration.defaultValue")}),this.validateValue()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_text_name")),this.updateLabelText(),this}},{key:"onBlur",value:function(){this.checkIfElementValueIsSynchronized()}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"getSuggestionsVisibility",value:function(){return null!==(this.getProperty("options.suggestions")||null)}},{key:"setSuggestionsVisibility",value:function(e){e?this.setProperty("options.suggestions",this.getProperty("options.suggestions")||""):this.setProperty("options.suggestions",null)}},{key:"initializeSuggestions",value:function(){var e=this;this.getForm().getEngine().on("compute-form-rules-done",(function(){setTimeout((function(){e.getSuggestionsVisibility()?e.suggestionsDropDown(Bt.getJQuery()):e.getForm().getEngine().getJQuery()(e.input).parent().find("[data-autocomplete-items]").remove()}),1e3)}))}},{key:"getPrefixVisibility",value:function(){return(this.getProperty("configuration.prefix")||"").length>0}},{key:"setPrefixVisibility",value:function(e){var t=this.getProperty("configuration.prefix")||"USD";e?this.setProperty("configuration.prefix",this.getProperty("configuration.prefix")||"USD"):this.setProperty("configuration.prefix",null),this.getPrefixInspectorInput().value=t}},{key:"updateInspectorPrefix",value:function(){var e=this.getPrefixInspectorInput();e.addEventListener("keypress",(function(t){if(!jt.isInputTextSelected(e)){var n=0;n+=e.value.replace(/[^a-z0-9]/gi,"").length;for(var i=0;i<e.value.length;i++)e.value.charCodeAt(i)>127&&n++;n>=4&&(t.key.match(/[a-z0-9]/gi)||t.key.charCodeAt(0)>127)&&t.preventDefault()}}))}},{key:"getPrefixInspectorInput",value:function(){return document.querySelector('#item [data-property-name="configuration-prefix"] input')}},{key:"suggestionsDropDown",value:function(e){var t,i=this,r=this.getProperty("options.suggestions").split("\n"),a=this.input;!function(o){function s(t){a.value=t,o.onValueChanged(),e(a).trigger("input"),e(a).trigger("change")}function l(){for(var t=e(a).parent().find("[data-autocomplete-items]"),n=0,i=t.length;n<i;n++)t[n].parentNode.removeChild(t[n])}function u(e,t){var n=document.createElement("div"),i=document.createElement("strong"),r=t.toUpperCase().indexOf(e.toUpperCase()),a=t.length,o=t.substr(r,e.length);if(i.appendChild(document.createTextNode(o)),r>0){var s=t.substr(0,r);n.appendChild(document.createTextNode(s))}n.appendChild(i);var l=r+e.length;if(l<a){var u=t.substr(l,a);n.appendChild(document.createTextNode(u))}return n.setAttribute("data-value",String(t||"")),n}function c(e){if(0===e.length)return!1;!function(e){for(var t=0;t<e.length;t++)e[t].removeAttribute("data-autocomplete-active")}(e),t>=e.length&&(t=0),t<0&&(t=e.length-1),e[t].setAttribute("data-autocomplete-active","")}function d(i){if(null!==o.getProperty("options.suggestions")){n.initialize(),l(),t=-1;for(var c=function(){var t=document.createElement("div");t.setAttribute("data-autocomplete-items",""),e(t).width("".concat(a.offsetWidth,"px"));var n=a.getBoundingClientRect();return e(t).css({top:"".concat(~~n.top+~~n.height,"px")}),e(t).on("mousedown","> div",(function(){s(e(this).attr("data-value")),l()})),t}(),d=!1,p=0,h=r.length;p<h;p++)if(r[p].toUpperCase().indexOf(i.toUpperCase())>=0){var g=u(i,r[p]);e(c).append(g),d=!0}d?e(a).parent().append(c):e(c).remove()}}e(i.input).on("input",(function(){d(this.value)})),e(i.input).on("click",(function(e){e.stopPropagation(),d(this.value)})),e(a).on("keydown",(function(n){var i=e(a).parent().find("[data-autocomplete-items]").find("div");switch(n.keyCode){case at.KEY_DOWN:t++,c(i),n.preventDefault();break;case at.KEY_UP:t--,c(i),n.preventDefault();break;case at.KEY_ENTER:t>-1&&i.length&&(s(i[t].getAttribute("data-value")),l()),n.preventDefault();break;case at.KEY_ESC:l(),n.preventDefault()}})),e(i.input).on("blur",(function(){l()}))}(this)}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly")||this.getProperty("configuration.defaultValueIsUniqueId");this.setReadonly(e)}},{key:"isReadonly",value:function(){return this.input.readOnly}},{key:"setReadonly",value:function(e){return this.input.readOnly=e,this}},{key:"emulateUserInput",value:function(){var e=this;!function(t){t([e.input]).trigger("input")}(this.getForm().getEngine().getJQuery())}},{key:"setVisible",value:function(e){p()(E()(n.prototype),"setVisible",this).call(this,e),this.hidePrefixLabelIfNeeded()}}],[{key:"initialize",value:function(){this.initialized||(!function(e){e(window).on("scroll","[data-autocomplete-items]",(function(e){e.stopPropagation()})),document.body.addEventListener("scroll",(function(){for(var e=0,t=document.querySelectorAll("[data-autocomplete-items]"),n=t.length;e<n;e++)t[e].parentNode.removeChild(t[e])}),{passive:!0})}(Bt.getJQuery()),this.initialized=!0)}},{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_TEXT,name:"Text",isContainer:!1,category:"basic",keywords:"short text input textbox open",icon:"i123-editor_field_shorttext",isVirtual:!1,i18nName:"edt_UI_control_type_text_name",i18nKeywords:"edt_UI_control_type_text_keywords",index:10,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function mi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ei,"attributes",{}),v()(Ei,"runtime",null),v()(Ei,"nodeName","text"),v()(Ei,"initialized",!1);var vi,Ti=function(e){g()(n,e);var t=mi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),v()(c()(r),"hasSuggestions",!0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","email".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","email-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","email-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","email"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","email".concat(a,"-acc ")+"email-".concat(a,"-error-acc ")+"email-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_EMAIL}},{key:"getElementName",value:function(){return"Email"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.updateDefaultValue(),this.initializeSuggestions(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.onReadonlyStateChanged()}},{key:"validateInput",value:function(){var e=this.getForm().getEngine().getValidator(),t=this.getProperty("value.value")||"";t&&!e.validate(t,Ee.VALIDATOR_TYPE_EMAIL)?this.addError(Dt.ERR_INVALID_EMAIL,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_5"),": ").concat(this.getForm().getEngine().getI18n().translateText("textdef_49"))||"The email address is invalid"):this.hasError(Dt.ERR_INVALID_EMAIL)&&this.removeError(Dt.ERR_INVALID_EMAIL)}},{key:"getSupportedValidators",value:function(){return[this.getForm().getEngine().getValidator().getValidatorById(Ee.VALIDATOR_TYPE_EMAIL)]}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateDefaultValue",value:function(){var e=String(this.getProperty("configuration.defaultValue")||"");this.setProperty("value.value",""===e?null:e),this.synchronizeValue()}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.updateDefaultValue(),this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_email_name")),this.updateLabelText(),this}},{key:"onBlur",value:function(){var e=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);this.validateInput(),this.checkIfElementValueIsSynchronized(),e&&(this.errorDOMNode.tabIndex=0)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"getSuggestionsVisibility",value:function(){return null!==(this.getProperty("options.suggestions")||null)}},{key:"setSuggestionsVisibility",value:function(e){e?this.setProperty("options.suggestions",this.getProperty("options.suggestions")||""):this.setProperty("options.suggestions",null)}},{key:"initializeSuggestions",value:function(){var e=this;this.getForm().getEngine().on("compute-form-rules-done",(function(){setTimeout((function(){e.getSuggestionsVisibility()?e.suggestionsDropDown(Bt.getJQuery()):e.getForm().getEngine().getJQuery()(e.input).parent().find("[data-autocomplete-items]").remove()}),1e3)}))}},{key:"suggestionsDropDown",value:function(e){var t,i=this,r=this.getProperty("options.suggestions").split("\n"),a=this.input;!function(o){function s(t){a.value=t,o.onValueChanged(),e(a).trigger("input"),e(a).trigger("change")}function l(){for(var t=e(a).parent().find("[data-autocomplete-items]"),n=0,i=t.length;n<i;n++)t[n].parentNode.removeChild(t[n])}function u(e,t){var n=document.createElement("div"),i=document.createElement("strong");return i.appendChild(document.createTextNode(t.substr(0,e.length))),n.appendChild(i),n.appendChild(document.createTextNode(t.substr(e.length))),n.setAttribute("data-value",String(t||"")),n}function c(e){if(0===e.length)return!1;!function(e){for(var t=0;t<e.length;t++)e[t].removeAttribute("data-autocomplete-active")}(e),t>=e.length&&(t=0),t<0&&(t=e.length-1),e[t].setAttribute("data-autocomplete-active","")}function d(i){if(null!==o.getProperty("options.suggestions")){n.initialize(),l(),t=-1;for(var c=function(){var t=document.createElement("div");t.setAttribute("data-autocomplete-items",""),e(t).width("".concat(a.offsetWidth,"px"));var n=a.getBoundingClientRect();return e(t).css({top:"".concat(~~n.top+~~n.height,"px")}),e(t).on("mousedown","> div",(function(){s(e(this).attr("data-value")),l()})),t}(),d=!1,p=0,h=r.length;p<h;p++)if(r[p].substr(0,i.length).toUpperCase()===i.toUpperCase()){var g=u(i,r[p]);e(c).append(g),d=!0}d?e(a).parent().append(c):e(c).remove()}}e(i.input).on("input",(function(){d(this.value)})),e(i.input).on("click",(function(e){e.stopPropagation(),d(this.value)})),e(a).on("keydown",(function(n){var i=e(a).parent().find("[data-autocomplete-items]").find("div");switch(n.keyCode){case at.KEY_DOWN:t++,c(i),n.preventDefault();break;case at.KEY_UP:t--,c(i),n.preventDefault();break;case at.KEY_ENTER:t>-1&&i.length&&(s(i[t].getAttribute("data-value")),l()),n.preventDefault();break;case at.KEY_ESC:l(),n.preventDefault()}})),e(i.input).on("blur",(function(){l()}))}(this)}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.setReadonly(e)}},{key:"isReadonly",value:function(){return this.input.readOnly}},{key:"setReadonly",value:function(e){return this.input.readOnly=e,this}}],[{key:"initialize",value:function(){Ei.initialize()}},{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_EMAIL,name:"Email",isContainer:!1,category:"advanced",keywords:"email mail address",icon:"i123-email",isVirtual:!1,i18nName:"edt_UI_control_type_email_name",i18nKeywords:"edt_UI_control_type_email_keywords",index:100,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function Oi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ti,"attributes",{}),v()(Ti,"runtime",null),v()(Ti,"nodeName","email"),function(e){e.TYPE_APPEND="append",e.TYPE_INSERT_BEFORE="insertBefore",e.TYPE_REPLACE="replace"}(vi||(vi={}));var Ci=function(e){g()(n,e);var t=Oi(n);function n(e){var i;return o()(this,n),i=t.call(this),v()(c()(i),"node",void 0),v()(c()(i),"options",void 0),v()(c()(i),"config",void 0),v()(c()(i),"selectedOption",null),v()(c()(i),"jq",void 0),v()(c()(i),"dropdownDirectionPlugin",!0),v()(c()(i),"onValueChanged",void 0),i.jq=e,i}return l()(n,[{key:"init",value:function(e,t,n){var i=this;return this.node=e,this.options=t,this.setConfig(n),this.setSelectedOption(),this.appendSelect(),setTimeout((function(){return i.bindEvents()}),5),this}},{key:"appendSelect",value:function(){var e=this.render();switch(this.jq(this.node).append(e),this.config.append){case vi.TYPE_APPEND:this.jq(this.node).append(e);break;case vi.TYPE_INSERT_BEFORE:this.jq(this.node).children().length>0?this.jq(this.node).prepend(e):this.jq(this.node).append(e);break;case vi.TYPE_REPLACE:this.virtualSelectAppendReplace(e)}}},{key:"virtualSelectAppendReplace",value:function(e){!function(t,n){var i=n(t.node).prop("attributes"),r=n(t.node).parent().append(e).children("div:last-child");n.each(i,(function(){"undefined"===typeof n(r).attr(this.name)&&n(r).attr(this.name,this.value)})),n(t.node).remove(),t.setNode(n(r).parent())}(this,this.jq)}},{key:"reRender",value:function(){!function(e,t){t(e.node).empty(),e.appendSelect()}(this,this.jq)}},{key:"render",value:function(){var e=this.getSelectedOption(),t=document.createElement("div");return t.className="virtual-select",null!==this.config.fixedWidth&&(t.style.width=this.config.fixedWidth),!0!==this.config.light||window.innerWidth<=767?t.setAttribute("data-light","false"):t.setAttribute("data-light","true"),t.setAttribute("data-size","".concat(this.config.size)),this.config.sizeSm&&t.setAttribute("data-sm-size","".concat(this.config.sizeSm)),this.config.sizeMd&&t.setAttribute("data-md-size","".concat(this.config.sizeSm)),this.config.sizeLg&&t.setAttribute("data-lg-size","".concat(this.config.sizeSm)),null!==e&&"undefined"!==typeof e.label||t.setAttribute("data-not-selected","true"),this.jq(t).append(this.renderPlaceholder()),t}},{key:"renderPlaceholder",value:function(){var e=this.getSelectedOption(),t=document.createElement("div"),n=document.createElement("span"),i=document.createElement("span");return t.className="virtual-select-placeholder",n.className="title-placeholder",i.className="arrow-placeholder",null!==e&&"undefined"!==typeof e.label?n.innerText="".concat(this.selectedOption.label):n.innerText=this.placeholderText(),t.innerHTML=n.outerHTML+i.outerHTML,t}},{key:"bindEvents",value:function(){!function(e,t){e.options&&"object"===r()(e.options)&&e.options.length>0?t(e.node).on("click",".virtual-select-placeholder",(function(n){n.stopImmediatePropagation(),n.preventDefault(),null!==e.config.changeOptions&&e.config.changeOptions(e),t(e.node).find(".virtual-select").append(e.renderSelect()).append((function(){var n=this,i={placeholder:e.placeholderText(),plugins:{no_results:{message:"No match found"},start_typing:{},scroll_dropdown_view_on_selected_item_top:{}},onInitialize:function(){var e=this;this.revertSettings.$children.each((function(){t(this).children().length&&t(this).children().each((function(){t.extend(e.options[this.value],t(this).data())})),t.extend(e.options[this.value],t(this).data())}))},render:{option:function(t,n){var i=e.getSelectedOption(),r="",a="";return t.hasOwnProperty("extraClass")&&(r+="".concat(t.extraClass)),null!==i&&i.hasOwnProperty("id")&&this.value==i.id&&(a="selected"),'<div class="option '.concat(a," ").concat(r,'">').concat(t.text," ").concat(a,"</div>")}},onDropdownClose:function(i){setTimeout((function(){"undefined"!==typeof i.attr("data-no-match-found")&&"true"===i.attr("data-no-match-found")||(t(n).find("select").each((function(e,t){e.selectize&&e.selectize().destroy()})),t(n).empty(),t(n).append(e.renderPlaceholder()))}),10)},onDropdownOpen:function(){t(".selectize-dropdown-content").perfectScrollbar({minScrollbarLength:10})}};e.dropdownDirectionPlugin&&(i.plugins.dropdown_direction={},i.dropdownDirection="auto"),t(this).find("select").selectize(i),t(this).find(".virtual-select-placeholder").hide(),setTimeout((function(){var e=t(n).find("select")[0];"undefined"!==typeof e&&"undefined"!==typeof e.selectize&&e.selectize.open()}),250)}))})).on("change","select",(function(n){n.stopImmediatePropagation(),n.preventDefault(),this.value&&("undefined"!==typeof t(e.node).find(".virtual-select").attr("data-not-selected")&&t(e.node).find(".virtual-select").removeAttr("data-not-selected"),e.changeSelectedStatusById(this.value),e.trigger("change",e))})).on("click",".selectize-control",(function(e){e.stopImmediatePropagation(),e.preventDefault(),t(this).parent().find("select.selectized")[0].selectize.open()})).on("mouseover",(function(t){e.trigger("hover",t)})).on("mouseenter",(function(t){e.trigger("mouseenter",t)})).on("mouseleave",(function(t){e.trigger("mouseleave",t)})):e.trigger("render-fail",e)}(this,this.jq)}},{key:"renderSelect",value:function(){var e=document.createElement("select"),t=this.config.selected;this.config.isSearchable||e.classList.add("no-search"),this.dropdownDirectionPlugin&&e.classList.add("dropdown-direction-plugin"),e.setAttribute("placeholder",this.placeholderText());var n=document.createElement("option");if(n.value="",n.text=this.placeholderText(),e.appendChild(n),Array.isArray(this.options)&&this.options.length>0){for(var i in this.options)if(this.options.hasOwnProperty(i))if(this.options[i].hasOwnProperty("groupLabel")){var r=document.createElement("optgroup");for(var a in r.setAttribute("label",this.options[i].groupLabel),this.options[i].options)if(this.options[i].options.hasOwnProperty(a)){var o=document.createElement("option");o.value=this.options[i].options[a].id.toString(),o.text=this.options[i].options[a].label,null!==t&&t.toString()===this.options[i].options[a].id.toString()&&(o.setAttribute("selected","selected"),o.setAttribute("class","option-highlight")),"undefined"!==typeof this.options[i].options[a].disabled&&this.options[i].options[a].disabled&&o.setAttribute("disabled","disabled"),"undefined"!==typeof this.options[i].options[a].class&&o.setAttribute("data-extra-class",this.options[i].options[a].class),r.appendChild(o)}e.add(r,e[e.length])}else{var s=document.createElement("option");s.value="".concat(this.options[i].id),s.text="".concat(this.options[i].label),null!==t&&t.toString()===this.options[i].id.toString()&&(s.setAttribute("selected","selected"),s.setAttribute("class","option-highlight")),"undefined"!==typeof this.options[i].disabled&&this.options[i].disabled&&s.setAttribute("disabled","disabled"),"undefined"!==typeof this.options[i].class&&s.setAttribute("data-extra-class",this.options[i].class),e.add(s,e[e.length])}return e}}},{key:"setConfig",value:function(e){var t={light:!1,size:12,sizeSm:null,sizeMd:null,sizeLg:null,fixedWidth:null,placeholder:"Please Select",append:vi.TYPE_APPEND,selected:null,isSearchable:!0,changeOptions:null};if("undefined"!==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);this.config=t}},{key:"getConfig",value:function(){return this.config}},{key:"setValueByOptionId",value:function(e){this.changeSelectedStatusById(e),this.reRender()}},{key:"changeSelectedStatusById",value:function(e){this.config.selected=e,this.setSelectedOption()}},{key:"placeholderText",value:function(){return this.config.placeholder}},{key:"setSelectedOption",value:function(){if(null!==this.config.selected){var e,t=this.config.selected;if("undefined"!==typeof this.options)Array.isArray(this.options)&&this.options.filter((function(n){n.hasOwnProperty("groupLabel")?n.options.filter((function(n){n.id==t&&(e=n)})):n.hasOwnProperty("id")&&n.id==t&&(e=n)})),this.selectedOption="undefined"!==typeof e?e:null;else this.selectedOption=null}}},{key:"getSelectedOption",value:function(){if(null!==this.config.selected){var e,t=this.config.selected;if(Array.isArray(this.options)&&this.options.filter((function(n){n.hasOwnProperty("groupLabel")?n.options.filter((function(n){n.id==t&&(e=n)})):n.hasOwnProperty("id")&&n.id==t&&(e=n)})),"undefined"!==typeof e)return this.onValueChanged&&this.onValueChanged(+e.id),e}return null}},{key:"getNode",value:function(){return this.node}},{key:"setNode",value:function(e){return this.node=e}},{key:"setOptions",value:function(e){this.options=e}}]),n}(b.a),Ni=function(){function e(){o()(this,e)}return l()(e,null,[{key:"makeSortable",value:function(t,n,i,r,a,o){var s,l,u=T.cb.IDLE,c={left:0,top:0},d={left:0,top:0},p=!1,h=function(i){if(u===T.cb.START||u===T.cb.RUN){var a=i.target||i.srcElement;if(a===n||t.contains(n,a)){if(!p){var h={left:i.clientX,top:i.clientY};if(jt.computeDistance(c,h)<e.MINIMUM_DISTANCE_IN_PIXELS_TO_INITIATE_A_DRAG)return i.preventDefault(),void i.stopPropagation();p=!0;var g=t(n).find("table").attr("data-editing-context"),_=s.getBoundingClientRect();l=s.cloneNode(!0),s.setAttribute("data-is-sortable-source-element",""),l.style.width="".concat(_.width,"px"),l.style.height="".concat(_.height,"px"),l.style.left="".concat(_.left,"px"),l.style.top="".concat(_.top,"px"),l.setAttribute("data-element-type","sortable-overlay"),l.setAttribute("data-editing-context",g),document.body.appendChild(l)}i.preventDefault(),i.stopPropagation(),t(n).attr("data-in-dragging-procedure",!0);var f=t(a).closest(r).get(0);if(f){var y=f.getBoundingClientRect(),E=y.top+y.height/2,m=T.bb.BEFORE;if(i.clientY>E&&(m=T.bb.AFTER),o)try{o(s,f,m)}catch(i){}}u=T.cb.RUN,d.left=i.clientX-c.left,d.top=i.clientY-c.top,l.style.transform="translate(".concat(d.left,"px, ").concat(d.top,"px)")}}},g=function e(i){if(t(n).removeAttr("data-in-dragging-procedure"),p=!1,u!==T.cb.RUN)return console.warn("RETURN (STATE IS NOT RUN)"),void(u=T.cb.IDLE);l.parentNode.removeChild(l),u=T.cb.IDLE,document.body.removeEventListener("mousemove",h,!0),document.body.removeEventListener("mouseup",e,!0),s.removeAttribute("data-is-sortable-source-element"),l=null,c.left=c.top=d.left=d.top=0,i.preventDefault(),i.stopPropagation();var o=i.target||i.srcElement;if(o!==n&&!t.contains(n,o))return console.warn("RETURN: TARGET IS NOT (A CHILD OF) SOURCE CONTAINER"),s=null,void(u=T.cb.IDLE);var g=t(o).closest(r).get(0);if(!g){if(a)try{a(s,null,T.bb.BEFORE)}catch(i){console.error("DROP CALLBACK EXCEPTION: ",i)}return s=null,g=null,console.warn("RETURN (NO TARGET DROP ELEMENT)"),void(u=T.cb.IDLE)}if(g===s)return s=null,u=T.cb.IDLE,void console.warn("RETURN (TARGET DROP ELEMENT == SOURCE ELEMENT)");var _=g.getBoundingClientRect(),f=_.top+_.height/2,y=T.bb.BEFORE;if(i.clientY>f&&(y=T.bb.AFTER),a)try{a(s,g,y)}catch(i){console.error("DROP CALLBACK EXCEPTION: ",i)}g=null,s=null,u=T.cb.IDLE};t(r).on("mousedown",(function(e){if(u===T.cb.IDLE&&Nt.getMouseButtonFromEvent(e)===T.B.LEFT){var n=e.target||e.srcElement;if(c.left=e.clientX,c.top=e.clientY,t(n).is("".concat(i,", ").concat(i," *"))){if(!(s=t(n).closest(r).get(0)))return;u=T.cb.START,document.body.addEventListener("mousemove",h,!0),document.body.addEventListener("mouseup",g,!0)}}}))}}]),e}();v()(Ni,"MINIMUM_DISTANCE_IN_PIXELS_TO_INITIATE_A_DRAG",5);var Ai=n(12),bi=function(){function e(){o()(this,e),v()(this,"currentSelectedControl",void 0),v()(this,"dialogOptions",void 0),v()(this,"userService",void 0),this.userService=window.userService.getInstance()}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){var r=this;this.setCurrentSelectedControl(i.getEngine()),t(n).find("input[type=hidden][data-plugin=text-choice-interface][data-value]").each((function(a,o){var s=o.getAttribute("data-value"),l=[],u=~~o.getAttribute("data-default-choice-type"),c=(o.getAttribute("data-set-default-first-option-after-text-dataset-import"),o.getAttribute("data-synchronize-other-properties")),d=o.getAttribute("data-new-choice-text")||"New Choice",p=o.getAttribute("data-new-choice-text-i18n");r.setDialogOptions({choices:l,container:n,editorUserInterface:i,defaultOptionInputType:u,dialogTitle:"",newChoiceText:"",itemType:"",editingContext:"",useDifferentValuesPerStatement:!1}),t(o).on("reload",(function(e){try{var n=e.target,i=t(n).closest("[data-role=property]").find("div[data-role=secondary]").get(0),a=t(i).find("[data-role=container]");r.dialogOptions.choices=r.reinitializeChoicesIndexes(JSON.parse(n.value),a),r.updateChoices(n,t),r.updateContainerAttributes(i)}catch(o){}})),o.removeAttribute("data-value"),s&&(r.dialogOptions.choices=JSON.parse(s)||[]),t(o).parent().find("[data-role=secondary]").each((function(n,a){t(o).closest("label").after(a);var s=t(a).find("[data-role=container]");r.dialogOptions.choices=r.resetChoicesIndex(r.dialogOptions.choices,s),r.updateContainerAttributes(a),r.makeChoicesInInspectorSortable(t,a,o,c),t(a).on("click","a[data-role=edit-option], a[data-role=edit-more-option]",(function(e){var n=e.currentTarget,u=String(n.getAttribute("data-dialog-title")),d=String(n.getAttribute("data-dialog-title-i18n")||""),p=String(n.getAttribute("data-new-choice-text")),h=String(n.getAttribute("data-new-choice-text-i18n")),g=String(n.getAttribute("data-item-type")),_=o.getAttribute("data-editing-context");r.dialogOptions.itemType=g,r.dialogOptions.editingContext=_,r.dialogOptions.useDifferentValuesPerStatement=r.currentSelectedControl.hasProperty("options.useDifferentValuesPerStatement")&&r.currentSelectedControl.getProperty("options.useDifferentValuesPerStatement"),r.dialogOptions.dialogTitle=d?i.getEngine().getI18n().translateText(d):u,r.dialogOptions.newChoiceText=h?i.getEngine().getI18n().translateText(h):p,r.editChoices().then((function(){r.currentSelectedControl.hasProperty("options.useDifferentValuesPerStatement")&&r.currentSelectedControl.setProperty("options.useDifferentValuesPerStatement",r.dialogOptions.useDifferentValuesPerStatement),l=JSON.parse(JSON.stringify(r.dialogOptions.choices)),l=r.reinitializeChoicesIndexes(l,s),r.updateContainerAttributes(a),r.updateChoices(o,t,c),r.makeChoicesInInspectorSortable(t,a,o,c),i.getEngine().getLoader().trigger("payments_products_price_change")})).fail((function(e){void 0!==e&&(console.warn("Failed to save options. Error is displayed below"),console.error(e))}))})).on("click","a[data-role=add-option]",(function(e){i.getEngine().getLoader().execCommand("track-event","edt_inspector_choice_option_add");var n=e.target,s=String(n.getAttribute("data-new-choice-text")),l=String(n.getAttribute("data-new-choice-text-i18n")),u=l?i.getEngine().getI18n().translateText(l):s,d=t(a).find('[data-role="container"]')[0],p=t(d).find('[data-role="choice"]:last-child input[data-role="secondary"]')[0];r.insertNewChoice(d,u,p,t),r.updateContainerAttributes(a),r.updateChoices(o,t,c),r.makeChoicesInInspectorSortable(t,a,o,c)})).parent().on("click","a[data-role=import-option]",(function(n){var l=n.target,u=JSON.parse(l.getAttribute("data-sets")||"[]"),d=String(l.getAttribute("data-dialog-title")||"Import choices"),p=String(l.getAttribute("data-dialog-title-i18n")||""),h=r.dialogOptions.choices;r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(h=JSON.parse(JSON.stringify(r.dialogOptions.choices[0]))),i.getSelectedDataset(u,p?i.getEngine().getI18n().translateText(p):d,h).then((function(n){s.find("[data-role=choice]").remove();for(var i=0,l=n.getValues(),u=l.length;i<u;i++){if(r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER){for(var d=0,p=r.dialogOptions.choices.length;d<p;d++)void 0===r.dialogOptions.choices[d][i]?r.dialogOptions.choices[d].push(e.createUniqueChoice({text:l[i].text,isDefault:!1,index:i,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,isCorrect:!1,quizPoints:0,paymentsValue:null},h)):r.dialogOptions.choices[d][i].text=l[i].text,i===u-1&&(r.dialogOptions.choices[d].length=u);h[i]=r.dialogOptions.choices[0][i]}else void 0===r.dialogOptions.choices[i]?r.dialogOptions.choices.push(e.createUniqueChoice({text:l[i].text,isDefault:!1,index:i,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,isCorrect:!1,quizPoints:0,paymentsValue:null},h)):r.dialogOptions.choices[i].text=l[i].text,h[i]=r.dialogOptions.choices[i],i===u-1&&(r.dialogOptions.choices.length=u);s.append(r.createChoiceElement(h[i]))}r.updateContainerAttributes(a),r.updateChoices(o,t,c),r.makeChoicesInInspectorSortable(t,a,o,c)})).fail((function(e){console.warn("Failed to import choices. Error is displayed below"),console.error(e)}))})).on("input","[data-role=choice] > input[type=text][data-model-property=text]",(function(e){var n=e.target,i=~~t(n).closest("[data-role=choice]").attr("data-index");if(r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var a=0,s=r.currentSelectedControl.getChildren().length;a<s;a++)r.dialogOptions.choices[a][i].text=n.value;else r.dialogOptions.choices[i].text=n.value;r.updateChoices(o,t,c)})).on("paste","[data-role=choice] > input[type=text][data-model-property=text]",(function(n){var i,s=n.target,u=[],d=~~t(s).closest("div[data-role=statement]").attr("data-index");try{var p=n.originalEvent||{},h=n.originalEvent.clipboardData||null;if(!h)return;i=h.getData("text/plain");var g=String(i||"").replace(/(^[\s]+|[\s]+$)/g,"");if(!(g.indexOf("\n")>-1))return;if(1===(u=g.split("\n")).length)return;p.preventDefault(),p.stopPropagation(),r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(l=l[0]);for(var _=0,f=u.length;_<f;_++){var y=e.createUniqueChoice({text:u[_],index:d+_+1},l),E=r.createChoiceElement(y);l.splice(y.index,0,y),t(E).insertAfter(t("div[data-role=choice][data-index=".concat(y.index-1,"]"))),l=r.reinitializeChoicesIndexes(l,t(a)),r.updateContainerAttributes(a)}r.updateChoices(o,t,c),r.makeChoicesInInspectorSortable(t,a,o,c)}catch(m){}})).on("click","[data-role=choice] div[data-role=remove]",(function(e){if(!(r.dialogOptions.choices.length<=1||r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&r.dialogOptions.choices[0].length<=1)){i.getEngine().getLoader().execCommand("track-event","edt_inspector_choice_option_remove");var n=e.target,a=t(n).closest('[data-role="container"]'),s=t(n).closest("[data-role=choice]"),l=~~s.attr("data-index");if(r.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var u=0,d=r.dialogOptions.choices.length;u<d;u++)r.dialogOptions.choices[u].splice(l,1);else r.dialogOptions.choices.splice(l,1);r.dialogOptions.choices=r.reinitializeChoicesIndexes(r.dialogOptions.choices,t(a)),r.updateChoices(o,t,c),s.remove(),r.updateContainerAttributes(a.closest("div[data-role=secondary]")[0])}})).on("keydown","input",(function(n){if((n.keyCode||n.charCode)===at.KEY_ENTER&&null!==l[l.length-1].text&&""!==l[l.length-1].text){var s=n.target,u=~~t(s).parent().attr("data-index");if(l.length>e.MAX_VISIBLE_NUMBER_OF_CHOICES_IN_INSPECTOR_PANEL&&u===e.MAX_VISIBLE_NUMBER_OF_CHOICES_IN_INSPECTOR_PANEL&&t("a[data-role=edit-more-option][data-target=choices]").trigger("click"),u<e.MAX_VISIBLE_NUMBER_OF_CHOICES_IN_INSPECTOR_PANEL){var h=e.createUniqueChoice({text:p?i.getEngine().getI18n().translateText(p):d,index:l.length},l),g=r.createChoiceElement(h);l.splice(u+1,0,h),t(g).insertAfter(s.parentNode),l=r.reinitializeChoicesIndexes(l,t(a)),r.updateChoices(o,t,c),r.updateContainerAttributes(a),r.makeChoicesInInspectorSortable(t,a,o,c),t(g).find("input").focus().select()}}}))}))}))}},{key:"createChoiceElement",value:function(e){var t,n,i,r=document.createElement("div");return r.setAttribute("data-role","choice"),r.setAttribute("data-index",String(e.index)),(t=document.createElement("input")).setAttribute("type","text"),t.setAttribute("data-model-property","text"),t.setAttribute("data-role","secondary"),r.appendChild(t),(n=document.createElement("div")).setAttribute("data-role","remove"),r.appendChild(n),(i=document.createElement("div")).setAttribute("data-role","drag"),r.appendChild(i),t.value=e.text,r}},{key:"isUniqueSetOfChoices",value:function(e){if(!e)return!0;for(var t=0,n=e.length;t<n;t++)for(var i=0;i<t;i++)if(e[t].text===e[i].text)return!1;return!0}},{key:"editChoices",value:function(){var e=this;this.dialogOptions.dialogTitle=this.dialogOptions.dialogTitle||"Default choice",this.dialogOptions.newChoiceText=this.dialogOptions.newChoiceText||"New Choice",this.dialogOptions.itemType=this.dialogOptions.itemType||"CHOICE";var t=JSON.parse(JSON.stringify(this.dialogOptions.choices)),n=this.dialogOptions.editorUserInterface,i=this.dialogOptions.editorUserInterface.getEngine().getJQuery(),r=this.dialogOptions.editorUserInterface.getEngine().getResourceManager(),a=this.dialogOptions.editorUserInterface.getEngine().getI18n(),o=this.dialogOptions.editorUserInterface.getEngine().getLoader().getCommandDispatcher();this.dialogOptions.editorUserInterface.getEngine().getFactory();return i.Deferred((function(s){if(!e.dialogOptions||"QUIZ_OPTIONS"!==e.dialogOptions.editingContext||e.userService.canUseQuizOptions()){var l="/modules/Typescript/Form/resources/edit-option-dialog.html",u=e.dialogOptions.choices,c=[];e.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(l="/modules/Typescript/Form/resources/edit-option-dialog-likert.html",c=e.generateStatementsForSalvageModel(),0!=e.dialogOptions.choices.length&&(u=e.dialogOptions.choices[0])),r.get(l).then((function(r){if(e.currentSelectedControl.getTypeId()!==C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var l=0,d=u.length;l<d;l++){var p=u[l];p.isCorrect||(p.quizPoints=0),p.numberOfTimesThisOptionHasBeenChosen<0&&(p.numberOfTimesThisOptionHasBeenChosen=0)}var h,g=new Ai.a(r),_={choices:JSON.parse(JSON.stringify(u)),inputType:e.dialogOptions.defaultOptionInputType!==T.f.CHECKBOX,itemType:e.dialogOptions.itemType,editingContext:e.dialogOptions.editingContext,displayResetUsedChoicesOption:e.isResetButtonVisibleInEditingPanel(u),resetUsedColumnText:"Reset used choices",resetUsedColumnTextI18n:"edt_text_reset_used_choices",formTotalPointsText:"Form total points:",formTotalPointsTextI18n:"edt_text_form_total_points",formTotalPoints:jt.getFormTotalPoints(e.dialogOptions.editorUserInterface.getEngine().getDocument()),useDifferentValuesPerStatement:e.dialogOptions.useDifferentValuesPerStatement,statements:c,disableDefaultValues:e.currentSelectedControl.hasProperty("choices.displayPlaceholderText")&&e.currentSelectedControl.getProperty("choices.displayPlaceholderText")};if((h=n.createDialog(e.dialogOptions.dialogTitle,[{type:qe.c.CANCEL,callback:e.onCancelButtonPress.bind(e,t,s)},{type:qe.c.SAVE,callback:e.onSaveButtonPress.bind(e,u,n,s)}],{width:"600px",height:"600px"})).body.setAttribute("data-dialog-role","edit-option"),e.dialogOptions&&"CONFIGURE_VALUES"===e.dialogOptions.editingContext){var f=document.createElement("div"),y=document.createElement("div"),E=document.createElement("div");f.setAttribute("data-role","set-all-button-container"),y.setAttribute("data-role","set-all-button"),E.setAttribute("data-i18n-text","edt_set_to_all"),E.innerText=a.translateText("edt_set_to_all"),y.appendChild(E),f.appendChild(y),h.titlebody.appendChild(f)}e.renderDialogBodyContent(h,g,_,a,o,i,u,n);for(var m,v=0,O=0,N=u.length;O<N;O++)if(u[O].isCorrect){v=u[O].quizPoints;break}m=jt.getFormTotalPoints(e.dialogOptions.editorUserInterface.getEngine().getDocument())-v,e.attachDialogEvents(i,h,n,m,u,_,g,a,o)})).fail((function(e){s.reject(e)}))}else o.triggerPaywall(qe.h.QUIZ_OPTIONS_NOT_SUPPORTED_IN_CURRENT_USER_PLAN)})).promise()}},{key:"onSaveButtonPress",value:function(e,t,n,i,r){this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER||this.isUniqueSetOfChoices(e)?(r.close(),n.resolve(this.dialogOptions.choices)):t.alert("Error Saving Choices","You are not allowed to have 2 or more options with the same value")}},{key:"onCancelButtonPress",value:function(e,t,n,i){this.dialogOptions.choices=e,i.close(),t.reject()}},{key:"generateStatementsForSalvageModel",value:function(){for(var e=[],t=this.currentSelectedControl.getChildren(),n=0,i=t.length;n<i;n++)e.push({choices:JSON.parse(JSON.stringify(this.dialogOptions.choices[n])),text:t[n].getProperty("label.labelText"),index:n});return e}},{key:"renderDialogBodyContent",value:function(e,t,n,i,r,a,o,s){var l=this;e.body.innerHTML=t.parse(n),i.translateDOMNode(e.body),r.addPerfectScrollbar(e.body),a(e.body).find("table tbody tr").each((function(e,t){l.updateNumberOfChoicesLeft(a(t))})),("PAYMENTS_VALUES"===n.editingContext&&(this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&this.currentSelectedControl.hasProperty("options.useDifferentValuesPerStatement")&&!this.currentSelectedControl.getProperty("options.useDifferentValuesPerStatement")||this.currentSelectedControl.getTypeId()!==C.a.CONTAINER_TYPE_LIKERT_WRAPPER)||"PAYMENTS_VALUES"!==n.editingContext)&&this.makeChoicesInEditPanelSortable(a,e.body),s.upgrade(e.body)}},{key:"attachDialogEvents",value:function(e,t,n,i,r,a,o,s,l){var u=this;e(t.body).on("keydown","input[name=payments-values]",(function(e){var t=e.target;t.setAttribute("data-temp-value",t.value)})).on("input","input[name=payments-values]",(function(e){var t=e.target;t.value.length&&!t.value.match(/^([0-9]+(\.[0-9]{1,2}|\.)?|\.[0-9]{1,2})$/)&&(t.value=t.getAttribute("data-temp-value"))})).on("keyup","input[name=payments-values]",(function(e){var t=e.target;setTimeout((function(){t.removeAttribute("data-temp-value")}),0)})).on("blur","input[name=payments-values]",(function(e){var t=e.target;if(t.value.indexOf(".")>-1){for(var n=t.value.split("."),i=!n[0].length||n[1].length<2;n[1].length<2;)n[1]+="0";i&&(t.value="".concat(n[0]||"0",".").concat(n[1]))}})).on("click","a[data-role=add-option]",(function(){var i=e(t.body).find('tbody [data-role="choice"]:last-child [data-role="choice-name"] input')[0],r=u.insertNewChoice(t.body,u.dialogOptions.newChoiceText,i,e);u.makeChoicesInEditPanelSortable(e,t.body),n.upgrade(r)})).on("input","td[data-role=choice-name] input[type=text]",(function(t){var n=t.target,i=n.value,r=e(n).closest("tr"),a=~~r.attr("data-statement-index"),o=~~r.attr("data-index"),s=u.dialogOptions.choices[o];if(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER){s=u.dialogOptions.choices[a][o];for(var l=0,c=u.dialogOptions.choices.length;l<c;l++)u.dialogOptions.choices[l][o].text=i}s.text=i})).on("click","tr[data-role=choice] td[data-role=choice-name] div[data-role=remove]",(function(n){if(!(u.dialogOptions.choices.length<=1||u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&u.dialogOptions.choices[0].length<=1)){var r=n.target,a=e(r).closest("[data-role=choice]"),o=a.parent(),s=~~a.attr("data-index");if(a.remove(),u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var l=0,c=u.dialogOptions.choices.length;l<c;l++){u.dialogOptions.choices[l].splice(s,1);for(var d=0,p=u.dialogOptions.choices[l].length;d<p;d++)u.dialogOptions.choices[l][d].isCorrect&&u.updateFormTotalPoints(i,t.body,u.dialogOptions.choices[l][d].quizPoints,e),o.find('[data-role="choice"]').get(d).setAttribute("data-index",String(d))}else{u.dialogOptions.choices.splice(s,1);for(var h=0,g=u.dialogOptions.choices.length;h<g;h++)u.dialogOptions.choices[h].isCorrect&&u.updateFormTotalPoints(i,t.body,u.dialogOptions.choices[h].quizPoints,e),o.find('[data-role="choice"]').get(h).setAttribute("data-index",String(h))}u.dialogOptions.choices=u.reinitializeChoicesIndexes(u.dialogOptions.choices)}})).on("click","td[data-role=is-default-choice] input",(function(t){var n=t.target,i=~~e(n).closest("tr").attr("data-index");if(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var r=0,a=u.dialogOptions.choices.length;r<a;r++)for(var o=0,s=u.dialogOptions.choices[r].length;o<s;o++){var l=!1;o!==i||u.dialogOptions.choices[r][o].isDefault||(l=!0),o===i&&(n.checked=l),u.dialogOptions.choices[r][o].isDefault=l}else for(var c=0,d=u.dialogOptions.choices.length;c<d;c++){var p=!1;(u.dialogOptions.defaultOptionInputType===T.f.CHECKBOX&&!0===u.dialogOptions.choices[c].isDefault&&c!==i||c===i&&!u.dialogOptions.choices[c].isDefault)&&(p=!0),c===i&&(n.checked=p),u.dialogOptions.choices[c].isDefault=p}})).on("keydown","input[type=text][data-role=choice-name]",(function(n){if(r=u.dialogOptions.choices[0].length>0?u.dialogOptions.choices[0]:u.dialogOptions.choices,(n.keyCode||n.charCode)===at.KEY_ENTER&&null!==r[r.length-1].text&&""!==r[r.length-1].text){var i=n.target;u.insertNewChoice(t.body,u.dialogOptions.newChoiceText||"New Choice",i,e),u.makeChoicesInEditPanelSortable(e,t.body)}})).on("paste","td[data-role=choice-name] input[type=text]",(function(n){var i,r=[];try{var a=n.target,o=n.originalEvent||{},s=n.originalEvent.clipboardData||null;if(!s)return;i=s.getData("text/plain");var l=String(i||"").replace(/(^[\s]+|[\s]+$)/g,"");if(!(l.indexOf("\n")>-1))return;r=l.split("\n"),o.preventDefault(),o.stopPropagation();for(var c=0,d=r.length;c<d;c++)u.insertNewChoice(t.body,r[c],a,e);u.makeChoicesInEditPanelSortable(e,t.body)}catch(p){return}})).on("input","td[data-role=total-number-of-choices] input[type=number]",(function(t){if(!(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER||u.dialogOptions.choices[0].length>0)){var n=t.target,i=~~e(n).closest("tr").attr("data-index");u.dialogOptions.choices[i].numberOfTimesThisOptionCanBeChosen=~~n.value,e(n).closest("tr").each((function(t,n){u.updateNumberOfChoicesLeft(e(n))}))}})).on("click","div[data-role=apply-all-button]",(function(){var n=e(t.body).find("input[type=number][name=apply-all-default-number-of-choices]").get(0),i=parseInt(n.value);if(i>=-1){e(t.body).find("table tbody tr").each((function(t,n){e(n).find("td[data-role=total-number-of-choices] input[type=number]").val(i),u.updateNumberOfChoicesLeft(e(n))}));for(var r=0;r<u.dialogOptions.choices.length;r++)u.dialogOptions.choices[r].numberOfTimesThisOptionCanBeChosen=i}})).on("click","a[data-role=reset-used-column]",(function(){if(!(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER||u.dialogOptions.choices[0].length>0)){for(var n=0,i=(r=u.dialogOptions.choices).length;n<i;n++)r[n].numberOfTimesThisOptionHasBeenChosen=-1;e(t.body).find("table tbody tr").each((function(t,n){var i=~~e(n).attr("data-index");e(n).find("td[data-role=used-number-of-choices] div span").text("0"),e(n).find("td[data-role=number-of-choices-left] div span").text(String(r[i].numberOfTimesThisOptionCanBeChosen||"0"))}))}})).on("click","td[data-role=quiz-correct] input",(function(n){var r=n.target,a=~~e(r).closest("tr").attr("data-index"),o=e(r).closest("tr").find("input[type=number][name=quiz-points]"),s=o.get(0);if(u.onCorrectChoiceCheckedStateModified(r,u.dialogOptions,a,s,!0,e),r.checked)setTimeout((function(){o.focus().select()}),10);else{var l=u.getQuizValue(s,e);e(t.body).find("div[data-role=form-total-points] span[data-role=form-total-points]").text(i+l)}})).on("input","td[data-role=quiz-points] input[type=number]",(function(n){if(!(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER||u.dialogOptions.choices[0].length>0)){r=u.dialogOptions.choices;var a=n.target,o=~~a.value;u.setQuizValue(t.body,o,e);for(var s=0,l=r.length;s<l;s++)r[s].isCorrect&&(r[s].quizPoints=o);u.updateFormTotalPoints(i,t.body,~~a.value,e)}})).on("click focus","td[data-role=quiz-points] input",(function(n){if(!(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER||u.dialogOptions.choices[0].length>0)){r=u.dialogOptions.choices;var a=n.target,o=e(a).closest("tr[data-role=choice]").find("td[data-role=quiz-correct] input").get(0),s=~~e(a).closest("tr").attr("data-index");o.checked=!0,u.onCorrectChoiceCheckedStateModified(o,u.dialogOptions,s,a,!1,e);for(var l=0,c=r.length;l<c;l++)r[l].isCorrect&&(r[l].quizPoints=~~a.value);u.updateFormTotalPoints(i,t.body,~~a.value,e)}})).on("input","td[data-role=payments-values] input[type=text]",(function(t){var n=t.target,i=parseFloat(n.value),r=e(n).closest("tr"),a=~~r.attr("data-statement-index"),o=~~r.attr("data-index"),s=u.dialogOptions.choices[o];u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(s=u.dialogOptions.choices[a][o]),!isNaN(i)&&i>=0?s.paymentsValue=i:s.paymentsValue=null})).on("change","input#use-different-values-per-statement",(function(i){var c=i.target,d=e(t.body).find("div[data-editing-context][data-use-different-values]");u.dialogOptions.useDifferentValuesPerStatement=c.checked,d.attr("data-use-different-values",String(c.checked)),a.useDifferentValuesPerStatement=u.dialogOptions.useDifferentValuesPerStatement,a.choices=JSON.parse(JSON.stringify(u.dialogOptions.choices[0])),a.statements=JSON.parse(JSON.stringify(u.generateStatementsForSalvageModel())),u.renderDialogBodyContent(t,o,a,s,l,e,r,n),(u.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&!u.dialogOptions.useDifferentValuesPerStatement||u.currentSelectedControl.getTypeId()!==C.a.CONTAINER_TYPE_LIKERT_WRAPPER)&&u.makeChoicesInEditPanelSortable(e,t.body)})),e(t.titlebody).on("click","div[data-role=set-all-button-container]",(function(){var n=e(t.body).find("div[data-role=apply-all-holder]");"none"===n.css("display")?n.css("display","inline-flex"):n.hide()}))}},{key:"updateControlChoicesAndDOM",value:function(e,t,n){t=this.getValidatedChoicesFromSet(t);var i=document.getElementById("item");if(i.getAttribute("data-target-element")===e.getHash())for(var r=i.querySelectorAll("input[type=hidden][data-plugin=text-choice-interface]"),a=t.length?JSON.stringify(t):"null",o=0,s=r.length;o<s;o++)n(r[o]).val(a).trigger("reload");else{for(var l=!1,u=[],c=0,d=t.length;c<d;c++)"undefined"!==typeof t[c].paymentsValue&&null!==t[c].paymentsValue?(l=!0,u.push(t[c].paymentsValue)):u.push(null);e.setProperty("choices.values",t),e.setProperty("payments.value",l?u.map((function(e){return Number(e)})):null),e.getForm().getEngine().getLoader().getCommandDispatcher().reloadVisiblePanel()}}},{key:"updateFormTotalPoints",value:function(e,t,n,i){var r=e+~~n;i(t).find("div[data-role=form-total-points] span[data-role=form-total-points]").text(r)}},{key:"getQuizValue",value:function(e,t){var n=0;return t(e).closest("table > tbody").find("input[type=number][name=quiz-points]").each((function(){if(0!=this.value)return n=this.value})),~~n}},{key:"setQuizValue",value:function(e,t,n){n(e).find("input[type=number][name=quiz-points]").each((function(){n(this).closest("tr").find("[name=quiz-correct]").is(":checked")&&(this.value=t)}))}},{key:"resetAllUncorrectChoicesPointsToZero",value:function(e,t,n,i){i(e).closest("table > tbody").find("input[type=number][name=quiz-points]").each((function(){if(this!==t&&!i(this).closest("tr").find("[name=quiz-correct]").is(":checked")){n.choices=n.choices;var e=~~i(this).closest("tr").attr("data-index");this.value="0",n.choices[e].isCorrect=!1,n.choices[e].quizPoints=0}}))}},{key:"insertNewChoice",value:function(t,n,i,r){var a,o="edit-option"===t.getAttribute("data-dialog-role"),s=this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER?JSON.parse(JSON.stringify(this.dialogOptions.choices[0])):JSON.parse(JSON.stringify(this.dialogOptions.choices)),l=r(i).closest("[data-role=choice]").get(0),u=e.createUniqueChoice({text:n,isDefault:!1,index:1+~~l.getAttribute("data-index"),numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,isCorrect:!1,quizPoints:0,paymentsValue:null},s);s.push(u);var c=r(a=l.cloneNode(!0)).find('td[data-role="is-default-choice"] input[name="default-option"]').get(0);c&&(c.removeAttribute("checked"),c.checked=!1),r(a).insertAfter(l);var d=r(i).closest("div[data-dialog-role=edit-option]");if(d.scrollTop(d.prop("scrollHeight")),this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER){for(var p=0,h=this.currentSelectedControl.getChildren().length;p<h;p++)if(this.dialogOptions.choices[p].push(JSON.parse(JSON.stringify(u))),!this.currentSelectedControl.hasProperty("options.useDifferentValuesPerStatement")||!this.currentSelectedControl.getProperty("options.useDifferentValuesPerStatement"))for(var g=0,_=this.dialogOptions.choices[p].length;g<_;g++)this.dialogOptions.choices[p][g].paymentsValue=this.dialogOptions.choices[0][g].paymentsValue}else this.dialogOptions.choices=JSON.parse(JSON.stringify(s));return this.dialogOptions.choices=o?this.reinitializeChoicesIndexes(this.dialogOptions.choices):this.reinitializeChoicesIndexes(this.dialogOptions.choices,r(t)),r(a).find("td[data-role=choice-name] input[type=text]").val(u.text).focus().select(),r(a).find("td[data-role=total-number-of-choices] input[type=number]").val(u.numberOfTimesThisOptionCanBeChosen),r(a).find("[data-role=used-number-of-choices] > span").text("0"),r(a).find("[data-role=number-of-choices-left] > span").text("0"),r(a).find("td[data-role=quiz-points] input[type=number]").val(u.quizPoints),r(a).find("td[data-role=payments-values] input[type=number]").val(String(u.paymentsValue||"")),r(a).find("td[data-role=payments-values] input[name=payments-values]").val(""),this.initializeNewlyInsertedRow(a,u,r),this.dialogOptions.container&&this.updateContainerAttributes(this.dialogOptions.container),a}},{key:"onCorrectChoiceCheckedStateModified",value:function(e,t,n,i,r,a){t.choices=t.choices,this.resetAllUncorrectChoicesPointsToZero(e,i,t,a);var o=this.getQuizValue(e,a);if(o>0&&a(i).val(o),r&&t.choices[n].isCorrect&&(e.checked=!1,i.value="0"),t.choices[n].isCorrect=e.checked,t.choices[n].quizPoints=~~i.value,t.defaultOptionInputType!==T.f.CHECKBOX)for(var s=0,l=t.choices.length;s<l;s++)s!=n&&(t.choices[s].isCorrect=!1)}},{key:"updateNumberOfChoicesLeft",value:function(e){null===e.find("[data-role=used-number-of-choices] > span").text()&&e.find("[data-role=used-number-of-choices] > span").text("0");var t=~~e.find("[name=total-number-of-choices]").val()-~~e.find("[data-role=used-number-of-choices] > span").text();e.find("[data-role=number-of-choices-left] > span").text(String(Math.max(0,t)))}},{key:"initializeNewlyInsertedRow",value:function(e,t,n){n(e).attr("data-index",(~~t.index).toString()).find("td[data-role=is-default-choice]").each((function(){n(this).find("input").each((function(){this.checked=t.isDefault,this.setAttribute("id","choice-editor-".concat((~~t.index).toString())),this.setAttribute("index",(~~t.index).toString())})),n(this).find("label").each((function(){this.setAttribute("for","choice-editor-".concat((~~t.index).toString()))}))})),n(e).find("td[data-role=quiz-correct]").each((function(){n(this).find("input").each((function(){this.checked=t.isCorrect,this.setAttribute("id","quiz-editor-".concat((~~t.index).toString())),this.setAttribute("index",(~~t.index).toString())})),n(this).find("label").each((function(){this.setAttribute("for","quiz-editor-".concat((~~t.index).toString()))}))}))}},{key:"updateContainerAttributes",value:function(t){var n=this.dialogOptions.choices;this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(n=this.dialogOptions.choices[0]),t.setAttribute("data-truncate-options",String(~~(n.length>e.MAX_VISIBLE_NUMBER_OF_CHOICES_IN_INSPECTOR_PANEL)))}},{key:"reinitializeChoicesIndexes",value:function(e,t){return t?(t.find("[data-role=choice]").remove(),this.resetChoicesIndex(e,t)):this.resetChoicesIndex(e)}},{key:"updateChoices",value:function(e,t,n){var i=this.getValidatedChoicesFromSet(this.dialogOptions.choices);e.value=i.length?JSON.stringify(i):"null",t(e).trigger("input"),n&&t(n).val(e.value).trigger("reload")}},{key:"getValidatedChoicesFromSet",value:function(e){for(var t,n=[],i=0,r=e.length;i<r;i++)if(Array.isArray(e[i])){var a=i;n[i]=this.getValidatedChoicesFromSet(e[a])}else{var o=e[i];t={text:window.removeDangerousHtmlAttributes(o.text)},void 0!==o.isOther&&(t.isOther=o.isOther),void 0!==o.isCorrect&&(t.isCorrect=o.isCorrect),void 0!==o.isDefault&&(t.isDefault=o.isDefault),void 0!==o.numberOfTimesThisOptionCanBeChosen&&(t.numberOfTimesThisOptionCanBeChosen=o.numberOfTimesThisOptionCanBeChosen),void 0!==o.numberOfTimesThisOptionHasBeenChosen&&(t.numberOfTimesThisOptionHasBeenChosen=o.numberOfTimesThisOptionHasBeenChosen),void 0!==o.quizPoints&&(t.quizPoints=o.quizPoints),void 0!==o.paymentsValue&&(t.paymentsValue=o.paymentsValue),n.push(t)}return n}},{key:"isResetButtonVisibleInEditingPanel",value:function(e){for(var t=0,n=e.length;t<n;t++)if(null!==e[t].numberOfTimesThisOptionHasBeenChosen&&e[t].numberOfTimesThisOptionHasBeenChosen>0)return!0;return!1}},{key:"makeChoicesInInspectorSortable",value:function(e,t,n,i){var r=this,a=O.a.create((function(){r.reorderOptionsInInspector(e,t,n,i)}),100);Ni.makeSortable(e,t,"div[data-role=choice] div[data-role=drag]","div[data-role=choice]",(function(e,t,n){a()}),(function(e,t,n){var i=e.parentNode;n===T.bb.BEFORE?i.insertBefore(e,t):i.insertBefore(e,t.nextSibling),a()}))}},{key:"makeChoicesInEditPanelSortable",value:function(e,t){var n=this,i=O.a.create((function(){n.reorderOptionsInEditPanel(e,t)}),100);Ni.makeSortable(e,t,"table[data-role=edit-option] tr[data-role=choice] td[data-role=choice-name] div[data-role=drag]","table[data-role=edit-option] tr[data-role=choice]",(function(e,t,n){i()}),(function(e,t,n){var r=e.parentNode;n===T.bb.BEFORE?r.insertBefore(e,t):r.insertBefore(e,t.nextSibling),i()}))}},{key:"onOptionsReorderedByDragAndDrop",value:function(e,t,n){var i=this,r=this.dialogOptions.choices,a=!1;if(e(t).find(n).each((function(e,t){var n=~~t.getAttribute("data-index");if(e!==n){if(a=!0,i.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var o=0,s=i.dialogOptions.choices.length;o<s;o++)(r=i.dialogOptions.choices[o])[n].index=e;else r[n].index=e;t.setAttribute("data-index",String(e))}})),a)if(this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var o=0,s=this.dialogOptions.choices.length;o<s;o++)(r=this.dialogOptions.choices[o]).sort((function(e,t){return e.index-t.index}));else r.sort((function(e,t){return e.index-t.index}))}},{key:"reorderOptionsInInspector",value:function(e,t,n,i){this.onOptionsReorderedByDragAndDrop(e,t,"[data-role=choice]"),this.updateChoices(n,e,i)}},{key:"reorderOptionsInEditPanel",value:function(e,t){var n=this,i="[data-role=choice]";this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(i='div[data-editing-context="PAYMENTS_VALUES"][data-use-different-values="true"] table[data-role="edit-option"] tbody[data-role="multi-statement-choices"] '.concat(i,', div[data-editing-context="PAYMENTS_VALUES"][data-use-different-values="false"] table[data-role="edit-option"] tbody[data-role="single-statement-choices"] ').concat(i,', div:not([data-editing-context="PAYMENTS_VALUES"]) table[data-role="edit-option"] tbody[data-role="single-statement-choices"] ').concat(i)),this.onOptionsReorderedByDragAndDrop(e,t,i),e(t).find(i).each((function(t,i){var r=n.dialogOptions.choices;n.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER&&(r=n.dialogOptions.choices[0]),n.initializeNewlyInsertedRow(i,r[t],e)}))}},{key:"resetChoicesIndex",value:function(e,t){if(this.currentSelectedControl.getTypeId()===C.a.CONTAINER_TYPE_LIKERT_WRAPPER)for(var n=0,i=e.length;n<i;n++)for(var r=0,a=e[n].length;r<a;r++)e[n][r].index=r,0===n&&t&&t.append(this.createChoiceElement(e[n][r]));else for(var o=0,s=e.length;o<s;o++)e[o].index=o,t&&t.append(this.createChoiceElement(e[o]));return e}},{key:"setDialogOptions",value:function(e){e.choices=this.resetChoicesIndex(e.choices),this.dialogOptions=e}},{key:"setCurrentSelectedControl",value:function(e,t){if(void 0===t){var n=e.getLoader().getSelection().getItems();0!==n.length&&(this.currentSelectedControl=n[0])}else this.currentSelectedControl=t}}],[{key:"createUniqueChoice",value:function(e,t){var n,i,r=0,a=e.text;if(!t||!t.length)return e;do{n=!0,i=0===r?a:"".concat(a," (").concat(r,")");for(var o=0,s=t.length;o<s;o++)if(t[o].text===i){n=!1,r++;break}}while(!n);return e.text=i,e}}]),e}();v()(bi,"NAME","ChoicesEditorInspectorPlugin"),v()(bi,"MAX_VISIBLE_NUMBER_OF_CHOICES_IN_INSPECTOR_PANEL",4);var Ri,Ii=n(208),Pi=function(){function e(t){o()(this,e),v()(this,"element",void 0),v()(this,"onclick",void 0),t.onClick&&(this.onclick=t.onClick),this.constructElement(),this.setState(t)}return l()(e,[{key:"constructElement",value:function(){this.element=document.createElement("button"),this.element.setAttribute("type","button"),this.element.onclick=this.clickHandler.bind(this)}},{key:"getElement",value:function(){return this.element}},{key:"setState",value:function(e){e.label&&(this.element.innerHTML=e.label),e.isDisabled?(this.element.setAttribute("disabled","disabled"),this.element.setAttribute("title",e.disabledTitle||"")):(this.element.removeAttribute("disabled"),this.element.setAttribute("title",e.title||"")),e.classList&&(this.element.className=e.classList)}},{key:"clickHandler",value:function(e){this.onclick&&this.onclick(e)}}]),e}();!function(e){e[e.PERCENTAGE=0]="PERCENTAGE",e[e.FIXED_VALUE=1]="FIXED_VALUE"}(Ri||(Ri={}));var Si=function(){function e(){o()(this,e),v()(this,"unitType",[{unitTypeIndex:Ri.PERCENTAGE,unitTypeName:"percentage",unitTypeSymbol:"%"},{unitTypeIndex:Ri.FIXED_VALUE,unitTypeName:"fixed_value",unitTypeSymbol:"$"}]),v()(this,"model",void 0),v()(this,"engine",void 0),v()(this,"ui",void 0),v()(this,"i18n",void 0),v()(this,"dispatcher",void 0),v()(this,"resourceManager",void 0),v()(this,"settings",void 0),v()(this,"productsToRemove",[]),v()(this,"jq",void 0),v()(this,"temporaryControlsData",void 0),v()(this,"selectedCurrency",void 0)}return l()(e,[{key:"open",value:function(t,n){var i=this;n&&(this.engine=n),t&&(this.jq=t),this.ui=this.engine.getLoader().getUI(),this.i18n=this.engine.getLoader().getI18n(),this.dispatcher=this.engine.getLoader().getCommandDispatcher(),this.resourceManager=this.engine.getResourceManager(),this.settings=this.engine.getDocument().getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),this.temporaryControlsData={};var r=this,a=r.settings.getProperty("currencyId")||e.DEFAULT_CURRENCY_ID;return this.jq.Deferred((function(e){i.jq.when(r.resourceManager.get("/modules/Typescript/Form/resources/editor/Payments/ProductsDialog/payments-products-dialog.html"),r.resourceManager.get("/modules/Typescript/Form/resources/editor/Payments/ProductsDialog/payments-products-dialog-table-headings.html"),r.resourceManager.get("/modules/Typescript/Form/resources/editor/Payments/ProductsDialog/payments-products-dialog-discount-on-total.html")).done((function(t,n,i){var o,s,l,u=new Ai.a(t),c=new Ai.a(n),d=new Ai.a(i),p=r.ui.createDialog(r.i18n.translateText("edt_UI_property_payments_products_dialog_title")||"Products",[{type:qe.c.CANCEL,callback:function(){p.close(),e.reject(new Error("User closed the dialog by pressing the Cancel button"))}},{type:qe.c.SAVE,callback:function(){r.engine.getLoader().trigger("products_dialog_on_save"),r.saveProductRemovalFromDialog(),p.close(),e.resolve(r.model)}}],{width:"900px",height:"615px"}),h=p.dialog.getElementsByClassName("ui-titlebar")[0],g=p.dialog.getElementsByClassName("ui-buttons")[0],_=new Pi({onClick:function(){p.close(),r.openCurrencyDialog()},classList:"i123-payments currency-button"}),f=document.createElement("div");p.dialog.classList.add("products-dialog"),r.model={currencyId:a,currencySymbol:r.engine.getCurrency().getCurrencySymbolById(a),onTotalDiscountValue:r.generateGenericPriceFormatFromInputValue(null===(o=r.settings)||void 0===o?void 0:o.getProperty("discountValue")),onTotalDiscountUnitType:r.settings.getProperty("discountType")||0,onTotalTaxValue:r.generateGenericPriceFormatFromInputValue(null===(s=r.settings)||void 0===s?void 0:s.getProperty("taxValue")),onTotalTaxUnitType:r.settings.getProperty("taxType")||0,unitType:r.unitType,controls:r.getControlsDataForSalvage()},null!==r.settings.getProperty("fixedAmount")&&(r.model.fixedAmount=r.settings.getProperty("fixedAmount").toFixed(2)),r.unitType[Ri.FIXED_VALUE].unitTypeSymbol=r.model.currencySymbol;for(var y=0,E=r.model.controls.length;y<E;y++)null===r.model.controls[y]&&(r.model.controls.splice(y,1),E=r.model.controls.length,y--);(h.appendChild(_.getElement()),f.classList.add("i123-add"),f.addEventListener("click",(function(){var e=p.body.getElementsByClassName("add-new-product");0!=e.length?r.jq(e).find('[data-role="text-dropdown"]').trigger("click"):r.renderAddProductRow(r.jq,p,u)})),h.appendChild(f),h.insertAdjacentHTML("beforeend",c.parse({tableHeaders:[{name:"name"},{name:"price"},{name:"quantity"},{name:"discount"},{name:"tax"}]})),r.ui.upgrade(h),r.renderDiscountOnTotal(g,d),r.renderDialogBody(r.jq,p,u),r.selectedCurrency)&&(l="string"===typeof r.selectedCurrency.id?parseInt(r.selectedCurrency.id):r.selectedCurrency.id,r.updateCurrency(r.jq,l,p,u,d))})).fail((function(e){console.warn("Failed to open Payment Calculations Settings. Error is displayed below"),console.error(e)}))})).promise()}},{key:"updateFeeControl",value:function(){var e=this,t=document.querySelectorAll("#form [data-role=control][data-type=fee]"),n=document.querySelectorAll(".form-currency-container > a[data-plugin=currency-editor]"),i=document.querySelectorAll("#item .fee-base-price-container > input");t&&(t.forEach((function(t){var n=t.getAttribute("data-hash");e.engine.getDocument().getElementByHash(n).updatePriceFee()})),n&&(n.forEach((function(t){t.innerText=e.engine.getCurrency().getCurrencyById(e.model.currencyId).isoCode})),i&&i.forEach((function(t){t.value=t.value.replace(/[^0-9.]/g,""),t.value=e.model.currencySymbol+t.value}))))}},{key:"openCurrencyDialog",value:function(){var t,n=this,i=this.settings.getProperty("currencyId")||e.DEFAULT_CURRENCY_ID,r=this.engine.getCurrency().enumerateCurrencies().map((function(e){return{id:e.id,label:n.i18n.translateText(e.i18n)}}));r=Object(Ii.a)(r,["label"],["asc"]);var a=this.ui.createDialog(this.i18n.translateText("payments_form_currency")||e.CURRENCY_DIALOG_TITLE,[{type:qe.c.SAVE,callback:function(){n.currencyDialogOnSaveHandler(a,t)}},{type:qe.c.CANCEL,callback:function(){n.switchDialogs(a)}}],{width:"500px",height:"270px"});a.dialog.classList.add("currency-dialog");var o=document.createElement("p");o.textContent=this.i18n.translateText("payments_currency_dialog_description"),a.body.appendChild(o);var s={placeholder:""};this.selectedCurrency?s.selected=this.selectedCurrency.id:i&&(s.selected=i);var l=new Ci(this.jq).init(a.body,r,s);l.on("change",(function(){t=l.getSelectedOption()}))}},{key:"currencyDialogOnSaveHandler",value:function(e,t){t&&(this.selectedCurrency=t),this.engine.getLoader().execCommand("track-event","payments_currency_change"),this.engine.getLoader().trigger("payments_currency_change",t),this.switchDialogs(e)}},{key:"switchDialogs",value:function(e){var t=this;e.close(),this.open().done((function(e){t.saveData(e)})).fail((function(e){console.warn(e.message)}))}},{key:"updateCurrency",value:function(e,t,n,i,r){this.model.currencyId=t,this.model.currencySymbol=this.engine.getCurrency().getCurrencySymbolById(t),this.unitType[Ri.FIXED_VALUE].unitTypeSymbol=this.model.currencySymbol;for(var a=n.dialog.getElementsByClassName("ui-buttons")[0],o=a.getElementsByClassName("payments-products-dialog-row"),s=0,l=o.length;s<l;s++)a.removeChild(o[0]);this.renderDiscountOnTotal(a,r),this.ui.upgrade(a),this.renderDialogBody(this.jq,n,i)}},{key:"renderDiscountOnTotal",value:function(e,t){e.insertAdjacentHTML("afterbegin",t.parse(this.model)),this.ui.upgrade(e)}},{key:"renderAddProductRow",value:function(t,n,i){var r=this,a=n.body.querySelector('[data-role="edit-products-options"]'),o=document.createElement("div"),s=a.getElementsByClassName("payments-products-dialog-row"),l=0!=s.length?s[s.length-1].nextSibling:a.firstChild,u=document.createElement("select"),c=document.createElement("div"),d=this.getCompatibleProductControls();o.classList.add("payments-products-dialog-row"),o.classList.add("add-new-product"),u.setAttribute("data-appearance","text");var p=document.createElement("option");if(p.value="",p.text=r.i18n.translateText("edt_UI_property_payments_products_dialog_select product_label"),u.add(p),!this.model.fixedAmount){var h=document.createElement("option");h.value="1",h.text=r.i18n.translateText("edt_UI_property_payments_products_dialog_fixed_amount_label"),u.add(h)}for(var g=0,_=d.length;g<_;g++){var f=document.createElement("option");f.value=d[g].id.toString(),f.text=d[g].label,u.add(f)}o.appendChild(u),c.classList.add("payments-products-dialog-column"),c.classList.add("i-lg"),c.classList.add("i123-close"),c.setAttribute("data-role","control-delete"),o.appendChild(c),a.insertBefore(o,l),this.ui.upgrade(a.parentNode),a.parentNode.scrollTop=a.offsetHeight-a.parentNode.offsetHeight;var y=t('.add-new-product [data-role="text-dropdown"]');y.get(0).addEventListener("click",(function(a){if(a.target.hasAttribute("data-value")){var o=parseInt(a.target.getAttribute("data-value").replace(/"/g,"")),s=a.target.innerHTML;if(1===o)r.model.fixedAmount=r.generateGenericPriceFormatFromInputValue("0");else{var l=r.engine.getDocument().getElementById(o);l.hasProperty("payments")&&l.setProperty("payments.isProduct",!0);var u=r.getControlHasQuantity(l);r.model.controls.push({rowIndex:r.model.controls.length,controlId:o,name:s,customName:null,hasMultiplePrices:e.CONTROLS_WITH_MULTIPLE_PRICES.indexOf(l.getTypeId())>-1,hasVariablePrice:e.CONTROLS_WITH_VARIABLE_PRICE.indexOf(l.getTypeId())>-1,price:r.getControlSinglePrice(l),hasQuantity:u,quantity:null,quantityControls:u?r.getCompatibleQuantityControls(o):null,discountValue:r.generateGenericPriceFormatFromInputValue("0"),discountUnitType:Ri.PERCENTAGE,taxValue:r.generateGenericPriceFormatFromInputValue("0"),taxUnitType:Ri.PERCENTAGE})}r.renderDialogBody(t,n,i),a.stopPropagation(),r.engine.getLoader().execCommand("track-event","payments_products_add")}}),!0),y.trigger("click")}},{key:"renderDialogBody",value:function(e,t,n){t.body.innerHTML=n.parse(this.model),this.i18n.translateDOMNode(t.body),this.dispatcher.addPerfectScrollbar(t.body),this.ui.upgrade(t.body),this.attachDialogEvents(t)}},{key:"getControlHasQuantity",value:function(e){return e.getTypeId()!==C.a.CONTROL_TYPE_FEE}},{key:"getControlsDataForSalvage",value:function(){var t=this,n=this.settings.getProperty("productsData"),i=0;return null===n?[]:n.map((function(n){var r=t.engine.getDocument().getElementById(n.controlId);if(!r)return null;var a=t.getControlHasQuantity(r);return{rowIndex:i++,controlId:n.controlId,name:t.getControlName(r),customName:n.details,hasMultiplePrices:e.CONTROLS_WITH_MULTIPLE_PRICES.indexOf(r.getTypeId())>-1,hasVariablePrice:e.CONTROLS_WITH_VARIABLE_PRICE.indexOf(r.getTypeId())>-1,price:t.getControlSinglePrice(r),hasQuantity:a,quantity:n.quantityControlId,quantityControls:a?t.getCompatibleQuantityControls(r.getId()):null,discountValue:t.generateGenericPriceFormatFromInputValue(String(n.discount)),discountUnitType:n.discountType,taxValue:t.generateGenericPriceFormatFromInputValue(String(n.tax)),taxUnitType:n.taxType}}))}},{key:"attachDialogEvents",value:function(e){var t=this;e.dialog.hasAttribute("events-attached")||($(e.dialog).on("click",'[data-role="control-price"][data-price-literal], [data-role="control-discount"], [data-role="control-tax"]',(function(){t.removeClickedState($),this.setAttribute("data-has-click",""),$(this).find('input:not([type="hidden"])').each((function(){this.focus()}))})).on("click",'[data-role="control-price"][data-price-multiple]',(function(){var n=t.engine.getLoader().getI18n(),i=+$(this).closest("[data-control-identifier]").attr("data-control-identifier"),r=t.engine.getDocument().getElementById(i),a="undefined"!==typeof t.temporaryControlsData[i]?jt.clone(t.temporaryControlsData[i]):jt.clone(r.getProperty("choices.values"))||[],o=new bi;e.hide(),o.setCurrentSelectedControl(t.engine,r),o.setDialogOptions({editingContext:"PAYMENTS_VALUES",itemType:"CHOICE",container:null,choices:a,defaultOptionInputType:0,dialogTitle:n.translateText("edt_UI_property_payments_value"),newChoiceText:n.translateText("edt_text_new_choice"),editorUserInterface:t.ui,useDifferentValuesPerStatement:!1}),o.editChoices().then((function(n){t.temporaryControlsData[i]=jt.clone(n),e.show()})).fail((function(t){e.show(),console.warn("Failed to save options. Error is displayed below"),console.error(t)}))})).on("change",'[data-role="control-name"] input:not([type="hidden"])',(function(){var e=$(this).parents(".payments-products-dialog-row"),n=t.engine.getDocument().getElementById(parseInt(e.attr("data-control-identifier"))),i=parseInt(e.attr("data-index"));t.updateControlConfigurationInsideModel(i,"customName",this.value),e.find('[data-role="control-name"]').attr("title",t.getControlName(n))})).on("change",'[data-role="control-price"][data-price-literal] input:not([type="hidden"])',(function(){var e=$(this),n=t.generateGenericPriceFormatFromInputValue(this.value),i=e.parents(".payments-products-dialog-row"),r=i.find('.payments-products-dialog-column[data-role="control-price"][data-price-literal] span'),a=parseInt(i.attr("data-index"));-1===a?t.model.fixedAmount=n:t.updateControlConfigurationInsideModel(a,"price",n),e.attr("title",t.model.currencySymbol+this.value),r.text(t.model.currencySymbol+n),this.value=n})).on("input",'[data-role="control-price"][data-price-literal] input:not([type="hidden"])',(function(){var e=$(this).parents(".payments-products-dialog-row"),n=e.attr("data-control-identifier"),i=t.generateGenericPriceFormatFromInputValue(this.value);$('[data-control-identifier="'.concat(n,'"]')).each((function(){var n=$(this);if(e.get(0)!==n.get(0)){var r=n.find('.payments-products-dialog-column[data-role="control-price"][data-price-literal] input'),a=n.find('.payments-products-dialog-column[data-role="control-price"][data-price-literal] span');t.updateControlConfigurationInsideModel(parseInt(n.attr("data-index")),"price",i),r.attr("title",t.model.currencySymbol+i),a.text(t.model.currencySymbol+i),n.val(i)}}))})).on("change",'[data-role="control-discount"] input:not([type="hidden"])',(function(){var e=$(this),n=e.parents(".payments-products-dialog-row"),i=e.parents(".payments-products-dialog-column"),r=i.find("span"),a=parseInt(n.attr("data-index")),o=this.value,s=!1,l="- ";isNaN(a)?(t.engine.getLoader().execCommand("track-event","payments_products_discount_total_value_change"),0===t.model.onTotalDiscountUnitType&&(s=!0),o=t.generateGenericPriceFormatFromInputValue(this.value,s),t.model.onTotalDiscountValue=o,l+=t.generateDiscountAndTaxValue(o,t.model.onTotalDiscountUnitType)):(t.engine.getLoader().execCommand("track-event","payments_products_discount_value_change"),0===t.model.controls[a].discountUnitType&&(s=!0),o=t.generateGenericPriceFormatFromInputValue(this.value,s),t.updateControlConfigurationInsideModel(a,"discountValue",o),l+=t.generateDiscountAndTaxValue(o,t.model.controls[a].discountUnitType)),i.attr("title",l),r.text(l),e.val(o)})).on("change",'[data-role="control-tax"] input:not([type="hidden"])',(function(){var e=$(this),n=e.parents(".payments-products-dialog-row"),i=e.parents(".payments-products-dialog-column"),r=i.find("span"),a=parseInt(n.attr("data-index")),o=this.value,s="+ ";isNaN(a)?(t.engine.getLoader().execCommand("track-event","payments_products_tax_total_value_change"),o=t.generateGenericPriceFormatFromInputValue(this.value),t.model.onTotalTaxValue=o,s+=t.generateDiscountAndTaxValue(o,t.model.onTotalTaxUnitType)):(t.engine.getLoader().execCommand("track-event","payments_products_tax_value_change"),o=t.generateGenericPriceFormatFromInputValue(this.value),t.updateControlConfigurationInsideModel(a,"taxValue",o),s+=t.generateDiscountAndTaxValue(o,t.model.controls[a].taxUnitType)),i.attr("title",s),r.text(s),e.val(o)})).on("click",'.ui-body .payments-products-dialog-row [data-role="control-delete"]',(function(){var e=$(this).parents(".payments-products-dialog-row");t.engine.getLoader().execCommand("track-event","payments_products_delete");var n=parseInt(e.attr("data-index")),i=parseInt(e.attr("data-control-identifier"));if(t.productsToRemove.push(i),-1===n)t.model.fixedAmount=null;else for(var r=0,a=t.model.controls.length;r<a;r++)if(n===t.model.controls[r].rowIndex){t.model.controls.splice(r,1);break}$(this).parent().remove()})),e.dialog.setAttribute("events-attached","1")),$('[data-role="control-quantity"] [data-role="text-dropdown"]').each((function(){this.addEventListener("click",(function(e){var n=$(e.target);if(n.attr("data-value")){var i=parseInt(n.parents(".payments-products-dialog-row").attr("data-index")),r=parseInt(n.attr("data-value").replace(/"/g,""))||null;t.updateControlConfigurationInsideModel(i,"quantity",r)}}),!0)})),$('[data-role="control-discount"] [data-role="text-dropdown"]').each((function(){this.addEventListener("click",(function(e){var n=$(e.target);if(n.attr("data-value")){var i=n.parents(".payments-products-dialog-row"),r=n.parents(".payments-products-dialog-column"),a=r.find("span"),o=r.find('input:not([type="hidden"])'),s=parseInt(i.attr("data-index")),l=parseInt(JSON.parse(n.attr("data-value"))),u=0===l,c=t.generateGenericPriceFormatFromInputValue(o.val(),u),d="- ";isNaN(s)?(t.engine.getLoader().execCommand("track-event","payments_products_discount_total_type_change"),t.model.onTotalDiscountUnitType=l,t.model.onTotalDiscountValue=c,d+=t.generateDiscountAndTaxValue(c,t.model.onTotalDiscountUnitType)):(t.engine.getLoader().execCommand("track-event","payments_products_discount_type_change"),t.updateControlConfigurationInsideModel(s,"discountUnitType",l),t.updateControlConfigurationInsideModel(s,"discountValue",c),d+=t.generateDiscountAndTaxValue(c,t.model.controls[s].discountUnitType)),r.attr("title",d),a.text(d),o.val(c),t.removeClickedState($)}}),!0)})),$('[data-role="control-tax"] [data-role="text-dropdown"]').each((function(){this.addEventListener("click",(function(e){var n=$(e.target);if(n.attr("data-value")){var i=n.parents(".payments-products-dialog-row"),r=n.parents(".payments-products-dialog-column"),a=r.find("span"),o=r.find('input:not([type="hidden"])'),s=parseInt(i.attr("data-index")),l=parseInt(JSON.parse(n.attr("data-value"))),u=t.generateGenericPriceFormatFromInputValue(o.val()),c="+ ";isNaN(s)?(t.engine.getLoader().execCommand("track-event","payments_products_tax_total_type_change"),t.model.onTotalTaxUnitType=l,t.model.onTotalTaxValue=u,c+=t.generateDiscountAndTaxValue(u,t.model.onTotalTaxUnitType)):(t.engine.getLoader().execCommand("track-event","payments_products_tax_type_change"),t.updateControlConfigurationInsideModel(s,"taxUnitType",l),t.updateControlConfigurationInsideModel(s,"taxValue",u),c+=t.generateDiscountAndTaxValue(u,t.model.controls[s].taxUnitType)),r.attr("title",c),a.text(c),o.val(u),t.removeClickedState($)}}),!0)})),e.dialog.addEventListener("click",(function(e){var n=$(e.target),i=n.parents('[data-role="control-price"][data-price-literal]'),r=n.parents('[data-role="control-discount"]'),a=n.parents('[data-role="control-tax"]');0===i.length&&0===r.length&&0===a.length&&t.removeClickedState($)}),!0)}},{key:"generateGenericPriceFormatFromInputValue",value:function(e,t){return t=void 0!==t&&t,e=e||"0",parseFloat(e)<0&&(e="0"),parseFloat(e)>100&&!0===t&&(e="100"),(Math.round(100*parseFloat(e||"0"))/100).toFixed(2)}},{key:"generateDiscountAndTaxValue",value:function(e,t){var n=e+this.unitType[Ri.PERCENTAGE].unitTypeSymbol;return 1===t&&(n=this.model.currencySymbol+e),n}},{key:"removeClickedState",value:function(e){e(".payments-products-dialog-row [data-has-click]").each((function(){this.removeAttribute("data-has-click")}))}},{key:"updateControlConfigurationInsideModel",value:function(e,t,n){for(var i=0,r=this.model.controls.length;i<r;i++)if(e===this.model.controls[i].rowIndex){this.model.controls[i][t]=n;break}}},{key:"getCompatibleProductControls",value:function(){var t=this,n=this.engine.getDocument().getControlsList(),i=[];return n.forEach((function(n){null!==n.getId()&&(e.COMPATIBLE_QUANTITY_CONTROLS_WITHOUT_VALUE.indexOf(n.getTypeId())>-1||n.hasProperty("payments.value"))&&i.push({id:n.getId(),label:t.getControlName(n)})})),i}},{key:"getCompatibleQuantityControls",value:function(t){for(var n=this.engine.getDocument().getControlsList(),i=[],r=0,a=n.length;r<a;r++)if(null!==n[r].getId()&&t!==n[r].getId())if(e.COMPATIBLE_QUANTITY_CONTROLS_WITHOUT_VALUE.indexOf(n[r].getTypeId())>-1)i.push({id:n[r].getId(),label:this.getControlName(n[r])});else if(n[r].hasProperty("payments.value")){var o=n[r].getProperty("payments.value");null!==o&&o.length>=1&&0!==o.reduce((function(e,t){return e+t}),0)&&i.push({id:n[r].getId(),label:this.getControlName(n[r])})}return i}},{key:"getControlName",value:function(e){return e.hasProperty("label.labelText")&&""!==e.getProperty("label.labelText")?e.getProperty("label.labelText"):"Control #".concat(e.getId())}},{key:"getControlSinglePrice",value:function(t){if(!t.hasProperty("payments.value"))return null;var n=t.getProperty("payments.value")||["0"];return-1===e.CONTROLS_WITH_MULTIPLE_PRICES.indexOf(t.getTypeId())&&-1===e.CONTROLS_WITH_VARIABLE_PRICE.indexOf(t.getTypeId())?this.generateGenericPriceFormatFromInputValue(n[0]):null}},{key:"saveProductRemovalFromDialog",value:function(){var e={},t={},n=this;if(n.productsToRemove.forEach((function(t){e[t]=(e[t]||0)+1})),null==n.settings.getProperty("productsData"))var i=[];else i=n.settings.getProperty("productsData").map((function(e){return e.controlId}));i.forEach((function(e){t[e]=(t[e]||0)+1})),n.productsToRemove.map((function(i){if(!isNaN(i)&&(e[i]===t[i]||e[i]>=1&&void 0===t[i])){var r=n.engine.getDocument().getElementById(i);r.hasProperty("payments")&&r.setProperty("payments.isProduct",!1)}}))}},{key:"saveData",value:function(t){var n=this,i=document.getElementById("item"),r=this.engine.getDocument().getElementByHash(i.getAttribute("data-target-element")),a=[],o=[];(this.settings.getProperty("productsData")||[]).forEach((function(e){a.push(e.controlId)})),this.settings.setProperty("currencyId",t.currencyId),void 0!==t.fixedAmount&&null!==t.fixedAmount?(this.settings.setProperty("fixedAmount",parseFloat(t.fixedAmount)),this.engine.getLoader().getCommandDispatcher().trackFirstValueSaved()):this.settings.setProperty("fixedAmount",null),this.settings.setProperty("discountValue",parseFloat(t.onTotalDiscountValue)),this.settings.setProperty("discountType",t.onTotalDiscountUnitType),this.settings.setProperty("taxValue",parseFloat(t.onTotalTaxValue)),this.settings.setProperty("taxType",t.onTotalTaxUnitType),this.settings.setProperty("productsData",t.controls.map((function(t){var a,s=t.controlId,l=n.engine.getDocument().getElementById(s),u=n.engine.getLoader(),c=l.getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING).getProperty("productsData"),d=window.location.href.replace("p=edit_fields","p=settings&tab=4"),p=u.getI18n().translateText("edt_UI_msg_payments_products_first_add_notification",d),h=n.engine.getDocument().getConfiguration().getProperty("hasProcessorsInjected");if(c&&0!==c.length||h||u.getUI().createNotification(p,!1,qe.d.DEFAULT,!0),-1===e.CONTROLS_WITH_MULTIPLE_PRICES.indexOf(l.getTypeId())&&-1===e.CONTROLS_WITH_VARIABLE_PRICE.indexOf(l.getTypeId())&&(l.setProperty("payments.value",[parseFloat(t.price||"0")]),n.updateFeeControl(),n.engine.getLoader().getCommandDispatcher().trackFirstValueSaved(),n.engine.getLoader().execCommand("track-event","payments_products_price_change"),u.trigger("payments_products_price_change"),r&&r.getId()===s)){var g=i.querySelector('[data-role="attribute-group"][data-name="payments"] [data-role="property"][data-property-name="payments-virtualValue"] input[type="number"]');null!==g&&(g.value=String(t.price))}e.CONTROLS_WITH_MULTIPLE_PRICES.indexOf(l.getTypeId())>-1&&((a=void 0===n.temporaryControlsData[s]?l.getProperty("choices.values"):n.temporaryControlsData[s]).forEach((function(e){"undefined"!==typeof e.paymentsValue&&null!==e.paymentsValue||(e.paymentsValue=0)})),(new bi).updateControlChoicesAndDOM(l,a,n.engine.getJQuery()));return o.push(s),l.hasProperty("payments.hasProductsSettingsEntry")&&l.setProperty("payments.hasProductsSettingsEntry",!0),{controlId:s,details:t.customName,quantityControlId:t.quantity||null,tax:parseFloat(t.taxValue),taxType:t.taxUnitType,discount:parseFloat(t.discountValue),discountType:t.discountUnitType}}))),this.engine.getLoader().getCommandDispatcher().reloadVisiblePanel(),a.forEach((function(e){if(-1===o.indexOf(e)){var t=n.engine.getDocument().getElementById(e);t&&t.hasProperty("payments.hasProductsSettingsEntry")&&t.setProperty("payments.hasProductsSettingsEntry",!1)}}))}}],[{key:"openFromExternalSource",value:function(){var t=new e,n=window.ed;t.open(n.getJQuery(),n.getEngine()).done((function(e){t.saveData(e)})).fail((function(e){console.warn(e.message)}))}}]),e}();function Di(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Si,"DEFAULT_CURRENCY_ID",1),v()(Si,"COMPATIBLE_QUANTITY_CONTROLS_WITHOUT_VALUE",[C.a.CONTROL_TYPE_TEXT,C.a.CONTROL_TYPE_NUMBER,C.a.CONTROL_TYPE_STAR_RATING,C.a.CONTROL_TYPE_PRICE,C.a.CONTROL_TYPE_FORMULA]),v()(Si,"CONTROLS_WITH_MULTIPLE_PRICES",[C.a.CONTROL_TYPE_DROPDOWN,C.a.CONTROL_TYPE_CHECKBOX,C.a.CONTROL_TYPE_RADIO,C.a.CONTROL_TYPE_LIKERT_SCALE]),v()(Si,"CONTROLS_WITH_VARIABLE_PRICE",[C.a.CONTROL_TYPE_FORMULA]),v()(Si,"CURRENCY_DIALOG_TITLE","Form currency");var Li=function(e){g()(n,e);var t=Di(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"settings",void 0),v()(c()(r),"nameNode",void 0),v()(c()(r),"priceNode",void 0);var a=r.getHash();return r.settings=r.getForm().getEngine().getDocument().getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","name-".concat(a,"-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("data-index",String(n.INDEX_DESCRIPTION)),r.instructionsDOMNode.setAttribute("id","name-".concat(a,"-instr-acc")),r.nameNode=document.createElement("input"),r.nameNode.setAttribute("data-role","i123-input"),r.nameNode.setAttribute("type","text"),r.nameNode.setAttribute("data-index",String(n.INDEX_NAME)),r.nameNode.placeholder="Shipping fee",r.nameNode.setAttribute("data-i18n-placeholder","textdef_30"),r.priceNode=document.createElement("div"),r.priceNode.setAttribute("data-role","fee-price"),r.priceNode.setAttribute("id","name-".concat(a,"-fee-price-acc")),r.priceNode.setAttribute("data-index",String(n.INDEX_BASE_PRICE)),r.priceNode.innerHTML=r.getProperty("payments.value")||"0",r.rootNode.setAttribute("aria-labelledby","name-".concat(a,"-acc\n                   name-").concat(a,"-error-acc\n                   name-").concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_FEE}},{key:"getElementName",value:function(){return"Fee"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.priceNode,width:T.y.FULL},{input:this.instructionsDOMNode,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updatePriceFee(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute()}},{key:"updatePriceFee",value:function(){var e=this.getProperty("payments.value"),t=this.getCurrencySymbol();e=e||"0",this.priceNode.innerHTML=t+e}},{key:"getCurrencySymbol",value:function(){var e,t=this.getForm().getEngine();return e=this.settings?this.settings.getProperty("currencyId"):t.getLoader().getFormSettings().currencyId,t.getCurrency().getCurrencyById(e||Si.DEFAULT_CURRENCY_ID).symbol}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case n.INDEX_NAME:return{targetPropertyFQN:"label.labelText",type:"string",optional:!1};case n.INDEX_DESCRIPTION:return{targetPropertyFQN:"instructions.text",type:"string",optional:!0};case n.INDEX_BASE_PRICE:return{targetPropertyFQN:"payments.value",type:"numeric",optional:!1};default:return null}}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText","Shipping Fee"),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}}],[{key:"initialize",value:function(){this.isInitialized||(this.isInitialized=!0)}},{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_FEE,name:"Fee",isContainer:!1,category:"e-commerce",keywords:"shipping fee fixed",icon:"i123-price_fee",isVirtual:!1,index:1,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function ki(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Li,"attributes",{}),v()(Li,"runtime",null),v()(Li,"nodeName","fee"),v()(Li,"isInitialized",!1),v()(Li,"INDEX_NAME",0),v()(Li,"INDEX_DESCRIPTION",1),v()(Li,"INDEX_BASE_PRICE",2);var Mi=function(e){g()(n,e);var t=ki(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"isEditorVisible",!1),e}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_FORM_HEADER}},{key:"getElementName",value:function(){var e=this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_form_header_name");return e&&"edt_UI_control_type_form_header_name"!==e?e:"Form header"}},{key:"updateHTMLContent",value:function(){if(this.hasProperty("configuration.innerHTML")){var e=this.getProperty("configuration.innerHTML"),t=this.getForm();e=jt.addNoFollowOnLinks(e),this.rootNode.innerHTML=S.sanitizeHTMLUsingUserRights(String(e||""));for(var n=0,i=t.getNumberOfPages();n<i;n++)t.getPageByIndex(n).renderHeader()}else this.rootNode.innerHTML="";this.updateAccessibilityAttributes()}},{key:"isRemovable",value:function(){return!1}},{key:"onCreated",value:function(){var e=this;this.updateHTMLContent(),this.updateAccessibilityAttributes(),setTimeout((function(){e.updateAccessibilityTabIndexes()}),10)}},{key:"getResizingCapability",value:function(){return T.K.NONE}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"isDuplicatable",value:function(){return!1}},{key:"onReset",value:function(){}},{key:"setupI18n",value:function(){return this.getRootNode().setAttribute("data-i18n-html","Headline"),p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"updateAccessibilityAttributes",value:function(){var e=this.getHash();this.rootNode.setAttribute("id","form-heading-".concat(e,"-acc")),this.rootNode.setAttribute("aria-labelledby","form-heading-".concat(e,"-acc"))}},{key:"onEnterSelection",value:function(){p()(E()(n.prototype),"onEnterSelection",this).call(this),function(e,t){e(t).find("[data-role=control][data-type=form-header]").attr("data-is-selected","1")}(this.getForm().getEngine().getJQuery(),this.getForm().getRootNode())}},{key:"onLeaveSelection",value:function(){p()(E()(n.prototype),"onLeaveSelection",this).call(this),function(e,t){e(t).find("[data-role=control][data-type=form-header]").removeAttr("data-is-selected")}(this.getForm().getEngine().getJQuery(),this.getForm().getRootNode())}},{key:"openEditableHTMLDialog",value:function(){this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT&&function(e,t){t.isEditorVisible||(t.isEditorVisible=!0,setTimeout((function(){e('#item[data-target-element-type="form header"][data-target-element="'.concat(t.getHash(),'"] [data-auto-click]')).each((function(){e(this).trigger("click")}))}),300),setTimeout((function(){t.isEditorVisible=!1}),600))}(this.getForm().getEngine().getJQuery(),this)}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("configuration.innerHTML")||"";return t&&e.push({key:"Headline",sourceText:t}),e}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_FORM_HEADER,name:"Form Header",isContainer:!1,category:"basic",keywords:"",icon:"",isVirtual:!1,index:99999,accessibilityFields:T.r.ROOT_NODE}}}]),n}(tn);function xi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Mi,"nodeName","form-header"),v()(Mi,"attributes",{}),v()(Mi,"runtime",null);var wi=function(e){g()(n,e);var t=xi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"previousRenderedHeadingElementName",void 0);var a=r.getHash();return r.previousRenderedHeadingElementName=r.getDOMLabelElementName(),r.labelDOMNode=document.createElement(r.previousRenderedHeadingElementName),r.labelDOMNode.setAttribute("id","heading-".concat(a,"-acc")),r.labelDOMNode.setAttribute("aria-labelledby","heading-".concat(a,"-acc")),r.rootNode.appendChild(r.labelDOMNode),r.updateAccessibilityTabIndexes(),n.instanceID++,r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_HEADING}},{key:"getElementName",value:function(){return"Heading"}},{key:"setRendererType",value:function(e){}},{key:"getDOMLabelElementName",value:function(){switch(this.getProperty("configuration.fontSize")){case 1:return"h6";case 2:return"h5";case 4:return"h3";case 5:return"h2";case 6:return"h1";case 3:default:return"h4"}}},{key:"updateLabelText",value:function(){var e=this.getDOMLabelElementName();e!==this.previousRenderedHeadingElementName&&(this.labelDOMNode.parentNode.removeChild(this.labelDOMNode),this.labelDOMNode=document.createElement(e),this.rootNode.appendChild(this.labelDOMNode),this.previousRenderedHeadingElementName=e),p()(E()(n.prototype),"updateLabelText",this).call(this)}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateLabelRemovedState(),this.updateFieldNameAttribute()}},{key:"updateLabelRemovedState",value:function(){this.hasProperty("label.isRemoved")&&this.getProperty("label.isRemoved")?this.rootNode.removeChild(this.labelDOMNode):this.rootNode.appendChild(this.labelDOMNode)}},{key:"updateFieldNameAttribute",value:function(){this.hasProperty("configuration.fieldName")&&this.getProperty("configuration.fieldName")&&this.rootNode.setAttribute("data-field-name",this.getProperty("configuration.fieldName"))}},{key:"onReset",value:function(){}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("formeditor_headingDefault")),this.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("formeditor_fieldTypeHeading")," ").concat(n.instanceID)),this.updateLabelText(),this}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"label.labelText",type:"string",optional:!0};default:return null}}},{key:"cloneNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=p()(E()(n.prototype),"cloneNode",this).call(this,!!e,t);return i.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_heading_name")," ").concat(n.instanceID)),i}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),e}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_HEADING,name:"Heading",isContainer:!1,category:"basic",keywords:"heading text statement",icon:"i123-editor_field_heading",isVirtual:!1,i18nName:"edt_UI_control_type_heading_name",i18nKeywords:"edt_UI_control_type_heading_keywords",index:70,accessibilityFields:T.r.ROOT_NODE}}}]),n}(tn);function Ui(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(wi,"instanceID",0),v()(wi,"attributes",{}),v()(wi,"runtime",null),v()(wi,"nodeName","heading");var Fi=function(e){g()(n,e);var t=Ui(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"imageNode",void 0),v()(c()(r),"imageParentNode",void 0),v()(c()(r),"isImageLoaded",!1),n.instanceID++,r.imageParentNode=document.createElement("div"),r.getRootNode().appendChild(r.imageParentNode),r.imageParentNode.setAttribute("data-image-container","1"),r.imageNode=document.createElement("img"),r.imageParentNode.appendChild(r.imageNode),r.imageNode.addEventListener("load",(function(){r.getRootNode().removeAttribute("data-image-placeholder"),r.isImageLoaded=!0,jt.refreshFrameHeightOnWix()}),!0),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_IMAGE}},{key:"getElementName",value:function(){return"Image"}},{key:"updateImageOptions",value:function(){this.hasProperty("configuration.remoteURL")&&!this.getProperty("configuration.remoteURL")&&this.rootNode.setAttribute("data-image-placeholder","1"),this.isImageLoaded=!1,this.imageNode.setAttribute("src",jt.getImageURLAntiCache(String(this.getProperty("configuration.remoteURL")||""))),this.imageNode.setAttribute("align",String(this.getProperty("configuration.align"))),this.updateAlternateTextAttribute()}},{key:"setRendererType",value:function(e){}},{key:"onCreated",value:function(){this.updateImageOptions(),this.updateAlternateTextAttribute()}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"getResizingCapability",value:function(){return this.isImageLoaded?T.K.ALL:T.K.LEFT_AND_RIGHT}},{key:"onReset",value:function(){}},{key:"updateAlternateTextAttribute",value:function(){var e=this.getProperty("configuration.alternateText");e&&this.imageNode.getAttribute("src")?this.imageNode.setAttribute("alt",e):this.imageNode.removeAttribute("alt")}},{key:"setupDefaults",value:function(){return this.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("formeditor_fieldTypeImage")," ").concat(n.instanceID)),this}},{key:"cloneNode",value:function(e){var t=p()(E()(n.prototype),"cloneNode",this).call(this,!!e);return t.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_image_name")," ").concat(n.instanceID)),t}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_IMAGE,name:"Image",isContainer:!1,category:"other",keywords:"image picture photo",icon:"i123-editor_field_image",isVirtual:!1,i18nName:"edt_UI_control_type_image_name",i18nKeywords:"edt_UI_control_type_image_keywords",index:230,accessibilityFields:T.r.ROOT_NODE}}}]),n}(tn);function Yi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Fi,"instanceID",0),v()(Fi,"attributes",{}),v()(Fi,"runtime",null),v()(Fi,"nodeName","image");var Bi=function(e){g()(n,e);var t=Yi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"choices",[]),v()(c()(r),"choicesLine",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","likertscale-".concat(a,"-acc")),r.labelDOMNode.setAttribute("data-skip-markdown","true"),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","likertscale-".concat(a,"-error-acc")),r.choicesLine=document.createElement("div"),r.choicesLine.setAttribute("data-role","likert-header"),r.rootNode.setAttribute("aria-labelledby","likertscale-".concat(a,"-acc ")+"likertscale-".concat(a,"-error-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateShowInstructionsOnClick(),this.updateInlineOptionsAttribute(),this.updateBoldOptionsAttribute(),this.updateChoices(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged()}},{key:"updateLabelText",value:function(){if(void 0!==this.labelDOMNode&&this.hasProperty("label.labelText")){var e=this.getProperty("label.labelText"),t=this.hasProperty("label.isRemoved")&&this.getProperty("label.isRemoved"),n=t||this.hasProperty("label.isCompactField")&&this.getProperty("label.isCompactField");null===e||""===e?(this.labelDOMNode.setAttribute("data-is-empty","1"),this.labelDOMNode.textContent="",this.isCompactFieldPlaceholderSupported()&&n&&x.setLabelCompactFieldState(!0,"",this.getInputDOMNodes(),t)):(this.labelDOMNode.removeAttribute("data-is-empty"),this.labelDOMNode.innerHTML=e,this.isCompactFieldPlaceholderSupported()&&n&&x.setLabelCompactFieldState(!0,e,this.getInputDOMNodes(),t))}}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_LIKERT_SCALE}},{key:"getElementName",value:function(){return"Likert scale"}},{key:"getPropertyDescriptorByInputIndex",value:function(e){var t=(this.getProperty("choices.values")||[]).length;return e<t?{element:this,targetPropertyFQN:"value.value",optional:!1,type:"string",inputIndex:e}:e>=t?null:{element:this,targetPropertyFQN:"value.value",optional:!1,type:"string",inputIndex:e}}},{key:"isSelectable",value:function(){return!1}},{key:"isDragable",value:function(){return!1}},{key:"getResizingCapability",value:function(){return T.K.NONE}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.choicesLine,width:T.y.FULL}]}]}},{key:"updateChoices",value:function(){if(this.hasProperty("choices.values")){for(var e,t=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),n=this.getHash(),i=this.getProperty("options.inlineOptions"),r=0,a=t.length;r<a;r++)t[r].index=r;this.choicesLine.innerHTML="",this.choices.splice(0,this.choices.length);for(var o=0,s=t.length;o<s;o++)e=this.getForm().getEngine().getTheme().isMobileLayout()?this.createChoiceElement(t[o].text,o,n,t[o].isDefault,!0):this.createChoiceElement(t[o].text,o,n,t[o].isDefault,i),this.choices.push(e),this.choicesLine.appendChild(e);this.isAttached()&&this.reRender()}}},{key:"createRadioNode",value:function(e,t,n,i){var r=document.createElement("input");return r.setAttribute("type","radio"),r.setAttribute("id","".concat(n,"_").concat(e)),r.setAttribute("name","c_".concat(n)),r.setAttribute("value",t),r.setAttribute("data-index",String(e)),r.setAttribute("data-role","i123-input"),i&&(r.checked=!0),r}},{key:"createLabelElement",value:function(e,t,n,i,r){var a=document.createElement("label");a.setAttribute("data-role","choice");var o=this.createRadioNode(e,t,n,i),s=this.createDecoratorElement(e,n);if(i&&a.setAttribute("aria-checked","true"),r){var l=document.createElement("span");l.setAttribute("data-role","option-text"),l.appendChild(document.createTextNode(t||"")),a.appendChild(l)}return a.appendChild(o),a.appendChild(s),a}},{key:"createDecoratorElement",value:function(e,t){var n=document.createElement("label");return n.setAttribute("data-role","checkbox"),n.setAttribute("for","".concat(t,"_").concat(e)),n.setAttribute("role","radio"),n.tabIndex=0,n}},{key:"createChoiceElement",value:function(e,t,n,i,r){var a=document.createElement("div");a.setAttribute("data-role","choice");var o=this.createLabelElement(t,e,n,i,r);return a.appendChild(o),a}},{key:"updateInlineOptionsAttribute",value:function(){this.hasProperty("options.inlineOptions")&&this.getProperty("options.inlineOptions")?this.rootNode.setAttribute("data-has-inline-options",""):this.rootNode.removeAttribute("data-has-inline-options")}},{key:"updateBoldOptionsAttribute",value:function(){this.hasProperty("options.boldOptions")&&this.getProperty("options.boldOptions")?this.rootNode.setAttribute("data-has-bold-options",""):this.rootNode.removeAttribute("data-has-bold-options")}},{key:"synchronizeValue",value:function(){var e,t=this.getProperty("choices.values"),n=this.getProperty("value.value");if(t&&t.length)for(var i=0,r=t.length;i<r;i++)if(t[i].text===n)for(var a=0,o=this.choices.length;a<o;a++)if(e=this.choices[a].querySelector("input[type=radio]"),parseInt(e.getAttribute("data-index"))===i)return void(e.checked||(e.checked=!0,this.setProperty("value.index",i)))}},{key:"onValueChanged",value:function(){for(var e,t,n=null,i=null,r=this.getValue().index,a=0,o=this.choices.length;a<o;a++){if(e=this.choices[a].querySelector("input[type=radio]"),t=this.choices[a].querySelector("label[data-role=checkbox]"),e&&e.checked){n=e.value,i=~~e.getAttribute("data-index"),t.setAttribute("aria-checked","true");break}t&&t.hasAttribute("aria-checked")&&t.removeAttribute("aria-checked")}this.setProperty("value.value",n),this.setProperty("value.index",-1===i?null:~~i),this.isAttached()&&(i!==r&&null!==r&&this.getForm().trigger("radio-uncheck",this,r),this.getForm().trigger("change",this))}},{key:"onReset",value:function(){this.updateChoices(),this.onValueChanged()}},{key:"updateRequiredState",value:function(){}},{key:"setupI18n",value:function(){var e=this.getId();if(e){for(var t=this.getParent(),i=0,r=this.choices.length;i<r;i++){var a=this.choices[i].querySelector("input[type=radio][data-index]");if(a){var o=~~a.getAttribute("data-index"),s=this.choices[i].querySelector("span[data-role=option-text]");s&&(s.setAttribute("data-i18n-text","control_label_".concat(e,"_choice_").concat(o)),s.setAttribute("data-skip-markdown","true")),t&&t.trigger("translation-set",o,"control_label_".concat(e,"_choice_").concat(o))}}t&&t.trigger("translation-set",null,"likert_headline_".concat(e))}return p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"getInputDOMNodeAtIndex",value:function(e){return null===e?null:this.rootNode.querySelector('input[type=radio][data-index="'.concat(e,'"]'))}},{key:"setRendererType",value:function(e){var t=e;switch(e){case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL:t=T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL;break;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD:t=T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD;break;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:t=T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD;break;case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:t=T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD}p()(E()(n.prototype),"setRendererType",this).call(this,t)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"setVisible",value:function(e){p()(E()(n.prototype),"setVisible",this).call(this,e),this.getParent().trigger("child-visibility-changed")}},{key:"onFocusEnter",value:function(){this.getParent()&&this.getParent().onFocusEnter()}},{key:"onFocusLeave",value:function(){this.getParent()&&this.getParent().onFocusLeave()}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_LIKERT_SCALE,name:"Likert Scale",isContainer:!1,category:"advanced",keywords:"likert scale radio radios matrix",icon:"i123-editor_field_likertscale",isVirtual:!0,i18nName:"edt_UI_control_type_likert_scale_name",i18nKeywords:"edt_UI_control_type_likert_scale_keywords",index:105,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE}}}]),n}(tn);v()(Bi,"attributes",{}),v()(Bi,"runtime",null),v()(Bi,"nodeName","likert-scale");var Vi,Hi=function(){function e(){o()(this,e)}return l()(e,null,[{key:"create",value:function(e,t){var n,i=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var l=function(){n=void 0,r||e.apply(i,o)},u=r&&void 0===n;void 0!==n&&clearTimeout(n),n=setTimeout(l.bind(i),t),u&&e.apply(i,o)}}}]),e}();function Gi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}!function(e){e.NO_API_KEY="no_api_key",e.WRONG_API_KEY="wrong_api_key",e.OTHER_ERROR="other_error"}(Vi||(Vi={}));var Wi=function(e){g()(n,e);var t=Gi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"isGoogleMapsJavascriptAPILoaded",!1),v()(c()(r),"mapRendererNode",void 0),v()(c()(r),"mapOverlay",void 0),v()(c()(r),"mapSearchInput",void 0),v()(c()(r),"isMapSearchDivSet",void 0),v()(c()(r),"map",void 0),v()(c()(r),"marker",void 0),v()(c()(r),"geocoder",void 0),v()(c()(r),"updateMarkerPositionInThrottledMode",void 0),v()(c()(r),"updateMapSizeDebounced",Hi.create((function(){var e=r.labelDOMNode.offsetHeight,t=r.instructionsDOMNode.offsetHeight,i=r.errorDOMNode.offsetHeight,a=null===r.getHeight()?n.DEFAULT_MAP_HEIGHT:r.getHeight(),o=a,s=r.getForm().getEngine().getTheme(),l=~~parseInt(s.getMergedProperties().container.padding.vertical),u=~~parseInt(s.getMergedProperties().label.padding.bottom);x.LABEL_PLACEMENT_TOP_RENDERERS.indexOf(r.getRendererType())>-1&&r.getVisibilityMode()!==T.o.REMOVED&&(o-=e,o-=t,o-=i,o-=u),o-=2*l,r.mapRendererNode.style.height="".concat(o,"px"),r.setProperty("configuration.mapHeight",a-5),window.google&&window.google.maps&&r.map&&google.maps.event.trigger(r.map,"resize")}),200));var a=r.getHash();if(r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","googlemap-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","googlemap-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","googlemap-".concat(a,"-instr-acc")),r.mapRendererNode=document.createElement("div"),r.mapRendererNode.setAttribute("data-role","map-canvas"),r.mapRendererNode.tabIndex=null,r.mapOverlay=document.createElement("div"),r.mapOverlay.setAttribute("data-role","map-overlay"),r.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT){var s=document.createElement("div");s.setAttribute("data-role","map-overlay-text");var l=document.createElement("span");l.setAttribute("data-i18n-text","textdef_250"),l.textContent="Add your Google Maps API Key to use this field",s.appendChild(l),r.mapOverlay.appendChild(s)}return r.mapSearchInput=document.createElement("input"),r.mapSearchInput.setAttribute("type","text"),r.mapSearchInput.setAttribute("data-role","i123-input"),r.mapSearchInput.setAttribute("class","controls"),r.mapSearchInput.setAttribute("data-no-theme",""),r.mapSearchInput.placeholder="Search Address",r.rootNode.setAttribute("aria-labelledby","googlemap-".concat(a,"-acc ")+"googlemap-".concat(a,"-error-acc ")+"googlemap-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r.updateMarkerPositionInThrottledMode=O.a.create((function(){r.updateMarkerPosition()}),1500),r}return l()(n,[{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.mapRendererNode,width:T.y.FULL}]}]}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_MAP}},{key:"getElementName",value:function(){return"Map"}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"float[]",optional:!0};default:return null}}},{key:"setRendererType",value:function(e){p()(E()(n.prototype),"setRendererType",this).call(this,e),this.updateMapSize()}},{key:"onCreated",value:function(){var e=this;this.updateMapSize(),this.updateLabelText(),this.updateInstructionsText(),this.updateErrorsText(),this.updateShowInstructionsOnClick(),this.synchronizeValue(),this.updateApiKey(),this.initializeMapCanvas(),this.initDOMEvents(),setTimeout((function(){e.initAddressSync()}),0)}},{key:"updateApiKey",value:function(){this.getProperty("configuration.apiKey")?n.GOOGLE_MAPS_EMBED_KEY=this.getProperty("configuration.apiKey"):n.GOOGLE_MAPS_EMBED_KEY="",n.theOnlyOneGoogleMapsAPILoadRequestPromise=void 0,this.isGoogleMapsJavascriptAPILoaded=!1,window.google=void 0}},{key:"initAddressSync",value:function(){var e=this,t=this.getProperty("synchronize.withControlId");try{if(this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&null!==t){var n=this.getForm().getElementById(t);n&&(setTimeout((function(){n.setMapSync(!0)}),1e3),n.setSyncronizeCallback((function(){e.geocoder.geocode({address:e.parseUserAddress(n)},(function(t,n){e.showAddressOnMap(n,t)}))})))}}catch(i){console.warn("Failed to synchronize map coordinates with control #".concat(t)),console.error(i)}}},{key:"parseUserAddress",value:function(e){var t,n=e.getValue();return null!==n.address1&&(t=n.address1),null!==n.address2&&(t+=" ".concat(n.address2)),null!==n.city&&(t+=" ".concat(n.city)),null!==n.zone&&(t+=" ".concat(n.zone)),null!==n.zipCode&&(t+=" ".concat(n.zipCode)),null!==n.country&&(t+=" ".concat(n.country)),t}},{key:"initializeMapCanvas",value:function(){var e=this;this.whenGoogleMapsAPIIsLoaded().then((function(){window.google?(e.map=new google.maps.Map(e.mapRendererNode,{center:{lat:-34.397,lng:150.644}}),e.marker=void 0,e.geocoder=new google.maps.Geocoder,e.updateMapZoomSetting(),e.updateMapInteractiveSetting(),e.updateMarkerPosition(),e.updateMapSize()):e.mapRendererNode.innerHTML=""})).fail((function(){e.mapRendererNode.appendChild(e.mapOverlay),e.updateMapSize()}))}},{key:"updateMapZoomSetting",value:function(){var e=~~this.getProperty("configuration.initialZoom")||15;e<n.GOOGLE_MAPS_MIN_ZOOM&&(e=n.GOOGLE_MAPS_MIN_ZOOM),e>n.GOOGLE_MAPS_MAX_ZOOM&&(e=n.GOOGLE_MAPS_MAX_ZOOM),this.map.setZoom(e)}},{key:"updateMapInteractiveSetting",value:function(){var e=this,t=!!this.getProperty("configuration.isInteractive"),i=~~this.getProperty("configuration.initialZoom")||15;if(i<n.GOOGLE_MAPS_MIN_ZOOM&&(i=n.GOOGLE_MAPS_MIN_ZOOM),i>n.GOOGLE_MAPS_MAX_ZOOM&&(i=n.GOOGLE_MAPS_MAX_ZOOM),t){this.map.setOptions({zoomControl:!0,panControl:!0,rotateControl:!0,minZoom:n.GOOGLE_MAPS_MIN_ZOOM,mazZoom:n.GOOGLE_MAPS_MAX_ZOOM,zoom:i,streetViewControl:!0,mapTypeControl:!0,fullscreenControl:!0,gestureHandling:"auto",keyboardShortcuts:!0,scrollwheel:!0}),this.marker&&this.marker.setOptions({draggable:!0});var r=document.createElement("div");r.appendChild(this.mapSearchInput),""===_e.meetsRequirements("* * mobile * *")&&(this.mapSearchInput.oninput=function(){e.isMapSearchDivSet||setTimeout((function(){for(var t=document.body.getElementsByClassName("pac-container"),n=t.length,i=0;i<n;i++)if("none"!==t[i].style.display){r.appendChild(t[i]),e.isMapSearchDivSet=!0;break}}),300)});var a=new google.maps.places.SearchBox(this.mapSearchInput);this.map.controls[google.maps.ControlPosition.TOP_LEFT].push(r),this.map.addListener("bounds_changed",(function(){a.setBounds(e.map.getBounds())})),a.addListener("places_changed",(function(){var t=a.getPlaces();0!=t.length&&t[0].geometry&&(e.marker?e.marker.position=t[0].geometry.location:e.marker=new google.maps.Marker({map:e.map,position:t[0].geometry.location,draggable:e.getProperty("configuration.isInteractive")}),e.map.setCenter(e.marker.getPosition()),""===_e.meetsRequirements("* * mobile * *")&&setTimeout((function(){e.map.panBy(0,-25)}),500),e.onValueChanged(),e.propagateCoordinates(t[0].geometry.location.lat(),t[0].geometry.location.lng()),e.geocoder.geocode({latLng:t[0].geometry.location},(function(t){e.propagateAddress(t)})))}))}else this.map.setOptions({zoomControl:!1,panControl:!1,rotateControl:!1,minZoom:i,maxZoom:i,zoom:i,streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1,gestureHandling:"none",keyboardShortcuts:!1,scrollwheel:!1}),this.marker&&this.marker.setOptions({draggable:!1}),this.map.controls[google.maps.ControlPosition.TOP_LEFT].clear()}},{key:"updateMarkerPosition",value:function(){var e=this;if(this.isGoogleMapsJavascriptAPILoaded){var t=String(this.getProperty("configuration.initialAddressText"))||null;t?this.geocoder.geocode({address:t},(function(t,n){e.showAddressOnMap(n,t),e.geocoder.geocode({latLng:t[0].geometry.location},(function(t){e.propagateAddress(t)}))})):this.marker&&this.marker.setMap(null)}}},{key:"showAddressOnMap",value:function(e,t){var n=this;this.isGoogleMapsJavascriptAPILoaded&&(e===google.maps.GeocoderStatus.OK?(this.map.setCenter(t[0].geometry.location),this.getProperty("configuration.isInteractive")&&""===_e.meetsRequirements("* * mobile * *")&&setTimeout((function(){n.map.panBy(0,-25)}),500),this.marker?(this.marker.setPosition(t[0].geometry.location),this.marker.setMap(this.map),this.propagateCoordinates(t[0].geometry.location.lat(),t[0].geometry.location.lng())):(this.marker=new google.maps.Marker({map:this.map,position:t[0].geometry.location,draggable:this.getProperty("configuration.isInteractive")}),this.onValueChanged(),this.propagateCoordinates(t[0].geometry.location.lat(),t[0].geometry.location.lng()),google.maps.event.addListener(this.marker,"dragend",(function(e){var t=e.latLng.lat(),i=e.latLng.lng();n.map.setCenter(n.marker.getPosition()),n.getProperty("configuration.isInteractive")&&""===_e.meetsRequirements("* * mobile * *")&&setTimeout((function(){n.map.panBy(0,-25)}),500),n.onValueChanged(),n.propagateCoordinates(t,i),n.geocoder.geocode({latLng:e.latLng},(function(e){n.propagateAddress(e)})),n.mapSearchInput.value=""})))):this.marker.setMap(null))}},{key:"propagateAddress",value:function(e){var t=this.getCombinedGeocodedAddressData(e),n=this.getProperty("synchronize.withControlId");try{if(this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&null!==n&&!0===this.getProperty("synchronize.enabled")){var i=this.getForm().getElementById(n);if(null===i)return;i.setMapSync(!1),i.setValue(t),i.updateCountry(t.country),setTimeout((function(){i.setMapSync(!0)}),1e3)}}catch(r){console.warn("Failed to propagate map coordinates to control #".concat(n)),console.error(r)}}},{key:"getCombinedGeocodedAddressData",value:function(e){var t=this,n=this.getGeocodedAddressData(e[0].address_components);return Object(ot.a)(e,(function(e){var i=t.getGeocodedAddressData(e.address_components);Object(ot.a)(i,(function(e,t){!n[t]&&e&&(n[t]=e)}))})),n}},{key:"getGeocodedAddressData",value:function(e){var t=this.getExtractedAddressData(e,["country"]),n={address1:this.getExtractedAddressData(e,["route"]),city:this.getExtractedAddressData(e,["locality"]),zone:this.getExtractedAddressData(e,["administrative_area_level_1"]),country:t,zipCode:this.getExtractedAddressData(e,["postal_code"]),fullCountryName:t},i=this.getExtractedAddressData(e,["street_number"]);return""!==i&&(n.address2="No. ".concat(i)),n}},{key:"getExtractedAddressData",value:function(e,t){for(var n=[],i=0;i<e.length;i++)for(var r=0;r<t.length;r++)-1!=e[i].types.indexOf(t[r])&&n.push(e[i].long_name.toString());return n.join(" ")}},{key:"propagateCoordinates",value:function(e,t){var n=this.getProperty("propagate.onControlId");try{if(this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&null!==n&&!0===this.getProperty("propagate.enabled")){var i=this.getForm().getElementById(n);null!==i&&i.setValue({value:"".concat(e,", ").concat(t)})}}catch(r){console.warn("Failed to propagate map coordinates to control #".concat(n)),console.error(r)}}},{key:"updateMapSize",value:function(){this.updateMapSizeDebounced()}},{key:"withHeight",value:function(e){var t=p()(E()(n.prototype),"withHeight",this).call(this,e);return this.updateMapSize(),t}},{key:"getResizingCapability",value:function(){return T.K.ALL}},{key:"whenGoogleMapsAPIIsLoaded",value:function(){var e=this,t=Bt.getJQuery();return this.isGoogleMapsJavascriptAPILoaded?t.Deferred((function(e){e.resolve()})).promise():(n.theOnlyOneGoogleMapsAPILoadRequestPromise||(n.theOnlyOneGoogleMapsAPILoadRequestPromise=t.Deferred((function(t){if(""!==n.GOOGLE_MAPS_EMBED_KEY){window.gm_authFaliure=function(){t.reject({code:Vi.OTHER_ERROR})};var i="//maps.googleapis.com/maps/api/js?libraries=places&key=".concat(n.GOOGLE_MAPS_EMBED_KEY);e.getForm().getEngine().getResourceManager().loadJavascript(i).done((function(){e.isGoogleMapsJavascriptAPILoaded=!0,t.resolve()})).fail((function(){t.reject(new Error("Failed to load google Maps API"))}))}else t.reject({code:Vi.NO_API_KEY})})).promise()),n.theOnlyOneGoogleMapsAPILoadRequestPromise)}},{key:"setupDefaults",value:function(){this.withHeight(n.DEFAULT_MAP_HEIGHT),this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_map_name"));var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DEFAULT_USER_PREFERENCES);return e&&this.setProperty("configuration.initialAddressText",e.mapLocation),this.updateLabelText(),this}},{key:"onValueChanged",value:function(){this.marker&&this.setProperty("value.value",[this.marker.getPosition().lat(),this.marker.getPosition().lng()])}},{key:"synchronizeValue",value:function(){var e=this,t=this.getProperty("value.value");if(t&&2===t.length&&this.map){var n=new google.maps.LatLng({lat:t[0],lng:t[1]});this.map.setCenter(n),this.getProperty("configuration.isInteractive")&&""===_e.meetsRequirements("* * mobile * *")&&setTimeout((function(){e.map.panBy(0,-25)}),500),this.marker&&this.marker.setPosition(n)}}},{key:"updateLabelText",value:function(){p()(E()(n.prototype),"updateLabelText",this).call(this),this.updateMapSize()}},{key:"updateInstructionsText",value:function(){p()(E()(n.prototype),"updateInstructionsText",this).call(this),this.updateMapSize()}},{key:"updateErrorsText",value:function(){p()(E()(n.prototype),"updateErrorsText",this).call(this),this.updateMapSize()}},{key:"initDOMEvents",value:function(){var e=this;window.addEventListener("resize",(function(){e.updateMapSize()}),!0),this.getForm().on("page-changed",(function(){e.updateMapSize()}))}},{key:"onReset",value:function(){var e=this;this.geocoder?(this.updateMarkerPosition(),this.updateMapZoomSetting(),this.onValueChanged()):(this.initializeMapCanvas(),setTimeout((function(){e.updateMarkerPosition(),e.updateMapZoomSetting(),e.onValueChanged()}),1500))}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_MAP,name:"Map",isContainer:!1,category:"other",keywords:"google map place address",icon:"i123-editor_field_googlemaps",isVirtual:!1,i18nName:"edt_UI_control_type_map_name",i18nKeywords:"edt_UI_control_type_map_keywords",index:280,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE}}}]),n}(tn);v()(Wi,"GOOGLE_MAPS_EMBED_KEY",""),v()(Wi,"GOOGLE_MAPS_MIN_ZOOM",1),v()(Wi,"GOOGLE_MAPS_MAX_ZOOM",15),v()(Wi,"DEFAULT_MAP_HEIGHT",300),v()(Wi,"theOnlyOneGoogleMapsAPILoadRequestPromise",void 0),v()(Wi,"attributes",{}),v()(Wi,"runtime",null),v()(Wi,"nodeName","map");var Ki=function(){function e(){o()(this,e)}return l()(e,null,[{key:"parseName",value:function(e){var t,n="",i="",r="",a=null,o=0,s=0,l=(t=(e=String(this.trim(e)||"")).split(" ").filter((function(e){return-1===e.indexOf("(")}))).length,u=this.getSalutation(t[0]),c=this.getSuffix(t[l-1]),d=u?1:0,p=c?l-1:l;for(a=t[d],this.isInitialName(a)?this.isInitialName(t[d+1])?i+=" ".concat(a.toUpperCase()):r+=" ".concat(a.toUpperCase()):i+=" ".concat(this.fixCase(a)),s=d+1;s<p-1&&(a=t[s],!this.is_compound_lastName(a)||this.isInitialName(a)&&a===a.toUpperCase());s++)this.isInitialName(a)?r+=" ".concat(a.toUpperCase()):i+=" ".concat(this.fixCase(a));if(p-d>1)for(o=s;o<p;o++)n+=" ".concat(this.fixCase(t[o]));return{title:this.trim(u)||null,firstName:this.getFirstName(i)||null,middleName:this.getMiddleName(i)||null,initials:this.trim(r)||null,lastName:this.trim(n)||null,suffix:this.trim(c)||null}}},{key:"isInitialName",value:function(e){return!!e&&1===(e=this.removeIgnoredChars(e)).length}},{key:"fixCase",value:function(e){return e=this.safeUCFirst("-",String(e||"")),e=this.safeUCFirst(".",String(e||""))}},{key:"safeUCFirst",value:function(e,t){return t.split(e).map((function(e){return this.isCamelCaseString(e)?e:e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase()}),this).join(e)}},{key:"is_compound_lastName",value:function(e){return e=e.toLowerCase(),this.COMPOUND_LAST_NAME_WORDS.indexOf(e)>=0}},{key:"getSalutation",value:function(e){return"mr"===(e=this.removeIgnoredChars(e).toLowerCase())||"master"===e||"mister"===e?"Mr.":"mrs"===e?"Mrs.":"miss"===e||"ms"===e?"Ms.":"dr"===e?"Dr.":"rev"===e?"Rev.":"fr"===e?"Fr.":null}},{key:"trim",value:function(e){return null===e?null:String(e||"").replace(/(^[\s]+|[\s]+$)/g,"")}},{key:"getFirstName",value:function(e){return this.trim(String(e||"")).split(/[\s]+/)[0]||null}},{key:"getMiddleName",value:function(e){return this.trim(String(e||"")).split(/[\s]+/).slice(1).join(" ")||null}}]),e}();function zi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ki,"COMPOUND_LAST_NAME_WORDS",["vere","von","van","de","del","della","di","da","pietro","vanden","du","st.","st","la","lo","ter","o","o'","mac","fitz"]),v()(Ki,"SUFFIX_ARRAY",["I","II","III","IV","V","Senior","Junior","Jr","Sr","PhD","APR","RPh","PE","MD","MA","DMD","CME","BVM","CFRE","CLU","CPA","CSC","CSJ","DC","DD","DDS","DO","DVM","EdD","Esq","JD","LLD","OD","OSB","PC","Ret","RGS","RN","RNC","SHCJ","SJ","SNJM","SSMO","USA","USAF","USAFR","USAR","USCG","USMC","USMCR","USN","USNR"]),v()(Ki,"removeIgnoredChars",(function(e){return String(e||"").replace(/\./g,"")})),v()(Ki,"isCamelCaseString",(function(e){return/[A-Z]+/.test(e)&&/[a-z]+/.test(e)})),v()(Ki,"getSuffix",(function(e){e=this.removeIgnoredChars(String(e||"")).toLowerCase();var t=this.SUFFIX_ARRAY.map((function(e){return e.toLowerCase()})).indexOf(e);return t>=0?this.SUFFIX_ARRAY[t]:null}));var qi=function(e){g()(n,e);var t=zi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"titleNode",void 0),v()(c()(r),"firstNameNode",void 0),v()(c()(r),"initialsNode",void 0),v()(c()(r),"middleNameNode",void 0),v()(c()(r),"lastNameNode",void 0),v()(c()(r),"wasCapitalizationPerformed",!1);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","name-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","name-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","name-".concat(a,"-instr-acc")),r.titleNode=Bt.createElement(Bt.ELEMENT_TYPE_DROPDOWN),r.titleNode.setAttribute("data-role","i123-input"),r.titleNode.setAttribute("data-index",String(n.INDEX_TITLE)),r.firstNameNode=document.createElement("input"),r.firstNameNode.setAttribute("data-role","i123-input"),r.firstNameNode.setAttribute("type","text"),r.firstNameNode.setAttribute("data-index",String(n.INDEX_FIRST_NAME)),r.firstNameNode.placeholder="First",r.firstNameNode.setAttribute("data-i18n-placeholder","textdef_30"),r.initialsNode=document.createElement("input"),r.initialsNode.setAttribute("data-role","i123-input"),r.initialsNode.setAttribute("type","text"),r.initialsNode.setAttribute("data-index",String(n.INDEX_INITIALS)),r.initialsNode.placeholder="Initials",r.initialsNode.setAttribute("data-i18n-placeholder","textdef_168"),r.middleNameNode=document.createElement("input"),r.middleNameNode.setAttribute("data-role","i123-input"),r.middleNameNode.setAttribute("type","text"),r.middleNameNode.setAttribute("data-index",String(n.INDEX_MIDDLE_NAME)),r.middleNameNode.placeholder="Middle",r.middleNameNode.setAttribute("data-i18n-placeholder","textdef_167"),r.lastNameNode=document.createElement("input"),r.lastNameNode.setAttribute("data-role","i123-input"),r.lastNameNode.setAttribute("type","text"),r.lastNameNode.setAttribute("data-index",String(n.INDEX_LAST_NAME)),r.lastNameNode.placeholder="Last",r.lastNameNode.setAttribute("data-i18n-placeholder","textdef_31"),r.rootNode.setAttribute("aria-labelledby","name-".concat(a,"-acc ")+"name-".concat(a,"-error-acc ")+"name-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_NAME}},{key:"getElementName",value:function(){return"Name"}},{key:"updateTitleOptions",value:function(){for(var e,t=this.getProperty("configuration.titleChoices")||[{text:"Ms",i18n:"formeditor_dropdownTitleNameChoice1"},{text:"Miss",i18n:"formeditor_dropdownTitleNameChoice2"},{text:"Mrs",i18n:"formeditor_dropdownTitleNameChoice3"},{text:"Mr",i18n:"formeditor_dropdownTitleNameChoice4"}];this.titleNode.getOptions().length;)this.titleNode.remove(0);(e=document.createElement("option")).value="",e.text="Title",e.setAttribute("data-i18n-text","textdef_166"),this.titleNode.add(e);for(var n=this.getId(),i=0,r=t.length;i<r;i++)(e=document.createElement("option")).text=e.value=t[i].text,n?e.setAttribute("data-i18n-text","control_label_".concat(this.getId(),"_choice_").concat(i)):t[i].i18n&&e.setAttribute("data-i18n-text",t[i].i18n),this.titleNode.add(e)}},{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateDefaultName(),this.synchronizeValue(),this.updateHiddenAttribute(),setTimeout((function(){e.updateTitleOptions()}),1)}},{key:"getInputDOMNodes",value:function(){switch(String(~~this.getProperty("configuration.fieldTitle"))+String(~~this.getProperty("configuration.fieldInitials"))+String(~~this.getProperty("configuration.fieldMiddleName"))){case"111":return[{inputs:[{width:T.y.QUARTER,input:this.titleNode},{width:T.y.FILL,input:this.firstNameNode},{width:T.y.QUARTER,input:this.initialsNode}]},{inputs:[{width:T.y.FILL,input:this.middleNameNode},{width:T.y.HALF,input:this.lastNameNode}]}];case"011":return[{inputs:[{width:T.y.QUARTER,input:this.firstNameNode},{width:T.y.QUARTER,input:this.initialsNode},{width:T.y.QUARTER,input:this.middleNameNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"010":return[{inputs:[{width:T.y.THIRD,input:this.firstNameNode},{width:T.y.QUARTER,input:this.initialsNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"001":return[{inputs:[{width:T.y.THIRD,input:this.firstNameNode},{width:T.y.THIRD,input:this.middleNameNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"101":return[{inputs:[{width:T.y.QUARTER,input:this.titleNode},{width:T.y.QUARTER,input:this.firstNameNode},{width:T.y.QUARTER,input:this.middleNameNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"100":return[{inputs:[{width:T.y.QUARTER,input:this.titleNode},{width:T.y.THIRD,input:this.firstNameNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"110":return[{inputs:[{width:T.y.QUARTER,input:this.titleNode},{width:T.y.QUARTER,input:this.firstNameNode},{width:T.y.QUARTER,input:this.initialsNode},{width:T.y.FILL,input:this.lastNameNode}]}];case"000":return[{inputs:[{width:T.y.FILL,input:this.firstNameNode},{width:T.y.HALF,input:this.lastNameNode}]}]}}},{key:"getCapitalizedValue",value:function(e){if(!this.getProperty("options.capitalize"))return e;if(!e)return e;for(var t=e.split(" "),n=0,i=t.length;n<i;n++)t[n]&&t[n].charAt(0)!==t[n].charAt(0).toLocaleUpperCase()&&(t[n]=t[n].charAt(0).toLocaleUpperCase()+t[n].slice(1),this.wasCapitalizationPerformed=!0);return t.join(" ")}},{key:"onValueChanged",value:function(){var e=this;setTimeout((function(){e.wasCapitalizationPerformed=!1,e.setProperty("value.title",e.titleNode.getValue()),e.setProperty("value.firstName",e.getCapitalizedValue(e.firstNameNode.value)),e.setProperty("value.initials",e.getCapitalizedValue(e.initialsNode.value)),e.setProperty("value.middleName",e.getCapitalizedValue(e.middleNameNode.value)),e.setProperty("value.lastName",e.getCapitalizedValue(e.lastNameNode.value)),e.wasCapitalizationPerformed&&e.synchronizeValue()}),0)}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case n.INDEX_TITLE:return{targetPropertyFQN:"value.title",type:"string",optional:!0};case n.INDEX_FIRST_NAME:return{targetPropertyFQN:"value.firstName",type:"string",optional:!0};case n.INDEX_INITIALS:return{targetPropertyFQN:"value.initials",type:"string",optional:!0};case n.INDEX_MIDDLE_NAME:return{targetPropertyFQN:"value.middleName",type:"string",optional:!0};case n.INDEX_LAST_NAME:return{targetPropertyFQN:"value.lastName",type:"string",optional:!0};default:return null}}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.titleNode,this.getProperty("value.title")),jt.synchronizeControlValue(this.firstNameNode,this.getProperty("value.firstName")),jt.synchronizeControlValue(this.initialsNode,this.getProperty("value.initials")),jt.synchronizeControlValue(this.middleNameNode,this.getProperty("value.middleName")),jt.synchronizeControlValue(this.lastNameNode,this.getProperty("value.lastName"))}},{key:"enumerateIndexes",value:function(){return[n.INDEX_MIDDLE_NAME,n.INDEX_FIRST_NAME,n.INDEX_INITIALS,n.INDEX_LAST_NAME,n.INDEX_TITLE]}},{key:"getMinInputRowWidth",value:function(){return 12}},{key:"getOptionalFields",value:function(){var e=[];return this.getProperty("configuration.fieldInitials")&&e.push(T.C.INITIALS),this.getProperty("configuration.fieldMiddleName")&&e.push(T.C.MIDDLE_NAME),this.getProperty("configuration.fieldTitle")&&e.push(T.C.TITLE),e}},{key:"setOptionalFields",value:function(e){for(var t=0,n=(e=e||[]).length;t<n;t++)e[t]=~~e[t];this.setProperty("configuration.fieldInitials",e.indexOf(T.C.INITIALS)>-1),this.setProperty("configuration.fieldMiddleName",e.indexOf(T.C.MIDDLE_NAME)>-1),this.setProperty("configuration.fieldTitle",e.indexOf(T.C.TITLE)>-1)}},{key:"updateDefaultName",value:function(){var e,t=this.getProperty("configuration.defaultValue"),n=!1;null!==t?(e=Ki.parseName(t.trim()),this.setProperty("configuration.defaultValue",t.trim())):e={initials:null,title:null,firstName:null,lastName:null,middleName:null,suffix:null},null!==e.firstName?(this.setProperty("value.firstName",e.firstName),n=!0):null!==this.getProperty("value.firstName")&&(this.setProperty("value.firstName",null),n=!0),null!==e.lastName?(this.setProperty("value.lastName",e.lastName),n=!0):null!==this.getProperty("value.lastName")&&(this.setProperty("value.lastName",null),n=!0),this.getProperty("configuration.fieldTitle")&&(null!==e.title?(this.setProperty("value.title",e.title.replace(/\.$/g,"")),n=!0):null!==this.getProperty("value.title")&&(this.setProperty("value.title",null),n=!0)),this.getProperty("configuration.fieldMiddleName")&&(null!==e.middleName?(this.setProperty("value.middleName",e.middleName),n=!0):null!==this.getProperty("value.middleName")&&(this.setProperty("value.middleName",null),n=!0)),this.getProperty("configuration.fieldInitials")&&(null!==e.initials?(this.setProperty("value.initials",e.initials),n=!0):null!==this.getProperty("value.initials")&&(this.setProperty("value.initials",null),n=!0)),n&&this.synchronizeValue()}},{key:"onReset",value:function(){this.setValue({title:null,firstName:null,initials:null,middleName:null,lastName:null}),this.updateDefaultName(),this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_name_name")),this.updateLabelText(),this}},{key:"setupI18n",value:function(){return this.titleNode.trigger("update"),p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";if(t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),this.getProperty("configuration.fieldTitle"))for(var i=this.getProperty("configuration.titleChoices")||[],r=0,a=i.length;r<a;r++)i[r].text&&e.push({key:"control_label_".concat(this.getId(),"_choice_").concat(r),sourceText:i[r].text});return e}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_NAME,name:"Name",isContainer:!1,category:"advanced",keywords:"name surname contact information",icon:"i123-editor_field_name",isVirtual:!1,i18nName:"edt_UI_control_type_name_name",i18nKeywords:"edt_UI_control_type_name_keywords",index:110,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE}}}]),n}(tn);function Xi(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(qi,"INDEX_FIRST_NAME",1),v()(qi,"INDEX_LAST_NAME",2),v()(qi,"INDEX_TITLE",3),v()(qi,"INDEX_INITIALS",4),v()(qi,"INDEX_MIDDLE_NAME",5),v()(qi,"attributes",{}),v()(qi,"runtime",null),v()(qi,"nodeName","name");var Qi=function(e){g()(n,e);var t=Xi(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"inputContainer",void 0),v()(c()(r),"prefixLabel",void 0),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","number-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","number-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","number-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","number"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("data-no-theme",""),r.input.setAttribute("step","any"),r.prefixLabel=document.createElement("span"),r.prefixLabel.setAttribute("data-role","prefix-label"),r.prefixLabel.setAttribute("id","price-".concat(a,"-prefix-acc")),r.inputContainer=document.createElement("div"),r.inputContainer.setAttribute("data-role","input-container"),r.inputContainer.setAttribute("data-ui-role","ui-element"),r.inputContainer.appendChild(r.prefixLabel),r.inputContainer.appendChild(r.input),r.input.setAttribute("aria-labelledby","number-".concat(a,"-acc ")+"number-".concat(a,"-error-acc ")+"number-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_NUMBER}},{key:"getElementName",value:function(){return"Number"}},{key:"updatePrefixLabel",value:function(){this.prefixLabel.textContent=this.getProperty("configuration.prefix")||"",this.adjustInputPadding()}},{key:"syncInputCompactField",value:function(){this.input.placeholder=this.inputContainer.hasAttribute("placeholder")?this.inputContainer.getAttribute("placeholder"):""}},{key:"adjustInputPadding",value:function(){var e=this;setTimeout((function(){var t=e.getForm().getEngine().getTheme().properties.input.padding.horizontal,n=e.getForm().getRootNode().getAttribute("data-text-direction"),i=e.prefixLabel.offsetWidth>parseInt(t,10)?"".concat(e.prefixLabel.offsetWidth+8,"px"):t;"ltr"===n?(e.input.style.paddingLeft=i,e.input.style.removeProperty("padding-right")):(e.input.style.paddingRight=i,e.input.style.removeProperty("padding-left"))}),1)}},{key:"adjustPrefixLabelOpacity",value:function(){this.input.value.length>0||null!==this.getErrors()?this.prefixLabel.style.removeProperty("opacity"):this.prefixLabel.style.opacity=".5"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.inputContainer,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.updateDefaultValue(),this.validateValue(),this.synchronizeValue(),this.updatePrefixLabel(),this.adjustPrefixLabelOpacity(),this.syncInputCompactField(),this.addEventListeners(),this.onReadonlyStateChanged(),setTimeout((function(){e.hidePrefixLabelIfNeeded()}),1e3)}},{key:"addEventListeners",value:function(){var e=this,t=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.UNDO_SERVICE),n=this.getForm().getEngine();t&&t.on("user-action",(function(t){"resize-end"===t&&e.hidePrefixLabelIfNeeded()})),window.addEventListener("resize",Object(ci.a)((function(){e.hidePrefixLabelIfNeeded()}),500)),this.input.addEventListener("focus",(function(){e.rootNode.querySelector('div[data-role="input-container"]').setAttribute("data-is-focused-child-element","1")})),this.input.addEventListener("blur",(function(){e.rootNode.querySelector('div[data-role="input-container"]').removeAttribute("data-is-focused-child-element")})),n.getDocument().on("update-text-direction",(function(){e.adjustInputPadding()})),n.getLoader().on("navigate-to-relative-page-number",(function(){e.hidePrefixLabelIfNeeded()}))}},{key:"hidePrefixLabelIfNeeded",value:function(){var e=this.getProperty("configuration.prefix")||"",t=parseInt(getComputedStyle(this.prefixLabel).paddingLeft,10),n=parseInt(getComputedStyle(this.input).paddingRight,10),i=ui.getDOMWidth(e);this.inputContainer.offsetWidth<i+t+n+30?this.prefixLabel.style.display="none":this.prefixLabel.style.removeProperty("display"),this.adjustInputPadding()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_NUMERIC),e.getValidatorById(Ee.VALIDATOR_TYPE_NUMERICPLUS)]}},{key:"onFocusEnter",value:function(){var e=this,t=setInterval((function(){e.getPrefixInspectorInput()&&(e.updateInspectorPrefix(),clearInterval(t))}),500)}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:parseFloat(e)),this.validateValue(),this.adjustPrefixLabelOpacity(),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateDefaultValue",value:function(){var e=this.getProperty("configuration.defaultValue");this.setProperty("value.value",0===e?0:e),this.synchronizeValue()}},{key:"validateValue",value:function(){var e=this.getProperty("value.value"),t=this.input.validity;if(0===e||e||(e=null),t&&t.valid)null!==e?this.checkValidNumericInput():this.clearAllValidationErrors();else if(t&&!t.valid){var n=this.getForm().getEngine().getI18n();this.addError(Dt.ERR_INVALID_NUMBER,"".concat(n.translateText("textdef_5"),":").concat(n.translateText("textdef_47"))||"Expected input: numeric (only numbers)")}}},{key:"clearAllValidationErrors",value:function(){this.removeError(Dt.ERR_NUMBER_TOO_BIG),this.removeError(Dt.ERR_NUMBER_TOO_LONG),this.removeError(Dt.ERR_NUMBER_TOO_SHORT),this.removeError(Dt.ERR_NUMBER_TOO_SMALL),this.removeError(Dt.ERR_NOT_NUMERIC),this.removeError(Dt.ERR_INVALID_NUMBER)}},{key:"checkValidNumericInput",value:function(){var e=this.getProperty("configuration.minLength"),t=this.getProperty("configuration.maxLength"),n=this.getProperty("configuration.minValue"),i=this.getProperty("configuration.maxValue"),r=this.getProperty("value.value"),a=this.getProperty("validation.type"),o=this.getForm().getEngine().getI18n();""==_e.meetsRequirements("* * * msie *")&&(isNaN(Number(this.input.value))||this.input.value.indexOf("x")>=0)?this.addError(Dt.ERR_INVALID_NUMBER,"".concat(o.translateText("textdef_5"),":").concat(o.translateText("textdef_47"))||"Expected input: numeric (only numbers)"):this.removeError(Dt.ERR_INVALID_NUMBER),a===Ee.VALIDATOR_TYPE_NUMERIC&&(r<0||Math.floor(r)!==r?this.addError(Dt.ERR_NOT_NUMERIC,"".concat(o.translateText("textdef_5"),":").concat(o.translateText("textdef_47"))||"Expected input: numeric (only numbers)"):this.removeError(Dt.ERR_NOT_NUMERIC)),null!=t&&t>0&&(String(r).length>t?this.addError(Dt.ERR_NUMBER_TOO_LONG,this.getForm().getEngine().getI18n().translateText("textdef_71",String(t))||"The number is too long"):this.removeError(Dt.ERR_NUMBER_TOO_LONG)),null!=e&&e>0&&(String(r).length<e?this.addError(Dt.ERR_NUMBER_TOO_SHORT,this.getForm().getEngine().getI18n().translateText("textdef_70",String(e))||"The number is too short"):this.removeError(Dt.ERR_NUMBER_TOO_SHORT)),null!=i&&(r>i?this.addError(Dt.ERR_NUMBER_TOO_BIG,this.getForm().getEngine().getI18n().translateText("textdef_73",String(i))||"The value you have provided is too big"):this.removeError(Dt.ERR_NUMBER_TOO_BIG)),null!=n&&(r<n?this.addError(Dt.ERR_NUMBER_TOO_SMALL,this.getForm().getEngine().getI18n().translateText("textdef_72",String(n))||"The value you have provided is too small"):this.removeError(Dt.ERR_NUMBER_TOO_SMALL))}},{key:"getPrefixVisibility",value:function(){return(this.getProperty("configuration.prefix")||"").length>0}},{key:"setPrefixVisibility",value:function(e){var t=this.getProperty("configuration.prefix")||"USD";e?this.setProperty("configuration.prefix",this.getProperty("configuration.prefix")||"USD"):this.setProperty("configuration.prefix",null),this.getPrefixInspectorInput().value=t}},{key:"updateInspectorPrefix",value:function(){var e=this.getPrefixInspectorInput();e.addEventListener("keypress",(function(t){if(!jt.isInputTextSelected(e)){var n=0;n+=e.value.replace(/[^a-z0-9]/gi,"").length;for(var i=0;i<e.value.length;i++)e.value.charCodeAt(i)>127&&n++;n>=4&&(t.key.match(/[a-z0-9]/gi)||t.key.charCodeAt(0)>127)&&t.preventDefault()}}))}},{key:"getPrefixInspectorInput",value:function(){return document.querySelector('#item [data-property-name="configuration-prefix"] input')}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value")),this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.removeAllBackendErrors()}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"number",optional:!0};default:return null}}},{key:"onReset",value:function(){this.updateDefaultValue(),this.synchronizeValue(),this.validateValue()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_number_name")),this.updateLabelText(),this}},{key:"updateInstructionsText",value:function(){if(void 0!==this.instructionsDOMNode){var e=this.getProperty("instructions.text"),t=this.hasProperty("configuration.limitSubmissionsTotal")&&this.getProperty("configuration.limitSubmissionsTotal")||null,n=this.hasProperty("configuration.currentSubmissionsValue")?this.getProperty("configuration.currentSubmissionsValue"):null,i=null!==t?Math.max(0,t-n):null,r="".concat(this.getForm().getEngine().getI18n().translateText("textdef_41")," ").concat(i),a=this.hasProperty("configuration.isLimitSubmissionsEnabled")?this.getProperty("configuration.isLimitSubmissionsEnabled"):null;null!==i&&a?(this.instructionsDOMNode.removeAttribute("data-is-empty"),e?(this.instructionsDOMNode.textContent=e,this.instructionsDOMNode.appendChild(document.createElement("br"))):this.instructionsDOMNode.textContent="",this.instructionsDOMNode.appendChild(document.createTextNode(r))):null===e||""===e?(this.instructionsDOMNode.setAttribute("data-is-empty","1"),this.instructionsDOMNode.textContent=""):(this.instructionsDOMNode.removeAttribute("data-is-empty"),this.instructionsDOMNode.textContent=R.parse(e))}}},{key:"onBlur",value:function(){this.checkIfElementValueIsSynchronized(),this.checkIfLimitSubmissionsTotalValueIsExceeded()}},{key:"checkIfLimitSubmissionsTotalValueIsExceeded",value:function(){if(this.hasProperty("configuration.isLimitSubmissionsEnabled")&&this.getProperty("configuration.isLimitSubmissionsEnabled")){var e=this.hasProperty("configuration.limitSubmissionsTotal")&&this.getProperty("configuration.limitSubmissionsTotal")||null,t=this.hasProperty("configuration.currentSubmissionsValue")&&this.getProperty("configuration.currentSubmissionsValue")||null,n=null!==e?Math.max(0,e-t):null;(n||0===n)&&(~~this.input.value>n?this.addError(Dt.ERR_MAX_ACCEPTED_VALUE_EXCEEDED,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_41"),": ").concat(n)||"The maximum accepted value is ".concat(n)):this.removeError(Dt.ERR_MAX_ACCEPTED_VALUE_EXCEEDED))}}},{key:"onDuplicate",value:function(){p()(E()(n.prototype),"onDuplicate",this).call(this),this.hasProperty("configuration.isLimitSubmissionsEnabled")&&(this.hasProperty("configuration.currentSubmissionsValue")&&this.setProperty("configuration.currentSubmissionsValue",null),this.updateInstructionsText())}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"setupI18n",value:function(){var e=this;if(this.hasProperty("configuration.isLimitSubmissionsEnabled")&&this.getProperty("configuration.isLimitSubmissionsEnabled")){var t=this.hasProperty("configuration.limitSubmissionsTotal")&&this.getProperty("configuration.limitSubmissionsTotal")||null,i=this.hasProperty("configuration.currentSubmissionsValue")&&this.getProperty("configuration.currentSubmissionsValue")||null,r=null!==t?Math.max(0,t-i):null;setTimeout((function(){var t="".concat(e.getForm().getEngine().getI18n().translateText("textdef_41")," ").concat(r);e.instructionsDOMNode.textContent=t}),100)}return p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.setReadonly(e)}},{key:"isReadonly",value:function(){return this.input.readOnly}},{key:"setReadonly",value:function(e){return this.input.readOnly=e,this}},{key:"setVisible",value:function(e){p()(E()(n.prototype),"setVisible",this).call(this,e),this.hidePrefixLabelIfNeeded()}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_NUMBER,name:"Number",isContainer:!1,category:"advanced",keywords:"number quantity",icon:"i123-editor_field_number",isVirtual:!1,i18nName:"edt_UI_control_type_number_name",i18nKeywords:"edt_UI_control_type_number_keywords",index:90,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function $i(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Qi,"attributes",{}),v()(Qi,"runtime",null),v()(Qi,"nodeName","number");var ji=function(e){g()(n,e);var t=$i(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getElementName",value:function(){return"Page break"}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_PAGE_BREAK}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"isSelectable",value:function(){return!1}},{key:"onReset",value:function(){}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_PAGE_BREAK,name:"Page Break",isContainer:!1,category:"other",keywords:"page break",icon:"i123-editor_field_pagebreak",isVirtual:!1,i18nName:"edt_UI_control_type_page_break_name",i18nKeywords:"edt_UI_control_type_page_break_keywords",index:220,accessibilityFields:T.r.NONE}}},{key:"getDropDestinationCSSSelector",value:function(){return"#form > div[data-role=page] > div[data-role=page-body] > div[data-role=container][data-type=virtual-form-table-row]"}},{key:"getDropSupportedEdges",value:function(){return[T.l.TOP,T.l.BOTTOM]}}]),n}(tn);function Ji(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(ji,"attributes",{}),v()(ji,"runtime",null),v()(ji,"nodeName","page-break");var Zi=function(e){g()(n,e);var t=Ji(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","password-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","password-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","password-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","password"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","password-".concat(a,"-acc ")+"password-".concat(a,"-error-acc ")+"password-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_PASSWORD}},{key:"getElementName",value:function(){return"Password"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateHiddenAttribute(),this.updateShowInstructionsOnClick(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY_INCLUDING_BLANK_PASSWORDS),e.getValidatorById(Ee.VALIDATOR_TYPE_PASSWORD_ANY_COMPLEXITY),e.getValidatorById(Ee.VALIDATOR_TYPE_PASSWORD_MIN_COMPLEXITY),e.getValidatorById(Ee.VALIDATOR_TYPE_PASSWORD_MED_COMPLEXITY),e.getValidatorById(Ee.VALIDATOR_TYPE_PASSWORD_CORPORATE_COMPLEXITY)]}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.validateValue(),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"validateValue",value:function(){var e=this.getProperty("configuration.minLength"),t=this.getProperty("configuration.maxLength"),n=this.getProperty("value.value")||"";n?(null!=t&&t>0&&(n.length>t?this.addError(Dt.ERR_TOO_MANY_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_71",String(t))||"You have more characters than allowed."):this.removeError(Dt.ERR_TOO_MANY_CHARACTERS)),null!=e&&e>0&&(n.length<e?this.addError(Dt.ERR_TOO_FEW_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_70",String(e))||"You have fewer characters than allowed."):this.removeError(Dt.ERR_TOO_FEW_CHARACTERS))):(this.removeError(Dt.ERR_TOO_MANY_CHARACTERS),this.removeError(Dt.ERR_TOO_FEW_CHARACTERS))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.setValue({value:null}),this.input.value=null}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_password_name")),this.updateLabelText(),this}},{key:"onBlur",value:function(){this.checkIfElementValueIsSynchronized()}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){this.input.readOnly=!!this.getProperty("options.readOnly")}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_PASSWORD,name:"Password",isContainer:!1,category:"advanced",keywords:"password",icon:"i123-editor_field_password",isVirtual:!1,i18nName:"edt_UI_control_type_password_name",i18nKeywords:"edt_UI_control_type_password_keywords",index:180,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function er(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Zi,"attributes",{}),v()(Zi,"runtime",null),v()(Zi,"nodeName","password");var tr=function(e){g()(n,e);var t=er(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","phone-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","phone-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","phone-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","text"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","phone-".concat(a,"-acc ")+"phone-".concat(a,"-format-acc ")+"phone-".concat(a,"-error-acc ")+"phone-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_PHONE}},{key:"getElementName",value:function(){return"Phone"}},{key:"onBlur",value:function(){this.validateInput()}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.onValidationChanged(),this.clearValue(),this.synchronizeValue(),this.updateHiddenAttribute(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_2_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_3_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_3_8),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_4_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_5_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_3),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_7),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_4_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_6),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_7),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_5_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_6),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_7),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_2_8),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_4_6),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_3_3),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_4_4),e.getValidatorById(Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_6)]}},{key:"getDigitGroups",value:function(e){switch(e){case Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_2_4:return[2,2,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_3_4:return[2,3,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_3_8:return[2,3,8];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_4_4:return[2,4,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_2_5_4:return[2,5,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_4:return[3,3,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_3:return[3,3,3];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_3_7:return[3,3,7];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_4_4:return[3,4,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_4:return[3,2,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_6:return[3,2,6];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_2_7:return[3,2,7];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_3_5_4:return[3,5,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3:return[4,3,3];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_4:return[4,3,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_6:return[4,3,6];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_7:return[4,3,7];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_2_8:return[4,2,8];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_4_6:return[4,4,6];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_3_3:return[5,3,3];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_4_4:return[5,4,4];case Ee.VALIDATOR_TYPE_PHONE_FORMAT_5_6:return[5,6];default:return null}}},{key:"onValidationChanged",value:function(){for(var e="",t=this.getDigitGroups(this.getProperty("validation.type")||Ee.VALIDATOR_TYPE_PHONE_FORMAT_4_3_3)||n.DEFAULT_MASK_FORMAT,i=0,r=t.length;i<r;i++)e+="".concat(this.strRepeat("#",t[i])," ");this.input.placeholder=e,this.updatePhoneFormatAccessibility(t)}},{key:"strRepeat",value:function(e,t){var n="";e=String(e||"");for(var i=0;i<t;i++)n+=e;return n}},{key:"getFormattedPhoneNumberAccordingToValidationType",value:function(e){var t=String(e||"").replace(/[^\d\+]+/g,""),n=this.getProperty("validation.type");if(!/^(\+)?([\d]+)/.test(t))return e;var i=this.getForm().getEngine().getPhoneUtils().parsePhoneNumber(t);if(null===i)return e;var r,a=this.getDigitGroups(n),o=0,s="";r=i.areaCode?"".concat(i.areaCode," "):"",i.localPhoneNumber=i.localPhoneNumber||"";for(var l=0,u=a.length;l<u;l++){for(var c=0;c<a[l]&&""!==(s=i.localPhoneNumber.charAt(o)||"");c++)o++,r+=s;if(""===s)break;r="".concat(r," ")}return r.replace(/(^[\s]+|[\s]+$)/g,"")}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{width:T.y.FULL,input:this.input}]}]}},{key:"onValueChanged",value:function(){var e=this.getFormattedPhoneNumberAccordingToValidationType(this.input.value);if(e!==this.input.value){this.input.value=e;var t=this.input;O.a.create((function(){t.focus(),t.setSelectionRange(t.value.length,t.value.length)}),0)()}e=e.replace(/ /g,"-"),this.setProperty("value.value",""===e?null:e),this.removeError(Dt.ERR_INVALID_PHONE_FORMAT),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"validateInput",value:function(){var e=this.getForm().getEngine().getValidator(),t=this.getProperty("value.value")||"",n=this.hasProperty("validation.type")?this.getProperty("validation.type"):null;this.hasError(Dt.ERR_INVALID_PHONE_FORMAT)&&this.removeError(Dt.ERR_INVALID_PHONE_FORMAT),t&&n&&!e.validate(t,this.getProperty("validation.type"))&&this.addError(Dt.ERR_INVALID_PHONE_FORMAT,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_5"),": ").concat(this.getDigitGroups(n).join(" "))||"The phone format must be ".concat(this.getDigitGroups(n).join(" ")))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.setValue({value:null})}},{key:"setupDefaults",value:function(){this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_phone_name"));var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DEFAULT_USER_PREFERENCES);return e&&(this.setProperty("validation.type",e.phoneFormat),this.onValidationChanged()),this.updateLabelText(),this}},{key:"isCompactFieldPlaceholderSupported",value:function(){return!1}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getFormattedPhoneNumberAccordingToValidationType(this.getProperty("value.value")))}},{key:"setValue",value:function(e){p()(E()(n.prototype),"setValue",this).call(this,e),this.validateInput()}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"updatePhoneFormatAccessibility",value:function(e){var t=document.createElement("span");t.setAttribute("id","phone-".concat(this.getHash(),"-format-acc")),t.textContent="Format ".concat(e[0]," ").concat(e[1]," ").concat(e[2]),t.style.display="none",this.input.appendChild(t)}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){this.input.readOnly=!!this.getProperty("options.readOnly")}},{key:"clearValue",value:function(){this.setProperty("value.value",null)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_PHONE,name:"Phone",isContainer:!1,category:"advanced",keywords:"phone number",icon:"i123-phone",isVirtual:!1,i18nName:"edt_UI_control_type_phone_name",i18nKeywords:"edt_UI_control_type_phone_keywords",index:130,accessibilityFields:T.r.ERROR_NODE}}}]),n}(tn);v()(tr,"DEFAULT_MASK_FORMAT",[4,3,3]),v()(tr,"attributes",{}),v()(tr,"runtime",null),v()(tr,"nodeName","phone");var nr=function(){function e(t){o()(this,e),v()(this,"i18n",void 0),v()(this,"cache",void 0),this.i18n=t}return l()(e,[{key:"getCurrencyById",value:function(t){return e.$ID_TO_ISO_CODE[t]?-1===e.$SUPPORTED_CURRENCIES.indexOf(e.$ID_TO_ISO_CODE[t])?null:{id:t,isoCode:e.$ID_TO_ISO_CODE[t],name:e.$ISO_CODE_TO_FULL_NAME[e.$ID_TO_ISO_CODE[t]],isOther:!1,i18n:e.$ISO_CODE_TO_NAME_I18N[e.$ID_TO_ISO_CODE[t]],symbol:e.$ID_TO_SYMBOL[t]}:null}},{key:"getCurrencyByCode",value:function(t){var n=String(t||"").toUpperCase();if(e.$SUPPORTED_CURRENCIES.indexOf(n)>-1){var i=null;for(var r in e.$ID_TO_ISO_CODE)if(e.$ID_TO_ISO_CODE.hasOwnProperty(r)&&e.$ID_TO_ISO_CODE[r]===n){i=parseInt(r);break}return null===i?null:{id:i,isoCode:n,name:e.$ISO_CODE_TO_FULL_NAME[n],isOther:!1,i18n:e.$ISO_CODE_TO_NAME_I18N[n],symbol:e.$ID_TO_SYMBOL[i]}}return null}},{key:"enumerateCurrencies",value:function(){if(void 0!==this.cache)return JSON.parse(JSON.stringify(this.cache));this.cache=[];for(var t=0,n=e.$SUPPORTED_CURRENCIES.length;t<n;t++)this.cache.push(this.getCurrencyByCode(e.$SUPPORTED_CURRENCIES[t]));return JSON.parse(JSON.stringify(this.cache))}},{key:"getCurrencySymbolById",value:function(e){var t=this.getCurrencyById(e);return t?t.symbol:""}}],[{key:"share",value:function(t){return void 0!==e.instance||(e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_USD]=e.CURRENCY_USD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_EUR]=e.CURRENCY_EUR,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_GBP]=e.CURRENCY_GBP,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_AUD]=e.CURRENCY_AUD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_JPY]=e.CURRENCY_JPY,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_CAD]=e.CURRENCY_CAD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_NZD]=e.CURRENCY_NZD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_HKD]=e.CURRENCY_HKD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_SGD]=e.CURRENCY_SGD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_MXN]=e.CURRENCY_MXN,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_DKK]=e.CURRENCY_DKK,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_NOK]=e.CURRENCY_NOK,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_MYR]=e.CURRENCY_MYR,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_TWD]=e.CURRENCY_TWD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_THB]=e.CURRENCY_THB,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_ILS]=e.CURRENCY_ILS,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_CHF]=e.CURRENCY_CHF,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_BRL]=e.CURRENCY_BRL,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_RON]=e.CURRENCY_RON,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_PGK]=e.CURRENCY_PGK,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_INR]=e.CURRENCY_INR,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_MUR]=e.CURRENCY_MUR,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_CZK]=e.CURRENCY_CZK,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_DOP]=e.CURRENCY_DOP,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_ZAR]=e.CURRENCY_ZAR,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_TRY]=e.CURRENCY_TRY,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_SEK]=e.CURRENCY_SEK,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_PLN]=e.CURRENCY_PLN,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_PHP]=e.CURRENCY_PHP,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_AED]=e.CURRENCY_AED,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_ARS]=e.CURRENCY_ARS,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_RUB]=e.CURRENCY_RUB,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_XCD]=e.CURRENCY_XCD,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_BGN]=e.CURRENCY_BGN,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_HUF]=e.CURRENCY_HUF,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_COP]=e.CURRENCY_COP,e.$ISO_CODE_TO_ID[e.CURRENCY_CODE_CNY]=e.CURRENCY_CNY,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_USD]=e.CURRENCY_FULL_NAME_USD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_EUR]=e.CURRENCY_FULL_NAME_EUR,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_GBP]=e.CURRENCY_FULL_NAME_GBP,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_AUD]=e.CURRENCY_FULL_NAME_AUD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_JPY]=e.CURRENCY_FULL_NAME_JPY,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_CAD]=e.CURRENCY_FULL_NAME_CAD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_NZD]=e.CURRENCY_FULL_NAME_NZD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_HKD]=e.CURRENCY_FULL_NAME_HKD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_SGD]=e.CURRENCY_FULL_NAME_SGD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_MXN]=e.CURRENCY_FULL_NAME_MXN,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_DKK]=e.CURRENCY_FULL_NAME_DKK,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_NOK]=e.CURRENCY_FULL_NAME_NOK,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_MYR]=e.CURRENCY_FULL_NAME_MYR,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_TWD]=e.CURRENCY_FULL_NAME_TWD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_THB]=e.CURRENCY_FULL_NAME_THB,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_ILS]=e.CURRENCY_FULL_NAME_ILS,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_CHF]=e.CURRENCY_FULL_NAME_CHF,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_BRL]=e.CURRENCY_FULL_NAME_BRL,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_RON]=e.CURRENCY_FULL_NAME_RON,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_PGK]=e.CURRENCY_FULL_NAME_PGK,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_INR]=e.CURRENCY_FULL_NAME_INR,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_MUR]=e.CURRENCY_FULL_NAME_MUR,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_CZK]=e.CURRENCY_FULL_NAME_CZK,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_DOP]=e.CURRENCY_FULL_NAME_DOP,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_ZAR]=e.CURRENCY_FULL_NAME_ZAR,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_TRY]=e.CURRENCY_FULL_NAME_TRY,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_SEK]=e.CURRENCY_FULL_NAME_SEK,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_PLN]=e.CURRENCY_FULL_NAME_PLN,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_PHP]=e.CURRENCY_FULL_NAME_PHP,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_AED]=e.CURRENCY_FULL_NAME_AED,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_ARS]=e.CURRENCY_FULL_NAME_ARS,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_RUB]=e.CURRENCY_FULL_NAME_RUB,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_XCD]=e.CURRENCY_FULL_NAME_XCD,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_BGN]=e.CURRENCY_FULL_NAME_BGN,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_HUF]=e.CURRENCY_FULL_NAME_HUF,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_COP]=e.CURRENCY_FULL_NAME_COP,e.$ISO_CODE_TO_FULL_NAME[e.CURRENCY_CODE_CNY]=e.CURRENCY_FULL_NAME_CNY,e.$ID_TO_ISO_CODE[e.CURRENCY_USD]=e.CURRENCY_CODE_USD,e.$ID_TO_ISO_CODE[e.CURRENCY_EUR]=e.CURRENCY_CODE_EUR,e.$ID_TO_ISO_CODE[e.CURRENCY_GBP]=e.CURRENCY_CODE_GBP,e.$ID_TO_ISO_CODE[e.CURRENCY_AUD]=e.CURRENCY_CODE_AUD,e.$ID_TO_ISO_CODE[e.CURRENCY_JPY]=e.CURRENCY_CODE_JPY,e.$ID_TO_ISO_CODE[e.CURRENCY_CAD]=e.CURRENCY_CODE_CAD,e.$ID_TO_ISO_CODE[e.CURRENCY_NZD]=e.CURRENCY_CODE_NZD,e.$ID_TO_ISO_CODE[e.CURRENCY_HKD]=e.CURRENCY_CODE_HKD,e.$ID_TO_ISO_CODE[e.CURRENCY_SGD]=e.CURRENCY_CODE_SGD,e.$ID_TO_ISO_CODE[e.CURRENCY_MXN]=e.CURRENCY_CODE_MXN,e.$ID_TO_ISO_CODE[e.CURRENCY_DKK]=e.CURRENCY_CODE_DKK,e.$ID_TO_ISO_CODE[e.CURRENCY_NOK]=e.CURRENCY_CODE_NOK,e.$ID_TO_ISO_CODE[e.CURRENCY_MYR]=e.CURRENCY_CODE_MYR,e.$ID_TO_ISO_CODE[e.CURRENCY_TWD]=e.CURRENCY_CODE_TWD,e.$ID_TO_ISO_CODE[e.CURRENCY_THB]=e.CURRENCY_CODE_THB,e.$ID_TO_ISO_CODE[e.CURRENCY_ILS]=e.CURRENCY_CODE_ILS,e.$ID_TO_ISO_CODE[e.CURRENCY_CHF]=e.CURRENCY_CODE_CHF,e.$ID_TO_ISO_CODE[e.CURRENCY_BRL]=e.CURRENCY_CODE_BRL,e.$ID_TO_ISO_CODE[e.CURRENCY_RON]=e.CURRENCY_CODE_RON,e.$ID_TO_ISO_CODE[e.CURRENCY_PGK]=e.CURRENCY_CODE_PGK,e.$ID_TO_ISO_CODE[e.CURRENCY_INR]=e.CURRENCY_CODE_INR,e.$ID_TO_ISO_CODE[e.CURRENCY_MUR]=e.CURRENCY_CODE_MUR,e.$ID_TO_ISO_CODE[e.CURRENCY_CZK]=e.CURRENCY_CODE_CZK,e.$ID_TO_ISO_CODE[e.CURRENCY_DOP]=e.CURRENCY_CODE_DOP,e.$ID_TO_ISO_CODE[e.CURRENCY_ZAR]=e.CURRENCY_CODE_ZAR,e.$ID_TO_ISO_CODE[e.CURRENCY_TRY]=e.CURRENCY_CODE_TRY,e.$ID_TO_ISO_CODE[e.CURRENCY_SEK]=e.CURRENCY_CODE_SEK,e.$ID_TO_ISO_CODE[e.CURRENCY_PLN]=e.CURRENCY_CODE_PLN,e.$ID_TO_ISO_CODE[e.CURRENCY_PHP]=e.CURRENCY_CODE_PHP,e.$ID_TO_ISO_CODE[e.CURRENCY_AED]=e.CURRENCY_CODE_AED,e.$ID_TO_ISO_CODE[e.CURRENCY_ARS]=e.CURRENCY_CODE_ARS,e.$ID_TO_ISO_CODE[e.CURRENCY_RUB]=e.CURRENCY_CODE_RUB,e.$ID_TO_ISO_CODE[e.CURRENCY_XCD]=e.CURRENCY_CODE_XCD,e.$ID_TO_ISO_CODE[e.CURRENCY_BGN]=e.CURRENCY_CODE_BGN,e.$ID_TO_ISO_CODE[e.CURRENCY_HUF]=e.CURRENCY_CODE_HUF,e.$ID_TO_ISO_CODE[e.CURRENCY_COP]=e.CURRENCY_CODE_COP,e.$ID_TO_ISO_CODE[e.CURRENCY_CNY]=e.CURRENCY_CODE_CNY,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_USD]=e.CURRENCY_NAME_I18N_USD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_EUR]=e.CURRENCY_NAME_I18N_EUR,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_GBP]=e.CURRENCY_NAME_I18N_GBP,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_AUD]=e.CURRENCY_NAME_I18N_AUD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_JPY]=e.CURRENCY_NAME_I18N_JPY,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_CAD]=e.CURRENCY_NAME_I18N_CAD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_NZD]=e.CURRENCY_NAME_I18N_NZD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_HKD]=e.CURRENCY_NAME_I18N_HKD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_SGD]=e.CURRENCY_NAME_I18N_SGD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_MXN]=e.CURRENCY_NAME_I18N_MXN,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_DKK]=e.CURRENCY_NAME_I18N_DKK,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_NOK]=e.CURRENCY_NAME_I18N_NOK,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_MYR]=e.CURRENCY_NAME_I18N_MYR,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_TWD]=e.CURRENCY_NAME_I18N_TWD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_THB]=e.CURRENCY_NAME_I18N_THB,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_ILS]=e.CURRENCY_NAME_I18N_ILS,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_CHF]=e.CURRENCY_NAME_I18N_CHF,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_BRL]=e.CURRENCY_NAME_I18N_BRL,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_RON]=e.CURRENCY_NAME_I18N_RON,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_PGK]=e.CURRENCY_NAME_I18N_PGK,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_INR]=e.CURRENCY_NAME_I18N_INR,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_MUR]=e.CURRENCY_NAME_I18N_MUR,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_CZK]=e.CURRENCY_NAME_I18N_CZK,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_DOP]=e.CURRENCY_NAME_I18N_DOP,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_ZAR]=e.CURRENCY_NAME_I18N_ZAR,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_TRY]=e.CURRENCY_NAME_I18N_TRY,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_SEK]=e.CURRENCY_NAME_I18N_SEK,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_PLN]=e.CURRENCY_NAME_I18N_PLN,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_PHP]=e.CURRENCY_NAME_I18N_PHP,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_AED]=e.CURRENCY_NAME_I18N_AED,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_ARS]=e.CURRENCY_NAME_I18N_ARS,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_RUB]=e.CURRENCY_NAME_I18N_RUB,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_XCD]=e.CURRENCY_NAME_I18N_XCD,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_BGN]=e.CURRENCY_NAME_I18N_BGN,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_HUF]=e.CURRENCY_NAME_I18N_HUF,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_COP]=e.CURRENCY_NAME_I18N_COP,e.$ISO_CODE_TO_NAME_I18N[e.CURRENCY_CODE_CNY]=e.CURRENCY_NAME_I18N_CNY,e.$ID_TO_SYMBOL[e.CURRENCY_USD]=e.CURRENCY_SYMBOL_USD,e.$ID_TO_SYMBOL[e.CURRENCY_EUR]=e.CURRENCY_SYMBOL_EUR,e.$ID_TO_SYMBOL[e.CURRENCY_GBP]=e.CURRENCY_SYMBOL_GBP,e.$ID_TO_SYMBOL[e.CURRENCY_AUD]=e.CURRENCY_SYMBOL_AUD,e.$ID_TO_SYMBOL[e.CURRENCY_JPY]=e.CURRENCY_SYMBOL_JPY,e.$ID_TO_SYMBOL[e.CURRENCY_CAD]=e.CURRENCY_SYMBOL_CAD,e.$ID_TO_SYMBOL[e.CURRENCY_NZD]=e.CURRENCY_SYMBOL_NZD,e.$ID_TO_SYMBOL[e.CURRENCY_HKD]=e.CURRENCY_SYMBOL_HKD,e.$ID_TO_SYMBOL[e.CURRENCY_SGD]=e.CURRENCY_SYMBOL_SGD,e.$ID_TO_SYMBOL[e.CURRENCY_MXN]=e.CURRENCY_SYMBOL_MXN,e.$ID_TO_SYMBOL[e.CURRENCY_DKK]=e.CURRENCY_SYMBOL_DKK,e.$ID_TO_SYMBOL[e.CURRENCY_NOK]=e.CURRENCY_SYMBOL_NOK,e.$ID_TO_SYMBOL[e.CURRENCY_MYR]=e.CURRENCY_SYMBOL_MYR,e.$ID_TO_SYMBOL[e.CURRENCY_TWD]=e.CURRENCY_SYMBOL_TWD,e.$ID_TO_SYMBOL[e.CURRENCY_THB]=e.CURRENCY_SYMBOL_THB,e.$ID_TO_SYMBOL[e.CURRENCY_ILS]=e.CURRENCY_SYMBOL_ILS,e.$ID_TO_SYMBOL[e.CURRENCY_CHF]=e.CURRENCY_SYMBOL_CHF,e.$ID_TO_SYMBOL[e.CURRENCY_BRL]=e.CURRENCY_SYMBOL_BRL,e.$ID_TO_SYMBOL[e.CURRENCY_RON]=e.CURRENCY_SYMBOL_RON,e.$ID_TO_SYMBOL[e.CURRENCY_PGK]=e.CURRENCY_SYMBOL_PGK,e.$ID_TO_SYMBOL[e.CURRENCY_INR]=e.CURRENCY_SYMBOL_INR,e.$ID_TO_SYMBOL[e.CURRENCY_MUR]=e.CURRENCY_SYMBOL_MUR,e.$ID_TO_SYMBOL[e.CURRENCY_CZK]=e.CURRENCY_SYMBOL_CZK,e.$ID_TO_SYMBOL[e.CURRENCY_DOP]=e.CURRENCY_SYMBOL_DOP,e.$ID_TO_SYMBOL[e.CURRENCY_ZAR]=e.CURRENCY_SYMBOL_ZAR,e.$ID_TO_SYMBOL[e.CURRENCY_TRY]=e.CURRENCY_SYMBOL_TRY,e.$ID_TO_SYMBOL[e.CURRENCY_SEK]=e.CURRENCY_SYMBOL_SEK,e.$ID_TO_SYMBOL[e.CURRENCY_PLN]=e.CURRENCY_SYMBOL_PLN,e.$ID_TO_SYMBOL[e.CURRENCY_PHP]=e.CURRENCY_SYMBOL_PHP,e.$ID_TO_SYMBOL[e.CURRENCY_AED]=e.CURRENCY_SYMBOL_AED,e.$ID_TO_SYMBOL[e.CURRENCY_ARS]=e.CURRENCY_SYMBOL_ARS,e.$ID_TO_SYMBOL[e.CURRENCY_RUB]=e.CURRENCY_SYMBOL_RUB,e.$ID_TO_SYMBOL[e.CURRENCY_XCD]=e.CURRENCY_SYMBOL_XCD,e.$ID_TO_SYMBOL[e.CURRENCY_BGN]=e.CURRENCY_SYMBOL_BGN,e.$ID_TO_SYMBOL[e.CURRENCY_HUF]=e.CURRENCY_SYMBOL_HUF,e.$ID_TO_SYMBOL[e.CURRENCY_COP]=e.CURRENCY_SYMBOL_COP,e.$ID_TO_SYMBOL[e.CURRENCY_CNY]=e.CURRENCY_SYMBOL_CNY,e.instance=new e(t)),e.instance}}]),e}();function ir(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(nr,"instance",void 0),v()(nr,"CURRENCY_CODE_USD","USD"),v()(nr,"CURRENCY_CODE_EUR","EUR"),v()(nr,"CURRENCY_CODE_GBP","GBP"),v()(nr,"CURRENCY_CODE_AUD","AUD"),v()(nr,"CURRENCY_CODE_JPY","JPY"),v()(nr,"CURRENCY_CODE_CAD","CAD"),v()(nr,"CURRENCY_CODE_NZD","NZD"),v()(nr,"CURRENCY_CODE_HKD","HKD"),v()(nr,"CURRENCY_CODE_SGD","SGD"),v()(nr,"CURRENCY_CODE_MXN","MXN"),v()(nr,"CURRENCY_CODE_DKK","DKK"),v()(nr,"CURRENCY_CODE_NOK","NOK"),v()(nr,"CURRENCY_CODE_MYR","MYR"),v()(nr,"CURRENCY_CODE_TWD","TWD"),v()(nr,"CURRENCY_CODE_THB","THB"),v()(nr,"CURRENCY_CODE_ILS","ILS"),v()(nr,"CURRENCY_CODE_CHF","CHF"),v()(nr,"CURRENCY_CODE_BRL","BRL"),v()(nr,"CURRENCY_CODE_RON","RON"),v()(nr,"CURRENCY_CODE_PGK","PGK"),v()(nr,"CURRENCY_CODE_INR","INR"),v()(nr,"CURRENCY_CODE_MUR","MUR"),v()(nr,"CURRENCY_CODE_CZK","CZK"),v()(nr,"CURRENCY_CODE_DOP","DOP"),v()(nr,"CURRENCY_CODE_ZAR","ZAR"),v()(nr,"CURRENCY_CODE_SEK","SEK"),v()(nr,"CURRENCY_CODE_PLN","PLN"),v()(nr,"CURRENCY_CODE_PHP","PHP"),v()(nr,"CURRENCY_CODE_TRY","TRY"),v()(nr,"CURRENCY_CODE_AED","AED"),v()(nr,"CURRENCY_CODE_ARS","ARS"),v()(nr,"CURRENCY_CODE_RUB","RUB"),v()(nr,"CURRENCY_CODE_XCD","XCD"),v()(nr,"CURRENCY_CODE_BGN","BGN"),v()(nr,"CURRENCY_CODE_HUF","HUF"),v()(nr,"CURRENCY_CODE_CNY","CNY"),v()(nr,"CURRENCY_CODE_COP","COP"),v()(nr,"CURRENCY_FULL_NAME_USD","United States Dollar"),v()(nr,"CURRENCY_FULL_NAME_EUR","Euro"),v()(nr,"CURRENCY_FULL_NAME_GBP","United Kingdom Pound"),v()(nr,"CURRENCY_FULL_NAME_AUD","Australia Dollar"),v()(nr,"CURRENCY_FULL_NAME_JPY","Japan Yen"),v()(nr,"CURRENCY_FULL_NAME_CAD","Canada Dollar"),v()(nr,"CURRENCY_FULL_NAME_NZD","New Zealand Dollar"),v()(nr,"CURRENCY_FULL_NAME_HKD","Hong Kong Dollar"),v()(nr,"CURRENCY_FULL_NAME_SGD","Singapore Dollar"),v()(nr,"CURRENCY_FULL_NAME_MXN","Mexico Peso"),v()(nr,"CURRENCY_FULL_NAME_DKK","Denmark Krone"),v()(nr,"CURRENCY_FULL_NAME_NOK","Norway Krone"),v()(nr,"CURRENCY_FULL_NAME_MYR","Malaysia Ringgit"),v()(nr,"CURRENCY_FULL_NAME_TWD","Taiwan New Dollar"),v()(nr,"CURRENCY_FULL_NAME_THB","Thailand Baht"),v()(nr,"CURRENCY_FULL_NAME_ILS","Israel Shekel"),v()(nr,"CURRENCY_FULL_NAME_CHF","Switzerland Franc"),v()(nr,"CURRENCY_FULL_NAME_BRL","Brazil Real"),v()(nr,"CURRENCY_FULL_NAME_RON","Romania Leu"),v()(nr,"CURRENCY_FULL_NAME_PGK","Papua New Guinea Kina"),v()(nr,"CURRENCY_FULL_NAME_INR","Indian Rupee"),v()(nr,"CURRENCY_FULL_NAME_MUR","Mauritian Rupee"),v()(nr,"CURRENCY_FULL_NAME_CZK","Czech Republic Koruna"),v()(nr,"CURRENCY_FULL_NAME_DOP","Dominican Republic Peso"),v()(nr,"CURRENCY_FULL_NAME_ZAR","South Africa Rand"),v()(nr,"CURRENCY_FULL_NAME_TRY","Turkey Lira"),v()(nr,"CURRENCY_FULL_NAME_SEK","Sweden Krona"),v()(nr,"CURRENCY_FULL_NAME_PLN","Poland Zloty"),v()(nr,"CURRENCY_FULL_NAME_PHP","Philippines Peso"),v()(nr,"CURRENCY_FULL_NAME_AED","United Arab Emirates Dirham"),v()(nr,"CURRENCY_FULL_NAME_ARS","Argentina Peso"),v()(nr,"CURRENCY_FULL_NAME_RUB","Russia Ruble"),v()(nr,"CURRENCY_FULL_NAME_XCD","East Caribbean Dollar"),v()(nr,"CURRENCY_FULL_NAME_BGN","Bulgaria Lev"),v()(nr,"CURRENCY_FULL_NAME_HUF","Hungary Forint"),v()(nr,"CURRENCY_FULL_NAME_CNY","Chinese Yuan"),v()(nr,"CURRENCY_FULL_NAME_COP","Colombian Pesos"),v()(nr,"CURRENCY_NAME_I18N_USD","payments_currency01"),v()(nr,"CURRENCY_NAME_I18N_EUR","payments_currency02"),v()(nr,"CURRENCY_NAME_I18N_GBP","payments_currency03"),v()(nr,"CURRENCY_NAME_I18N_AUD","payments_currency04"),v()(nr,"CURRENCY_NAME_I18N_JPY","payments_currency05"),v()(nr,"CURRENCY_NAME_I18N_CAD","payments_currency06"),v()(nr,"CURRENCY_NAME_I18N_NZD","payments_currency07"),v()(nr,"CURRENCY_NAME_I18N_HKD","payments_currency08"),v()(nr,"CURRENCY_NAME_I18N_SGD","payments_currency09"),v()(nr,"CURRENCY_NAME_I18N_MXN","payments_currency10"),v()(nr,"CURRENCY_NAME_I18N_DKK","payments_currency11"),v()(nr,"CURRENCY_NAME_I18N_NOK","payments_currency13"),v()(nr,"CURRENCY_NAME_I18N_MYR","payments_currency14"),v()(nr,"CURRENCY_NAME_I18N_TWD","payments_currency15"),v()(nr,"CURRENCY_NAME_I18N_THB","payments_currency16"),v()(nr,"CURRENCY_NAME_I18N_ILS","payments_currency17"),v()(nr,"CURRENCY_NAME_I18N_CHF","payments_currency18"),v()(nr,"CURRENCY_NAME_I18N_BRL","payments_currency19"),v()(nr,"CURRENCY_NAME_I18N_RON","payments_currency37"),v()(nr,"CURRENCY_NAME_I18N_PGK","payments_currency22"),v()(nr,"CURRENCY_NAME_I18N_INR","payments_currency23"),v()(nr,"CURRENCY_NAME_I18N_MUR","payments_currency24"),v()(nr,"CURRENCY_NAME_I18N_CZK","payments_currency25"),v()(nr,"CURRENCY_NAME_I18N_DOP","payments_currency26"),v()(nr,"CURRENCY_NAME_I18N_ZAR","payments_currency27"),v()(nr,"CURRENCY_NAME_I18N_TRY","payments_currency28"),v()(nr,"CURRENCY_NAME_I18N_SEK","payments_currency29"),v()(nr,"CURRENCY_NAME_I18N_PLN","payments_currency30"),v()(nr,"CURRENCY_NAME_I18N_PHP","payments_currency38"),v()(nr,"CURRENCY_NAME_I18N_AED","payments_currency32"),v()(nr,"CURRENCY_NAME_I18N_ARS","payments_currency33"),v()(nr,"CURRENCY_NAME_I18N_RUB","payments_currency34"),v()(nr,"CURRENCY_NAME_I18N_XCD","payments_currency36"),v()(nr,"CURRENCY_NAME_I18N_BGN","payments_currency39"),v()(nr,"CURRENCY_NAME_I18N_HUF","payments_currency40"),v()(nr,"CURRENCY_NAME_I18N_CNY","payments_currency41"),v()(nr,"CURRENCY_NAME_I18N_COP","payments_currency42"),v()(nr,"CURRENCY_SYMBOL_USD","$"),v()(nr,"CURRENCY_SYMBOL_EUR","\u20ac"),v()(nr,"CURRENCY_SYMBOL_GBP","\xa3"),v()(nr,"CURRENCY_SYMBOL_AUD","$"),v()(nr,"CURRENCY_SYMBOL_JPY","\xa5"),v()(nr,"CURRENCY_SYMBOL_CAD","$"),v()(nr,"CURRENCY_SYMBOL_NZD","$"),v()(nr,"CURRENCY_SYMBOL_HKD","$"),v()(nr,"CURRENCY_SYMBOL_SGD","$"),v()(nr,"CURRENCY_SYMBOL_MXN","$"),v()(nr,"CURRENCY_SYMBOL_DKK","Kr."),v()(nr,"CURRENCY_SYMBOL_NOK","kr"),v()(nr,"CURRENCY_SYMBOL_MYR","RM"),v()(nr,"CURRENCY_SYMBOL_TWD","NT$"),v()(nr,"CURRENCY_SYMBOL_THB","\u0e3f"),v()(nr,"CURRENCY_SYMBOL_ILS","\u20aa"),v()(nr,"CURRENCY_SYMBOL_CHF","SFr."),v()(nr,"CURRENCY_SYMBOL_BRL","R$"),v()(nr,"CURRENCY_SYMBOL_RON","lei"),v()(nr,"CURRENCY_SYMBOL_PGK","K"),v()(nr,"CURRENCY_SYMBOL_INR","\u20b9"),v()(nr,"CURRENCY_SYMBOL_MUR","\u20a8"),v()(nr,"CURRENCY_SYMBOL_CZK","K\u010d"),v()(nr,"CURRENCY_SYMBOL_DOP","RD$"),v()(nr,"CURRENCY_SYMBOL_ZAR","R"),v()(nr,"CURRENCY_SYMBOL_SEK","kr"),v()(nr,"CURRENCY_SYMBOL_PLN","z\u0142"),v()(nr,"CURRENCY_SYMBOL_PHP","\u20b1"),v()(nr,"CURRENCY_SYMBOL_TRY","\u20ba"),v()(nr,"CURRENCY_SYMBOL_AED","\u062f.\u0625"),v()(nr,"CURRENCY_SYMBOL_ARS","$"),v()(nr,"CURRENCY_SYMBOL_RUB","\u20bd"),v()(nr,"CURRENCY_SYMBOL_XCD","$"),v()(nr,"CURRENCY_SYMBOL_BGN","\u043b\u0432"),v()(nr,"CURRENCY_SYMBOL_HUF","Ft"),v()(nr,"CURRENCY_SYMBOL_CNY","\uffe5"),v()(nr,"CURRENCY_SYMBOL_COP","COP"),v()(nr,"$SUPPORTED_CURRENCIES",[nr.CURRENCY_CODE_ARS,nr.CURRENCY_CODE_AUD,nr.CURRENCY_CODE_BRL,nr.CURRENCY_CODE_BGN,nr.CURRENCY_CODE_CAD,nr.CURRENCY_CODE_CNY,nr.CURRENCY_CODE_COP,nr.CURRENCY_CODE_CZK,nr.CURRENCY_CODE_DKK,nr.CURRENCY_CODE_DOP,nr.CURRENCY_CODE_XCD,nr.CURRENCY_CODE_EUR,nr.CURRENCY_CODE_HKD,nr.CURRENCY_CODE_HUF,nr.CURRENCY_CODE_INR,nr.CURRENCY_CODE_ILS,nr.CURRENCY_CODE_JPY,nr.CURRENCY_CODE_PGK,nr.CURRENCY_CODE_MYR,nr.CURRENCY_CODE_MUR,nr.CURRENCY_CODE_MXN,nr.CURRENCY_CODE_NZD,nr.CURRENCY_CODE_NOK,nr.CURRENCY_CODE_PHP,nr.CURRENCY_CODE_PLN,nr.CURRENCY_CODE_GBP,nr.CURRENCY_CODE_RON,nr.CURRENCY_CODE_RUB,nr.CURRENCY_CODE_SGD,nr.CURRENCY_CODE_ZAR,nr.CURRENCY_CODE_CHF,nr.CURRENCY_CODE_SEK,nr.CURRENCY_CODE_TWD,nr.CURRENCY_CODE_THB,nr.CURRENCY_CODE_TRY,nr.CURRENCY_CODE_AED,nr.CURRENCY_CODE_USD]),v()(nr,"CURRENCY_USD",1),v()(nr,"CURRENCY_EUR",2),v()(nr,"CURRENCY_GBP",3),v()(nr,"CURRENCY_AUD",4),v()(nr,"CURRENCY_JPY",5),v()(nr,"CURRENCY_CAD",6),v()(nr,"CURRENCY_NZD",7),v()(nr,"CURRENCY_HKD",8),v()(nr,"CURRENCY_SGD",9),v()(nr,"CURRENCY_MXN",10),v()(nr,"CURRENCY_DKK",11),v()(nr,"CURRENCY_NOK",13),v()(nr,"CURRENCY_MYR",14),v()(nr,"CURRENCY_TWD",15),v()(nr,"CURRENCY_THB",16),v()(nr,"CURRENCY_ILS",17),v()(nr,"CURRENCY_CHF",18),v()(nr,"CURRENCY_BRL",19),v()(nr,"CURRENCY_RON",20),v()(nr,"CURRENCY_PGK",22),v()(nr,"CURRENCY_INR",23),v()(nr,"CURRENCY_MUR",24),v()(nr,"CURRENCY_CZK",25),v()(nr,"CURRENCY_DOP",26),v()(nr,"CURRENCY_ZAR",27),v()(nr,"CURRENCY_TRY",28),v()(nr,"CURRENCY_SEK",29),v()(nr,"CURRENCY_PLN",30),v()(nr,"CURRENCY_PHP",31),v()(nr,"CURRENCY_AED",32),v()(nr,"CURRENCY_ARS",33),v()(nr,"CURRENCY_RUB",34),v()(nr,"CURRENCY_XCD",36),v()(nr,"CURRENCY_BGN",37),v()(nr,"CURRENCY_HUF",38),v()(nr,"CURRENCY_CNY",39),v()(nr,"CURRENCY_COP",40),v()(nr,"$ID_TO_ISO_CODE",{}),v()(nr,"$ID_TO_SYMBOL",{}),v()(nr,"$ISO_CODE_TO_ID",{}),v()(nr,"$ISO_CODE_TO_FULL_NAME",{}),v()(nr,"$ISO_CODE_TO_NAME_I18N",{});var rr=function(e){g()(n,e);var t=ir(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"priceInput",void 0),v()(c()(r),"priceContainer",void 0),v()(c()(r),"currencyLabel",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","price-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","price-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","price-".concat(a,"-instr-acc")),r.priceInput=document.createElement("input"),r.priceInput.setAttribute("type","text"),r.priceInput.setAttribute("data-role","i123-input"),r.priceInput.setAttribute("data-no-theme",""),r.priceInput.setAttribute("data-index",String("".concat(n.INDEX_FLOAT_PART,",").concat(n.INDEX_FIXED_PART,",").concat(n.INDEX_DECIMAL_PART))),r.currencyLabel=document.createElement("span"),r.currencyLabel.setAttribute("data-role","currency-code"),r.currencyLabel.setAttribute("id","price-".concat(a,"-currency-acc")),r.priceContainer=document.createElement("div"),r.priceContainer.setAttribute("data-role","price-container"),r.priceContainer.setAttribute("data-ui-role","ui-element"),r.priceContainer.appendChild(r.currencyLabel),r.priceContainer.appendChild(r.priceInput),r.priceInput.setAttribute("aria-labelledby","price-".concat(a,"-acc ")+"price-".concat(a,"-error-acc ")+"price-".concat(a,"-instr-acc ")+"price-".concat(a,"-currency-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_PRICE}},{key:"getElementName",value:function(){return"Price"}},{key:"updateCurrencyLabel",value:function(){var e=this.getProperty("options.intendedCurrencyISOCode")||nr.CURRENCY_CODE_USD;this.currencyLabel.textContent=e}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateCurrencyLabel(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.clearValue(),this.updatePlaceholderValue(),this.addEventListeners(),this.synchronizeValue()}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.priceContainer,width:T.y.FULL}]}]}},{key:"onValueChanged",value:function(){var e=this.priceInput.value,t=this.getProperty("options.hideDecimals"),i=[],r=null,a=parseFloat(e),o=parseInt(String(a));if(""!==e)if(isFinite(a))if(a<0)this.addError(Dt.ERR_NEGATIVE_PRICE,this.getForm().getEngine().getI18n().translateText("textdef_224")||"Negative price is not allowed"),i.push(Dt.ERR_NEGATIVE_PRICE);else if(!t&&/\.[\d]{3,}(.*)?$/.test(e))this.addError(Dt.ERR_PRICE_TOO_MANY_DECIMALS,this.getForm().getEngine().getI18n().translateText("textdef_219")||"Maximum 2 decimals are allowed"),i.push(Dt.ERR_PRICE_TOO_MANY_DECIMALS);else{var s=(e=e.replace(/^[0]+/,"")).indexOf(".")>-1?e.replace(/\.\d{1}$/,(function(e){return"".concat(e,"0")})).replace(/\.$/,".00").replace(".",""):"".concat(e,"00");(r=Math.round(100*a))>=100&&(r>n.MAX_STORED_VALUE||String(r).length!==s.length)?(this.addError(Dt.ERR_NUMBER_TOO_BIG,this.getForm().getEngine().getI18n().translateText("textdef_73",String(n.MAX_INPUT_VALUE_STRING))||"The value you have provided is too big"),i.push(Dt.ERR_NUMBER_TOO_BIG)):t&&a!==o&&(this.addError(Dt.ERR_INTEGER_VALUE_EXPECTED,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_5"),": ").concat(this.getForm().getEngine().getI18n().translateText("textdef_223"))||"Please input an integer number"),i.push(Dt.ERR_INTEGER_VALUE_EXPECTED))}else this.addError(Dt.ERR_NUMBER_EXPECTED,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_5"),": ").concat(this.getForm().getEngine().getI18n().translateText("textdef_47"))||"Please input a number"),i.push(Dt.ERR_NUMBER_EXPECTED);for(var l=0,u=[Dt.ERR_INTEGER_VALUE_EXPECTED,Dt.ERR_PRICE_TOO_MANY_DECIMALS,Dt.ERR_NUMBER_EXPECTED,Dt.ERR_NEGATIVE_PRICE,Dt.ERR_NUMBER_TOO_BIG],c=u.length;l<c;l++)-1===i.indexOf(u[l])&&this.removeError(u[l]);i.length?(this.setProperty("value.chosenValueInMinimalPossibleRepresentation",null),this.setProperty("value.chosenCurrency",null)):(this.setProperty("value.chosenCurrency",this.getProperty("options.intendedCurrencyISOCode")),this.setProperty("value.chosenValueInMinimalPossibleRepresentation",r)),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"addEventListeners",value:function(){var e=this;this.priceInput.addEventListener("keydown",(function(t){var n=e.priceInput.value,i=t.keyCode||t.charCode,r=!e.getProperty("options.hideDecimals"),a=n.indexOf(".")>-1;if(t.shiftKey&&i!==at.KEY_TAB)return t.preventDefault(),void t.stopPropagation();switch(i){case at.KEY_0:case at.KEY_1:case at.KEY_2:case at.KEY_3:case at.KEY_4:case at.KEY_5:case at.KEY_6:case at.KEY_7:case at.KEY_8:case at.KEY_9:if(t.shiftKey)return t.preventDefault(),void t.stopPropagation();case at.KEY_PAD_0:case at.KEY_PAD_1:case at.KEY_PAD_2:case at.KEY_PAD_3:case at.KEY_PAD_4:case at.KEY_PAD_5:case at.KEY_PAD_6:case at.KEY_PAD_7:case at.KEY_PAD_8:case at.KEY_PAD_9:case at.KEY_BACKSPACE:case at.KEY_DELETE:case at.KEY_LEFT:case at.KEY_RIGHT:case at.KEY_HOME:case at.KEY_END:case at.KEY_TAB:break;case at.KEY_UP:isFinite(parseFloat(e.priceInput.value))&&!e.readOnly&&(e.priceInput.value=String(parseFloat(n)+1));break;case at.KEY_DOWN:isFinite(parseFloat(e.priceInput.value))&&parseFloat(e.priceInput.value)-1>=0&&!e.readOnly&&(e.priceInput.value=String(parseFloat(n)-1));break;case at.KEY_DOT:case at.KEY_PAD_DOT:if(r&&!a)return;default:t.stopPropagation(),t.preventDefault()}})),function(e,t){e(t.priceInput).on("focus",(function(){e(t.rootNode).find("div[data-role=price-container]").attr("data-is-focused-child-element","1")})).on("blur",(function(){e(t.rootNode).find("div[data-role=price-container]").removeAttr("data-is-focused-child-element")}))}(Bt.getJQuery(),this)}},{key:"enumerateIndexes",value:function(){return[n.INDEX_FLOAT_PART,n.INDEX_FIXED_PART,n.INDEX_DECIMAL_PART]}},{key:"getIntPartAsString",value:function(){var e=this.getProperty("value.chosenValueInMinimalPossibleRepresentation");return null===e?null:(e/100).toFixed(0)}},{key:"setIntPartFromString",value:function(e){var t=parseInt(e);if(isFinite(t)&&t>=0){var n=this.getProperty("value.chosenValueInMinimalPossibleRepresentation");if(null===n)n=100*t;else n=100*t+n%100;this.setProperty("value.chosenValueInMinimalPossibleRepresentation",n),this.synchronizeValue()}else console.warn("Invalid int part value: ".concat(JSON.stringify(e),": sint >=0 expected!"))}},{key:"getDecimalPartAsString",value:function(){var e=this.getProperty("value.chosenValueInMinimalPossibleRepresentation");return this.getProperty("options.hideDecimals")?"":null!==e&&isFinite(e)?String(e%100):""}},{key:"setDecimalPartAsString",value:function(e){var t=this.getProperty("value.chosenValueInMinimalPossibleRepresentation");if(!this.getProperty("options.hideDecimals")){var n=null===e?0:parseInt(e);isFinite(n)&&n>=0&&n<100?(t=null===t?n:100*Math.floor(t/100)+n,this.setProperty("value.chosenValueInMinimalPossibleRepresentation",t),this.synchronizeValue()):console.warn("Invalid decimal part value: ".concat(JSON.stringify(e),": sint >=0 < 100 expected!"))}}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case n.INDEX_FLOAT_PART:return{targetPropertyFQN:"value.asFloat",type:"number",optional:!0};case n.INDEX_FIXED_PART:return{targetPropertyFQN:"value.fixedPart",type:"string",optional:!0};case n.INDEX_DECIMAL_PART:return{targetPropertyFQN:"value.decimalPart",type:"string",optional:!0};default:return null}}},{key:"updatePlaceholderValue",value:function(){var e=this.getProperty("options.hideDecimals");this.priceInput.placeholder=e?"0":"0.00"}},{key:"setupDefaults",value:function(){this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_price_name"));var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DEFAULT_USER_PREFERENCES);return e&&(this.setProperty("options.intendedCurrencyISOCode",e.currency),this.updateCurrencyLabel()),this.updateLabelText(),this}},{key:"synchronizeValue",value:function(){var e=this.getProperty("value.chosenValueInMinimalPossibleRepresentation"),t=parseInt(String(e/100),10),n=e%100;if(null===e)jt.synchronizeControlValue(this.priceInput,"");else{var i=this.getProperty("options.hideDecimals"),r=this.priceInput.value,a=String(t)+(i?"":".".concat(String(n<10?"0".concat(n):n)));parseFloat(r)!==parseFloat(a)&&(this.priceInput.value=a)}}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"getValueAsFloat",value:function(){return parseFloat(((this.getProperty("value.chosenValueInMinimalPossibleRepresentation")||0)/100).toFixed(2))}},{key:"setValueFromFloat",value:function(e){this.setProperty("value.chosenValueInMinimalPossibleRepresentation",Math.round(100*(e||0)))}},{key:"onReset",value:function(){null!==this.getProperty("value.chosenValueInMinimalPossibleRepresentation")&&(this.setProperty("value.chosenValueInMinimalPossibleRepresentation",null),jt.synchronizeControlValue(this.priceInput,""),this.getForm().getEngine().getJQuery()(this.priceInput).trigger("input"))}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"clearValue",value:function(){this.setProperty("value.chosenValueInMinimalPossibleRepresentation",null)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_PRICE,name:"Price",isContainer:!1,category:"advanced",keywords:"price number",icon:"i123-editor_field_price",isVirtual:!1,i18nName:"edt_UI_control_type_price_name",i18nKeywords:"edt_UI_control_type_price_keywords",index:160,accessibilityFields:T.r.ERROR_NODE}}}]),n}(tn);function ar(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(rr,"MAX_STORED_VALUE",900719925474999),v()(rr,"MAX_INPUT_VALUE_STRING","9007199254749.99"),v()(rr,"INDEX_FLOAT_PART",0),v()(rr,"INDEX_FIXED_PART",1),v()(rr,"INDEX_DECIMAL_PART",2),v()(rr,"attributes",{}),v()(rr,"runtime",null),v()(rr,"nodeName","price");var or=function(e){g()(n,e);var t=ar(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"choices",[]),v()(c()(r),"clearableButton",void 0);var a=r.getHash();return r.rootNode.setAttribute("aria-labelledby","checkbox-".concat(a,"-acc ")+"radio-".concat(a,"-clearable-button-acc ")+"checkbox-".concat(a,"-error-acc ")+"checkbox-".concat(a,"-instr-acc")),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","radio-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","radio-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","radio-".concat(a,"-instr-acc")),r.clearableButton=document.createElement("span"),r.clearableButton.setAttribute("data-role","clear-value"),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_RADIO}},{key:"getElementName",value:function(){return"Radio"}},{key:"clearValue",value:function(){!function(e,t){e(t.rootNode).find("input[type=radio]").each((function(){this.checked&&(e(this).trigger("click"),this.checked=!1)}))}(this.getForm().getEngine().getJQuery(),this),this.onValueChanged()}},{key:"updateChoices",value:function(){if(this.hasProperty("choices.values")){var e,t,n,i,r,a,o,s=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),l=this.getHash(),u=this.getProperty("options.showNumberOfChoicesLeft");u?this.rootNode.setAttribute("data-show-number-of-choices","1"):this.rootNode.removeAttribute("data-show-number-of-choices");for(var c=0,d=s.length;c<d;c++)s[c].index=c;this.hasProperty("options.randomizeOrder")&&this.getProperty("options.randomizeOrder")&&jt.shuffle(s),this.hasProperty("choices.allowOther")&&this.getProperty("choices.allowOther")&&s.push({text:"Other...",isOther:!0,index:-1});for(var p=0,h=this.choices.length;p<h;p++)this.choices[p].parentNode&&this.choices[p].parentNode.removeChild(this.choices[p]);this.choices.splice(0,this.choices.length);for(var g=0,_=s.length;g<_;g++){if((i=document.createElement("div")).setAttribute("data-role","choice"),(e=document.createElement("input")).setAttribute("type","radio"),e.setAttribute("id","".concat(l,"_").concat(g)),e.setAttribute("name","c_".concat(l)),e.setAttribute("value",s[g].text),e.setAttribute("data-index",String(s[g].index)),e.setAttribute("data-role","i123-input"),s[g].isOther&&e.setAttribute("data-is-other","1"),(t=document.createElement("label")).setAttribute("data-role","choice"),t.setAttribute("id","radio-".concat(l).concat(g)),t.appendChild(e),s[g].isDefault&&(e.checked=!0,t.setAttribute("aria-checked","true")),(n=document.createElement("label")).setAttribute("data-role","radio"),n.setAttribute("for","".concat(l,"_").concat(g)),n.setAttribute("aria-labelledby","radio-".concat(l).concat(g)),n.setAttribute("role","radio"),t.appendChild(n),i.appendChild(t),s[g].isOther)(r=document.createElement("input")).setAttribute("data-role","other"),r.setAttribute("type","text"),r.setAttribute("data-size","full"),(o=document.createElement("span")).innerHTML=s[g].text||"",o.setAttribute("data-i18n-text","textdef_15"),t.appendChild(o),t.setAttribute("data-is-other","1"),i.appendChild(r);else jt.isImageURL(s[g].text||"")?((a=document.createElement("img")).setAttribute("src",s[g].text),a.setAttribute("data-choice-is-image","1"),t.appendChild(a)):((o=document.createElement("span")).setAttribute("data-role","option-text"),o.innerHTML=s[g].text||"",t.appendChild(o));this.setupNumberOfTimesAnOptionCanBeChosen(s[g],u,t,i,e),this.choices.push(i)}if(this.isAttached()){this.rendererType=void 0;var f=le.getSuggestedRenderer(this,this.getForm().getLabelPlacement(),this.getForm().getInstructionsPlacement());this.setRendererType(f)}}}},{key:"setupNumberOfTimesAnOptionCanBeChosen",value:function(e,t,n,i,r){if(e.numberOfTimesThisOptionCanBeChosen&&null!==e.numberOfTimesThisOptionCanBeChosen&&e.numberOfTimesThisOptionCanBeChosen>=-1){var a=~~e.numberOfTimesThisOptionHasBeenChosen;a<0&&(a=0);var o=e.numberOfTimesThisOptionCanBeChosen-a;if(t){var s=document.createElement("span");s.setAttribute("data-role","label-info");var l=document.createElement("span");s.appendChild(document.createTextNode("".concat(String(o<0||0===o?0:o)," "))),l.textContent=1===o?"choice left":"choices left",l.setAttribute("data-i18n-text",1===o?"textdef_173":"textdef_174"),s.appendChild(l),n.appendChild(s)}(this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT||this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.getForm().getEngine().getLoader().getViewFormContext()!==T.Z.EDIT_SUBMISSION)&&o<1&&(n.setAttribute("data-disabled","1"),i.setAttribute("data-disabled","1"),r.setAttribute("disabled","true"),r.setAttribute("data-disabled","1"))}}},{key:"updateSideBySideAttribute",value:function(){this.getProperty("layout.isSideBySide")?this.rootNode.setAttribute("data-is-side-by-side-layout","1"):this.rootNode.removeAttribute("data-is-side-by-side-layout")}},{key:"updateClearableOption",value:function(){this.getProperty("options.clearable")?this.labelDOMNode.appendChild(this.clearableButton):this.clearableButton.parentNode&&this.clearableButton.parentNode.removeChild(this.clearableButton)}},{key:"getNumberOfColumns",value:function(){var e=this.hasProperty("layout.columns")?~~this.getProperty("layout.columns"):1;return e<1&&(e=1),e>4&&(e=4),e}},{key:"getIsSideBySideLayout",value:function(){return!!this.hasProperty("layout.isSideBySide")&&!!this.getProperty("layout.isSideBySide")}},{key:"getIsDirectionVertical",value:function(){return!!this.hasProperty("layout.direction")&&"vertical"===this.getProperty("layout.direction")}},{key:"getSideBySideChoicesLayoutRows",value:function(e){for(var t=[],n={inputs:[]},i=0,r=e;i<r;i++)n.inputs.push({width:null,input:this.choices[i]});return t.push(n),t}},{key:"getChoiceWidth",value:function(e){switch(e){case 2:return T.y.HALF;case 3:return T.y.THIRD;case 4:return T.y.QUARTER;case 1:default:return T.y.FULL}}},{key:"getVerticalChoicesLayoutRows",value:function(e,t){var n=Math.ceil(e/t),i=0,r=this.getChoiceWidth(t),a=[];n!==~~n&&(n=1+~~n);for(var o=0,s=e;o<s;o++)a[i]=a[i]||{inputs:[]},a[i].inputs.push({width:r,input:this.choices[o]}),++i>=n&&(i=0);return a}},{key:"getInputObject",value:function(e,t){switch(e){case 2:return{width:T.y.HALF,input:t};case 3:return{width:T.y.THIRD,input:t};case 4:return{width:T.y.QUARTER,input:t};case 1:default:return{width:T.y.FULL,input:t}}}},{key:"getHorizontalChoicesLayoutRows",value:function(e,t){for(var n=null,i=0,r=[],a=0,o=e;a<o;a++)null===n&&(n={inputs:[]},r.push(n)),n.inputs.push(this.getInputObject(t,this.choices[a])),++i>=t&&(i=0,a<o-1&&(n={inputs:[]},r.push(n)));return r}},{key:"getInputDOMNodes",value:function(){var e=this.getNumberOfColumns(),t=this.getIsSideBySideLayout(),n=this.getIsDirectionVertical(),i=this.choices.length;switch(!0){case t:return this.getSideBySideChoicesLayoutRows(i);case n:if(!this.getForm().getEngine().getTheme().isMobileLayout())return this.getVerticalChoicesLayoutRows(i,e)}return this.getHorizontalChoicesLayoutRows(i,e)}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateChoices(),this.updateShowInstructionsOnClick(),this.updateSideBySideAttribute(),this.updateHiddenAttribute(),this.updateClearableOption(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.onValueChanged()}},{key:"onValueChanged",value:function(){for(var e,t,n,i,r,a=null,o=null,s=this.getValue().index,l=0,u=this.choices.length;l<u;l++)if(e=this.choices[l].querySelector("input[type=radio]"),r=this.choices[l].querySelector("label[data-role=radio]"),e&&e.checked){if(r.setAttribute("aria-checked","true"),!e.hasAttribute("data-is-other")){a=e.value,o=parseInt(e.getAttribute("data-index"));break}if(t=this.choices[l].querySelector("input[type=text][data-role=other]")){a=t.value,o=-1;break}}else r&&r.hasAttribute("aria-checked")&&r.removeAttribute("aria-checked");null!==(n=this.choices[this.choices.length-1]||null)&&n.querySelector("label [data-is-other]")&&(e=n.querySelector("input[type=radio]"))&&(e.checked?n.setAttribute("data-is-checked","1"):n.removeAttribute("data-is-checked")),this.setProperty("value.value",a),this.setProperty("value.index",i=-1===o?this.choices.length-1:~~o),this.isAttached()&&(i!==s&&this.getForm().trigger("radio-uncheck",this,s),this.getForm().trigger("change",this))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){var t,n=this.getProperty("choices.values")||[],i=n.length;return e<i?{element:this,targetPropertyFQN:"value.value",optional:!1,type:"string",inputIndex:e,parser:(t=e,function(e){return e===n[t].text})}:e>i?null:this.getProperty("choices.allowOther")?{element:this,targetPropertyFQN:"value.value",optional:!1,type:"string",inputIndex:e}:null}},{key:"synchronizeValue",value:function(){var e,t=this.getProperty("choices.values"),n=this.getProperty("choices.allowOther"),i=this.getProperty("value.value"),r=this.getProperty("value.index");if(t&&t.length)for(var a=0,o=t.length;a<o;a++)if(t[a].text===i&&r===a)for(var s=0,l=this.choices.length-~~n;s<l;s++)if(e=this.choices[s].querySelector("input[type=radio]"),parseInt(e.getAttribute("data-index"))===r)return void(e.checked||(e.checked=!0));if(n&&null===r)try{var u=this.choices[this.choices.length-1];u.setAttribute("data-is-checked","1"),u.querySelector("input[type=radio]").checked=!!i,u.querySelector("input[type=text]").value=String(i||""),u.querySelector("label[data-role=radio]").setAttribute("aria-checked","true")}catch(c){console.error(c)}}},{key:"isNumberOfTimesAnOptionCanBeChosen",value:function(){for(var e=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),t=0,n=e.length;t<n;t++)if(e[t].numberOfTimesThisOptionCanBeChosen)return!0;return!1}},{key:"setIsNumberOfTimesAnOptionCanBeChosen",value:function(e){for(var t=JSON.parse(JSON.stringify(this.getProperty("choices.values")||[])),n=0,i=t.length;n<i;n++)e?void 0!==t[n].numberOfTimesThisOptionCanBeChosen&&null!==t[n].numberOfTimesThisOptionCanBeChosen||(t[n].numberOfTimesThisOptionCanBeChosen=0):t[n].numberOfTimesThisOptionCanBeChosen=null;this.setProperty("choices.values",t)}},{key:"getChoicesValues",value:function(){return JSON.parse(JSON.stringify(this.getProperty("choices.values")||[]))}},{key:"setChoicesValues",value:function(e){e&&Object(ot.a)(e,(function(e){return e.text=e.text.trim()})),this.setProperty("choices.values",e)}},{key:"onReset",value:function(){this.updateChoices(),this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_radio_name")),this.updateLabelText(),this}},{key:"setupI18n",value:function(){var e=this,t=this.getId();if(t){for(var i=0,r=this.choices.length;i<r;i++){var a=this.choices[i].querySelector("input[type=radio][data-index]");if(a){var o=~~a.getAttribute("data-index"),s=this.choices[i].querySelector("span[data-role=option-text]");s&&(s.setAttribute("data-i18n-html","control_label_".concat(t,"_choice_").concat(o)),s.setAttribute("data-skip-markdown","true"))}}setTimeout((function(){return e.updateClearableOption()}),30)}return p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"getInputDOMNodeAtIndex",value:function(e){return null===e?null:this.rootNode.querySelector('input[type=radio][data-index="'.concat(e,'"]'))}},{key:"getChoicesDOMNodes",value:function(){return this.choices}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"updateAccessibilityTabIndexes",value:function(){if(p()(E()(n.prototype),"updateAccessibilityTabIndexes",this).call(this),this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1)){var e=document.createElement("span");e.appendChild(document.createTextNode("Clear options")),e.style.display="none",this.clearableButton.appendChild(e),this.clearableButton.setAttribute("aria-labelledby","radio-".concat(this.getHash(),"-clearable-button-acc")),this.clearableButton.tabIndex=0}else this.clearableButton.removeAttribute("tabindex")}},{key:"enumerateTranslations",value:function(){var e=[],t=(this.getForm().getEngine().getI18n(),this.getProperty("label.labelText")||""),n=this.getProperty("instructions.text")||"";t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n});for(var i=this.getProperty("choices.values")||[],r=0,a=i.length;r<a;r++)i[r].text&&e.push({key:"control_label_".concat(this.getId(),"_choice_").concat(r),sourceText:i[r].text});return e}},{key:"cloneNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return p()(E()(n.prototype),"cloneNode",this).call(this,e,t)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_RADIO,name:"Radio",isContainer:!1,category:"basic",keywords:"single choice radio radios multiple choices",icon:"i123-single_choice",isVirtual:!1,i18nName:"edt_UI_control_type_radio_name",i18nKeywords:"edt_UI_control_type_radio_keywords",index:40,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE+T.r.OTHER}}}]),n}(tn);function sr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(or,"attributes",{}),v()(or,"runtime",null),v()(or,"nodeName","radio");var lr=function(e){g()(n,e);var t=sr(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_SEPARATOR}},{key:"getElementName",value:function(){return"Separator"}},{key:"setRendererType",value:function(e){}},{key:"getMinColspan",value:function(){return 0}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"onReset",value:function(){}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_SEPARATOR,name:"Separator",isContainer:!1,category:"basic",keywords:"separator space blank empty",icon:"i123-single_choice",isVirtual:!1,index:99999,accessibilityFields:T.r.NONE}}}]),n}(tn);function ur(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(lr,"attributes",{}),v()(lr,"runtime",null),v()(lr,"nodeName","separator");var cr=function(e){g()(n,e);var t=ur(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"canvasNode",void 0),v()(c()(r),"textBaseline",void 0),v()(c()(r),"clearButton",void 0),v()(c()(r),"fakeInputNode",void 0),v()(c()(r),"tainted",!1),v()(c()(r),"warningMessageRegardingLoosingSignature",void 0),v()(c()(r),"pictureWithLoadedTaintedSignature",void 0),v()(c()(r),"signatureValueAsString",null);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","signature-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","signature-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","signature-".concat(a,"-instr-acc")),r.canvasNode=document.createElement("canvas"),r.textBaseline=document.createElement("div"),r.textBaseline.setAttribute("data-role","text-baseline"),r.clearButton=document.createElement("a"),r.clearButton.setAttribute("data-role","clear-signature"),r.clearButton.textContent="Clear",r.clearButton.style.display="none",r.clearButton.setAttribute("data-i18n-text","textdef_218"),r.clearButton.setAttribute("id","signature-".concat(a,"-clear-button-acc")),r.fakeInputNode=document.createElement("div"),r.fakeInputNode.setAttribute("data-role","signature-container"),r.fakeInputNode.appendChild(r.canvasNode),r.fakeInputNode.appendChild(r.textBaseline),r.fakeInputNode.appendChild(r.clearButton),e.getEngine().getLoader().getLoaderType()===T.v.VIEW&&r.init(),r.fakeInputNode.setAttribute("aria-labelledby","signature-".concat(a,"-acc ")+"signature-".concat(a,"-clear-button-acc ")+"signature-".concat(a,"-error-acc ")+"signature-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_SIGNATURE}},{key:"getElementName",value:function(){return"Signature"}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateRequiredState(),this.updateInstructionsText(),this.updateShowInstructionsOnClick(),this.clearValue(),this.updateHiddenAttribute(),this.synchronizeValue(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_EXTRA_LOW),e.getValidatorById(Ee.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_LOW),e.getValidatorById(Ee.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_AVERAGE),e.getValidatorById(Ee.VALIDATOR_TYPE_SIGNATURE_COMPLEXITY_HIGH)]}},{key:"getInputDOMNodes",value:function(){var e=this.signatureValueAsString,t="string"===typeof e&&/^data:/.test(e);return this.tainted?[{inputs:[{width:T.y.FULL,input:t?this.fakeInputNode:this.warningMessageRegardingLoosingSignature}]}]:[{inputs:[{width:T.y.FULL,input:this.fakeInputNode}]}]}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"any",optional:!0};default:return null}}},{key:"setRendererType",value:function(e){switch(e){case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,e);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD);break;default:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD)}}},{key:"draw",value:function(e){if(this.removeAllBackendErrors(),e){var t=this.canvasNode.getContext("2d");if(this.tainted)this.pictureWithLoadedTaintedSignature&&(this.canvasNode.width=this.canvasNode.getBoundingClientRect().width,this.canvasNode.height=this.canvasNode.getBoundingClientRect().height,t.fillStyle="rgba(255,255,255,0)",t.fillRect(0,0,this.canvasNode.offsetWidth,this.canvasNode.offsetHeight),t.drawImage(this.pictureWithLoadedTaintedSignature,0,0));else{var n=e.length,i=0,r=1;if(t.lineWidth=2,t.lineCap="round",t.strokeStyle="#000000",n<2)this.clearButton.style.display="none";else for(this.clearButton.style.display="";i<n;)0===i||-1===e[i-1]?(t.beginPath(),t.moveTo(e[i],e[i+1]),r=2):-1===e[i]?(r=1,t.stroke()):(t.lineTo(e[i],e[i+1]),r=2),i+=r}}else this.clearButton.style.display="none"}},{key:"getMostLeftSignaturePoint",value:function(e){if(!e)return null;var t=e.length,n=0,i=1,r=0|e[0],a=0|r;if(t<2)return null;for(;n<t;)0===n||-1===e[n-1]?(a=e[n],i=2):-1===e[n]?(i=1,a=r):(a=e[n],i=2),n+=i,r>a&&(r=a);return r}},{key:"getMostRightSignaturePoint",value:function(e){if(!e)return null;var t=e.length,n=0,i=1,r=0|e[0],a=0|r;if(t<2)return null;for(;n<t;)0===n||-1===e[n-1]?(a=e[n],i=2):-1===e[n]?(i=1,a=r):(a=e[n],i=2),n+=i,r<a&&(r=a);return r}},{key:"shiftHorizontal",value:function(e,t){if(!e)return t;if(!t)return t;var n=t.length,i=0,r=1,a=0|t[0],o=0|a;if(n<2)return t;for(;i<n;)0===i||-1===t[i-1]?(t[i]+=e,r=2):-1===t[i]?r=1:(t[i]+=e,r=2),i+=r,a>o&&(a=o);return t}},{key:"init",value:function(){!function(e,t){var n=!1,i={top:0,left:0},r=[];function a(){e.tainted||(e.canvasNode.width=e.canvasNode.offsetWidth,e.canvasNode.height=e.canvasNode.offsetHeight)}function o(t){e.readOnly||e.tainted||(n=!0,i.left=t.offsetX,i.top=t.offsetY,a(),e.draw(e.getProperty("value.value")||[]),r=[i.left,i.top])}function s(t){if(!e.readOnly&&!e.tainted&&n){if(t)try{t.preventDefault()}catch(o){}if(t.offsetX<0||t.offsetY<0||t.offsetX>e.canvasNode.offsetWidth||t.offsetY>e.canvasNode.offsetHeight)l(t);else{e.clearButton.style.display="";var a=e.canvasNode.getContext("2d");a.lineWidth=2,a.lineCap="round",a.strokeStyle="#000000",a.beginPath(),a.moveTo(i.left,i.top),a.lineTo(i.left=t.offsetX,i.top=t.offsetY),r.push(i.left,i.top),a.stroke()}}}function l(t){if(!e.readOnly&&!e.tainted&&n){n=!1,r.push(-1);for(var i=e.getProperty("value.value")||[],a=0,o=r.length;a<o;a++)i.push(r[a]);e.setProperty("value.value",i.slice(0))}}function u(t){if(!t.touches||!t.touches.length)return null;var n=e.canvasNode.getBoundingClientRect();return{offsetX:~~(t.touches[0].clientX-n.left),offsetY:~~(t.touches[0].clientY-n.top)}}(Nt.isMobile()||_e.isTouchDevice())&&(t(e.canvasNode).on("touchstart",(function(e){e.preventDefault(),o(u(e.originalEvent))})),t(e.canvasNode).on("touchmove",(function(e){s(u(e.originalEvent))})),t(e.canvasNode).on("touchend touchcancel mouseup mouseout mouseleave",(function(e){l(u(e.originalEvent))}))),Nt.isMobile()||(t(e.canvasNode).on("mousedown",o),t(e.canvasNode).on("mousemove",s),t(e.canvasNode).on("mouseout mouseleave mouseup",l)),t(e.clearButton).on("click",(function(){e.readOnly||e.onReset()})),e.getForm().getEngine().on("resize",(function(){a();var t,n=e.getProperty("value.value"),i=e.getMostLeftSignaturePoint(n),r=e.getMostRightSignaturePoint(n),o=e.canvasNode.offsetWidth;o<=0||i<0||r<0||r-i<0||(null!==n&&null!==i&&null!==r&&(t=~~(o/2)-~~((r-i)/2),n=e.shiftHorizontal(t-i,n),e.setProperty("value.value",n)),e.draw(n))}))}(this,this.getForm().getEngine().getJQuery())}},{key:"onReset",value:function(){this.setProperty("value.value",null),this.canvasNode.width=this.canvasNode.offsetWidth,this.canvasNode.height=this.canvasNode.offsetHeight,this.draw([])}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_signature_name")),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"updateTaintedState",value:function(){if(this.tainted){this.warningMessageRegardingLoosingSignature=this.warningMessageRegardingLoosingSignature||document.createElement("div");var e=this.signatureValueAsString||null;e&&(/^data:image\//.test(e)?this.paintSignatureOnControlCanvas(e):(this.warningMessageRegardingLoosingSignature.textContent="This signature will be unvalidated on update submission",this.warningMessageRegardingLoosingSignature.setAttribute("data-role","tainted-signature")))}else this.warningMessageRegardingLoosingSignature&&(this.warningMessageRegardingLoosingSignature.parentNode&&this.warningMessageRegardingLoosingSignature.parentNode.removeChild(this.warningMessageRegardingLoosingSignature),this.warningMessageRegardingLoosingSignature=null);this.reRender()}},{key:"setProperty",value:function(e,t){"value.value"===e&&this.properties.value.value&&"string"===typeof this.properties.value.value&&(this.signatureValueAsString=this.properties.value.value);var i=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.VIEW_FORM_CONTEXT);return"value.value"===e&&"string"===typeof t?(this.signatureValueAsString=this.signatureValueAsString||t,i===T.Z.SAVE_FOR_LATER||i===T.Z.EDIT_LATER?this.tainted=!1:"no"!==this.signatureValueAsString.toLowerCase()&&(this.tainted=!0,this.updateTaintedState()),i!==T.Z.APPROVAL&&(this.properties.value.value=null),this):p()(E()(n.prototype),"setProperty",this).call(this,e,t)}},{key:"updateAccessibilityTabIndexes",value:function(){p()(E()(n.prototype),"updateAccessibilityTabIndexes",this).call(this),this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1)?(this.fakeInputNode.tabIndex=0,this.clearButton.tabIndex=0):(this.fakeInputNode.removeAttribute("tabindex"),this.clearButton.removeAttribute("tabindex"))}},{key:"paintSignatureOnControlCanvas",value:function(e){var t=this;setTimeout((function(){var n=document.createElement("img");n.onload=function(){t.canvasNode.width=t.canvasNode.offsetWidth,t.canvasNode.height=t.canvasNode.offsetHeight,t.canvasNode.getContext("2d").drawImage(n,0,0),t.pictureWithLoadedTaintedSignature=n},n.src=e}),100)}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){this.readOnly=!!this.getProperty("options.readOnly")}},{key:"clearValue",value:function(){this.getForm().getEngine().getLoader().getLoaderDependency(T.A.VIEW_FORM_CONTEXT)!==T.Z.APPROVAL&&this.properties&&this.properties.value&&this.setProperty("value.value",null)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_SIGNATURE,name:"Signature",isContainer:!1,category:"advanced",keywords:"signature electronic sign",icon:"i123-edit",isVirtual:!1,i18nName:"edt_UI_control_type_signature_name",i18nKeywords:"edt_UI_control_type_signature_keywords",index:190,accessibilityFields:T.r.ROOT_NODE+T.r.ERROR_NODE+T.r.OTHER}}},{key:"drawSignaturesInPage",value:function(e){try{e.getEngine().getDocument().flatten().forEach((function(e){e.getTypeId()===C.a.CONTROL_TYPE_SIGNATURE&&e.draw([])}))}catch(t){}}}]),n}(tn);function dr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(cr,"attributes",{}),v()(cr,"runtime",null),v()(cr,"nodeName","signature");var pr=function(e){g()(n,e);var t=dr(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),r.input=document.createElement("div"),r.input.setAttribute("data-role","social-container"),r.rootNode.appendChild(r.input),r}return l()(n,[{key:"getElementName",value:function(){return"Social"}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_SOCIAL}},{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"refreshButtons",value:function(){for(var e=this.getProperty("configuration.hasButtonGooglePlus"),t=this.getProperty("configuration.hasButtonTwitter"),i=this.getProperty("configuration.hasButtonLinkedin"),r=this.getProperty("configuration.hasFacebookLike"),a=this.getProperty("configuration.hasFacebookShare"),o=this.getProperty("configuration.customLink")||window.location.href,s=!!this.getProperty("options.showCount"),l=document.title,u=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);this.input.firstChild;)this.input.removeChild(this.input.firstChild);r&&this.input.appendChild(n.createButton("facebook-like",o,l,s,u)),a&&this.input.appendChild(n.createButton("facebook-share",o,l,s,u)),t&&this.input.appendChild(n.createButton("twitter",o,l,s,u)),i&&this.input.appendChild(n.createButton("linkedin",o,l,s,u)),e&&this.input.appendChild(n.createButton("google-plus",o,l,s,u)),r&&this.onFacebookReady().then((function(){try{FB.XFBML.parse()}catch(e){console.error("Failed to execute: FB.XFBML.parse()")}}))}},{key:"updateAlignment",value:function(){switch(this.getProperty("configuration.alignment")){case"center":this.rootNode.setAttribute("data-align","center");break;case"right":this.rootNode.setAttribute("data-align","right");break;case"left":default:this.rootNode.setAttribute("data-align","left")}}},{key:"getAllowedSocialPlatforms",value:function(){var e=[],t=this.getProperty("configuration.hasButtonGooglePlus"),n=this.getProperty("configuration.hasButtonTwitter"),i=this.getProperty("configuration.hasButtonLinkedin"),r=this.getProperty("configuration.hasFacebookLike"),a=this.getProperty("configuration.hasFacebookShare");return t&&e.push(T.Q.GOOGLE_PLUS),i&&e.push(T.Q.LINKEDIN),n&&e.push(T.Q.TWITTER),r&&e.push(T.Q.FACEBOOK_LIKE),a&&e.push(T.Q.FACEBOOK_SHARE),e}},{key:"setAllowedSocialPlatforms",value:function(e){if(e)for(var t=0,n=e.length;t<n;t++)e[t]=~~e[t];e.length?(this.setProperty("configuration.hasButtonGooglePlus",e.indexOf(T.Q.GOOGLE_PLUS)>-1),this.setProperty("configuration.hasButtonLinkedin",e.indexOf(T.Q.LINKEDIN)>-1),this.setProperty("configuration.hasButtonTwitter",e.indexOf(T.Q.TWITTER)>-1),this.setProperty("configuration.hasFacebookLike",e.indexOf(T.Q.FACEBOOK_LIKE)>-1),this.setProperty("configuration.hasFacebookShare",e.indexOf(T.Q.FACEBOOK_SHARE)>-1)):(this.setProperty("configuration.hasButtonGooglePlus",!0),this.setProperty("configuration.hasButtonLinkedin",!0),this.setProperty("configuration.hasButtonTwitter",!0),this.setProperty("configuration.hasFacebookLike",!0),this.setProperty("configuration.hasFacebookShare",!0))}},{key:"onCreated",value:function(){this.updateAlignment(),this.refreshButtons()}},{key:"onFacebookReady",value:function(){return function(e,t){return void 0!==n.facebookSDKPromise?n.facebookSDKPromise:e.Deferred((function(e){t.loadJavascript("//connect.facebook.net/en_US/all.js#xfbml=1&appId=157025404377057").then((function(){e.resolve(!0)})).fail((function(){e.reject(new Error("Failed loading Facebook SDK"))}))})).promise()}(this.getForm().getEngine().getJQuery(),this.getForm().getEngine().getResourceManager())}},{key:"setRendererType",value:function(e){}},{key:"onReset",value:function(){}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_SOCIAL,name:"Social",isContainer:!1,category:"other",keywords:"social share facebook twitter linkedin google plus",icon:"i123-social",isVirtual:!1,i18nName:"edt_UI_control_type_social_name",i18nKeywords:"edt_UI_control_type_social_keywords",index:290,accessibilityFields:T.r.OTHER}}},{key:"createButton",value:function(e,t,n,i,r){var a,o;switch((o=document.createElement("span")).appendChild(document.createTextNode(e)),o.setAttribute("id","social-".concat(e,"-button-acc")),o.style.display="none","facebook-like"!==e?((a=document.createElement("a")).setAttribute("target","_blank"),a.setAttribute("href","javascript:;"),a.setAttribute("data-button-type",e),a.setAttribute("data-role","share-button"),a.setAttribute("aria-labelledby","social-".concat(e,"-button-acc")),a.appendChild(o)):((a=document.createElement("div")).className="fb-like",a.setAttribute("data-layout",i?"button_count":"button"),a.setAttribute("data-action","like"),a.setAttribute("data-show-faces","false"),a.setAttribute("data-share","false"),r&&(a.tabIndex=0)),e){case"google-plus":a.setAttribute("href","https://plus.google.com/share?url=".concat(encodeURIComponent(t)));break;case"twitter":a.setAttribute("href","https://twitter.com/home?status=".concat(encodeURIComponent(t)));break;case"linkedin":a.setAttribute("href","https://www.linkedin.com/shareArticle?mini=true&url=".concat(encodeURIComponent(t),"&title=").concat(encodeURIComponent(n),"&summary=&source="));break;case"facebook-like":a.setAttribute("data-href",t);break;case"facebook-share":a.setAttribute("href","https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(t)))}return a}}]),n}(tn);function hr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(pr,"attributes",{}),v()(pr,"runtime",null),v()(pr,"nodeName","social"),v()(pr,"facebookSDKPromise",void 0);var gr=function(e){g()(n,e);var t=hr(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","starrating-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","starrating-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","starrating-".concat(a,"-instr-acc")),r.input=Bt.createElement(Bt.ELEMENT_TYPE_STAR_RATING),r.input.withHash(a),r.input.setAttribute("data-role","i123-input"),r.rootNode.setAttribute("aria-labelledby","starrating-".concat(a,"-acc ")+"starrating-".concat(a,"-error-acc ")+"starrating-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_STAR_RATING}},{key:"getElementName",value:function(){return"Star rating"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateStarShapeType(),this.updateStarsCount(),this.updateHiddenAttribute(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW?(this.updateDefaultValue(),this.onValueChanged()):this.synchronizeValue(),this.onReadonlyStateChanged()}},{key:"onValueChanged",value:function(){var e=this.input.getValue();this.setProperty("value.value",0===e?null:e),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"int",optional:!0};default:return null}}},{key:"updateStarShapeType",value:function(){switch(this.getProperty("configuration.displayAs")){case T.R.ADULTS:this.input.withStarShapeType("adults");break;case T.R.CHILDREN:this.input.withStarShapeType("children");break;case T.R.STARS:default:this.input.withStarShapeType("stars")}}},{key:"updateStarsCount",value:function(){var e=this.getProperty("configuration.starsCount");null===e&&(e=5),e<1&&(e=1),e>10&&(e=10),this.input.withMinValue(0).withMaxValue(e),this.input.onAccessibilitySettingsChanged()}},{key:"updateDefaultValue",value:function(){this.input.setValue(this.getProperty("configuration.defaultValue"))}},{key:"onReset",value:function(){this.updateDefaultValue(),this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_star_rating_name")),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){this.input.setReadOnly(!!this.getProperty("options.readOnly"))}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_STAR_RATING,name:"Star Rating",isContainer:!1,category:"advanced",keywords:"star rating rate opinion",icon:"i123-star_rating",isVirtual:!1,i18nName:"edt_UI_control_type_star_rating_name",i18nKeywords:"edt_UI_control_type_star_rating_keywords",index:200,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);function _r(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(gr,"attributes",{}),v()(gr,"runtime",null),v()(gr,"nodeName","star-rating");var fr=function(e){g()(n,e);var t=_r(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),v()(c()(r),"linkElement",void 0),v()(c()(r),"additionalLabelElement",void 0),v()(c()(r),"checkboxDecorator",void 0);var a="tos_".concat(String(~~(1e6*Math.random())),"_").concat(String(~~(1e6*Math.random())),"_").concat(+new Date),s=r.getHash();return r.input=document.createElement("input"),r.input.setAttribute("type","checkbox"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("data-index","0"),r.input.setAttribute("id",a),r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","tos-".concat(s,"-acc")),r.linkElement=document.createElement("a"),r.linkElement.setAttribute("data-role","tos-link"),r.linkElement.setAttribute("href","javascript:;"),r.linkElement.setAttribute("rel","nofollow"),r.additionalLabelElement=document.createElement("label"),r.additionalLabelElement.setAttribute("data-role","tos-label"),r.additionalLabelElement.setAttribute("id","tos-checkbox-".concat(s,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","tos-".concat(s,"-error-acc")),r.checkboxDecorator=document.createElement("label"),r.checkboxDecorator.setAttribute("data-role","checkbox"),r.checkboxDecorator.setAttribute("for",a),r.checkboxDecorator.setAttribute("aria-labelledby","tos-".concat(s,"-acc tos-").concat(s,"-error-acc tos-checkbox-").concat(s,"-acc")),r.checkboxDecorator.setAttribute("role","checkbox"),r.checkboxDecorator.setAttribute("aria-checked","false"),r.checkboxDecorator.tabIndex=0,r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"onCreated",value:function(){var e;this.updateLabelText(),this.updateErrorsText(),this.updateTOSAdditionalLabelText(),this.updateRequiredState(),this.updateHiddenAttribute(),this.updateDefaultValue(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():((e=this).linkElement.addEventListener("click",(function(){e.onClick()}),!1),this.onValueChanged()),this.onReadonlyStateChanged()}},{key:"getProperty",value:function(e){switch(e){case"configuration.agreementLabelAdditionalText":var t=this.getId();if(t){var i="terms_of_service_option_label_".concat(t),r=this.getForm().getEngine().getI18n().translateText(i);if(r&&r!==i)return r}return p()(E()(n.prototype),"getProperty",this).call(this,e);default:return p()(E()(n.prototype),"getProperty",this).call(this,e)}}},{key:"updateTOSAdditionalLabelText",value:function(){var e=this.getForm().getEngine().getI18n().translateText("terms_of_service_option_label_".concat(this.getId())),t=String(this.getProperty("configuration.agreementLabelAdditionalText")||""),n=e||t;this.getForm().getEngine().getLoader().getLoaderType()==T.v.EDIT&&(n=t);for(var i=/^([\s\S]+)?<link>([\s\S]+)?<\/link>([\s\S]+)?$/.exec(n);this.additionalLabelElement.firstChild;)this.additionalLabelElement.removeChild(this.additionalLabelElement.firstChild);if(this.additionalLabelElement.appendChild(this.input),this.additionalLabelElement.appendChild(this.checkboxDecorator),i)i[1]&&(this.additionalLabelElement.appendChild(document.createElement("span")).textContent=i[1]),i[2]&&(this.linkElement.textContent=i[2],this.additionalLabelElement.appendChild(this.linkElement)),i[3]&&(this.additionalLabelElement.appendChild(document.createElement("span")).textContent=i[3]);else{var r=document.createElement("label");r.textContent=String(n||""),this.additionalLabelElement.appendChild(r)}}},{key:"updateDefaultValue",value:function(){this.setProperty("value.value",!!this.getProperty("configuration.defaultValue")),this.synchronizeValue()}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_TERMS_OF_SERVICE}},{key:"getElementName",value:function(){return"Terms of service"}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"boolean",optional:!0};default:return null}}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.additionalLabelElement,width:T.y.FULL}]}]}},{key:"onValueChanged",value:function(){var e=this.input.checked;this.setProperty("value.value",null!==e&&e),e?this.checkboxDecorator.setAttribute("aria-checked","true"):this.checkboxDecorator.setAttribute("aria-checked","false"),this.isAttached()&&this.getForm().trigger("click",this)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"showText",value:function(){var e=this.getForm().getEngine().getI18n().translateText("terms_of_service_html_markup_".concat(this.getId())),t=this.getProperty("configuration.agreementHTMLMarkup"),n=e||t,i=~~this.getProperty("configuration.popupWidthInPixels"),r=~~this.getProperty("configuration.popupHeightInPixels");if("string"===typeof n&&""!==n){i<=0&&(i=500),r<=0&&(r=500);var a=this.getForm().getEngine().getJQuery(),o=a(window).width(),s=a(window).height();o<i&&(i=o-20),s<r&&(r=s-20),function(e,t,a){if(e){var o=t.getForm().getEngine().getI18n().translateText("textdef_232")||"Terms of Service",s=e.createDialog(o,[{type:qe.c.OK,callback:function(){s.close()}}],{width:"".concat(i,"px"),height:"".concat(r,"px")});a(s.body).addClass("html-content"),s.body.innerHTML='<div class="ui-body-inner">'.concat(n,"</div>")}}(this.getForm().getEngine().getLoader().getUI(),this,this.getForm().getEngine().getJQuery())}}},{key:"openURL",value:function(){var e=this,t=this.getProperty("configuration.url");t&&(this.linkElement.setAttribute("href",t),this.linkElement.setAttribute("target","_blank"),Bt.getJQuery()(this.linkElement).trigger("click"),setTimeout((function(){e.linkElement.removeAttribute("href"),e.linkElement.removeAttribute("target")}),1e3))}},{key:"onClick",value:function(){switch(this.getProperty("configuration.linkBehaviour")){case"show_text":this.showText();break;case"open_url":this.openURL()}}},{key:"onReset",value:function(){var e=this.getProperty("configuration.defaultValue");this.input.checked=!!e,this.onValueChanged()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_terms_of_service_name")),this.updateLabelText(),this.setProperty("configuration.agreementHTMLMarkup",this.getForm().getEngine().getI18n().translateText("func_editTos")),this}},{key:"setupI18n",value:function(){return this.updateTOSAdditionalLabelText(),p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("configuration.agreementLabelAdditionalText")||"",i=this.getProperty("configuration.agreementHTMLMarkup")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"terms_of_service_option_label_".concat(this.getId()),sourceText:n}),i&&e.push({key:"terms_of_service_html_markup_".concat(this.getId()),sourceText:i}),e}},{key:"onReadonlyStateChanged",value:function(){this.input.disabled=!!this.getProperty("options.readOnly")}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_TERMS_OF_SERVICE,name:"Terms of Service",isContainer:!1,category:"advanced",keywords:"terms of service legal",icon:"i123-editor_field_termsofservice",isVirtual:!1,i18nName:"edt_UI_control_type_terms_of_service_name",i18nKeywords:"edt_UI_control_type_terms_of_service_keywords",index:210,accessibilityFields:T.r.ERROR_NODE}}}]),n}(tn);function yr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(fr,"attributes",{}),v()(fr,"runtime",null),v()(fr,"nodeName","terms-of-service");var Er=function(e){g()(n,e);var t=yr(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","textarea-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","textarea-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","textarea-".concat(a,"-instr-acc")),r.input=document.createElement("textarea"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","textarea-".concat(a,"-acc ")+"textarea-".concat(a,"-error-acc ")+"textarea-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_TEXTAREA}},{key:"getElementName",value:function(){return"Long text"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateDefaultValue(),this.updateShowInstructionsOnClick(),this.validateValue(),this.updateHiddenAttribute(),this.setHeightInRows(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.onReadonlyStateChanged()}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.validateValue(),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateDefaultValue",value:function(){var e=this.getProperty("configuration.defaultValue")||"",t=e&&e.trim();this.setProperty("value.value",""===e?null:t),this.setProperty("configuration.defaultValue",t),this.synchronizeValue()}},{key:"validateValue",value:function(){var e=this.getProperty("configuration.minLength"),t=this.getProperty("configuration.maxLength"),n=this.getProperty("configuration.minNumberOfWords"),i=this.getProperty("configuration.maxNumberOfWords"),r=this.getProperty("value.value")||"",a=jt.getTextNumberOfWords(this.getProperty("value.value"));r?(null!=t&&t>0&&(r.length>t?this.addError(Dt.ERR_TOO_MANY_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_71",String(t))||"You have more characters than allowed"):this.removeError(Dt.ERR_TOO_MANY_CHARACTERS)),null!=e&&e>0&&(r.length<e?this.addError(Dt.ERR_TOO_FEW_CHARACTERS,this.getForm().getEngine().getI18n().translateText("textdef_70",String(e))||"You have fewer characters than allowed"):this.removeError(Dt.ERR_TOO_FEW_CHARACTERS)),null!=i&&i>0&&(a>i?this.addError(Dt.ERR_TOO_MANY_WORDS,this.getForm().getEngine().getI18n().translateText("textdef_94",String(i))||"You have more words than allowed"):this.removeError(Dt.ERR_TOO_MANY_WORDS)),null!=n&&n>0&&(a<n?this.addError(Dt.ERR_TOO_FEW_WORDS,this.getForm().getEngine().getI18n().translateText("textdef_93",String(n))||"You have fewer words than allowed"):this.removeError(Dt.ERR_TOO_FEW_WORDS))):(this.removeError(Dt.ERR_TOO_MANY_CHARACTERS),this.removeError(Dt.ERR_TOO_FEW_CHARACTERS),this.removeError(Dt.ERR_TOO_MANY_WORDS),this.removeError(Dt.ERR_TOO_FEW_WORDS))}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.setValue({value:this.getProperty("configuration.defaultValue")}),this.validateValue()}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_textarea_name")),this.updateLabelText(),this}},{key:"setHeightInRows",value:function(){this.input.setAttribute("rows",this.hasProperty("size.heightInRows")&&this.getProperty("size.heightInRows")?this.getProperty("size.heightInRows"):n.DEFAULT_INPUT_HEIGHT_IN_ROWS)}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.setReadonly(e)}},{key:"isReadonly",value:function(){return this.input.readOnly}},{key:"setReadonly",value:function(e){return this.input.readOnly=e,this}},{key:"emulateUserInput",value:function(){var e=this;!function(t){t([e.input]).trigger("input")}(this.getForm().getEngine().getJQuery())}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_TEXTAREA,name:"Long Text",isContainer:!1,category:"basic",keywords:"long text input textbox open textarea",icon:"i123-editor_field_longtext",isVirtual:!1,i18nName:"edt_UI_control_type_textarea_name",i18nKeywords:"edt_UI_control_type_textarea_keywords",index:20,accessibilityFields:T.r.ERROR_NODE}}}]),n}(tn);function mr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Er,"DEFAULT_INPUT_HEIGHT_IN_ROWS",3),v()(Er,"attributes",{}),v()(Er,"runtime",null),v()(Er,"nodeName","textarea");var vr=function(e){g()(n,e);var t=mr(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0);var a=r.getHash(),s=r.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","time-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","time-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","time-".concat(a,"-instr-acc")),r.input=Bt.createElement(Bt.ELEMENT_TYPE_TIME),r.input.setAccessibilityEnabled(s),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-live","assertive"),r.input.setAttribute("role","alert"),r.rootNode.setAttribute("aria-labelledby","time-".concat(a,"-acc ")+"time-".concat(a,"-error-acc ")+"time-".concat(a,"-instr-acc ")+"time-".concat(a,"-hour ")+"time-".concat(a,"-minute ")+"time-".concat(a,"-second ")+"time-".concat(a,"-am-pm")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"setTimeControlOptions",value:function(){this.input.withHash(this.getHash()),this.input.setFormat("12"===this.getProperty("configuration.timeFormat")?Ee.VALIDATOR_TYPE_TIME_AMPM:Ee.VALIDATOR_TYPE_TIME)}},{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_TIME}},{key:"getElementName",value:function(){return"Time"}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateInstructionsText(),this.updateErrorsText(),this.updateRequiredState(),this.setTimeControlOptions(),this.updateShowInstructionsOnClick(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.updateHiddenAttribute(),this.loadDefaultTimeValueIntoForm(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){var e=this.getForm().getEngine().getValidator();return[e.getValidatorById(Ee.VALIDATOR_TYPE_TIME),e.getValidatorById(Ee.VALIDATOR_TYPE_TIME_AMPM)]}},{key:"getStringValue",value:function(){return this.input.getValue()}},{key:"setStringValue",value:function(e){try{this.input.setValue(e)}catch(t){this.input.setDateValue(null)}this.onValueChanged()}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.stringValue",type:"string",optional:!0};default:return null}}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"synchronizeValue",value:function(){var e,t,n,i,r=this.getProperty("value.value");null===r?e=null:(e=new Date,r-=3600*(t=Math.floor(r/3600)),r-=60*(n=Math.floor(r/60)),i=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?r:r-r%60,e.setDate(1),e.setMonth(0),e.setFullYear(1970),e.setHours(t),e.setMinutes(n),e.setSeconds(i),e.setMilliseconds(0)),this.input.setDateValue(e),this.updateErrorState(this.input.getInputErrorState())}},{key:"onValueChanged",value:function(){var e=this.input.getDateValue();if(null===e)this.setProperty("value.value",null);else{var t=3600*e.getHours()+60*e.getMinutes()+e.getSeconds();this.setProperty("value.value",Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?t:t-t%60)}this.isAttached()&&this.getForm().trigger("input",this),this.updateErrorState(this.input.getInputErrorState())}},{key:"loadDefaultTimeValueIntoForm",value:function(){var e="",t=this.hasProperty("configuration.defaultValue")?this.getProperty("configuration.defaultValue"):void 0;"string"!==typeof t&&(e=this.convertTimeSecondsToString(t)),t||0===t?("number"!==typeof t||Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL||(t-=t%60),this.input.setDateValue(this.getForm().getEngine().getTimeUtils().stringToTime(e||String(t))),this.onValueChanged()):this.input.setDateValue(null)}},{key:"convertTimeSecondsToString",value:function(e){var t,n=this.hasProperty("configuration.timeFormat")?this.getProperty("configuration.timeFormat"):void 0;if(n)switch(n){case"24":n=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?"%H:%i:%S":"%H:%i";break;case"12":default:n=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?"%h:%i:%S %p":"%h:%i %p"}return t=Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?0:e%60,this.getForm().getEngine().getTimeUtils().intToTime(e-t,n)}},{key:"onReset",value:function(){this.loadDefaultTimeValueIntoForm()}},{key:"updateErrorState",value:function(e){switch(e){case T.x.ERROR:this.addError(Dt.ERR_TIME_NOT_COMPLETE,this.getForm().getEngine().getI18n().translateText("textdef_222")||"Please fill in both hour and minutes");break;case T.x.UNFILLED:case T.x.FILLED:default:this.removeError(Dt.ERR_TIME_NOT_COMPLETE)}}},{key:"onBlur",value:function(){this.updateErrorState(this.input.getInputErrorState())}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_time_name")),this.updateLabelText(),this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.input.setReadOnly(e)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_TIME,name:"Time",isContainer:!1,category:"advanced",keywords:"time date hour minute",icon:"i123-time",isVirtual:!1,i18nName:"edt_UI_control_type_time_name",i18nKeywords:"edt_UI_control_type_time_keywords",index:150,accessibilityFields:T.r.ERROR_NODE+T.r.ROOT_NODE}}}]),n}(tn);function Tr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(vr,"attributes",{}),v()(vr,"runtime",null),v()(vr,"nodeName","time");var Or=function(e){g()(n,e);var t=Tr(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"input",void 0),v()(c()(r),"hasSuggestions",!0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","website-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","website-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("id","website-".concat(a,"-instr-acc")),r.input=document.createElement("input"),r.input.setAttribute("type","text"),r.input.setAttribute("data-role","i123-input"),r.input.setAttribute("aria-labelledby","website-".concat(a,"-acc ")+"website-".concat(a,"-error-acc ")+"website-".concat(a,"-instr-acc")),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_WEBSITE}},{key:"getElementName",value:function(){return"Website"}},{key:"getInputDOMNodes",value:function(){return[{inputs:[{input:this.input,width:T.y.FULL}]}]}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateHiddenAttribute(),this.updateDefaultValue(),this.initializeSuggestions(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT?this.synchronizeValue():this.onValueChanged(),this.onReadonlyStateChanged()}},{key:"getSupportedValidators",value:function(){return[this.getForm().getEngine().getValidator().getValidatorById(Ee.VALIDATOR_TYPE_URL_WEB_PAGE)]}},{key:"onValueChanged",value:function(){var e=this.input.value;this.setProperty("value.value",""===e?null:e),this.isAttached()&&this.getForm().trigger("input",this)}},{key:"updateDefaultValue",value:function(){var e=this.getProperty("configuration.defaultValue");this.setProperty("value.value",""===e?null:e),this.synchronizeValue()}},{key:"validateValue",value:function(){var e=this.getForm().getEngine().getValidator(),t=this.getProperty("value.value")||"";null!==t&&""!==t?t&&!e.validate(t,Ee.VALIDATOR_TYPE_URL_WEB_PAGE)?this.addError(Dt.ERR_INVALID_URL,"".concat(this.getForm().getEngine().getI18n().translateText("textdef_5"),": ").concat(this.getForm().getEngine().getI18n().translateText("textdef_50"))||"The URL is invalid."):this.hasError(Dt.ERR_INVALID_URL)&&this.removeError(Dt.ERR_INVALID_URL):this.removeError(Dt.ERR_INVALID_URL)}},{key:"synchronizeValue",value:function(){jt.synchronizeControlValue(this.input,this.getProperty("value.value"))}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"value.value",type:"string",optional:!0};default:return null}}},{key:"onReset",value:function(){this.setValue({value:this.getProperty("configuration.defaultValue")})}},{key:"setupDefaults",value:function(){return this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_website_name")),this.updateLabelText(),this}},{key:"onBlur",value:function(){this.validateValue(),this.checkIfElementValueIsSynchronized()}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"",n=this.getProperty("instructions.text")||"";return t&&e.push({key:"control_label_".concat(this.getId()),sourceText:t}),n&&e.push({key:"control_instructions_".concat(this.getId()),sourceText:n}),e}},{key:"getSuggestionsVisibility",value:function(){return null!==(this.getProperty("options.suggestions")||null)}},{key:"setSuggestionsVisibility",value:function(e){e?this.setProperty("options.suggestions",this.getProperty("options.suggestions")||""):this.setProperty("options.suggestions",null)}},{key:"initializeSuggestions",value:function(){var e=this;this.getForm().getEngine().on("compute-form-rules-done",(function(){setTimeout((function(){e.getSuggestionsVisibility()?e.suggestionsDropDown(Bt.getJQuery()):e.getForm().getEngine().getJQuery()(e.input).parent().find("[data-autocomplete-items]").remove()}),1e3)}))}},{key:"suggestionsDropDown",value:function(e){var t,i=this,r=this.getProperty("options.suggestions").split("\n"),a=this.input;!function(o){function s(t){a.value=t,o.onValueChanged(),e(a).trigger("input"),e(a).trigger("change")}function l(){for(var t=e(a).parent().find("[data-autocomplete-items]"),n=0,i=t.length;n<i;n++)t[n].parentNode.removeChild(t[n])}function u(e,t){var n=document.createElement("div"),i=document.createElement("strong");return i.appendChild(document.createTextNode(t.substr(0,e.length))),n.appendChild(i),n.appendChild(document.createTextNode(t.substr(e.length))),n.setAttribute("data-value",String(t||"")),n}function c(e){if(0===e.length)return!1;!function(e){for(var t=0;t<e.length;t++)e[t].removeAttribute("data-autocomplete-active")}(e),t>=e.length&&(t=0),t<0&&(t=e.length-1),e[t].setAttribute("data-autocomplete-active","")}function d(i){if(null!==o.getProperty("options.suggestions")){n.initialize(),l(),t=-1;for(var c=function(){var t=document.createElement("div");t.setAttribute("data-autocomplete-items",""),e(t).width("".concat(a.offsetWidth,"px"));var n=a.getBoundingClientRect();return e(t).css({top:"".concat(~~n.top+~~n.height,"px")}),e(t).on("mousedown","> div",(function(){s(e(this).attr("data-value")),l()})),t}(),d=!1,p=0,h=r.length;p<h;p++)if(r[p].substr(0,i.length).toUpperCase()===i.toUpperCase()){var g=u(i,r[p]);e(c).append(g),d=!0}d?e(a).parent().append(c):e(c).remove()}}e(i.input).on("input",(function(){d(this.value)})),e(i.input).on("click",(function(e){e.stopPropagation(),d(this.value)})),e(a).on("keydown",(function(n){var i=e(a).parent().find("[data-autocomplete-items]").find("div");switch(n.keyCode){case at.KEY_DOWN:t++,c(i),n.preventDefault();break;case at.KEY_UP:t--,c(i),n.preventDefault();break;case at.KEY_ENTER:t>-1&&i.length&&(s(i[t].getAttribute("data-value")),l()),n.preventDefault();break;case at.KEY_ESC:l(),n.preventDefault()}})),e(i.input).on("blur",(function(){l()}))}(this)}},{key:"onReadonlyStateChanged",value:function(){var e=this.getProperty("options.readOnly");this.setReadonly(e)}},{key:"isReadonly",value:function(){return this.input.readOnly}},{key:"setReadonly",value:function(e){return this.input.readOnly=e,this}}],[{key:"initialize",value:function(){Ei.initialize()}},{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_WEBSITE,name:"Website",isContainer:!1,category:"advanced",keywords:"website url link",icon:"i123-editor_field_website",isVirtual:!1,i18nName:"edt_UI_control_type_website_name",i18nKeywords:"edt_UI_control_type_website_keywords",index:170,accessibilityFields:T.r.ERROR_NODE}}}]),n}(rn);function Cr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Or,"attributes",{}),v()(Or,"runtime",null),v()(Or,"nodeName","website");var Nr=function(e){g()(n,e);var t=Cr(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"widgetIframeNode",void 0),v()(c()(r),"isWidgetLoaded",!1),v()(c()(r),"widgetIconNode",void 0),r.widgetIframeNode=document.createElement("iframe"),r.getRootNode().appendChild(r.widgetIframeNode),r.widgetIframeNode.setAttribute("data-widget-iframe","1"),r.widgetIframeNode.setAttribute("id","widget-iframe-"+r.getHash()),r.widgetIconNode=document.createElement("div"),r.widgetIconNode.setAttribute("data-widget-icon-container","1"),r.getRootNode().appendChild(r.widgetIconNode),r.widgetIframeNode.addEventListener("load",(function(){r.widgetIframeNode.getAttribute("src")&&(r.getRootNode().removeAttribute("data-widget-placeholder"),r.isWidgetLoaded=!0)}),!0),r}return l()(n,[{key:"getPropertyDescriptorByInputIndex",value:function(e){return null}},{key:"getResizingCapability",value:function(){return this.isWidgetLoaded?T.K.ALL:T.K.LEFT_AND_RIGHT}},{key:"setRendererType",value:function(e){}},{key:"isRenderingSupported",value:function(){return!1}},{key:"onCreated",value:function(){this.generateProperLinkForIframe()}},{key:"updateIframeOptions",value:function(e){e?(this.widgetIframeNode.setAttribute("src",e),this.getRootNode().removeAttribute("data-widget-placeholder"),this.isWidgetLoaded=!0):(this.getRootNode().setAttribute("data-widget-placeholder","1"),this.isWidgetLoaded=!1),this.widgetIframeNode.setAttribute("frameborder","0")}}]),n}(tn);function Ar(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Nr,"attributes",{}),v()(Nr,"runtime",null);var br=function(e){g()(n,e);var t=Ar(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),n.instanceID++,r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_WIDGET_FACEBOOK}},{key:"getElementName",value:function(){return"Facebook"}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_WIDGET_FACEBOOK,name:"Facebook",isContainer:!1,category:"other",keywords:"widget facebook post page embed",icon:"i123-field_facebook",isVirtual:!1,i18nName:"edt_UI_control_type_widget_facebook_name",i18nKeywords:"edt_UI_control_type_widget_facebook_keywords",index:250,accessibilityFields:T.r.NONE}}}]),l()(n,[{key:"setupDefaults",value:function(){return this.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_facebook_name")," ").concat(n.instanceID)),this}},{key:"generateProperLinkForIframe",value:function(){var e=this.getForm().getEngine().getValidator().validateEmbeddableFacebookURL(this.getProperty("configuration.url")),t=null;null!==e&&(t=jt.getURLEmbedIframeSource(e)),t&&T.W.FACEBOOK_PAGE===e.type?this.widgetIframeNode.setAttribute("data-facebook-page","1"):this.widgetIframeNode.removeAttribute("data-facebook-page"),p()(E()(n.prototype),"updateIframeOptions",this).call(this,t)}},{key:"cloneNode",value:function(e){var t=p()(E()(n.prototype),"cloneNode",this).call(this,!!e);return t.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_facebook_name")," ").concat(n.instanceID)),t}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){return[]}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"configuration.url",type:"string",optional:!0};default:return null}}}]),n}(Nr);function Rr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(br,"instanceID",0),v()(br,"nodeName","widget-facebook");var Ir=function(e){g()(n,e);var t=Rr(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),n.instanceID++,r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_WIDGET_PDF}},{key:"getElementName",value:function(){return"PDF embed"}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_WIDGET_PDF,name:"PDF embed",isContainer:!1,category:"other",keywords:"widget pdf document embed",icon:"i123-field_pdfembed",isVirtual:!1,i18nName:"edt_UI_control_type_widget_pdf_name",i18nKeywords:"edt_UI_control_type_widget_pdf_keywords",index:260,accessibilityFields:T.r.NONE}}}]),l()(n,[{key:"setupDefaults",value:function(){return this.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_pdf_name")," ").concat(n.instanceID)),this}},{key:"generateProperLinkForIframe",value:function(){var e=this.getForm().getEngine().getValidator().validateEmbeddablePdfURL(this.getProperty("configuration.url")),t=null;Nt.isMobile()&&e&&(e.type=T.W.MOBILE_EMBED),null!==e&&(t=jt.getURLEmbedIframeSource(e),t=Object(fe.c)(t)),p()(E()(n.prototype),"updateIframeOptions",this).call(this,t)}},{key:"cloneNode",value:function(e){var t=p()(E()(n.prototype),"cloneNode",this).call(this,!!e);return t.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_pdf_name")," ").concat(n.instanceID)),t}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"configuration.url",type:"string",optional:!0};default:return null}}},{key:"enumerateTranslations",value:function(){return[]}}]),n}(Nr);function Pr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ir,"instanceID",0),v()(Ir,"nodeName","widget-pdf");var Sr=function(e){g()(n,e);var t=Pr(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),n.instanceID++,r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTROL_TYPE_WIDGET_VIDEO}},{key:"getElementName",value:function(){return"Video"}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTROL_TYPE_WIDGET_VIDEO,name:"Video",isContainer:!1,category:"other",keywords:"widget video movie audio music embed Youtube Vimeo TED NFB Kickstarter Dailymotion Twitch Soundcloud Mixcloud Wordpress TV",icon:"i123-field_video",isVirtual:!1,i18nName:"edt_UI_control_type_widget_video_name",i18nKeywords:"edt_UI_control_type_widget_video_keywords",index:240,accessibilityFields:T.r.NONE}}}]),l()(n,[{key:"setupDefaults",value:function(){return this.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_video_name")," ").concat(n.instanceID)),this}},{key:"generateProperLinkForIframe",value:function(){var e=this.getForm().getEngine().getValidator().validateEmbeddableVideoURL(this.getProperty("configuration.url")),t=null;null!==e&&(t=jt.getURLEmbedIframeSource(e)),p()(E()(n.prototype),"updateIframeOptions",this).call(this,t)}},{key:"cloneNode",value:function(e){var t=p()(E()(n.prototype),"cloneNode",this).call(this,!!e);return t.setProperty("configuration.fieldName","".concat(this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_widget_video_name")," ").concat(n.instanceID)),t}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"enumerateTranslations",value:function(){return[]}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"configuration.url",type:"string",optional:!0};default:return null}}}]),n}(Nr);v()(Sr,"instanceID",0),v()(Sr,"nodeName","widget-video");var Dr=function(){function e(t,n,i,r){o()(this,e),v()(this,"app",void 0),v()(this,"jq",void 0),v()(this,"notificationsAreaContainer",void 0),v()(this,"mainApplicationNode",void 0),this.app=t,this.jq=n,this.notificationsAreaContainer=i,this.mainApplicationNode=r}return l()(e,[{key:"alert",value:function(e,t,n,i){var r=this.createDialog(String(e||this.app.getI18n().translateText("myforms_UI_dlg_title_ALERT")),[{type:qe.c.OK,callback:function(e,t){n&&A()(n,Function)&&n(),t.close()}}],{width:i&&i.width?i.width:"500px",height:i&&i.height?i.height:void 0});r.body.textContent=String(t||"")||this.app.getI18n().translateText("myforms_UI_dlg_title_ALERT"),r.body.setAttribute("data-dialog-role","system-dialog")}},{key:"prompt",value:function(e,t,n,i){var r=this.createDialog(String(e||this.app.getI18n().translateText("myforms_UI_dlg_title_QUESTION")),[{type:qe.c.YES,callback:function(e,t){n&&A()(n,Function)&&n(),t.close()}},{type:qe.c.NO,callback:function(e,t){i&&A()(i,Function)&&(i(),qe.c.DOWNLOAD),t.close()}}],{width:"600px"});r.body.textContent=String(t||"")||this.app.getI18n().translateText("myforms_UI_dlg_title_QUESTION"),r.body.setAttribute("data-dialog-role","system-dialog")}},{key:"markNotificationTooltipAsClosed",value:function(e){var t=JSON.parse(localStorage.getItem("closed_notification_tooltips")||"{}");t[e]=1,localStorage.setItem("closed_notification_tooltips",JSON.stringify(t))}},{key:"isNotificationTooltipMarkedAsClosed",value:function(e){return!!JSON.parse(localStorage.getItem("closed_notification_tooltips")||"{}")[e]}},{key:"createNotificationTooltip",value:function(t,n){return function(i){var r=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");r.tabIndex=0,r.setAttribute("data-ui-tooltip-modal","1"),a.setAttribute("data-ui-tooltip-dialog","1"),a.setAttribute("data-placement",e.getNotificationTooltipPlacementAttribute(n.placement)),a.setAttribute(e.getNotificationTooltipStylingAttribute(n.tooltipType),"1"),o.setAttribute("data-ui-body","1"),l.setAttribute("data-ui-buttons","1"),1===t.length&&l.setAttribute("data-single-button-tooltip","1"),2===t.length&&l.setAttribute("data-two-buttons-tooltip","1"),r.appendChild(a),a.appendChild(o),o.appendChild(s);for(var u=!1,c={close:function(){u||(r.parentNode&&r.parentNode.removeChild(r),u=!0,n&&n.onCloseCallback&&n.onCloseCallback(c))},show:function(){a.removeAttribute("data-hide-tooltip")},hide:function(){a.setAttribute("data-hide-tooltip","")},persistentClose:function(){u||(r.parentNode&&r.parentNode.removeChild(r),u=!0,window.CFTracker&&window.CFTracker.event("tooltip_dismissed_".concat(n.tooltipId)),n&&n.tooltipId&&i.markNotificationTooltipAsClosed(n.tooltipId),n&&n.onCloseCallback&&n.onCloseCallback(c))},tooltip:s,body:o,tooltipId:n.tooltipId||null},d=0,p=t.length;d<p;d++)!function(t){var i=document.createElement("button");i.innerHTML=t.html||(t.i18nKey&&this.app.getI18n().translateText(t.i18nKey)!==t.i18nKey?this.app.getI18n().translateText(t.i18nKey):t.text),i.setAttribute(e.getNotificationTooltipStylingAttribute(n.tooltipType),"1"),i.onclick=function(){t.callback(c)},l.appendChild(i)}(t[d]);return a.appendChild(l),n&&(n.width&&(a.style.width=n.width),n.height&&(a.style.height=n.height)),n&&n.tooltipId&&i.isNotificationTooltipMarkedAsClosed(n.tooltipId)?setTimeout((function(){c.close()}),500):document.body.appendChild(r),r.focus(),c}(this)}},{key:"createDialog",value:function(t,n,i){return function(r,a){var o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div"),u=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),p=document.createElement("div");o.tabIndex=0,o.className="ui-modal",s.className="ui-dialog",l.className="ui-titlebar",l.textContent=t,u.className="ui-titlebody",d.className="ui-body",p.className="ui-buttons bootstrap-iso",c.className="ui-close i123-close",o.appendChild(s),l.appendChild(u),l.appendChild(c),s.appendChild(l),s.appendChild(d);var h=!1;function g(e){var t;e.preventDefault(),e.stopPropagation(),a(p).find("> button").each((function(){switch(parseInt(a(this).attr("data-role").replace(/^button-type-/,""))){case qe.c.OK:case qe.c.YES:case qe.c.SAVE:case qe.c.FORM_MIGRATE:t||(t=this)}})),t&&a(t).click()}var _={close:function(){h||(a(d).find("form").off("submit",g),o.parentNode.removeChild(o),h=!0)},body:d,titlebody:u,dialog:s,setHTML:function(e){d.innerHTML=e,a(d).find("form").on("submit",g)},clearInlineErrors:function(){a(d).find("label.error").text("")},hide:function(){a(o).addClass("hidden")},show:function(){a(o).removeClass("hidden")},isClosed:function(){return h}};c.onclick=function(){if(i&&i.onCloseButtonClick)try{i.onCloseButtonClick()}catch(e){}_.close()},o.addEventListener("keyup",(function(e){27==(e.keyCode||e.charCode)&&(_.close(),i&&i.onCloseButtonClick&&i.onCloseButtonClick())}),!1);for(var f=0,y=n.length;f<y;f++)!function(t){var n=document.createElement("button");n.textContent=r.getDialogButtonLabel(t.type),p.appendChild(n),n.setAttribute("data-role","button-type-".concat(t.type)),n.className="btn ".concat(e.getDialogButtonClass(t.type)),n.onclick=function(){t.callback(t.type,_)}}(n[f]);return s.appendChild(p),i&&(i.width&&(s.style.width=i.width),i.height&&(s.style.height=i.height)),document.body.appendChild(o),o.focus(),o.addEventListener("keydown",(function(e){var t=e.target||e.srcElement;t&&-1===["input","select","textarea"].indexOf(t.nodeName.toLowerCase())&&(t.hasAttribute("data-allow-keyboard")||e.stopPropagation())}),!0),o.addEventListener("keypress",(function(e){var t=e.target||e.srcElement;t&&-1===["input","select","textarea"].indexOf(t.nodeName.toLowerCase())&&e.stopPropagation()}),!0),o.addEventListener("keyup",(function(e){var t=e.target||e.srcElement;t&&-1===["input","select","textarea"].indexOf(t.nodeName.toLowerCase())&&e.stopPropagation()}),!0),_}(this,this.jq)}},{key:"getDialogButtonLabel",value:function(e){switch(e){case qe.c.OK:return this.app.getI18n().translateText("myforms_UI_btn_OK");case qe.c.YES:return this.app.getI18n().translateText("myforms_UI_btn_YES");case qe.c.ABORT:return this.app.getI18n().translateText("myforms_UI_btn_ABORT");case qe.c.RETRY:return this.app.getI18n().translateText("myforms_UI_btn_RETRY");case qe.c.CANCEL:return this.app.getI18n().translateText("myforms_UI_btn_CANCEL");case qe.c.IGNORE:return this.app.getI18n().translateText("myforms_UI_btn_IGNORE");case qe.c.NO:return this.app.getI18n().translateText("myforms_UI_btn_NO");case qe.c.SAVE:return this.app.getI18n().translateText("myforms_UI_btn_SAVE");case qe.c.CHANGE:return this.app.getI18n().translateText("myforms_UI_btn_CHANGE");case qe.c.DELETE:return this.app.getI18n().translateText("myforms_UI_btn_DELETE");case qe.c.DOWNLOAD:return this.app.getI18n().translateText("myforms_UI_btn_DOWNLOAD");case qe.c.CLOSE:return this.app.getI18n().translateText("myforms_UI_btn_CLOSE");case qe.c.ENABLE_COMPLIANCE:return this.app.getI18n().translateText("myformsHipaaChangeStatusTitle0");case qe.c.DISABLE_COMPLIANCE:return this.app.getI18n().translateText("myformsHipaaChangeStatusTitle1");case qe.c.CREATE:return this.app.getI18n().translateText("applications_UI_btn_CREATE");case qe.c.DONE:return this.app.getI18n().translateText("applications_UI_btn_DONE");case qe.c.TRY_FORM:return this.app.getI18n().translateText("oldEditor_TryFormBtn");case qe.c.NO_THANKS:return this.app.getI18n().translateText("editForm_noThanksButton");case qe.c.UPDATE:return this.app.getI18n().translateText("Update");case qe.c.MAYBE_LATER:return this.app.getI18n().translateText("wix_popupMaybeLater");case qe.c.UPGRADE_NOW:return this.app.getI18n().translateText("LinkUpdateNowTitle");case qe.c.UPGRADE_NOW_PAYWALL:return this.app.getI18n().translateText("paywall_upgrade_button_1");case qe.c.CONTINUE:return this.app.getI18n().translateText("userServeyPopup_continue");case qe.c.KEEP_EDITING_FORM:return this.app.getI18n().translateText("edt_UI_btn_keep_editing_form");case qe.c.CLOSE_EDITOR:return this.app.getI18n().translateText("edt_UI_btn_close_editor");case qe.c.IMPORT:return this.app.getI18n().translateText("edt_UI_btn_import");case qe.c.ADD_DOMAIN:return this.app.getI18n().translateText("js_iep_domainalias05");case qe.c.VALIDATE:return this.app.getI18n().translateText("edt_UI_btn_validate_smtp");case qe.c.FORM_MIGRATE:return"Migrate";case qe.c.UPGRADE_TO_ENTERPRISE:return this.app.getI18n().translateText("paywall_upgrade_button_2");case qe.c.REQUEST_A_DEMO_CORPORATE_PAYWALL:return this.app.getI18n().translateText("paywall_request_a_demo");default:throw new Error("Invalid button type: ".concat(JSON.stringify(e),". Please use one of EDialogButtonType types"))}}},{key:"getCurrentNotification",value:function(){return this.notificationsAreaContainer.firstElementChild}},{key:"createNotification",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qe.d.DEFAULT,r=arguments.length>3?arguments[3]:void 0,a=document.createElement("div");if(a.className="notification",a.innerHTML=n?e.escapeHTML(t):t,r||void 0===r){var o=document.createElement("div");o.className="close",a.appendChild(o)}switch(this.notificationsAreaContainer.innerHTML="",i){case qe.d.DEFAULT:break;case qe.d.ERROR:this.jq(a).prepend('<span class="i123-warning"></span>'),this.jq(a).addClass("ERROR");break;case qe.d.SUCCESS:this.jq(a).prepend('<span class="i123-check"></span>'),this.jq(a).addClass("SUCCESS")}return this.notificationsAreaContainer.appendChild(a),this.jq(this.mainApplicationNode).addClass("with-notification"),a}},{key:"createResponsiveNotification",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qe.d.DEFAULT,r=arguments.length>3?arguments[3]:void 0,a=document.createElement("div"),o=n?e.escapeHTML(t):t;if(a.className="notification",a.innerHTML='<span class="notification-content">'.concat(o,"</span>"),r||void 0===r){var s=document.createElement("div");s.className="close",a.appendChild(s)}switch(this.notificationsAreaContainer.innerHTML="",i){case qe.d.DEFAULT:break;case qe.d.ERROR:this.jq(a).prepend('<span class="i123-warning"></span>'),this.jq(a).addClass("ERROR");break;case qe.d.SUCCESS:this.jq(a).prepend('<span class="i123-check"></span>'),this.jq(a).addClass("SUCCESS")}return this.notificationsAreaContainer.appendChild(a),this.jq(this.mainApplicationNode).addClass("with-notification"),a}},{key:"closeAllNotifications",value:function(){this.jq(this.mainApplicationNode).removeClass("with-notification"),this.notificationsAreaContainer.innerHTML=""}},{key:"getRootNode",value:function(){return this.mainApplicationNode}}],[{key:"getDialogButtonClass",value:function(e){switch(e){case qe.c.OK:case qe.c.YES:case qe.c.SAVE:case qe.c.CHANGE:case qe.c.DOWNLOAD:case qe.c.ENABLE_COMPLIANCE:case qe.c.CREATE:case qe.c.DONE:case qe.c.TRY_FORM:case qe.c.UPDATE:case qe.c.UPGRADE_NOW:case qe.c.CONTINUE:case qe.c.KEEP_EDITING_FORM:case qe.c.IMPORT:case qe.c.ADD_DOMAIN:case qe.c.VALIDATE:case qe.c.FORM_MIGRATE:return"btn-secondary-cta";case qe.c.DELETE:case qe.c.DISABLE_COMPLIANCE:return"btn-secondary-red";case qe.c.UPGRADE_NOW_PAYWALL:case qe.c.UPGRADE_TO_ENTERPRISE:case qe.c.REQUEST_A_DEMO_CORPORATE_PAYWALL:return"btn-upgrade";default:return"btn-outline"}}},{key:"getNotificationTooltipStylingAttribute",value:function(e){switch(e){case qe.f.WARNING:return"data-styling-warning";case qe.f.ERROR:return"data-styling-error";case qe.f.DEFAULT:default:return"data-styling-regular"}}},{key:"getNotificationTooltipPlacementAttribute",value:function(e){switch(e){case qe.e.TOP_LEFT:return"top-left";case qe.e.TOP_CENTER:return"top-center";case qe.e.TOP_RIGHT:return"top-right";case qe.e.LEFT:return"left";case qe.e.CENTER:return"center";case qe.e.RIGHT:return"right";case qe.e.BOTTOM_LEFT:return"bottom-left";case qe.e.BOTTOM_CENTER:return"bottom-center";case qe.e.BOTTOM_RIGHT:default:return"bottom-right"}}},{key:"escapeHTML",value:function(t){e.HTMLEscaper.textContent=t;var n=e.HTMLEscaper.innerHTML;return e.HTMLEscaper.textContent="",n}}]),e}();v()(Dr,"HTMLEscaper",document.createElement("div"));var Lr=function(){function e(){o()(this,e),v()(this,"values",void 0)}return l()(e,[{key:"getValues",value:function(){return this.values}},{key:"getTranslationForText",value:function(e){for(var t=this.getValues()||[],n=0,i=t.length;n<i;n++)if(t[n].text===e)return t[n].i18n||null;return null}}]),e}();function kr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Mr=function(e){g()(n,e);var t=kr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Monday",i18n:"edt_text_monday"},{text:"Tuesday",i18n:"edt_text_tuesday"},{text:"Wednesday",i18n:"edt_text_wednesday"},{text:"Thursday",i18n:"edt_text_thursday"},{text:"Friday",i18n:"edt_text_friday"},{text:"Saturday",i18n:"edt_text_saturday"},{text:"Sunday",i18n:"edt_text_sunday"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Days of the Week",i18n:"edt_UI_dataset_days_of_week"}}}]),n}(Lr);function xr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var wr=function(e){g()(n,e);var t=xr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Strongly Agree",i18n:"edt_UI_dataset_strongly_agree"},{text:"Agree",i18n:"edt_UI_dataset_agree"},{text:"Neutral",i18n:"edt_UI_dataset_neutral"},{text:"Disagree",i18n:"edt_UI_dataset_disagree"},{text:"Strongly Disagree",i18n:"edt_UI_dataset_strongly_disagree"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Degrees of Agreement",i18n:"edt_UI_dataset_degrees_of_agreement"}}}]),n}(Lr);function Ur(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Fr=function(e){g()(n,e);var t=Ur(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Very Important",i18n:"edt_UI_dataset_very_important"},{text:"Important",i18n:"edt_UI_dataset_important"},{text:"Neutral",i18n:"edt_UI_dataset_neutral"},{text:"Somewhat Important",i18n:"edt_UI_dataset_somewhat_important"},{text:"Not Important",i18n:"edt_UI_dataset_not_important"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Degrees of Importance",i18n:"edt_UI_dataset_degrees_of_importance"}}}]),n}(Lr);function Yr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Br=function(e){g()(n,e);var t=Yr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Definitely",i18n:"edt_UI_dataset_definitely"},{text:"Probably",i18n:"edt_UI_dataset_probably"},{text:"Not Sure",i18n:"edt_UI_dataset_not_sure"},{text:"Probably Not",i18n:"edt_UI_dataset_probably_not"},{text:"Definitely Not",i18n:"edt_UI_dataset_definitely_not"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Degrees of Probability",i18n:"edt_UI_dataset_degrees_of_probability"}}}]),n}(Lr);function Vr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Hr=function(e){g()(n,e);var t=Vr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Very Good",i18n:"edt_UI_dataset_very_good"},{text:"Good",i18n:"edt_UI_dataset_good"},{text:"Fair",i18n:"edt_UI_dataset_fair"},{text:"Poor",i18n:"edt_UI_dataset_poor"},{text:"Very Poor",i18n:"edt_UI_dataset_very_poor"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Degrees of Quality",i18n:"edt_UI_dataset_degrees_of_quality"}}}]),n}(Lr);function Gr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Wr=function(e){g()(n,e);var t=Gr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"Very Satisfied",i18n:"edt_UI_dataset_very_satisfied"},{text:"Satisfied",i18n:"edt_UI_dataset_satisfied"},{text:"Neutral",i18n:"edt_UI_dataset_neutral"},{text:"Unsatisfied",i18n:"edt_UI_dataset_unsatisfied"},{text:"Very Unsatisfied",i18n:"edt_UI_dataset_very_unsatisfied"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Degrees Of Satisfaction",i18n:"edt_UI_dataset_degrees_of_satisfaction"}}}]),n}(Lr);function Kr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var zr,qr=function(e){g()(n,e);var t=Kr(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"values",[{text:"January",i18n:"edt_UI_dataset_january"},{text:"February",i18n:"edt_UI_dataset_february"},{text:"March",i18n:"edt_UI_dataset_march"},{text:"April",i18n:"edt_UI_dataset_april"},{text:"May",i18n:"edt_UI_dataset_may"},{text:"June",i18n:"edt_UI_dataset_june"},{text:"July",i18n:"edt_UI_dataset_july"},{text:"August",i18n:"edt_UI_dataset_august"},{text:"September",i18n:"edt_UI_dataset_september"},{text:"October",i18n:"edt_UI_dataset_october"},{text:"November",i18n:"edt_UI_dataset_november"},{text:"December",i18n:"edt_UI_dataset_december"}]),e}return l()(n,[{key:"getName",value:function(){return{text:"Months of the Year",i18n:"edt_UI_dataset_months_of_year"}}}]),n}(Lr);!function(e){e[e.DEGREES_OF_AGREEMENT=0]="DEGREES_OF_AGREEMENT",e[e.DEGREES_OF_IMPORTANCE=1]="DEGREES_OF_IMPORTANCE",e[e.DEGREES_OF_PROBABILITY=2]="DEGREES_OF_PROBABILITY",e[e.DEGREES_OF_SATISFACTION=3]="DEGREES_OF_SATISFACTION",e[e.DEGREES_OF_QUALITY=4]="DEGREES_OF_QUALITY",e[e.DAYS_OF_WEEK=5]="DAYS_OF_WEEK",e[e.MONTHS_OF_YEAR=6]="MONTHS_OF_YEAR"}(zr||(zr={}));var Xr=function(){function e(){o()(this,e),v()(this,"providers",[]),this.providers.push(new wr),this.providers.push(new Fr),this.providers.push(new Br),this.providers.push(new Wr),this.providers.push(new Hr),this.providers.push(new Mr),this.providers.push(new qr)}return l()(e,[{key:"getDatasetByType",value:function(e){return this.providers[e]||null}}]),e}();function Qr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var $r=function(e){g()(n,e);var t=Qr(n);function n(){var e;return o()(this,n),e=t.call(this),v()(c()(e),"datasetName",void 0),e.values=[],e}return l()(n,[{key:"getName",value:function(){return this.datasetName}},{key:"withName",value:function(e){return this.datasetName=e,this}},{key:"getValues",value:function(){return this.values}},{key:"withValue",value:function(e){return this.values.push(e),this}}]),n}(Lr);function jr(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Jr=function(e){g()(n,e);var t=jr(n);function n(e){var i;return o()(this,n),i=t.call(this,e,e.getJQuery(),window.document.getElementById("notifications-area"),window.document.body),v()(c()(i),"engine",void 0),v()(c()(i),"datasetProvider",void 0),i.engine=e,i.datasetProvider=new Xr,i.initDOMEvents(),i}return l()(n,[{key:"upgrade",value:function(e,t){!function(i,r){var a=r.engine.getLoader().getCommandDispatcher();a.editorValueRendererFactory&&a.editorValueRendererFactory.injectDeferredElements(e);for(var o=0,s=n.plugins.length;o<s;o++)if(!t||t&&t.indexOf(n.plugins[o].getName())>-1)try{n.plugins[o].upgrade(i,e,r)}catch(l){console.warn("FAILED TO UPGRADE, PLUGIN = ",n.plugins[o])}}(this.jq,this)}},{key:"getSelectedDataset",value:function(e,t,n){return function(i,r,a,o,s,l,u){return a.Deferred((function(c){o.get("/modules/Typescript/Form/resources/options-dataset-dialog.html").then((function(o){for(var d,p,h,g={datasets:[]},_=new Ai.a(o),f=null,y=0,E=e.length;y<E;y++)(d=s.getDatasetByType(e[y]))&&g.datasets.push({id:e[y],name:d.getName().text,i18nName:d.getName().i18n||null});g.title="Choices Sets",g.i18nTitle="edt_text_choices_sets",h=function(){for(var e=[],t=0,i=n.length;t<i;t++)e.push(n[t].text);return e}().join("\n"),g.existingOptions=h;(p=i.createDialog(t,[{type:qe.c.CANCEL,callback:function(){p.close(),c.reject(new Error("User closed the dialog by pressing the Cancel button"))}},{type:qe.c.SAVE,callback:function(){var e,t=String(a(p.body).find(".values-placeholder > textarea").val()||"").replace(/(^[\s]+|[\s]+$)/g,""),n=t.split("\n"),i=new $r,r=!1;if(""!==t){null!==f&&(e=s.getDatasetByType(f)),i.withName(e?e.getName():{text:"User provided dataset"});for(var o=0,l=n.length;o<l;o++)n[o]=n[o].replace(/(^[\s]+|[\s]+$)/g,""),""!==n[o]&&(i.withValue({text:n[o],i18n:e?e.getTranslationForText(n[o]):null}),r=!0);r&&(p.close(),c.resolve(i))}}}],{width:"600px",height:"466px",onCloseButtonClick:function(){c.reject(new Error("User closed the dialog by pressing the X button"))}})).body.innerHTML=_.parse(g),p.body.setAttribute("data-dialog-role","choice-importer-dialog"),u.addPerfectScrollbar(p.body),l.translateDOMNode(p.body),a(p.body).on("click","a[data-role=dataset][data-type-id]",(function(){for(var e=parseInt(a(this).attr("data-type-id")),t=s.getDatasetByType(e).getValues()||[],n=[],i=r.getEngine().getI18n(),o=0,l=t.length;o<l;o++)n.push(i.translateText(t[o].i18n)&&i.translateText(t[o].i18n)!==t[o].i18n?i.translateText(t[o].i18n):t[o].text);a(p.body).find(".values-placeholder > textarea").val(n.join("\n")),f=e})).on("keydown","textarea",(function(){this.style.height="5px",this.style.height="".concat(this.scrollHeight,"px")}))})).fail((function(e){c.reject(e)}))})).promise()}(this.engine.getLoader().getUI(),this,this.engine.getJQuery(),this.engine.getResourceManager(),this.datasetProvider,this.engine.getI18n(),this.getEngine().getLoader().getCommandDispatcher())}},{key:"getEngine",value:function(){return this.engine}},{key:"initDOMEvents",value:function(){!function(e,t){e("#notifications-area").on("click",".notification > .close",(function(){this.parentNode.parentNode.removeChild(this.parentNode),e("body").removeClass("with-notification")})),document.body.addEventListener("mousewheel",(function(e){e.target&&e.target.className&&"ui-modal"===e.target.className&&(e.preventDefault(),e.stopPropagation())}),!0),document.body.addEventListener("mousemove",(function(e){e.target&&e.target.className&&"ui-modal"===e.target.className&&(e.preventDefault(),e.stopPropagation())}),!0)}(this.jq)}},{key:"createDialog",value:function(e,t,i){var r=p()(E()(n.prototype),"createDialog",this).call(this,e,t,i);return jt.scrollElementIntoView(r.dialog),jt.scrollElementIntoViewOnWix(),r}}],[{key:"addPlugin",value:function(e){this.plugins.push(e)}}]),n}(Dr);v()(Jr,"plugins",[]);var Zr=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){e(t).find("input[type=hidden][data-plugin=accepted-days-of-week]").each((function(){var t=null;this.getAttribute("data-value")&&(t=JSON.parse(this.getAttribute("data-value"))),this.value=JSON.stringify(t),null!==t?e(this).closest("div[data-role=property]").find("div[data-role=secondary] input[type=checkbox]").each((function(){this.checked=t.indexOf(~~this.name.substr(1))>-1})):e(this).closest("div[data-role=property]").find("div[data-role=secondary] input[type=checkbox]").each((function(){this.checked=!0}))})),e(t).attr("data-accepted-days-of-week-upgraded")||(e(t).on("click","input[type=hidden][data-plugin=accepted-days-of-week] + [data-role=secondary] input[type=checkbox]",(function(t){t.stopPropagation();var n=[];e(this).closest("div[data-role=secondary]").find("input[type=checkbox]").each((function(){this.checked&&n.push(~~this.name.substr(1))})),e(this).closest("div[data-role=property]").find("input[type=hidden][data-plugin=accepted-days-of-week]").each((function(){e(this).val(JSON.stringify(n)),e(this).trigger("input")}))})),e(t).attr("data-accepted-days-of-week-upgraded","1"))}}]),e}();v()(Zr,"NAME","AcceptedDaysOfWeekInspectorPlugin");var ea=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t){e(t).find("input[data-plugin=captcha-configuration-type]").each((function(){var t;e(t=this).closest("label").find("div[data-role=secondary][data-plugin-type=captcha-configuration-type]").each((function(){!function(n){e(n).on("click","input[type=radio]",(function(){this.value,t.value=this.value,e(t).trigger("input")}));var i=JSON.parse(t.getAttribute("data-value"));e(n).find("input[type=radio]").each((function(){this.checked=~~this.value===i}))}(this)}))}))}}]),e}();v()(ea,"NAME","CaptchaConfigurationInspectorPlugin");var ta,na=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t){e(t).find("input[type=checkbox][data-value], input[type=radio][data-value]").each((function(){this.checked=!0===this.getAttribute("data-value"),this.removeAttribute("data-value")}))}}]),e}();v()(na,"NAME","CheckBoxAndRadioInputInspectorPlugin"),function(e){e[e.PERCENTUAL=1]="PERCENTUAL",e[e.FIXED=2]="FIXED"}(ta||(ta={}));var ia=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find("input[data-plugin=coupon-codes-editor]").each((function(){var t,r,a,o,s,l;t=this,r=JSON.parse(t.getAttribute("data-value")||"[]"),a=t.nextElementSibling.querySelector("[data-role=coupons-list]"),o=t.parentNode.querySelector("[data-role=add-coupon-code]"),s=t.parentNode.querySelector("[data-role=add-coupon-code-more]"),l=t.parentNode.querySelector("[data-role=coupon-codes-editor]"),i.updateCouponsList(r,a),e([s,l]).on("click",(function(){i.editCouponCodesDialog(jt.clone(r),e,n).then((function(n){r.splice(0,r.length);for(var o=0,s=n.length;o<s;o++)r.push(n[o]);i.updateCouponsList(r,a),i.propagateChanges(r,t,e)}))})),e(o).on("click",(function(){i.addEmptyCouponCode(r),i.updateCouponsList(r,a),i.propagateChanges(r,t,e),n.getEngine().getLoader().execCommand("track-event","payments_coupon_set")})),e(a).on("click","[data-role=coupon-code-row] [data-role=remove]",(function(o){n.getEngine().getLoader().execCommand("track-event","payments_coupon_delete"),o.preventDefault(),o.stopPropagation();var s=~~this.parentNode.getAttribute("data-index");r.splice(s,1),i.updateCouponsList(r,a),i.propagateChanges(r,t,e)})).on("input","[data-role=coupon-code-row] > input",(function(n){var o=~~this.parentNode.getAttribute("data-index");""===this.value?(r.splice(o,1),i.updateCouponsList(r,a)):r[o].code=this.value,i.propagateChanges(r,t,e)}))}))}},{key:"createCouponCodeInputRow",value:function(e){var t=document.createElement("div");t.setAttribute("data-role","coupon-code-row");var n=document.createElement("input");return n.setAttribute("type","text"),t.appendChild(n),n.value=String(e||""),n.setAttribute("data-role","secondary"),t.appendChild(document.createElement("div")).setAttribute("data-role","remove"),t}},{key:"updateCouponsList",value:function(e,t){for(;t.firstChild;)t.removeChild(t.firstChild);for(var n,i=0,r=Math.min(5,e.length);i<r;i++)(n=this.createCouponCodeInputRow(e[i].code)).setAttribute("data-index",String(i)),t.appendChild(n);t.setAttribute("has-hidden-options",String(e.length>=5))}},{key:"addEmptyCouponCode",value:function(e){var t=window.JQLNativeFunctions.UNIQUE_ID_BASED_ON_DATE_MILISECOND();e.push({code:t,labelText:"",type:ta.PERCENTUAL,value:0})}},{key:"propagateChanges",value:function(e,t,n){t.value=JSON.stringify(e),n(t).trigger("input")}},{key:"editCouponCodesDialog",value:function(t,n,i){return r=i.getEngine().getResourceManager(),n.Deferred((function(a){r.get("/modules/Typescript/Form/resources/editor/Coupon/coupon-codes-editor-dialog.html").then((function(r){var o,s=i.createDialog("Coupon codes",[{callback:function(){var e=null;try{var t=[];n(s.body).find("table tbody > tr").each((function(){var i,r=this,a={code:n(this).find("[data-role=code]").val(),value:(i=n(this).find("[data-role=value]").get(0),""===i.value||isNaN(i.value)?null:parseFloat(i.value)),labelText:n(this).find("[data-role=labelText]").val(),type:~~n(this).find("[data-role=type]").attr("data-value")};if(a.code=String(a.code||"").replace(/(^[\s]+|[\s]+$)/g,""),!a.code)throw e=n(this).find("[data-role=code]"),new Error("Empty coupon codes are not allowed");if(Object(ot.a)(t,(function(t){if(t.code===a.code)throw e=n(r).find("[data-role=code]"),new Error("Another coupon with code ".concat(t.code," is already present!"))})),null===a.value)throw e=n(this).find("[data-role=value]"),new Error("Please specify a valid numeric discount");if(a.value<0)throw e=n(this).find("[data-role=value]"),new Error("Please specify a discount greater or equal to 0");if(a.value>100&&1===a.type)throw e=n(this).find("[data-role=value]"),new Error("Percentual coupon codes cannot have discount greater than 100");t.push(a)})),s.close(),a.resolve(t)}catch(r){i.alert("Error saving coupon codes",String(r).replace(/^Error:/g,""),(function(){e&&(e.focus(),e.select())}))}},type:qe.c.SAVE},{callback:function(){a.reject(new Error("User canceled!")),s.close()},type:qe.c.CANCEL}],{width:"584px",onCloseButtonClick:function(){a.reject(new Error("User closed editor without saving!"))}}),l=new Ai.a(r);s.body.innerHTML=l.parse({}),s.dialog.setAttribute("data-dialog-role","coupon-codes-editor"),o=s.body.querySelector("table");for(var u=i.getEngine().getDocument().getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING).getProperty("currencyId")||e.DEFAULT_CURRENCY_ID,c=i.getEngine().getCurrency().getCurrencySymbolById(u),d=function(t){var n=document.createElement("tr"),i=n.appendChild(document.createElement("td")),r=n.appendChild(document.createElement("td")),a=n.appendChild(document.createElement("td")),o=document.createElement("input");o.setAttribute("type","text"),o.setAttribute("data-role","code"),o.value=t.code,i.appendChild(o),i.appendChild(document.createElement("div")).setAttribute("data-role","remove");var s,l=document.createElement("input");switch(l.setAttribute("type","text"),l.setAttribute("data-role","value"),l.value=String(t.value),t.type){case ta.PERCENTUAL:s=e.PERCENTAGE_SYMBOL;break;case ta.FIXED:s=c;break;default:throw new Error("Coupon code type is invalid")}var u=document.createElement("div");u.setAttribute("data-role","type"),u.setAttribute("data-value",String(t.type)),u.setAttribute("data-allow-keyboard",""),u.textContent=s,u.tabIndex=0,r.appendChild(l),r.appendChild(u),r.appendChild(function(){var t=document.createElement("div");t.setAttribute("data-role","dropdown");var n=document.createElement("div");return n.setAttribute("data-value","1"),n.textContent=e.PERCENTAGE_SYMBOL,t.appendChild(n),(n=document.createElement("div")).setAttribute("data-value","2"),n.textContent=c,t.appendChild(n),t}());var d=document.createElement("input");return d.setAttribute("type","text"),d.setAttribute("data-role","labelText"),d.value=t.labelText,a.appendChild(d),n},p=0,h=t.length;p<h;p++){var g=d(t[p]);o.tBodies[0].appendChild(g)}var _=function(){for(var e=0,t=o.tBodies[0].rows.length;e<t;e++)o.tBodies[0].rows[e].setAttribute("data-index",String(e))};_(),n(s.body).on("focus","[data-role=type]",(function(){var e=this.getAttribute("data-value");n(this).addClass("focused").next("[data-role=dropdown]").find("div[data-value]").each((function(){this.getAttribute("data-value")===e?n(this).addClass("selected"):n(this).removeClass("selected")}))})).on("blur","[data-role=type]",(function(){var e=this;setTimeout((function(){n(e).removeClass("focused")}),10)})).on("keydown","[data-role=type]",(function(e){var t=e.keyCode||e.charCode,i=n(this).hasClass("focused"),r=null;if(i){if(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||-1===[at.KEY_UP,at.KEY_DOWN,at.KEY_ESC,at.KEY_ENTER].indexOf(t))return;r=-1;var a=[];switch(n(this).next("[data-role=dropdown]").find("> div").each((function(e){a.push(this),n(this).hasClass("selected")&&(r=e)})),t){case at.KEY_ENTER:-1!=r&&(n(this).attr("data-value",n(a[r]).attr("data-value")),n(this).removeClass("focused"));break;case at.KEY_ESC:return void n(this).removeClass("focused");case at.KEY_DOWN:n(a[r]||null).removeClass("selected"),++r>=a.length&&(r=0),n(a[r]||null).addClass("selected");break;case at.KEY_UP:n(a[r]||null).removeClass("selected"),--r<0&&(r=a.length-1),n(a[r]||null).addClass("selected")}}else t===at.KEY_ENTER&&n(this).addClass("focused")})).on("mousedown","[data-role=dropdown] > [data-value]",(function(e){var t=~~this.getAttribute("data-value"),n=this.parentNode.previousElementSibling;n.setAttribute("data-value",String(t)),n.textContent=this.textContent,t===ta.PERCENTUAL&&parseFloat(n.previousElementSibling.value||"0")>100&&(n.previousElementSibling.value="")})).on("mouseenter","[data-role=dropdown] > [data-value]",(function(e){var t=this;n(this).parent().find("[data-value]").each((function(){this!==t?n(this).removeClass("selected"):n(this).addClass("selected")}))})).on("click","[data-role=remove]",(function(){var e=~~n(this).closest("tr").attr("data-index");n(this).closest("tr").remove(),t.splice(e,1),_()})).on("click","td[data-role=add-coupon]",(function(){var e={value:0,code:window.JQLNativeFunctions.UNIQUE_ID_BASED_ON_DATE_MILISECOND(),type:ta.PERCENTUAL,labelText:""};t.push(e);var n=d(e);o.tBodies[0].appendChild(n),_(),s.body.scrollTop=8e7,i.getEngine().getLoader().execCommand("track-event","payments_coupon_set")})),n(s.body).perfectScrollbar()})).fail((function(){a.reject(new Error("Failed to fetch coupon codes editor dialog markup"))}))})).promise();var r}}]),e}();v()(ia,"NAME","CouponCodesInspectorPlugin"),v()(ia,"DEFAULT_CURRENCY_ID",1),v()(ia,"PERCENTAGE_SYMBOL","%");var ra=function(){function e(){o()(this,e),v()(this,"PRESETS_CONFIGURATION",{notSet:{text:"none",index:0},"-1w":{text:"today -1 week",index:1},"-1d":{text:"yesterday",index:2},now:{text:"today",index:3},"+1d":{text:"tomorrow",index:4},"+1w":{text:"today +1 week",index:5},"-1hh":{text:"now -1 hour",index:1},"-1mm":{text:"now -1 minute",index:2},"+1mm":{text:"now +1 minute",index:4},"+1hh":{text:"now +1 hour",index:5},"-2d":{text:"Two days ago",index:6},"-3d":{text:"3 days ago",index:7},"-2w":{text:"2 weeks ago",index:8},"-3w":{text:"3 weeks ago",index:9},"-1m":{text:"1 month ago",index:10},"-2m":{text:"Two months ago",index:11},"-3m":{text:"3 months ago",index:12},"-6m":{text:"6 months ago",index:13},"-1y":{text:"1 year ago",index:14},"+2d":{text:"Overmorrow",index:15},"+3d":{text:"Over 3 days",index:16},"+2w":{text:"Over 2 weeks",index:17},"+3w":{text:"Over 3 weeks",index:18},"+1m":{text:"Over 1 month",index:19},"+2m":{text:"Over 2 months",index:20},"+3m":{text:"Over 3 months",index:21},"+6m":{text:"Over 6 months",index:22},"+1y":{text:"Over 1 year",index:23},custom:{text:"custom date",index:99},customTime:{text:"custom time",index:99}})}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"updateLabelText",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=String(e.value||"").toLowerCase(),o="custom"!==a&&"customTime"!==a&&""!==a&&i.indexOf(a)>-1;o||""===a&&!r?e.removeAttribute("data-is-visible"):e.setAttribute("data-is-visible",""),n.textContent=o?"now"===a?this.setNowTextForControl(e):this.PRESETS_CONFIGURATION[a].text:""===a||"notset"===a?this.PRESETS_CONFIGURATION.notSet.text:a}},{key:"setNowTextForControl",value:function(e){return e.hasAttribute("data-return-time-part-only")?"now":"today"}},{key:"triggerChange",value:function(e,t,n,i,r,a){var o=n(t).closest("[data-role=property]").attr("data-validation-type")||Ee.VALIDATOR_TYPE_DATE_MMDDYYYY,s=i.stringToTime(t.value,o),l=String(t.value||"").toLowerCase(),u=n("#item").attr("data-target-element");a.getEngine().getDocument().getElementByHash(u);null===s?e.value="null":i.dateAdd(t.value)||i.isHumanDateString(t.value)?e.value=JSON.stringify(t.value):e.value=JSON.stringify(r?3600*s.getHours()+60*s.getMinutes()+s.getSeconds():~~(s.getTime()/1e3)),""!==l&&null!==l||(e.value=l),n(e).trigger("input")}},{key:"updatePropertyCustomAttribute",value:function(e,t,n){!1===n.indexOf(t.value)>-1&&""!==t.value?e(t).closest("[data-role=property]").attr("data-property-has-custom-value","1"):""===t.value?e(t).on("blur",(function(){e(t).closest("[data-role=property]").removeAttr("data-property-has-custom-value")})):e(t).closest("[data-role=property]").removeAttr("data-property-has-custom-value")}},{key:"listenForDateFormatAttributePropagationChange",value:function(t,n,i,r,a){r(t).closest("[data-role=property]").on("attribute:propagate",(function(){var o=n.value,s=this.getAttribute("data-validation-type");if(""!==o&&s)try{var l=JSON.parse(o);if("number"!==typeof l)return;if(0===l||null===l)return;var u=null;switch(s){case Ee.VALIDATOR_TYPE_DATE_MMDDYYYY:case Ee.VALIDATOR_TYPE_DATE_DDMMYYYY:case Ee.VALIDATOR_TYPE_DATE_YYYYMMDD:case Ee.VALIDATOR_TYPE_DATE_MMYYYY:u=e.SUPPORTED_DATE_VALIDATOR_FORMATS[s];break;default:return}var c=a.formatTime(l,u);r(i).text(c),r(t).val(c)}catch(d){}}))}},{key:"upgrade",value:function(t,n,i){var r,a=i.getEngine().getTimeUtils();r=this,t(n).find("input[data-plugin=date-editor]").each((function(){!function(n){var o=String(n.getAttribute("data-presets")||"now -1d +1d -2d +2d -3d +3d -1w +1w -2w +2w -3w +3w -1m +1m -2m +2m -3m +3m -6m +6m -1y +1y custom").trim().split(/[\s]+/).filter((function(e){return!!e&&!!r.PRESETS_CONFIGURATION[e]})).sort((function(e,t){return r.PRESETS_CONFIGURATION[e].index-r.PRESETS_CONFIGURATION[t].index})),s=n.hasAttribute("data-return-time-part-only");if(n.setAttribute("data-role","secondary"),n.title=t(n).closest("label").find("span.property-label").text(),""!==n.value&&"0"!==n.value&&n.value===String(~~n.value))if(s)n.value=a.intToTime(~~n.value,Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?"%H:%i:%S":"%H:%i");else{var l=t(n).closest("[data-role=property]").attr("data-validation-type"),u=e.SUPPORTED_DATE_VALIDATOR_FORMATS[l]||"%m/%d/%Y";n.value=a.formatTime(~~n.value,u)}n.value="0"===n.value?s?"00:00":"":n.value;var c=document.createElement("div"),d=document.createElement("input");d.setAttribute("type","hidden"),d.setAttribute("data-is-json-value",""),d.value=String(~~n.value)===n.value?n.value:JSON.stringify(n.value||null),t(c).attr("data-role","text-dropdown"),r.listenForDateFormatAttributePropagationChange(n,d,c,t,a),t(n).before(c),t(n).before(d),t(n).closest("label").attr("data-has-text-dropdown","1"),t(n).closest("[data-role=property]").attr("data-plugin","date-editor"),r.updatePropertyCustomAttribute(t,n,o),r.updateLabelText(n,d,c,o),t(n).on("input",(function(){r.updateLabelText(n,d,c,o),r.triggerChange(d,n,t,a,s,i),r.updatePropertyCustomAttribute(t,n,o)})),t(c).on("click",(function(){if(!t(c).closest("[data-role=property]").attr("data-is-opened")){t(c).closest("[data-role=property]").attr("data-is-opened","1");var l,u=document.createElement("div");u.setAttribute("data-role","text-dropdown-overlay");for(var p=0,h=o.length;p<h;p++)(l=document.createElement("div")).setAttribute("data-value",JSON.stringify(o[p])),l.textContent="now"===o[p]?r.setNowTextForControl(n):r.PRESETS_CONFIGURATION[o[p]].text,u.appendChild(l);var g,_=function(e){var n=e.srcElement||e.target;n===u||t.contains(u,n)||n===c||(t(c).closest("[data-role=property]").removeAttr("data-is-opened"),t(u).remove(),document.body.removeEventListener("mousedown",_,!0),_=null)};if(_e.isMobile()){var f=document.createElement("div");f.setAttribute("data-role","text-dropdown"),f.appendChild(u);var y=i.getEngine().getI18n();(g=i.getEngine().getLoader().getUI().createDialog(y.translateText("edt_dropdown_UI_please_choose"),[],{width:"100%",height:"100%",onCloseButtonClick:function(){t(c).closest("[data-role=property]").removeAttr("data-is-opened")}})).body.appendChild(f),g.show()}else{c.appendChild(u);var E=c.getBoundingClientRect();document.body.getBoundingClientRect().height<E.top+E.height?c.setAttribute("data-dropdown-position","top"):c.setAttribute("data-dropdown-position","bottom"),document.body.addEventListener("mousedown",_,!0)}t(u).on("click","> div",(function(l){var u=JSON.parse(this.getAttribute("data-value")),p=new Date,h=t(n).closest("[data-role=property]").attr("data-validation-type"),f=e.SUPPORTED_DATE_VALIDATOR_FORMATS[h]||"%m/%d/%Y";n.value="custom"===u||"customTime"===u||""===u?s?a.intToTime(3600*p.getHours()+60*p.getMinutes()+p.getSeconds(),Rt.ALLOW_SECOND_COMPONENT_IN_UI_TIME_CONTROL?"%H:%i:%S":"%H:%i"):a.formatTime(parseInt(String(+new Date/1e3)),f):u,r.updateLabelText(n,d,c,o),r.triggerChange(d,n,t,a,s,i),r.updatePropertyCustomAttribute(t,n,o),document.body.removeEventListener("mousedown",_,!0),_e.isMobile()&&g&&g.close(),setTimeout((function(){t(c).closest("[data-role=property]").removeAttr("data-is-opened")}),50)})).on("mousewheel",(function(e){e.stopPropagation()}))}}))}(this)}))}}]),e}();v()(ra,"NAME","DateEditorInspectorPlugin"),v()(ra,"SUPPORTED_DATE_VALIDATOR_FORMATS",{datemmddyyyy:"%m/%d/%Y",dateddmmyyyy:"%d/%m/%Y",dateyyyymmdd:"%Y/%m/%d",datemmyyyy:"%m/%Y"});var aa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"getPluginOptions",value:function(e){for(var t=String(e||"").toLowerCase().split(/[\s,]+/),n=[],i=0,r=t.length;i<r;i++)t[i]&&n.push(t[i]);return n.length?n:null}},{key:"hasPluginOption",value:function(e,t){return!(!e||!t)&&e.indexOf(t)>-1}},{key:"createOverlayOptionHeaderElement",value:function(e,t,n){var i,r,a=document.createElement("div");return a.setAttribute("data-role","header"),e&&((i=document.createElement("a")).setAttribute("data-role","header-command"),i.setAttribute("data-command","add-item"),i.href="javascript:;",i.textContent="Add",a.appendChild(i)),t&&((r=document.createElement("span")).appendChild(document.createTextNode(t)),r.setAttribute("data-is-disabled","1"),a.appendChild(r)),n&&((i=document.createElement("a")).setAttribute("data-role","header-command"),i.setAttribute("data-command","select-all"),i.href="javascript:;",i.textContent="All",i.title="Select All",a.appendChild(i),(i=document.createElement("a")).setAttribute("data-role","header-command"),i.setAttribute("data-command","select-none"),i.href="javascript:;",i.textContent="None",i.title="Deselect All",a.appendChild(i)),a}},{key:"evalCallback",value:function(e){return new Function("return "+e)()}},{key:"addNewItem",value:function(e,t,n){var i;try{if(!(i=this.evalCallback(e))||!i.then||"function"!==typeof i.then||!i.fail||"function"!==typeof i.fail||!i.always||"function"!==typeof i.always)throw new Error("The returned eval'd text ".concat(JSON.stringify(e)," does not seem to be a JQueryPromise!"))}catch(r){return console.warn("Failed executing callback: ".concat(JSON.stringify(e)," while running the add option plugin. Exception is shown in console!")),void console.error(r)}i.then((function(e){var i,a={};if(!e)throw new Error("Promise did not returned a valid option!");if("string"===typeof e||"number"===typeof e)a.text=a.value=String(e),a.selected=!1;else if(a.text=e.text||e.value||null,a.value=e.value||null,a.selected=!!e.selected,null===a.text||null===a.value)throw new Error("Promise did not returned a valid option!");for(var o=0,s=t.length;o<s;o++)if(t[o].value===a.value)throw new Error("Adding duplicate options is not supported!");(i=document.createElement("div")).setAttribute("data-value",JSON.stringify(a.value)),i.textContent=a.text,a.selected&&i.setAttribute("data-is-selected",""),n.appendChild(i),t.push(a);try{i.scrollIntoView()}catch(r){}}))}},{key:"upgrade",value:function(t,n,i){var r;r=this,t(n).find("select[data-appearance=text]").each((function(){!function(a){t(a).closest("label").attr("data-has-text-dropdown","1");var o,s=document.createElement("input"),l=document.createElement("div"),u=[],c=a.hasAttribute("multiple"),d=a.getAttribute("data-empty-state-label")||"0 selected",p=a.hasAttribute("data-is-json-value"),h=a.hasAttribute("data-plugin-options")?r.getPluginOptions(a.getAttribute("data-plugin-options")):null,g=a.hasAttribute("data-allow-addition")&&a.hasAttribute("data-add-new-item-callback"),_=a.getAttribute("data-add-new-item-callback")||null,f=a.hasAttribute("data-dropdown-empty-state-option-i18n")&&i.getEngine().getI18n().translateText(a.getAttribute("data-dropdown-empty-state-option-i18n"))?i.getEngine().getI18n().translateText(a.getAttribute("data-dropdown-empty-state-option-i18n")):a.hasAttribute("data-dropdown-empty-state-option")&&a.getAttribute("data-dropdown-empty-state-option")||null,y=r.hasPluginOption(h,e.PLUGIN_SELECT_ALL_SELECT_NONE);a.hasAttribute("data-value")&&(c||(a.value=a.getAttribute("data-value")),a.removeAttribute("data-value")),a.hasAttribute("data-skip-errors")&&l.setAttribute("data-skip-errors","1"),s.setAttribute("type","hidden");for(var E=0,m=a.attributes.length;E<m;E++)s.hasAttribute(a.attributes[E].name)||s.setAttribute(a.attributes[E].name,a.attributes[E].value);a.parentNode.insertBefore(s,a),a.parentNode.insertBefore(l,a),a.parentNode.removeChild(a);for(var v=0,T=a.options.length;v<T;v++)u.push({value:a.options[v].value,text:a.options[v].text,i18nText:a.options[v].hasAttribute("data-i18n-text")&&a.options[v].getAttribute("data-i18n-text")||null,selected:a.options[v].selected,webfontClass:a.options[v].hasAttribute("data-is-webfont")&&a.options[v].getAttribute("data-webfont-class")||null});u.length&&(f=null),r.notifyChangeEvent(s,c,a.value,u,t,p,!1),o=r.getElementCaption(u,a.value,c,d,i),l.textContent=l.title=r.getTransformedTextCaption(o,h),""===o?l.setAttribute("data-is-not-selected","1"):l.removeAttribute("data-is-not-selected"),l.setAttribute("data-role","text-dropdown"),t(l).on("click",(function(e){if(!l.hasAttribute("data-is-opened")&&(!t(l).closest("#item")||!t(l).closest("#item").attr("data-autosubmit-enabled")||1!==Number(t(l).closest("#item").attr("data-autosubmit-enabled")))){e.stopPropagation(),e.preventDefault(),l.setAttribute("data-is-opened","1");var a,E=document.createElement("div");E.setAttribute("data-role","text-dropdown-overlay"),c&&E.setAttribute("data-is-multiple",""),(g||f||y)&&E.appendChild(r.createOverlayOptionHeaderElement(g,f,y));for(var m=0,v=u.length;m<v;m++)(a=document.createElement("div")).setAttribute("data-value",JSON.stringify(u[m].value)),u[m].i18nText&&a.setAttribute("data-i18n-text",u[m].i18nText),u[m].webfontClass&&(a.setAttribute("data-is-webfont","1"),a.setAttribute("data-webfont-class",u[m].webfontClass)),a.textContent=r.getTransformedTextCaption(u[m].text,h),r.transformOptionElement(a,u[m],h),E.appendChild(a),u[m].selected?a.setAttribute("data-is-selected",""):a.removeAttribute("data-is-selected");i.getEngine().getI18n().translateDOMNode(E);var T,O=function(e){var n=e.srcElement||e.target;n===E||t.contains(E,n)||n===l||(l.removeAttribute("data-is-opened"),t(E).remove(),document.body.removeEventListener("mousedown",O,!0),O=null)};if(_e.isMobile()){var C=function(){l.removeAttribute("data-is-opened"),T.close()},N=c?[{type:qe.c.DONE,callback:C}]:[],A=document.createElement("div");A.setAttribute("data-role","text-dropdown"),A.appendChild(E);var b=i.getEngine().getLoader().getUI(),R=i.getEngine().getI18n();(T=b.createDialog(R.translateText("edt_dropdown_UI_please_choose"),N,{width:"100%",height:"100%",onCloseButtonClick:C})).body.appendChild(A)}else{l.appendChild(E);var I=l.getBoundingClientRect(),P=document.body.getBoundingClientRect(),S=n.getBoundingClientRect(),D=P.height+P.top>S.height?S:P;D.bottom-I.bottom>E.offsetHeight?l.setAttribute("data-dropdown-position","bottom"):(l.setAttribute("data-dropdown-position","top"),I.top-D.top<E.offsetHeight+5&&(E.style.bottom="-".concat(E.offsetHeight-(I.bottom-D.top)+5,"px"))),document.body.addEventListener("mousedown",O,!0)}t(E).on("click","> div",(function(e){if(this.hasAttribute("data-value")){i.getEngine().getLoader().execCommand("track-event","edt_property_dropdown_click");var n,a=JSON.parse(this.getAttribute("data-value"));r.updateSelectedState(u,c,a),r.notifyChangeEvent(s,c,a,u,t,p),t(E).find("> div[data-value]").each((function(e){u[e].selected?this.setAttribute("data-is-selected",""):this.removeAttribute("data-is-selected")})),n=r.getElementCaption(u,s.value,c,d,i),l.title=n,c?l.childNodes[0].textContent=r.getTransformedTextCaption(n,h):(l.textContent=r.getTransformedTextCaption(n,h),setTimeout((function(){l.removeAttribute("data-is-opened")}),10),_e.isMobile()?T&&T.close():t(E).remove(),""===n?l.setAttribute("data-is-not-selected","1"):l.removeAttribute("data-is-not-selected"),document.body.removeEventListener("mousedown",O,!0))}else{if("header"!=this.getAttribute("data-role"))return;var g=e.srcElement||e.target;switch(!0){case t(g).is("[data-role=header-command][data-command=add-item]"):r.addNewItem(_,u,E);break;case t(g).is("[data-role=header-command][data-command=select-all]"):c&&(r.setItemsSelectedState(!0,u,E,t),r.notifyChangeEvent(s,c,null,u,t,p),o=r.getElementCaption(u,s.value,c,d,i),l.title=o,l.childNodes[0].textContent=r.getTransformedTextCaption(o,h));break;case t(g).is("[data-role=header-command][data-command=select-none]"):c&&(r.setItemsSelectedState(!1,u,E,t),r.notifyChangeEvent(s,c,null,u,t,p),o=r.getElementCaption(u,s.value,c,d,i),l.title=o,l.childNodes[0].textContent=r.getTransformedTextCaption(o,h))}}})).on("mousewheel",(function(e){e.stopPropagation()}))}}))}(this)}))}},{key:"transformOptionElement",value:function(t,n,i){n&&this.hasPluginOption(i,e.PLUGIN_OPTION_FONT_DROPDOWN)&&(t.title=t.innerText,t.hasAttribute("data-is-webfont")?(t.innerText="",t.className+=" ".concat(t.getAttribute("data-webfont-class")," gf-123")):(t.style.fontFamily=n.value||n.text||"",t.setAttribute("data-is-font-style-option","")))}},{key:"notifyChangeEvent",value:function(e,t,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];if(t){for(var s=[],l=0,u=i.length;l<u;l++)i[l].selected&&s.push(i[l].value);e.value=a?JSON.stringify(s):s.join(",")}else e.value=a?JSON.stringify(n):n;o&&r(e).trigger("input")}},{key:"updateSelectedState",value:function(e,t,n){for(var i=0,r=e.length;i<r;i++)t?e[i].value===n&&(e[i].selected=!e[i].selected):e[i].selected=e[i].value===n}},{key:"getTransformedTextCaption",value:function(t,n){return this.hasPluginOption(n,e.PLUGIN_OPTION_FONT_DROPDOWN)?String(t||"").replace(/,(.*)$/g,""):t}},{key:"getElementCaption",value:function(e,t,n,i,r){var a=r.getEngine().getI18n();if(n){for(var o=0,s="edt_text_element_caption_selected",l=a.translateText(s)&&s!==a.translateText(s)?a.translateText(s):null,u=l?" ".concat(l):" selected",c=0,d=e.length;c<d;c++)e[c].selected&&o++;return o?o+u:i}for(var p=0,h=e.length;p<h;p++)if(String(e[p].value)===String(t))return e[p].i18nText&&e[p].i18nText!==a.translateText(e[p].i18nText)?a.translateText(e[p].i18nText):e[p].text||"";return""}},{key:"setItemsSelectedState",value:function(e,t,n,i){if(t){for(var r=0,a=t.length;r<a;r++)t[r].selected=e;i(n).find("> div[data-value]").each((function(){e?this.setAttribute("data-is-selected",""):this.removeAttribute("data-is-selected")}))}}}]),e}();v()(aa,"NAME","TextAppearanceDropDownInspectorPlugin"),v()(aa,"PLUGIN_OPTION_FONT_DROPDOWN","font-dropdown"),v()(aa,"PLUGIN_SELECT_ALL_SELECT_NONE","select-all");var oa=function(){function e(){var t=this;o()(this,e),v()(this,"discountContainer",void 0),v()(this,"parentContainer",void 0),v()(this,"taxContainer",void 0),v()(this,"unitType",[{unitTypeIndex:Ri.PERCENTAGE,unitTypeName:"percentage",unitTypeSymbol:"%"},{unitTypeIndex:Ri.FIXED_VALUE,unitTypeName:"fixed_value",unitTypeSymbol:"$"}]),v()(this,"clickHandler",(function(e){var n=$(e.target),i=n.parents('[data-role="control-discount"]'),r=n.parents('[data-role="control-tax"]');0===i.length&&(t.removeClickedState(t.discountContainer.find('[data-role="control-discount"][data-has-click]').get(0)),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!1)),0===r.length&&(t.removeClickedState(t.taxContainer.find('[data-role="control-tax"][data-has-click]').get(0)),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="taxOnTotal"] span.property-label'),!1))}))}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){this.parentContainer=e(t),this.discountContainer=this.parentContainer.find('[data-plugin="discount-on-total"]'),this.taxContainer=this.parentContainer.find('[data-plugin="tax-on-total"]'),this.upgradeDiscountContainer(n),this.upgradeTaxContainer(n),(this.discountContainer.length||this.taxContainer.length)&&(this.parentContainer.off("click",this.clickHandler),this.parentContainer.on("click",this.clickHandler))}},{key:"upgradeDiscountContainer",value:function(e){var t=this,n=e.getEngine(),i=n.getResourceManager(),r=n.getDocument().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),a=n.getDocument().getEditorSettingByTypeId(ei.PAYMENT_SUMMARY_EDITOR_SETTING),o=(null===r||void 0===r?void 0:r.getProperty("currencyId"))||Si.DEFAULT_CURRENCY_ID,s=n.getCurrency().getCurrencySymbolById(o);if(this.discountContainer.length){var l=this.generateGenericPriceFormatFromInputValue(r.getProperty("discountValue"));this.unitType[Ri.FIXED_VALUE].unitTypeSymbol=s;var u={currencySymbol:s,onTotalDiscountValue:l,onTotalDiscountUnitType:r.getProperty("discountType")||0,unitType:this.unitType};$.when(i.get("/modules/Typescript/Form/resources/editor/SummarySetting/discount-on-total.html")).done((function(i){a.setProperty("discountOnTotal",parseFloat(l));var o=new Ai.a(i);t.discountContainer.get(0).innerHTML="",t.discountContainer.get(0).insertAdjacentHTML("afterbegin",o.parse(u)),e.upgrade(t.discountContainer.get(0),[aa.NAME]),t.discountContainer.mouseenter((function(e){t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!0)})),t.discountContainer.mouseleave((function(e){t.discountContainer.find('[data-role="text-dropdown-overlay"] > [data-is-selected]').trigger("click"),0==t.discountContainer.find('[data-role="control-discount"][data-has-click]').length&&t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!1)})),t.discountContainer.off("click",'[data-role="control-discount"]'),t.discountContainer.on("click",'[data-role="control-discount"]',(function(e){t.addClickedState(e.currentTarget),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!0),t.discountContainer.find('input:not([type="hidden"])').focus()})),t.discountContainer.find('[data-role="text-dropdown"]').each((function(e,i){i.addEventListener("click",(function(e){var i=$(e.target);if(i.attr("data-value")){var a=t.discountContainer.find('input:not([type="hidden"])'),o=parseInt(JSON.parse(i.attr("data-value"))),s=t.generateGenericPriceFormatFromInputValue(a.val(),0===o),l="- ";n.getLoader().execCommand("track-event","payments_products_discount_total_type_change"),l+=t.generateDiscountAndTaxValue(s,o,u.currencySymbol),t.discountContainer.find('[data-role="control-discount"]').attr("title",l),t.discountContainer.find('[data-role="control-discount"] span').text(l),t.discountContainer.find('[data-role="control-discount"] input').each((function(e,t){$(t).val(s)})),r.setProperty("discountType",o),r.setProperty("discountValue",parseFloat(s)),n.getLoader().trigger("products_discount_tax_change"),t.removeClickedState(t.discountContainer.find('[data-role="control-discount"][data-has-click]').get(0)),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!1),e.preventDefault()}}))})),t.discountContainer.off("change",'input:not([type="hidden"])'),t.discountContainer.on("change",'input:not([type="hidden"])',(function(e){n.getLoader().execCommand("track-event","payments_products_discount_total_value_change");var i=!1,a=$(e.currentTarget).val(),o="- ";0===u.onTotalDiscountUnitType&&(i=!0),a=t.generateGenericPriceFormatFromInputValue(a,i),o+=t.generateDiscountAndTaxValue(a,u.onTotalDiscountUnitType,u.currencySymbol),t.discountContainer.find('[data-role="control-discount"]').attr("title",o),t.discountContainer.find('[data-role="control-discount"] span').text(o),t.discountContainer.find('[data-role="control-discount"] input').each((function(e,t){$(t).val(a)})),r.setProperty("discountValue",parseFloat(a)),n.getLoader().trigger("products_discount_tax_change")}))})).fail((function(e){console.warn("Failed to open template for discount on total. Error is displayed below."),console.error(e)}))}}},{key:"upgradeTaxContainer",value:function(e){var t=this,n=e.getEngine(),i=n.getResourceManager(),r=n.getDocument().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),a=n.getDocument().getEditorSettingByTypeId(ei.PAYMENT_SUMMARY_EDITOR_SETTING),o=(null===r||void 0===r?void 0:r.getProperty("currencyId"))||Si.DEFAULT_CURRENCY_ID,s=n.getCurrency().getCurrencySymbolById(o);if(this.taxContainer.length){var l=this.generateGenericPriceFormatFromInputValue(r.getProperty("taxValue"));this.unitType[Ri.FIXED_VALUE].unitTypeSymbol=s;var u={currencySymbol:s,onTotalTaxValue:l,onTotalTaxUnitType:r.getProperty("taxType")||0,unitType:this.unitType};$.when(i.get("/modules/Typescript/Form/resources/editor/SummarySetting/tax-on-total.html")).done((function(i){a.setProperty("taxOnTotal",parseFloat(l));var o=new Ai.a(i);t.taxContainer.get(0).innerHTML="",t.taxContainer.get(0).insertAdjacentHTML("afterbegin",o.parse(u)),e.upgrade(t.taxContainer.get(0),[aa.NAME]),t.taxContainer.mouseenter((function(e){t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="taxOnTotal"] span.property-label'),!0)})),t.taxContainer.mouseleave((function(e){t.taxContainer.find('[data-role="text-dropdown-overlay"] > [data-is-selected]').trigger("click"),0==t.taxContainer.find('[data-role="control-tax"][data-has-click]').length&&t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="taxOnTotal"] span.property-label'),!1)})),t.taxContainer.off("click",'[data-role="control-tax"]'),t.taxContainer.on("click",'[data-role="control-tax"]',(function(e){t.addClickedState(e.currentTarget),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="discountOnTotal"] span.property-label'),!0),t.taxContainer.find('input:not([type="hidden"])').focus()})),t.taxContainer.find('[data-role="text-dropdown"]').each((function(e,i){i.addEventListener("click",(function(e){var i=$(e.target);if(i.attr("data-value")){var a=t.taxContainer.find('input:not([type="hidden"])'),o=parseInt(JSON.parse(i.attr("data-value"))),s=t.generateGenericPriceFormatFromInputValue(a.val(),0===o),l="+ ";n.getLoader().execCommand("track-event","payments_products_tax_total_type_change"),l+=t.generateDiscountAndTaxValue(s,o,u.currencySymbol),t.taxContainer.find('[data-role="control-tax"]').attr("title",l),t.taxContainer.find('[data-role="control-tax"] span').text(l),t.taxContainer.find('[data-role="control-tax"] input').each((function(e,t){$(t).val(s)})),r.setProperty("taxType",o),r.setProperty("taxValue",parseFloat(s)),n.getLoader().trigger("products_discount_tax_change"),t.removeClickedState(t.taxContainer.find('[data-role="control-tax"][data-has-click]').get(0)),t.setShrunkPropertyOnLabel(t.parentContainer.find('[data-property-name="taxOnTotal"] span.property-label'),!1),e.preventDefault()}}))})),t.taxContainer.off("change",'input:not([type="hidden"])'),t.taxContainer.on("change",'input:not([type="hidden"])',(function(e){n.getLoader().execCommand("track-event","payments_products_tax_total_value_change");var i=!1,a=$(e.currentTarget).val(),o="+ ";0===u.onTotalTaxUnitType&&(i=!0),a=t.generateGenericPriceFormatFromInputValue(a,i),o+=t.generateDiscountAndTaxValue(a,u.onTotalTaxUnitType,u.currencySymbol),t.taxContainer.find('[data-role="control-tax"]').attr("title",o),t.taxContainer.find('[data-role="control-tax"] span').text(o),t.taxContainer.find('[data-role="control-tax"] input').each((function(e,t){$(t).val(a)})),r.setProperty("taxValue",parseFloat(a)),n.getLoader().trigger("products_discount_tax_change")}))})).fail((function(e){console.warn("Failed to open template for tax on total. Error is displayed below."),console.error(e)}))}}},{key:"addClickedState",value:function(e){e.setAttribute("data-has-click","")}},{key:"removeClickedState",value:function(e){e&&$(e).each((function(e,t){t.removeAttribute("data-has-click")}))}},{key:"setShrunkPropertyOnLabel",value:function(e,t){t?e.addClass("shrunk"):e.removeClass("shrunk")}},{key:"generateGenericPriceFormatFromInputValue",value:function(e,t){return t=void 0!==t&&t,e=e||"0",parseFloat(e)<0&&(e="0"),parseFloat(e)>100&&!0===t&&(e="100"),(Math.round(100*parseFloat(e||"0"))/100).toFixed(2)}},{key:"generateDiscountAndTaxValue",value:function(e,t,n){var i=e+this.unitType[Ri.PERCENTAGE].unitTypeSymbol;return 1===t&&(i=n+e),i}}]),e}();v()(oa,"NAME","DiscountAndTaxOnTotalInspectorPlugin");var sa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"isSelected",value:function(e,t){for(var n=String(e),i=0,r=t.length;i<r;i++)if(String(t[i])===n)return!0;return!1}},{key:"upgrade",value:function(e,t){var n;n=this,e(t).find("select[data-plugin][data-value]").each((function(){var t;if(this.hasAttribute("data-is-json-value")){t=!0;try{var i=JSON.parse(e(this).attr("data-value")||"null")||null;if(null!==i)switch(!0){case"string"===typeof i:this.value=i;break;case A()(i,Array):for(var r=0,a=this.options.length;r<a;r++)n.isSelected(this.options[r].value,i)&&(this.options[r].selected=!0)}else this.value=null}catch(o){console.warn("Could not parse dropdown values as JSON. Exception is shown below"),console.error(o)}t?e(this).attr("value",null):e(this).attr("data-value",null)}else this.value=e(this).attr("data-value"),e(this).attr("data-value",null),t=!1}))}}]),e}();v()(sa,"NAME","DropDownInspectorPlugin");var la=function(){function e(){o()(this,e),v()(this,"groups",null),v()(this,"modalIsLoading",!1)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find('[data-property-name="choices-isDropdownWithForms"]').each((function(){e(this).on("click","[data-role=edit-dropdowns-forms]",(function(t){if(t.preventDefault(),!i.modalIsLoading){i.changeShowModalStatus();var r=e(this).closest("#item[data-role=editor-panel][data-target-element]").attr("data-target-element"),a=n.getEngine().getDocument().getElementByHash(r);i.editGroupsList(a,e,n)}})).on("change","input[type=checkbox]",(function(){if(this.checked)e(this).closest("[data-role=attribute-group]").attr("data-hide-choices",""),e("[data-role=edit-dropdowns-forms]").trigger("click");else{e(this).closest("[data-role=attribute-group]").attr("data-hide-choices",null);var t=e(this).closest("#item[data-role=editor-panel][data-target-element]").attr("data-target-element");n.getEngine().getDocument().getElementByHash(t).setProperty("choices.isDropdownWithForms",!1).setProperty("choices.values",[{text:"Please Select"}]).synchronizeValue(),n.getEngine().getLoader().getCommandDispatcher().reloadVisiblePanel()}})),function(t){setTimeout((function(){e(t).find("input[type=checkbox]").each((function(){var t=this.checked;e(this).closest("[data-role=attribute-group]").attr("data-hide-choices",t?"":null)}))}),50)}(this)}))}},{key:"editGroupsList",value:function(e,t,n){var i,r,a;i=this,r=n.getEngine().getLoader().getUI(),a=n.getEngine().getResourceManager(),i.loadGroups(t,n).then((function(n){i.includeDependency();var o=r.createDialog("Import forms",[{type:qe.c.SAVE,callback:function(){for(var n=[],i=t("#hiltiSelectGroups").val(),r=0,a=i.length||0;r<a;r++)n.push({text:i[r]});e.setProperty("choices.values",n),o.close()}},{type:qe.c.CANCEL,callback:function(){o.close()}}],{width:"500px",height:"250px"});o.dialog.setAttribute("data-dialog-role","dropdown-forms-list-dialog"),a.get("/modules/Typescript/Form/resources/editor/Dropdown/dropdown-forms-list-dialog.html").then((function(r){var a=new Ai.a(r),s=e.getProperty("choices.values")||[],l=0,u={groups:function(e){for(var t,n=[],i=0,r=e.length;i<r;i++){t=!1;for(var a=0,o=s.length;a<o;a++)if(e[i].id===~~s[a].text){t=!0,l++;break}n.push({id:e[i].id,name:e[i].name,level:e[i].level,selected:t})}return n}(jt.clone(n)),hideClearAll:!(l>=2)};o.body.innerHTML=a.parse(u),i.initiateSelect2DropdownAndDependency(t),i.changeShowModalStatus()})).fail((function(e){r.alert("Error loading component","There was a network error obtaining the dialog contents. Please retry. If the problem persists, contact support",(function(){o.close()}))}))})).fail((function(e){r.alert("Error loading groups","There was a network error obtaining groups. Please retry. If the problem persists, contact support")}))}},{key:"loadGroups",value:function(e,t){return n=this,e.Deferred((function(t){null!==n.groups?t.resolve(n.groups):e.ajax({type:"GET",url:"/modules/CustomScripts/classes/Hilti/DropdownForms/ajaxCall.php",data:{do:"getGroups"},contentType:"application/json",success:function(e){n.groups=e,t.resolve(n.groups)},error:function(){t.reject()}})})).promise();var n}},{key:"includeDependency",value:function(){if(!document.getElementById("select2")){var e=document.getElementsByTagName("head")[0],t=document.createElement("link");t.id="select2",t.rel="stylesheet",t.type="text/css",t.href="/libraries/select2/select2-ver-2-4.0.3/css/select2.min.css",e.appendChild(t);var n=document.createElement("script");n.type="text/javascript",n.src="/libraries/select2/select2-ver-2-4.0.3/js/select2.full.js",e.appendChild(n)}}},{key:"initiateSelect2DropdownAndDependency",value:function(e){setTimeout((function(){e("#hiltiSelectGroups").select2({width:"100%",multiple:!0,placeholder:"*Please Select*",templateResult:function(t){if("undefined"!=typeof t.id){var n=t.id,i=e('#hiltiSelectGroups option[value="'.concat(n,'"]'));if("undefined"!=typeof i.attr("data-type")&&"group"==i.attr("data-type")){var r=e(t.element).find("option").length-e(t.element).find("option:selected").length,a=i.attr("data-level");return e('<span class="i123-folder icon space-'.concat(a).concat(r?"":" group_selected",'"></span> <span class="text">').concat(t.text,"</span>"))}}}})}),100),e(document).off("change","#hiltiSelectGroups").on("change","#hiltiSelectGroups",(function(){var t=e("#hiltiSelectGroups").val(),n=e("#hiltiClearAllButton");null!==t?t.length>1&&n.hasClass("hidden")?n.removeClass("hidden"):t.length<=1&&!n.hasClass("hidden")&&n.addClass("hidden"):n.hasClass("hidden")||n.addClass("hidden")})),e(document).off("click","#hiltiClearAllButton").on("click","#hiltiClearAllButton",(function(){e("#hiltiSelectGroups").val(null).trigger("change"),e(this).addClass("hidden")}))}},{key:"changeShowModalStatus",value:function(){this.modalIsLoading?this.modalIsLoading=!0:this.modalIsLoading=!1}}]),e}();v()(la,"NAME","DropdownsEditFormsListInspectorPlugin");var ua=function(){function e(){o()(this,e),v()(this,"editorUi",null),v()(this,"formulaInputOffsetLeft",void 0),v()(this,"formulaInputOffsetTop",void 0),v()(this,"formulaInputRowHeight",void 0),v()(this,"lastMouseDownKeyCode",null),v()(this,"lastMouseDownControlId",null),v()(this,"availableControls",{}),v()(this,"didRefreshAvailableControls",!1),v()(this,"validationQueues",{}),v()(this,"labelOfDeleted",void 0),v()(this,"labelOfFixedAmount",void 0)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){var r=this,a=t(n),o=t("input[data-plugin=formula]");if(this.lastMouseDownKeyCode=null,this.lastMouseDownControlId=null,this.availableControls={},this.didRefreshAvailableControls=!1,this.editorUi=i,o.length){var s=t("div[data-role=formula-editor]"),l=s.find("div[data-role=formula-input]:first");if(!a.attr("data-formula-one-time-logic")){var u=this.editorUi.getEngine().getI18n(),c=l.attr("data-add-field-label-i18n"),d=l.attr("data-fixed-amount-label-i18n"),p=u.translateText(c),h=u.translateText(d);this.labelOfDeleted=p&&p!==c?p:l.attr("data-add-field-label"),this.labelOfFixedAmount=h&&h!==d?h:l.attr("data-fixed-amount-label")}if(this.initInputMarkupFromFormula(o.val(),s.get(0)),l.off("focus").on("focus",(function(){this.setAttribute("data-focused","1")})),l.off("blur").on("blur",(function(){this.setAttribute("data-focused","0")})),l.parent().perfectScrollbar({minScrollbarLength:50,maxScrollbarLength:50}),s.find("div[data-role=formula-add-controls] > div").perfectScrollbar({minScrollbarLength:50,maxScrollbarLength:50}),!a.attr("data-formula-one-time-logic")){var g=t("div",l);this.formulaInputRowHeight=g.outerHeight()+parseInt(g.css("margin-top"),10)+parseInt(g.css("margin-bottom"),10),this.formulaInputOffsetLeft=l.offset().left+parseInt(l.css("padding-left"),10),this.formulaInputOffsetTop=l.offset().top+parseInt(l.css("padding-top"),10),a.on("mousedown","div[data-role=formula-keypad], div[data-role=formula-add-controls]",(function(n){n.preventDefault(),n.target.hasAttribute("data-control-id")?(r.lastMouseDownKeyCode=null,r.lastMouseDownControlId=t(n.target).attr("data-control-id")):n.target.hasAttribute("data-fixed-amount")?(r.lastMouseDownKeyCode=null,r.lastMouseDownControlId=String(e.CONTROL_ID_FIXED_AMOUNT)):n.target.hasAttribute("data-key-code")?(r.lastMouseDownKeyCode=parseInt(t(n.target).attr("data-key-code"),10),r.lastMouseDownControlId=null):(r.lastMouseDownKeyCode=null,r.lastMouseDownControlId=null)})),a.on("mouseup","div[data-role=formula-keypad], div[data-role=formula-add-controls]",(function(n){if(n.preventDefault(),n.target.hasAttribute("data-control-id")){if(null!==r.lastMouseDownControlId){var i=t(this).closest("div[data-role=formula-editor]").get(0),a=t(i).children("div[data-role=formula-add-controls]"),o=t(n.target).attr("data-control-id");a.attr("data-open","0"),r.addFormulaEntity(o,i,e.ENTITY_TYPE_CONTROL,t)}}else if(n.target.hasAttribute("data-fixed-amount")){if(r.lastMouseDownControlId===String(e.CONTROL_ID_FIXED_AMOUNT)){var s=t(this).closest("div[data-role=formula-editor]").get(0);t(s).children("div[data-role=formula-add-controls]").attr("data-open","0"),r.addFormulaEntity(null,s,e.ENTITY_TYPE_FIXED_AMOUNT,t)}}else if(n.target.hasAttribute("data-key-code")&&null!==r.lastMouseDownKeyCode){var l=parseInt(t(n.target).attr("data-key-code"),10);if(r.lastMouseDownKeyCode===l){var u=t(this).closest("div[data-role=formula-editor]").get(0);r.pressKey(l,u,t)}}r.lastMouseDownKeyCode=null,r.lastMouseDownControlId=null})),a.on("mouseleave","div[data-role=formula-keypad], div[data-role=formula-add-controls]",(function(){r.lastMouseDownKeyCode=null,r.lastMouseDownControlId=null})),a.on("mousedown","div[data-role=formula-input]",(function(e){var n=t(this).closest("div[data-role=formula-editor]").get(0);r.handleMouseInteraction(e,n,t)})),a.on("keydown","div[data-role=formula-input]",(function(e){var n=t(this).closest("div[data-role=formula-editor]").get(0);r.handleKeyboardInteraction(e,n,t)})),a.on("keypress","div[data-role=formula-input]",(function(e){var n=t(this).closest("div[data-role=formula-editor]").get(0);r.handleKeyboardInteraction(e,n,t)})),a.attr("data-formula-one-time-logic","1")}}}},{key:"refreshAvailableControls",value:function(){if(!this.didRefreshAvailableControls){var e=this.editorUi.getEngine().getDocument(),t=$("#item").attr("data-target-element"),n=e.getElementByHash(t),i=e.getControlsList();this.availableControls={};for(var r=0;r<i.length;r++){var a=i[r].getTypeId();i[r].getId()==n.getId()||a!==C.a.CONTROL_TYPE_FORMULA&&a!==C.a.CONTROL_TYPE_NUMBER&&a!==C.a.CONTROL_TYPE_TEXT&&a!==C.a.CONTROL_TYPE_DROPDOWN&&a!==C.a.CONTROL_TYPE_RADIO&&a!==C.a.CONTROL_TYPE_CHECKBOX&&a!==C.a.CONTROL_TYPE_DATE&&a!==C.a.CONTROL_TYPE_TIME&&a!==C.a.CONTROL_TYPE_PRICE&&a!==C.a.CONTROL_TYPE_LIKERT_SCALE&&a!==C.a.CONTROL_TYPE_STAR_RATING&&a!==C.a.CONTROL_TYPE_TERMS_OF_SERVICE||(this.availableControls[i[r].getId()]=i[r])}this.didRefreshAvailableControls=!0}}},{key:"initInputMarkupFromFormula",value:function(t,n){var i=this,r="",a=$(n).find("div[data-role=formula-input]:first").get(0);(t=(t=t.trim().replace(/\s\s+/g," ")).replace(/(-)(:control_[\d]+(_[\d]+)?|:fixed_amount)/g,"$1 $2")).length&&(this.refreshAvailableControls(),t.split(" ").forEach((function(e){if(0==e.indexOf(":control_")){var t=e.split("_").pop(),n="1";i.availableControls.hasOwnProperty(t)?e=i.availableControls[t].getLabelDOMNode().innerText:(e=i.labelOfDeleted,n="0"),r+='<span data-control-id="'.concat(t,'" data-valid="').concat(n,'">').concat(e,"</span>")}else if(":fixed_amount"===e)e=i.labelOfFixedAmount,r+='<span data-fixed-amount="true">'.concat(e,"</span>");else for(var a=0;a<e.length;a++)r+='<span data-character="'.concat(e[a],'">').concat(e[a],"</span>")}))),r+=e.getCaretMarkup(),$(a).html(r)}},{key:"handleMouseInteraction",value:function(e,t,n){var i=n(t).find("div[data-role=formula-input]:first"),r=n("div",i);if(e.target===i.get(0)){var a=e.pageX-this.formulaInputOffsetLeft,o=e.pageY-this.formulaInputOffsetTop;a<1&&o<this.formulaInputRowHeight?r.detach().prependTo(i):r.detach().appendTo(i)}else n(e.target).is("span")&&r.detach().insertAfter(e.target);e.preventDefault(),document.activeElement!==i.get(0)&&i.focus()}},{key:"handleKeyboardInteraction",value:function(t,n,i){if("keydown"!=t.type){var r=null;switch(t.preventDefault(),t.which){case 48:r=e.KEY_CODE_ZERO;break;case 49:r=e.KEY_CODE_ONE;break;case 50:r=e.KEY_CODE_TWO;break;case 51:r=e.KEY_CODE_THREE;break;case 52:r=e.KEY_CODE_FOUR;break;case 53:r=e.KEY_CODE_FIVE;break;case 54:r=e.KEY_CODE_SIX;break;case 55:r=e.KEY_CODE_SEVEN;break;case 56:r=e.KEY_CODE_EIGHT;break;case 57:r=e.KEY_CODE_NINE;break;case 40:r=e.KEY_CODE_PARENTHESES_OPEN;break;case 41:r=e.KEY_CODE_PARENTHESES_CLOSE;break;case 47:r=e.KEY_CODE_DIVIDE;break;case 42:r=e.KEY_CODE_MULTIPLY;break;case 45:r=e.KEY_CODE_SUBSTRACT;break;case 43:r=e.KEY_CODE_ADD;break;case 46:r=e.KEY_CODE_DECIMAL_POINT;break;default:return}this.pressKey(r,n,i)}else 8==t.keyCode?(t.preventDefault(),this.executeInputAction(e.INPUT_ACTION_DELETE_ONE,n,null,i)):37==t.keyCode?(t.preventDefault(),this.executeInputAction(e.INPUT_ACTION_MOVE_LEFT,n,null,i)):39==t.keyCode&&(t.preventDefault(),this.executeInputAction(e.INPUT_ACTION_MOVE_RIGHT,n,null,i))}},{key:"pressKey",value:function(t,n,i){var r=null;switch(t){case e.KEY_CODE_ADD_FIELD:var a=i(n).children("div[data-role=formula-add-controls]");if("1"==a.attr("data-open"))a.attr("data-open","0");else{this.refreshAvailableControls();var o="",s=this.editorUi.getEngine().getDocument().getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING);for(var l in this.availableControls)if(this.availableControls.hasOwnProperty(l)){var u=this.availableControls[l];o+='<span data-control-id="'.concat(l,'">').concat(u.getLabelDOMNode().innerText,"</span>")}s&&s.hasProperty("fixedAmount")&&null!==s.getProperty("fixedAmount")&&(o+='<span data-fixed-amount="true">'.concat(this.labelOfFixedAmount,"</span>")),a.children("div").html(o),""!=o&&(a.attr("data-open","1"),setTimeout((function(){a.children("div").scrollTop(1)}),0))}return;case e.KEY_CODE_ZERO:r="0";break;case e.KEY_CODE_ONE:r="1";break;case e.KEY_CODE_TWO:r="2";break;case e.KEY_CODE_THREE:r="3";break;case e.KEY_CODE_FOUR:r="4";break;case e.KEY_CODE_FIVE:r="5";break;case e.KEY_CODE_SIX:r="6";break;case e.KEY_CODE_SEVEN:r="7";break;case e.KEY_CODE_EIGHT:r="8";break;case e.KEY_CODE_NINE:r="9";break;case e.KEY_CODE_PARENTHESES_OPEN:r="(";break;case e.KEY_CODE_PARENTHESES_CLOSE:r=")";break;case e.KEY_CODE_DIVIDE:r="/";break;case e.KEY_CODE_MULTIPLY:r="*";break;case e.KEY_CODE_SUBSTRACT:r="-";break;case e.KEY_CODE_ADD:r="+";break;case e.KEY_CODE_DECIMAL_POINT:r=".";break;case e.KEY_CODE_DELETE_ONE:return void this.executeInputAction(e.INPUT_ACTION_DELETE_ONE,n,null,i);case e.KEY_CODE_DELETE_ALL:return void this.executeInputAction(e.INPUT_ACTION_DELETE_ALL,n,null,i);default:return}this.addFormulaEntity(r,n,e.ENTITY_TYPE_REGULAR,i)}},{key:"addFormulaEntity",value:function(t,n,i,r){var a=document.createElement("span");switch(i){case e.ENTITY_TYPE_CONTROL:if(!this.availableControls.hasOwnProperty(t))return;a.setAttribute("data-control-id",t),t=this.availableControls[t].getLabelDOMNode().innerText;break;case e.ENTITY_TYPE_FIXED_AMOUNT:a.setAttribute("data-fixed-amount","true"),t=this.labelOfFixedAmount;break;case e.ENTITY_TYPE_REGULAR:a.setAttribute("data-character",t);break;default:return}a.appendChild(document.createTextNode(t)),this.executeInputAction(e.INPUT_ACTION_ADD,n,a,r)}},{key:"executeInputAction",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0,a=r(n).find("div[data-role=formula-input]:first").get(0),o=r(n).parent().parent().parent().find("div[data-role=element-error]").length,s=!0;if(document.activeElement!==a){switch(t){case e.INPUT_ACTION_ADD:r("div",a).detach().appendTo(a),r(i).insertBefore(r("div",a));break;case e.INPUT_ACTION_DELETE_ONE:r("div",a).detach().appendTo(a),r("span",a).last().remove();break;case e.INPUT_ACTION_DELETE_ALL:r(a).children().not("div").remove();break;default:return}r(a).focus()}else{var l,u=r("div",a);switch(t){case e.INPUT_ACTION_ADD:r(i).insertBefore(u);break;case e.INPUT_ACTION_MOVE_LEFT:s=!1,(l=u.prev("span")).length&&u.detach().insertBefore(l);break;case e.INPUT_ACTION_MOVE_RIGHT:s=!1,(l=u.next("span")).length&&u.detach().insertAfter(l);break;case e.INPUT_ACTION_DELETE_ONE:u.prev().remove();break;case e.INPUT_ACTION_DELETE_ALL:r(a).children().not(u).remove();break;default:return}}if(s)switch(!0){case e.INPUT_ACTION_TRIGGER_SAVE_ON_BLUR:this.triggerFormulaEvaluationOnBlur(r,a);break;case o>0:this.validateFormula(a,r),this.triggerFormulaEvaluationOnBlur(r,a);break;default:this.validateFormula(a,r)}}},{key:"triggerFormulaEvaluationOnBlur",value:function(e,t){var n=this;e(t).off("blur").one("blur",(function(){t.setAttribute("data-focused","0"),n.validateFormula(t,e)})),e('[data-role="page"]').off("click").one("click",(function(){t.setAttribute("data-focused","0"),n.validateFormula(t,e)}))}},{key:"validateFormula",value:function(e,t){var n=this,i=t("#item").attr("data-target-element");this.validationQueues.hasOwnProperty(i)&&clearTimeout(this.validationQueues[i]),this.validationQueues[i]=setTimeout((function(){var r=n.editorUi.getEngine().getDocument().getElementByHash(i);if(r){var a=t(e).children("span"),o="";a.each((function(){var e="";(e=this.hasAttribute("data-control-id")?":control_".concat(this.getAttribute("data-control-id")):this.hasAttribute("data-fixed-amount")?":fixed_amount":this.innerText).length&&("."==e||parseInt(e,10)>=0?o+=e:o="".concat(o.trim()," ").concat(e," "))})),o=(o=o.trim()).replace(/([*\/+]\s-)\s/g,"$1"),r.setProperty("calculations.formula",o)}}),500)}}],[{key:"getCaretMarkup",value:function(){return"<div><strong></strong></div>"}}]),e}();v()(ua,"NAME","FormulaInspectorPlugin"),v()(ua,"ENTITY_TYPE_REGULAR",1),v()(ua,"ENTITY_TYPE_CONTROL",2),v()(ua,"ENTITY_TYPE_FIXED_AMOUNT",3),v()(ua,"CONTROL_ID_FIXED_AMOUNT",-1),v()(ua,"KEY_CODE_ADD_FIELD",100),v()(ua,"KEY_CODE_ZERO",1),v()(ua,"KEY_CODE_ONE",2),v()(ua,"KEY_CODE_TWO",3),v()(ua,"KEY_CODE_THREE",4),v()(ua,"KEY_CODE_FOUR",5),v()(ua,"KEY_CODE_FIVE",6),v()(ua,"KEY_CODE_SIX",7),v()(ua,"KEY_CODE_SEVEN",8),v()(ua,"KEY_CODE_EIGHT",9),v()(ua,"KEY_CODE_NINE",10),v()(ua,"KEY_CODE_PARENTHESES_OPEN",11),v()(ua,"KEY_CODE_PARENTHESES_CLOSE",12),v()(ua,"KEY_CODE_DELETE_ONE",13),v()(ua,"KEY_CODE_DELETE_ALL",14),v()(ua,"KEY_CODE_DIVIDE",15),v()(ua,"KEY_CODE_MULTIPLY",16),v()(ua,"KEY_CODE_SUBSTRACT",17),v()(ua,"KEY_CODE_ADD",18),v()(ua,"KEY_CODE_DECIMAL_POINT",19),v()(ua,"INPUT_ACTION_ADD",1),v()(ua,"INPUT_ACTION_MOVE_LEFT",2),v()(ua,"INPUT_ACTION_MOVE_RIGHT",3),v()(ua,"INPUT_ACTION_DELETE_ONE",4),v()(ua,"INPUT_ACTION_DELETE_ALL",5),v()(ua,"INPUT_ACTION_TRIGGER_SAVE_ON_BLUR",!0);var ca=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){e(t).attr("data-html-editor-upgraded")||(e(t).on("click","input[type=hidden][data-role=html-editor] + a[data-role=html-popup]",(function(t){var i=this.getAttribute("data-dialog-title")||"Edit Rich Text",r=this.getAttribute("data-dialog-title-i18n")||"edt_UI_create_dialog_edit_rich_text",a=e("#item").attr("data-target-element"),o=n.getEngine().getDocument().getElementByHash(a),s=e(this).closest("[data-role=property]").attr("data-property-name"),l=null;[C.a.CONTROL_TYPE_FORM_HEADER,C.a.CONTROL_TYPE_HTML_BLOCK].indexOf(o.getTypeId())>-1&&"configuration-innerHTML"===s&&(l="\n                    html > body {\n                        background-color: ".concat(n.getEngine().getTheme().getMergedProperties().page.background.color,";\n                        color: ").concat(n.getEngine().getTheme().getMergedProperties().form.color,";\n                    }\n                ")),e(this).prev("input[type=hidden][data-role=html-editor]").each((function(){n.getEngine().getLoader().execCommand("edit-html",this,i,r,l)}))})),e(t).attr("data-html-editor-upgraded","1"))}}]),e}();v()(ca,"NAME","HTMLEditorInspectorPlugin");var da=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){e(t).find("input[type=file][data-plugin=image-uploader]").each((function(){!function(t,i,r){var a=e(r).find("input[type=text]").get(0),o=e(r).find("div[data-role=remove-image]").get(0),s=a.value,l=document.createElement("img");l.setAttribute("data-role","inserted-image-container"),e(l).on("load",(function(){e(r).attr("data-image-is-loaded","")})).on("error",(function(){e(r).removeAttr("data-image-is-loaded")})),e(r).find("div[data-role=uploader-label]").append(l),l.src=jt.getImageURLAntiCache(s);var u=e(r).closest("#item, #options").attr("data-target-element"),c=null;u&&!(c=n.getEngine().getDocument().getElementByHash(u))||(e(o).on("click",(function(){t.value=null,l.src=jt.getImageURLAntiCache(""),e(a).val("").trigger("input"),c&&(c.setProperty("configuration.remoteURL",null),c.setProperty("configuration.name",null),c.setProperty("configuration.mimeType",null),c.setProperty("configuration.size",null))})),e(a).on("input",(function(){l.src=jt.getImageURLAntiCache(this.value),c&&(c.setProperty("configuration.remoteURL",""),c.setProperty("configuration.remoteURL",this.value),c.setProperty("configuration.name",null),c.setProperty("configuration.mimeType",null),c.setProperty("configuration.size",null))})),t.addEventListener("change",(function(o){var s=t.files[0];if(s)if(s.size)if(/^image\/(png|jpg|jpeg|gif)$/i.test(s.type))if(s.size>5242880)console.warn("file size greater than 5 mb");else{var d=c?c.getId():null;if(!c||d){var p=i.createUpload(s).withControlId(d).withArchivePacking(!1).withUploaderInstanceIndex(~~!!d||"theme_".concat(e(t).closest("[data-property-name]").attr("data-property-name").replace(/\./g,"_")));l.src="",p.on("success",(function(){var n=p.getStoredFileURLFromCloud();l.setAttribute("src",jt.getImageURLAntiCache(n)),c?(e(a).val(n).trigger("input"),c.setProperty("configuration.remoteURL",""),c.setProperty("configuration.remoteURL",n),c.setProperty("configuration.name",p.getStoredFileNameOnServer()),c.setProperty("configuration.mimeType",p.getMimeType()),c.setProperty("configuration.size",p.getSize())):e(a).val(jt.getImageURLAntiCache(n)).trigger("input"),t.value=null,e(r).removeAttr("data-is-uploading")})),p.on("error",(function(i){t.value=null,c&&(c.setProperty("configuration.remoteURL",null),c.setProperty("configuration.name",null),c.setProperty("configuration.mimeType",null),c.setProperty("configuration.size",null)),n.getEngine().getLoader().getUI().alert("There was an error uploading your file to our server",i.toString()),e(r).removeAttr("data-is-uploading")})),e(r).attr("data-is-uploading","1"),p.upload(),e(r).find("input[type=text]").on("input",(function(){c&&(c.setProperty("configuration.remoteURL",""===this.value?null:this.value),c.setProperty("configuration.name",null),c.setProperty("configuration.mimeType",null),c.setProperty("configuration.size",null))}))}else console.warn("element with hash ".concat(u," don't have a id: ").concat(JSON.stringify(d)))}else console.warn("not a picture but a ".concat(JSON.stringify(s.type)));else console.warn("empty file");else console.warn("no file found")}),!0))}(this,n.getEngine().getUploadsService(),e(this).closest("div[data-role=property]").get(0))}))}}]),e}();v()(da,"NAME","ImageUploaderInspectorPlugin");var pa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find("input[type=number][data-plugin=size-int]").each((function(){e(this).next("input[type=range]").val(this.value),e(this).closest("[data-role=property]").attr("data-is-range-property","")})).closest("[data-role=property]").attr("data-plugin","size-int"),e(t).attr("number-upgraded")||(e(t).on("input change","input[type=number][data-plugin=size-int]",(function(){var t=parseFloat(this.value)||0;this.title=String(this.value||""),e(this).next("input[type=range]").each((function(){this.value=t}))})).on("blur","input[type=number][data-plugin=size-int]",(function(){var t=parseFloat(this.value)||0;this.value=t=i.limitToRange(this,t),this.title=String(this.value||""),e(this).next("input[type=range]").each((function(){this.value=t})),n.getEngine().getLoader().getCommandDispatcher().dispatchPropertyChangeInThemePanel(this,"value")})).on("change","input[type=number][data-plugin=size-int] + input[type=range]",(function(){var t=parseFloat(this.value)||0;e(this).prev("input[type=number]").val(t).trigger("input"),n.getEngine().getLoader().execCommand("track-event","edt_slider_change",{},1e3)})),e(t).attr("number-upgraded","1"))}},{key:"limitToRange",value:function(e,t){var n=e.hasAttribute("data-min")?~~e.getAttribute("data-min"):null,i=e.hasAttribute("data-max")?~~e.getAttribute("data-max"):null;return i&&t>i&&(t=i),n&&t<n&&(t=n),t}}]),e}();v()(pa,"NAME","InputTypeNumberInspectorPlugin");var ha=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"parseSizeInPixels",value:function(e){if("string"===typeof e){var t=/^((-)?([\d]+))(px)?$/.exec(e);return t?~~t[1]:0}return 0}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find("input[type=text][data-plugin=size-px]").each((function(){e(this).next("input[type=range]").val(i.parseSizeInPixels(this.value)),e(this).closest("[data-role=property]").attr("data-is-range-property","")})).closest("[data-role=property]").attr("data-plugin","size-px"),e(t).attr("data-size-in-pixels-upgraded")||(e(t).on("input change","input[type=text][data-plugin=size-px]",(function(){this.title=String(this.value);var t=i.parseSizeInPixels(this.value);e(this).next("input[type=range]").each((function(){this.value=t}))})).on("keydown","input[type=text][data-plugin=size-px]",(function(t){var n=t.keyCode,r=i.parseSizeInPixels(this.value),a=!1;switch(n){case 40:r>0&&(r--,a=!0);break;case 38:r++,a=!0}a&&(t.preventDefault(),this.value="".concat(r,"px"),e(this).trigger("input"))})).on("blur","input[type=text][data-plugin=size-px]",(function(){this.value="".concat(i.parseSizeInPixels(this.value),"px"),e(this).trigger("input")})),e(t).on("change","input[type=text][data-plugin=size-px] + input[type=range]",(function(){var t=this.value;e(this).prev("input[type=text]").val("".concat(t,"px")).trigger("input"),n.getEngine().getLoader().execCommand("track-event","edt_slider_change",{},1e3)})),e(t).attr("data-size-in-pixels-upgraded","1"))}}]),e}();v()(ha,"NAME","InputTypeSizeInPixelsInspectorPlugin");var ga=function(){function e(){o()(this,e),v()(this,"templatePath","/modules/Typescript/Form/resources/edit-likert-option-dialog.html"),v()(this,"totalQuizPoints",0),v()(this,"userService",void 0),this.userService=window.userService.getInstance()}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find("input[type=hidden][data-plugin=text-choice-interface-likert][data-value]").each((function(){var t,r;(r=(t=this).getAttribute("data-value"))&&JSON.parse(r),t.removeAttribute("data-value"),e(t).parent().find("[data-role=secondary]").on("click","a[data-role=edit-likert-quiz]",(function(){for(var r=e(this).data("dialog-title"),a=e(this).data("dialog-title-i18n"),o=n.getEngine().getLoader().getSelection().getItems()[0],s=o.getProperty("options.quizOptions"),l=o.getProperty("choices.statements"),u=n.getEngine().getDocument(),c=[],d=0,p=o.getChildren().length;d<p;d++)c.push(o.getChildren()[d].getHash());i.totalQuizPoints=jt.getFormPointsWithoutElements(u,c),i.editQuizOptions({editorUserInterface:n,popupTitle:r,i18nPopupTitle:a,choices:s,statements:l,inputType:T.f.RADIO,totalPoints:jt.getFormTotalPoints(u)},n.getEngine().getFactory()).then((function(n){i.updateQuizOptions(n,t,e)})).fail((function(e){console.warn("Quiz settings not saved"),console.log(e)}))}))}))}},{key:"updateQuizOptions",value:function(e,t,n){for(var i=[],r=0,a=e.length;r<a;r++){for(var o=[],s=0,l=e[r].length;s<l;s++)o.push({text:e[r][s].text,isDefault:e[r][s].isDefault,isCorrect:e[r][s].isCorrect,quizPoints:e[r][s].quizPoints,numberOfTimesThisOptionCanBeChosen:e[r][s].numberOfTimesThisOptionCanBeChosen?e[r][s].numberOfTimesThisOptionCanBeChosen:null,paymentsValue:e[r][s].paymentsValue?e[r][s].paymentsValue:null,i18nLabel:null!=e[r][s].i18nLabel?e[r][s].i18nLabel:""});i.push(JSON.parse(JSON.stringify(o)))}t.value=JSON.stringify(i),n(t).trigger("input"),t.getAttribute("data-synchronize-other-properties")&&n(t.getAttribute("data-synchronize-other-properties")).val(JSON.stringify(i)).trigger("reload")}},{key:"editQuizOptions",value:function(e,t){return function(t,n,i,r,a,o){return i.Deferred((function(i){if(t.checkIfShouldDisplayPaywall(o))return i.reject();r.get(t.templatePath).then((function(r){for(var s={statements:[],formTotalPoints:e.totalPoints,formTotalPointsText:"Form total points:",formTotalPointsTextI18n:"edt_text_form_total_points"},l=0,u=e.choices.length;l<u;l++){for(var c={choices:[],i18n:null,text:e.statements[l].text,inputType:e.inputType,index:l},d=0;d<e.choices[l].length;d++){var p=e.choices[l][d],h={isCorrect:p.isCorrect,isDefault:p.isDefault,numberOfTimesThisOptionCanBeChosen:p.numberOfTimesThisOptionCanBeChosen,quizPoints:p.quizPoints,paymentsValue:p.paymentsValue,text:p.text,index:d};c.choices.push(h)}s.statements.push(c)}var g=t.showDialog(n,r,s,e,o,a,i);t.initDialogListeners(g,s)})).fail((function(e){i.reject(e)}))})).promise()}(this,e.editorUserInterface.getEngine().getLoader().getUI(),e.editorUserInterface.getEngine().getJQuery(),e.editorUserInterface.getEngine().getResourceManager(),e.editorUserInterface.getEngine().getI18n(),e.editorUserInterface.getEngine().getLoader().getCommandDispatcher())}},{key:"checkIfShouldDisplayPaywall",value:function(e){return!this.userService.canUseQuizOptions()&&(e.triggerPaywall(qe.h.QUIZ_OPTIONS_NOT_SUPPORTED_IN_CURRENT_USER_PLAN),!0)}},{key:"showDialog",value:function(e,t,n,i,r,a,o){var s=this.getDialogTitle(i,a),l=[{type:qe.c.CANCEL,callback:function(){u.close(),o.reject(new Error("Closed the popup by pressing cancel"))}},{type:qe.c.SAVE,callback:function(){for(var e=[],t=0,i=n.statements.length;t<i;t++)e.push(n.statements[t].choices);u.close(),o.resolve(e)}}],u=e.createDialog(s,l,{width:"600px",height:"600px"});return u.body.setAttribute("data-dialog-role","edit-option"),u.body.innerHTML=this.parseTemplate(t,n),a.translateDOMNode(u.body),r.addPerfectScrollbar(u.body),u}},{key:"parseTemplate",value:function(e,t){return new Ai.a(e).parse(t)}},{key:"getDialogTitle",value:function(e,t){return null!=e.i18nPopupTitle?t.translateText(e.i18nPopupTitle):e.popupTitle}},{key:"initDialogListeners",value:function(e,t){var n;n=this,$(e.body).find("input[type=number][data-statement][data-index]").focus((function(){var t=$(this).data("statement"),i=$(this).data("index");$("input[type=number][data-statement=".concat(t,"]:not([data-index=").concat(i,"])")).each((function(){0!==parseInt($(this).val())&&$(this).val("0")})),$("input[type=radio][data-statement=".concat(t,"]")).prop("checked",!1),$("input[type=radio][data-statement=".concat(t,"][data-index=").concat(i,"]")).prop("checked",!0),n.updateTotalQuizPoints(e)})).on("input",(function(){for(var i=$(this).val();"0"===i.charAt(0);)i=i.substr(1);""==i&&(i="0"),$(this).val(i);for(var r=$(this).data("statement"),a=$(this).data("index"),o=0,s=t.statements[r].choices.length;o<s;o++)o!=a&&(t.statements[r].choices[o].isCorrect=!1,t.statements[r].choices[o].quizPoints=0);t.statements[r].choices[a].isCorrect=!0,t.statements[r].choices[a].quizPoints=~~i,n.updateTotalQuizPoints(e)})),$(e.body).find("input[type=radio][data-statement][data-index]").click((function(){for(var i=$(this).data("statement"),r=$(this).data("index"),a=t.statements[i].choices[r].isCorrect,o=0,s=t.statements[i].choices.length;o<s;o++)o!=r&&(t.statements[i].choices[o].isCorrect=!1,t.statements[i].choices[o].quizPoints=0);t.statements[i].choices[r].isCorrect=!a;var l=$("input[type=number][data-statement=".concat(i,"][data-index=").concat(r,"]"));a?(l.val("0"),$("input[type=radio][data-statement=".concat(i,"][data-index=").concat(r,"]")).prop("checked",!1),t.statements[i].choices[r].quizPoints=0):(l.focus().select(),$("input[type=radio][data-statement=".concat(i,"][data-index=").concat(r,"]")).prop("checked",!0),$("input[type=number][data-statement=".concat(i,"]:not([data-index=").concat(r,"])")).val("0")),n.updateTotalQuizPoints(e)}))}},{key:"updateTotalQuizPoints",value:function(e){var t=0;$("input[type=number][name=quiz-points]").each((function(){t+=parseInt($(this).val())})),t+=this.totalQuizPoints,$(e.body).find("div[data-role=form-total-points] span[data-role=form-total-points]").text(t)}}]),e}();v()(ga,"NAME","LikertQuizOptionsInspectorPlugin");var _a=function(){function e(){o()(this,e),v()(this,"userService",void 0),this.userService=window.userService.getInstance()}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){var r;r=this,t(n).find("input[type=hidden][data-plugin=likert-wrapper-choice-stament][data-value]").each((function(){var n,a,o,s,l,u;a=(n=this).getAttribute("data-value"),o=[],s=n.getAttribute("data-new-statement-title")||"New Statement",l=n.getAttribute("data-new-statement-title-i18n"),u=~~n.getAttribute("data-context"),n.removeAttribute("data-value"),a&&(o=JSON.parse(a)||[]),t(n).parent().find("[data-role=secondary]").each((function(){t(n).closest("label").after(this),function(a){for(var c=t(a).find("[data-role=container]"),d=0,p=o.length;d<p;d++)o[d].index=d,c.append(r.createI18nStatementElement(o[d],o[d].index));r.updateContainerAttributes(a,o),r.makeStatementsInInspectorSortable(r,t,a,o,n),t(a).on("input","div[data-role=statement] input[type=text]",(function(e){var i=~~t(this).closest("[data-role=statement]").attr("data-index");o[i]&&(o[i].text=this.value,r.updateStatements(o,n,t))})).on("click","div[data-role=statement] div[data-role=remove]",(function(e){o.length<=1||(i.getEngine().getLoader().execCommand("track-event","edt_inspector_choice_option_remove"),t(this).closest("[data-role=statement]").each((function(){var e=parseInt(this.getAttribute("data-index")),i=this.parentNode;o.splice(e,1),i.removeChild(this),t(i).find("div[data-role=statement]").each((function(e){this.setAttribute("data-index",String(e))})),r.updateStatements(o,n,t),r.updateContainerAttributes(a,o)})))})).on("click","a[data-role=edit-option], a[data-role=edit-more-option]",(function(){var e=String(this.getAttribute("data-dialog-title")||"Statements option..."),s=String(this.getAttribute("data-dialog-title-i18n")),l=String(this.getAttribute("data-item-type-name")||"STATEMENT"),u=String(this.getAttribute("data-item-type-name-i18n")),d=String(this.getAttribute("data-new-statement-title")||"New Statement"),p=String(this.getAttribute("data-new-statement-title-i18n")),h=u&&i.getEngine().getI18n().translateText(u)&&u!==i.getEngine().getI18n().translateText(u)?i.getEngine().getI18n().translateText(u):l;r.editStatements(o,a,s?i.getEngine().getI18n().translateText(s):e,i,h,p?i.getEngine().getI18n().translateText(p):d).then((function(e){o=JSON.parse(JSON.stringify(e)),c.find("div[data-role=statement]").remove();for(var i=0,s=o.length;i<s;i++)o[i].index=i,c.append(r.createI18nStatementElement(o[i],o[i].index));r.updateContainerAttributes(a,o),r.updateStatements(o,n,t),r.makeStatementsInInspectorSortable(r,t,a,o,n)})).fail((function(e){console.warn("Failed to save options. Error is displayed below"),console.error(e)}))})).on("click","a[data-role=add-statement]",(function(e){if(i.getEngine().getLoader().execCommand("track-event","edt_inspector_choice_option_add"),u!==C.a.CONTAINER_TYPE_LIKERT_WRAPPER||!r.triggerUpgdragePaywallOnAddStatement(o,i,e)){var d=r.createUniqueStatement({text:l?i.getEngine().getI18n().translateText(l):s,index:o.length},o),p=i.getEngine().getLoader().getSelection().getItems(),h=0!==p.length?p[0]:null,g=h.hasProperty("choices.scale")?h.getProperty("choices.scale"):[],_=g.length,f=t(a).closest("#item").find("input[type=hidden][data-plugin=text-choice-interface]").get(0),y=f?f.getAttribute("data-synchronize-other-properties"):"";if(o.push(d),c.append(r.createI18nStatementElement(d,d.index)),r.updateStatements(o,n,t),r.updateContainerAttributes(a,o),r.makeStatementsInInspectorSortable(r,t,a,o,n),g){g[_]=[];for(var E=0,m=g[0].length;E<m;E++)g[_][E]=bi.createUniqueChoice({text:g[0][E].text,isDefault:"undefined"!==typeof g[0][E].isDefault&&null!==g[0][E].isDefault?g[0][E].isDefault:null,index:E,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,isCorrect:"undefined"!==typeof g[0][E].isCorrect&&null!==g[0][E].isCorrect?g[0][E].isCorrect:null,quizPoints:0,paymentsValue:null},g);f.value=JSON.stringify(g),t(f).trigger("input"),y&&t(y).val(f.value).trigger("reload")}}})).parent().on("click","a[data-role=import-statement]",(function(e){var s=JSON.parse(this.getAttribute("data-sets")||"[]"),l=String(this.getAttribute("data-dialog-title")||"Import statements"),u=String(this.getAttribute("data-dialog-title-i18n")||"");i.getSelectedDataset(s,u?i.getEngine().getI18n().translateText(u):l,o).then((function(s){if(!r.triggerUpgdragePaywallOnAddStatement(s.getValues(),i,e)){c.find("[data-role=statement]").remove(),o=[];for(var l=0,u=s.getValues(),d=u.length;l<d;l++)o.push(u[l]),o[l].index=l,c.append(r.createI18nStatementElement(o[l],o[l].index));r.updateStatements(o,n,t),r.updateContainerAttributes(a,o),r.makeStatementsInInspectorSortable(r,t,a,o,n)}})).fail((function(e){console.warn("Failed to import statements. Error is displayed below"),console.error(e)}))})).on("keydown","input",(function(u){if((u.keyCode||u.charCode)===at.KEY_ENTER&&o[o.length-1].text){var c=~~t(this.parentNode).attr("data-index");if(o.length>e.MAX_VISIBLE_NUMBER_OF_STATEMENTS_IN_INSPECTOR_PANEL&&c===e.MAX_VISIBLE_NUMBER_OF_STATEMENTS_IN_INSPECTOR_PANEL&&t("a[data-role=edit-more-option][data-target=statements]").trigger("click"),c<e.MAX_VISIBLE_NUMBER_OF_STATEMENTS_IN_INSPECTOR_PANEL){if(r.triggerUpgdragePaywallOnAddStatement(o,i,u))return;var d=r.createUniqueStatement({text:l?i.getEngine().getI18n().translateText(l):s,index:o.length},o),p=r.createI18nStatementElement(d,d.index);o.splice(c+1,0,d),t(p).insertAfter(this.parentNode),r.reinitializeStatementsIndexes(o,a,t),r.updateStatements(o,n,t),r.updateContainerAttributes(a,o),r.makeStatementsInInspectorSortable(r,t,a,o,n),t(p).find("input").focus().select()}}})).on("paste","[data-role=statement] > input[type=text]",(function(e){var s,l=[],u=~~t(this).closest("div[data-role=statement]").attr("data-index");try{var c=e.originalEvent||{},d=e.originalEvent.clipboardData||null;if(!d)return;s=d.getData("text/plain");var p=String(s||"").replace(/(^[\s]+|[\s]+$)/g,"");if(!(p.indexOf("\n")>-1))return;l=p.split("\n"),c.preventDefault(),c.stopPropagation();for(var h=0,g=l.length;h<g;h++){if(r.triggerUpgdragePaywallOnAddStatement(o,i,e))return;var _=r.createUniqueStatement({text:l[h],index:u+h+1},o),f=r.createI18nStatementElement(_,_.index);o.splice(_.index,0,_),t(f).insertAfter(t("div[data-role=statement][data-index=".concat(_.index-1,"]"))),r.reinitializeStatementsIndexes(o,a,t),r.updateContainerAttributes(a,o)}r.updateStatements(o,n,t),r.makeStatementsInInspectorSortable(r,t,a,o,n)}catch(y){return}}))}(this)}))}))}},{key:"updateContainerAttributes",value:function(t,n){t.setAttribute("data-truncate-options",String(~~(n.length>e.MAX_VISIBLE_NUMBER_OF_STATEMENTS_IN_INSPECTOR_PANEL)))}},{key:"isUniqueSetOfStatements",value:function(e){if(!e)return!0;for(var t=0,n=e.length;t<n;t++)for(var i=0;i<t;i++)if(e[t].text===e[i].text)return!1;return!0}},{key:"createUniqueStatement",value:function(e,t){var n,i,r=0,a=e.text;if(!t||!t.length)return e;do{n=!0,i=0===r?a:"".concat(a," (").concat(r,")");for(var o=0,s=t.length;o<s;o++)if(t[o].text===i){n=!1,r++;break}}while(!n);return e.text=i,e}},{key:"reinitializeStatementsIndexes",value:function(e,t,n){for(var i=0,r=e.length;i<r;i++)e[i].index=i;n(t).find("[data-role=statement]").each((function(e){this.setAttribute("data-index",String(e))}))}},{key:"editStatements",value:function(e,t,n,i,a,o){var s=JSON.parse(JSON.stringify(e));return function(l,u,c,d,p,h){return c.Deferred((function(g){d.get("/modules/Typescript/Form/resources/edit-statements-dialog.html").then((function(d){var _,f=new Ai.a(d),y={statements:e,editStatementsDialogItemTypeName:a},E=e;(_=l.createDialog(n,[{type:qe.c.CANCEL,callback:function(){for(;e.length;)e.pop();for(var t=0,n=s.length;t<n;t++)e.push(s[t]);_.close(),g.reject(new Error("User closed the dialog by pressing the Cancel button"))}},{type:qe.c.SAVE,callback:function(){u.isUniqueSetOfStatements(e)?(_.close(),g.resolve(e)):l.alert("Error Saving Statements","You are not allowed to have 2 or more statements with the same value")}}],{width:"600px",height:"600px",onCloseButtonClick:function(){g.reject(new Error("User closed the dialog by pressing the X button"))}})).body.setAttribute("data-dialog-role","edit-statement"),_.body.innerHTML=f.parse(y),p.translateDOMNode(_.body),h.addPerfectScrollbar(_.body),u.makeStatementsInEditPanelSortable(u,c,_.body,E),c(_.body).on("click","a[data-role=add-statement]",(function(n){if(!u.triggerUpgdragePaywallOnAddStatement(E,i,n)){u.insertNewStatement(u,E,_.body,t,o,e.length,c,i),u.makeStatementsInEditPanelSortable(u,c,_.body,E);var r=c(this).closest("div[data-dialog-role=edit-statement]");r.scrollTop(r.prop("scrollHeight"))}})).on("input","td[data-role=statement-name] input[type=text]",(function(){var t=~~c(this).closest("tr").attr("data-index"),n=this.value;e[t].text=n})).on("click","tr[data-role=statement] td[data-role=statement-name] div[data-role=remove]",(function(){if(!(E.length<=1)){var e=~~c(this).closest("[data-role=statement]").attr("data-index");E.splice(e,1),c(this).closest("[data-role=statement]").remove(),u.reinitializeStatementsIndexes(E,_.body,c),u.updateContainerAttributes(t,E)}})).on("input","td[data-role=statement-name] input[type=text]",(function(){var t=~~c(this).closest("tr").attr("data-index"),n=this.value;e[t].text=n})).on("keydown","input[type=text][data-role=statement-name]",(function(e){if((e.keyCode||e.charCode)===at.KEY_ENTER&&null!==E[E.length-1].text&&""!==E[E.length-1].text&&!u.triggerUpgdragePaywallOnAddStatement(E,i,e)){var n=1+~~c(this.parentNode).closest("tr[data-role=statement]").attr("data-index");u.insertNewStatement(u,E,_.body,t,o,n,c,i),u.makeStatementsInEditPanelSortable(u,c,_.body,E);var r=c(this).closest("div[data-dialog-role=edit-statement]");r.scrollTop(r.prop("scrollHeight"))}})).on("paste","td[data-role=statement-name] input[type=text]",(function(e){var n,a=[],o=~~c(this).closest("tr[data-role=statement]").attr("data-index");try{var s=e.originalEvent||{},l=e.originalEvent.clipboardData||null;if(!l)return;n=l.getData("text/plain");var d=String(n||"").replace(/(^[\s]+|[\s]+$)/g,"");if(!(d.indexOf("\n")>-1))return;a=d.split("\n"),s.preventDefault(),s.stopPropagation();for(var p=function(t,n){if(u.triggerUpgdragePaywallOnAddStatement(E,i,e))return{v:void 0};var r=u.createUniqueStatement({text:a[t],index:o+t+1},E),s=void 0;E.splice(r.index,0,r),c(_.body).find("table").each((function(){s=this.tBodies[0].rows[this.tBodies[0].rows.length-1].cloneNode(!0),c(s).insertAfter(c("tr[data-role=statement][data-index=".concat(r.index-1,"]")))})),c(s).find("td[data-role=statement-name] input[type=text]").val(r.text),u.reinitializeStatementsIndexes(E,_.body,c)},h=0,g=a.length;h<g;h++){var f=p(h);if("object"===r()(f))return f.v}u.updateContainerAttributes(t,E),u.makeStatementsInEditPanelSortable(u,c,_.body,E)}catch(y){return}}))})).fail((function(e){g.reject(e)}))})).promise()}(i.getEngine().getLoader().getUI(),this,i.getEngine().getJQuery(),i.getEngine().getResourceManager(),i.getEngine().getI18n(),i.getEngine().getLoader().getCommandDispatcher())}},{key:"createI18nStatementElement",value:function(e,t){var n=document.createElement("div"),i=n.appendChild(document.createElement("input")),r=n.appendChild(document.createElement("div")),a=n.appendChild(document.createElement("div"));return i.setAttribute("type","text"),i.setAttribute("data-role","secondary"),i.value=e.text||"No statement",r.setAttribute("data-role","remove"),a.setAttribute("data-role","drag"),n.setAttribute("data-role","statement"),n.setAttribute("data-index",String(t)),n}},{key:"updateStatements",value:function(e,t,n){t.value=e&&e.length?JSON.stringify(e):"null",n(t).trigger("input")}},{key:"insertNewStatement",value:function(e,t,n,i,r,a,o,s){var l,u=e.createUniqueStatement({text:r||"New Statement",index:a},t),c=s.getEngine().getLoader().getSelection().getItems(),d=0!==c.length?c[0]:null,p=d.hasProperty("choices.scale")?d.getProperty("choices.scale"):[],h=p.length,g=o(i).closest("#item").find("input[type=hidden][data-plugin=text-choice-interface]").get(0),_=g?g.getAttribute("data-synchronize-other-properties"):"";if(t.splice(a,0,u),o(n).find("table").each((function(){l=this.tBodies[0].rows[this.tBodies[0].rows.length-1].cloneNode(!0),o(l).insertAfter(o("tr[data-index=".concat(a-1,"]")))})),o(l).find("td[data-role=statement-name] input[type=text]").val(u.text).focus().select(),l.setAttribute("data-index",(~~u.index).toString()),this.reinitializeStatementsIndexes(t,n,o),e.updateContainerAttributes(i,t),p){p[h]=[];for(var f=0,y=p[0].length;f<y;f++)p[h][f]=bi.createUniqueChoice({text:p[0][f].text,isDefault:"undefined"!==typeof p[0][f].isDefault&&null!==p[0][f].isDefault?p[0][f].isDefault:null,index:f,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,isCorrect:"undefined"!==typeof p[0][f].isCorrect&&null!==p[0][f].isCorrect?p[0][f].isCorrect:null,quizPoints:0,paymentsValue:null},p);g.value=JSON.stringify(p),o(g).trigger("input"),_&&o(_).val(g.value).trigger("reload")}}},{key:"makeStatementsInInspectorSortable",value:function(e,t,n,i,r){var a=O.a.create((function(){e.reorderStatementsInInspector(t,n,i,r)}),100);Ni.makeSortable(t,n,"div[data-role=statement] div[data-role=drag]","div[data-role=statement]",(function(e,t,n){a()}),(function(e,t,n){var i=e.parentNode;n===T.bb.BEFORE?i.insertBefore(e,t):i.insertBefore(e,t.nextSibling),a()}))}},{key:"makeStatementsInEditPanelSortable",value:function(e,t,n,i){var r=O.a.create((function(){e.reorderStatementsInPanelCallback(t,n,i)}),100);Ni.makeSortable(t,n,"table[data-role=edit-statements] tr[data-role=statement] td[data-role=statement-name] div[data-role=drag]","table[data-role=edit-statements] tr[data-role=statement]",(function(e,t,n){r()}),(function(e,t,n){var i=e.parentNode;n===T.bb.BEFORE?i.insertBefore(e,t):i.insertBefore(e,t.nextSibling),r()}))}},{key:"onStatementsReorderedByDragAndDrop",value:function(e,t,n){var i=!1;e(t).find("[data-role=statement]").each((function(e){var t=~~this.getAttribute("data-index");e!==t&&(i=!0,n[t].index=e,this.setAttribute("data-index",String(e)))})),i&&n.sort((function(e,t){return e.index-t.index}))}},{key:"reorderStatementsInInspector",value:function(e,t,n,i){this.onStatementsReorderedByDragAndDrop(e,t,n),this.updateStatements(n,i,e)}},{key:"reorderStatementsInPanelCallback",value:function(e,t,n){this.onStatementsReorderedByDragAndDrop(e,t,n)}},{key:"triggerUpgdragePaywallOnAddStatement",value:function(e,t,n){return!this.userService.canAddLikertStatements(e.length)&&(t.getEngine().getLoader().getCommandDispatcher().triggerPaywall(qe.h.MAXIMUM_NUMBER_OF_LIKERT_STATEMENTS_IN_CURRENT_USER_PLAN),n.preventDefault(),n.stopPropagation(),!0)}}]),e}();v()(_a,"NAME","LikertStatementsEditorInspectorPlugin"),v()(_a,"MAX_VISIBLE_NUMBER_OF_STATEMENTS_IN_INSPECTOR_PANEL",4);var fa=function(){function e(){o()(this,e),v()(this,"translator",void 0),v()(this,"values",void 0),v()(this,"targetContainer",void 0),v()(this,"engine",void 0)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i=this;this.engine=n.getEngine(),this.translator=this.engine.getI18n(),e(t).find("div[data-plugin=list-editor]").each((function(e,t){i.targetContainer=t;var n=t.getAttribute("data-value");i.targetContainer.onclick=function(e){return e.preventDefault()},n&&(i.values=JSON.parse(n)||[]),Object(ot.a)(i.values,(function(e){i.createListElement(e)}))}))}},{key:"createListElement",value:function(e){var t=document.createElement("div"),n=this.createInput(e);if(t.classList.add("list-element"),t.setAttribute("data-name",e.name),t.appendChild(n),e.isHideable&&e.showFlag){var i=this.createVisibilityButton(this.engine.getLoader().getSummarySettingProperty(e.showFlag));t.appendChild(i)}this.targetContainer.appendChild(t)}},{key:"createInput",value:function(e){var t=this,n=document.createElement("input");return n.setAttribute("type","text"),n.setAttribute("data-role","secondary"),e.label?n.value=e.label:e.i18n&&(n.value=this.translator.translateText(e.i18n)),n.oninput=function(){Object(ot.a)(t.values,(function(t){t.name===e.name&&(t.label=n.value)})),t.updateListElements()},n.onblur=function(){""===n.value&&(n.value=t.translator.translateText(e.i18n))},n}},{key:"createVisibilityButton",value:function(e){var t=this,n=document.createElement("button");return n.classList.add("visibility-button","i-lg","i123-hidden"),this.setVisibilityButtonState(n,e),n.onclick=function(){var e="true"===n.getAttribute("data-column-is-visible");t.setVisibilityButtonState(n,!e)},n}},{key:"setVisibilityButtonState",value:function(e,t){e.setAttribute("data-column-is-visible",t.toString()),e.title=t?this.getTooltipMessage(T.ab.SHOW):this.getTooltipMessage(T.ab.HIDE)}},{key:"getTooltipMessage",value:function(e){switch(e){case T.ab.HIDE:return this.translator.translateText("payments_show_column");case T.ab.SHOW:return this.translator.translateText("payments_hide_column")}}},{key:"updateListElements",value:function(){var e=this.values.length?JSON.stringify(this.values):"null";this.targetContainer.setAttribute("data-value",e)}}]),e}();v()(fa,"NAME","ListEditorInspectorPlugin");var ya=function(e){for(var t=[],n=-1,i=function(e){for(var t,n=0,i=e.length;n<i;n++)switch(t=e.charAt(n)){case"*":r("%ST%");break;case"_":r("%UN%");break;case"+":r("%PL%");break;case"-":r("%MI%");break;case"\n":case"\t":case"\r":r(" ");break;default:r(t)}},r=function(e){-1===n&&a(),t[n]+=e},a=function(){n++,t.push("")},o=function e(t,n){if(t)if(t.textContent)if(t.nodeType===Node.ELEMENT_NODE)switch(t.nodeName){case"P":a();for(var o=0,s=t.childNodes.length;o<s;o++)e(t.childNodes[o],n+1);break;case"B":case"STRONG":r("*");for(var l=0,u=t.childNodes.length;l<u;l++)e(t.childNodes[l],n+1);r("*");break;case"I":case"EM":r("_");for(var c=0,d=t.childNodes.length;c<d;c++)e(t.childNodes[c],n+1);r("_");break;case"DEL":case"STRIKE":r("-");for(var p=0,h=t.childNodes.length;p<h;p++)e(t.childNodes[p],n+1);r("-");break;case"U":r("+");for(var g=0,_=t.childNodes.length;g<_;g++)e(t.childNodes[g],n+1);r("+");break;case"A":r("[");for(var f=0,y=t.childNodes.length;f<y;f++)e(t.childNodes[f],n+1);r("]("),r(t.getAttribute("href")),r(")");break;case"BR":a();break;default:i(t.textContent)}else t.nodeType===Node.TEXT_NODE&&i(t.textContent);else a()},s=0,l=e.childNodes||[],u=l.length;s<u;s++)o(l[s],0);return t.join("\n").trim()},Ea=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){e(t).find('textarea[data-plugin="markdown-editor"][data-markdown-loaded="false"]').each((function(){var t;e(t=this).closest("label").each((function(){!function(i){var r,a,o=document.createElement("input");o.setAttribute("type","hidden");for(var s=0,l=t.attributes.length;s<l;s++)o.setAttribute(t.attributes[s].name,t.attributes[s].value);t.parentNode.appendChild(o),i.parentNode.appendChild(t),t.setAttribute("data-markdown-loaded","true"),t.value=R.parse(t.value),e(t).trumbowyg({btns:[["strong","em","underline","link","removeformat"]],btnsDef:{unlink:{key:"D"},createLink:{text:"Add link",key:"K",tag:"a"}},semantic:!0,autogrowOnEnter:!0,svgPath:!1,hideButtonTexts:!0,removeformatPasted:!1,allowTagsFromPaste:["b","strong","i","em","u","del","strike"]}).on("tbwchange",(function(){o.value=ya(r),e(o).trigger("input")})).on("tbwblur",(function(){if(a.setAttribute("data-toolbar",""),null!==a.querySelector(".trumbowyg-modal-box")){a.setAttribute("data-toolbar","visible");var e=a.querySelector('.trumbowyg-modal-box input[name="url"]'),t=a.querySelector('.trumbowyg-modal-box input[name="text"]'),i=a.querySelector(".trumbowyg-modal-title");null!==e&&null!==t&&(e.setAttribute("placeholder","URL"),e.setAttribute("data-i18n-placeholder","themes_url"),e.setAttribute("data-role","markdown-url"),t.setAttribute("placeholder","Text"),t.setAttribute("data-i18n-placeholder","editor_text"),t.setAttribute("data-role","markdown-url-text")),null!==i&&(i.textContent="link",i.setAttribute("data-i18n-text","applications_wordpress_select_format_link")),n.getEngine().getI18n().translateDOMNode(a)}})).on("tbwpaste",(function(){o.value=ya(r),e(o).trigger("input")})),r=i.parentNode.querySelector(".trumbowyg-editor"),a=r.parentNode,e(r).on("mousedown",(function(){a.setAttribute("data-toolbar","visible")})),a.setAttribute("data-role","markdown-editor"),null!==e(r).closest("[data-role=attribute-group]")&&e(r).closest("[data-role=attribute-group]").attr("data-has-markdown-property","1")}(this)}))}))}}]),e}();v()(Ea,"NAME","MarkdownEditorInspectorPlugin");var ma=function(){function e(){o()(this,e),v()(this,"supportedSettingTypeIds",[ei.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING,ei.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING,ei.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING,ei.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING]),v()(this,"disabled",!1),v()(this,"pluginTargets",void 0),v()(this,"setting",void 0),v()(this,"controls",void 0),v()(this,"readyPluginTargetsCount",0),v()(this,"editorUi",void 0),v()(this,"jQuery",void 0)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){var r=this;if(this.disabled)this.disabled=!1;else{var a=document.getElementById("item"),o=a.getAttribute("data-target-setting-id");if("setting"===a.getAttribute("data-target-element-type")&&-1!==this.supportedSettingTypeIds.indexOf(o)){switch(this.pluginTargets=[],o){case ei.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING:case ei.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING:this.setting=i.getEngine().getDocument().getEditorSettingByTypeId(o),this.pluginTargets.push({node:n.querySelector('[data-role="attribute-group"][data-name="shipping_information"]'),propertyName:"shippingInformation",triggerPropertyName:"useShipping"});break;case ei.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING:this.setting=i.getEngine().getDocument().getEditorSettingByTypeId(o),this.pluginTargets.push({node:n.querySelector('[data-role="attribute-group"][data-name="client_information"]'),propertyName:"clientInformation",triggerPropertyName:null},{node:n.querySelector('[data-role="attribute-group"][data-name="invoice_information"]'),propertyName:"invoiceInformation",triggerPropertyName:null});break;case ei.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING:this.setting=i.getEngine().getDocument().getEditorSettingByTypeId(o),this.pluginTargets.push({node:n.querySelector('[data-role="attribute-group"][data-name="description_information"]'),propertyName:"description",useSingleValue:!0,triggerPropertyName:null})}if(this.setting&&this.pluginTargets.length){this.jQuery=t,this.editorUi=i,this.controls=null,this.readyPluginTargetsCount=0,this.pluginTargets.forEach((function(e){r.processPluginTarget(e)}));var s="data-assocs-".concat(o.replace(/_/g,"-"),"-otl");if(!n.hasAttribute(s)){var l=this,u=t("#item").parent(),c='[id="item"][data-target-setting-id="'.concat(o,'"]');this.pluginTargets.forEach((function(n,i){var r="".concat(c,' [data-role="property"][data-property-name="').concat(n.triggerPropertyName,'"]'),a="".concat(c,' [data-role="property"][data-property-name="').concat(n.propertyName,'"]')+' [data-plugin="payment-processors-assocs"] [data-role="secondary"]';n.triggerPropertyName&&u.on("click",r,(function(e){"INPUT"===e.target.tagName.toUpperCase()&&setTimeout((function(){l.processPluginTarget(l.pluginTargets[i],!0)}),0)})),u.on("input",a,(function(){var n,r=l.pluginTargets[i],a=this.getAttribute("data-type")||null,o=this.value.length?e.ensurePropertyValueWithType(this.value,a):null;if("useSingleValue"in r&&r.useSingleValue)n=o;else{var s=t(this).closest("[data-assoc-field]").attr("data-field-name");s in(n=l.getMultipleValuePropertyData(r.propertyName))&&(n[s]=o)}l.setting.setProperty(r.propertyName,n)}))}));var d="".concat(c," div[data-role=add-controls] > span"),p="".concat(c," div[data-role=add-controls] > div > span");u.on("click",d,(function(){var e=this.parentNode,n="1"===e.getAttribute("data-open");e.setAttribute("data-open",n?"0":"1"),n||setTimeout((function(){t(e).children("div").perfectScrollbar({minScrollbarLength:50,maxScrollbarLength:50})}),0)})),u.on("click",p,(function(){var e=t(this).closest("div[data-role=add-controls]").get(0),n=e.parentNode.querySelector("textarea"),i="[{".concat(this.innerText,"(").concat(this.getAttribute("data-control-id"),")}]");if("selection"in document&&"createRange"in document.selection)n.focus(),document.selection.createRange.call(document.selection).text=i;else if(n.selectionStart||0===n.selectionStart){var r=n.selectionStart,a=n.selectionEnd,o=r+i.length;n.value=n.value.substring(0,r)+i+n.value.substring(a,n.value.length),n.selectionStart=o,n.selectionEnd=o}else n.value+=i;t(n).trigger("input"),e.setAttribute("data-open","0")})),n.setAttribute(s,"1")}}}}}},{key:"processPluginTarget",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.node){var i=!e.triggerPropertyName||!!this.setting.getProperty(e.triggerPropertyName),r=e.node,a=e.propertyName,o="1"===r.getAttribute("data-visible"),s=!1;if(i){var l=this.jQuery,u=this.getTemplateModel(e);null!==this.setting.getProperty(a)||"useSingleValue"in e&&e.useSingleValue||this.setting.setProperty(a,this.getMultipleValuePropertyData(a)),r.hasAttribute("data-is-upgraded")||(s=!0,l.when(this.editorUi.getEngine().getResourceManager().get("/modules/Typescript/Form/resources/editor/Payments/Processors/field-assocs.html")).done((function(e){var i=l('[data-role="property"][data-property-name="'.concat(a,'"] span.property-label'),r);i.siblings().remove(),l(new Ai.a(e).parse(u)).insertAfter(i),r.setAttribute("data-is-upgraded","1"),t.notifyPluginTargetReady(n)})))}else i!==o&&(this.setting.setProperty(a,null),r.removeAttribute("data-is-upgraded"));s||this.notifyPluginTargetReady(n)}}},{key:"getTemplateModel",value:function(e){var t=e.propertyName,n=this.getEmptyTemplateModel(t),i=this.setting?this.setting.getProperty(t):null;return n.fields.forEach((function(t){"useSingleValue"in e&&e.useSingleValue?t.value=i:t.value=i&&i.hasOwnProperty(t.name)?i[t.name]:"defaultValue"in t?t.defaultValue:null})),n.controls=this.getFormControls(),n}},{key:"getMultipleValuePropertyData",value:function(e){var t={},n=this.getEmptyTemplateModel(e),i=this.setting.getProperty(e)||{};return n.fields.forEach((function(e){var n=e.name;t[n]=n in i?i[n]:"defaultValue"in e?e.defaultValue:null})),t}},{key:"getFormControls",value:function(){var e=this;return this.controls||(this.controls=[],this.editorUi.getEngine().getDocument().getControlsList().forEach((function(t){if(t.getLabelDOMNode()){var n=t.getId(),i=t.getLabelDOMNode().innerText;t.getTypeId()===C.a.CONTROL_TYPE_ADDRESS||t.getTypeId()===C.a.CONTROL_TYPE_NAME?t.getInputDOMNodes().forEach((function(t){t.inputs.forEach((function(t){var r=A()(t.input,HTMLInputElement)?t.input:t.input.getRootNode(),a=r.hasAttribute("data-i18n-placeholder")?r.getAttribute("data-i18n-placeholder"):$(r).find("input[data-i18n-placeholder]").attr("data-i18n-placeholder");e.controls.push({id:"".concat(n,"-").concat(r.getAttribute("data-index")),label:"".concat(i," - ").concat(e.editorUi.getEngine().getI18n().translateText(a))})}))})):e.controls.push({id:String(n),label:i})}}))),this.controls}},{key:"notifyPluginTargetReady",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.readyPluginTargetsCount++,(e||this.readyPluginTargetsCount===this.pluginTargets.length)&&this.executeDOMUpdate()}},{key:"executeDOMUpdate",value:function(){var e=this;this.readyPluginTargetsCount=0,this.disabled=!0,this.pluginTargets.forEach((function(t){var n=!t.triggerPropertyName||!!e.setting.getProperty(t.triggerPropertyName);t.node.setAttribute("data-visible",n?"1":"0")})),this.editorUi.upgrade(document.querySelector('#item [data-role="vertical-content"]'))}},{key:"getEmptyTemplateModel",value:function(e){var t=this,n=function(e){return t.editorUi.getEngine().getI18n().translateText(e)},i={descriptionTexts:[],textFieldPlaceholder:n("edt_text_write_something"),addFieldTriggerLabel:n("payments_addField"),fields:[],controls:[]};switch(this.setting.getTypeId()){case ei.PAYMENT_PROCESSOR_PAYPAL_EDITOR_SETTING:case ei.PAYMENT_PROCESSOR_PAYPAL_CHECKOUT_EDITOR_SETTING:i.descriptionTexts=[n("edt_text_paypal_shipping_info_title"),n("edt_text_paypal_shipping_info_warning")],i.fields.push({name:"firstName",label:n("edt_text_paypal_shipping_info_firstName"),showEmptyOption:!0},{name:"lastName",label:n("edt_text_paypal_shipping_info_lastName"),showEmptyOption:!0},{name:"email",label:n("edt_text_paypal_shipping_info_email"),showEmptyOption:!0},{name:"address1",label:n("edt_text_paypal_shipping_info_address1"),showEmptyOption:!0,required:!0},{name:"address2",label:n("edt_text_paypal_shipping_info_address2"),showEmptyOption:!0},{name:"city",label:n("edt_text_paypal_shipping_info_city"),showEmptyOption:!0,required:!0},{name:"stateCode",label:n("edt_text_paypal_shipping_info_stateCode"),showEmptyOption:!0},{name:"zipCode",label:n("edt_text_paypal_shipping_info_zipCode"),showEmptyOption:!0},{name:"countryCode",label:n("edt_text_paypal_shipping_info_countryCode"),showEmptyOption:!0,required:!0});break;case ei.PAYMENT_PROCESSOR_FRESHBOOKS_EDITOR_SETTING:switch(e){case"clientInformation":i.descriptionTexts=[n("edt_text_paypal_shipping_info_title"),n("edt_text_paypal_shipping_info_warning")],i.fields.push({name:"email",label:n("edt_text_freshbooks_client_info_email"),showEmptyOption:!0,required:!0},{name:"firstName",label:n("edt_text_freshbooks_client_info_firstName"),showEmptyOption:!0,required:!0},{name:"lastName",label:n("edt_text_freshbooks_client_info_lastName"),showEmptyOption:!0,required:!0},{name:"organization",label:n("edt_text_freshbooks_client_info_organization"),showEmptyOption:!0},{name:"address1",label:n("edt_text_freshbooks_client_info_address1"),showEmptyOption:!0},{name:"address2",label:n("edt_text_freshbooks_client_info_address2"),showEmptyOption:!0},{name:"city",label:n("edt_text_freshbooks_client_info_city"),showEmptyOption:!0},{name:"state",label:n("edt_text_freshbooks_client_info_state"),showEmptyOption:!0},{name:"country",label:n("edt_text_freshbooks_client_info_country"),showEmptyOption:!0},{name:"code",label:n("edt_text_freshbooks_client_info_code"),showEmptyOption:!0},{name:"workPhone",label:n("edt_text_freshbooks_client_info_workPhone"),showEmptyOption:!0},{name:"homePhone",label:n("edt_text_freshbooks_client_info_homePhone"),showEmptyOption:!0},{name:"mobilePhone",label:n("edt_text_freshbooks_client_info_mobilePhone"),showEmptyOption:!0},{name:"fax",label:n("edt_text_freshbooks_client_info_fax"),showEmptyOption:!0},{name:"internalNotes",label:n("edt_text_freshbooks_client_info_internalNotes"),allowTextInput:!0});break;case"invoiceInformation":i.fields.push({name:"type",label:n("edt_text_freshbooks_invoice_info_create"),showEmptyOption:!1,defaultValue:0,type:"int",options:[{id:0,label:n("edt_text_freshbooks_invoice_info_create_invoice")},{id:1,label:n("edt_text_freshbooks_invoice_info_create_estimate")}]},{name:"status",label:n("edt_text_freshbooks_invoice_info_status"),showEmptyOption:!1,defaultValue:0,type:"int",options:[{id:0,label:n("edt_text_freshbooks_invoice_info_status_email")},{id:1,label:n("edt_text_freshbooks_invoice_info_status_draft")}]},{name:"notes",label:n("edt_text_freshbooks_invoice_info_notes"),allowTextInput:!0},{name:"terms",label:n("edt_text_freshbooks_invoice_info_terms"),allowTextInput:!0})}break;case ei.PAYMENT_PROCESSOR_STRIPE_EDITOR_SETTING:i.descriptionTexts=[n("edt_UI_setting_processor_attribute_description_property_description")],i.fields.push({name:"description",allowTextInput:!0})}return i}}],[{key:"ensurePropertyValueWithType",value:function(e,t){switch(t){case"int":return parseInt(e,10);default:return String(e)}}}]),e}();v()(ma,"NAME","PaymentProcessorsAssocsInspectorPlugin");var va=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){var r=document.querySelector("#item"),a=r.getAttribute("data-target-setting-id");if("setting"===r.getAttribute("data-target-element-type")&&-1!==_n.getGroupSettingTypeIds(_n.PAYMENT_PROCESSORS).indexOf(a)&&i.getEngine().getDocument().getEditorSettingByTypeId(a)){var o=i.getEngine().getDocument().getConfiguration();t.when(i.getEngine().getResourceManager().get("/modules/Typescript/Form/resources/editor/Payments/Processors/testing-mode.html")).then((function(t){var r,a=n.querySelector('[data-role="attribute-group"][data-name="testing_mode"]');a&&(r=a.querySelectorAll('[data-role="property"]:not([data-property-name="'.concat(e.USE_SANDBOX_PROPERTY_NAME,'"])')),a.remove()),t=new Ai.a(t).parse({useSandbox:!!o.getProperty("isPaymentSandboxEnabled")});var s=n.querySelector('[data-role="attribute-group"]:last-child');if(s)s.insertAdjacentHTML("afterend",t);else{if(!(s=n.querySelector('[data-role="separator"]')))return;s.insertAdjacentHTML("beforebegin",t)}var l=n.querySelector('[data-property-name="'.concat(e.USE_SANDBOX_PROPERTY_NAME,'"] input[type="checkbox"]'));if(l&&(l.addEventListener("change",(function(e){o.withProperty("isPaymentSandboxEnabled",e.target.checked),i.getEngine().getLoader().trigger("payments_use_sandbox_changed")}),{passive:!0}),r)){l.addEventListener("change",(function(){var t=n.querySelectorAll('[data-role="attribute-group"][data-name="testing_mode"] [data-role="property"]:not([data-property-name="'.concat(e.USE_SANDBOX_PROPERTY_NAME,'"])'));t&&t.forEach((function(e){e.style.display="block"===e.style.display||""===e.style.display?"none":"block"}))}),{passive:!0});var u=n.querySelector('[data-property-name="'.concat(e.USE_SANDBOX_PROPERTY_NAME,'"]'));r.forEach((function(e){u.insertAdjacentElement("afterend",e),o.getProperty("isPaymentSandboxEnabled")||(e.style.display="none")}))}}))}}}]),e}();v()(va,"NAME","PaymentProcessorsInspectorPlugin"),v()(va,"USE_SANDBOX_PROPERTY_NAME","useSandbox");var Ta=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i=e(t),r=new Si;i.find('input[data-plugin="payments-products"]').each((function(){e(this).parent().find('[data-role="secondary"] a[data-role="edit-payments-products"]').on("click",(function(){r.open(e,n.getEngine()).done((function(e){r.saveData(e)})).fail((function(e){console.warn(e.message)}))}))}))}}]),e}();v()(Ta,"NAME","PaymentsProductsPlugin");var Oa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){n.getEngine().getLoader().updateStripeConnectedAccountPlaceholder()}}]),e}();v()(Oa,"NAME","ListEditorInspectorPlugin");var Ca=function(){function e(){o()(this,e),v()(this,"DEFAULT_CURRENCY_ID",void 0),v()(this,"settings",void 0),v()(this,"formContainer",void 0),v()(this,"editorUserInterface",void 0),v()(this,"jq",void 0),v()(this,"currency",void 0),v()(this,"currencyService",void 0),v()(this,"i18n",void 0)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i=this;this.formContainer=t,this.editorUserInterface=n,this.jq=e,this.init(),e(this.formContainer).find("a[data-plugin=currency-editor]").each((function(e,n){i.setCurrency(n),n.onclick=function(){i.triggerCurrencyDialog(n,t)}})),this.updatePriceFee(),this.updateCurrencySymbol()}},{key:"init",value:function(){var e;this.settings=this.editorUserInterface.getEngine().getDocument().getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),this.currencyService=this.editorUserInterface.getEngine().getCurrency();var t=(null===(e=this.settings)||void 0===e?void 0:e.getProperty("currencyId"))||this.DEFAULT_CURRENCY_ID;this.currency=this.currencyService.getCurrencyById(t),this.i18n=this.editorUserInterface.getEngine().getLoader().getI18n()}},{key:"updateCurrencySymbol",value:function(){var e,t=/[^0-9.]/g,n=document.querySelectorAll("#item .fee-base-price-container > input"),i=(null===(e=this.settings)||void 0===e?void 0:e.getProperty("currencyId"))||this.DEFAULT_CURRENCY_ID,r=this.currencyService.getCurrencySymbolById(i);n&&n.forEach((function(e){setTimeout((function(){e.value=e.value.replace(t,""),e.value=r+e.value}),1),e.addEventListener("keypress",(function(e){e.key.match(t)&&e.preventDefault()})),e.addEventListener("focusin",(function(){e.value=e.value.replace(t,"")})),e.addEventListener("focusout",(function(){e.value=e.value.replace(t,""),e.value=r+e.value}))}))}},{key:"setCurrency",value:function(e){e.innerText=this.currency?this.currency.isoCode:this.i18n.translateText("payment_currency_unknown")}},{key:"saveCurrency",value:function(e){this.settings.setProperty("currencyId",e)}},{key:"updatePriceFee",value:function(){var e=this,t=document.querySelectorAll("#form [data-role=control][data-type=fee]");t&&t.forEach((function(t){var n=t.getAttribute("data-hash");e.editorUserInterface.getEngine().getDocument().getElementByHash(n).updatePriceFee()}))}},{key:"updateDiscountAndTax",value:function(e){this.editorUserInterface.upgrade(e,[oa.NAME])}},{key:"triggerCurrencyDialog",value:function(e,t){var n,i=this,r=this.editorUserInterface.getEngine().getCurrency().enumerateCurrencies().map((function(e){return{id:e.id,label:i.i18n.translateText(e.i18n)}}));r=Object(Ii.a)(r,["label"],["asc"]);var a=this.editorUserInterface.createDialog(this.i18n.translateText("payments_form_currency")||Si.CURRENCY_DIALOG_TITLE,[{type:qe.c.SAVE,callback:function(){n||(n=l.getSelectedOption()),i.currency=i.currencyService.getCurrencyById(n.id),i.setCurrency(e),i.saveCurrency(n.id),i.updatePriceFee(),i.updateCurrencySymbol(),i.updateDiscountAndTax(t),i.editorUserInterface.getEngine().getLoader().execCommand("track-event","payments_currency_change"),i.editorUserInterface.getEngine().getLoader().trigger("payments_currency_change",n),a.close()}},{type:qe.c.CANCEL,callback:function(){a.close()}}],{width:"500px",height:"270px"});a.dialog.classList.add("currency-dialog");var o=document.createElement("p");o.textContent=this.i18n.translateText("payments_currency_dialog_description"),a.body.appendChild(o);var s={placeholder:""};this.currency&&(s.selected=this.currency.id);var l=new Ci(this.jq).init(a.body,r,s);l.on("change",(function(){n=l.getSelectedOption()}))}}]),e}();v()(Ca,"NAME","PriceEditorInspectorPlugin");var Na=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){e(t).find("[data-propagate-value-css-selector][data-propagate-value-attribute-name]").each((function(){var t=this.getAttribute("data-propagate-value-css-selector")||null,n=this.getAttribute("data-propagate-value-attribute-name")||null;if(t&&n){var i=this.nodeName.toLowerCase(),r="input"===i?this.type:i,a="input"===i&&"checkbox"===r||"radio"===r?this.checked:this.value;e(t).each((function(){var t=this;setTimeout((function(){e(t).trigger("attribute:propagate")}),50)})).attr(n,String(a)||null)}}))}}]),e}();v()(Na,"NAME","PropagatedDOMAttributes");var Aa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(t,n,i){if(!t(n).attr("data-is-upgraded-deferred-ranged-slider")){var r,a=O.a.create((function(){r&&r.setAttribute("data-show-range","1")}),e.DEFERRED_TIMEOUT);t(n).on("mouseenter","[data-role=property][data-is-range-property]",(function(){r=this,a()})).on("mouseleave","[data-role=property][data-is-range-property]",(function(){r=null,this.removeAttribute("data-show-range")}))}}}]),e}();v()(Aa,"NAME","RangedPropertiesDeferredSliderAppearance"),v()(Aa,"DEFERRED_TIMEOUT",100);var ba=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i=e(t).find("div[data-role=property][data-property-name=customerEmail]").get(0)||null,r=n.getEngine().getDocument().getEditorSettingByTypeId(e("#item").attr("data-target-setting-id"));if(i&&r)if(i.hasAttribute("data-is-upgrading"))i.removeAttribute("data-is-upgrading");else{var a=[];n.getEngine().getDocument().getControlsList().forEach((function(e){e.getTypeId()===C.a.CONTROL_TYPE_EMAIL&&a.push({id:e.getId(),name:e.getLabelDOMNode().innerText})}));var o={selectedValue:r.getProperty("customerEmail"),controls:jt.clone(a)};e.when(n.getEngine().getResourceManager().get("/modules/Typescript/Form/resources/editor/Payments/Processors/Sagepay/customer-email.html")).then((function(t){e("span.property-label",i).siblings().remove(),e(new Ai.a(t).parse(o)).insertAfter(e("span.property-label",i)),i.setAttribute("data-is-upgrading","1"),n.upgrade(document.querySelector('#item [data-role="vertical-content"]'))}))}}}]),e}();v()(ba,"NAME","SagepayCustomerEmailInspectorPlugin");var Ra=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i=e(t).find("div[data-role=property][data-property-name=locationId]").get(0)||null,r=n.getEngine().getDocument().getEditorSettingByTypeId(e("#item").attr("data-target-setting-id"));if(i&&r){var a={selectedValue:r.getProperty("locationId"),locations:jt.clone(r.getProperty("locations"))};i.hasAttribute("data-is-upgrading")?i.removeAttribute("data-is-upgrading"):e.when(n.getEngine().getResourceManager().get("/modules/Typescript/Form/resources/editor/Payments/Processors/Square/store-location.html")).then((function(t){e("span.property-label",i).siblings().remove(),e(new Ai.a(t).parse(a)).insertAfter(e("span.property-label",i)),i.setAttribute("data-is-upgrading","1"),n.upgrade(document.querySelector('#item [data-role="vertical-content"]'))}))}}}]),e}();v()(Ra,"NAME","SquareStoreLocationInspectorPlugin");var Ia=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find("[data-role=property][data-property-name=locations][data-property-type=string]").each((function(){e(this).find("a[data-role=edit-square-locations]").each((function(){this.onclick=function(){i.openSquareLocationsDialog(e,t,n)}}))}))}},{key:"openSquareLocationsDialog",value:function(e,t,n){var i=n.getEngine().getDocument().getEditorSettingByTypeId(ei.PAYMENT_PROCESSOR_SQUARE_EDITOR_SETTING);if(i){var r,a,o,s,l=jt.clone(i.getProperty("locations"));r=n.getEngine().getLoader().getUI(),a=n.getEngine().getResourceManager(),o=n.getEngine().getLoader().getI18n(),(s=r.createDialog(o.translateText("edt_UI_setting_processor_square_active_locations"),[{type:qe.c.CLOSE,callback:function(){s.close()}}],{width:"900px",height:"615px"})).dialog.setAttribute("data-dialog-role","square-active-locations"),a.get("/modules/Typescript/Form/resources/editor/Payments/Processors/Square/square-locations-dialog.html").then((function(e){var t={locations:l},n=new Ai.a(e);s.body.innerHTML=n.parse(t),o.translateDOMNode(s.body)})).fail((function(e){console.error(e)}))}else console.error("Could not oppen Square locations dialog, invalid settings")}}]),e}();v()(Ia,"NAME","SquareStoreLocationsPopupInspectorPlugin");var Pa=function(){function e(){o()(this,e)}return l()(e,[{key:"getName",value:function(){return e.NAME}},{key:"upgrade",value:function(e,t,n){var i;i=this,e(t).find('[data-property-name="choices-isWorkflowsUserDropdown"]').each((function(){e(this).on("click","[data-role=edit-workflows-users]",(function(){var t=e(this).closest("#item[data-role=editor-panel][data-target-element]").attr("data-target-element"),r=n.getEngine().getDocument().getElementByHash(t);i.editUsersList(r,e,n)})).on("change","input[type=checkbox]",(function(){if(this.checked)e(this).closest("[data-role=attribute-group]").attr("data-hide-choices","");else{e(this).closest("[data-role=attribute-group]").attr("data-hide-choices",null);var t=e(this).closest("#item[data-role=editor-panel][data-target-element]").attr("data-target-element");n.getEngine().getDocument().getElementByHash(t).setProperty("choices.isWorkflowsUserDropdownSelectAll",!1).setProperty("choices.values",[{text:"Please Select"}]).synchronizeValue(),n.getEngine().getLoader().getCommandDispatcher().reloadVisiblePanel()}})),function(t){setTimeout((function(){e(t).find("input[type=checkbox]").each((function(){var t=this.checked;e(this).closest("[data-role=attribute-group]").attr("data-hide-choices",t?"":null)}))}),50)}(this)}))}},{key:"editUsersList",value:function(e,t,n){var i,r,a,o;i=n.getEngine().getLoader().getUI(),r=n.getEngine().getResourceManager(),a=n.getEngine().getLoader().getLoaderDependency(T.A.WORKFLOWS_USERS_LIST),(o=i.createDialog("Edit users list",[{type:qe.c.SAVE,callback:function(){var n=[];t(o.body).find("table tr[data-user-id]").each((function(){var e=this;t(this).find("input[type=checkbox]").each((function(){this.checked&&n.push({id:~~e.getAttribute("data-user-id"),email:e.getAttribute("data-user-email")})}))}));for(var i=[],r=0,a=n.length;r<a;r++)i.push({text:n[r].email});e.setProperty("choices.values",i),o.close()}},{type:qe.c.CANCEL,callback:function(){o.close()}}],{width:"500px",height:"500px"})).dialog.setAttribute("data-dialog-role","workflows-edit-users-dialog"),t(o.body).on("change","table thead tr[data-role=all] input[type=checkbox]",(function(n,i){e.setProperty("choices.isWorkflowsUserDropdownSelectAll",this.checked),t(o.body).find("table tbody tr[data-user-id] td input[type=checkbox]").prop("checked",this.checked)})),t(o.body).on("change","table tbody tr[data-user-id] input[type=checkbox]",(function(n,i){!1===this.checked&&(t(o.body).find("table thead tr[data-role=all] td input[type=checkbox]").prop("checked",!1),e.setProperty("choices.isWorkflowsUserDropdownSelectAll",!1))})),r.get("/modules/Typescript/Form/resources/editor/Dropdown/workflows-edit-users-list-dialog.html").then((function(n){var i=new Ai.a(n),r=e.getProperty("choices.values")||[],s={users:function(e){for(var t,n=[],i=0,a=e.length;i<a;i++){t=!1;for(var o=0,s=r.length;o<s;o++)if(e[i].email.toLowerCase()===String(r[o].text||"").toLowerCase()){t=!0;break}n.push({id:e[i].id,email:e[i].email,selected:t})}return n}(jt.clone(a)),allCheckbox:e.getProperty("choices.isWorkflowsUserDropdownSelectAll")||!1};o.body.innerHTML=i.parse(s),s.allCheckbox&&t(o.body).find("table tr[data-user-id] input[type=checkbox]").prop("checked",!0)})).fail((function(e){i.alert("Error loading component","There was a network error obtaining the dialog contents. Please retry. If the problem persists, contact support",(function(){o.close()}))}))}}]),e}();function Sa(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Pa,"NAME","WorkflowEditUsersListInspectorPlugin");var Da=function(e){g()(n,e);var t=Sa(n);function n(e,i,r){var a;if(o()(this,n),a=t.call(this,e,5e3,2),v()(c()(a),"loader",void 0),v()(c()(a),"engine",void 0),v()(c()(a),"errorLogger",void 0),a.engine=i,a.loader=r,!window.errorLoggingService)throw new Error("Dependency not found: errorLoggingService");return a.errorLogger=window.errorLoggingService.getInstance(),a}return l()(n,[{key:"run",value:function(){var e=this;window.addEventListener("beforeunload",this.beforeUnload);var t=this.loader.getAPI(),n=this.engine.getDocument();return n.trigger("editor-save-form-started"),function(t,n,i,r,a){return t.PUT_JSON("/v2/editor/form",n.serialize()).then((function(e){r.updateState(e),window.removeEventListener("beforeunload",a.beforeUnload),n.trigger("editor-save-form-finished",e),a.stop()})).fail((function(n,i){e.errorLogger.logError(t,"Error saving form: ".concat(null===i||void 0===i?void 0:i.responseText),T.p.ERROR,"SaveActivityFE"),window.CFTracker&&window.CFTracker.event("editor_save_form_error")})).always((function(){a.jq(i.getUICssSelector("saving-container")).removeClass("is-saving").text("")}))}(t,n,this.loader,this.engine,this)}},{key:"beforeUnload",value:function(e){var t="There was an error saving your form. Changes may not be saved.";return e.returnValue=t,t}},{key:"removeUnloadEventListener",value:function(){window.removeEventListener("beforeunload",this.beforeUnload)}}]),n}(function(){function e(t,n,i){o()(this,e),v()(this,"MAX_RETRY_PERIOD",18e4),v()(this,"retryPeriod",void 0),v()(this,"isStarted",!1),v()(this,"timeout",void 0),v()(this,"intervalMultiplicator",void 0),v()(this,"baseRetryPeriod",void 0),v()(this,"jq",void 0),this.jq=t,this.retryPeriod=this.baseRetryPeriod=n,this.intervalMultiplicator=i}return l()(e,[{key:"start",value:function(){this.isStarted||(this.isStarted=!0,this.onStart()),this.reset(),this.doWork()}},{key:"stop",value:function(){this.isStarted=!1,this.onStop()}},{key:"onStart",value:function(){}},{key:"onStop",value:function(){}},{key:"onError",value:function(e){}},{key:"doWork",value:function(){var e=this;this.isStarted&&this.jq.when(this.run()).fail((function(t){e.onError(t)})).always((function(){e.timeout=window.setTimeout((function(){e.doWork()}),e.retryPeriod),e.retryPeriod=e.retryPeriod>=e.MAX_RETRY_PERIOD?e.MAX_RETRY_PERIOD:e.retryPeriod*e.intervalMultiplicator}))}},{key:"reset",value:function(){this.retryPeriod=this.baseRetryPeriod,window.clearTimeout(this.timeout)}}]),e}()),La=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getValueForSingleValueControl",value:function(e){return jt.clone(e.getProperty("payments.value")||[0])[0]}},{key:"setValueForSingleValueControl",value:function(e,t){var n=null===t?[0]:[t];e.hasProperty("payments.value")&&e.setProperty("payments.value",n),null===t&&$("#item").find('[data-role="attribute-group"][data-name="payments"] [data-role="property"][data-property-name="payments-virtualValue"] input[type="number"]').val(n[0]);var i=e.getProperty("payments.hasProductsSettingsEntry"),r=e.getForm().getEngine().getLoader();if(!i&&!r.getCommandDispatcher().isErrorStateNotification(r.getUI().getCurrentNotification())){var a=e.getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),o=a.getProperty("productsData"),s=window.location.href.replace("p=edit_fields","p=settings&tab=4"),l=r.getI18n().translateText("edt_UI_msg_payments_products_first_add_notification",s),u=e.getForm().getEngine().getDocument().getConfiguration().getProperty("hasProcessorsInjected");o&&0!==o.length||u||r.getUI().createNotification(l,!1,qe.d.DEFAULT,!0),!1===e.getProperty("payments.isProduct")?a.hasProperty("productsData")&&a.setProperty("productsData",a.getProperty("productsData")||[]):a.hasProperty("productsData")&&a.setProperty("productsData",(a.getProperty("productsData")||[]).concat([{controlId:e.getId(),tax:0,taxType:0,discount:0,discountType:0}])),e.hasProperty("payments.hasProductsSettingsEntry")&&e.setProperty("payments.hasProductsSettingsEntry",!0),r.execCommand("track-event","payments_products_add")}r.execCommand("track-event","payments_products_price_change"),r.trigger("payments_products_price_change")}},{key:"getValueForOptionsBasedControl",value:function(e){var t=jt.clone(e.getProperty("payments.value")||[]);return jt.clone(e.getProperty("choices.values")||[]).map((function(e,n){return e.paymentsValue=t[n]||null,e}))}},{key:"setValueForOptionsBasedControl",value:function(e,t){var n=!1,i=e.getProperty("payments.hasProductsSettingsEntry"),r=e.getForm().getEngine().getLoader();if(e.hasProperty("choices.values")&&e.setProperty("choices.values",t),e.hasProperty("payments.value")&&e.setProperty("payments.value",t.map((function(e){return null!==e.paymentsValue?(n=!0,e.paymentsValue):0}))),n){if(!i&&!r.getCommandDispatcher().isErrorStateNotification(r.getUI().getCurrentNotification())){var a=e.getForm().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),o=a.getProperty("productsData"),s=window.location.href.replace("p=edit_fields","p=settings&tab=4"),l=r.getI18n().translateText("edt_UI_msg_payments_products_first_add_notification",s),u=e.getForm().getEngine().getDocument().getConfiguration().getProperty("hasProcessorsInjected");o&&0!==o.length||u||r.getUI().createNotification(l,!1,qe.d.DEFAULT,!0),!1===e.getProperty("payments.isProduct")?a.hasProperty("productsData")&&a.setProperty("productsData",a.getProperty("productsData")||[]):a.hasProperty("productsData")&&a.setProperty("productsData",(a.getProperty("productsData")||[]).concat([{controlId:e.getId(),tax:0,taxType:0,discount:0,discountType:0}])),e.hasProperty("payments.hasProductsSettingsEntry")&&e.setProperty("payments.hasProductsSettingsEntry",!0),r.execCommand("track-event","payments_products_add")}r.execCommand("track-event","payments_products_price_change"),r.trigger("payments_products_price_change")}}},{key:"getValueForComposedControl",value:function(e){var t=e.getChildren();if(0===t.length)return[];var n=t.map((function(e){return e.getProperty("payments.value")}));return t.map((function(e){return e.getProperty("choices.values")})).map((function(e,t){return e.map((function(e,i){if(null===n[t])return e.paymentsValue=null,e;e.paymentsValue=n[t][i]||null})),e}))}},{key:"setValueForComposedControl",value:function(e,t){for(var n=!1,i=e.getForm().getEngine().getLoader(),r=e.getChildren(),a=0,o=t.length;a<o;a++){var s=!1;if(void 0!==r[a]&&A()(r[a],Bi)){if(n=r[a].getProperty("payments.hasProductsSettingsEntry"),r[a].hasProperty("choices.values")&&r[a].setProperty("choices.values",jt.trimChoices(t[a])),r[a].hasProperty("payments.value")&&r[a].setProperty("payments.value",t[a].map((function(e){return null!==e.paymentsValue?(s=!0,e.paymentsValue):0}))),!s)continue;if(!n&&!i.getCommandDispatcher().isErrorStateNotification(i.getUI().getCurrentNotification())){var l=i.getEngine().getDocument().getEditorSettingByTypeId(ei.PAYMENT_PRODUCTS_EDITOR_SETTING),u=l.getProperty("productsData"),c=window.location.href.replace("p=edit_fields","p=settings&tab=4"),d=i.getI18n().translateText("edt_UI_msg_payments_products_first_add_notification",c),p=i.getEngine().getDocument().getConfiguration().getProperty("hasProcessorsInjected");u&&0!==u.length||p||i.getUI().createNotification(d,!1,qe.d.DEFAULT,!0),!1===r[a].getProperty("payments.isProduct")?l.hasProperty("productsData")&&l.setProperty("productsData",l.getProperty("productsData")||[]):l.hasProperty("productsData")&&l.setProperty("productsData",(l.getProperty("productsData")||[]).concat([{controlId:r[a].getId(),tax:0,taxType:0,discount:0,discountType:0}])),r[a].hasProperty("payments.hasProductsSettingsEntry")&&r[a].setProperty("payments.hasProductsSettingsEntry",!0),i.execCommand("track-event","payments_products_add")}}}i.execCommand("track-event","payments_products_price_change"),i.trigger("payments_products_price_change")}}]),e}();function ka(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Ma=function(e){g()(n,e);var t=ka(n);function n(){var e;o()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),v()(c()(e),"children",[]),e}return l()(n,[{key:"getDOMInsertionNode",value:function(){return this.rootNode}},{key:"hasChild",value:function(e){for(var t=0,n=this.children.length;t<n;t++)if(this.children[t]===e)return!0;return!1}},{key:"appendChild",value:function(e){if(!e)throw new Error("Attempted to append a invalid element!");var t=!1;if(null!==e.getParent()&&e.getParent().hasChild(e)){for(var n=0,i=this.children.length;n<i;n++)if(e===this.children[n]){this.children.splice(n,1),t=!0;break}t||e.getParent().removeChild(e)}return this.children.push(e),e.withParent(this),this.getDOMInsertionNode().appendChild(e.getRootNode()),!t&&this.isAttached()&&this.getForm().trigger("node-insertion",e),t||this.getRootNode().setAttribute("data-num-children",String(this.children.length)),e}},{key:"removeChild",value:function(e){for(var t,n=!1,i=0,r=this.children.length;i<r;i++)if(this.children[i]===e){this.children.splice(i,1),n=!0;break}if(!n)throw new Error("Attempted to remove a non-existent element!");return e.withParent(null),(t=e.getRootNode()).parentNode&&t.parentNode.removeChild(t),this.isAttached()&&this.getForm().trigger("node-removal",e),this.getRootNode().setAttribute("data-num-children",String(this.children.length)),e}},{key:"getChildren",value:function(){return this.children.slice(0)}},{key:"getLayoutDirection",value:function(){return T.z.TOP_TO_BOTTOM}},{key:"createRootNodeElement",value:function(){this.rootNode=document.createElement("div"),this.rootNode.setAttribute("data-role","container"),this.rootNode.setAttribute("data-type",this._static().nodeName),this.rootNode.setAttribute("data-hash",this.getHash()),this.rootNode.setAttribute("data-type-id",String(this.getTypeId())),this.updateLabelItalicState(),this.updateLabelBoldState(),this.updateLabelHiddenState()}},{key:"insertBefore",value:function(e,t){if(!t)throw new Error('Invalid argument "child": IFormElement expected!');if(e===t)throw new Error("Invalid argument: reference and child are the same!");for(var n=!1,i=0,r=this.children.length;i<r;i++)if(this.children[i]===t){this.children.splice(i,1),n=!0;break}for(var a=-1,o=0,s=this.children.length;o<s;o++)if(this.children[o]===e){a=o;break}if(-1===a)throw new Error("Insertion failed: reference child is not contained by it's parent");return this.children.splice(a,0,t),n||null===t.getParent()||t.getParent().removeChild(t),t.withParent(this),this.getDOMInsertionNode().insertBefore(t.getRootNode(),e.getRootNode()),!n&&this.isAttached()&&this.getForm().trigger("node-insertion",t),n||this.getRootNode().setAttribute("data-num-children",String(this.children.length)),t}},{key:"insertAfter",value:function(e,t){if(!t)throw new Error('Invalid argument "child": IFormElement expected!');if(e===t)throw new Error("Invalid argument: reference and child are the same!");for(var n=!1,i=0,r=this.children.length;i<r;i++)if(this.children[i]===t){this.children.splice(i,1),n=!0;break}for(var a=-1,o=0,s=this.children.length;o<s;o++)if(this.children[o]===e){a=o;break}if(-1===a)throw new Error("Insertion failed: reference child is not contained by it's parent");return this.children.splice(a+1,0,t),n||null===t.getParent()||t.getParent().removeChild(t),t.withParent(this),this.getDOMInsertionNode().insertBefore(t.getRootNode(),e.getRootNode().nextSibling),!n&&this.isAttached()&&this.getForm().trigger("node-insertion",t),n||this.getRootNode().setAttribute("data-num-children",String(this.children.length)),t}},{key:"getFirstChild",value:function(){return this.children[0]||null}},{key:"getLastChild",value:function(){return this.children[this.children.length-1]||null}},{key:"flatten",value:function(){for(var e=[this],t=0,n=this.children.length;t<n;t++)for(var i=0,r=this.children[t].flatten(),a=r.length;i<a;i++)e.push(r[i]);return e}},{key:"serialize",value:function(){var e=null;if(null!==this.children){e=[];for(var t=0,n=this.children.length;t<n;t++)for(var i=this.children[t].serialize(),r=0,a=i.length;r<a;r++)e.push(i[r])}return[this.getTypeId(),this.getId(),this.getHash(),this.properties||null,this.errors||null,e,this.getColspan(),this.getHeight()]}},{key:"getElementKind",value:function(){return T.m.CONTAINER}},{key:"removeAllChildren",value:function(){this.getDOMInsertionNode().innerHTML="",this.children.splice(0,this.children.length)}},{key:"withColspan",value:function(e){if(null===e||this.getTypeId()===Oe.CONTAINER_TYPE_PAGE||this.getTypeId()===Oe.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE||this.getTypeId()===Oe.CONTAINER_TYPE_ROW||this.getTypeId()===Oe.ELEMENT_TYPE_FORM)return p()(E()(n.prototype),"withColspan",this).call(this,e);for(var t,i=null,r=0,a=this.children.length;r<a;r++)t=this.children[r].getMinColspan(),(null===i||t>i)&&(i=t);if(i>e)return this;for(var o=0,s=this.children.length;o<s;o++)this.children[o].withColspan(e);return p()(E()(n.prototype),"withColspan",this).call(this,e)}},{key:"enumerateDisabledProperties",value:function(){return this.getParent()?this.getParent().enumerateDisabledProperties():null}}]),n}(Zt);function xa(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var wa=function(e){g()(n,e);var t=xa(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_DIV}},{key:"getElementName",value:function(){return"Div"}},{key:"getResizingCapability",value:function(){return T.K.LEFT_AND_RIGHT}},{key:"withColspan",value:function(e){if(p()(E()(n.prototype),"withColspan",this).call(this,e),this.children.length)for(var t=0,i=this.children.length;t<i;t++)this.children[t].getTypeId()===C.a.CONTAINER_TYPE_ROW&&(this.children[t].withColspan(e),this.children[t].makeElementsToFitColspanUsingTheFairResizingAlgorithm(e,!0));return this}},{key:"unwrap",value:function(){for(;this.children.length;)this.getParent().getParent().insertBefore(this.getParent(),this.getFirstChild());this.getParent().removeChild(this),this.getForm().normalize()}},{key:"isSelectable",value:function(){return!1}},{key:"isDragable",value:function(){return!1}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return{category:"containers",icon:"i123-date",isContainer:!0,keywords:"div container",name:"Div",typeId:C.a.CONTAINER_TYPE_DIV,isVirtual:!0,index:99999,accessibilityFields:T.r.NONE}}}]),n}(Ma);v()(wa,"attributes",{}),v()(wa,"runtime",null),v()(wa,"nodeName","div");var Ua=n(21);function Fa(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Ya=function(e){g()(n,e);var t=Fa(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"likertHeaderDOMNode",void 0),v()(c()(r),"likertHeaderCSSDOMNode",void 0),v()(c()(r),"headerScaleI18nTexts",[]),v()(c()(r),"labelI18nText",null),v()(c()(r),"setupI18nAsync",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","likertwrapper-".concat(a,"-acc")),r.errorDOMNode=document.createElement("label"),r.errorDOMNode.setAttribute("data-role","error"),r.errorDOMNode.setAttribute("id","likertwrapper-".concat(a,"-error-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("aria-labelledby","likertwrapper-".concat(a,"-instr-acc")),r.likertHeaderDOMNode=document.createElement("div"),r.likertHeaderDOMNode.setAttribute("data-role","likert-header"),r.likertHeaderCSSDOMNode=document.createElement("style"),r.rootNode.tabIndex=0,r.rootNode.setAttribute("aria-labelledby","likertwrapper-".concat(a,"-acc ")+"likertwrapper-".concat(a,"-error-acc ")+"likertwrapper-".concat(a,"-instr-acc")),r.init(),r.updateAccessibilityTabIndexes(),r}return l()(n,[{key:"onCreated",value:function(){var e=this;this.updateLabelText(),this.updateErrorsText(),this.updateInstructionsText(),this.updateRequiredState(),this.updateShowInstructionsOnClick(),this.updateBoldOptionsState(),this.updateChoiceTextAlignment(),this.updateHiddenAttribute(),this.setupDOMEvents();for(var t=0,n=this.getChildren()||[],i=n.length;t<i;t++)n[t].onCreated();setTimeout((function(){e.updateRequiredState(),e.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&e.randomizeOptions()}),100)}},{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_LIKERT_WRAPPER}},{key:"getElementName",value:function(){return"Likert scale"}},{key:"appendChild",value:function(e){if(!e)throw new Error("Attempted to append a invalid element!");if(e.getTypeId()===C.a.CONTROL_TYPE_LIKERT_SCALE){var t=p()(E()(n.prototype),"appendChild",this).call(this,e);this.reRender(),e.setupI18n();var i=Object(Ua.b)(t);return this.store.dispatch(i),t}throw new Error("Attempted to append a non-likert-scale element inside a likert wrapper")}},{key:"insertBefore",value:function(e,t){if(!t)throw new Error('Invalid argument "child": IFormElement expected!');if(t.getTypeId()===C.a.CONTROL_TYPE_LIKERT_SCALE){var i=p()(E()(n.prototype),"insertBefore",this).call(this,e,t);return this.reRender(),t.setupI18n(),i}throw new Error("Attempted to insert a non-likert-scale element inside a likert wrapper")}},{key:"insertAfter",value:function(e,t){if(!t)throw new Error('Invalid argument "child": IFormElement expected!');if(t.getTypeId()===C.a.CONTROL_TYPE_LIKERT_SCALE){var i=p()(E()(n.prototype),"insertAfter",this).call(this,e,t);return this.reRender(),t.setupI18n(),i}throw new Error("Attempted to insert a non-likert-scale element inside a likert wrapper")}},{key:"removeChild",value:function(e){var t=p()(E()(n.prototype),"removeChild",this).call(this,e);this.reRender();var i=Object(Ua.c)([e]);return this.store.dispatch(i),t}},{key:"isRenderingSupported",value:function(){return!0}},{key:"getResizingCapability",value:function(){return T.K.LEFT_AND_RIGHT}},{key:"getChoiceStatements",value:function(){for(var e=[],t=0,n=(this.getChildren()||[]).length;t<n;t++)e.push({text:this.children[t].getProperty("label.labelText"),i18n:this.children[t].getProperty("label.i18nLabelKey")});return e&&e.length?e:null}},{key:"setupNewStatement",value:function(e,t){if(e.setProperty("label.widthInUnits",t.labelWidthInUnits),e.setProperty("options.inlineOptions",t.inlineOptions),e.setProperty("options.boldOptions",t.boldOptions),null!==t.choices){for(var n=[],i=0,r=t.choices.length;i<r;i++){var a={isCorrect:"undefined"!==typeof t.choices[i].isCorrect&&null!==t.choices[i].isCorrect?t.choices[i].isCorrect:null,isDefault:"undefined"!==typeof t.choices[i].isDefault&&null!==t.choices[i].isDefault?t.choices[i].isDefault:null,numberOfTimesThisOptionCanBeChosen:0,numberOfTimesThisOptionHasBeenChosen:0,quizPoints:0,text:t.choices[i].text};n.push(a)}e.setProperty("choices.values",n)}e.reRender(),e.updateChoices()}},{key:"setChoiceStatements",value:function(e){for(var t,n,i=this,r=jt.trimChoices(e)||[],a=this.getChildren(),o=r.length-a.length,s=this.getForm().getEngine(),l=a[0]?a[0].getProperty("label.widthInUnits"):null,u=this.getProperty("options.boldOptions"),c=this.getProperty("options.inlineOptions"),d=a[0]?a[0].getProperty("choices.values"):null;0!=o;)o<0?(this.removeChild(a.pop()),o++):(t=s.createElement(C.a.CONTROL_TYPE_LIKERT_SCALE),this.setupNewStatement(t,{labelWidthInUnits:l,boldOptions:u,inlineOptions:c,choices:d}),a.push(t),this.appendChild(t),o--);for(var p=0,h=a.length;p<h;p++)n=!1,a[p].getProperty("label.labelText")!==r[p].text&&(a[p].setProperty("label.labelText",r[p].text),n=!0),r[p].i18n=r[p].i18n||null,a[p].getProperty("label.i18nLabelKey")!==r[p].i18n&&(a[p].setProperty("label.i18nLabelKey",r[p].i18n),n=!0),n&&a[p].updateLabelText();setTimeout((function(){i.reRender()}),100)}},{key:"getInputDOMNodes",value:function(){var e=this.getProperty("options.inlineOptions"),t=[],n=this.getChildren()||[];e||this.getForm().getEngine().getTheme().isMobileLayout()||t.push({inputs:[{input:this.likertHeaderDOMNode,width:T.y.FULL}]});for(var i=0,r=n.length;i<r;i++)n[i].updateChoices(),t.push({inputs:[{input:n[i].getRootNode(),width:T.y.FULL}]});return t}},{key:"getChoiceScale",value:function(){var e=this.getChildren()||[];return 0===e.length?null:e.map((function(e){return e.getProperty("choices.values")}))}},{key:"setChoiceScale",value:function(e){for(var t=this.getChildren()||[],n=0,i=t.length;n<i;n++){for(var r=[],a=0,o=e[n].length;a<o;a++){var s={text:e[n][a].text,isDefault:"undefined"!==typeof e[n][a].isDefault&&null!==e[n][a].isDefault?e[n][a].isDefault:null,isCorrect:e[n][a]&&"undefined"!==typeof e[n][a].isCorrect&&null!==e[n][a].isCorrect?e[n][a].isCorrect:null,quizPoints:e[n][a]&&"undefined"!==typeof e[n][a].quizPoints&&null!==e[n][a].quizPoints?e[n][a].quizPoints:null,numberOfTimesThisOptionCanBeChosen:"undefined"!==typeof e[n][a].numberOfTimesThisOptionCanBeChosen&&null!==e[n][a].numberOfTimesThisOptionCanBeChosen?e[n][a].numberOfTimesThisOptionCanBeChosen:null,paymentsValue:"undefined"!==typeof e[n][a].paymentsValue&&null!==e[n][a].paymentsValue?e[n][a].paymentsValue:null,i18nLabel:"undefined"!==typeof e[n][a].i18nLabel&&null!==e[n][a].i18nLabel?e[n][a].i18nLabel:null};r.push(s)}t[n].setProperty("choices.values",r)}this.updateLikertHeader()}},{key:"updateLikertHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e){var t,n=this.getProperty("options.inlineOptions"),i=this.getChildren().length>0&&this.getChildren()[0].getProperty("choices.values")||[],r=i.length,a=this.getHash(),o="width: calc( (100% - ".concat(r,"px) / ").concat(r,") !important;");if(this.getForm().getEngine().getTheme().isMobileLayout()&&(o="display: block !important"),this.likertHeaderCSSDOMNode.textContent='\n            div[data-role=container][data-type=likert-wrapper][data-hash="'.concat(a,'"] div[data-role=likert-header] > * {').concat(o,"}"),this.getRootNode().appendChild(this.likertHeaderCSSDOMNode),!n){this.likertHeaderDOMNode.innerHTML="";for(var s=0,l=i.length;s<l;s++)(t=document.createElement("div")).setAttribute("data-role","scale-column"),t.setAttribute("id","likert-scale-column-".concat(a,"-").concat(s)),t.setAttribute("data-skip-markdown","true"),t.textContent=i[s].text,this.likertHeaderDOMNode.appendChild(t),this.headerScaleI18nTexts[s]&&(t.setAttribute("data-i18n-text",this.headerScaleI18nTexts[s]),t.setAttribute("data-skip-markdown",this.headerScaleI18nTexts[s]))}}var u=null;!function(e,t){e(t).find("> div[data-role=input-row]:not([data-is-first-row])").first().each((function(){e(this).find("> div[data-role=control] > div[data-role=input-column]").first().each((function(){u=this.getAttribute("data-colspan")}))}))}(this.getForm().getEngine().getJQuery(),this.rootNode),(u=String(u||""))?this.likertHeaderDOMNode.setAttribute("data-colspan",u):this.likertHeaderDOMNode.removeAttribute("data-colspan")}},{key:"setRendererType",value:function(e){switch(e){case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,e);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD_COMPACT_FIELD);break;case T.n.LABEL_PLACEMENT_LEFT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:case T.n.LABEL_PLACEMENT_RIGHT_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_LABEL_COMPACT_FIELD);break;default:p()(E()(n.prototype),"setRendererType",this).call(this,T.n.LABEL_PLACEMENT_TOP_INSTRUCTIONS_BELOW_FIELD)}this.updateLikertHeader()}},{key:"updateLabelWidthInUnitsToChildNodes",value:function(e){for(var t=this.getChildren()||[],n=0,i=t.length;n<i;n++)t[n].getProperty("label.widthInUnits")!==e&&(t[n].setProperty("label.widthInUnits",e),t[n].reRender());this.updateLikertHeader(!0)}},{key:"setupDefaults",value:function(){return this.setProperty("choices.statements",[{text:"Statement 1"},{text:"Statement 2"},{text:"Statement 3"}]),this.setProperty("choices.scale",[[{text:"Very Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Fair",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Very Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null}],[{text:"Very Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,paymentsValue:null,quizPoints:null},{text:"Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,paymentsValue:null,quizPoints:null},{text:"Fair",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,paymentsValue:null,quizPoints:null},{text:"Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,paymentsValue:null,quizPoints:null},{text:"Very Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,numberOfTimesThisOptionHasBeenChosen:null,paymentsValue:null,quizPoints:null}],[{text:"Very Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Good",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Fair",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null},{text:"Very Poor",isCorrect:null,isDefault:null,numberOfTimesThisOptionCanBeChosen:null,paymentsValue:null,quizPoints:null}]]),this.setProperty("label.labelText",this.getForm().getEngine().getI18n().translateText("edt_UI_control_type_likert_scale_name")),this.updateLabelText(),this}},{key:"updateBoldOptionsState",value:function(){for(var e=this.getProperty("options.boldOptions"),t=this.getChildren()||[],n=0,i=t.length;n<i;n++)t[n].setProperty("options.boldOptions",e);e?this.rootNode.setAttribute("data-has-bold-options",""):this.rootNode.removeAttribute("data-has-bold-options")}},{key:"updateInlineOptionsState",value:function(){for(var e=this.getProperty("options.inlineOptions"),t=this.getChildren()||[],n=0,i=t.length;n<i;n++)t[n].setProperty("options.inlineOptions",e);this.reRender()}},{key:"updateChoiceTextAlignment",value:function(){switch(this.getProperty("options.choiceTextAlignment")){case"center":this.rootNode.setAttribute("data-choice-text-alignment","center");break;case"right":this.rootNode.setAttribute("data-choice-text-alignment","right");break;case"left":default:this.rootNode.setAttribute("data-choice-text-alignment","left")}}},{key:"isRequired",value:function(){for(var e=this.getChildren(),t=0,n=e.length;t<n;t++)if(!e[t].getProperty("options.required"))return!1;return e.length>0}},{key:"setRequired",value:function(e){for(var t=this.getChildren(),n=0,i=t.length;n<i;n++)t[n].hasProperty("options.required")&&t[n].setProperty("options.required",e);this.updateRequiredState()}},{key:"setupDOMEvents",value:function(){!function(e,t){function n(n,i){if(-1===n&&t.rootNode===document.activeElement)return!1;for(var r=Array.prototype.slice.call(t.rootNode.querySelectorAll("label[data-role=checkbox]"),0),a=null,o=0,s=r.length;o<s;o++)if(document.activeElement===r[o]){a=o;break}if(null===a)return!1;var l=null;return i&&(l=e(r[a]).closest("div[data-role=input-row]").get(0)),a+=n,(!i||l===e(r[a]).closest("div[data-role=input-row]").get(0))&&(!(a<0)&&(!(a>=r.length)&&(r[a].focus(),document.activeElement===r[a]||(setTimeout((function(){e(r[a]).focus()}),0),!1))))}t.rootNode.addEventListener("keydown",(function(e){var i=e.keyCode||e.charCode,r=!1,a=1;try{a=t.rootNode.querySelector("div[data-role=input-row]").querySelectorAll("label[data-role=checkbox], div[data-role=scale-column]").length}catch(e){}switch(i){case at.KEY_TAB:r=e.shiftKey?n(-1,!1):n(1,!1);break;case at.KEY_LEFT:r=n(-1,!0);break;case at.KEY_UP:r=n(-a,!1);break;case at.KEY_RIGHT:r=n(1,!0);break;case at.KEY_DOWN:r=n(a,!1)}r&&(e.preventDefault(),e.stopPropagation())}),!0)}(this.getForm().getEngine().getJQuery(),this)}},{key:"init",value:function(){var e=this;this.setupI18nAsync=O.a.create((function(){e.setupI18n()}),0),this.on("translation-set",(function(t,n){null!==t?e.headerScaleI18nTexts[t]=e.headerScaleI18nTexts[t]||n:e.labelI18nText=n,e.setupI18nAsync()})),this.on("child-visibility-changed",(function(){e.hideContainerIfAllChildrenAreNotShown()}))}},{key:"setupI18n",value:function(){if(this.headerScaleI18nTexts.length&&this.likertHeaderDOMNode)for(var e=0,t=this.likertHeaderDOMNode.children,i=t.length;e<i;e++)this.headerScaleI18nTexts[e]&&t[e].setAttribute("data-i18n-text",this.headerScaleI18nTexts[e]);return this.labelI18nText&&this.labelDOMNode.setAttribute("data-i18n-text",this.labelI18nText),this.getForm().getEngine().getI18n().translateDOMNode(this.getRootNode()),p()(E()(n.prototype),"setupI18n",this).call(this)}},{key:"updateHiddenAttribute",value:function(){this.hasProperty("options.hidden")&&this.getProperty("options.hidden")?this.rootNode.setAttribute("data-is-hidden","1"):this.rootNode.removeAttribute("data-is-hidden")}},{key:"randomizeOptions",value:function(){if(this.hasProperty("options.randomizeOrder")&&this.getProperty("options.randomizeOrder")){for(var e=[],t=0,n=this.getChildren(),i=n.length;t<i;t++)e.push({index:t,child:n[t],node:n[t].getRootNode()});for(var r=0,a=(e=jt.shuffle(e)).length;r<a;r++)this.rootNode.appendChild(e[r].node)}else if(this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT)for(var o=0,s=this.getChildren(),l=s.length;o<l;o++)this.rootNode.appendChild(s[o].getRootNode())}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"updateAccessibilityTabIndexes",value:function(){var e=this;p()(E()(n.prototype),"updateAccessibilityTabIndexes",this).call(this);var t=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);setTimeout((function(){if(t)for(var n=0,i=e.getChildren(),r=i.length;n<r;n++)for(var a=i[n].flatten()[0].getRootNode().querySelectorAll("label[data-role=checkbox]"),o=0,s=a.length;o<s;o++)a[o].setAttribute("aria-labelledby","likert-scale-column-".concat(e.getHash(),"-").concat(o))}),500)}},{key:"hideContainerIfAllChildrenAreNotShown",value:function(){for(var e=!0,t=0,n=this.getChildren()||[],i=n.length;t<i;t++)if(n[t].isVisible()){e=!1;break}e?this.rootNode.setAttribute("data-is-hidden","1"):this.rootNode.removeAttribute("data-is-hidden")}},{key:"onFocusEnter",value:function(){this.getRootNode().hasAttribute("data-is-active")||this.getRootNode().setAttribute("data-is-active","1")}},{key:"onFocusLeave",value:function(){this.getRootNode().hasAttribute("data-is-active")&&this.getRootNode().removeAttribute("data-is-active")}},{key:"enumerateTranslations",value:function(){for(var e,t,n,i=[],r=this.getProperty("label.labelText")||"",a=this.getProperty("instructions.text")||"",o=this.getChildren()||[],s=0,l=0,u=o.length;l<u;l++)if(o[l].getId()){if(0===s){e=String(o[l].getId()),r&&i.push({key:"likert_headline_".concat(o[l].getId()),sourceText:r}),a&&i.push({key:"likert_instructions_".concat(o[l].getId()),sourceText:a}),(t=o[l].getProperty("label.labelText")||"")&&i.push({key:"control_label_".concat(o[l].getId()),sourceText:t});for(var c=0,d=(n=o[l].getProperty("choices.values")||[]).length;c<d;c++)i.push({key:"control_label_".concat(o[l].getId(),"_choice_").concat(c),sourceText:n[c].text})}else{r&&i.push({key:"likert_headline_".concat(o[l].getId()),sourceText:r,hidden:!0,syncWith:"likert_headline_".concat(e)}),a&&i.push({key:"likert_instructions_".concat(o[l].getId()),sourceText:a,hidden:!0,syncWith:"likert_instructions_".concat(e)}),(t=o[l].getProperty("label.labelText")||"")&&i.push({key:"control_label_".concat(o[l].getId()),sourceText:t});for(var p=0,h=(n=o[l].getProperty("choices.values")||[]).length;p<h;p++)i.push({key:"control_label_".concat(o[l].getId(),"_choice_").concat(p),sourceText:n[p].text,hidden:!0,syncWith:"control_label_".concat(e,"_choice_").concat(p)})}s++}return i}},{key:"setStatementsWithChoicesValues",value:function(e){for(var t=this.getChildren()||[],n=0,i=e.statements.length;n<i;n++)for(var r=e.statements[n],a=0,o=r.choices.length;a<o;a++){var s=r.choices[a];s.quizPoints=parseInt(s.quizPoints),s.i18nLabel=null}for(var l=0,u=t.length;l<u;l++)t[l].setProperty("choices.values",e.statements[l].choices)}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTAINER_TYPE_LIKERT_WRAPPER,name:"Likert Scale",isContainer:!1,category:"advanced",keywords:"likert scale radio radios matrix",icon:"i123-editor_field_likertscale",isVirtual:!1,i18nName:"edt_UI_control_type_likert_scale_name",i18nKeywords:"edt_UI_control_type_likert_scale_keywords",index:105,accessibilityFields:T.r.ROOT_NODE}}}]),n}(Ma);v()(Ya,"attributes",{}),v()(Ya,"runtime",null),v()(Ya,"nodeName","likert-wrapper");var Ba=function(){function e(t){o()(this,e),v()(this,"element",void 0),v()(this,"tooltip",void 0),this.element=t,this.tooltip=document.createElement("div"),this.tooltip.textContent=e.jq(this.element).attr("ui-title")||"",this.tooltip.className="ui-tooltip",document.body.appendChild(this.tooltip),this.anchorTooltip()}return l()(e,[{key:"destroy",value:function(){this.tooltip&&this.tooltip.parentNode&&this.tooltip.parentNode.removeChild(this.tooltip)}},{key:"anchorTooltip",value:function(){var t=this.element.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),i=_t.getAnchorPosition(t,n,e.distance,["center-top","center-bottom","center-right","center-left"]);this.tooltip.style.left="".concat(i.left,"px"),this.tooltip.style.top="".concat(i.top,"px"),this.tooltip.setAttribute("ui-anchor-mode",i.mode)}}],[{key:"init",value:function(t){e.jq=t,function(t){var n=t("body");n.on("mouseenter","[ui-title]",(function(){e.instance&&e.instance.destroy(),e.instance=new e(this)})),n.on("mouseleave","[ui-title]",(function(){e.instance&&(e.instance.destroy(),e.instance=null)})),setInterval((function(){if(e.instance)try{e.instance.anchorTooltip()}catch(t){}}),10)}(e.jq)}}]),e}();function Va(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ba,"distance",14),v()(Ba,"jq",void 0),v()(Ba,"instance",void 0);var Ha=function(e){g()(n,e);var t=Va(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"index",void 0),v()(c()(r),"lastPage",void 0),v()(c()(r),"header",void 0),v()(c()(r),"footer",void 0),v()(c()(r),"body",void 0),v()(c()(r),"separator",void 0),v()(c()(r),"emptyPageContainer",void 0),v()(c()(r),"actionBarButtonsVisibilityStates",[]),v()(c()(r),"updateActionBarButtonsThrottled",void 0),r.header=document.createElement("div"),r.header.setAttribute("data-role","page-header"),r.rootNode.appendChild(r.header),r.body=document.createElement("div"),r.body.setAttribute("data-role","page-body"),r.rootNode.appendChild(r.body),r.footer=document.createElement("div"),r.footer.setAttribute("data-role","page-footer"),r.rootNode.appendChild(r.footer),r.emptyPageContainer=document.createElement("div"),r.emptyPageContainer.setAttribute("data-role","empty-state-view"),r.rootNode.appendChild(r.emptyPageContainer),r.separator=document.createElement("div"),r.separator.setAttribute("data-role","page-break"),r.separator.innerHTML='<div data-role="merge-pages"><div data-role="page-separator-line"></div><button data-role="merge-pages-button" data-i18n-text="edt_text_merge_button">Merge pages</button><div data-role="page-separator-line"></div></div>',r.updateActionBarButtonsThrottled=O.a.create((function(){r.updateActionBarButtonsInImmediateMode()}),50),r}return l()(n,[{key:"getDOMInsertionNode",value:function(){return this.body}},{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_PAGE}},{key:"getElementName",value:function(){return"Page"}},{key:"createRootNodeElement",value:function(){this.rootNode=document.createElement("div"),this.rootNode.setAttribute("data-role","page"),this.rootNode.setAttribute("data-type",this._static().nodeName),this.rootNode.setAttribute("data-hash",this.getHash()),this.rootNode.setAttribute("data-type-id",String(this.getTypeId()))}},{key:"onCreated",value:function(){var e;this.renderHeader(),this.renderFooter(),this.rootNode.appendChild(this.getForm().getEngine().getTheme().getGridContainerElement().cloneNode(!0)),e=this,setTimeout((function(){e.loadEmptyStateMarkup(),e.renderHeader(),e.renderFooter()}),10)}},{key:"getIndex",value:function(){return this.index}},{key:"withIndex",value:function(e){return this.index=~~e,this.rootNode.setAttribute("data-page-index",String(this.index)),this.separator.setAttribute("data-page-index",String(this.index)),0===e?this.rootNode.setAttribute("data-is-first-page","1"):this.rootNode.removeAttribute("data-is-first-page"),this}},{key:"isLastPage",value:function(){return Boolean(this.lastPage)}},{key:"withIsLastPage",value:function(e){return this.lastPage=Boolean(e),this.lastPage?(this.rootNode.setAttribute("data-is-last-page","yes"),this.separator.setAttribute("data-is-last-page","yes")):(this.rootNode.removeAttribute("data-is-last-page"),this.separator.removeAttribute("data-is-last-page")),this}},{key:"addRealtimeCalculationsToPageHeader",value:function(){var e=document.createElement("div");e.setAttribute("data-role","control"),e.setAttribute("data-type","realtime-calculations");var t="...";if(this.getLoaderType()===T.v.VIEW){e.setAttribute("data-is-empty","1"),e.setAttribute("data-page","viewer"),e.setAttribute("aria-labelledby","floating-payments-header-text floating-payments-header-calculation-total");var i=this.getForm().getLastCalculationServerResponse();this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1)?e.tabIndex=0:e.removeAttribute("tabindex"),i&&(t=i.currencyHTML+String(i.invoiceObject.total))}else if(this.getLoaderType()===T.v.EDIT){e.setAttribute("data-page","editor");var r=this.getForm().getEngine().getLoader().getSelectedCurrencyId()||Si.DEFAULT_CURRENCY_ID,a=this.getForm().getEngine().getCurrency().getCurrencySymbolById(r);t="".concat(a).concat(n.DUMMY_VALUE_FOR_RTS_RIBBON)}e.innerHTML='<span data-i18n-text="realtime_summary_total" id="floating-payments-header-text">\n                Total:\n            </span>\n            <span data-role="calculation-total" id="floating-payments-header-calculation-total">\n                '.concat(t,"\n            </span>"),this.getForm().getEngine().getI18n().translateDOMNode(e),this.header.appendChild(e)}},{key:"getLoaderType",value:function(){return this.getForm().getEngine().getLoader().getLoaderType()}},{key:"addPaymentsSummaryToPageFooter",value:function(){var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DETAILED_INVOICE_OPTIONS);if(e&&e.showPaymentsSummaryBelowForm){var t=document.createElement("div");t.setAttribute("data-type","payment-summary"),this.getForm().getEngine().getLoader().getLoaderDependency(T.A.SHOULD_SHOW_PAYMENT_SUMMARY)||t.setAttribute("data-is-empty","1"),t.innerHTML=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.LAST_CALCULATION_HTML_MARKUP)||"",this.getForm().getEngine().getLoader().execCommand("add-payment-summary-listeners",t),this.footer.appendChild(t)}}},{key:"selectPaymentSummaryContainer",value:function(){this.getForm().getEngine().getJQuery()("[data-type=payment-summary]").children(":first").attr("data-is-selected",1)}},{key:"unselectPaymentSummaryContainer",value:function(){this.getForm().getEngine().getJQuery()("[data-type=payment-summary]").children(":first").removeAttr("data-is-selected")}},{key:"addLanguageSelectorToPageHeader",value:function(){if(this.getForm().getEngine().getLoader().getLoaderType()!==T.v.EDIT||0===this.getIndex()){var e=document.createElement("div");e.setAttribute("data-role","control"),e.setAttribute("data-type","language-selector"),this.header.appendChild(e),function(t,n,i,r,a,o){n.get("/modules/Typescript/Form/resources/language-selector.html").then((function(n){var a=t.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1),s=r?r.getLanguageCode():null,l={languages:[],hasAccessibilityEnabled:a},u=Re.getLanguagesList();if(t.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW){for(var c=0,d=u.length;c<d;c++)(i.indexOf(u[c].code3)>-1||u[c].code2&&i.indexOf(u[c].code2)>-1)&&l.languages.push({code:u[c].code2||u[c].code3,name:u[c].name,nativeName:u[c].native_name,selected:s===u[c].code3||u[c].code2&&s===u[c].code2});l.languages.sort((function(e,t){if(~~e.selected!==~~t.selected)return~~t.selected-~~e.selected;var n=e.nativeName.toLowerCase(),i=t.nativeName.toLowerCase();return n===i?0:n<i?-1:1}))}else l.languages.push({code:"",name:"Default",nativeName:"Default",selected:!0}),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){try{t.getForm().getEngine().getLoader().getEditorPanelGroup().setActivePanel("translations")}catch(e){}}),100)}),!0);var p=new Ai.a(n);e.innerHTML=p.parse(l),o(e).find("select").each((function(){mt.upgradeDropdown(this).getRootNode().setAttribute("data-role","i123-input")})),r&&r.translateDOMNode(e)}))}(this,this.getForm().getEngine().getResourceManager(),this.getForm().getEngine().getLoader().getLoaderDependency(T.A.TRANSLATIONS_LANGUAGE_CODES),this.getForm().getEngine().getLoader().getLoaderDependency(T.A.I18N),this.getForm().getEngine().getGeolocation(),this.getForm().getEngine().getJQuery())}}},{key:"addPaginationToPageHeader",value:function(e){var t=window.document.createElement("div"),n={pagination:{isNone:!1,isSteps:!1,isPercentage:!1,isPageNumbers:!1},pages:[],numPages:0,moreThan5Pages:!1},i=this.getForm(),r=i.getNumberOfPages(),a=100/r,o=this.getPageTitlesVisibility();n.numPages=r,n.moreThan5Pages=r>5,n.isAccessibilityEnabled=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1);for(var s=0,l=r;s<l;s++)n.pages.push({index:s,paddedOrder:jt.padString(String(s+1),"0",2,T.F.LEFT),order:String(s+1),isCurrent:s===this.index,title:String(i.getPageByIndex(s).getProperty("label.labelText")||"Untitled Page"),percent:String(Math.round((s+1)*a)),unitPercent:"".concat(a.toFixed(2),"%"),showTitle:o,numPages:r,isAccessibilityEnabled:n.isAccessibilityEnabled});switch(t.setAttribute("data-role","pagination"),e){case T.w.STEPS:n.pagination.isSteps=!0,t.setAttribute("data-type","steps");break;case T.w.PERCENTAGE:n.pagination.isPercentage=!0,t.setAttribute("data-type","percents");break;case T.w.PAGE_NUMBERS:n.pagination.isPageNumbers=!0,t.setAttribute("data-type","page-numbers");break;default:n.pagination.isNone=!0,t.setAttribute("data-type","none")}this.header.appendChild(t),function(e,i,r){e.get("/modules/Typescript/Form/resources/pagination.html").then((function(e){var i=new Ai.a(e);t.innerHTML=i.parse(n),Ba.init(r)})).fail((function(e){var n=window.document.createElement("span");n.setAttribute("data-role","error"),n.textContent=String(e||"Error occured fetching pagination"),t.appendChild(n)}))}(this.getForm().getEngine().getResourceManager(),this.getForm().getEngine().getLoader().getLoaderDependency(T.A.I18N),this.getForm().getEngine().getJQuery())}},{key:"renderHeader",value:function(){for(;this.header.firstChild;)this.header.removeChild(this.header.firstChild);var e=this.getForm().getEngine().getLoader(),t=this.getForm();if(this.isAttached()){var n=t.getNumberOfPages(),i=t.getProperty("options.paginationType");n>1&&i!==T.w.NONE&&this.getTypeId()!==C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE&&this.addPaginationToPageHeader(i),Rt.ALLOW_QUIZ_TIMER&&(null!==e.getLoaderDependency(T.A.INITIAL_QUIZ_TIMER)?(this.addQuizTimerContainerToPageHeader(),this.header.setAttribute("data-has-quiz-timer","")):this.header.removeAttribute("data-has-quiz-timer")),Rt.ALLOW_REAL_TIME_CALCULATIONS&&(e.getLoaderDependency(T.A.SHOW_REALTIME_CALCULATIONS)?(this.addRealtimeCalculationsToPageHeader(),this.header.setAttribute("data-has-realtime-calculations","")):this.header.removeAttribute("data-has-realtime-calculations")),Rt.ALLOW_I18N_DROPDOWN_SELECTOR&&(null!==e.getLoaderDependency(T.A.TRANSLATIONS_LANGUAGE_CODES)&&1<e.getLoaderDependency(T.A.TRANSLATIONS_LANGUAGE_CODES).length?(this.addLanguageSelectorToPageHeader(),this.header.setAttribute("data-has-language-selector","")):this.header.removeAttribute("data-has-language-selector")),this.header.appendChild(t.getHeader().getRootNode().cloneNode(!0))}}},{key:"addQuizTimerContainerToPageHeader",value:function(){var e=document.createElement("div");e.setAttribute("data-role","quiz-timer"),this.header.appendChild(e),this.getForm().getEngine().getResourceManager().get("/modules/Typescript/Form/resources/quiz-timer.html").then((function(t){e.innerHTML=t}))}},{key:"addPaymentProcessorsToPageFooter",value:function(){var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.PAYMENT_PROCESSORS_LIST),t=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DETAILED_INVOICE_OPTIONS);if(t&&t.showPaymentsSummaryBelowForm&&null!==e){var n={processors:function(){for(var t=[],n=0,i=e.length;n<i;n++)t.push({isRadio:e[n].displayType===T.G.DISPLAY_BOTH_AS_RADIO_AND_AS_DROPDOWN||e[n].displayType===T.G.DISPLAY_ONLY_AS_RADIO,isDropdown:e[n].displayType===T.G.DISPLAY_BOTH_AS_RADIO_AND_AS_DROPDOWN||e[n].displayType===T.G.DISPLAY_ONLY_AS_DROPDOWN,displayType:e[n].displayType,typeId:e[n].typeId,name:e[n].name,brandLogo:e[n].pictures[0]||null,creditCardLogos:btoa(JSON.stringify(e[n].pictures.slice(1))),isDefault:e[n].isDefault,frontendPluginTypeId:e[n].frontendPluginTypeId||null});return t}(),hasDropdown:!1,hasRadio:!1,hasAccessibilityEnabled:!1},i=document.createElement("div");n.hasAccessibilityEnabled=this.getForm().getConfiguration().getProperty("hasAccessibilityEnabled",!1),i.setAttribute("data-role","control"),i.setAttribute("data-type","payments-selector"),i.setAttribute("data-renderer-type","tln");for(var r=0,a=n.processors.length;r<a;r++)n.processors[r].isDropdown&&(n.hasDropdown=!0),n.processors[r].isRadio&&(n.hasRadio=!0);this.footer.appendChild(i),function(e,t,n,r){e.get("/modules/Typescript/Form/resources/payments-choose-processor.html").then((function(e){var a=new Ai.a(e);t.innerHTML=a.parse(n),r.getI18n().translateDOMNode(t),r.trigger("plugin-rendered","payments-selector",i),jt.refreshFrameHeightOnWix()})).fail((function(e){t.textContent=String(e||"Error fetching /modules/Typescript/Form/resources/payments-choose-processor.html")}))}(this.getForm().getEngine().getResourceManager(),i,n,this.getForm().getEngine().getLoader())}}},{key:"addCaptchaControlToPageFooter",value:function(){var e,t;!0!==(t=(e=this).getForm().getEngine().getLoader()).getLoaderDependency(T.A.SKIP_CAPTCHA)&&T.Z.EDIT_SUBMISSION!==t.getLoaderDependency(T.A.VIEW_FORM_CONTEXT)&&e.footer.appendChild(e.getForm().getCaptcha().getParent().getRootNode())}},{key:"addActionBarControlToPageFooter",value:function(){var e,t;t=(e=this).getForm().getActionBar().getRootNode().cloneNode(!0),e.updateActionBarButtonsVisibilityStates(t),e.footer.appendChild(t),e.getForm().getEngine().getResourceManager().get("/modules/Typescript/Form/resources/action-bar.html").then((function(n){var i=new Ai.a(n),r={isFirstPage:0===e.getIndex(),isLastPage:e.isLastPage(),index:e.getIndex(),hasNextPage:!e.isLastPage()&&e.getTypeId()!==C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE,hasPreviousPage:e.getIndex()>0&&e.getTypeId()!==C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE,nextPageIndex:e.getIndex()+1,previousPageIndex:e.getIndex()-1,isPaymentSummaryPage:e.getTypeId()===C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE,properties:e.getForm().getActionBar().getComputedProperties()};e.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW?e.getForm().getEngine().getLoader().isEnabledAutoSubmit()&&(r.properties.autosubmit=!0):!0===e.getForm().getEngine().getLoader().getFormSettings().autoSubmit&&(r.properties.autosubmit=!0),t.innerHTML=i.parse(r),e.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&e.getForm().getEngine().getLoader().getI18n().translateDOMNode(t)})).fail((function(e){t.textContent=String(e||"Error fetching /modules/Typescript/Form/resources/action-bar.html")}))}},{key:"addPaymentCouponCodeControlToPageFooter",value:function(){var e=this.getForm().getCouponCode();e&&this.footer.appendChild(e.getRootNode())}},{key:"renderFooter",value:function(){for(;this.footer.firstChild;)this.footer.removeChild(this.footer.firstChild);this.isAttached()&&(this.isLastPage()&&(Rt.ALLOW_COUPON_CODES_ON_LAST_PAGE_FOOTER&&this.addPaymentCouponCodeControlToPageFooter(),Rt.ALLOW_PAYMENTS_SELECTOR&&this.addPaymentProcessorsToPageFooter(),Rt.ALLOW_PAYMENTS_SUMMARY&&this.addPaymentsSummaryToPageFooter(),this.addCaptchaControlToPageFooter()),this.addActionBarControlToPageFooter())}},{key:"isRemovable",value:function(){return!1}},{key:"getParentPage",value:function(){return this}},{key:"getMaxColspan",value:function(){return 20}},{key:"getColspan",value:function(){return 20}},{key:"split",value:function(e,t){if(t!==T.l.TOP&&t!==T.l.BOTTOM)throw new Error("Invalid argument: referenceRowEdge: EElementEdge.TOP || EElementEdge.BOTTOM expected!");for(var n=null,i=0,r=this.children.length;i<r;i++)this.children[i]===e&&(n=i);if(null===n)throw new Error("Invalid reference row!");t===T.l.BOTTOM&&n++;var a=this.getForm().getEngine().createElement(C.a.CONTAINER_TYPE_PAGE);for(this.getParent().insertAfter(this,a);this.children.length-1>=n;)a.appendChild(this.children[n])}},{key:"mergeWith",value:function(e){for(var t=e.getChildren().slice(0),n=0,i=t.length;n<i;n++)this.appendChild(t[n]);e.getParent().removeChild(e)}},{key:"getPageSeparatorDOMNode",value:function(){return this.separator}},{key:"isDragable",value:function(){return!1}},{key:"isDuplicatable",value:function(){return!1}},{key:"getHeaderContainerDOMNode",value:function(){return this.header}},{key:"getPaginationType",value:function(){return this.getForm().getProperty("options.paginationType")}},{key:"setPaginationType",value:function(e){switch(e){case T.w.NONE:case T.w.PAGE_NUMBERS:case T.w.PERCENTAGE:case T.w.STEPS:console.warn("set pagination type: ",e),this.getForm().setProperty("options.paginationType",e);break;default:this.getForm().setProperty("options.paginationType",T.w.NONE)}}},{key:"getPageTitlesVisibility",value:function(){return this.getForm().getProperty("options.showPageTitles")}},{key:"setPageTitlesVisibility",value:function(e){this.getForm().setProperty("options.showPageTitles",!!e)}},{key:"loadEmptyStateMarkup",value:function(){var e=this;this.getForm().getEngine().getResourceManager().get("/modules/Typescript/Form/resources/empty-state-page.html").then((function(t){e.emptyPageContainer.innerHTML=t,e.getForm().getEngine().getI18n().translateDOMNode(e.emptyPageContainer)}))}},{key:"setActionBarButtonVisibility",value:function(e,t){if(null!==e){for(var n=0,i=this.actionBarButtonsVisibilityStates.length;n<i;n++)if(this.actionBarButtonsVisibilityStates[n].button===e)return null===t?this.actionBarButtonsVisibilityStates.splice(n,1):this.actionBarButtonsVisibilityStates[n].visible=t,void this.updateActionBarButtonsThrottled();null!==t&&this.actionBarButtonsVisibilityStates.push({button:e,visible:t}),this.updateActionBarButtonsThrottled()}}},{key:"getActionBarButtonVisibility",value:function(e){for(var t=0,n=this.actionBarButtonsVisibilityStates.length;t<n;t++)if(this.actionBarButtonsVisibilityStates[t].button===e)return this.actionBarButtonsVisibilityStates[t].visible;return null}},{key:"updateActionBarButtonsVisibilityStates",value:function(e){if(e){for(var t,i,r=Array.prototype.slice.call(e.attributes,0),a=r.length,o=0;o<a;o++)n.isActionBarDOMAttributeName(r[o].name)&&(t=n.getActionBarButtonFromDOMAttributeName(r[o].name),e.setAttribute(r[o].name,this.getActionBarButtonVisibility(t)?"1":"0"));for(var s=0,l=this.actionBarButtonsVisibilityStates.length;s<l;s++)i=n.getActionBarDOMAttributeNameFromButtonType(this.actionBarButtonsVisibilityStates[s].button),e.hasAttribute(i)||e.setAttribute(i,this.actionBarButtonsVisibilityStates[s].visible?"1":"0")}}},{key:"updateActionBarButtonsInImmediateMode",value:function(){this.updateActionBarButtonsVisibilityStates(this.footer.querySelector("div[data-role=control][data-type=form-action-bar]"))}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"enumerateTranslations",value:function(){var e=[],t=this.getProperty("label.labelText")||"";return t&&e.push({key:"page_".concat(this.getIndex(),"_label"),sourceText:t}),e}}],[{key:"getConfiguration",value:function(){return{category:"containers",icon:"i123-date",isContainer:!0,keywords:"page",name:"Page",typeId:C.a.CONTAINER_TYPE_PAGE,isVirtual:!0,index:99999,accessibilityFields:T.r.NONE}}},{key:"isActionBarDOMAttributeName",value:function(e){return n.ACTIONBAR_DOM_NODE_ATTRIBUTE_NAMES.indexOf(e)>-1}},{key:"getActionBarButtonFromDOMAttributeName",value:function(e){switch(e){case"data-button-submit":return T.a.SUBMIT;case"data-button-calculate":return T.a.CALCULATE;case"data-button-show-summary":return T.a.SHOW_SUMMARY;case"data-button-next-page":return T.a.NEXT_PAGE;case"data-button-previous-page":return T.a.PREVIOUS_PAGE;case"data-button-approve":return T.a.APPROVE;case"data-button-preview":return T.a.PREVIEW;case"data-button-print":return T.a.PRINT;case"data-button-reset":return T.a.RESET;case"data-button-save-for-later":return T.a.SAVE_FOR_LATER;default:return null}}},{key:"getActionBarDOMAttributeNameFromButtonType",value:function(e){switch(e){case T.a.SUBMIT:return"data-button-submit";case T.a.CALCULATE:return"data-button-calculate";case T.a.SHOW_SUMMARY:return"data-button-show-summary";case T.a.NEXT_PAGE:return"data-button-next-page";case T.a.PREVIOUS_PAGE:return"data-button-previous-page";case T.a.APPROVE:return"data-button-approve";case T.a.PREVIEW:return"data-button-preview";case T.a.PRINT:return"data-button-print";case T.a.RESET:return"data-button-reset";case T.a.SAVE_FOR_LATER:return"data-button-save-for-later";default:return null}}}]),n}(Ma);function Ga(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Ha,"ACTIONBAR_DOM_NODE_ATTRIBUTE_NAMES",["data-button-submit","data-button-calculate","data-button-show-summary","data-button-next-page","data-button-previous-page","data-button-approve","data-button-preview","data-button-print","data-button-reset","data-button-save-for-later"]),v()(Ha,"nodeName","page"),v()(Ha,"attributes",{}),v()(Ha,"runtime",null),v()(Ha,"DUMMY_VALUE_FOR_RTS_RIBBON","99");var Wa=function(e){g()(n,e);var t=Ga(n);function n(e,i){var r;return o()(this,n),(r=t.call(this,e,i)).rootNode.removeChild(r.emptyPageContainer),r.separator=document.createElement("div"),r.separator.setAttribute("data-role","after-submit-page-break"),r.separator.innerHTML='<div><div data-role="page-separator-line"></div>\n            <button data-role="after-submit-button" data-i18n-text="edt_text_after_submit_button">After submit</button>\n            <div data-role="page-separator-line"></div></div>',r.updateActionBarButtonsThrottled=O.a.create((function(){r.updateActionBarButtonsInImmediateMode()}),50),r}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_PAYMENT_SUMMARY_PAGE}},{key:"renderFooter",value:function(){for(;this.footer.firstChild;)this.footer.removeChild(this.footer.firstChild);this.isAttached()&&(Rt.ALLOW_PAYMENTS_SUMMARY&&this.addPaymentsSummaryToPageFooter(),this.addActionBarControlToPageFooter())}},{key:"addPaymentsSummaryToPageFooter",value:function(){var e=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.DETAILED_INVOICE_OPTIONS);if(e&&!e.showPaymentsSummaryBelowForm){var t=document.createElement("div");t.setAttribute("data-type","payment-summary"),this.getForm().getEngine().getLoader().getLoaderDependency(T.A.SHOULD_SHOW_PAYMENT_SUMMARY)||t.setAttribute("data-is-empty","1"),t.innerHTML=this.getForm().getEngine().getLoader().getLoaderDependency(T.A.LAST_CALCULATION_HTML_MARKUP)||"",this.getForm().getEngine().getLoader().execCommand("add-payment-summary-listeners",t),this.footer.appendChild(t)}}}]),n}(Ha);function Ka(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Wa,"nodeName","payment-summary-page");var za=function(e){g()(n,e);var t=Ka(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_ROW}},{key:"getElementName",value:function(){return"Row"}},{key:"getLayoutDirection",value:function(){return T.z.LEFT_TO_RIGHT}},{key:"getMinColspan",value:function(){for(var e=0,t=0,n=this.children.length;t<n;t++)e+=this.children[t].getMinColspan();return e||1}},{key:"makeElementsToFitColspanUsingTheFairResizingAlgorithm",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!==e&&0!==this.children.length){var n,i=0,r=0,a=0,o=0;if(!(e<0)){do{n=[],i=0,r=0;for(var s=0,l=this.children.length;s<l;s++)(r=(a=this.children[s].getColspan())-this.children[s].getMinColspan())>0&&n.push({element:this.children[s],canDecreaseColspan:r,colspan:a}),i+=a;if(0===n.length)break;if(i<=e)break;n.sort((function(e,t){return t.canDecreaseColspan-e.canDecreaseColspan}));for(var u=0,c=n.length;u<c;u++)if(n[u].element.withColspan(n[u].colspan-1),n[u].element.getColspan()!==n[u].colspan){i--;break}if(++o>20){console.warn("fair resize: infinite loop detected while shrinking!");break}}while(i>=e);if(t){o=0;do{n=[],i=0;for(var d=0,p=this.children.length;d<p;d++)n.push({element:this.children[d],canDecreaseColspan:0,colspan:a=this.children[d].getColspan()}),i+=a;if(i>=e)break;n.sort((function(e,t){return e.canDecreaseColspan-t.canDecreaseColspan}));for(var h=0,g=n.length;h<g;h++)if(n[h].element.withColspan(n[h].colspan+1),n[h].element.getColspan()!=n[h].colspan){i++;break}if(++o>20){console.warn("fair resize: infinite loop detected while enlarging!");break}}while(i<e)}}}}},{key:"withColspan",value:function(e){return null===e||this.makeElementsToFitColspanUsingTheFairResizingAlgorithm(e),p()(E()(n.prototype),"withColspan",this).call(this,e)}},{key:"getColspan",value:function(){var e=p()(E()(n.prototype),"getColspan",this).call(this);return null===e&&null!==this.getParent()&&(e=this.getParent().getColspan()),null===e?20:e}},{key:"isRemovable",value:function(){return!0}},{key:"isDuplicatable",value:function(){return!1}},{key:"isSelectable",value:function(){return!1}},{key:"isDragable",value:function(){return!1}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"enumerateTranslations",value:function(){return[]}}],[{key:"getConfiguration",value:function(){return null}}]),n}(Ma);function qa(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(za,"nodeName","virtual-form-table-row"),v()(za,"attributes",{}),v()(za,"runtime",null);var Xa=function(e){g()(n,e);var t=qa(n);function n(e,i){var r;o()(this,n),r=t.call(this,e,i),v()(c()(r),"body",void 0),v()(c()(r),"addGroupButton",void 0),v()(c()(r),"visible",void 0);var a=r.getHash();return r.labelDOMNode=document.createElement("label"),r.labelDOMNode.setAttribute("data-role","label"),r.labelDOMNode.setAttribute("id","repeatable-".concat(a,"-acc")),r.instructionsDOMNode=document.createElement("dt"),r.instructionsDOMNode.setAttribute("data-role","instructions"),r.instructionsDOMNode.setAttribute("aria-labelledby","repeatable-".concat(a,"-instr-acc")),r.rootNode.tabIndex=0,r.rootNode.setAttribute("aria-labelledby","repeatable-".concat(a,"-acc ")+"repeatable-".concat(a,"-error-acc ")+"repeatable-".concat(a,"-instr-acc")),r.body=document.createElement("div"),r.body.setAttribute("data-role","body"),r.addGroupButton=document.createElement("button"),r.addGroupButton.setAttribute("data-role","add-group-button"),r.addGroupButton.setAttribute("type","button"),r.rootNode.appendChild(r.labelDOMNode),r.rootNode.appendChild(r.instructionsDOMNode),r.rootNode.appendChild(r.body),r.rootNode.appendChild(r.addGroupButton),r.init(),r}return l()(n,[{key:"init",value:function(){this.onAddButtonTextChanged(),this.onBorderSettingsChanged(),this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&this.initViewFormEvents()}},{key:"onCreated",value:function(){this.updateLabelText(),this.updateInstructionsText(),this.onAddButtonTextChanged(),this.onBorderSettingsChanged(),this.updateMaxLimitReachedAttribute(null,null)}},{key:"setupDefaults",value:function(){return this.appendChild(this.getForm().getEngine().getFactory().createItemByTypeId(C.a.CONTAINER_TYPE_REPEATABLE_GROUP,this.getForm())),this.setProperty("label.labelText","Repeatable container"),this.updateLabelText(),this}},{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_REPEATABLE}},{key:"getElementName",value:function(){return"Repeatable container"}},{key:"appendChild",value:function(e){if(!e||e.getTypeId()!==C.a.CONTAINER_TYPE_REPEATABLE_GROUP)throw new Error("Element type ".concat(e.getElementName()," is not supported directly in the form root!"));return p()(E()(n.prototype),"appendChild",this).call(this,e)}},{key:"insertBefore",value:function(e,t){if(!t||t.getTypeId()!==C.a.CONTAINER_TYPE_REPEATABLE_GROUP)throw new Error("Element type not supported directly in the form root!");if(e===t)throw new Error("Invalid argument: reference and child are the same!");return p()(E()(n.prototype),"insertBefore",this).call(this,e,t)}},{key:"insertAfter",value:function(e,t){if(!t||t.getTypeId()!==C.a.CONTAINER_TYPE_REPEATABLE_GROUP)throw new Error("Element type not supported directly in the form root!");if(e===t)throw new Error("Invalid argument: reference and child are the same!");return p()(E()(n.prototype),"insertAfter",this).call(this,e,t)}},{key:"removeChild",value:function(e){return p()(E()(n.prototype),"removeChild",this).call(this,e)}},{key:"isRenderingSupported",value:function(){return!0}},{key:"getResizingCapability",value:function(){return T.K.LEFT_AND_RIGHT}},{key:"setRendererType",value:function(e){}},{key:"setupI18n",value:function(){return this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!0}},{key:"getDOMInsertionNode",value:function(){return this.body}},{key:"setProperty",value:function(e,t){return p()(E()(n.prototype),"setProperty",this).call(this,e,t)}},{key:"onAddButtonTextChanged",value:function(){var e=this.getProperty("configuration.addButtonText");this.addGroupButton.textContent=String(e||"")||"Add more"}},{key:"onBorderSettingsChanged",value:function(){this.getProperty("configuration.showBorders")?this.rootNode.setAttribute("data-show-borders","1"):this.rootNode.removeAttribute("data-show-borders")}},{key:"initViewFormEvents",value:function(){var e=this;this.addGroupButton.onclick=function(){e.addNewGroup(),jt.refreshFrameHeightOnWix()}}},{key:"addNewGroup",value:function(){var e=this.getProperty("configuration.maxNumberOfGroupsAllowed"),t=this.getChildren(),n=t.length;if(!(e<=n)&&!(t.length<1)){this.updateMaxLimitReachedAttribute(e,n);var i=t[0].cloneNode(!0);return this.getForm().getEngine().getI18n().translateDOMNode(i.getDOMInsertionNode()),this.appendChild(i),i}}},{key:"updateMaxLimitReachedAttribute",value:function(e,t){e||(e=this.getProperty("configuration.maxNumberOfGroupsAllowed")),t||(t=this.getChildren().length),e<=t+1&&this.rootNode.setAttribute("data-max-limit-reached","1")}},{key:"updateNumberOfGroupsAllowed",value:function(){var e=this.getProperty("configuration.maxNumberOfGroupsAllowed");e&&this.rootNode.setAttribute("data-max-number-of-groups",e)}},{key:"isRemovable",value:function(){return!0}},{key:"onRemoveGroupButtonClicked",value:function(e){var t=this.getChildren(),n=t.indexOf(e),i=t.length,r=this.getProperty("configuration.maxNumberOfGroupsAllowed");t.length<1||-1!==n&&(r>=i-1&&this.rootNode.removeAttribute("data-max-limit-reached"),this.removeChild(e),jt.refreshFrameHeightOnWix())}},{key:"enumerateDisabledProperties",value:function(){var e=this.getParent()?this.getParent().enumerateDisabledProperties():null,t=["synchronize.enabled","synchronize.withControlId","configuration.isLimitSubmissionsEnabled","configuration.limitSubmissionsTotal","configuration.currentSubmissionsValue"];return e=e?e.concat(t):t}},{key:"isSelectable",value:function(){return!0}},{key:"cloneNode",value:function(e){return p()(E()(n.prototype),"cloneNode",this).call(this,!0,!1)}},{key:"getPropertyDescriptorByInputIndex",value:function(e){switch(e){case 0:return{targetPropertyFQN:"label.label",type:"string",optional:!0};default:return null}}},{key:"isVisible",value:function(){return this.visible}},{key:"setVisible",value:function(e){e=!!e,this.visible=e,this.visible?(this.getRootNode().removeAttribute("data-is-hidden"),this.getForm().getEngine().getLoader().execCommand("control-has-changed-visibility",{controlId:this.getId(),visibility:this.visible,element:this})):this.getRootNode().setAttribute("data-is-hidden",""),jt.refreshFrameHeightOnWix()}}],[{key:"getConfiguration",value:function(){return{typeId:C.a.CONTAINER_TYPE_REPEATABLE,name:"Repeatable container",isContainer:!0,category:"advanced",keywords:"repeatable container",icon:"i123-repeatable_container",isVirtual:!1,i18nName:"edt_UI_container_type_repeatable",i18nKeywords:"edt_UI_container_type_repeatable_keywords",index:155,accessibilityFields:T.r.ROOT_NODE,isBetaFeature:!0}}},{key:"getDropDestinationCSSSelector",value:function(){return"#form > div[data-role=page] > div[data-role=page-body] *:not([data-role=container][data-type=repeatable]), #form > div[data-role=page] > div[data-role=page-body] *:not([data-role=container][data-type=repeatable]) *"}}]),n}(Ma);function Qa(e){var t=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}}();return function(){var n,i=E()(e);if(t){var r=E()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}v()(Xa,"MAX_ALLOWED_NUMBER_OF_GROUPS",60),v()(Xa,"attributes",{}),v()(Xa,"runtime",null),v()(Xa,"nodeName","repeatable");var $a,ja,Ja,Za,eo,to,no,io,ro,ao,oo,so,lo,uo,co,po,ho,go,_o,fo,yo,Eo,mo,vo,To,Oo,Co,No=function(e){g()(n,e);var t=Qa(n);function n(e,i){var r;return o()(this,n),r=t.call(this,e,i),v()(c()(r),"body",void 0),v()(c()(r),"removeGroupButton",void 0),r.body=document.createElement("div"),r.body.setAttribute("data-role","body"),r.removeGroupButton=document.createElement("button"),r.removeGroupButton.setAttribute("data-role","remove-group-button"),r.removeGroupButton.setAttribute("type","button"),r.removeGroupButton.innerHTML='<i class="i123-close"></i>',r.removeGroupButton.setAttribute("type","button"),r.rootNode.appendChild(r.body),r.rootNode.appendChild(r.removeGroupButton),r.init(),r}return l()(n,[{key:"init",value:function(){var e=this;this.getForm().getEngine().getLoader().getLoaderType()===T.v.VIEW&&(this.initViewFormEvents(),setTimeout((function(){e.updateRepeatableElementAttributes(),e.updateRepeatableElementPrefillAttributes()}),1)),this.getForm().getEngine().getLoader().getLoaderType()===T.v.EDIT&&(this.updateEmptyStateDomNodes(),setTimeout((function(){e.updateEmptyStateAttribute()}),1))}},{key:"getTypeId",value:function(){return C.a.CONTAINER_TYPE_REPEATABLE_GROUP}},{key:"getElementName",value:function(){return"Repeatable group"}},{key:"appendChild",value:function(e){var t=this;return setTimeout((function(){t.updateEmptyStateAttribute()}),1),p()(E()(n.prototype),"appendChild",this).call(this,e)}},{key:"insertBefore",value:function(e,t){var i=this;return setTimeout((function(){i.updateEmptyStateAttribute()}),1),p()(E()(n.prototype),"insertBefore",this).call(this,e,t)}},{key:"insertAfter",value:function(e,t){var i=this;return setTimeout((function(){i.updateEmptyStateAttribute()}),1),p()(E()(n.prototype),"insertAfter",this).call(this,e,t)}},{key:"removeChild",value:function(e){var t=this;return setTimeout((function(){t.updateEmptyStateAttribute()}),1),p()(E()(n.prototype),"removeChild",this).call(this,e)}},{key:"isRenderingSupported",value:function(){return!1}},{key:"getResizingCapability",value:function(){return T.K.NONE}},{key:"setRendererType",value:function(e){}},{key:"setupI18n",value:function(){return this}},{key:"isCountableWhenComputingFormNumberOfControls",value:function(){return!1}},{key:"getDOMInsertionNode",value:function(){return this.body}},{key:"isRemovable",value:function(){return!0}},{key:"isDuplicatable",value:function(){return!1}},{key:"isDragable",value:function(){return!1}},{key:"isSelectable",value:function(){return!1}},{key:"getRepeatableGroupIndexAttribute",value:function(){return~~this.rootNode.getAttribute("data-repeatable-index")}},{key:"setRepeatableGroupIndexAttribute",value:function(e){this.rootNode.setAttribute("data-repeatable-index",String(e))}},{key:"getRepeatableGroupPathAttribute",value:function(){return this.rootNode.getAttribute("data-repeatable-path")}},{key:"setRepeatableGroupPathAttribute",value:function(e){this.rootNode.setAttribute("data-repeatable-path",e)}},{key:"initViewFormEvents",value:function(){var e=this;this.removeGroupButton.onclick=function(){var t=e.getParent();t&&t.onRemoveGroupButtonClicked(e)}}},{key:"updateEmptyStateDomNodes",value:function(){var e=document.createElement("span"),t=document.createElement("span");e.className="i-lg i123-empty-page",e.setAttribute("data-role","empty-state-icon"),t.textContent="Drag and drop fields here",t.setAttribute("data-role","empty-state-text"),this.body.appendChild(e),this.body.appendChild(t)}},{key:"hasControls",value:function(){return this.getChildren().length>0}},{key:"updateEmptyStateAttribute",value:function(){this.hasControls()?this.rootNode.removeAttribute("data-empty-state"):this.rootNode.setAttribute("data-empty-state","1")}},{key:"updateRepeatableElementAttributes",value:function(){var e,t=this.getFirstParentOfType(C.a.CONTAINER_TYPE_REPEATABLE_GROUP),n=1+~~this.getFirstParentOfType(C.a.CONTAINER_TYPE_REPEATABLE).getChildren().slice(-2)[0].getRepeatableGroupIndexAttribute();if(t){var i=t.getRepeatableGroupPathAttribute();e="".concat(i,".").concat(n)}else e=n;this.setRepeatableGroupIndexAttribute(n),this.setRepeatableGroupPathAttribute(e)}},{key:"resetRepeatableElementAttributes",value:function(){var e,t=this.getFirstParentOfType(C.a.CONTAINER_TYPE_REPEATABLE_GROUP),n=this.getFirstParentOfType(C.a.CONTAINER_TYPE_REPEATABLE).getChildren();if(t){var i=t.getRepeatableGroupPathAttribute();if(n.length)for(var r=0,a=n.length;r<a;r++){var o=r+1;e="".concat(i,".").concat(o),n[r].setRepeatableGroupIndexAttribute(o),n[r].setRepeatableGroupPathAttribute(e)}}else if(n.length)for(var s=0,l=n.length;s<l;s++){var u=s+1;e=s+1,n[s].setRepeatableGroupIndexAttribute(u),n[s].setRepeatableGroupPathAttribute(e)}}},{key:"removeRepeatableAttributes",value:function(e){this.rootNode.removeAttribute("data-repeatable-index"),this.rootNode.removeAttribute("data-repeatable-path")}},{key:"updateRepeatableElementPrefillAttributes",value:function(){var e=this.getControlsRecursively(this);this.markSalesforceControlsWithDOMAttributeOnRepeatedControl(e,this.getForm().getEngine().getLoader().getRules().getSalesforceAffectedControlsTriggers(),"trigger"),this.markSalesforceControlsWithDOMAttributeOnRepeatedControl(e,this.getForm().getEngine().getLoader().getRules().getSalesforceAffectedControls(),"normalField")}},{key:"getControlsRecursively",value:function(e){var t=[];if(e.getElementKind()===T.m.CONTAINER)for(var n=0,i=e.getChildren(),r=i.length;n<r;n++)i[n].getElementKind()===T.m.CONTAINER?t=t.concat(this.getControlsRecursively(i[n])):i[n].getElementKind()===T.m.CONTROL&&t.push(i[n]);else e.getElementKind()===T.m.CONTROL&&t.push(e);return t}},{key:"markSalesforceControlsWithDOMAttributeOnRepeatedControl",value:function(e,t,n){for(var i=0,r=e.length;i<r;i++){var a=e[i],o=void 0;a&&-1!==t.indexOf("control_".concat(a.getId()))&&(o=a.getRootNode())&&("trigger"===n?o.setAttribute("data-is-salesforce-prefill-trigger","1"):o.setAttribute("data-is-salesforce-prefill-normal","1"))}}}],[{key:"getConfiguration",value:function(){return{category:"containers",icon:"i123-date",isContainer:!0,keywords:"div container",name:"Div",typeId:C.a.CONTAINER_TYPE_REPEATABLE_GROUP,isVirtual:!0,index:12,accessibilityFields:T.r.NONE}}}]),n}(Ma);v()(No,"attributes",{}),v()(No,"runtime",null),v()(No,"nodeName","repeatable-group"),function(e){e[e.ICON=0]="ICON",e[e.ICONFONT=1]="ICONFONT"}($a||($a={})),function(e){e[e.TEXT=0]="TEXT",e[e.IMAGE=1]="IMAGE",e[e.AUTO_POPUP=2]="AUTO_POPUP",e[e.FLOATING_BUTTON=3]="FLOATING_BUTTON"}(ja||(ja={})),function(e){e[e.TEXT=0]="TEXT",e[e.IMAGE=1]="IMAGE"}(Ja||(Ja={})),function(e){e.PUBLISH="publish-form",e.NOTIFICATIONS="notifications",e.EDITOR="editor",e.TRANSLATIONS="translations",e.ITEM="item",e.PRODUCTS="productsDialog"}(Za||(Za={})),function(e){e[e.ABSTRACT_CHILD=0]="ABSTRACT_CHILD",e[e.ABSTRACT_CHILD_THAT_SUPPORTS_CHILDREN=1]="ABSTRACT_CHILD_THAT_SUPPORTS_CHILDREN",e[e.BUTTON_COMPONENT=2]="BUTTON_COMPONENT",e[e.CHECKBOX_COMPONENT=3]="CHECKBOX_COMPONENT",e[e.COMPONENT=4]="COMPONENT",e[e.CONTAINER=5]="CONTAINER",e[e.DIVIDER=6]="DIVIDER",e[e.DROPDOWN=7]="DROPDOWN",e[e.EXTENSION=8]="EXTENSION",e[e.HEADER=9]="HEADER",e[e.HEADING=10]="HEADING",e[e.ITEM=11]="ITEM",e[e.OVERLAY=12]="OVERLAY",e[e.SCROLLABLE=13]="SCROLLABLE"}(eo||(eo={})),function(e){e.FORMS="FORMS",e.RULES="RULES"}(to||(to={})),function(e){e.PROMO="PROMO",e.CONTAINER="CONTAINER"}(no||(no={})),function(e){e.ANCHOR="ANCHOR",e.ANCHOR_NEW_TAB="ANCHOR_NEW_TAB",e.MENU="MENU",e.MENU_HOVER="MENU_HOVER",e.EVENT="EVENT",e.MENU_BACK="MENU_BACK"}(io||(io={})),function(e){e[e.NONE=0]="NONE",e[e.VIEW=1]="VIEW",e[e.EDIT=2]="EDIT"}(ro||(ro={})),function(e){e.HEADER_EVENT="HeaderEvent",e.MY_FORMS_CONTAINER="myFormsContainer",e.USERS_CONTAINER="usersContainer",e.SHOW_WIZARD_SWITCHER="showWizardSwitcher"}(ao||(ao={})),function(e){e[e.MENU_GET_LINK=1]="MENU_GET_LINK",e[e.MENU_EMBED_CODE=2]="MENU_EMBED_CODE",e[e.MENU_BLOGGER=3]="MENU_BLOGGER",e[e.MENU_SALESFORCE_MARKETING_CLOUD=4]="MENU_SALESFORCE_MARKETING_CLOUD",e[e.MENU_UNBOUNCE=5]="MENU_UNBOUNCE",e[e.MENU_GOOGLE_SITES=6]="MENU_GOOGLE_SITES",e[e.MENU_TWITTER=7]="MENU_TWITTER",e[e.MENU_SHOPIFY=8]="MENU_SHOPIFY",e[e.MENU_BIGCOMMERCE=9]="MENU_BIGCOMMERCE",e[e.MENU_PREVIEW_FORM=10]="MENU_PREVIEW_FORM",e[e.MENU_FACEBOOK=11]="MENU_FACEBOOK",e[e.MENU_JOOMLA=12]="MENU_JOOMLA",e[e.MENU_WORDPRESS=13]="MENU_WORDPRESS",e[e.MENU_EMBED_IN_PAGE=14]="MENU_EMBED_IN_PAGE",e[e.MENU_LINK_TO_FORM=15]="MENU_LINK_TO_FORM",e[e.MENU_LIGHTBOX=16]="MENU_LIGHTBOX",e[e.MENU_DIRECT_LINK=17]="MENU_DIRECT_LINK",e[e.MENU_CUSTOM_WEBSITE=18]="MENU_CUSTOM_WEBSITE",e[e.MENU_PLATFORMS=19]="MENU_PLATFORMS",e[e.MENU_SALESFORCE_COMMUNITY=20]="MENU_SALESFORCE_COMMUNITY",e[e.MENU_PUBLISH_ON_WIX=21]="MENU_PUBLISH_ON_WIX"}(oo||(oo={})),function(e){e[e.ACCOUNT_MENU_HELP_KNOWLEDGE_BASE=11]="ACCOUNT_MENU_HELP_KNOWLEDGE_BASE",e[e.ACCOUNT_MENU_HELP_SUPPORT=12]="ACCOUNT_MENU_HELP_SUPPORT",e[e.ACCOUNT_MENU_HELP_CONTACT=13]="ACCOUNT_MENU_HELP_CONTACT",e[e.ACCOUNT_MENU_HELP_TERMS_OF_SERVICE=14]="ACCOUNT_MENU_HELP_TERMS_OF_SERVICE",e[e.ACCOUNT_MENU_HELP_PRIVACY=15]="ACCOUNT_MENU_HELP_PRIVACY"}(so||(so={})),function(e){e.EMAIL_AND_SMS="EmailAndSMS",e.PUBLISH_WEEBLY="PublishOnWeebly",e.PRODUCTS="Products",e.TRANSLATIONS="Translations",e.UNDO="Undo",e.REDO="Redo",e.EDIT_TITLE_BOX="EditTitleBox",e.CUSTOMIZE_THEME="CustomizeTheme",e.ADD_FIELDS="AddFields",e.EDIT_TITLE="EditTitle",e.SHOW_WHATS_NEW="ShowWhatsNew",e.CHANGE_TAB="ChangeTab",e.SHOW_SUPPORT="ShowSupport",e.SEARCH_FORMS_STRING="SearchFormString",e.SEARCH_FORMS_CLEAR_STRING="SearchFormsClearString",e.NEW_FOLDER="NewFolder",e.SORT_BY="SortBy",e.ITEMS_PER_PAGE="ItemsPerPage",e.SELECT_ALL_VISIBLE_FORMS="SelectAllVisibleForms",e.DESELECT_ALL_FORMS="DeselectAllForms",e.DUPLICATE_SELECTED_FORMS="DuplicateSelectedForms",e.DELETE_SELECTED_FORMS="DeleteSelectedForms",e.PUBLISH_PLATFORMS="PublishPlatforms",e.PUBLISH_GET_LINK="PublishGetLink",e.PUBLISH_EMBED_CODE="PublishEmbedCode",e.PUBLISH_SHOPIFY="PublishShopify",e.PUBLISH_BIG_COMMERCE="PublishBigCommerce",e.PUBLISH_FACEBOOK="PublishFacebook",e.PUBLISH_BLOGGER="PublishBlogger",e.PUBLISH_WORDPRESS="PublishWordpress",e.PUBLISH_JOOMLA="PublishJoomla",e.PUBLISH_SALESFORCE="PublishSalesforce",e.PUBLISH_UNBOUNCE="PublishUnbounce",e.PUBLISH_GOOGLE_SITES="PublishGoogleSites",e.PUBLISH_TWITTER="PublishTwitter",e.PUBLISH_SALESFORCE_COMMUNITY="PublishSalesforceCommunity",e.PUBLISH_SALESFORCE_PLATFORMS="PublishSalesforcePlatforms",e.PUBLISH_WEEBLY_LINK="PublishLinkOnWeebly",e.PUBLISH_WEEBLY_LIGHTBOX="PublishLightboxOnWeebly",e.PUBLISH_WEEBLY_PLATFORMS="PublishPlatformsOnWeebly",e.PUBLISH_BIG_COMMERCE_LINK="PublishLinkBigCommerce",e.PUBLISH_BIG_COMMERCE_LIGHTBOX="PublishLightboxBigCommerce",e.PUBLISH_BIG_COMMERCE_PLATFORMS="PublishPlatformsOnBigCommerce",e.PUBLISH_SHOPIFY_LINK="PublishLinkShopify",e.PUBLISH_SHOPIFY_LIGHTBOX="PublishLightboxShopify",e.PUBLISH_SHOPIFY_PLATFORMS="PublishPlatformsOnShopify",e.PAYMENTS="Payments",e.WHITE_LABEL="WhiteLabel",e.SHOW_WIZARD_SWITCHER="ShowWizardSwitcher"}(lo||(lo={})),function(e){e.TASKS="tasks",e.REQUESTS="requests",e.WORKFLOWS="workflows",e.WORKFLOWS_TEMPLATES="wf_templates",e.WORKFLOWS_EDIT="workflows_edit",e.USERS="usrman"}(uo||(uo={})),function(e){e.EDIT_FIELDS="edit_fields",e.SUBMISSIONS="submissions",e.PUBLISH="publish",e.REPORTS="reports",e.SETTINGS="settings",e.DASHBOARD="dashboard",e.SET_SELECTED_LANGUAGE="setselectedlanguage",e.MY_FORMS="your_forms",e.MYACCOUNT="myaccount",e.SALESFORCE_OBJECTS="salesforce_objects",e.SALESFORCE_MAPPING="salesforce-mapping",e.NEW_FORM="new_form",e.USRMAN="usrman",e.MYACCOUNT_UPGRADE="myaccount_upgrade",e.FEATURES_MATRIX="features-matrix",e.FEATURES_MATRIX_WIX="features-matrix-wix",e.FEATURES_MATRIX_WEEBLY="features-matrix-weebly",e.FORM_TEMPLATE="form_template",e.WHITE_LABEL="white_label",e.CANCEL_SUBSCRIPTION="cancel_subscription"}(co||(co={})),function(e){e.WIX="wix",e.WEEBLY="weebly",e.CAPTAIN_FORM="captainForm",e.BETA="beta",e.SALESFORCE="salesForce",e.WORKFLOWS="workflows",e.SHOPIFY="shopify",e.BIG_COMMERCE="bigcommerce",e.MAIN_123="123"}(po||(po={})),function(e){e[e.NOTIFICATIONS=1]="NOTIFICATIONS",e[e.THEMES=2]="THEMES",e[e.APPS=3]="APPS",e[e.PAYMENTS=4]="PAYMENTS",e[e.SECURITY=5]="SECURITY",e[e.RULES=6]="RULES",e[e.TRANSLATIONS=7]="TRANSLATIONS",e[e.ADVANCED=8]="ADVANCED",e[e.THANK_YOU=10]="THANK_YOU",e[e.NONE=0]="NONE",e[e.APPROVALS=9]="APPROVALS",e[e.HOOKS=11]="HOOKS"}(ho||(ho={})),function(e){e.SELECT_ITEM="selectItem",e.DESELECT_ITEM="deselectItem",e.HIDE_SELECTION_BAR="hideSelectionBar",e.SHOW_SELECTION_BAR="showSelectionBar",e.SELECT_ALL_FORMS="SelectAllForms",e.MOVE_SELECTED_FORMS="MoveSelectedForms",e.SELECTION_PER_PAGE="SelectionPerPage"}(go||(go={})),function(e){e.ICON_BUTTON="IconButton",e.BUTTON="Button"}(_o||(_o={})),function(e){e.ICON_BUTTON="IconButton",e.BUTTON="Button"}(fo||(fo={})),function(e){e.SHOPIFY_REVIEW="https://apps.shopify.com/123formbuilder#modal-show=ReviewListingModal"}(yo||(yo={})),function(e){e.DUPLICATE="i123-duplicate",e.MOVE_TO="i123-move_to",e.DELETE="i123-delete"}(Eo||(Eo={})),function(e){e.LARGE="i-lg"}(mo||(mo={})),function(e){e[e.STANDARD_USER=0]="STANDARD_USER",e[e.ADMINISTRATOR=1]="ADMINISTRATOR",e[e.VIEWER=2]="VIEWER",e[e.COMPANY_ADMINISTRATOR=3]="COMPANY_ADMINISTRATOR"}(vo||(vo={})),function(e){e[e.OK=0]="OK",e[e.PAYMENT_PROBLEMS=1]="PAYMENT_PROBLEMS",e[e.PHISHING=2]="PHISHING",e[e.USES_ADVANCED_FEATURES=3]="USES_ADVANCED_FEATURES",e[e.SUBMISSIONS_EXCEEDED=4]="SUBMISSIONS_EXCEEDED"}(To||(To={})),function(e){e.HAMBURGER="ui_hamburger",e.HEADER="ui_header",e.SUBHEADER="ui_subheader",e.TITLE_INPUT="ui_title_input",e.ACTION_BAR="ui_action_bar",e.SELECTION_BAR="ui_selection_bar",e.SEARCH_BOX="ui_search_box"}(Oo||(Oo={})),function(e){e[e.SETTINGS=0]="SETTINGS",e[e.SUBMISSIONS=1]="SUBMISSIONS",e[e.REPORTS=2]="REPORTS",e[e.FORM_EDITOR=3]="FORM_EDITOR"}(Co||(Co={}));var Ao=function(){function e(){o()(this,e),v()(this,"isNotificationsV2Initialised",!1),v()(this,"isTranslationsInitialised",!1),v()(this,"isThemesInitialised",!1),v()(this,"isPublishInitialised",!1),v()(this,"store",void 0),v()(this,"currentRoute",""),v()(this,"editorPanelGroup",void 0),v()(this,"loader",void 0),v()(this,"URLHandler",void 0),v()(this,"sidebarSwitcher",void 0),v()(this,"isSidebarSwitcherMounted",!1),v()(this,"editorPanelConfig",void 0),this.editorPanelConfig=window.EditorPanelConfig,this.URLHandler=window.builderUrlHandler,this.store=window.builderStore,this.store.subscribe(this.handleChange.bind(this)),this.createSidebarIfNeeded(),this.removeActiveStateIfNewForm()}return l()(e,[{key:"setPanelGroup",value:function(e){this.editorPanelGroup=e}},{key:"setLoader",value:function(e){this.loader=e}},{key:"createSidebarIfNeeded",value:function(){if(window.BOOTSTRAP_DATA&&window.BOOTSTRAP_DATA.builderSidebarExperiment){if(!window.BuilderSidebar)throw new Error("Dependency not found: BuilderSidebar");this.sidebarSwitcher=new window.BuilderSidebar}else this.sidebarSwitcher={render:function(e){}}}},{key:"handleChange",value:function(){var e,t=this.store.getState(),n=window.innerWidth,i=this.currentRoute===t.navigation.activeState,r=null===(e=this.editorPanelGroup)||void 0===e?void 0:e.isVisible(),a=t.action.type===Ua.a.NAVIGATE;if(i&&r&&n<=900&&a)return this.editorPanelGroup.setVisible(!1),void window.localStorage.setItem("noSidebarActiveState","1");i||(this.currentRoute=t.navigation.activeState),this.isSidebarSwitcherMounted?a&&this.updateView():(this.isSidebarSwitcherMounted=!0,this.sidebarSwitcher.render(this.canNavigate.bind(this)))}},{key:"updateView",value:function(){switch(this.currentRoute){case T.d.NOTIFICATIONS:this.showLoader(),this.redirectToNotificationsV2();break;case T.d.OLD_NOTIFICATIONS:this.redirectToNotificationsV1();break;case T.d.TRANSLATIONS:this.redirectToTranslations();break;case T.d.THEMES:this.redirectToThemes();break;case T.d.EDITOR:this.redirectToEditor();break;case T.d.PUBLISH:case T.d.PUBLISH_GET_LINK:case T.d.PUBLISH_WEEBLY_LINK:case T.d.PUBLISH_WEEBLY_LIGHTBOX:case T.d.PUBLISH_WEEBLY_PLATFORMS:case T.d.PUBLISH_WEEBLY:case T.d.PUBLISH_BIG_COMMERCE_LINK:case T.d.PUBLISH_BIG_COMMERCE_LIGHTBOX:case T.d.PUBLISH_BIG_COMMERCE_PLATFORMS:case T.d.PUBLISH_BIG_COMMERCE:case T.d.PUBLISH_SHOPIFY_LINK:case T.d.PUBLISH_SHOPIFY_LIGHTBOX:case T.d.PUBLISH_SHOPIFY_PLATFORMS:case T.d.PUBLISH_SHOPIFY:case T.d.PUBLISH_EMBED_CODE:case T.d.PUBLISH_BLOGGER:case T.d.PUBLISH_FACEBOOK:case T.d.PUBLISH_GOOGLE_SITES:case T.d.PUBLISH_JOOMLA:case T.d.PUBLISH_TWITTER:case T.d.PUBLISH_UNBOUNCE:case T.d.PUBLISH_WORDPRESS:case T.d.PUBLISH_PLATFORMS:case T.d.PUBLISH_PLATFORM_SHOPIFY:case T.d.PUBLISH_PLATFORM_WEEBLY:case T.d.PUBLISH_PLATFORM_BIG_COMMERCE:case T.d.PUBLISH_SALESFORCE:case T.d.PUBLISH_SALESFORCE_COMMUNITY:case T.d.PUBLISH_SALESFORCE_PLATFORMS:this.redirectToPublishV2(this.currentRoute);break;case T.d.PUBLISH_V1:this.redirectToPublishV1();break;case T.d.PAYMENTS:this.redirectToPayments();break;case T.d.PAYMENTS_V1:this.redirectToPaymentsV1();break;default:console.error("Route not implemented yet for: ".concat(this.currentRoute))}}},{key:"showLoader",value:function(){console.warn("Showing loader")}},{key:"redirectToNotificationsV2",value:function(){this.isNotificationsV2Initialised||this.editorPanelConfig.configureNewNotificationsPanel(this.editorPanelGroup,this.loader),this.isNotificationsV2Initialised=!0,this.editorPanelGroup.setVisible(!0),this.editorPanelGroup.setActivePanel(Za.NOTIFICATIONS),this.disableUndoService(),this.URLHandler.setNewUrl(Za.NOTIFICATIONS)}},{key:"redirectToNotificationsV1",value:function(){var e=this.loader.getHeader().getModel(),t=e.settings.formId,n=e.settings.pageName,i=e.settings.isSampleForm,r=i||n?"&click_from=".concat(n).concat(i?"_sample":""):"";this.URLHandler.setRawUrl("/index.php?p=settings&id=".concat(t,"&tab=1").concat(r))}},{key:"redirectToTranslations",value:function(){this.isTranslationsInitialised||this.editorPanelConfig.configureTranslations(this.editorPanelGroup,this.loader),this.isTranslationsInitialised=!0,this.editorPanelGroup.setVisible(!0),this.editorPanelGroup.setActivePanel(T.d.TRANSLATIONS),this.disableUndoService(),this.URLHandler.setNewUrl(T.d.TRANSLATIONS)}},{key:"redirectToThemes",value:function(){this.isThemesInitialised||(this.editorPanelConfig.configureThemes(this.editorPanelGroup,this.loader,this.loader.getJQuery()),this.loader.commands.loadThemePropertiesIntoPanel(),this.loader.commands.loadAvailableThemes()),this.isThemesInitialised=!0,this.editorPanelGroup.setVisible(!0),this.editorPanelGroup.setActivePanel(T.d.THEMES),this.resetUndoService(),this.URLHandler.setNewUrl(T.d.THEMES)}},{key:"redirectToEditor",value:function(){this.URLHandler.setNewUrl(T.d.EDITOR),this.loader.openEditorPanel(T.d.EDITOR)}},{key:"redirectToPublishV2",value:function(t){var n=window.innerWidth;if(this.isPublishInitialised||(this.editorPanelConfig.configureEmbedFormPanel(this.editorPanelGroup,this.loader),this.isPublishInitialised=!0),t||(t=T.d.PUBLISH_GET_LINK),n<=900&&(t=T.d.PUBLISH),this.editorPanelGroup.setVisible(!0),this.URLHandler.setNewUrl(t),this.loader.execCommand("set-active-panel","publish-form"),this.editorPanelGroup.setActivePanel(t),!(n<=900)){var i=this.editorPanelGroup.getPanelById("publish-form"),r=e.getPublishPanelName(t);i.openElementById(r)}}},{key:"redirectToPayments",value:function(){var e=this;this.currentRoute!=T.d.EDITOR&&this.loader.openEditorPanel(T.d.EDITOR),setTimeout((function(){var t;(null===(t=e.editorPanelGroup)||void 0===t?void 0:t.isVisible())&&(e.loader.commands.scrollToPaymentsInInspector(),e.URLHandler.setNewUrl(T.d.PAYMENTS))}),1e3)}},{key:"redirectToPaymentsV1",value:function(){var e=this.getFormId(),t=this.URLHandler.computeStaticUrl(T.d.PAYMENTS_V1,e,"edit_fields");this.URLHandler.setRawUrl(t)}},{key:"redirectToPublishV1",value:function(){var e=this.getFormId(),t=this.URLHandler.computeStaticUrl(T.d.PUBLISH_V1,e,"edit_fields");this.URLHandler.setRawUrl(t)}},{key:"canNavigate",value:function(){return this.currentRoute===T.d.NOTIFICATIONS?this.editorPanelGroup.getActivePanel().getUserConfirmationForDiscardingUnsavedChanges()?Promise.resolve():Promise.reject():Promise.resolve()}},{key:"disableUndoService",value:function(){this.updateUndoService(!1,!1)}},{key:"resetUndoService",value:function(){var e=this.loader.getUndoService().canRedo(),t=this.loader.getUndoService().canUndo();this.updateUndoService(t,e)}},{key:"updateUndoService",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.loader.getHeader().setButtonInteractionState(lo.REDO,t),this.loader.getHeader().setButtonInteractionState(lo.UNDO,e)}},{key:"getFormId",value:function(){return this.store.getState().form.id}},{key:"getPublishPanelByTabId",value:function(e){switch(e){case T.J.LINK:return T.d.PUBLISH_GET_LINK;case T.J.EMBED_JAVASCRIPT:return T.d.PUBLISH_EMBED_CODE;case T.J.PLATFORM_BIG_COMMERCE:return this.loader.getPlatformDetails().isBigCommerce?T.d.PUBLISH_BIG_COMMERCE:T.d.PUBLISH_PLATFORM_BIG_COMMERCE;case T.J.PLATFORM_BLOGGER:return T.d.PUBLISH_BLOGGER;case T.J.PLATFORM_FACEBOOK:return T.d.PUBLISH_FACEBOOK;case T.J.PLATFORM_GOOGLE_SITES:return T.d.PUBLISH_GOOGLE_SITES;case T.J.PLATFORM_JOOMLA:return T.d.PUBLISH_JOOMLA;case T.J.PLATFORM_SHOPIFY:return this.loader.getPlatformDetails().isShopify?T.d.PUBLISH_SHOPIFY:T.d.PUBLISH_PLATFORM_SHOPIFY;case T.J.PLATFORM_TWITTER:return T.d.PUBLISH_TWITTER;case T.J.PLATFORM_UNBOUNCE:return T.d.PUBLISH_UNBOUNCE;case T.J.PLATFORM_WORDPRESS:return T.d.PUBLISH_WORDPRESS;case T.J.PLATFORM_WEEBLY:return this.loader.getPlatformDetails().isWeebly?T.d.PUBLISH_WEEBLY:T.d.PUBLISH_PLATFORM_WEEBLY;case T.J.PUBLISH_PLATFORMS:return T.d.PUBLISH_PLATFORMS;case T.J.PLATFORM_SALESFORCE:return T.d.PUBLISH_SALESFORCE;case T.J.PLATFORM_SALESFORCE_COMMUNITY:return T.d.PUBLISH_SALESFORCE_COMMUNITY;default:return T.d.PUBLISH_GET_LINK}}},{key:"removeActiveStateIfNewForm",value:function(){var e=this.URLHandler.getUrlVars();e&&"firsttime"===e.action&&window.localStorage.setItem("noSidebarActiveState","1")}}],[{key:"getPublishPanelName",value:function(e){switch(e){case T.d.PUBLISH_WEEBLY:return T.I.PUBLISH_WEEBLY;case T.d.PUBLISH_WEEBLY_LINK:return T.I.PUBLISH_WEEBLY_LINK;case T.d.PUBLISH_WEEBLY_LIGHTBOX:return T.I.PUBLISH_WEEBLY_LIGHTBOX;case T.d.PUBLISH_WEEBLY_PLATFORMS:return T.I.PUBLISH_PLATFORM_SHOPIFY;case T.d.PUBLISH_BIG_COMMERCE:return T.I.PUBLISH_BIG_COMMERCE;case T.d.PUBLISH_BIG_COMMERCE_LINK:return T.I.PUBLISH_BIG_COMMERCE_LINK;case T.d.PUBLISH_BIG_COMMERCE_LIGHTBOX:return T.I.PUBLISH_BIG_COMMERCE_LIGHTBOX;case T.d.PUBLISH_BIG_COMMERCE_PLATFORMS:return T.I.PUBLISH_PLATFORM_SHOPIFY;case T.d.PUBLISH_SHOPIFY:return T.I.PUBLISH_SHOPIFY;case T.d.PUBLISH_SHOPIFY_LINK:return T.I.PUBLISH_SHOPIFY_LINK;case T.d.PUBLISH_SHOPIFY_LIGHTBOX:return T.I.PUBLISH_SHOPIFY_LIGHTBOX;case T.d.PUBLISH_SHOPIFY_PLATFORMS:return T.I.PUBLISH_PLATFORM_BIG_COMMERCE;case T.d.PUBLISH_EMBED_CODE:return T.I.PUBLISH_EMBED_CODE;case T.d.PUBLISH_BLOGGER:return T.I.PUBLISH_BLOGGER;case T.d.PUBLISH_FACEBOOK:return T.I.PUBLISH_FACEBOOK;case T.d.PUBLISH_GOOGLE_SITES:return T.I.PUBLISH_GOOGLE_SITES;case T.d.PUBLISH_JOOMLA:return T.I.PUBLISH_JOOMLA;case T.d.PUBLISH_TWITTER:return T.I.PUBLISH_TWITTER;case T.d.PUBLISH_UNBOUNCE:return T.I.PUBLISH_UNBOUNCE;case T.d.PUBLISH_WORDPRESS:return T.I.PUBLISH_WORDPRESS;case T.d.PUBLISH_PLATFORM_BIG_COMMERCE:return T.I.PUBLISH_PLATFORM_BIG_COMMERCE;case T.d.PUBLISH_PLATFORM_SHOPIFY:return T.I.PUBLISH_PLATFORM_SHOPIFY;case T.d.PUBLISH_PLATFORM_WEEBLY:return T.I.PUBLISH_PLATFORM_WEEBLY;case T.d.PUBLISH_SALESFORCE:return T.I.PUBLISH_SALESFORCE;case T.d.PUBLISH_SALESFORCE_COMMUNITY:return T.I.PUBLISH_SALESFORCE_COMMUNITY;case T.d.PUBLISH_SALESFORCE_PLATFORMS:return T.I.PUBLISH_PLATFORM_SHOPIFY;case T.d.PUBLISH_PLATFORMS:return T.I.PUBLISH_PLATFORMS;default:return T.I.PUBLISH_LINK}}}]),e}();window.TextControl=Ei,window.SynchronizableFormControl=rn,window.FormControl=tn,window.FormElement=Zt,window.ActionBarControl=on,window.AddressControl=ln,window.CaptchaControl=cn,window.CheckBoxControl=pn,window.DateControl=ri,window.DropDownControl=oi,window.ElementNotSupported=fi,window.EmailControl=Ti,window.FileControl=li,window.CouponControl=ni,window.FeeControl=Li,window.FormHeaderControl=Mi,window.FormulaControl=pi,window.HeadingControl=wi,window.HTMLBlockControl=gi,window.ImageControl=Fi,window.LikertScaleControl=Bi,window.MapControl=Wi,window.NameControl=qi,window.NumberControl=Qi,window.PageBreakControl=ji,window.PasswordControl=Zi,window.PhoneControl=tr,window.PriceControl=rr,window.RadioControl=or,window.SeparatorControl=lr,window.SignatureControl=cr,window.SocialControl=pr,window.StarRatingControl=gr,window.TermsOfServiceControl=fr,window.TextAreaControl=Er,window.TimeControl=vr,window.WebsiteControl=Or,window.WidgetFacebookControl=br,window.WidgetPDFControl=Ir,window.WidgetVideoControl=Sr,window.ElementVirtualProperty=D,window.EditorUserInterface=Jr,window.AcceptedDaysOfWeekInspectorPlugin=Zr,window.CaptchaConfigurationInspectorPlugin=ea,window.CheckBoxAndRadioInputInspectorPlugin=na,window.ChoicesEditorInspectorPlugin=bi,window.CouponCodesInspectorPlugin=ia,window.DateEditorInspectorPlugin=ra,window.DiscountAndTaxOnTotalInspectorPlugin=oa,window.DropDownInspectorPlugin=sa,window.DropdownsEditFormsListInspectorPlugin=la,window.FormulaInspectorPlugin=ua,window.HTMLEditorInspectorPlugin=ca,window.ImageUploaderInspectorPlugin=da,window.InputTypeNumberInspectorPlugin=pa,window.InputTypeSizeInPixelsInspectorPlugin=ha,window.LikertQuizOptionsInspectorPlugin=ga,window.LikertStatementsEditorInspectorPlugin=_a,window.ListEditorPlugin=fa,window.MarkdownEditorInspectorPlugin=Ea,window.PaymentProcessorsAssocsInspectorPlugin=ma,window.PaymentProcessorsInspectorPlugin=va,window.PaymentsProductsPlugin=Ta,window.PaymentsStringReadOnlyPlugin=Oa,window.PriceEditorInspectorPlugin=Ca,window.PropagatedDOMAttributes=Na,window.RangedPropertiesDeferredSliderAppearance=Aa,window.SagepayCustomerEmailInspectorPlugin=ba,window.SortablePlugin=Ni,window.SquareStoreLocationInspectorPlugin=Ra,window.SquareStoreLocationsPopupInspectorPlugin=Ia,window.TextAppearanceDropDownInspectorPlugin=aa,window.WorkflowEditUsersListInspectorPlugin=Pa,window.SaveActivity=Da,window.PaymentsAttributeHelper=La,window.DivContainer=wa,window.LikertContainer=Ya,window.PageContainer=Ha,window.PaymentSummaryPageContainer=Wa,window.RowContainer=za,window.RepeatableContainer=Xa,window.RepeatableGroup=No,window.ReactiveButton=Pi,window.VirtualSelect=Ci,window.BlankDataset=$r,window.GenericI18nDataset=Lr,window.DegreesOfAgreementDataset=wr,window.DegreesOfImportanceDataset=Fr,window.DegreesOfProbabilityDataset=Br,window.DegreesOfSatisfactionDataset=Wr,window.DegreesOfQualityDataset=Hr,window.DaysOfWeekDataset=Mr,window.MonthsOfTheYearDataset=qr,window.DatasetProvider=Xr,window.EDatasetProviderType=zr,window.EditorSetting=gn,window.EditorSettingGroups=_n,window.EditorSettingTypes=ei,window.CouponCodesEditorSetting=Tn,window.ProductsEditorSetting=yn,window.SummaryEditorSetting=mn,window.AuthorizeEditorSetting=qn,window.BraintreeEditorSetting=Un,window.CivicaEditorSetting=Zn,window.FreshbooksEditorSetting=jn,window.PayfastEditorSetting=Gn,window.PaypalCheckoutEditorSetting=An,window.PaypalEditorSetting=Cn,window.PaypalPayflowEditorSetting=Pn,window.PaypalProEditorSetting=Rn,window.PayUEditorSetting=Yn,window.SagepayEditorSetting=Qn,window.SisowEditorSetting=Vn,window.SquareEditorSetting=xn,window.StripeCheckoutEditorSetting=kn,window.StripeEditorSetting=Dn,window.WorldpayEditorSetting=Kn,window.ViewManager=Ao,window.UIElement=M,window.UITagsContainer=ut},34:function(e,t){}});