@mjsz-vbr-elements/internal 2.34.0
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/README.md +7 -0
- package/dist/index.iife.js +8 -0
- package/dist/index.iife.js.br +0 -0
- package/dist/index.iife.js.gz +0 -0
- package/dist/index.js +527 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @mjsz-vbr-elements/internal
|
|
3
|
+
* version: v2.34.0 - 15/12/2025, 12:56:01
|
|
4
|
+
* (c) 2025
|
|
5
|
+
* description: Data visualization for MJSZ VBR
|
|
6
|
+
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
|
+
*/
|
|
8
|
+
var MjszVbrElementsInternal=function(C,t,K,X){"use strict";function R(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function I(){const e=new Set,r=s=>{e.delete(s)};return{on:s=>{e.add(s);const n=()=>r(s);return R(n),{off:n}},off:r,trigger:(...s)=>Promise.all(Array.from(e).map(n=>n(...s))),clear:()=>{e.clear()}}}const Y=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const se=Object.prototype.toString,de=e=>se.call(e)==="[object Object]",me=()=>{};function U(...e){if(e.length!==1)return t.toRef(...e);const r=e[0];return typeof r=="function"?t.readonly(t.customRef(()=>({get:r,set:me}))):t.ref(r)}function Z(e,r=!1,a="Timeout"){return new Promise((d,i)=>{setTimeout(r?()=>i(a):d,e)})}function pe(e,...r){return r.some(a=>a in e)}function H(e){return Array.isArray(e)?e:[e]}function L(e,r=!1){function a(c,{flush:p="sync",deep:v=!1,timeout:w,throwOnTimeout:x}={}){let g=null;const A=[new Promise(z=>{g=t.watch(e,b=>{c(b)!==r&&(g?g():t.nextTick(()=>g?.()),z(b))},{flush:p,deep:v,immediate:!0})})];return w!=null&&A.push(Z(w,x).then(()=>t.toValue(e)).finally(()=>g?.())),Promise.race(A)}function d(c,p){if(!t.isRef(c))return a(b=>b===c,p);const{flush:v="sync",deep:w=!1,timeout:x,throwOnTimeout:g}=p??{};let y=null;const z=[new Promise(b=>{y=t.watch([e,c],([$,E])=>{r!==($===E)&&(y?y():t.nextTick(()=>y?.()),b($))},{flush:v,deep:w,immediate:!0})})];return x!=null&&z.push(Z(x,g).then(()=>t.toValue(e)).finally(()=>(y?.(),t.toValue(e)))),Promise.race(z)}function i(c){return a(p=>!!p,c)}function s(c){return d(null,c)}function n(c){return d(void 0,c)}function o(c){return a(Number.isNaN,c)}function l(c,p){return a(v=>{const w=Array.from(v);return w.includes(c)||w.includes(t.toValue(c))},p)}function m(c){return u(1,c)}function u(c=1,p){let v=-1;return a(()=>(v+=1,v>=c),p)}return Array.isArray(t.toValue(e))?{toMatch:a,toContains:l,changed:m,changedTimes:u,get not(){return L(e,!r)}}:{toMatch:a,toBe:d,toBeTruthy:i,toBeNull:s,toBeNaN:o,toBeUndefined:n,changed:m,changedTimes:u,get not(){return L(e,!r)}}}function he(e){return L(e)}function ee(e,r,a={}){const{immediate:d=!0,immediateCallback:i=!1}=a,s=t.shallowRef(!1);let n;function o(){n&&(clearTimeout(n),n=void 0)}function l(){s.value=!1,o()}function m(...u){i&&e(),o(),s.value=!0,n=setTimeout(()=>{s.value=!1,n=void 0,e(...u)},t.toValue(r))}return d&&(s.value=!0,Y&&m()),R(l),{isPending:t.shallowReadonly(s),start:m,stop:l}}function fe(e,r,a){return t.watch(e,r,{...a,immediate:!0})}const te=Y?window:void 0;function ue(e){var r;const a=t.toValue(e);return(r=a?.$el)!=null?r:a}function ve(...e){const r=[],a=()=>{r.forEach(o=>o()),r.length=0},d=(o,l,m,u)=>(o.addEventListener(l,m,u),()=>o.removeEventListener(l,m,u)),i=t.computed(()=>{const o=H(t.toValue(e[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),s=fe(()=>{var o,l;return[(l=(o=i.value)==null?void 0:o.map(m=>ue(m)))!=null?l:[te].filter(m=>m!=null),H(t.toValue(i.value?e[1]:e[0])),H(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([o,l,m,u])=>{if(a(),!o?.length||!l?.length||!m?.length)return;const c=de(u)?{...u}:u;r.push(...o.flatMap(p=>l.flatMap(v=>m.map(w=>d(p,v,w,c)))))},{flush:"post"}),n=()=>{s(),a()};return R(a),n}const we={json:"application/json",text:"text/plain"};function re(e){return e&&pe(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}function G(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries(e.entries()):e}function ge(e,...r){var a,d;const i=typeof AbortController=="function";let s={},n={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const o={method:"GET",type:"text",payload:void 0};r.length>0&&(re(r[0])?n={...n,...r[0]}:s=r[0]),r.length>1&&re(r[1])&&(n={...n,...r[1]});const{fetch:l=(d=(a=te)==null?void 0:a.fetch)!=null?d:globalThis?.fetch,initialData:m,timeout:u}=n,c=I(),p=I(),v=I(),w=t.shallowRef(!1),x=t.shallowRef(!1),g=t.shallowRef(!1),y=t.shallowRef(null),A=t.shallowRef(null),z=t.shallowRef(null),b=t.shallowRef(m||null),$=t.computed(()=>i&&x.value);let E,S;const W=h=>{i&&(E?.abort(h),E=new AbortController,E.signal.onabort=()=>g.value=!0,s={...s,signal:E.signal})},q=h=>{x.value=h,w.value=!h};u&&(S=ee(W,u,{immediate:!1}));let J=0;const F=async(h=!1)=>{var k,O;W(),q(!0),z.value=null,y.value=null,g.value=!1,J+=1;const D=J,B={method:o.method,headers:{}},V=t.toValue(o.payload);if(V){const f=G(B.headers),M=Object.getPrototypeOf(V);!o.payloadType&&V&&(M===Object.prototype||Array.isArray(M))&&!(V instanceof FormData)&&(o.payloadType="json"),o.payloadType&&(f["Content-Type"]=(k=we[o.payloadType])!=null?k:o.payloadType),B.body=o.payloadType==="json"?JSON.stringify(V):V}let ce=!1;const P={url:t.toValue(e),options:{...B,...s},cancel:()=>{ce=!0}};if(n.beforeFetch&&Object.assign(P,await n.beforeFetch(P)),ce||!l)return q(!1),Promise.resolve(null);let j=null;return S&&S.start(),l(P.url,{...B,...P.options,headers:{...G(B.headers),...G((O=P.options)==null?void 0:O.headers)}}).then(async f=>{if(A.value=f,y.value=f.status,j=await f.clone()[o.type](),!f.ok)throw b.value=m||null,new Error(f.statusText);return n.afterFetch&&({data:j}=await n.afterFetch({data:j,response:f,context:P,execute:F})),b.value=j,c.trigger(f),f}).catch(async f=>{let M=f.message||f.name;if(n.onFetchError&&({error:M,data:j}=await n.onFetchError({data:j,error:f,response:A.value,context:P,execute:F})),z.value=M,n.updateDataOnError&&(b.value=j),p.trigger(f),h)throw f;return null}).finally(()=>{D===J&&q(!1),S&&S.stop(),v.trigger(null)})},le=U(n.refetch);t.watch([le,U(e)],([h])=>h&&F(),{deep:!0});const N={isFinished:t.readonly(w),isFetching:t.readonly(x),statusCode:y,response:A,error:z,data:b,canAbort:$,aborted:g,abort:W,execute:F,onFetchResponse:c.on,onFetchError:p.on,onFetchFinally:v.on,get:T("GET"),put:T("PUT"),post:T("POST"),delete:T("DELETE"),patch:T("PATCH"),head:T("HEAD"),options:T("OPTIONS"),json:_("json"),text:_("text"),blob:_("blob"),arrayBuffer:_("arrayBuffer"),formData:_("formData")};function T(h){return(k,O)=>{if(!x.value)return o.method=h,o.payload=k,o.payloadType=O,t.isRef(o.payload)&&t.watch([le,U(o.payload)],([D])=>D&&F(),{deep:!0}),{...N,then(D,B){return Q().then(D,B)}}}}function Q(){return new Promise((h,k)=>{he(w).toBe(!0).then(()=>h(N)).catch(k)})}function _(h){return()=>{if(!x.value)return o.type=h,{...N,then(k,O){return Q().then(k,O)}}}}return n.immediate&&Promise.resolve().then(()=>F()),{...N,then(h,k){return Q().then(h,k)}}}function ye(e,r=3e4,{check:a,set:d}){const{start:i,stop:s}=ee(o,r,{immediate:!1});ve(e,"click",l=>{l.target===t.unref(e)&&o()}),t.watch(e,l=>{l&&(a?.()||(n(),i()))});function n(){d?.(),t.unref(e).showModal()}function o(){t.unref(e).close(),s()}return{hide:o}}const be=["width","height"],xe=["src","type"],ke={key:1},ze=["srcset","media"],Ae=["src"],Ee=["src"],oe=t.defineComponent({__name:"Media",props:{currentAd:{type:Object,required:!0},mobileBreakpoint:{type:String,required:!0}},setup(e){const r=e,a=t.computed(()=>`(min-width: ${r.currentAd?.breakpoint||r.mobileBreakpoint})`);function d(i){return`${K.VBR_API_BASE_URL.replace("/vbr","")}${i}`}return(i,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentAd.link?"a":"div"),{href:e.currentAd.link||void 0},{default:t.withCtx(()=>[e.currentAd.media[0]?.mediaType?.includes("video")?(t.openBlock(),t.createElementBlock("video",{key:0,width:e.currentAd.media[0].width,height:e.currentAd.media[0].height,autoplay:"",muted:""},[t.createElementVNode("source",{src:e.currentAd.media[0]?.media,type:e.currentAd.media[0]?.mediaType},null,8,xe)],8,be)):(t.openBlock(),t.createElementBlock("picture",ke,[e.currentAd.type==="responsive"?(t.openBlock(),t.createElementBlock("source",{key:0,srcset:d(e.currentAd.media[1].path),media:a.value},null,8,ze)):t.createCommentVNode("",!0),e.currentAd.type==="popover"?(t.openBlock(),t.createElementBlock("img",{key:1,src:d(e.currentAd.media[0].path),style:t.normalizeStyle(`width: clamp(0px, ${e.currentAd.media[0].width}px, 750px); height: auto;`)},null,12,Ae)):(t.openBlock(),t.createElementBlock("img",{key:2,src:d(e.currentAd.media[0].path)},null,8,Ee))]))]),_:1},8,["href"]))}}),Te='dialog[data-v-27c6fb4c]:open{display:grid;grid-template-areas:"stack";opacity:1}dialog[data-v-27c6fb4c]{--popover-padding: var(--size-10);padding:var(--popover-padding);border-radius:8px;background-color:var(--mvw-color-white);opacity:0;transition:opacity .3s,overlay .3s allow-discrete,display .3s allow-discrete}dialog[data-v-27c6fb4c] :is(button,a){grid-area:stack}dialog[data-v-27c6fb4c] :where(a){outline:none}dialog[data-v-27c6fb4c] :where(img,video){display:block;object-fit:cover}dialog button[data-v-27c6fb4c]{align-self:start;justify-self:end}@starting-style{dialog[data-v-27c6fb4c]:open{opacity:0}}dialog[data-v-27c6fb4c]::backdrop{background-color:transparent;transition:display .3s allow-discrete,overlay .3s allow-discrete,background-color .3s;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}dialog[data-v-27c6fb4c]:open::backdrop{background-color:#000000bf}@starting-style{dialog[data-v-27c6fb4c]:open::backdrop{background-color:transparent}}.ad-placement-tool[data-v-27c6fb4c] :where(img,video){opacity:1}.ad-placement-tool .close[data-v-27c6fb4c]{position:absolute;right:calc(var(--popover-padding) * -1);top:calc(var(--popover-padding) * -1);width:24px;height:24px;margin:0;padding:0;background:#fff;border:none;border-end-start-radius:8px}.ad-placement-tool .close[data-v-27c6fb4c]:before,.ad-placement-tool .close[data-v-27c6fb4c]:after{position:absolute;left:43%;top:5px;content:" ";height:16px;width:2px;background-color:#333}.ad-placement-tool .close[data-v-27c6fb4c]:before{transform:rotate(45deg)}.ad-placement-tool .close[data-v-27c6fb4c]:after{transform:rotate(-45deg)}',Be='@layer normalize,theme,components.variables,components,utils;:where(:host,:root){--mvw-color-white: #fff;--mvw-color-black: #000;--mvw-color-primary-0: #ffffff;--mvw-color-primary-50: #eceff1;--mvw-color-primary-100: #cfd8dc;--mvw-color-primary-200: #b0bec5;--mvw-color-primary-300: #90a4ae;--mvw-color-primary-400: #78909c;--mvw-color-primary-500: #607d8b;--mvw-color-primary-600: #546e7a;--mvw-color-primary-700: #455a64;--mvw-color-primary-800: #37474f;--mvw-color-primary-900: #263238;--mvw-color-primary-950: #182024}:where(:host,:root){--mvw-color-secondary-100: #dcedc8;--mvw-color-secondary-200: #badb94;--mvw-color-secondary-300: #aed581;--mvw-color-secondary-400: #9ccc65;--mvw-color-secondary-500: #8bc34a;--mvw-color-secondary-700: #689f38;--mvw-color-secondary-800: #558b2f;--mvw-color-secondary-900: #33691e;--mvw-color-secondary-950: #14290c}:where(:host){--radius-1: 2px;--radius-2: 5px;--radius-3: 16px;--radius-4: 32px;--radius-5: 64px;--radius-6: 96px}:where(:host){--font-size-50: .625rem;--font-size-100: .6875rem;--font-size-200: .75rem;--font-size-300: .8125rem;--font-size-400: .875rem;--font-size-500: 1rem;--font-size-600: 1.125rem;--font-size-700: 1.25rem;--font-size-800: 1.5rem;--font-size-900: 1.75rem;--font-size-950: 2rem;--font-lineheight-50: .95;--font-lineheight-100: 1;--font-lineheight-200: 1.1;--font-lineheight-300: 1.25;--font-lineheight-400: 1.375;--font-lineheight-500: 1.5;--font-lineheight-600: 1.75;--font-lineheight-700: 2}:where(:host){--size-1: 1px;--size-2: .125rem;--size-4: .25rem;--size-6: .375rem;--size-8: .5rem;--size-10: .625rem;--size-12: .75rem;--size-16: 1rem;--size-24: 1.5rem;--size-32: 2rem}:where(:host){--shadow-color: 220 3% 15%;--shadow-strength: 1%;--inner-shadow-highlight: inset 0 -.5px 0 0 #fff, inset 0 .5px 0 0 #0001;--shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)), 0 1px 2px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)), 0 2px 5px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)), 0 4px 12px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)), 0 12px 15px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%));--shadow-6: 0 -1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)), 0 3px 2px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)), 0 7px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)), 0 12px 10px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)), 0 22px 18px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)), 0 41px 33px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 6%)), 0 100px 80px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%))}@media (prefers-color-scheme: dark){:where(:host){--shadow-color: 220 40% 2%;--shadow-strength: 25%;--inner-shadow-highlight: inset 0 -.5px 0 0 #fff1, inset 0 .5px 0 0 #0007}}:where(:host){--ease-spring-1: linear( 0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1.004 83.8%, 1 )}@layer normalize{*,:before,:after{box-sizing:border-box}*{scrollbar-width:thin}:where(img,svg,video,canvas,audio,iframe,embed,object){display:inline-block}:where(img,svg,video){block-size:auto;max-inline-size:100%}:where(img){opacity:0;transition:opacity .5s ease-out}:where(img).is-loaded{opacity:1}:where(svg:not([width])){inline-size:var(--size-16)}:where(input,button,textarea),:where(input[type=file])::-webkit-file-upload-button{color:inherit;font-size:inherit;font:inherit;letter-spacing:inherit}:where(a[href],area,button,[role=button],input,label[for],select,summary,textarea,[tabindex]:not([tabindex*="-"])){-webkit-tap-highlight-color:transparent;touch-action:manipulation}:where(:not(fieldset,progress,meter)){background-origin:border-box;background-repeat:no-repeat;border-style:solid;border-width:0}:where(button){appearance:button;-webkit-appearance:button;background-color:transparent;background-image:none}:where(dd,pre){margin:0}:where(ul,li){margin:0;padding:0}:where(ol,ul){list-style:none}}@layer theme{[data-theme=light],:host-context(.light){color-scheme:only light}[data-theme=dark],:host-context(.dark){color-scheme:only dark}:root,:host{font-family:var(--mvw-font, inherit);--mvw-color-live: #8bc34a;--mvw-color-error: #fb2c36;--mvw-color-warning: #ffc107;--mvw-color-info: #2870ed;--mvw-color-team: #ff6129;--mvw-link-color: light-dark(var(--mvw-color-secondary-700), var(--mvw-color-secondary-400));--mvw-link-hover-color: light-dark(var(--mvw-color-secondary-900), var(--mvw-color-secondary-200));--mvw-text-pale: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-700));--mvw-text-faded: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-600));--mvw-text-dimmed: light-dark(var(--mvw-color-primary-400), var(--mvw-color-primary-500));--mvw-text-muted: light-dark(var(--mvw-color-primary-500), var(--mvw-color-primary-400));--mvw-text-toned: light-dark(var(--mvw-color-primary-600), var(--mvw-color-primary-300));--mvw-text-default: light-dark(var(--mvw-color-primary-700), var(--mvw-color-primary-200));--mvw-text-highlighted: light-dark(var(--mvw-color-primary-900), var(--mvw-color-primary-50));--mvw-text-inverted: light-dark(var(--mvw-color-white), var(--mvw-color-primary-950));--mvw-bg-default: light-dark(var(--mvw-color-white), var(--mvw-color-primary-950));--mvw-bg-muted: light-dark(var(--mvw-color-primary-50), var(--mvw-color-primary-900));--mvw-bg-elevated: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-800));--mvw-bg-accented: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-700));--mvw-bg-highlighted: var(--mvw-color-secondary-500);--mvw-bg-inverted: light-dark(var(--mvw-color-primary-900), var(--mvw-color-primary-50));--mvw-border-faded: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-800));--mvw-border-muted: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-700));--mvw-border-highlighted: var(--mvw-color-secondary-500)}:where(a[href]){color:var(--mvw-link-color);text-decoration:none}:where(a[href]):hover{color:var(--mvw-link-hover-color)}:where(a[href]):visited{color:var(--mvw-link-color)}}@layer components{:where(.loading-indicator){padding:var(--size-16);font-weight:600;color:var(--mvw-loading-indicator-text-color, var(--mvw-text-toned));text-align:center}}@layer utils{.font-bold{font-weight:700}.italic{font-style:italic}.uppercase{text-transform:uppercase}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-start{text-align:start}.text-end{text-align:end}.text-center{text-align:center}.text-xs{font-size:var(--font-size-200)}.text-sm{font-size:var(--font-size-400)}.text-xl{font-size:var(--font-size-700)}.text-faded{color:var(--mvw-text-faded)}.text-dimmed{color:var(--mvw-text-dimmed)}.text-muted{color:var(--mvw-text-muted)}.text-toned{color:var(--mvw-text-toned)}.text-default{color:var(--mvw-text-default)}.text-highlighted{color:var(--mvw-text-highlighted)}.w-auto{width:auto}.mx-sm{margin-inline:var(--size-8)}.mb-sm{margin-block-end:var(--size-8)}.mb-md{margin-block-end:var(--size-16)}.mb-xl{margin-block-end:calc(var(--size-16) * 2)}.mt-md{margin-block-start:var(--size-16)}.mt-lg{margin-block-start:var(--size-24)}.mt-xl{margin-block-start:calc(var(--size-16) * 2)}.p-sm{padding-block:var(--size-8)}.py-md{padding-block:var(--size-16)}.flex{display:flex}.grid{display:grid}.block{display:block}.rounded{border-radius:1e5px}.sticky{position:sticky;top:var(--mvw-sticky-top-offset, 0);z-index:10}.blured-bg{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.grid-container{--min-width: 230px;--max-width: 1fr;--gap: var(--size-16);--align-items: center;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(var(--min-width),100%),var(--max-width)));align-items:var(--align-items);gap:var(--gap)}.flex-container{display:flex;flex-wrap:wrap;gap:var(--size-16)}.responsive-team-name{container-type:inline-size;container-name:team-name}.responsive-team-name>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.responsive-team-name>* .team-name-short{display:none}@container team-name (max-width: 200px){.responsive-team-name>* .team-name-long{display:none}.responsive-team-name>* .team-name-short{display:inline-block}}}',Pe=(e,r)=>{const a=e.__vccOpts||e;for(const[d,i]of r)a[d]=i;return a},je={key:0,class:"ad-placement-tool"},Ce={key:0,ref:"popover"},ae=Pe({__name:"AdPlacement.ce",props:{areaId:{type:String,default:""},mobileBreakpoint:{type:String,default:"768px"}},setup(e){const r=e,a=t.useTemplateRef("popover"),{isFinished:d,data:i,error:s}=ge(`${K.VBR_API_BASE_URL.replace("/vbr","")}/internal/ad-placement?areaid=${r.areaId}`,{timeout:1e3}).get().json(),{hide:n}=ye(a,t.computed(()=>i.value?.closeTimeout??3e4),{check:()=>X.cookie.checkCookie(`mjsz-popover-${i.value?._id}`),set:()=>X.cookie.setCookie(`mjsz-popover-${i.value?._id}`,1,i.value?.expiration??1)});return(o,l)=>t.unref(d)&&!t.unref(s)?(t.openBlock(),t.createElementBlock("div",je,[t.unref(i).type==="popover"?(t.openBlock(),t.createElementBlock("dialog",Ce,[t.createVNode(oe,{"current-ad":t.unref(i),"mobile-breakpoint":e.mobileBreakpoint},null,8,["current-ad","mobile-breakpoint"]),t.createElementVNode("button",{type:"button",class:"close",onClick:l[0]||(l[0]=(...m)=>t.unref(n)&&t.unref(n)(...m))})],512)):(t.openBlock(),t.createBlock(oe,{key:1,"current-ad":t.unref(i),"mobile-breakpoint":e.mobileBreakpoint},null,8,["current-ad","mobile-breakpoint"]))])):t.createCommentVNode("",!0)}},[["styles",[Te,Be]],["__scopeId","data-v-27c6fb4c"]]),ne=t.defineCustomElement(ae);function ie(){customElements.define("mjsz-ad-placement",ne)}const Fe={install:()=>ie()};return C.AdPlacement=ae,C.AdPlacementCE=ne,C.default=Fe,C.register=ie,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),C}({},Vue,MjszVbrElementsCore,MjszVbrElementsCore);
|
|
Binary file
|
|
Binary file
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @mjsz-vbr-elements/internal
|
|
3
|
+
* version: v2.34.0 - 15/12/2025, 12:56:01
|
|
4
|
+
* (c) 2025
|
|
5
|
+
* description: Data visualization for MJSZ VBR
|
|
6
|
+
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
|
+
*/
|
|
8
|
+
import { shallowRef as E, shallowReadonly as we, toRef as ge, readonly as Z, ref as ye, customRef as be, toValue as y, getCurrentScope as xe, onScopeDispose as ke, watch as M, nextTick as ae, isRef as se, computed as L, unref as x, defineComponent as ze, createBlock as de, openBlock as T, resolveDynamicComponent as Te, withCtx as Ae, createElementBlock as S, createElementVNode as me, createCommentVNode as ue, normalizeStyle as Ee, useTemplateRef as Fe, createVNode as Pe, defineCustomElement as Oe } from "vue";
|
|
9
|
+
import { VBR_API_BASE_URL as pe } from "@mjsz-vbr-elements/core/constants";
|
|
10
|
+
import { cookie as ne } from "@mjsz-vbr-elements/core/utils";
|
|
11
|
+
function te(e) {
|
|
12
|
+
return xe() ? (ke(e), !0) : !1;
|
|
13
|
+
}
|
|
14
|
+
function R() {
|
|
15
|
+
const e = /* @__PURE__ */ new Set(), t = (c) => {
|
|
16
|
+
e.delete(c);
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
on: (c) => {
|
|
20
|
+
e.add(c);
|
|
21
|
+
const a = () => t(c);
|
|
22
|
+
return te(a), {
|
|
23
|
+
off: a
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
off: t,
|
|
27
|
+
trigger: (...c) => Promise.all(Array.from(e).map((a) => a(...c))),
|
|
28
|
+
clear: () => {
|
|
29
|
+
e.clear();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const ve = typeof window < "u" && typeof document < "u";
|
|
34
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
35
|
+
const je = Object.prototype.toString, Ce = (e) => je.call(e) === "[object Object]", Be = () => {
|
|
36
|
+
};
|
|
37
|
+
function K(...e) {
|
|
38
|
+
if (e.length !== 1)
|
|
39
|
+
return ge(...e);
|
|
40
|
+
const t = e[0];
|
|
41
|
+
return typeof t == "function" ? Z(be(() => ({ get: t, set: Be }))) : ye(t);
|
|
42
|
+
}
|
|
43
|
+
function ie(e, t = !1, o = "Timeout") {
|
|
44
|
+
return new Promise((s, n) => {
|
|
45
|
+
setTimeout(t ? () => n(o) : s, e);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function Se(e, ...t) {
|
|
49
|
+
return t.some((o) => o in e);
|
|
50
|
+
}
|
|
51
|
+
function X(e) {
|
|
52
|
+
return Array.isArray(e) ? e : [e];
|
|
53
|
+
}
|
|
54
|
+
function ee(e, t = !1) {
|
|
55
|
+
function o(l, { flush: m = "sync", deep: h = !1, timeout: f, throwOnTimeout: k } = {}) {
|
|
56
|
+
let w = null;
|
|
57
|
+
const F = [new Promise((A) => {
|
|
58
|
+
w = M(
|
|
59
|
+
e,
|
|
60
|
+
(b) => {
|
|
61
|
+
l(b) !== t && (w ? w() : ae(() => w?.()), A(b));
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
flush: m,
|
|
65
|
+
deep: h,
|
|
66
|
+
immediate: !0
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
})];
|
|
70
|
+
return f != null && F.push(
|
|
71
|
+
ie(f, k).then(() => y(e)).finally(() => w?.())
|
|
72
|
+
), Promise.race(F);
|
|
73
|
+
}
|
|
74
|
+
function s(l, m) {
|
|
75
|
+
if (!se(l))
|
|
76
|
+
return o((b) => b === l, m);
|
|
77
|
+
const { flush: h = "sync", deep: f = !1, timeout: k, throwOnTimeout: w } = m ?? {};
|
|
78
|
+
let g = null;
|
|
79
|
+
const A = [new Promise((b) => {
|
|
80
|
+
g = M(
|
|
81
|
+
[e, l],
|
|
82
|
+
([V, P]) => {
|
|
83
|
+
t !== (V === P) && (g ? g() : ae(() => g?.()), b(V));
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
flush: h,
|
|
87
|
+
deep: f,
|
|
88
|
+
immediate: !0
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
})];
|
|
92
|
+
return k != null && A.push(
|
|
93
|
+
ie(k, w).then(() => y(e)).finally(() => (g?.(), y(e)))
|
|
94
|
+
), Promise.race(A);
|
|
95
|
+
}
|
|
96
|
+
function n(l) {
|
|
97
|
+
return o((m) => !!m, l);
|
|
98
|
+
}
|
|
99
|
+
function c(l) {
|
|
100
|
+
return s(null, l);
|
|
101
|
+
}
|
|
102
|
+
function a(l) {
|
|
103
|
+
return s(void 0, l);
|
|
104
|
+
}
|
|
105
|
+
function r(l) {
|
|
106
|
+
return o(Number.isNaN, l);
|
|
107
|
+
}
|
|
108
|
+
function i(l, m) {
|
|
109
|
+
return o((h) => {
|
|
110
|
+
const f = Array.from(h);
|
|
111
|
+
return f.includes(l) || f.includes(y(l));
|
|
112
|
+
}, m);
|
|
113
|
+
}
|
|
114
|
+
function d(l) {
|
|
115
|
+
return v(1, l);
|
|
116
|
+
}
|
|
117
|
+
function v(l = 1, m) {
|
|
118
|
+
let h = -1;
|
|
119
|
+
return o(() => (h += 1, h >= l), m);
|
|
120
|
+
}
|
|
121
|
+
return Array.isArray(y(e)) ? {
|
|
122
|
+
toMatch: o,
|
|
123
|
+
toContains: i,
|
|
124
|
+
changed: d,
|
|
125
|
+
changedTimes: v,
|
|
126
|
+
get not() {
|
|
127
|
+
return ee(e, !t);
|
|
128
|
+
}
|
|
129
|
+
} : {
|
|
130
|
+
toMatch: o,
|
|
131
|
+
toBe: s,
|
|
132
|
+
toBeTruthy: n,
|
|
133
|
+
toBeNull: c,
|
|
134
|
+
toBeNaN: r,
|
|
135
|
+
toBeUndefined: a,
|
|
136
|
+
changed: d,
|
|
137
|
+
changedTimes: v,
|
|
138
|
+
get not() {
|
|
139
|
+
return ee(e, !t);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function De(e) {
|
|
144
|
+
return ee(e);
|
|
145
|
+
}
|
|
146
|
+
function he(e, t, o = {}) {
|
|
147
|
+
const {
|
|
148
|
+
immediate: s = !0,
|
|
149
|
+
immediateCallback: n = !1
|
|
150
|
+
} = o, c = E(!1);
|
|
151
|
+
let a;
|
|
152
|
+
function r() {
|
|
153
|
+
a && (clearTimeout(a), a = void 0);
|
|
154
|
+
}
|
|
155
|
+
function i() {
|
|
156
|
+
c.value = !1, r();
|
|
157
|
+
}
|
|
158
|
+
function d(...v) {
|
|
159
|
+
n && e(), r(), c.value = !0, a = setTimeout(() => {
|
|
160
|
+
c.value = !1, a = void 0, e(...v);
|
|
161
|
+
}, y(t));
|
|
162
|
+
}
|
|
163
|
+
return s && (c.value = !0, ve && d()), te(i), {
|
|
164
|
+
isPending: we(c),
|
|
165
|
+
start: d,
|
|
166
|
+
stop: i
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function $e(e, t, o) {
|
|
170
|
+
return M(
|
|
171
|
+
e,
|
|
172
|
+
t,
|
|
173
|
+
{
|
|
174
|
+
...o,
|
|
175
|
+
immediate: !0
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
const fe = ve ? window : void 0;
|
|
180
|
+
function _e(e) {
|
|
181
|
+
var t;
|
|
182
|
+
const o = y(e);
|
|
183
|
+
return (t = o?.$el) != null ? t : o;
|
|
184
|
+
}
|
|
185
|
+
function Me(...e) {
|
|
186
|
+
const t = [], o = () => {
|
|
187
|
+
t.forEach((r) => r()), t.length = 0;
|
|
188
|
+
}, s = (r, i, d, v) => (r.addEventListener(i, d, v), () => r.removeEventListener(i, d, v)), n = L(() => {
|
|
189
|
+
const r = X(y(e[0])).filter((i) => i != null);
|
|
190
|
+
return r.every((i) => typeof i != "string") ? r : void 0;
|
|
191
|
+
}), c = $e(
|
|
192
|
+
() => {
|
|
193
|
+
var r, i;
|
|
194
|
+
return [
|
|
195
|
+
(i = (r = n.value) == null ? void 0 : r.map((d) => _e(d))) != null ? i : [fe].filter((d) => d != null),
|
|
196
|
+
X(y(n.value ? e[1] : e[0])),
|
|
197
|
+
X(x(n.value ? e[2] : e[1])),
|
|
198
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
199
|
+
y(n.value ? e[3] : e[2])
|
|
200
|
+
];
|
|
201
|
+
},
|
|
202
|
+
([r, i, d, v]) => {
|
|
203
|
+
if (o(), !r?.length || !i?.length || !d?.length)
|
|
204
|
+
return;
|
|
205
|
+
const l = Ce(v) ? { ...v } : v;
|
|
206
|
+
t.push(
|
|
207
|
+
...r.flatMap(
|
|
208
|
+
(m) => i.flatMap(
|
|
209
|
+
(h) => d.map((f) => s(m, h, f, l))
|
|
210
|
+
)
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
{ flush: "post" }
|
|
215
|
+
), a = () => {
|
|
216
|
+
c(), o();
|
|
217
|
+
};
|
|
218
|
+
return te(o), a;
|
|
219
|
+
}
|
|
220
|
+
const Ne = {
|
|
221
|
+
json: "application/json",
|
|
222
|
+
text: "text/plain"
|
|
223
|
+
};
|
|
224
|
+
function le(e) {
|
|
225
|
+
return e && Se(e, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch", "updateDataOnError");
|
|
226
|
+
}
|
|
227
|
+
function Y(e) {
|
|
228
|
+
return typeof Headers < "u" && e instanceof Headers ? Object.fromEntries(e.entries()) : e;
|
|
229
|
+
}
|
|
230
|
+
function Ie(e, ...t) {
|
|
231
|
+
var o, s;
|
|
232
|
+
const n = typeof AbortController == "function";
|
|
233
|
+
let c = {}, a = {
|
|
234
|
+
immediate: !0,
|
|
235
|
+
refetch: !1,
|
|
236
|
+
timeout: 0,
|
|
237
|
+
updateDataOnError: !1
|
|
238
|
+
};
|
|
239
|
+
const r = {
|
|
240
|
+
method: "GET",
|
|
241
|
+
type: "text",
|
|
242
|
+
payload: void 0
|
|
243
|
+
};
|
|
244
|
+
t.length > 0 && (le(t[0]) ? a = { ...a, ...t[0] } : c = t[0]), t.length > 1 && le(t[1]) && (a = { ...a, ...t[1] });
|
|
245
|
+
const {
|
|
246
|
+
fetch: i = (s = (o = fe) == null ? void 0 : o.fetch) != null ? s : globalThis?.fetch,
|
|
247
|
+
initialData: d,
|
|
248
|
+
timeout: v
|
|
249
|
+
} = a, l = R(), m = R(), h = R(), f = E(!1), k = E(!1), w = E(!1), g = E(null), F = E(null), A = E(null), b = E(d || null), V = L(() => n && k.value);
|
|
250
|
+
let P, N;
|
|
251
|
+
const W = (u) => {
|
|
252
|
+
n && (P?.abort(u), P = new AbortController(), P.signal.onabort = () => w.value = !0, c = {
|
|
253
|
+
...c,
|
|
254
|
+
signal: P.signal
|
|
255
|
+
});
|
|
256
|
+
}, q = (u) => {
|
|
257
|
+
k.value = u, f.value = !u;
|
|
258
|
+
};
|
|
259
|
+
v && (N = he(W, v, { immediate: !1 }));
|
|
260
|
+
let J = 0;
|
|
261
|
+
const D = async (u = !1) => {
|
|
262
|
+
var z, $;
|
|
263
|
+
W(), q(!0), A.value = null, g.value = null, w.value = !1, J += 1;
|
|
264
|
+
const H = J, j = {
|
|
265
|
+
method: r.method,
|
|
266
|
+
headers: {}
|
|
267
|
+
}, _ = y(r.payload);
|
|
268
|
+
if (_) {
|
|
269
|
+
const p = Y(j.headers), U = Object.getPrototypeOf(_);
|
|
270
|
+
!r.payloadType && _ && (U === Object.prototype || Array.isArray(U)) && !(_ instanceof FormData) && (r.payloadType = "json"), r.payloadType && (p["Content-Type"] = (z = Ne[r.payloadType]) != null ? z : r.payloadType), j.body = r.payloadType === "json" ? JSON.stringify(_) : _;
|
|
271
|
+
}
|
|
272
|
+
let oe = !1;
|
|
273
|
+
const C = {
|
|
274
|
+
url: y(e),
|
|
275
|
+
options: {
|
|
276
|
+
...j,
|
|
277
|
+
...c
|
|
278
|
+
},
|
|
279
|
+
cancel: () => {
|
|
280
|
+
oe = !0;
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
if (a.beforeFetch && Object.assign(C, await a.beforeFetch(C)), oe || !i)
|
|
284
|
+
return q(!1), Promise.resolve(null);
|
|
285
|
+
let B = null;
|
|
286
|
+
return N && N.start(), i(
|
|
287
|
+
C.url,
|
|
288
|
+
{
|
|
289
|
+
...j,
|
|
290
|
+
...C.options,
|
|
291
|
+
headers: {
|
|
292
|
+
...Y(j.headers),
|
|
293
|
+
...Y(($ = C.options) == null ? void 0 : $.headers)
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
).then(async (p) => {
|
|
297
|
+
if (F.value = p, g.value = p.status, B = await p.clone()[r.type](), !p.ok)
|
|
298
|
+
throw b.value = d || null, new Error(p.statusText);
|
|
299
|
+
return a.afterFetch && ({ data: B } = await a.afterFetch({
|
|
300
|
+
data: B,
|
|
301
|
+
response: p,
|
|
302
|
+
context: C,
|
|
303
|
+
execute: D
|
|
304
|
+
})), b.value = B, l.trigger(p), p;
|
|
305
|
+
}).catch(async (p) => {
|
|
306
|
+
let U = p.message || p.name;
|
|
307
|
+
if (a.onFetchError && ({ error: U, data: B } = await a.onFetchError({
|
|
308
|
+
data: B,
|
|
309
|
+
error: p,
|
|
310
|
+
response: F.value,
|
|
311
|
+
context: C,
|
|
312
|
+
execute: D
|
|
313
|
+
})), A.value = U, a.updateDataOnError && (b.value = B), m.trigger(p), u)
|
|
314
|
+
throw p;
|
|
315
|
+
return null;
|
|
316
|
+
}).finally(() => {
|
|
317
|
+
H === J && q(!1), N && N.stop(), h.trigger(null);
|
|
318
|
+
});
|
|
319
|
+
}, re = K(a.refetch);
|
|
320
|
+
M(
|
|
321
|
+
[
|
|
322
|
+
re,
|
|
323
|
+
K(e)
|
|
324
|
+
],
|
|
325
|
+
([u]) => u && D(),
|
|
326
|
+
{ deep: !0 }
|
|
327
|
+
);
|
|
328
|
+
const G = {
|
|
329
|
+
isFinished: Z(f),
|
|
330
|
+
isFetching: Z(k),
|
|
331
|
+
statusCode: g,
|
|
332
|
+
response: F,
|
|
333
|
+
error: A,
|
|
334
|
+
data: b,
|
|
335
|
+
canAbort: V,
|
|
336
|
+
aborted: w,
|
|
337
|
+
abort: W,
|
|
338
|
+
execute: D,
|
|
339
|
+
onFetchResponse: l.on,
|
|
340
|
+
onFetchError: m.on,
|
|
341
|
+
onFetchFinally: h.on,
|
|
342
|
+
// method
|
|
343
|
+
get: O("GET"),
|
|
344
|
+
put: O("PUT"),
|
|
345
|
+
post: O("POST"),
|
|
346
|
+
delete: O("DELETE"),
|
|
347
|
+
patch: O("PATCH"),
|
|
348
|
+
head: O("HEAD"),
|
|
349
|
+
options: O("OPTIONS"),
|
|
350
|
+
// type
|
|
351
|
+
json: I("json"),
|
|
352
|
+
text: I("text"),
|
|
353
|
+
blob: I("blob"),
|
|
354
|
+
arrayBuffer: I("arrayBuffer"),
|
|
355
|
+
formData: I("formData")
|
|
356
|
+
};
|
|
357
|
+
function O(u) {
|
|
358
|
+
return (z, $) => {
|
|
359
|
+
if (!k.value)
|
|
360
|
+
return r.method = u, r.payload = z, r.payloadType = $, se(r.payload) && M(
|
|
361
|
+
[
|
|
362
|
+
re,
|
|
363
|
+
K(r.payload)
|
|
364
|
+
],
|
|
365
|
+
([H]) => H && D(),
|
|
366
|
+
{ deep: !0 }
|
|
367
|
+
), {
|
|
368
|
+
...G,
|
|
369
|
+
then(H, j) {
|
|
370
|
+
return Q().then(H, j);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function Q() {
|
|
376
|
+
return new Promise((u, z) => {
|
|
377
|
+
De(f).toBe(!0).then(() => u(G)).catch(z);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
function I(u) {
|
|
381
|
+
return () => {
|
|
382
|
+
if (!k.value)
|
|
383
|
+
return r.type = u, {
|
|
384
|
+
...G,
|
|
385
|
+
then(z, $) {
|
|
386
|
+
return Q().then(z, $);
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
return a.immediate && Promise.resolve().then(() => D()), {
|
|
392
|
+
...G,
|
|
393
|
+
then(u, z) {
|
|
394
|
+
return Q().then(u, z);
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function He(e, t = 3e4, {
|
|
399
|
+
check: o,
|
|
400
|
+
set: s
|
|
401
|
+
}) {
|
|
402
|
+
const { start: n, stop: c } = he(r, t, { immediate: !1 });
|
|
403
|
+
Me(e, "click", (i) => {
|
|
404
|
+
i.target === x(e) && r();
|
|
405
|
+
}), M(e, (i) => {
|
|
406
|
+
i && (o?.() || (a(), n()));
|
|
407
|
+
});
|
|
408
|
+
function a() {
|
|
409
|
+
s?.(), x(e).showModal();
|
|
410
|
+
}
|
|
411
|
+
function r() {
|
|
412
|
+
x(e).close(), c();
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
hide: r
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
const Ue = ["width", "height"], Ve = ["src", "type"], Ge = { key: 1 }, Le = ["srcset", "media"], We = ["src"], qe = ["src"], ce = /* @__PURE__ */ ze({
|
|
419
|
+
__name: "Media",
|
|
420
|
+
props: {
|
|
421
|
+
currentAd: {
|
|
422
|
+
type: Object,
|
|
423
|
+
required: !0
|
|
424
|
+
},
|
|
425
|
+
mobileBreakpoint: {
|
|
426
|
+
type: String,
|
|
427
|
+
required: !0
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
setup(e) {
|
|
431
|
+
const t = e, o = L(() => `(min-width: ${t.currentAd?.breakpoint || t.mobileBreakpoint})`);
|
|
432
|
+
function s(n) {
|
|
433
|
+
return `${pe.replace("/vbr", "")}${n}`;
|
|
434
|
+
}
|
|
435
|
+
return (n, c) => (T(), de(Te(e.currentAd.link ? "a" : "div"), {
|
|
436
|
+
href: e.currentAd.link || void 0
|
|
437
|
+
}, {
|
|
438
|
+
default: Ae(() => [
|
|
439
|
+
e.currentAd.media[0]?.mediaType?.includes("video") ? (T(), S("video", {
|
|
440
|
+
key: 0,
|
|
441
|
+
width: e.currentAd.media[0].width,
|
|
442
|
+
height: e.currentAd.media[0].height,
|
|
443
|
+
autoplay: "",
|
|
444
|
+
muted: ""
|
|
445
|
+
}, [
|
|
446
|
+
me("source", {
|
|
447
|
+
src: e.currentAd.media[0]?.media,
|
|
448
|
+
type: e.currentAd.media[0]?.mediaType
|
|
449
|
+
}, null, 8, Ve)
|
|
450
|
+
], 8, Ue)) : (T(), S("picture", Ge, [
|
|
451
|
+
e.currentAd.type === "responsive" ? (T(), S("source", {
|
|
452
|
+
key: 0,
|
|
453
|
+
srcset: s(e.currentAd.media[1].path),
|
|
454
|
+
media: o.value
|
|
455
|
+
}, null, 8, Le)) : ue("", !0),
|
|
456
|
+
e.currentAd.type === "popover" ? (T(), S("img", {
|
|
457
|
+
key: 1,
|
|
458
|
+
src: s(e.currentAd.media[0].path),
|
|
459
|
+
style: Ee(`width: clamp(0px, ${e.currentAd.media[0].width}px, 750px); height: auto;`)
|
|
460
|
+
}, null, 12, We)) : (T(), S("img", {
|
|
461
|
+
key: 2,
|
|
462
|
+
src: s(e.currentAd.media[0].path)
|
|
463
|
+
}, null, 8, qe))
|
|
464
|
+
]))
|
|
465
|
+
]),
|
|
466
|
+
_: 1
|
|
467
|
+
}, 8, ["href"]));
|
|
468
|
+
}
|
|
469
|
+
}), Je = 'dialog[data-v-27c6fb4c]:open{display:grid;grid-template-areas:"stack";opacity:1}dialog[data-v-27c6fb4c]{--popover-padding: var(--size-10);padding:var(--popover-padding);border-radius:8px;background-color:var(--mvw-color-white);opacity:0;transition:opacity .3s,overlay .3s allow-discrete,display .3s allow-discrete}dialog[data-v-27c6fb4c] :is(button,a){grid-area:stack}dialog[data-v-27c6fb4c] :where(a){outline:none}dialog[data-v-27c6fb4c] :where(img,video){display:block;object-fit:cover}dialog button[data-v-27c6fb4c]{align-self:start;justify-self:end}@starting-style{dialog[data-v-27c6fb4c]:open{opacity:0}}dialog[data-v-27c6fb4c]::backdrop{background-color:transparent;transition:display .3s allow-discrete,overlay .3s allow-discrete,background-color .3s;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}dialog[data-v-27c6fb4c]:open::backdrop{background-color:#000000bf}@starting-style{dialog[data-v-27c6fb4c]:open::backdrop{background-color:transparent}}.ad-placement-tool[data-v-27c6fb4c] :where(img,video){opacity:1}.ad-placement-tool .close[data-v-27c6fb4c]{position:absolute;right:calc(var(--popover-padding) * -1);top:calc(var(--popover-padding) * -1);width:24px;height:24px;margin:0;padding:0;background:#fff;border:none;border-end-start-radius:8px}.ad-placement-tool .close[data-v-27c6fb4c]:before,.ad-placement-tool .close[data-v-27c6fb4c]:after{position:absolute;left:43%;top:5px;content:" ";height:16px;width:2px;background-color:#333}.ad-placement-tool .close[data-v-27c6fb4c]:before{transform:rotate(45deg)}.ad-placement-tool .close[data-v-27c6fb4c]:after{transform:rotate(-45deg)}', Qe = '@layer normalize,theme,components.variables,components,utils;:where(:host,:root){--mvw-color-white: #fff;--mvw-color-black: #000;--mvw-color-primary-0: #ffffff;--mvw-color-primary-50: #eceff1;--mvw-color-primary-100: #cfd8dc;--mvw-color-primary-200: #b0bec5;--mvw-color-primary-300: #90a4ae;--mvw-color-primary-400: #78909c;--mvw-color-primary-500: #607d8b;--mvw-color-primary-600: #546e7a;--mvw-color-primary-700: #455a64;--mvw-color-primary-800: #37474f;--mvw-color-primary-900: #263238;--mvw-color-primary-950: #182024}:where(:host,:root){--mvw-color-secondary-100: #dcedc8;--mvw-color-secondary-200: #badb94;--mvw-color-secondary-300: #aed581;--mvw-color-secondary-400: #9ccc65;--mvw-color-secondary-500: #8bc34a;--mvw-color-secondary-700: #689f38;--mvw-color-secondary-800: #558b2f;--mvw-color-secondary-900: #33691e;--mvw-color-secondary-950: #14290c}:where(:host){--radius-1: 2px;--radius-2: 5px;--radius-3: 16px;--radius-4: 32px;--radius-5: 64px;--radius-6: 96px}:where(:host){--font-size-50: .625rem;--font-size-100: .6875rem;--font-size-200: .75rem;--font-size-300: .8125rem;--font-size-400: .875rem;--font-size-500: 1rem;--font-size-600: 1.125rem;--font-size-700: 1.25rem;--font-size-800: 1.5rem;--font-size-900: 1.75rem;--font-size-950: 2rem;--font-lineheight-50: .95;--font-lineheight-100: 1;--font-lineheight-200: 1.1;--font-lineheight-300: 1.25;--font-lineheight-400: 1.375;--font-lineheight-500: 1.5;--font-lineheight-600: 1.75;--font-lineheight-700: 2}:where(:host){--size-1: 1px;--size-2: .125rem;--size-4: .25rem;--size-6: .375rem;--size-8: .5rem;--size-10: .625rem;--size-12: .75rem;--size-16: 1rem;--size-24: 1.5rem;--size-32: 2rem}:where(:host){--shadow-color: 220 3% 15%;--shadow-strength: 1%;--inner-shadow-highlight: inset 0 -.5px 0 0 #fff, inset 0 .5px 0 0 #0001;--shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)), 0 1px 2px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)), 0 2px 5px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)), 0 4px 12px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)), 0 12px 15px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%));--shadow-6: 0 -1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)), 0 3px 2px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)), 0 7px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)), 0 12px 10px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)), 0 22px 18px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)), 0 41px 33px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 6%)), 0 100px 80px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%))}@media (prefers-color-scheme: dark){:where(:host){--shadow-color: 220 40% 2%;--shadow-strength: 25%;--inner-shadow-highlight: inset 0 -.5px 0 0 #fff1, inset 0 .5px 0 0 #0007}}:where(:host){--ease-spring-1: linear( 0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1.004 83.8%, 1 )}@layer normalize{*,:before,:after{box-sizing:border-box}*{scrollbar-width:thin}:where(img,svg,video,canvas,audio,iframe,embed,object){display:inline-block}:where(img,svg,video){block-size:auto;max-inline-size:100%}:where(img){opacity:0;transition:opacity .5s ease-out}:where(img).is-loaded{opacity:1}:where(svg:not([width])){inline-size:var(--size-16)}:where(input,button,textarea),:where(input[type=file])::-webkit-file-upload-button{color:inherit;font-size:inherit;font:inherit;letter-spacing:inherit}:where(a[href],area,button,[role=button],input,label[for],select,summary,textarea,[tabindex]:not([tabindex*="-"])){-webkit-tap-highlight-color:transparent;touch-action:manipulation}:where(:not(fieldset,progress,meter)){background-origin:border-box;background-repeat:no-repeat;border-style:solid;border-width:0}:where(button){appearance:button;-webkit-appearance:button;background-color:transparent;background-image:none}:where(dd,pre){margin:0}:where(ul,li){margin:0;padding:0}:where(ol,ul){list-style:none}}@layer theme{[data-theme=light],:host-context(.light){color-scheme:only light}[data-theme=dark],:host-context(.dark){color-scheme:only dark}:root,:host{font-family:var(--mvw-font, inherit);--mvw-color-live: #8bc34a;--mvw-color-error: #fb2c36;--mvw-color-warning: #ffc107;--mvw-color-info: #2870ed;--mvw-color-team: #ff6129;--mvw-link-color: light-dark(var(--mvw-color-secondary-700), var(--mvw-color-secondary-400));--mvw-link-hover-color: light-dark(var(--mvw-color-secondary-900), var(--mvw-color-secondary-200));--mvw-text-pale: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-700));--mvw-text-faded: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-600));--mvw-text-dimmed: light-dark(var(--mvw-color-primary-400), var(--mvw-color-primary-500));--mvw-text-muted: light-dark(var(--mvw-color-primary-500), var(--mvw-color-primary-400));--mvw-text-toned: light-dark(var(--mvw-color-primary-600), var(--mvw-color-primary-300));--mvw-text-default: light-dark(var(--mvw-color-primary-700), var(--mvw-color-primary-200));--mvw-text-highlighted: light-dark(var(--mvw-color-primary-900), var(--mvw-color-primary-50));--mvw-text-inverted: light-dark(var(--mvw-color-white), var(--mvw-color-primary-950));--mvw-bg-default: light-dark(var(--mvw-color-white), var(--mvw-color-primary-950));--mvw-bg-muted: light-dark(var(--mvw-color-primary-50), var(--mvw-color-primary-900));--mvw-bg-elevated: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-800));--mvw-bg-accented: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-700));--mvw-bg-highlighted: var(--mvw-color-secondary-500);--mvw-bg-inverted: light-dark(var(--mvw-color-primary-900), var(--mvw-color-primary-50));--mvw-border-faded: light-dark(var(--mvw-color-primary-100), var(--mvw-color-primary-800));--mvw-border-muted: light-dark(var(--mvw-color-primary-200), var(--mvw-color-primary-700));--mvw-border-highlighted: var(--mvw-color-secondary-500)}:where(a[href]){color:var(--mvw-link-color);text-decoration:none}:where(a[href]):hover{color:var(--mvw-link-hover-color)}:where(a[href]):visited{color:var(--mvw-link-color)}}@layer components{:where(.loading-indicator){padding:var(--size-16);font-weight:600;color:var(--mvw-loading-indicator-text-color, var(--mvw-text-toned));text-align:center}}@layer utils{.font-bold{font-weight:700}.italic{font-style:italic}.uppercase{text-transform:uppercase}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-start{text-align:start}.text-end{text-align:end}.text-center{text-align:center}.text-xs{font-size:var(--font-size-200)}.text-sm{font-size:var(--font-size-400)}.text-xl{font-size:var(--font-size-700)}.text-faded{color:var(--mvw-text-faded)}.text-dimmed{color:var(--mvw-text-dimmed)}.text-muted{color:var(--mvw-text-muted)}.text-toned{color:var(--mvw-text-toned)}.text-default{color:var(--mvw-text-default)}.text-highlighted{color:var(--mvw-text-highlighted)}.w-auto{width:auto}.mx-sm{margin-inline:var(--size-8)}.mb-sm{margin-block-end:var(--size-8)}.mb-md{margin-block-end:var(--size-16)}.mb-xl{margin-block-end:calc(var(--size-16) * 2)}.mt-md{margin-block-start:var(--size-16)}.mt-lg{margin-block-start:var(--size-24)}.mt-xl{margin-block-start:calc(var(--size-16) * 2)}.p-sm{padding-block:var(--size-8)}.py-md{padding-block:var(--size-16)}.flex{display:flex}.grid{display:grid}.block{display:block}.rounded{border-radius:1e5px}.sticky{position:sticky;top:var(--mvw-sticky-top-offset, 0);z-index:10}.blured-bg{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.grid-container{--min-width: 230px;--max-width: 1fr;--gap: var(--size-16);--align-items: center;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(var(--min-width),100%),var(--max-width)));align-items:var(--align-items);gap:var(--gap)}.flex-container{display:flex;flex-wrap:wrap;gap:var(--size-16)}.responsive-team-name{container-type:inline-size;container-name:team-name}.responsive-team-name>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.responsive-team-name>* .team-name-short{display:none}@container team-name (max-width: 200px){.responsive-team-name>* .team-name-long{display:none}.responsive-team-name>* .team-name-short{display:inline-block}}}', Re = (e, t) => {
|
|
470
|
+
const o = e.__vccOpts || e;
|
|
471
|
+
for (const [s, n] of t)
|
|
472
|
+
o[s] = n;
|
|
473
|
+
return o;
|
|
474
|
+
}, Ke = {
|
|
475
|
+
key: 0,
|
|
476
|
+
class: "ad-placement-tool"
|
|
477
|
+
}, Xe = {
|
|
478
|
+
key: 0,
|
|
479
|
+
ref: "popover"
|
|
480
|
+
}, Ye = {
|
|
481
|
+
__name: "AdPlacement.ce",
|
|
482
|
+
props: {
|
|
483
|
+
areaId: {
|
|
484
|
+
type: String,
|
|
485
|
+
default: ""
|
|
486
|
+
},
|
|
487
|
+
mobileBreakpoint: {
|
|
488
|
+
type: String,
|
|
489
|
+
default: "768px"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
setup(e) {
|
|
493
|
+
const t = e, o = Fe("popover"), { isFinished: s, data: n, error: c } = Ie(`${pe.replace("/vbr", "")}/internal/ad-placement?areaid=${t.areaId}`, { timeout: 1e3 }).get().json(), { hide: a } = He(o, L(() => n.value?.closeTimeout ?? 3e4), {
|
|
494
|
+
check: () => ne.checkCookie(`mjsz-popover-${n.value?._id}`),
|
|
495
|
+
set: () => ne.setCookie(`mjsz-popover-${n.value?._id}`, 1, n.value?.expiration ?? 1)
|
|
496
|
+
});
|
|
497
|
+
return (r, i) => x(s) && !x(c) ? (T(), S("div", Ke, [
|
|
498
|
+
x(n).type === "popover" ? (T(), S("dialog", Xe, [
|
|
499
|
+
Pe(ce, {
|
|
500
|
+
"current-ad": x(n),
|
|
501
|
+
"mobile-breakpoint": e.mobileBreakpoint
|
|
502
|
+
}, null, 8, ["current-ad", "mobile-breakpoint"]),
|
|
503
|
+
me("button", {
|
|
504
|
+
type: "button",
|
|
505
|
+
class: "close",
|
|
506
|
+
onClick: i[0] || (i[0] = (...d) => x(a) && x(a)(...d))
|
|
507
|
+
})
|
|
508
|
+
], 512)) : (T(), de(ce, {
|
|
509
|
+
key: 1,
|
|
510
|
+
"current-ad": x(n),
|
|
511
|
+
"mobile-breakpoint": e.mobileBreakpoint
|
|
512
|
+
}, null, 8, ["current-ad", "mobile-breakpoint"]))
|
|
513
|
+
])) : ue("", !0);
|
|
514
|
+
}
|
|
515
|
+
}, Ze = /* @__PURE__ */ Re(Ye, [["styles", [Je, Qe]], ["__scopeId", "data-v-27c6fb4c"]]), et = Oe(Ze);
|
|
516
|
+
function tt() {
|
|
517
|
+
customElements.define("mjsz-ad-placement", et);
|
|
518
|
+
}
|
|
519
|
+
const nt = {
|
|
520
|
+
install: () => tt()
|
|
521
|
+
};
|
|
522
|
+
export {
|
|
523
|
+
Ze as AdPlacement,
|
|
524
|
+
et as AdPlacementCE,
|
|
525
|
+
nt as default,
|
|
526
|
+
tt as register
|
|
527
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mjsz-vbr-elements/internal",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.34.0",
|
|
5
|
+
"private": false,
|
|
6
|
+
"description": "Data visualization for MJSZ VBR",
|
|
7
|
+
"author": "Ákos Stegner <akos.stegner@gmail.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://api.icehockey.hu/widgets/docs/v2/",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/jegkorongszovetseg/hihf-vbr-widget-v2.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"unpkg": "./dist/index.iife.js",
|
|
21
|
+
"jsdelivr": "./dist/index.iife.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@vueuse/core": "^13.4.0",
|
|
27
|
+
"vue": "^3.5.22",
|
|
28
|
+
"@mjsz-vbr-elements/core": "^2.34.0",
|
|
29
|
+
"@mjsz-vbr-elements/shared": "^2.34.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
33
|
+
"sass-embedded": "^1.89.2",
|
|
34
|
+
"vite": "^7.0.0",
|
|
35
|
+
"vite-plugin-banner": "^0.8.1",
|
|
36
|
+
"vite-plugin-compression2": "^2.2.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "vite build"
|
|
44
|
+
}
|
|
45
|
+
}
|