;
(self.AMP=self.AMP||[]).push({m:1,v:"2601162341000",n:"amp-action-macro",ev:"0.1",l:!0,f:function(t,n){(()=>{var{isArray:n}=Array,{hasOwnProperty:r,toString:e}=Object.prototype;self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var i=self.__AMP_LOG;function o(t){return function(t,n){throw new Error("failed to call initLogConstructor")}()}function s(t,n,r,e,i,o,s,u,c,a,l){return t}function u(t,n,r,e,s,u,c,a,l,f,h){return(i.user||(i.user=o()),void i.user.win?i.userForEmbed||(i.userForEmbed=o()):i.user).assert(t,n,r,e,s,u,c,a,l,f,h)}function c(t){return t.nodeType?(r=t,n=(r.ownerDocument||r).defaultView,function(t,n){return a(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),"ampdoc")}(n)).getAmpDoc(t):t;var n,r}function a(t,n){s(l(t,n));const r=function(t){let n=t.__AMP_SERVICES;return n||(n=t.__AMP_SERVICES={}),n}(t)[n];return r.obj||(s(r.ctor),s(r.context),r.obj=new r.ctor(r.context),s(r.obj),r.context=null,r.resolve&&r.resolve(r.obj)),r.obj}function l(t,n){const r=t.__AMP_SERVICES&&t.__AMP_SERVICES[n];return!(!r||!r.ctor)}var f="amp-action-macro",h=class extends t.BaseElement{constructor(t){super(t),this.E_=null,this.BL=[]}buildCallback(){const{element:t}=this;this.E_=(t=>function(t,n){const r=function(t){const n=c(t);return n.isSingleDoc()?n.win:n}(c(t));return l(r,n)?a(r,n):null}(t,"action"))(t);const n=t.getAttribute("arguments");n&&(this.BL=n.split(",").map((t=>t.trim()))),this.registerAction("execute",this.vs.bind(this))}getLayoutPriority(){return 1}vs(t){const{actionEventType:n,args:r,event:e,trust:i}=t;if(r&&this.BL.length>0)for(const t in r)u(this.BL.includes(t),'Variable argument name "%s" is not defined in %s',t,this.element);t.caller.tagName.toLowerCase()===f&&u(this.GL(t.caller),'Action macro with ID "%s" cannot reference itself or macros defined after it',this.element.getAttribute("id")),this.E_.trigger(this.element,`${n}`,e,i,r)}renderOutsideViewport(){return!0}isLayoutSupported(t){return!0}GL(t){return!!(this.element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)}};t.registerElement(f,h)})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-action-macro-0.1.mjs.map