var ready=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},each=function(e,t){Array.prototype.forEach.call(document.querySelectorAll(e),function(e){t(e)})},DEBUG=!1,Util=function(){"use strict";var e={locale:locale,classNames:{hover:"is-hovering",active:"is-active",focus:"is-focused",visible:"is-visible",disabled:"is-disabled",open:"is-open",hidden:"is-hidden",expanded:"is-expanded",selected:"is-selected"},endpoints:{articles:{product:"help_center/"+locale,endpoint:"articles.json",sideloads:["categories","sections","users","translations"],properties:["id","title","name","html_url","position","category_id","parent_section_id","section_id","promoted"]},sections:{product:"help_center/"+locale,endpoint:"sections.json",sideloads:["categories","translations"],properties:["id","name","html_url","position","category_id","parent_section_id"]},categories:{product:"help_center/"+locale,endpoint:"categories.json",sideloads:["translations"],properties:["id","name","html_url","position"]},posts:{product:"community",endpoint:"posts.json",sideloads:["topics","users"],properties:["id","title","html_url","position","featured","pinned","topic_id"]},topics:{product:"community",endpoint:"topics.json",sideloads:[],properties:["id","name","html_url","position"]}},log:function(){!0===DEBUG&&console.log.apply(this,arguments)},typeOf:function(e){return{}.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase()},unique:function(e,t){var n=e.map(function(e){return e[t]});return e.filter(function(e,r){return n.indexOf(e[t])===r})},pick:function(e,t){var n={};return e?t&&t.length?(t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n):e:n},closest:function(e,t){if(Element.prototype.closest)return e.closest(t);do{if(Element.prototype.matches&&e.matches(t)||Element.prototype.msMatchesSelector&&e.msMatchesSelector(t)||Element.prototype.webkitMatchesSelector&&e.webkitMatchesSelector(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null},debounce:function(e,t,n){var r;return function(){var i=this,o=arguments,s=n&&!r;clearTimeout(r),r=setTimeout(function(){r=null,n||e.apply(i,o)},t),s&&e.apply(i,o)}},throttle:function(e,t){var n;return function(){var r=arguments;n||(e.apply(this,r),n=!0,setTimeout(function(){return n=!1},t))}},isObject:function(e){return e&&"object"==typeof e&&!Array.isArray(e)},extend:function(t,n){var r=Object.assign({},t);return e.isObject(t)&&e.isObject(n)&&Object.keys(n).forEach(function(i){if(e.isObject(n[i]))if(i in t)e.isElement(n[i])?r[i]=n[i]:r[i]=e.extend(t[i],n[i]);else{var o={};o[i]=n[i],Object.assign(r,o)}else r[i]=n[i]}),r},isElement:function(e){return e instanceof Element||e instanceof HTMLDocument},getURLParameter:function(e,t){t=t||location.search,e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},setURLParameter:function(e,t,n){t=encodeURIComponent(t),n=encodeURIComponent(n);var r=e.split("?")[0],i=t+"="+n,o="?"+i,s=void 0===e.split("?")[1]?"":"?"+e.split("?")[1];if(s){var a=new RegExp("([?&])"+t+"[^&]*"),c=new RegExp("([?&])"+t+"=[^&;]+[&;]?");o=null==n||""===n?(o=s.replace(c,"$1")).replace(/[&;]$/,""):null!==s.match(a)?s.replace(a,"$1"+i):""===s?"?"+i:s+"&"+i}return r+(o="?"===o?"":o)},getTransitionDuration:function(e){if(!e)return 0;var t=getComputedStyle(e),n=parseFloat(t.transitionDuration),r=parseFloat(t.transitionDelay);return n||r?1e3*(n+r):0},onTransitionEnd:function(t,n){if(t&&n&&"function"==typeof n){var r=!1,i=this;t.addEventListener("transitionend",function e(o){o.target===t&&(r=!0,t.removeEventListener("transitionend",e,!1),n.call(i,o))},!1),setTimeout(function(){r||e.triggerEvent(t,"transitionend")},e.getTransitionDuration(t))}},getHashString:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t},intersection:function(e,t){return e.filter(function(e){return t.includes(e)})},comparePosition:function(e,t){return e.position<t.position?-1:e.position>t.position?1:0},get:function(t,n){if("string"==typeof t&&(t=[t]),!Array.isArray(t)||!t.length)return new Promise(function(e,t){t(new Error("The object argument provided is invalid"))});var r=Object.keys(e.endpoints),i=t.filter(function(e){return-1!==r.indexOf(e)});if(!i.length)return new Promise(function(e,t){t(new Error("The specified object types are not supported"))});var o=[];return r.forEach(function(r){if(-1!==t.indexOf(r)){var s=e.endpoints[r],a=s.endpoint,c=e.intersection(t,s.sideloads);c.length&&(a+="?include="+c.join(","),i=i.filter(function(e){return-1===c.indexOf(e)})),o.push({id:r,url:"/api/v2/"+s.product+"/"+a,properties:n||s.properties})}}),o.length?Promise.all(o.map(function(t){return e.request(t.url,t.properties)})).then(function(e){if(1===e.length)return e[0];var t={};return e.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&-1!==r.indexOf(n)&&(t[n]=e[n])}),t}):new Promise(function(e,t){t(new Error("No valid REST API endpoints were found"))})},filterObjectProperties:function(t,n){var r=Object.keys(e.endpoints);for(var i in t)t.hasOwnProperty(i)&&-1!==r.indexOf(i)&&Array.isArray(t[i])&&(t[i]=t[i].filter(function(e){return!(e.hasOwnProperty("draft")&&!0===e.draft)}).map(function(t){return e.pick(t,n)}),-1!==n.indexOf("position")&&1===t.page_count&&t[i].sort(e.comparePosition));return delete t.previous_page,delete t.sort_by,delete t.sort_order,t},request:function(t,n){n=n||[],t=e.setURLParameter(t,"per_page",100);var r=function(t,n){if(t.page_count&&(1===t.page_count||t.page>1))return t;for(var r=[],i=2;i<=t.page_count;i++)r.push(e.setURLParameter(t.next_page,"page",i));var o=Object.keys(e.endpoints);return Promise.all(r.map(function(t){return e.request(t,n)})).then(function(r){for(var i in r.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&Array.isArray(e[n])&&-1!==o.indexOf(n)&&(t[n]=t[n].concat(e[n]))}),t)t.hasOwnProperty(i)&&Array.isArray(t[i])?(t[i]=e.unique(t[i],"id"),n.indexOf("position")>-1&&t[i].sort(e.comparePosition)):delete t[i];return t})},i=e.getHashString(t+n.join("-")),o=Util.storage(i,!0);return o.isValid(36e5)?new Promise(function(e){e(r(o.get(),n))}):fetch(t).then(function(e){return 200!==e.status?Promise.reject(new Error(e.statusText)):-1===e.headers.get("Content-Type").indexOf("application/json")?Promise.reject("Response does not have a content type of JSON"):e.json()}).then(function(t){return t=e.filterObjectProperties(t,n),o.set(t),r(t,n)})},replaceWithSVG:function(t){var n=[],r=function(e){return"IMG"===e.tagName&&e.src&&"svg"===e.src.substr(e.src.lastIndexOf(".")+1)};("string"!=typeof t||(t=document.querySelectorAll(t)))&&(NodeList.prototype.isPrototypeOf(t)?n=Array.prototype.filter.call(t,r):e.isElement(t)&&r(t)&&n.push(t),n.length&&n.forEach(function(e){fetch(e.src,{cache:"no-cache",mode:"cors",credentials:"omit"}).then(function(e){return e.blob()}).then(function(e){return e.text()}).then(function(t){var n=document.createElement("div");n.innerHTML=t.trim();var r=n.querySelector("svg");e.classList.forEach(function(e){r.classList.add(e)});for(var i=0;i<e.attributes.length;i++){var o=e.attributes[i];r.setAttribute(o.name,o.value)}e.replaceWith(r)})}))},reflow:function(e){return e.offsetHeight},triggerEvent:function(e,t,n){if(t){var r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n||{}});return(e||window).dispatchEvent(r),r}},getSelectorFromElement:function(e){var t=e.getAttribute("data-target");if(!t||"#"===t){var n=e.getAttribute("href");t=n&&"#"!==n?n.trim():""}try{return document.querySelector(t)?t:null}catch(e){return null}}};return e}();!function(e){window.dataStorage={_storage:new WeakMap,put:function(e,t,n){this._storage.has(e)||this._storage.set(e,new Map),this._storage.get(e).set(t,n)},get:function(e,t){if(this._storage.has(e))return this._storage.get(e).get(t)},has:function(e,t){return this._storage.has(e)&&this._storage.get(e).has(t)},remove:function(e,t){var n=this._storage.get(e).delete(t);return 0===!this._storage.get(e).size&&this._storage.delete(e),n}};var t=0,n=function(n,r){if(!e.isElement(n))throw Error("A valid DOM element was not provided.");this.el=n,this.instanceNumber=t++,this.id="zp-"+this.instanceNumber,this.options=this._getOptions(r),this.events=e.extend(this.events,{initialize:"initialize"}),this.initialize(this.options)},r=n.prototype;r.defaults={},r.optionTypes={},r.events={},r._getOptions=function(t){t=e.extend(this.defaults,t);var n=this.el.dataset;for(var r in n)if(n.hasOwnProperty(r)&&t.hasOwnProperty(r)){var i=n[r];"true"===i&&(i=!0),"false"===i&&(i=!1),"null"===i&&(i=null),i===+i+""&&(i=+i),t[r]=i}return this._checkOptionTypes(t,this.optionTypes),t},r._checkOptionTypes=function(t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r],o=t[r],s=o&&e.isElement(o)?"element":e.typeOf(o);if(!new RegExp(i).test(s))throw new Error('Option "'+r+'" provided "'+s+'" but expected "'+i+'"')}},r.initialize=function(){},r._getClassName=function(t){var n=void 0;if(!this.options.hasOwnProperty("classNames")||"object"!==e.typeOf(this.options.classNames)||!this.options.classNames.hasOwnProperty(t))return n;var r=this.options.classNames;return"function"==typeof r[t]?n=r[t].apply(this,[].slice.call(arguments,1)):"string"==typeof r[t]&&(n=r[t]),n},e.createPlugin=function(e){var t=function(e,t){n.call(this,e,t)};for(var r in t.prototype=Object.create(n.prototype),e)e.hasOwnProperty(r)&&(t.prototype[r]=e[r]);return Object.defineProperty(t.prototype,"constructor",{enumerable:!1,value:t}),t}}(Util||{}),function(e){var t,n,r,i,o,s={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},a=/(.)^/,c={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},u=/\\|'|\r|\n|\u2028|\u2029/g,l=function(e){return"\\"+c[e]};t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},n=function(e){return t[e]},r="(?:"+Object.keys(t).join("|")+")",i=RegExp(r),o=RegExp(r,"g");e.template=function(t,n){n=n||{},n=e.extend(n,s);var r,i=RegExp([(n.escape||a).source,(n.interpolate||a).source,(n.evaluate||a).source].join("|")+"|$","g"),o=0,c="__p+='";t.replace(i,function(e,n,r,i,s){return c+=t.slice(o,s).replace(u,l),o=s+e.length,n?c+="'+\n((__t=("+n+"))==null?'':escape(__t))+\n'":r?c+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(c+="';\n"+i+"\n__p+='"),e}),c+="';\n",n.variable||(c="with(obj||{}){\n"+c+"}\n"),c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+c+"return __p;\n";try{r=new Function(n.variable||"obj",c)}catch(e){throw e.source=c,e}return function(e){return r.call(this,e)}},e.renderTemplate=function(t,n,r){var i,o,s=document.getElementById("tmpl-"+n);s&&s.innerHTML?(i=s.innerHTML,(o=e.template(i)(r).replace(/(^\s+|\s+$)/g,""))&&t.insertAdjacentHTML("afterbegin",o)):console.error("Template "+n+" does not exist")}}(Util||{}),function(e){var t=function(e,t){if(!e)throw Error("Please provide an ID for your storage");this.id=e,this.storage=t?sessionStorage:localStorage},n=t.prototype;n.set=function(e){this.storage.setItem(this.id,JSON.stringify({timestamp:(new Date).getTime(),data:e}))},n.get=function(e,t){var n=this.storage.getItem(this.id);return(n=n?JSON.parse(n):null)&&!0!==DEBUG?t?n:n.data:e||n},n.isValid=function(e){var t=this.get(null,!0);return!(!t||!0===DEBUG)&&(new Date).getTime()-t.timestamp<e},n.remove=function(){this.storage.removeItem(this.id)},e.storage=function(e,n){return new t(e,n)}}(Util||{});