(function(n,t){typeof define=="function"&&define.amd?define(["angular"],function(i){return t(n,i,n.__lc)}):typeof exports!="undefined"?exports=module.exports=t({},require("angular"),n.__lc):angular&&t(n,n.angular,n.__lc)})(this,function(n,t,i){"use strict";return t.module("ngLiveChat",[]).directive("livechat",function(){return{scope:{license:"@"},bindToController:!0,controllerAs:"vm",controller:["$window",function(n){n.__lc=i||{};n.__lc.license=this.license,function(){var t=n.document.createElement("script"),i;t.type="text/javascript";t.async=!0;t.src=("https:"==n.document.location.protocol?"https://":"http://")+"cdn.livechatinc.com/tracking.js";i=n.document.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i)}()}]}}),t.module("ngLiveChat")}),function(n){"use strict";if(typeof bootstrap=="function")bootstrap("promise",n);else if(typeof exports=="object"&&typeof module=="object")module.exports=n();else if(typeof define=="function"&&define.amd)define(n);else if(typeof ses!="undefined")if(ses.ok())ses.makeQ=n;else return;else if(typeof window!="undefined"||typeof self!="undefined"){var t=typeof window!="undefined"?window:self,i=t.Q;t.Q=n();t.Q.noConflict=function(){return t.Q=i,this}}else throw new Error("This environment was not anticipated by Q. Please file a bug.");}(function(){"use strict";function s(n){return function(){return kt.apply(n,arguments)}}function ti(n){return n===Object(n)}function ii(n){return ni(n)==="[object StopIteration]"||n instanceof d}function ft(n,t){var r,i,u;if(l&&t.stack&&typeof n=="object"&&n!==null&&n.stack&&n.stack.indexOf(g)===-1){for(r=[],i=t;!!i;i=i.source)i.stack&&r.unshift(i.stack);r.unshift(n.stack);u=r.join("\n"+g+"\n");n.stack=ri(u)}}function ri(n){for(var t,r=n.split("\n"),u=[],i=0;i<r.length;++i)t=r[i],fi(t)||ui(t)||!t||u.push(t);return u.join("\n")}function ui(n){return n.indexOf("(module.js:")!==-1||n.indexOf("(node.js:")!==-1}function et(n){var r=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(n),t,i;return r?[r[1],Number(r[2])]:(t=/at ([^ ]+):(\d+):(?:\d+)$/.exec(n),t)?[t[1],Number(t[2])]:(i=/.*@(.+):(\d+)$/.exec(n),i?[i[1],Number(i[2])]:void 0)}function fi(n){var t=et(n),r,i;return t?(r=t[0],i=t[1],r===rt&&i>=bt&&i<=pt):!1}function ot(){if(l)try{throw new Error;}catch(i){var n=i.stack.split("\n"),r=n[0].indexOf("@")>0?n[1]:n[2],t=et(r);return t?(rt=t[0],t[1]):void 0}}function ei(n,t,i){return function(){return typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(t+" is deprecated, use "+i+" instead.",new Error("").stack),n.apply(n,arguments)}}function n(n){return n instanceof t?n:ct(n)?ai(n):it(n)}function r(){function v(t){f=t;n.longStackSupport&&l&&(e.source=t);a(h,function(i,r){n.nextTick(function(){t.promiseDispatch.apply(t,r)})},void 0);h=void 0;c=void 0}var h=[],c=[],f,s=k(r.prototype),e=k(t.prototype);if(e.promiseDispatch=function(t,r,u){var e=i(arguments);h?(h.push(e),r==="when"&&u[1]&&c.push(u[1])):n.nextTick(function(){f.promiseDispatch.apply(f,e)})},e.valueOf=function(){if(h)return e;var n=ht(f);return o(n)&&(f=n),n},e.inspect=function(){return f?f.inspect():{state:"pending"}},n.longStackSupport&&l)try{throw new Error;}catch(y){e.stack=y.stack.substring(y.stack.indexOf("\n")+1)}return s.promise=e,s.resolve=function(t){f||v(n(t))},s.fulfill=function(n){f||v(it(n))},s.reject=function(n){f||v(u(n))},s.notify=function(t){f||a(c,function(i,r){n.nextTick(function(){r(t)})},void 0)},s}function e(n){if(typeof n!="function")throw new TypeError("resolver must be a function.");var t=r();try{n(t.resolve,t.reject,t.notify)}catch(i){t.reject(i)}return t.promise}function st(t){return e(function(i,r){for(var u=0,f=t.length;u<f;u++)n(t[u]).then(i,r)})}function t(n,i,r){var f,e;return i===void 0&&(i=function(n){return u(new Error("Promise does not support operation: "+n))}),r===void 0&&(r=function(){return{state:"unknown"}}),f=k(t.prototype),f.promiseDispatch=function(t,r,e){var o;try{o=n[r]?n[r].apply(f,e):i.call(f,r,e)}catch(s){o=u(s)}t&&t(o)},f.inspect=r,r&&(e=r(),e.state==="rejected"&&(f.exception=e.reason),f.valueOf=function(){var n=r();return n.state==="pending"||n.state==="rejected"?f:n.value}),f}function f(t,i,r,u){return n(t).then(i,r,u)}function ht(n){if(o(n)){var t=n.inspect();if(t.state==="fulfilled")return t.value}return n}function o(n){return n instanceof t}function ct(n){return ti(n)&&typeof n.then=="function"}function oi(n){return o(n)&&n.inspect().state==="pending"}function si(n){return!o(n)||n.inspect().state==="fulfilled"}function hi(n){return o(n)&&n.inspect().state==="rejected"}function tt(){h.length=0;v.length=0;y||(y=!0)}function ci(t,i){y&&(typeof process=="object"&&typeof process.emit=="function"&&n.nextTick.runAfter(function(){w(v,t)!==-1&&(process.emit("unhandledRejection",i,t),nt.push(t))}),v.push(t),i&&typeof i.stack!="undefined"?h.push(i.stack):h.push("(no stack) "+i))}function li(t){if(y){var i=w(v,t);i!==-1&&(typeof process=="object"&&typeof process.emit=="function"&&n.nextTick.runAfter(function(){var n=w(nt,t);n!==-1&&(process.emit("rejectionHandled",h[i],t),nt.splice(n,1))}),v.splice(i,1),h.splice(i,1))}}function u(n){var i=t({when:function(t){return t&&li(this),t?t(n):this}},function(){return this},function(){return{state:"rejected",reason:n}});return ci(i,n),i}function it(n){return t({when:function(){return n},get:function(t){return n[t]},set:function(t,i){n[t]=i},"delete":function(t){delete n[t]},post:function(t,i){return t===null||t===void 0?n.apply(void 0,i):n[t].apply(n,i)},apply:function(t,i){return n.apply(t,i)},keys:function(){return gt(n)}},void 0,function(){return{state:"fulfilled",value:n}})}function ai(t){var i=r();return n.nextTick(function(){try{t.then(i.resolve,i.reject,i.notify)}catch(n){i.reject(n)}}),i.promise}function vi(i){return t({isDef:function(){}},function(n,t){return at(i,n,t)},function(){return n(i).inspect()})}function lt(t,i,r){return n(t).spread(i,r)}function yi(t){return function(){function i(t,i){var s;if(typeof StopIteration=="undefined"){try{s=e[t](i)}catch(h){return u(h)}return s.done?n(s.value):f(s.value,r,o)}try{s=e[t](i)}catch(h){return ii(h)?n(h.value):u(h)}return f(s,r,o)}var e=t.apply(this,arguments),r=i.bind(i,"next"),o=i.bind(i,"throw");return r()}}function pi(t){n.done(n.async(t)())}function wi(n){throw new d(n);}function bi(n){return function(){return lt([this,c(arguments)],function(t,i){return n.apply(t,i)})}}function at(t,i,r){return n(t).dispatch(i,r)}function c(n){return f(n,function(n){var i=0,t=r();return a(n,function(r,u,e){var s;o(u)&&(s=u.inspect()).state==="fulfilled"?n[e]=s.value:(++i,f(u,function(r){n[e]=r;--i==0&&t.resolve(n)},t.reject,function(n){t.notify({index:e,value:n})}))},void 0),i===0&&t.resolve(n),t.promise})}function vt(t){if(t.length===0)return n.resolve();var i=n.defer(),r=0;return a(t,function(n,u,e){function s(n){i.resolve(n)}function h(n){r--;r===0&&(n.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+n.message,i.reject(n))}function c(n){i.notify({index:e,value:n})}var o=t[e];r++;f(o,s,h,c)},undefined),i.promise}function yt(t){return f(t,function(t){return t=b(t,n),f(c(b(t,function(n){return f(n,ut,ut)})),function(){return t})})}function ki(t){return n(t).allSettled()}function di(t,i){return n(t).then(void 0,void 0,i)}function gi(t,i){return n(t).nodeify(i)}var l=!1,d,g,pt;try{throw new Error;}catch(wt){l=!!wt.stack}var bt=ot(),rt,ut=function(){},p=function(){function t(){for(var t,i;n.next;)n=n.next,t=n.task,n.task=void 0,i=n.domain,i&&(n.domain=void 0,i.enter()),h(t,i);while(e.length)t=e.pop(),h(t);r=!1}function h(n,i){try{n()}catch(r){if(f){i&&i.exit();setTimeout(t,0);i&&i.enter();throw r;}else setTimeout(function(){throw r;},0)}i&&i.exit()}var n={task:void 0,next:null},s=n,r=!1,i=void 0,f=!1,e=[],u,o;return p=function(n){s=s.next={task:n,domain:f&&process.domain,next:null};r||(r=!0,i())},typeof process=="object"&&process.toString()==="[object process]"&&process.nextTick?(f=!0,i=function(){process.nextTick(t)}):typeof setImmediate=="function"?i=typeof window!="undefined"?setImmediate.bind(window,t):function(){setImmediate(t)}:typeof MessageChannel!="undefined"?(u=new MessageChannel,u.port1.onmessage=function(){i=o;u.port1.onmessage=t;t()},o=function(){u.port2.postMessage(0)},i=function(){setTimeout(t,0);o()}):i=function(){setTimeout(t,0)},p.runAfter=function(n){e.push(n);r||(r=!0,i())},p}(),kt=Function.call;var i=s(Array.prototype.slice),a=s(Array.prototype.reduce||function(n,t){var i=0,r=this.length;if(arguments.length===1)do{if(i in this){t=this[i++];break}if(++i>=r)throw new TypeError;}while(1);for(;i<r;i++)i in this&&(t=n(t,this[i],i));return t}),w=s(Array.prototype.indexOf||function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return t;return-1}),b=s(Array.prototype.map||function(n,t){var i=this,r=[];return a(i,function(u,f,e){r.push(n.call(t,f,e,i))},void 0),r}),k=Object.create||function(n){function t(){}return t.prototype=n,new t},dt=s(Object.prototype.hasOwnProperty),gt=Object.keys||function(n){var t=[];for(var i in n)dt(n,i)&&t.push(i);return t},ni=s(Object.prototype.toString);d=typeof ReturnValue!="undefined"?ReturnValue:function(n){this.value=n};g="From previous event:";n.resolve=n;n.nextTick=p;n.longStackSupport=!1;typeof process=="object"&&process&&process.env&&process.env.Q_DEBUG&&(n.longStackSupport=!0);n.defer=r;r.prototype.makeNodeResolver=function(){var n=this;return function(t,r){t?n.reject(t):arguments.length>2?n.resolve(i(arguments,1)):n.resolve(r)}};n.Promise=e;n.promise=e;e.race=st;e.all=c;e.reject=u;e.resolve=n;n.passByCopy=function(n){return n};t.prototype.passByCopy=function(){return this};n.join=function(t,i){return n(t).join(i)};t.prototype.join=function(t){return n([this,t]).spread(function(n,t){if(n===t)return n;throw new Error("Q can't join: not the same: "+n+" "+t);})};n.race=st;t.prototype.race=function(){return this.then(n.race)};n.makePromise=t;t.prototype.toString=function(){return"[object Promise]"};t.prototype.then=function(t,i,f){function h(n){try{return typeof t=="function"?t(n):n}catch(i){return u(i)}}function c(n){if(typeof i=="function"){ft(n,s);try{return i(n)}catch(t){return u(t)}}return u(n)}function l(n){return typeof f=="function"?f(n):n}var s=this,e=r(),o=!1;return n.nextTick(function(){s.promiseDispatch(function(n){o||(o=!0,e.resolve(h(n)))},"when",[function(n){o||(o=!0,e.resolve(c(n)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(t){var i,r=!1;try{i=l(t)}catch(u){if(r=!0,n.onerror)n.onerror(u);else throw u;}r||e.notify(i)}]),e.promise};n.tap=function(t,i){return n(t).tap(i)};t.prototype.tap=function(t){return t=n(t),this.then(function(n){return t.fcall(n).thenResolve(n)})};n.when=f;t.prototype.thenResolve=function(n){return this.then(function(){return n})};n.thenResolve=function(t,i){return n(t).thenResolve(i)};t.prototype.thenReject=function(n){return this.then(function(){throw n;})};n.thenReject=function(t,i){return n(t).thenReject(i)};n.nearer=ht;n.isPromise=o;n.isPromiseAlike=ct;n.isPending=oi;t.prototype.isPending=function(){return this.inspect().state==="pending"};n.isFulfilled=si;t.prototype.isFulfilled=function(){return this.inspect().state==="fulfilled"};n.isRejected=hi;t.prototype.isRejected=function(){return this.inspect().state==="rejected"};var h=[],v=[],nt=[],y=!0;return n.resetUnhandledRejections=tt,n.getUnhandledReasons=function(){return h.slice()},n.stopUnhandledRejectionTracking=function(){tt();y=!1},tt(),n.reject=u,n.fulfill=it,n.master=vi,n.spread=lt,t.prototype.spread=function(n,t){return this.all().then(function(t){return n.apply(void 0,t)},t)},n.async=yi,n.spawn=pi,n["return"]=wi,n.promised=bi,n.dispatch=at,t.prototype.dispatch=function(t,i){var f=this,u=r();return n.nextTick(function(){f.promiseDispatch(u.resolve,t,i)}),u.promise},n.get=function(t,i){return n(t).dispatch("get",[i])},t.prototype.get=function(n){return this.dispatch("get",[n])},n.set=function(t,i,r){return n(t).dispatch("set",[i,r])},t.prototype.set=function(n,t){return this.dispatch("set",[n,t])},n.del=n["delete"]=function(t,i){return n(t).dispatch("delete",[i])},t.prototype.del=t.prototype["delete"]=function(n){return this.dispatch("delete",[n])},n.mapply=n.post=function(t,i,r){return n(t).dispatch("post",[i,r])},t.prototype.mapply=t.prototype.post=function(n,t){return this.dispatch("post",[n,t])},n.send=n.mcall=n.invoke=function(t,r){return n(t).dispatch("post",[r,i(arguments,2)])},t.prototype.send=t.prototype.mcall=t.prototype.invoke=function(n){return this.dispatch("post",[n,i(arguments,1)])},n.fapply=function(t,i){return n(t).dispatch("apply",[void 0,i])},t.prototype.fapply=function(n){return this.dispatch("apply",[void 0,n])},n["try"]=n.fcall=function(t){return n(t).dispatch("apply",[void 0,i(arguments,1)])},t.prototype.fcall=function(){return this.dispatch("apply",[void 0,i(arguments)])},n.fbind=function(t){var r=n(t),u=i(arguments,1);return function(){return r.dispatch("apply",[this,u.concat(i(arguments))])}},t.prototype.fbind=function(){var n=this,t=i(arguments);return function(){return n.dispatch("apply",[this,t.concat(i(arguments))])}},n.keys=function(t){return n(t).dispatch("keys",[])},t.prototype.keys=function(){return this.dispatch("keys",[])},n.all=c,t.prototype.all=function(){return c(this)},n.any=vt,t.prototype.any=function(){return vt(this)},n.allResolved=ei(yt,"allResolved","allSettled"),t.prototype.allResolved=function(){return yt(this)},n.allSettled=ki,t.prototype.allSettled=function(){return this.then(function(t){return c(b(t,function(t){function i(){return t.inspect()}return t=n(t),t.then(i,i)}))})},n.fail=n["catch"]=function(t,i){return n(t).then(void 0,i)},t.prototype.fail=t.prototype["catch"]=function(n){return this.then(void 0,n)},n.progress=di,t.prototype.progress=function(n){return this.then(void 0,void 0,n)},n.fin=n["finally"]=function(t,i){return n(t)["finally"](i)},t.prototype.fin=t.prototype["finally"]=function(t){if(!t||typeof t.apply!="function")throw new Error("Q can't apply finally callback");return t=n(t),this.then(function(n){return t.fcall().then(function(){return n})},function(n){return t.fcall().then(function(){throw n;})})},n.done=function(t,i,r,u){return n(t).done(i,r,u)},t.prototype.done=function(t,i,r){var u=function(t){n.nextTick(function(){if(ft(t,f),n.onerror)n.onerror(t);else throw t;})},f=t||i||r?this.then(t,i,r):this;typeof process=="object"&&process&&process.domain&&(u=process.domain.bind(u));f.then(void 0,u)},n.timeout=function(t,i,r){return n(t).timeout(i,r)},t.prototype.timeout=function(n,t){var i=r(),u=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+n+" ms"),t.code="ETIMEDOUT");i.reject(t)},n);return this.then(function(n){clearTimeout(u);i.resolve(n)},function(n){clearTimeout(u);i.reject(n)},i.notify),i.promise},n.delay=function(t,i){return i===void 0&&(i=t,t=void 0),n(t).delay(i)},t.prototype.delay=function(n){return this.then(function(t){var i=r();return setTimeout(function(){i.resolve(t)},n),i.promise})},n.nfapply=function(t,i){return n(t).nfapply(i)},t.prototype.nfapply=function(n){var t=r(),u=i(n);return u.push(t.makeNodeResolver()),this.fapply(u).fail(t.reject),t.promise},n.nfcall=function(t){var r=i(arguments,1);return n(t).nfapply(r)},t.prototype.nfcall=function(){var t=i(arguments),n=r();return t.push(n.makeNodeResolver()),this.fapply(t).fail(n.reject),n.promise},n.nfbind=n.denodeify=function(t){if(t===undefined)throw new Error("Q can't wrap an undefined function");var u=i(arguments,1);return function(){var e=u.concat(i(arguments)),f=r();return e.push(f.makeNodeResolver()),n(t).fapply(e).fail(f.reject),f.promise}},t.prototype.nfbind=t.prototype.denodeify=function(){var t=i(arguments);return t.unshift(this),n.denodeify.apply(void 0,t)},n.nbind=function(t,u){var f=i(arguments,2);return function(){function s(){return t.apply(u,arguments)}var o=f.concat(i(arguments)),e=r();return o.push(e.makeNodeResolver()),n(s).fapply(o).fail(e.reject),e.promise}},t.prototype.nbind=function(){var t=i(arguments,0);return t.unshift(this),n.nbind.apply(void 0,t)},n.nmapply=n.npost=function(t,i,r){return n(t).npost(i,r)},t.prototype.nmapply=t.prototype.npost=function(n,t){var f=i(t||[]),u=r();return f.push(u.makeNodeResolver()),this.dispatch("post",[n,f]).fail(u.reject),u.promise},n.nsend=n.nmcall=n.ninvoke=function(t,u){var e=i(arguments,2),f=r();return e.push(f.makeNodeResolver()),n(t).dispatch("post",[u,e]).fail(f.reject),f.promise},t.prototype.nsend=t.prototype.nmcall=t.prototype.ninvoke=function(n){var u=i(arguments,1),t=r();return u.push(t.makeNodeResolver()),this.dispatch("post",[n,u]).fail(t.reject),t.promise},n.nodeify=gi,t.prototype.nodeify=function(t){if(t)this.then(function(i){n.nextTick(function(){t(null,i)})},function(i){n.nextTick(function(){t(i)})});else return this},n.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global");},pt=ot(),n});angular.module("nzpApp",["ngLiveChat","ngRoute","ngSanitize","ngCookies","mwl.confirm","ui.bootstrap.tpls","ui.bootstrap.modal","angular-carousel-3d","rorymadden.date-dropdowns","ui.bootstrap.popover"]);angular.module("nzpApp").config(["$logProvider","$windowProvider","$locationProvider",function(n,t,i){var r=t.$get();n.debugEnabled(!r.ENV_LIVE);i.html5Mode({enabled:!0,requireBase:!1,rewriteLinks:!1})}]);angular.module("nzpApp").run(["$templateCache",function(n){n.put("modalContent.html",'<div class="modal-header"><h3 class="modal-title" ng-bind-html="title"><\/h3><\/div><div class="modal-body" ng-bind-html="message"><\/div><div class="modal-footer text-center"><button class="button" type="button" ng-click="ok()">OK, got it!<\/button><\/div>')}]),function(){"use strict";function n(n,t,i,r){function u(n){return n.charAt(0)!=="/"&&n.indexOf("http:")===-1&&n.indexOf("https:")===-1?"/"+n:n}function f(i,r,f,o,s){var c=t.defer(),l=typeof s=="undefined"?!1:s,h;return i=i.toLowerCase(),f=u(f),h=[r+f],o&&i.match(/post|put/)&&h.push(o),h.push({cache:l}),n[i].apply(null,h).success(function(n){c.resolve(n)}).error(function(n,t){c.reject("HTTP Error: "+t)}),c.promise.catch(e)}function e(){throw new Error;}function o(n,t){var c=n.uri,o=n.method,l=r.REMOTES[n.remote],a=n.cache,e=null,s=[],u,h;if(t&&t.length>0)for(u=0;u<t.length;u++)o.toLowerCase()==="post"&&typeof t[u]=="object"?e===null&&(e=t[u]):s.push(t[u]);return h=i.vsprintf(c,s),f(o,l,h,e,a)}return{fetch:o}}angular.module("nzpApp").factory("apiHelper",n);n.$inject=["$http","$q","$window","enums","$log"]}();!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular"),require("angular-sanitize")):"function"==typeof define&&define.amd?define(["angular","angular-sanitize"],t):"object"==typeof exports?exports.angularBootstrapConfirmModuleName=t(require("angular"),require("angular-sanitize")):n.angularBootstrapConfirmModuleName=t(n.angular,n["angular-sanitize"])}(this,function(n,t){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){"use strict";var r=i(1),f=i(2),u;i(3);i(1);u="angular-bootstrap-confirm.html";n.exports=r.module("mwl.confirm",["ngSanitize","ui.bootstrap.position"]).run(["$templateCache",function(n){n.put(u,f)}]).controller("PopoverConfirmCtrl",["$scope","$rootScope","$element","$attrs","$compile","$document","$window","$timeout","$injector","$templateRequest","$parse","$log","confirmationPopoverDefaults",function(n,t,i,u,f,e,o,s,h,c,l,a,v){function tt(t,i){var f=u[t];r.isDefined(f)&&(l(f).assign?l(f).assign(n,i):a.warn("Could not set value of "+t+" to "+i+". This is normally because the value is not a variable."))}function b(t,i){return r.isDefined(t)?l(t)(n):i}function k(){var n=ut.positionElements(i,y.popover,u.placement||y.defaults.placement,!0);n.top+="px";n.left+="px";y.popover.css(n)}function it(){var n=u.focusButton||y.defaults.focusButton,t;n&&(t=n+"-button",y.popover[0].getElementsByClassName(t)[0].focus())}function d(){y.isVisible||b(u.isDisabled,!1)||(y.popover.css({display:"block"}),k(),it(),y.isVisible=!0,tt("isOpen",!0))}function p(){y.isVisible&&(y.popover.css({display:"none"}),y.isVisible=!1,tt("isOpen",!1))}function g(){y.isVisible?p():d();n.$apply()}function w(t){!y.isVisible||y.popover[0].contains(t.target)||i[0].contains(t.target)||(p(),n.$apply())}var y=this;y.defaults=v;y.$attrs=u;var rt=h.has("$uibPosition")?"$uibPosition":"$position",ut=h.get(rt),ft=u.templateUrl||v.templateUrl,nt=t.$new(!0);nt.vm=y;c(ft).then(function(n){y.popover=r.element(n);y.popover.css("display","none");f(y.popover)(nt);e.find("body").append(y.popover)});y.isVisible=!1;y.showPopover=d;y.hidePopover=p;y.togglePopover=g;y.onConfirm=function(){b(u.onConfirm)};y.onCancel=function(){b(u.onCancel)};n.$watch(u.isOpen,function(n){s(function(){n?d():p()})});i.bind("click",g);o.addEventListener("resize",k);e.bind("click",w);e.bind("touchend",w);n.$on("$destroy",function(){y.popover.remove();i.unbind("click",g);o.removeEventListener("resize",k);e.unbind("click",w);e.unbind("touchend",w);nt.$destroy()})}]).directive("mwlConfirm",function(){return{restrict:"A",controller:"PopoverConfirmCtrl"}}).value("confirmationPopoverDefaults",{confirmText:"Confirm",cancelText:"Cancel",confirmButtonType:"success",cancelButtonType:"default",placement:"top",focusButton:null,templateUrl:u,hideConfirmButton:!1,hideCancelButton:!1}).name},function(t){t.exports=n},function(n){n.exports='<div\n  class="popover"\n  ng-class="[vm.$attrs.placement || vm.defaults.placement, \'popover-\' + (vm.$attrs.placement || vm.defaults.placement), vm.$attrs.popoverClass || vm.defaults.popoverClass]">\n  <div class="popover-arrow arrow"><\/div>\n  <h3 class="popover-title" ng-bind-html="vm.$attrs.title"><\/h3>\n  <div class="popover-content">\n    <p ng-bind-html="vm.$attrs.message"><\/p>\n    <div class="row">\n      <div\n        class="col-xs-6"\n        ng-if="!vm.$attrs.hideConfirmButton && !vm.defaults.hideConfirmButton"\n        ng-class="{\'col-xs-offset-3\': vm.$attrs.hideCancelButton || vm.defaults.hideCancelButton}">\n        <button\n          class="btn btn-block confirm-button"\n          ng-class="\'btn-\' + (vm.$attrs.confirmButtonType || vm.defaults.confirmButtonType)"\n          ng-click="vm.onConfirm(); vm.hidePopover()"\n          ng-bind-html="vm.$attrs.confirmText || vm.defaults.confirmText">\n        <\/button>\n      <\/div>\n      <div\n        class="col-xs-6"\n        ng-if="!vm.$attrs.hideCancelButton && !vm.defaults.hideCancelButton"\n        ng-class="{\'col-xs-offset-3\': vm.$attrs.hideConfirmButton || vm.defaults.hideConfirmButton}">\n        <button\n          class="btn btn-block cancel-button"\n          ng-class="\'btn-\' + (vm.$attrs.cancelButtonType || vm.defaults.cancelButtonType)"\n          ng-click="vm.onCancel(); vm.hidePopover()"\n          ng-bind-html="vm.$attrs.cancelText || vm.defaults.cancelText">\n        <\/button>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n'},function(n){n.exports=t}])}),function(n,t){"use strict";function i(n,i,u,f){r.directive(n,["$parse","swipe",function(r,e){var o=75,s=.3,h=30;return function(c,l,a){function b(n){if(!v||!y)return!1;var t=(n.y-v.y)*i,r=(n.x-v.x)*i;return u?Math.abs(r)<o&&t>0&&t>h&&Math.abs(r)/t<s:Math.abs(t)<o&&r>0&&r>h&&Math.abs(t)/r<s}var w=r(a[n]),v,y,p=["touch"];t.isDefined(a.ngSwipeDisableMouse)||p.push("mouse");e.bind(l,{start:function(n,t){var i=t.target.getAttribute("class");u&&(!i||i&&i.match("noPreventDefault")===null)&&t.preventDefault();v=n;y=!0},cancel:function(){y=!1},end:function(n,t){b(n)&&c.$apply(function(){l.triggerHandler(f);w(c,{$event:t})})}},p)}}])}var r=t.module("swipe",[]);r.factory("swipe",[function(){function i(n){var t=n.originalEvent||n,r=t.touches&&t.touches.length?t.touches:[t],i=t.changedTouches&&t.changedTouches[0]||r[0];return{x:i.clientX,y:i.clientY}}function n(n,i){var r=[];return t.forEach(n,function(n){var t=f[n][i];t&&r.push(t)}),r.join(" ")}var r=40,u=.3,f={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"}};return{bind:function(t,f,e){var l,a,o,c,s=!1,v=!1,h=!0;e=e||["mouse","touch"];t.on(n(e,"start"),function(n){o=i(n);s=!0;l=0;a=0;v=!1;h=!0;c=o;f.start&&f.start(o,n)});t.on(n(e,"cancel"),function(n){s=!1;f.cancel&&f.cancel(n)});t.on(n(e,"move"),function(n){var t,e,y,p;s&&o&&((t=i(n),l+=Math.abs(t.x-c.x),a+=Math.abs(t.y-c.y),c=t,l<r&&a<r)||(v||(e=Math.abs(t.x-o.x),y=Math.abs(t.y-o.y),p=y/e,p<u?(n.preventDefault(),h=!1):h=!0,v=!0),n.isVertical=h,f.move&&f.move(t,n)))});t.on(n(e,"end"),function(n){s&&(n.isVertical=h,s=!1,f.end&&f.end(i(n),n))})}}}]);try{t.module("ngTouch")}catch(u){i("ngSwipeLeft",-1,!1,"swipeleft");i("ngSwipeRight",1,!1,"swiperight")}i("ngSwipeUp",-1,!0,"swipeup");i("ngSwipeDown",1,!0,"swipedown")}(window,window.angular);!function(n){"use strict";function i(){var n=arguments[0],t=i.cache;return t[n]&&t.hasOwnProperty(n)||(t[n]=i.parse(n)),i.format.call(null,t[n],arguments)}function r(n){return"number"==typeof n?"number":"string"==typeof n?"string":Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function e(n,t){return t>=0&&7>=t&&f[n]?f[n][t]:Array(t+1).join(n)}var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/bcdiefguxX/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},u,f;i.format=function(n,u){for(var f,c,o,a,v,y,b=1,k=n.length,p="",s=[],w=!0,l="",h=0;k>h;h++)if(p=r(n[h]),"string"===p)s[s.length]=n[h];else if("array"===p){if(o=n[h],o[2])for(f=u[b],c=0;c<o[2].length;c++){if(!f.hasOwnProperty(o[2][c]))throw new Error(i('[sprintf] property "%s" does not exist',o[2][c]));f=f[o[2][c]]}else f=o[1]?u[o[1]]:u[b++];if(t.not_type.test(o[8])&&t.not_primitive.test(o[8])&&"function"==r(f)&&(f=f()),t.numeric_arg.test(o[8])&&"number"!=r(f)&&isNaN(f))throw new TypeError(i("[sprintf] expecting number but found %s",r(f)));switch(t.number.test(o[8])&&(w=f>=0),o[8]){case"b":f=parseInt(f,10).toString(2);break;case"c":f=String.fromCharCode(parseInt(f,10));break;case"d":case"i":f=parseInt(f,10);break;case"j":f=JSON.stringify(f,null,o[6]?parseInt(o[6]):0);break;case"e":f=o[7]?parseFloat(f).toExponential(o[7]):parseFloat(f).toExponential();break;case"f":f=o[7]?parseFloat(f).toFixed(o[7]):parseFloat(f);break;case"g":f=o[7]?parseFloat(f).toPrecision(o[7]):parseFloat(f);break;case"o":f=f.toString(8);break;case"s":f=String(f);f=o[7]?f.substring(0,o[7]):f;break;case"t":f=String(!!f);f=o[7]?f.substring(0,o[7]):f;break;case"T":f=r(f);f=o[7]?f.substring(0,o[7]):f;break;case"u":f=parseInt(f,10)>>>0;break;case"v":f=f.valueOf();f=o[7]?f.substring(0,o[7]):f;break;case"x":f=parseInt(f,10).toString(16);break;case"X":f=parseInt(f,10).toString(16).toUpperCase()}t.json.test(o[8])?s[s.length]=f:(!t.number.test(o[8])||w&&!o[3]?l="":(l=w?"+":"-",f=f.toString().replace(t.sign,"")),v=o[4]?"0"===o[4]?"0":o[4].charAt(1):" ",y=o[6]-(l+f).length,a=o[6]&&y>0?e(v,y):"",s[s.length]=o[5]?l+f+a:"0"===v?l+a+f:a+l+f)}return s.join("")};i.cache={};i.parse=function(n){for(var e=n,i=[],r=[],s=0;e;){if(null!==(i=t.text.exec(e)))r[r.length]=i[0];else if(null!==(i=t.modulo.exec(e)))r[r.length]="%";else{if(null===(i=t.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){s|=1;var u=[],o=i[2],f=[];if(null===(f=t.key.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(u[u.length]=f[1];""!==(o=o.substring(f[0].length));)if(null!==(f=t.key_access.exec(o)))u[u.length]=f[1];else{if(null===(f=t.index_access.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");u[u.length]=f[1]}i[2]=u}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=i}e=e.substring(i[0].length)}return r};u=function(n,t,r){return r=(t||[]).slice(0),r.splice(0,0,n),i.apply(null,r)};f={0:["","0","00","000","0000","00000","000000","0000000"]," ":[""," ","  ","   ","    ","     ","      ","       "],_:["","_","__","___","____","_____","______","_______"]};"undefined"!=typeof exports?(exports.sprintf=i,exports.vsprintf=u):(n.sprintf=i,n.vsprintf=u,"function"==typeof define&&define.amd&&define(function(){return{sprintf:i,vsprintf:u}}))}("undefined"==typeof window?this:window),function(){var t,n;t=this.jQuery||window.jQuery;n=t(window);t.fn.stick_in_parent=function(i){var s,e,a,h,c,v,r,u,o,l,f;for(null==i&&(i={}),f=i.sticky_class,c=i.inner_scrolling,l=i.recalc_every,o=i.parent,u=i.offset_top,r=i.spacer,e=i.bottoming,null==u&&(u=0),null==o&&(o=void 0),null==c&&(c=!0),null==f&&(f="is_stuck"),s=t(document),null==e&&(e=!0),a=function(i,h,a,v,y,p,w,b){var it,ot,nt,et,st,k,d,rt,ut,ft,g,tt;if(!i.data("sticky_kit")){if(i.data("sticky_kit",!0),st=s.height(),d=i.parent(),null!=o&&(d=d.closest(o)),!d.length)throw"failed to find stick parent";if(it=nt=!1,(g=null!=r?r&&i.closest(r):t("<div />"))&&g.css("position",i.css("position")),rt=function(){var n,t,e;if(!b&&(st=s.height(),n=parseInt(d.css("border-top-width"),10),t=parseInt(d.css("padding-top"),10),h=parseInt(d.css("padding-bottom"),10),a=d.offset().top+n+t,v=d.height(),nt&&(it=nt=!1,null==r&&(i.insertAfter(g),g.detach()),i.css({position:"",top:"",width:"",bottom:""}).removeClass(f),e=!0),y=i.offset().top-(parseInt(i.css("margin-top"),10)||0)-u,p=i.outerHeight(!0),w=i.css("float"),g&&g.css({width:i.outerWidth(!0),height:p,display:i.css("display"),"vertical-align":i.css("vertical-align"),float:w}),e))return tt()},rt(),p!==v)return et=void 0,k=u,ft=l,tt=function(){var o,ut,t,tt;if(!b&&(t=!1,null!=ft&&(--ft,0>=ft&&(ft=l,rt(),t=!0)),t||s.height()===st||rt(),t=n.scrollTop(),null!=et&&(ut=t-et),et=t,nt?(e&&(tt=t+p+k>v+a,it&&!tt&&(it=!1,i.css({position:"fixed",bottom:"",top:k}).trigger("sticky_kit:unbottom"))),t<y&&(nt=!1,k=u,null==r&&("left"!==w&&"right"!==w||i.insertAfter(g),g.detach()),o={position:"",width:"",top:""},i.css(o).removeClass(f).trigger("sticky_kit:unstick")),c&&(o=n.height(),p+u>o&&!it&&(k-=ut,k=Math.max(o-p,k),k=Math.min(u,k),nt&&i.css({top:k+"px"})))):t>y&&(nt=!0,o={position:"fixed",top:k},o.width="border-box"===i.css("box-sizing")?i.outerWidth()+"px":i.width()+"px",i.css(o).addClass(f),null==r&&(i.after(g),"left"!==w&&"right"!==w||g.append(i)),i.trigger("sticky_kit:stick")),nt&&e&&(null==tt&&(tt=t+p+k>v+a),!it&&tt)))return it=!0,"static"===d.css("position")&&d.css({position:"relative"}),i.css({position:"absolute",bottom:h,top:"auto"}).trigger("sticky_kit:bottom")},ut=function(){return rt(),tt()},ot=function(){return b=!0,n.off("touchmove",tt),n.off("scroll",tt),n.off("resize",ut),t(document.body).off("sticky_kit:recalc",ut),i.off("sticky_kit:detach",ot),i.removeData("sticky_kit"),i.css({position:"",bottom:"",top:"",width:""}),d.position("position",""),nt?(null==r&&("left"!==w&&"right"!==w||i.insertAfter(g),g.remove()),i.removeClass(f)):void 0},n.on("touchmove",tt),n.on("scroll",tt),n.on("resize",ut),t(document.body).on("sticky_kit:recalc",ut),i.on("sticky_kit:detach",ot),setTimeout(tt,0)}},h=0,v=this.length;h<v;h++)i=this[h],a(t(i));return this}}.call(this),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l){function b(){a.formState.VALIDATING_PROMO=!0;a.PromotionConfirmed=!1;a.PromotionNoneApplicable=!1;i.validatePromotionCode(a.promotionCodeCandidate,a.basketId).then(function(t){if(t.Data.IsValid)a.promotionValidated=!0,a.promotionValidationCode=a.promotionCodeCandidate,a.promotionCode=a.promotionCodeCandidate,y(a.basketId),n.$parent.ChangedGift+=1,a.promotionCodeCandidate="",a.promotionGiftSelectionNeeded=t.Data.ValueMethod===3,a.promotionSelectedGift=null,a.promotionGifts=t.Data.Gifts,a.redemptionMessage=t.Data.RedemptionMessage,a.screenRedemptionMessage=a.redemptionMessage&&a.redemptionMessage!==""?a.redemptionMessage:"Promotional code applied!";else l.open("Promotion code not found","Unfortunately we could not find a matching or valid promotional code. If you think this might be an error, please give us a call on 0800 650 111.",450)}).finally(function(){a.formState.VALIDATING_PROMO=!1})}function k(n){return n===1?"New":n===2?"Redesign":"Upgrade"}function d(n){a.sidePanelContent={};u.getContent(n).then(function(n){var t=n.Header,i=n.Content;l.open(t,i,450)})}function v(){var n=a.FinalTotal,t;a.formState.SETTING_AMOUNTS=!0;typeof n!="undefined"&&(t=a.useSurcharge===!0?1:2,a.formState.SETTING_AMOUNTS=!0,c.calculateSurcharge(n,t).then(function(n){var t=n.Data;t&&(a.amounts=t,s.setAmounts(a.amounts))}).finally(function(){a.formState.SETTING_AMOUNTS=!1}),a.basketId&&(a.formState.SETTING_AMOUNTS=!0,i.laybyQuote(a.basketId).then(function(n){a.layby=n.Data;a.laybyAllowed=a.layby?a.layby.Success===!0:!1}).finally(function(){a.formState.SETTING_AMOUNTS=!1})))}function g(n,t){i.removeLineItem(a.basketId,n).then(function(i){var r=i.Data;r?t&&(a.basket=a.basket.filter(function(t){return t.LineId!==n}),y(a.basketId).then(function(){v()})):l.open("Something went wrong!","We could not remove this item from your shopping cart. If you continue to have issues, please give us a call on 0800 650 111.",450)})}function nt(n,t){return r.generateImageUrl(n.DualPlateDesignId,n.CombinationLayout,n.DualPlateSizeId,n.DualPlateForegroundColourId,t?t:p,n.CaptionTopColourId,n.CaptionTopText,n.CaptionBottomColourId,n.CaptionBottomText)}function tt(n,t){return r.generateImageUrl(n.PlateDesignId,n.CombinationLayout,n.PlateSizeId,n.ForegroundColourId,t?t:p,n.CaptionTopColourId,n.CaptionTopText,n.CaptionBottomColourId,n.CaptionBottomText)}function w(){e(function(){a.isMobileDevice=$(".device-xs").is(":visible")},0)}function it(){a.formState.LOADING_ITEMS=!0;a.formState.allowDelete=!n.$parent||!n.$parent.vm||!n.$parent.vm.formState||n.$parent.vm.formState.allowCartDelete;f.onresize=function(){w()};w();i.getBasketId().then(function(n){a.basketId=n;y(n)})}function y(n){return i.listBasket(n).then(function(n){var r,t;if(n.Data){for(r=n.Data.LineItems,a.basket=r,t=0;t<a.basket.length;t++)a.basket[t].DualPlateDesignId&&(a.basket[t].relativeImageSize=a.basket[t].DualPlateSize.Width_mm>a.basket[t].Size.Width_mm?100/a.basket[t].DualPlateSize.Width_mm:100/a.basket[t].Size.Width_mm);s.setCart(r);a.ItemTotal=n.Data.ItemTotal;a.Discount=n.Data.Discount;a.FinalTotal=n.Data.FinalTotal;a.GST=n.Data.GST;a.PromotionNoneApplicable=!1;a.PromotionConfirmed=!1;a.PromotionIsGift=!1;a.promotionCode=n.Data.PromotionCode;n.Data.PromotionCode?a.Discount>0||a.PromotionIsGift?a.PromotionConfirmed=!0:a.PromotionNoneApplicable=!0:i.removePromotionCode();v();a.formState.LOADING_ITEMS=!1}}).finally(function(){a.formState.LOADING_ITEMS=!1})}var a=this,p=150;a.basketId=null;a.basket=[];a.formState={SETTING_AMOUNTS:!1};a.amounts={};a.ItemTotal=0;a.Discount=0;a.FinalTotal=0;a.GST=0;a.layby={};a.laybyAllowed=!1;a.generatePlateImage=tt;a.generateDualPlateImage=nt;a.removeLineItem=g;a.getTransactionType=k;a.triggerModal=d;a.promotionCodeCandidate=i.getPromoCodeDefault();a.promotionGiftSelectionNeeded=!1;a.promotionSelectedGift=null;a.validatePromo=b;n.$watch("vm.promotionSelectedGift",function(n){typeof n!="undefined"&&a.basketId!=="undefined"&&a.promotionSelectedGift!=null&&i.setPromotionGift(a.basketId,a.promotionSelectedGift)});n.$watch("$parent.vm.addSurcharge",function(n){typeof n!="undefined"&&(a.useSurcharge=n,v())});it()}angular.module("nzpApp").controller("basketController",n);n.$inject=["$scope","$q","basketService","plateService","sidePanelService","$window","$timeout","$log","sharedProperties","googleAnalyticsService","paymentService","modalService"]}(),function(){"use strict";function n(n,t,i,r){function v(){return n.fetch(r.ENDPOINTS.Basket.SetPromotionGift,arguments)}function y(n,t){return p(n,t).then(function(n){return n.Data.IsValid&&w(n.Data.InstanceCode,n.Data.Expiry),n})}function p(){return n.fetch(r.ENDPOINTS.Basket.ValidatePromotionCode,arguments)}function w(n,i){var r=Date.parse(i);t.put(f,n,{expires:i})}function b(){t.remove(f)}function k(n,i){var r=Date.parse(i);t.put(o,n,{expires:i})}function d(){return t.get(o)}function s(){return t.get(f)}function h(){return n.fetch(r.ENDPOINTS.Basket.GetBasketById,arguments)}function g(){return n.fetch(r.ENDPOINTS.Basket.AddItem,arguments)}function c(){return n.fetch(r.ENDPOINTS.Basket.CreateBasket)}function l(){return n.fetch(r.ENDPOINTS.Basket.CheckBasket,arguments)}function nt(){return n.fetch(r.ENDPOINTS.Basket.SaveMyOrderItems,arguments)}function tt(){return n.fetch(r.ENDPOINTS.Basket.GetSaveMyOrderItems,arguments)}function it(){return n.fetch(r.ENDPOINTS.Basket.DeleteLine,arguments)}function rt(){var r=i.defer(),n=t.get(u),f=ot("restart");return f&&(n=f),n?l(n).then(function(t){t.Data?(e(n),r.resolve(n)):(a(),c().then(function(n){var t=n.Data;e(t);r.resolve(t)}))}):c().then(function(n){var t=n.Data;e(t);r.resolve(t)}),r.promise}function e(n){var i=new Date;i.setDate(i.getDate()+30);t.put(u,n,{expires:i})}function a(){t.remove(u)}function ut(n){var t=i.defer();return h(n).then(function(n){for(var r=n.Data,u=0,i=0;i<=r.length-1;i++)u+=r[i].PriceIncGST;t.resolve(u)}),t.promise}function ft(n){return et(n,s())}function et(){return n.fetch(r.ENDPOINTS.Basket.LaybyQuote,arguments)}function ot(n,t){for(var e,r,o=t||window.location.search.substring(1),u=o.split(/[&||?]/),f,i=0;i<u.length;i+=1)e=u[i],r=(e||"").split("="),r[0]===n&&(f=r[1]);return f}var u="basket-id",f="promo-id",o="promo-default-id";return{checkBasket:l,getBasketId:rt,removeBasketId:a,listBasket:h,addLineItem:g,removeLineItem:it,calculateTotal:ut,laybyQuote:ft,saveMyOrderItems:nt,getSaveMyOrderItems:tt,validatePromotionCode:y,removePromotionCode:b,getPromoCode:s,setPromotionGift:v,setDefaultPromoCode:k,getPromoCodeDefault:d}}angular.module("nzpApp").service("basketService",n);n.$inject=["apiHelper","$cookies","$q","enums"]}(),function(){"use strict";function n(n,t,i,r,u,f){function c(n){return r.generateImageUrl(n.DualPlateDesignId,n.CombinationLayout,n.DualPlateSizeId,n.DualPlateForegroundColourId,s,n.CaptionTopColourId,n.CaptionTopText,n.CaptionBottomColourId,n.CaptionBottomText)}function l(n){return r.generateImageUrl(n.PlateDesignId,n.CombinationLayout,n.PlateSizeId,n.ForegroundColourId,s,n.CaptionTopColourId,n.CaptionTopText,n.CaptionBottomColourId,n.CaptionBottomText)}function v(){y()}function h(){u.cancel(a)}function y(){o+=1;o>180&&h();i.getBasketId().then(function(n){e.basketId=n;i.listBasket(n).then(function(t){var u,r;if(t.Data){for(u=t.Data.LineItems,e.basket=u,r=0;r<e.basket.length;r++)e.basket[r].DualPlateDesignId&&(e.hasDualSizeItem=!0,e.basket[r].relativeImageSize=e.basket[r].DualPlateSize.Width_mm>e.basket[r].Size.Width_mm?100/e.basket[r].DualPlateSize.Width_mm:100/e.basket[r].Size.Width_mm);e.basket.length===0&&h();e.ItemTotal=t.Data.ItemTotal;e.Discount=t.Data.Discount;e.FinalTotal=t.Data.FinalTotal;e.GST=t.Data.GST;i.laybyQuote(n).then(function(n){e.layby=n;n.Data&&(e.laybyAllowed=n.Data.Success,e.laybyDepositAmount=n.Data.DepositAmount)})}}).catch(function(n){f.error(n)})})}var e=this,s=150,a,o;e.basketId=null;e.basket={};e.laybyAllowed=!1;e.laybyDepositAmount=0;e.generatePlateImage=l;e.generateDualPlateImage=c;e.ItemTotal=0;e.Discount=0;e.FinalTotal=0;e.GST=0;e.hasDualSizeItem=!1;o=0;v()}angular.module("nzpApp").controller("headerBasketController",n);n.$inject=["$scope","$q","basketService","plateService","$interval","$log"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){function it(){b.checkoutEntityOwner.StreetAddressFull=b.checkoutEntity.StreetAddressFull;b.checkoutEntityOwner.AddressLine1=b.checkoutEntity.AddressLine1;b.checkoutEntityOwner.AddressLine2=b.checkoutEntity.AddressLine2;b.checkoutEntityOwner.AddressLine3=b.checkoutEntity.AddressLine3;b.checkoutEntityOwner.Suburb=b.checkoutEntity.Suburb;b.checkoutEntityOwner.City=b.checkoutEntity.City;b.checkoutEntityOwner.PostCode=b.checkoutEntity.PostCode}function rt(){b.checkoutEntityOwner.StreetAddressFull=null;b.checkoutEntityOwner.AddressLine1=null;b.checkoutEntityOwner.AddressLine2=null;b.checkoutEntityOwner.AddressLine3=null;b.checkoutEntityOwner.Suburb=null;b.checkoutEntityOwner.City=null;b.checkoutEntityOwner.PostCode=null}function lt(){b.addSurcharge=!0;b.formState.allowCartDelete=!1;window.addEventListener("scroll",ui);i.getBasketId().then(function(n){n!=null&&(b.basketId=n,i.listBasket(n).then(function(t){var f,r;for(b.formState.INIT=!0,f=t.Data.LineItems,b.cart=f,r=0;r<b.cart.length;r++)b.cart[r].DualPlateDesignId&&(b.hasDualPlateOrder=!0,b.cart[r].relativeImageSize=b.cart[r].DualPlateSize.Width_mm>b.cart[r].Size.Width_mm?100/b.cart[r].DualPlateSize.Width_mm:100/b.cart[r].Size.Width_mm);l.setCart(f);b.ItemTotal=t.Data.ItemTotal;b.Discount=t.Data.Discount;b.FinalTotal=t.Data.FinalTotal;b.GST=t.Data.GST;b.AllowPaymentOnline=t.Data.AllowPaymentOnline;b.AllowPaymentOffline=t.Data.AllowPaymentOffline;b.AllowPaymentLayBy=t.Data.AllowPaymentLayBy;u.calculateSurcharge(b.FinalTotal,b.addSurcharge===!0?1:2).then(function(n){var t=n.Data;t&&(l.setAmounts(t),b.amounts=l.getAmounts())});i.getSaveMyOrderItems(n).then(function(n){b.order=n;n.Data&&pt(n.Data)});b.AllowPaymentLayBy&&i.laybyQuote(n).then(function(n){b.layby=n;n.Data&&(console.log(n.Data.Success),b.laybyAllowed=n.Data.Success,b.laybyDepositAmount=n.Data.DepositAmount)})}))})}function at(n,t){var i=new Date,r=n*t;return i.setDate(i.getDate()+r),i}function ut(){return b.billingForm.FirstName.$valid&&b.billingForm.EmailAddress.$valid}function vt(n,t){for(var u,f,s,e,o=[],r=p.CHECKOUT.FieldMap,i=0;i<=r.length-1;i++)if(r[i].Name===n)for(u=0;u<=r[i].Data.length-1;u++){f=r[i].Data[u].FieldMap;s=r[i].Data[u].AssociatedEntity;for(e in f)if(f.hasOwnProperty(e)&&e===t)return o.push(s),o.push(f[e]),o}return null}function yt(){if(ut()){w.showLoading();b.formState.SAVING=!0;b.formState.SAVED=!1;var n=p.CHECKOUT.FieldMap;i.getBasketId().then(function(t){for(var e,c,u,f,a,s,h=[],r=0;r<=n.length-1;r++)for(e=n[r],c=e.Name,u=0;u<=e.Data.length-1;u++){var l=n[r].Data[u],v=l.AssociatedEntity,o=l.FieldMap;for(f in o)o.hasOwnProperty(f)&&(a=o[f],s=b[v][a],h.push({AttributeName:"Checkout."+c+"."+f.toString(),Value:s?s:""}))}i.saveMyOrderItems(t,h).then(function(n){n.Data?(b.saveMyOrderSuccess=n.Success,b.saveMyOrderSuccess===!0?ti(b.checkoutEntity.Email):(b.saveMyOrderSuccess=!1,et())):(b.saveMyOrderSuccess=!1,et())}).finally(function(){b.formState.SAVING=!1;w.hideLoading()})})}}function pt(n){for(var i,r=0;r<=n.length-1;r++){var u=n[r].AttributeName.split("."),f=u[1],e=u[2],t=vt(f,e);typeof t!="undefined"&&t!=null&&(i=n[r].Value,t[1].indexOf("DOB")>-1?b[t[0]][t[1]]=new Date(i):(i=i.toLowerCase()==="true"?!0:i.toLowerCase()==="false"?!1:i,b[t[0]][t[1]]=i))}}function wt(n,t){i.getBasketId().then(function(i){var r={},u;r.AttributeName=n;r.Value=t;u=[r];y.saveValue(i,u)})}function bt(){return b.checkoutEntityDelivery.ManufactureNow&&b.checkoutEntityDelivery.SelectedDeliveryType.id===3?b.checkoutEntityDelivery.DOB!==null:!0}function ft(n,t){for(var i in n)t.hasOwnProperty(i)&&n[i]!==null&&n[i]>""&&(t[i]=n[i])}function kt(n){n.Title=null;n.SelectedTitle=null;n.FirstName=null;n.LastName=null;n.Organisation=null;n.StreetAddressFull=null;n.AddressLine1=null;n.AddressLine2=null;n.AddressLine3=null;n.Suburb=null;n.City=null;n.PostCode=null;n.Email=null;n.MobilePhone=null}function dt(n){var t="";return n&&(t=n.getDate()+"-"+(n.getMonth()+1)+"-"+n.getFullYear()),t}function gt(n){b.checkoutEntityDelivery.ManufactureNow=n}function ni(){h.open("Are these plates going on your car?","<p>If these plates are going owned by someone else, you will have to provide their full details in addition to your own as the applicant.<\/p><p>If these plates will be owned by you and placed on your own car, we will confirm you as both the applicant and the owner of these plates.<\/p>",450)}function ti(n){var t="<p>You will receive an email at <strong>"+n+"<\/strong> with details on how to complete your order at your convenience. <strong>Please note, saving your order will not reserve your plate combination(s) from sale.<\/strong><\/p><p>If you do not receive the email, or have any questions, please feel free to contact us.<\/p>";h.open("Your order details have been saved!",t,450)}function et(){h.open("Your order details were not saved!","<p>Oops! Something went wrong when we tried to save your details.<\/p> <p>If you do not receive an email or have any questions, please feel free to contact us.<\/p>",450)}function d(){return g(b.checkoutEntity.AddressLine1)}function ot(){return b.checkout?b.formState.SAVING||!b.billingFormOwner.$valid&&d()||d()&&g(b.checkoutEntityOwner.AddressLine1)||!b.billingForm.$valid||!b.checkout.acceptedTerms||!b.checkoutEntityDelivery.ManufactureNow&&!b.checkout.acceptedManufacturing:!0}function k(n){e.hash(n);s.yOffset=100;s()}function ii(){b.billingFormComplete=st(b.billingForm);b.checkoutEntityOwner.IsOwner||(b.billingFormOwnerComplete=st(b.billingFormOwner));b.checkoutEntityOwner.IsOwner?it():rt()}function st(n){var t=0,r=0,u=0,f=0,i=0;return angular.forEach(n,function(n){typeof n=="object"&&n.hasOwnProperty("$modelValue")&&(t++,n.hasOwnProperty("$error")&&(r++,n.$error.required&&u++),n.$valid||f++,n.$valid&&i++)}),i/t*100}function g(n){return typeof n=="undefined"?!1:n&&n.indexOf("PO Box")>-1}function ri(){var n=b.useSurcharge===!0?1:2;u.calculateSurcharge(i.getTotal(b.cart),n).then(function(n){var t=n.Data;t&&(b.amounts=t)})}function ht(){return b.cart=l.getCart(),b.cart.FinalTotal>0&&ri(),b.cart}function ui(){nt||($("#sidebar").stick_in_parent({offset_top:75}),nt=!0)}function fi(){b.checkoutEntityOwner.IsOwner=!0;b.formState.MY_DETAILS_ACTIVE=!0}function ei(){$("form :input, .alert :input, label :input").attr("disabled","disabled")}function oi(){$("form :input, .alert :input, label :input").removeAttr("disabled")}function si(){if(ei(),ot()){b.formState.SAVING=!1;h.open("Houston, we have a problem!","<p>There was an issue processing your order. Make sure all your details are correct and you have accepted all terms and conditions.<\/p><p>Review and try again or please give us a call on <strong>0800 650 111<\/strong> if this error persists.<\/p>",450);oi()}else b.formState.SAVING=!0,b.checkoutEntity.acceptedKiwiVIP&&ci(),i.getBasketId().then(function(n){var f=b.checkoutEntity,r,t,e,o,s,c,l;hi(f)?(r=[],b.checkoutEntityDelivery.Licence=b.checkoutEntity.Licence,f.EntityTypeId=2,r.push(f),b.checkoutEntityOwner.IsOwner?(t=b.checkoutEntityOwner,ft(b.checkoutEntity,b.checkoutEntityOwner),b.checkoutEntityOwner.StreetAddressFull=t.StreetAddressFull,b.checkoutEntityOwner.AddressLine1=t.AddressLine1,b.checkoutEntityOwner.AddressLine2=t.AddressLine2,b.checkoutEntityOwner.AddressLine3=t.AddressLine3,b.checkoutEntityOwner.Suburb=t.Suburb,b.checkoutEntityOwner.City=t.City,b.checkoutEntityOwner.PostCode=t.PostCode,b.checkoutEntityOwner.EntityTypeId=1,r.push(b.checkoutEntityOwner)):(b.checkoutEntityOwner.EntityTypeId=1,r.push(b.checkoutEntityOwner)),e=1,b.checkoutEntityDelivery.ManufactureNow&&(b.checkoutEntityDelivery.EntityTypeId=3,r.push(b.checkoutEntityDelivery),e=b.checkoutEntityDelivery.SelectedDeliveryType.id),o=b.paymentMethod==="4"||b.paymentMethod===4,s=o&&b.AutoPaySelected,u.placeOrder(n,e,o,r,s).then(function(t){var r,e,o,f;t.Success?(b.formState.SAVED=!0,f="<p>The good news is that your order has been saved successfully. Unfortunately we had problems communicating with the payment gateway and cannot process your payment at this time.<\/p><p>Please give us a call on <strong>0800 650 111<\/strong> to finalise your payment.<\/p>",Number(b.paymentMethod)===4?u.requestPaymentLayBy(n,b.subPaymentMethod,b.laybyDepositAmount).then(function(n){var t=n.Data;n&&n.Success&&t.url?(i.removeBasketId(),window.location=t.url):h.open("Oh no!",f,450)}).finally(function(){b.formState.SAVING=!1;b.formState.SAVED=!0}):Number(b.subPaymentMethod)===1||Number(b.subPaymentMethod)===2?u.requestPayment(n,b.subPaymentMethod).then(function(n){var t=n.Data;console.log("req:",n);n&&n.Success&&t.url?t.url?(a.saveCart(b.basket()),i.removeBasketId(),window.location=t.url):h.open("Oh no!",f,450):h.open("Oh no!",f,450)}).finally(function(){b.formState.SAVING=!1;b.formState.SAVED=!0}):(b.formState.SAVING=!1,b.formState.SAVED=!0,i.removeBasketId())):(r="",t.Message=t.Message?t.Message.toUpperCase():"",t.Message.indexOf("BASKET ALREADY CHECKED OUT")>-1?(i.removeBasketId(),r+="<p>This error is commonly seen when an order has already been successfully submitted so we have cleared your cart.<\/p>"):t.Message.indexOf("MODEL NOT VALID OR INCOMPLETE")>-1&&(r+="<p>This error is commonly seen when some details are missing or incorrect on the form.<\/p>"),e="Houston, we have a problem!",o="<p>There was an issue saving your order. The error was:<\/p><h5>"+t.Message+"<\/h5>"+r+"Please give us a call on <strong>0800 650 111 <\/strong> if this problem persists.",h.open(e,o,450))})):(b.formState.SAVING=!1,c="Houston, we have a problem!",l="<p>There was an issue processing your order. Make sure all your details are correct and you have accepted all terms and conditions.<\/p><p>Review and try again or please give us a call on <strong>0800 650 111<\/strong> if this error persists.<\/p>",h.open(c,l,450))})}function hi(){return!b.checkoutEntityOwner.IsOwner&&!b.billingFormOwner.$valid?!1:!0}function ci(){var n={ListId:366263,contact:{Email:b.checkoutEntity.Email,Parameters:{Firstname:b.checkoutEntity.FirstName,Lastname:b.checkoutEntity.LastName,MobilePhone:b.checkoutEntity.MobilePhone,ReferralSource:"Website - Checkout"}}};v.isSubscribed(n).then(function(t){t||v.addSubscriber(n).then(function(){})})}function li(){h.open("UNSOCIABLE AND CONFUSING PLATES","<p>Tongue in cheek phrases can be harmless to some, however, we think it’s best to keep it appropriate to avoid offending other road users. KiwiPlates and the New Zealand Transport Authority have guidelines to follow when approving certain plate combinations and anything considered unsociable, confusing or offensive won’t be allowed.<\/p>\r\n<p>This includes:<\/p>\r\n<ul>\r\n<li>Plates that are offensive, derogatory, obscene or profane<\/li>\r\n<li>Plates that promote violence,<\/li>\r\n<li>Plates that discriminate or are bias <\/li>\r\n<li><span>Plates that contain a sequence of similar numbers and letters designed to confuse, or which cannot be easily identified. This includes arrangements of letters and numbers that can be inverted to make an entirely new combination. <br /><\/span><\/li>\r\n<\/ul>\r\n<p>KiwiPlates reserves the right to reject submitted plate orders deemed unacceptable.<\/p>\r\n<p>We’re not totally humourless. If you have something fun and cheeky in mind but you're unsure if it's 'appropriate', give us a call on <strong>0800 650 111<\/strong> and we can have a chat. <\/p>\r\n<p> <\/p>",450)}function ct(){h.open("Terms & Conditions","Unfortunately the range you have selected is unavailable with your current vehicle selection.  Motorcycle and Large Trailer plates have restrictions that limit your design choice.",450)}function ai(){h.open("Manufacturing Requests","<p>We take care of all plate manufacturing &amp; transaction fees as long as a request for manufacture is lodged within 90 calendar days of final payment. Any requests made outside of this timeframe will attract applicable manufacturing fees.<\/p>",450)}function tt(n,t){o(function(){var u=t.box_type==="PO Box",r=t.unit_type?t.unit_type+" "+t.unit_identifier:"",i=t.floor?t.floor:"",f=r.length>1&&i.length>0?r+", "+i:r.length>1&&!(i.length>0)?r:i.length>0?i:"",e=(u?t.box_type+" ":"")+t.number+(t.alpha&&!u?t.alpha:"")+(u?"":" "+t.street);n.AddressLine1=t.building_name;n.AddressLine2=f;n.AddressLine3=e;n.Suburb=t.suburb?t.suburb:t.mailtown;n.AddressLine2===n.Suburb?n.AddressLine2=null:n.AddressLine3===n.Suburb&&(n.AddressLine3=null);n.City=t.city;n.Suburb===n.City&&(n.Suburb=null);n.PostCode=t.postcode;n.StreetAddressFull=t.a},0)}var b=this,nt;b.formState={INIT:!1,SAVING:!1,SAVED:!1};n.cartPreviewOnly=!0;n.cartPaymentOnly=!1;b.step={active:1,forward:function(){b.step.active+=1;k("step"+b.step.active);n.cartPaymentOnly=b.step.active===5},back:function(){b.step.active-=1;k("step"+b.step.active);n.cartPaymentOnly=b.step.active===5},move:function(t){t<b.step.active&&(b.step.active=t,k("step"+b.step.active),n.cartPaymentOnly=b.step.active===5)}};b.useManualAddressForm=!1;b.basket=ht;b.paymentMethod=1;b.basketId="";b.hasDualPlateOrder=!1;b.subPaymentMethod=1;b.laybyAllowed=!1;b.laybyDepositAmount=0;b.AutoPaySelected=!1;b.saveMyOrderVisible=!0;b.saveMyOrderSuccess=!0;b.ChangedGift=1;b.constants={titles:{availableOptions:["Mr","Mrs","Miss","Ms","Dr"]},deliveryTypes:{availableOptions:[{id:3,name:"Individual"},{id:4,name:"Registered Company"}]},paymentSubTypes:{selectedOption:{id:1,name:"Credit Card",isOnline:!0,isOffline:!1,showAll:!0},availableOptions:[{id:1,name:"Credit Card",isOnline:!0,isOffline:!1,showAll:!0},{id:2,name:"Online Banking (Account2Account)",isOnline:!0,isOffline:!1,showAll:!0},{id:3,name:"Gift Voucher",isOnline:!1,isOffline:!0,showAll:!1}]}};b.shouldShowPayment=function(n){if(b.paymentMethod===1){if(b.AllowPaymentOnline&&n.isOnline||b.AllowPaymentOffline&&n.isOffline)return!0}else if(b.AllowPaymentOnline&&n.isOnline&&n.showAll||b.AllowPaymentOffline&&n.isOffline&&n.showAll)return!0;return!1};b.setPaymentMethod=function(n){b.constants.paymentSubTypes.selectedOption={id:1,name:"Credit Card"};b.paymentMethod=n};n.$watch("vm.constants.paymentSubTypes.selectedOption",function(n){b.subPaymentMethod=n.id});n.$watch("vm.ChangedGift",function(){b.basketId&&(b.amountUpdatePromise&&o.cancel(b.amountUpdatePromise),b.amountUpdatePromise=o(function(){i.listBasket(b.basketId).then(function(n){var t=n.Data.LineItems;b.cart=t;l.setCart(t);u.calculateSurcharge(n.Data.FinalTotal,b.addSurcharge===!0?1:2).then(function(n){var t=n.Data;t&&(l.setAmounts(t),b.amounts=l.getAmounts())})})},500))});n.$watch("vm.subPaymentMethod",function(n){typeof n!="undefined"&&typeof b.FinalTotal!="undefined"&&(b.addSurcharge=n===1,u.calculateSurcharge(b.FinalTotal,b.addSurcharge?1:2).then(function(n){var t=n.Data;t&&(l.setAmounts(t),b.amounts=l.getAmounts())}))});b.checkout={acceptedTerms:!1,acceptedManufacturing:!1,acceptedKiwiVIP:!1};b.checkoutEntityOwner={EntityTypeId:1,Title:null,SelectedTitle:null,FirstName:null,LastName:null,Organisation:null,StreetAddressFull:null,AddressLine1:null,AddressLine2:null,AddressLine3:null,Suburb:null,City:null,PostCode:null,MobilePhone:null,Email:null,DOB:new Date("January 1, 1970 13:00:00"),Licence:null,CompanyNumber:null,ExistingCombination:null,VehicleOwnerName:null,Make:null,Model:null,IsOwner:!0};b.checkoutEntity={EntityTypeId:2,Title:null,SelectedTitle:null,FirstName:null,LastName:null,Organisation:null,StreetAddressFull:null,AddressLine1:null,AddressLine2:null,AddressLine3:null,Suburb:null,City:null,PostCode:null,MobilePhone:null,Email:null};b.checkoutEntityDelivery={EntityTypeId:3,Title:null,SelectedTitle:null,FirstName:null,LastName:null,Organisation:null,StreetAddressFull:null,AddressLine1:null,AddressLine2:null,AddressLine3:null,Suburb:null,City:null,PostCode:null,SelectedDeliveryType:{id:3,name:"Individual"},ManufactureNow:!1};n.$watch("vm.checkoutEntity.StreetAddressFull",function(){b.checkoutEntityOwner.IsOwner&&it()});b.scrollToElement=k;b.showTerms=ct;b.saveOrder=si;b.showUnsociable=li;b.showTerms=ct;b.showManufactureInfo=ai;b.resetToOwner=fi;b.watchForm=ii;b.checkoutIsDisabled=ot;b.addressIsPoBox=g;b.ownerDetailsRequired=d;b.showMyCarModal=ni;b.setImmediateManufacture=gt;b.dateFormat=dt;b.copyAddress=ft;b.clearDetails=kt;b.clearOwnerAddress=rt;b.checkDeliveryForm=bt;b.getCart=ht;b.saveSalesRecovery=wt;b.canSaveCheckout=ut;b.saveCheckout=yt;b.addDaysToToday=at;b.validateOwnerDetails=function(){b.billingForm.$valid?b.checkoutEntityOwner.IsOwner?b.step.forward():b.billingFormOwner.$valid?b.step.forward():b.showFormValidation(b.billingFormOwner):(b.showFormValidation(b.billingForm),b.checkoutEntityOwner.IsOwner||b.billingFormOwner.$valid||b.showFormValidation(b.billingFormOwner));setTimeout(function(){$(".ng-touched.ng-invalid").animate({backgroundColor:"rgba(255, 235, 238, 1)"},250).animate({backgroundColor:"white"},250)},100)};b.validateDeliveryDetails=function(){b.deliveryForm.$valid||!b.checkoutEntityDelivery.ManufactureNow?b.step.forward():b.showFormValidation(b.deliveryForm);setTimeout(function(){$(".ng-touched.ng-invalid").animate({backgroundColor:"rgba(255, 235, 238, 1)"},250).animate({backgroundColor:"white"},250)},100)};b.showFormValidation=function(n){angular.forEach(n.$error,function(n){angular.forEach(n,function(n){n.$setTouched()})})};nt=!1;b.initAddressFinder=function(){var i=new f.AddressFinder.Widget(document.getElementById("AddressLookup"),"JNTCYGW69H37UKDEV8X4","NZ"),n,t;i.on("result:select",function(n,t){tt(b.checkoutEntity,t)});n=new f.AddressFinder.Widget(document.getElementById("address_field-owner"),"JNTCYGW69H37UKDEV8X4","NZ");n.on("result:select",function(n,t){tt(b.checkoutEntityOwner,t)});t=new f.AddressFinder.Widget(document.getElementById("address_field-delivery"),"JNTCYGW69H37UKDEV8X4","NZ");t.on("result:select",function(n,t){tt(b.checkoutEntityDelivery,t)})},function(n){var t=document.createElement("script");t.src="https://api.addressfinder.io/assets/v3/widget.js";t.async=!0;t.onload=n;document.body.appendChild(t)}(b.initAddressFinder);lt()}angular.module("nzpApp").controller("checkoutController",n);n.$inject=["$scope","$q","basketService","plateService","paymentService","$window","$location","$timeout","$anchorScroll","modalService","$log","sharedProperties","googleAnalyticsService","newsletterService","salesRecoveryService","enums","jQueryService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){function c(){s.token=a();s.token===null?l():u.checkPaymentRequest(s.token).then(function(n){o.debug(n);v(n)})}function l(){s.state.loading=!1;s.errormsg="Oops! We could not detect a verified payment token.  Please give us a call on 0800 650 111 or copy the link directly out of your email into a browser.";s.state.error=!0}function a(){var n=f.search();return(o.debug(n),n&&n.token)?n.token:null}function v(n){s.state.error=!1;e(function(){if(s.response=n,s.state.loading=!1,s.islayby=s.response.Data.IsLayBy,s.isdeposit=s.response.Data.IsDeposit,s.minimumAmount=s.response.Data.MinimumPaymentAmount,s.maximumAmount=s.response.Data.MaximumPaymentAmount,s.updatedAmount=s.response.Data.AmountDueincGST,n.Success)if(n.Data.AllowedToProceed)s.state.loading=!1,s.state.verified=!0;else{s.errormsg="Uh oh! There was a problem with this payment link.";var t=s.response.Data.Reason;t&&(s.errormsg+=" Reason: "+t);s.errormsg+=" Please give us a call on 0800 650 111 and we can generate a new payment token.";s.state.error=!0}else s.errormsg="Oh no! Something went wrong when communicating with our systems.  Please give us a call on 0800 650 111 and we can generate a new payment token.",s.state.error=!0},2e3)}function y(n){s.state.paying!==!0&&(s.state.paying=!0,s.error=!1,n===1&&s.islayby===!0&&s.isdeposit===!1&&(n=3),s.token&&s.response.Success?h(s.token,n):(s.state.loading=!1,s.errormsg="Uh oh! There was an error retrieving your payment link. Please call us on 0800 650 111 and we will get to the bottom of the problem.",s.state.error=!0))}function h(n,t){var i=0;s.updatedAmountValid===!0&&s.updatedAmount>0&&(i=s.updatedAmount);u.beginPaymentRequest(n,t,i).then(function(n){n.Success?n.Data.url?window.location=n.Data.url:(s.state.loading=!1,s.errormsg="Uh oh! There was an error retrieving your payment link. Please call us on 0800 650 111 and we will get to the bottom of the problem.",s.state.error=!0):(s.state.loading=!1,s.errormsg="Uh oh! There was an error processing your payment link. Please call us on 0800 650 111 and we will get to the bottom of the problem.",s.state.error=!0)})}function p(){var n=parseFloat(s.updatedAmount);s.updatedAmountValid=n>=s.minimumAmount&&n<=s.maximumAmount;s.updatedAmountValid&&u.checkPaymentAmount(s.token,n,s.paymentMethod).then(function(n){o.debug(n);n.Success&&(s.response.Data.AmountDueincGST=n.Data.Amount,s.response.Data.AmountDueGST=n.Data.AmountGST,s.response.Data.SurchargeincGST=n.Data.Surcharge,s.response.Data.SurchargeGST=n.Data.SurchargeGST)});console.log(s.updatedAmountValid)}var s=this;s.params={};s.token=null;s.response=null;s.loading=!0;s.paymentMethod=1;s.islayby=!1;s.isdeposit=!1;s.updatedAmount=-1;s.updatedAmountValid=!0;s.state={loading:!0,error:!1,verified:!1,paying:!1};s.makeLinkPayment=h;s.attemptPayment=y;s.checkAmountRange=p;c()}angular.module("nzpApp").controller("payLinkController",n);n.$inject=["$scope","$q","basketService","plateService","paymentService","$location","$timeout","$log"]}(),function(){"use strict";function n(n,t,i,r){function f(){var n=t.search();u.params.success=n.success;u.params.layby=n.layby=="1";u.params.deposit=n.deposit=="1";u.params.rcpt=typeof n.rcpt!="undefined"?n.rcpt.replace(/^[0]+/g,""):null;u.params.allowretry=n.allowretry;u.params.success==="1"?(r.sendCartEC(),i.removeBasketId()):r.sendPageview()}var u=this;u.params={};f()}angular.module("nzpApp").controller("paymentResponseController",n);n.$inject=["$scope","$location","basketService","googleAnalyticsService"]}(),function(){"use strict";function n(n,t,i){function r(){return n.fetch(i.ENDPOINTS.Basket.SaveValue,arguments)}return{saveValue:r}}angular.module("nzpApp").service("salesRecoveryService",n);n.$inject=["apiHelper","$q","enums"]}(),function(){"use strict";function n(n,t,i){function f(i){n.hash(i);t(-250)}function e(){r.scrollToTarget("contactform-header");var n={Name:r.name,Email:r.email,Phone:r.phone,Subject:r.subject,Comments:r.comments};u(n.Email)?(r.formSubmitting=!0,i.createTicket(n).then(function(n){r.formSubmitting=!1;n&&n.id?(r.supportTicket=n.id,r.formSubmitted=!0):r.formSubmitError=!0})):r.contactform.contactEmail.$valid=!1}function u(n){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(n)}var r=this;r.name="";r.email="";r.phone="";r.subject="";r.comments="";r.createTicket=e;r.validateEmail=u;r.scrollToTarget=f}angular.module("nzpApp").controller("ContactUsController",n);n.$inject=["$location","$anchorScroll","ContactUsService"]}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.LiveChat.CreateTicket,arguments)}return{createTicket:i}}angular.module("nzpApp").service("ContactUsService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(n,t,i){function f(){i.LogoutMember().then(function(){n.location.href="/login#?logout"})}function e(){if(n.LC_API&&typeof n.LC_API.agents_are_available()!="undefined"){var t=n.LC_API.chat_window_maximized();t?n.LC_API.minimize_chat_window():n.LC_API.open_chat_window()}}var r=this,u;r.agentsAvailable=!1;r.toggleWindow=e;r.logoutMember=f;u=t(function(){n.LC_API&&typeof n.LC_API.agents_are_available()!="undefined"&&(r.agentsAvailable=n.LC_API.agents_are_available(),angular.isDefined(u)&&(t.cancel(u),u=undefined))},100)}angular.module("nzpApp").controller("HeaderNaviController",n);n.$inject=["$window","$interval","memberService"]}(),function(){"use strict";function n(){var n=this}angular.module("nzpApp").controller("topSearchController",n)}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.Vision6.UnsubscribeByEmail,arguments)}function r(){return n.fetch(t.ENDPOINTS.MarketingCloud.AddSubscriber,arguments)}function u(){return n.fetch(t.ENDPOINTS.Vision6.ConfirmSubscriber,arguments)}function f(){return n.fetch(t.ENDPOINTS.MarketingCloud.IsSubscribed,arguments)}return{addSubscriber:r,confirmSubscriber:u,isSubscribed:f,unsubscribeByEmail:i}}angular.module("nzpApp").service("campaignService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(n,t){var i=this;i.acceptedConditions=!1;i.name="";i.email="";i.wheel=null;i.listId="3D89CE54-0C3D-40EE-9364-379BC6304C28";i.isLoading=!1;i.showError=!1;i.errorMessage="";i.subscribeUser=function(){if(i.form.$valid){i.isLoading=!0;i.showError=!1;i.errorMessage="";var n={EmailListId:i.listId,Email:i.email,SubscriberProperties:{Name:i.name,Created:(new Date).toLocaleDateString()}};t.isSubscribed(i.listId,i.email).then(function(r){if(r.Success&&r.Data)i.showError=!0,i.isLoading=!1,i.errorMessage="This email address has already been entered into the draw";else return t.addSubscriber(n).then(function(){i.isLoading=!1;i.wheel.startAnimation()})})}};i.alertPrize=function(){i.prizeSegment=i.wheel.getIndicatedSegment();n.$apply();$("#kp-modal").modal("show")};i.wheel=new Winwheel({canvasId:"WinningWheel",lineWidth:3,numSegments:12,pointerAngle:90,innerRadius:40,easing:"Power4.easeOut",animation:{type:"spinToStop",duration:5,spins:8,callbackFinished:i.alertPrize},segments:[{fillStyle:"#9e1f63",text:"BURGERFUEL FRIES",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"fries from BurgerFuel!",textFontSize:16},{fillStyle:"#33a3dc",text:"RED BULL",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a can of Redbull!",textFontSize:16},{fillStyle:"#f3921b",text:"CHOCOLATE BAR",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a chocolate bar!",textFontSize:16},{fillStyle:"#43b649",text:"BURGERFUEL FRIES",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"fries from BurgerFuel!",textFontSize:16},{fillStyle:"#9e1f63",text:"RED BULL",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a can of Redbull!",textFontSize:16},{fillStyle:"#33a3dc",text:"CHOCOLATE BAR",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a chocolate bar!",textFontSize:16},{fillStyle:"#f3921b",text:"BURGERFUEL FRIES",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"fries from BurgerFuel!",textFontSize:16},{fillStyle:"#43b649",text:"RED BULL",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a can of Redbull!",textFontSize:16},{fillStyle:"#9e1f63",text:"CHOCOLATE BAR  ",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a chocolate bar!",textFontSize:16},{fillStyle:"#33a3dc",text:"BURGERFUEL FRIES",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"fries from BurgerFuel!",textFontSize:16},{fillStyle:"#f3921b",text:"RED BULL",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a can of RedBull!",textFontSize:16},{fillStyle:"#43b649",text:"CHOCOLATE BAR",textFillStyle:"#ffffff",strokeStyle:"#231f20",textFontFamily:"'Open Sans', sans-serif",success:!0,message:"a chocolate bar!",textFontSize:16}]})}angular.module("nzpApp").controller("bigBoysToysLandingPageController",n);n.$inject=["$scope","campaignService"]}(),function(){"use strict";function n(n,t,i){var r=this;r.selectedSizeIndex=0;r.selectedForegroundColourIndex=0;r.rangeId=36;r.combination="";r.combinationAvailable=!0;r.canAddToCart=!1;r.isLoading=!1;r.combinationAlreadyInCart=!1;r.combinationFormatPrice=0;r.setDesignSizeIndex=function(n){r.selectedSizeIndex=n};r.setForegroundColourIndex=function(n){r.selectedForegroundColourIndex=n};r.setDesignOption=function(n){r.selectedDesignOption=n;r.selectedForegroundColourIndex=0};r.resetCombinationValidation=function(){r.combinationAvailable=!0;r.canAddToCart=!1;r.combinationAlreadyInCart=!1};r.checkCombinationAvailability=function(){r.isLoading=!0;t.isAvailable(r.combination,!0).then(function(n){r.isLoading=!1;n.Success&&n.Data&&n.Data.Available?r.canAddToCart=!0:r.combinationAvailable=!1})};r.addPlateToBasket=function(){r.isLoading=!0;i.getBasketId().then(function(n){if(n){var t={Combination:r.combination.replace(" ",""),Combination_Layout:r.combination,VehicleTypeId:1,PlateDesignId:r.selectedDesignOption.sizes[r.selectedSizeIndex].designId,ForegroundColourId:r.selectedDesignOption.sizes[r.selectedSizeIndex].foregroundColors[r.selectedForegroundColourIndex].foregroundColourId,PlateSizeId:r.selectedDesignOption.sizes[r.selectedSizeIndex].sizeId,TransactionTypeId:1};i.addLineItem(t,n).then(function(n){r.isLoading=!1;n.Success?window.location.href="/cart":r.combinationAlreadyInCart=!0})}else r.isLoading=!1})};r.designOptions=[{hexColour:"#0082bf",placeholder:"BLUE",sizes:[{designId:168,sizeId:14,sizeText:"Large 440 x 112mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]},{designId:173,sizeId:2,sizeText:"Slim 360 x 100mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]}]},{hexColour:"#000000",placeholder:"BLACK",sizes:[{designId:170,sizeId:14,sizeText:"Large 440 x 112mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]},{designId:175,sizeId:2,sizeText:"Slim 360 x 100mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]}]},{hexColour:"#d0202e",placeholder:"RED",sizes:[{designId:171,sizeId:14,sizeText:"Large 440 x 112mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4},{hexColour:"#d0202e",foregroundColourId:5}]},{designId:176,sizeId:2,sizeText:"Slim 360 x 100mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4},{hexColour:"#d0202e",foregroundColourId:5}]}]},{hexColour:"#ec008c",placeholder:"PINK",sizes:[{designId:167,sizeId:14,sizeText:"Large 440 x 112mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]},{designId:172,sizeId:2,sizeText:"Slim 360 x 100mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]}]},{hexColour:"#86754e",placeholder:"GOLD",sizes:[{designId:169,sizeId:14,sizeText:"Large 440 x 112mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]},{designId:174,sizeId:2,sizeText:"Slim 360 x 100mm",foregroundColors:[{hexColour:"#000000",foregroundColourId:4}]}]}];r.selectedDesignOption=r.designOptions[0]}angular.module("nzpApp").controller("hashtagLandingPageController",n);n.$inject=["$scope","plateService","basketService"]}(),function(){"use strict";function n(){var n=this;n.selectedlaybyBracketInfoIndex=0;n.laybyBracketInfo=[{weekly:{deposit:"49.92",payment:"49.92",term:"12 weeks"},fortnightly:{deposit:"99.84",payment:"99.84",term:"8 fortnights"},monthly:{deposit:"149.75",payment:"149.75",term:"4 months"}},{weekly:{deposit:"83.25",payment:"83.25",term:"12 weeks"},fortnightly:{deposit:"166.50",payment:"166.50",term:"8 fortnights"},monthly:{deposit:"249.75",payment:"249.75",term:"4 months"}}]}angular.module("nzpApp").controller("laybyLandingPageController",n);n.$inject=["$scope"]}(),function(){"use strict";function n(n,t){function r(){(i.formState.PAYING=!0,i.laybyReferenceNumber&&i.laybyPaymentAmount)&&t.makeLaybyPayment(i.laybyReferenceNumber,i.laybyPaymentAmount).then(function(n){n.Data.payment_url&&(window.location=n.Data.payment_url)}).finally(function(){i.formState.PAYING=!1})}function u(){(i.formState.RETRIEVING=!0,i.laybyReferenceNumber)&&t.requestLaybyPayment(i.laybyReferenceNumber).then(function(n){i.laybyOrder=n.Data;i.laybyOrder&&i.laybyOrder.order_lines.length>0&&(i.formState.RETRIEVED=!0)}).finally(function(){i.formState.RETRIEVING=!1})}function f(){}var i=this;i.laybyReferenceNumber=null;i.laybyOrder=null;i.laybyPaymentAmount=null;i.formState={INIT:!1,RETRIEVING:!1,RETRIEVED:!1,PAYING:!1,PAID:!1};i.retrieveLayby=u;i.makeLaybyPayment=r;f()}angular.module("nzpApp").controller("laybyPaymentController",n);n.$inject=["$scope","paymentService"]}(),function(){"use strict";function n(n,t,i){function e(){f();r.formState.MEMBER_UPDATING=!0;n.UpdateMember(r.member).then(function(n){r.formState.MEMBER_UPDATED=n;i.debug(n)}).finally(function(){r.formState.MEMBER_UPDATING=!1})}function o(){if(f(),r.currentPassword!==r.newPassword)if(r.newPassword===r.newPassword2){r.formState.PASSWORD_CHANGING=!0;var t={Email:r.username,CurrentPassword:r.currentPassword,NewPassword:r.newPassword,NewPassword2:r.newPassword2};n.PasswordChangeWithPassword(t).then(function(n){r.formState.PASSWORD_CHANGE_SUCCESS=n}).finally(function(){r.formState.PASSWORD_CHANGING=!1;r.formState.PASSWORD_CHANGE_ERROR=!r.formState.PASSWORD_CHANGE_SUCCESS})}else r.formState.PASSWORD_CHANGE_ERROR=!0;else r.formState.PASSWORD_CHANGE_ERROR=!0}function s(n){if(i.debug(n),n||t.unsubscribeByEmail(u,r.username).then(function(){}),n){var f={ListId:u,contact:{Email:r.username}};t.confirmSubscriber(f).then(function(){})}}function h(){n.GetLoggedInMember().then(function(n){r.member=n;r.username=n.Email;var i={ListId:u,contact:{Email:n.Email}};t.isSubscribed(i).then(function(n){r.updateUserForm.newsletterSubscribed=n})});f()}function f(){r.formState={PASSWORD_CHANGING:!1,PASSWORD_CHANGE_SUCCESS:!1,PASSWORD_CHANGE_ERROR:!1,MEMBER_UPDATING:!1,MEMBER_UPDATED:!1}}var r=this,u=366263;r.toggleSubscription=s;r.changePassword=o;r.updateMember=e;h()}angular.module("nzpApp").controller("dashboardController",n);n.$inject=["memberService","newsletterService","$log"]}(),function(){"use strict";function n(n,t,i){function e(){var u=n.search().code,t=n.search().email;u&&t&&f(t)&&(r.formState.MEMBER_VALIDATING=!0,i.ConfirmMember({Code:u,Email:t}).then(function(n){n===!0&&(r.verificationEmail=t,r.formState.MEMBER_VALIDATING=!1,r.formState.MEMBER_VALIDATED=!0)}).finally(function(){r.formState.MEMBER_VALIDATING=!1}))}function o(){f(r.loginEmail)&&(r.formState.REQUESTING_PW_RESET=!0,i.RequestReset(r.loginEmail).then(function(){r.formState.REQUEST_PW_SUCCESS=!0}).finally(function(){r.formState.REQUESTING_PW_RESET=!1}))}function s(){u();r.formState.REQUEST_PW_SHOW=!0}function h(){if(u(),r.formState.REGISTERING=!0,r.registerPassword===r.registerPassword2){var n={FirstName:r.registerFirstName,LastName:r.registerLastName,Email:r.registerEmail,Password:r.registerPassword};i.RegisterMember(n).then(function(n){r.formState.REGISTERING=!1;r.formState.REGISTRATION_ERROR=n.CreateStatus!==0;r.formState.REGISTRATION_SUCCESS=n.CreateStatus===0;r.formState.REGISTRATION_SUCCESS&&l()}).finally(function(){r.formState.REGISTERING=!1;r.formState.REGISTRATION_ERROR=!r.formState.REGISTRATION_SUCCESS})}else r.formState.REGISTRATION_ERROR=!0,r.formState.REGISTERING=!1}function c(){u();r.formState.LOGGING_IN=!0;var n={email:r.loginEmail,password:r.loginPassword};i.LoginMember(n).then(function(n){r.formState.LOGGING_IN=!1;r.formState.LOGIN_ERROR=!n;r.formState.LOGIN_SUCCESS=n;n&&(t.location.href="/")}).finally(function(){r.formState.LOGGING_IN=!1})}function l(){r.registerFirstName="";r.registerLastName="";r.registerEmail="";r.registerPassword="";r.registerPassword2=""}function u(){r.formState={LOGGING_IN:!1,LOGIN_ERROR:!1,LOGIN_SUCCESS:!1,REGISTERING:!1,REGISTRATION_ERROR:!1,REGISTRATION_SUCCESS:!1,REQUEST_PW_SHOW:!1,REQUESTING_PW_RESET:!1,REQUEST_PW_SUCCESS:!1,REQUEST_PW_ERROR:!1,MEMBER_VALIDATING:!1,MEMBER_VALIDATED:!1}}function f(n){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(n)}var r=this;n.search().logout&&(r.isLoggedOut=!0);r.loginEmail="";r.loginPassword="";r.registerFirstName="";r.registerLastName="";r.registerEmail="";r.registerPassword="";r.registerPassword2="";r.registerMember=h;r.loginMember=c;r.validateEmail=f;r.showReset=s;r.resetFormState=u;r.requestReset=o;u();e()}angular.module("nzpApp").controller("loginController",n);n.$inject=["$location","$window","memberService"]}(),function(){"use strict";function n(n){function t(){return n.get(0,"/member/GetCurrentUserName").then(function(n){return n})}function i(){return n.get(0,"/member/GetLoggedInMember").then(function(n){return n})}function r(t){return n.post(0,"/member/ConfirmMember",t).then(function(n){return n})}function u(t){return n.post(0,"/member/UpdateMember",t).then(function(n){return n})}function f(t){return n.get(0,"/member/RequestReset?email="+t).then(function(n){return n})}function e(t){return n.post(0,"/member/PasswordResetWithToken",t).then(function(n){return n})}function o(t){return n.post(0,"/member/PasswordResetWithPassword",t).then(function(n){return n})}function s(t){return n.post(0,"/member/RegisterMember",t).then(function(n){return n})}function h(t){return n.post(0,"/member/LoginMember",t).then(function(n){return n})}function c(){return n.post(0,"/member/LogoutMember").then(function(n){return n})}return{RegisterMember:s,LoginMember:h,LogoutMember:c,RequestReset:f,PasswordResetWithToken:e,PasswordChangeWithPassword:o,ConfirmMember:r,GetCurrentUserName:t,GetLoggedInMember:i,UpdateMember:u}}angular.module("nzpApp").service("memberService",n);n.$inject=["apiHelper"]}(),function(){"use strict";function n(n,t){function r(){i.formState={RESET_INIT_FAIL:!1,RESET_SUBMITTING:!1,RESET_ERROR_EXPIRED:!1,RESET_ERROR_TOKEN:!1,RESET_ERROR_UNKNOWN:!1,RESET_SUCCESS:!1};f()}function f(){i.resetRequest.Email=n.search().email;i.resetRequest.Token=n.search().token;i.formState.RESET_INIT_FAIL=!i.resetRequest.Email||!i.resetRequest.Token||!(i.resetRequest.Email>"")||!(i.resetRequest.Email>"")||!u(i.resetRequest.Email)}function e(){r();u()&&i.resetRequest.Password===i.resetRequest.Password2&&(i.formState.RESET_SUBMITTING=!0,t.PasswordResetWithToken(i.resetRequest).then(function(n){i.formState.RESET_ERROR_TOKEN=!n.TokenValid;i.formState.RESET_ERROR_EXPIRED=n.TokenValid&&!n.ExpiryValid;i.formState.RESET_SUCCESS=n.ExpiryValid&&n.TokenValid&&n.DateValid&&n.Successful}).finally(function(){i.formState.RESET_SUBMITTING=!1;i.formState.RESET_SUCCESS||i.formState.RESET_ERROR_EXPIRED||i.formState.RESET_ERROR_TOKEN||(i.formState.RESET_ERROR_UNKNOWN=!0)}))}function u(){return i.resetRequest.Email&&o(i.resetRequest.Email)}function o(n){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(n)}var i=this;i.resetRequest={Email:"",Token:"",Password:"",Password2:""};i.checkValidEmail=u;i.resetPassword=e;i.resetForm=r;r()}angular.module("nzpApp").controller("resetPasswordController",n);n.$inject=["$location","memberService"]}(),function(){"use strict";function n(n){function i(){return t.formIsValid=t.name!=""&&t.email!=""&&r(t.email),t.formIsValid}function r(n){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(n)}function u(r,u){if(t.formIsDirty=!0,t.subscribing=!0,i()){var f={EmailListId:"CAF19828-675F-4A6C-BD3E-68618AB95764",Email:r,SubscriberProperties:{Name:u,LeadSource:"Website - Newsletter Bar",Created:(new Date).toLocaleDateString()}};return n.addSubscriber(f).then(function(){t.subscribed=!0;t.subscribing=!1})}return t.subscribing=!1,!1}var t=this;t.name="";t.email="";t.alreadySubscribed=!1;t.subscribing=!1;t.subscribed=!1;t.formIsDirty=!1;t.formIsValid=!1;t.emailFormat=/^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/;t.subscribe=function(){u(t.email,t.name)}}angular.module("nzpApp").controller("NewsletterController",n);n.$inject=["newsletterService"]}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.Vision6.UnsubscribeByEmail,arguments)}function r(){return n.fetch(t.ENDPOINTS.MarketingCloud.AddSubscriber,arguments)}function u(){return n.fetch(t.ENDPOINTS.Vision6.ConfirmSubscriber,arguments)}function f(){return n.fetch(t.ENDPOINTS.Vision6.CheckSubscribed,arguments)}return{addSubscriber:r,confirmSubscriber:u,isSubscribed:f,unsubscribeByEmail:i}}angular.module("nzpApp").service("newsletterService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function t(){function t(t){n.push(t)}return t.model=function(n){t(n)},t.step=function(n){t(n)},t.trackEvent=function(n,i){var r=i.attributes;console.log(i);t({event:n,attributes:{u4:r.currentPlateCombination,u5:r.plateAvailability,u7:r.plateDesign,u9:r.topMessage,u10:r.bottomMessage}})},t}angular.module("nzpApp").service("GTMService",t);var n=window.dataLayer=window.dataLayer||[]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l,a){function dt(){sr();t.getVehicles().then(function(n){v.vehicles=n.Data;v.formState.FORM_INIT=!0;v.plate.vehicle=1;v.preloadedPlate.vehicle?et(v.preloadedPlate.vehicle):et(1);var t=l.search();t.design||!t.range?!t.design||!t.range?y("combination"):y("design"):y("range")});t.getCaptionFont().then(function(n){v.plateFont=n.Data});o.onresize=function(){ht()};ht();ei();w($("#combination"));var n=or("combination");n&&n.length<=6&&n.length>=3&&(v.plate.combination=n.replace("+"," ").toUpperCase())}function y(n){l.hash(v.path[n])}function gt(){return v.formState.COMBO_ACCEPTED?v.plate.design.TopCaptionAvailable?!0:v.plate.design.BottomCaptionAvailable?!0:v.plate.dualSize&&v.plate.dualSize.TopCaptionAvailable?!0:v.plate.dualSize&&v.plate.dualSize.BottomCaptionAvailable?!0:v.plate.design.Sizes&&v.plate.design.Sizes.length>1?!0:v.formState.DISABLE_SALE?!0:!1:!0}function ni(n,t){n==="top"?v.topCaptionColourHover=t:v.bottomCaptionColourHover=t}function ti(n){return t.captionFns().remaining(nt(),n)}function nt(){if(v.plateFont)return v.plate.design.TopCaptionAvailable&&v.plate.design.BottomCaptionAvailable||v.plate.design.Name==="I Love Message"?v.plateFont.CharacterMapSmall:v.plateFont.CharacterMapLarge}function ht(){u(function(){v.isMobileDevice=$(".device-xs").is(":visible")},0)}function ii(){return/^[hwmnsxiozHWMNSXIOZ0689 ]{1,16}$/.test(v.plate.combination)}function ri(n){var t,e,i,o;if(!v.plate.combination)return!1;var f=!1,r=v.formats.filter(function(n){return n.Fixed}),u=v.formats.filter(function(n){return!n.Fixed});for(t=0;t<=r.length-1;t++)if(e=r[t].Format.test(v.plate.combination.replace(/\s+/g,"")),e&&(f=!0,r[t].Id===n.Id))return!0;if(!f)for(i=0;i<=u.length-1;i++)if(o=u[i].Format.test(v.plate.combination.replace(/\s+/g,"")),o&&u[i].Id===n.Id)return!0;return!1}function ct(){if(v.plate.combination){var n=v.plate.combination.replace(/\s/g,"");return/^[A-Za-z]{3}[0-9]{2}$|^[A-Za-z]{3}[0-9]{3}$|^[0-9]{3}[A-Za-z]{3}$|^[0-9]{2}[A-Za-z]{3}$|^[0-9]{1}[A-Za-z]{3}$|^[A-Za-z]{3}[0-9]{1}$/.test(n)}}function ui(){return ct()?599:v.plate.combination!=null&&v.plate.combination.length===3?1200:999}function fi(){return o.API_ENDPOINT}function ei(){var n=!1,i=function(){n||(n=!0,n=!1)},t=document.querySelectorAll("body");t=Array.prototype.slice.call(t);t.forEach(function(){window.addEventListener("scroll",i);window.addEventListener("resize",i);window.addEventListener("resize",w)})}function w(n){u(function(){var i;if(n&&n.parent&&typeof n.parent()!="undefined"&&(i=n.parent(),i)){var o=n.parent().width(),r=o*.692,t=r*.347,u=t*.055,f=u*2,e=(t+f*2)*.7;n.width(r);n.height(t);n.css("font-size",e+"px");n.css("line-height",v.isMobileDevice?"1em":e+"px");n.css("border-width",u+"px");n.css("border-radius",f+"px")}},0)}function oi(n){for(var t=0,i=0,r,u;n;)n.tagName==="BODY"?(r=n.scrollLeft||document.documentElement.scrollLeft,u=n.scrollTop||document.documentElement.scrollTop,t+=n.offsetLeft-r+n.clientLeft,i+=n.offsetTop-u+n.clientTop):(t+=n.offsetLeft-n.scrollLeft+n.clientLeft,i+=n.offsetTop-n.scrollTop+n.clientTop),n=n.offsetParent;return{x:t,y:i}}function si(n,t){var i=f.defer();return r.listBasket(n).then(function(u){var o,f,e;if(u.Data&&u.Data.LineItems&&u.Data.LineItems.length>0){for(o=u.Data.LineItems,f=null,e=0;e<=o.length-1;e++)if(o[e].Combination.toLowerCase()===t.toLowerCase()){f=o[e];continue}typeof f=="undefined"||f===null?i.resolve(!0):r.removeLineItem(n,f.LineId).then(function(){i.resolve(!0)}).catch(function(){i.resolve(!1)})}else i.resolve(!0)}).catch(function(){i.resolve(!1)}),i.promise}function hi(){v.formState.BUYING=!0;a.trackEvent("AddToCartRM",{attributes:{currentPlateCombination:v.plate.combination,plateAvailability:!0,plateDesign:v.plate.design.Id}});r.getBasketId().then(function(n){var i=v.plate.combination.replace(/\s/g,""),r,u,t;v.plate.dualSize&&(!v.plate.design.TopCaptionAvailable||!v.plate.design.BottomCaptionAvailable)&&(v.plate.dualSize.TopCaptionAvailable||v.plate.dualSize.BottomCaptionAvailable)&&(r=v.plate.design.Id,u=v.plate.design.SizeId,v.plate.design.Id=v.plate.dualSize.Id,v.plate.design.SizeId=v.plate.dualSize.Sizes[0].PlateSizeId,v.plate.dualSize.Id=r,v.plate.dualSize.Sizes[0].PlateSizeId=u);t={Combination:i,Combination_Layout:v.plate.combination,plateDesignId:v.plate.design.Id,vehicleTypeId:v.plate.vehicle,foregroundColourId:v.plate.design.ForegroundColourId,plateSizeId:v.plate.design.SizeId,TransactionTypeId:1};v.plate.dualSize&&v.plate.dualSize.Id!==v.plate.design.Id&&(t.DualPlateDesignId=v.plate.dualSize.Id,t.DualPlateForegroundColourId=v.plate.dualSize.Colours[0].ForegroundColourId,t.DualPlateSizeId=v.plate.dualSize.Sizes[0].PlateSizeId);(v.plate.design.TopCaptionAvailable||v.plate.dualSize&&v.plate.dualSize.TopCaptionAvailable)&&(t.captionTopText=v.plate.design.TopCaption.toUpperCase(),t.captionTopColourId=v.plate.design.TopCaptionColour);(v.plate.design.BottomCaptionAvailable||v.plate.dualSize&&v.plate.dualSize.BottomCaptionAvailable)&&(t.captionBottomText=v.plate.design.BottomCaption.toUpperCase(),t.captionBottomColourId=v.plate.design.BottomCaptionColour);si(n,i).then(function(i){if(i)ci(t,n);else{var r=g;e.open("Uh oh.. We can't seem to add this plate!",r,250)}})})}function ci(n,t){r.addLineItem(n,t).then(function(n){if(n.Success)window.location="/cart";else{var t="<h6>Info: "+n.Message+"<\/h6>"+g;e.open("Uh oh.. We can't seem to add this plate!",t,250)}}).finally(function(){v.formState.BUYING=!1})}function li(n){var t,i,r;if(n&&v.plate.design.Sizes)for(t=0;t<=v.plate.design.Sizes.length-1;t++)i=v.plate.design.Sizes[t],r=n===i.PlateSizeId,i.Active=r,r&&(v.plate.design.SizeId=n,v.stageImageUrl=d(v.plate.design,null,null,t))}function ai(n){var t,i,r;if(v.plate.design.Colours)for(v.plate.dualSize=null,t=0;t<=v.plate.design.Colours.length-1;t++)i=v.plate.design.Colours[t],r=n===i.ForegroundColourId,i.Active=r,r&&(v.plate.design.ForegroundColourId=n,v.stageImageUrl=d(v.plate.design,null,t))}function lt(){v.formState.COMBO_ACCEPTED=!0;p().then(function(n){var r,i,u,f;if(n&&v.ranges.length>0){if(!!v.preloadedPlate.range){if(r=h("filter")(v.ranges,{Id:parseInt(v.preloadedPlate.range)},!0)[0],i=v.ranges.indexOf(r),i!==-1){ut(i);return}t.getRangeById(v.preloadedPlate.range).then(function(n){n.Data.ParentRangeId!==-1&&(v.activeRangeId=n.Data.ParentRangeId,p().then(function(){var t=h("filter")(v.ranges,{Id:parseInt(v.preloadedPlate.range)},!0)[0],n=v.ranges.indexOf(t);if(n!==-1){ut(n);return}}))})}b(v.ranges[0].Id);y("range")}else u="Oops!",f="Something went wrong, we could not find any designs to match your selection! Change your combination and try again or give us a call on 0800 650 111.",e.open(u,f,250),v.formState.COMBO_ACCEPTED=!1})}function at(){v.formState.COMBO_AVAILABLE=!1;v.formState.COMBO_ACCEPTED=!1;v.formState.DESIGN_SELECTED=!1;v.formState.COMBO_CHECKED=!1;v.formState.CONFIG_INIT=!1;it();w($("#combination"));bt();y("combination")}function vt(){v.formState.DESIGN_SELECTED=!1;v.plate.dualSize=null;v.parentRangeId&&v.parentRangeId!==-1?(v.activeRangeId=v.parentRangeId,v.formState.RANGE_SELECTED=!0,v.formState.RANGE_SELECTED_SUBCATEGORY=!0,p(),b(v.activeRangeId),t.getRangeById(v.activeRangeId).then(function(n){yt(n.Data.ParentRangeId)})):(it(),p(),v.designs=null,v.formState.RANGE_SELECTED=!1,v.formState.RANGE_SELECTED_SUBCATEGORY=!1)}function it(){v.designs=null;v.activeRangeId=null;v.activeRangeName=null;v.activeRangeIndex=null;v.formState.RANGE_SELECTED=!1}function rt(n,t){t&&(v.activeRangeId=t.Id,v.activeRangeName=t.Name,v.activeRangeIndex=n)}function yt(n){n===-1?(v.parentRangeId=n,v.parentRangeName="Ranges"):t.getRangeById(n).then(function(n){v.parentRangeId=n.Data.Id;v.parentRangeName=n.Data.Name})}function vi(n){ut(n)}function ut(n){var t=v.ranges[n],i,r;t.Available?(rt(n,t),yt(t.ParentRangeId),v.formState.RANGE_SELECTED=!0,p().then(function(){v.formState.RANGE_SELECTED_SUBCATEGORY=v.ranges.length>0;y(!v.formState.RANGE_SELECTED_SUBCATEGORY?"design":"subrange");b(t.Id)})):(i="Uh oh! This range is unavailable",r="Unfortunately the range you have selected is unavailable with your current vehicle selection.  Motorcycle and Large Trailer plates have restrictions that limit your design choice.",e.open(i,r,250));window.scrollTo(0,0)}function b(n){v.plate.design.IsDirty=!1;v.activeRangeId=n;v.designs=[];t.getDesigns(v.plate.vehicle,v.plate.combination,n).then(function(n){var r=!1,i=null;v.designs=n.Data;v.designs.length>0?(!v.preloadedPlate.design||(i=h("filter")(v.designs,{Id:parseInt(v.preloadedPlate.design)},!0)[0],i&&(r=!0)),v.designs.forEach(function(n){if(n.SuitableForVehicleType&&!v.plate.design.IsDirty)if(v.formState.CONFIG_INIT||(rt(0,v.ranges[0]),v.formState.CONFIG_INIT=!0),r){if(n.Id===i.Id&&(k(n),v.plate.design.IsDirty=!0,v.preloadedPlate.dualDesign)){var t=h("filter")(n.DualSizeOptions,{Id:parseInt(v.preloadedPlate.dualDesign)},!0)[0];t&&ft(t)}}else k(n),v.plate.design.IsDirty=!0})):t.getDesigns(v.plate.vehicle,v.plate.combination,v.ranges[0].Id).then(function(n){var t=n.Data[0];v.plate.design.IsDirtyd||(v.formState.CONFIG_INIT||(rt(0,v.ranges[0]),v.formState.CONFIG_INIT=!0),k(t),v.plate.design.IsDirty=!0)})})}function ft(n){v.plate.dualSize=n;v.formState.DISABLE_SALE=v.plate.dualSize.DisableOnlineSale?!0:!1;v.plate.dualSize&&t.getPrice(1,n.Id,n.Sizes[0].PlateSizeId,v.plate.vehicle,v.plate.combination).then(function(n){v.plate.dualSize.Price=n.Data.TotalPriceIncGST})}function yi(n){y("design");k(n)}function k(n){var i,r,u;n?(a.trackEvent("chooseDesign",{attributes:{currentPlateCombination:v.plate.combination,plateAvailability:!0,plateDesign:n.Id}}),v.plate.design.Id=n.Id,v.plate.design.Name=n.Name,v.plate.design.Sizes=n.Sizes,v.plate.design.Colours=n.Colours,v.plate.design.TopCaptionAvailable=n.TopCaptionAvailable,v.plate.design.BottomCaptionAvailable=n.BottomCaptionAvailable,v.plate.design.RangeName=n.RangeName,i=v.plate.design.SizeId,v.plate.design.SizeId=ki(n,i)?i:n.Sizes[0].PlateSizeId,v.plate.design.RelativeSize=n.Sizes[0].Width_mm/520*100,v.plate.design.SizeName=n.Sizes[0].Name,r=v.plate.design.ForegroundColourId,v.plate.design.ForegroundColourId=gi(n,r)?r:n.Colours[0].ForegroundColourId,console.log(n.TopCaptionAvailable,n.BottomCaptionAvailable),(n.TopCaptionAvailable||n.BottomCaptionAvailable)&&t.getCaptionColoursByDesign(n.Id).then(function(n){v.captionColours=n.Data;v.captionColours.length>0&&(v.plate.design.TopCaptionColour&&pt(v.plate.design.TopCaptionColour)||(v.plate.design.TopCaptionColour=v.captionColours[0].CaptionColourId),v.plate.design.BottomCaptionColour&&pt(v.plate.design.BottomCaptionColour)||(v.plate.design.BottomCaptionColour=v.captionColours[0].CaptionColourId))}),v.plate.design.DisableOnlineSale=n.DisableOnlineSale,v.plate.design.DisableOnlineMessage=n.DisableOnlineMessage,v.formState.DISABLE_SALE=v.plate.design.DisableOnlineSale?!0:!1,t.getPrice(1,v.plate.design.Id,v.plate.design.SizeId,v.plate.vehicle,v.plate.combination).then(function(n){v.plate.design.Price=n.Data.TotalPriceIncGST}),wt(n,null,wi(n,v.plate.design.ForegroundColourId),pi(n,v.plate.design.SizeId)),v.formState.DESIGN_SELECTED||(n.DualSizeOptions&&n.DualSizeOptions.length>0?(u=[n],v.plate.sizingOptions=u.concat(n.DualSizeOptions)):v.plate.sizingOptions=[])):b(0)}function pt(n){for(var t=0;t<=v.captionColours.length-1;t++)if(v.captionColours[t].CaptionColourId===n)return!0;return!1}function pi(n,t){for(var i=0;i<=n.Sizes.length-1;i++)if(n.Sizes[i].PlateSizeId===t)return i;return null}function wi(n,t){for(var i=0;i<=n.Colours.length-1;i++)if(n.Colours[i].ForegroundColourId===t)return i;return null}function bi(n){return v.captionColours.length>0?h("filter")(v.captionColours,{CaptionColourId:n},!0)[0].Name:""}function ki(n,t){if(n&&n.Sizes){for(var i=0;i<=n.Sizes.length-1;i++)if(n.Sizes[i].PlateSizeId===t)return!0;return!1}}function di(n){var t,i,r;if(v.plate.dualSize&&v.plate.design){if(n){for(t=0,i=0;i<v.plate.sizingOptions.length;i++)t=v.plate.sizingOptions[i].Sizes[0].Width_mm>t?v.plate.sizingOptions[i].Sizes[0].Width_mm:t;return 100/t}return r=v.plate.design.Sizes[0].Width_mm>=v.plate.dualSize.Sizes[0].Width_mm?v.plate.design.Sizes[0].Width_mm:v.plate.dualSize.Sizes[0].Width_mm,100/r}return 0}function gi(n,t){if(n&&n.Colours){for(var i=0;i<=n.Colours.length-1;i++)if(n.Colours[i].ForegroundColourId===t)return!0;return!1}}function wt(n,t,i,r){v.stageImageUrl=d(n,t,i,r)}function nr(n){return"/plateranges/"+n+"/image"}function tr(n,t,i,r){r=r?r:1200;var u="/image";return u+="/"+n,u+="/"+v.plate.combination,u+="/"+t,u+="/"+i,u+("/max/"+r+"")}function d(n,i,r,u){var c,e,s,o,f;if(n&&n.Sizes&&n.Colours)return(c=h("filter")(n.Colours,{ForegroundColourId:v.plate.design.ForegroundColourId},!0)[0],i=i?i:1200,r=r?r:n.Colours.indexOf(c)===-1?0:n.Colours.indexOf(c),u=u?u:0,!n.Sizes[u])?void 0:(e="/image",e+="/"+n.Id,e+="/"+v.plate.combination,e+="/"+n.Sizes[u].PlateSizeId,e+="/"+n.Colours[r].ForegroundColourId,e+="/max/"+i+"",n.BottomCaptionAvailable&&(s="?",f="",v.plate.design.BottomCaptionDirty?(f=t.captionFns().stripChars(v.plate.design.BottomCaption),f=t.captionFns().validate(nt(),f,f),v.plate.design.BottomCaption!==null&&v.plate.design.BottomCaption!==""&&f.toUpperCase()!==v.plate.design.BottomCaption.toUpperCase()&&(v.plate.design.BottomCaption=f.toUpperCase())):(v.plate.design.BottomCaption="ENTER A MESSAGE",v.plate.design.BottomCaptionDirty=!0),o=v.plate.design.BottomCaptionColour,v.plate.design.BottomCaptionColour=o,e+=s+"bcc="+o+"&bct="+t.captionFns().makeSafe(f)),n.TopCaptionAvailable&&(s=s==="?"?"&":"?",f="",v.plate.design.TopCaptionDirty?(f=t.captionFns().stripChars(v.plate.design.TopCaption),f=t.captionFns().validate(nt(),f,f),v.plate.design.TopCaption!==null&&v.plate.design.TopCaption!==""&&f.toUpperCase()!==v.plate.design.TopCaption.toUpperCase()&&(v.plate.design.TopCaption=f.toUpperCase())):(v.plate.design.TopCaption="ENTER A MESSAGE",v.plate.design.TopCaptionDirty=!0),o=v.plate.design.TopCaptionColour,v.plate.design.TopCaptionColour=o,e+=s+"tcc="+o+"&tct="+t.captionFns().makeSafe(f)),e)}function bt(){v.activeCombo=!1;v.formState.VEHICLE_ACCEPTED=!0;u(function(){v.activeCombo=!0})}function p(){var n=f.defer();return t.getRanges(v.activeRangeId==null?-1:v.activeRangeId,v.plate.vehicle,v.plate.combination).then(function(t){var i=t.Data.filter(function(n){return n.Available});v.ranges=i;n.resolve(!0)}).catch(function(){n.resolve(!1)}),n.promise}function et(n){if(v.plate.combination&&(n===2||n===3)&&v.plate.combination.length>5){var t="It looks like your current combination <strong>("+v.plate.combination+")<\/strong> needs to be 5 characters or less for this vehicle selection. If you need to choose this particular vehicle, reset the combination and try again!";e.open("Oops!",t,250);return}v.plate.vehicle=n;v.formState.VEHICLE_ACCEPTED=!0;w($("#combination"));v.setFocusOnCombo();!v.preloadedPlate.combination||(v.plate.combination=v.preloadedPlate.combination,ot())}function ir(){if(v.vehicles)for(var n=0;n<=v.vehicles.length-1;n++)if(v.vehicles[n].VehicleTypeId===v.plate.vehicle)return v.vehicles[n].Name;return""}function kt(){v.formState.SUGGESTION_FINDING=!0;v.formState.SUGGESTION_NOT_FOUND=!1;t.getSuggestions(v.suggestioncriteria.RangeFrom,v.suggestioncriteria.RangeTo,!0,v.suggestioncriteria.PopularNumber,v.suggestioncriteria.RangeOfNumbers,!0,v.suggestioncriteria.ViewAll,v.plate.combination).then(function(n){s.info(n);v.suggestionModel=n.Data;v.formState.SUGGESTION_FINDING=!1;n.Data.length===0&&(v.formState.SUGGESTION_NOT_FOUND=!0)})}function rr(){v.formState.SUGGESTION_INIT=!1;v.formState.SUGGESTION_COMPLETE=!1;v.formState.SUGGESTION_CHECKING=!1}function ur(){v.formState.SUGGESTION_MORE=!0;v.suggestionModel=null;kt();w($("#combination-suggestion"))}function fr(n){c.sendEvent("suggestion","click",n);v.plate.combination=n;v.formState.SUGGESTION_MORE=!1;v.checkAvailable()}function ot(){var n=f.defer();if(v.plate.combination)return st(),rr(),v.formState.COMBO_CHECKING=!0,t.isAvailableWithVehicle(v.plate.combination,v.plate.vehicle,!0).then(function(i){var r=i.Data.Available;v.formState.COMBO_UNAVAILABLE=!r;v.formState.COMBO_AVAILABLE=r;!!v.preloadedPlate.range&&r&&lt();r?a.trackEvent("chooseCombination",{attributes:{currentPlateCombination:v.plate.combination,plateAvailability:!0}}):(v.formState.SUGGESTION_INIT=!0,v.formState.SUGGESTION_CHECKING=!0,t.getSuggestions(0,8,!0,!1,!0,!0,!1,v.plate.combination).then(function(n){v.suggestionModel=n.Data;v.formState.SUGGESTION_CHECKING=!1;v.formState.SUGGESTION_COMPLETE=!0}));v.formState.COMBO_CHECKED=!0;v.formState.COMBO_CHECKING=!1;n.resolve(r)}),n.promise}function st(n){n&&(v.plate.combination="");v.formState.COMBO_CHECKING=!1;v.formState.COMBO_CHECKED=!1;v.formState.COMBO_AVAILABLE=!1;v.formState.COMBO_UNAVAILABLE=!1;v.suggestionModel=null;v.setFocusOnCombo()}function er(n){v.sidePanelContent={};i.getContent(n).then(function(n){v.sidePanelContent=n})}function or(n,t){for(var e,r,o=t||window.location.search.substring(1),u=o.split(/[&||?]/),f="",i=0;i<u.length;i+=1)e=u[i],r=(e||"").split("="),r[0]===n&&(f=r[1]);return f}function sr(){var n=l.search();!n.combination||(v.preloadedPlate.combination=n.combination);!n.vehicle||(v.preloadedPlate.vehicle=n.vehicle);!n.design||(v.preloadedPlate.design=n.design);!n.dualDesign||(v.preloadedPlate.dualDesign=n.dualDesign);!n.range||(v.preloadedPlate.range=n.range)}var v=this,g,tt;v.ranges=[];v.captionColours={};v.captionCavityMm=330;g="Unfortunately, there appears to be a problem adding this plate to your shopping cart. Sorry about that. If this just doesn't make sense or the problem continues, please give us a call on 0800 650 111.";v.hashTagCopy="Available in 2 sizes, please check dimensions.";v.plate={combination:null,design:{Id:null,Name:null,SizeId:null,IsDirty:!1,ForegroundColourId:null,TopCaptionAvailable:null,TopCaption:null,TopCaptionDirty:!1,TopCaptionColour:null,BottomCaptionAvailable:null,BottomCaption:null,BottomCaptionDirty:!1,BottomCaptionColour:null,DisableOnlineSale:!1,DisableOnlineMessage:"",RangeName:"",DualSizeOptions:[]},sizingOptions:[],dualSizePlateStyle:null,dualSize:null,suggestions:[]};v.dualSizeOptionsAvailable=function(){return v.plate.vehicle===1?h("filter")(v.plate.sizingOptions,{Colours:{ForegroundColourId:v.plate.design.ForegroundColourId}},!0).length>1:!1};v.preloadedPlate={combination:null,design:null,range:null,vehicle:null};v.activeSuggestionIndex=0;v.suggestioncriteria={combination:null,PopularNumber:!0,RangeOfNumbers:!0,RangeFrom:0,RangeTo:25,ViewAll:!1};v.formats=[{Id:0,Name:"3 x 2",Fixed:!0,Triple:!1,Desc:"Three letters followed by two numbers.",Format:/^[A-Za-z]{3}[0-9]{2}$/,Url:"image/20/ABC12/1/4/max/150"},{Id:1,Name:"3 x 3",Fixed:!0,Triple:!1,Desc:"Three letters followed by three numbers.",Format:/^[A-Za-z]{3}[0-9]{3}$/,Url:"image/20/ABC123/1/4/max/150"},{Id:2,Name:"2 x 3",Fixed:!0,Triple:!1,Desc:"Two numbers followed by three letters.",Format:/^[0-9]{2}[A-Za-z]{3}$/,Url:"image/20/12ABC/1/4/max/150"},{Id:3,Name:"3 x 3",Fixed:!0,Triple:!1,Desc:"Three numbers followed by three letters.",Format:/^[0-9]{3}[A-Za-z]{3}$/,Url:"image/20/123ABC/1/4/max/150"},{Id:4,Name:"3 x 1",Fixed:!0,Triple:!1,Desc:"Three letters followed by one number.",Format:/^[A-Za-z]{3}[0-9]{1}$/,Url:"image/68/ABC1/4/4/max/150"},{Id:5,Name:"1 x 3",Fixed:!0,Triple:!1,Desc:"One number followed by three letters.",Format:/^[0-9]{1}[A-Za-z]{3}$/,Url:"image/68/1ABC/4/4/max/150"},{Id:6,Name:"3",Fixed:!1,Triple:!0,Desc:"Any three letters or numbers.",Format:/^[A-Za-z0-9]{3}$/,Url:"image/20/ABC/1/4/max/150"},{Id:7,Name:"4 Alpha",Fixed:!1,Triple:!1,Desc:"Any four letters or numbers.",Format:/^[A-Za-z0-9]{4}$/,Url:"image/20/ABCD/1/4/max/150"},{Id:8,Name:"5 Alpha",Fixed:!1,Triple:!1,Desc:"Any five letters or numbers.",Format:/^[A-Za-z0-9]{5}$/,Url:"image/20/ABCDE/1/4/max/150"},{Id:9,Name:"6 Alpha",Fixed:!1,Triple:!1,Desc:"Any six letters or numbers.",Format:/^[A-Za-z0-9]{6}$/,Url:"image/20/ABCDEF/1/4/max/150"},{Id:10,Name:"2",Fixed:!1,Triple:!0,Desc:"Any two letters or numbers.",Format:/^[A-Za-z0-9]{2}$/,Url:"image/20/AB/1/4/max/150"}];v.formState={FORM_INIT:!1,VEHICLE_ACCEPTED:!1,COMBO_CHECKING:!1,COMBO_CHECKED:!1,COMBO_AVAILABLE:!1,COMBO_UNAVAILABLE:!1,COMBO_ACCEPTED:!1,SUGGESTION_INIT:!1,SUGGESTION_CHECKING:!1,SUGGESTION_COMPLETE:!1,SUGGESTION_FINDING:!1,SUGGESTION_NOT_FOUND:!1,DESIGN_SELECTED:!1,CONFIG_INIT:!1,RANGE_SELECTED:!1,RANGE_SELECTED_SUBCATEGORY:!1,RANGES_LOADED:!1,DISABLE_SALE:!1,BUYING:!1};v.laybyAllowed=!1;v.laybyDepositAmount=0;v.checkAvailable=ot;v.findSuggestions=kt;v.showSuggestionEngine=ur;v.resetComboCheckForm=st;v.setComboAccepted=lt;v.getSidePanelContent=er;v.setVehicle=et;v.getVehicle=ir;v.getRanges=p;v.userSelectRange=vi;v.setFocusOnCombo=bt;v.getDesigns=b;v.resetToCombo=at;v.resetToRange=vt;v.generateRangeImage=nr;v.generatePlateImage=d;v.generateDualSizePlateImage=tr;v.userSetDesign=yi;v.setDualSize=ft;v.setColour=ai;v.setSize=li;v.addToCart=hi;v.getAPI=fi;v.calculateFormatPrice=ui;v.matchesFormat=ri;v.isFixedFormat=ct;v.combinationInversionTest=ii;v.calculateCavityWidthRemaining=ti;v.captionColourNameById=bi;v.hoverCaption=ni;v.registerSuggestionClick=fr;v.sideBarIsRequired=gt;v.getRelativeDualSizeWidth=di;n.$on("$locationChangeSuccess",function(n,t,i){var r=i.substring(i.indexOf("#")+1),u=t.substring(t.indexOf("#")+1);switch(u){case"choose-combination":r==="choose-range"&&at();break;case"choose-range":r==="choose-design"||r==="choose-sub-range"?vt():r==="choose-combination"&&ot()}});v.path={combination:"choose-combination",range:"choose-range",subrange:"choose-sub-range",design:"choose-design"};tt=["Oops","Oh no"];n.$watch("vm.formState.COMBO_AVAILABLE",function(n){n||(v.randomOops=tt[Math.floor(Math.random()*tt.length)])});n.$watch("[vm.plate.design.BottomCaption, vm.plate.design.TopCaption, vm.plate.design.BottomCaptionColour,vm.plate.design.TopCaptionColour]",function(){wt(v.plate.design)});v.selectSizing=function(){v.formState.DESIGN_SELECTED=!0;v.formState.RANGE_SELECTED=!0;ft(h("filter")(v.plate.sizingOptions,{Colours:{ForegroundColourId:v.plate.design.ForegroundColourId}},!0)[0]);window.scrollTo(0,0)};n.$watch("vm.plate.combination",function(n,t){v.formState.COMBO_ACCEPTED=!1;n!==t&&(it(),st());t===null&&(v.suggestionModel=null)});dt()}angular.module("nzpApp").controller("plateController",n);n.$inject=["$scope","plateService","sidePanelService","basketService","$timeout","$q","modalService","$window","$log","$filter","googleAnalyticsService","$location","GTMService"]}(),function(){"use strict";function n(n,t){function r(){return n.fetch(t.ENDPOINTS.Designs.GetCaptionFontMap,arguments)}function u(){return n.fetch(t.ENDPOINTS.Designs.GetPrice,arguments)}function f(){return n.fetch(t.ENDPOINTS.Basket.LaybyQuoteAmount,arguments)}function e(){return n.fetch(t.ENDPOINTS.Designs.GetAllCaptionColours,arguments)}function o(){return n.fetch(t.ENDPOINTS.Designs.GetCaptionColoursByDesign,arguments)}function s(){return n.fetch(t.ENDPOINTS.Ranges.GetTopLevel,arguments)}function h(){return n.fetch(t.ENDPOINTS.Ranges.GetRanges,arguments)}function c(){return n.fetch(t.ENDPOINTS.Ranges.GetRangeById,arguments)}function l(){return n.fetch(t.ENDPOINTS.Designs.GetDesigns,arguments)}function a(){return n.fetch(t.ENDPOINTS.Designs.GetColours,arguments)}function v(){return n.fetch(t.ENDPOINTS.Designs.GetSizes,arguments)}function y(){return arguments[0]=arguments[0].replace(/ /g,""),n.fetch(t.ENDPOINTS.Combinations.IsAvailable,arguments)}function p(){return arguments[0]=arguments[0].replace(/ /g,""),n.fetch(t.ENDPOINTS.Combinations.IsAvailableForRedesign,arguments)}function w(){return arguments[0]=arguments[0].replace(/ /g,""),n.fetch(t.ENDPOINTS.Combinations.IsValidForVehicle,arguments)}function b(){return n.fetch(t.ENDPOINTS.Combinations.GetSuggestions,arguments)}function k(){return n.fetch(t.ENDPOINTS.Vehicles.GetAllVehicles,arguments)}function i(){var t=330,n="[^ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~'!@#$%^&*:;_ \\()-+=./?-{},\"][><]";return{validate:function(n,t,i){return this.remaining(n,t)<0?this.remaining(n,i)>=0?i:this.trim(n,t):t},getWidth:function(n,t){var r,i,u;if(!n||!t||t.length===0)return 0;for(r=0,i=0;i<=t.length-1;i++)u=t[i]===" "?"\\":t[i].toUpperCase(),r+=n[u]?n[u]:27.5;return Math.ceil(r)},trim:function(n,t){var i,r;if(!n||!t)return"";for(i="",r=0;r<=t.length-1;r++)this.remaining(n,i+t[r])>0&&(i+=t[r]);return i===t?t:i},remaining:function(n,i){return t-this.getWidth(n,i)},stripChars:function(t){var r,i,u;if(!t||!n)return"";for(r="",i=0;i<=t.length-1;i++)u=t[i].toUpperCase(),n.indexOf(u)>-1&&(r+=u);return r},makeSafe:function(n){return n?n.replace(/\%/g,"%25").replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B"):""}}}function d(n,r,u,f,e,o,s,h,c){var l=t.REMOTES.RemoteUri,a;return l+="/image",l+="/"+n,l+="/"+r,l+="/"+u,l+="/"+f,l+="/max/"+e,a="",h&&c&&(a="?",l+=a+"bcc="+h+"&bct="+i().makeSafe(c)),s&&o&&(a=a==="?"?"&":"?",l+=a+"tcc="+o+"&tct="+i().makeSafe(s)),l}return{isAvailable:y,isAvailableForRedesign:p,isAvailableWithVehicle:w,getSuggestions:b,getVehicles:k,getRootRanges:s,getRanges:h,getRangeById:c,getDesigns:l,getSizes:v,getColours:a,getCaptionColours:e,getCaptionColoursByDesign:o,generateImageUrl:d,getPrice:u,laybyQuoteAmount:f,getCaptionFont:r,captionFns:i}}angular.module("nzpApp").service("plateService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(){var n=this;n.stories=window.plateStories;n.selectedStory={};n.selectedStoryIndex=0;$(".story-images").slick({slidesToScroll:1,arrows:!0,slide:".kp-plate-story-modal-image",adaptiveHeight:!1,autoplay:!0,autoplaySpeed:3e3,dots:!0,draggable:!0,infinite:!0,prevArrow:'<button class="slick-prev kp-plate-stories-carousel-arrow"><i class="fas fa-chevron-left"><\/i><\/button>',nextArrow:'<button class="slick-next kp-plate-stories-carousel-arrow"><i class="fas fa-chevron-right"><\/i><\/button>'});n.selectStory=function(t){n.selectedStoryIndex=t;n.selectedStory=n.stories[t];var i=n.updateUrlParameter(window.location.href,"story",n.selectedStory.title.replace(/\s+/g,""));window.history.pushState({path:i},"",i);$("#kp-plate-story-modal").modal("show")};n.nextStory=function(){n.selectedStoryIndex<n.stories.length?n.selectedStoryIndex++:n.selectedStoryIndex=0;n.selectedStory=n.stories[n.selectedStoryIndex]};n.previousStory=function(){n.selectedStoryIndex>0?n.selectedStoryIndex--:n.selectedStoryIndex=n.stories.length;n.selectedStory=n.stories[n.selectedStoryIndex]};n.endsWith=function(n,t){return n.indexOf(t,n.length-t.length)!==-1};n.init=function(){n.detectIE()||Macy({container:".kp-plate-stories-container",waitForImages:!1,columns:3,margin:{x:5,y:5},breakAt:{768:2,600:1}});$("#kp-plate-story-modal").on("shown.bs.modal",function(){for(var t=0;t<n.selectedStory.imageUrls.length;t++)n.endsWith(n.selectedStory.imageUrls[t],".mp4")?$(".story-images").slick("slickAdd",'<div class="kp-plate-story-modal-image"><video style="width: 100%;" controls><source src="'+n.selectedStory.imageUrls[t]+'" type="video/mp4"><\/video><\/div>'):$(".story-images").slick("slickAdd",'<div class="kp-plate-story-modal-image"><img src="'+n.selectedStory.imageUrls[t]+'" /><\/div>')}).on("hidden.bs.modal",function(){for(var t=0;t<n.selectedStory.imageUrls.length;t++)$(".story-images").slick("slickRemove",null,null,!0)})};n.detectIE=function(){var n=window.navigator.userAgent,i=n.indexOf("MSIE "),t,r;return i>0?!0:(t=n.indexOf("Trident/"),t>0)?(r=n.indexOf("rv:"),!0):!1};n.updateUrlParameter=function(n,t,i){var r=n.indexOf("#"),e=r===-1?"":n.substr(r),u,f;return n=r===-1?n:n.substr(0,r),u=new RegExp("([?&])"+t+"=.*?(&|$)","i"),f=n.indexOf("?")!==-1?"&":"?",i?n=n.match(u)?n.replace(u,"$1"+t+"="+i+"$2"):n+f+t+"="+i:(n=n.replace(new RegExp("([?&]?)"+t+"=[^&]*","i"),""),n.slice(-1)==="?"&&(n=n.slice(0,-1)),n.indexOf("?")===-1&&(n=n.replace(/&/,"?"))),n+e};n.init()}angular.module("nzpApp").controller("plateStoriesController",n);n.$inject=["$scope","$timeout"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){function et(){ri();t.getCaptionFont().then(function(n){l.plateFont=n.Data});var n=document.querySelectorAll("body");n=Array.prototype.slice.call(n);n.forEach(function(){window.addEventListener("resize",p)});l.preloadedPlate.combination&&(l.formState.PRELOADEDPLATE_INIT=!0,l.plate.combination=l.preloadedPlate.combination,d())}function ot(n){return l.captionColours.length>0?h("filter")(l.captionColours,{CaptionColourId:n},!0)[0].Name:""}function st(n){var t,i,r;if(l.plate.dualSize&&l.plate.design){if(n){for(t=0,i=0;i<l.plate.sizingOptions.length;i++)t=l.plate.sizingOptions[i].Sizes[0].Width_mm>t?l.plate.sizingOptions[i].Sizes[0].Width_mm:t;return 100/t}return r=l.plate.design.Sizes[0].Width_mm>=l.plate.dualSize.Sizes[0].Width_mm?l.plate.design.Sizes[0].Width_mm:l.plate.dualSize.Sizes[0].Width_mm,100/r}return 0}function ht(){return s.info(o.API_ENDPOINT),o.API_ENDPOINT}function ct(n){return t.captionFns().remaining(w(),n)}function w(){if(l.plateFont)return l.plate.design.TopCaptionAvailable&&l.plate.design.BottomCaptionAvailable||l.plate.design.Name==="I Love Message"?l.plateFont.CharacterMapSmall:l.plateFont.CharacterMapLarge}function lt(){o.location.reload()}function d(){t.isAvailable(l.plate.combination,!0).then(function(n){var t=n.Data,i,r;t.Available===!1?t.IsAvailableForRedesign||t.IsAvailableForUpgrade?(l.formState.DESIGNS_LOADING=!0,l.formState.COMBO_ACCEPTED=!0,l.formState.RANGES_INIT=!0,l.formState.UPGRADE_TYPE_SET=!0,l.plate.isUpgrade=t.IsAvailableForUpgrade?!0:!1,p(),l.preloadedPlate&&l.preloadedPlate.range?at():a(l.activeParentId,l.plate.vehicleId,"SAMPLE").then(function(n){l.formState.RANGES_INIT=!1;l.formState.RANGES_LOADED=!0;l.ranges=n;tt(l.ranges[0])})):(i="Oops! Cannot proceed with upgrade",r="Unfortunately this combination does no appear to be eligible for an upgrade or a redesign. Please give us a call on 0800 650 111 and we can assist you with this purchase.",e.open(i,r,250),l.formState.COMBO_ACCEPTED=!1):(i="Oops! Cannot proceed with upgrade",r="Unfortunately this combination does no appear to be eligible for an upgrade or a redesign. Please give us a call on 0800 650 111 and we can assist you with this purchase.",e.open(i,r,250),l.formState.COMBO_ACCEPTED=!1)})}function at(){l.formState.DESIGNS_LOADING=!0;a(l.activeParentId,l.plate.vehicleId,"SAMPLE").then(function(n){l.ranges=n;var i=h("filter")(l.ranges,{Id:parseInt(l.preloadedPlate.range)},!0)[0];i?(b(i),g()):t.getRangeById(l.preloadedPlate.range).then(function(n){if(n.Data.ParentRangeId!==-1){var t=h("filter")(l.ranges,{Id:parseInt(n.Data.ParentRangeId)},!0)[0];t&&b(t);a(n.Data.ParentRangeId,l.plate.vehicleId,"SAMPLE").then(function(n){l.childRanges=n;var t=h("filter")(l.childRanges,{Id:parseInt(l.preloadedPlate.range)},!0)[0];t&&(it(t),g())})}})})}function g(){l.preloadedPlate.design&&y(l.selectedChildRange?l.selectedChildRange.Id:l.selectedRange.Id).then(function(n){var t,r,i;if(l.designs=n,t=h("filter")(l.designs,{Id:parseInt(l.preloadedPlate.design)},!0)[0],t&&(v(t),l.preloadedPlate.foregroundColourId&&nt(parseInt(l.preloadedPlate.foregroundColourId)),l.preloadedPlate.dualDesign)){for(r=null,i=0;i<t.DualSizeOptions.length;i++)t.DualSizeOptions[i].Id==l.preloadedPlate.dualDesign&&(r=t.DualSizeOptions[i]);r&&rt(r)}l.formState.DESIGNS_LOADING=!1})}function nt(n){var t,i,r;if(l.plate.design.Colours)for(l.plate.dualSize=null,t=0;t<=l.plate.design.Colours.length-1;t++)i=l.plate.design.Colours[t],r=n===i.ForegroundColourId,i.Active=r,r&&(l.plate.design.ForegroundColourId=n,l.plate.design.image=k(l.plate.design,null,t))}function vt(n){return"/plateranges/"+n+"/image"}function yt(){l.selectedRange=null;l.parentId=-1;a(-1,1,l.plate.combination)}function a(n,i,r){l.formState.RANGES_LOADED=!1;var u=f.defer();return t.getRanges(n,i,r).then(function(n){var t=n.Data.filter(function(n){return n.Available});u.resolve(t);l.formState.RANGES_LOADED=!0}).catch(function(){u.resolve(!1)}),p(),u.promise}function tt(n){l.formState.DESIGNS_LOADING=!0;b(n);l.selectedRange&&(l.selectedRange&&l.selectedRange.HasChildRange?a(l.selectedRange.Id,1,l.plate.combination).then(function(n){l.childRanges=n;l.selectedChildRange=n[0];y(l.selectedChildRange.Id).then(function(n){l.designs=n;v(n[0]);l.formState.DESIGNS_LOADING=!1})}):(l.childRanges=[],y(l.selectedRange.Id).then(function(n){l.designs=n;v(n[0]);l.formState.DESIGNS_LOADING=!1})))}function b(n){l.selectedRange=n}function pt(n){it(n)}function it(n){l.selectedChildRange=n;l.selectedChildRange&&y(l.selectedChildRange.Id).then(function(n){l.designs=n;v(n[0])})}function wt(n){v(n)}function v(n){if(l.plate.design=n,l.plate.design.rangeId=l.selectedRange.Id,l.plate.design.ForegroundColourId=n.Colours[0].ForegroundColourId,!l.formState.DESIGN_SELECTED)if(n.DualSizeOptions&&n.DualSizeOptions.length>0){var i=[n];l.plate.sizingOptions=i.concat(n.DualSizeOptions)}else l.plate.sizingOptions=[];(n.TopCaptionAvailable||n.BottomCaptionAvailable)&&(l.captionColours={},t.getCaptionColoursByDesign(n.Id).then(function(n){l.captionColours=n.Data;l.captionColours&&(ni(),ti())}));l.plate.design.DisableOnlineSale=n.DisableOnlineSale;l.plate.design.DisableOnlineMessage=n.DisableOnlineMessage;l.formState.DISABLE_SALE=l.plate.design.DisableOnlineSale?!0:!1;ut();l.plate.design.image=k(n,1200,0,0)}function bt(n){rt(n)}function rt(n){l.plate.dualSize=n;ut()}function y(n){l.formState.DESIGNS_LOADED=!1;var i=f.defer();return u(function(){t.getDesigns(l.plate.vehicleId,l.plate.combination,n).then(function(n){var t=n.Data.filter(function(n){return n.Available&&n.SuitableForVehicleType});l.formState.DESIGNS_LOADED=!0;i.resolve(t)}).catch(function(){i.resolve(!1)})},0),i.promise}function kt(){l.formState.COMBO_ACCEPTED=!1;l.formState.UPGRADE_TYPE_SET=!1;l.formState.RANGES_LOADED=!1;l.formState.DESIGNS_LOADED=!1;l.plate.combination=null}function ut(){if(l.plate.design){var n=null,t=l.plate.isUpgrade?3:2,i=t===3?l.plate.design.UpgradePrice:l.plate.design.RedesignPrice;l.plate.dualSize&&(n=t===3?l.plate.dualSize.UpgradePrice:l.plate.dualSize.RedesignPrice);l.price=n&&n>i?n:i}}function dt(){gt(l.plate.design)&&(l.formState.ADDING_TO_CART=!0,r.getBasketId().then(function(n){var f=l.plate.combination.replace(/\s/g,""),i,u,t;l.plate.dualSize&&(!l.plate.design.TopCaptionAvailable||!l.plate.design.BottomCaptionAvailable)&&(l.plate.dualSize.TopCaptionAvailable||l.plate.dualSize.BottomCaptionAvailable)&&(i=l.plate.design.Id,u=l.plate.design.Sizes,l.plate.design.Id=l.plate.dualSize.Id,l.plate.design.Sizes=l.plate.dualSize.Sizes,l.plate.dualSize.Id=i,l.plate.dualSize.Sizes=u);t={Combination:f,Combination_Layout:l.plate.combination,plateDesignId:l.plate.design.Id,vehicleTypeId:l.plate.vehicleId,foregroundColourId:l.plate.design.ForegroundColourId,plateSizeId:l.plate.design.Sizes[0].PlateSizeId,TransactionTypeId:l.plate.isUpgrade?3:2};l.plate.dualSize&&l.plate.dualSize.Id!==l.plate.design.Id&&(t.DualPlateDesignId=l.plate.dualSize.Id,t.DualPlateForegroundColourId=l.plate.dualSize.Colours[0].ForegroundColourId,t.DualPlateSizeId=l.plate.dualSize.Sizes[0].PlateSizeId);(l.plate.design.TopCaptionAvailable||l.plate.dualSize&&l.plate.dualSize.TopCaptionAvailable)&&(t.captionTopText=l.plate.design.TopCaption.toUpperCase(),t.captionTopColourId=l.plate.design.TopCaptionColour);(l.plate.design.BottomCaptionAvailable||l.plate.dualSize&&l.plate.dualSize.BottomCaptionAvailable)&&(t.captionBottomText=l.plate.design.BottomCaption.toUpperCase(),t.captionBottomColourId=l.plate.design.BottomCaptionColour);r.addLineItem(n,t).then(function(n){var r=n.Success,i,t;r&&n.Data?window.location="/cart":(l.formState.ADDING_TO_CART=!1,i="Oops! There was an issue adding this plate to the shopping cart.",t="If this problem persists, please call us on 0800 650 111.",n.Message&&(t+="<br /><h5>Detail: "+n.Message+"<\/h5>"),e.open(i,t))}).finally(function(){l.formState.BUYING=!1})}).finally(function(){l.formState.ADDING_TO_CART=!1}))}function gt(n){var t,i;return n.TopCaptionAvailable&&l.plate.design.TopCaption===l.captionDefaultText?(t="Oops! Cannot proceed with upgrade",i="Please make sure you set a top caption for this plate.",e.open(t,i,250),!1):n.BottomCaptionAvailable&&l.plate.design.BottomCaption===l.captionDefaultText?(t="Oops! Cannot proceed with upgrade",i="Please make sure you set a bottom caption for this plate.",e.open(t,i,250),!1):!0}function ni(){l.captionColours.sort(function(n,t){var i=n.Name.toUpperCase(),r=t.Name.toUpperCase();return i<r?-1:i>r?1:0})}function ti(){var n=l.plate.design.TopCaptionColour,t=l.plate.design.BottomCaptionColour;ft(n)||(l.plate.design.TopCaptionColour=l.captionColours[0].CaptionColourId);ft(t)||(l.plate.design.BottomCaptionColour=l.captionColours[0].CaptionColourId)}function ft(n){for(var t=0;t<=l.captionColours.length-1;t++)if(l.captionColours[t].CaptionColourId===n)return!0;return!1}function k(n,i,r,u){var c,e,s,o,f;if(n&&n.Sizes&&n.Colours)return(c=h("filter")(n.Colours,{ForegroundColourId:l.plate.design.ForegroundColourId},!0)[0],i=i?i:1200,r=r?r:n.Colours.indexOf(c)===-1?0:n.Colours.indexOf(c),u=u?u:0,!n.Sizes[u])?void 0:(e="/image",e+="/"+n.Id,e+="/"+l.plate.combination,e+="/"+n.Sizes[u].PlateSizeId,e+="/"+n.Colours[r].ForegroundColourId,e+="/max/"+i+"",n.BottomCaptionAvailable&&(s="?",f="",l.plate.design.BottomCaptionDirty?(f=t.captionFns().stripChars(l.plate.design.BottomCaption),f=t.captionFns().validate(w(),f,f),l.plate.design.BottomCaption!==null&&l.plate.design.BottomCaption!==""&&f.toUpperCase()!==l.plate.design.BottomCaption.toUpperCase()&&(l.plate.design.BottomCaption=f.toUpperCase())):(l.plate.design.BottomCaption="ENTER A MESSAGE",l.plate.design.BottomCaptionDirty=!0),o=l.plate.design.BottomCaptionColour?l.plate.design.BottomCaptionColour:4,l.plate.design.BottomCaptionColour=o,e+=s+"bcc="+o+"&bct="+t.captionFns().makeSafe(f)),n.TopCaptionAvailable&&(s=s==="?"?"&":"?",f="",l.plate.design.TopCaptionDirty?(f=t.captionFns().stripChars(l.plate.design.TopCaption),f=t.captionFns().validate(w(),f,f),l.plate.design.TopCaption!==null&&l.plate.design.TopCaption!==""&&f.toUpperCase()!==l.plate.design.TopCaption.toUpperCase()&&(l.plate.design.TopCaption=f.toUpperCase())):(l.plate.design.TopCaption="ENTER A MESSAGE",l.plate.design.TopCaptionDirty=!0),o=l.plate.design.TopCaptionColour?l.plate.design.TopCaptionColour:4,l.plate.design.TopCaptionColour=o,e+=s+"tcc="+o+"&tct="+t.captionFns().makeSafe(f)),e)}function ii(n,t,i,r){r=r?r:1200;var u="/image";return u+="/"+n,u+="/"+l.plate.combination,u+="/"+t,u+="/"+i,u+("/max/"+r+"")}function p(){u(function(){var n=$("#combination"),e=$("#combination-input").width(),i=e*.492,t=i*.347,r=t*.055,u=r*2,f=(t+u*2)*.7;n.width(i);n.height(t);n.css("font-size",f+"px");n.css("line-height",l.isMobileDevice?"1em":f+"px");n.css("border-width",r+"px");n.css("border-radius",u+"px")},0)}function ri(){var n=c.search();!n.combination||(l.preloadedPlate.combination=n.combination);!n.range||(l.preloadedPlate.range=n.range);!n.foregroundColour||(l.preloadedPlate.foregroundColourId=n.foregroundColour);!n.design||(l.preloadedPlate.design=n.design);!n.dualDesign||(l.preloadedPlate.dualDesign=n.dualDesign)}var l=this;l.ranges=[];l.designs=[];l.childRanges=[];l.slides=[];l.activeRange={};l.activeDesign=null;l.slideIndex=0;l.captionDirty=!1;l.captionDefaultText="ENTER A MESSAGE";l.activeParentId=-1;l.selectedRange=null;l.selectedChildRange=null;l.parentId=-1;l.parentName=null;l.price=null;l.preloadedPlate={};l.plate={combination:null,isUpgrade:!1,vehicleId:1,design:{Id:null,Name:null,SizeId:null,IsDirty:!1,ForegroundColourId:null,TopCaptionAvailable:null,TopCaption:null,TopCaptionDirty:!1,TopCaptionColour:null,BottomCaptionAvailable:null,BottomCaption:null,BottomCaptionDirty:!1,BottomCaptionColour:null,DisableOnlineSale:!1,DisableOnlineMessage:"",DualSizeOptions:[],ImageUrl:""},sizingOptions:[],dualSize:null,suggestions:[]};l.formState={FORM_INIT:!0,UPGRADE_TYPE_SET:!1,COMBO_ACCEPTED:!1,RANGES_INIT:!1,RANGES_LOADED:!1,DESIGNS_LOADING:!1,TRANSACTIONTYPE_SELECTED:!1,ADDING_TO_CART:!1,DESIGN_SELECTED:!1};l.generateRangeImage=vt;l.generatePlateImage=k;l.generateDualSizePlateImage=ii;l.setCombination=d;l.userSelectRange=tt;l.userSelectChildRange=pt;l.userSelectDesign=wt;l.userSelectDualSize=bt;l.getRootRanges=yt;l.getRanges=a;l.getDesigns=y;l.setColour=nt;l.addUpgradeToBasket=dt;l.resetForm=kt;l.reloadPage=lt;l.calculateCavityWidthRemaining=ct;l.getAPI=ht;l.captionColourNameById=ot;l.getRelativeDualSizeWidth=st;l.dualSizeOptionsAvailable=function(){return l.plate.vehicleId===1?h("filter")(l.plate.sizingOptions,{Colours:{ForegroundColourId:l.plate.design.ForegroundColourId}},!0).length>1:!1};l.selectSizing=function(){l.formState.DESIGN_SELECTED=!0;setDualSize(l.plate.sizingOptions[0])};l.showCaptionContainer=function(){return l.plate.design.TopCaptionAvailable||l.plate.design.BottomCaptionAvailable||l.plate.dualSize&&l.plate.dualSize.TopCaptionAvailable||l.plate.dualSize&&l.plate.dualSize.BottomCaptionAvailable};l.selectSizes=function(){l.formState.DESIGN_SELECTED=!0;l.plate.dualSize=l.plate.sizingOptions[0]};l.resetToRange=function(){l.formState.DESIGN_SELECTED=!1;l.plate.dualSize=null};n.$watch("[vm.formState.TRANSACTIONTYPE_SELECTED]",function(){p()});et()}angular.module("nzpApp").controller("redesignController",n);n.$inject=["$scope","plateService","sidePanelService","basketService","$timeout","$q","modalService","$window","$log","$filter","$location"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function v(){nt()}function y(){t.isAvailable(o.settings.COMBINATION,!0).then(function(n){var t=n.Data;t.Available===!1&&(t.IsAvailableForRedesign===!0||t.IsAvailableForUpgrade===!0)?(o.formState.COMBO_ACCEPTED=!0,o.settings.UPGRADE_TYPE=t.IsAvailableForRedesign===!0?s.UPGRADE_TYPE.Redesign:s.UPGRADE_TYPE.Upgrade,h(-1)):g(1)})}function p(n,i,r,u){return t.getRanges(n,i,r,u)}function w(n){n.HasChildRange&&h(n.Id);c(n.Id)}function h(n){p(n,o.settings.VEHICLE_TYPE,o.settings.COMBINATION,o.settings.UPGRADE_TYPE).then(function(n){b(n.Data);k(n.Data[0].Id)})}function b(n){o.ranges=n}function k(n){n>=0||(n=0);o.settings.SELECTED_RANGE=n;c(n)}function c(n){t.getDesigns(o.settings.VEHICLE_TYPE,o.settings.COMBINATION,n).then(function(n){o.designs=n.Data})}function d(n,t,i,r){var u,e,s,f;if(n&&n.Sizes&&n.Colours)return(t=t?t:1200,i=i?i:0,r=r?r:0,!n.Sizes[r])?void 0:(u="/image",u+="/"+n.Id,u+="/"+o.plate.combination,u+="/"+n.Sizes[r].Front.PlateSizeId,u+="/"+n.Colours[i].ForegroundColourId,u+="/max/"+t+"",n.BottomCaptionAvailable&&(e="?",f=o.plate.design.BottomCaptionDirty?o.plate.design.BottomCaption:"SAMPLE TEXT",o.plate.design.BottomCaption=f.toUpperCase(),o.plate.design.BottomCaptionDirty=!0,s=o.plate.design.BottomCaptionColour?o.plate.design.BottomCaptionColour:4,u+=e+"bcc="+s+"&bct="+l(f)),n.TopCaptionAvailable&&(e=e==="?"?"&":"?",f=o.plate.design.TopCaptionDirty?o.plate.design.TopCaption:"SAMPLE TEXT",o.plate.design.TopCaption=f.toUpperCase(),o.plate.design.TopCaptionDirty=!0,s=o.plate.design.TopCaptionColour?o.plate.design.TopCaptionColour:4,u+=e+"tcc="+s+"&tct="+l(f)),u)}function g(n){switch(n){case 1:e.open("Oops! Cannot proceed with upgrade","Unfortunately this combination does no appear to be eligible for an upgrade or a redesign. Please give us a call on 0800 650 111 and we can assist you with this purchase.",250);o.formState.COMBO_ACCEPTED=!1}}function l(n){return n.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B")}function nt(){a();var n=document.querySelectorAll("body");n=Array.prototype.slice.call(n);n.forEach(function(){window.addEventListener("resize",a)})}function a(){u(function(){var n=$("#combination"),e=$("#combination-input").width(),i=e*.492,t=i*.347,r=t*.055,u=r*2,f=(t+u*2)*.7;n.width(i);n.height(t);n.css("font-size",f+"px");n.css("line-height",o.isMobileDevice?"1em":f+"px");n.css("border-width",r+"px");n.css("border-radius",u+"px")},0)}var o=this,s;o.setCombination=y;o.getRangesByParent=w;o.getRangesByParentId=h;o.generatePlateImage=d;o.settings={COMBINATION:null,VEHICLE_TYPE:1,UPGRADE_TYPE:0,SELECTED_RANGE:0};o.formState={FORM_INIT:!1,UPGRADE_TYPE_SET:!1,COMBO_ACCEPTED:!1,RANGES_INIT:!1,RANGES_LOADED:!1,DESIGNS_LOADED:!1};s={UPGRADE_TYPE:{Redesign:0,Upgrade:1},VEHICLE_TYPE:{MotorVehicle:1,Trailer:2,Motorcycle:3}};Object.freeze&&Object.freeze(s);v()}angular.module("nzpApp").controller("redesignController2",n);n.$inject=["$scope","plateService","sidePanelService","basketService","$timeout","$q","modalService","$window","$log"]}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.SidePanel.FetchContent,arguments)}return{getContent:i}}angular.module("nzpApp").service("sidePanelService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function h(){if(o.STATE_SURVEY_SAVING=!0,s()){var n=[];o.Questions.forEach(function(t){n.push({QuestionId:t.Id,Response:t.Answer})});i.info(n);e.saveSurvey(o.Survey.TransactionId,o.Survey.ResponseId,n).then(function(n){o.STATE_SURVEY_SAVING=!1;o.surveyResponse=n.Data;n.Success?(o.STATE.SURVEY_SAVED=!0,o.STATE.SAVE_ERROR=!1):(o.STATE.SURVEY_SAVED=!1,o.STATE.SAVE_ERROR=!0)})}}function s(){var i=o.Questions.length,t,n;if(i>0){for(t=0,n=0;n<=o.Questions.length-1;n++)t+=o.Questions[n].AnswerType===o.ANSWER_TYPE.TEXT||a(o.Questions[n])?1:0;o.STATE.SURVEY_COMPLETE=i===t}return o.STATE.SURVEY_COMPLETE}function c(){var n=r.search();typeof n.sid!="undefined"&&typeof n.id!="undefined"&&n.id>0&&n.sid>0&&(o.Survey.TransactionId=n.id,o.Survey.ResponseId=n.sid,e.getSurvey(o.Survey.TransactionId,o.Survey.ResponseId).then(function(n){if(o.STATE.SURVEY_INITIATED=!0,n.Data&&n.Data.UserCanProceed){o.STATE.VALID_SURVEY=!0;o.Questions=n.Data.Questions;for(var t=0;t<=o.Questions.length-1;t++)l(o.Questions[t])}else o.error=n.Message,o.STATE.VALID_SURVEY=!1}))}function l(n){switch(n.AnswerType){case o.ANSWER_TYPE.RATING:n.Answer=0;break;case o.ANSWER_TYPE.BOOLEAN:n.Answer=null;break;case o.ANSWER_TYPE.TEXT:n.Answer="";break;default:n.Answer=""}}function a(n){if(typeof n.Answer=="undefined"||n.Answer===null)return!1;switch(n.AnswerType){case o.ANSWER_TYPE.RATING:return n.Answer>0;case o.ANSWER_TYPE.BOOLEAN:return n.Answer===!1||n.Answer===!0||n.Answer.toLowerCase()==="true"||n.Answer.toLowerCase()==="false";case o.ANSWER_TYPE.TEXT:return n.Answer>"";default:return!1}}function v(){c()}var o=this;o.checkCompletion=s;o.saveSurvey=h;o.STATE={SURVEY_INITIATED:!1,VALID_SURVEY:!1,SAVE_ERROR:!1,SURVEY_COMPLETE:!1,SURVEY_SAVING:!1,SURVEY_SAVED:!1};o.ANSWER_TYPE={RATING:0,TEXT:1,BOOLEAN:2};o.Survey={ResponseId:null,TransactionId:null};o.Questions=[];o.rating={maxScore:10};o.rateFunction=function(){s()};v()}angular.module("nzpApp").controller("surveyController",n);n.$inject=["$scope","$q","$log","$location","googleAnalyticsService","modalService","surveyService"]}(),function(){"use strict";function n(n,t,i,r){function u(){return n.fetch(r.ENDPOINTS.Survey.GetSurvey,arguments)}function f(){return n.fetch(r.ENDPOINTS.Survey.SendSurvey,arguments)}return{getSurvey:u,saveSurvey:f}}angular.module("nzpApp").service("surveyService",n);n.$inject=["apiHelper","$cookies","$q","enums"]}(),function(){"use strict";var n=angular.module("rorymadden.date-dropdowns",[]);n.factory("rsmdateutils",function(){function i(n){return n.day>28?(n.day--,n):n.month>11?(n.day=31,n.month--,n):void 0}var r=this,n=[1,31],t=["January","February","March","April","May","June","July","August","September","October","November","December"];return{checkDate:function(n){var t;return!n.day||n.month===null||n.month===undefined||!n.year?!1:(t=new Date(Date.UTC(n.year,n.month,n.day)),t&&t.getMonth()===n.month&&t.getDate()===Number(n.day))?t:this.checkDate(i(n))},days:function(){for(var t=[];n[0]<=n[1];)t.push(n[0]++);return t}(),months:function(){for(var i=[],r=t.length,n=0;n<r;n++)i.push({value:n,name:t[n]});return i}()}});n.directive("rsmdatedropdowns",["rsmdateutils",function(){return{restrict:"A",replace:!0,require:"ngModel",scope:{model:"=ngModel"},controller:["$scope","rsmdateutils",function(n,t){n.days=t.days;n.months=t.months;n.dateFields={};n.dateFields.day=new Date(n.model).getUTCDate();n.dateFields.month=new Date(n.model).getUTCMonth();n.dateFields.year=new Date(n.model).getUTCFullYear();n.$watch("model",function(t){t&&(n.dateFields.day=new Date(t).getUTCDate(),n.dateFields.month=new Date(t).getUTCMonth(),n.dateFields.year=new Date(t).getUTCFullYear())});n.checkDate=function(){var i=t.checkDate(n.dateFields);i&&(n.model=i)}}],template:'<div class="form-inline">  <div class="form-group col-xs-5 col-sm-2 col-md-3">     <select name="dateFields.day" data-ng-model="dateFields.day" placeholder="Day" class="sm-form-control" ng-options="day for day in days" ng-change="checkDate()" ng-disabled="disableFields"><\/select>  <\/div>  <div class="form-group col-xs-7 col-sm-5 col-md-5">    <select name="dateFields.month" data-ng-model="dateFields.month" placeholder="Month" class="sm-form-control" ng-options="month.value as month.name for month in months" value="{{ dateField.month }}" ng-change="checkDate()" ng-disabled="disableFields"><\/select>  <\/div>  <div class="form-group col-xs-12 col-sm-5 col-md-4">    <select ng-show="!yearText" name="dateFields.year" data-ng-model="dateFields.year" placeholder="Year" class="sm-form-control" ng-options="year for year in years" ng-change="checkDate()" ng-disabled="disableFields"><\/select>    <input ng-show="yearText" type="text" name="dateFields.year" data-ng-model="dateFields.year" placeholder="Year" class="form-control" ng-disabled="disableFields">  <\/div><\/div>',link:function(n,t,i,r){var f=parseInt(i.startingYear,10)||(new Date).getFullYear(),s=parseInt(i.numYears,10)||100,h=f-s,e=["dayDivClass","dayClass","monthDivClass","monthClass","yearDivClass","yearClass"],o,u;for(n.years=[],n.yearText=i.yearText?!0:!1,i.ngDisabled&&n.$parent.$watch(i.ngDisabled,function(t){n.disableFields=t}),i.required&&(o=i.required.split(" "),r.$parsers.push(function(){angular.forEach(o,function(n){angular.isNumber(n)||r.$setValidity("required",!1)});r.$setValidity("required",!0)})),u=f;u>=h;u--)n.years.push(u);(function(){for(var n=e.length,u,r;n--;)u=e[n],r=t[0].children[Math.floor(n/2)],n%2&&n!=2&&(r=r.children[0]),i[u]&&angular.element(r).attr("class",i[u])})()}}}])}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.Vision6.UnsubscribeByEmail,arguments)}function r(){return n.fetch(t.ENDPOINTS.MarketingCloud.AddSubscriber,arguments)}function u(){return n.fetch(t.ENDPOINTS.Vision6.ConfirmSubscriber,arguments)}function f(){return n.fetch(t.ENDPOINTS.MarketingCloud.IsSubscribed,arguments)}return{addSubscriber:r,confirmSubscriber:u,isSubscribed:f,unsubscribeByEmail:i}}angular.module("nzpApp").service("campaignService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(){var n=this;n.customerSatisfaction={rating:96,ratings:462,dateRange:"Jan - Nov 2019"};n.googleSatisfaction={rating:4.5,ratings:155};n.reviews=[{name:"Jenny E",comment:"Bekka was amazing to deal with. Fantastic communication, prompt emails and calls. She made the whole process so easy and can't wait to receive my new plates.Thank you so much."},{name:"David F",comment:"Everything was easy, even my last-minute changes were done straightaway. Also, the staff are very helpful and informative and delivery was quick. I will do my next number plates with them."},{name:"Liz B",comment:"Excellent company to deal with. It was a completely seamless process with no hassles at all. I highly recommend everyone to grab a KiwiPlate."},{name:"William G",comment:"I ordered some plates, the process to choose a custom plate is really easy and they were delivered quite fast. They also take your old plates for you. Highly recommend."},{name:"Lissa M",comment:"Great friendly and patient staff very helpful explanation with each question and helpful with anything I didn’t quite understand."},{name:"Steve C",comment:"I have purchased 10 x sets of personalised plates over the years and have always found KiwiPlates to be of excellent service and a friendly helpful team."},{name:"Sharon O",comment:"First time owning personalised plates. Very easy. Communication was great, thanks!"},{name:"Ravi P",comment:"They deliver what they promise! Quick delivery and nice work guys. Keep it up."}]}angular.module("nzpApp").controller("customerRatingsController",n);n.$inject=["$scope"]}(),function(){"use strict";function n(n){var t={REMOTES:{LocalUri:"/umbraco/api",RemoteUri:"https://local.api.kiwiplates.nz/api",Instagram:"https://www.instagram.com"},ENDPOINTS:{Ranges:{GetRangeById:{uri:"/plateranges/%s",method:"GET",remote:"RemoteUri",cache:!0},GetRanges:{uri:"/plateranges/?parentRangeId=%s&vehicleTypeId=%s&combination=%s&transactionTypeId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetTopLevel:{uri:"/plateranges/?vehicleTypeId=%s&combination=%s",method:"GET",remote:"RemoteUri",cache:!0}},Designs:{GetPrice:{uri:"/pricing/calculate?transactionType=%s&plateDesignId=%s&plateSize=%s&vehicleTypeId=%s&combination=%s",method:"GET",remote:"RemoteUri",cache:!0},GetDesigns:{uri:"/platedesigns?vehicleTypeId=%s&combination=%s&plateRangeId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetSizes:{uri:"/platesizes?vehicleTypeId=%s&combination=%s&plateDesignId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetColours:{uri:"/platecolours?plateDesignId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetCaptionColoursByDesign:{uri:"/captioncolours?plateDesignId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetAllCaptionColours:{uri:"/captioncolours/",method:"GET",remote:"RemoteUri",cache:!0},GetCaptionFontMap:{uri:"/platefont/",method:"GET",remote:"RemoteUri",cache:!0}},Vehicles:{GetVehicleTypeByComboAndDesign:{uri:"/vehicletypes?combination=%s&plateDesignId=%s",method:"GET",remote:"RemoteUri",cache:!0},GetVehicleTypeById:{uri:"/vehicletypes/%s",method:"GET",remote:"RemoteUri",cache:!0},GetAllVehicles:{uri:"/vehicletypes/",method:"GET",remote:"RemoteUri",cache:!0}},Combinations:{GetSuggestions:{uri:"/suggest?&startIndex=%s&endIndex=%s&leetSpeakAlt=%s&popularNos=%s&rangeOfNumbers=%s&permutations=%s&viewAll=%s&combination=%s",method:"GET",remote:"RemoteUri",cache:!0},IsValidForVehicle:{uri:"/combination/%s/?vehicleTypeId=%s&userGenerated=%s",method:"GET",remote:"RemoteUri",cache:!0},IsAvailableForRedesign:{uri:"/combination/availableforredesign/%s",method:"GET",remote:"RemoteUri",cache:!0},IsAvailable:{uri:"/combination/%s?userGenerated=%s",method:"GET",remote:"RemoteUri",cache:!0}},Basket:{CreateBasket:{uri:"/basket",method:"POST",remote:"RemoteUri",cache:!1},GetBasketById:{uri:"/basket/%s",method:"GET",remote:"RemoteUri",cache:!1},AddItem:{uri:"/basket/line/%s",method:"POST",remote:"RemoteUri",cache:!1},CheckBasket:{uri:"/basket/check/%s",method:"POST",remote:"RemoteUri",cache:!1},DeleteLine:{uri:"/basket/line/%s/?lineId=%s",method:"DELETE",remote:"RemoteUri",cache:!1},SaveValue:{uri:"/basket/set/%s",method:"POST",remote:"RemoteUri",cache:!1},LaybyQuote:{uri:"/basket/layby/quote/%s?promoCode=%s",method:"GET",remote:"RemoteUri",cache:!1},LaybyQuoteAmount:{uri:"/basket/layby/quote?amount=%s",method:"GET",remote:"RemoteUri",cache:!1},SaveMyOrderItems:{uri:"/basket/savemyorder/email/%s",method:"POST",remote:"RemoteUri",cache:!1},GetSaveMyOrderItems:{uri:"/basket/savemyorder/get/%s",method:"GET",remote:"RemoteUri",cache:!1},ValidatePromotionCode:{uri:"/basket/validate/%s?basketid=%s",method:"GET",remote:"RemoteUri",cache:!1},SetPromotionGift:{uri:"/basket/setgift/%s?giftid=%s",method:"POST",remote:"RemoteUri",cache:!1}},Payment:{CalculateSurcharge:{uri:"/surcharge?amount=%s&method=%s",method:"GET",remote:"RemoteUri",cache:!1},RequestPayment:{uri:"/basket/paymentrequest/%s?method=%s",method:"GET",remote:"RemoteUri",cache:!1},RequestPaymentLayBy:{uri:"/basket/paymentrequest/%s?method=%s&amount=%s",method:"GET",remote:"RemoteUri",cache:!1},SaveOrder:{uri:"/basket/xactdual/%s",method:"POST",remote:"RemoteUri",cache:!1},PlaceOrder:{uri:"/basket/placeorder/%s?deliveryType=%s&islayby=%s&autoPay=%s",method:"POST",remote:"RemoteUri",cache:!1},StartPaymentRequest:{uri:"/payrequest/start/%s?method=%s&amount=%s",method:"GET",remote:"RemoteUri",cache:!1},CheckPaymentRequest:{uri:"/payrequest/check/%s",method:"GET",remote:"RemoteUri",cache:!1},CheckPaymentAmount:{uri:"/payrequest/checkamount/%s?amount=%s&method=%s",method:"GET",remote:"RemoteUri",cache:!1}},LiveChat:{CreateTicket:{uri:"/livechat/CreateTicketFromContactForm",method:"POST",remote:"LocalUri",cache:!1}},MarketingCloud:{AddSubscriber:{uri:"/marketing-cloud/subscribe-user",method:"POST",remote:"RemoteUri",cache:!1}},Vision6:{UnsubscribeByEmail:{uri:"/vision6/unsubscribeContact?listId=%s&email=%s",method:"GET",remote:"LocalUri",cache:!1},AddSubscriber:{uri:"/vision6/addContact",method:"POST",remote:"LocalUri",cache:!1},ConfirmSubscriber:{uri:"/vision6/subscribeContact",method:"POST",remote:"LocalUri",cache:!1},CheckSubscribed:{uri:"/vision6/isSubscribed",method:"POST",remote:"LocalUri",cache:!1}},SidePanel:{FetchContent:{uri:"/content/GetSidePanelContent?name=%s",method:"GET",remote:"LocalUri",cache:!1}},Instagram:{Media:{uri:"/instagram/getmedia",method:"GET",remote:"LocalUri",cache:!0}},Survey:{GetSurvey:{uri:"/nps/%s/%s",method:"GET",remote:"RemoteUri",cache:!1},SendSurvey:{uri:"/nps/%s/%s",method:"POST",remote:"RemoteUri",cache:!1}}},CHECKOUT:{FieldMap:[{Name:"Applicant",Data:[{AssociatedEntity:"checkoutEntity",FieldMap:{Title:"Title",FirstName:"FirstName",LastName:"LastName",CompanyName:"Organisation",StreetAddressFull:"StreetAddressFull",Address1:"AddressLine1",Address2:"AddressLine2",Address3:"AddressLine3",City:"City",PostCode:"PostCode",Email:"Email",Phone:"MobilePhone",AcceptedVIP:"AcceptedKiwiVIP"}}]},{Name:"Owner",Data:[{AssociatedEntity:"checkoutEntityOwner",FieldMap:{PlatesOwned:"IsOwner",Title:"Title",FirstName:"FirstName",LastName:"LastName",CompanyName:"Organisation",StreetAddressFull:"StreetAddressFull",Address1:"AddressLine1",Address2:"AddressLine2",Address3:"AddressLine3",City:"City",PostCode:"PostCode",Email:"Email",Phone:"MobilePhone"}}]},{Name:"Delivery",Data:[{AssociatedEntity:"checkoutEntityDelivery",FieldMap:{Title:"Title",FirstName:"FirstName",LastName:"LastName",CompanyName:"Organisation",StreetAddressFull:"StreetAddressFull",Address1:"AddressLine1",Address2:"AddressLine2",Address3:"AddressLine3",City:"City",PostCode:"PostCode",Email:"Email",MakeNow:"ManufactureNow",OwnershipType:"DeliveryType"}},{AssociatedEntity:"checkoutEntityOwner",FieldMap:{LicenceNo:"Licence",CompanyNumber:"CompanyNumber",DOB:"DOB",VehicleOwnerName:"VehicleOwnerName",ExistingPlate:"ExistingCombination",Make:"Make",Model:"Model"}}]}]}},i=n.API_ENDPOINT;return i&&(t.REMOTES.RemoteUri=i),Object.freeze&&Object.freeze(t),t}angular.module("nzpApp").factory("enums",n);n.$inject=["$window"]}(),function(){"use strict";function n(){var n=this;n.featureItems=[{itemID:1,isImage:!0,icon:"https://kiwiplates.nz/media/1920/create-new_black.png",title:"CREATE NEW PLATES",descriptor:"Exclusive plates to tell your story.",link:"https://kiwiplates.nz/get-a-plate",linkText:"GET STARTED",toolTip:"Create a new personalised number plate"},{itemID:2,isImage:!0,icon:"https://kiwiplates.nz/media/1922/redesign_black.png",title:"REDESIGN EXISTING PLATES",descriptor:"Add a design to your number plates.",link:"https://kiwiplates.nz/redesign-or-upgrade",linkText:"VIEW DESIGNS",toolTip:"Redesign your current number plates"},{itemID:4,isImage:!0,icon:"https://kiwiplates.nz/media/1921/gift_black.png",title:"GIFT VOUCHERS",descriptor:"The perfect personalised gift.",link:"https://kiwiplates.nz/more-info/gift-vouchers",linkText:"BUY NOW",toolTip:"Buy number plate gift vouchers"}]}angular.module("nzpApp").controller("featureController",n)}(),function(){"use strict";function n(n,t){return{link:function(i,r,u){var f=t(u.focusMe);i.$watch(f,function(t){t===!0&&n(function(){i[u.focusMe]=!1;r[0].focus()})})}}}angular.module("nzpApp").directive("focusMe",n);n.$inject=["$timeout","$parse"]}(),function(){"use strict";function n(n){function i(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+"; "+u}function r(n){for(var t,r=n+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}var t=!(r("shown")=="true");n.show=t;i("shown","true",14)}angular.module("nzpApp").controller("gapModalController",n);n.$inject=["$scope","$cookies"]}(),function(){"use strict";function n(){return{restrict:"E",scope:{showOnLoad:"=localValue",closeOnClick:"=localValue",referrerURL:"=localValue"},replace:!0,transclude:!0,link:function(n,t,i){if(n.dialogStyle={},i.showonload&&(n.show=i.showonload==="true"?!0:!1),i.referrerurl!=""){var r=document.referrer,u=r.indexOf(i.referrerurl)>-1;n.show=n.show&&u}n.closeonclick=i.closeonclick==="true"?!0:!1;n.classes=i.classmodifiers;i.width&&(n.dialogStyle.width=i.width);i.height&&(n.dialogStyle.height=i.height);i.bgimage&&(n.dialogStyle["background-image"]="url("+i.bgimage+")",n.dialogStyle["background-size"]="cover");n.hideModal=function(){n.show=!1}},template:"<div class='{{ classes }}'><div class='ng-modal' ng-show='show' ng-click='closeonclick && hideModal()'><div class='ng-modal-overlay' ng-click='hideModal()'><\/div><div class='ng-modal-dialog' ng-style='dialogStyle'><div class='ng-modal-close' ng-click='hideModal()'><i class='fa fa-close'><\/i><\/div><div class='ng-modal-dialog-content' ng-transclude><\/div><\/div><\/div><\/div>"}}angular.module("nzpApp").directive("gapModal",n)}(),function(){"use strict";function n(n,t,i,r,u){function f(n,t){return n.reduce(function(n,i){return n+i[t]},0)}function s(n){i(function(){var u,f,r,i;if(ga&&n&&n.length>0){if(u=n[0].BasketId,f=h(u,n),f){for(ga("ecommerce:addTransaction",f),r=0;r<=n.length-1;r++)i=c(u,n[r]),i&&ga("ecommerce:addItem",i),o(i.id,i.price,i.sku,i.name);ga("ecommerce:send");ga("ecommerce:clear")}}else t.error("Unable to find Google Analytics resource.")},0)}function h(n,t){var i={id:n,affiliation:"Website",revenue:null,shipping:0,tax:null,currency:"NZD"};return t&&t.length>0&&(i.revenue=f(t,"PriceIncGST").toFixed(2),i.tax=f(t,"GST").toFixed(2)),i.id?i:null}function c(n,t){var i={id:n,name:null,sku:null,category:null,price:null,quantity:"1",currency:"NZD"};return t&&(i.sku=t.PlateDesignId+"-"+t.ForegroundColourId+"-"+t.PlateSizeId,i.category=t.RangeName,i.name=t.DesignName+" ("+t.SizeName+")",i.price=t.PriceIncGST.toFixed(2)),i.id?i:null}function e(){ga&&ga("send","pageview")}function l(n,t,i){ga&&ga("send",{hitType:"event",eventCategory:n,eventAction:t,eventLabel:i})}function o(n,t,i,r){var u=angular.element(document.querySelector("#pixel1src")),f='<iframe src="https://6974303.fls.doubleclick.net/activityi;src=6974303;type=checkout;cat=check0;qty=1;cost='+t+";u1="+i+";u2="+t+";u3="+r+";dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord="+n+'?" width="1" height="1" frameborder="0" style="display:none"><\/iframe>';u.append(f)}function a(n){var t={basketId:n[0].BasketId,details:{dateCreated:+new Date,cartObject:n}};r.putObject("gaSavedCart",t)}function v(){i(function(){var u=r.getObject("gaSavedCart"),n=u?u.details.cartObject:null,s,h,f,i;if(ga&&u&&n&&n.length>0&&+new Date-u.details.dateCreated<18e5&&!w(n[0].BasketId)){if(s=n[0].BasketId,h=y(s,n),h){for(f=0;f<=n.length-1;f++)i=p(n[f]),i&&ga("ec:addProduct",i),o(i.id,i.price,i.sku,i.name);ga("ec:setAction","purchase",h);ga("send","pageview");r.remove("gaSavedCart");b(s)}}else e(),t.error("Unable to find Google Analytics resource.")},0)}function y(n,t){var i={id:n,affiliation:"Website",revenue:null,shipping:0,tax:null};return t&&t.length>0&&(i.revenue=f(t,"PriceIncGST").toFixed(2),i.tax=f(t,"GST").toFixed(2)),i.id?i:null}function p(n){var t={id:null,name:null,category:null,price:null,quantity:"1"};return n&&(t.id=n.PlateDesignId+"-"+n.ForegroundColourId+"-"+n.PlateSizeId,t.category=n.RangeName,t.name=n.DesignName+" ("+n.SizeName+")",t.price=n.PriceIncGST.toFixed(2)),t.id?t:null}function w(n){var t=r.getObject("gaTransactionsProcessed");return t?u("filter")(t.transactions,n,!0).length>0?!0:!1:!1}function b(n){var t=r.getObject("gaTransactionsProcessed");t?t.transactions.push(n):t={transactions:[n]};r.putObject("gaTransactionsProcessed",t)}return{sendCart:s,sendPageview:e,sendEvent:l,saveCart:a,sendCartEC:v}}angular.module("nzpApp").service("googleAnalyticsService",n);n.$inject=["$window","$log","$timeout","$cookies","$filter"]}(),function(){"use strict";function n(){return{restrict:"A",require:"ngModel",scope:{format:"@"},link:function(n,t,i,r){function h(t){var i=u[n.format],h;if(!t)return t;var c=t.replace(e,"").length,l=t.replace(o,"").length,a=c+l,v=t.replace(s,"").length,y=c*i.largeCharWidth+l*i.smallCharWidth+v*i.spaceCharWidth;return a>i.maxChars||y>i.maxWidth?(r.$setViewValue(n.oldVal),r.$render(),n.oldVal):(h=t.replace(f,""),h!==t&&(r.$setViewValue(h),r.$render()),n.oldVal=h,h)}var f=/[^0-9A-Za-z ]*/g,e=/[^02-9A-HJ-Za-hj-z]*/g,o=/[^Ii1]*/g,s=/[^ ]*/g,u;n.oldVal="";u=[{name:"Car",largeCharWidth:55,smallCharWidth:27.5,spaceCharWidth:13.75,maxChars:6,maxWidth:330},{name:"Other",largeCharWidth:55,smallCharWidth:27.5,spaceCharWidth:13.75,maxChars:5,maxWidth:275}];r.$parsers.push(h)}}}angular.module("nzpApp").directive("inputRestrictor",n)}(),function(){"use strict";function n(n,t,i){function u(){r.STATE.LOADED=!1;i.getInstagramFeed().then(function(n){r.mediaFeed=n.data;r.STATE.LOADED=!0;t(function(){SEMICOLON.widget.carousel();SEMICOLON.initialize.lightbox()})})}var r=this;r.STATE={LOADED:!1};r.mediaFeed=null;u()}angular.module("nzpApp").controller("instagramController",n);n.$inject=["$scope","$timeout","instagramService"]}(),function(){"use strict";function n(n,t){function i(){return n.fetch(t.ENDPOINTS.Instagram.Media)}return{getInstagramFeed:i}}angular.module("nzpApp").service("instagramService",n);n.$inject=["apiHelper","enums"]}(),function(){"use strict";function n(){function t(){n(!0)}function i(){n(!1)}function n(n){var t="body";$(t+" input").prop("disabled",n);$(t+" select").prop("disabled",n);$(t+" textarea").prop("disabled",n);$(t).toggleClass("loading-overlay")}return{showLoading:t,hideLoading:i}}angular.module("nzpApp").service("jQueryService",n);n.$inject=[]}(),function(){"use strict";function n(n,t,i,r){var u=this;n.title=i;n.message=r;n.ok=function(){t.close(!0)};n.cancel=function(){t.dismiss("cancel")}}angular.module("nzpApp").controller("modalInstanceController",n);n.$inject=["$scope","$uibModalInstance","title","message"]}(),function(){"use strict";function n(n,t){function i(i,r,u){var f=n.open({animation:!1,templateUrl:"modalContent.html",controller:"modalInstanceController",size:u,resolve:{title:function(){return i},message:function(){return r}}});f.result.then(function(n){t.debug(n)})}return{open:i}}angular.module("nzpApp").service("modalService",n);n.$inject=["$uibModal","$log"]}(),function(){"use strict";function n(){return{require:"ngModel",restrict:"E",scope:{password:"=ngModel"},link:function(n){n.$watch("password",function(t){function i(n){return n?1:0}n.strength=i(t&&t.length>=8)+i(t&&/[a-z]/.test(t))+i(t&&/[A-Z]/.test(t))+i(t&&/\d/.test(t))},!0)},template:'<div class="progress" style="height: 3px; margin-bottom: 0"><div class="progress-bar progress-bar-danger" style="width: {{strength >= 1 ? 25 : 0}}%"><\/div><div class="progress-bar progress-bar-warning" style="width: {{strength >= 2 ? 25 : 0}}%"><\/div><div class="progress-bar progress-bar-warning" style="width: {{strength >= 3 ? 25 : 0}}%"><\/div><div class="progress-bar progress-bar-success" style="width: {{strength >= 4 ? 25 : 0}}%"><\/div><\/div>'}}angular.module("nzpApp").directive("passwordStrength",n)}(),function(){"use strict";function n(){return{require:"ngModel",restrict:"A",link:function(n,t,i,r){r.$parsers.unshift(function(n){var t=new RegExp(i.patternValidator),u=t.test(n);return r.$setValidity("passwordPattern",u),n})}}}angular.module("nzpApp").directive("patternValidator",n)}(),function(){"use strict";function n(n,t,i){function r(){return n.fetch(i.ENDPOINTS.Payment.CheckPaymentRequest,arguments)}function u(){return n.fetch(i.ENDPOINTS.Payment.StartPaymentRequest,arguments)}function f(){return n.fetch(i.ENDPOINTS.Payment.CheckPaymentAmount,arguments)}function e(){return n.fetch(i.ENDPOINTS.Payment.CalculateSurcharge,arguments)}function o(){return n.fetch(i.ENDPOINTS.Payment.RequestPayment,arguments)}function s(){return n.fetch(i.ENDPOINTS.Payment.RequestPaymentLayBy,arguments)}function h(){return n.fetch(i.ENDPOINTS.Payment.SaveOrder,arguments)}function c(){return n.fetch(i.ENDPOINTS.Payment.PlaceOrder,arguments)}return{saveOrder:h,placeOrder:c,requestPayment:o,requestPaymentLayBy:s,calculateSurcharge:e,checkPaymentRequest:r,beginPaymentRequest:u,checkPaymentAmount:f}}angular.module("nzpApp").service("paymentService",n);n.$inject=["apiHelper","$q","enums"]}(),function(){"use strict";function n(n){return{link:function(t,i,r){var u=null,f=n.API_ENDPOINT,e=function(){r.plateImage&&f&&(i[0].src="/styles/images/plate-loader2.gif",u=new Image,u.src=f+r.plateImage,u.onload=function(){i[0].src=f+r.plateImage})};t.$watch(function(){return r.plateImage},function(n,t){t!==n&&e()});e()}}}angular.module("nzpApp").directive("plateImage",n);n.$inject=["$window"]}(),function(){"use strict";function n(n,t,i,r){function u(){t(function(){var t=i.getPromoCode(),n=f();typeof t=="undefined"&&n!=null&&i.setDefaultPromoCode(n)},100)}function f(){var n=r.search();return n&&n.promo?n.promo:null}u()}angular.module("nzpApp").controller("promotionCaptureController",n);n.$inject=["$scope","$timeout","basketService","$location"]}(),function(){"use strict";function n(){return{restrict:"EA",template:'<ul class="star-rating" ng-class="{readonly: readonly}">  <li ng-repeat="star in stars" class="star" ng-class="{filled: star.filled, selected: (ratingValue-1)==$index}" ng-click="toggle($index)">    <i class="icon icon-star3"><\/i><br/><div style="text-align: center; font-size: 13px; color: #777; text-shadow: none; font-weight: bold;">{{ $index+1 }}<\/span>  <\/li><\/ul><span ng-show="ratingValue>0" style="vertical-align: top;padding: 14px 16px;display: inline-block;font-size: 22px;margin: 0 20;background-color: #eee;">{{ratingValue}}/{{stars.length}}<\/span>',scope:{ratingValue:"=ngModel",max:"=?",onRatingSelect:"&?",readonly:"=?"},link:function(n){function t(){n.stars=[];for(var t=0;t<n.max;t++)n.stars.push({filled:t<n.ratingValue})}n.max==undefined&&(n.max=5);n.toggle=function(t){if(n.readonly==undefined||n.readonly===!1){n.ratingValue=t+1;n.onRatingSelect({rating:t+1})}};n.$watch("ratingValue",function(n,i){(i||i===0)&&t()})}}}angular.module("nzpApp").directive("starRating",n)}(),function(){"use strict";function n(){var n={},t={};return{getCart:function(){return n},setCart:function(t){n=t},getAmounts:function(){return t},setAmounts:function(n){t=n}}}angular.module("nzpApp").service("sharedProperties",n);n.$inject=["$log"]}()