@storyblok/vue 7.3.2 → 8.0.1

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 CHANGED
@@ -338,6 +338,8 @@ Possible values:
338
338
 
339
339
  - `eu` (default): For spaces created in the EU
340
340
  - `us`: For spaces created in the US
341
+ - `ap`: For spaces created in Australia
342
+ - `ca`: For spaces created in Canada
341
343
  - `cn`: For spaces created in China
342
344
 
343
345
  Full example for a space created in the US:
@@ -0,0 +1,24 @@
1
+ import { defineComponent as l, openBlock as r, createElementBlock as p, createElementVNode as n, createTextVNode as c, toDisplayString as _ } from "vue";
2
+ const m = { class: "fallback-component" }, d = { class: "component" }, f = /* @__PURE__ */ l({
3
+ __name: "FallbackComponent",
4
+ props: {
5
+ blok: {}
6
+ },
7
+ setup(o) {
8
+ return (e, t) => (r(), p("div", m, [
9
+ n("p", null, [
10
+ c(" Component could not be found for blok "),
11
+ n("span", d, _(e.blok.component), 1),
12
+ c("! Is it configured correctly? ")
13
+ ])
14
+ ]));
15
+ }
16
+ }), i = (o, e) => {
17
+ const t = o.__vccOpts || o;
18
+ for (const [s, a] of e)
19
+ t[s] = a;
20
+ return t;
21
+ }, u = /* @__PURE__ */ i(f, [["__scopeId", "data-v-93c770c0"]]);
22
+ export {
23
+ u as default
24
+ };
@@ -1,4 +1,4 @@
1
- (function(d,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(d=typeof globalThis<"u"?globalThis:d||self,u(d.storyblokVue={},d.Vue))})(this,function(d,u){"use strict";let S=!1;const j=[],L=o=>new Promise((e,t)=>{if(typeof window>"u"||(window.storyblokRegisterEvent=r=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}S?r():j.push(r)},document.getElementById("storyblok-javascript-bridge")))return;const s=document.createElement("script");s.async=!0,s.src=o,s.id="storyblok-javascript-bridge",s.onerror=r=>t(r),s.onload=r=>{j.forEach(n=>n()),S=!0,e(r)},document.getElementsByTagName("head")[0].appendChild(s)});var V=Object.defineProperty,z=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,h=(o,e,t)=>(z(o,typeof e!="symbol"?e+"":e,t),t);function C(o){return!(o!==o||o===1/0||o===-1/0)}function U(o,e,t){if(!C(e))throw new TypeError("Expected `limit` to be a finite number");if(!C(t))throw new TypeError("Expected `interval` to be a finite number");const s=[];let r=[],n=0;const i=function(){n++;const a=setTimeout(function(){n--,s.length>0&&i(),r=r.filter(function(p){return p!==a})},t);r.indexOf(a)<0&&r.push(a);const c=s.shift();c.resolve(o.apply(c.self,c.args))},l=function(...a){const c=this;return new Promise(function(p,f){s.push({resolve:p,reject:f,args:a,self:c}),n<e&&i()})};return l.abort=function(){r.forEach(clearTimeout),r=[],s.forEach(function(a){a.reject(function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"})}),s.length=0},l}class v{constructor(){h(this,"isCDNUrl",(e="")=>e.indexOf("/cdn/")>-1),h(this,"getOptionsPage",(e,t=25,s=1)=>({...e,per_page:t,page:s})),h(this,"delay",e=>new Promise(t=>setTimeout(t,e))),h(this,"arrayFrom",(e=0,t)=>[...Array(e)].map(t)),h(this,"range",(e=0,t=e)=>{const s=Math.abs(t-e)||0,r=e<t?1:-1;return this.arrayFrom(s,(n,i)=>i*r+e)}),h(this,"asyncMap",async(e,t)=>Promise.all(e.map(t))),h(this,"flatMap",(e=[],t)=>e.map(t).reduce((s,r)=>[...s,...r],[])),h(this,"escapeHTML",function(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=/[&<>"']/g,r=RegExp(s.source);return e&&r.test(e)?e.replace(s,n=>t[n]):e})}stringify(e,t,s){const r=[];for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const i=e[n],l=s?"":encodeURIComponent(n);let a;typeof i=="object"?a=this.stringify(i,t?t+encodeURIComponent("["+l+"]"):l,Array.isArray(i)):a=(t?t+encodeURIComponent("["+l+"]"):l)+"="+encodeURIComponent(i),r.push(a)}return r.join("&")}getRegionURL(e){const t="api.storyblok.com",s="api-us.storyblok.com",r="app.storyblokchina.cn";switch(e){case"us":return s;case"cn":return r;default:return t}}}const F=function(o,e){const t={};for(const s in o){const r=o[s];e.indexOf(s)>-1&&r!==null&&(t[s]=r)}return t},H=o=>o==="email",q=()=>({singleTag:"hr"}),D=()=>({tag:"blockquote"}),B=()=>({tag:"ul"}),J=o=>({tag:["pre",{tag:"code",attrs:o.attrs}]}),K=()=>({singleTag:"br"}),Y=o=>({tag:`h${o.attrs.level}`}),W=o=>({singleTag:[{tag:"img",attrs:F(o.attrs,["src","alt","title"])}]}),G=()=>({tag:"li"}),Q=()=>({tag:"ol"}),X=()=>({tag:"p"}),Z=o=>({tag:[{tag:"span",attrs:{"data-type":"emoji","data-name":o.attrs.name,emoji:o.attrs.emoji}}]}),ee=()=>({tag:"b"}),te=()=>({tag:"strike"}),se=()=>({tag:"u"}),re=()=>({tag:"strong"}),oe=()=>({tag:"code"}),ne=()=>({tag:"i"}),ie=o=>{const e=new v().escapeHTML,t={...o.attrs},{linktype:s="url"}=o.attrs;if(t.href&&(t.href=e(o.attrs.href||"")),H(s)&&(t.href=`mailto:${t.href}`),t.anchor&&(t.href=`${t.href}#${t.anchor}`,delete t.anchor),t.custom){for(const r in t.custom)t[r]=t.custom[r];delete t.custom}return{tag:[{tag:"a",attrs:t}]}},ae=o=>({tag:[{tag:"span",attrs:o.attrs}]}),le=()=>({tag:"sub"}),ce=()=>({tag:"sup"}),he=o=>({tag:[{tag:"span",attrs:o.attrs}]}),ue=o=>{var e;return(e=o.attrs)!=null&&e.color?{tag:[{tag:"span",attrs:{style:`background-color:${o.attrs.color};`}}]}:{tag:""}},pe=o=>{var e;return(e=o.attrs)!=null&&e.color?{tag:[{tag:"span",attrs:{style:`color:${o.attrs.color}`}}]}:{tag:""}},P={nodes:{horizontal_rule:q,blockquote:D,bullet_list:B,code_block:J,hard_break:K,heading:Y,image:W,list_item:G,ordered_list:Q,paragraph:X,emoji:Z},marks:{bold:ee,strike:te,underline:se,strong:re,code:oe,italic:ne,link:ie,styled:ae,subscript:le,superscript:ce,anchor:he,highlight:ue,textStyle:pe}},de=function(o){const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},t=/[&<>"']/g,s=RegExp(t.source);return o&&s.test(o)?o.replace(t,r=>e[r]):o};class b{constructor(e){h(this,"marks"),h(this,"nodes"),e||(e=P),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,t){this.nodes[e]=t}addMark(e,t){this.marks[e]=t}render(e,t={optimizeImages:!1}){if(e&&e.content&&Array.isArray(e.content)){let s="";return e.content.forEach(r=>{s+=this.renderNode(r)}),t.optimizeImages?this.optimizeImages(s,t.optimizeImages):s}return console.warn(`The render method must receive an Object with a "content" field.
1
+ (function(d,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(d=typeof globalThis<"u"?globalThis:d||self,u(d.storyblokVue={},d.Vue))})(this,function(d,u){"use strict";let C=!1;const $=[],L=o=>new Promise((e,t)=>{if(typeof window>"u"||(window.storyblokRegisterEvent=r=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}C?r():$.push(r)},document.getElementById("storyblok-javascript-bridge")))return;const s=document.createElement("script");s.async=!0,s.src=o,s.id="storyblok-javascript-bridge",s.onerror=r=>t(r),s.onload=r=>{$.forEach(n=>n()),C=!0,e(r)},document.getElementsByTagName("head")[0].appendChild(s)});var M=Object.defineProperty,D=(o,e,t)=>e in o?M(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,h=(o,e,t)=>(D(o,typeof e!="symbol"?e+"":e,t),t);function E(o){return!(o!==o||o===1/0||o===-1/0)}function F(o,e,t){if(!E(e))throw new TypeError("Expected `limit` to be a finite number");if(!E(t))throw new TypeError("Expected `interval` to be a finite number");const s=[];let r=[],n=0;const i=function(){n++;const a=setTimeout(function(){n--,s.length>0&&i(),r=r.filter(function(p){return p!==a})},t);r.indexOf(a)<0&&r.push(a);const c=s.shift();c.resolve(o.apply(c.self,c.args))},l=function(...a){const c=this;return new Promise(function(p,m){s.push({resolve:p,reject:m,args:a,self:c}),n<e&&i()})};return l.abort=function(){r.forEach(clearTimeout),r=[],s.forEach(function(a){a.reject(function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"})}),s.length=0},l}class v{constructor(){h(this,"isCDNUrl",(e="")=>e.indexOf("/cdn/")>-1),h(this,"getOptionsPage",(e,t=25,s=1)=>({...e,per_page:t,page:s})),h(this,"delay",e=>new Promise(t=>setTimeout(t,e))),h(this,"arrayFrom",(e=0,t)=>[...Array(e)].map(t)),h(this,"range",(e=0,t=e)=>{const s=Math.abs(t-e)||0,r=e<t?1:-1;return this.arrayFrom(s,(n,i)=>i*r+e)}),h(this,"asyncMap",async(e,t)=>Promise.all(e.map(t))),h(this,"flatMap",(e=[],t)=>e.map(t).reduce((s,r)=>[...s,...r],[])),h(this,"escapeHTML",function(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=/[&<>"']/g,r=RegExp(s.source);return e&&r.test(e)?e.replace(s,n=>t[n]):e})}stringify(e,t,s){const r=[];for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const i=e[n],l=s?"":encodeURIComponent(n);let a;typeof i=="object"?a=this.stringify(i,t?t+encodeURIComponent("["+l+"]"):l,Array.isArray(i)):a=(t?t+encodeURIComponent("["+l+"]"):l)+"="+encodeURIComponent(i),r.push(a)}return r.join("&")}getRegionURL(e){const t="api.storyblok.com",s="api-us.storyblok.com",r="app.storyblokchina.cn",n="api-ap.storyblok.com",i="api-ca.storyblok.com";switch(e){case"us":return s;case"cn":return r;case"ap":return n;case"ca":return i;default:return t}}}const V=function(o,e){const t={};for(const s in o){const r=o[s];e.indexOf(s)>-1&&r!==null&&(t[s]=r)}return t},B=o=>o==="email",H=()=>({singleTag:"hr"}),z=()=>({tag:"blockquote"}),q=()=>({tag:"ul"}),G=o=>({tag:["pre",{tag:"code",attrs:o.attrs}]}),J=()=>({singleTag:"br"}),K=o=>({tag:`h${o.attrs.level}`}),Y=o=>({singleTag:[{tag:"img",attrs:V(o.attrs,["src","alt","title"])}]}),W=()=>({tag:"li"}),X=()=>({tag:"ol"}),Z=()=>({tag:"p"}),Q=o=>({tag:[{tag:"span",attrs:{"data-type":"emoji","data-name":o.attrs.name,emoji:o.attrs.emoji}}]}),ee=()=>({tag:"b"}),te=()=>({tag:"s"}),se=()=>({tag:"u"}),re=()=>({tag:"strong"}),oe=()=>({tag:"code"}),ne=()=>({tag:"i"}),ie=o=>{if(!o.attrs)return{tag:""};const e=new v().escapeHTML,t={...o.attrs},{linktype:s="url"}=o.attrs;if(delete t.linktype,t.href&&(t.href=e(o.attrs.href||"")),B(s)&&(t.href=`mailto:${t.href}`),t.anchor&&(t.href=`${t.href}#${t.anchor}`,delete t.anchor),t.custom){for(const r in t.custom)t[r]=t.custom[r];delete t.custom}return{tag:[{tag:"a",attrs:t}]}},ae=o=>({tag:[{tag:"span",attrs:o.attrs}]}),le=()=>({tag:"sub"}),ce=()=>({tag:"sup"}),he=o=>({tag:[{tag:"span",attrs:o.attrs}]}),ue=o=>{var e;return(e=o.attrs)!=null&&e.color?{tag:[{tag:"span",attrs:{style:`background-color:${o.attrs.color};`}}]}:{tag:""}},pe=o=>{var e;return(e=o.attrs)!=null&&e.color?{tag:[{tag:"span",attrs:{style:`color:${o.attrs.color}`}}]}:{tag:""}},j={nodes:{horizontal_rule:H,blockquote:z,bullet_list:q,code_block:G,hard_break:J,heading:K,image:Y,list_item:W,ordered_list:X,paragraph:Z,emoji:Q},marks:{bold:ee,strike:te,underline:se,strong:re,code:oe,italic:ne,link:ie,styled:ae,subscript:le,superscript:ce,anchor:he,highlight:ue,textStyle:pe}},de=function(o){const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},t=/[&<>"']/g,s=RegExp(t.source);return o&&s.test(o)?o.replace(t,r=>e[r]):o};class y{constructor(e){h(this,"marks"),h(this,"nodes"),e||(e=j),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,t){this.nodes[e]=t}addMark(e,t){this.marks[e]=t}render(e,t={optimizeImages:!1}){if(e&&e.content&&Array.isArray(e.content)){let s="";return e.content.forEach(r=>{s+=this.renderNode(r)}),t.optimizeImages?this.optimizeImages(s,t.optimizeImages):s}return console.warn(`The render method must receive an Object with a "content" field.
2
2
  The "content" field must be an array of nodes as the type ISbRichtext.
3
3
  ISbRichtext:
4
4
  content?: ISbRichtext[]
@@ -21,5 +21,5 @@
21
21
  }
22
22
  ],
23
23
  type: 'doc'
24
- }`),""}optimizeImages(e,t){let s=0,r=0,n="",i="";typeof t!="boolean"&&(typeof t.width=="number"&&t.width>0&&(n+=`width="${t.width}" `,s=t.width),typeof t.height=="number"&&t.height>0&&(n+=`height="${t.height}" `,r=t.height),(t.loading==="lazy"||t.loading==="eager")&&(n+=`loading="${t.loading}" `),typeof t.class=="string"&&t.class.length>0&&(n+=`class="${t.class}" `),t.filters&&(typeof t.filters.blur=="number"&&t.filters.blur>=0&&t.filters.blur<=100&&(i+=`:blur(${t.filters.blur})`),typeof t.filters.brightness=="number"&&t.filters.brightness>=-100&&t.filters.brightness<=100&&(i+=`:brightness(${t.filters.brightness})`),t.filters.fill&&(t.filters.fill.match(/[0-9A-Fa-f]{6}/g)||t.filters.fill==="transparent")&&(i+=`:fill(${t.filters.fill})`),t.filters.format&&["webp","png","jpeg"].includes(t.filters.format)&&(i+=`:format(${t.filters.format})`),typeof t.filters.grayscale=="boolean"&&t.filters.grayscale&&(i+=":grayscale()"),typeof t.filters.quality=="number"&&t.filters.quality>=0&&t.filters.quality<=100&&(i+=`:quality(${t.filters.quality})`),t.filters.rotate&&[90,180,270].includes(t.filters.rotate)&&(i+=`:rotate(${t.filters.rotate})`),i.length>0&&(i="/filters"+i))),n.length>0&&(e=e.replace(/<img/g,`<img ${n.trim()}`));const l=s>0||r>0||i.length>0?`${s}x${r}${i}`:"";return e=e.replace(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,`a.storyblok.com/f/$1/$2.$3/m/${l}`),typeof t!="boolean"&&(t.sizes||t.srcset)&&(e=e.replace(/<img.*?src=["|'](.*?)["|']/g,a=>{var c,p;const f=a.match(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g);if(f&&f.length>0){const m={srcset:(c=t.srcset)==null?void 0:c.map(g=>{if(typeof g=="number")return`//${f}/m/${g}x0${i} ${g}w`;if(typeof g=="object"&&g.length===2){let R=0,M=0;return typeof g[0]=="number"&&(R=g[0]),typeof g[1]=="number"&&(M=g[1]),`//${f}/m/${R}x${M}${i} ${R}w`}}).join(", "),sizes:(p=t.sizes)==null?void 0:p.map(g=>g).join(", ")};let T="";return m.srcset&&(T+=`srcset="${m.srcset}" `),m.sizes&&(T+=`sizes="${m.sizes}" `),a.replace(/<img/g,`<img ${T.trim()}`)}return a})),e}renderNode(e){const t=[];e.marks&&e.marks.forEach(r=>{const n=this.getMatchingMark(r);n&&n.tag!==""&&t.push(this.renderOpeningTag(n.tag))});const s=this.getMatchingNode(e);return s&&s.tag&&t.push(this.renderOpeningTag(s.tag)),e.content?e.content.forEach(r=>{t.push(this.renderNode(r))}):e.text?t.push(de(e.text)):s&&s.singleTag?t.push(this.renderTag(s.singleTag," /")):s&&s.html?t.push(s.html):e.type==="emoji"&&t.push(this.renderEmoji(e)),s&&s.tag&&t.push(this.renderClosingTag(s.tag)),e.marks&&e.marks.slice(0).reverse().forEach(r=>{const n=this.getMatchingMark(r);n&&n.tag!==""&&t.push(this.renderClosingTag(n.tag))}),t.join("")}renderTag(e,t){return e.constructor===String?`<${e}${t}>`:e.map(s=>{if(s.constructor===String)return`<${s}${t}>`;{let r=`<${s.tag}`;if(s.attrs)for(const n in s.attrs){const i=s.attrs[n];i!==null&&(r+=` ${n}="${i}"`)}return`${r}${t}>`}}).join("")}renderOpeningTag(e){return this.renderTag(e,"")}renderClosingTag(e){return e.constructor===String?`</${e}>`:e.slice(0).reverse().map(t=>t.constructor===String?`</${t}>`:`</${t.tag}>`).join("")}getMatchingNode(e){const t=this.nodes[e.type];if(typeof t=="function")return t(e)}getMatchingMark(e){const t=this.marks[e.type];if(typeof t=="function")return t(e)}renderEmoji(e){if(e.attrs.emoji)return e.attrs.emoji;const t=[{tag:"img",attrs:{src:e.attrs.fallbackImage,draggable:"false",loading:"lazy",align:"absmiddle"}}];return this.renderTag(t," /")}}class fe{constructor(e){h(this,"baseURL"),h(this,"timeout"),h(this,"headers"),h(this,"responseInterceptor"),h(this,"fetch"),h(this,"ejectInterceptor"),h(this,"url"),h(this,"parameters"),this.baseURL=e.baseURL,this.headers=e.headers||new Headers,this.timeout=e!=null&&e.timeout?e.timeout*1e3:0,this.responseInterceptor=e.responseInterceptor,this.fetch=(...t)=>e.fetch?e.fetch(...t):fetch(...t),this.ejectInterceptor=!1,this.url="",this.parameters={}}get(e,t){return this.url=e,this.parameters=t,this._methodHandler("get")}post(e,t){return this.url=e,this.parameters=t,this._methodHandler("post")}put(e,t){return this.url=e,this.parameters=t,this._methodHandler("put")}delete(e,t){return this.url=e,this.parameters=t,this._methodHandler("delete")}async _responseHandler(e){const t=[],s={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(r=>{s.data=r});for(const r of e.headers.entries())t[r[0]]=r[1];return s.headers={...t},s.status=e.status,s.statusText=e.statusText,s}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,s=null;if(e==="get"){const a=new v;t=`${this.baseURL}${this.url}?${a.stringify(this.parameters)}`}else s=JSON.stringify(this.parameters);const r=new URL(t),n=new AbortController,{signal:i}=n;let l;this.timeout&&(l=setTimeout(()=>n.abort(),this.timeout));try{const a=await this.fetch(`${r}`,{method:e,headers:this.headers,body:s,signal:i});this.timeout&&clearTimeout(l);const c=await this._responseHandler(a);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(c)):this._statusHandler(c)}catch(a){return{message:a}}}eject(){this.ejectInterceptor=!0}_statusHandler(e){const t=/20[0-6]/g;return new Promise(s=>{if(t.test(`${e.status}`))return s(e);const r={message:e.statusText,status:e.status,response:Array.isArray(e.data)?e.data[0]:e.data.error||e.data.slug};throw new Error(JSON.stringify(r))})}}const x="SB-Agent",w={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:"5.14.2"};let _={};const y={};class ge{constructor(e,t){h(this,"client"),h(this,"maxRetries"),h(this,"throttle"),h(this,"accessToken"),h(this,"cache"),h(this,"helpers"),h(this,"resolveCounter"),h(this,"relations"),h(this,"links"),h(this,"richTextResolver"),h(this,"resolveNestedRelations");let s=e.endpoint||t;if(!s){const i=new v().getRegionURL,l=e.https===!1?"http":"https";e.oauthToken?s=`${l}://${i(e.region)}/v1`:s=`${l}://${i(e.region)}/v2`}const r=new Headers;if(r.set("Content-Type","application/json"),r.set("Accept","application/json"),e.headers)for(const i in e.headers)r.set(i,e.headers[i]);r.has(x)||(r.set(x,w.defaultAgentName),r.set(w.defaultAgentVersion,w.packageVersion));let n=5;e.oauthToken&&(r.set("Authorization",e.oauthToken),n=3),e.rateLimit&&(n=e.rateLimit),e.richTextSchema?this.richTextResolver=new b(e.richTextSchema):this.richTextResolver=new b,e.componentResolver&&this.setComponentResolver(e.componentResolver),this.maxRetries=e.maxRetries||5,this.throttle=U(this.throttledRequest,n,1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.helpers=new v,this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.client=new fe({baseURL:s,timeout:e.timeout||0,headers:r,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}setComponentResolver(e){this.richTextResolver.addNode("blok",t=>{let s="";return t.attrs.body&&t.attrs.body.forEach(r=>{s+=e(r.component,r)}),{html:s}})}parseParams(e){return e.version||(e.version="published"),e.token||(e.token=this.getToken()),e.cv||(e.cv=y[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),e}factoryParamOptions(e,t){return this.helpers.isCDNUrl(e)?this.parseParams(t):t}makeRequest(e,t,s,r){const n=this.factoryParamOptions(e,this.helpers.getOptionsPage(t,s,r));return this.cacheResponse(e,n)}get(e,t){t||(t={});const s=`/${e}`,r=this.factoryParamOptions(s,t);return this.cacheResponse(s,r)}async getAll(e,t,s){const r=(t==null?void 0:t.per_page)||25,n=`/${e}`,i=n.split("/"),l=s||i[i.length-1],a=1,c=await this.makeRequest(n,t,r,a),p=c.total?Math.ceil(c.total/r):1,f=await this.helpers.asyncMap(this.helpers.range(a,p),m=>this.makeRequest(n,t,r,m+1));return this.helpers.flatMap([c,...f],m=>Object.values(m.data[l]))}post(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("post",s,t))}put(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("put",s,t))}delete(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("delete",s,t))}getStories(e){return this.get("cdn/stories",e)}getStory(e,t){return this.get(`cdn/stories/${e}`,t)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,s){const r=e[t];r&&r.fieldtype=="multilink"&&r.linktype=="story"&&typeof r.id=="string"&&this.links[s][r.id]?r.story=this._cleanCopy(this.links[s][r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[s][r.uuid]&&(r.story=this._cleanCopy(this.links[s][r.uuid]))}_insertRelations(e,t,s,r){if(s.indexOf(`${e.component}.${t}`)>-1){if(typeof e[t]=="string")this.relations[r][e[t]]&&(e[t]=this._cleanCopy(this.relations[r][e[t]]));else if(e[t]&&e[t].constructor===Array){const n=[];e[t].forEach(i=>{this.relations[r][i]&&n.push(this._cleanCopy(this.relations[r][i]))}),e[t]=n}}}iterateTree(e,t,s){const r=n=>{if(n!=null){if(n.constructor===Array)for(let i=0;i<n.length;i++)r(n[i]);else if(n.constructor===Object){if(n._stopResolving)return;for(const i in n)(n.component&&n._uid||n.type==="link")&&(this._insertRelations(n,i,t,s),this._insertLinks(n,i,s)),r(n[i])}}};r(e.content)}async resolveLinks(e,t,s){let r=[];if(e.link_uuids){const n=e.link_uuids.length,i=[],l=50;for(let a=0;a<n;a+=l){const c=Math.min(n,a+l);i.push(e.link_uuids.slice(a,c))}for(let a=0;a<i.length;a++)(await this.getStories({per_page:l,language:t.language,version:t.version,by_uuids:i[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.links;r.forEach(n=>{this.links[s][n.uuid]={...n,_stopResolving:!0}})}async resolveRelations(e,t,s){let r=[];if(e.rel_uuids){const n=e.rel_uuids.length,i=[],l=50;for(let a=0;a<n;a+=l){const c=Math.min(n,a+l);i.push(e.rel_uuids.slice(a,c))}for(let a=0;a<i.length;a++)(await this.getStories({per_page:l,language:t.language,version:t.version,by_uuids:i[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.rels;r&&r.length>0&&r.forEach(n=>{this.relations[s][n.uuid]={...n,_stopResolving:!0}})}async resolveStories(e,t,s){var r,n;let i=[];if(this.links[s]={},this.relations[s]={},typeof t.resolve_relations<"u"&&t.resolve_relations.length>0&&(typeof t.resolve_relations=="string"&&(i=t.resolve_relations.split(",")),await this.resolveRelations(e,t,s)),t.resolve_links&&["1","story","url","link"].indexOf(t.resolve_links)>-1&&((r=e.links)!=null&&r.length||(n=e.link_uuids)!=null&&n.length)&&await this.resolveLinks(e,t,s),this.resolveNestedRelations)for(const l in this.relations[s])this.iterateTree(this.relations[s][l],i,s);e.story?this.iterateTree(e.story,i,s):e.stories.forEach(l=>{this.iterateTree(l,i,s)}),delete this.links[s],delete this.relations[s]}async cacheResponse(e,t,s){(typeof s>"u"||!s)&&(s=0);const r=this.helpers.stringify({url:e,params:t}),n=this.cacheProvider();if(this.cache.clear==="auto"&&t.version==="draft"&&await this.flushCache(),t.version==="published"&&e!="/cdn/spaces/me"){const i=await n.get(r);if(i)return Promise.resolve(i)}return new Promise(async(i,l)=>{var a;try{const c=await this.throttle("get",e,t);if(c.status!==200)return l(c);let p={data:c.data,headers:c.headers};if((a=c.headers)!=null&&a["per-page"]&&(p=Object.assign({},p,{perPage:c.headers["per-page"]?parseInt(c.headers["per-page"]):0,total:c.headers["per-page"]?parseInt(c.headers.total):0})),p.data.story||p.data.stories){const f=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(p.data,t,`${f}`)}return t.version==="published"&&e!="/cdn/spaces/me"&&await n.set(r,p),p.data.cv&&t.token&&(t.version=="draft"&&y[t.token]!=p.data.cv&&await this.flushCache(),y[t.token]=p.data.cv),i(p)}catch(c){if(c.response&&c.response.status===429&&(s=s?s+1:0,s<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${s} seconds.`),await this.helpers.delay(1e3*s),this.cacheResponse(e,t,s).then(i).catch(l);l(c.message)}})}throttledRequest(e,t,s){return this.client[e](t,s)}cacheVersions(){return y}cacheVersion(){return y[this.accessToken]}setCacheVersion(e){this.accessToken&&(y[this.accessToken]=e)}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(_[e])},getAll(){return Promise.resolve(_)},set(e,t){return _[e]=t,Promise.resolve(void 0)},flush(){return _={},Promise.resolve(void 0)}};case"custom":if(this.cache.custom)return this.cache.custom;default:return{get(){return Promise.resolve(void 0)},getAll(){return Promise.resolve(void 0)},set(){return Promise.resolve(void 0)},flush(){return Promise.resolve(void 0)}}}}async flushCache(){return await this.cacheProvider().flush(),this}}const me=(o={})=>{const{apiOptions:e}=o;if(!e.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new ge(e)}},ye=o=>{if(typeof o!="object"||typeof o._editable>"u")return{};const e=JSON.parse(o._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return e?{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}:{}};let $,E="https://app.storyblok.com/f/storyblok-v2-latest.js";const I=(o,e,t={})=>{var s;const r=!(typeof window>"u")&&typeof window.storyblokRegisterEvent<"u",n=+new URL((s=window.location)==null?void 0:s.href).searchParams.get("_storyblok")===o;if(!(!r||!n)){if(!o){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(t).on(["input","published","change"],i=>{i.action==="input"&&i.story.id===o?e(i.story):(i.action==="change"||i.action==="published")&&i.storyId===o&&window.location.reload()})})}},be=(o={})=>{var e,t;const{bridge:s,accessToken:r,use:n=[],apiOptions:i={},richText:l={},bridgeUrl:a}=o;i.accessToken=i.accessToken||r;const c={bridge:s,apiOptions:i};let p={};n.forEach(m=>{p={...p,...m(c)}}),a&&(E=a);const f=!(typeof window>"u")&&((t=(e=window.location)==null?void 0:e.search)==null?void 0:t.includes("_storyblok_tk"));return s!==!1&&f&&L(E),$=new b(l.schema),l.resolver&&A($,l.resolver),p},A=(o,e)=>{o.addNode("blok",t=>{let s="";return t.attrs.body.forEach(r=>{s+=e(r.component,r)}),{html:s}})},ke=o=>!o||!(o!=null&&o.content.some(e=>e.content||e.type==="blok"||e.type==="horizontal_rule")),ve=(o,e,t)=>{let s=t||$;if(!s){console.error("Please initialize the Storyblok SDK before calling the renderRichText function");return}return ke(o)?"":(e&&(s=new b(e.schema),e.resolver&&A(s,e.resolver)),s.render(o))},N=u.defineComponent({__name:"StoryblokComponent",props:{blok:{}},setup(o,{expose:e}){const t=o,s=u.ref();e({value:s});const r=typeof u.resolveDynamicComponent(t.blok.component)!="string",n=u.inject("VueSDKOptions"),i=u.ref(t.blok.component);return r||(n.enableFallbackComponent?(i.value=n.customFallbackComponent??"FallbackComponent",typeof u.resolveDynamicComponent(i.value)=="string"&&console.error(`Is the Fallback component "${i.value}" registered properly?`)):console.error(`Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`)),(l,a)=>(u.openBlock(),u.createBlock(u.resolveDynamicComponent(i.value),u.mergeProps({ref_key:"blokRef",ref:s},{...l.$props,...l.$attrs}),null,16))}}),_e={beforeMount(o,e){if(e.value){const t=ye(e.value);Object.keys(t).length>0&&(o.setAttribute("data-blok-c",t["data-blok-c"]),o.setAttribute("data-blok-uid",t["data-blok-uid"]),o.classList.add("storyblok__outline"))}}},O=o=>{console.error(`You can't use ${o} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
25
- `)};let k=null;const we=()=>(k||O("useStoryblokApi"),k),$e=async(o,e={},t={})=>{const s=u.ref(null);if(t.resolveRelations=t.resolveRelations??e.resolve_relations,t.resolveLinks=t.resolveLinks??e.resolve_links,u.onMounted(()=>{s.value&&s.value.id&&I(s.value.id,r=>s.value=r,t)}),k){const{data:r}=await k.get(`cdn/stories/${o}`,e);s.value=r.story}else O("useStoryblok");return s},Te={install(o,e={}){o.directive("editable",_e),o.component("StoryblokComponent",N),e.enableFallbackComponent&&!e.customFallbackComponent&&o.component("FallbackComponent",u.defineAsyncComponent(()=>Promise.resolve().then(()=>Ce)));const{storyblokApi:t}=be(e);k=t,o.provide("VueSDKOptions",e)}},Re={class:"fallback-component"},Se={class:"component"},je=u.defineComponent({__name:"FallbackComponent",props:{blok:{}},setup(o){return(e,t)=>(u.openBlock(),u.createElementBlock("div",Re,[u.createElementVNode("p",null,[u.createTextVNode(" Component could not be found for blok "),u.createElementVNode("span",Se,u.toDisplayString(e.blok.component),1),u.createTextVNode("! Is it configured correctly? ")])]))}}),Pe="",Ce=Object.freeze(Object.defineProperty({__proto__:null,default:((o,e)=>{const t=o.__vccOpts||o;for(const[s,r]of e)t[s]=r;return t})(je,[["__scopeId","data-v-93c770c0"]])},Symbol.toStringTag,{value:"Module"}));d.RichTextResolver=b,d.RichTextSchema=P,d.StoryblokComponent=N,d.StoryblokVue=Te,d.apiPlugin=me,d.renderRichText=ve,d.useStoryblok=$e,d.useStoryblokApi=we,d.useStoryblokBridge=I,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
24
+ }`),""}optimizeImages(e,t){let s=0,r=0,n="",i="";typeof t!="boolean"&&(typeof t.width=="number"&&t.width>0&&(n+=`width="${t.width}" `,s=t.width),typeof t.height=="number"&&t.height>0&&(n+=`height="${t.height}" `,r=t.height),(t.loading==="lazy"||t.loading==="eager")&&(n+=`loading="${t.loading}" `),typeof t.class=="string"&&t.class.length>0&&(n+=`class="${t.class}" `),t.filters&&(typeof t.filters.blur=="number"&&t.filters.blur>=0&&t.filters.blur<=100&&(i+=`:blur(${t.filters.blur})`),typeof t.filters.brightness=="number"&&t.filters.brightness>=-100&&t.filters.brightness<=100&&(i+=`:brightness(${t.filters.brightness})`),t.filters.fill&&(t.filters.fill.match(/[0-9A-Fa-f]{6}/g)||t.filters.fill==="transparent")&&(i+=`:fill(${t.filters.fill})`),t.filters.format&&["webp","png","jpeg"].includes(t.filters.format)&&(i+=`:format(${t.filters.format})`),typeof t.filters.grayscale=="boolean"&&t.filters.grayscale&&(i+=":grayscale()"),typeof t.filters.quality=="number"&&t.filters.quality>=0&&t.filters.quality<=100&&(i+=`:quality(${t.filters.quality})`),t.filters.rotate&&[90,180,270].includes(t.filters.rotate)&&(i+=`:rotate(${t.filters.rotate})`),i.length>0&&(i="/filters"+i))),n.length>0&&(e=e.replace(/<img/g,`<img ${n.trim()}`));const l=s>0||r>0||i.length>0?`${s}x${r}${i}`:"";return e=e.replace(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,`a.storyblok.com/f/$1/$2.$3/m/${l}`),typeof t!="boolean"&&(t.sizes||t.srcset)&&(e=e.replace(/<img.*?src=["|'](.*?)["|']/g,a=>{var c,p;const m=a.match(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g);if(m&&m.length>0){const f={srcset:(c=t.srcset)==null?void 0:c.map(g=>{if(typeof g=="number")return`//${m}/m/${g}x0${i} ${g}w`;if(typeof g=="object"&&g.length===2){let w=0,P=0;return typeof g[0]=="number"&&(w=g[0]),typeof g[1]=="number"&&(P=g[1]),`//${m}/m/${w}x${P}${i} ${w}w`}}).join(", "),sizes:(p=t.sizes)==null?void 0:p.map(g=>g).join(", ")};let T="";return f.srcset&&(T+=`srcset="${f.srcset}" `),f.sizes&&(T+=`sizes="${f.sizes}" `),a.replace(/<img/g,`<img ${T.trim()}`)}return a})),e}renderNode(e){const t=[];e.marks&&e.marks.forEach(r=>{const n=this.getMatchingMark(r);n&&n.tag!==""&&t.push(this.renderOpeningTag(n.tag))});const s=this.getMatchingNode(e);return s&&s.tag&&t.push(this.renderOpeningTag(s.tag)),e.content?e.content.forEach(r=>{t.push(this.renderNode(r))}):e.text?t.push(de(e.text)):s&&s.singleTag?t.push(this.renderTag(s.singleTag," /")):s&&s.html?t.push(s.html):e.type==="emoji"&&t.push(this.renderEmoji(e)),s&&s.tag&&t.push(this.renderClosingTag(s.tag)),e.marks&&e.marks.slice(0).reverse().forEach(r=>{const n=this.getMatchingMark(r);n&&n.tag!==""&&t.push(this.renderClosingTag(n.tag))}),t.join("")}renderTag(e,t){return e.constructor===String?`<${e}${t}>`:e.map(s=>{if(s.constructor===String)return`<${s}${t}>`;{let r=`<${s.tag}`;if(s.attrs)for(const n in s.attrs){const i=s.attrs[n];i!==null&&(r+=` ${n}="${i}"`)}return`${r}${t}>`}}).join("")}renderOpeningTag(e){return this.renderTag(e,"")}renderClosingTag(e){return e.constructor===String?`</${e}>`:e.slice(0).reverse().map(t=>t.constructor===String?`</${t}>`:`</${t.tag}>`).join("")}getMatchingNode(e){const t=this.nodes[e.type];if(typeof t=="function")return t(e)}getMatchingMark(e){const t=this.marks[e.type];if(typeof t=="function")return t(e)}renderEmoji(e){if(e.attrs.emoji)return e.attrs.emoji;const t=[{tag:"img",attrs:{src:e.attrs.fallbackImage,draggable:"false",loading:"lazy",align:"absmiddle"}}];return this.renderTag(t," /")}}class me{constructor(e){h(this,"baseURL"),h(this,"timeout"),h(this,"headers"),h(this,"responseInterceptor"),h(this,"fetch"),h(this,"ejectInterceptor"),h(this,"url"),h(this,"parameters"),this.baseURL=e.baseURL,this.headers=e.headers||new Headers,this.timeout=e!=null&&e.timeout?e.timeout*1e3:0,this.responseInterceptor=e.responseInterceptor,this.fetch=(...t)=>e.fetch?e.fetch(...t):fetch(...t),this.ejectInterceptor=!1,this.url="",this.parameters={}}get(e,t){return this.url=e,this.parameters=t,this._methodHandler("get")}post(e,t){return this.url=e,this.parameters=t,this._methodHandler("post")}put(e,t){return this.url=e,this.parameters=t,this._methodHandler("put")}delete(e,t){return this.url=e,this.parameters=t,this._methodHandler("delete")}async _responseHandler(e){const t=[],s={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(r=>{s.data=r});for(const r of e.headers.entries())t[r[0]]=r[1];return s.headers={...t},s.status=e.status,s.statusText=e.statusText,s}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,s=null;if(e==="get"){const a=new v;t=`${this.baseURL}${this.url}?${a.stringify(this.parameters)}`}else s=JSON.stringify(this.parameters);const r=new URL(t),n=new AbortController,{signal:i}=n;let l;this.timeout&&(l=setTimeout(()=>n.abort(),this.timeout));try{const a=await fetch(`${r}`,{method:e,headers:this.headers,body:s,signal:i});this.timeout&&clearTimeout(l);const c=await this._responseHandler(a);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(c)):this._statusHandler(c)}catch(a){return{message:a}}}eject(){this.ejectInterceptor=!0}_statusHandler(e){const t=/20[0-6]/g;return new Promise((s,r)=>{if(t.test(`${e.status}`))return s(e);const n={message:e.statusText,status:e.status,response:Array.isArray(e.data)?e.data[0]:e.data.error||e.data.slug};r(n)})}}var ge={NVM_INC:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/include/node",TERM_PROGRAM:"iTerm.app",NODE:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node",NVM_CD_FLAGS:"-q",INIT_CWD:"/Users/lisilinhart/Code/storyblok-js-client",SHELL:"/bin/zsh",TERM:"xterm-256color",TMPDIR:"/var/folders/9v/t3hq3s9n2rj6_x9jlsjjq95w0000gn/T/",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_config_global_prefix:"/Users/lisilinhart/.nvm/versions/node/v18.16.0",TERM_PROGRAM_VERSION:"3.4.20",TERM_SESSION_ID:"w0t0p1:12B7CE01-010D-40B5-B6DA-DFE3CF20B8FF",COLOR:"0",npm_config_noproxy:"",ZSH:"/Users/lisilinhart/.oh-my-zsh",npm_config_local_prefix:"/Users/lisilinhart/Code/storyblok-js-client",USER:"lisilinhart",NVM_DIR:"/Users/lisilinhart/.nvm",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/etc/npmrc",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.oUounWp9qr/Listeners",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x5C",npm_execpath:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/bin/npm-cli.js",PAGER:"less",npm_package_integrity:"null",LSCOLORS:"Gxfxcxdxbxegedabagacad",PATH:"/Users/lisilinhart/Code/storyblok-js-client/node_modules/.bin:/Users/lisilinhart/Code/node_modules/.bin:/Users/lisilinhart/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/Users/lisilinhart/Code/storyblok-js-client/node_modules/.bin:/Users/lisilinhart/Code/node_modules/.bin:/Users/lisilinhart/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/usr/local/sbin:/Users/lisilinhart/.rbenv/shims:/Users/lisilinhart/.yarn/bin:/Users/lisilinhart/.config/yarn/global/node_modules/.bin:/Users/lisilinhart/.rbenv/shims:/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin:/Users/lisilinhart/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/lisilinhart/.cargo/bin",RUBY_CONFIGURE_OPTS:"--with-openssl-dir=/usr/local/opt/openssl@1.1",LaunchInstanceID:"9D2A03D3-35CC-4CDD-810D-0D5C25991BBB",_:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node",npm_package_json:"/Users/lisilinhart/Code/storyblok-js-client/package.json",__CFBundleIdentifier:"com.googlecode.iterm2",npm_config_init_module:"/Users/lisilinhart/.npm-init.js",npm_config_userconfig:"/Users/lisilinhart/.npmrc",PWD:"/Users/lisilinhart/Code/storyblok-js-client",npm_command:"run-script",P9K_SSH:"0",EDITOR:"vi",npm_lifecycle_event:"build",LANG:"de_AT.UTF-8",P9K_TTY:"old",npm_package_name:"storyblok-js-client",ITERM_PROFILE:"Default",XPC_FLAGS:"0x0",RBENV_SHELL:"zsh",npm_config_node_gyp:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",XPC_SERVICE_NAME:"0",npm_package_version:"6.4.1",COLORFGBG:"7;0",HOME:"/Users/lisilinhart",SHLVL:"3",npm_package_resolved:"/Users/lisilinhart/Code/storyblok-js-client",LC_TERMINAL_VERSION:"3.4.20",ITERM_SESSION_ID:"w0t0p1:12B7CE01-010D-40B5-B6DA-DFE3CF20B8FF",LOGNAME:"lisilinhart",LESS:"-R",npm_config_cache:"/Users/lisilinhart/.npm",npm_lifecycle_script:"node vite.build.mjs && tsc",NVM_BIN:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin",npm_config_user_agent:"npm/9.5.1 node/v18.16.0 darwin x64 workspaces/false",LC_TERMINAL:"iTerm2",SECURITYSESSIONID:"186a1",COLORTERM:"truecolor",npm_config_prefix:"/Users/lisilinhart/.nvm/versions/node/v18.16.0",npm_node_execpath:"/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node",NODE_ENV:"production"};const x="SB-Agent",R={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:ge.npm_package_version};let k={};const b={};class fe{constructor(e,t){h(this,"client"),h(this,"maxRetries"),h(this,"throttle"),h(this,"accessToken"),h(this,"cache"),h(this,"helpers"),h(this,"resolveCounter"),h(this,"relations"),h(this,"links"),h(this,"richTextResolver"),h(this,"resolveNestedRelations"),h(this,"stringifiedStoriesCache");let s=e.endpoint||t;if(!s){const i=new v().getRegionURL,l=e.https===!1?"http":"https";e.oauthToken?s=`${l}://${i(e.region)}/v1`:s=`${l}://${i(e.region)}/v2`}const r=new Headers;if(r.set("Content-Type","application/json"),r.set("Accept","application/json"),e.headers)for(const i in e.headers)r.set(i,e.headers[i]);r.has(x)||(r.set(x,R.defaultAgentName),r.set(R.defaultAgentVersion,R.packageVersion));let n=5;e.oauthToken&&(r.set("Authorization",e.oauthToken),n=3),e.rateLimit&&(n=e.rateLimit),e.richTextSchema?this.richTextResolver=new y(e.richTextSchema):this.richTextResolver=new y,e.componentResolver&&this.setComponentResolver(e.componentResolver),this.maxRetries=e.maxRetries||5,this.throttle=F(this.throttledRequest,n,1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.helpers=new v,this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.stringifiedStoriesCache={},this.client=new me({baseURL:s,timeout:e.timeout||0,headers:r,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}setComponentResolver(e){this.richTextResolver.addNode("blok",t=>{let s="";return t.attrs.body&&t.attrs.body.forEach(r=>{s+=e(r.component,r)}),{html:s}})}parseParams(e){return e.token||(e.token=this.getToken()),e.cv||(e.cv=b[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),e}factoryParamOptions(e,t){return this.helpers.isCDNUrl(e)?this.parseParams(t):t}makeRequest(e,t,s,r){const n=this.factoryParamOptions(e,this.helpers.getOptionsPage(t,s,r));return this.cacheResponse(e,n)}get(e,t){t||(t={});const s=`/${e}`,r=this.factoryParamOptions(s,t);return this.cacheResponse(s,r)}async getAll(e,t,s){const r=(t==null?void 0:t.per_page)||25,n=`/${e}`,i=n.split("/"),l=s||i[i.length-1],a=1,c=await this.makeRequest(n,t,r,a),p=c.total?Math.ceil(c.total/r):1,m=await this.helpers.asyncMap(this.helpers.range(a,p),f=>this.makeRequest(n,t,r,f+1));return this.helpers.flatMap([c,...m],f=>Object.values(f.data[l]))}post(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("post",s,t))}put(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("put",s,t))}delete(e,t){const s=`/${e}`;return Promise.resolve(this.throttle("delete",s,t))}getStories(e){return this.get("cdn/stories",e)}getStory(e,t){return this.get(`cdn/stories/${e}`,t)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,s){const r=e[t];r&&r.fieldtype=="multilink"&&r.linktype=="story"&&typeof r.id=="string"&&this.links[s][r.id]?r.story=this._cleanCopy(this.links[s][r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[s][r.uuid]&&(r.story=this._cleanCopy(this.links[s][r.uuid]))}getStoryReference(e,t){return this.relations[e][t]?(this.stringifiedStoriesCache[t]||(this.stringifiedStoriesCache[t]=JSON.stringify(this.relations[e][t])),JSON.parse(this.stringifiedStoriesCache[t])):t}_insertRelations(e,t,s,r){s.indexOf(`${e.component}.${t}`)>-1&&(typeof e[t]=="string"?e[t]=this.getStoryReference(r,e[t]):Array.isArray(e[t])&&(e[t]=e[t].map(n=>this.getStoryReference(r,n)).filter(Boolean)))}iterateTree(e,t,s){const r=n=>{if(n!=null){if(n.constructor===Array)for(let i=0;i<n.length;i++)r(n[i]);else if(n.constructor===Object){if(n._stopResolving)return;for(const i in n)(n.component&&n._uid||n.type==="link")&&(this._insertRelations(n,i,t,s),this._insertLinks(n,i,s)),r(n[i])}}};r(e.content)}async resolveLinks(e,t,s){let r=[];if(e.link_uuids){const n=e.link_uuids.length,i=[],l=50;for(let a=0;a<n;a+=l){const c=Math.min(n,a+l);i.push(e.link_uuids.slice(a,c))}for(let a=0;a<i.length;a++)(await this.getStories({per_page:l,language:t.language,version:t.version,by_uuids:i[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.links;r.forEach(n=>{this.links[s][n.uuid]={...n,_stopResolving:!0}})}async resolveRelations(e,t,s){let r=[];if(e.rel_uuids){const n=e.rel_uuids.length,i=[],l=50;for(let a=0;a<n;a+=l){const c=Math.min(n,a+l);i.push(e.rel_uuids.slice(a,c))}for(let a=0;a<i.length;a++)(await this.getStories({per_page:l,language:t.language,version:t.version,by_uuids:i[a].join(","),excluding_fields:t.excluding_fields})).data.stories.forEach(c=>{r.push(c)})}else r=e.rels;r&&r.length>0&&r.forEach(n=>{this.relations[s][n.uuid]={...n,_stopResolving:!0}})}async resolveStories(e,t,s){var r,n;let i=[];if(this.links[s]={},this.relations[s]={},typeof t.resolve_relations<"u"&&t.resolve_relations.length>0&&(typeof t.resolve_relations=="string"&&(i=t.resolve_relations.split(",")),await this.resolveRelations(e,t,s)),t.resolve_links&&["1","story","url","link"].indexOf(t.resolve_links)>-1&&((r=e.links)!=null&&r.length||(n=e.link_uuids)!=null&&n.length)&&await this.resolveLinks(e,t,s),this.resolveNestedRelations)for(const l in this.relations[s])this.iterateTree(this.relations[s][l],i,s);e.story?this.iterateTree(e.story,i,s):e.stories.forEach(l=>{this.iterateTree(l,i,s)}),this.stringifiedStoriesCache={},delete this.links[s],delete this.relations[s]}async cacheResponse(e,t,s){(typeof s>"u"||!s)&&(s=0);const r=this.helpers.stringify({url:e,params:t}),n=this.cacheProvider();if(this.cache.clear==="auto"&&t.version==="draft"&&await this.flushCache(),t.version==="published"&&e!="/cdn/spaces/me"){const i=await n.get(r);if(i)return Promise.resolve(i)}return new Promise(async(i,l)=>{var a;try{const c=await this.throttle("get",e,t);if(c.status!==200)return l(c);let p={data:c.data,headers:c.headers};if((a=c.headers)!=null&&a["per-page"]&&(p=Object.assign({},p,{perPage:c.headers["per-page"]?parseInt(c.headers["per-page"]):0,total:c.headers["per-page"]?parseInt(c.headers.total):0})),p.data.story||p.data.stories){const m=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(p.data,t,`${m}`)}return t.version==="published"&&e!="/cdn/spaces/me"&&await n.set(r,p),p.data.cv&&t.token&&(t.version==="draft"&&b[t.token]!=p.data.cv&&await this.flushCache(),b[t.token]=t.cv?t.cv:p.data.cv),i(p)}catch(c){if(c.response&&c.response.status===429&&(s=s?s+1:0,s<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${s} seconds.`),await this.helpers.delay(1e3*s),this.cacheResponse(e,t,s).then(i).catch(l);l(c)}})}throttledRequest(e,t,s){return this.client[e](t,s)}cacheVersions(){return b}cacheVersion(){return b[this.accessToken]}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(k[e])},getAll(){return Promise.resolve(k)},set(e,t){return k[e]=t,Promise.resolve(void 0)},flush(){return k={},Promise.resolve(void 0)}};case"custom":if(this.cache.custom)return this.cache.custom;default:return{get(){return Promise.resolve()},getAll(){return Promise.resolve(void 0)},set(){return Promise.resolve(void 0)},flush(){return Promise.resolve(void 0)}}}}async flushCache(){return await this.cacheProvider().flush(),this}}const ye=(o={})=>{const{apiOptions:e}=o;if(!e.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new fe(e)}},be=o=>{if(typeof o!="object"||typeof o._editable>"u")return{};try{const e=JSON.parse(o._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return e?{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}:{}}catch{return{}}};let S,I="https://app.storyblok.com/f/storyblok-v2-latest.js";const U=(o,e,t={})=>{var s;const r=!(typeof window>"u")&&typeof window.storyblokRegisterEvent<"u",n=+new URL((s=window.location)==null?void 0:s.href).searchParams.get("_storyblok")===o;if(!(!r||!n)){if(!o){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(t).on(["input","published","change"],i=>{i.action==="input"&&i.story.id===o?e(i.story):(i.action==="change"||i.action==="published")&&i.storyId===o&&window.location.reload()})})}},_e=(o={})=>{var e,t;const{bridge:s,accessToken:r,use:n=[],apiOptions:i={},richText:l={},bridgeUrl:a}=o;i.accessToken=i.accessToken||r;const c={bridge:s,apiOptions:i};let p={};n.forEach(f=>{p={...p,...f(c)}}),a&&(I=a);const m=!(typeof window>"u")&&((t=(e=window.location)==null?void 0:e.search)==null?void 0:t.includes("_storyblok_tk"));return s!==!1&&m&&L(I),S=new y(l.schema),l.resolver&&O(S,l.resolver),p},O=(o,e)=>{o.addNode("blok",t=>{let s="";return t.attrs.body.forEach(r=>{s+=e(r.component,r)}),{html:s}})},ve=o=>!o||!(o!=null&&o.content.some(e=>e.content||e.type==="blok"||e.type==="horizontal_rule")),ke=(o,e,t)=>{let s=t||S;if(!s){console.error("Please initialize the Storyblok SDK before calling the renderRichText function");return}return ve(o)?"":(e&&(s=new y(e.schema),e.resolver&&O(s,e.resolver)),s.render(o))},A=u.defineComponent({__name:"StoryblokComponent",props:{blok:{}},setup(o,{expose:e}){const t=o,s=u.ref();e({value:s});const r=typeof u.resolveDynamicComponent(t.blok.component)!="string",n=u.inject("VueSDKOptions"),i=u.ref(t.blok.component);return r||(n.enableFallbackComponent?(i.value=n.customFallbackComponent??"FallbackComponent",typeof u.resolveDynamicComponent(i.value)=="string"&&console.error(`Is the Fallback component "${i.value}" registered properly?`)):console.error(`Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`)),(l,a)=>(u.openBlock(),u.createBlock(u.resolveDynamicComponent(i.value),u.mergeProps({ref_key:"blokRef",ref:s},{...l.$props,...l.$attrs}),null,16))}}),Re={beforeMount(o,e){if(e.value){const t=be(e.value);Object.keys(t).length>0&&(o.setAttribute("data-blok-c",t["data-blok-c"]),o.setAttribute("data-blok-uid",t["data-blok-uid"]),o.classList.add("storyblok__outline"))}}},N=o=>{console.error(`You can't use ${o} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
25
+ `)};let _=null;const Se=()=>(_||N("useStoryblokApi"),_),Te=async(o,e={},t={})=>{const s=u.ref(null);if(t.resolveRelations=t.resolveRelations??e.resolve_relations,t.resolveLinks=t.resolveLinks??e.resolve_links,u.onMounted(()=>{s.value&&s.value.id&&U(s.value.id,r=>s.value=r,t)}),_){const{data:r}=await _.get(`cdn/stories/${o}`,e);s.value=r.story}else N("useStoryblok");return s},we={install(o,e={}){o.directive("editable",Re),o.component("StoryblokComponent",A),e.enableFallbackComponent&&!e.customFallbackComponent&&o.component("FallbackComponent",u.defineAsyncComponent(()=>Promise.resolve().then(()=>Ee)));const{storyblokApi:t}=_e(e);_=t,o.provide("VueSDKOptions",e)}},Ce={class:"fallback-component"},$e={class:"component"},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:((o,e)=>{const t=o.__vccOpts||o;for(const[s,r]of e)t[s]=r;return t})(u.defineComponent({__name:"FallbackComponent",props:{blok:{}},setup(o){return(e,t)=>(u.openBlock(),u.createElementBlock("div",Ce,[u.createElementVNode("p",null,[u.createTextVNode(" Component could not be found for blok "),u.createElementVNode("span",$e,u.toDisplayString(e.blok.component),1),u.createTextVNode("! Is it configured correctly? ")])]))}}),[["__scopeId","data-v-93c770c0"]])},Symbol.toStringTag,{value:"Module"}));d.RichTextResolver=y,d.RichTextSchema=j,d.StoryblokComponent=A,d.StoryblokVue=we,d.apiPlugin=ye,d.renderRichText=ke,d.useStoryblok=Te,d.useStoryblokApi=Se,d.useStoryblokBridge=U,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
@@ -1,27 +1,27 @@
1
- import { defineComponent as N, ref as _, resolveDynamicComponent as $, inject as O, openBlock as L, createBlock as M, mergeProps as z, onMounted as U, defineAsyncComponent as H } from "vue";
2
- let S = !1;
3
- const x = [], q = (o) => new Promise((e, t) => {
1
+ import { defineComponent as O, ref as S, resolveDynamicComponent as R, inject as N, openBlock as P, createBlock as L, mergeProps as M, onMounted as D, defineAsyncComponent as F } from "vue";
2
+ let $ = !1;
3
+ const E = [], B = (o) => new Promise((e, t) => {
4
4
  if (typeof window > "u" || (window.storyblokRegisterEvent = (r) => {
5
5
  if (window.location === window.parent.location) {
6
6
  console.warn("You are not in Draft Mode or in the Visual Editor.");
7
7
  return;
8
8
  }
9
- S ? r() : x.push(r);
9
+ $ ? r() : E.push(r);
10
10
  }, document.getElementById("storyblok-javascript-bridge")))
11
11
  return;
12
12
  const s = document.createElement("script");
13
13
  s.async = !0, s.src = o, s.id = "storyblok-javascript-bridge", s.onerror = (r) => t(r), s.onload = (r) => {
14
- x.forEach((n) => n()), S = !0, e(r);
14
+ E.forEach((n) => n()), $ = !0, e(r);
15
15
  }, document.getElementsByTagName("head")[0].appendChild(s);
16
16
  });
17
- var V = Object.defineProperty, D = (o, e, t) => e in o ? V(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, h = (o, e, t) => (D(o, typeof e != "symbol" ? e + "" : e, t), t);
18
- function C(o) {
17
+ var H = Object.defineProperty, V = (o, e, t) => e in o ? H(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, h = (o, e, t) => (V(o, typeof e != "symbol" ? e + "" : e, t), t);
18
+ function x(o) {
19
19
  return !(o !== o || o === 1 / 0 || o === -1 / 0);
20
20
  }
21
- function F(o, e, t) {
22
- if (!C(e))
21
+ function z(o, e, t) {
22
+ if (!x(e))
23
23
  throw new TypeError("Expected `limit` to be a finite number");
24
- if (!C(t))
24
+ if (!x(t))
25
25
  throw new TypeError("Expected `interval` to be a finite number");
26
26
  const s = [];
27
27
  let r = [], n = 0;
@@ -98,35 +98,39 @@ class b {
98
98
  }
99
99
  /**
100
100
  * @method getRegionURL
101
- * @param {String} regionCode region code, could be eu, us or cn
101
+ * @param {String} regionCode region code, could be eu, us, cn, ap or ca
102
102
  * @return {String} The base URL of the region
103
103
  */
104
104
  getRegionURL(e) {
105
- const t = "api.storyblok.com", s = "api-us.storyblok.com", r = "app.storyblokchina.cn";
105
+ const t = "api.storyblok.com", s = "api-us.storyblok.com", r = "app.storyblokchina.cn", n = "api-ap.storyblok.com", i = "api-ca.storyblok.com";
106
106
  switch (e) {
107
107
  case "us":
108
108
  return s;
109
109
  case "cn":
110
110
  return r;
111
+ case "ap":
112
+ return n;
113
+ case "ca":
114
+ return i;
111
115
  default:
112
116
  return t;
113
117
  }
114
118
  }
115
119
  }
116
- const B = function(o, e) {
120
+ const q = function(o, e) {
117
121
  const t = {};
118
122
  for (const s in o) {
119
123
  const r = o[s];
120
124
  e.indexOf(s) > -1 && r !== null && (t[s] = r);
121
125
  }
122
126
  return t;
123
- }, J = (o) => o === "email", K = () => ({
127
+ }, G = (o) => o === "email", J = () => ({
124
128
  singleTag: "hr"
125
- }), Y = () => ({
129
+ }), K = () => ({
126
130
  tag: "blockquote"
127
- }), W = () => ({
131
+ }), Y = () => ({
128
132
  tag: "ul"
129
- }), G = (o) => ({
133
+ }), W = (o) => ({
130
134
  tag: [
131
135
  "pre",
132
136
  {
@@ -134,15 +138,15 @@ const B = function(o, e) {
134
138
  attrs: o.attrs
135
139
  }
136
140
  ]
137
- }), Q = () => ({
141
+ }), X = () => ({
138
142
  singleTag: "br"
139
- }), X = (o) => ({
140
- tag: `h${o.attrs.level}`
141
143
  }), Z = (o) => ({
144
+ tag: `h${o.attrs.level}`
145
+ }), Q = (o) => ({
142
146
  singleTag: [
143
147
  {
144
148
  tag: "img",
145
- attrs: B(o.attrs, ["src", "alt", "title"])
149
+ attrs: q(o.attrs, ["src", "alt", "title"])
146
150
  }
147
151
  ]
148
152
  }), ee = () => ({
@@ -165,7 +169,7 @@ const B = function(o, e) {
165
169
  }), oe = () => ({
166
170
  tag: "b"
167
171
  }), ne = () => ({
168
- tag: "strike"
172
+ tag: "s"
169
173
  }), ie = () => ({
170
174
  tag: "u"
171
175
  }), ae = () => ({
@@ -175,8 +179,12 @@ const B = function(o, e) {
175
179
  }), ce = () => ({
176
180
  tag: "i"
177
181
  }), he = (o) => {
182
+ if (!o.attrs)
183
+ return {
184
+ tag: ""
185
+ };
178
186
  const e = new b().escapeHTML, t = { ...o.attrs }, { linktype: s = "url" } = o.attrs;
179
- if (t.href && (t.href = e(o.attrs.href || "")), J(s) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
187
+ if (delete t.linktype, t.href && (t.href = e(o.attrs.href || "")), G(s) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
180
188
  for (const r in t.custom)
181
189
  t[r] = t.custom[r];
182
190
  delete t.custom;
@@ -200,14 +208,14 @@ const B = function(o, e) {
200
208
  tag: "sub"
201
209
  }), de = () => ({
202
210
  tag: "sup"
203
- }), ge = (o) => ({
211
+ }), me = (o) => ({
204
212
  tag: [
205
213
  {
206
214
  tag: "span",
207
215
  attrs: o.attrs
208
216
  }
209
217
  ]
210
- }), fe = (o) => {
218
+ }), ge = (o) => {
211
219
  var e;
212
220
  return (e = o.attrs) != null && e.color ? {
213
221
  tag: [
@@ -221,7 +229,7 @@ const B = function(o, e) {
221
229
  } : {
222
230
  tag: ""
223
231
  };
224
- }, me = (o) => {
232
+ }, fe = (o) => {
225
233
  var e;
226
234
  return (e = o.attrs) != null && e.color ? {
227
235
  tag: [
@@ -237,13 +245,13 @@ const B = function(o, e) {
237
245
  };
238
246
  }, ye = {
239
247
  nodes: {
240
- horizontal_rule: K,
241
- blockquote: Y,
242
- bullet_list: W,
243
- code_block: G,
244
- hard_break: Q,
245
- heading: X,
246
- image: Z,
248
+ horizontal_rule: J,
249
+ blockquote: K,
250
+ bullet_list: Y,
251
+ code_block: W,
252
+ hard_break: X,
253
+ heading: Z,
254
+ image: Q,
247
255
  list_item: ee,
248
256
  ordered_list: te,
249
257
  paragraph: se,
@@ -260,9 +268,9 @@ const B = function(o, e) {
260
268
  styled: ue,
261
269
  subscript: pe,
262
270
  superscript: de,
263
- anchor: ge,
264
- highlight: fe,
265
- textStyle: me
271
+ anchor: me,
272
+ highlight: ge,
273
+ textStyle: fe
266
274
  }
267
275
  }, be = function(o) {
268
276
  const e = {
@@ -274,7 +282,7 @@ const B = function(o, e) {
274
282
  }, t = /[&<>"']/g, s = RegExp(t.source);
275
283
  return o && s.test(o) ? o.replace(t, (r) => e[r]) : o;
276
284
  };
277
- class k {
285
+ class v {
278
286
  constructor(e) {
279
287
  h(this, "marks"), h(this, "nodes"), e || (e = ye), this.marks = e.marks || [], this.nodes = e.nodes || [];
280
288
  }
@@ -331,19 +339,19 @@ class k {
331
339
  /a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
332
340
  );
333
341
  if (p && p.length > 0) {
334
- const g = {
342
+ const m = {
335
343
  srcset: (c = t.srcset) == null ? void 0 : c.map((d) => {
336
344
  if (typeof d == "number")
337
345
  return `//${p}/m/${d}x0${i} ${d}w`;
338
346
  if (typeof d == "object" && d.length === 2) {
339
- let w = 0, j = 0;
340
- return typeof d[0] == "number" && (w = d[0]), typeof d[1] == "number" && (j = d[1]), `//${p}/m/${w}x${j}${i} ${w}w`;
347
+ let k = 0, C = 0;
348
+ return typeof d[0] == "number" && (k = d[0]), typeof d[1] == "number" && (C = d[1]), `//${p}/m/${k}x${C}${i} ${k}w`;
341
349
  }
342
350
  }).join(", "),
343
351
  sizes: (u = t.sizes) == null ? void 0 : u.map((d) => d).join(", ")
344
352
  };
345
- let v = "";
346
- return g.srcset && (v += `srcset="${g.srcset}" `), g.sizes && (v += `sizes="${g.sizes}" `), a.replace(/<img/g, `<img ${v.trim()}`);
353
+ let _ = "";
354
+ return m.srcset && (_ += `srcset="${m.srcset}" `), m.sizes && (_ += `sizes="${m.sizes}" `), a.replace(/<img/g, `<img ${_.trim()}`);
347
355
  }
348
356
  return a;
349
357
  })), e;
@@ -410,7 +418,7 @@ class k {
410
418
  return this.renderTag(t, " /");
411
419
  }
412
420
  }
413
- class ke {
421
+ class ve {
414
422
  constructor(e) {
415
423
  h(this, "baseURL"), h(this, "timeout"), h(this, "headers"), h(this, "responseInterceptor"), h(this, "fetch"), h(this, "ejectInterceptor"), h(this, "url"), h(this, "parameters"), this.baseURL = e.baseURL, this.headers = e.headers || new Headers(), this.timeout = e != null && e.timeout ? e.timeout * 1e3 : 0, this.responseInterceptor = e.responseInterceptor, this.fetch = (...t) => e.fetch ? e.fetch(...t) : fetch(...t), this.ejectInterceptor = !1, this.url = "", this.parameters = {};
416
424
  }
@@ -459,7 +467,7 @@ class ke {
459
467
  let l;
460
468
  this.timeout && (l = setTimeout(() => n.abort(), this.timeout));
461
469
  try {
462
- const a = await this.fetch(`${r}`, {
470
+ const a = await fetch(`${r}`, {
463
471
  method: e,
464
472
  headers: this.headers,
465
473
  body: s,
@@ -479,33 +487,34 @@ class ke {
479
487
  }
480
488
  _statusHandler(e) {
481
489
  const t = /20[0-6]/g;
482
- return new Promise((s) => {
490
+ return new Promise((s, r) => {
483
491
  if (t.test(`${e.status}`))
484
492
  return s(e);
485
- const r = {
493
+ const n = {
486
494
  message: e.statusText,
487
495
  status: e.status,
488
496
  response: Array.isArray(e.data) ? e.data[0] : e.data.error || e.data.slug
489
497
  };
490
- throw new Error(JSON.stringify(r));
498
+ r(n);
491
499
  });
492
500
  }
493
501
  }
494
- const P = "SB-Agent", R = {
502
+ var _e = { NVM_INC: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/include/node", TERM_PROGRAM: "iTerm.app", NODE: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node", NVM_CD_FLAGS: "-q", INIT_CWD: "/Users/lisilinhart/Code/storyblok-js-client", SHELL: "/bin/zsh", TERM: "xterm-256color", TMPDIR: "/var/folders/9v/t3hq3s9n2rj6_x9jlsjjq95w0000gn/T/", npm_config_metrics_registry: "https://registry.npmjs.org/", npm_config_global_prefix: "/Users/lisilinhart/.nvm/versions/node/v18.16.0", TERM_PROGRAM_VERSION: "3.4.20", TERM_SESSION_ID: "w0t0p1:12B7CE01-010D-40B5-B6DA-DFE3CF20B8FF", COLOR: "0", npm_config_noproxy: "", ZSH: "/Users/lisilinhart/.oh-my-zsh", npm_config_local_prefix: "/Users/lisilinhart/Code/storyblok-js-client", USER: "lisilinhart", NVM_DIR: "/Users/lisilinhart/.nvm", COMMAND_MODE: "unix2003", npm_config_globalconfig: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/etc/npmrc", SSH_AUTH_SOCK: "/private/tmp/com.apple.launchd.oUounWp9qr/Listeners", __CF_USER_TEXT_ENCODING: "0x1F5:0x0:0x5C", npm_execpath: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/bin/npm-cli.js", PAGER: "less", npm_package_integrity: "null", LSCOLORS: "Gxfxcxdxbxegedabagacad", PATH: "/Users/lisilinhart/Code/storyblok-js-client/node_modules/.bin:/Users/lisilinhart/Code/node_modules/.bin:/Users/lisilinhart/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/Users/lisilinhart/Code/storyblok-js-client/node_modules/.bin:/Users/lisilinhart/Code/node_modules/.bin:/Users/lisilinhart/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/usr/local/sbin:/Users/lisilinhart/.rbenv/shims:/Users/lisilinhart/.yarn/bin:/Users/lisilinhart/.config/yarn/global/node_modules/.bin:/Users/lisilinhart/.rbenv/shims:/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin:/Users/lisilinhart/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/lisilinhart/.cargo/bin", RUBY_CONFIGURE_OPTS: "--with-openssl-dir=/usr/local/opt/openssl@1.1", LaunchInstanceID: "9D2A03D3-35CC-4CDD-810D-0D5C25991BBB", _: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node", npm_package_json: "/Users/lisilinhart/Code/storyblok-js-client/package.json", __CFBundleIdentifier: "com.googlecode.iterm2", npm_config_init_module: "/Users/lisilinhart/.npm-init.js", npm_config_userconfig: "/Users/lisilinhart/.npmrc", PWD: "/Users/lisilinhart/Code/storyblok-js-client", npm_command: "run-script", P9K_SSH: "0", EDITOR: "vi", npm_lifecycle_event: "build", LANG: "de_AT.UTF-8", P9K_TTY: "old", npm_package_name: "storyblok-js-client", ITERM_PROFILE: "Default", XPC_FLAGS: "0x0", RBENV_SHELL: "zsh", npm_config_node_gyp: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js", XPC_SERVICE_NAME: "0", npm_package_version: "6.4.1", COLORFGBG: "7;0", HOME: "/Users/lisilinhart", SHLVL: "3", npm_package_resolved: "/Users/lisilinhart/Code/storyblok-js-client", LC_TERMINAL_VERSION: "3.4.20", ITERM_SESSION_ID: "w0t0p1:12B7CE01-010D-40B5-B6DA-DFE3CF20B8FF", LOGNAME: "lisilinhart", LESS: "-R", npm_config_cache: "/Users/lisilinhart/.npm", npm_lifecycle_script: "node vite.build.mjs && tsc", NVM_BIN: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin", npm_config_user_agent: "npm/9.5.1 node/v18.16.0 darwin x64 workspaces/false", LC_TERMINAL: "iTerm2", SECURITYSESSIONID: "186a1", COLORTERM: "truecolor", npm_config_prefix: "/Users/lisilinhart/.nvm/versions/node/v18.16.0", npm_node_execpath: "/Users/lisilinhart/.nvm/versions/node/v18.16.0/bin/node", NODE_ENV: "production" };
503
+ const j = "SB-Agent", w = {
495
504
  defaultAgentName: "SB-JS-CLIENT",
496
505
  defaultAgentVersion: "SB-Agent-Version",
497
- packageVersion: "5.14.2"
506
+ packageVersion: _e.npm_package_version
498
507
  };
499
508
  let y = {};
500
- const f = {};
501
- class ve {
509
+ const g = {};
510
+ class ke {
502
511
  /**
503
512
  *
504
513
  * @param config ISbConfig interface
505
514
  * @param endpoint string, optional
506
515
  */
507
516
  constructor(e, t) {
508
- h(this, "client"), h(this, "maxRetries"), h(this, "throttle"), h(this, "accessToken"), h(this, "cache"), h(this, "helpers"), h(this, "resolveCounter"), h(this, "relations"), h(this, "links"), h(this, "richTextResolver"), h(this, "resolveNestedRelations");
517
+ h(this, "client"), h(this, "maxRetries"), h(this, "throttle"), h(this, "accessToken"), h(this, "cache"), h(this, "helpers"), h(this, "resolveCounter"), h(this, "relations"), h(this, "links"), h(this, "richTextResolver"), h(this, "resolveNestedRelations"), h(this, "stringifiedStoriesCache");
509
518
  let s = e.endpoint || t;
510
519
  if (!s) {
511
520
  const i = new b().getRegionURL, l = e.https === !1 ? "http" : "https";
@@ -515,12 +524,12 @@ class ve {
515
524
  if (r.set("Content-Type", "application/json"), r.set("Accept", "application/json"), e.headers)
516
525
  for (const i in e.headers)
517
526
  r.set(i, e.headers[i]);
518
- r.has(P) || (r.set(P, R.defaultAgentName), r.set(
519
- R.defaultAgentVersion,
520
- R.packageVersion
527
+ r.has(j) || (r.set(j, w.defaultAgentName), r.set(
528
+ w.defaultAgentVersion,
529
+ w.packageVersion
521
530
  ));
522
531
  let n = 5;
523
- e.oauthToken && (r.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new k(e.richTextSchema) : this.richTextResolver = new k(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries || 5, this.throttle = F(this.throttledRequest, n, 1e3), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new b(), this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.client = new ke({
532
+ e.oauthToken && (r.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new v(e.richTextSchema) : this.richTextResolver = new v(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries || 5, this.throttle = z(this.throttledRequest, n, 1e3), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new b(), this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.stringifiedStoriesCache = {}, this.client = new ve({
524
533
  baseURL: s,
525
534
  timeout: e.timeout || 0,
526
535
  headers: r,
@@ -539,7 +548,7 @@ class ve {
539
548
  });
540
549
  }
541
550
  parseParams(e) {
542
- return e.version || (e.version = "published"), e.token || (e.token = this.getToken()), e.cv || (e.cv = f[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), e;
551
+ return e.token || (e.token = this.getToken()), e.cv || (e.cv = g[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), e;
543
552
  }
544
553
  factoryParamOptions(e, t) {
545
554
  return this.helpers.isCDNUrl(e) ? this.parseParams(t) : t;
@@ -559,11 +568,11 @@ class ve {
559
568
  async getAll(e, t, s) {
560
569
  const r = (t == null ? void 0 : t.per_page) || 25, n = `/${e}`, i = n.split("/"), l = s || i[i.length - 1], a = 1, c = await this.makeRequest(n, t, r, a), u = c.total ? Math.ceil(c.total / r) : 1, p = await this.helpers.asyncMap(
561
570
  this.helpers.range(a, u),
562
- (g) => this.makeRequest(n, t, r, g + 1)
571
+ (m) => this.makeRequest(n, t, r, m + 1)
563
572
  );
564
573
  return this.helpers.flatMap(
565
574
  [c, ...p],
566
- (g) => Object.values(g.data[l])
575
+ (m) => Object.values(m.data[l])
567
576
  );
568
577
  }
569
578
  post(e, t) {
@@ -597,19 +606,19 @@ class ve {
597
606
  const r = e[t];
598
607
  r && r.fieldtype == "multilink" && r.linktype == "story" && typeof r.id == "string" && this.links[s][r.id] ? r.story = this._cleanCopy(this.links[s][r.id]) : r && r.linktype === "story" && typeof r.uuid == "string" && this.links[s][r.uuid] && (r.story = this._cleanCopy(this.links[s][r.uuid]));
599
608
  }
609
+ /**
610
+ *
611
+ * @param resolveId A counter number as a string
612
+ * @param uuid The uuid of the story
613
+ * @returns string | object
614
+ */
615
+ getStoryReference(e, t) {
616
+ return this.relations[e][t] ? (this.stringifiedStoriesCache[t] || (this.stringifiedStoriesCache[t] = JSON.stringify(
617
+ this.relations[e][t]
618
+ )), JSON.parse(this.stringifiedStoriesCache[t])) : t;
619
+ }
600
620
  _insertRelations(e, t, s, r) {
601
- if (s.indexOf(`${e.component}.${t}`) > -1) {
602
- if (typeof e[t] == "string")
603
- this.relations[r][e[t]] && (e[t] = this._cleanCopy(
604
- this.relations[r][e[t]]
605
- ));
606
- else if (e[t] && e[t].constructor === Array) {
607
- const n = [];
608
- e[t].forEach((i) => {
609
- this.relations[r][i] && n.push(this._cleanCopy(this.relations[r][i]));
610
- }), e[t] = n;
611
- }
612
- }
621
+ s.indexOf(`${e.component}.${t}`) > -1 && (typeof e[t] == "string" ? e[t] = this.getStoryReference(r, e[t]) : Array.isArray(e[t]) && (e[t] = e[t].map((n) => this.getStoryReference(r, n)).filter(Boolean)));
613
622
  }
614
623
  iterateTree(e, t, s) {
615
624
  const r = (n) => {
@@ -677,7 +686,8 @@ class ve {
677
686
  per_page: l,
678
687
  language: t.language,
679
688
  version: t.version,
680
- by_uuids: i[a].join(",")
689
+ by_uuids: i[a].join(","),
690
+ excluding_fields: t.excluding_fields
681
691
  })).data.stories.forEach((c) => {
682
692
  r.push(c);
683
693
  });
@@ -702,7 +712,7 @@ class ve {
702
712
  );
703
713
  e.story ? this.iterateTree(e.story, i, s) : e.stories.forEach((l) => {
704
714
  this.iterateTree(l, i, s);
705
- }), delete this.links[s], delete this.relations[s];
715
+ }), this.stringifiedStoriesCache = {}, delete this.links[s], delete this.relations[s];
706
716
  }
707
717
  async cacheResponse(e, t, s) {
708
718
  (typeof s > "u" || !s) && (s = 0);
@@ -726,11 +736,11 @@ class ve {
726
736
  const p = this.resolveCounter = ++this.resolveCounter % 1e3;
727
737
  await this.resolveStories(u.data, t, `${p}`);
728
738
  }
729
- return t.version === "published" && e != "/cdn/spaces/me" && await n.set(r, u), u.data.cv && t.token && (t.version == "draft" && f[t.token] != u.data.cv && await this.flushCache(), f[t.token] = u.data.cv), i(u);
739
+ return t.version === "published" && e != "/cdn/spaces/me" && await n.set(r, u), u.data.cv && t.token && (t.version === "draft" && g[t.token] != u.data.cv && await this.flushCache(), g[t.token] = t.cv ? t.cv : u.data.cv), i(u);
730
740
  } catch (c) {
731
741
  if (c.response && c.response.status === 429 && (s = s ? s + 1 : 0, s < this.maxRetries))
732
742
  return console.log(`Hit rate limit. Retrying in ${s} seconds.`), await this.helpers.delay(1e3 * s), this.cacheResponse(e, t, s).then(i).catch(l);
733
- l(c.message);
743
+ l(c);
734
744
  }
735
745
  });
736
746
  }
@@ -738,13 +748,10 @@ class ve {
738
748
  return this.client[e](t, s);
739
749
  }
740
750
  cacheVersions() {
741
- return f;
751
+ return g;
742
752
  }
743
753
  cacheVersion() {
744
- return f[this.accessToken];
745
- }
746
- setCacheVersion(e) {
747
- this.accessToken && (f[this.accessToken] = e);
754
+ return g[this.accessToken];
748
755
  }
749
756
  cacheProvider() {
750
757
  switch (this.cache.type) {
@@ -769,7 +776,7 @@ class ve {
769
776
  default:
770
777
  return {
771
778
  get() {
772
- return Promise.resolve(void 0);
779
+ return Promise.resolve();
773
780
  },
774
781
  getAll() {
775
782
  return Promise.resolve(void 0);
@@ -795,20 +802,24 @@ const xe = (o = {}) => {
795
802
  );
796
803
  return;
797
804
  }
798
- return { storyblokApi: new ve(e) };
799
- }, we = (o) => {
805
+ return { storyblokApi: new ke(e) };
806
+ }, Re = (o) => {
800
807
  if (typeof o != "object" || typeof o._editable > "u")
801
808
  return {};
802
- const e = JSON.parse(
803
- o._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
804
- );
805
- return e ? {
806
- "data-blok-c": JSON.stringify(e),
807
- "data-blok-uid": e.id + "-" + e.uid
808
- } : {};
809
+ try {
810
+ const e = JSON.parse(
811
+ o._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
812
+ );
813
+ return e ? {
814
+ "data-blok-c": JSON.stringify(e),
815
+ "data-blok-uid": e.id + "-" + e.uid
816
+ } : {};
817
+ } catch {
818
+ return {};
819
+ }
809
820
  };
810
- let T, E = "https://app.storyblok.com/f/storyblok-v2-latest.js";
811
- const $e = (o, e, t = {}) => {
821
+ let T, I = "https://app.storyblok.com/f/storyblok-v2-latest.js";
822
+ const we = (o, e, t = {}) => {
812
823
  var s;
813
824
  const r = !(typeof window > "u") && typeof window.storyblokRegisterEvent < "u", n = +new URL((s = window.location) == null ? void 0 : s.href).searchParams.get(
814
825
  "_storyblok"
@@ -824,7 +835,7 @@ const $e = (o, e, t = {}) => {
824
835
  });
825
836
  });
826
837
  }
827
- }, Re = (o = {}) => {
838
+ }, Se = (o = {}) => {
828
839
  var e, t;
829
840
  const {
830
841
  bridge: s,
@@ -837,12 +848,12 @@ const $e = (o, e, t = {}) => {
837
848
  i.accessToken = i.accessToken || r;
838
849
  const c = { bridge: s, apiOptions: i };
839
850
  let u = {};
840
- n.forEach((g) => {
841
- u = { ...u, ...g(c) };
842
- }), a && (E = a);
851
+ n.forEach((m) => {
852
+ u = { ...u, ...m(c) };
853
+ }), a && (I = a);
843
854
  const p = !(typeof window > "u") && ((t = (e = window.location) == null ? void 0 : e.search) == null ? void 0 : t.includes("_storyblok_tk"));
844
- return s !== !1 && p && q(E), T = new k(l.schema), l.resolver && I(T, l.resolver), u;
845
- }, I = (o, e) => {
855
+ return s !== !1 && p && B(I), T = new v(l.schema), l.resolver && U(T, l.resolver), u;
856
+ }, U = (o, e) => {
846
857
  o.addNode("blok", (t) => {
847
858
  let s = "";
848
859
  return t.attrs.body.forEach((r) => {
@@ -851,7 +862,7 @@ const $e = (o, e, t = {}) => {
851
862
  html: s
852
863
  };
853
864
  });
854
- }, _e = (o) => !o || !(o != null && o.content.some((e) => e.content || e.type === "blok" || e.type === "horizontal_rule")), Ce = (o, e, t) => {
865
+ }, Te = (o) => !o || !(o != null && o.content.some((e) => e.content || e.type === "blok" || e.type === "horizontal_rule")), je = (o, e, t) => {
855
866
  let s = t || T;
856
867
  if (!s) {
857
868
  console.error(
@@ -859,31 +870,31 @@ const $e = (o, e, t = {}) => {
859
870
  );
860
871
  return;
861
872
  }
862
- return _e(o) ? "" : (e && (s = new k(e.schema), e.resolver && I(s, e.resolver)), s.render(o));
863
- }, Te = /* @__PURE__ */ N({
873
+ return Te(o) ? "" : (e && (s = new v(e.schema), e.resolver && U(s, e.resolver)), s.render(o));
874
+ }, Ce = /* @__PURE__ */ O({
864
875
  __name: "StoryblokComponent",
865
876
  props: {
866
877
  blok: {}
867
878
  },
868
879
  setup(o, { expose: e }) {
869
- const t = o, s = _();
880
+ const t = o, s = S();
870
881
  e({
871
882
  value: s
872
883
  });
873
- const r = typeof $(t.blok.component) != "string", n = O("VueSDKOptions"), i = _(t.blok.component);
874
- return r || (n.enableFallbackComponent ? (i.value = n.customFallbackComponent ?? "FallbackComponent", typeof $(i.value) == "string" && console.error(
884
+ const r = typeof R(t.blok.component) != "string", n = N("VueSDKOptions"), i = S(t.blok.component);
885
+ return r || (n.enableFallbackComponent ? (i.value = n.customFallbackComponent ?? "FallbackComponent", typeof R(i.value) == "string" && console.error(
875
886
  `Is the Fallback component "${i.value}" registered properly?`
876
887
  )) : console.error(
877
888
  `Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`
878
- )), (l, a) => (L(), M($(i.value), z({
889
+ )), (l, a) => (P(), L(R(i.value), M({
879
890
  ref_key: "blokRef",
880
891
  ref: s
881
892
  }, { ...l.$props, ...l.$attrs }), null, 16));
882
893
  }
883
- }), je = {
894
+ }), $e = {
884
895
  beforeMount(o, e) {
885
896
  if (e.value) {
886
- const t = we(e.value);
897
+ const t = Re(e.value);
887
898
  Object.keys(t).length > 0 && (o.setAttribute("data-blok-c", t["data-blok-c"]), o.setAttribute("data-blok-uid", t["data-blok-uid"]), o.classList.add("storyblok__outline"));
888
899
  }
889
900
  }
@@ -891,17 +902,17 @@ const $e = (o, e, t = {}) => {
891
902
  console.error(`You can't use ${o} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
892
903
  `);
893
904
  };
894
- let m = null;
895
- const Pe = () => (m || A("useStoryblokApi"), m), Ee = async (o, e = {}, t = {}) => {
896
- const s = _(null);
897
- if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links, U(() => {
898
- s.value && s.value.id && $e(
905
+ let f = null;
906
+ const Ie = () => (f || A("useStoryblokApi"), f), Ue = async (o, e = {}, t = {}) => {
907
+ const s = S(null);
908
+ if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links, D(() => {
909
+ s.value && s.value.id && we(
899
910
  s.value.id,
900
911
  (r) => s.value = r,
901
912
  t
902
913
  );
903
- }), m) {
904
- const { data: r } = await m.get(
914
+ }), f) {
915
+ const { data: r } = await f.get(
905
916
  `cdn/stories/${o}`,
906
917
  e
907
918
  );
@@ -909,24 +920,24 @@ const Pe = () => (m || A("useStoryblokApi"), m), Ee = async (o, e = {}, t = {})
909
920
  } else
910
921
  A("useStoryblok");
911
922
  return s;
912
- }, Ie = {
923
+ }, Ae = {
913
924
  install(o, e = {}) {
914
- o.directive("editable", je), o.component("StoryblokComponent", Te), e.enableFallbackComponent && !e.customFallbackComponent && o.component(
925
+ o.directive("editable", $e), o.component("StoryblokComponent", Ce), e.enableFallbackComponent && !e.customFallbackComponent && o.component(
915
926
  "FallbackComponent",
916
- H(() => import("./FallbackComponent-ddf2f161.mjs"))
927
+ F(() => import("./FallbackComponent-hOszcW1L.mjs"))
917
928
  );
918
- const { storyblokApi: t } = Re(e);
919
- m = t, o.provide("VueSDKOptions", e);
929
+ const { storyblokApi: t } = Se(e);
930
+ f = t, o.provide("VueSDKOptions", e);
920
931
  }
921
932
  };
922
933
  export {
923
- k as RichTextResolver,
934
+ v as RichTextResolver,
924
935
  ye as RichTextSchema,
925
- Te as StoryblokComponent,
926
- Ie as StoryblokVue,
936
+ Ce as StoryblokComponent,
937
+ Ae as StoryblokVue,
927
938
  xe as apiPlugin,
928
- Ce as renderRichText,
929
- Ee as useStoryblok,
930
- Pe as useStoryblokApi,
931
- $e as useStoryblokBridge
939
+ je as renderRichText,
940
+ Ue as useStoryblok,
941
+ Ie as useStoryblokApi,
942
+ we as useStoryblokBridge
932
943
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/vue",
3
- "version": "7.3.2",
3
+ "version": "8.0.1",
4
4
  "description": "Storyblok directive for get editable elements.",
5
5
  "main": "./dist/storyblok-vue.js",
6
6
  "module": "./dist/storyblok-vue.mjs",
@@ -25,26 +25,26 @@
25
25
  "prepublishOnly": "npm run build && cp ../README.md ./"
26
26
  },
27
27
  "dependencies": {
28
- "@storyblok/js": "^2.3.0"
28
+ "@storyblok/js": "^3.0.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@babel/core": "^7.23.3",
32
- "@cypress/vite-dev-server": "^5.0.6",
31
+ "@babel/core": "^7.23.6",
32
+ "@cypress/vite-dev-server": "^5.0.7",
33
33
  "@cypress/vue": "^6.0.0",
34
- "@vitejs/plugin-vue": "^4.5.0",
34
+ "@vitejs/plugin-vue": "^5.0.2",
35
35
  "@vue/babel-preset-app": "^5.0.8",
36
- "@vue/test-utils": "2.4.2",
36
+ "@vue/test-utils": "2.4.3",
37
37
  "@vue/tsconfig": "^0.1.3",
38
38
  "@vue/vue3-jest": "^29.2.6",
39
39
  "babel-jest": "^29.4.3",
40
40
  "cypress": "^13.5.1",
41
41
  "eslint-plugin-cypress": "^2.15.1",
42
- "eslint-plugin-jest": "^27.6.0",
42
+ "eslint-plugin-jest": "^27.6.1",
43
43
  "jest": "^29.6.4",
44
44
  "typescript": "^4.9.5",
45
- "vite": "^4.5.0",
45
+ "vite": "^5.0.10",
46
46
  "vue": "^3.3.4",
47
- "vue-tsc": "^1.8.22"
47
+ "vue-tsc": "^1.8.27"
48
48
  },
49
49
  "babel": {
50
50
  "presets": [
@@ -1,25 +0,0 @@
1
- import { defineComponent as _, openBlock as a, createElementBlock as p, createElementVNode as n, createTextVNode as c, toDisplayString as r } from "vue";
2
- const d = { class: "fallback-component" }, m = { class: "component" }, i = /* @__PURE__ */ _({
3
- __name: "FallbackComponent",
4
- props: {
5
- blok: {}
6
- },
7
- setup(o) {
8
- return (e, t) => (a(), p("div", d, [
9
- n("p", null, [
10
- c(" Component could not be found for blok "),
11
- n("span", m, r(e.blok.component), 1),
12
- c("! Is it configured correctly? ")
13
- ])
14
- ]));
15
- }
16
- });
17
- const u = (o, e) => {
18
- const t = o.__vccOpts || o;
19
- for (const [l, s] of e)
20
- t[l] = s;
21
- return t;
22
- }, k = /* @__PURE__ */ u(i, [["__scopeId", "data-v-93c770c0"]]);
23
- export {
24
- k as default
25
- };