function CertonaProductFinder(e){"use strict";function t(e,t){var n=document.createElement(e);for(var s in t)if(t.hasOwnProperty(s))switch(s){case"html":n.innerHTML=t[s];break;case"text":n.innerText=t[s];break;default:n.setAttribute(s,t[s])}return n}function n(e,t,n){for(var s=0;s'}),u=t("span",{class:"ddl-arrow",html:''}),f=t("div",{class:"ddl-options"});if(e.parentNode.insertBefore(o,e.nextSibling),o.appendChild(u),i){l.appendChild(c),l.appendChild(h),o.appendChild(l);var g=parseFloat(o.style.width)-parseFloat(o.style.paddingLeft)-parseFloat(o.style.paddingRight),m=parseInt(o.style.paddingLeft)+parseInt(o.style.paddingRight),v=u.getBoundingClientRect().width;l.style.width=g-v-m+"px"}else o.appendChild(a);f.style.top=parseFloat(o.style.height)+parseFloat(o.style.paddingBottom)+parseFloat(o.style.borderBottom)+"px";var y=!1;o.addEventListener("click",function(){y||(y=!0,setTimeout(function(){var e=function(){document.removeEventListener("click",e),y=!1,f.style.display="none"};document.addEventListener("click",e)},1)),f.style.display="block"},!1),h.addEventListener("click",function(t){r=0,c.style.visibility="hidden",h.style.visibility="hidden",e.value="";for(var n=0;n-1){x=!0;break}x||(w.selected=!0)}for(var k=0;k0?(c.innerText="("+r+")",c.style.visibility="visible",h.style.visibility="visible"):e.value=[]),o.appendChild(e),e.style.display="none",e.tabIndex=-1;var N=t("select",{class:"certona-pf-input-hidden"});N.tabIndex=0,o.insertBefore(N,e);var P=null;N.addEventListener("focus",function(){o.classList.add("focused")}),N.addEventListener("blur",function(){o.classList.remove("focused")}),N.addEventListener("keydown",function(t){var n=!1;if(t.keyCode)switch(t.keyCode){case 13:case 32:if(n=!0,"block"!==f.style.display)f.style.display="block",null===P&&(P=f.children[0],P.classList.add("hover"));else{if(p(P,"selected")===!0)P.classList.remove("hover"),P.classList.remove("selected"),d(P,"selected",!1),p(P,"option").selected=!1,i?(r--,0===r?(c.style.visibility="hidden",h.style.visibility="hidden",w.selected=!0):c.innerText="("+r+")"):(a.innerText="",e.value="");else if(P.classList.remove("hover"),P.classList.add("selected"),d(P,"selected",!0),p(P,"option").selected=!0,i)r++,c.innerText="("+r+")",1===r&&(c.style.visibility="visible",h.style.visibility="visible",w.selected=!1);else{for(var o=0;o0)e.answers.forEach(function(e){t.answers[e.answerId.toString()]=e});else if(e.children.length>0){var s=new i,o=1;e.children.forEach(function(e){s[e.questionId.toString()]=new r(e,o),o++}),t.children=s}return t}function o(e,t,n,s){return(e/=s/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}function a(e){for(var t,n=[],s=e&&e.options,i=0,r=s.length;i":">",'"':""","'":"'","`":"`"},c=/[&<>"'`]/g,h=/[&<>"'`]/;o.extend=n;var u=Object.prototype.toString;o.toString=u;var p=function(e){return"function"==typeof e};p(/x/)&&(p=function(e){return"function"==typeof e&&"[object Function]"===u.call(e)});var p;o.isFunction=p;var d=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===u.call(e)};return o.isArray=d,o.escapeExpression=s,o.isEmpty=i,o.appendContextPath=r,o}(e),n=function(){function e(e,n){var s;n&&n.firstLine&&(s=n.firstLine,e+=" - "+s+":"+n.firstColumn);for(var i=Error.prototype.constructor.call(this,e),r=0;r0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):s(this);if(n.data&&n.ids){var o=m(n.data);o.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:o}}return i(t,n)}),e.registerHelper("each",function(e,t){if(!t)throw new o("Must pass iterator to #each");var n,s,i=t.fn,a=t.inverse,l=0,c="";if(t.data&&t.ids&&(s=r.appendContextPath(t.data.contextPath,t.ids[0])+"."),u(e)&&(e=e.call(this)),t.data&&(n=m(t.data)),e&&"object"==typeof e)if(h(e))for(var p=e.length;l= 2.0.0-beta.1"};i.REVISION_CHANGES=c;var h=r.isArray,u=r.isFunction,p=r.toString,d="[object Object]";i.HandlebarsEnvironment=n,n.prototype={constructor:n,logger:f,log:g,registerHelper:function(e,t){if(p.call(e)===d){if(t)throw new o("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){p.call(e)===d?r.extend(this.partials,e):this.partials[e]=t},unregisterPartial:function(e){delete this.partials[e]}};var f={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){if(f.level<=e){var n=f.methodMap[e];"undefined"!=typeof console&&console[n]&&console[n].call(console,t)}}};i.logger=f;var g=f.log;i.log=g;var m=function(e){var t=r.extend({},e);return t._parent=e,t};return i.createFrame=m,i}(t,n),i=function(e,t,n){function s(e){var t=e&&e[0]||1,n=p;if(t!==n){if(t0)throw new s("Invalid path: "+i,this);".."===h?(o++,a+="../"):this.isScoped=!0}else r.push(h)}this.original=i,this.parts=r,this.string=r.join("."),this.depth=o,this.idName=a+this.string,this.isSimple=1===e.length&&!this.isScoped&&0===o,this.stringModeValue=this.string},PartialNameNode:function(e,n){t.call(this,n),this.type="PARTIAL_NAME",this.name=e.original},DataNode:function(e,n){t.call(this,n),this.type="DATA",this.id=e,this.stringModeValue=e.stringModeValue,this.idName="@"+e.stringModeValue},StringNode:function(e,n){t.call(this,n),this.type="STRING",this.original=this.string=this.stringModeValue=e},NumberNode:function(e,n){t.call(this,n),this.type="NUMBER",this.original=this.number=e,this.stringModeValue=Number(e)},BooleanNode:function(e,n){t.call(this,n),this.type="BOOLEAN",this.bool=e,this.stringModeValue="true"===e},CommentNode:function(e,n){t.call(this,n),this.type="comment",this.comment=e,this.strip={inlineStandalone:!0}}};return n=i}(n),a=function(){var e,t=function(){function e(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(e,t,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return s.prepareProgram(r[a-1].statements,!0),r[a-1];case 2:this.$=new s.ProgramNode(s.prepareProgram(r[a]),{},this._$);break;case 3:this.$=r[a];break;case 4:this.$=r[a];break;case 5:this.$=r[a];break;case 6:this.$=r[a];break;case 7:this.$=new s.ContentNode(r[a],this._$);break;case 8:this.$=new s.CommentNode(r[a],this._$);break;case 9:this.$=new s.RawBlockNode(r[a-2],r[a-1],r[a],this._$);break;case 10:this.$=new s.MustacheNode(r[a-1],null,"","",this._$);break;case 11:this.$=s.prepareBlock(r[a-3],r[a-2],r[a-1],r[a],!1,this._$);break;case 12:this.$=s.prepareBlock(r[a-3],r[a-2],r[a-1],r[a],!0,this._$);break;case 13:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 14:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 15:this.$={strip:s.stripFlags(r[a-1],r[a-1]),program:r[a]};break;case 16:this.$={path:r[a-1],strip:s.stripFlags(r[a-2],r[a])};break;case 17:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 18:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 19:this.$=new s.PartialNode(r[a-3],r[a-2],r[a-1],s.stripFlags(r[a-4],r[a]),this._$);break;case 20:this.$=new s.PartialNode(r[a-2],void 0,r[a-1],s.stripFlags(r[a-3],r[a]),this._$);break;case 21:this.$=new s.SexprNode([r[a-2]].concat(r[a-1]),r[a],this._$);break;case 22:this.$=new s.SexprNode([r[a]],null,this._$);break;case 23:this.$=r[a];break;case 24:this.$=new s.StringNode(r[a],this._$);break;case 25:this.$=new s.NumberNode(r[a],this._$);break;case 26:this.$=new s.BooleanNode(r[a],this._$);break;case 27:this.$=r[a];break;case 28:r[a-1].isHelper=!0,this.$=r[a-1];break;case 29:this.$=new s.HashNode(r[a],this._$);break;case 30:this.$=[r[a-2],r[a]];break;case 31:this.$=new s.PartialNameNode(r[a],this._$);break;case 32:this.$=new s.PartialNameNode(new s.StringNode(r[a],this._$),this._$);break;case 33:this.$=new s.PartialNameNode(new s.NumberNode(r[a],this._$));break;case 34:this.$=new s.DataNode(r[a],this._$);break;case 35:this.$=new s.IdNode(r[a],this._$);break;case 36:r[a-2].push({part:r[a],separator:r[a-1]}),this.$=r[a-2];break;case 37:this.$=[{part:r[a]}];break;case 38:this.$=[];break;case 39:r[a-1].push(r[a]);break;case 48:this.$=[];break;case 49:r[a-1].push(r[a]);break;case 52:this.$=[r[a]];break;case 53:r[a-1].push(r[a])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(e,t){throw new Error(e)},parse:function(e){function t(){var e;return e=n.lexer.lex()||1,"number"!=typeof e&&(e=n.symbols_[e]||e),e}var n=this,s=[0],i=[null],r=[],o=this.table,a="",l=0,c=0,h=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;r.push(u);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,f,g,m,v,y,w,x,S,k={};;){if(g=s[s.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null!==d&&"undefined"!=typeof d||(d=t()),m=o[g]&&o[g][d]),"undefined"==typeof m||!m.length||!m[0]){var b="";if(!h){S=[];for(y in o[g])this.terminals_[y]&&y>2&&S.push("'"+this.terminals_[y]+"'");b=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(b,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:u,expected:S})}}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+d);switch(m[0]){case 1:s.push(d),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),s.push(m[1]),d=null,f?(d=f,f=null):(c=this.lexer.yyleng,a=this.lexer.yytext,l=this.lexer.yylineno,u=this.lexer.yylloc,h>0&&h--);break;case 2:if(w=this.productions_[m[1]][1],k.$=i[i.length-w],k._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},p&&(k._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),v=this.performAction.call(k,a,c,l,this.yy,m[1],i,r),"undefined"!=typeof v)return v;w&&(s=s.slice(0,-1*w*2),i=i.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[m[1]][0]),i.push(k.$),r.push(k._$),x=o[s[s.length-2]][s[s.length-1]],s.push(x);break;case 3:return!0}}return!0}},n=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,s,i;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;ot[0].length)||(t=n,s=o,this.options.flex));o++);return t?(i=t[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,r[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e?e:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return"undefined"!=typeof e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)}};return e.options={},e.performAction=function(e,t,n,s){function i(e,n){return t.yytext=t.yytext.substr(e,t.yyleng-n)}switch(n){case 0:if("\\\\"===t.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return t.yytext=t.yytext.substr(5,t.yyleng-9),this.popState(),15;case 4:return 12;case 5:return i(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26; case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return i(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return t.yytext=i(1,2).replace(/\\"/g,'"'),42;case 30:return t.yytext=i(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return t.yytext=i(1,2),50;case 37:return"INVALID";case 38:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],e.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},e}();return t.lexer=n,e.prototype=t,t.Parser=e,new e}();return e=t}(),l=function(e){function t(e,t){return{left:"~"===e.charAt(2),right:"~"===t.charAt(t.length-3)}}function n(e,t,n,s,l,h){if(e.sexpr.id.original!==s.path.original)throw new c(e.sexpr.id.original+" doesn't match "+s.path.original,e);var u=n&&n.program,p={left:e.strip.left,right:s.strip.right,openStandalone:r(t.statements),closeStandalone:i((u||t).statements)};if(e.strip.right&&o(t.statements,null,!0),u){var d=n.strip;d.left&&a(t.statements,null,!0),d.right&&o(u.statements,null,!0),s.strip.left&&a(u.statements,null,!0),i(t.statements)&&r(u.statements)&&(a(t.statements),o(u.statements))}else s.strip.left&&a(t.statements,null,!0);return l?new this.BlockNode(e,u,t,p,h):new this.BlockNode(e,t,u,p,h)}function s(e,t){for(var n=0,s=e.length;n0&&(t+=", "+n.join(", "));for(var s in this.aliases)this.aliases.hasOwnProperty(s)&&(t+=", "+s+"="+this.aliases[s]);var i=["depth0","helpers","partials","data"];this.useDepths&&i.push("depths");var r=this.mergeSource(t);return e?(i.push(r),Function.apply(this,i)):"function("+i.join(",")+") {\n "+r+"}"},mergeSource:function(e){for(var t,n,s="",i=!this.forceBuffer,r=0,o=this.source.length;rthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;if(e.length){this.inlineStack=[];for(var t=0,s=e.length;t0&&(t=document.cookie,n=t.indexOf(e+"="),n!==-1))return n+=e.length+1,s=t.indexOf(";",n),s===-1&&(s=t.length),decodeURIComponent(t.slice(n,s))}catch(e){console.log(e)}return null},h=!1,u={},p=function(e,t){if(e.getAttribute("cpfId")){var n=u[e.getAttribute("cpfId")];if(n.hasOwnProperty(t))return n[t]}else;},d=function(e,t,n){var s;if(e.getAttribute("cpfId"))s=e.getAttribute("cpfId");else{for(s=Math.floor(2147483647*Math.random())+1;u.hasOwnProperty(s.toString());)s=Math.floor(2147483647*Math.random())+1;e.setAttribute("cpfId",s),u[s]={}}u[s][t]=n},f=function(e,t){if(window.getComputedStyle){var n=getComputedStyle(e,null);return n[t]}return e.currentStyle[t]},g=function(e){return f(e,"width")},m={rootUrl:"https://api.certona.com",resxHost:"res-x.com",surveyEventPrefix:"productfinder",surveyId:"",applicationId:"",surveyName:"",firstQuestion:null,insertionElementId:"output",resxTrackingId:null,resxSessionId:null,token:"",autoStart:!0,previewMode:!1,finishFunction:void 0,progressBar:{show:!0,insertionElementId:"progressBarOutput",animationDuration:1e3,template:"progress-bar",outerId:"product-finder-progress-outer",innerId:"product-finder-progress-inner"},resultsAsYouGo:{enabled:!1,scheme:null,num:20,rrcall:null},symbols:{answerBreadcrumbs:{separator:null,unanswered:null,questionGroupSeparator:"
------------
",multiSelectSeparator:", "}}},v={render:function(){}};e.hasOwnProperty("render")&&"function"==typeof e.render&&(v.render=e.render);var y,w={getSurveyUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/Survey/{{surveyId}}/User/{{trackingId}}?callback=processCPFAPIResponse&_=",answerQuestionUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/Answer/{{token}}",getDynamicAnswerUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/GetDynamicAnswers?_=",get surveyUrl(){return w.getSurveyUrl.replace(/\{\{rootUrl\}\}/,m.rootUrl).replace(/{{appId}}/,m.applicationId).replace(/{{surveyId}}/,m.surveyId).replace(/{{trackingId}}/,m.resxTrackingId)},get answerUrl(){return w.answerQuestionUrl.replace(/{{rootUrl}}/,m.rootUrl).replace(/{{appId}}/,m.applicationId).replace(/{{token}}/,m.token)},get surveyStartEvent(){return m.surveyEventPrefix+"start"},get surveyCompletionEvent(){return m.surveyEventPrefix+"completion"},get dynamicAnswersUrl(){return w.getDynamicAnswerUrl.replace(/{{rootUrl}}/,m.rootUrl).replace(/{{appId}}/,m.applicationId)}},x=null,S=[],k=[],b=function(e,t){for(y in e)e.hasOwnProperty(y)&&("object"==typeof e[y]?b(e[y],t[y]):t[y]=e[y])};if(b(e,m),"function"==typeof m.resultsAsYouGo.rrcall){var I="cpfcallback"+(new Date).getTime();window[I]=m.resultsAsYouGo.rrcall,m.resultsAsYouGo.rrcall=I}var E=function(){function e(e){e.forEach(function(e){e.selected&&e.navigationFilter&&""!==e.navigationFilter&&(t.length>9&&(t+=";"),t+=e.navigationFilter.replace(/&/g,";"))})}var t="pfilter=;";return S.forEach(function(t){t.children?t.children.forEach(function(t){e(t.answers)}):e(t.answers)}),t.length>9?t:""};"function"!=typeof m.finishFunction&&(m.finishFunction=function(e){"object"==typeof window.certona&&"string"==typeof window.certona.productfinderresultsurl&&(m.finishedUrl=window.certona.productfinderresultsurl),m.finishedUrl.indexOf("?")>-1?window.location=m.finishedUrl+"&"+e.filters:window.location=m.finishedUrl+"?"+e.filters}),null===m.resxTrackingId&&(m.resxTrackingId=c("RES_TRACKINGID")),null===m.resxSessionId&&(m.resxSessionId=c("RES_SESSIONID"));var _=new i,N=["","select_one","multi_select","product_rating","select_one_ddl","multi_select_ddl"],P=this,A=function(e){try{return _.hasOwnProperty(e)?_[e]:null}catch(e){console.log(e)}},O=function(){try{_.forEach(function(e){e.isFirst&&(x=e)})}catch(e){console.log(e)}};this.getSurvey=function(){try{window.processCPFAPIResponse=function(t){if(t.success){var n=t.productFinder.settings;for(var s in n)if(n.hasOwnProperty(s))if("object"==typeof n[s])for(var i in n[s])n[s].hasOwnProperty(i)&&(m[s][i]=n[s][i]);else m[s]=n[s];e.hasOwnProperty("resultsAsYouGo")&&e.resultsAsYouGo.hasOwnProperty("num")&&(m.resultsAsYouGo.num=e.resultsAsYouGo.num);for(var o=0;o=s&&clearInterval(a)},1e3/60)},q=function(e,t){try{var n=m.progressBar,s=C(t),i=g(document.getElementById(n.outerId)),r=document.getElementById(n.template).innerHTML,o=document.getElementById(n.insertionElementId),a=l.Handlebars.compile(r);o.innerHTML=a(s);var c=document.getElementById(n.innerId);t?L(c,"width",parseFloat(i),parseInt(n.animationDuration)||250):L(c,"width",(parseFloat(i)/s.total-1)*S.length,parseInt(n.animationDuration)||250)}catch(e){console.log(e)}};this.finish=function(){m.previewMode||(window.resx=new Object,window.resx.event=w.surveyCompletionEvent,window.resx.host=m.resxHost,window.resx.appid=m.applicationId,window.resx.itemid=m.surveyId,certonaResx.run()),m.progressBar.show&&q(x,!0),m.filters=E(),m.finishFunction(m)};var R=function(e,t){function n(e){e.answers.forEach(function(e){e.selected=!1;var t=document.querySelector('div[data-answer-id="'+e.answerId+'"]');t&&t.classList&&t.classList.remove("selected")})}t=t||x,t.children?e?n(t.children[e]):t.children.forEach(function(e){n(e)}):n(t)},H=function(){try{var e=[],t="",n=null,s=[],i=!0;if(4!==x.questionTypeId&&5!==x.questionTypeId&&2!==x.responseType&&5!==x.responseType||(n=x.nextQuestionId,i=!1),x.children&&x.children.length&&x.children.length>0){var r={qId:x.questionId,questions:[]},o=1,a=x.children.length;for(o;o<=a;o++){var l=x.children.find("order",o);s=[],l.answers.forEach(function(e){e.selected&&(s.push(e.answerId),t+=e.navigationFilter)}),0===s.length&&s.push(null),r.questions.push({questionId:l.questionId,itemId:l.itemId,answers:s,rating:3===l.questionTypeId})}e.push(r)}else x.answers.forEach(function(e){e.selected&&(s.push(e.answerId),t+=e.navigationFilter,i&&(n=e.nextQuestionId))}),e.push({questionId:x.questionId,itemId:x.itemId,answers:s,rating:3===x.questionTypeId});e.forEach(function(e){var t,n,s,i,r;if(e.questions){var o="";e.questions.forEach(function(a,l){for(m.previewMode||null===a.answers[0]||(t={productFinder:{surveyId:m.surveyId,questionId:e.qId,trackingId:m.resxTrackingId,sessionId:m.resxSessionId,answerId:a.answers,itemId:"",questionGroupQuestionId:a.questionId}},null!==a.itemId&&(t.productFinder.itemId=a.itemId),i=new XMLHttpRequest,i.open("POST",w.answerUrl,!0),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.onload=function(){200!==i.status&&console.log(i.responseText)},i.send(JSON.stringify(t))),n="",s=0;s0&&(n+=m.symbols.answerBreadcrumbs.multiSelectSeparator),n+=a.rating?"Rated":r.answerText.length>0?r.answerText:r.answerName):(n.length>0&&(n+=m.symbols.answerBreadcrumbs.multiSelectSeparator),n+='');l>0&&(n=m.symbols.answerBreadcrumbs.questionGroupSeparator+n),o+=n}),k.push(o)}else{for(m.previewMode||(t={productFinder:{surveyId:m.surveyId,questionId:e.questionId,trackingId:m.resxTrackingId,sessionId:m.resxSessionId,answerId:e.answers,itemId:""}},null!==e.itemId&&(t.productFinder.itemId=e.itemId),i=new XMLHttpRequest,i.open("POST",w.answerUrl,!0),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.onload=function(){200!==i.status&&console.log(i.responseText)},i.send(JSON.stringify(t))),n="",s=0;s0&&(n+=m.symbols.answerBreadcrumbs.multiSelectSeparator),n+=null!==r?e.rating?"Rated":x.answers[r].answerText.length>0?x.answers[r].answerText:x.answers[r].answerName:'';k.push(n)}}),S.push(x),null!=x&&("undefined"!=typeof n&&null!==n&&""!==n&&n!==-1?(x=A(n),V()):P.finish())}catch(e){console.log(e)}},D=function(e){var t=E();void 0!==e&&null!==e&&""!==e&&(t.length>0?t+=";":t="pfilter=;",t+=e.replace(/&/g,";")),"undefined"!=typeof window.RAOPFPV?window.RAOPFPV.getRecommendationResults(t):m.resultsAsYouGo.enabled&&(window.resx=new Object,window.resx.host=m.resxHost,window.resx.appid=m.applicationId,window.resx.itemid=m.surveyId,window.resx.rrelem=m.resultsAsYouGo.scheme,window.resx.rrqs=t,window.resx.rrnum=m.resultsAsYouGo.num,window.resx.rrec=!0,null!==m.resultsAsYouGo.rrcall&&"string"==typeof m.resultsAsYouGo.rrcall&&(window.resx.rrcall=m.resultsAsYouGo.rrcall),certonaResx.run())},M=function(){var e=S.pop();k.pop(),x=e,V()},B=function(){R(),S.push(x),k.push(null);var e;if(4===x.questionTypeId||5===x.questionTypeId||2===x.responseType||5===x.responseType)e=x.nextQuestionId;else{var t=Object.keys(x.answers)[0];e=x.answers[t].nextQuestionId}e!==-1&&null!==e?(x=A(e),V()):P.finish()},$=function(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null},F=function(e){var n=this,s=parseInt(n.parentNode.getAttribute("data-answer-id")),i=parseInt($(n,".question").getAttribute("data-question-id")),r=document.getElementById("answer_info_"+s); if(r)r.parentNode.removeChild(r);else{var o=isNaN(i)?x.answers[s].answerInfo:x.children[i].answers[s].answerInfo,a=t("div",{text:o,id:"answer_info_"+s,class:"answer-info-box"});n.appendChild(a),a.style.left=n.offsetWidth+"px",a.style.bottom=n.offsetHeight+"px"}e.stopPropagation(),e.preventDefault()},j={rh:function(e,t,n,s){if("function"==typeof n){var i=function(e){try{n.call(this,e)}catch(e){console.log(e)}},r=document;s&&(r=document.getElementById(m.insertionElementId));var o=r.querySelectorAll(e),a=0;for(a;a input","focus",function(e){$(this,".certona-pf-input-container").classList.add("focused")},!0)},blur:function(){j.rh(".certona-pf-input-container > input","blur",function(e){$(this,".certona-pf-input-container").classList.remove("focused")},!0)},keypress:function(){j.rh(".certona-pf-input-container > input","keypress",function(e){var t=e.charCode||e.keyCode;32!==t&&13!==t||$(this,".certona-pf-input-container").click()},!0)},register:function(){j.ada.focus(),j.ada.blur(),j.ada.keypress()}},startOver:function(){j.rh("#start-over","click",P.startSurvey,!0)},back:function(){j.rh("#back","click",M,!0)},skip:function(){j.rh("#skip-question","click",B,!0)},finish:function(){j.rh("#finish-survey","click",P.finish,!0)},answerInfo:function(){j.rh(".answer-info","click",F,!0)},groupQuestionContinue:function(){j.rh("#question-group-continue","click",function(e){var t=!1;x.children.forEach(function(e){var n=!1;if(e.answers.forEach(function(e){if(e.selected)return n=!0,!0}),n)return t=!0,!0}),t&&H()},!0)},selectOne:function(){j.rh(".select-one","click",function(e){var t=this,n=parseInt(t.getAttribute("data-answer-id")),s=parseInt($(t,".question").getAttribute("data-question-id"));R(s),isNaN(s)?(x.answers[n].selected=!0,H()):(x.children[s].answers[n].selected=!0,t.classList.add("selected"))},!0)},selectOneRayg:function(){j.rh(".select-one-rayg","click",function(e){var t=this,n=null,s=t.getAttribute("data-answer-id"),i=parseInt($(t,".question").getAttribute("data-question-id"));R(i),isNaN(i)?(x.answers[s].selected=!0,n=x.answers[s].navigationFilter):x.children[i].answers[s].selected=!0,t.classList.add("selected"),D(n)},!0)},selectOneRaygContinue:function(){j.rh("#select-one-rayg-continue","click",function(e){var t=this,n=$(t,".question").querySelector(".options");n.querySelectorAll(".select-one-rayg.selected").length>0&&H()},!0)},selectOneDdl:function(){j.rh("select:not([multiple=multiple]):not([data-rayg=true])","change",function(e){var t=this,n=a(t),s=parseInt($(t,".question").getAttribute("data-question-id"));R(s),isNaN(s)?(x.answers[n].selected=!0,H()):(x.children[s].answers[n].selected=!0,t.classList.add("selected"))},!0)},selectOneDdlRayg:function(){j.rh("select[data-rayg=true]:not([multiple=multiple])","change",function(e){var t=this,n=null,s=a(t),i=parseInt($(t,".question").getAttribute("data-question-id"));R(i),""!==s&&(isNaN(i)?(x.answers[s].selected=!0,n=x.answers[s].navigationFilter):(x.children[i].answers[s].selected=!0,t.classList.add("selected"))),D(n)},!0)},selectOneDdlRaygContinue:function(){j.rh("#select-one-ddl-rayg-continue","click",function(e){var t=this,n=$(t,".question").querySelector("select[data-rayg=true]");""!==n.value&&null!==n.value&&void 0!==n.value&&H()},!0)},productRating:function(){j.rh(".product-rating","click",function(e){var t=this,n=parseInt(t.getAttribute("data-answer-id")),s=parseInt($(t,".question").getAttribute("data-question-id"));R(s),isNaN(s)?(x.answers[n].selected=!0,H()):(x.children[s].answers[n].selected=!0,t.classList.add("selected"))},!0)},productRatingRayg:function(){j.rh(".product-rating-rayg","click",function(e){var t=this,n=null,s=t.getAttribute("data-answer-id"),i=parseInt($(t,".question").getAttribute("data-question-id"));R(i),isNaN(i)?(x.answers[s].selected=!0,n=x.answers[s].navigationFilter):x.children[i].answers[s].selected=!0,t.classList.add("selected"),D(n)},!0)},productRatingRaygContinue:function(){j.rh("#product-rating-rayg-continue","click",function(e){var t=this,n=$(t,".question").querySelector(".options");n.querySelectorAll(".product-rating-rayg.selected").length>0&&H()},!0)},multiSelect:function(){j.rh(".multi-select","click",function(e){var t=this,n="",s=t.getAttribute("data-answer-id"),i=parseInt($(t,".question").getAttribute("data-question-id")),r=isNaN(i)?x:x.children[i];if(t.classList.contains("unselected")?(t.classList.remove("unselected"),t.classList.add("selected"),r.answers[s].selected=!0):(t.classList.remove("selected"),t.classList.add("unselected"),r.answers[s].selected=!1),isNaN(i)){var o=!1;r.answers.forEach(function(e){e.selected&&(o=!0)});var a=document.getElementById("multi-select-continue");o?a.removeAttribute("disabled"):a.setAttribute("disabled","disabled")}m.resultsAsYouGo.enabled&&(r.answers.forEach(function(e){if(e.selected){var t=e.navigationFilter;t.length>0&&(0===n.length?n=t:n+="&"+t)}}),D(n))},!0)},multiSelectContinue:function(){j.rh("#multi-select-continue","click",function(e){var t=this,n=$(t,".question").querySelector(".options");n.querySelectorAll(".multi-select.selected").length>0&&H()},!0)},multiSelectDdl:function(){j.rh("select[multiple=multiple]","change",function(e){var t=this,n="",s=a(t),i=parseInt($(t,".question").getAttribute("data-question-id")),r=isNaN(i)?x:x.children[i];if(R(i),s.length>0&&""!==s[0]&&s.forEach(function(e){r.answers[e].selected=!0,n+=r.answers[e].navigationFilter}),isNaN(i)){var o=!1;r.answers.forEach(function(e){e.selected&&(o=!0)});var l=document.getElementById("multi-select-ddl-continue");o?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled")}m.resultsAsYouGo.enabled&&D(n)},!0)},multiSelectDdlContinue:function(){j.rh("#multi-select-ddl-continue","click",function(e){var t=this,n=$(t,".question"),s=n.querySelectorAll("select"),i=s[s.length-1],r=a(i);r.length>0&&""!==r[0]&&H()},!0)},select_one:function(){j.selectOne()},select_one_rayg:function(){j.selectOneRayg(),j.selectOneRaygContinue()},select_one_ddl:function(){j.selectOneDdl()},select_one_ddl_rayg:function(){j.selectOneDdlRayg(),j.selectOneDdlRaygContinue()},multi_select:function(){j.multiSelect(),j.multiSelectContinue()},multi_select_ddl:function(){j.multiSelectDdl(),j.multiSelectDdlContinue()},product_rating:function(){j.productRating()},product_rating_rayg:function(){j.productRatingRayg(),j.productRatingRaygContinue()},question_group:function(){j.groupQuestionContinue()},always:function(){j.startOver(),j.finish(),j.answerInfo()}},V=function(){function e(e){r++;var n=new XMLHttpRequest;n.open("POST",w.dynamicAnswersUrl+(new Date).getTime(),!0),n.setRequestHeader("Content-Type","application/json; charset=utf-8"),n.onload=function(){if(200===n.status){r--;var s=e.answers;e.answers=new i;for(var l=JSON.parse(n.responseText).GetDynamicQuestionAnswersResult.answers.sort(function(e,t){var n=e.answerText.toLowerCase(),s=t.answerText.toLowerCase();return n>s?1:s>n?-1:0}),c=1;c<=l.length;c++){var h=l[c-1];h.selected=s[h.answerId].selected,h.order=c,e.answers[h.answerId.toString()]=h,a=!0}if(0===r&&o){if(!a)return void(null===x.nextQuestionId||"-1"===x.nextQuestionId.toString()?P.finish():(x=_[x.nextQuestionId],V()));t()}console.log(n.responseText)}},n.send(JSON.stringify({sqid:null,sqgqid:e.questionId,filters:E().replace("pfilter=;","")}))}function t(){if(5===x.questionTypeId&&0===x.answers.length)return void(null===x.nextQuestionId||"-1"===x.nextQuestionId.toString()?P.finish():(x=_[x.nextQuestionId],V()));null!==x.children&&x.children.length>0?n="question_group":(n=N[x.responseType],1!==x.responseType&&3!==x.responseType&&4!==x.responseType||!m.resultsAsYouGo.enabled||(n+="_rayg"));var e,t=[],i=document.getElementById(n).innerHTML,r=document.getElementById(m.insertionElementId),o=l.Handlebars.compile(i),a={};for(e in x)x.hasOwnProperty(e)&&(a[e]=x[e]);a.showBackButton=S.length>0,a.answerBreadcrumbs=k;var c=[],h=1;for(h=1;h<=a.answers.length;h++)c.push(a.answers.find("order",h));if(a.answers=c,r.innerHTML=o(a),j.hasOwnProperty(n)&&t.push(j[n]),null!==x.children&&x.children.length>0&&r.querySelectorAll(".question-group > .questions").length>0){r=r.querySelector(".question-group > .questions");var u=1,p=x.children.length;for(u;u<=p;u++){var d=x.children.find("order",u);if(d.answers.length>0){var f={};for(e in d)d.hasOwnProperty(e)&&(f[e]=d[e]);for(f.qIdx=u-1,c=[],h=1;h<=f.answers.length;h++)c.push(f.answers.find("order",h));if(f.answers=c,0===f.answers.length)continue;n=N[f.responseType],1!==f.responseType&&3!==f.responseType||!m.resultsAsYouGo.enabled||(n+="_rayg");var g=n+"_qgq";document.getElementById(g)&&(n=g),i=document.getElementById(n).innerHTML,o=l.Handlebars.compile(i),r.innerHTML+=o(f);var y=n.replace(/_qgq/,"");j.hasOwnProperty(y)&&t.indexOf(j[y])===-1&&t.push(j[y])}}r=document.getElementById(m.insertionElementId)}else if(2===x.responseType||5===x.responseType){var w=!1;x.answers.forEach(function(e){e.selected&&(w=!0)});var b=document.getElementById(5===x.responseType?"multi-select-ddl-continue":"multi-select-continue");w?b.removeAttribute("disabled"):b.setAttribute("disabled","disabled")}t.forEach(function(e,t){e()});for(var I=r.querySelectorAll("select[data-certona-ddl=true]"),A=0;As?1:s>n?-1:0}),s=1;s<=n.length;s++){var r=n[s-1];r.selected=e[r.answerId].selected,r.order=s,x.answers[r.answerId.toString()]=r}t(),console.log(c.responseText)}},c.send(JSON.stringify({sqid:x.questionId,sqgqid:null,filters:E().replace("pfilter=;","")}))}else t()}catch(e){}};if(this.startSurvey=function(){return h?(S=[],k=[],_.forEach(function(e){R(void 0,e)}),m.previewMode||(window.resx=new Object,window.resx.event=w.surveyStartEvent,window.resx.host=m.resxHost,window.resx.appid=m.applicationId,window.resx.itemid=m.surveyId,certonaResx.run()),"undefined"!=typeof x&&null!==x&&x.isFirst===!0||O(),void V()):void setTimeout(P.startSurvey,100)},null!==m.resxTrackingId&&null!==m.resxSessionId)try{this.getSurvey()}catch(e){console.log(e)}else if(window.resx=new Object,window.resx.host=m.resxHost,window.resx.appid=m.applicationId,window.resx.itemid=m.surveyId,certonaResx.run(),m.resxTrackingId=c("RES_TRACKINGID"),m.resxSessionId=c("RES_SESSIONID"),null!==m.resxTrackingId&&null!==m.resxSessionId)try{this.getSurvey()}catch(e){console.log(e)}else console.log("Resonance Tracking and/or Session cookie(s) missing!")}