diff --git a/assets/iframemanager/iframemanager.css b/assets/iframemanager/iframemanager.css index a9dff9d..e62b235 100644 --- a/assets/iframemanager/iframemanager.css +++ b/assets/iframemanager/iframemanager.css @@ -1 +1 @@ -:root{--im-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--im-color:#fff;--im-bg:#0b1016;--im-link-color:#5fb3fb;--im-link-hover-color:rgba(95,178,251,.682);--im-btn-color:#fff;--im-btn-bg:rgba(0,102,219,.84);--im-btn-hover-bg:rgba(9,80,161,.89);--im-btn-active-box-shadow:0 0 0 4px rgba(24,104,250,.24);--im-btn-s-color:var(--im-bg);--im-btn-s-bg:rgba(225,239,255,.8);--im-btn-s-hover-bg:rgba(225,239,255,.95);--im-btn-s-active-bg:rgba(225,239,255,.6);--im-overlay-bg:linear-gradient(14deg,#1e3861,rgba(206,220,233,.118))}div[data-service],div[data-service] .cll,div[data-service] .cll :after,div[data-service] .cll a,div[data-service] .cll button,div[data-service] .cll div,div[data-service] .cll iframe,div[data-service] .cll span,div[data-service]:before{all:unset;box-sizing:border-box}div[data-service] .cll a,div[data-service] .cll button,div[data-service] .cll input{-webkit-appearance:none;appearance:none;cursor:pointer;display:revert;font-family:inherit;font-size:100%;line-height:normal;margin:0;outline:revert;outline-offset:2px;overflow:hidden}div[data-service]{background-color:#0b1016;background-color:var(--im-bg);display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-family:var(--im-font-family);font-size:16px;font-weight:400;max-width:100%;min-height:150px;min-width:300px;overflow:hidden;position:relative}div[data-service]:before{content:"";display:block;padding-top:56.25%}div[data-service] .cll .c-ld{bottom:2em;opacity:0;right:2.5em;transform:translateY(10px);visibility:hidden}div[data-service] .cll .c-ld,div[data-service] .cll .c-ld:after{border-radius:100%;height:20px;position:absolute;width:20px;z-index:1}div[data-service] .cll .c-ld:after{animation:spin 1s linear infinite;border:4px solid #fff;border-top-color:transparent;content:""}div[data-service].c-h-n .cll .c-ld{opacity:1;transform:translateY(0);visibility:visible}div[data-service].c-h-b .cll .c-ld{opacity:0;transform:translateY(0);visibility:hidden}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}div[data-autoscale]{height:auto;width:100%}div[data-service] .cll .c-nt{bottom:0;color:#fff;color:var(--im-color);height:100%;left:0;max-width:100%;position:absolute;right:0;top:0;width:100%}div[data-service] .cll .c-bg{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0}div[data-service] .cll .c-bg:before{background:linear-gradient(14deg,#1e3861,rgba(206,220,233,.118));background:var(--im-overlay-bg);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}div[data-service] .cll .c-bg-i{background-position:50%;background-repeat:no-repeat;background-size:cover;bottom:0;left:0;opacity:0;position:absolute;right:0;top:0}div[data-service] .cll .c-bg-i.loaded{opacity:1}div[data-service] .cll .c-tl{display:block;font-size:1.2em;font-weight:600;margin-bottom:10px;text-align:center}div[data-service].c-h-n .cll .c-bg{opacity:1;transform:scale(1)}div[data-service] .cll .c-n-c{align-items:center;display:flex;font-size:.9em;height:100%;justify-content:center;position:relative}div[data-service] .cll .c-n-t{display:block;font-size:.95em;line-height:1.4em;margin:0 auto;max-width:420px;position:relative;z-index:1}div[data-service] .cll .c-n-t+div{margin-top:20px}div[data-service] .cll .c-n-a,div[data-service] .cll .c-n-t{align-items:center;display:flex;gap:12px;justify-content:center;text-align:center}div[data-service] .cll .c-t-cn{padding:0 12px;z-index:1}div[data-service] .cll .c-l-b,div[data-service] .cll .c-la-b{align-items:center;background:rgba(0,102,219,.84);background:var(--im-btn-bg);border-radius:4px;box-shadow:0 4px 12px rgba(0,0,0,.19);color:#fff;color:var(--im-btn-color);display:flex;font-size:.85em;font-weight:600;gap:8px;justify-content:space-evenly;padding:1em;position:relative}div[data-service] .cll .c-l-b:before{background-position:50%;background-repeat:no-repeat;background-size:contain;border-bottom:7.5px solid transparent;border-left:12px solid #fff;border-left:12px solid var(--im-btn-color);border-top:7.5px solid transparent;content:"";display:block}div[data-service] .cll .c-la-b{background:rgba(225,239,255,.8);background:var(--im-btn-s-bg);color:#0b1016;color:var(--im-btn-s-color);padding:1em}div[data-service] .cll .c-la-b:hover{background:rgba(225,239,255,.95);background:var(--im-btn-s-hover-bg)}div[data-service] .cll .c-l-b:hover{background:rgba(9,80,161,.89);background:var(--im-btn-hover-bg)}div[data-service] .cll .c-la-b:active{background:rgba(225,239,255,.6);background:var(--im-btn-s-active-bg);transition:none!important}div[data-service] .cll .c-l-b:active{box-shadow:0 0 0 4px rgba(24,104,250,.24);box-shadow:var(--im-btn-active-box-shadow);transition:none!important}div[data-service].c-h-n .cll .c-t-cn{opacity:0;transform:translateY(-10px);transition-duration:.2s;visibility:hidden}div[data-service] .cll iframe{background:#fff;border:none;bottom:0;display:block;height:100%;left:0;max-width:100%;opacity:0;position:absolute;right:0;top:0;visibility:hidden;width:100%;z-index:1}div[data-service].c-h-b .cll iframe{display:block!important;height:100%!important;opacity:1;visibility:visible}div[data-service] .cll .c-n-t a{border-bottom:1px solid #5fb3fb;border-bottom:1px solid var(--im-link-color);color:#5fb3fb;color:var(--im-link-color);text-decoration:none}div[data-service] .cll .c-n-t a:hover{--im-link-color:var(--im-link-hover-color)}div[data-service][data-ratio="1:1"]:before{padding-top:100%}div[data-service][data-ratio="2:1"]:before{padding-top:50%}div[data-service][data-ratio="3:2"]:before{padding-top:66.666666%}div[data-service][data-ratio="5:2"]:before{padding-top:40%}div[data-service][data-ratio="4:3"]:before{padding-top:75%}div[data-service][data-ratio="16:9"]:before{padding-top:56.25%}div[data-service][data-ratio="16:10"]:before{padding-top:62.5%}div[data-service][data-ratio="20:9"]:before{padding-top:45%}div[data-service][data-ratio="21:9"]:before{padding-top:42.857142%}div[data-service][data-ratio="9:16"]:before{padding-top:177.777777%}div[data-service][data-ratio="9:20"]:before{padding-top:222.222222%}div[data-widget]:before{display:none}div[data-widget].c-h-b .cll .c-ld{opacity:0;visibility:hidden}div[data-widget] .cll+*,div[data-widget] .cll>:last-child{height:100%!important;margin:0!important}div[data-service] [data-placeholder]{bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden}@keyframes fadeIn{0%{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}div.c-an [data-placeholder]{animation:none}div[data-service] [data-placeholder][data-visible]{align-items:center;animation:fadeIn .2s forwards;animation-delay:.4s;color:#fff;color:var(--im-color);display:flex;justify-content:center}div[data-service].show-ph [data-placeholder]{opacity:1;visibility:visible}div[data-service].show-ph .cll .c-ld{opacity:0;visibility:hidden}div.c-an .cll .c-bg,div.c-an .cll .c-bg:before,div.c-an .cll .c-ld,div.c-an .cll .c-n-t,div.c-an .cll .c-t-cn{transition:opacity .3s ease,visibility .3s ease,transform .3s ease}div.c-an .cll .c-bg-i{transition:opacity .5s ease,transform .5s ease}div.c-an[data-widget]{transition:opacity .3s ease,background-color .3s ease}div.c-an .cll .c-l-b,div.c-an .cll .c-la-b{transition:opacity .3s ease,transform .3s cubic-bezier(.25,1,.5,1),visibility .3s ease,box-shadow .3s ease,background-color .3s ease}div.c-an .cll .c-n-t a{transition:color .2s ease,border-color .2s ease}div.c-an .cll iframe,div.c-an [data-placeholder]{transition:opacity .3s ease,visibility .3s ease;transition-delay:.1s} \ No newline at end of file +:root{--im-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--im-color:#fff;--im-bg:#0b1016;--im-link-color:#5fb3fb;--im-link-hover-color:rgba(95,178,251,.682);--im-btn-color:#fff;--im-btn-bg:rgba(0,102,219,.84);--im-btn-hover-bg:rgba(9,80,161,.89);--im-btn-active-box-shadow:0 0 0 .25em rgba(24,104,250,.24);--im-btn-s-color:var(--im-bg);--im-btn-s-bg:rgba(225,239,255,.8);--im-btn-s-hover-bg:rgba(225,239,255,.95);--im-btn-s-active-bg:rgba(225,239,255,.6);--im-overlay-bg:linear-gradient(14deg,#1e3861,rgba(206,220,233,.118))}div[data-service],div[data-service] .cll,div[data-service] .cll a,div[data-service] .cll button{all:initial;box-sizing:border-box;font-family:inherit;font-size:inherit;font-weight:inherit}div[data-service] .cll :after,div[data-service] .cll iframe,div[data-service] .cll span,div[data-service]:before{all:unset;box-sizing:border-box}div[data-service] .cll a,div[data-service] .cll button,div[data-service] .cll input{-webkit-appearance:none;appearance:none;cursor:pointer;display:revert;font-family:inherit;font-size:100%;line-height:normal;margin:0;outline:revert;overflow:hidden}div[data-service]{background-color:#0b1016;background-color:var(--im-bg);display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-family:var(--im-font-family);font-size:16px;font-weight:400;max-width:100%;min-height:9.375rem;min-width:18.75rem;overflow:hidden;position:relative}div[data-service]:before{content:"";display:block;padding-top:56.25%}div[data-service] .cll .c-ld{bottom:2em;opacity:0;right:2.5em;transform:translateY(1.4em);visibility:hidden}div[data-service] .cll .c-ld,div[data-service] .cll .c-ld:after{border-radius:100%;height:1.25em;position:absolute;width:1.25em;z-index:1}div[data-service] .cll .c-ld:after{animation:spin 1s linear infinite;border:.25em solid #fff;border-top-color:transparent;content:""}div[data-service].c-h-n .cll .c-ld{opacity:1;transform:translateY(0);visibility:visible}div[data-service].c-h-b .cll .c-ld{opacity:0;transform:translateY(0);visibility:hidden}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}div[data-autoscale]{height:auto;width:100%}div[data-service] .cll .c-nt{bottom:0;color:#fff;color:var(--im-color);height:100%;left:0;max-width:100%;position:absolute;right:0;top:0;width:100%}div[data-service] .cll .c-bg{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0}div[data-service] .cll .c-bg:before{background:linear-gradient(14deg,#1e3861,rgba(206,220,233,.118));background:var(--im-overlay-bg);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}div[data-service] .cll .c-bg-i{background-position:50%;background-repeat:no-repeat;background-size:cover;bottom:0;left:0;opacity:0;position:absolute;right:0;top:0}div[data-service] .cll .c-bg-i.loaded{opacity:1}div[data-service] .cll .c-tl{display:block;font-size:1.2em;font-weight:600;margin-bottom:.6em;text-align:center}div[data-service].c-h-n .cll .c-bg{opacity:1;transform:scale(1)}div[data-service] .cll .c-n-c{align-items:center;display:flex;height:100%;justify-content:center;position:relative}div[data-service] .cll .c-n-t{display:block;font-size:.87em;line-height:1.4em;margin:0 auto;max-width:32em;position:relative;z-index:1}div[data-service] .cll .c-n-a{margin-top:1.25em}div[data-service] .cll .c-n-a,div[data-service] .cll .c-n-t{align-items:center;display:flex;justify-content:center;text-align:center}div[data-service] .cll .c-n-a button+button{margin-left:.8em}div[data-service] .cll .c-t-cn{padding:0 .75em;z-index:1}div[data-service] .cll .c-l-b,div[data-service] .cll .c-la-b{align-items:center;align-self:stretch;background:rgba(0,102,219,.84);background:var(--im-btn-bg);border-radius:.3125em;box-shadow:0 .25em .75em rgba(0,0,0,.19);color:#fff;color:var(--im-btn-color);display:flex;font-size:.77em;font-weight:600;justify-content:space-evenly;padding:.975em 1.1em;position:relative}div[data-service] .cll .c-l-b:before{background-position:50%;background-repeat:no-repeat;background-size:contain;border-bottom:.6em solid transparent;border-left:1em solid #fff;border-left:1em solid var(--im-btn-color);border-top:.6em solid transparent;content:"";display:block;margin-right:.75em}div[data-service] .cll .c-la-b{background:rgba(225,239,255,.8);background:var(--im-btn-s-bg);color:#0b1016;color:var(--im-btn-s-color)}div[data-service] .cll .c-la-b:hover{background:rgba(225,239,255,.95);background:var(--im-btn-s-hover-bg)}div[data-service] .cll .c-l-b:hover{background:rgba(9,80,161,.89);background:var(--im-btn-hover-bg)}div[data-service] .cll .c-la-b:active{background:rgba(225,239,255,.6);background:var(--im-btn-s-active-bg);transition:none!important}div[data-service] .cll .c-l-b:active{box-shadow:0 0 0 .25em rgba(24,104,250,.24);box-shadow:var(--im-btn-active-box-shadow);transition:none!important}div[data-service].c-h-n .cll .c-t-cn{opacity:0;transform:translateY(-.7em);transition-duration:.2s;visibility:hidden}div[data-service] .cll iframe{background:#fff;border:none;bottom:0;display:block;height:100%;left:0;max-width:100%;opacity:0;position:absolute;right:0;top:0;visibility:hidden;width:100%;z-index:1}div[data-service].c-h-b .cll iframe{display:block!important;height:100%!important;opacity:1;visibility:visible}div[data-service] .cll .c-n-t a{border-bottom:1px solid #5fb3fb;border-bottom:1px solid var(--im-link-color);color:#5fb3fb;color:var(--im-link-color);text-decoration:none}div[data-service] .cll .c-n-t a:hover{--im-link-color:var(--im-link-hover-color)}div[data-service][data-ratio="1:1"]:before{padding-top:100%}div[data-service][data-ratio="2:1"]:before{padding-top:50%}div[data-service][data-ratio="3:2"]:before{padding-top:66.666666%}div[data-service][data-ratio="5:2"]:before{padding-top:40%}div[data-service][data-ratio="4:3"]:before{padding-top:75%}div[data-service][data-ratio="16:9"]:before{padding-top:56.25%}div[data-service][data-ratio="16:10"]:before{padding-top:62.5%}div[data-service][data-ratio="20:9"]:before{padding-top:45%}div[data-service][data-ratio="21:9"]:before{padding-top:42.857142%}div[data-service][data-ratio="9:16"]:before{padding-top:177.777777%}div[data-service][data-ratio="9:20"]:before{padding-top:222.222222%}div[data-widget]:before{display:none}div[data-widget].c-h-b .cll .c-ld{opacity:0;visibility:hidden}div[data-widget] .cll+*,div[data-widget] .cll>:last-child{height:100%!important;margin:0!important}div[data-service] [data-placeholder]{bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden}@keyframes fadeIn{0%{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}div.c-an [data-placeholder]{animation:none}div[data-service] [data-placeholder][data-visible]{align-items:center;animation:fadeIn .2s forwards;animation-delay:.4s;color:#fff;color:var(--im-color);display:flex;justify-content:center}div[data-service].show-ph [data-placeholder]{opacity:1;visibility:visible}div[data-service].show-ph .cll .c-ld{opacity:0;visibility:hidden}div.c-an .cll .c-bg,div.c-an .cll .c-bg:before,div.c-an .cll .c-ld,div.c-an .cll .c-n-t,div.c-an .cll .c-t-cn{transition:opacity .3s ease,visibility .3s ease,transform .4s ease}div.c-an .cll .c-bg-i{transition:opacity .5s ease,transform .5s ease}div.c-an[data-widget]{transition:opacity .3s ease,background-color .3s ease}div.c-an .cll .c-l-b,div.c-an .cll .c-la-b{transition:opacity .3s ease,transform .3s cubic-bezier(.25,1,.5,1),visibility .3s ease,box-shadow .3s ease,background-color .3s ease}div.c-an .cll .c-n-t a{transition:color .2s ease,border-color .2s ease}div.c-an .cll iframe,div.c-an [data-placeholder]{transition:opacity .3s ease,visibility .3s ease;transition-delay:.1s} \ No newline at end of file diff --git a/assets/iframemanager/iframemanager.js b/assets/iframemanager/iframemanager.js index 40821d3..f834810 100644 --- a/assets/iframemanager/iframemanager.js +++ b/assets/iframemanager/iframemanager.js @@ -1,6 +1,6 @@ /*! - * iframemanager v1.2.2 + * iframemanager v1.2.4 * Author Orest Bida * Released under the MIT License */ -(()=>{'use strict';const e='click',t='{data-id}',n='accept',o='reject',c='c-h-n',i='c-h-b',s='show-ph';let r,a,l,f,d,u={},v=!1,m='',p={},b=new Map,h='api';const w=['onload','onerror','src'],_=e=>'function'==typeof e,g=e=>'string'==typeof e,$=e=>a.createElement(e),S=()=>$('div'),I=()=>{const e=$('button');return e.type='button',e},T=(e,t)=>e.className=t,x=(e,t)=>e.classList.add(t),y=(e,t)=>e.appendChild(t),P=e=>e&&Object.keys(e)||[],D=(e,t)=>{for(const n in t)j(e,n,t[n])},O=e=>{const t=e.dataset,n={},o='data-iframe-',c=e.getAttributeNames().filter((e=>e.slice(0,12)===o)).map((e=>e.slice(12))),i=e.querySelector('[data-placeholder]'),s=i?.hasAttribute('data-visible');s&&i.removeAttribute('data-visible');const r=i?.cloneNode(!0);for(const t of c)n[t]=e.getAttribute(o+t);return{t:t.id,o:t.title,i:t.thumbnail,l:t.params,u:e,v:null,m:i,p:r,h:null,_:!1,g:!1,$:!0,S:'widget'in t,I:s,T:n}},k=(e,t)=>{const n=u[e];if('IntersectionObserver'in r){const e=new IntersectionObserver((o=>{for(const c of o)c.isIntersecting&&(E(t,n[c.target.dataset.index]),e.unobserve(c.target))}));for(const t of n)e.observe(t.u)}},E=(e,n)=>{const o=e=>{n.h.style.backgroundImage=`url('${e}')`;const t=new Image;t.onload=()=>x(n.h,'loaded'),t.src=e};if(g(n.i))''!==n.i&&o(n.i);else if(_(e))e(n.t,(e=>o(e)));else if(g(e)){const c=e.replace(t,n.t);o(c)}},M=(e,n)=>{if(e._)return;if(e._=!0,e.m){const t=e.p.cloneNode(!0);e.m.replaceWith(t),e.m=t}const o=n.iframe;if(_(n.onAccept))return void n.onAccept(e.u,(t=>{if(!(t instanceof HTMLIFrameElement))return!1;D(t,o),D(t,e.T),e.P=t,e._=!0,x(e.u,i),(!e.I||e.S)&&x(e.u,s)}));e.P=$('iframe');const c=e.l||n.iframe?.params;let r=(n.embedUrl||'').replace(t,e.t);e.o&&(e.P.title=e.o),c&&g(c)&&(r+='?'===c.slice(0,1)?c:`?${c}`),e.P.onload=()=>{x(e.u,i),e.P.onload=void 0,_(o?.onload)&&o.onload(e.t,e.P)},D(e.P,o),D(e.P,e.T),e.P.src=r,y(e.v,e.P)},j=(e,t,n)=>{w.includes(t)||e.setAttribute(t,n)},C=e=>{x(e.u,c),e.$=!1},L=e=>{e.u.classList.remove(c,i,s),e.$=!0},N=e=>(e=a.cookie.match(`(^|;)\\s*${e}\\s*=\\s*([^;]+)`))?e.pop():'',A=(t,n,o)=>{const i=u[t],s=n.languages;i.forEach((i=>{if(!i.g&&s){const r=s[m]?.loadBtn,l=s[m]?.notice,f=s[m]?.loadAllBtn,d=a.createElement('div'),u=S(),v=S(),p=S(),b=S();T(d,'cll'),i.v=d;const w=()=>{C(i),M(i,n)};if(r){const t=I();t.textContent=r,T(t,'c-l-b'),t.addEventListener(e,w),y(b,t)}if(f){const n=I();n.textContent=f,T(n,r?'c-la-b':'c-l-b'),n.addEventListener(e,(()=>{w(),h=e,W.acceptService(t)})),y(b,n)}const _=S(),P=S(),D=S(),O=S(),k=S();T(_,'cc-text'),T(O,'c-bg-i'),i.h=O,T(D,'c-ld'),g(i.i)&&''===i.i||T(P,'c-bg');const E=i.o,j=a.createDocumentFragment();if(E){const e=$('span');T(e,'c-tl'),e.insertAdjacentHTML('beforeend',E),y(j,e)}y(_,j),u&&_.insertAdjacentHTML('beforeend',l||''),y(v,_),T(k,'c-t-cn'),T(v,'c-n-t'),T(p,'c-n-c'),T(u,'c-nt'),T(b,'c-n-a'),y(k,v),(r||f)&&y(k,b),y(p,k),y(u,p),y(P,O),y(d,u),(n.thumbnailUrl||i.i)&&y(d,P),y(d,D),o&&x(i.u,c),i.u.prepend(d),i.g=!0,setTimeout((()=>x(i.u,'c-an')),20)}}))},F=(e,t)=>{const n=u[e];if('IntersectionObserver'in r){const e=new IntersectionObserver((o=>{if(v)e.disconnect();else for(let c=0;c{const i=o[c].target;setTimeout((()=>{const e=i.dataset.index;M(n[e],t),C(n[e])}),50*c),e.unobserve(i)})(c)}));n.forEach((t=>{t._||e.observe(t.u)}))}},G=(e,t)=>e in t?e:P(t).length>0?m in t?m:P(t)[0]:void 0,H=(e,t)=>{const{cookie:n}=t;N(n.name)||(e=>{const{hostname:t,protocol:n}=location,o=e.name,c=new Date,i=e.path||'/',s=864e5*(e.expiration||182),r=e.sameSite||'Lax',l=e.domain||t;c.setTime(c.getTime()+s);let f=o+'=1'+(0!==s?`; Expires=${c.toUTCString()}`:'')+`; Path=${i}`+`; SameSite=${r}`;l.indexOf('.')>-1&&(f+=`; Domain=${l}`),'https:'===n&&(f+='; Secure'),a.cookie=f})(n),F(e,t)},J=(e,t)=>{const{cookie:n}=t;N(n.name)&&(e=>{const t=e.name,n=e.path||'/',o=e.domain||location.hostname;a.cookie=`${t}=; Path=${n}; Domain=${o}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`})(n),((e,t)=>{const n=u[e];for(let e=0;e{var o;n[e]._&&(_(t.onReject)?(t.onReject(n[e].P,n[e].u,(()=>L(n[e]))),n[e]._=!1):(o=n[e],o.P?.remove(),o._=!1)),L(n[e])})(e)})(e,t)},V=(e,t,n)=>{_(d)&&d({eventSource:{type:h,service:e,action:t},changedServices:n})},W={acceptService:e=>{v=!1;const t=[];if('all'===e){for(const e of f)b.get(e)||(b.set(e,!0),H(e,p[e]),t.push(e));t.length>0&&V(e,n,t)}else f.includes(e)&&(b.get(e)||(b.set(e,!0),H(e,p[e]),t.push(e),V(e,n,t)));h='api'},rejectService:e=>{const t=[];if('all'===e){v=!0;for(const e of f)J(e,p[e]),b.get(e)&&(b.set(e,!1),t.push(e));t.length>0&&V(e,o,t)}else f.includes(e)&&(J(e,p[e]),b.get(e)&&(b.set(e,!1),t.push(e),V(e,o,t)))},childExists:async({parent:e=r,childProperty:t,childSelector:n='iframe',timeout:o=1e3,maxTimeout:c=15e3})=>{let i=1;const s=t?()=>e[t]:()=>e.querySelector(n);return new Promise((e=>{const t=()=>{if(s()||i++*o>c)return e(void 0!==s());setTimeout(t,o)};t()}))},getState:()=>({services:new Map(b),acceptedServices:[...b].filter((([e,t])=>!!t)).map((([e])=>e))}),getConfig:()=>l,run:e=>{if(a=document,r=window,l=e,p=l.services,d=l.onChange,f=P(p),0===f.length)return;m=l.currLang;const t=p[f[0]].languages;!0===l.autoLang?m=G(navigator.language.slice(0,2).toLowerCase(),t):g(l.currLang)&&(m=G(l.currLang,t));for(const e of f){const t=p[e],n=t.cookie||={},o=n.name||=`im_${e}`,c=N(o);b.set(e,!!c),u[e]=[];const i=a.querySelectorAll(`div[data-service="${e}"]`),s=i.length;if(0!==s){for(let t=0;tW)})(); \ No newline at end of file +(()=>{'use strict';const e='click',t='{data-id}',o='accept',n='reject',c='c-h-n',i='c-h-b',s='show-ph';let r,a,l,f,d,u={},m={},v={},p='',h={},b=new Map,w='api';const _=['onload','onerror','src'],g=e=>'function'==typeof e,$=e=>'string'==typeof e,S=e=>a.createElement(e),T=()=>S('div'),x=()=>{const e=S('button');return e.type='button',e},y=(e,t)=>e.className=t,I=(e,t)=>e.classList.add(t),P=(e,t)=>e.appendChild(t),D=e=>e&&Object.keys(e)||[],k=(e,t)=>{for(const o in t)C(e,o,t[o])},E=e=>{const t=e.dataset,o={},n='data-iframe-',c=e.getAttributeNames().filter((e=>e.slice(0,12)===n)).map((e=>e.slice(12))),i=e.querySelector('[data-placeholder]'),s=i&&i.hasAttribute('data-visible');s&&i.removeAttribute('data-visible');const r=i&&i.cloneNode(!0);for(const a of c)o[a]=e.getAttribute(n+a);return{t:t.id,o:t.title,i:t.thumbnail,l:t.params,u:e,m:null,v:i,p:r,h:null,_:!1,g:!1,$:!0,S:'widget'in t,T:s,I:o}},M=(e,t)=>{const o=u[e];if('IntersectionObserver'in r){const e=new IntersectionObserver((n=>{for(const c of n)c.isIntersecting&&(O(t,o[c.target.dataset.index]),e.unobserve(c.target))}));for(const t of o)e.observe(t.u)}},O=(e,o)=>{const n=e=>{o.h.style.backgroundImage=`url('${e}')`;const t=new Image;t.onload=()=>I(o.h,'loaded'),t.src=e};if($(o.i))''!==o.i&&n(o.i);else if(g(e))e(o.t,(e=>n(e)));else if($(e)){const c=e.replace(t,o.t);n(c)}},j=(e,o)=>{if(e._)return;if(e._=!0,e.v){const t=e.p.cloneNode(!0);e.v.replaceWith(t),e.v=t}const n=o.iframe;if(g(o.onAccept))return void o.onAccept(e.u,(t=>{if(!(t instanceof HTMLIFrameElement))return!1;k(t,n),k(t,e.I),e.P=t,e._=!0,I(e.u,i),(!e.T||e.S)&&I(e.u,s)}));e.P=S('iframe');const c=o.iframe,r=e.l||c&&c.params;let a=(o.embedUrl||'').replace(t,e.t);e.o&&(e.P.title=e.o),r&&$(r)&&(a+='?'===r.slice(0,1)?r:`?${r}`),e.P.onload=()=>{I(e.u,i),e.P.onload=void 0,g(n&&n.onload)&&n.onload(e.t,e.P)},k(e.P,n),k(e.P,e.I),e.P.src=a,P(e.m,e.P)},C=(e,t,o)=>{_.includes(t)||e.setAttribute(t,o)},L=e=>{I(e.u,c),e.$=!1},N=e=>{e.u.classList.remove(c,i,s),e.$=!0},A=e=>(e=a.cookie.match(`(^|;)\\s*${e}\\s*=\\s*([^;]+)`))?e.pop():'',F=(t,o,n)=>{const i=u[t],s=o.languages;i.forEach((i=>{if(!i.g&&s){const r=s[p],l=r&&r.loadBtn,f=r&&r.notice,d=r&&r.loadAllBtn,u=a.createElement('div'),m=T(),v=T(),h=T(),b=T();y(u,'cll'),i.m=u;const _=()=>{L(i),j(i,o)};if(l){const t=x();t.textContent=l,y(t,'c-l-b'),t.addEventListener(e,_),P(b,t)}if(d){const o=x();o.textContent=d,y(o,l?'c-la-b':'c-l-b'),o.addEventListener(e,(()=>{_(),w=e,q.acceptService(t)})),P(b,o)}const g=T(),D=T(),k=T(),E=T(),M=T();y(g,'cc-text'),y(E,'c-bg-i'),i.h=E,y(k,'c-ld'),$(i.i)&&''===i.i||y(D,'c-bg');const O=i.o,C=a.createDocumentFragment();if(O){const e=S('span');y(e,'c-tl'),e.insertAdjacentHTML('beforeend',O),P(C,e)}P(g,C),m&&g.insertAdjacentHTML('beforeend',f||''),P(v,g),y(M,'c-t-cn'),y(v,'c-n-t'),y(h,'c-n-c'),y(m,'c-nt'),y(b,'c-n-a'),P(M,v),(l||d)&&P(M,b),P(h,M),P(m,h),P(D,E),P(u,m),(o.thumbnailUrl||i.i)&&P(u,D),P(u,k),n&&I(i.u,c),i.u.prepend(u),i.g=!0,setTimeout((()=>I(i.u,'c-an')),20)}}))},G=(e,t)=>{const o=u[e];o.forEach((n=>{n._||((e,n)=>{m[n]||(m[n]=new IntersectionObserver((e=>{if(v[n])m[n].disconnect();else for(let c=0;c{const i=e[c].target,s=i.dataset.index;j(o[s],t),setTimeout((()=>{L(o[s])}),50*c),m[n].unobserve(i)})(c)}))),m[n].observe(e)})(n.u,e)}))},H=(e,t)=>e in t?e:D(t).length>0?p in t?p:D(t)[0]:void 0,J=(e,t)=>{const{cookie:o}=t;A(o.name)||(e=>{const{hostname:t,protocol:o}=location,n=e.name,c=new Date,i=e.path||'/',s=864e5*(e.expiration||182),r=e.sameSite||'Lax',l=e.domain||t;c.setTime(c.getTime()+s);let f=n+'=1'+(0!==s?`; Expires=${c.toUTCString()}`:'')+`; Path=${i}`+`; SameSite=${r}`;l.indexOf('.')>-1&&(f+=`; Domain=${l}`),'https:'===o&&(f+='; Secure'),a.cookie=f})(o),G(e,t)},V=(e,t)=>{const{cookie:o}=t;A(o.name)&&(e=>{const t=e.name,o=e.path||'/',n=e.domain||location.hostname;a.cookie=`${t}=; Path=${o}; Domain=${n}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`})(o),((e,t)=>{const o=u[e];for(let n=0;n{var n;o[e]._&&(g(t.onReject)?(t.onReject(o[e].P,o[e].u,(()=>N(o[e]))),o[e]._=!1):((n=o[e]).P&&n.P.remove(),n._=!1)),N(o[e])})(n)})(e,t)},W=(e,t,o)=>{g(d)&&d({eventSource:{type:w,service:e,action:t},changedServices:o})},q={acceptService:e=>{const t=[];if('all'===e){for(const e of f)v[e]=!1,b.get(e)||(b.set(e,!0),J(e,h[e]),t.push(e));t.length>0&&W(e,o,t)}else f.includes(e)&&(v[e]=!1,b.get(e)||(b.set(e,!0),J(e,h[e]),t.push(e),W(e,o,t)));w='api'},rejectService:e=>{const t=[];if('all'===e){for(const e of f)v[e]=!0,V(e,h[e]),b.get(e)&&(b.set(e,!1),t.push(e));t.length>0&&W(e,n,t)}else f.includes(e)&&(v[e]=!0,V(e,h[e]),b.get(e)&&(b.set(e,!1),t.push(e),W(e,n,t)))},childExists:async({parent:e=r,childProperty:t,childSelector:o='iframe',timeout:n=1e3,maxTimeout:c=15e3})=>{let i=1;const s=t?()=>e[t]:()=>e.querySelector(o);return new Promise((e=>{const t=()=>{if(s()||i++*n>c)return e(void 0!==s());setTimeout(t,n)};t()}))},getState:()=>({services:new Map(b),acceptedServices:[...b].filter((([e,t])=>!!t)).map((([e])=>e))}),getConfig:()=>l,run:e=>{if(a=document,r=window,l=e,h=l.services,d=l.onChange,f=D(h),0===f.length)return;p=l.currLang;const t=h[f[0]].languages;!0===l.autoLang?p=H(navigator.language.slice(0,2).toLowerCase(),t):$(l.currLang)&&(p=H(l.currLang,t));for(const o of f){const e=h[o],t=e.cookie=e.cookie||{},n=t.name=t.name||`im_${o}`,c=A(n);b.set(o,!!c),u[o]=[];const i=a.querySelectorAll(`div[data-service="${o}"]`),s=i.length;if(0!==s){for(let e=0;eq)})(); \ No newline at end of file diff --git a/package.yml b/package.yml index 5899bb6..1c98814 100644 --- a/package.yml +++ b/package.yml @@ -1,5 +1,5 @@ package: wenns_sein_muss -version: '4.0.2' +version: '4.0.3' author: 'Alexander Walther' supportpage: https://github.com/alexplusde/wenns_sein_muss