@dreamsengine/dreams-ad-engine 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dreams-ad-engine.js +4 -4
- package/package.json +1 -1
package/dist/dreams-ad-engine.js
CHANGED
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const U=globalThis,D=U.trustedTypes,Q=D?D.createPolicy("lit-html",{createHTML:n=>n}):void 0,dt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+_,Et=`<${lt}>`,b=document,O=()=>b.createComment(""),N=n=>n===null||typeof n!="object"&&typeof n!="function",ht=Array.isArray,xt=n=>ht(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",B=`[
|
|
14
14
|
\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,Y=/>/g,y=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,ct=/^(?:script|style|textarea|title)$/i,Pt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),P=Pt(1),S=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),it=new WeakMap,A=b.createTreeWalker(b,129);function pt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":"",o=x;for(let d=0;d<e;d++){const a=n[d];let c,u,l=-1,v=0;for(;v<a.length&&(o.lastIndex=v,u=o.exec(a),u!==null);)v=o.lastIndex,o===x?u[1]==="!--"?o=X:u[1]!==void 0?o=Y:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=y):u[3]!==void 0&&(o=y):o===y?u[0]===">"?(o=i??x,l=-1):u[1]===void 0?l=-2:(l=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?y:u[3]==='"'?et:tt):o===et||o===tt?o=y:o===X||o===Y?o=x:(o=y,i=void 0);const $=o===y&&n[d+1].startsWith("/>")?" ":"";r+=o===x?a+Et:l>=0?(s.push(c),a.slice(0,l)+dt+a.slice(l)+_+$):a+_+(l===-2?d:$)}return[pt(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),s]};class z{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const d=t.length-1,a=this.parts,[c,u]=Ct(t,e);if(this.el=z.createElement(c,s),A.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=A.nextNode())!==null&&a.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(dt)){const v=u[o++],$=i.getAttribute(l).split(_),
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,ct=/^(?:script|style|textarea|title)$/i,Pt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),P=Pt(1),S=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),it=new WeakMap,A=b.createTreeWalker(b,129);function pt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":"",o=x;for(let d=0;d<e;d++){const a=n[d];let c,u,l=-1,v=0;for(;v<a.length&&(o.lastIndex=v,u=o.exec(a),u!==null);)v=o.lastIndex,o===x?u[1]==="!--"?o=X:u[1]!==void 0?o=Y:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=y):u[3]!==void 0&&(o=y):o===y?u[0]===">"?(o=i??x,l=-1):u[1]===void 0?l=-2:(l=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?y:u[3]==='"'?et:tt):o===et||o===tt?o=y:o===X||o===Y?o=x:(o=y,i=void 0);const $=o===y&&n[d+1].startsWith("/>")?" ":"";r+=o===x?a+Et:l>=0?(s.push(c),a.slice(0,l)+dt+a.slice(l)+_+$):a+_+(l===-2?d:$)}return[pt(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),s]};class z{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const d=t.length-1,a=this.parts,[c,u]=Ct(t,e);if(this.el=z.createElement(c,s),A.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=A.nextNode())!==null&&a.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(dt)){const v=u[o++],$=i.getAttribute(l).split(_),k=/([.?@])?(.*)/.exec(v);a.push({type:1,index:r,name:k[2],strings:$,ctor:k[1]==="."?Tt:k[1]==="?"?Ot:k[1]==="@"?Nt:L}),i.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:r}),i.removeAttribute(l));if(ct.test(i.tagName)){const l=i.textContent.split(_),v=l.length-1;if(v>0){i.textContent=D?D.emptyScript:"";for(let $=0;$<v;$++)i.append(l[$],O()),A.nextNode(),a.push({type:2,index:++r});i.append(l[v],O())}}}else if(i.nodeType===8)if(i.data===lt)a.push({type:2,index:r});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var o,d;if(t===S)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=N(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((d=i==null?void 0:i._$AO)==null||d.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class Ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??b).importNode(e,!0);A.currentNode=i;let r=A.nextNode(),o=0,d=0,a=s[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new I(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new zt(r,this,t)),this._$AV.push(c),a=s[++d]}o!==(a==null?void 0:a.index)&&(r=A.nextNode(),o++)}return A.currentNode=b,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class I{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),N(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xt(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==p&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=z.createElement(pt(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new Ut(i,this),d=o.u(this.options);o.p(e),this.T(d),this._$AH=o}}_$AC(t){let e=it.get(t.strings);return e===void 0&&it.set(t.strings,e=new z(t)),e}k(t){ht(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new I(this.S(O()),this.S(O()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=E(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const d=t;let a,c;for(t=r[0],a=0;a<r.length-1;a++)c=E(this,d[s+a],e,a),c===S&&(c=this._$AH[a]),o||(o=!N(c)||c!==this._$AH[a]),c===p?t=p:t!==p&&(t+=(c??"")+r[a+1]),this._$AH[a]=c}o&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Tt extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Ot extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Nt extends L{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??p)===S)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class zt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}}const W=U.litHtmlPolyfillSupport;W==null||W(z,I),(U.litHtmlVersions??(U.litHtmlVersions=[])).push("3.1.3");const It=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new I(t.insertBefore(O(),r),r,void 0,e??{})}return i._$AI(n),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/class T extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
19
|
+
*/class T extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=It(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}}var rt;T._$litElement$=!0,T.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:T});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:T});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const kt=n=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(n,t)}):customElements.define(n,t)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
<slot name="ad-slot"></slot>
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
|
-
`}};H=new WeakSet;gt=function(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.dreamsAllSlots=window.dreamsAllSlots||[],window.dreamsSlotsToUpdate=window.dreamsSlotsToUpdate||[],window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()}),this.apstag&&this.pubId&&window.apstag.init({pubID:this.pubId,adServer:"googletag",bidTimeout:this.bidTimeout})};ft=function(){const n=`/${this.networkId}/${this.adUnit}`,t=this.divId,e=document.createElement("div");e.id=t,e.setAttribute("data-ad",this.divId),e.setAttribute("slot","ad-slot"),e.classList.add("ad-serving-rendered"),e.parentElement||this.appendChild(e),window.googletag.cmd.push(()=>{const s=window.googletag.defineSlot(n,this.sizing,t).addService(window.googletag.pubads());window.googletag.pubads().addEventListener("slotRenderEnded",d=>{d.slot.getSlotElementId()===t&&(this.adLoaded=!0)});const i=window.googletag.sizeMapping();this.mapping.forEach(d=>{i.addSize(d.viewport,d.sizing)});const r=i.build(),o=s.defineSizeMapping(r).addService(window.googletag.pubads());this.refresh&&window.dreamsSlotsToUpdate.push(s),window.dreamsAllSlots.push(o)
|
|
139
|
+
`}};H=new WeakSet;gt=function(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.dreamsAllSlots=window.dreamsAllSlots||[],window.dreamsSlotsToUpdate=window.dreamsSlotsToUpdate||[],window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()}),this.apstag&&this.pubId&&window.apstag.init({pubID:this.pubId,adServer:"googletag",bidTimeout:this.bidTimeout})};ft=function(){const n=`/${this.networkId}/${this.adUnit}`,t=this.divId,e=document.createElement("div");e.id=t,e.setAttribute("data-ad",this.divId),e.setAttribute("slot","ad-slot"),e.classList.add("ad-serving-rendered"),e.parentElement||this.appendChild(e),window.googletag.cmd.push(()=>{const s=window.googletag.defineSlot(n,this.sizing,t).addService(window.googletag.pubads());window.googletag.pubads().addEventListener("slotRenderEnded",d=>{d.slot.getSlotElementId()===t&&(this.adLoaded=!0)});const i=window.googletag.sizeMapping();this.mapping.forEach(d=>{i.addSize(d.viewport,d.sizing)});const r=i.build(),o=s.defineSizeMapping(r).addService(window.googletag.pubads());this.refresh&&window.dreamsSlotsToUpdate.push(s),window.dreamsAllSlots.push(o),!this.apstag&&!this.pubId&&window.googletag.display(t),this.apstag&&this.pubId&&window.apstag.fetchBids({slots:[{slotID:t,slotName:n,sizes:this.sizing}]},()=>{window.googletag.cmd.push(()=>{window.apstag.setDisplayBids(),window.googletag.pubads().refresh([o])})})})};h.styles=at(Rt);h.initialized=!1;h.old_url="";g([f({type:String})],h.prototype,"networkId",2);g([f({type:String})],h.prototype,"adUnit",2);g([f({type:String})],h.prototype,"divId",2);g([f({type:Array})],h.prototype,"mapping",2);g([f({type:Array})],h.prototype,"sizing",2);g([f({type:Boolean,reflect:!0})],h.prototype,"refresh",2);g([f({type:Boolean,reflect:!0})],h.prototype,"enableTitle",2);g([f({type:Boolean,reflect:!0})],h.prototype,"apstag",2);g([f({type:String})],h.prototype,"pubId",2);g([f({type:Number})],h.prototype,"bidTimeout",2);g([f({type:String})],h.prototype,"title",2);g([f({type:Boolean})],h.prototype,"adLoaded",2);h=g([kt("dreams-ad-engine")],h);
|