; (self.AMP=self.AMP||[]).push({m:1,v:"2309181453000",n:"amp-script",ev:"0.1",l:!0,f:function(t,e){(()=>{var e;function n(){return e||(e=Promise.resolve(void 0))}var i=class{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}},r=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(8);return{execute:(t,i,r)=>(s&&r&&(t=e.getNode(t[i+1]))&&(r=t.transferControlToOffscreen(),n.messageToWorker({12:9,13:[t._index_],38:r},[r])),i+2)}},s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],o=(t,e)=>Array.prototype.forEach.call(t,e),a=new Map,c=(t,e)=>{e&&"value"in e&&null===e.oninput&&(e.oninput=()=>u(t,e))},l=(t,e)=>{e&&"value"in e&&!a.get(e)&&(new MutationObserver((e=>e.map((e=>u(t,e.target))))).observe(e,{attributes:!0}),a.set(e,!0))},u=(t,e)=>t.messageToWorker({12:4,40:{7:e._index_,21:e.value}}),f=t=>Object.values(t).map((t=>[t.identifier,t.screenX,t.screenY,t.clientX,t.clientY,t.pageX,t.pageY,t.target._index_])),h=(t,e,n,i,r)=>{const s=[],o=r.executorsAllowed.includes(4);let a=[window.innerWidth,window.innerHeight];const h=(t,e)=>i=>{e&&i.preventDefault();var r=i.currentTarget;if(r&&"value"in r)u(n,i.currentTarget);else if("resize"===i.type){const{innerWidth:t,innerHeight:e}=window;if(a[0]===t&&a[1]===e)return;a=[window.innerWidth,window.innerHeight],n.messageToWorker({12:5,40:a})}n.messageToWorker({12:1,39:{7:t,25:i.bubbles,26:i.cancelable,27:i.cancelBubble,28:[i.currentTarget._index_||0],29:i.defaultPrevented,30:i.eventPhase,31:i.isTrusted,32:i.returnValue,13:[i.target._index_||0],33:i.timeStamp,12:i.type,35:"keyCode"in i?i.keyCode:void 0,60:"pageX"in i?i.pageX:void 0,61:"pageY"in i?i.pageY:void 0,65:"offsetX"in i?i.offsetX:void 0,66:"offsetY"in i?i.offsetY:void 0,62:"touches"in i?f(i.touches):void 0,63:"changedTouches"in i?f(i.changedTouches):void 0}})};return{execute(i,r,a){var u=i[r+2];const f=r+4+2*u;if(u=r+4+6*i[r+3]+2*u,o&&a&&(a=e.getNode(i[r+1]))){let o=r+4;for(;o{const s=r.executorsAllowed.includes(5);return{execute:(t,i,r)=>(s&&r&&(t=e.getNode(t[i+1]))&&(r=t.getBoundingClientRect(),n.messageToWorker({12:6,13:[t._index_],38:[r.top,r.right,r.bottom,r.left,r.width,r.height]})),i+2)}},m=(t,{getNode:e},n,i,r)=>{const s=r.executorsAllowed.includes(2);return{execute(t,i,r){const o=t[i+4],a=t[i+5];if(s&&r){const r=e(t[i+1]);r&&(0{(t=e(t))&&t.remove()})),0{const o=t[i+2];(s=e(s))&&(r.insertBefore(s,o&&e(o)||null),c(n,s),l(n,s))})))}return i+6+o+a}}},d=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(0);return{execute(n,i,o){if(s&&o){o=e.getNode(n[i+1]);const s=t.get(n[i+2]);n=0!==(n=n[i+4])?t.get(n-1):null,o&&null!=s&&(r.sanitizer?r.sanitizer.setAttribute(o,s,n):null==n?o.removeAttribute(s):o.setAttribute(s,n))}return i+5}}},g=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(1);return{execute:(n,i,r)=>(s&&r&&(r=e.getNode(n[i+1]),n=n[i+2],r&&n&&(r.textContent=t.get(n))),i+3)}},b=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(3);return{execute(n,i,o){if(s&&o){o=e.getNode(n[i+1]);const s=t.get(n[i+2]);{const e=n[i+4];n=1===n[i+3]?1===e:0!==e?t.get(e):null}o&&s&&null!=n&&(r.sanitizer?r.sanitizer.setProperty(o,s,String(n)):o[s]=n)}return i+5}}},v=(t,e,i,r,s)=>{const o=s.executorsAllowed.includes(6);let a,c=0;return{execute(t,e,i){if(o&&i&&s.longTask)if(6===t[e]){if(c++,!a){const t=new Promise((t=>a=t));n().then((()=>s.longTask&&s.longTask(t)))}}else 7===t[e]&&(c--,a&&0>=c&&(a(),a=null,c=0));return e+2},get active(){return null!==a}}},y=new Float32Array(1),w=new Uint16Array(y.buffer);function x(t,e,n,i,r,s){let o=[];for(let c=0;c{const s=r.executorsAllowed.includes(9);return{execute(n,r,o){const a=t.get(n[r+1]),c=n[r+2],{offset:l,args:u}=x(n,r+3,1,t,e,i);r=u[0];const{offset:f,args:h}=x(n,l,c,t,e,i);return s&&o&&(A(r,a)?r[a]=h[0]:r[a](...h)),f}}};function A(t,e){if(!t)throw Error(`Property ${e} does not exist on ${t}.`);let n=Object.getOwnPropertyDescriptor(t,e);return void 0!==n?"set"in n:A(Object.getPrototypeOf(t),e)}var _=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(10);if(!i)throw Error("objectContext is not defined.");return{execute(n,r,o){const a=t.get(n[r+1]),c=n[r+2],l=n[r+3],{offset:u,args:f}=x(n,r+4,1,t,e,i);r=f[0];const{offset:h,args:p}=x(n,u,l,t,e,i);return s&&o&&"new"!==a&&i.store(c,r[a](...p)),h}}},T=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(11);return{execute:(t,i,r)=>(s&&r&&(r=e.getNode(t[i+1]))&&self.createImageBitmap(r).then((e=>{n.messageToWorker({12:10,73:t[i+2],38:e},[e])})),i+3)}},E=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(12);return{execute(e,i,o){if(s&&o){o=e[i+1];var a=e[i+2],c=e[i+3];const s=e[i+4];if(e=0{n.messageToWorker({12:11,74:u,75:l,21:t})}));else if(2===o)if(o=a,a=e,e=c,r.sanitizer)r.sanitizer.setStorage(o,a,e);else{let t;if(0===o?t=window.localStorage:1===o&&(t=window.sessionStorage),t)if(null==a){if(null!=e)throw Error("Unexpected storage operation.");t.clear()}else null==e?t.removeItem(a):t.setItem(a,e)}}var l,u;return i+5}}},O=0,S={},R=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(13);return{execute(e,n){if(s){const i=e[n+1],r=e[n+2];e=e[n+3],e=t.hasIndex(e)?JSON.parse(t.get(e)):void 0,1===i?S[r].resolve(e):S[r].reject(e),delete S[r]}return n+4}}},M=(t,e,n,i,r)=>{const s=r.executorsAllowed.includes(14);return{execute:(t,n,i)=>(s&&i&&(t=e.getNode(t[n+1]))&&t.scrollIntoView(),n+2)}},j=[8,3];function P(t,e,n,i){var r=[].slice.call(t.childNodes).filter(n);return r={7:t._index_,11:0,0:t.nodeType,1:e(t.localName||t.nodeName),4:r.map((t=>P(t,e,n,i))),2:[].map.call(t.attributes||[],(t=>[e(t.namespaceURI||"null"),e(t.name),e(t.value)]))},null!=t.namespaceURI&&(r[6]=e(t.namespaceURI)),j.includes(t.nodeType)&&null!==t.textContent&&(r[5]=e(t.textContent)),c(i,t),l(i,t),r}function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.store(t)))}},l=new class{constructor(){this.objects=void 0,this.objects=new Map}store(t,e){this.objects.set(t,e)}get(t){let e=this.objects.get(t);if(e)return e;throw Error("Object with id ("+t+") does not exist.")}},u=new class{constructor(t,e){this.nodes=this.count=this.stringContext=this.baseElement=void 0,this.createNodes=(t,e)=>{let n=(t=new Uint16Array(t)).length;for(let r=0;r(t=this.nodes.get(t))&&"BODY"===t.nodeName?this.baseElement:t,this.storeNodes=t=>{this.storeNode(t,++this.count),o(t.childNodes,(t=>this.storeNodes(t)))},this.count=2,this.stringContext=t,this.nodes=new Map([[1,e],[2,e]]),this.baseElement=e,e._index_=2,o(e.childNodes,(t=>this.storeNodes(t)))}storeNode(t,e){t._index_=e,this.nodes.set(e,t)}}(c,e),f=(y=i,Object.assign({},{mutationPump:requestAnimationFrame.bind(null),executorsAllowed:s},y));var y;return t.then((([t,s])=>{if(t&&s&&i.authorURL){let o=new class{constructor(t,e,n,i,r){this[55]=void 0,this.nodeContext=e,this.config=r;let{skeleton:s,strings:o}=function(t,e,n){e=e.hydrateFilter||(()=>!0);let i=[],r=new Map;return{skeleton:P(t,(t=>{if(r.has(t))return r.get(t);const e=i.length;return r.set(t,e),i.push(t),e}),e,n),strings:i}}(t,r,this);e=[];let a=[],c=D("localStorage"),l=D("sessionStorage");for(let n in t.style)e.push(n);for(let e in t)e.startsWith("on")&&a.push(e);n=`'use strict';(function(){${n}self['window']=self;var workerDOM=WorkerThread.workerDOM;WorkerThread.hydrate(workerDOM.document,${JSON.stringify(o)},${JSON.stringify(s)},${JSON.stringify(e)},${JSON.stringify(a)},[${window.innerWidth},${window.innerHeight}],${JSON.stringify(c)},${JSON.stringify(l)});workerDOM.document[59](this);Object.assign(self,workerDOM);}).call(self);${i}//# sourceURL=${encodeURI(r.authorURL)}`,this[55]=r.sandbox?new class{constructor(t,e){this.readyPromiseResolve=this.iframe=this.readyPromise=this.onmessageerror=this.onmessage=this.onerror=this.url=void 0,this.url=t,this.iframe=window.document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-scripts"),this.iframe.setAttribute("style","display:none"),this.iframe.setAttribute("src",e),this.url=t,this.readyPromise=new Promise((t=>{this.readyPromiseResolve=t})),this.setupInit(),this.proxyFromWorker(),window.document.body.appendChild(this.iframe)}setupInit(){let t=e=>{e.source==this.iframe.contentWindow&&fetch(this.url.toString()).then((t=>t.text())).then((n=>{const i=e.data;"iframe-ready"==i.type?this.iframe.contentWindow.postMessage({type:"init-worker",code:n},"*"):"worker-ready"===i.type&&(this.readyPromiseResolve(),window.removeEventListener("message",t))}))};window.addEventListener("message",t)}proxyFromWorker(){window.addEventListener("message",(t=>{if(t.source==this.iframe.contentWindow){var{type:e,message:n}=t.data;"onmessage"==e&&this.onmessage?this.onmessage(I({},t,{data:n})):"onerror"===e&&this.onerror?this.onerror(n):"onmessageerror"===e&&this.onmessageerror&&this.onmessageerror(I({},t,{data:n}))}}))}postMessage(t,e){let n={type:"postMessage",message:t};this.readyPromise.then((()=>{this.iframe.contentWindow.postMessage(n,"*",e)}))}terminate(){this.iframe.contentWindow.postMessage({type:"terminate"},"*"),this.iframe.remove()}}(URL.createObjectURL(new Blob([n])),r.sandbox.iframeUrl):new Worker(URL.createObjectURL(new Blob([n]))),r.onCreateWorker&&r.onCreateWorker(t,o,s,e)}ready(){return this.worker.readyPromise||n()}get worker(){return this[55]}messageToWorker(t,e){this.config.onSendMessage&&this.config.onSendMessage(t),this.worker.postMessage(t,e||[])}}(e,u,t,s,f),a=new class{constructor(t,e,n,i,s){this.nodeContext=this.stringContext=void 0,this.mutationQueue=[],this.pendingMutations=!1,this.executors=this.sanitizer=this.mutationPumpFunction=void 0,this.syncFlush=(t=!0)=>{let e=[];return this.mutationQueue.forEach((n=>{let i=n.length,r=0;for(;r{let{data:e}=t;L.includes(e[12])&&(a.mutate(e[54],e[37],e[41],new Uint16Array(e[36])),i.onReceiveMessage)&&i.onReceiveMessage(t)},o.ready().then((()=>new class{constructor(t,e){this.workerContext_=t,this.config=e}callFunction(t,...e){if(!this.config.executorsAllowed.includes(13))throw Error(`[worker-dom]: Error calling ${t}. You must enable the FUNCTION_CALL executor within the config.`);let{promise:n,index:i}=function(){let t,e,n=new Promise(((n,i)=>{t=n,e=i}));O>=Number.MAX_VALUE&&(O=0);let i=O++;return S[i]={promise:n,resolve:t,reject:e},{promise:n,index:i}}();return t={12:12,77:t,78:JSON.stringify(e),7:i},this.workerContext_.messageToWorker(t),n}set onerror(t){this.workerContext_.worker.onerror=t}terminate(){this.workerContext_.worker.terminate()}}(o,f)))}return null}))}var C=t=>null===t.parentNode||(t=(t.parentNode.localName||t.parentNode.nodeName).toLowerCase(),!/amp-/.test(t)||"amp-script"===t),{isArray:N}=Array;function $(t,e){const n=[];let i=0;for(let r=0;r""!==t)),null===(r=(s=self).__AMP_REPORT_ERROR)||void 0===r||r.call(s,u),u}("​​​",t,e,n,i,r,s,o,a,c,l,u)}function J(t){return"fixed"==t||"fixed-height"==t||"responsive"==t||"fill"==t||"flex-item"==t||"fluid"==t||"intrinsic"==t}function Y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function K(t){for(var e=1;e1?n-1:0),r=1;r/gm),Ct=rt(/\${[\w\W]*}/gm),Nt=rt(/^data-[\-\w.\u00B7-\uFFFF]/),$t=rt(/^aria-[\-\w]+$/),Ft=rt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ut=rt(/^(?:\w+script|data):/i),Bt=rt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wt=rt(/^html$/i),qt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Lt,ERB_EXPR:zt,TMPLIT_EXPR:Ct,DATA_ATTR:Nt,ARIA_ATTR:$t,IS_ALLOWED_URI:Ft,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Bt,DOCTYPE_NAME:Wt}),Vt=()=>"undefined"==typeof window?null:window,Ht=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(i)&&(n=e.currentScript.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Gt=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vt();const n=e=>t(e);if(n.version="3.0.2",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;const i=e.document;let{document:r}=e;const{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:p}=e,m=c.prototype,d=At(m,"cloneNode"),g=At(m,"nextSibling"),b=At(m,"childNodes"),v=At(m,"parentNode");if("function"==typeof o){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}const y=Ht(p,i),w=y?y.createHTML(""):"",{implementation:x,createNodeIterator:k,createDocumentFragment:A,getElementsByTagName:_}=r,{importNode:T}=i;let E={};n.isSupported="function"==typeof Z&&"function"==typeof v&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:S,TMPLIT_EXPR:R,DATA_ATTR:M,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:P,ATTR_WHITESPACE:I}=qt;let{IS_ALLOWED_URI:D}=qt,L=null;const z=xt({},[..._t,...Tt,...Et,...St,...Mt]);let C=null;const N=xt({},[...jt,...Pt,...It,...Dt]);let $=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,U=null,B=!0,W=!0,q=!1,V=!0,H=!1,G=!1,J=!1,Y=!1,X=!1,K=!1,Q=!1,tt=!0,et=!1;const nt="user-content-";let rt=!0,st=!1,ot={},at=null;const ct=xt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let wt=null;const Lt=xt({},["audio","video","img","source","image","track"]);let zt=null;const Ct=xt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nt="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let Bt=Ut,Gt=!1,Jt=null;const Yt=xt({},[Nt,$t,Ut],pt);let Xt;const Kt=["application/xhtml+xml","text/html"],Zt="text/html";let Qt,te=null;const ee=r.createElement("form"),ne=function(t){return t instanceof RegExp||t instanceof Function},ie=function(t){te&&te===t||(t&&"object"==typeof t||(t={}),t=kt(t),Xt=Xt=-1===Kt.indexOf(t.PARSER_MEDIA_TYPE)?Zt:t.PARSER_MEDIA_TYPE,Qt="application/xhtml+xml"===Xt?pt:ht,L="ALLOWED_TAGS"in t?xt({},t.ALLOWED_TAGS,Qt):z,C="ALLOWED_ATTR"in t?xt({},t.ALLOWED_ATTR,Qt):N,Jt="ALLOWED_NAMESPACES"in t?xt({},t.ALLOWED_NAMESPACES,pt):Yt,zt="ADD_URI_SAFE_ATTR"in t?xt(kt(Ct),t.ADD_URI_SAFE_ATTR,Qt):Ct,wt="ADD_DATA_URI_TAGS"in t?xt(kt(Lt),t.ADD_DATA_URI_TAGS,Qt):Lt,at="FORBID_CONTENTS"in t?xt({},t.FORBID_CONTENTS,Qt):ct,F="FORBID_TAGS"in t?xt({},t.FORBID_TAGS,Qt):{},U="FORBID_ATTR"in t?xt({},t.FORBID_ATTR,Qt):{},ot="USE_PROFILES"in t&&t.USE_PROFILES,B=!1!==t.ALLOW_ARIA_ATTR,W=!1!==t.ALLOW_DATA_ATTR,q=t.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,H=t.SAFE_FOR_TEMPLATES||!1,G=t.WHOLE_DOCUMENT||!1,X=t.RETURN_DOM||!1,K=t.RETURN_DOM_FRAGMENT||!1,Q=t.RETURN_TRUSTED_TYPE||!1,Y=t.FORCE_BODY||!1,tt=!1!==t.SANITIZE_DOM,et=t.SANITIZE_NAMED_PROPS||!1,rt=!1!==t.KEEP_CONTENT,st=t.IN_PLACE||!1,D=t.ALLOWED_URI_REGEXP||Ft,Bt=t.NAMESPACE||Ut,$=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ne(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ne(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(W=!1),K&&(X=!0),ot&&(L=xt({},[...Mt]),C=[],!0===ot.html&&(xt(L,_t),xt(C,jt)),!0===ot.svg&&(xt(L,Tt),xt(C,Pt),xt(C,Dt)),!0===ot.svgFilters&&(xt(L,Et),xt(C,Pt),xt(C,Dt)),!0===ot.mathMl&&(xt(L,St),xt(C,It),xt(C,Dt))),t.ADD_TAGS&&(L===z&&(L=kt(L)),xt(L,t.ADD_TAGS,Qt)),t.ADD_ATTR&&(C===N&&(C=kt(C)),xt(C,t.ADD_ATTR,Qt)),t.ADD_URI_SAFE_ATTR&&xt(zt,t.ADD_URI_SAFE_ATTR,Qt),t.FORBID_CONTENTS&&(at===ct&&(at=kt(at)),xt(at,t.FORBID_CONTENTS,Qt)),rt&&(L["#text"]=!0),G&&xt(L,["html","head","body"]),L.table&&(xt(L,["tbody"]),delete F.tbody),it&&it(t),te=t)},re=xt({},["mi","mo","mn","ms","mtext"]),se=xt({},["foreignobject","desc","title","annotation-xml"]),oe=xt({},["title","style","font","a","script"]),ae=xt({},Tt);xt(ae,Et),xt(ae,Ot);const ce=xt({},St);xt(ce,Rt);const le=function(t){let e=v(t);e&&e.tagName||(e={namespaceURI:Bt,tagName:"template"});const n=ht(t.tagName),i=ht(e.tagName);return!!Jt[t.namespaceURI]&&(t.namespaceURI===$t?e.namespaceURI===Ut?"svg"===n:e.namespaceURI===Nt?"svg"===n&&("annotation-xml"===i||re[i]):Boolean(ae[n]):t.namespaceURI===Nt?e.namespaceURI===Ut?"math"===n:e.namespaceURI===$t?"math"===n&&se[i]:Boolean(ce[n]):t.namespaceURI===Ut?!(e.namespaceURI===$t&&!se[i])&&!(e.namespaceURI===Nt&&!re[i])&&!ce[n]&&(oe[n]||!ae[n]):!("application/xhtml+xml"!==Xt||!Jt[t.namespaceURI]))},ue=function(t){ft(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){t.remove()}},fe=function(t,e){try{ft(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){ft(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!C[t])if(X||K)try{ue(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},he=function(t){let e,n;if(Y)t=""+t;else{const e=mt(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Xt&&Bt===Ut&&(t=''+t+"");const i=y?y.createHTML(t):t;if(Bt===Ut)try{e=(new h).parseFromString(i,Xt)}catch(t){}if(!e||!e.documentElement){e=x.createDocument(Bt,"template",null);try{e.documentElement.innerHTML=Gt?w:i}catch(t){}}const s=e.body||e.documentElement;return t&&n&&s.insertBefore(r.createTextNode(n),s.childNodes[0]||null),Bt===Ut?_.call(e,G?"html":"body")[0]:G?e.documentElement:s},pe=function(t){return k.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},me=function(t){return t instanceof f&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof u)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},de=function(t){return"object"==typeof a?t instanceof a:t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},ge=function(t,e,i){E[t]&<(E[t],(t=>{t.call(n,e,i,te)}))},be=function(t){let e;if(ge("beforeSanitizeElements",t,null),me(t))return ue(t),!0;const i=Qt(t.nodeName);if(ge("uponSanitizeElement",t,{tagName:i,allowedTags:L}),t.hasChildNodes()&&!de(t.firstElementChild)&&(!de(t.content)||!de(t.content.firstElementChild))&&vt(/<[/\w]/g,t.innerHTML)&&vt(/<[/\w]/g,t.textContent))return ue(t),!0;if(!L[i]||F[i]){if(!F[i]&&ye(i)){if($.tagNameCheck instanceof RegExp&&vt($.tagNameCheck,i))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(i))return!1}if(rt&&!at[i]){const e=v(t)||t.parentNode,n=b(t)||t.childNodes;if(n&&e)for(let i=n.length-1;i>=0;--i)e.insertBefore(d(n[i],!0),g(t))}return ue(t),!0}return t instanceof c&&!le(t)?(ue(t),!0):"noscript"!==i&&"noembed"!==i||!vt(/<\/no(script|embed)/i,t.innerHTML)?(H&&3===t.nodeType&&(e=t.textContent,e=dt(e,O," "),e=dt(e,S," "),e=dt(e,R," "),t.textContent!==e&&(ft(n.removed,{element:t.cloneNode()}),t.textContent=e)),ge("afterSanitizeElements",t,null),!1):(ue(t),!0)},ve=function(t,e,n){if(tt&&("id"===e||"name"===e)&&(n in r||n in ee))return!1;if(W&&!U[e]&&vt(M,e));else if(B&&vt(j,e));else if(!C[e]||U[e]){if(!(ye(t)&&($.tagNameCheck instanceof RegExp&&vt($.tagNameCheck,t)||$.tagNameCheck instanceof Function&&$.tagNameCheck(t))&&($.attributeNameCheck instanceof RegExp&&vt($.attributeNameCheck,e)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(e))||"is"===e&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&vt($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(zt[e]);else if(vt(D,dt(n,I,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==gt(n,"data:")||!wt[t])if(q&&!vt(P,dt(n,I,"")));else if(n)return!1;return!0},ye=function(t){return t.indexOf("-")>0},we=function(t){let e,i,r,s;ge("beforeSanitizeAttributes",t,null);const{attributes:o}=t;if(!o)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C};for(s=o.length;s--;){e=o[s];const{name:c,namespaceURI:l}=e;if(i="value"===c?e.value:bt(e.value),r=Qt(c),a.attrName=r,a.attrValue=i,a.keepAttr=!0,a.forceKeepAttr=void 0,ge("uponSanitizeAttribute",t,a),i=a.attrValue,a.forceKeepAttr)continue;if(fe(c,t),!a.keepAttr)continue;if(!V&&vt(/\/>/i,i)){fe(c,t);continue}H&&(i=dt(i,O," "),i=dt(i,S," "),i=dt(i,R," "));const u=Qt(t.nodeName);if(ve(u,r,i)){if(!et||"id"!==r&&"name"!==r||(fe(c,t),i=nt+i),y&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(l);else switch(p.getAttributeType(u,r)){case"TrustedHTML":i=y.createHTML(i);break;case"TrustedScriptURL":i=y.createScriptURL(i)}try{l?t.setAttributeNS(l,c,i):t.setAttribute(c,i),ut(n.removed)}catch(t){}}}ge("afterSanitizeAttributes",t,null)},xe=function t(e){let n;const i=pe(e);for(ge("beforeSanitizeShadowDOM",e,null);n=i.nextNode();)ge("uponSanitizeShadowNode",n,null),be(n)||(n.content instanceof s&&t(n.content),we(n));ge("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t){let e,r,o,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Gt=!t,Gt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!de(t)){if("function"!=typeof t.toString)throw yt("toString is not a function");if("string"!=typeof(t=t.toString()))throw yt("dirty is not a string, aborting")}if(!n.isSupported)return t;if(J||ie(l),n.removed=[],"string"==typeof t&&(st=!1),st){if(t.nodeName){const e=Qt(t.nodeName);if(!L[e]||F[e])throw yt("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof a)e=he("\x3c!----\x3e"),r=e.ownerDocument.importNode(t,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?e=r:e.appendChild(r);else{if(!X&&!H&&!G&&-1===t.indexOf("<"))return y&&Q?y.createHTML(t):t;if(e=he(t),!e)return X?null:Q?w:""}e&&Y&&ue(e.firstChild);const u=pe(st?t:e);for(;o=u.nextNode();)be(o)||(o.content instanceof s&&xe(o.content),we(o));if(st)return t;if(X){if(K)for(c=A.call(e.ownerDocument);e.firstChild;)c.appendChild(e.firstChild);else c=e;return(C.shadowroot||C.shadowrootmod)&&(c=T.call(i,c,!0)),c}let f=G?e.outerHTML:e.innerHTML;return G&&L["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&vt(Wt,e.ownerDocument.doctype.name)&&(f="\n"+f),H&&(f=dt(f,O," "),f=dt(f,S," "),f=dt(f,R," ")),y&&Q?y.createHTML(f):f},n.setConfig=function(t){ie(t),J=!0},n.clearConfig=function(){te=null,J=!1},n.isValidAttribute=function(t,e,n){te||ie({});const i=Qt(t),r=Qt(e);return ve(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&(E[t]=E[t]||[],ft(E[t],e))},n.removeHook=function(t){if(E[t])return ut(E[t])},n.removeHooks=function(t){E[t]&&(E[t]=[])},n.removeAllHooks=function(){E={}},n}();function Jt(t){return function(t,e){const n=e.documentElement;return["⚡4email","amp4email"].some((t=>n.hasAttribute(t)))}(0,t)}var Yt=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function Xt(t,e=""){try{return decodeURIComponent(t)}catch(t){return e}}function Kt(t){const e=B();if(!t)return e;let n;for(;n=Yt.exec(t);){const t=Xt(n[1],n[1]),i=n[2]?Xt(n[2].replace(/\+/g," "),n[2]):"";e[t]=i}return e}function Zt(t){const{location:e}=t||self;return Kt(e.originalHash||e.hash)}var Qt="";function te(t){var e;return Qt||(Qt=(null===(e=t.AMP_CONFIG)||void 0===e?void 0:e.v)||"012309181453000"),Qt}function ee(t,e){const n=e||Zt(t);return["1","actions","amp","amp4ads","amp4email"].includes(n.development)||!!t.AMP_DEV_MODE}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var ne=self.__AMP_LOG;function ie(t,e){throw new Error("failed to call initLogConstructor")}function re(t){return ne.user||(ne.user=se()),function(t,e){return e&&e.ownerDocument.defaultView!=t}(ne.user.win,t)?ne.userForEmbed||(ne.userForEmbed=se()):ne.user}function se(t){return ie()}function oe(t,e,n,i,r,s,o,a,c,l,u){return t}function ae(t,e,n,i,r,s,o,a,c,l,u){return re().assert(t,e,n,i,r,s,o,a,c,l,u)}var ce=/(\S+)(?:\s+(?:(-?\d+(?:\.\d+)?)([a-zA-Z]*)))?\s*(?:,|$)/g;function le(t,e){return G(t.width!=e.width,"Duplicate width: %s",t.width),t.width-e.width}function ue(t,e){return G(t.dpr!=e.dpr,"Duplicate dpr: %s",t.dpr),t.dpr-e.dpr}var fe=(()=>self.AMP.config.urls)();function he(t,e){return ve(t=de(t),e)}function pe(t,e){const n=be(ge(t));return xe(n,e)?ve(n,e):null}function me(t,e){return ye(be(t),e)}function de(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}function ge(t){return t.nodeType?(n=t,e=(n.ownerDocument||n).defaultView,he(e,"ampdoc")).getAmpDoc(t):t;var e,n}function be(t){const e=ge(t);return e.isSingleDoc()?e.win:e}function ve(t,e){oe(xe(t,e));const n=we(t)[e];return n.obj||(oe(n.ctor),oe(n.context),n.obj=new n.ctor(n.context),oe(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function ye(t,e){const n=we(t)[e];return n?n.promise?n.promise:(ve(t,e),n.promise=Promise.resolve(n.obj)):null}function we(t){let e=t.__AMP_SERVICES;return e||(e=t.__AMP_SERVICES={}),e}function xe(t,e){const n=t.__AMP_SERVICES&&t.__AMP_SERVICES[e];return!(!n||!n.ctor)}function ke(t,e,n,r){const s=me(t,e);if(s)return s;const o=ge(t);return o.whenExtensionsKnown().then((()=>{const t=o.getExtensionVersion(n);return t?he(o.win,"extensions").waitForExtension(n,t):null})).then((n=>n?r?me(t,e):function(t,e){return function(t,e){const n=ye(t,e);if(n)return n;const r=we(t);return r[e]=function(){const t=new i,{promise:e,reject:n,resolve:r}=t;return e.catch((()=>{})),{obj:null,promise:e,resolve:r,reject:n,context:null,ctor:null}}(),r[e].promise}(be(t),e)}(t,e):null))}var Ae,_e=t=>function(t,e,n){const i=pe(t,e);return i?Promise.resolve(i):ke(t,e,"amp-bind")}(t,"bind"),Te=t=>he(t,"xhr"),Ee=(()=>self.AMP.config.urls)(),Oe=new Set(["c","v","a","ad"]),Se=t=>"string"==typeof t?Re(t):t;function Re(t,e){return Ae||(Ae=self.document.createElement("a")),function(t,e,n){return t.href="",new URL(e,t.href)}(Ae,t)}function Me(t){return Ee.cdnProxyRegex.test(Se(t).origin)}function je(t,e){return e=Se(e),new URL(t,e.href).toString()}var Pe=(()=>self.AMP.config.urls)();function Ie(t,e,n){return De(e)?function(t,e,n,i){var r;ae(!("__amp_source_origin"in Kt(Re(r=n).search)),"Source origin is not allowed in %s",r);const s=Me(i),o=Re(function(t){if(!Me(t=Se(t)))return t.href;const e=t.pathname.split("/"),n=e[1];ae(Oe.has(n),"Unknown path prefix in url %s",t.href);const i=e[2],r="s"==i?"https://"+decodeURIComponent(e[3]):"http://"+decodeURIComponent(i);return ae(r.indexOf(".")>0,"Expected a . in origin %s",r),e.splice(1,"s"==i?3:2),r+e.join("/")+function(t,e){if(!t||"?"==t)return"";const n=new RegExp("[?&](amp_(js[^&=]*|gsa|r|kit)|usqp)\\b[^&]*","g"),i=t.replace(n,"").replace(/^[?&]/,"");return i?"?"+i:""}(t.search)+(t.hash||"")}(i));if("href"==e&&!n.startsWith("#"))return je(n,o);if("src"==e)return"amp-img"==t?Le(n,o,s):je(n,o);if("srcset"==e){let t;try{t=function(t){const e=[];let n;for(;n=ce.exec(t);){const t=n[1];let i,r;if(n[2]){const t=n[3].toLowerCase();if("w"==t)i=parseInt(n[2],10);else{if("x"!=t)continue;r=parseFloat(n[2])}}else r=1;e.push({url:t,width:i,dpr:r})}return new class{constructor(t){G(t.length>0,"Srcset must have at least one source"),this.Xb=t;let e=!1,n=!1;for(let i=0;i1.2))break;n=o,i=c,r=a}return n}Dy(t){const e=this.Xb;let n=0,i=1/0;for(let r=0;rt.url))}stringify(t){const e=[],n=this.Xb;for(let i=0;iLe(t,o,s)))}return n}(t,e,n,self.location):n}function De(t){return"src"==t||"href"==t||"xlink:href"==t||"srcset"==t}function Le(t,e,n){const i=Re(je(t,e));return"data:"==i.protocol||Me(i)||!n?i.href:`${Pe.cdn}/i/`+("https:"==i.protocol?"s/":"")+encodeURIComponent(i.host)+i.pathname+(i.search||"")+(i.hash||"")}var ze="data-amp-bind-",Ce="i-amphtml-key",Ne={"AMP-IMG":["src","srcset","layout","width","height"]},$e={"applet":!0,"audio":!0,"base":!0,"embed":!0,"frame":!0,"frameset":!0,"iframe":!0,"img":!0,"link":!0,"meta":!0,"object":!0,"style":!0,"video":!0},Fe={"amp-accordion":!0,"amp-anim":!0,"amp-bind-macro":!0,"amp-carousel":!0,"amp-fit-text":!0,"amp-img":!0,"amp-layout":!0,"amp-selector":!0,"amp-sidebar":!0,"amp-timeago":!0},Ue=["a","amp-img","article","aside","b","blockquote","br","caption","code","col","colgroup","dd","del","details","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","header","hr","i","ins","li","main","mark","nav","ol","p","pre","q","s","section","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","u","ul"],Be=["a","article","aside","b","blockquote","br","caption","code","col","colgroup","dd","del","details","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","header","hr","i","ins","li","main","mark","nav","ol","p","pre","q","s","section","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","u","ul"],We=["amp-fx","fallback","heights","layout","min-font-size","max-font-size","on","option","placeholder","submitting","submit-success","submit-error","validation-for","verify-error","visible-when-invalid","href","style","text","subscriptions-action","subscriptions-actions","subscriptions-decorate","subscriptions-dialog","subscriptions-display","subscriptions-section","subscriptions-service","subscriptions-google-rtc","amp-nested-submenu","amp-nested-submenu-open","amp-nested-submenu-close","itemprop"],qe={"a":["rel","target"],"div":["template"],"form":["action-xhr","verify-xhr","custom-validation-reporting","target"],"input":["mask-output"],"template":["type"],"textarea":["autoexpand"]},Ve=["_top","_blank"],He=/^(?:\w+script|data|blob):/i,Ge=/^(?:blob):/i,Je=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ye=Object.freeze({"input":{"type":/(?:image|button)/i}}),Xe=Object.freeze({"input":{"type":/(?:button|file|image|password)/i}}),Ke=Object.freeze(["form","formaction","formmethod","formtarget","formnovalidate","formenctype"]),Ze=Object.freeze({"input":Ke,"textarea":Ke,"select":Ke}),Qe=Object.freeze({"amp-anim":["controls"],"form":["name"]}),tn=/!important|position\s*:\s*fixed|position\s*:\s*sticky/i;function en(t,e,n,i,r=!1){const s=n?n.replace(Je,""):"";if(!r){if(e.startsWith("on")&&"on"!=e)return!1;const t=s.toLowerCase();if(t.indexOf("=0||t.indexOf("=0)return!1;if(He.test(s))return!1}if(Ge.test(s))return!1;if("style"==e)return!tn.test(n);if("class"==e&&n&&/(^|\W)i-amphtml-/i.test(n))return!1;if(De(e)&&/__amp_source_origin/.test(n))return!1;const o=Jt(i),a=Object.assign(B(),Ze,o?Qe:{})[t];if(a&&-1!=a.indexOf(e))return!1;const c=Object.assign(B(),Ye,o?Xe:{})[t];if(c){const t=c[e];if(t&&-1!=n.search(t))return!1}return!0}var nn="purifier",rn={"script":{"attribute":"type","values":["application/json","application/ld+json"]}},sn={USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}};function on(t){return"["==t[0]&&"]"==t[t.length-1]?1:t.startsWith(ze)?2:0}var an=["change","click","dblclick","input","keypress","submit","keydown"],cn=self.__AMP_ERRORS||[];self.__AMP_ERRORS=cn;var ln=(()=>self.AMP.config.urls)(),un="amp-script",fn=15e4,hn=3e5,pn=class extends t.BaseElement{constructor(t){super(t),this.sh=he(this.win,"vsync"),this.xj=null,this.kj=null,this._j=null,this.Tj="amp-script[unknown].js",this.Ej=!1,this.Oj=!1,this.Me=new i,this.Sj=!1,this.Rj=!1,this.Mj=!1}isLayoutSupported(t){return"container"==t||J(t)}buildCallback(){return this.Mj=this.element.hasAttribute("sandboxed"),this.Rj=this.Mj||this.element.hasAttribute("nodom"),this.Sj=this.element.hasAttribute("data-ampdevmode")||this.element.ownerDocument.documentElement.hasAttribute("data-ampdevmode"),this.Sj,this.Rj&&(this.element.hasAttribute("width")||this.element.hasAttribute("height")||this.element.hasAttribute("layout")),(t=this.element,e=un,n=un,ke(t,e,n,undefined).then((t=>function(t,e,n){return ae(t,"Service %s was requested to be provided through %s, but %s is not loaded in the current page. To fix this problem load the JavaScript file for %s in this page.","amp-script",n,n,n)}(t,0,n)))).then((t=>{this.setService(t)}));var t,e,n}onLayoutMeasure(){if(this.Ej||this.Oj)return;const{height:t,width:e}=this.getLayoutSize();e*t!=0||this.Rj||(this.Oj=!0)}setService(t){this._j=t}getUserActivation(){return this.kj}callFunction(t,e){return this.Me.promise.then((()=>this.xj?this.xj.callFunction.apply(this.xj,arguments):Promise.reject(new Error("Attempted to call a function on an amp-script which failed initialization."))))}layoutCallback(){let t;if(this.Ej=!0,this.element.sizerElement){t=this.win.document.createElement("div"),(e=t).classList.add("i-amphtml-fill-content"),e.classList.add("i-amphtml-replaced-content");const n=function(t){return function(t,e){const n=[];for(let e=t.firstElementChild;e;e=e.nextElementSibling)!(function(t){let e;return"string"==typeof t?e=t:W(t)&&(e=t.tagName),!!e&&e.toLowerCase().startsWith("i-")}(i=e)||i.nodeType===Node.ELEMENT_NODE&&(H(i),i.hasAttribute("placeholder")||i.hasAttribute("fallback")||i.hasAttribute("overflow")))&&n.push(e);var i;return n}(t)}(this.element);for(let e=0;e{this.sl.addEventListener(t,this.jj,!0)}))}dispose(){an.forEach((t=>{this.sl.removeEventListener(t,this.jj,!0)}))}hasBeenActive(){return this.Ij>0}isActive(){return this.Ij>0&&Date.now()-this.Ij<=5e3||this.Dj}getLastActivationTime(){return this.Ij}expandLongTask(t){if(!this.isActive())return;oe(!this.Dj),this.Dj=!0;const e=()=>{this.Dj=!1,this.Ij=Date.now()};t.then(e,e)}isInLongTask(){return this.Dj}Pj(t){t.isTrusted&&(this.Ij=Date.now())}}(this.element),this.Tj=this.element.hasAttribute("src")?`amp-script[src="${this.element.getAttribute("src")}"].js`:`amp-script[script="${this.element.getAttribute("script")}"].js`;const n=this.Lj(this.Tj);if(!n)return re().error(un,'"src" or "script" attribute is required.'),Promise.reject(new Error("CANCELLED"));const i=Promise.all([this.zj(),n]).then((t=>{const e=t[0],n=t[1];return!this.Sj&&this._j.sizeLimitExceeded(n.length,this.Mj)?(re().error(un,"Maximum total script size exceeded (%s). %s is disabled. See https://amp.dev/documentation/components/amp-script/#size-of-javascript-code.",this.Mj?hn:fn,this.Tj),this.element.classList.add("i-amphtml-broken"),[]):[e,n]})),r=(this.element.getAttribute("sandbox")||"").split(" ").map((t=>t.trim()));let s;s=`${ln.thirdParty}/2309181453000/amp-script-proxy-iframe.html`;const o={authorURL:this.Tj,mutationPump:this.Cj.bind(this),longTask:t=>{this.kj.expandLongTask(t)},sanitizer:new dn(this,r),onCreateWorker:t=>{},onSendMessage:t=>{},onReceiveMessage:t=>{},sandbox:this.Mj&&{iframeUrl:s}};return(a=t||this.element,c=i,l=o,l.hydrateFilter=C,z(c,a,l)).then((t=>{this.xj=t,this.Me.resolve(),this.xj&&(this.xj.onerror=t=>{t.preventDefault(),re().error(un,`${t.message}\n at (${t.filename}:${t.lineno})`)})}));var a,c,l}zj(){const t=function(t,e,n,i){const r=function(t,e){if(e){let e=`${t.protocol}//${t.host}`;return"about:"!=t.protocol&&"blob:"!=t.protocol&&"data:"!=t.protocol||(e=""),`${e}/dist`}return fe.cdn}(t,i);return`${r}/rtv/${function(t){const e=self;return e.__AMP_MODE?e.__AMP_MODE:e.__AMP_MODE=function(t){return{localDev:!1,development:ee(t,Zt(t)),esm:!0,test:!1,rtvVersion:te(t),ssrReady:!1}}(e)}().rtvVersion}/v0/${e}${n?"-"+n:""}.mjs`}(this.win.location,this.Rj?"amp-script-worker-nodom":"amp-script-worker","0.1",!1);return Te(this.win).fetchText(t,{ampCors:!1}).then((t=>t.text()))}Lj(t){const e=this.element.getAttribute("src");if(e)return this.Nj(e,t);{const e=this.element.getAttribute("script");if(e){const n=this.getAmpDoc().getElementById(e);ae(n,"[%s] %s could not find element with #%s.",un,t,e),ae("amp-script"===n.getAttribute("target"),'[%s] script#%s must have target="amp-script".',un,e);const i=n.textContent;return this.Sj||this.Mj?Promise.resolve(i):this._j.checkSha384(i,t).then((()=>i))}}return null}Nj(t,e){return Te(this.win).fetchText(t,{ampCors:!1}).then((t=>{if(t.url&&this.$j(t.url)){const n=t.headers.get("Content-Type");if(!n||!n.startsWith("application/javascript")&&!n.startsWith("text/javascript"))throw re().createError(un,`Same-origin "src" requires "Content-Type: text/javascript" or "Content-Type: application/javascript". Fetched source for ${e} has "Content-Type: ${n}". See https://amp.dev/documentation/components/amp-script/#security-features.`);return t.text()}return this.Sj||this.Mj?t.text():t.text().then((t=>this._j.checkSha384(t,e).then((()=>t))))}))}$j(t){const e=pe(this.element,"url");return e.getSourceOrigin(this.getAmpDoc().getUrl())===e.parse(t).origin}isMutationAllowedByFixedSize(){return J(this.getLayout())}isMutationAllowedByUserGesture(){return this.kj.isActive()}Cj(t,e){1==e&&this.sh.mutate((()=>this.element.classList.add("i-amphtml-hydrated")));const n=this.isMutationAllowedByFixedSize()||this.isMutationAllowedByUserGesture();this.sh.mutate((()=>{const i=t(n),r=B();i.forEach((t=>{r[t]=r[t]+1||1})),Object.keys(r).forEach((t=>{const e=r[t];re().error(un,this.Fj(t,e))})),i.length>0&&2===e&&(this.xj.terminate(),this.element.classList.remove("i-amphtml-hydrated"),this.element.classList.add("i-amphtml-broken"),re().error(un,"%s was terminated due to illegal mutation.",this.Tj))}))}Fj(t,e){let n;switch(t){case"0":case"3":n="DOM element attributes or styles";break;case"1":n="textContent or the like";break;case"2":n="DOM element children, innerHTML, or the like";break;default:n="the DOM"}return`Blocked ${e} attempts to modify ${n}. For variable-sized containers, a user action has to happen first.`}},mn=["form","button","fieldset","input","object","output","select","textarea"],dn=class{constructor(t,e){var n,i,r;this.i=t.win,this.tf=t.element,i="purifier-inplace",r=function(){return new class{constructor(t,e,n){this.if=t,this.Ly=1,this.Ny=Gt(self),this.Uy=Gt(self);const i=Object.assign(e||{},K(K({},sn),{},{ADD_ATTR:We,ADD_TAGS:["use"],FORBID_TAGS:Object.keys($e),FORCE_BODY:!0,RETURN_DOM:!0,ALLOW_UNKNOWN_PROTOCOLS:!0}));this.Ny.setConfig(i),this.By(this.Ny,n),this.Wy(this.Uy)}purifyHtml(t){return this.Ny.sanitize(t)}purifyTagsForTripleMustache(t){const e=this.Uy.sanitize(t,{"ALLOWED_TAGS":Jt(this.if)?Be:Ue,"FORCE_BODY":!0,"RETURN_DOM_FRAGMENT":!0}),n=this.if.createElement("div");return n.appendChild(e),n.innerHTML}getAllowedTags(){const t={};this.Ny.addHook("uponSanitizeElement",((e,n)=>{Object.assign(t,n.allowedTags)}));const e=this.if.createElement("p");return this.Ny.sanitize(e),Object.keys($e).forEach((e=>{t[e]=!1})),this.Ny.removeHook("uponSanitizeElement"),t}validateAttributeChange(t,e,n){const i=t.nodeName.toLowerCase(),r=rn[i];if(r){const{attribute:t,values:i}=r;if(t===e&&(null==n||!i.includes(n)))return!1}if("a"===i&&"target"===e&&(null==n||!Ve.includes(n)))return!1;if(null==n)return!0;if(0!==on(e))return!1;if(!this.Ny.isValidAttribute(i,e,n)){const t=qe[i];if(!(t&&t.includes(e)||i.startsWith("amp-")))return!1}const s=t.ownerDocument?t.ownerDocument:t;return!(n&&!en(i,e,n,s,!0))}By(t,e){const n=Jt(this.if);let i;const r=[];let s;const o=[];t.addHook("uponSanitizeElement",((t,e)=>{const{tagName:s}=e;if(i=e.allowedTags,s.startsWith("amp-")&&(i[s]=!n||Fe[s]),"a"===s){const e=H(t);e.hasAttribute("href")&&!e.hasAttribute("target")&&e.setAttribute("target","_top")}const o=rn[s];if(o){const{attribute:e,values:n}=o,a=H(t);a.hasAttribute(e)&&n.includes(a.getAttribute(e))&&(i[s]=!0,r.push(s))}})),t.addHook("afterSanitizeElements",(t=>{r.forEach((t=>{delete i[t]})),r.length=0})),t.addHook("uponSanitizeAttribute",((t,n)=>{const i=t.nodeName.toLowerCase(),{attrName:r}=n;let{attrValue:a}=n;s=n.allowedAttributes;const c=()=>{s[r]||(s[r]=!0,o.push(r))};if(i.startsWith("amp-"))c();else{if("a"==i&&"target"==r){const t=a.toLowerCase();a=Ve.includes(t)?t:"_top"}const t=qe[i];t&&t.includes(r)&&c()}const l=on(r);if(1===l){const e=r.substring(1,r.length-1);t.setAttribute(`data-amp-bind-${e}`,a)}0!==l&&t.setAttribute("i-amphtml-binding",""),en(i,r,a,this.if,!0)?e&&a&&!r.startsWith(ze)&&(a=e(i,r,a)):(n.keepAttr=!1,re().error(nn,'Removed invalid attribute %s[%s="%s"].',i,r,a)),n.attrValue=a})),t.addHook("afterSanitizeAttributes",(t=>{!function(t,e){const n=t.tagName.startsWith("AMP-"),i=t.hasAttribute("i-amphtml-binding");!i&&Ne[t.tagName]?t.setAttribute("i-amphtml-ignore",""):(i||n)&&(t.hasAttribute(Ce)||t.setAttribute(Ce,e()))}(t,(()=>String(this.Ly++))),o.forEach((t=>{delete s[t]})),o.length=0,"use"===t.nodeName.toLowerCase()&&["href","xlink:href"].forEach((e=>{t.hasAttribute(e)&&!t.getAttribute(e).startsWith("#")&&(function(t){var e;null===(e=t.parentElement)||void 0===e||e.removeChild(t)}(t),re().error(nn,'Removed invalid . use[href] must start with "#".'))}))}))}Wy(t){let e;t.addHook("uponSanitizeElement",((t,n)=>{const{tagName:i}=n;if(e=n.allowedTags,"template"===i){const n=t.getAttribute("type");n&&"amp-mustache"===n.toLowerCase()&&(e.template=!0)}})),t.addHook("afterSanitizeElements",(t=>{e.template=!1}))}}(t.win.document,{"IN_PLACE":!0},Ie)},function(t,e,n,i,r,s){const o=we(t);let a=o[n];a||(a=o[n]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:!1}),a.ctor||(a.ctor=i,a.context=e,a.sharedInstance=!1,a.resolve&&ve(t,n))}(n=de(n=this.i),n,i,r),this.$y=he(this.i,"purifier-inplace"),this.Uj=this.$y.getAllowedTags(),this.Bj=()=>t.isMutationAllowedByUserGesture(),this.Wj=()=>!this.Bj()&&t.isMutationAllowedByFixedSize(),this.Uj["amp-img"]=!0,this.Uj["amp-layout"]=!0,this.Uj["amp-pixel"]=!1,this.qj=e.includes("allow-forms"),mn.forEach((t=>{this.Uj[t]=this.qj}))}sanitize(t){const e=t.nodeName.toLowerCase(),n=this.Uj[e];return n||this.Vj(e),n}setAttribute(t,e,n){const i=t.nodeName.toLowerCase();if(this.Uj[i]){const r=e.toLowerCase();if(this.$y.validateAttributeChange(t,r,n)){if(null==n)t.removeAttribute(r);else{const e=Ie(i,r,n);t.setAttribute(r,e)}return"a"===i&&t.hasAttribute("href")&&!t.hasAttribute("target")&&t.setAttribute("target","_top"),!0}}return this.Vj(i),!1}Vj(t){return!(this.qj||!mn.includes(t))}setProperty(t,e,n){const i=e.toLowerCase();return!!this.$y.validateAttributeChange(t,i,n)&&(t[e]=n,!0)}getStorage(t,e){if(2===t)return _e(this.tf).then((t=>{if(t)return t.getStateValue(e||".")}));const n=this.Hj(t),i={};for(let t=0;t{if(t){const e=function(t,e){try{return function(t){return JSON.parse(t)}(t)}catch(t){return null==e||e(),null}}(i,(()=>{(ne.dev||(ne.dev=ie())).error(un,"Invalid AMP.setState() argument: %s",i)}));if(e){const n=this.Bj(),i=this.Wj()?[this.tf]:void 0;t.setState(e,{skipEval:!n&&!i,skipAmpState:!1,constrain:i})}}}));const r=this.Hj(t);return null===e?null===i&&re().error(un,"Storage.clear() is not supported in amp-script."):e.startsWith("amp-")?re().error(un,'Invalid "amp-" prefix for storage key: %s',e):null===i?r.removeItem(e):r.setItem(e,i),n()}Hj(t){return 0===t?this.i.localStorage:1===t?this.i.sessionStorage:null}};t.registerServiceForDoc(un,class{constructor(t){this.ji=t,this.Gj=0,this.Jj=0,this.Xb=[];const e=t.getMetaByName("amp-script-src");e&&(this.Xb=e.split(/\s+/).filter(Boolean)),this.uj=he(t.win,"crypto")}checkSha384(t,e){const n=(i=t,"undefined"!=typeof TextEncoder?(new TextEncoder).encode(i):function(t){const e=new Uint8Array(t.length);for(let n=0;n{if(!t||!this.Xb.includes("sha384-"+t))throw re().createError(un,`Script hash not found or incorrect for ${e}. You must include . During development, you can disable this check by adding the "data-ampdevmode" attribute to ${e}, or the root html nodeSee https://amp.dev/documentation/components/amp-script/#script-hash.`)}))}sizeLimitExceeded(t,e){return e?this.Jj+=t:this.Gj+=t,e?this.Jj>hn:this.Gj>fn}fetch(t,e){const n=t.slice("amp-script:".length).split(".");ae(2===n.length&&n[0].length>0&&n[1].length>0,`[${un}]: "amp-script" URIs must be of the format "scriptId.functionIdentifier".`);const i=n[0],r=n[1],s=this.ji.getElementById(i);ae(s&&"AMP-SCRIPT"===s.tagName,`[${un}]: could not find with script set to ${i}`);const o=Array.prototype.slice.call(arguments,1);return s.getImpl().then((t=>t.callFunction.apply(t,[r].concat(o))))}}),t.registerElement(un,pn,"amp-script{opacity:0.7}amp-script.i-amphtml-hydrated{opacity:1}\n/*# sourceURL=/extensions/amp-script/0.1/amp-script.css*/")})(); /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ /*! Bundled license information: dompurify/dist/purify.es.js: (*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE *) */}}); //# sourceMappingURL=amp-script-0.1.mjs.map