=1e3&&delete f[e.shift()],e.push(u),f[u]=n.apply(t,o),i?i(f[u]):f[u])}return r}function ht(n,t,i,r,f,e){if(f==null){var o=n-i,s=t-r;return!o&&!s?0:(180+u.atan2(-s,-o)*180/ut+360)%360}return ht(n,t,f,e)-ht(i,r,f,e)}function ct(n){return n%360*ut/180}function si(n){return n*180/ut%360}function li(n){var t=[];return n=n.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(n,i,r){return r=r.split(/\s*,\s*|\s+/),i=="rotate"&&r.length==1&&r.push(0,0),i=="scale"&&(r.length>2?r=r.slice(0,2):r.length==2&&r.push(0,0),r.length==1&&r.push(r[0],0,0)),i=="skewX"?t.push(["m",1,0,u.tan(ct(r[0])),1,0,0]):i=="skewY"?t.push(["m",1,u.tan(ct(r[0])),0,1,0,0]):t.push([i.charAt(0)].concat(r)),n}),t}function ai(n,t){var y=bt(n),u=new i.Matrix,v,p;if(y)for(v=0,p=y.length;v.5;)(l=f-u)>=0&&(b=h(p=e.getPointAtLength(l)))n-i)return t-u+n}return t};i.getRGB=b(function(n){if(!n||!!((n=l(n)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:y};if(n=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:y};if(ii[c](n.toLowerCase().substring(0,2))||n.charAt()=="#"||(n=lt(n)),!n)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:y};var o,s,h,a,v,t,f=n.match(ti);return f?(f[2]&&(h=p(f[2].substring(5),16),s=p(f[2].substring(3,5),16),o=p(f[2].substring(1,3),16)),f[3]&&(h=p((v=f[3].charAt(3))+v,16),s=p((v=f[3].charAt(2))+v,16),o=p((v=f[3].charAt(1))+v,16)),f[4]&&(t=f[4].split(et),o=e(t[0]),t[0].slice(-1)=="%"&&(o*=2.55),s=e(t[1]),t[1].slice(-1)=="%"&&(s*=2.55),h=e(t[2]),t[2].slice(-1)=="%"&&(h*=2.55),f[1].toLowerCase().slice(0,4)=="rgba"&&(a=e(t[3])),t[3]&&t[3].slice(-1)=="%"&&(a/=100)),f[5])?(t=f[5].split(et),o=e(t[0]),t[0].slice(-1)=="%"&&(o/=100),s=e(t[1]),t[1].slice(-1)=="%"&&(s/=100),h=e(t[2]),t[2].slice(-1)=="%"&&(h/=100),(t[0].slice(-3)=="deg"||t[0].slice(-1)=="°")&&(o/=360),f[1].toLowerCase().slice(0,4)=="hsba"&&(a=e(t[3])),t[3]&&t[3].slice(-1)=="%"&&(a/=100),i.hsb2rgb(o,s,h,a)):f[6]?(t=f[6].split(et),o=e(t[0]),t[0].slice(-1)=="%"&&(o/=100),s=e(t[1]),t[1].slice(-1)=="%"&&(s/=100),h=e(t[2]),t[2].slice(-1)=="%"&&(h/=100),(t[0].slice(-3)=="deg"||t[0].slice(-1)=="°")&&(o/=360),f[1].toLowerCase().slice(0,4)=="hsla"&&(a=e(t[3])),t[3]&&t[3].slice(-1)=="%"&&(a/=100),i.hsl2rgb(o,s,h,a)):(o=w(u.round(o),255),s=w(u.round(s),255),h=w(u.round(h),255),a=w(it(a,0),1),f={r:o,g:s,b:h,toString:y},f.hex="#"+(16777216|h|s<<8|o<<16).toString(16).slice(1),f.opacity=r(a,"finite")?a:1,f):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:y}},i);i.hsb=b(function(n,t,r){return i.hsb2rgb(n,t,r).hex});i.hsl=b(function(n,t,r){return i.hsl2rgb(n,t,r).hex});i.rgb=b(function(n,t,i,f){if(r(f,"finite")){var e=u.round;return"rgba("+[e(n),e(t),e(i),+f.toFixed(2)]+")"}return"#"+(16777216|i|t<<8|n<<16).toString(16).slice(1)});var lt=function(n){var t=f.doc.getElementsByTagName("head")[0]||f.doc.getElementsByTagName("svg")[0],i="rgb(255, 0, 0)";return lt=b(function(n){if(n.toLowerCase()=="red")return i;t.style.color=i;t.style.color=n;var r=f.doc.defaultView.getComputedStyle(t,k).getPropertyValue("color");return r==i?null:r}),lt(n)},hi=function(){return"hsb("+[this.h,this.s,this.b]+")"},ci=function(){return"hsl("+[this.h,this.s,this.l]+")"},y=function(){return this.opacity==1||this.opacity==null?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},pt=function(n,t,u){if(t==null&&r(n,"object")&&"r"in n&&"g"in n&&"b"in n&&(u=n.b,t=n.g,n=n.r),t==null&&r(n,string)){var f=i.getRGB(n);n=f.r;t=f.g;u=f.b}return(n>1||t>1||u>1)&&(n/=255,t/=255,u/=255),[n,t,u]},wt=function(n,t,f,e){n=u.round(n*255);t=u.round(t*255);f=u.round(f*255);var o={r:n,g:t,b:f,opacity:r(e,"finite")?e:1,hex:i.rgb(n,t,f),toString:y};return r(e,"finite")&&(o.opacity=e),o};i.color=function(n){var t;return r(n,"object")&&"h"in n&&"s"in n&&"b"in n?(t=i.hsb2rgb(n),n.r=t.r,n.g=t.g,n.b=t.b,n.opacity=1,n.hex=t.hex):r(n,"object")&&"h"in n&&"s"in n&&"l"in n?(t=i.hsl2rgb(n),n.r=t.r,n.g=t.g,n.b=t.b,n.opacity=1,n.hex=t.hex):(r(n,"string")&&(n=i.getRGB(n)),r(n,"object")&&"r"in n&&"g"in n&&"b"in n&&!("error"in n)?(t=i.rgb2hsl(n),n.h=t.h,n.s=t.s,n.l=t.l,t=i.rgb2hsb(n),n.v=t.b):(n={hex:"none"},n.r=n.g=n.b=n.h=n.s=n.v=n.l=-1,n.error=1)),n.toString=y,n};i.hsb2rgb=function(n,t,i,u){r(n,"object")&&"h"in n&&"s"in n&&"b"in n&&(i=n.b,t=n.s,u=n.o,n=n.h);n*=360;var o,s,h,e,f;return n=n%360/60,f=i*t,e=f*(1-rt(n%2-1)),o=s=h=i-f,n=~~n,o+=[f,e,0,0,e,f][n],s+=[e,f,f,e,0,0][n],h+=[0,0,e,f,f,e][n],wt(o,s,h,u)};i.hsl2rgb=function(n,t,i,u){r(n,"object")&&"h"in n&&"s"in n&&"l"in n&&(i=n.l,t=n.s,n=n.h);(n>1||t>1||i>1)&&(n/=360,t/=100,i/=100);n*=360;var o,s,h,e,f;return n=n%360/60,f=2*t*(i<.5?i:1-i),e=f*(1-rt(n%2-1)),o=s=h=i-f/2,n=~~n,o+=[f,e,0,0,e,f][n],s+=[e,f,f,e,0,0][n],h+=[0,0,e,f,f,e][n],wt(o,s,h,u)};i.rgb2hsb=function(n,t,i){i=pt(n,t,i);n=i[0];t=i[1];i=i[2];var f,e,u,r;return u=it(n,t,i),r=u-w(n,t,i),f=r==0?null:u==n?(t-i)/r:u==t?(i-n)/r+2:(n-t)/r+4,f=(f+360)%6/6,e=r==0?0:r/u,{h:f,s:e,b:u,toString:hi}};i.rgb2hsl=function(n,t,i){i=pt(n,t,i);n=i[0];t=i[1];i=i[2];var e,s,u,f,o,r;return f=it(n,t,i),o=w(n,t,i),r=f-o,e=r==0?null:f==n?(t-i)/r:f==t?(i-n)/r+2:(n-t)/r+4,e=(e+360)%6/6,u=(f+o)/2,s=r==0?0:u<.5?r/(2*u):r/(2-2*u),{h:e,s:s,l:u,toString:ci}};i.parsePathString=function(n){var u,f,t;return n?(u=i.path(n),u.arr)?i.path.clone(u.arr):(f={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[],r(n,"array")&&r(n[0],"array")&&(t=i.path.clone(n)),t.length||l(n).replace(ri,function(n,i,r){var u=[],e=i.toLowerCase();if(r.replace(vt,function(n,t){t&&u.push(+t)}),e=="m"&&u.length>2&&(t.push([i].concat(u.splice(0,2))),e="l",i=i=="m"?"l":"L"),e=="o"&&u.length==1&&t.push([i,u[0]]),e=="r")t.push([i].concat(u));else while(u.length>=f[e])if(t.push([i].concat(u.splice(0,f[e]))),!f[e])break}),t.toString=i.path.toString,u.arr=i.path.clone(t),t):null};bt=i.parseTransformString=function(n){if(!n)return null;var t=[];return r(n,"array")&&r(n[0],"array")&&(t=i.path.clone(n)),t.length||l(n).replace(ui,function(n,i,r){var u=[],f=i.toLowerCase();r.replace(vt,function(n,t){t&&u.push(+t)});t.push([i].concat(u))}),t.toString=i.path.toString,t};i._.svgTransform2string=li;i._.rgTransform=/^[a-z][\s]*-?\.?\d/i;i._.transform2matrix=ai;i._unit2px=pi;vi=f.doc.contains||f.doc.compareDocumentPosition?function(n,t){var r=n.nodeType==9?n.documentElement:n,i=t&&t.parentNode;return n==i||!!(i&&i.nodeType==1&&(r.contains?r.contains(i):n.compareDocumentPosition&&n.compareDocumentPosition(i)&16))}:function(n,t){if(t)while(t)if(t=t.parentNode,t==n)return!0;return!1};i._.getSomeDefs=yi;i._.getSomeSVG=kt;i.select=function(n){return n=l(n).replace(/([^\\]):/g,"$1\\:"),h(f.doc.querySelector(n))};i.selectAll=function(n){for(var r=f.doc.querySelectorAll(n),u=(i.set||Array)(),t=0;t1)l={},l[n]=i,n=l;else return t("snap.util.getattr."+n,f).firstDefined();for(o in n)n[c](o)&&t("snap.util.attr."+o,f,n[o]);return f};i.parse=function(n){var t=f.doc.createDocumentFragment(),i=!0,r=f.doc.createElement("div");if(n=l(n),n.match(/^\s*<\s*svg(?:\s|>)/)||(n=""+n+"<\/svg>",i=!1),r.innerHTML=n,n=r.getElementsByTagName("svg")[0],n)if(i)t=n;else while(n.firstChild)t.appendChild(n.firstChild);return new nt(t)};i.fragment=function(){for(var n,u=Array.prototype.slice.call(arguments,0),t=f.doc.createDocumentFragment(),r=0,e=u.length;r" ),t="0,u=r.length;t")}else n&&(i+="/>");return i}}var s=u.prototype,y=i.is,l=String,nt=i._unit2px,h=i._.$,p=i._.make,b=i._.getSomeDefs,w="hasOwnProperty",c=i._.wrap,d,v,a;s.getBBox=function(n){var t,u,e,r,f;if(!i.Matrix||!i.path)return this.node.getBBox();if(t=this,u=new i.Matrix,t.removed)return i._.box();while(t.type=="use")n||(u=u.add(t.transform().localMatrix.translate(t.attr("x")||0,t.attr("y")||0))),t.original?t=t.original:(e=t.attr("xlink:href"),t=t.original=t.node.ownerDocument.getElementById(e.substring(e.indexOf("#")+1)));r=t._;f=i.path.get[t.type]||i.path.get.deflt;try{return n?(r.bboxwt=f?i.path.getBBox(t.realPath=f(t)):i._.box(t.node.getBBox()),i._.box(r.bboxwt)):(t.realPath=f(t),t.matrix=t.transform().localMatrix,r.bbox=i.path.getBBox(i.path.map(t.realPath,u.add(t.matrix))),i._.box(r.bbox))}catch(o){return i._.box()}};d=function(){return this.string};s.transform=function(n){var c=this._;if(n==null){for(var r=this,u=new i.Matrix(this.node.getCTM()),t=k(this),f=[t],e=new i.Matrix,o,s=t.toTransformString(),a=l(t)==l(this.matrix)?l(c.transform):s;r.type!="svg"&&(r=r.parent());)f.push(k(r));for(o=f.length;o--;)e.add(f[o]);return{string:a,globalMatrix:u,totalMatrix:e,localMatrix:t,diffMatrix:u.clone().add(t.invert()),global:u.toTransformString(),total:e.toTransformString(),local:s,toString:d}}return n instanceof i.Matrix?(this.matrix=n,this._.transform=n.toTransformString()):k(this,n),this.node&&(this.type=="linearGradient"||this.type=="radialGradient"?h(this.node,{gradientTransform:this.matrix}):this.type=="pattern"?h(this.node,{patternTransform:this.matrix}):h(this.node,{transform:this.matrix})),this};s.parent=function(){return c(this.node.parentNode)};s.append=s.add=function(n){if(n){if(n.type=="set"){var t=this;return n.forEach(function(n){t.add(n)}),this}n=c(n);this.node.appendChild(n.node);n.paper=this.paper}return this};s.appendTo=function(n){return n&&(n=c(n),n.append(this)),this};s.prepend=function(n){var r,t,i;if(n){if(n.type=="set")return r=this,n.forEach(function(n){t?t.after(n):r.prepend(n);t=n}),this;n=c(n);i=n.parent();this.node.insertBefore(n.node,this.node.firstChild);this.add&&this.add();n.paper=this.paper;this.parent()&&this.parent().add();i&&i.add()}return this};s.prependTo=function(n){return n=c(n),n.prepend(this),this};s.before=function(n){var t,i;return n.type=="set"?(t=this,n.forEach(function(n){var i=n.parent();t.node.parentNode.insertBefore(n.node,t.node);i&&i.add()}),this.parent().add(),this):(n=c(n),i=n.parent(),this.node.parentNode.insertBefore(n.node,this.node),this.parent()&&this.parent().add(),i&&i.add(),n.paper=this.paper,this)};s.after=function(n){n=c(n);var t=n.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(n.node,this.node.nextSibling):this.node.parentNode.appendChild(n.node),this.parent()&&this.parent().add(),t&&t.add(),n.paper=this.paper,this};s.insertBefore=function(n){n=c(n);var t=this.parent();return n.node.parentNode.insertBefore(this.node,n.node),this.paper=n.paper,t&&t.add(),n.parent()&&n.parent().add(),this};s.insertAfter=function(n){n=c(n);var t=this.parent();return n.node.parentNode.insertBefore(this.node,n.node.nextSibling),this.paper=n.paper,t&&t.add(),n.parent()&&n.parent().add(),this};s.remove=function(){var n=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,n&&n.add(),this};s.select=function(n){return c(this.node.querySelector(n))};s.selectAll=function(n){for(var r=this.node.querySelectorAll(n),u=(i.set||Array)(),t=0;t{contents}<\/svg>',{x:+t.x.toFixed(3),y:+t.y.toFixed(3),width:+t.width.toFixed(3),height:+t.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(r)))}};o.prototype.select=s.select;o.prototype.selectAll=s.selectAll}),i.plugin(function(n){function i(n,t,i,r,f,e){if(t==null&&u.call(n)=="[object SVGMatrix]"){this.a=n.a;this.b=n.b;this.c=n.c;this.d=n.d;this.e=n.e;this.f=n.f;return}n!=null?(this.a=+n,this.b=+t,this.c=+i,this.d=+r,this.e=+f,this.f=+e):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}var u=Object.prototype.toString,f=String,t=Math,r="";(function(u){function e(n){return n[0]*n[0]+n[1]*n[1]}function o(n){var i=t.sqrt(e(n));n[0]&&(n[0]/=i);n[1]&&(n[1]/=i)}u.add=function(n,t,r,u,f,e){var o=[[],[],[]],v=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],a=[[n,r,f],[t,u,e],[0,0,1]],s,h,c,l;for(n&&n instanceof i&&(a=[[n.a,n.c,n.e],[n.b,n.d,n.f],[0,0,1]]),s=0;s<3;s++)for(h=0;h<3;h++){for(l=0,c=0;c<3;c++)l+=v[s][c]*a[c][h];o[s][h]=l}return this.a=o[0][0],this.b=o[1][0],this.c=o[0][1],this.d=o[1][1],this.e=o[0][2],this.f=o[1][2],this};u.invert=function(){var n=this,t=n.a*n.d-n.b*n.c;return new i(n.d/t,-n.b/t,-n.c/t,n.a/t,(n.c*n.f-n.d*n.e)/t,(n.b*n.e-n.a*n.f)/t)};u.clone=function(){return new i(this.a,this.b,this.c,this.d,this.e,this.f)};u.translate=function(n,t){return this.add(1,0,0,1,n,t)};u.scale=function(n,t,i,r){return t==null&&(t=n),(i||r)&&this.add(1,0,0,1,i,r),this.add(n,0,0,t,0,0),(i||r)&&this.add(1,0,0,1,-i,-r),this};u.rotate=function(i,r,u){i=n.rad(i);r=r||0;u=u||0;var f=+t.cos(i).toFixed(9),e=+t.sin(i).toFixed(9);return this.add(f,e,-e,f,r,u),this.add(1,0,0,1,-r,-u)};u.x=function(n,t){return n*this.a+t*this.c+this.e};u.y=function(n,t){return n*this.b+t*this.d+this.f};u.get=function(n){return+this[f.fromCharCode(97+n)].toFixed(4)};u.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"};u.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]};u.determinant=function(){return this.a*this.d-this.b*this.c};u.split=function(){var i={},r,u,f;return i.dx=this.e,i.dy=this.f,r=[[this.a,this.c],[this.b,this.d]],i.scalex=t.sqrt(e(r[0])),o(r[0]),i.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*i.shear,r[1][1]-r[0][1]*i.shear],i.scaley=t.sqrt(e(r[1])),o(r[1]),i.shear/=i.scaley,this.determinant()<0&&(i.scalex=-i.scalex),u=-r[0][1],f=r[1][1],f<0?(i.rotate=n.deg(t.acos(f)),u<0&&(i.rotate=360-i.rotate)):i.rotate=n.deg(t.asin(u)),i.isSimple=!+i.shear.toFixed(9)&&(i.scalex.toFixed(9)==i.scaley.toFixed(9)||!i.rotate),i.isSuperSimple=!+i.shear.toFixed(9)&&i.scalex.toFixed(9)==i.scaley.toFixed(9)&&!i.rotate,i.noRotation=!+i.shear.toFixed(9)&&!i.rotate,i};u.toTransformString=function(n){var t=n||this.split();return+t.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[+t.dx.toFixed(4),+t.dy.toFixed(4)]:r)+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:r)+(t.rotate?"r"+[+t.rotate.toFixed(4),0,0]:r))}})(i.prototype);n.Matrix=i;n.matrix=function(n,t,r,u,f,e){return new i(n,t,r,u,f,e)}}),i.plugin(function(n,i,r,u,f){function y(r){return function(u){var o,a,v;t.stop();u instanceof f&&u.node.childNodes.length==1&&(u.node.firstChild.tagName=="radialGradient"||u.node.firstChild.tagName=="linearGradient"||u.node.firstChild.tagName=="pattern")&&(u=u.node.firstChild,s(this).appendChild(u),u=h(u));u instanceof i?u.type=="radialGradient"||u.type=="linearGradient"||u.type=="pattern"?(u.node.id||e(u.node,{id:u.id}),o=c(u.node.id)):o=u.attr(r):(o=n.color(u),o.error?(a=n(s(this).ownerSVGElement).gradient(u),a?(a.node.id||e(a.node,{id:a.id}),o=c(a.node.id)):o=u):o=l(o));v={};v[r]=o;e(this.node,v);this.node.style[r]=g}}function w(n){t.stop();n==+n&&(n+="px");this.node.style.fontSize=n}function b(n){for(var t,i=[],u=n.childNodes,r=0,f=u.length;r1&&(n=Array.prototype.slice.call(arguments,0));var t={};return o(n,"object")&&!o(n,"array")?t=n:n!=null&&(t={points:n}),this.el("polyline",t)};e.polygon=function(n){arguments.length>1&&(n=Array.prototype.slice.call(arguments,0));var t={};return o(n,"object")&&!o(n,"array")?t=n:n!=null&&(t={points:n}),this.el("polygon",t)},function(){function u(){return this.selectAll("stop")}function f(n,t){var f=r("stop"),u={offset:+t+"%"};return n=i.color(n),u["stop-color"]=n.hex,n.opacity<1&&(u["stop-opacity"]=n.opacity),r(f,u),this.node.appendChild(f),this}function o(){if(this.type=="linearGradient"){var t=r(this.node,"x1")||0,f=r(this.node,"x2")||1,u=r(this.node,"y1")||0,e=r(this.node,"y2")||0;return i._.box(t,u,math.abs(f-t),math.abs(e-u))}var o=this.node.cx||.5,s=this.node.cy||.5,n=this.node.r||0;return i._.box(o-n,s-n,n*2,n*2)}function c(n,i){function y(n,t){for(var r=(t-a)/(n-l),i=l;if){if(r&&!y.start){if(s=it(h,c,o[1],o[2],o[3],o[4],o[5],o[6],f-a),l+=["C"+u(s.start.x),u(s.start.y),u(s.m.x),u(s.m.y),u(s.x),u(s.y)],e)return l;y.start=l;l=["M"+u(s.x),u(s.y)+"C"+u(s.n.x),u(s.n.y),u(s.end.x),u(s.end.y),u(o[5]),u(o[6])].join();a+=v;h=+o[5];c=+o[6];continue}if(!i&&!r)return it(h,c,o[1],o[2],o[3],o[4],o[5],o[6],f-a)}a+=v;h=+o[5];c=+o[6]}l+=o.shift()+o}return y.end=l,i?a:r?y:w(h,c,o[0],o[1],o[2],o[3],o[4],o[5],1)},null,n._.clone)}function w(n,t,r,u,e,o,h,c,l){var a=1-l,y=s(a,3),p=s(a,2),v=l*l,w=v*l,nt=y*n+p*3*l*r+a*3*l*l*e+w*h,tt=y*t+p*3*l*u+a*3*l*l*o+w*c,b=n+2*l*(r-n)+v*(e-2*r+n),k=t+2*l*(u-t)+v*(o-2*u+t),d=r+2*l*(e-r)+v*(h-2*e+r),g=u+2*l*(o-u)+v*(c-2*o+u),it=a*n+l*r,rt=a*t+l*u,ut=a*e+l*h,ft=a*o+l*c,et=90-i.atan2(b-d,k-g)*180/f;return{x:nt,y:tt,m:{x:b,y:k},n:{x:d,y:g},start:{x:it,y:rt},end:{x:ut,y:ft},alpha:et}}function ft(t,i,r,u,f,e,o,s){n.is(t,"array")||(t=[t,i,r,u,f,e,o,s]);var c=wt.apply(null,t);return h(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)}function e(n,t,i){return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height}function lt(n,t){return n=h(n),t=h(t),e(t,n.x,n.y)||e(t,n.x2,n.y)||e(t,n.x,n.y2)||e(t,n.x2,n.y2)||e(n,t.x,t.y)||e(n,t.x2,t.y)||e(n,t.x,t.y2)||e(n,t.x2,t.y2)||(n.xt.x||t.xn.x)&&(n.yt.y||t.yn.y)}function at(n,t,i,r,u){var f=-3*t+9*i-9*r+3*u,e=n*f+6*t-12*i+6*r;return n*e-3*t+3*i}function v(n,t,r,u,f,e,o,s,h){var c;h==null&&(h=1);h=h>1?1:h<0?0:h;var l=h/2,w=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],b=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],a=0;for(c=0;c<12;c++){var v=l*w[c]+l,y=at(v,n,r,f,o),p=at(v,t,u,e,s),k=y*y+p*p;a+=b[c]*i.sqrt(k)}return l*a}function ni(n,t,i,r,u,f,e,s,h){if(!(h<0)&&!(v(n,t,i,r,u,f,e,s).01;)a/=2,c+=(lr(e,s))&&!(r(t,f)r(o,h))){var p=(n*f-t*i)*(e-s)-(n-i)*(e*h-o*s),w=(n*f-t*i)*(o-h)-(t-f)*(e*h-o*s),a=(n-i)*(o-h)-(t-f)*(e-s);if(a){var v=p/a,y=w/a,c=+v.toFixed(2),l=+y.toFixed(2);if(!(c<+u(n,i).toFixed(2))&&!(c>+r(n,i).toFixed(2))&&!(c<+u(e,s).toFixed(2))&&!(c>+r(e,s).toFixed(2))&&!(l<+u(t,f).toFixed(2))&&!(l>+r(t,f).toFixed(2))&&!(l<+u(o,h).toFixed(2))&&!(l>+r(o,h).toFixed(2)))return{x:v,y:y}}}}function et(n,t,i){var rt=ft(n),ut=ft(t),r,s,h,k,d;if(!lt(rt,ut))return i?0:[];var et=v.apply(0,n),ot=v.apply(0,t),a=~~(et/8),y=~~(ot/8),g=[],nt=[],it={},tt=i?0:[];for(r=0;r=0&&k<=1&&d>=0&&d<=1&&(i?tt++:tt.push({x:u.x,y:u.y,t1:k,t2:d}))}}return tt}function ii(n,t){return ot(n,t)}function ri(n,t){return ot(n,t,1)}function ot(n,t,i){var f,e,o,s,b,k,d,g,h,c,v,y,nt,l,w,tt,a,r,u,it;for(n=p(n),t=p(t),v=i?0:[],y=0,nt=n.length;y180),0,s,c]];else e=[["M",n,t],["m",0,-r],["a",i,r,0,1,1,0,2*r],["a",i,r,0,1,1,0,-2*r],["z"]];return e.toString=a,e}function ei(t){var w=c(t),b=String.prototype.toLowerCase,u,d,f,i,s,g,h,nt,v;if(w.rel)return l(w.rel);n.is(t,"array")&&n.is(t&&t[0],"array")||(t=n.parsePathString(t));var r=[],o=0,e=0,y=0,p=0,k=0;for(t[0][0]=="M"&&(o=t[0][1],e=t[0][2],y=o,p=e,k++,r.push(["M",o,e])),u=k,d=t.length;u1&&(tt=i.sqrt(tt),u=tt*u,e=tt*e);var ot=u*u,st=e*e,lt=(h==c?-1:1)*i.sqrt(o((ot*st-ot*d*d-st*k*k)/(ot*d*d+st*k*k))),it=lt*u*d/e+(t+l)/2,rt=lt*-e*k/u+(r+a)/2,p=i.asin(((r-rt)/e).toFixed(9)),y=i.asin(((a-rt)/e).toFixed(9));p=ty&&(p=p-f*2);!c&&y>p&&(y=y-f*2)}if(et=y-p,o(et)>ct){var gt=y,ni=l,ti=a;y=p+ct*(c&&y>p?1:-1);l=it+u*i.cos(y);a=rt+e*i.sin(y);w=pt(l,a,u,e,s,0,c,ni,ti,[y,gt,it,rt])}et=y-p;var ii=i.cos(p),ri=i.sin(p),ui=i.cos(y),fi=i.sin(y),at=i.tan(et/4),vt=4/3*u*at,yt=4/3*e*at,wt=[t,r],nt=[t+vt*ri,r-yt*ii],bt=[l+vt*fi,a-yt*ui],kt=[l,a];if(nt[0]=2*wt[0]-nt[0],nt[1]=2*wt[1]-nt[1],v)return[nt,bt,kt].concat(w);for(w=[nt,bt,kt].concat(w).join().split(","),ht=[],b=0,dt=w.length;b7){n[t].shift();for(var i=n[t];i.length;)h[t]="A",u&&(a[t]="A"),n.splice(t++,0,["C"].concat(i.splice(0,6)));n.splice(t,1);w=r(f.length,u&&u.length||0)}},rt=function(n,t,i,e,o){n&&t&&n[o][0]=="M"&&t[o][0]!="M"&&(t.splice(o,0,["M",e.x,e.y]),i.bx=0,i.by=0,i.x=n[o][1],i.y=n[o][2],w=r(f.length,u&&u.length||0))},h=[],a=[],s="",p="";for(i=0,w=r(f.length,u&&u.length||0);ir;r+=2)i=[{x:+n[r-2],y:+n[r-1]},{x:+n[r],y:+n[r+1]},{x:+n[r+2],y:+n[r+3]},{x:+n[r+4],y:+n[r+5]}],t?r?u-4==r?i[3]={x:+n[0],y:+n[1]}:u-2==r&&(i[2]={x:+n[0],y:+n[1]},i[3]={x:+n[2],y:+n[3]}):i[0]={x:+n[u-2],y:+n[u-1]}:u-4==r?i[3]=i[2]:r||(i[0]={x:+n[r],y:+n[r+1]}),f.push(["C",(-i[0].x+6*i[1].x+i[2].x)/6,(-i[0].y+6*i[1].y+i[2].y)/6,(i[1].x+6*i[2].x-i[3].x)/6,(i[1].y+6*i[2].y-i[3].y)/6,i[2].x,i[2].y]);return f}var nt=t.prototype,ht=n.is,tt=n._.clone,kt="hasOwnProperty",dt=/,?([a-z]),?/gi,b=parseFloat,i=Math,f=i.PI,u=i.min,r=i.max,s=i.pow,o=i.abs,gt=rt(1),ct=rt(),ut=rt(0,1),d=n._unit2px,fi={path:function(n){return n.attr("path")},circle:function(n){var t=d(n);return y(t.cx,t.cy,t.r)},ellipse:function(n){var t=d(n);return y(t.cx||0,t.cy||0,t.rx,t.ry)},rect:function(n){var t=d(n);return k(t.x||0,t.y||0,t.width,t.height,t.rx,t.ry)},image:function(n){var t=d(n);return k(t.x||0,t.y||0,t.width,t.height)},line:function(n){return"M"+[n.attr("x1")||0,n.attr("y1")||0,n.attr("x2"),n.attr("y2")]},polyline:function(n){return"M"+n.attr("points")},polygon:function(n){return"M"+n.attr("points")+"z"},deflt:function(n){var t=n.node.getBBox();return k(t.x,t.y,t.width,t.height)}};n.path=c;n.path.getTotalLength=gt;n.path.getPointAtLength=ct;n.path.getSubpath=function(n,t,i){if(this.getTotalLength(n)-i<1e-6)return ut(n,t).end;var r=ut(n,i,1);return t?ut(r,t).end:r};nt.getTotalLength=function(){if(this.node.getTotalLength)return this.node.getTotalLength()};nt.getPointAtLength=function(n){return ct(this.attr("d"),n)};nt.getSubpath=function(t,i){return n.path.getSubpath(this.attr("d"),t,i)};n._.box=h;n.path.findDotsAtSegment=w;n.path.bezierBBox=ft;n.path.isPointInsideBBox=e;n.closest=function(t,i,r,u){for(var f=100,p=h(t-f/2,i-f/2,f,f),s=[],b=r[0].hasOwnProperty("x")?function(n){return{x:r[n].x,y:r[n].y}}:function(n){return{x:r[n],y:u[n]}},v=0,o,c,l,y,w,a;f<=1e6&&!v;){for(o=0,c=r.length;oa&&(y=a,s[o].len=a,w=s[o]);return w}};n.path.isBBoxIntersect=lt;n.path.intersection=ii;n.path.intersectionNumber=ri;n.path.isPointInside=ui;n.path.getBBox=vt;n.path.get=fi;n.path.toRelative=ei;n.path.toAbsolute=st;n.path.toCubic=p;n.path.map=oi;n.path.toString=a;n.path.clone=l}),i.plugin(function(n){var f=Math.max,e=Math.min,u=function(n){if(this.items=[],this.bindings={},this.length=0,this.type="set",n)for(var t=0,i=n.length;t ',{def:r})};n.filter.blur.toString=function(){return this()};n.filter.shadow=function(t,i,r,u,f){return typeof r=="string"&&(u=r,f=u,r=4),typeof u!="string"&&(f=u,u="#000"),u=u||"#000",r==null&&(r=4),f==null&&(f=1),t==null&&(t=0,i=2),i==null&&(i=t),u=n.color(u),n.format(' <\/feComponentTransfer> <\/feMerge>',{color:u,dx:t,dy:i,blur:r,opacity:f})};n.filter.shadow.toString=function(){return this()};n.filter.grayscale=function(t){return t==null&&(t=1),n.format(' ',{a:.2126+.7874*(1-t),b:.7152-.7152*(1-t),c:.0722-.0722*(1-t),d:.2126-.2126*(1-t),e:.7152+.2848*(1-t),f:.0722-.0722*(1-t),g:.2126-.2126*(1-t),h:.0722+.9278*(1-t)})};n.filter.grayscale.toString=function(){return this()};n.filter.sepia=function(t){return t==null&&(t=1),n.format(' ',{a:.393+.607*(1-t),b:.769-.769*(1-t),c:.189-.189*(1-t),d:.349-.349*(1-t),e:.686+.314*(1-t),f:.168-.168*(1-t),g:.272-.272*(1-t),h:.534-.534*(1-t),i:.131+.869*(1-t)})};n.filter.sepia.toString=function(){return this()};n.filter.saturate=function(t){return t==null&&(t=1),n.format(' ',{amount:1-t})};n.filter.saturate.toString=function(){return this()};n.filter.hueRotate=function(t){return t=t||0,n.format(' ',{angle:t})};n.filter.hueRotate.toString=function(){return this()};n.filter.invert=function(t){return t==null&&(t=1),n.format(' <\/feComponentTransfer>',{amount:t,amount2:1-t})};n.filter.invert.toString=function(){return this()};n.filter.brightness=function(t){return t==null&&(t=1),n.format(' <\/feComponentTransfer>',{amount:t})};n.filter.brightness.toString=function(){return this()};n.filter.contrast=function(t){return t==null&&(t=1),n.format(' <\/feComponentTransfer>',{amount:t,amount2:.5-t/2})};n.filter.contrast.toString=function(){return this()}}),i.plugin(function(n,t){var i=n._.box,r=n.is,u=/^[^a-z]*([tbmlrc])/i,f=function(){return"T"+this.dx+","+this.dy};t.prototype.getAlign=function(n,t){t==null&&r(n,"string")&&(t=n,n=null);n=n||this.paper;var o=n.getBBox?n.getBBox():i(n),s=this.getBBox(),e={};t=t&&t.match(u);t=t?t[1].toLowerCase():"c";switch(t){case"t":e.dx=0;e.dy=o.y-s.y;break;case"b":e.dx=0;e.dy=o.y2-s.y2;break;case"m":e.dx=0;e.dy=o.cy-s.cy;break;case"l":e.dx=o.x-s.x;e.dy=0;break;case"r":e.dx=o.x2-s.x2;e.dy=0;break;default:e.dx=o.cx-s.cx;e.dy=0}return e.toString=f,e};t.prototype.align=function(n,t){return this.transform("..."+this.getAlign(n,t))}}),i});Snap.plugin(function(n,t,i){i.prototype.seatIcon=function(t,i,r,u,f,e,o){var v=100,a=null,s,c,y,l,h=n.matrix();h.translate(i,r);h.scale(u/v,f/v);switch(o){case 1:h.rotate(-90,50,50);break;case 3:h.rotate(90,50,50)}switch(e){case 1:s=' <\/g>';l="SeatingControl-standard-seat";break;case 2:s=' <\/g>';l="SeatingControl-wheelchair";break;case 3:s=' <\/g>';l="SeatingControl-carer-seat";break;default:s=""}return y=''+s+' <\/g><\/g>',c=' <\/g>',c=''+c+y+"<\/g>",this.append(n.parse(c)),a=this.select("#seat-"+t),a.transform(h),a}}),function e(n,t,i){function r(u,e){var s,h,o;if(!t[u]){if(!n[u]){if(s=typeof require=="function"&&require,!e&&s)return s(u,!0);if(f)return f(u,!0);h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h;}o=t[u]={exports:{}};n[u][0].call(o.exports,function(t){var i=n[u][1][t];return r(i?i:t)},o,o.exports,e,n,t,i)}return t[u].exports}for(var f=typeof require=="function"&&require,u=0;u=0;i--)this.eventListeners.hasOwnProperty(t[i])&&delete this.eventListeners[t[i]];for(u in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(u,this.eventListeners[u],this.options.preventMouseEventsDefault?!1:s);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())};i.prototype.enableMouseWheelZoom=function(){var n,t;if(!this.options.mouseWheelZoomEnabled){n=this;this.wheelListener=function(t){return n.handleMouseWheel(t)};t=!this.options.preventMouseEventsDefault;o.on(this.options.eventsListenerElement||this.svg,this.wheelListener,t);this.options.mouseWheelZoomEnabled=!0}};i.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var n=!this.options.preventMouseEventsDefault;o.off(this.options.eventsListenerElement||this.svg,this.wheelListener,n);this.options.mouseWheelZoomEnabled=!1}};i.prototype.handleMouseWheel=function(n){if(this.options.zoomEnabled&&this.state==="none"){this.options.preventMouseEventsDefault&&(n.preventDefault?n.preventDefault():n.returnValue=!1);var t=n.deltaY||1,i=Date.now()-this.lastMouseWheelEventTime,r=3+Math.max(0,30-i);this.lastMouseWheelEventTime=Date.now();"deltaMode"in n&&n.deltaMode===0&&n.wheelDelta&&(t=n.deltaY===0?0:Math.abs(n.wheelDelta)/n.deltaY);t=-.30?1:-1)*Math.log(Math.abs(t)+10)/r;var f=this.svg.getScreenCTM().inverse(),e=u.getEventPoint(n,this.svg).matrixTransform(f),o=Math.pow(1+this.options.zoomScaleSensitivity,-1*t);this.zoomAtPoint(o,e)}};i.prototype.zoomAtPoint=function(n,t,i){var r=this.viewport.getOriginalState();i?(n=Math.max(this.options.minZoom*r.zoom,Math.min(this.options.maxZoom*r.zoom,n)),n=n/this.getZoom()):this.getZoom()*nthis.options.maxZoom*r.zoom&&(n=this.options.maxZoom*r.zoom/this.getZoom());var f=this.viewport.getCTM(),u=t.matrixTransform(f.inverse()),o=this.svg.createSVGMatrix().translate(u.x,u.y).scale(n).translate(-u.x,-u.y),e=f.multiply(o);e.a!==f.a&&this.viewport.setCTM(e)};i.prototype.zoom=function(n,t){this.zoomAtPoint(n,u.getSvgCenterPoint(this.svg,this.width,this.height),t)};i.prototype.publicZoom=function(n,t){t&&(n=this.computeFromRelativeZoom(n));this.zoom(n,t)};i.prototype.publicZoomAtPoint=function(n,t,i){if(i&&(n=this.computeFromRelativeZoom(n)),r.getType(t)!=="SVGPoint")if("x"in t&&"y"in t)t=u.createSVGPoint(this.svg,t.x,t.y);else throw new Error("Given point is invalid");this.zoomAtPoint(n,t,i)};i.prototype.getZoom=function(){return this.viewport.getZoom()};i.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()};i.prototype.computeFromRelativeZoom=function(n){return n*this.viewport.getOriginalState().zoom};i.prototype.resetZoom=function(){var n=this.viewport.getOriginalState();this.zoom(n.zoom,!0)};i.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())};i.prototype.reset=function(){this.resetZoom();this.resetPan()};i.prototype.handleDblClick=function(n){var t,i,r;if(this.options.preventMouseEventsDefault&&(n.preventDefault?n.preventDefault():n.returnValue=!1),this.options.controlIconsEnabled&&(t=n.target.getAttribute("class")||"",t.indexOf("svg-pan-zoom-control")>-1))return!1;i=n.shiftKey?1/((1+this.options.zoomScaleSensitivity)*2):(1+this.options.zoomScaleSensitivity)*2;r=u.getEventPoint(n,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(i,r)};i.prototype.handleMouseDown=function(n,t){this.options.preventMouseEventsDefault&&(n.preventDefault?n.preventDefault():n.returnValue=!1);r.mouseAndTouchNormalize(n,this.svg);this.options.dblClickZoomEnabled&&r.isDblClick(n,t)?this.handleDblClick(n):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=u.getEventPoint(n,this.svg).matrixTransform(this.firstEventCTM.inverse()))};i.prototype.handleMouseMove=function(n){if(this.options.preventMouseEventsDefault&&(n.preventDefault?n.preventDefault():n.returnValue=!1),this.state==="pan"&&this.options.panEnabled){var t=u.getEventPoint(n,this.svg).matrixTransform(this.firstEventCTM.inverse()),i=this.firstEventCTM.translate(t.x-this.stateOrigin.x,t.y-this.stateOrigin.y);this.viewport.setCTM(i)}};i.prototype.handleMouseUp=function(n){this.options.preventMouseEventsDefault&&(n.preventDefault?n.preventDefault():n.returnValue=!1);this.state==="pan"&&(this.state="none")};i.prototype.fit=function(){var n=this.viewport.getViewBox(),t=Math.min(this.width/n.width,this.height/n.height);this.zoom(t,!0)};i.prototype.contain=function(){var n=this.viewport.getViewBox(),t=Math.max(this.width/n.width,this.height/n.height);this.zoom(t,!0)};i.prototype.center=function(){var n=this.viewport.getViewBox(),t=(this.width-(n.width+n.x*2)*this.getZoom())*.5,i=(this.height-(n.height+n.y*2)*this.getZoom())*.5;this.getPublicInstance().pan({x:t,y:i})};i.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()};i.prototype.pan=function(n){var t=this.viewport.getCTM();t.e=n.x;t.f=n.y;this.viewport.setCTM(t)};i.prototype.panBy=function(n){var t=this.viewport.getCTM();t.e+=n.x;t.f+=n.y;this.viewport.setCTM(t)};i.prototype.getPan=function(){var n=this.viewport.getState();return{x:n.x,y:n.y}};i.prototype.resize=function(){var t=u.getBoundingClientRectNormalized(this.svg),n;this.width=t.width;this.height=t.height;n=this.viewport;n.options.width=this.width;n.options.height=this.height;n.processCTM();this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())};i.prototype.destroy=function(){var t=this,n;this.beforeZoom=null;this.onZoom=null;this.beforePan=null;this.onPan=null;this.onUpdatedCTM=null;this.options&&this.options.customEventsHandler!=null&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(n in this.eventListeners)(this.options&&this.options.eventsListenerElement||this.svg).removeEventListener(n,this.eventListeners[n],this.options&&!this.options.preventMouseEventsDefault?s:!1);this.disableMouseWheelZoom();this.getPublicInstance().disableControlIcons();this.reset();f=f.filter(function(n){return n.svg!==t.svg});delete this.options;delete this.viewport;delete this.publicInstance;delete this.pi;this.getPublicInstance=function(){return null}};i.prototype.getPublicInstance=function(){var n=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return n.options.panEnabled=!0,n.pi},disablePan:function(){return n.options.panEnabled=!1,n.pi},isPanEnabled:function(){return!!n.options.panEnabled},pan:function(t){return n.pan(t),n.pi},panBy:function(t){return n.panBy(t),n.pi},getPan:function(){return n.getPan()},setBeforePan:function(t){return n.options.beforePan=t===null?null:r.proxy(t,n.publicInstance),n.pi},setOnPan:function(t){return n.options.onPan=t===null?null:r.proxy(t,n.publicInstance),n.pi},enableZoom:function(){return n.options.zoomEnabled=!0,n.pi},disableZoom:function(){return n.options.zoomEnabled=!1,n.pi},isZoomEnabled:function(){return!!n.options.zoomEnabled},enableControlIcons:function(){return n.options.controlIconsEnabled||(n.options.controlIconsEnabled=!0,e.enable(n)),n.pi},disableControlIcons:function(){return n.options.controlIconsEnabled&&(n.options.controlIconsEnabled=!1,e.disable(n)),n.pi},isControlIconsEnabled:function(){return!!n.options.controlIconsEnabled},enableDblClickZoom:function(){return n.options.dblClickZoomEnabled=!0,n.pi},disableDblClickZoom:function(){return n.options.dblClickZoomEnabled=!1,n.pi},isDblClickZoomEnabled:function(){return!!n.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return n.enableMouseWheelZoom(),n.pi},disableMouseWheelZoom:function(){return n.disableMouseWheelZoom(),n.pi},isMouseWheelZoomEnabled:function(){return!!n.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(t){return n.options.zoomScaleSensitivity=t,n.pi},setMinZoom:function(t){return n.options.minZoom=t,n.pi},setMaxZoom:function(t){return n.options.maxZoom=t,n.pi},setBeforeZoom:function(t){return n.options.beforeZoom=t===null?null:r.proxy(t,n.publicInstance),n.pi},setOnZoom:function(t){return n.options.onZoom=t===null?null:r.proxy(t,n.publicInstance),n.pi},zoom:function(t){return n.publicZoom(t,!0),n.pi},zoomBy:function(t){return n.publicZoom(t,!1),n.pi},zoomAtPoint:function(t,i){return n.publicZoomAtPoint(t,i,!0),n.pi},zoomAtPointBy:function(t,i){return n.publicZoomAtPoint(t,i,!1),n.pi},zoomIn:function(){return this.zoomBy(1+n.options.zoomScaleSensitivity),n.pi},zoomOut:function(){return this.zoomBy(1/(1+n.options.zoomScaleSensitivity)),n.pi},getZoom:function(){return n.getRelativeZoom()},setOnUpdatedCTM:function(t){return n.options.onUpdatedCTM=t===null?null:r.proxy(t,n.publicInstance),n.pi},resetZoom:function(){return n.resetZoom(),n.pi},resetPan:function(){return n.resetPan(),n.pi},reset:function(){return n.reset(),n.pi},fit:function(){return n.fit(),n.pi},contain:function(){return n.contain(),n.pi},center:function(){return n.center(),n.pi},updateBBox:function(){return n.updateBBox(),n.pi},resize:function(){return n.resize(),n.pi},getSizes:function(){return{width:n.width,height:n.height,realZoom:n.getZoom(),viewBox:n.viewport.getViewBox()}},destroy:function(){return n.destroy(),n.pi}}),this.publicInstance};f=[];h=function(n,t){var e=r.getSvg(n),u;if(e===null)return null;for(u=f.length-1;u>=0;u--)if(f[u].svg===e)return f[u].instance.getPublicInstance();return f.push({svg:e,instance:new i(e,t)}),f[f.length-1].instance.getPublicInstance()};t.exports=h},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(n,t){var i=n("./utilities"),r="unknown";/*@cc_on!@*/!1&&!document.documentMode||(r="ie");t.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(n){if(n.clientWidth&&n.clientHeight)return{width:n.clientWidth,height:n.clientHeight};if(!n.getBoundingClientRect())throw new Error("Cannot get BoundingClientRect for SVG.");else return n.getBoundingClientRect()},getOrCreateViewport:function(n,t){var r=null,f,s,u,e,o;if(r=i.isElement(t)?t:n.querySelector(t),r||(f=Array.prototype.slice.call(n.childNodes||n.children).filter(function(n){return n.nodeName!=="defs"&&n.nodeName!=="#text"}),f.length===1&&f[0].nodeName==="g"&&f[0].getAttribute("transform")===null&&(r=f[0])),!r){if(s="viewport-"+(new Date).toISOString().replace(/\D/g,""),r=document.createElementNS(this.svgNS,"g"),r.setAttribute("id",s),u=n.childNodes||n.children,!!u&&u.length>0)for(e=u.length;e>0;e--)u[u.length-e].nodeName!=="defs"&&r.appendChild(u[u.length-e]);n.appendChild(r)}return o=[],r.getAttribute("class")&&(o=r.getAttribute("class").split(" ")),~o.indexOf("svg-pan-zoom_viewport")||(o.push("svg-pan-zoom_viewport"),r.setAttribute("class",o.join(" "))),r},setupSvgAttributes:function(n){if(n.setAttribute("xmlns",this.svgNS),n.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),n.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),n.parentNode!==null){var t=n.getAttribute("style")||"";t.toLowerCase().indexOf("overflow")===-1&&n.setAttribute("style","overflow: hidden; "+t)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:i.throttle(function(){for(var n,i=document.querySelectorAll("defs"),r=i.length,t=0;tt?(clearTimeout(r),r=null,e=l,o=n.apply(u,f),r||(u=f=null)):r||i.trailing===!1||(r=setTimeout(h,c)),o}},createRequestAnimationFrame:function(n){var t=null;return n!=="auto"&&n<60&&n>1&&(t=Math.floor(1e3/n)),t===null?window.requestAnimationFrame||i(33):i(t)}}},{}]},{},[1]);var SportsubsSeatingUISubModule=function(n){return n.SeatingUI=function(){var o=!1,h=null,e=[],t={HeadingModifyOrComplete:"The system has automatically assigned you seats from amongst the best available seating, you can click the blue section below to view your seats. Select any available section to view other available seats. Once finished click Confirm Seats.",HeadingSelectSection:"You need to choose seats for this purchase. Select any available section to select your seats.",HeadingSelectSeats:"Select any available seats or choose another section.",HeadingModifyOrCompleteSeats:"You may move your seating to any available space or choose a different section. Once finished click Confirm Seats.",HeadingSelectSeatBlock:"Select where you want your group to sit from the available positions.",HeadingModifyOrCompleteBlock:"You may move the entire group to any available space or choose another section. Once finished click Confirm Seats.",HeadingRenewalSeats:"Your reserved seats",HeadingRenewalSection:"Your seating section",HeadingSelectedSeats:"Seating location",HeadingSelectedSection:"Venue section location",HeadingSectionAvailability:"Current seating availability",HeadingSectionSeatAvailability:"Current availability",HeadingSeatingSections:"Seating areas",AlreadySelected:"Already selected",Available:"Available",AvailabilityForMatch:' Availability for <\/span>{0}',AvailabilityInfoReserved:"You have reserved this seat",AvailabilityInfoForSeason:"for the season",AvailabilityInfoForMatch:"for {0}: {1}",CarerInfo:"This seat is suitable for a carer accompanying the person in the adjacent wheelchair position.",CarerSeat:'Carer seat<\/span>',CarerSeats:'Carer seats<\/span>',EntireSeason:"entire season",InfoBoxHeadingAllMatches:"Showing seat availability for all matches",InfoBoxHeadingMatch:"Seat availability for {0}",InfoBoxHeadingSeason:"Showing season seating availability",InfoBoxHeadingOwnSeats:"Seating for {0}",MultipleMatchCancel:"Cancel",MultipleMatchChangeSeatsTitle:"Reserve seat for multiple matches",MultipleMatchChangeSeatsInfo:"Select all matches you like to change to seat",MultipleMatchOk:"Reserve seats",MultipleMatchSelectSeatsInfo:"Select the matches you would like to reserve this seat for",MultipleMatchSelectSeatsTitle:"This seat is not available for all matches",MustSelectSeats:"You must select your seats before continuing",NotAvailable:"Not available",PartialAvailable:"Partially available",ShowSeatLabel:"Show seat position",RemoveSeatLabel:"Remove selected seat",ReserveSeatCancel:"Cancel",ReserveSeatOK:"Reserve",Seat:"Seat",SeatRemoved:"Seat removed",SelectMatchLabel:"Select match",SelectSeasonText:"Entire season",SoldOut:"Sold Out",StandardSeat:'Standard seat<\/span>',StandardSeats:'Standard seats<\/span>',SuccessMultipleRemoveSeat:"Seat unreserved for all matches",SuccessMultipleReserveSeat:"Seat {0}{1} reserved for all matches",SuccessSingleRemoveSeat:"Seat unreserved",SuccessSingleReserveSeat:"Seat {0}{1} reserved",TowardsPitch:"towards {0}",WheelChairInfo:"The selected area is suitable a wheelchair. There is no seat present.",WheelchairBay:'Wheelchair bay<\/span>',WheelchairBays:'Wheelchair bays<\/span>',PressToSelect:"(Press seat again to reserve)",PressToUnselect:"",YourSeats:"Your seating",DisabledFacilities:"Disabled facilities",ProductSeatingAreas:"Seating areas for this product",ErrorMultipleRemoveSeat:"Unable to remove the selected seats, please try again or contact technical support if the problem persists.",ErrorMultipleReserveSeat:"Unable to reserve all the required seats, please try another location.",ErrorSingleRemoveSeat:"Unable to remove this seat, please try again or contact technical support if the problem persists.",ErrorSingleReserveSeat:"Unable to reserve the requested seats, please try another location.",ErrorUnknown:"We are unable to process your request at this time. If the problem persists, please contact technical support.",FatalError:"Sorry, this feature is temporarily unavailable. If the problem persists, please contact technical support.",AlertSelectionUnavailable:"Seating for this item cannot be changed at this time.",AlertGroupSelectionComplete:"Your seat selection for this item is complete, next choose seats for {0}.",AlertGroupSelectionNextProduct:"the next product in your cart",AlertAutoAssignedNotMoveable:"The pre-assigned seats for this purchase cannot be changed."},p=function(){var r=function(t){this.ns=n.SeatingUI;this.controlId=_.uniqueId("seatingcontrol_");this.Settings={showOnlyOverlaySeats:!0,highlightBlockedSeats:!0,seatingBlockCanSpanAisle:!1,seatingBlockCanSpanNoSeatsSpaces:!1,autoOpenSelectedSeatSection:!1,highlightSeatedSections:!0,showAvailability:!0,showAttributes:!0,showMedia:!0,showMatchSelector:!0,showSeatedSectionNames:!0,showUnseatedSectionNames:!1,showOverlayDetails:!0,showLeftRowLabel:!0,showRightRowLabel:!0,enableSectionSelection:!0,enableSeatSelection:!0,enforceNoSingleSeats:!0,showCategoryList:!1,venueSvgMaxHeight:550,venueSvgMaxWidth:1e3,enableSvgZoom:!1,venueBackgroundUpdateInterval:1e4,enableVenueBackgroundStatusUpdate:!1,seatingGridBackgroundUpdateInterval:5e3,enableSeatingGridBackgroundStatusUpdate:!1,matchIds:null,seatingCategories:null,venueDefinitionUrl:null,sectionAvailabilityUrl:null,seatAvailabilityUrl:null,enableFullSeason:!0,autoAdvanceBetweenGroups:!0,isAutoAssignedSeats:!1,isAutoAssignedSeatingMoveable:!1,isAllRenewals:!1,isShowingSelectedSeats:!1,initialVenueId:0,initialMatchId:0,selectedSeatingIds:null,selectedOverlayIds:null};this.controlElementName=".SeatingControl-VenueSeatingUI";this.containerElementName=".SeatingControl-VenueContainer";this.matchSelectorElementName=".SeatingControl-MatchSelector";this.categoryListElementName=".SeatingControl-VenueSeatingCategories";this.infoPanelElementName=".SeatingControl-InfoPanel";this.venueSvgElementName=".SeatingControl-VenueMap";this.seatingGridSvgElementName=".SeatingControl-SeatingGrid";this.venueGroupId=_.uniqueId("vg");this.$UiWrapperElement=$(t);this.$containerElement=this.$UiWrapperElement.find(this.containerElementName);this.$venueSvgElement=this.$UiWrapperElement.find(this.venueSvgElementName);this.$seatingGridSvgElement=this.$UiWrapperElement.find(this.seatingGridSvgElementName);this.$matchSelectorElement=this.$UiWrapperElement.find(this.matchSelectorElementName);this.$infoPanelElement=this.$UiWrapperElement.find(this.infoPanelElementName);this.$categoryListElement=this.$UiWrapperElement.find(this.categoryListElementName);this.venueSvgPaper=null;this.seatingGridSvgPaper=null;this.Name=null;this.VenueId=null;this.PerimeterSvgMarkup=null;this.PitchSvgMarkup=null;this.BasePixelWidth=null;this.BasePixelHeight=null;this.SectionOverlays=[];this.combineAllMatches=!1;this.currentMatchId=0;this.currentProductMatchIds=[];this.isActive=!1;this.currentSectionOverlay=null;this.currentActivePerson=null;this.isVenueSoldOut=!1;this.isSectionOverlaySoldOut=!1;n.debugMessage("Defaults:","info");n.debugMessage(this.Settings,"info");this.Settings=$.extend(this.Settings,this.$UiWrapperElement.data());for(i in this.Settings)_.isNumber(this.Settings[i])||(n.isValueTrue(this.Settings[i])?this.Settings[i]=!0:n.isValueFalse(this.Settings[i])&&(this.Settings[i]=!1));this.Settings.selectedSeatingIds=n.stringToArray(this.Settings.selectedSeatingIds,",",!0);this.Settings.selectedOverlayIds=n.stringToArray(this.Settings.selectedOverlayIds,",",!0);this.Settings.seatingCategories=n.stringToKeyPairArray(this.Settings.seatingCategories,",",[{Key:"Id",Type:"int"},{Key:"Name",Type:"string"}]);this.Settings.isAllRenewals&&(this.Settings.enableSeatSelection=!1);n.debugMessage("Merged settings:","info");n.debugMessage(this.Settings,"info");this.ns.VenueDefinitions=this.$UiWrapperElement.data("venue-definitions")};return r.prototype={SeatStatuses:{Unallocated:0,Allocated:1,Pending:2,PendingTransfer:3,PendingConfirmation:4,Hold:5,MatchdayHold:6,TemporyHold:7,Blocked:8,PartiallyAllocated:9,NotInOverlay:100,InValidForGroupSeating:101},SeatTypes:{StandardSeat:1,WheelchairBay:2,CarerSeat:3,NoSeat:4,Aisle:5},SeatCssClasses:["SeatingControl-seat-allocated-color","SeatingControl-seat-blocked-color","SeatingControl-seat-invalid-for-group-color","SeatingControl-seat-not-present-color","SeatingControl-seat-partially-allocated-color","SeatingControl-seat-selected-color","SeatingControl-seat-unallocated-color","SeatingControl-seat-symbol-allocated-color","SeatingControl-seat-symbol-blocked-color","SeatingControl-seat-symbol-invalid-for-group-color","SeatingControl-seat-symbol-not-present-color","SeatingControl-seat-symbol-partially-allocated-color","SeatingControl-seat-symbol-selected-color","SeatingControl-seat-symbol-unallocated-color","active-person-seat"],OverlayCssClasses:["SeatingControl-section-seating-available","SeatingControl-section-seating-available-disabledfacilities","SeatingControl-section-seating-soldout","disable-pointer"],init:function(){var t=this,i=parseInt(t.Settings.initialVenueId),r,u;t.buildMatches(t.$UiWrapperElement.data("matches"));t.currentMatchId=t.Settings.initialMatchId;_.isNil(t.ns.VenueDefinitions)||t.ns.VenueDefinitions.length!==1?t.currentMatchId===0&&t.Settings.initialVenueId>0?i=t.Settings.initialVenueId:_.isNil(t.Settings.matches)?(this.fatalError(),n.debugMessage("No match definitions available","error"),n.handleError(new Error("No match definitions available"))):(u=_.find(t.Settings.matches,{Id:parseInt(t.currentMatchId)}),_.isNil(u)?(this.fatalError(),n.debugMessage("No definition for match id:"+t.currentMatchId,"error"),n.handleError(new Error("No definition for expected match id"),null,{currentMatchId:t.currentMatchId},null,null)):i=u.VenueId):(r=t.ns.VenueDefinitions[0],_.isNil(r)||(i=r.VenueId));!_.isNil(i)&&i>0?(t.setVenue(i),t.drawVenue(),t.updateControlHeading(),t.Settings.showMatchSelector&&t.initMatchSelector(),t.showVenueUI(),t.populateFooterContent(),this.Settings.enableSeatingCountdown&&!_.isNil(this.Settings.selectedSeatingIds)&&this.Settings.selectedSeatingIds.length>0&&!this.Settings.isAllRenewals&&t.ns.showCountdown(),t.$UiWrapperElement.trigger("SportsubsEvent:seatingcontrol:initialised",[t])):(this.fatalError(),n.debugMessage("Unable to initialise venue control, could not determine venue Id ","error"))},setVenue:function(t){var i=this,r=null;if(!_.isNil(t)&&t!==i.VenueId)if(r=_.find(i.ns.VenueDefinitions,{VenueId:t}),_.isNil(r))this.fatalError(),n.debugMessage("Venue definition not found:"+t,"error");else{if(i.Settings.enableSvgZoom&&!_.isNil(i.venuePanZoom)&&_.isFunction(i.venuePanZoom.destroy))try{i.venuePanZoom.destroy()}catch(u){}if(i.Settings.enableSvgZoom&&!_.isNil(i.seatingGridPanZoom)&&_.isFunction(i.seatingGridPanZoom.destroy))try{i.seatingGridPanZoom.destroy()}catch(u){}i.Name=r.VenueName;i.VenueId=r.VenueId;i.PerimeterSvgMarkup=r.PerimeterSvgMarkup;i.PitchSvgMarkup=r.PitchSvgMarkup;i.BasePixelWidth=r.OverallWidthInPixels;i.BasePixelHeight=r.OverallHeightInPixels;i.SeatingAreas=r.Sections;currentMatch=_.find(i.Settings.matches,{Id:parseInt(i.currentMatchId)});_.isNil(currentMatch)||(i.initialiseSectionOverlayObjects(currentMatch.SectionOverlays),i.selectMatchById(i.currentMatchId))}},setActive:function(){this.isActive=!0;$(this.controlElementName).addClass("ghosted");$(this.$UiWrapperElement.removeClass("ghosted"));this.$UiWrapperElement.trigger("SportsubsEvent:seatingcontrol:active",[this])},setInactive:function(){this.isActive=!1;this.stopBackgroundStatusUpdate();_.isNil(this.currentSectionOverlay)||this.currentSectionOverlay.stopBackgroundStatusUpdate();this.$UiWrapperElement.addClass("ghosted");this.$UiWrapperElement.trigger("SportsubsEvent:seatingcontrol:inactive",[this])},fatalError:function(){var n=$("",{"class":"alert alert-danger seating-fatal-error",html:this.ns.Strings.FatalError});this.$UiWrapperElement.html(n)},initialiseSectionOverlayObjects:function(n){var t=this;t.clearSeatingSectionOverlays();_.forEach(n,function(n){var i=new t.SectionOverlay(n);i.SeatingControl=t;t.SectionOverlays.push(i)})},getSectionOverlaysGroup:function(){var t=this,n=null;return this.venueSvgPaper&&(n=this.venueSvgPaper.select("#VenueSectionOverlaysGroup"),_.isNil(n)&&(n=this.venueSvgPaper.g().attr({id:"VenueSectionOverlaysGroup"}))),n},destroySectionOverlaysGroup:function(){var n=this.getSectionOverlaysGroup();n.remove()},addSectionOverlaysToGroup:function(){var n=this.getSectionOverlaysGroup();return this.SectionOverlays.forEach(function(t){t=t.draw();_.isNull(t)||n.add(t)}),n},clearSeatingSectionOverlays:function(){this.clearSectionOverlaysGroup();this.SectionOverlays=[]},clearSectionOverlaysGroup:function(){this.SectionOverlays.forEach(function(n){n=n.remove()})},getSectionOverlayById:function(n){var t=null;return!_.isUndefined(n)&&n>0&&(t=_.find(this.SectionOverlays,{Id:parseInt(n)})),t},getAvailabilityForSectionOverlays:function(){var t=this,i=null,u,f,r;t.Settings.sectionAvailabilityUrl?(u=_.filter(t.SectionOverlays,function(n){var t=null;return!_.isNil(n.AllowedCategoryTypeIds)&&n.AllowedCategoryTypeIds.length>0&&(t=n.Id),t}),f=_.map(u,"Id"),t.Settings.enableFullSeason&&(i=[0]),i=t.Settings.matches.length===1?_.union(i,[t.currentMatchId]):_.union(i,_.map(_.filter(t.Settings.matches,["VenueId",t.VenueId]),"Id")),r=JSON.stringify({overlayIds:f,matchIds:i}),t.sectionUpdateRequest=$.ajax({url:t.Settings.sectionAvailabilityUrl,method:"POST",contentType:"application/json; charset=utf-8",data:r,dataType:"json",cache:!1,headers:{__RequestVerificationToken:n.afToken()},success:function(i){i!=="null"?(n.debugMessage("getAvailabilityForSectionOverlays( "+r+" )","info"),n.debugMessage(JSON.parse(i),"info"),t.parseAvailabilityFromJson(JSON.parse(i)),t.updateSectionOverlaysWithCurrentAvailability()):n.debugMessage("getAvailabilityForSectionOverlays() returned null","warn")},error:function(t,i,r){r!=="abort"&&(n.debugMessage("AJAX error in getAvailabilityForSectionOverlays() : "+r,"error"),n.debugMessage(t,"error"))},complete:function(){t.$infoPanelElement.html("
{0}<\/div>".format(t.getAvailabilityLabel(t.currentMatchId)));t.Settings.enableVenueBackgroundStatusUpdate&&_.isNil(t.venueDataUpdateTimeout)&&t.startBackgroundStatusUpdate();t.hideBusy()}})):n.debugMessage("Invalid sectionAvailabilityUrl: "+t.Settings.sectionAvailabilityUrl,"error")},parseAvailabilityFromJson:function(n){var t=this;_.forEach(t.SectionOverlays,function(t){var r=_.find(n,{SectionId:t.VenueSectionId}),i=_.filter(r.AvailabilityItems,{SeatingCategoryId:t.SeatingCategoryId});_.isNil(i)||(t.AvailabilityItems=i)})},updateSectionOverlaysWithCurrentAvailability:function(){var n=this,t;n.Settings.showAvailability&&(t=0,n.showUpdating(),_.forEach(n.SectionOverlays,function(i){var r=n.setVenueSvgSectionOverlayAttributes(i);r>0&&t++}),n.hideUpdating(),n.isVenueSoldOut=t===0)},startBackgroundStatusUpdate:function(){var n=this;n.isActive&&n.Settings.enableVenueBackgroundStatusUpdate&&(n.stopBackgroundStatusUpdate(),n.venueDataUpdateTimeout=setInterval(function(){n.$venueSvgElement.is(":visible:not(:animated)")&&!_.isNil(n.venueDataUpdateTimeout)&&(n.showUpdating(),n.getAvailabilityForSectionOverlays())},n.Settings.venueBackgroundUpdateInterval))},stopBackgroundStatusUpdate:function(){var n=this;_.isNil(n.venueDataUpdateTimeout)||clearInterval(n.venueDataUpdateTimeout);_.isNil(n.sectionUpdateRequest)||n.sectionUpdateRequest.abort()},getVenueSvgSectionOverlayById:function(n){var t="#SectionOverlay-"+n,i=this.venueSvgPaper;return i.select(t)},getVenueSvgSectionOverlayShapeById:function(n){var t="#SectionOverlayShape-"+n,i=this.venueSvgPaper;return i.select(t)},setVenueSvgSectionOverlayAttributes:function(t){var i=this,f=0,s=null,l=!_.isNil(i.Settings.selectedOverlayIds)&&_.includes(i.Settings.selectedOverlayIds,t.OverlayId),r,c,u,e,o,h;return _.isNil(t)||(r=i.getVenueSvgSectionOverlayShapeById(t.Id),r&&(t.isAllowedForCategories()?(c=i.combineAllMatches?t.availabilityCountsForCurrentProduct():t.availabilityCountsForCurrentMatch(),u=_.find(t.availabilityCountsForSeason(),{MatchId:0}),u&&(i.currentMatchId===0||_.isNil(c))?(f=_.sumBy(u.AvailabilityCounts,function(n){return n.AvailabilityCount}),s=u):(e=t.minimumAvailabilityForMatchIds(i.combineAllMatches?i.currentProductMatchIds:[i.currentMatchId]),_.isNil(e)||e.forEach(function(n){u&&(o=_.find(u.AvailabilityCounts,{SeatType:n.SeatType}),o&&o.AvailabilityCount
0?(h=_.map(s,"SeatType"),_.includes(h,i.SeatTypes.WheelchairBay)||_.includes(h,i.SeatTypes.CarerSeat)?r.removeClass(t.SeatingControl.OverlayCssClasses.join(" ")).addClass("SeatingControl-section-seating-available-disabledfacilities"):r.removeClass(t.SeatingControl.OverlayCssClasses.join(" ")).addClass("SeatingControl-section-seating-available")):f===0&&(r.removeClass(t.SeatingControl.OverlayCssClasses.join(" ")).addClass("SeatingControl-section-seating-soldout"),l||n.SeatingUI._godMode||r.addClass("disable-pointer"))):r.removeClass(t.SeatingControl.OverlayCssClasses.join(" ")))),f},drawVenue:function(){var t=this,s=Math.max(t.$containerElement.innerWidth(),t.ns.defaultWidth),a=t.BasePixelHeight/t.BasePixelWidth,c,l;_.isNil(t.venueSvgPaper)&&(t.$venueSvgElement.width(s).height(s*a),t.$venueSvgElement.attr("id","VenueSvg-"+t.venueGroupId),t.venueSvgPaper=Snap($(t.$venueSvgElement)[0]));t.venueSvgPaper.clear();var v=t.PerimeterSvgMarkup?t.PerimeterSvgMarkup.replace(/"pitchArea"/g,'"pitchArea-'+t.venueGroupId+'"'):"",y=t.PitchSvgMarkup?t.PitchSvgMarkup.replace(/id="/g,'id="'+t.venueGroupId+"_"):"",h=t.importSvg(v,"BorderGroup_"+t.venueGroupId),e=h.select("#pitchArea-"+t.venueGroupId),o=t.importSvg(y,"PitchGroup_"+t.venueGroupId);if(e){t._showPitchLocation&&e.attr({strokeOpacity:1});var i=e.getBBox(),r=o.getBBox(),u=Math.min(i.width/r.width,i.height/r.height);_.isFinite(u)||(u=1);var p=r.x*-1,w=r.y*-1,f=new Snap.Matrix;i.width0&&t.highlightSelectedSeatingSectionOverlays(t.Settings.selectedOverlayIds);$(window).on("resize",function(){clearTimeout(t.resizeTimer);t.resizeTimer=setTimeout(function(){t.resizeVenueGroup()},t.ns._resizeDebounceMillisconds)})},drawSeatingAreas:function(){var n=this,u=null,r,t,i;if(n.venueSvgPaper){if(r=n.venueSvgPaper.g().attr({id:"VenueSeatingAreasGroup"}),t=null,!_.isNil(n.SeatingAreas)&&!_.isEmpty(n.SeatingAreas))for(i=0;i"+this.Name+": "+f+"<\/b>",r="",t.Settings.showAvailability&&(i.AvailabilityItems&&i.AvailabilityItems.length>0?(i.AvailabilityItems.forEach(function(n){var e,i;if(t.currentProductMatchIds.length===0&&n.MatchId===t.currentMatchId||t.combineAllMatches&&_.includes(t.currentProductMatchIds,n.MatchId)||!t.combineAllMatches&&t.currentMatchId===n.MatchId){var f=_.find(t.Settings.matches,{Id:n.MatchId}),u='',o=n.AvailabilityCounts;r+=_.isNil(f)?t.ns.Strings.AvailabilityForMatch.format("season"):t.ns.Strings.AvailabilityForMatch.format(f.NameWithDate());e=_.sortBy(o,"SeatType");i="";e.forEach(function(n){if(n.AvailabilityCount>0)switch(n.SeatType){case t.SeatTypes.StandardSeat:i='<\/i> {0} {1}<\/li>'.format(n.AvailabilityCount,n.AvailabilityCount===1?t.ns.Strings.StandardSeat:t.ns.Strings.StandardSeats);u+=i;break;case t.SeatTypes.WheelchairBay:i=' <\/i> {0} {1}<\/li>'.format(n.AvailabilityCount,n.AvailabilityCount===1?t.ns.Strings.WheelchairBay:t.ns.Strings.WheelchairBays);u+=i;break;case t.SeatTypes.CarerSeat:i=' <\/i> {0} {1}<\/li>'.format(n.AvailabilityCount,n.AvailabilityCount===1?t.ns.Strings.CarerSeat:t.ns.Strings.CarerSeats);u+=i}});r+=u+"<\/ul><\/li>"}}),u+=r!==""?'{0}<\/ul>'.format(r):'{0}<\/li><\/ul>'.format(t.ns.Strings.SoldOut)):u+='{0}<\/li><\/ul>'.format(t.ns.Strings.SoldOut))),u},resetDetailsPanel:function(n){var t=this,i;(_.isUndefined(n)||n<0)&&(n=1);i=t.$infoPanelElement;i.length===1&&(_.isNil(t.infoPanelTimeout)||clearTimeout(t.infoPanelTimeout),i.clearQueue(),t.infoPanelTimeout=setTimeout(function(){i.hasClass("panelIsVisible")||i.fadeOut("fast",function(){t.Settings.matches.length>0&&(i.html($("",{html:t.getAvailabilityLabel(t.currentMatchId)})),i.fadeIn("fast"))})},n))},populateDetailsPanel:function(n){var t=this.$infoPanelElement;t.length!==1||_.isUndefined(n)||t.html($("
",{html:n}))},populateAndShowDetailsPanel:function(n){var i=this,t=i.$infoPanelElement;t.length!==1||_.isUndefined(n)||(_.isNil(i.infoPanelTimeout)||clearTimeout(i.infoPanelTimeout),i.populateDetailsPanel(n),!t.is(":animated")||t.is(":hidden")?t.fadeIn("fast"):t.show())},highlightSeatingCategory:function(n,t,i){var r=this,u=!1,f=parseInt(i)>0?i:5e3;_.isNil(r.categoryHighlightTimeout)||window.clearTimeout(r.categoryHighlightTimeout);_.each(this.SectionOverlays,function(i){var f=i;_.isNil(f.SeatingCategoryId)||(t&&f.SeatingCategoryId===n?(r.getVenueSvgSectionOverlayShapeById(f.Id).addClass("SeatingControl-section-category-highlight-color"),u=!0):r.getVenueSvgSectionOverlayShapeById(f.Id).removeClass("SeatingControl-section-category-highlight-color"))});u&&(r.categoryHighlightTimeout=setTimeout(function(){r.highlightSeatingCategory(null,!1);$(".seatingCategoryKeyItem").removeClass("SeatingControl-category-highlight-color")},f))},drawSeatingCategoryList:function(){var n=this,u=_.sortBy(n.Settings.seatingCategories,"Name"),t=$("
"),i,r;t.addClass("my-2 list-unstyled list-inline");i=_.uniq(_.flatten(_.map(n.SectionOverlays,"AllowedCategoryTypeIds")));r=_.filter(u,function(n){return _.includes(i,n.Id)});r.forEach(function(i){var r=$("").appendTo(t);r.addClass("inline");$("").text(i.Name).attr("data-cat-id",i.Id).addClass("pointer seatingCategoryKeyItem btn btn-secondary").on("click",function(){$(".seatingCategoryKeyItem").removeClass("SeatingControl-category-highlight-color");$(this).addClass("SeatingControl-category-highlight-color");n.highlightSeatingCategory($(this).data("cat-id"),!0,3e3)}).appendTo(r)});n.$categoryListElement.empty().append(t)},highlightSelectedSeatingSectionOverlays:function(n){this.SectionOverlays.forEach(function(t){_.includes(n,t.Id)?t.addSelectedSeatHighlight():t.removeSelectedSeatHighlight()})},updateCurrentMatchId:function(n){var t=this;t.currentMatchId!==n&&(t.currentMatchId=n,t.Settings.enableVenueBackgroundStatusUpdate&&t.stopBackgroundStatusUpdate(),t.updateSectionOverlaysWithCurrentAvailability(),t.Settings.enableVenueBackgroundStatusUpdate&&t.startBackgroundStatusUpdate(),t.currentSectionOverlay&&(t.Settings.enableSeatingGridBackgroundStatusUpdate&&t.currentSectionOverlay.stopBackgroundStatusUpdate(),t.currentSectionOverlay.refreshSeatStatusesForProductMatchIds(),t.Settings.enableSeatingGridBackgroundStatusUpdate&&t.currentSectionOverlay.startBackgroundStatusUpdate()));t.$infoPanelElement.html("{0}<\/div>".format(t.getAvailabilityLabel(t.currentMatchId)));t.hideBusy()},getAvailabilityLabel:function(n){var i="",t=this,r;return t.Settings.showAvailability&&t.isVenueSoldOut?i='<\/i> Sorry, there are currently no seats available<\/b><\/span>':!_.isNil(t.currentProductMatchIds)&&t.currentProductMatchIds.length>1&&t.combineAllMatches?i=t.ns.Strings.InfoBoxHeadingAllMatches:!_.isNil(n)&&n>0?(r=_.find(t.Settings.matches,{Id:parseInt(n)}),_.isNil(r)||(!_.isNil(t.Settings.selectedSeatingIds)&&t.Settings.selectedSeatingIds.length>0?i=t.ns.Strings.InfoBoxHeadingOwnSeats.format(r.Name()):t.Settings.showAvailability&&(i=t.ns.Strings.InfoBoxHeadingMatch.format(r.Name())))):t.Settings.showAvailability&&(i=t.ns.Strings.InfoBoxHeadingSeason),i},showVenueUI:function(n){var t=this;_.isNil(n)&&(n={});t.$containerElement.closest(".seating-manager-panel").find(".venue-group").fadeIn(n);$(window).trigger("sportsubsEvent_seatingSelector_showUI")},hideVenueUI:function(n){var t=this;_.isNil(n)&&(n={});t.resetDetailsPanel(t.ns._defaultInfoPanelAutoHideMilliseconds);t.$containerElement.closest(".seating-manager-panel").find(".venue-group").each(function(t){$(this).fadeOut(t===0?n:{})});$(window).trigger("sportsubsEvent_seatingSelector_hideUI")},RefreshSelectedSectionOverlaysAndSeats:function(){var t=[],n;t=$.makeArray($(".person").map(function(){return parseInt($(this).attr("data-overlay-id"))}));this.Settings.selectedOverlayIds=t;n=[];n=$.makeArray($(".person").map(function(){return parseInt($(this).attr("data-seating-id"))}));this.Settings.selectedSeatingIds=n},Match:function(){var t=function(t){this.Id=t.MatchId;this.Date=t.Date;this.AwayTeam=t.AwayTeam;this.Round=t.Round;this.IsSeatingAvailable=t.IsSeatingAvailable;this.ns=n.SeatingUI;this.VenueId=t.VenueId;this.SectionOverlays=t.SeatingSections};return t.prototype={Name:function(n){var t=null;return this.Id>0?(t=this.Round+": "+this.AwayTeam,n&&(t+=" ("+moment(this.Date).format("lll")+")")):t=" "+this.ns.Strings.EntireSeason,t},NameWithDate:function(){return this.Name(!0)}},t}(),SectionOverlay:function(){var t=function(t){this.AllowedCategoryTypeIds=t.AllowedCategoryTypeIds;this.AvailabilityItems=[];this.VenueSectionId=t.SectionId;this.Id=t.OverlayId;this.Name=t.SectionName;this.SeatingCategoryId=t.SeatingCategoryId;this.ShortName=t.SectionShortName;this.OverlayId=t.OverlayId;this.OverlayDescription=t.OverlayDescription;this.Orientation=t.SectionOrientation;this.Type=t.SectionType;this.NonRectangleDataPath=t.NonRectangleDataPath;this.RectangleCoordinates=t.RectangleCoordinates;this.TierIndex=t.TierIndex;this.isEnabled=!0;this.GridWidth=null;this.Rows=null;this.SeatPixelSize=25;this.SeatingControl=null;this.ns=n.SeatingUI};return t.prototype={draw:function(){var t=this,r=t.SeatingControl.venueSvgPaper,i=null,f;if(r){if(t.sectionShape=null,_.isNil(this.NonRectangleDataPath)||this.NonRectangleDataPath===""?_.isNil(this.RectangleCoordinates)||(t.sectionShape=r.rect(this.RectangleCoordinates.X,this.RectangleCoordinates.Y,this.RectangleCoordinates.Width,this.RectangleCoordinates.Height)):t.sectionShape=r.path(this.NonRectangleDataPath),!_.isNull(t.sectionShape)){t.sectionShape.attr({id:"SectionOverlayShape-"+this.Id}).addClass("SeatingControl-section-default");t.sectionShape.addClass("SeatingControl-fill-transition");t.SeatingControl.Settings.highlightSeatedSections&&(f=!1,t.AllowedCategoryTypeIds.forEach(function(n){_.includes(_.map(t.SeatingControl.Settings.seatingCategories,"Id"),n)&&(f=!0)}),t.sectionShape.addClass(f?"SeatingControl-section-available":"SeatingControl-section-unavailable"));var u=t.sectionShape.getBBox(),e=this.OverlayDescription!=""?this.OverlayDescription.substr(0,6):this.ShortName,o=r.text(u.x+u.width/2,u.y+u.height/2,t.SeatingControl.Settings.showSeatedSectionNames&&t.SeatingControl.Settings.highlightSeatedSections&&this.isSeatedSectionOverlay()||t.SeatingControl.Settings.showUnseatedSectionNames&&!this.isSeatedSectionOverlay()?e:"").attr({fill:"white",fontSize:"10px",textAnchor:"middle",alignmentBaseline:"central"}).addClass("no-pointer-events");i=r.group(t.sectionShape,o).attr({id:"SectionOverlay-"+this.Id});(n.SeatingUI._godMode||t.isSeatedSectionOverlay()&&(t.SeatingControl.Settings.showOverlayDetails||t.SeatingControl.Settings.enableSectionSelection&&!t.SeatingControl.Settings.isAllRenewals||t.containsSelectedSeats()))&&i.hover(function(n){t.onHover(n,this)},function(n){t.offHover(n,this)});(n.SeatingUI._godMode||t.isSeatedSectionOverlay()&&(t.SeatingControl.Settings.enableSectionSelection&&!t.SeatingControl.Settings.isAllRenewals||t.containsSelectedSeats()))&&(i.addClass("pointer"),i.click(function(n){t.onClick(n,this)}),i.touchend(function(n){t.onClick(n,this)}))}return i}},remove:function(){var n=this.SeatingControl.venueSvgPaper.select("#SectionOverlay-"+this.Id);_.isNil(n)||n.remove()},onHover:function(){var n=this;n.SeatingControl.Settings.showOverlayDetails&&(n.SeatingControl.Settings.showAvailability||!_.isNil(n.SeatingControl.Settings.selectedOverlayIds))&&n.SeatingControl.populateAndShowDetailsPanel(n.SeatingControl.sectionAvailabilityInformation(n.Id))},offHover:function(){var n=this;n.SeatingControl.Settings.showOverlayDetails&&n.SeatingControl.resetDetailsPanel(n.ns._defaultInfoPanelAutoHideMilliseconds)},onClick:function(){var t=this;(n.SeatingUI._godMode||t.SeatingControl.Settings.enableSectionSelection&&!t.SeatingControl.Settings.isAllRenewals&&_.isNil(t.SeatingControl.seatingGridDataUpdateRequest)&&(t.hasCarerSeatAvailable()||t.hasStandardSeatingAvailable()||t.hasWheelchairBayAvailable())||t.containsSelectedSeats()||!t.SeatingControl.Settings.showAvailability)&&(t.SeatingControl.showBusy(),t.SeatingControl.Settings.enableVenueBackgroundStatusUpdate&&t.SeatingControl.stopBackgroundStatusUpdate(),t.getAvailabilityForSeatingGrid())},containsSelectedSeats:function(){return _.includes(this.SeatingControl.Settings.selectedOverlayIds,this.Id)},isAllowedForCategories:function(){var n=_.intersection(_.map(this.SeatingControl.Settings.seatingCategories,"Id"),this.AllowedCategoryTypeIds);return!_.isNil(n)&&n.length>0},isSeatedSectionOverlay:function(){return!_.isNil(this.AllowedCategoryTypeIds)&&this.AllowedCategoryTypeIds.length>0||this.containsSelectedSeats()},hasStandardSeating:function(){var n=!1,t=this.allSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.StandardSeat)),n},hasWheelchairBay:function(){var n=!1,t=this.allSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.WheelchairBay)),n},hasCarerSeat:function(){var n=!1,t=this.allSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.CarerSeat)),n},hasStandardSeatingAvailable:function(){var n=!1,t=this.availableSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.StandardSeat)),n},hasWheelchairBayAvailable:function(){var n=!1,t=this.availableSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.WheelchairBay)),n},hasCarerSeatAvailable:function(){var n=!1,t=this.availableSeatTypesForCurrentMatch();return t&&(n=_.includes(t,this.SeatingControl.SeatTypes.CarerSeat)),n},seatsInSection:function(){return _.flatten(_.map(this.Rows,"Seats"))},seatsInSectionOverlay:function(){var n=_.flatten(_.map(this.Rows,"Seats")),t=this.SeatingCategoryId;return _.filter(n,{Availability:[{SeatingCategoryId:t}]})},getSeatById:function(n){var u=this,t=null,i=u.seatsInSection(),r=_.findIndex(i,function(t){return t.Id===parseInt(n)});return r!==-1&&(t=i[r]),t},getSeatBySeatingId:function(n){var u=this,i=null,r,t;return n>0&&(r=u.seatsInSection(),t=_.filter(r,{Availability:[{SeatingId:parseInt(n)}]}),t.length===1&&(i=t[0])),i},availabilityCountsForCurrentMatch:function(){return _.head(this.availabilityCountsForMatchIds([this.SeatingControl.currentMatchId]))},availabilityCountsForSeason:function(){return this.availabilityCountsForMatchIds([0])},availabilityCountsForCurrentProduct:function(){return this.availabilityCountsForMatchIds(this.SeatingControl.currentProductMatchIds)},availabilityCountsForMatchIds:function(n){var t=this;return _.filter(t.AvailabilityItems,function(t){return _.includes(n,t.MatchId)})},minimumAvailabilityForMatchIds:function(n){var e=this,r=null,u=e.availabilityCountsForMatchIds(n),t=[],i,f;return u&&(i=_.flatten(_.map(u,"AvailabilityCounts")),f=_.map(i,"SeatType"),_.forEach(f,function(n){var r=_.filter(i,{SeatType:n}),u=_.minBy(r,function(n){return n.AvailabilityCount});t.push({SeatType:n,AvailabilityCount:u.AvailabilityCount})})),t.length&&(r=t),r},allSeatTypesForCurrentMatch:function(){var i=this,n=null,t=i.availabilityCountsForCurrentMatch();return t&&(n=_.map(t[0].AvailabilityCounts,"SeatType")),n},availableSeatTypesForCurrentMatch:function(){var r=this,i=null,n=r.availabilityCountsForCurrentMatch(),t;return _.isNil(n)||_.isNil(n.AvailabilityCounts)||(t=_.filter(n.AvailabilityCounts,function(n){return n.AvailabilityCount>0}),t&&(i=_.map(t,"SeatType"))),i},getContiguousSeatsInArray:function(n,t){for(var f,r=this,i=null,u=0;u0?t.SeatingControl.currentProductMatchIds:t.SeatingControl.currentMatchId;r=JSON.stringify({overlayId:t.Id,matchIds:i});t.stopBackgroundStatusUpdate();t.SeatingControl.Settings.seatAvailabilityUrl?t.SeatingControl.seatingGridDataUpdateRequest=$.ajax({url:t.SeatingControl.Settings.seatAvailabilityUrl,method:"POST",cache:!1,headers:{__RequestVerificationToken:n.afToken()},data:r,dataType:"json",contentType:"application/json; charset=utf-8",error:function(t,i,r){r!=="abort"&&(n.debugMessage("AJAX error in getAvailabilityForSeatingGrid() : "+r,"error"),n.debugMessage(t,"error"))},success:function(i){n.debugMessage("getAvailabilityForSeatingGrid( "+r+" )","info");i?(i=JSON.parse(i),n.debugMessage(i,"info"),i.SectionId===t.Id&&(t.SeatingControl.currentSectionOverlay&&t.SeatingControl.currentSectionOverlay.Id===t.Id?t.updateSeatingGrid(i):t.drawSeatingGrid(i),t.SeatingControl.Settings.enableSeatingGridBackgroundStatusUpdate&&t.startBackgroundStatusUpdate())):n.debugMessage("getAvailabilityForSeatingGrid() returned Null","warn")},complete:function(){t.SeatingControl.hideBusy();t.SeatingControl.seatingGridDataUpdateRequest=null},"async":!0,processData:!1}):n.debugMessage("Invalid seatAvailabilityUrl: "+t.SeatingControl.Settings.seatAvailabilityUrl,"error")},isValidSeatingRow:function(n){var t=this,i=!1;return!_.isNil(n.Seats)&&n.Seats.length>0&&(i=_.some(n.Seats,function(n){return n.SeatTypeId===t.SeatingControl.SeatTypes.StandardSeat||n.SeatTypeId===t.SeatingControl.SeatTypes.WheelchairBay||n.SeatTypeId===t.SeatingControl.SeatTypes.CarerSeat}),i&&t.SeatingControl.Settings.showOnlyOverlaySeats&&(i=_.some(n.Seats,{Availability:[{SeatingCategoryId:t.SeatingCategoryId}]}))),i},drawSeatingGrid:function(t){var i=this,e,f,s,l,h,o,a,r,u;if(_.isNil(i.SeatingControl.currentMatchId)&&(i.SeatingControl.currentMatchId=0),i.SeatingControl.seatingGridSvgPaper){if(i.SeatingControl.Settings.enableSvgZoom&&i.SeatingControl.seatingGridPanZoom&&typeof i.SeatingControl.seatingGridPanZoom.options!="undefined")try{i.SeatingControl.seatingGridPanZoom.destroy()}catch(p){n.handleError(p)}paper=i.SeatingControl.seatingGridSvgPaper;paper.clear()}else paper=Snap($(i.SeatingControl.$seatingGridSvgElement)[0]),$(i.SeatingControl.$seatingGridSvgElement).attr("id","SeatingGridSvg-"+i.SeatingControl.venueGroupId);if(e=i.SeatingControl.$seatingGridSvgElement.width(),f=i.SeatingControl.$seatingGridSvgElement.height(),i.SeatingControl.seatingGridSvgPaper=paper,paper.rect(0,0,e,f).addClass("SeatingControl-seating-grid-background"),paper!==null&&t.Rows.length>0){o=[];firstRowIndex=Math.max(0,_.findIndex(t.Rows,function(n){return i.isValidSeatingRow(n)}));lastRowIndex=_.findLastIndex(t.Rows,function(n){return i.isValidSeatingRow(n)});lastRowIndex++;o=_.slice(t.Rows,firstRowIndex,lastRowIndex);a=o[0].Seats[0].GridRow;i.Rows=[];var w=_.flatten(_.map(o,"Seats")),v=_.map(w,"GridSeat"),b=_.min(v),y=_.max(v),c=y-b+1,k=y-c;i.GridWidth=c+1;r=(e-i.GridWidth*i.SeatPixelSize)/2;u=(f-o.length*i.SeatPixelSize)/2;i.SeatPixelSize=i.Orientation.PitchDirection===1||i.Orientation.PitchDirection===3?Math.min(f/(c+10),e/o.length):Math.min(e/(c+10),f/(o.length+8));o.forEach(function(n){i.Rows.push({DisplaySequence:n.DisplaySequence,Name:n.RowName,Seats:[]});s=n.Seats;l=i.firstSeatPositioninRow(s);h=i.lastSeatPositioninRow(s);h===-1&&(h=s.length);var t=0,c=0;s.forEach(function(s){var v=new i.SeatingControl.Seat(s.StadiumSeatId,s.SeatTypeId,s.SeatNumber,s.SeatAttributes,s.MediaItems,s.GridRow,s.GridRow-a,s.GridSeat,i.Id,s.Availability,i,n.RowName),p,g,d;v.GridColumn=v.GridColumn-k;i.Rows[c].Seats.push(v);var w=0,b=0,y=i.SeatPixelSize*.6;switch(i.Orientation.PitchDirection){case 0:r=(e-(i.GridWidth+1)*i.SeatPixelSize)/2;u=(f-o.length*i.SeatPixelSize)/2;firstLabelOffsetX=y*-1;firstLabelOffsetY=y;lastLabelOffsetX=y*2;lastLabelOffsetY=y;w=v.GridColumn*i.SeatPixelSize+r;b=(v.DisplayRow+1)*i.SeatPixelSize+u-i.SeatPixelSize;break;case 1:r=(e-o.length*i.SeatPixelSize)/2;u=(f-(i.GridWidth+2)*i.SeatPixelSize)/2;firstLabelOffsetX=y;firstLabelOffsetY=y*-1;lastLabelOffsetX=y;lastLabelOffsetY=y*2;w=e-((v.DisplayRow-1)*i.SeatPixelSize+r);b=v.GridColumn*i.SeatPixelSize+u;break;case 2:r=(e-(i.GridWidth+1)*i.SeatPixelSize)/2;u=(f-o.length*i.SeatPixelSize)/2;firstLabelOffsetX=y*2;firstLabelOffsetY=y;lastLabelOffsetX=y*-1;lastLabelOffsetY=y;w=e-(v.GridColumn*i.SeatPixelSize+r+i.SeatPixelSize);b=f-((v.DisplayRow+1)*i.SeatPixelSize+u);break;case 3:r=(e-o.length*i.SeatPixelSize)/2;u=(f-(i.GridWidth+2)*i.SeatPixelSize)/2;firstLabelOffsetX=y/2;firstLabelOffsetY=y*2;lastLabelOffsetX=y/2;lastLabelOffsetY=y*-.75;w=(v.DisplayRow+1)*i.SeatPixelSize+(r-i.SeatPixelSize);b=f-v.GridColumn*i.SeatPixelSize-(u+i.SeatPixelSize)}i.SeatingControl.Settings.showLeftRowLabel&&n.RowName!=="***"&&t===l&&paper.text(w+firstLabelOffsetX,b+firstLabelOffsetY,n.RowName).attr({fontSize:i.SeatPixelSize*.4,textAnchor:"middle"});i.SeatingControl.Settings.showRightRowLabel&&n.RowName!=="***"&&t===h&&paper.text(w+lastLabelOffsetX,b+lastLabelOffsetY,n.RowName).attr({fontSize:i.SeatPixelSize*.4,textAnchor:"middle"});v.SeatTypeId!==i.SeatingControl.SeatTypes.NoSeat&&v.SeatTypeId!==i.SeatingControl.SeatTypes.Aisle&&(p=paper.seatIcon(v.Id,w,b,i.SeatPixelSize*.8,i.SeatPixelSize*.8,v.SeatTypeId,i.Orientation.PitchDirection),p.append(Snap.parse("{0} {1}{2}<\/title>".format(i.ns.Strings.Seat,n.RowName,v.SeatNumber))),p.hover(function(){var n=this.node.id.indexOf("-"),t,r;n!==-1&&(t=this.node.id.substr(n+1),r=i.getSeatById(t),r.onHover())},function(){var n=this.node.id.indexOf("-"),t,r;n!==-1&&(t=this.node.id.substr(n+1),r=i.getSeatById(t),r.offHover())}),i.SeatingControl.Settings.enableSeatSelection&&(p.addClass("pointer"),p.touchmove(function(){return clearTimeout(i.ns._longPressTimer),!1}),p.touchstart(function(){var n=this.node.id.indexOf("-"),t,r;if(n!==-1)return t=this.node.id.substr(n+1),r=i.getSeatById(t),i.SeatingControl.ns._longPressTimer=window.setTimeout(function(){r.onClick()},i.SeatingControl.ns.__longPressEventMilliseconds),!1}),p.touchend(function(){return clearTimeout(i.SeatingControl.ns._longPressTimer),!1}),p.click(function(n){var t,r,u;(n.type==="touchstart"||n.type==="touchend")&&(n.stopPropagation(),n.preventDefault());t=this.node.id.indexOf("-");t!==-1&&(r=this.node.id.substr(t+1),u=i.getSeatById(r),u.onClick())})),v.hideBusy(),g=p.getBBox(),d=paper.text(50,75,n.RowName+v.SeatNumber),d.attr({textAnchor:"middle",alignmentBaseline:"middle",fontSize:25,display:"none"}),d.addClass("seat-icon-number"),d.appendTo(v.getSeatSvgSymbolGroup()),i.SeatingControl.Settings.showAvailability||v.isSelected()?v.updateIcon():v.updateIconToAllocated());t++});c++});i.SeatingControl.Settings.enableSeatSelection&&i.updateSeatingGrid(t,i.SeatingControl.Settings.isForceAutoAssignedSeatingAsBlock);switch(i.Orientation.PitchDirection){case 0:paper.polygon(r,u-i.SeatPixelSize,e/2,u-i.SeatPixelSize*3,e-r,u-i.SeatPixelSize).attr({fill:"#888"}).addClass("pointer").click(function(){i.hideSeatingGrid()});paper.text(e/2,u-i.SeatPixelSize/.5,i.ns.Strings.TowardsPitch.format(i.SeatingControl.Settings.pitchDescription)).attr({textAnchor:"middle",alignmentBaseline:"middle",fill:"#eee",fontSize:i.SeatPixelSize*.6}).addClass("no-pointer-events");i.Orientation.LeftSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.LeftSideSectionId,r,u,3);i.Orientation.RightSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.RightSideSectionId,r,u,1);break;case 2:paper.polygon(r,f-u+i.SeatPixelSize,e/2,f-u+i.SeatPixelSize*3,e-r,f-u+i.SeatPixelSize).attr({fill:"#888"}).addClass("pointer").click(function(){i.hideSeatingGrid()});paper.text(e/2,f-u+i.SeatPixelSize*2,i.ns.Strings.TowardsPitch.format(i.SeatingControl.Settings.pitchDescription)).attr({textAnchor:"middle",alignmentBaseline:"middle",fill:"#eee",fontSize:i.SeatPixelSize*.6}).addClass("no-pointer-events");i.Orientation.RightSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.RightSideSectionId,r,u,3);i.Orientation.LeftSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.LeftSideSectionId,r,u,1);break;case 1:paper.polygon(e-r+i.SeatPixelSize,u,e-r+i.SeatPixelSize*3,f/2,e-r+i.SeatPixelSize,f-u).attr({fill:"#888"}).addClass("pointer").click(function(){i.hideSeatingGrid()});paper.text(e-(r-i.SeatPixelSize/1.5),f/2,i.ns.Strings.TowardsPitch.format(i.SeatingControl.Settings.pitchDescription)).attr({textAnchor:"middle",alignmentBaseline:"middle",fill:"#eee",fontSize:i.SeatPixelSize*.6}).transform("r-90,"+(e-(r-i.SeatPixelSize/1.5))+","+f/2).addClass("no-pointer-events");i.Orientation.RightSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.RightSideSectionId,r,u,2);i.Orientation.LeftSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.LeftSideSectionId,r,u,0);break;case 3:paper.polygon(r-i.SeatPixelSize,u,r-i.SeatPixelSize*3,f/2,r-i.SeatPixelSize,f-u).attr({fill:"#888"}).addClass("pointer").click(function(){i.hideSeatingGrid()});paper.text(r-i.SeatPixelSize/.6,f/2,i.ns.Strings.TowardsPitch.format(i.SeatingControl.Settings.pitchDescription)).attr({textAnchor:"middle",alignmentBaseline:"middle",fill:"#eee",fontSize:i.SeatPixelSize*.6}).transform("r90,"+(r-i.SeatPixelSize/.6)+","+f/2).addClass("no-pointer-events");i.Orientation.LeftSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.LeftSideSectionId,r,u,2);i.Orientation.RightSideSectionId&&i.drawAdjacentSectionOverlayLink(i.Orientation.RightSideSectionId,r,u,0)}i.showSectionOverlayUI({complete:function(){i.SeatingControl.Settings.enableSvgZoom&&(i.SeatingControl.seatingGridPanZoom=svgPanZoom("#SeatingGridSvg-"+i.SeatingControl.venueGroupId,{panEnabled:i.SeatingControl.Settings.enableSvgZoom,controlIconsEnabled:!1,zoomEnabled:i.SeatingControl.Settings.enableSvgZoom,dblClickZoomEnabled:!1,mouseWheelZoomEnabled:i.SeatingControl.Settings.enableSvgZoom,preventMouseEventsDefault:!0,zoomScaleSensitivity:.2,minZoom:1,maxZoom:10,zoom:.9,fit:!0,center:!0,refreshRate:"auto",beforePan:n.SeatingUI.limitPan,customEventsHandler:n.SeatingUI.touchEventsHandler,onZoom:i.hideOrShowSeatLabels}));i.SeatingControl.hideVenueUI()}})}i.SeatingControl.currentSectionOverlay=i;i.SeatingControl.updateControlHeading();i.SeatingControl.populateFooterContent();$(window).trigger("sportsubsEvent_seatingSelector_showSeatingGrid")},hideSeatingGrid:function(){var t=this,i=t.SeatingControl.seatingGridSvgPaper;t.SeatingControl.Settings.enableSvgZoom&&t.SeatingControl.seatingGridPanZoom;t.SeatingControl.Settings.enableBackgroundStatusUpdate===!0&&t.stopBackgroundStatusUpdate();t.SeatingControl.resetDetailsPanel(1);t.hideSectionOverlayUI({complete:function(){if(t.SeatingControl.currentSectionOverlay=null,t.SeatingControl.showVenueUI(),t.SeatingControl.Settings.enableSvgZoom&&t.SeatingControl.seatingGridPanZoom)try{t.SeatingControl.seatingGridPanZoom.destroy()}catch(i){n.handleError(i)}t.SeatingControl.updateControlHeading();t.SeatingControl.populateFooterContent();t.SeatingControl.updateSectionOverlaysWithCurrentAvailability();t.SeatingControl.hideBusy();var r=parseInt($(".active-person").first().attr("data-overlay-id"));t.SeatingControl.highlightSelectedSeatingSectionOverlays([r]);t.SeatingControl.Settings.enableVenueBackgroundStatusUpdate===!0&&t.SeatingControl.startBackgroundStatusUpdate();t.SeatingControl.Settings.highlightSelectedOverlays&&t.SeatingControl.Settings.selectedOverlayIds&&t.SeatingControl.Settings.selectedOverlayIds.length>0&&t.SeatingControl.highlightSelectedSeatingSectionOverlays(t.SeatingControl.Settings.selectedOverlayIds)}});$(window).trigger("sportsubsEvent_seatingSelector_hideSeatingGrid")},hideOrShowSeatLabels:function(n){var t=this;t.isShowingSeatLabels===!0&&n<1.75?(t.isShowingSeatLabels=!1,$(".seat-icon-number").fadeOut()):!t.isShowingSeatLabels&&n>=1.75&&(t.isShowingSeatLabels=!0,$(".seat-icon-number").fadeIn())},drawAdjacentSectionOverlayLink:function(n,t,i,r){var u=this,p=u.SeatingControl.seatingGridSvgPaper,f=u.SeatingControl.$seatingGridSvgElement.width(),e=u.SeatingControl.$seatingGridSvgElement.height(),s,h,c,l,a,v,y,o=_.find(u.SeatingControl.SectionOverlays,{VenueSectionId:n});if(o&&o.isSeatedSectionOverlay()&&o.isAllowedForCategories()){switch(r){case 0:s=t;h=i;c=f/2;l=i-u.SeatPixelSize*2;a=f-t;v=i;lx=f/2;ly=i-u.SeatPixelSize;break;case 1:s=f-t;h=i;c=f-t+u.SeatPixelSize*2;l=e/2;a=f-t;v=e-i;lx=f-t+u.SeatPixelSize;ly=e/2;y=90;break;case 2:s=t;h=e-i;c=f/2;l=e-i+u.SeatPixelSize*2;a=f-t;v=e-i;lx=f/2;ly=e-i+u.SeatPixelSize;break;case 3:s=t;h=i;c=t-u.SeatPixelSize*2;l=e/2;a=t;v=e-i;lx=t-u.SeatPixelSize;ly=e/2;y=-90}var k=p.polygon(s,h,c,l,a,v).attr({fill:"#ddd"}).addClass("pointer").click(function(){o.SeatingControl.showBusy();o.getAvailabilityForSeatingGrid()}),w=o.OverlayDescription!=""?o.OverlayDescription:o.Name,b=p.text(lx,ly,w).attr({textAnchor:"middle",alignmentBaseline:"middle",fill:"#888",fontSize:u.SeatPixelSize*.6}).addClass("no-pointer-events");y&&b.transform("r"+y+","+lx+","+ly)}},showSectionOverlayUI:function(n){_.isNil(n)&&(n={});(this.SeatingControl.Settings.showAvailability||this.SeatingControl.Settings.isShowingSelectedSeats||this.SeatingControl.Settings.enableSectionSelection)&&(this.SeatingControl.showBusy(),this.SeatingControl.$containerElement.closest(".seating-manager-panel").find(".seating-grid-group").each(function(t){$(this).fadeIn(t===0?n:{})}))},hideSectionOverlayUI:function(n){_.isNil(n)&&(n={});(this.SeatingControl.Settings.showAvailability||this.SeatingControl.Settings.isShowingSelectedSeats||this.SeatingControl.Settings.enableSectionSelection)&&(this.SeatingControl.showBusy(),this.SeatingControl.$containerElement.closest(".seating-manager-panel").find(".seating-grid-group").each(function(t){$(this).fadeOut(t===0?n:{})}))},firstSeatPositioninRow:function(n){var t=this;return Math.max(0,_.findIndex(n,function(n){return n.SeatTypeId!==t.SeatingControl.SeatTypes.NoSeat}))},lastSeatPositioninRow:function(n){var t=this;return _.findLastIndex(n,function(n){return n.SeatTypeId!==t.SeatingControl.SeatTypes.NoSeat})}},t}(),Seat:function(){var t=function(t,i,r,u,f,e,o,s,h,c,l,a){this.Id=t;this.SeatTypeId=i;this.SeatNumber=r;this.SeatName=a+r;this.Attributes=u;this.MediaItems=f;this.DisplayRow=o;this.GridRow=e;this.GridColumn=s;this.SectionId=h;this.Availability=c;this.seatHoverTimeout=null;this.SectionOverlay=l;this.ns=n.SeatingUI;this.multiSeatSeatingIds=[]};return t.prototype={isWheelchair:function(){return this.seatTypeId===this.SectionOverlay.SeatingControl.SeatTypes.WheelchairBay},isCarer:function(){return this.seatTypeId===this.SectionOverlay.SeatingControl.SeatTypes.CarerSeat},isStandardSeat:function(){return this.seatTypeId===this.SectionOverlay.SeatingControl.SeatTypes.StandardSeat},isEmptySpace:function(){return this.seatTypeId===this.SectionOverlay.SeatingControl.SeatTypes.NoSeat},isReservedForSeason:function(){var n=this.matchStatus([0]);return!(n===this.SectionOverlay.SeatingControl.SeatStatuses.Unallocated)},isReservedForCurrentMatchId:function(){var n=this.matchStatus([this.SectionOverlay.SeatingControl.currentMatchId]);return!(n===this.SectionOverlay.SeatingControl.SeatStatuses.Unallocated)},isPartiallyReserved:function(){var n=this.matchStatus(this.SectionOverlay.SeatingControl.currentProductMatchIds);return!(n===this.SectionOverlay.SeatingControl.SeatStatuses.Unallocated)},isAvailableForSeason:function(){var n=this.matchStatus([0]);return n===this.SectionOverlay.SeatingControl.SeatStatuses.Unallocated},isAvailableForAllProductMatches:function(){var n=this,t=!0,i=_.filter(n.Availability,function(t){return t.MatchId>0&&_.includes(n.SectionOverlay.SeatingControl.currentProductMatchIds,t.MatchId)}),r=_.map(i,"CurrentStatusId");return _.some(r,function(n){return n!==0&&n!==100&&n!==101})&&(t=!1),t},isBlocked:function(){var n=this.matchStatus([this.SectionOverlay.SeatingControl.currentMatchId]);return n===this.SectionOverlay.SeatingControl.SeatStatuses.Blocked},isSelected:function(){var n=!1,t=this.SectionOverlay.SeatingControl.Settings.selectedSeatingIds,i;return t.length>0&&(i=this.getSeatingId(),n=_.includes(t,i)),n},isSelectedByActivePerson:function(){var n=!1,t=this.SectionOverlay.SeatingControl.currentActivePerson;return _.isNil(t)||(n=this===this.SectionOverlay.getSeatBySeatingId(t.seatingId)),n},allProductMatchStatus:function(){var n=this,r=n.SectionOverlay.SeatingControl.SeatStatuses.Unallocated,t=n.SectionOverlay.SeatingControl.SeatStatuses.Unallocated,u=_.find(n.Availability,{MatchId:0}),f,i;return _.isNil(u)||(r=u.CurrentStatusId),f=_.filter(n.Availability,function(t){return t.MatchId>0&&_.includes(n.SectionOverlay.SeatingControl.currentProductMatchIds,t.MatchId)}),i=_.map(f,"CurrentStatusId"),_.some(i,function(n){return n!==0})&&(t=n.SectionOverlay.SeatingControl.SeatStatuses.PartiallyAllocated),_.every(i,function(n){return n!==0})&&(t=n.SectionOverlay.SeatingControl.SeatStatuses.Allocated),Math.max(r,t)},matchStatus:function(n){var t=this,h=!1,i=t.SectionOverlay.SeatingControl.SeatStatuses.Blocked,f=_.pull(n,0),s,e,u;if(!_.isNil(f)&&f.length>0){var o=_.filter(t.Availability,function(n){return _.includes(f,n.MatchId)&&n.SeatingCategoryId===t.SectionOverlay.SeatingCategoryId}),r=_.map(o,"CurrentStatusId"),c=_.map(o,"MatchId");if(_.difference(c,f).length!==0&&(h=!0),!_.isNil(r)&&r.length>0)i=t.SectionOverlay.SeatingControl.SeatStatuses.Unallocated,_.some(r,function(n){return n!==0})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.PartiallyAllocated),_.every(r,function(n){return n!==0&&n})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.Allocated),_.every(r,function(n){return n===8})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.Blocked),_.every(r,function(n){return n===100})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.NotInOverlay),_.every(r,function(n){return n===101})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.InValidForGroupSeating);else if(t.SectionOverlay.SeatingControl.currentMatchId!==0)for(s in f)t.Availability.push({MatchId:f[s],CurrentStatusId:8,SeatingCategoryId:t.SectionOverlay.SeatingCategoryId,SeatingId:t.SeatingId})}else i=t.SectionOverlay.SeatingControl.SeatStatuses.Unallocated;return e=_.find(t.Availability,{MatchId:0}),e?(e.CurrentStatusId!==t.SectionOverlay.SeatingControl.SeatStatuses.Unallocated&&e.CurrentStatusId!==t.SectionOverlay.SeatingControl.SeatStatuses.InValidForGroupSeating&&e.CurrentStatusId!==t.SectionOverlay.SeatingControl.SeatStatuses.NotInOverlay&&(i=e.CurrentStatusId),t.SectionOverlay.SeatingControl.currentMatchId===0&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.Unallocated,u=_.map(t.Availability,"CurrentStatusId"),_.some(u,function(n){return n!==0})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.PartiallyAllocated),_.every(u,function(n){return n!==0})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.Allocated),_.every(u,function(n){return n===100})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.NotInOverlay),_.every(u,function(n){return n===101})&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.InValidForGroupSeating),!_.isNil(u)&&u.length<t.SectionOverlay.SeatingControl.Settings.matches.length&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.PartiallyAllocated))):(n.length===0||n===[0])&&(i=t.SectionOverlay.SeatingControl.SeatStatuses.Blocked),i},getSeatingId:function(n){var i=0,r=this,t;return _.isUndefined(n)&&(n=r.SectionOverlay.SeatingControl.currentMatchId),t=_.find(r.Availability,{MatchId:parseInt(n)}),_.isUndefined(t)||(i=t.SeatingId),parseInt(i)},getSeatSvg:function(){return this.SectionOverlay.SeatingControl.seatingGridSvgPaper.select("#seat-"+this.Id)},getSeatSvgBackground:function(){return this.SectionOverlay.SeatingControl.seatingGridSvgPaper.select("#seatBg-"+this.Id)},getSeatSvgSymbolGroup:function(){return this.SectionOverlay.SeatingControl.seatingGridSvgPaper.select("#seatSymbol-"+this.Id)},getSeatSvgSymbol:function(){return this.SectionOverlay.SeatingControl.seatingGridSvgPaper.select("#symbol-"+this.Id)},getSeatSvgBusy:function(){return this.SectionOverlay.SeatingControl.seatingGridSvgPaper.select("#busy-"+this.Id)},showBusy:function(){var i=this.getSeatSvgSymbol(),t,n;i&&(i.addClass("SeatingControl-busy-icon"),i.attr({opacity:0}));t=this.getSeatSvgBusy();t&&(n=t.getBBox(),t.transform("r0,"+n.cx+","+n.cy).attr({opacity:1}).animate({transform:"r3600,"+n.cx+","+n.cy},1e4,mina.ease))},hideBusy:function(){var n=this.getSeatSvgSymbol(),t;n&&(n.removeClass("SeatingControl-busy-icon"),n.attr({opacity:1}));t=this.getSeatSvgBusy();t&&t.attr({opacity:0})},resetIcon:function(){var n=this,f=n.SectionOverlay.SeatingControl,t=f.SeatCssClasses.join(" "),i=n.getSeatSvg(),r=n.getSeatSvgBackground(),u=n.getSeatSvgSymbolGroup();r&&r.removeClass(t);u&&u.removeClass(t);i&&i.removeClass("pointer")},updateIconToAllocated:function(){var n=this,f=n.SectionOverlay.SeatingControl,t=f.SeatCssClasses.join(" "),i=n.getSeatSvg(),r=n.getSeatSvgBackground(),u=n.getSeatSvgSymbolGroup();r&&r.removeClass(t).addClass("SeatingControl-seat-allocated-color");u&&u.removeClass(t).addClass("SeatingControl-seat-symbol-allocated-color");i&&i.removeClass("pointer")},updateIcon:function(){var r=this,i=r.SectionOverlay.SeatingControl,u=i.SeatCssClasses.join(" "),o=i.combineAllMatches?r.matchStatus(i.currentProductMatchIds):r.matchStatus([i.currentMatchId]),f=r.getSeatSvg(),n=r.getSeatSvgBackground(),t=r.getSeatSvgSymbolGroup(),e=r.isSelected();switch(o){case i.SeatStatuses.Unallocated:n&&n.removeClass(u).addClass("SeatingControl-seat-unallocated-color");t&&t.removeClass(u).addClass("SeatingControl-seat-symbol-unallocated-color");f&&f.addClass("pointer");break;case i.SeatStatuses.PartiallyAllocated:n&&n.removeClass(u).addClass("SeatingControl-seat-partially-allocated-color");t&&t.removeClass(u).addClass("SeatingControl-seat-symbol-partially-allocated-color");f&&f.addClass("pointer");break;case i.SeatStatuses.NotInOverlay:n&&n.removeClass(u).addClass("SeatingControl-seat-not-present-color");t&&t.removeClass(u).addClass("SeatingControl-seat-symbol-not-present-color");f&&f.removeClass("pointer");break;case i.SeatStatuses.InValidForGroupSeating:n&&n.removeClass(u).addClass("SeatingControl-seat-invalid-for-group-color");t&&t.removeClass(u).addClass("SeatingControl-seat-symbol-invalid-for-group-color");f&&f.removeClass("pointer");break;default:n&&n.removeClass(u).addClass("SeatingControl-seat-allocated-color");t&&t.removeClass(u).addClass("SeatingControl-seat-symbol-allocated-color");f&&f.removeClass("pointer")}i.Settings.highlightBlockedSeats&&(r.isBlocked()?(n&&n.addClass("SeatingControl-seat-blocked-color"),t&&t.addClass("SeatingControl-seat-symbol-blocked-color")):(n&&n.removeClass("SeatingControl-seat-blocked-color"),t&&t.removeClass("SeatingControl-seat-symbol-blocked-color")));n&&(e?n.addClass("SeatingControl-seat-selected-color"):n.removeClass("SeatingControl-seat-selected-color"),i.Settings.highlightBlockedSeats&&r.isBlocked()&&(n?n.addClass("SeatingControl-seat-blocked-color"):n.removeClass("SeatingControl-seat-blocked-color")),r.isSelectedByActivePerson()?(allSeats=i.seatingGridSvgPaper.selectAll(".active-person-seat"),allSeats.forEach(function(n){Snap(n).removeClass("active-person-seat")}),n.addClass("active-person-seat")):n.removeClass("active-person-seat"));t&&(e?t.addClass("SeatingControl-seat-symbol-selected-color"):t.removeClass("SeatingControl-seat-symbol-selected-color"))},onClick:function(){var t=this,i,r,u;t.isUpdating||(t.isUpdating=!0,setTimeout(function(){t.isUpdating=!1},t.ns._seatDebounceMilliseconds),i=t.SectionOverlay.SeatingControl.$containerElement.closest(".seating-manager-panel"),i&&(t.isSelected&&(r=i.find('[data-seating-id="'+t.getSeatingId(t.SectionOverlay.SeatingControl.currentMatchId)+'"]'),r.length===1&&t.ns.setActivePerson(r)),u=i.find(".active-person"),u.length===1?u.data("isBestSeat")&&!t.SectionOverlay.SeatingControl.Settings.isAutoAssignedSeatingMoveable?n.alert(t.SectionOverlay.ns.Strings.AlertAutoAssignedNotMoveable):_.isNil(t.ns._currentUpdateTask)&&(t.SectionOverlay.SeatingControl.Settings.enableSeatSelection&&(t.multiSeatSeatingIds.length!==0||!t.isReservedForCurrentMatchId())?t.confirmIfDisabledFacilities():t.SectionOverlay.SeatingControl.Settings.enableSeatSelection&&t.isReservedForCurrentMatchId()&&t.isSelected()):n.alert(t.SectionOverlay.ns.Strings.AlertSelectionUnavailable)))},onHover:function(){var n=this,i=n.getSeatInformation(),t;(n.SectionOverlay.SeatingControl.Settings.showAvailability||n.isSelected())&&n.SectionOverlay.SeatingControl.populateAndShowDetailsPanel(i);n.SectionOverlay.SeatingControl.resetDetailsPanel(n.ns._seatInfoPanelAutoHideMilliseconds);n.SectionOverlay.SeatingControl.Settings.enableSeatSelection&&(!n.isReservedForCurrentMatchId()||n.isReservedForCurrentMatchId()&&n.isSelected())&&(t=n.getSeatSvgBackground(),_.isNil(n.seatHoverTimeout)||clearTimeout(n.seatHoverTimeout),t&&(t.addClass("SeatingControl-seat-highlight-color"),n.seatHoverTimeout=setTimeout(function(){t.removeClass("SeatingControl-seat-highlight-color")},n.SectionOverlay.ns._seatHoverTimeoutMiliseconds)))},offHover:function(){var n=this,t;n.SectionOverlay.SeatingControl.resetDetailsPanel(n.ns._seatInfoPanelAutoHideMilliseconds);n.SectionOverlay.SeatingControl.Settings.enableSeatSelection&&(t=n.getSeatSvgBackground(),_.isNil(n.seatHoverTimeout)||clearTimeout(n.seatHoverTimeout),t&&t.removeClass("SeatingControl-seat-highlight-color"))},selectSeat:function(t){var i=this,f=i.getSeatingId(t),r=i.getSeatSvgBackground(),u=i.getSeatSvgSymbolGroup();i.SectionOverlay.SeatingControl.Settings.selectedSeatingIds=_.union(i.SectionOverlay.SeatingControl.Settings.selectedSeatingIds,[f]);r&&r.addClass("SeatingControl-seat-selected-color");u&&u.addClass("SeatingControl-seat-symbol-selected-color");i.updateMatchStatus(t,i.SectionOverlay.SeatingControl.SeatStatuses.Allocated);n.debugMessage("Selected SeatingIds:","info");n.debugMessage(i.SectionOverlay.SeatingControl.Settings.selectedSeatingIds,"info")},unSelectSeat:function(n){var t=this,u=t.getSeatingId(n),i=t.getSeatSvgBackground(),r=t.getSeatSvgSymbolGroup();_.pull(t.SectionOverlay.SeatingControl.Settings.selectedSeatingIds,u);i&&(i.removeClass("SeatingControl-seat-selected-color"),i.removeClass("active-person-seat"));r&&r.removeClass("SeatingControl-seat-symbol-selected-color");t.updateMatchStatus(n,t.SectionOverlay.SeatingControl.SeatStatuses.Unallocated)},confirmIfMultipleSeats:function(){var n=this,r,t,i;n.SectionOverlay.SeatingControl.combineAllMatches&&!n.isAvailableForAllProductMatches()?(r=n.multiSeatSeatingIds.length!==0?"<b>{0}<\/b><br/>{1} {2}".format(n.ns.Strings.MultipleMatchChangeSeatsTitle,n.ns.Strings.MultipleMatchChangeSeatsInfo,n.SeatName):"<b>{0}<\/b><br/>{1}".format(n.ns.Strings.MultipleMatchSelectSeatsTitle,n.ns.Strings.MultipleMatchSelectSeatsInfo),t=[],_.isNil(n.Availability)||n.Availability.forEach(function(r){if(_.includes(n.SectionOverlay.SeatingControl.currentProductMatchIds,r.MatchId)&&(i=_.find(n.SectionOverlay.SeatingControl.Settings.matches,{Id:r.MatchId}),!_.isNil(i))){var u=r.CurrentStatusId===n.SectionOverlay.SeatingControl.SeatStatuses.Unallocated?'<span class="label label-success">{0}<\/span>'.format(n.ns.Strings.Available):'<span class="label label-danger">{0}<\/span>'.format(n.ns.Strings.NotAvailable);_.includes(n.multiSeatSeatingIds,r.SeatingId)&&(u='<span class="label label-info">{0}<\/span>'.format(n.ns.Strings.AlreadySelected));t.push({text:"{0} {1}".format(u,i.NameWithDate()),value:r.MatchId,checked:!0,disabled:!(r.CurrentStatusId===n.SectionOverlay.SeatingControl.SeatStatuses.Unallocated),date:i.Date})}}),t=_.sortBy(t,"date"),bootbox.prompt({title:r,inputType:"checkbox",inputOptions:t,buttons:{confirm:{label:n.ns.Strings.MultipleMatchOk,className:"btn-success"},cancel:{label:n.ns.Strings.MultipleMatchCancel,className:"btn-danger"}},callback:function(t){if(t){var r=n.SectionOverlay.SeatingControl.getControlPanelElement(),u=r.find(".active-person").first(),f=u.closest(".product-group"),i=f.find(".all-matches-checkbox");i.length===1&&i.prop("checked")&&(i.prop("checked",!1),i.trigger("change"));n.reserveSeat(t)}}})):n.reserveSeat()},confirmIfDisabledFacilities:function(){var n=this,t;n.SeatTypeId===n.SectionOverlay.SeatingControl.SeatTypes.WheelchairBay||n.SeatTypeId===n.SectionOverlay.SeatingControl.SeatTypes.CarerSeat?(t=n.SeatTypeId===n.SectionOverlay.SeatingControl.SeatTypes.WheelchairBay?n.ns.Strings.WheelChairInfo:n.ns.Strings.CarerInfo,bootbox.confirm({size:"small",message:t,buttons:{confirm:{label:n.ns.Strings.ReserveSeatOK,className:"btn-success"},cancel:{label:n.ns.Strings.ReserveSeatCancel,className:"btn-danger"}},callback:function(t){t&&n.confirmIfMultipleSeats()}})):n.confirmIfMultipleSeats()},reserveSeat:function(t){var i=this,r,u;if(_.isUndefined(t)&&(t=null),i.SectionOverlay.SeatingControl.Settings.isForceAutoAssignedSeatingAsBlock){if(r=i.SectionOverlay.SeatingControl.Settings.numberOfSeatsRequired,(_.isNil(r)||r<1)&&(r=1),t=i.createSeatUnit(r),_.isNil(t)||t.length<r){i.SectionOverlay.SeatingControl.showInfoFlashMessage("danger","Failed to allocate block of seats",4e3);n.debugMessage("reserveSeat() - enforce block","info");n.debugMessage(t,"info");return}}else t=[i];if(u=i.SectionOverlay.SeatingControl.Settings.isForceAutoAssignedSeatingAsBlock?i.SectionOverlay.SeatingControl.Settings.numberOfSeatsRequired:1,i.SectionOverlay.SeatingControl.Settings.enforceNoSingleSeats&&i.reservationCreatesSingletonNeighbour(u)){i.SectionOverlay.SeatingControl.showInfoFlashMessage("warning","Seat selections must not leave single empty seats",4e3);return}n.debugMessage("reserveSeat()","info");n.debugMessage(t,"info");i.SectionOverlay.SeatingControl.ns.reserveSeat(t)},unreserveSeat:function(){var t=this;n.debugMessage("unreserveSeat()","info");t.SectionOverlay.SeatingControl.ns.unreserveSeat(t)},updateMatchStatus:function(n,t){var i=this,r=_.findIndex(i.Availability,{MatchId:n});r!==-1&&(i.Availability[r].CurrentStatusId=t)},getSeatInformation:function(){var n=this,t,i="",u=n.SectionOverlay.OverlayDescription!=""?n.SectionOverlay.OverlayDescription:n.SectionOverlay.Name,r,f;switch(n.SeatTypeId){case 1:i='<b>Section {0}:<\/b> <i class="fa fa-user left-space" aria-hidden="true"><\/i>{1} ({2})'.format(u,n.SeatName,n.ns.Strings.StandardSeat);break;case 2:i='<b>Section {0}:<\/b> <i class="fa fa-wheelchair left-space" aria-hidden="true"><\/i>{1} ({2})'.format(u,n.SeatName,n.ns.Strings.WheelchairBay);break;case 3:i='<b>Section {0}:<\/b> <i class="fa fa-heart left-space" aria-hidden="true"><\/i>{1} ({2})'.format(u,n.SeatName,n.ns.Strings.CarerSeat)}return r='<div class="SeatingControl-seat-availability">',_.isNil(n.Availability)||n.Availability.forEach(function(i){if((n.SectionOverlay.SeatingControl.combineAllMatches&&_.includes(n.SectionOverlay.SeatingControl.currentProductMatchIds,i.MatchId)||!n.SectionOverlay.SeatingControl.combineAllMatches&&n.SectionOverlay.SeatingControl.currentMatchId===i.MatchId)&&(t=_.find(n.SectionOverlay.SeatingControl.Settings.matches,{Id:i.MatchId}),!_.isNil(t)||n.SectionOverlay.SeatingControl.currentMatchId===0)){f=n.isSelected()?'<span class="SeatingControl-seat-selected-message"><i class="fa fa-check-circle"><\/i> {0}'.format(n.ns.Strings.AvailabilityInfoReserved):i.CurrentStatusId===0&&!n.isReservedForSeason()?'<span class="SeatingControl-seat-available-message"><i class="fa fa-check-circle"><\/i> {0}'.format(n.ns.Strings.Available):'<span class="SeatingControl-seat-not-available-message"><i class="fa fa-exclamation-circle"><\/i> {0}'.format(n.ns.Strings.NotAvailable);var u="";$("html").hasClass("touch")&&(u='<span class="mobile-seat-select-hint">{0}<\/span>'.format(n.isSelected()?n.ns.Strings.PressToUnselect:n.ns.Strings.PressToSelect));r+="{0} {1} {2}<\/span><br/>".format(f,n.SectionOverlay.SeatingControl.currentMatchId===0?n.ns.Strings.AvailabilityInfoForSeason:" for {0}: {1}".format(t.Round,t.AwayTeam),u)}}),r+="<\/div>",i+r},reservationCreatesSingletonNeighbour:function(n){var s=this;_.isNil(n)&&(n=1);var h=s.GridRow,e=null,t=null,o=null,i=null,r=!1,c=s.SectionOverlay.seatsInSection(),u=_.filter(c,{GridRow:h}),l=_.minBy(u,"GridColumn"),a=_.maxBy(u,"GridColumn"),f=s.GridColumn;return f>=l.GridColumn&&(e=_.find(u,{GridColumn:f-n,SeatTypeId:1}),t=_.find(u,{GridColumn:f-(n+1),SeatTypeId:1})),f<=a.GridColumn&&(o=_.find(u,{GridColumn:f+n,SeatTypeId:1}),i=_.find(u,{GridColumn:f+(n+1),SeatTypeId:1})),_.isNil(e)||(e.isAvailableForAllProductMatches()?!_.isUndefined(t)&&(t.isAvailableForAllProductMatches()||t.isSelectedByActivePerson())||(r=!0):e.isSelectedByActivePerson()&&(_.isUndefined(t)||!t.isAvailableForAllProductMatches())&&(r=!0)),r||_.isNil(o)||(o.isAvailableForAllProductMatches()?!_.isUndefined(i)&&(i.isAvailableForAllProductMatches()||i.isSelectedByActivePerson())||(r=!0):o.isSelectedByActivePerson()&&(_.isUndefined(i)||!i.isAvailableForAllProductMatches())&&(r=!0)),r},addHighlight:function(){var n=this.getSeatSvgBackground();_.isNil(n)||(_.isNil(this.seatHoverTimeout)||clearTimeout(this.seatHoverTimeout),n.addClass("SeatingControl-seat-highlight-color"))},removeHighlight:function(){var n=this.getSeatSvgBackground();_.isNil(n)||(_.isNil(this.seatHoverTimeout)||clearTimeout(this.seatHoverTimeout),n.removeClass("SeatingControl-seat-highlight-color"))},addGroupHighlight:function(){var n=this.getSeatSvgBackground();_.isNil(n)||n.addClass("SeatingControl-seat-group-highlight-color")},removeGroupHighlight:function(){var n=this.getSeatSvgBackground();_.isNil(n)||n.removeClass("SeatingControl-seat-group-highlight-color")},createSeatUnit:function(n){var t=this,r=t.SectionOverlay.seatsInSection(),i;return _.forEach(r,function(n){n.removeGroupHighlight()}),i=t.SectionOverlay.getContiguousSeatsInRow(t.GridRow,n,t.SectionOverlay.SeatingControl.Settings.seatingBlockCanSpanAisle,t.SectionOverlay.SeatingControl.Settings.seatingBlockCanSpanNoSeatsSpaces),(_.isNil(i)||i.length<n)&&(i=null),i}},t}(),drawVenueSeatingArea:function(n){var r=this,i=r.venueSvgPaper,t=null;if(i)return _.isNil(n.NonRectangleDataPath)||n.NonRectangleDataPath===""?_.isNil(n.RectangleCoordinates)||(t=i.rect(n.RectangleCoordinates.X,n.RectangleCoordinates.Y,n.RectangleCoordinates.Width,n.RectangleCoordinates.Height)):t=i.path(n.NonRectangleDataPath),_.isNull(r.sectionShape)||t.attr({id:"SectionArea-"+n.SectionId}).addClass("SeatingControl-section-area"),t},resizeTimer:null,returnClickOrTouchPoint:function(n){var i=n.originalEvent&&n.originalEvent.touches&&n.originalEvent.touches[0];n=i||n;var t=$(n.target).offset(),r=n.layerX-t.left,u=n.layerY-t.top;return{x:r,y:u}},hideOrShowMatchSelector:function(){var n=this;n.Settings.matches.length>0?(n.initMatchSelector(),n.Settings.matches.length<2&&n.hideMatchSelector(),n.Settings.matches.length===1&&(n.currentMatchId=n.Settings.matches[0].MatchId),n.Settings.showAvailability===!0&&(n.showBusy(),n.getAvailabilityForSectionOverlays(),n.hideBusy())):(n.currentMatchId=0,n.hideMatchSelector())},buildMatches:function(n){var t=this,i;t.Settings.matches=[];n&&(i=n,_.forEach(i,function(n){var i=new t.Match(n);t.Settings.matches.push(i)}),!t.Settings.enableFullSeason&&t.Settings.matches.length>1?(t.currentMatchId=t.Settings.matches[0].MatchId,t.$infoPanelElement.html($("<div/>",{html:t.getAvailabilityLabel(t.currentMatchId)}))):t.Settings.matches.length===1?(t.currentMatchId=t.Settings.matches[0].MatchId,t.$infoPanelElement.html($("<div/>",{html:t.getAvailabilityLabel(t.currentMatchId)}))):t.Settings.enableFullSeason&&(t.currentMatchId=0))},initMatchSelector:function(){var n=this;n.Settings.matches.length>0?(n.buildMatchSelector(),n.Settings.matches.length<2&&n.hideMatchSelector(),n.Settings.matches.length===1&&(n.currentMatchId=n.Settings.matches[0].Id),n.Settings.showAvailability===!0&&(n.showBusy(),n.getAvailabilityForSectionOverlays(),n.hideBusy())):(n.currentMatchId=0,n.hideMatchSelector())},buildMatchSelector:function(){var n=this,t,i;n.$matchSelectorElement.length===1&&(n.Settings.matches&&n.Settings.matches.length>1&&n.Settings.showMatchSelector?(t='<div class="form-group form-horizontal row"><label class="col-sm-3 control-label">{0}<\/label><div class="col-sm-9"><select class="form-control matchSelect">'.format(n.ns.Strings.SelectMatchLabel),i=n.currentMatchId===0?"selected":"",n.Settings.enableFullSeason&&(t+='<option value="0" {0}>{1}<\/option>'.format(i,n.ns.Strings.SelectSeasonText)),_.isNil(n.Settings.matches)||(i=!1,n.Settings.matches.forEach(function(r){i=n.currentMatchId===r.Id?"selected":"";t+='<option value="'+r.Id+'" '+i+">"+r.NameWithDate()+"<\/option>"})),t+="<\/select><\/div><\/div>",n.$matchSelectorElement.html(t),n.showMatchSelector(),n.$matchSelectorElement.find(".matchSelect").change(function(){$(this).hasClass("disabled")||n.selectMatchById(this.value)})):n.hideMatchSelector())},showMatchSelector:function(n){n?this.$matchSelectorElement.fadeIn(n):this.$matchSelectorElement.show()},hideMatchSelector:function(n){n?this.$matchSelectorElement.fadeOut(n):this.$matchSelectorElement.hide()},selectMatchById:function(n){var t=this,i,u,r,f;n>0?n!==t.currentMatchId&&(i=_.find(t.Settings.matches,{Id:parseInt(n)}),_.isNil(i)||(t.currentMatchId=i.Id,t.showBusy(),i.VenueId!==t.VenueId?_.isNil(t.currentSectionOverlay)?(t.setVenue(i.VenueId),t.drawVenue()):(t.setVenue(i.VenueId),t.drawVenue(),t.currentSectionOverlay.hideSeatingGrid(),t.currentSectionOverlay=null):(t.initialiseSectionOverlayObjects(i.SectionOverlays),t.addSectionOverlaysToGroup()),_.isNil(t.currentSectionOverlay)||(u=t.currentSectionOverlay.VenueSectionId,r=_.find(t.SectionOverlays,{VenueSectionId:u}),_.isNil(r)||r.getAvailabilityForSeatingGrid()))):t.currentMatchId=0;t.Settings.showCategoryList&&t.Settings.seatingCategories&&t.drawSeatingCategoryList();f=t.getAvailabilityLabel(t.currentMatchId);t.populateAndShowDetailsPanel(f);_.isNil(t.currentSectionOverlay)?t.getAvailabilityForSectionOverlays():t.currentSectionOverlay.refreshSeatStatusesForProductMatchIds()},selectMatch:function(n){var t=this,i=_.findIndex(t.Settings.matches,{Id:t.currentMatchId}),r;(t.currentMatchId===0&&t.Settings.enableFullSeason||i>-1)&&(i=i+n,i<0?(t.currentMatchId=t.Settings.enableFullSeason?0:t.Settings.matches[0].Id,t.$matchSelectorElement.find(".prevMatch").addClass("disabled"),t.$matchSelectorElement.find(".nextMatch").removeClass("disabled")):i>t.Settings.matches.length-1?(t.currentMatchId=t.Settings.matches[t.Settings.matches.length-1].Id,t.$matchSelectorElement.find(".prevMatch").removeClass("disabled"),t.$matchSelectorElement.find(".nextMatch").addClass("disabled")):(t.currentMatchId=t.Settings.matches[i].Id,t.$matchSelectorElement.find(".prevMatch,.nextMatch").removeClass("disabled")),r=t.getAvailabilityLabel(t.currentMatchId),t.populateAndShowDetailsPanel(r),_.isNil(t.currentSectionOverlay)?t.updateSectionOverlaysForCurrentMatchId():t.currentSectionOverlay.refreshSeatStatusesForProductMatchIds())},showCategoryList:function(){this.$categoryListElement.stop().fadeIn("fast")},hideCategoryList:function(){this.$categoryListElement.stop().fadeOut("fast")},showUpdating:function(){$(this.$containerElement).find(".SeatingControl-LiveUpdateStatus:hidden").fadeIn("fast");$(".seating-manager-panel").attr("disabled",!0)},hideUpdating:function(){$(this.$containerElement).find(".SeatingControl-LiveUpdateStatus:visible").fadeOut("fast");$(".seating-manager-panel").attr("disabled",!1)},showBusy:function(){$(this.$containerElement).find(".SeatingControl-BusyStatus:hidden").fadeIn("fast");$(".seating-manager-panel").attr("disabled",!0)},hideBusy:function(){$(this.$containerElement).find(".SeatingControl-BusyStatus:visible").fadeOut("fast");$(".seating-manager-panel").attr("disabled",!1)},updateControlHeading:function(){var i=this,u=i.getControlPanelElement(),o;if(u.length===1){var e=u.find(".product-group"),s=u.find(".seating-status-message"),r="";_.isNil(i.currentSectionOverlay)?r=n.isValueTrue(e.data("isRenewal"))?t.HeadingRenewalSection:i.Settings.isShowingSelectedSeats&&!i.Settings.enableSeatSelection?t.HeadingSelectedSection:i.Settings.enableSeatSelection?f(u)?t.HeadingModifyOrComplete:i.Settings.isForceAutoAssignedSeatingAsBlock&&i.Settings.numberOfSeatsRequired>1?t.HeadingSelectSeatBlock:t.HeadingSelectSeats:i.Settings.showAvailability?t.HeadingSectionAvailability:t.HeadingSeatingSections:n.isValueTrue(e.data("isRenewal"))?r=i.ns.Strings.HeadingRenewalSeats:i.Settings.isShowingSelectedSeats&&!i.Settings.enableSeatSelection?r=t.HeadingSelectedSeats:i.Settings.enableSeatSelection?r=f(u)?i.Settings.isForceAutoAssignedSeatingAsBlock&&i.Settings.numberOfSeatsRequired>1?t.HeadingModifyOrCompleteBlock:t.HeadingModifyOrCompleteSeats:i.Settings.isForceAutoAssignedSeatingAsBlock&&i.Settings.numberOfSeatsRequired>1?t.HeadingSelectSeatBlock:t.HeadingSelectSeats:i.Settings.showAvailability?(o=i.currentSectionOverlay.OverlayDescription!=""?i.currentSectionOverlay.OverlayDescription:i.currentSectionOverlay.Name,r=t.HeadingSectionSeatAvailability+" in "+o):r=t.HeadingSeatingSections;s.html('<div class="h3">{0}<\/h3>'.format(r))}},showFooterContent:function(){var n=this.getControlPanelElement();n.find(".SeatingControl-MapLegend:hidden").fadeIn("fast")},hideFooterContent:function(){var n=this.getControlPanelElement();n.find(".SeatingControl-MapLegend:visible").fadeOut("fast")},populateFooterContent:function(){var t=this.getControlPanelElement(),i=this.buildMapLegendMarkup(),n=t.find(".SeatingControl-MapLegend");n.length===1&&(n.html(i),this.showFooterContent())},buildMapLegendMarkup:function(){var t=$("<ul/>",{"class":"list-unstyled list-inline stadium-key"});return _.isNil(this.currentSectionOverlay)?(!_.isNil(this.Settings.selectedSeatingIds)&&this.Settings.selectedSeatingIds.length>0&&t.append('<li><span class="stadium-key-legend venue-section-selected-seats"><\/span> '+this.ns.Strings.YourSeats+"<\/li>"),n.isValueTrue(this.Settings.showAvailability)?(t.append('<li><span class="stadium-key-legend venue-section-available"><\/span> '+this.ns.Strings.Available+"<\/li>"),t.append('<li><span class="stadium-key-legend venue-section-sold-out"><\/span> '+this.ns.Strings.SoldOut+"<\/li>"),t.append('<li><span class="stadium-key-legend venue-section-disabled-facilities"><\/span> '+this.ns.Strings.DisabledFacilities+"<\/li>")):n.isValueTrue(this.Settings.highlightSeatedSections)&&t.append('<li><span class="stadium-key-legend venue-section-highlighted"><\/span> '+this.ns.Strings.ProductSeatingAreas+"<\/li>")):(!_.isNil(this.Settings.selectedSeatingIds)&&this.Settings.selectedSeatingIds.length>0&&t.append('<li><span class="stadium-key-legend seat-selected"><\/span> '+this.ns.Strings.YourSeats+"<\/li>"),n.isValueTrue(this.Settings.showAvailability)&&(t.append('<li><span class="stadium-key-legend seat-available"><\/span> '+this.ns.Strings.Available+"<\/li>"),!_.isNil(this.Settings.matchIds)&&this.Settings.matchIds.length>1&&t.append('<li><span class="stadium-key-legend seat-partially-available"><\/span> '+this.ns.Strings.PartialAvailable+"<\/li>"),t.append('<li><span class="stadium-key-legend seat-unavailable"><\/span> '+this.ns.Strings.NotAvailable+"<\/li>"))),t.prop("outerHTML")},showInfoFlashMessage:function(n,t,i){var f=this,u=f.getControlPanelElement(),r;u.length===1&&(isNaN(i)&&(i=2500),n===""&&(n="info"),r=u.find(".SeatingControl-AlertMessage"),r.finish().fadeOut("fast",function(){var u=r.html();r.html('<div class="alert alert-dismissible alert-{0}">{1}<\/div>'.format(n,t));r.fadeIn("fast").delay(i).fadeOut("fast",function(){r.html(u).fadeIn()})}))},getControlPanelElement:function(){return $(this.$UiWrapperElement).closest(".seating-manager-panel")}},r}(),w=function(n,t){var r=1,i=this.getSizes(),u=-((i.viewBox.x+i.viewBox.width)*i.realZoom)+i.viewBox.width*r,f=i.width-i.viewBox.width*r-i.viewBox.x*i.realZoom,e=-((i.viewBox.y+i.viewBox.height)*i.realZoom)+i.viewBox.height*r,o=i.height-i.viewBox.height*r-i.viewBox.y*i.realZoom;return{x:Math.max(u,Math.min(f,t.x)),y:Math.max(e,Math.min(o,t.y))}},b={haltEventListeners:["touchstart","touchend","touchmove","touchleave","touchcancel"],init:function(n){var t=n.instance,i=1,r=0,u=0;this.hammer=Hammer(n.svgElement,{inputClass:Hammer.SUPPORT_POINTER_EVENTS?Hammer.PointerEventInput:Hammer.TouchInput});this.hammer.get("pinch").set({enable:!0});this.hammer.on("doubletap",function(){t.zoomIn()});this.hammer.on("panstart panmove",function(n){n.type==="panstart"&&(r=0,u=0);t.panBy({x:n.deltaX-r,y:n.deltaY-u});r=n.deltaX;u=n.deltaY});this.hammer.on("pinchstart pinchmove",function(n){n.type==="pinchstart"&&(i=t.getZoom(),t.zoom(i*n.scale));t.zoom(i*n.scale)});n.svgElement.addEventListener("touchmove",function(n){n.preventDefault()})},destroy:function(){this.hammer.destroy()}},r=function(t){var u=null,i=$(t).closest(".seating-manager-panel"),r;return _.isNil(i)||i.length!==1||(r=parseInt(i.attr("data-control-index")),_.isInteger(r)?u=n.SeatingUI.SeatingControls[r]:n.debugMessage("Found .seating-manager-panel but missing venueIndex data attribute","warn")),u},k=function(t,i){var y,a;o=!0;_.each(t,function(n){n.showBusy()});var v=null,y=null,l=[],f=null,b=_.head(t),e=b.SectionOverlay,s=e.SeatingControl.currentProductMatchIds,c=e.SeatingControl.getControlPanelElement(),p=c.find(".active-person").first(),h=p.closest(".product-group"),k=h.data("cartItemGuid"),w=h.find(".all-matches-checkbox"),v=p.data("personCounter"),u=r(h);w.length!==1||w.prop("checked")||(s=[e.SeatingControl.currentMatchId]);_.isNil(i)||(s=[],i.forEach(function(n){s.push(parseInt(n))}));t.length===1?s.forEach(function(n){if(n=parseInt(n),seat=t[0],(s.length===1||s.length>1&&n!==0)&&(f=h.find('li[data-match-id="'+n+'"][data-person-counter="'+v+'"]'),f.length===1)){var i=e.getSeatBySeatingId(f.data("seatingId"));i&&i.unSelectSeat(n);l.push({ExistingSeatingId:f.data("seatingId"),ExistingTemporaryHoldId:f.data("temporaryHoldId"),SeatIndex:f.data("seatIndex"),NewSeatingId:seat.getSeatingId(n),Operation:f.data("temporaryHoldId")>0?"Transfer":"Reserve",MatchId:n,SectionId:seat.SectionId,CartItemGuid:f.data("cartItemGuid"),IsEntireSeason:n===0})}}):(y=c.find(".person"),a=0,s.forEach(function(n){if(n=parseInt(n),s.length===1||s.length>1&&n!==0){var i=y.filter('li[data-match-id="'+n+'"]');i.each(function(){f=$(this);seat=t[a];var i=e.getSeatBySeatingId(f.data("seatingId"));i&&i.unSelectSeat(n);l.push({ExistingSeatingId:f.data("seatingId"),ExistingTemporaryHoldId:f.data("temporaryHoldId"),SeatIndex:f.data("seatIndex"),NewSeatingId:seat.getSeatingId(n),Operation:f.data("temporaryHoldId")>0?"Transfer":"Reserve",MatchId:n,SectionId:seat.SectionId,CartItemGuid:f.data("cartItemGuid"),IsEntireSeason:n===0});a++});a=0}}));l.length>0&&(n.SeatingUI._currentUpdateTask=$.ajax({method:"POST",cache:!1,url:e.SeatingControl.Settings.updateSeatUrl,headers:{__RequestVerificationToken:n.afToken()},data:{requiredUpdates:l},success:function(t){var r=JSON.parse(t),y=!1,p,s,i,d,g,o,a,nt;if(!_.isNil(r))for(p=c.find(".person"),s=0;s<r.length;s++){if(i=r[s],e.SeatingControl.currentMatchId=i.MatchId,seat=e.getSeatBySeatingId(i.NewSeatingId),i.IsSuccessful===!0){_.isNil(seat)||(seat.selectSeat(i.MatchId),seat.hideBusy(),i.ExistingSeatingId>0&&(oldSeat=e.getSeatBySeatingId(i.ExistingSeatingId),_.isNil(oldSeat)||oldSeat.updateIcon()));var w="",l="",b="",tt=$("<button/>").attr("type","button").html('<i class="fa fa-trash-o"><\/i>').addClass("btn btn-danger btn-xs remove-seat").prop("title",u.ns.Strings.RemoveSeatLabel).click(function(){u.ns.unreserveSeat(seat)}),k=$("<button/>").attr("type","button").html('<i class="fa fa-eye"><\/i>').addClass("btn btn-primary btn-xs show-seat").prop("title",u.ns.Strings.ShowSeatLabel).click(function(){u.openSectionOverlayById(seat.SectionOverlay.Id)});b=seat.SectionOverlay.SeatingControl.Settings.isAutoAssignedSeats?$("<div/>").append(k).addClass("btn-group pull-right"):$("<div/>").append(k).append(tt).addClass("btn-group pull-right");i.SeatTypeId===2?l=$("<span/>").html('<i class="fa fa-wheelchair"><\/i>').addClass("stadium-key-legend seat-wheelchair"):i.SeatTypeId===3&&(l=$("<span/>").html('<i class="fa fa-heart"><\/i>').addClass("stadium-key-legend seat-carer"));w=$("<span/>").html(i.SectionName+" Seat "+i.RowName+i.SeatNumber).attr("data-overlay-id",i.SectionName.split(" ").slice(-1));d=$("<div/>").append(l).append(w).append(b);f=i.ExistingSeatingId>0?p.filter('li[data-seating-id="'+i.ExistingSeatingId+'"]'):h.find('*[data-match-id="'+i.MatchId+'"][data-person-counter="'+v+'"]');u.ns.updatePerson(seat,f,i.NewSeatingId,i.ExistingTemporaryHoldId,seat.VenueSectionId,seat.SectionOverlay.Id,d)}else _.isNil(seat)||(seat.unSelectSeat(seat),seat.hideBusy()),y=!0,n.debugMessage("reserveSeat() API reported error: "+(i.ErrorText!==""?i.ErrorText:"Unspecified Error"),"warning");e.SeatingControl.populateDetailsPanel(seat.getSeatInformation())}r.length!==0&&(y?(r.length>1?u.showInfoFlashMessage("danger",u.ns.Strings.ErrorMultipleReserveSeat,1e4):u.showInfoFlashMessage("danger",u.ns.Strings.ErrorSingleReserveSeat,1e4),$(window).trigger("sportsubsEvent_seatingSelector_reserveFail")):(r.length>1?u.showInfoFlashMessage("success",'<i class="fa fa-check"><\/i> {0}'.format(u.ns.Strings.SuccessMultipleReserveSeat.format(r[0].RowName,r[0].SeatNumber))):u.showInfoFlashMessage("success",'<i class="fa fa-check"><\/i> {0}'.format(u.ns.Strings.SuccessSingleReserveSeat.format(r[0].RowName,r[0].SeatNumber))),$(window).trigger("sportsubsEvent_seatingSelector_reserveSuccess"),$(window).trigger("sportsubsEvent_seatingSelector_unsavedChanges")));u.ns.isPanelCompleted(c)&&(u.ns.enablePanelCompleteButton(c),u.updateControlHeading());g=u.currentMatchId;o=n.SeatingUI.selectNextPerson(h,!1,u.Settings.isForceAutoAssignedSeatingAsBlock);u.ns.showCountdown();h.hasClass("completed")&&!_.isNil(o)&&o.Person&&o.InNewGroup&&g!==parseInt(o.Person.attr("data-match-id"))&&(a=$(o.Person).closest(".product-group"),nt=u.ns.Strings.AlertGroupSelectionComplete.format(a.attr("data-product-name")!==""?a.attr("data-product-name"):u.ns.Strings.AlertGroupSelectionNext),bootbox.alert({callback:function(){u&&u.currentSectionOverlay&&(u.currentSectionOverlay.hideSeatingGrid(),u.currentSectionOverlay=null,u.updateControlHeading(),u.ns.moveVenueUiAfterGroup(o.Person,!1))},message:nt,buttons:{ok:{label:"Continue",className:"btn-success"}}}))},error:function(t,i,r){r!=="abort"&&(u.showInfoFlashMessage("danger",u.ns.Strings.ErrorUnknown),n.debugMessage("reserveSeat() Failed: "+r,"error"),n.debugMessage(t,"error"),$(window).trigger("sportsubsEvent_seatingSelector_reserveError"))},complete:function(){u.ns._ignoreBackgroundUpdate=!1;seat.hideBusy();seat.updateIcon();seat.multiSeatSeatingIds=[];u.RefreshSelectedSectionOverlaysAndSeats();u.ns._currentUpdateTask=null;$(window).trigger("sportsubsEvent_seatingSelector_reserveComplete")}}))},c=function(n,t,i){var e=null,u=null,f=null;return u=r(n),u&&(f=_.find(u.SectionOverlays,{Id:t}),f&&(e=f.getSeatBySeatingId(i))),e},ft=function(n){_.isNil(n.data)||s(n.data)},d=function(n){var t=$(n).closest(".person"),i;t&&(t.hasClass("active-person")||u(t),i=c(n,t.data("sectionId"),t.data("seatingId")),s(i,t))},g=function(n){var t=$(n).closest(".person"),i,f;t.length>0&&(t.hasClass("active-person")||u(t),i=r(t),f=t.attr("data-overlay-id"),_.isNil(i)||_.isNil(f)||i.openSectionOverlayById(parseInt(f)))},s=function(t,i){var s=null;o=!0;t?(t.showBusy(),s=t.SectionOverlay.SeatingControl.getControlPanelElement(),i=s.find(".active-person").first()):s=i.closest(".seating-manager-panel");var u=r(s),c=i.closest(".product-group"),a=i.data("personCounter"),l=[],e=u.currentProductMatchIds,v=c.find(".all-matches-checkbox"),f;v.length!==1||v.prop("checked")||(e=[t.SectionOverlay.SeatingControl.currentMatchId]);i.data("isEntireSeason")==="True"&&(e=[0]);_.isNil(e)||e.forEach(function(n){if(n=parseInt(n),(e.length===1||e.length>1&&n!==0)&&(f=c.find('*[data-match-id="'+n+'"][data-person-counter="'+a+'"]'),f.length===1)){if(t){var i=t.SectionOverlay.getSeatBySeatingId(f.data("seatingId"));i&&i.unSelectSeat(n)}l.push({ExistingSeatingId:f.data("seatingId"),ExistingTemporaryHoldId:f.data("temporaryHoldId"),SeatIndex:f.data("seatIndex"),NewSeatingId:0,Operation:"Unreserve",MatchId:n,IsEntireSeason:n===0})}});l.length>0&&(h=$.ajax({method:"POST",cache:!1,url:u.Settings.updateSeatUrl,headers:{__RequestVerificationToken:n.afToken()},data:{requiredUpdates:l},success:function(i){var r=JSON.parse(i),e=!1;for(index in r)r[index].IsSuccessful===!0?(f=c.find('*[data-match-id="'+r[index].MatchId+'"][data-person-counter="'+a+'"]'),u.ns.updatePerson(t,f,0,0,0,0,'<i class="fa fa-exclamation-triangle text-danger"><\/i> <span class="text-danger">No seat selected<\/span>'),u.showInfoFlashMessage("success",'<i class="fa fa-check"><\/i> {0}'.format(u.ns.Strings.SeatRemoved)),u.ns.disablePanelCompleteButton(s),t&&(t.hideBusy(),t.SectionOverlay.SeatingControl.currentMatchId=r[index].MatchId,t.unSelectSeat(r[index].MatchId))):(e=!0,n.debugMessage("unreserveSeat() API reported error: "+(r[index].ErrorText!==""?r[0].ErrorText:"Unspecified Error"),"warning"));t&&t.SectionOverlay.SeatingControl.populateDetailsPanel(t.getSeatInformation());u.ns.markGroupComplete(c);u.updateControlHeading();u.ns.possiblyStopCountdown();e?(r.length>1?u.showInfoFlashMessage("warning",u.ns.Strings.ErrorMultipleRemoveSeat):u.showInfoFlashMessage("warning",u.ns.Strings.ErrorSingleRemoveSeat),$(window).trigger("sportsubsEvent_seatingSelector_unreserveFail")):(r.length>1?u.showInfoFlashMessage("success",'<i class="fa fa-check"><\/i> {0}'.format(u.ns.Strings.SuccessMultipleRemoveSeat)):u.showInfoFlashMessage("success",'<i class="fa fa-check"><\/i> {0}'.format(u.ns.Strings.SuccessSingleRemoveSeat)),$(window).trigger("sportsubsEvent_seatingSelector_unreserveSuccess"),$(window).trigger("sportsubsEvent_seatingSelector_unsavedChanges"))},error:function(t,i,r){r!=="abort"&&(u.showInfoFlashMessage("danger",u.ns.Strings.ErrorUnknown),n.debugMessage("unreserveSeat() Failed: "+r,"error"),n.debugMessage(t,"error"),$(window).trigger("sportsubsEvent_seatingSelector_unreserveError"))},complete:function(){u.ns._ignoreBackgroundUpdate=!1;t&&(t.hideBusy(),t.multiSeatSeatingIds=[]);u.RefreshSelectedSectionOverlaysAndSeats();u.ns._currentUpdateTask=null;$(window).trigger("sportsubsEvent_seatingSelector_unreserveComplete")}}))},nt=function(n,t,i,r,u,f,e){if(t){t.attr("data-seating-id",i);t.attr("data-overlay-id",f);t.attr("data-venue-section-id",u);t.attr("data-temporary-hold-id",r);t.data("seatingId",i);t.data("temporaryHoldId",r);var o=t.find(".selected-seat");o.html("").append(e)}n&&(t.attr("data-stadium-seat-id",n.Id),t.data("stadiumSeatId",n.Id))},u=function(n){var i=$(n),t,u,o,f,s;if(i.length>0){for(t=r(i),u=0;u<e.length;u++)e[u].controlId!==t.controlId&&e[u].setInactive();if(t.setActive(),t.currentActivePerson=i.data(),$(".active-person").removeClass("active-person"),i.addClass("active-person"),t.Settings.isForceAutoAssignedSeatingAsBlock?$(".product-group").removeClass("ghosted"):($(".product-group").addClass("ghosted"),i.closest(".product-group").removeClass("ghosted")),o=i.attr("data-match-id"),!_.isNil(o)){var c=i.closest(".product-group"),l=i.closest(".person-seating-groups"),h=l.find(".all-matches-checkbox");t.combineAllMatches=h.length===1&&h.prop("checked");t.currentProductMatchIds=c.data("productMatchIds").toString().split(",");_.isNil(t.currentProductMatchIds)||(t.currentProductMatchIds=_.map(t.currentProductMatchIds,function(n){return parseInt(n)}));t.selectMatchById(parseInt(o));f=parseInt(i.attr("data-overlay-id"));t.highlightSelectedSeatingSectionOverlays([f]);_.isNil(f)||f===0||(s=_.find(t.SectionOverlays,{Id:parseInt(f)}),s&&t.Settings.autoOpenSelectedSeatSection&&s.onClick())}}},et=function(n){var t=n.find(".active-person");t.length!==1&&u(n.find(".person:not(.isRenewal)").first())},l=function(t,i,f){var a=n.SeatingUI,h=r(t),c=null,l=!1,o=null,e,s;return _.isUndefined(f)&&(f=!1),_.isUndefined(i)&&(i=!1),i===!0?(e=t.find('.person[data-seating-id="0"]').first(),e.length!==1&&(e=t.find(".person").first())):f===!0?e=t.find(".person:visible").last():(o=t.find(".active-person"),o.length===1?i?e=o:(e=o.nextAll(".person:not(.isRenewal):visible").first(),e.length===0&&(h=r(t),h&&h.Settings.autoAdvanceBetweenGroups&&(e=t.nextAll(".product-group").first().find(".person:not(.isRenewal):visible").first(),l=!0))):(i===!0&&(e=t.find('.person:visible[data-seating-id="0"]').first()),(_.isUndefined(e)||e.length!==1)&&(e=t.find(".person:visible").first()))),e.length===1&&e!==o&&(y(e,!1),u(e),e.find(".person-details").velocity("callout.pulse"),c={Person:e,InNewGroup:l}),_.isNull(o)||o.length!==1||(s=o.closest("ul.product-group"),_.isNull(s)||s.length!==1||v(s)),c},a=function(n){var u=r(n),t=n.find(".panelCompleteButton"),i;t.length!==0&&(t.attr("disabled",!1),t.removeClass("d-none"),t.velocity("callout.triplePulse"),i=t.parent(),i.length===1&&(i.attr("data-original-title",""),i.is(":visible")&&i.tooltip("_fixTitle")));_.isNil(u)||u.updateControlHeading()},tt=function(n){var f=r(n),u,i;n.removeClass("completed");u=n.find(".panelCompleteButton");u.length!==0&&(u.attr("disabled",!0),i=u.parent(),i.length===1&&(i.attr("data-original-title",t.MustSelectSeats),i.is(":visible")&&i.tooltip("_fixTitle")))},f=function(n){var i=!0,t;return n.find(".person:not(.isRenewal)").each(function(){t=parseInt($(this).data("seatingId"));(t===0||_.isNaN(t))&&(i=!1)}),i},v=function(n){if(!_.isNil(n)&&n.length===1){var t=n.find(".seating-panel-footer").first();f(n)?(n.addClass("completed"),t.addClass("completed"),t.find(".complete-controls").removeClass("d-none"),t.find(".incomplete-controls").addClass("d-none")):(n.removeClass("completed"),t.removeClass("completed"),t.find(".complete-controls").addClass("d-none"),t.find(".incomplete-controls").removeClass("d-none"))}},y=function(n,t){var i=r(n),u;$(window).width()<992&&(u=$(n).find(".mobilemap"),u.append(i.$UiWrapperElement),i.$UiWrapperElement.removeClass("ghosted"),t&&$(n).velocity("scroll",{duration:400,offset:-120,easing:"ease-in-out"}))},it=function(n){var i=$(n),u=r(i),t,e,o;if(u&&(u.stopBackgroundStatusUpdate(),u.currentSectionOverlay&&u.currentSectionOverlay.stopBackgroundStatusUpdate()),this._ignoreBackgroundUpdate=!0,_.isNil(this._currentUpdateTask)||this._currentUpdateTask.abort(),i.addClass("completed"),t=$(".seating-manager-panel:not(.completed)").first(),t.length>0){u.setInactive();e=r(t);e.setActive();o=l(t,!1);f(t)&&a(t);i.find(".card-collapse").on("hidden.bs.collapse",function(){t.find(".card-collapse").collapse("show");t.velocity("scroll",{duration:400,offset:-90,easing:"ease-in-out"})});i.find(".card-collapse").collapse("hide")}else $(".panelCompleteButton").button("loading"),$.isFunction($.fn.busyLoadFull)&&$.busyLoadFull("show"),i.closest("form").submit()},rt=function(){var i=0,t=parseInt($("#SeatingCountdown").attr("data-seat-reservation-remaining-seconds")),r=parseInt($("#SeatingCountdown").attr("data-seat-reservation-duration-seconds"));i=!_.isUndefined(t)&&!isNaN(t)&&t>0?t:r;$("#seating-timer").countdown("getTimes")||(window.innerWidth<768?$("#seating-timer").countdown({layout:"Complete the checkout within {mn} minutes {sn} seconds to keep your seat selection.",until:+i,expiryUrl:$("#seating-timer").data("timeoutUrl"),description:"Complete the checkout within this time to keep your seat selections."}):$("#seating-timer").countdown({format:"MS",until:+i,expiryUrl:$("#seating-timer").data("timeoutUrl"),description:"You must complete the checkout within this time to keep your seat selections."}),$("#SeatingCountdown").slideDown(),$("#SeatingCountdown").hover(function(){$("#SeatingCountdown:not(:animated)").slideUp("fast",function(){_.isNil(window.seatingCountdown)||clearTimeout(window.seatingCountdown);window.seatingCountdown=setTimeout(function(){$("#SeatingCountdown:not(:animated)").slideDown()},n.SeatingUI._seatingCountdownAutoHideMilliseconds)})}))},ut=function(){$(".person[data-seating-id!='0']").length===0&&$("#seating-timer").countdown("getTimes")&&($("#SeatingCountdown").slideUp(),$("#seating-timer").countdown("destroy"))};return{SeatingControls:e,SeatingControl:p,VenueDefinitions:[],Strings:t,limitPan:w,touchEventsHandler:b,completeSeats:it,disablePanelCompleteButton:tt,enablePanelCompleteButton:a,getRelatedVenueObject:r,getSeatBySeatingId:c,isPanelCompleted:f,markGroupComplete:v,moveVenueUiAfterGroup:y,possiblyStopCountdown:ut,reserveSeat:k,selectNextPerson:l,setActivePerson:u,showByPersonClick:g,showCountdown:rt,unreserveByPersonClick:d,unreserveSeat:s,updatePerson:nt,_ignoreBackgroundUpdate:o,_currentUpdateTask:h,_longPressTimer:null,_longPressEventMilliseconds:200,_resizeDebounceMillisconds:250,_seatDebounceMilliseconds:1e3,_seatHoverTimeoutMiliseconds:200,_seatingCountdownAutoHideMilliseconds:1e4,_defaultInfoPanelAutoHideMilliseconds:500,_seatInfoPanelAutoHideMilliseconds:5e3,_godMode:!1}}(),n}(Sportsubs||{}),SportsubsSeatingUIInitialiseModule=function(n){return n.SeatingUI.inititaliseSeatingMaps=function(){var t,i;try{t=this;t.activateSeatingControl=!0;i=$(".SeatingControl-VenueContainer").first();i&&(t.defaultWidth=i.innerWidth());$(".SeatingControl-VenueSeatingUI").each(function(i,r){var f=$(r).closest(".seating-manager-panel"),s=f.data("control-index"),u,l,e,h,a,o,c;if(_.isNil(s)||_.isNil(t.SeatingControls)||_.isNil(t.SeatingControls[s])){u=new t.SeatingControl(r);u.init();u.$containerElement.off("click").on("click",function(){u.isActive||(t.SeatingControls.forEach(function(n){u.controlId===n.controlId?n.setActive():n.setInactive()}),t.selectNextPerson(f,!0,u.Settings.enforceMoveAutoAssignedAsBlock))});t.SeatingControls.push(u);s=t.SeatingControls.length-1;f.length===1&&f.attr("data-control-index",s);t.activateSeatingControl&&($('.person[data-seating-id="0"]').length===0?(u.setActive(),t.activateSeatingControl=!1):(l=f.find('.person[data-seating-id="0"]'),l.length!==0&&(u.setActive(),t.activateSeatingControl=!1)),e=t.selectNextPerson(f,!0,u.Settings.enforceMoveAutoAssignedAsBlock),!_.isNil(e)&&e.Person&&t.moveVenueUiAfterGroup(e.Person,!1),i>0&&(h=$(".content-body .alert").first(),h.length===1&&(a=f.find(".panel-body>div").first(),a.before(h)),f.velocity("scroll",{offset:-100,duration:500,easing:"ease-in"})),t.isPanelCompleted(f)&&t.enablePanelCompleteButton(f),u.Settings.isShowingSelectedSeats&&(o=null,e!==null&&e.Person.length===1?(o=parseInt(e.Person.attr("data-overlay-id")),u.highlightSelectedSeatingSectionOverlays([o])):_.isNil(u.Settings.selectedOverlayIds)||(o=u.Settings.selectedOverlayIds[0]),o!==null&&n.isValueTrue(u.Settings.autoOpenSelectedSeatSection)&&(c=u.getSectionOverlayById(o),_.isNil(c)||c.onClick())))}});$(".person:not(.isRenewal)").on("click",function(n){n.stopPropagation();var i=$(this).closest(".person");i.length===1&&(t.setActivePerson(i),t.moveVenueUiAfterGroup(i,!0))});$(".panelCompleteButton").on("click",function(n){n.stopPropagation();$panel=$(this).closest(".panel");$panel.length!==1||$(this).attr("disabled")||t.completeSeats($panel)});$(".all-matches-checkbox").on("change",function(){var r=$(this).closest(".product-group"),o=t.getRelatedVenueObject(this),i=r.find(".person").first(),n,u,h;if(this.checked){o.combineAllMatches=!0;r.find(".detailModeView").addClass("d-none");r.find(".summaryView").removeClass("d-none");var s=i.data("personCounter"),f=i.data("seatingId"),c=i.data("venueSectionId"),e=i.data("overlayId");parseInt(f)>0&&parseInt(e)>0&&(n=t.getSeatBySeatingId(i,e,f),_.isNil(n)||(n.multiSeatSeatingIds=[],u=r.find(".person").filter('[data-person-counter="'+s+'"]'),u.length>0&&(h=u.map(function(){thisSeat=t.getSeatBySeatingId($(this),$(this).data("overlayId"),$(this).data("seatingId"));thisSeat&&thisSeat.Id===n.Id&&$(this).data("stadiumSeatId")===i.data("stadiumSeatId")&&n.multiSeatSeatingIds.push(parseInt($(this).data("seatingId")))}),n.multiSeatSeatingIds.length>0&&n.multiSeatSeatingIds.length!==u.length&&n.onClick())))}else r.find(".detailModeView").removeClass("d-none"),r.find(".summaryView").addClass("d-none");t.setActivePerson(i)});$(".SeatingControl-show-venue-view").on("click",function(){var n=t.getRelatedVenueObject($(this));!_.isNil(n)&&n.currentSectionOverlay&&n.currentSectionOverlay.hideSeatingGrid()});$(".SeatingControl-zoom-in-control").on("click",function(){var n=t.getRelatedVenueObject($(this));_.isNil(n)||n.zoomVenueOrSection("in")});$(".SeatingControl-zoom-out-control").on("click",function(){var n=t.getRelatedVenueObject($(this));_.isNil(n)||n.zoomVenueOrSection("out")});$(".SeatingControl-zoom-reset-control").on("click",function(){var n=t.getRelatedVenueObject($(this));_.isNil(n)||n.zoomVenueOrSection("reset")});$(".card-collapse").on("shown.bs.collapse",function(){$(this).find(".SeatingControl-VenueSeatingUI").removeClass("ghosted");t.setActivePerson($(this).find(".person:not(.isRenewal)").first())});$("ul.product-group").each(function(){t.markGroupComplete($(this))});$('[data-toggle="tooltip"]').tooltip();$(".SeatingControl-VenueSeatingUI button").on("click",function(){$(this).tooltip("hide")})}catch(r){n.alert("Could not initialise seating selector, please contact support.");n.handleError(r,["Seating"],null,null,null)}},n}(Sportsubs||{})