@storyblok/astro 7.3.8 → 7.4.0-alpha.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/dist/components/StoryblokServerData.astro +29 -0
- package/dist/index.d.ts +3 -1
- package/dist/lib/helpers.d.ts +46 -0
- package/dist/lib/sanitizeJSON.d.ts +30 -0
- package/dist/live-preview/middleware.ts +6 -7
- package/dist/public.d.ts +8 -0
- package/dist/storyblok-astro.es.js +934 -607
- package/dist/storyblok-astro.umd.js +11 -11
- package/dist/utils/isEditorRequest.d.ts +41 -0
- package/package.json +4 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(S,K){typeof exports=="object"&&typeof module<"u"?K(exports):typeof define=="function"&&define.amd?define(["exports"],K):(S=typeof globalThis<"u"?globalThis:S||self,K(S.storyblokAstro={}))})(this,function(S){"use strict";const K=`
|
|
2
2
|
<svg class="logo-storyblok logo-storyblok--dark" role="img" aria-label="Storyblok Official Logo" viewBox="0 0 19 22" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M29.0287 14.9132C28.2686 14.9132 27.5302 14.8018 26.7918 14.5568C26.0988 14.3265 25.462 13.9468 24.924 13.4432L25.9013 11.7504C26.4443 12.1291 26.9655 12.4186 27.4867 12.6414C27.9862 12.8641 28.4858 12.9532 28.9636 12.9532C29.3111 12.9532 29.5934 12.8864 29.7888 12.7527C29.9843 12.6414 30.0712 12.4409 30.0712 12.1959C30.0712 11.9732 29.9626 11.7504 29.702 11.6168C29.2938 11.4162 28.8636 11.2666 28.4206 11.1714L26.9003 10.6591C26.4877 10.4809 26.1619 10.3027 25.9013 10.1023C25.6407 9.92408 25.4452 9.67908 25.3366 9.43408C25.2184 9.1529 25.1592 8.84935 25.1629 8.54317C25.1502 7.66646 25.5255 6.83107 26.1836 6.27136C26.4877 6.00408 26.8786 5.80363 27.313 5.64772C27.7473 5.49181 28.2251 5.42499 28.7247 5.42499C29.3979 5.42499 30.0277 5.51408 30.6141 5.69226C31.2005 5.89272 31.7652 6.22681 32.3081 6.71681L31.244 8.38726C30.8236 8.07881 30.3722 7.81747 29.8974 7.60772C29.4848 7.42954 29.1156 7.36272 28.7247 7.36272C28.4423 7.36272 28.1817 7.40726 27.9862 7.5409C27.7691 7.65226 27.6822 7.85272 27.6822 8.11999C27.6822 8.38726 27.7908 8.56545 28.008 8.69908C28.2251 8.83272 28.6595 8.96635 29.2459 9.12226C29.7903 9.26289 30.3268 9.4339 30.853 9.63454C31.2874 9.81272 31.6349 10.0132 31.9172 10.2136C32.4511 10.6169 32.7463 11.2726 32.6991 11.9509C32.6991 12.8641 32.3733 13.5768 31.7 14.1114C31.0485 14.6459 30.1798 14.9132 29.0287 14.9132ZM39.7792 14.2673C39.41 14.4232 38.9756 14.5791 38.4978 14.7127C38.02 14.8464 37.5422 14.9354 37.0427 14.9354C36.6952 14.9354 36.3911 14.8909 36.0871 14.8018C35.7915 14.7134 35.5176 14.5616 35.2835 14.3564C35.0663 14.1782 34.8926 13.9109 34.7623 13.6214C34.632 13.3095 34.5451 12.9309 34.5451 12.4854V7.69681H33.4158V5.60317H34.5668V2.68545H37.2599V5.5809H39.0842V7.69681H37.2599V11.5277C37.2599 11.8173 37.325 12.04 37.4771 12.1959C37.6291 12.3073 37.8245 12.3741 38.0417 12.3741C38.2589 12.3741 38.4761 12.3518 38.6715 12.2627C38.8887 12.1959 39.0842 12.1291 39.2362 12.04L39.7575 14.2673H39.7792ZM44.8612 14.9132C44.1701 14.9255 43.4835 14.7968 42.8414 14.5345C41.7112 14.076 40.8261 13.1439 40.409 11.9732C39.9823 10.8102 39.9823 9.52792 40.409 8.36499C40.8261 7.19423 41.7112 6.26214 42.8414 5.80363C43.4278 5.55863 44.1011 5.42499 44.8612 5.42499C46.1833 5.36117 47.4671 5.88947 48.3795 6.87272C48.7922 7.2959 49.0962 7.80817 49.3134 8.36499C49.758 9.5322 49.758 10.8282 49.3134 11.9954C48.8937 13.1518 48.0186 14.0734 46.9027 14.5345C46.2538 14.7998 45.5596 14.9285 44.8612 14.9132ZM42.9066 10.1914C42.9066 10.9041 43.0803 11.4832 43.4495 11.9064C43.8405 12.3518 44.3183 12.5745 44.8829 12.5745C45.4284 12.5853 45.9487 12.3391 46.2946 11.9064C46.4683 11.6836 46.5987 11.4609 46.7072 11.1491C46.8158 10.8595 46.8593 10.5254 46.8593 10.1914C46.8593 9.45636 46.6638 8.87726 46.2946 8.45408C45.9254 8.00863 45.4476 7.78589 44.8829 7.78589C44.3394 7.78464 43.8229 8.02909 43.4712 8.45408C43.2975 8.67681 43.1455 8.89954 43.0369 9.21136C42.939 9.52794 42.8949 9.85944 42.9066 10.1914ZM56.6541 7.98636C56.0026 7.98636 55.3945 8.09772 54.8515 8.32045C54.3736 8.48572 53.9666 8.81646 53.7005 9.2559V14.7573H50.9857V5.60317H53.4833V7.42954C53.7873 6.8059 54.1783 6.3159 54.6778 5.98181C55.1556 5.62545 55.6551 5.44726 56.1981 5.42499H56.4804L56.6541 5.44726V7.96408V7.98636ZM57.8486 16.1159C58.2263 16.2505 58.6217 16.3256 59.0214 16.3386C59.3472 16.3386 59.6078 16.2273 59.8033 16.0045C59.977 15.7818 60.129 15.3364 60.2811 14.7573L56.893 5.60317H59.6947L61.7579 12.3518L63.5605 5.60317H66.1015L62.6918 16.2273C62.1569 18.0318 60.3638 19.1157 58.5653 18.7218C58.3481 18.6773 58.0875 18.6104 57.8486 18.4991V16.1159ZM72.5301 14.9133C71.8568 14.9133 71.2487 14.7795 70.7492 14.4677C70.2417 14.1818 69.8208 13.758 69.533 13.2427V14.7573H67.1657V2.01727H69.9022V7.09545C70.4962 6.02938 71.6157 5.38681 72.8124 5.42499C73.3771 5.42499 73.8983 5.53636 74.3761 5.80363C74.8539 6.02636 75.2448 6.38272 75.614 6.8059C76.6831 8.32739 76.974 10.2831 76.3959 12.0623C76.1787 12.6414 75.8746 13.1536 75.5054 13.5768C74.7429 14.4342 73.6616 14.9198 72.5301 14.9133ZM71.7699 12.5745C72.6515 12.5764 73.4369 12.0037 73.7245 11.1491C74.043 10.2518 73.887 9.24956 73.3119 8.49863C72.9724 8.0401 72.4398 7.7753 71.8785 7.7859C71.4659 7.7859 71.0749 7.94181 70.7057 8.23136C70.3582 8.54317 70.0759 8.92181 69.8805 9.38954V11.305C70.2309 12.0628 70.9738 12.5476 71.7916 12.5523L71.7699 12.5745ZM78.0247 2.01727H80.7395V11.4832C80.7395 12.1959 81.0218 12.53 81.6082 12.53C81.9183 12.5309 82.2239 12.4545 82.4987 12.3073L82.8679 14.3786C82.1072 14.7203 81.2875 14.902 80.4572 14.9132C79.6753 14.9132 79.0672 14.6904 78.6546 14.2895C78.2202 13.8441 78.003 13.265 78.003 12.4632V2.01727H78.0247ZM87.9933 14.9132C87.3023 14.9255 86.6157 14.7968 85.9736 14.5345C84.8367 14.0789 83.9437 13.1469 83.5194 11.9732C82.8914 10.2226 83.2408 8.26037 84.4316 6.85045C84.8659 6.40499 85.3437 6.0709 85.9518 5.80363C86.5382 5.55863 87.2115 5.42499 87.9716 5.42499C89.2937 5.36117 90.5776 5.88947 91.49 6.87272C91.9243 7.2959 92.2066 7.80817 92.4238 8.36499C93.0767 10.1133 92.7249 12.0889 91.5117 13.4877C91.099 13.9332 90.5995 14.2895 89.9914 14.5345C89.3493 14.7968 88.6627 14.9255 87.9716 14.9132H87.9933ZM86.017 10.1914C86.017 10.9041 86.1907 11.4832 86.5599 11.9064C86.9509 12.3518 87.4287 12.5745 87.9933 12.5745C88.5382 12.5821 89.0571 12.3364 89.405 11.9064C89.5788 11.6836 89.7091 11.4609 89.8177 11.1491C89.9262 10.8595 89.9697 10.5254 89.9697 10.1914C89.9697 9.45636 89.7742 8.87726 89.405 8.45408C89.0358 8.00863 88.558 7.78589 87.9933 7.78589C87.4498 7.78464 86.9334 8.02909 86.5817 8.45408C86.4079 8.67681 86.2559 8.89954 86.1473 9.21136C86.0387 9.52317 86.017 9.83499 86.017 10.1914ZM100.112 14.7573L97.7882 11.06L96.8326 12.0845V14.7573H94.1178V2.01727H96.8326V9.38954L99.8514 5.60317H102.74L99.5256 9.54545L103.001 14.7573H100.112Z" fill="currentColor"></path>
|
|
4
4
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.71089C0 0.76599 0.76599 0 1.71089 0H17.1089C18.0538 0 18.8198 0.76599 18.8198 1.71089V17.1089C18.8198 18.0538 18.0538 18.8198 17.1089 18.8198H7.13145L4.57616 20.9297C4.24445 21.2036 3.74366 20.9676 3.74366 20.5375V18.8198H1.71089C0.76599 18.8198 0 18.0538 0 17.1089V1.71089ZM3.74233 3.10946H11.9675C13.7438 3.10946 15.1839 4.5495 15.1839 6.32587C15.1839 7.74936 14.2592 8.95687 12.9777 9.38045C14.4761 9.65447 15.6117 10.9667 15.6117 12.5443C15.6117 14.3207 14.1717 15.7607 12.3953 15.7607H3.74247V9.54229H3.74233V3.10946ZM10.583 6.00384H6.73607V7.93369H10.583C11.1159 7.93369 11.5479 7.50168 11.5479 6.96877C11.5479 6.43585 11.1159 6.00384 10.583 6.00384ZM6.73607 10.2925H10.9035C11.4956 10.2925 11.9757 10.7725 11.9757 11.3647C11.9757 11.9568 11.4956 12.4368 10.9035 12.4368H6.73607V10.2925Z" fill="currentColor"></path>
|
|
5
5
|
</svg>
|
|
6
|
-
`;function
|
|
6
|
+
`;function Je(e,t,r){const s="virtual:storyblok-init",n=`\0${s}`;return{name:"vite-plugin-storyblok-init",async resolveId(i){if(i===s)return n},async load(i){if(i===n)return`
|
|
7
7
|
import { storyblokInit, apiPlugin } from "@storyblok/astro";
|
|
8
8
|
const { storyblokApi } = storyblokInit({
|
|
9
9
|
accessToken: "${e}",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
apiOptions: ${JSON.stringify(r)},
|
|
12
12
|
});
|
|
13
13
|
export const storyblokApiInstance = storyblokApi;
|
|
14
|
-
`}}}function
|
|
14
|
+
`}}}function Ke(e){const t="virtual:storyblok-options",r=`\0${t}`;return{name:"vite-plugin-storyblok-options",async resolveId(s){if(s===t)return r},async load(s){if(s===r)return`export default ${JSON.stringify(e)}`}}}function We(){if(!(globalThis!=null&&globalThis.storyblokApiInstance))throw new Error("storyblokApiInstance has not been initialized correctly");return globalThis.storyblokApiInstance}async function Ye(e){let t=null;return e&&e.locals._storyblok_preview_data&&(t=e.locals._storyblok_preview_data.story||null),t}async function Ze({locals:e}){const{story:t,serverData:r}=e._storyblok_preview_data||{};return{story:t,serverData:r}}function Xe(e){return typeof e=="object"?`const storyblokInstance = new StoryblokBridge(${JSON.stringify(e)});`:"const storyblokInstance = new StoryblokBridge();"}function Qe(e){return e.endsWith(".astro")?e:`${e}.astro`}function he(e){return`/${e.trim().replace(/^\/+/,"").replace(/\/+$/,"").replace(/\/{2,}/g,"/")}`}const et=/[\p{Lu}]/u,tt=/[\p{Ll}]/u,we=/^[\p{Lu}](?![\p{Lu}])/gu,Ee=/([\p{Alpha}\p{N}_]|$)/u,fe=/[_.\- ]+/,rt=new RegExp("^"+fe.source),_e=new RegExp(fe.source+Ee.source,"gu"),Se=new RegExp("\\d+"+Ee.source,"gu"),st=(e,t,r,s)=>{let n=!1,i=!1,o=!1,l=!1;for(let a=0;a<e.length;a++){const h=e[a];l=a>2?e[a-3]==="-":!0,n&&et.test(h)?(e=e.slice(0,a)+"-"+e.slice(a),n=!1,o=i,i=!0,a++):i&&o&&tt.test(h)&&(!l||s)?(e=e.slice(0,a-1)+"-"+e.slice(a-1),o=i,i=!1,n=!0):(n=t(h)===h&&r(h)!==h,o=i,i=r(h)===h&&t(h)!==h)}return e},nt=(e,t)=>(we.lastIndex=0,e.replaceAll(we,r=>t(r))),it=(e,t)=>(_e.lastIndex=0,Se.lastIndex=0,e.replaceAll(Se,(r,s,n)=>["_","-"].includes(e.charAt(n+r.length))?r:t(r)).replaceAll(_e,(r,s)=>t(s)));function ot(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(i=>i.trim()).filter(i=>i.length).join("-"):e=e.trim(),e.length===0)return"";const r=t.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(t.locale),s=t.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(t.locale);return e.length===1?fe.test(e)?"":t.pascalCase?s(e):r(e):(e!==r(e)&&(e=st(e,r,s,t.preserveConsecutiveUppercase)),e=e.replace(rt,""),e=t.preserveConsecutiveUppercase?nt(e,r):r(e),t.pascalCase&&(e=s(e.charAt(0))+e.slice(1)),it(e,s))}function Le(e){return ot(e)}function at(e,t,r,s){const n="virtual:import-storyblok-components",i=`\0${n}`;return{name:"vite-plugin-import-storyblok-components",async resolveId(o){if(o===n)return i},async load(o){if(o!==i)return;const l=await ct(this,t,r,s),a=await ut(this,e,t,r);return lt(t,l,a)}}}function lt(e,t,r){const n=`${he(e)}/storyblok/**/*.astro`;return`
|
|
15
15
|
// Import utilities and fallback component
|
|
16
16
|
import { toCamelCase } from '@storyblok/astro';
|
|
17
17
|
${t}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
`)}
|
|
20
20
|
|
|
21
21
|
// Dynamically import all Storyblok components using Vite's glob import
|
|
22
|
-
const modules = import.meta.glob('${
|
|
22
|
+
const modules = import.meta.glob('${n}', { eager: true });
|
|
23
23
|
// Process imported modules into a components object
|
|
24
24
|
const storyblokComponents = {};
|
|
25
25
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// Manual imports (overwrite auto if same key exists)
|
|
42
|
-
${r.map(
|
|
42
|
+
${r.map(i=>{var l;const o=(l=i.match(/import\s+(\w+)\s+from/))==null?void 0:l[1];return`storyblokComponents['${o}'] = ${o};`}).join(`
|
|
43
43
|
`)}
|
|
44
44
|
|
|
45
45
|
// Add fallback component if enabled
|
|
@@ -47,23 +47,23 @@
|
|
|
47
47
|
|
|
48
48
|
// Export the components object for use in Storyblok initialization
|
|
49
49
|
export { storyblokComponents };
|
|
50
|
-
`.trim()}async function
|
|
50
|
+
`.trim()}async function ct(e,t,r,s){if(!r)return"";if(s){const n=Re(t,s);if(!await e.resolve(n))throw new Error(`Custom fallback component could not be found. Does "${n}" exist?`);return`import FallbackComponent from '${n}';`}return"import FallbackComponent from '@storyblok/astro/FallbackComponent.astro';"}async function ut(e,t,r,s){const n=[];for await(const[i,o]of Object.entries(t)){const l=Re(r,o),a=await e.resolve(l);if(a)n.push(`import ${Le(i)} from "${a.id}"`);else if(!s)throw new Error(`Component could not be found for blok "${i}"! Does "${l}" exist?`)}return n}function Re(e,t){const s=`${he(e)}${he(t)}`;return Qe(s)}function dt(e){const t={useCustomApi:!1,bridge:!0,componentsDir:"src",enableFallbackComponent:!1,livePreview:!1,...e},{accessToken:r,useCustomApi:s,apiOptions:n,componentsDir:i,customFallbackComponent:o,enableFallbackComponent:l,components:a,bridge:h,livePreview:g}=t,p=Xe(t.bridge);return{name:"@storyblok/astro",hooks:{"astro:config:setup":({injectScript:w,updateConfig:$,addDevToolbarApp:E,addMiddleware:O,config:j})=>{if($({vite:{plugins:[Je(r,s,n),at(a||{},i,l,o),Ke(t)]}}),g&&(j==null?void 0:j.output)!=="server")throw new Error("To utilize the Astro Storyblok Live feature, Astro must be configured to run in SSR mode. Please disable this feature or switch Astro to SSR mode.");w("page-ssr",`
|
|
51
51
|
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
52
52
|
globalThis.storyblokApiInstance = storyblokApiInstance;
|
|
53
|
-
`),
|
|
53
|
+
`),h&&!g&&w("page",`import { loadStoryblokBridge } from "@storyblok/astro";
|
|
54
54
|
loadStoryblokBridge().then(() => {
|
|
55
55
|
const { StoryblokBridge, location } = window;
|
|
56
|
-
${
|
|
56
|
+
${p}
|
|
57
57
|
storyblokInstance.on(["published", "change"], (event) => {
|
|
58
58
|
if (!event.slugChanged) {
|
|
59
59
|
location.reload(true);
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
-
`),g&&(
|
|
63
|
+
`),g&&(w("page",`import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
|
|
64
64
|
loadStoryblokBridge().then(() => {
|
|
65
65
|
const { StoryblokBridge, location } = window;
|
|
66
|
-
${
|
|
66
|
+
${p}
|
|
67
67
|
storyblokInstance.on(["published", "change", "input"], handleStoryblokMessage);
|
|
68
68
|
});
|
|
69
|
-
`),_({entrypoint:"@storyblok/astro/middleware.ts",order:"pre"})),w({id:"storyblok",name:"Storyblok",icon:$,entrypoint:"@storyblok/astro/toolbarApp.ts"})}}}}let te;async function Oe(e){const{action:t,story:r}=e||{};if(t==="input"&&r){const s=async()=>{re("storyblok-live-preview-updating",{story:r});const n=await Pe(r),a=document.body;if(n.outerHTML===a.outerHTML)return;const l=document.querySelector('[data-blok-focused="true"]');Me(a,n,l),re("storyblok-live-preview-updated",{story:r})};clearTimeout(te),te=setTimeout(s,500)}["published","change"].includes(e==null?void 0:e.action)&&location.reload()}function Me(e,t,r){if(r){const s=r.getAttribute("data-blok-uid"),o=t.querySelector(`[data-blok-uid="${s}"]`);o&&(o.setAttribute("data-blok-focused","true"),r.replaceWith(o))}else e.replaceWith(t)}async function Pe(e){const r=await(await fetch(location.href,{method:"POST",body:JSON.stringify({...e,is_storyblok_preview:!0}),headers:{"Content-Type":"application/json"}})).text();return new DOMParser().parseFromString(r,"text/html").body}function re(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))}var xe=Object.defineProperty,He=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t,r)=>He(e,typeof t!="symbol"?t+"":t,r);let k=function(e){return e.DOCUMENT="doc",e.HEADING="heading",e.PARAGRAPH="paragraph",e.QUOTE="blockquote",e.OL_LIST="ordered_list",e.UL_LIST="bullet_list",e.LIST_ITEM="list_item",e.CODE_BLOCK="code_block",e.HR="horizontal_rule",e.BR="hard_break",e.IMAGE="image",e.EMOJI="emoji",e.COMPONENT="blok",e.TABLE="table",e.TABLE_ROW="tableRow",e.TABLE_CELL="tableCell",e.TABLE_HEADER="tableHeader",e}({}),E=function(e){return e.BOLD="bold",e.STRONG="strong",e.STRIKE="strike",e.UNDERLINE="underline",e.ITALIC="italic",e.CODE="code",e.LINK="link",e.ANCHOR="anchor",e.STYLED="styled",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.TEXT_STYLE="textStyle",e.HIGHLIGHT="highlight",e}({}),Ne=function(e){return e.TEXT="text",e}({}),x=function(e){return e.URL="url",e.STORY="story",e.ASSET="asset",e.EMAIL="email",e}({});const je=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],De=(e={})=>{const{custom:t,...r}=e,s={...r,...t};return Object.keys(s).map(o=>`${o}="${s[o]}"`).join(" ")},Ue=(e={})=>Object.keys(e).map(t=>`${t}: ${e[t]}`).join("; ");function Ve(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const I=e=>Object.fromEntries(Object.entries(e).filter(([t,r])=>r!==void 0));function Be(e,t){if(!t)return{src:e,attrs:{}};let r=0,s=0;const o={},n=[];function a(c,u,g,d,C){typeof c!="number"||c<=u||c>=g?console.warn(`[StoryblokRichText] - ${d.charAt(0).toUpperCase()+d.slice(1)} value must be a number between ${u} and ${g} (inclusive)`):C.push(`${d}(${c})`)}if(typeof t=="object"){if(t.width!==void 0&&(typeof t.width=="number"&&t.width>=0?(o.width=t.width,r=t.width):console.warn("[StoryblokRichText] - Width value must be a number greater than or equal to 0")),t.height!==void 0&&(typeof t.height=="number"&&t.height>=0?(o.height=t.height,s=t.height):console.warn("[StoryblokRichText] - Height value must be a number greater than or equal to 0")),t.height===0&&t.width===0&&(delete o.width,delete o.height,console.warn("[StoryblokRichText] - Width and height values cannot both be 0")),t.loading&&["lazy","eager"].includes(t.loading)&&(o.loading=t.loading),t.class&&(o.class=t.class),t.filters){const{filters:c}=t||{},{blur:u,brightness:g,fill:d,format:C,grayscale:T,quality:w,rotate:_}=c||{};u&&a(u,0,100,"blur",n),w&&a(w,0,100,"quality",n),g&&a(g,0,100,"brightness",n),d&&n.push(`fill(${d})`),T&&n.push("grayscale()"),_&&[0,90,180,270].includes(t.filters.rotate||0)&&n.push(`rotate(${_})`),C&&["webp","png","jpeg"].includes(C)&&n.push(`format(${C})`)}t.srcset&&(o.srcset=t.srcset.map(c=>{if(typeof c=="number")return`${e}/m/${c}x0/${n.length>0?`filters:${n.join(":")}`:""} ${c}w`;if(Array.isArray(c)&&c.length===2){const[u,g]=c;return`${e}/m/${u}x${g}/${n.length>0?`filters:${n.join(":")}`:""} ${u}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),t.sizes&&(o.sizes=t.sizes.join(", "))}let l=`${e}/m/`;return(r>0||s>0)&&(l=`${l}${r}x${s}/`),n.length>0&&(l=`${l}filters:${n.join(":")}`),{src:l,attrs:o}}function se(e,t={},r){const s=De(t),o=s?`${e} ${s}`:e,n=Array.isArray(r)?r.join(""):r||"";if(e){if(je.includes(e))return`<${o}>`}else return n;return`<${o}>${n}</${e}>`}function oe(e={}){const t=new Map,{renderFn:r=se,textFn:s=Ve,resolvers:o={},optimizeImages:n=!1,keyedResolvers:a=!1}=e,l=r!==se,c=(i={})=>{const{textAlign:h,class:p,id:f,style:y,...v}=i,b=[];return y&&b.push(y.endsWith(";")?y:`${y};`),h&&b.push(`text-align: ${h};`),I({...v,class:p,id:f,...b.length>0?{style:b.join(" ")}:{}})},u=i=>(h,p)=>{const f=c(h.attrs);return p.render(i,f,h.children||null)},g=(i,h)=>{const{src:p,alt:f,title:y,srcset:v,sizes:b}=i.attrs||{};let R=p,A={};if(n){const{src:vt,attrs:kt}=Be(p,n);R=vt,A=kt}const P={src:R,alt:f,title:y,srcset:v,sizes:b,...A};return h.render("img",I(P))},d=(i,h)=>{const{level:p,...f}=i.attrs||{},y=c(f);return h.render(`h${p}`,y,i.children)},C=(i,h)=>{var p,f,y,v;const b=h.render("img",{src:(p=i.attrs)==null?void 0:p.fallbackImage,alt:(f=i.attrs)==null?void 0:f.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return h.render("span",{"data-type":"emoji","data-name":(y=i.attrs)==null?void 0:y.name,"data-emoji":(v=i.attrs)==null?void 0:v.emoji},b)},T=(i,h)=>h.render("pre",i.attrs||{},h.render("code",{},i.children||"")),w=(i,h=!1)=>({text:p,attrs:f},y)=>{const{class:v,id:b,...R}=f||{},A=h?{class:v,id:b,style:Ue(R)||void 0}:f||{};return y.render(i,I(A),p)},_=i=>J(i),M=i=>{const{marks:h,...p}=i;if("text"in i){if(h)return h.reduce((y,v)=>_({...v,text:y}),_({...p,children:p.children}));const f=i.attrs||{};if(a){const y=t.get("txt")||0;t.set("txt",y+1),f.key=`txt-${y}`}return s(p.text,f)}return""},he=(i,h)=>{const{linktype:p,href:f,anchor:y,...v}=i.attrs||{};let b="";switch(p){case x.ASSET:case x.URL:b=f;break;case x.EMAIL:b=`mailto:${f}`;break;case x.STORY:b=f,y&&(b=`${b}#${y}`);break;default:b=f;break}const R={...v};return b&&(R.href=b),h.render("a",R,i.text)},ft=(i,h)=>{var p,f;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),h.render("span",{blok:(p=i==null?void 0:i.attrs)==null?void 0:p.body[0],id:(f=i.attrs)==null?void 0:f.id,style:"display: none"})},mt=(i,h)=>{const p=c(i.attrs),f=i.children||null;return h.render("table",p,h.render("tbody",{},f))},yt=(i,h)=>{const p=c(i.attrs);return h.render("tr",p,i.children)},gt=(i,h)=>{const{colspan:p,rowspan:f,colwidth:y,backgroundColor:v,textAlign:b,...R}=i.attrs||{},A=[];y&&A.push(`width: ${y}px;`),v&&A.push(`background-color: ${v};`),b&&A.push(`text-align: ${b};`);const P={...R,...p>1?{colspan:p}:{},...f>1?{rowspan:f}:{},...A.length>0?{style:A.join(" ")}:{}};return h.render("td",I(P),i.children)},bt=(i,h)=>{const{colspan:p,rowspan:f,colwidth:y,backgroundColor:v,textAlign:b,...R}=i.attrs||{},A=[];y&&A.push(`width: ${y}px;`),v&&A.push(`background-color: ${v};`),b&&A.push(`text-align: ${b};`);const P={...R,...p>1?{colspan:p}:{},...f>1?{rowspan:f}:{},...A.length>0?{style:A.join(" ")}:{}};return h.render("th",I(P),i.children)},de=new Map([[k.DOCUMENT,u("")],[k.HEADING,d],[k.PARAGRAPH,u("p")],[k.UL_LIST,u("ul")],[k.OL_LIST,u("ol")],[k.LIST_ITEM,u("li")],[k.IMAGE,g],[k.EMOJI,C],[k.CODE_BLOCK,T],[k.HR,u("hr")],[k.BR,u("br")],[k.QUOTE,u("blockquote")],[k.COMPONENT,ft],[Ne.TEXT,M],[E.LINK,he],[E.ANCHOR,he],[E.STYLED,w("span",!0)],[E.BOLD,w("strong")],[E.TEXT_STYLE,w("span",!0)],[E.ITALIC,w("em")],[E.UNDERLINE,w("u")],[E.STRIKE,w("s")],[E.CODE,w("code")],[E.SUPERSCRIPT,w("sup")],[E.SUBSCRIPT,w("sub")],[E.HIGHLIGHT,w("mark")],[k.TABLE,mt],[k.TABLE_ROW,yt],[k.TABLE_CELL,gt],[k.TABLE_HEADER,bt]]),pe=new Map([...de,...Object.entries(o).map(([i,h])=>[i,h])]),Ct=()=>({render:(i,h={},p)=>{if(a&&i){const f=t.get(i)||0;t.set(i,f+1),h.key=`${i}-${f}`}return r(i,h,p)},originalResolvers:de,mergedResolvers:pe});function D(i){const h=pe.get(i.type);if(!h)return console.error("<Storyblok>",`No resolver found for node type ${i.type}`),"";const p=Ct();if(i.type==="text")return h(i,p);const f=i.content?i.content.map(J):void 0;return h({...i,children:f},p)}function J(i){return i.type==="doc"?l?i.content.map(D):i.content.map(D).join(""):Array.isArray(i)?i.map(D):D(i)}return{render:J}}let ne=!1;const ie=[],ae=e=>new Promise((t,r)=>{if(typeof window>"u"){r(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=o=>{if(!window.location.search.includes("_storyblok")){console.warn("You are not in Draft Mode or in the Visual Editor.");return}ne?o():ie.push(o)},document.getElementById("storyblok-javascript-bridge")){t(void 0);return}const s=document.createElement("script");s.async=!0,s.src=e,s.id="storyblok-javascript-bridge",s.onerror=o=>r(o),s.onload=o=>{ie.forEach(n=>n()),ne=!0,t(o)},document.getElementsByTagName("head")[0].appendChild(s)}),B=(e="")=>e.includes("/cdn/"),qe=(e,t=25,r=1)=>({...e,per_page:t,page:r}),Fe=e=>new Promise(t=>setTimeout(t,e)),Ge=(e=0,t)=>Array.from({length:e},t),ze=(e=0,t=e)=>{const r=Math.abs(t-e)||0,s=e<t?1:-1;return Ge(r,(o,n)=>n*s+e)},Ze=async(e,t)=>Promise.all(e.map(t)),Je=(e=[],t)=>e.map(t).reduce((r,s)=>[...r,...s],[]),q=(e,t,r)=>{const s=[];for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const n=e[o];if(n==null)continue;const a=r?"":encodeURIComponent(o);let l;typeof n=="object"?l=q(n,t?t+encodeURIComponent(`[${a}]`):a,Array.isArray(n)):l=`${t?t+encodeURIComponent(`[${a}]`):a}=${encodeURIComponent(n)}`,s.push(l)}return s.join("&")},le=e=>{const t={eu:"api.storyblok.com",us:"api-us.storyblok.com",cn:"app.storyblokchina.cn",ap:"api-ap.storyblok.com",ca:"api-ca.storyblok.com"};return t[e]??t.eu};var We=class{constructor(e){m(this,"baseURL"),m(this,"timeout"),m(this,"headers"),m(this,"responseInterceptor"),m(this,"fetch"),m(this,"ejectInterceptor"),m(this,"url"),m(this,"parameters"),m(this,"fetchOptions"),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={},this.fetchOptions={}}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=[],r={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(s=>{r.data=s});for(const s of e.headers.entries())t[s[0]]=s[1];return r.headers={...t},r.status=e.status,r.statusText=e.statusText,r}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,r=null;e==="get"?t=`${this.baseURL}${this.url}?${q(this.parameters)}`:r=JSON.stringify(this.parameters);const s=new URL(t),o=new AbortController,{signal:n}=o;let a=null;this.timeout&&(a=setTimeout(()=>o.abort(),this.timeout));try{const l=await this.fetch(`${s}`,{method:e,headers:this.headers,body:r,signal:n,...this.fetchOptions});this.timeout&&a&&clearTimeout(a);const c=await this._responseHandler(l);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(c)):this._statusHandler(c)}catch(l){return l.name==="AbortError"?{message:"Request timeout: The request was aborted due to timeout"}:{message:l.message||l.toString()||"An unknown error occurred"}}}setFetchOptions(e={}){Object.keys(e).length>0&&"method"in e&&delete e.method,this.fetchOptions={...e}}eject(){this.ejectInterceptor=!0}_normalizeErrorMessage(e){if(Array.isArray(e))return e[0]||"Unknown error";if(e&&typeof e=="object"){if(e.error)return e.error;for(const t in e){if(Array.isArray(e[t]))return`${t}: ${e[t][0]}`;if(typeof e[t]=="string")return`${t}: ${e[t]}`}if(e.slug)return e.slug}return"Unknown error"}_statusHandler(e){const t=/20[0-6]/g;return new Promise((r,s)=>{if(t.test(`${e.status}`))return r(e);const o={message:this._normalizeErrorMessage(e.data),status:e.status,response:e};s(o)})}},Ye=We;const ce="SB-Agent",F={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:"7.0.0"},ue={DRAFT:"draft",PUBLISHED:"published"},Ke=25,G={SMALL:25,MEDIUM:50,LARGE:75},O={SINGLE_OR_SMALL:50,MEDIUM:15,LARGE:10,VERY_LARGE:6},z=1e3,H=3;function Xe(e){return e.version===ue.DRAFT}function Qe(e,t){const r=e.includes("/cdn/stories/"),s=e.split("/").length>3&&!e.endsWith("/cdn/stories"),o="find_by"in t;return r&&s||o}function et(e){return e<=G.SMALL?O.SINGLE_OR_SMALL:e<=G.MEDIUM?O.MEDIUM:e<=G.LARGE?O.LARGE:O.VERY_LARGE}function N(e,t,r={},s){if(r.userRateLimit!==void 0)return Math.min(r.userRateLimit,z);if(r.serverHeadersRateLimit!==void 0)return Math.min(r.serverHeadersRateLimit,z);if(s!==void 0)return s;if(t&&!Xe(t))return z;if(Qe(e,t))return O.SINGLE_OR_SMALL;const o=t.per_page||Ke;return et(o)}function tt(e){if(!e)return null;const t=e["x-ratelimit"]||e["X-RateLimit"],r=e["x-ratelimit-policy"]||e["X-RateLimit-Policy"];if(!t&&!r)return null;const s={};if(t){const o=t.match(/r=(\d+)/);o&&(s.remaining=Number.parseInt(o[1],10))}if(r){const o=r.match(/q=(\d+)/);o&&(s.max=Number.parseInt(o[1],10))}return Object.keys(s).length>0?s:null}function rt(e,t=!1){return{userRateLimit:e,serverHeadersRateLimit:void 0,isManagementApi:t}}var st=class extends Error{constructor(e){super(e),this.name="AbortError"}};function ot(e,t,r){if(!Number.isFinite(t))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(r))throw new TypeError("Expected `interval` to be a finite number");const s=[];let o=[],n=0,a=!1;const l=async()=>{n++;const u=s.shift();if(u)try{const d=await e(...u.args);u.resolve(d)}catch(d){u.reject(d)}const g=setTimeout(()=>{n--,s.length>0&&l(),o=o.filter(d=>d!==g)},r);o.includes(g)||o.push(g)},c=(...u)=>a?Promise.reject(new Error("Throttled function is already aborted and not accepting new promises")):new Promise((g,d)=>{s.push({resolve:g,reject:d,args:u}),n<t&&l()});return c.abort=()=>{a=!0,o.forEach(clearTimeout),o=[],s.forEach(u=>u.reject(()=>new st("Throttle function aborted"))),s.length=0},c}var nt=ot,it=class{constructor(e,t=1e3){m(this,"queues"),m(this,"interval"),m(this,"throttledRequestFn"),this.queues=new Map,this.interval=t,this.throttledRequestFn=e}getQueue(e){let t=this.queues.get(e);return t||(t=nt(this.throttledRequestFn,e,this.interval),this.queues.set(e,t)),t}execute(e,...t){return this.getQueue(e)(...t)}abortAll(){this.queues.forEach(e=>{var t;(t=e.abort)==null||t.call(e)}),this.queues.clear()}getQueueCount(){return this.queues.size}};let j={};const S={};var at=class{constructor(e,t){m(this,"client"),m(this,"maxRetries"),m(this,"retriesDelay"),m(this,"throttleManager"),m(this,"accessToken"),m(this,"cache"),m(this,"resolveCounter"),m(this,"relations"),m(this,"links"),m(this,"version"),m(this,"rateLimitConfig"),m(this,"richTextResolver"),m(this,"resolveNestedRelations"),m(this,"stringifiedStoriesCache"),m(this,"inlineAssets");let r=e.endpoint||t;if(!r){const o=e.https===!1?"http":"https";e.oauthToken?r=`${o}://${le(e.region)}/v1`:r=`${o}://${le(e.region)}/v2`}const s=new Headers;s.set("Content-Type","application/json"),s.set("Accept","application/json"),e.headers&&(e.headers.constructor.name==="Headers"?e.headers.entries().toArray():Object.entries(e.headers)).forEach(([o,n])=>{s.set(o,n)}),s.has(ce)||(s.set(ce,F.defaultAgentName),s.set(F.defaultAgentVersion,F.packageVersion)),e.oauthToken&&s.set("Authorization",e.oauthToken),this.rateLimitConfig=rt(e.rateLimit,!!e.oauthToken),this.maxRetries=e.maxRetries||10,this.retriesDelay=300,this.throttleManager=new it(this.throttledRequest.bind(this),1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.stringifiedStoriesCache={},this.version=e.version||ue.PUBLISHED,this.inlineAssets=e.inlineAssets||!1,this.client=new Ye({baseURL:r,timeout:e.timeout||0,headers:s,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}parseParams(e){return e.token||(e.token=this.getToken()),e.cv||(e.cv=S[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),typeof e.resolve_relations<"u"&&(e.resolve_level=2),e}factoryParamOptions(e,t){return B(e)?this.parseParams(t):t}makeRequest(e,t,r,s,o){const n=this.factoryParamOptions(e,qe(t,r,s));return this.cacheResponse(e,n,void 0,o)}get(e,t={},r){t||(t={});const s=`/${e}`;B(s)&&(t.version=t.version||this.version);const o=this.factoryParamOptions(s,t);return this.cacheResponse(s,o,void 0,r)}async getAll(e,t={},r,s){const o=(t==null?void 0:t.per_page)||25,n=`/${e}`.replace(/\/$/,""),a=r??n.substring(n.lastIndexOf("/")+1);t.version=t.version||this.version;const l=1,c=await this.makeRequest(n,t,o,l,s),u=c.total?Math.ceil(c.total/(c.perPage||o)):1,g=await Ze(ze(l,u),d=>this.makeRequest(n,t,o,d+1,s));return Je([c,...g],d=>Object.values(d.data[a]))}post(e,t={},r){const s=`/${e}`,o=N(void 0,void 0,this.rateLimitConfig,H);return this.throttleManager.execute(o,"post",s,t,r)}put(e,t={},r){const s=`/${e}`,o=N(void 0,void 0,this.rateLimitConfig,H);return this.throttleManager.execute(o,"put",s,t,r)}delete(e,t={},r){t||(t={});const s=`/${e}`,o=N(void 0,void 0,this.rateLimitConfig,H);return this.throttleManager.execute(o,"delete",s,t,r)}getStories(e={},t){return this._addResolveLevel(e),this.get("cdn/stories",e,t)}getStory(e,t={},r){return this._addResolveLevel(t),this.get(`cdn/stories/${e}`,t,r)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_addResolveLevel(e){typeof e.resolve_relations<"u"&&(e.resolve_level=2)}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,r){const s=e[t];s&&s.fieldtype==="multilink"&&s.linktype==="story"&&typeof s.id=="string"&&this.links[r][s.id]?s.story=this._cleanCopy(this.links[r][s.id]):s&&s.linktype==="story"&&typeof s.uuid=="string"&&this.links[r][s.uuid]&&(s.story=this._cleanCopy(this.links[r][s.uuid]))}getStoryReference(e,t){return this.relations[e][t]?JSON.parse(this.stringifiedStoriesCache[t]||JSON.stringify(this.relations[e][t])):t}_resolveField(e,t,r){const s=e[t];typeof s=="string"?e[t]=this.getStoryReference(r,s):Array.isArray(s)&&(e[t]=s.map(o=>this.getStoryReference(r,o)).filter(Boolean))}_insertRelations(e,t,r,s){if(Array.isArray(r)?r.find(n=>n.endsWith(`.${t}`)):r.endsWith(`.${t}`)){this._resolveField(e,t,s);return}const o=e.component?`${e.component}.${t}`:t;(Array.isArray(r)?r.includes(o):r===o)&&this._resolveField(e,t,s)}iterateTree(e,t,r){const s=(o,n="")=>{if(!(!o||o._stopResolving)){if(Array.isArray(o))o.forEach((a,l)=>s(a,`${n}[${l}]`));else if(typeof o=="object")for(const a in o){const l=n?`${n}.${a}`:a;(o.component&&o._uid||o.type==="link")&&(this._insertRelations(o,a,t,r),this._insertLinks(o,a,r)),s(o[a],l)}}};s(e.content)}async resolveLinks(e,t,r){let s=[];if(e.link_uuids){const o=e.link_uuids.length,n=[],a=50;for(let l=0;l<o;l+=a){const c=Math.min(o,l+a);n.push(e.link_uuids.slice(l,c))}for(let l=0;l<n.length;l++)(await this.getStories({per_page:a,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:n[l].join(",")})).data.stories.forEach(c=>{s.push(c)})}else s=e.links;s.forEach(o=>{this.links[r][o.uuid]={...o,_stopResolving:!0}})}async resolveRelations(e,t,r){let s=[];if(e.rel_uuids){const o=e.rel_uuids.length,n=[],a=50;for(let l=0;l<o;l+=a){const c=Math.min(o,l+a);n.push(e.rel_uuids.slice(l,c))}for(let l=0;l<n.length;l++)(await this.getStories({per_page:a,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:n[l].join(","),excluding_fields:t.excluding_fields})).data.stories.forEach(c=>{s.push(c)});s.length>0&&(e.rels=s,delete e.rel_uuids)}else s=e.rels;s&&s.length>0&&s.forEach(o=>{this.relations[r][o.uuid]={...o,_stopResolving:!0}})}async resolveStories(e,t,r){var s,o;let n=[];if(this.links[r]={},this.relations[r]={},typeof t.resolve_relations<"u"&&t.resolve_relations.length>0&&(typeof t.resolve_relations=="string"&&(n=t.resolve_relations.split(",")),await this.resolveRelations(e,t,r)),t.resolve_links&&["1","story","url","link"].includes(t.resolve_links)&&((s=e.links)!=null&&s.length||(o=e.link_uuids)!=null&&o.length)&&await this.resolveLinks(e,t,r),this.resolveNestedRelations)for(const a in this.relations[r])this.iterateTree(this.relations[r][a],n,r);e.story?this.iterateTree(e.story,n,r):e.stories.forEach(a=>{this.iterateTree(a,n,r)}),this.stringifiedStoriesCache={},delete this.links[r],delete this.relations[r]}async cacheResponse(e,t,r,s){const o=q({url:e,params:t}),n=this.cacheProvider();if(t.version==="published"&&e!=="/cdn/spaces/me"){const c=await n.get(o);if(c)return Promise.resolve(c)}const a=!B(e)&&this.rateLimitConfig.isManagementApi?H:void 0,l=N(e,t,this.rateLimitConfig,a);return new Promise(async(c,u)=>{var g;try{const d=await this.throttleManager.execute(l,"get",e,t,s);if(d.status!==200)return u(d);let C={data:d.data,headers:d.headers};const T=tt(d.headers);if((T==null?void 0:T.max)!==void 0&&(this.rateLimitConfig.serverHeadersRateLimit=T.max),(g=d.headers)!=null&&g["per-page"]&&(C=Object.assign({},C,{perPage:d.headers["per-page"]?Number.parseInt(d.headers["per-page"]):0,total:d.headers["per-page"]?Number.parseInt(d.headers.total):0})),C.data.story||C.data.stories){const _=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(C.data,t,`${_}`),C=await this.processInlineAssets(C)}t.version==="published"&&e!=="/cdn/spaces/me"&&await n.set(o,C);const w=this.cache.clear==="onpreview"&&t.version==="draft"||this.cache.clear==="auto";return t.token&&C.data.cv&&(w&&S[t.token]&&S[t.token]!==C.data.cv&&await this.flushCache(),S[t.token]=C.data.cv),c(C)}catch(d){if(d.response&&d.status===429&&(r=typeof r>"u"?0:r+1,r<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${this.retriesDelay/1e3} seconds.`),await Fe(this.retriesDelay),this.cacheResponse(e,t,r).then(c).catch(u);u(d)}})}throttledRequest(e,t,r,s){return this.client.setFetchOptions(s),this.client[e](t,r)}cacheVersions(){return S}cacheVersion(){return S[this.accessToken]}setCacheVersion(e){this.accessToken&&(S[this.accessToken]=e)}clearCacheVersion(){this.accessToken&&(S[this.accessToken]=0)}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(j[e])},getAll(){return Promise.resolve(j)},set(e,t){return j[e]=t,Promise.resolve(void 0)},flush(){return j={},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.clearCacheVersion(),this}async processInlineAssets(e){if(!this.inlineAssets)return e;const t=r=>{if(!r||typeof r!="object")return r;if(Array.isArray(r))return r.map(o=>t(o));let s={...r};s.fieldtype==="asset"&&Array.isArray(e.data.assets)&&(s={...e.data.assets.find(o=>o.id===s.id),...s});for(const o in s)typeof s[o]=="object"&&(s[o]=t(s[o]));return s};return e.data.story&&(e.data.story.content=t(e.data.story.content)),e.data.stories&&(e.data.stories=e.data.stories.map(r=>(r.content=t(r.content),r))),e}},lt=at;const ct=(e={})=>{const{apiOptions:t}=e;if(!t||!t.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 lt(t)}},ut=e=>{if(typeof e!="object"||typeof e._editable>"u")return{};try{const t=JSON.parse(e._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return t?{"data-blok-c":JSON.stringify(t),"data-blok-uid":`${t.id}-${t.uid}`}:{}}catch{return{}}};let Z="https://app.storyblok.com/f/storyblok-v2-latest.js";const ht=(e={})=>{var t,r;const{bridge:s,accessToken:o,use:n=[],apiOptions:a={},bridgeUrl:l}=e;a.accessToken=a.accessToken||o;const c={bridge:s,apiOptions:a};let u={};n.forEach(d=>{u={...u,...d(c)}}),l&&(Z=l);const g=!(typeof window>"u")&&((r=(t=window.location)==null?void 0:t.search)==null?void 0:r.includes("_storyblok_tk"));return s!==!1&&g&&ae(Z),u};function dt(e,t){return oe(t).render(e)}const pt=()=>ae(Z);L.apiPlugin=ct,L.getLiveStory=ge,L.handleStoryblokMessage=Oe,L.loadStoryblokBridge=pt,L.renderRichText=dt,L.richTextResolver=oe,L.storyblok=Ie,L.storyblokEditable=ut,L.storyblokInit=ht,L.toCamelCase=Q,L.useStoryblokApi=ye,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
|
69
|
+
`),O({entrypoint:"@storyblok/astro/middleware.ts",order:"pre"})),E({id:"storyblok",name:"Storyblok",icon:K,entrypoint:"@storyblok/astro/toolbarApp.ts"})}}}}function ht(e){const t=JSON.stringify(e);return t===void 0?"null":t.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/&/g,"\\u0026")}var Ie=11;function ft(e,t){var r=t.attributes,s,n,i,o,l;if(!(t.nodeType===Ie||e.nodeType===Ie)){for(var a=r.length-1;a>=0;a--)s=r[a],n=s.name,i=s.namespaceURI,o=s.value,i?(n=s.localName||n,l=e.getAttributeNS(i,n),l!==o&&(s.prefix==="xmlns"&&(n=s.name),e.setAttributeNS(i,n,o))):(l=e.getAttribute(n),l!==o&&e.setAttribute(n,o));for(var h=e.attributes,g=h.length-1;g>=0;g--)s=h[g],n=s.name,i=s.namespaceURI,i?(n=s.localName||n,t.hasAttributeNS(i,n)||e.removeAttributeNS(i,n)):t.hasAttribute(n)||e.removeAttribute(n)}}var re,pt="http://www.w3.org/1999/xhtml",R=typeof document>"u"?void 0:document,mt=!!R&&"content"in R.createElement("template"),vt=!!R&&R.createRange&&"createContextualFragment"in R.createRange();function yt(e){var t=R.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function gt(e){re||(re=R.createRange(),re.selectNode(R.body));var t=re.createContextualFragment(e);return t.childNodes[0]}function bt(e){var t=R.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Ct(e){return e=e.trim(),mt?yt(e):vt?gt(e):bt(e)}function se(e,t){var r=e.nodeName,s=t.nodeName,n,i;return r===s?!0:(n=r.charCodeAt(0),i=s.charCodeAt(0),n<=90&&i>=97?r===s.toUpperCase():i<=90&&n>=97?s===r.toUpperCase():!1)}function kt(e,t){return!t||t===pt?R.createElement(e):R.createElementNS(t,e)}function At(e,t){for(var r=e.firstChild;r;){var s=r.nextSibling;t.appendChild(r),r=s}return t}function pe(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var $e={OPTION:function(e,t){var r=e.parentNode;if(r){var s=r.nodeName.toUpperCase();s==="OPTGROUP"&&(r=r.parentNode,s=r&&r.nodeName.toUpperCase()),s==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}pe(e,t,"selected")},INPUT:function(e,t){pe(e,t,"checked"),pe(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var s=e.firstChild;if(s){var n=s.nodeValue;if(n==r||!r&&n==e.placeholder)return;s.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,s=0,n=e.firstChild,i,o;n;)if(o=n.nodeName&&n.nodeName.toUpperCase(),o==="OPTGROUP")i=n,n=i.firstChild,n||(n=i.nextSibling,i=null);else{if(o==="OPTION"){if(n.hasAttribute("selected")){r=s;break}s++}n=n.nextSibling,!n&&i&&(n=i.nextSibling,i=null)}e.selectedIndex=r}}},W=1,Oe=11,Pe=3,Me=8;function M(){}function Tt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function wt(e){return function(r,s,n){if(n||(n={}),typeof s=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"){var i=s;s=R.createElement("html"),s.innerHTML=i}else if(r.nodeName==="BODY"){var o=s;s=R.createElement("html"),s.innerHTML=o;var l=s.querySelector("body");l&&(s=l)}else s=Ct(s);else s.nodeType===Oe&&(s=s.firstElementChild);var a=n.getNodeKey||Tt,h=n.onBeforeNodeAdded||M,g=n.onNodeAdded||M,p=n.onBeforeElUpdated||M,w=n.onElUpdated||M,$=n.onBeforeNodeDiscarded||M,E=n.onNodeDiscarded||M,O=n.onBeforeElChildrenUpdated||M,j=n.skipFromChildren||M,Q=n.addChild||function(f,d){return f.appendChild(d)},ee=n.childrenOnly===!0,x=Object.create(null),B=[];function F(f){B.push(f)}function ce(f,d){if(f.nodeType===W)for(var A=f.firstChild;A;){var y=void 0;d&&(y=a(A))?F(y):(E(A),A.firstChild&&ce(A,d)),A=A.nextSibling}}function V(f,d,A){$(f)!==!1&&(d&&d.removeChild(f),E(f),ce(f,A))}function q(f){if(f.nodeType===W||f.nodeType===Oe)for(var d=f.firstChild;d;){var A=a(d);A&&(x[A]=d),q(d),d=d.nextSibling}}q(r);function te(f){g(f);for(var d=f.firstChild;d;){var A=d.nextSibling,y=a(d);if(y){var C=x[y];C&&se(d,C)?(d.parentNode.replaceChild(C,d),H(C,d)):te(d)}else te(d);d=A}}function G(f,d,A){for(;d;){var y=d.nextSibling;(A=a(d))?F(A):V(d,f,!0),d=y}}function H(f,d,A){var y=a(d);if(y&&delete x[y],!A){var C=p(f,d);if(C===!1||(C instanceof HTMLElement&&(f=C,q(f)),e(f,d),w(f),O(f,d)===!1))return}f.nodeName!=="TEXTAREA"?c(f,d):$e.TEXTAREA(f,d)}function c(f,d){var A=j(f,d),y=d.firstChild,C=f.firstChild,z,P,J,ue,D;e:for(;y;){for(ue=y.nextSibling,z=a(y);!A&&C;){if(J=C.nextSibling,y.isSameNode&&y.isSameNode(C)){y=ue,C=J;continue e}P=a(C);var de=C.nodeType,U=void 0;if(de===y.nodeType&&(de===W?(z?z!==P&&((D=x[z])?J===D?U=!1:(f.insertBefore(D,C),P?F(P):V(C,f,!0),C=D,P=a(C)):U=!1):P&&(U=!1),U=U!==!1&&se(C,y),U&&H(C,y)):(de===Pe||de==Me)&&(U=!0,C.nodeValue!==y.nodeValue&&(C.nodeValue=y.nodeValue))),U){y=ue,C=J;continue e}P?F(P):V(C,f,!0),C=J}if(z&&(D=x[z])&&se(D,y))A||Q(f,D),H(D,y);else{var Te=h(y);Te!==!1&&(Te&&(y=Te),y.actualize&&(y=y.actualize(f.ownerDocument||R)),Q(f,y),te(y))}y=ue,C=J}G(f,C,P);var ze=$e[f.nodeName];ze&&ze(f,d)}var u=r,m=u.nodeType,v=s.nodeType;if(!ee){if(m===W)v===W?se(r,s)||(E(r),u=At(r,kt(s.nodeName,s.namespaceURI))):u=s;else if(m===Pe||m===Me){if(v===m)return u.nodeValue!==s.nodeValue&&(u.nodeValue=s.nodeValue),u;u=s}}if(u===s)E(r);else{if(s.isSameNode&&s.isSameNode(u))return;if(H(u,s,ee),B)for(var b=0,_=B.length;b<_;b++){var k=x[B[b]];k&&V(k,k.parentNode,!1)}}return!ee&&u!==r&&r.parentNode&&(u.actualize&&(u=u.actualize(r.ownerDocument||R)),r.parentNode.replaceChild(u,r)),u}}var Et=wt(ft);let me,ne=null;const _t=500,St="__STORYBLOK_SERVERDATA__",Ne="data-blok-focused",Y="data-blok-uid",Lt="data-preserve-state",Rt="storyblok-live-preview",It="storyblok-live-preview-updating",xe="storyblok-live-preview-updated";function $t(){const e=document.querySelector(`meta[name="${Rt}"]`);return(e==null?void 0:e.content)==="disabled"||(e==null?void 0:e.content)==="false"}async function Ot(e){const{action:t,story:r}=e||{};if(["published","change"].includes(t)){location.reload();return}if(t==="input"&&r){if($t())return;ne&&ne.abort(),me&&clearTimeout(me),me=setTimeout(async()=>{try{await Pt(r)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;console.error("Failed to update live preview:",s)}},_t)}}async function Pt(e){if(ve(It,{story:e},!0).defaultPrevented)return;const r=document.body,s=Ut(r),n=await Dt(e,s);if(n.outerHTML===r.outerHTML){ve(xe,{story:e});return}const i=document.querySelector(`[${Ne}="true"]`);Nt(r,n,i),ve(xe,{story:e})}function Mt(e,t){var n,i;const r=(n=e.attributes.getNamedItem(Y))==null?void 0:n.value,s=(i=t.attributes.getNamedItem(Y))==null?void 0:i.value;r===s&&Array.from(e.attributes).forEach(o=>{if(o.name===Y)return;const l=o.value,a=t.getAttribute(o.name);(!t.hasAttribute(o.name)||a!==l)&&t.setAttribute(o.name,l)})}function Nt(e,t,r){let s=!0;if(r){const n=r.getAttribute(Y),i=t.querySelector(`[data-blok-uid="${n}"]`);i&&(i.setAttribute(Ne,"true"),He(r,i),s=!1)}s&&He(e,t)}function xt(e){if(e.nodeType===1){const t=e.getAttribute(Y);if(t)return t}}function He(e,t){Et(e,t,{getNodeKey:xt,onBeforeElUpdated:(r,s)=>r.hasAttribute(Lt)?!1:(Mt(r,s),!0)})}const Ht=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};async function Dt(e,t){ne=new AbortController;const r={story:{...e,is_storyblok_preview:!0},...Ht(t)&&{serverData:t}},s=await fetch(location.href,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"},signal:ne.signal});if(!s.ok)throw new Error(`Failed to fetch updated HTML: ${s.status} ${s.statusText}`);const n=await s.text();return new DOMParser().parseFromString(n,"text/html").body}function ve(e,t,r=!1){const s=new CustomEvent(e,{detail:t,cancelable:r});return document.dispatchEvent(s),s}function Ut(e){const t=e.querySelector(`#${St}`);if(!(t!=null&&t.textContent))return null;try{return JSON.parse(t.textContent||"{}")}catch(r){return console.error("Failed to parse server data:",r),null}}const jt=["_storyblok","_storyblok_c","_storyblok_tk[space_id]"];function Vt(e,t={}){const r=e.searchParams;return!(!jt.every(n=>r.has(n))||t.spaceId&&r.get("_storyblok_tk[space_id]")!==t.spaceId)}var Bt=Object.defineProperty,Ft=(e,t,r)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t,r)=>Ft(e,typeof t!="symbol"?t+"":t,r);let L=function(e){return e.DOCUMENT="doc",e.HEADING="heading",e.PARAGRAPH="paragraph",e.QUOTE="blockquote",e.OL_LIST="ordered_list",e.UL_LIST="bullet_list",e.LIST_ITEM="list_item",e.CODE_BLOCK="code_block",e.HR="horizontal_rule",e.BR="hard_break",e.IMAGE="image",e.EMOJI="emoji",e.COMPONENT="blok",e.TABLE="table",e.TABLE_ROW="tableRow",e.TABLE_CELL="tableCell",e.TABLE_HEADER="tableHeader",e}({}),I=function(e){return e.BOLD="bold",e.STRONG="strong",e.STRIKE="strike",e.UNDERLINE="underline",e.ITALIC="italic",e.CODE="code",e.LINK="link",e.ANCHOR="anchor",e.STYLED="styled",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.TEXT_STYLE="textStyle",e.HIGHLIGHT="highlight",e}({}),qt=function(e){return e.TEXT="text",e}({}),ie=function(e){return e.URL="url",e.STORY="story",e.ASSET="asset",e.EMAIL="email",e}({});const Gt=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],zt=(e={})=>{const{custom:t,...r}=e,s={...r,...t};return Object.keys(s).map(n=>`${n}="${s[n]}"`).join(" ")},Jt=(e={})=>Object.keys(e).map(t=>`${t}: ${e[t]}`).join("; ");function Kt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Z=e=>Object.fromEntries(Object.entries(e).filter(([t,r])=>r!==void 0));function Wt(e,t){if(!t)return{src:e,attrs:{}};let r=0,s=0;const n={},i=[];function o(a,h,g,p,w){typeof a!="number"||a<=h||a>=g?console.warn(`[StoryblokRichText] - ${p.charAt(0).toUpperCase()+p.slice(1)} value must be a number between ${h} and ${g} (inclusive)`):w.push(`${p}(${a})`)}if(typeof t=="object"){if(t.width!==void 0&&(typeof t.width=="number"&&t.width>=0?(n.width=t.width,r=t.width):console.warn("[StoryblokRichText] - Width value must be a number greater than or equal to 0")),t.height!==void 0&&(typeof t.height=="number"&&t.height>=0?(n.height=t.height,s=t.height):console.warn("[StoryblokRichText] - Height value must be a number greater than or equal to 0")),t.height===0&&t.width===0&&(delete n.width,delete n.height,console.warn("[StoryblokRichText] - Width and height values cannot both be 0")),t.loading&&["lazy","eager"].includes(t.loading)&&(n.loading=t.loading),t.class&&(n.class=t.class),t.filters){const{filters:a}=t||{},{blur:h,brightness:g,fill:p,format:w,grayscale:$,quality:E,rotate:O}=a||{};h&&o(h,0,100,"blur",i),E&&o(E,0,100,"quality",i),g&&o(g,0,100,"brightness",i),p&&i.push(`fill(${p})`),$&&i.push("grayscale()"),O&&[0,90,180,270].includes(t.filters.rotate||0)&&i.push(`rotate(${O})`),w&&["webp","png","jpeg"].includes(w)&&i.push(`format(${w})`)}t.srcset&&(n.srcset=t.srcset.map(a=>{if(typeof a=="number")return`${e}/m/${a}x0/${i.length>0?`filters:${i.join(":")}`:""} ${a}w`;if(Array.isArray(a)&&a.length===2){const[h,g]=a;return`${e}/m/${h}x${g}/${i.length>0?`filters:${i.join(":")}`:""} ${h}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),t.sizes&&(n.sizes=t.sizes.join(", "))}let l=`${e}/m/`;return(r>0||s>0)&&(l=`${l}${r}x${s}/`),i.length>0&&(l=`${l}filters:${i.join(":")}`),{src:l,attrs:n}}function De(e,t={},r){const s=zt(t),n=s?`${e} ${s}`:e,i=Array.isArray(r)?r.join(""):r||"";if(e){if(Gt.includes(e))return`<${n}>`}else return i;return`<${n}>${i}</${e}>`}function Ue(e={}){const t=new Map,{renderFn:r=De,textFn:s=Kt,resolvers:n={},optimizeImages:i=!1,keyedResolvers:o=!1}=e,l=r!==De,a=(c={})=>{const{textAlign:u,class:m,id:v,style:b,..._}=c,k=[];return b&&k.push(b.endsWith(";")?b:`${b};`),u&&k.push(`text-align: ${u};`),Z({..._,class:m,id:v,...k.length>0?{style:k.join(" ")}:{}})},h=c=>(u,m)=>{const v=a(u.attrs);return m.render(c,v,u.children||null)},g=(c,u)=>{const{src:m,alt:v,title:b,srcset:_,sizes:k}=c.attrs||{};let f=m,d={};if(i){const{src:y,attrs:C}=Wt(m,i);f=y,d=C}const A={src:f,alt:v,title:b,srcset:_,sizes:k,...d};return u.render("img",Z(A))},p=(c,u)=>{const{level:m,...v}=c.attrs||{},b=a(v);return u.render(`h${m}`,b,c.children)},w=(c,u)=>{var m,v,b,_;const k=u.render("img",{src:(m=c.attrs)==null?void 0:m.fallbackImage,alt:(v=c.attrs)==null?void 0:v.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return u.render("span",{"data-type":"emoji","data-name":(b=c.attrs)==null?void 0:b.name,"data-emoji":(_=c.attrs)==null?void 0:_.emoji},k)},$=(c,u)=>u.render("pre",c.attrs||{},u.render("code",{},c.children||"")),E=(c,u=!1)=>({text:m,attrs:v},b)=>{const{class:_,id:k,...f}=v||{},d=u?{class:_,id:k,style:Jt(f)||void 0}:v||{};return b.render(c,Z(d),m)},O=c=>H(c),j=c=>{const{marks:u,...m}=c;if("text"in c){if(u)return u.reduce((b,_)=>O({..._,text:b}),O({...m,children:m.children}));const v=c.attrs||{};if(o){const b=t.get("txt")||0;t.set("txt",b+1),v.key=`txt-${b}`}return s(m.text,v)}return""},Q=(c,u)=>{const{linktype:m,href:v,anchor:b,..._}=c.attrs||{};let k="";switch(m){case ie.ASSET:case ie.URL:k=v;break;case ie.EMAIL:k=`mailto:${v}`;break;case ie.STORY:k=v,b&&(k=`${k}#${b}`);break;default:k=v;break}const f={..._};return k&&(f.href=k),u.render("a",f,c.text)},ee=(c,u)=>{var m,v;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),u.render("span",{blok:(m=c==null?void 0:c.attrs)==null?void 0:m.body[0],id:(v=c.attrs)==null?void 0:v.id,style:"display: none"})},x=(c,u)=>{const m=a(c.attrs),v=c.children||null;return u.render("table",m,u.render("tbody",{},v))},B=(c,u)=>{const m=a(c.attrs);return u.render("tr",m,c.children)},F=(c,u)=>{const{colspan:m,rowspan:v,colwidth:b,backgroundColor:_,textAlign:k,...f}=c.attrs||{},d=[];b&&d.push(`width: ${b}px;`),_&&d.push(`background-color: ${_};`),k&&d.push(`text-align: ${k};`);const A={...f,...m>1?{colspan:m}:{},...v>1?{rowspan:v}:{},...d.length>0?{style:d.join(" ")}:{}};return u.render("td",Z(A),c.children)},ce=(c,u)=>{const{colspan:m,rowspan:v,colwidth:b,backgroundColor:_,textAlign:k,...f}=c.attrs||{},d=[];b&&d.push(`width: ${b}px;`),_&&d.push(`background-color: ${_};`),k&&d.push(`text-align: ${k};`);const A={...f,...m>1?{colspan:m}:{},...v>1?{rowspan:v}:{},...d.length>0?{style:d.join(" ")}:{}};return u.render("th",Z(A),c.children)},V=new Map([[L.DOCUMENT,h("")],[L.HEADING,p],[L.PARAGRAPH,h("p")],[L.UL_LIST,h("ul")],[L.OL_LIST,h("ol")],[L.LIST_ITEM,h("li")],[L.IMAGE,g],[L.EMOJI,w],[L.CODE_BLOCK,$],[L.HR,h("hr")],[L.BR,h("br")],[L.QUOTE,h("blockquote")],[L.COMPONENT,ee],[qt.TEXT,j],[I.LINK,Q],[I.ANCHOR,Q],[I.STYLED,E("span",!0)],[I.BOLD,E("strong")],[I.TEXT_STYLE,E("span",!0)],[I.ITALIC,E("em")],[I.UNDERLINE,E("u")],[I.STRIKE,E("s")],[I.CODE,E("code")],[I.SUPERSCRIPT,E("sup")],[I.SUBSCRIPT,E("sub")],[I.HIGHLIGHT,E("mark")],[L.TABLE,x],[L.TABLE_ROW,B],[L.TABLE_CELL,F],[L.TABLE_HEADER,ce]]),q=new Map([...V,...Object.entries(n).map(([c,u])=>[c,u])]),te=()=>({render:(c,u={},m)=>{if(o&&c){const v=t.get(c)||0;t.set(c,v+1),u.key=`${c}-${v}`}return r(c,u,m)},originalResolvers:V,mergedResolvers:q});function G(c){const u=q.get(c.type);if(!u)return console.error("<Storyblok>",`No resolver found for node type ${c.type}`),"";const m=te();if(c.type==="text")return u(c,m);const v=c.content?c.content.map(H):void 0;return u({...c,children:v},m)}function H(c){return c.type==="doc"?l?c.content.map(G):c.content.map(G).join(""):Array.isArray(c)?c.map(G):G(c)}return{render:H}}let je=!1;const Ve=[],Be=e=>new Promise((t,r)=>{if(typeof window>"u"){r(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=n=>{if(!window.location.search.includes("_storyblok")){console.warn("You are not in Draft Mode or in the Visual Editor.");return}je?n():Ve.push(n)},document.getElementById("storyblok-javascript-bridge")){t(void 0);return}const s=document.createElement("script");s.async=!0,s.src=e,s.id="storyblok-javascript-bridge",s.onerror=n=>r(n),s.onload=n=>{Ve.forEach(i=>i()),je=!0,t(n)},document.getElementsByTagName("head")[0].appendChild(s)}),ye=(e="")=>e.includes("/cdn/"),Yt=(e,t=25,r=1)=>({...e,per_page:t,page:r}),Zt=e=>new Promise(t=>setTimeout(t,e)),Xt=(e=0,t)=>Array.from({length:e},t),Qt=(e=0,t=e)=>{const r=Math.abs(t-e)||0,s=e<t?1:-1;return Xt(r,(n,i)=>i*s+e)},er=async(e,t)=>Promise.all(e.map(t)),tr=(e=[],t)=>e.map(t).reduce((r,s)=>[...r,...s],[]),ge=(e,t,r)=>{const s=[];for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const i=e[n];if(i==null)continue;const o=r?"":encodeURIComponent(n);let l;typeof i=="object"?l=ge(i,t?t+encodeURIComponent(`[${o}]`):o,Array.isArray(i)):l=`${t?t+encodeURIComponent(`[${o}]`):o}=${encodeURIComponent(i)}`,s.push(l)}return s.join("&")},Fe=e=>{const t={eu:"api.storyblok.com",us:"api-us.storyblok.com",cn:"app.storyblokchina.cn",ap:"api-ap.storyblok.com",ca:"api-ca.storyblok.com"};return t[e]??t.eu};var rr=class{constructor(e){T(this,"baseURL"),T(this,"timeout"),T(this,"headers"),T(this,"responseInterceptor"),T(this,"fetch"),T(this,"ejectInterceptor"),T(this,"url"),T(this,"parameters"),T(this,"fetchOptions"),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={},this.fetchOptions={}}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=[],r={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(s=>{r.data=s});for(const s of e.headers.entries())t[s[0]]=s[1];return r.headers={...t},r.status=e.status,r.statusText=e.statusText,r}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,r=null;e==="get"?t=`${this.baseURL}${this.url}?${ge(this.parameters)}`:r=JSON.stringify(this.parameters);const s=new URL(t),n=new AbortController,{signal:i}=n;let o=null;this.timeout&&(o=setTimeout(()=>n.abort(),this.timeout));try{const l=await this.fetch(`${s}`,{method:e,headers:this.headers,body:r,signal:i,...this.fetchOptions});this.timeout&&o&&clearTimeout(o);const a=await this._responseHandler(l);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(a)):this._statusHandler(a)}catch(l){return l.name==="AbortError"?{message:"Request timeout: The request was aborted due to timeout"}:{message:l.message||l.toString()||"An unknown error occurred"}}}setFetchOptions(e={}){Object.keys(e).length>0&&"method"in e&&delete e.method,this.fetchOptions={...e}}eject(){this.ejectInterceptor=!0}_normalizeErrorMessage(e){if(Array.isArray(e))return e[0]||"Unknown error";if(e&&typeof e=="object"){if(e.error)return e.error;for(const t in e){if(Array.isArray(e[t]))return`${t}: ${e[t][0]}`;if(typeof e[t]=="string")return`${t}: ${e[t]}`}if(e.slug)return e.slug}return"Unknown error"}_statusHandler(e){const t=/20[0-6]/g;return new Promise((r,s)=>{if(t.test(`${e.status}`))return r(e);const n={message:this._normalizeErrorMessage(e.data),status:e.status,response:e};s(n)})}},sr=rr;const qe="SB-Agent",be={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:"7.0.0"},Ge={DRAFT:"draft",PUBLISHED:"published"},nr=25,Ce={SMALL:25,MEDIUM:50,LARGE:75},X={SINGLE_OR_SMALL:50,MEDIUM:15,LARGE:10,VERY_LARGE:6},ke=1e3,oe=3;function ir(e){return e.version===Ge.DRAFT}function or(e,t){const r=e.includes("/cdn/stories/"),s=e.split("/").length>3&&!e.endsWith("/cdn/stories"),n="find_by"in t;return r&&s||n}function ar(e){return e<=Ce.SMALL?X.SINGLE_OR_SMALL:e<=Ce.MEDIUM?X.MEDIUM:e<=Ce.LARGE?X.LARGE:X.VERY_LARGE}function ae(e,t,r={},s){if(r.userRateLimit!==void 0)return Math.min(r.userRateLimit,ke);if(r.serverHeadersRateLimit!==void 0)return Math.min(r.serverHeadersRateLimit,ke);if(s!==void 0)return s;if(t&&!ir(t))return ke;if(or(e,t))return X.SINGLE_OR_SMALL;const n=t.per_page||nr;return ar(n)}function lr(e){if(!e)return null;const t=e["x-ratelimit"]||e["X-RateLimit"],r=e["x-ratelimit-policy"]||e["X-RateLimit-Policy"];if(!t&&!r)return null;const s={};if(t){const n=t.match(/r=(\d+)/);n&&(s.remaining=Number.parseInt(n[1],10))}if(r){const n=r.match(/q=(\d+)/);n&&(s.max=Number.parseInt(n[1],10))}return Object.keys(s).length>0?s:null}function cr(e,t=!1){return{userRateLimit:e,serverHeadersRateLimit:void 0,isManagementApi:t}}var ur=class extends Error{constructor(e){super(e),this.name="AbortError"}};function dr(e,t,r){if(!Number.isFinite(t))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(r))throw new TypeError("Expected `interval` to be a finite number");const s=[];let n=[],i=0,o=!1;const l=async()=>{i++;const h=s.shift();if(h)try{const p=await e(...h.args);h.resolve(p)}catch(p){h.reject(p)}const g=setTimeout(()=>{i--,s.length>0&&l(),n=n.filter(p=>p!==g)},r);n.includes(g)||n.push(g)},a=(...h)=>o?Promise.reject(new Error("Throttled function is already aborted and not accepting new promises")):new Promise((g,p)=>{s.push({resolve:g,reject:p,args:h}),i<t&&l()});return a.abort=()=>{o=!0,n.forEach(clearTimeout),n=[],s.forEach(h=>h.reject(()=>new ur("Throttle function aborted"))),s.length=0},a}var hr=dr,fr=class{constructor(e,t=1e3){T(this,"queues"),T(this,"interval"),T(this,"throttledRequestFn"),this.queues=new Map,this.interval=t,this.throttledRequestFn=e}getQueue(e){let t=this.queues.get(e);return t||(t=hr(this.throttledRequestFn,e,this.interval),this.queues.set(e,t)),t}execute(e,...t){return this.getQueue(e)(...t)}abortAll(){this.queues.forEach(e=>{var t;(t=e.abort)==null||t.call(e)}),this.queues.clear()}getQueueCount(){return this.queues.size}};let le={};const N={};var pr=class{constructor(e,t){T(this,"client"),T(this,"maxRetries"),T(this,"retriesDelay"),T(this,"throttleManager"),T(this,"accessToken"),T(this,"cache"),T(this,"resolveCounter"),T(this,"relations"),T(this,"links"),T(this,"version"),T(this,"rateLimitConfig"),T(this,"richTextResolver"),T(this,"resolveNestedRelations"),T(this,"stringifiedStoriesCache"),T(this,"inlineAssets");let r=e.endpoint||t;if(!r){const n=e.https===!1?"http":"https";e.oauthToken?r=`${n}://${Fe(e.region)}/v1`:r=`${n}://${Fe(e.region)}/v2`}const s=new Headers;s.set("Content-Type","application/json"),s.set("Accept","application/json"),e.headers&&(e.headers.constructor.name==="Headers"?e.headers.entries().toArray():Object.entries(e.headers)).forEach(([n,i])=>{s.set(n,i)}),s.has(qe)||(s.set(qe,be.defaultAgentName),s.set(be.defaultAgentVersion,be.packageVersion)),e.oauthToken&&s.set("Authorization",e.oauthToken),this.rateLimitConfig=cr(e.rateLimit,!!e.oauthToken),this.maxRetries=e.maxRetries||10,this.retriesDelay=300,this.throttleManager=new fr(this.throttledRequest.bind(this),1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.stringifiedStoriesCache={},this.version=e.version||Ge.PUBLISHED,this.inlineAssets=e.inlineAssets||!1,this.client=new sr({baseURL:r,timeout:e.timeout||0,headers:s,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}parseParams(e){return e.token||(e.token=this.getToken()),e.cv||(e.cv=N[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),typeof e.resolve_relations<"u"&&(e.resolve_level=2),e}factoryParamOptions(e,t){return ye(e)?this.parseParams(t):t}makeRequest(e,t,r,s,n){const i=this.factoryParamOptions(e,Yt(t,r,s));return this.cacheResponse(e,i,void 0,n)}get(e,t={},r){t||(t={});const s=`/${e}`;ye(s)&&(t.version=t.version||this.version);const n=this.factoryParamOptions(s,t);return this.cacheResponse(s,n,void 0,r)}async getAll(e,t={},r,s){const n=(t==null?void 0:t.per_page)||25,i=`/${e}`.replace(/\/$/,""),o=r??i.substring(i.lastIndexOf("/")+1);t.version=t.version||this.version;const l=1,a=await this.makeRequest(i,t,n,l,s),h=a.total?Math.ceil(a.total/(a.perPage||n)):1,g=await er(Qt(l,h),p=>this.makeRequest(i,t,n,p+1,s));return tr([a,...g],p=>Object.values(p.data[o]))}post(e,t={},r){const s=`/${e}`,n=ae(void 0,void 0,this.rateLimitConfig,oe);return this.throttleManager.execute(n,"post",s,t,r)}put(e,t={},r){const s=`/${e}`,n=ae(void 0,void 0,this.rateLimitConfig,oe);return this.throttleManager.execute(n,"put",s,t,r)}delete(e,t={},r){t||(t={});const s=`/${e}`,n=ae(void 0,void 0,this.rateLimitConfig,oe);return this.throttleManager.execute(n,"delete",s,t,r)}getStories(e={},t){return this._addResolveLevel(e),this.get("cdn/stories",e,t)}getStory(e,t={},r){return this._addResolveLevel(t),this.get(`cdn/stories/${e}`,t,r)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_addResolveLevel(e){typeof e.resolve_relations<"u"&&(e.resolve_level=2)}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,r){const s=e[t];s&&s.fieldtype==="multilink"&&s.linktype==="story"&&typeof s.id=="string"&&this.links[r][s.id]?s.story=this._cleanCopy(this.links[r][s.id]):s&&s.linktype==="story"&&typeof s.uuid=="string"&&this.links[r][s.uuid]&&(s.story=this._cleanCopy(this.links[r][s.uuid]))}getStoryReference(e,t){return this.relations[e][t]?JSON.parse(this.stringifiedStoriesCache[t]||JSON.stringify(this.relations[e][t])):t}_resolveField(e,t,r){const s=e[t];typeof s=="string"?e[t]=this.getStoryReference(r,s):Array.isArray(s)&&(e[t]=s.map(n=>this.getStoryReference(r,n)).filter(Boolean))}_insertRelations(e,t,r,s){if(Array.isArray(r)?r.find(i=>i.endsWith(`.${t}`)):r.endsWith(`.${t}`)){this._resolveField(e,t,s);return}const n=e.component?`${e.component}.${t}`:t;(Array.isArray(r)?r.includes(n):r===n)&&this._resolveField(e,t,s)}iterateTree(e,t,r){const s=(n,i="")=>{if(!(!n||n._stopResolving)){if(Array.isArray(n))n.forEach((o,l)=>s(o,`${i}[${l}]`));else if(typeof n=="object")for(const o in n){const l=i?`${i}.${o}`:o;(n.component&&n._uid||n.type==="link")&&(this._insertRelations(n,o,t,r),this._insertLinks(n,o,r)),s(n[o],l)}}};s(e.content)}async resolveLinks(e,t,r){let s=[];if(e.link_uuids){const n=e.link_uuids.length,i=[],o=50;for(let l=0;l<n;l+=o){const a=Math.min(n,l+o);i.push(e.link_uuids.slice(l,a))}for(let l=0;l<i.length;l++)(await this.getStories({per_page:o,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:i[l].join(",")})).data.stories.forEach(a=>{s.push(a)})}else s=e.links;s.forEach(n=>{this.links[r][n.uuid]={...n,_stopResolving:!0}})}async resolveRelations(e,t,r){let s=[];if(e.rel_uuids){const n=e.rel_uuids.length,i=[],o=50;for(let l=0;l<n;l+=o){const a=Math.min(n,l+o);i.push(e.rel_uuids.slice(l,a))}for(let l=0;l<i.length;l++)(await this.getStories({per_page:o,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:i[l].join(","),excluding_fields:t.excluding_fields})).data.stories.forEach(a=>{s.push(a)});s.length>0&&(e.rels=s,delete e.rel_uuids)}else s=e.rels;s&&s.length>0&&s.forEach(n=>{this.relations[r][n.uuid]={...n,_stopResolving:!0}})}async resolveStories(e,t,r){var s,n;let i=[];if(this.links[r]={},this.relations[r]={},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,r)),t.resolve_links&&["1","story","url","link"].includes(t.resolve_links)&&((s=e.links)!=null&&s.length||(n=e.link_uuids)!=null&&n.length)&&await this.resolveLinks(e,t,r),this.resolveNestedRelations)for(const o in this.relations[r])this.iterateTree(this.relations[r][o],i,r);e.story?this.iterateTree(e.story,i,r):e.stories.forEach(o=>{this.iterateTree(o,i,r)}),this.stringifiedStoriesCache={},delete this.links[r],delete this.relations[r]}async cacheResponse(e,t,r,s){const n=ge({url:e,params:t}),i=this.cacheProvider();if(t.version==="published"&&e!=="/cdn/spaces/me"){const a=await i.get(n);if(a)return Promise.resolve(a)}const o=!ye(e)&&this.rateLimitConfig.isManagementApi?oe:void 0,l=ae(e,t,this.rateLimitConfig,o);return new Promise(async(a,h)=>{var g;try{const p=await this.throttleManager.execute(l,"get",e,t,s);if(p.status!==200)return h(p);let w={data:p.data,headers:p.headers};const $=lr(p.headers);if(($==null?void 0:$.max)!==void 0&&(this.rateLimitConfig.serverHeadersRateLimit=$.max),(g=p.headers)!=null&&g["per-page"]&&(w=Object.assign({},w,{perPage:p.headers["per-page"]?Number.parseInt(p.headers["per-page"]):0,total:p.headers["per-page"]?Number.parseInt(p.headers.total):0})),w.data.story||w.data.stories){const O=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(w.data,t,`${O}`),w=await this.processInlineAssets(w)}t.version==="published"&&e!=="/cdn/spaces/me"&&await i.set(n,w);const E=this.cache.clear==="onpreview"&&t.version==="draft"||this.cache.clear==="auto";return t.token&&w.data.cv&&(E&&N[t.token]&&N[t.token]!==w.data.cv&&await this.flushCache(),N[t.token]=w.data.cv),a(w)}catch(p){if(p.response&&p.status===429&&(r=typeof r>"u"?0:r+1,r<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${this.retriesDelay/1e3} seconds.`),await Zt(this.retriesDelay),this.cacheResponse(e,t,r).then(a).catch(h);h(p)}})}throttledRequest(e,t,r,s){return this.client.setFetchOptions(s),this.client[e](t,r)}cacheVersions(){return N}cacheVersion(){return N[this.accessToken]}setCacheVersion(e){this.accessToken&&(N[this.accessToken]=e)}clearCacheVersion(){this.accessToken&&(N[this.accessToken]=0)}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(le[e])},getAll(){return Promise.resolve(le)},set(e,t){return le[e]=t,Promise.resolve(void 0)},flush(){return le={},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.clearCacheVersion(),this}async processInlineAssets(e){if(!this.inlineAssets)return e;const t=r=>{if(!r||typeof r!="object")return r;if(Array.isArray(r))return r.map(n=>t(n));let s={...r};s.fieldtype==="asset"&&Array.isArray(e.data.assets)&&(s={...e.data.assets.find(n=>n.id===s.id),...s});for(const n in s)typeof s[n]=="object"&&(s[n]=t(s[n]));return s};return e.data.story&&(e.data.story.content=t(e.data.story.content)),e.data.stories&&(e.data.stories=e.data.stories.map(r=>(r.content=t(r.content),r))),e}},mr=pr;const vr=(e={})=>{const{apiOptions:t}=e;if(!t||!t.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 mr(t)}},yr=e=>{if(typeof e!="object"||typeof e._editable>"u")return{};try{const t=JSON.parse(e._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return t?{"data-blok-c":JSON.stringify(t),"data-blok-uid":`${t.id}-${t.uid}`}:{}}catch{return{}}};let Ae="https://app.storyblok.com/f/storyblok-v2-latest.js";const gr=(e={})=>{var t,r;const{bridge:s,accessToken:n,use:i=[],apiOptions:o={},bridgeUrl:l}=e;o.accessToken=o.accessToken||n;const a={bridge:s,apiOptions:o};let h={};i.forEach(p=>{h={...h,...p(a)}}),l&&(Ae=l);const g=!(typeof window>"u")&&((r=(t=window.location)==null?void 0:t.search)==null?void 0:r.includes("_storyblok_tk"));return s!==!1&&g&&Be(Ae),h};function br(e,t){return Ue(t).render(e)}const Cr=()=>Be(Ae);S.apiPlugin=vr,S.getLiveStory=Ye,S.getPayload=Ze,S.handleStoryblokMessage=Ot,S.isEditorRequest=Vt,S.loadStoryblokBridge=Cr,S.renderRichText=br,S.richTextResolver=Ue,S.sanitizeJSON=ht,S.storyblok=dt,S.storyblokEditable=yr,S.storyblokInit=gr,S.toCamelCase=Le,S.useStoryblokApi=We,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for validating Storyblok Visual Editor requests.
|
|
3
|
+
*/
|
|
4
|
+
interface StoryblokValidationOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Optional space ID to validate against the request.
|
|
7
|
+
* If provided, the request must match this space ID to be considered valid.
|
|
8
|
+
*/
|
|
9
|
+
spaceId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates whether a given URL is a legitimate request from the Storyblok Visual Editor.
|
|
13
|
+
*
|
|
14
|
+
* This function performs a multi-layered validation to ensure the request originates from
|
|
15
|
+
* the Storyblok Visual Editor by checking for required query parameters and optionally
|
|
16
|
+
* validating the space ID.
|
|
17
|
+
*
|
|
18
|
+
* @param url - The URL object to validate.
|
|
19
|
+
* @param options - Optional validation configuration.
|
|
20
|
+
* @param options.spaceId - If provided, validates that the request's space ID matches this value.
|
|
21
|
+
*
|
|
22
|
+
* @returns `true` if the URL contains all required Storyblok Visual Editor parameters
|
|
23
|
+
* and passes optional space ID validation; `false` otherwise.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const url = new URL('https://example.com/?_storyblok=123&_storyblok_c=456&_storyblok_tk[space_id]=789');
|
|
28
|
+
*
|
|
29
|
+
* // Basic validation
|
|
30
|
+
* if (isEditorRequest(url)) {
|
|
31
|
+
* console.log('Valid Storyblok editor request');
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* // Validation with space ID check
|
|
35
|
+
* if (isEditorRequest(url, { spaceId: '789' })) {
|
|
36
|
+
* console.log('Valid request for specific space');
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function isEditorRequest(url: URL, options?: StoryblokValidationOptions): boolean;
|
|
41
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/astro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.4.0-alpha.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Official Astro integration for the Storyblok Headless CMS",
|
|
7
7
|
"author": "Storyblok",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"./client": "./dist/lib/client.ts",
|
|
41
41
|
"./FallbackComponent.astro": "./dist/components/FallbackComponent.astro",
|
|
42
|
-
"./StoryblokComponent.astro": "./dist/components/StoryblokComponent.astro"
|
|
42
|
+
"./StoryblokComponent.astro": "./dist/components/StoryblokComponent.astro",
|
|
43
|
+
"./StoryblokServerData.astro": "./dist/components/StoryblokServerData.astro"
|
|
43
44
|
},
|
|
44
45
|
"main": "./dist/storyblok-astro.es.js",
|
|
45
46
|
"module": "./dist/storyblok-astro.js",
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"camelcase": "^8.0.0",
|
|
57
|
+
"morphdom": "^2.7.8",
|
|
56
58
|
"@storyblok/js": "4.4.4"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|