diff --git a/.gitignore b/.gitignore index d451ff1..daa834e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules dist dist-ssr *.local +tags diff --git a/docs/assets/display.27947ee2.js b/docs/assets/display.27947ee2.js deleted file mode 100644 index 74364ad..0000000 --- a/docs/assets/display.27947ee2.js +++ /dev/null @@ -1 +0,0 @@ -var a=Object.assign;import{z as s,m as t,b as e,A as l,E as i,f as r}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var d=s({name:"sb-image-display",model:t,props:a(a({},e),{data:{type:null,default:l}}),setup:a=>()=>i("figure",{class:"sb-image"},[i("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),i(r,{block:a.data.description},null)])});export default d; diff --git a/docs/assets/display.344ee7da.js b/docs/assets/display.344ee7da.js deleted file mode 100644 index 9d3dc59..0000000 --- a/docs/assets/display.344ee7da.js +++ /dev/null @@ -1 +0,0 @@ -var e=Object.assign;import{H as t,m as n,b as a,I as s,J as l}from"./index.039d73cc.js";import"./vendor.9babb3f5.js";var o=t({name:"sb-missing-block",model:n,props:e(e({name:String},a),{data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>s("div",{class:"sb-missing-block"},[l("Missing block: "),e.name])});export default o; diff --git a/docs/assets/display.57d7b574.js b/docs/assets/display.57d7b574.js deleted file mode 100644 index fa07949..0000000 --- a/docs/assets/display.57d7b574.js +++ /dev/null @@ -1 +0,0 @@ -var a=Object.assign;import{d as s,m as t,b as e,g as l,c as o,a as d,f as r}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var i=s({name:"sb-layout-display",model:t,props:a(a({},e),{data:{type:null,default:l}}),setup(a){const s=o((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>d("div",{class:s.value},[...a.data.children.map((a=>d(r,{key:a.id,block:a},null)))])}});export default i; diff --git a/docs/assets/display.65dc313e.js b/docs/assets/display.65dc313e.js new file mode 100644 index 0000000..4055bcd --- /dev/null +++ b/docs/assets/display.65dc313e.js @@ -0,0 +1 @@ +import{d as a,m as s,g as t,c as e,a as l,e as o}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var d=a({name:"sb-layout-display",model:s,props:{data:{type:null,default:t}},setup(a){const s=e((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>l("div",{class:s.value},[...a.data.children.map((a=>l(o,{key:a.id,block:a},null)))])}});export default d; diff --git a/docs/assets/display.8a67d4c4.js b/docs/assets/display.8a67d4c4.js new file mode 100644 index 0000000..2435d93 --- /dev/null +++ b/docs/assets/display.8a67d4c4.js @@ -0,0 +1 @@ +import{y as a,m as s,z as e,D as t,e as l}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var d=a({name:"sb-image-display",model:s,props:{data:{type:null,default:e}},setup:a=>()=>t("figure",{class:"sb-image"},[t("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),t(l,{block:a.data.description},null)])});export default d; diff --git a/docs/assets/display.9a74f321.js b/docs/assets/display.9a74f321.js new file mode 100644 index 0000000..8b94c21 --- /dev/null +++ b/docs/assets/display.9a74f321.js @@ -0,0 +1 @@ +var e=Object.assign;import{G as t,m as n,H as a,I as s,J as l}from"./index.be3c5d52.js";import"./vendor.9babb3f5.js";var o=t({name:"sb-missing-block",model:n,props:e(e({},a),{name:String,data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>s("div",{class:"sb-missing-block"},[l("Missing block: "),e.name])});export default o; diff --git a/docs/assets/display.bd126a56.js b/docs/assets/display.bd126a56.js deleted file mode 100644 index dbd0128..0000000 --- a/docs/assets/display.bd126a56.js +++ /dev/null @@ -1 +0,0 @@ -var a=Object.assign;import{k as s,m as r,b as t,l as e,s as p,t as l,y as n}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var b=s({name:"sb-paragraph-display",model:r,props:a(a({},t),{data:{type:Object,default:e}}),setup(a){const s=p((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>l("p",n({class:s.value},{innerHTML:a.data.value}),null)}});export default b; diff --git a/docs/assets/display.e17abc85.js b/docs/assets/display.e17abc85.js new file mode 100644 index 0000000..181be8d --- /dev/null +++ b/docs/assets/display.e17abc85.js @@ -0,0 +1 @@ +import{j as a,m as s,k as r,q as e,s as p,x as t}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var l=a({name:"sb-paragraph-display",model:s,props:{data:{type:Object,default:r}},setup(a){const s=e((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>p("p",t({class:s.value},{innerHTML:a.data.value}),null)}});export default l; diff --git a/docs/assets/edit.1f668f17.js b/docs/assets/edit.1f668f17.js new file mode 100644 index 0000000..5a3ee47 --- /dev/null +++ b/docs/assets/edit.1f668f17.js @@ -0,0 +1 @@ +var e=Object.assign;import{d as n,m as i,g as t,u as l,r as a,w as d,c as r,a as c,S as o,b as h,e as s,f as p,h as u,i as v}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var f=n({name:"sb-layout-edit",model:i,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:t}},setup(n){const{activate:i}=l(),t=a({orientation:n.data.orientation,children:[...n.data.children]});d((()=>n.data),(()=>{t.orientation=n.data.orientation,t.children=[...n.data.children]}));const f=r((()=>({"sb-layout":!0,[`sb-layout_${t.orientation}`]:!0}))),m=()=>{n.onUpdate({orientation:"vertical"===t.orientation?"horizontal":"vertical"})},b=e=>{t.children=[...t.children,e],n.onUpdate({children:[...t.children]}),i(e.id)},U=(e,l)=>{t.children=[...t.children.slice(0,e+1),l,...t.children.slice(e+1)],n.onUpdate({children:[...t.children]}),i(l.id)},y=e=>{t.children=[...t.children.slice(0,e),...t.children.slice(e+1)],n.onUpdate({children:[...t.children]});const l=Math.max(e-1,0);i(t.children[l].id)},k=e=>{const n=Math.max(Math.min(t.children.length-1,e),0);i(t.children[n].id)};return()=>c("div",{class:f.value},[c(o,null,{default:()=>[c(h,{type:"button",onClick:m},{default:()=>[t.orientation]})]}),...t.children.map(((i,l)=>c(s,p({key:i.id},{"data-order":l,block:i,onUpdate:l=>((i,l)=>{const a=t.children.indexOf(i);-1!==a&&n.onUpdate({children:[...t.children.slice(0,a),e(e({},i),l),...t.children.slice(a+1)]})})(i,l),onRemoveSelf:()=>y(l),onPrependBlock:e=>U(l-1,e),onAppendBlock:e=>U(l,e),onActivatePrevious:()=>k(l-1),onActivateNext:()=>k(l+1)}),{"context-toolbar":()=>c(u,{onMoveBackward:()=>(e=>{if(0===e)return;const i=t.children[e],l=t.children[e-1];t.children=[...t.children.slice(0,e-1),i,l,...t.children.slice(e+1)],n.onUpdate({children:[...t.children]})})(l),onMoveForward:()=>(e=>{if(e===t.children.length-1)return;const i=t.children[e],l=t.children[e+1];t.children=[...t.children.slice(0,e),l,i,...t.children.slice(e+2)],n.onUpdate({children:[...t.children]})})(l),onRemove:()=>y(l),orientation:t.orientation},null)}))),c(v,{onInsertBlock:b},null)])}});export default f; diff --git a/docs/assets/edit.25f6c7d7.js b/docs/assets/edit.25f6c7d7.js new file mode 100644 index 0000000..8c1de00 --- /dev/null +++ b/docs/assets/edit.25f6c7d7.js @@ -0,0 +1 @@ +import{j as a,m as e,k as n,l as t,n as l,u as o,o as u,p as i,q as s,s as r,S as d,t as p,v}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var c=a({name:"sb-paragraph-edit",model:e,props:{blockId:{type:String,required:!0},data:{type:null,default:n},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(a){const e=t({value:a.data.value,align:a.data.align,focused:!1}),c=l(null),{isActive:f,activate:g}=o(a.blockId),b=()=>{c.value&&f.value&&c.value.focus()};u((()=>{b(),c.value&&(c.value.innerHTML=e.value)})),i(f,b),i((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,c.value&&(c.value.innerHTML=e.value)}));const y=a=>{e.value=a.target.innerHTML},h=s((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),m=n=>{a.onUpdate({value:e.value,align:n.target.value})},k=()=>{e.focused=!0,g()},A=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const t=""+ +new Date;a.onAppendBlock({id:t,name:"sb-paragraph",data:n()}),g(t),e.preventDefault()}},F=n=>{var t;"Backspace"===n.key&&""===e.value&&a.onRemoveSelf();const l=window.getSelection(),o=null==l?void 0:l.focusNode,u=Array.from((null==(t=null==c?void 0:c.value)?void 0:t.childNodes)||[]),i=o?u.indexOf(o):-1;if(o===c.value||0===i||i===u.length-1)switch(n.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>r("div",{class:h.value},[r(d,null,{default:()=>[r(p,{value:e.align,onChange:m},{default:()=>[r("option",null,[v("left")]),r("option",null,[v("center")]),r("option",null,[v("right")])]})]}),r("p",{class:"sb-paragraph__input",ref:c,contenteditable:!0,onInput:y,onFocus:k,onBlur:A,onKeydown:w,onKeyup:F},null)])}});export default c; diff --git a/docs/assets/edit.492a1056.js b/docs/assets/edit.492a1056.js deleted file mode 100644 index 451be30..0000000 --- a/docs/assets/edit.492a1056.js +++ /dev/null @@ -1 +0,0 @@ -var a=Object.assign;import{k as e,m as n,b as t,l,n as o,o as u,u as s,p as i,q as r,s as p,t as d,S as c,v,x as f}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var g=e({name:"sb-paragraph-edit",model:n,props:a(a({},t),{data:{type:null,default:l},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}}),setup(a){const e=o({value:a.data.value,align:a.data.align,focused:!1}),n=u(null),{isActive:t,activate:g}=s(a.blockId),b=()=>{n.value&&t.value&&n.value.focus()};i((()=>{b(),n.value&&(n.value.innerHTML=e.value)})),r(t,b),r((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,n.value&&(n.value.innerHTML=e.value)}));const y=a=>{e.value=a.target.innerHTML},h=p((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),m=n=>{a.onUpdate({value:e.value,align:n.target.value})},A=()=>{e.focused=!0,g()},k=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const n=""+ +new Date;a.onAppendBlock({id:n,name:"sb-paragraph",data:l()}),g(n),e.preventDefault()}},x=t=>{"Backspace"===t.key&&""===e.value&&a.onRemoveSelf();const l=window.getSelection().focusNode,o=Array.from(n.value.childNodes),u=o.indexOf(l);if(l===n.value||0===u||u===o.length-1)switch(t.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>d("div",{class:h.value},[d(c,null,{default:()=>[d(v,{value:e.align,onChange:m},{default:()=>[d("option",null,[f("left")]),d("option",null,[f("center")]),d("option",null,[f("right")])]})]}),d("p",{class:"sb-paragraph__input",ref:n,contenteditable:!0,onInput:y,onFocus:A,onBlur:k,onKeydown:w,onKeyup:x},null)])}});export default g; diff --git a/docs/assets/edit.4ace5dcb.js b/docs/assets/edit.4ace5dcb.js deleted file mode 100644 index f0a794b..0000000 --- a/docs/assets/edit.4ace5dcb.js +++ /dev/null @@ -1 +0,0 @@ -var a=Object.assign;import{z as e,m as t,b as s,A as l,B as n,C as d,D as i,E as r,S as c,e as o,F as u,G as p,f}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var m=e({name:"sb-image-edit",model:t,props:a(a({},s),{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:l}}),setup(e){const t=n({src:e.data.src,alt:e.data.alt,description:e.data.description}),s=d(null);i((()=>e.data),(()=>{t.src=e.data.src,t.alt=e.data.alt,t.description=e.data.description}));const l=()=>{s.value&&s.value.click()},m=()=>{if(s.value&&s.value.files&&s.value.files.length){const a=new FileReader;a.addEventListener("load",(()=>{e.onUpdate({src:a.result,alt:e.data.alt,description:e.data.description})})),a.readAsDataURL(s.value.files[0])}};return()=>r("figure",{class:"sb-image"},[r(c,null,{default:()=>[t.src?r(o,{onClick:l},{default:()=>[u("Change Image")]}):null,r("input",{type:"file",ref:s,style:"display: none;",onInput:m},null)]}),t.src?r(p,null,[r("img",{src:t.src,alt:t.alt,class:"sb-image__content"},null),r(f,{block:t.description,onUpdate:t=>{return s=t,void e.onUpdate(a(a({},e.data),{description:s}));var s}},null)]):r(o,{onClick:l},{default:()=>[u("Select Image")]})])}});export default m; diff --git a/docs/assets/edit.772205fb.js b/docs/assets/edit.772205fb.js deleted file mode 100644 index 1dba703..0000000 --- a/docs/assets/edit.772205fb.js +++ /dev/null @@ -1 +0,0 @@ -var e=Object.assign;import{d as n,m as i,b as l,g as t,u as a,r as d,w as r,c,a as o,S as s,e as h,f as p,h as u,i as v,j as b}from"./index.039d73cc.js";/* empty css */import"./vendor.9babb3f5.js";var f=n({name:"sb-layout-edit",model:i,props:e(e({},l),{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:t}}),setup(n){const{activate:i}=a(n.id),l=d({orientation:n.data.orientation,children:[...n.data.children]});r((()=>n.data),(()=>{l.orientation=n.data.orientation,l.children=[...n.data.children]}));const t=c((()=>({"sb-layout":!0,[`sb-layout_${l.orientation}`]:!0}))),f=()=>{console.log("toggle"),n.onUpdate({orientation:"vertical"===l.orientation?"horizontal":"vertical"})},m=e=>{l.children=[...l.children,e],n.onUpdate({children:[...l.children]}),i(e.id)},U=(e,t)=>{l.children=[...l.children.slice(0,e+1),t,...l.children.slice(e+1)],n.onUpdate({children:[...l.children]}),i(t.id)},y=e=>{l.children=[...l.children.slice(0,e),...l.children.slice(e+1)],n.onUpdate({children:[...l.children]});const t=Math.max(e-1,0);i(l.children[t].id)},g=e=>{const n=Math.max(Math.min(l.children.length-1,e),0);i(l.children[n].id)};return()=>o("div",{class:t.value},[o(s,null,{default:()=>[o(h,{type:"button",onClick:f},{default:()=>[l.orientation]})]}),...l.children.map(((i,t)=>o(p,u({key:i.id},{"data-order":t,block:i,onUpdate:t=>((i,t)=>{const a=l.children.indexOf(i);-1!==a&&n.onUpdate({children:[...l.children.slice(0,a),e(e({},i),t),...l.children.slice(a+1)]})})(i,t),onRemoveSelf:()=>y(t),onPrependBlock:e=>U(t-1,e),onAppendBlock:e=>U(t,e),onActivatePrevious:e=>g(t-1),onActivateNext:e=>g(t+1)}),{"context-toolbar":()=>o(v,{onMoveBackward:()=>(e=>{if(0===e)return;const i=l.children[e],t=l.children[e-1];l.children=[...l.children.slice(0,e-1),i,t,...l.children.slice(e+1)],n.onUpdate({children:[...l.children]})})(t),onMoveForward:()=>(e=>{if(e===l.children.length-1)return;const i=l.children[e],t=l.children[e+1];l.children=[...l.children.slice(0,e),t,i,...l.children.slice(e+2)],n.onUpdate({children:[...l.children]})})(t),onRemove:()=>y(t),sortable:n.sortable},null)}))),o(b,{onInsertBlock:m},null)])}});export default f; diff --git a/docs/assets/edit.fbd6e1aa.js b/docs/assets/edit.fbd6e1aa.js new file mode 100644 index 0000000..91ab641 --- /dev/null +++ b/docs/assets/edit.fbd6e1aa.js @@ -0,0 +1 @@ +var a=Object.assign;import{y as e,m as t,z as l,A as s,B as n,C as i,D as d,S as r,b as o,E as c,F as u,e as p}from"./index.be3c5d52.js";/* empty css */import"./vendor.9babb3f5.js";var v=e({name:"sb-image-edit",model:t,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:l}},setup(e){const t=s({src:e.data.src,alt:e.data.alt,description:e.data.description}),l=n(null);i((()=>e.data),(()=>{t.src=e.data.src,t.alt=e.data.alt,t.description=e.data.description}));const v=()=>{l.value&&l.value.click()},f=()=>{if(l.value&&l.value.files&&l.value.files.length){const a=new FileReader;a.addEventListener("load",(()=>{var t;const l=null==(t=null==a?void 0:a.result)?void 0:t.toString();if(!l)throw new Error("Couldn't load image src");e.onUpdate({src:l,alt:e.data.alt,description:e.data.description})})),a.readAsDataURL(l.value.files[0])}};return()=>d("figure",{class:"sb-image"},[d(r,null,{default:()=>[t.src?d(o,{"onClick:value":v},{default:()=>[c("Select Image")]}):null,d("input",{type:"file",ref:l,style:"display: none;",onInput:f},null)]}),t.src?d(u,null,[d("img",{src:t.src,alt:t.alt,class:"sb-image__content"},null),d(p,{block:t.description,onUpdate:t=>{return l=t,void e.onUpdate(a(a({},e.data),{description:l}));var l}},null)]):d(o,{"onClick:value":v},{default:()=>[c("Select Image")]})])}});export default v; diff --git a/docs/assets/index.039d73cc.js b/docs/assets/index.039d73cc.js deleted file mode 100644 index 19905dc..0000000 --- a/docs/assets/index.039d73cc.js +++ /dev/null @@ -1 +0,0 @@ -var t=Object.assign;import{d as e,a as n,r as o,b as r,o as s,c as l,e as c,f as i,g as a}from"./vendor.9babb3f5.js";var u,f;!function(t=".",e="__import__"){try{self[e]=new Function("u","return import(u)")}catch(n){const o=new URL(t,location),r=t=>{URL.revokeObjectURL(t.src),t.remove()};self[e]=t=>new Promise(((n,s)=>{const l=new URL(t,o);if(self[e].moduleMap[l])return n(self[e].moduleMap[l]);const c=new Blob([`import * as m from '${l}';`,`${e}.moduleMap['${l}']=m;`],{type:"text/javascript"}),i=Object.assign(document.createElement("script"),{type:"module",src:URL.createObjectURL(c),onerror(){s(new Error(`Failed to import: ${t}`)),r(i)},onload(){n(self[e].moduleMap[l]),r(i)}});document.head.appendChild(i)})),self[e].moduleMap={}}}("/schlechtenburg/assets/"),(f=u||(u={})).Edit="edit",f.Display="display";const p=Symbol("Schlechtenburg mode"),d={prop:"block",event:"update"},h={id:{type:String,default:()=>""+ +new Date},data:{type:Object,default:()=>({})}};function _(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const v=_("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function g(t){if(j(t)){const e={};for(let n=0;n{if(t){const n=t.split(b);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function w(t){let e="";if(F(t))e=t;else if(j(t))for(let n=0;n{},x=/^on[^a-z]/,R=t=>x.test(t),C=Object.assign,E=Object.prototype.hasOwnProperty,O=(t,e)=>E.call(t,e),j=Array.isArray,$=t=>"[object Map]"===N(t),P=t=>"function"==typeof t,F=t=>"string"==typeof t,I=t=>"symbol"==typeof t,M=t=>null!==t&&"object"==typeof t,A=Object.prototype.toString,N=t=>A.call(t),T=t=>F(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,U=(t,e)=>t!==e&&(t==t||e==e),D=new WeakMap,z=[];let B;const V=Symbol(""),L=Symbol("");function W(t,e=k){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!z.includes(n)){q(n);try{return H.push(J),J=!0,z.push(n),B=n,t()}finally{z.pop(),Q(),B=z[z.length-1]}}};return n.id=K++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let K=0;function q(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==B||t.allowRecurse)&&c.add(t)}))};if("clear"===e)l.forEach(i);else if("length"===n&&j(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&i(t)}));else switch(void 0!==n&&i(l.get(n)),e){case"add":j(t)?T(n)&&i(l.get("length")):(i(l.get(V)),$(t)&&i(l.get(L)));break;case"delete":j(t)||(i(l.get(V)),$(t)&&i(l.get(L)));break;case"set":$(t)&&i(l.get(V))}c.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const Z=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(I)),tt=st(),et=st(!1,!0),nt=st(!0),ot=st(!0,!0),rt={};function st(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?Ft:Pt).get(n))return n;const s=j(n);if(!t&&s&&O(rt,o))return Reflect.get(rt,o,r);const l=Reflect.get(n,o,r);if(I(o)?Z.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||X(n,0,o),e)return l;if(Vt(l)){return!s||!T(o)?l.value:l}return M(l)?t?At(l):Mt(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];rt[t]=function(...t){const n=zt(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];rt[t]=function(...t){G();const n=e.apply(this,t);return Q(),n}}));function lt(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=zt(o),!j(e)&&Vt(s)&&!Vt(o)))return s.value=o,!0;const l=j(e)&&T(n)?Number(n)!0,deleteProperty:(t,e)=>!0},at=C({},ct,{get:et,set:lt(!0)});C({},it,{get:ot});const ut=t=>M(t)?Mt(t):t,ft=t=>M(t)?At(t):t,pt=t=>t,dt=t=>Reflect.getPrototypeOf(t);function ht(t,e,n=!1,o=!1){const r=zt(t=t.__v_raw),s=zt(e);e!==s&&!n&&X(r,0,e),!n&&X(r,0,s);const{has:l}=dt(r),c=n?ft:o?pt:ut;return l.call(r,e)?c(t.get(e)):l.call(r,s)?c(t.get(s)):void 0}function _t(t,e=!1){const n=this.__v_raw,o=zt(n),r=zt(t);return t!==r&&!e&&X(o,0,t),!e&&X(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function vt(t,e=!1){return t=t.__v_raw,!e&&X(zt(t),0,V),Reflect.get(t,"size",t)}function gt(t){t=zt(t);const e=zt(this),n=dt(e).has.call(e,t);return e.add(t),n||Y(e,"add",t,t),this}function yt(t,e){e=zt(e);const n=zt(this),{has:o,get:r}=dt(n);let s=o.call(n,t);s||(t=zt(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?U(e,l)&&Y(n,"set",t,e):Y(n,"add",t,e),this}function bt(t){const e=zt(this),{has:n,get:o}=dt(e);let r=n.call(e,t);r||(t=zt(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&Y(e,"delete",t,void 0),s}function mt(){const t=zt(this),e=0!==t.size,n=t.clear();return e&&Y(t,"clear",void 0,void 0),n}function wt(t,e){return function(n,o){const r=this,s=r.__v_raw,l=zt(s),c=t?ft:e?pt:ut;return!t&&X(l,0,V),s.forEach(((t,e)=>n.call(o,c(t),c(e),r)))}}function kt(t,e,n){return function(...o){const r=this.__v_raw,s=zt(r),l=$(s),c="entries"===t||t===Symbol.iterator&&l,i="keys"===t&&l,a=r[t](...o),u=e?ft:n?pt:ut;return!e&&X(s,0,i?L:V),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function St(t){return function(...e){return"delete"!==t&&this}}const xt={get(t){return ht(this,t)},get size(){return vt(this)},has:_t,add:gt,set:yt,delete:bt,clear:mt,forEach:wt(!1,!1)},Rt={get(t){return ht(this,t,!1,!0)},get size(){return vt(this)},has:_t,add:gt,set:yt,delete:bt,clear:mt,forEach:wt(!1,!0)},Ct={get(t){return ht(this,t,!0)},get size(){return vt(this,!0)},has(t){return _t.call(this,t,!0)},add:St("add"),set:St("set"),delete:St("delete"),clear:St("clear"),forEach:wt(!0,!1)};function Et(t,e){const n=e?Rt:t?Ct:xt;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(O(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{xt[t]=kt(t,!1,!1),Ct[t]=kt(t,!0,!1),Rt[t]=kt(t,!1,!0)}));const Ot={get:Et(!1,!1)},jt={get:Et(!1,!0)},$t={get:Et(!0,!1)},Pt=new WeakMap,Ft=new WeakMap;function It(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>N(t).slice(8,-1))(t))}function Mt(t){return t&&t.__v_isReadonly?t:Nt(t,!1,ct,Ot)}function At(t){return Nt(t,!0,it,$t)}function Nt(t,e,n,o){if(!M(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?Ft:Pt,s=r.get(t);if(s)return s;const l=It(t);if(0===l)return t;const c=new Proxy(t,2===l?o:n);return r.set(t,c),c}function Tt(t){return Ut(t)?Tt(t.__v_raw):!(!t||!t.__v_isReactive)}function Ut(t){return!(!t||!t.__v_isReadonly)}function Dt(t){return Tt(t)||Ut(t)}function zt(t){return t&&zt(t.__v_raw)||t}const Bt=t=>M(t)?Mt(t):t;function Vt(t){return Boolean(t&&!0===t.__v_isRef)}function Lt(t){return function(t,e=!1){if(Vt(t))return t;return new Wt(t,e)}(t)}class Wt{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:Bt(t)}get value(){return X(zt(this),0,"value"),this._value}set value(t){U(zt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:Bt(t),Y(zt(this),"set","value",t))}}class Kt{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=W(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,Y(zt(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),X(zt(this),0,"value"),this._value}set value(t){this._setter(t)}}function qt(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){Ht(s,e,n)}return r}function Jt(t,e,n,o){if(P(t)){const s=qt(t,e,n,o);return s&&(M(r=s)&&P(r.then)&&P(r.catch))&&s.catch((t=>{Ht(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function de(t){Qt=!1,Gt=!0,fe(t),Xt.sort(((t,e)=>pe(t)-pe(e)));try{for(Yt=0;Ytpe(t)-pe(e))),re=0;re_e+=t;const ge=(ye="um",(t,e=Je)=>function(t,e,n=Je,o=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;G(),He(n);const r=Jt(e,n,t,o);return He(null),Q(),r});return o?r.unshift(s):r.push(s),s}}(ye,t,e));var ye;const be={};function me(t,e,n){return we(t,e,n)}function we(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=k,c=Je){let i,a,u=!1;if(Vt(t)?(i=()=>t.value,u=!!t._shallow):Tt(t)?(i=()=>t,o=!0):i=j(t)?()=>t.map((t=>Vt(t)?t.value:Tt(t)?Se(t):P(t)?qt(t,c,2):void 0)):P(t)?e?()=>qt(t,c,2):()=>{if(!c||!c.isUnmounted)return a&&a(),qt(t,c,3,[f])}:S,e&&o){const t=i;i=()=>Se(t())}const f=t=>{a=_.options.onStop=()=>{qt(t,c,4)}};let p=j(t)?[]:be;const d=()=>{if(_.active)if(e){const t=_();(o||u||U(t,p))&&(a&&a(),Jt(e,c,3,[t,p===be?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>Ee(d,c&&c.suspense):()=>{!c||c.isMounted?function(t){ue(t,te,Zt,ee)}(d):d()};const _=W(i,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return Ge(_,c),e?n?d():p=_():"post"===r?Ee(_,c&&c.suspense):_(),()=>{var t;(t=_).active&&(q(t),t.options.onStop&&t.options.onStop(),t.active=!1),c&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(c.effects,_)}}function ke(t,e,n){const o=this.proxy;return we(F(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function Se(t,e=new Set){if(!M(t)||e.has(t))return t;if(e.add(t),Vt(t))Se(t.value,e);else if(j(t))for(let n=0;n{Se(t,e)}));else for(const n in t)Se(t[n],e);return t}function xe(t){return P(t)?{setup:t,name:t.name}:t}function Re(t){P(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:c}=t;let i,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),c)return new Promise(((e,n)=>{c(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),i=e,e))))};return xe({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=Je;if(i)return()=>Ce(i,t);const e=e=>{a=null,Ht(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>Ce(e,t))).catch((t=>(e(t),()=>o?Ae(o,{error:t}):null)));const c=Lt(!1),u=Lt(),p=Lt(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!c.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{c.value=!0})).catch((t=>{e(t),u.value=t})),()=>c.value&&i?Ce(i,t):u.value&&o?Ae(o,{error:u.value}):n&&!p.value?Ae(n):void 0}})}function Ce(t,{vnode:{ref:e,props:n,children:o}}){const r=Ae(t,n,o);return r.ref=e,r}const Ee=function(t,e){e&&e.pendingBranch?j(t)?e.effects.push(...t):e.effects.push(t):ue(t,oe,ne,re)},Oe=Symbol(),je=Symbol(void 0),$e=Symbol(void 0),Pe=Symbol(void 0);function Fe(t){return!!t&&!0===t.__v_isVNode}const Ie=({key:t})=>null!=t?t:null,Me=({ref:t})=>null!=t?F(t)||Vt(t)||P(t)?{i:null,r:t}:t:null,Ae=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==Oe||(t=Pe);if(Fe(t)){const o=Ne(t,e,!0);return n&&De(o,n),o}l=t,P(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(Dt(e)||"__vInternal"in e)&&(e=C({},e));let{class:t,style:n}=e;t&&!F(t)&&(e.class=w(t)),M(n)&&(Dt(n)&&!j(n)&&(n=C({},n)),e.style=g(n))}const c=F(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:M(t)?4:P(t)?2:0,i={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Ie(e),ref:e&&Me(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(De(i,n),128&c){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=he(n.default),r=he(n.fallback)):(o=he(n),r=Ue(null)),{content:o,fallback:r}}(i);i.ssContent=t,i.ssFallback=e}0;return i};function Ne(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?ze(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Ie(l),ref:e&&e.ref?n&&r?j(r)?r.concat(Me(e)):[r,Me(e)]:Me(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==je?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ne(t.ssContent),ssFallback:t.ssFallback&&Ne(t.ssFallback),el:t.el,anchor:t.anchor}}function Te(t=" ",e=0){return Ae($e,null,t,e)}function Ue(t){return null==t||"boolean"==typeof t?Ae(Pe):j(t)?Ae(je,null,t):"object"==typeof t?null===t.el?t:Ne(t):Ae($e,null,String(t))}function De(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(j(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&ve(1),De(t,n()),n._c&&ve(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else P(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[Te(e)]):n=8);t.children=e,t.shapeFlag|=n}function ze(...t){const e=C({},t[0]);for(let n=1;n1)return n&&P(e)?e():e}}function Le(t,e,n){const o=n.appContext.config.optionMergeStrategies,{mixins:r,extends:s}=e;s&&Le(t,s,n),r&&r.forEach((e=>Le(t,e,n)));for(const l in e)o&&O(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const We=t=>t&&(t.proxy?t.proxy:We(t.parent)),Ke=C(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>We(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Le(l,e,t))),Le(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(Xt.length&&Xt.includes(e,Gt&&e.allowRecurse?Yt+1:Yt)||e===ce||(Xt.push(e),ae()));var e},$nextTick:t=>ie.bind(t.proxy),$watch:t=>ke.bind(t)}),qe={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:c,appContext:i}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const c=l[e];if(void 0!==c)switch(c){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==k&&O(o,e))return l[e]=0,o[e];if(r!==k&&O(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&O(a,e))return l[e]=2,s[e];if(n!==k&&O(n,e))return l[e]=3,n[e];l[e]=4}}const u=Ke[e];let f,p;return u?("$attrs"===e&&X(t,0,e),u(t)):(f=c.__cssModules)&&(f=f[e])?f:n!==k&&O(n,e)?(l[e]=3,n[e]):(p=i.config.globalProperties,O(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==k&&O(r,e))r[e]=n;else if(o!==k&&O(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let c;return void 0!==n[l]||t!==k&&O(t,l)||e!==k&&O(e,l)||(c=s[0])&&O(c,l)||O(o,l)||O(Ke,l)||O(r.config.globalProperties,l)}};C({},qe,{get(t,e){if(e!==Symbol.unscopables)return qe.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!v(e)});let Je=null;const He=t=>{Je=t};function Ge(t,e=Je){e&&(e.effects||(e.effects=[])).push(t)}function Qe(t){const e=function(t){let e,n;return P(t)?(e=t,n=S):(e=t.get,n=t.set),new Kt(e,n,P(t)||!t.set)}(t);return Ge(e.effect),e}const Xe=Symbol("Schlechtenburg active block");function Ye(t){const e=Ve(Xe,Lt(null)),n=Qe((()=>e.value===t)),o=n=>{e.value=void 0!==n?n:t};return{activeBlockId:e,isActive:n,activate:o,requestActivation:()=>{e.value||o()}}}const Ze=Symbol("Schlechtenburg block library");function tn(){const t=Ve(p,Lt(u.Edit)),e=Ve(Ze,Mt({}));return{mode:t,customBlocks:e,getBlock:t=>e[t]}}const en=Symbol("Schlechtenburg block dimensions"),nn=Symbol("Schlechtenburg editor dimensions");function on(t,e){const n=Lt(null);Be(e,n);const o=()=>{if(!t.value)return;const e=t.value.getBoundingClientRect();n.value={width:e.width,height:e.height,left:t.value.offsetLeft,top:t.value.offsetTop}},r=new ResizeObserver(o),s=new MutationObserver(o);return me(t,(()=>{t.value&&(r.observe(t.value),s.observe(t.value,{attributes:!0,childList:!1,subtree:!1}))})),{triggerSizeCalculation:o,dimensions:n}}function rn(){return{editorDimensions:Ve(nn,Lt(null)),blockDimensions:Ve(en,Lt(null))}}const sn=Symbol("Schlechtenburg block tree"),ln=Symbol("Schlechtenburg block tree"),cn=Symbol("Schlechtenburg block tree");function an(){const t=Ve(sn,null),e=Ve(ln,(t=>{})),n=Ve(cn,(t=>{})),o=Mt({id:"",name:"",icon:"",children:[]});Be(ln,(t=>{o.children.find((e=>e.id===t.id))||(o.children=[...o.children,t])})),Be(cn,(({id:t})=>{o.children=o.children.filter((e=>e.id!==t))}));return ge((()=>{o.id&&n(o)})),{blockTree:t,register:t=>{if(!t.id)throw new Error(`Cannot register a block without an id: ${JSON.stringify(t)}`);o.id=t.id,o.name=t.name,e(o)}}}const un=xe({name:"sb-button",inheritAttrs:!1,setup:(e,n)=>()=>Ae("button",t(t({},n.attrs),{class:(n.attrs.class||"")+" sb-button"}),[n.slots.default()])});const fn=xe({name:"sb-context-menu",props:{onClose:{type:Function,default:()=>{}},onOpen:{type:Function,default:()=>{}}},setup(t,e){const n=Lt(!1),o=()=>{n.value=!0},r=()=>{n.value=!1},s=t=>{"Escape"===t.key&&r()},l=()=>{n.value?r():o()};return me(n,((t,e)=>{t!==e&&(t?setTimeout((()=>{document.body.addEventListener("click",r),document.body.addEventListener("keypress",s)})):(document.body.removeEventListener("click",r),document.body.removeEventListener("keypress",s)))})),()=>Ae("div",{class:"sb-context"},[e.slots.context({opened:n,toggle:l,close:r,open:o})||Ae(un,{onClick:l},{default:()=>[Te("Menu")]}),Ae("dialog",{class:"sb-context-menu",open:!!n.value||void 0,onClose:r,onClick:t=>{t.stopPropagation()}},[e.slots.default({opened:n,toggle:l,close:r,open:o})||null])])}});const pn=xe({name:"sb-main-menu",setup(){const{blockTree:t}=an(),{activate:e,activeBlockId:n}=Ye(),o=(t,r)=>Ae("li",{class:{"sb-tree-block-select__block":!0,"sb-tree-block-select__block_active":n.value===t.id}},[Ae("button",{class:"sb-tree-block-select__block-name",onClick:()=>{e(t.id),r()},onMouseEnter:()=>e(t.id)},[t.name]),t.children.length?Ae("ul",{class:"sb-tree-block-select__list"},[t.children.map((t=>o(t,r)))]):null]);return()=>t.value?Ae(fn,{class:"sb-tree-block-select"},{context:({toggle:t})=>Ae(un,{onClick:t},{default:()=>[Te("Tree")]}),default:({close:e})=>Ae("ul",{class:"sb-tree-block-select__list sb-tree-block-select__list_base"},[o(t.value,e)])}):""}});const dn=xe({name:"sb-main-menu",props:{block:{type:null,required:!0}},setup:(t,e)=>()=>Ae("div",{class:"sb-main-menu"},[Ae(pn,{block:t.block},null)])});const hn=xe({name:"sb-block-toolbar",props:{block:{type:null,required:!0}},setup:(t,e)=>()=>Ae("div",{class:"sb-block-toolbar"},null)});let _n;const vn={},gn=function(t,e){if(!e)return t();if(void 0===_n){const t=document.createElement("link").relList;_n=t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(e.map((t=>{if(t in vn)return;vn[t]=!0;const e=t.endsWith(".css"),n=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":_n,e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((t,e)=>{o.addEventListener("load",t),o.addEventListener("error",e)})):void 0}))).then((()=>t()))};var yn={name:"sb-missing-block",edit:Re((()=>gn((()=>__import__("./display.344ee7da.js")),["/schlechtenburg/assets/display.344ee7da.js","/schlechtenburg/assets/display.08a50fb3.css","/schlechtenburg/assets/vendor.9babb3f5.js"]))),display:Re((()=>gn((()=>__import__("./display.344ee7da.js")),["/schlechtenburg/assets/display.344ee7da.js","/schlechtenburg/assets/display.08a50fb3.css","/schlechtenburg/assets/vendor.9babb3f5.js"])))};const bn=xe({name:"sb-block",props:{block:{type:null,required:!0},sortable:{type:String,default:null},onUpdate:{type:Function,default:()=>{}},onPrependBlock:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onMoveBackward:{type:Function,default:()=>{}},onMoveForward:{type:Function,default:()=>{}}},setup(e,n){const o=Lt(null),{mode:r,getBlock:s}=tn(),{isActive:l,activate:c,isHighlighted:i}=Ye(e.block.id),a=Qe((()=>({"sb-block":!0,"sb-block_active":l.value}))),{triggerSizeCalculation:f}=on(o,en);me((()=>e.block.data),f);const{register:p}=an();p(e.block),me(e.block,(()=>{p(e.block)}));const d=n=>{e.onUpdate(t(t({},e.block),{data:t(t({},e.block.data),n)}))};return()=>{var t;const l=null==(t=s(e.block.name))?void 0:t[r.value];if(!l){const t=yn[r.value];return Ae(t,{name:e.block.name,blockId:e.block.id},null)}return r.value===u.Display?Ae(l,{data:e.block.data,blockId:e.block.id},null):Ae("div",{ref:o,class:a.value},[Ae("div",{class:"sb-block__edit-cover"},null),n.slots["context-toolbar"]?n.slots["context-toolbar"]():null,Ae(l,ze({data:e.block.data,blockId:e.block.id,onUpdate:d,onPrependBlock:e.onPrependBlock,onAppendBlock:e.onAppendBlock,onRemoveSelf:e.onRemoveSelf,onActivatePrevious:e.onActivatePrevious,onActivateNext:e.onActivateNext,onClick:t=>{t.stopPropagation(),c()}},n.attrs),null)])}}});const mn=xe({name:"schlechtenburg-main",model:d,props:{customBlocks:{type:Array,default:()=>[]},block:{type:Object,required:!0},onUpdate:{type:Function,default:()=>{}},mode:{type:String,validator:t=>Object.values(u).includes(t),default:u.Edit}},setup(e){const n=Lt(null);on(n,nn);const o=Lt(e.mode);Be(p,o);const r=Lt(null);Be(Xe,r);const s=Lt(null);Be(sn,s),Be(ln,(t=>{s.value=t})),Be(cn,(()=>{s.value=null}));const l=Nt(t({},e.customBlocks.reduce(((e,n)=>t(t({},e),{[n.name]:n})),{})),!1,at,jt);return Be(Ze,l),()=>Ae("div",{class:"sb-main",ref:n},[o.value===u.Edit?Ae(je,null,[Ae(dn,{block:e.block},null),Ae(hn,{block:e.block},null)]):null,Ae(bn,{block:e.block,onUpdate:e.onUpdate},null)])}});const wn=xe({name:"sb-modal",props:{open:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}}},setup(t,e){const n=Qe((()=>({"sb-modal":!0,"sb-modal_open":t.open})));return()=>Ae("div",{class:n.value},[Ae("div",{class:"sb-modal__overlay",onClick:e=>{e.stopPropagation(),t.onClose()}},[Ae("div",{class:"sb-modal__content"},[e.slots.default()])])])}});const kn=xe({name:"sb-block-picker",props:{},setup(t,e){const n=Lt(!1),{customBlocks:o}=tn(),r=Qe((()=>Object.keys(o).map((t=>o[t])))),s=t=>()=>{n.value=!1,e.emit("picked-block",{name:t.name,id:""+ +new Date,data:t.getDefaultData()})};return()=>Ae("div",{class:"sb-block-picker"},[Ae(un,{class:"sb-block-picker__add-button",type:"button",onClick:t=>{n.value=!0,t.stopPropagation()}},{default:()=>[Te("+")]}),Ae(wn,{open:n.value,onClick:t=>t.stopPropagation(),onClose:()=>{n.value=!1}},{default:()=>[...r.value.map((t=>Ae(un,{type:"button",onClick:s(t)},{default:()=>[t.name]})))]})])}});var Sn="object"==typeof global&&global&&global.Object===Object&&global,xn="object"==typeof self&&self&&self.Object===Object&&self,Rn=Sn||xn||Function("return this")(),Cn=Rn.Symbol,En=Object.prototype,On=En.hasOwnProperty,jn=En.toString,$n=Cn?Cn.toStringTag:void 0;var Pn=Object.prototype.toString;var Fn=Cn?Cn.toStringTag:void 0;function In(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Fn&&Fn in Object(t)?function(t){var e=On.call(t,$n),n=t[$n];try{t[$n]=void 0;var o=!0}catch(s){}var r=jn.call(t);return o&&(e?t[$n]=n:delete t[$n]),r}(t):function(t){return Pn.call(t)}(t)}function Mn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var An=/^\s+|\s+$/g,Nn=/^[-+]0x[0-9a-f]+$/i,Tn=/^0b[01]+$/i,Un=/^0o[0-7]+$/i,Dn=parseInt;function zn(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==In(t)}(t))return NaN;if(Mn(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Mn(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(An,"");var n=Tn.test(t);return n||Un.test(t)?Dn(t.slice(2),n?2:8):Nn.test(t)?NaN:+t}var Bn=function(){return Rn.Date.now()},Vn=Math.max,Ln=Math.min;function Wn(t,e,n){var o,r,s,l,c,i,a=0,u=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=o,s=r;return o=r=void 0,a=e,l=t.apply(s,n)}function h(t){return a=t,c=setTimeout(v,e),u?d(t):l}function _(t){var n=t-i;return void 0===i||n>=e||n<0||f&&t-a>=s}function v(){var t=Bn();if(_(t))return g(t);c=setTimeout(v,function(t){var n=e-(t-i);return f?Ln(n,s-(t-a)):n}(t))}function g(t){return c=void 0,p&&o?d(t):(o=r=void 0,l)}function y(){var t=Bn(),n=_(t);if(o=arguments,r=this,i=t,n){if(void 0===c)return h(i);if(f)return clearTimeout(c),c=setTimeout(v,e),d(i)}return void 0===c&&(c=setTimeout(v,e)),l}return e=zn(e)||0,Mn(n)&&(u=!!n.leading,s=(f="maxWait"in n)?Vn(zn(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==c&&clearTimeout(c),a=0,o=i=r=c=void 0},y.flush=function(){return void 0===c?l:g(Bn())},y}const Kn=xe({name:"sb-block-ordering",props:{sortable:{type:String,default:null},onRemove:{type:Function,default:()=>{}},onMoveUp:{type:Function,default:()=>{}},onMoveDown:{type:Function,default:()=>{}}},setup(t){const e=Mt({top:"",right:""}),n=Qe((()=>({"sb-block-ordering":!0,[`sb-block-ordering_${t.sortable}`]:!!t.sortable}))),{editorDimensions:o,blockDimensions:r}=rn(),s=Wn((()=>{if(!o.value||!r.value)return;const t=o.value.width-r.value.left;e.top=`${r.value.top}px`,e.right=`${t}px`}));return me(o,s),me(r,s),me((()=>t.sortable),s),()=>Ae("div",{class:n.value,style:e,onClick:t=>t.stopPropagation()},[Ae(un,{onClick:t.onMoveUp},{default:()=>["vertical"===t.sortable?"↑":"←"]}),Ae(un,{onClick:t.onRemove},{default:()=>[Te("x")]}),Ae(un,{onClick:t.onMoveDown},{default:()=>["vertical"===t.sortable?"↓":"→"]})])}});const qn=xe({name:"sb-block-placeholder",setup:(t,e)=>()=>Ae("div",{class:"sb-block-placeholder"},[Ae(kn,{onPickedBlock:t=>e.emit("insert-block",t)},null)])});const Jn=xe({name:"sb-toolbar",setup(t,e){const n=Mt({bottom:"",left:"",maxWidth:""}),{editorDimensions:o,blockDimensions:r}=rn(),s=Wn((()=>{if(!o.value||!r.value)return;const t=o.value.height-r.value.top;n.bottom=`${t}px`,n.left=`${r.value.left}px`,n.maxWidth=`${r.value.width}px`}));return me(o,s),me(r,s),()=>{var t,o;return Ae("div",{class:"sb-toolbar",style:n,onClick:t=>t.stopPropagation()},[null==(o=null==(t=e.slots)?void 0:t.default)?void 0:o.call(t)])}}});const Hn=xe({name:"sb-select",inheritAttrs:!1,setup:(t,e)=>()=>Ae("div",{class:"sb-select"},[Ae("select",ze({class:"sb-select__input"},e.attrs),[e.slots.default()])])});function Gn(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const Qn=Gn("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function Xn(t){if(ao(t)){const e={};for(let n=0;n{if(t){const n=t.split(Zn);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function eo(t){let e="";if(po(t))e=t;else if(ao(t))for(let n=0;n{},ro=/^on[^a-z]/,so=t=>ro.test(t),lo=Object.assign,co=Object.prototype.hasOwnProperty,io=(t,e)=>co.call(t,e),ao=Array.isArray,uo=t=>"[object Map]"===go(t),fo=t=>"function"==typeof t,po=t=>"string"==typeof t,ho=t=>"symbol"==typeof t,_o=t=>null!==t&&"object"==typeof t,vo=Object.prototype.toString,go=t=>vo.call(t),yo=t=>po(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,bo=(t,e)=>t!==e&&(t==t||e==e),mo=new WeakMap,wo=[];let ko;const So=Symbol(""),xo=Symbol("");function Ro(t,e=no){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!wo.includes(n)){Eo(n);try{return jo.push(Oo),Oo=!0,wo.push(n),ko=n,t()}finally{wo.pop(),$o(),ko=wo[wo.length-1]}}};return n.id=Co++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let Co=0;function Eo(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==ko||t.allowRecurse)&&c.add(t)}))};if("clear"===e)l.forEach(i);else if("length"===n&&ao(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&i(t)}));else switch(void 0!==n&&i(l.get(n)),e){case"add":ao(t)?yo(n)&&i(l.get("length")):(i(l.get(So)),uo(t)&&i(l.get(xo)));break;case"delete":ao(t)||(i(l.get(So)),uo(t)&&i(l.get(xo)));break;case"set":uo(t)&&i(l.get(So))}c.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const Io=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(ho)),Mo=Do(),Ao=Do(!1,!0),No=Do(!0),To=Do(!0,!0),Uo={};function Do(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?ur:ar).get(n))return n;const s=ao(n);if(!t&&s&&io(Uo,o))return Reflect.get(Uo,o,r);const l=Reflect.get(n,o,r);if(ho(o)?Io.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||Po(n,0,o),e)return l;if(mr(l)){return!s||!yo(o)?l.value:l}return _o(l)?t?dr(l):pr(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];Uo[t]=function(...t){const n=yr(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];Uo[t]=function(...t){jo.push(Oo),Oo=!1;const n=e.apply(this,t);return $o(),n}}));function zo(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=yr(o),!ao(e)&&mr(s)&&!mr(o)))return s.value=o,!0;const l=ao(e)&&yo(n)?Number(n)!0,deleteProperty:(t,e)=>!0};lo({},Bo,{get:Ao,set:zo(!0)}),lo({},Vo,{get:To});const Lo=t=>_o(t)?pr(t):t,Wo=t=>_o(t)?dr(t):t,Ko=t=>t,qo=t=>Reflect.getPrototypeOf(t);function Jo(t,e,n=!1,o=!1){const r=yr(t=t.__v_raw),s=yr(e);e!==s&&!n&&Po(r,0,e),!n&&Po(r,0,s);const{has:l}=qo(r),c=n?Wo:o?Ko:Lo;return l.call(r,e)?c(t.get(e)):l.call(r,s)?c(t.get(s)):void 0}function Ho(t,e=!1){const n=this.__v_raw,o=yr(n),r=yr(t);return t!==r&&!e&&Po(o,0,t),!e&&Po(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function Go(t,e=!1){return t=t.__v_raw,!e&&Po(yr(t),0,So),Reflect.get(t,"size",t)}function Qo(t){t=yr(t);const e=yr(this),n=qo(e).has.call(e,t);return e.add(t),n||Fo(e,"add",t,t),this}function Xo(t,e){e=yr(e);const n=yr(this),{has:o,get:r}=qo(n);let s=o.call(n,t);s||(t=yr(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?bo(e,l)&&Fo(n,"set",t,e):Fo(n,"add",t,e),this}function Yo(t){const e=yr(this),{has:n,get:o}=qo(e);let r=n.call(e,t);r||(t=yr(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&Fo(e,"delete",t,void 0),s}function Zo(){const t=yr(this),e=0!==t.size,n=t.clear();return e&&Fo(t,"clear",void 0,void 0),n}function tr(t,e){return function(n,o){const r=this,s=r.__v_raw,l=yr(s),c=t?Wo:e?Ko:Lo;return!t&&Po(l,0,So),s.forEach(((t,e)=>n.call(o,c(t),c(e),r)))}}function er(t,e,n){return function(...o){const r=this.__v_raw,s=yr(r),l=uo(s),c="entries"===t||t===Symbol.iterator&&l,i="keys"===t&&l,a=r[t](...o),u=e?Wo:n?Ko:Lo;return!e&&Po(s,0,i?xo:So),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function nr(t){return function(...e){return"delete"!==t&&this}}const or={get(t){return Jo(this,t)},get size(){return Go(this)},has:Ho,add:Qo,set:Xo,delete:Yo,clear:Zo,forEach:tr(!1,!1)},rr={get(t){return Jo(this,t,!1,!0)},get size(){return Go(this)},has:Ho,add:Qo,set:Xo,delete:Yo,clear:Zo,forEach:tr(!1,!0)},sr={get(t){return Jo(this,t,!0)},get size(){return Go(this,!0)},has(t){return Ho.call(this,t,!0)},add:nr("add"),set:nr("set"),delete:nr("delete"),clear:nr("clear"),forEach:tr(!0,!1)};function lr(t,e){const n=e?rr:t?sr:or;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(io(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{or[t]=er(t,!1,!1),sr[t]=er(t,!0,!1),rr[t]=er(t,!1,!0)}));const cr={get:lr(!1,!1)},ir={get:lr(!0,!1)},ar=new WeakMap,ur=new WeakMap;function fr(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>go(t).slice(8,-1))(t))}function pr(t){return t&&t.__v_isReadonly?t:hr(t,!1,Bo,cr)}function dr(t){return hr(t,!0,Vo,ir)}function hr(t,e,n,o){if(!_o(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?ur:ar,s=r.get(t);if(s)return s;const l=fr(t);if(0===l)return t;const c=new Proxy(t,2===l?o:n);return r.set(t,c),c}function _r(t){return vr(t)?_r(t.__v_raw):!(!t||!t.__v_isReactive)}function vr(t){return!(!t||!t.__v_isReadonly)}function gr(t){return _r(t)||vr(t)}function yr(t){return t&&yr(t.__v_raw)||t}const br=t=>_o(t)?pr(t):t;function mr(t){return Boolean(t&&!0===t.__v_isRef)}function wr(t){return function(t,e=!1){if(mr(t))return t;return new kr(t,e)}(t)}class kr{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:br(t)}get value(){return Po(yr(this),0,"value"),this._value}set value(t){bo(yr(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:br(t),Fo(yr(this),"set","value",t))}}class Sr{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=Ro(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,Fo(yr(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),Po(yr(this),0,"value"),this._value}set value(t){this._setter(t)}}function xr(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){Cr(s,e,n)}return r}function Rr(t,e,n,o){if(fo(t)){const s=xr(t,e,n,o);return s&&(_o(r=s)&&fo(r.then)&&fo(r.catch))&&s.catch((t=>{Cr(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function Kr(t){Or=!1,Er=!0,Lr(t),jr.sort(((t,e)=>Wr(t)-Wr(e)));try{for($r=0;$rWr(t)-Wr(e))),Nr=0;NrJr+=t;const Gr={};function Qr(t,e,n){return Xr(t,e,n)}function Xr(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=no,c=ws){let i,a,u=!1;if(mr(t)?(i=()=>t.value,u=!!t._shallow):_r(t)?(i=()=>t,o=!0):i=ao(t)?()=>t.map((t=>mr(t)?t.value:_r(t)?Zr(t):fo(t)?xr(t,c,2):void 0)):fo(t)?e?()=>xr(t,c,2):()=>{if(!c||!c.isUnmounted)return a&&a(),xr(t,c,3,[f])}:oo,e&&o){const t=i;i=()=>Zr(t())}const f=t=>{a=_.options.onStop=()=>{xr(t,c,4)}};let p=ao(t)?[]:Gr;const d=()=>{if(_.active)if(e){const t=_();(o||u||bo(t,p))&&(a&&a(),Rr(e,c,3,[t,p===Gr?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>os(d,c&&c.suspense):()=>{!c||c.isMounted?function(t){Vr(t,Fr,Pr,Ir)}(d):d()};const _=Ro(i,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return ks(_,c),e?n?d():p=_():"post"===r?os(_,c&&c.suspense):_(),()=>{var t;(t=_).active&&(Eo(t),t.options.onStop&&t.options.onStop(),t.active=!1),c&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(c.effects,_)}}function Yr(t,e,n){const o=this.proxy;return Xr(po(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function Zr(t,e=new Set){if(!_o(t)||e.has(t))return t;if(e.add(t),mr(t))Zr(t.value,e);else if(ao(t))for(let n=0;n{Zr(t,e)}));else for(const n in t)Zr(t[n],e);return t}function ts(t){return fo(t)?{setup:t,name:t.name}:t}function es(t){fo(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:c}=t;let i,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),c)return new Promise(((e,n)=>{c(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),i=e,e))))};return ts({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=ws;if(i)return()=>ns(i,t);const e=e=>{a=null,Cr(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>ns(e,t))).catch((t=>(e(t),()=>o?fs(o,{error:t}):null)));const c=wr(!1),u=wr(),p=wr(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!c.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{c.value=!0})).catch((t=>{e(t),u.value=t})),()=>c.value&&i?ns(i,t):u.value&&o?fs(o,{error:u.value}):n&&!p.value?fs(n):void 0}})}function ns(t,{vnode:{ref:e,props:n,children:o}}){const r=fs(t,n,o);return r.ref=e,r}const os=function(t,e){e&&e.pendingBranch?ao(t)?e.effects.push(...t):e.effects.push(t):Vr(t,Ar,Mr,Nr)},rs=Symbol(),ss=Symbol(void 0),ls=Symbol(void 0),cs=Symbol(void 0);function is(t){return!!t&&!0===t.__v_isVNode}const as=({key:t})=>null!=t?t:null,us=({ref:t})=>null!=t?po(t)||mr(t)||fo(t)?{i:null,r:t}:t:null,fs=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==rs||(t=cs);if(is(t)){const o=ps(t,e,!0);return n&&_s(o,n),o}l=t,fo(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(gr(e)||"__vInternal"in e)&&(e=lo({},e));let{class:t,style:n}=e;t&&!po(t)&&(e.class=eo(t)),_o(n)&&(gr(n)&&!ao(n)&&(n=lo({},n)),e.style=Xn(n))}const c=po(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:_o(t)?4:fo(t)?2:0,i={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&as(e),ref:e&&us(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(_s(i,n),128&c){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=qr(n.default),r=qr(n.fallback)):(o=qr(n),r=hs(null)),{content:o,fallback:r}}(i);i.ssContent=t,i.ssFallback=e}0;return i};function ps(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?vs(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&as(l),ref:e&&e.ref?n&&r?ao(r)?r.concat(us(e)):[r,us(e)]:us(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ss?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ps(t.ssContent),ssFallback:t.ssFallback&&ps(t.ssFallback),el:t.el,anchor:t.anchor}}function ds(t=" ",e=0){return fs(ls,null,t,e)}function hs(t){return null==t||"boolean"==typeof t?fs(cs):ao(t)?fs(ss,null,t):"object"==typeof t?null===t.el?t:ps(t):fs(ls,null,String(t))}function _s(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(ao(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&Hr(1),_s(t,n()),n._c&&Hr(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else fo(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[ds(e)]):n=8);t.children=e,t.shapeFlag|=n}function vs(...t){const e=lo({},t[0]);for(let n=1;ngs(t,e,n)));for(const l in e)o&&io(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const ys=t=>t&&(t.proxy?t.proxy:ys(t.parent)),bs=lo(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>ys(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>gs(l,e,t))),gs(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(jr.length&&jr.includes(e,Er&&e.allowRecurse?$r+1:$r)||e===Dr||(jr.push(e),Br()));var e},$nextTick:t=>zr.bind(t.proxy),$watch:t=>Yr.bind(t)}),ms={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:c,appContext:i}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const c=l[e];if(void 0!==c)switch(c){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==no&&io(o,e))return l[e]=0,o[e];if(r!==no&&io(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&io(a,e))return l[e]=2,s[e];if(n!==no&&io(n,e))return l[e]=3,n[e];l[e]=4}}const u=bs[e];let f,p;return u?("$attrs"===e&&Po(t,0,e),u(t)):(f=c.__cssModules)&&(f=f[e])?f:n!==no&&io(n,e)?(l[e]=3,n[e]):(p=i.config.globalProperties,io(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==no&&io(r,e))r[e]=n;else if(o!==no&&io(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let c;return void 0!==n[l]||t!==no&&io(t,l)||e!==no&&io(e,l)||(c=s[0])&&io(c,l)||io(o,l)||io(bs,l)||io(r.config.globalProperties,l)}};lo({},ms,{get(t,e){if(e!==Symbol.unscopables)return ms.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!Qn(e)});let ws=null;function ks(t,e=ws){e&&(e.effects||(e.effects=[])).push(t)}function Ss(t){const e=function(t){let e,n;return fo(t)?(e=t,n=oo):(e=t.get,n=t.set),new Sr(e,n,fo(t)||!t.set)}(t);return ks(e.effect),e}const xs=()=>({orientation:"vertical",children:[]});var Rs={name:"sb-layout",getDefaultData:xs,edit:es((()=>gn((()=>__import__("./edit.772205fb.js")),["/schlechtenburg/assets/edit.772205fb.js","/schlechtenburg/assets/style.b876754e.css","/schlechtenburg/assets/vendor.9babb3f5.js"]))),display:es((()=>gn((()=>__import__("./display.57d7b574.js")),["/schlechtenburg/assets/display.57d7b574.js","/schlechtenburg/assets/style.b876754e.css","/schlechtenburg/assets/vendor.9babb3f5.js"])))};var Cs={name:"sb-heading",getDefaultData:()=>({}),edit:e((()=>gn((()=>__import__("./edit.bd5075df.js")),void 0))),display:e((()=>gn((()=>__import__("./edit.bd5075df.js")),void 0)))};function Es(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const Os=Es("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function js(t){if(Bs(t)){const e={};for(let n=0;n{if(t){const n=t.split(Ps);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function Is(t){let e="";if(Ws(t))e=t;else if(Bs(t))for(let n=0;n{},Ns=/^on[^a-z]/,Ts=t=>Ns.test(t),Us=Object.assign,Ds=Object.prototype.hasOwnProperty,zs=(t,e)=>Ds.call(t,e),Bs=Array.isArray,Vs=t=>"[object Map]"===Hs(t),Ls=t=>"function"==typeof t,Ws=t=>"string"==typeof t,Ks=t=>"symbol"==typeof t,qs=t=>null!==t&&"object"==typeof t,Js=Object.prototype.toString,Hs=t=>Js.call(t),Gs=t=>Ws(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,Qs=(t,e)=>t!==e&&(t==t||e==e),Xs=new WeakMap,Ys=[];let Zs;const tl=Symbol(""),el=Symbol("");function nl(t,e=Ms){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!Ys.includes(n)){rl(n);try{return ll.push(sl),sl=!0,Ys.push(n),Zs=n,t()}finally{Ys.pop(),il(),Zs=Ys[Ys.length-1]}}};return n.id=ol++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let ol=0;function rl(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==Zs||t.allowRecurse)&&c.add(t)}))};if("clear"===e)l.forEach(i);else if("length"===n&&Bs(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&i(t)}));else switch(void 0!==n&&i(l.get(n)),e){case"add":Bs(t)?Gs(n)&&i(l.get("length")):(i(l.get(tl)),Vs(t)&&i(l.get(el)));break;case"delete":Bs(t)||(i(l.get(tl)),Vs(t)&&i(l.get(el)));break;case"set":Vs(t)&&i(l.get(tl))}c.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const fl=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(Ks)),pl=gl(),dl=gl(!1,!0),hl=gl(!0),_l=gl(!0,!0),vl={};function gl(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?Vl:Bl).get(n))return n;const s=Bs(n);if(!t&&s&&zs(vl,o))return Reflect.get(vl,o,r);const l=Reflect.get(n,o,r);if(Ks(o)?fl.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||al(n,0,o),e)return l;if(Yl(l)){return!s||!Gs(o)?l.value:l}return qs(l)?t?Kl(l):Wl(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];vl[t]=function(...t){const n=Ql(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];vl[t]=function(...t){cl();const n=e.apply(this,t);return il(),n}}));function yl(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=Ql(o),!Bs(e)&&Yl(s)&&!Yl(o)))return s.value=o,!0;const l=Bs(e)&&Gs(n)?Number(n)!0,deleteProperty:(t,e)=>!0};Us({},bl,{get:dl,set:yl(!0)}),Us({},ml,{get:_l});const wl=t=>qs(t)?Wl(t):t,kl=t=>qs(t)?Kl(t):t,Sl=t=>t,xl=t=>Reflect.getPrototypeOf(t);function Rl(t,e,n=!1,o=!1){const r=Ql(t=t.__v_raw),s=Ql(e);e!==s&&!n&&al(r,0,e),!n&&al(r,0,s);const{has:l}=xl(r),c=n?kl:o?Sl:wl;return l.call(r,e)?c(t.get(e)):l.call(r,s)?c(t.get(s)):void 0}function Cl(t,e=!1){const n=this.__v_raw,o=Ql(n),r=Ql(t);return t!==r&&!e&&al(o,0,t),!e&&al(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function El(t,e=!1){return t=t.__v_raw,!e&&al(Ql(t),0,tl),Reflect.get(t,"size",t)}function Ol(t){t=Ql(t);const e=Ql(this),n=xl(e).has.call(e,t);return e.add(t),n||ul(e,"add",t,t),this}function jl(t,e){e=Ql(e);const n=Ql(this),{has:o,get:r}=xl(n);let s=o.call(n,t);s||(t=Ql(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?Qs(e,l)&&ul(n,"set",t,e):ul(n,"add",t,e),this}function $l(t){const e=Ql(this),{has:n,get:o}=xl(e);let r=n.call(e,t);r||(t=Ql(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&ul(e,"delete",t,void 0),s}function Pl(){const t=Ql(this),e=0!==t.size,n=t.clear();return e&&ul(t,"clear",void 0,void 0),n}function Fl(t,e){return function(n,o){const r=this,s=r.__v_raw,l=Ql(s),c=t?kl:e?Sl:wl;return!t&&al(l,0,tl),s.forEach(((t,e)=>n.call(o,c(t),c(e),r)))}}function Il(t,e,n){return function(...o){const r=this.__v_raw,s=Ql(r),l=Vs(s),c="entries"===t||t===Symbol.iterator&&l,i="keys"===t&&l,a=r[t](...o),u=e?kl:n?Sl:wl;return!e&&al(s,0,i?el:tl),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function Ml(t){return function(...e){return"delete"!==t&&this}}const Al={get(t){return Rl(this,t)},get size(){return El(this)},has:Cl,add:Ol,set:jl,delete:$l,clear:Pl,forEach:Fl(!1,!1)},Nl={get(t){return Rl(this,t,!1,!0)},get size(){return El(this)},has:Cl,add:Ol,set:jl,delete:$l,clear:Pl,forEach:Fl(!1,!0)},Tl={get(t){return Rl(this,t,!0)},get size(){return El(this,!0)},has(t){return Cl.call(this,t,!0)},add:Ml("add"),set:Ml("set"),delete:Ml("delete"),clear:Ml("clear"),forEach:Fl(!0,!1)};function Ul(t,e){const n=e?Nl:t?Tl:Al;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(zs(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{Al[t]=Il(t,!1,!1),Tl[t]=Il(t,!0,!1),Nl[t]=Il(t,!1,!0)}));const Dl={get:Ul(!1,!1)},zl={get:Ul(!0,!1)},Bl=new WeakMap,Vl=new WeakMap;function Ll(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>Hs(t).slice(8,-1))(t))}function Wl(t){return t&&t.__v_isReadonly?t:ql(t,!1,bl,Dl)}function Kl(t){return ql(t,!0,ml,zl)}function ql(t,e,n,o){if(!qs(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?Vl:Bl,s=r.get(t);if(s)return s;const l=Ll(t);if(0===l)return t;const c=new Proxy(t,2===l?o:n);return r.set(t,c),c}function Jl(t){return Hl(t)?Jl(t.__v_raw):!(!t||!t.__v_isReactive)}function Hl(t){return!(!t||!t.__v_isReadonly)}function Gl(t){return Jl(t)||Hl(t)}function Ql(t){return t&&Ql(t.__v_raw)||t}const Xl=t=>qs(t)?Wl(t):t;function Yl(t){return Boolean(t&&!0===t.__v_isRef)}function Zl(t){return function(t,e=!1){if(Yl(t))return t;return new tc(t,e)}(t)}class tc{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:Xl(t)}get value(){return al(Ql(this),0,"value"),this._value}set value(t){Qs(Ql(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:Xl(t),ul(Ql(this),"set","value",t))}}class ec{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=nl(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,ul(Ql(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),al(Ql(this),0,"value"),this._value}set value(t){this._setter(t)}}function nc(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){rc(s,e,n)}return r}function oc(t,e,n,o){if(Ls(t)){const s=nc(t,e,n,o);return s&&(qs(r=s)&&Ls(r.then)&&Ls(r.catch))&&s.catch((t=>{rc(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function Sc(t){lc=!1,sc=!0,wc(t),cc.sort(((t,e)=>kc(t)-kc(e)));try{for(ic=0;ickc(t)-kc(e))),hc=0;hcRc+=t;const Ec=(t=>(e,n=ti)=>function(t,e,n=ti,o=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;cl(),ei(n);const r=oc(e,n,t,o);return ei(null),il(),r});return o?r.unshift(s):r.push(s),s}}(t,e,n))("m"),Oc={};function jc(t,e,n){return $c(t,e,n)}function $c(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=Ms,c=ti){let i,a,u=!1;if(Yl(t)?(i=()=>t.value,u=!!t._shallow):Jl(t)?(i=()=>t,o=!0):i=Bs(t)?()=>t.map((t=>Yl(t)?t.value:Jl(t)?Fc(t):Ls(t)?nc(t,c,2):void 0)):Ls(t)?e?()=>nc(t,c,2):()=>{if(!c||!c.isUnmounted)return a&&a(),nc(t,c,3,[f])}:As,e&&o){const t=i;i=()=>Fc(t())}const f=t=>{a=_.options.onStop=()=>{nc(t,c,4)}};let p=Bs(t)?[]:Oc;const d=()=>{if(_.active)if(e){const t=_();(o||u||Qs(t,p))&&(a&&a(),oc(e,c,3,[t,p===Oc?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>Nc(d,c&&c.suspense):()=>{!c||c.isMounted?function(t){mc(t,uc,ac,fc)}(d):d()};const _=nl(i,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return ni(_,c),e?n?d():p=_():"post"===r?Nc(_,c&&c.suspense):_(),()=>{var t;(t=_).active&&(rl(t),t.options.onStop&&t.options.onStop(),t.active=!1),c&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(c.effects,_)}}function Pc(t,e,n){const o=this.proxy;return $c(Ws(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function Fc(t,e=new Set){if(!qs(t)||e.has(t))return t;if(e.add(t),Yl(t))Fc(t.value,e);else if(Bs(t))for(let n=0;n{Fc(t,e)}));else for(const n in t)Fc(t[n],e);return t}function Ic(t){return Ls(t)?{setup:t,name:t.name}:t}function Mc(t){Ls(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:c}=t;let i,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),c)return new Promise(((e,n)=>{c(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),i=e,e))))};return Ic({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=ti;if(i)return()=>Ac(i,t);const e=e=>{a=null,rc(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>Ac(e,t))).catch((t=>(e(t),()=>o?Wc(o,{error:t}):null)));const c=Zl(!1),u=Zl(),p=Zl(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!c.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{c.value=!0})).catch((t=>{e(t),u.value=t})),()=>c.value&&i?Ac(i,t):u.value&&o?Wc(o,{error:u.value}):n&&!p.value?Wc(n):void 0}})}function Ac(t,{vnode:{ref:e,props:n,children:o}}){const r=Wc(t,n,o);return r.ref=e,r}const Nc=function(t,e){e&&e.pendingBranch?Bs(t)?e.effects.push(...t):e.effects.push(t):mc(t,dc,pc,hc)},Tc=Symbol(),Uc=Symbol(void 0),Dc=Symbol(void 0),zc=Symbol(void 0);function Bc(t){return!!t&&!0===t.__v_isVNode}const Vc=({key:t})=>null!=t?t:null,Lc=({ref:t})=>null!=t?Ws(t)||Yl(t)||Ls(t)?{i:null,r:t}:t:null,Wc=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==Tc||(t=zc);if(Bc(t)){const o=Kc(t,e,!0);return n&&Hc(o,n),o}l=t,Ls(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(Gl(e)||"__vInternal"in e)&&(e=Us({},e));let{class:t,style:n}=e;t&&!Ws(t)&&(e.class=Is(t)),qs(n)&&(Gl(n)&&!Bs(n)&&(n=Us({},n)),e.style=js(n))}const c=Ws(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:qs(t)?4:Ls(t)?2:0,i={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Vc(e),ref:e&&Lc(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(Hc(i,n),128&c){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=xc(n.default),r=xc(n.fallback)):(o=xc(n),r=Jc(null)),{content:o,fallback:r}}(i);i.ssContent=t,i.ssFallback=e}0;return i};function Kc(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?Gc(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Vc(l),ref:e&&e.ref?n&&r?Bs(r)?r.concat(Lc(e)):[r,Lc(e)]:Lc(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Uc?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Kc(t.ssContent),ssFallback:t.ssFallback&&Kc(t.ssFallback),el:t.el,anchor:t.anchor}}function qc(t=" ",e=0){return Wc(Dc,null,t,e)}function Jc(t){return null==t||"boolean"==typeof t?Wc(zc):Bs(t)?Wc(Uc,null,t):"object"==typeof t?null===t.el?t:Kc(t):Wc(Dc,null,String(t))}function Hc(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(Bs(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&Cc(1),Hc(t,n()),n._c&&Cc(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else Ls(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[qc(e)]):n=8);t.children=e,t.shapeFlag|=n}function Gc(...t){const e=Us({},t[0]);for(let n=1;nQc(t,e,n)));for(const l in e)o&&zs(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const Xc=t=>t&&(t.proxy?t.proxy:Xc(t.parent)),Yc=Us(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Xc(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Qc(l,e,t))),Qc(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(cc.length&&cc.includes(e,sc&&e.allowRecurse?ic+1:ic)||e===gc||(cc.push(e),bc()));var e},$nextTick:t=>yc.bind(t.proxy),$watch:t=>Pc.bind(t)}),Zc={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:c,appContext:i}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const c=l[e];if(void 0!==c)switch(c){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==Ms&&zs(o,e))return l[e]=0,o[e];if(r!==Ms&&zs(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&zs(a,e))return l[e]=2,s[e];if(n!==Ms&&zs(n,e))return l[e]=3,n[e];l[e]=4}}const u=Yc[e];let f,p;return u?("$attrs"===e&&al(t,0,e),u(t)):(f=c.__cssModules)&&(f=f[e])?f:n!==Ms&&zs(n,e)?(l[e]=3,n[e]):(p=i.config.globalProperties,zs(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==Ms&&zs(r,e))r[e]=n;else if(o!==Ms&&zs(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let c;return void 0!==n[l]||t!==Ms&&zs(t,l)||e!==Ms&&zs(e,l)||(c=s[0])&&zs(c,l)||zs(o,l)||zs(Yc,l)||zs(r.config.globalProperties,l)}};Us({},Zc,{get(t,e){if(e!==Symbol.unscopables)return Zc.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!Os(e)});let ti=null;const ei=t=>{ti=t};function ni(t,e=ti){e&&(e.effects||(e.effects=[])).push(t)}function oi(t){const e=function(t){let e,n;return Ls(t)?(e=t,n=As):(e=t.get,n=t.set),new ec(e,n,Ls(t)||!t.set)}(t);return ni(e.effect),e}const ri=()=>({value:"",align:"left"});var si={name:"sb-paragraph",getDefaultData:ri,edit:Mc((()=>gn((()=>__import__("./edit.492a1056.js")),["/schlechtenburg/assets/edit.492a1056.js","/schlechtenburg/assets/style.3e24e605.css","/schlechtenburg/assets/vendor.9babb3f5.js"]))),display:Mc((()=>gn((()=>__import__("./display.bd126a56.js")),["/schlechtenburg/assets/display.bd126a56.js","/schlechtenburg/assets/style.3e24e605.css","/schlechtenburg/assets/vendor.9babb3f5.js"])))};function li(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const ci=li("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function ii(t){if(mi(t)){const e={};for(let n=0;n{if(t){const n=t.split(ui);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function pi(t){let e="";if(Si(t))e=t;else if(mi(t))for(let n=0;n{},_i=/^on[^a-z]/,vi=t=>_i.test(t),gi=Object.assign,yi=Object.prototype.hasOwnProperty,bi=(t,e)=>yi.call(t,e),mi=Array.isArray,wi=t=>"[object Map]"===Ei(t),ki=t=>"function"==typeof t,Si=t=>"string"==typeof t,xi=t=>"symbol"==typeof t,Ri=t=>null!==t&&"object"==typeof t,Ci=Object.prototype.toString,Ei=t=>Ci.call(t),Oi=t=>Si(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,ji=(t,e)=>t!==e&&(t==t||e==e),$i=new WeakMap,Pi=[];let Fi;const Ii=Symbol(""),Mi=Symbol("");function Ai(t,e=di){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!Pi.includes(n)){Ti(n);try{return Di.push(Ui),Ui=!0,Pi.push(n),Fi=n,t()}finally{Pi.pop(),zi(),Fi=Pi[Pi.length-1]}}};return n.id=Ni++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let Ni=0;function Ti(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==Fi||t.allowRecurse)&&c.add(t)}))};if("clear"===e)l.forEach(i);else if("length"===n&&mi(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&i(t)}));else switch(void 0!==n&&i(l.get(n)),e){case"add":mi(t)?Oi(n)&&i(l.get("length")):(i(l.get(Ii)),wi(t)&&i(l.get(Mi)));break;case"delete":mi(t)||(i(l.get(Ii)),wi(t)&&i(l.get(Mi)));break;case"set":wi(t)&&i(l.get(Ii))}c.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const Li=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(xi)),Wi=Gi(),Ki=Gi(!1,!0),qi=Gi(!0),Ji=Gi(!0,!0),Hi={};function Gi(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?ma:ba).get(n))return n;const s=mi(n);if(!t&&s&&bi(Hi,o))return Reflect.get(Hi,o,r);const l=Reflect.get(n,o,r);if(xi(o)?Li.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||Bi(n,0,o),e)return l;if($a(l)){return!s||!Oi(o)?l.value:l}return Ri(l)?t?Sa(l):ka(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];Hi[t]=function(...t){const n=Oa(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];Hi[t]=function(...t){Di.push(Ui),Ui=!1;const n=e.apply(this,t);return zi(),n}}));function Qi(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=Oa(o),!mi(e)&&$a(s)&&!$a(o)))return s.value=o,!0;const l=mi(e)&&Oi(n)?Number(n)!0,deleteProperty:(t,e)=>!0};gi({},Xi,{get:Ki,set:Qi(!0)}),gi({},Yi,{get:Ji});const Zi=t=>Ri(t)?ka(t):t,ta=t=>Ri(t)?Sa(t):t,ea=t=>t,na=t=>Reflect.getPrototypeOf(t);function oa(t,e,n=!1,o=!1){const r=Oa(t=t.__v_raw),s=Oa(e);e!==s&&!n&&Bi(r,0,e),!n&&Bi(r,0,s);const{has:l}=na(r),c=n?ta:o?ea:Zi;return l.call(r,e)?c(t.get(e)):l.call(r,s)?c(t.get(s)):void 0}function ra(t,e=!1){const n=this.__v_raw,o=Oa(n),r=Oa(t);return t!==r&&!e&&Bi(o,0,t),!e&&Bi(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function sa(t,e=!1){return t=t.__v_raw,!e&&Bi(Oa(t),0,Ii),Reflect.get(t,"size",t)}function la(t){t=Oa(t);const e=Oa(this),n=na(e).has.call(e,t);return e.add(t),n||Vi(e,"add",t,t),this}function ca(t,e){e=Oa(e);const n=Oa(this),{has:o,get:r}=na(n);let s=o.call(n,t);s||(t=Oa(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?ji(e,l)&&Vi(n,"set",t,e):Vi(n,"add",t,e),this}function ia(t){const e=Oa(this),{has:n,get:o}=na(e);let r=n.call(e,t);r||(t=Oa(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&Vi(e,"delete",t,void 0),s}function aa(){const t=Oa(this),e=0!==t.size,n=t.clear();return e&&Vi(t,"clear",void 0,void 0),n}function ua(t,e){return function(n,o){const r=this,s=r.__v_raw,l=Oa(s),c=t?ta:e?ea:Zi;return!t&&Bi(l,0,Ii),s.forEach(((t,e)=>n.call(o,c(t),c(e),r)))}}function fa(t,e,n){return function(...o){const r=this.__v_raw,s=Oa(r),l=wi(s),c="entries"===t||t===Symbol.iterator&&l,i="keys"===t&&l,a=r[t](...o),u=e?ta:n?ea:Zi;return!e&&Bi(s,0,i?Mi:Ii),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function pa(t){return function(...e){return"delete"!==t&&this}}const da={get(t){return oa(this,t)},get size(){return sa(this)},has:ra,add:la,set:ca,delete:ia,clear:aa,forEach:ua(!1,!1)},ha={get(t){return oa(this,t,!1,!0)},get size(){return sa(this)},has:ra,add:la,set:ca,delete:ia,clear:aa,forEach:ua(!1,!0)},_a={get(t){return oa(this,t,!0)},get size(){return sa(this,!0)},has(t){return ra.call(this,t,!0)},add:pa("add"),set:pa("set"),delete:pa("delete"),clear:pa("clear"),forEach:ua(!0,!1)};function va(t,e){const n=e?ha:t?_a:da;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(bi(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{da[t]=fa(t,!1,!1),_a[t]=fa(t,!0,!1),ha[t]=fa(t,!1,!0)}));const ga={get:va(!1,!1)},ya={get:va(!0,!1)},ba=new WeakMap,ma=new WeakMap;function wa(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>Ei(t).slice(8,-1))(t))}function ka(t){return t&&t.__v_isReadonly?t:xa(t,!1,Xi,ga)}function Sa(t){return xa(t,!0,Yi,ya)}function xa(t,e,n,o){if(!Ri(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?ma:ba,s=r.get(t);if(s)return s;const l=wa(t);if(0===l)return t;const c=new Proxy(t,2===l?o:n);return r.set(t,c),c}function Ra(t){return Ca(t)?Ra(t.__v_raw):!(!t||!t.__v_isReactive)}function Ca(t){return!(!t||!t.__v_isReadonly)}function Ea(t){return Ra(t)||Ca(t)}function Oa(t){return t&&Oa(t.__v_raw)||t}const ja=t=>Ri(t)?ka(t):t;function $a(t){return Boolean(t&&!0===t.__v_isRef)}function Pa(t){return function(t,e=!1){if($a(t))return t;return new Fa(t,e)}(t)}class Fa{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:ja(t)}get value(){return Bi(Oa(this),0,"value"),this._value}set value(t){ji(Oa(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:ja(t),Vi(Oa(this),"set","value",t))}}function Ia(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){Aa(s,e,n)}return r}function Ma(t,e,n,o){if(ki(t)){const s=Ia(t,e,n,o);return s&&(Ri(r=s)&&ki(r.then)&&ki(r.catch))&&s.catch((t=>{Aa(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function tu(t){Ta=!1,Na=!0,Ya(t),Ua.sort(((t,e)=>Za(t)-Za(e)));try{for(Da=0;DaZa(t)-Za(e))),Ka=0;Kanu+=t;const ru={};function su(t,e,n){return lu(t,e,n)}function lu(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=di,c=ju){let i,a,u=!1;if($a(t)?(i=()=>t.value,u=!!t._shallow):Ra(t)?(i=()=>t,o=!0):i=mi(t)?()=>t.map((t=>$a(t)?t.value:Ra(t)?iu(t):ki(t)?Ia(t,c,2):void 0)):ki(t)?e?()=>Ia(t,c,2):()=>{if(!c||!c.isUnmounted)return a&&a(),Ia(t,c,3,[f])}:hi,e&&o){const t=i;i=()=>iu(t())}const f=t=>{a=_.options.onStop=()=>{Ia(t,c,4)}};let p=mi(t)?[]:ru;const d=()=>{if(_.active)if(e){const t=_();(o||u||ji(t,p))&&(a&&a(),Ma(e,c,3,[t,p===ru?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>pu(d,c&&c.suspense):()=>{!c||c.isMounted?function(t){Xa(t,Ba,za,Va)}(d):d()};const _=Ai(i,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return function(t,e=ju){e&&(e.effects||(e.effects=[])).push(t)}(_,c),e?n?d():p=_():"post"===r?pu(_,c&&c.suspense):_(),()=>{var t;(t=_).active&&(Ti(t),t.options.onStop&&t.options.onStop(),t.active=!1),c&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(c.effects,_)}}function cu(t,e,n){const o=this.proxy;return lu(Si(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function iu(t,e=new Set){if(!Ri(t)||e.has(t))return t;if(e.add(t),$a(t))iu(t.value,e);else if(mi(t))for(let n=0;n{iu(t,e)}));else for(const n in t)iu(t[n],e);return t}function au(t){return ki(t)?{setup:t,name:t.name}:t}function uu(t){ki(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:c}=t;let i,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),c)return new Promise(((e,n)=>{c(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),i=e,e))))};return au({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=ju;if(i)return()=>fu(i,t);const e=e=>{a=null,Aa(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>fu(e,t))).catch((t=>(e(t),()=>o?mu(o,{error:t}):null)));const c=Pa(!1),u=Pa(),p=Pa(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!c.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{c.value=!0})).catch((t=>{e(t),u.value=t})),()=>c.value&&i?fu(i,t):u.value&&o?mu(o,{error:u.value}):n&&!p.value?mu(n):void 0}})}function fu(t,{vnode:{ref:e,props:n,children:o}}){const r=mu(t,n,o);return r.ref=e,r}const pu=function(t,e){e&&e.pendingBranch?mi(t)?e.effects.push(...t):e.effects.push(t):Xa(t,Wa,La,Ka)},du=Symbol(),hu=Symbol(void 0),_u=Symbol(void 0),vu=Symbol(void 0);function gu(t){return!!t&&!0===t.__v_isVNode}const yu=({key:t})=>null!=t?t:null,bu=({ref:t})=>null!=t?Si(t)||$a(t)||ki(t)?{i:null,r:t}:t:null,mu=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==du||(t=vu);if(gu(t)){const o=wu(t,e,!0);return n&&xu(o,n),o}l=t,ki(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(Ea(e)||"__vInternal"in e)&&(e=gi({},e));let{class:t,style:n}=e;t&&!Si(t)&&(e.class=pi(t)),Ri(n)&&(Ea(n)&&!mi(n)&&(n=gi({},n)),e.style=ii(n))}const c=Si(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:Ri(t)?4:ki(t)?2:0,i={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&yu(e),ref:e&&bu(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(xu(i,n),128&c){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=eu(n.default),r=eu(n.fallback)):(o=eu(n),r=Su(null)),{content:o,fallback:r}}(i);i.ssContent=t,i.ssFallback=e}0;return i};function wu(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?function(...t){const e=gi({},t[0]);for(let n=1;nRu(t,e,n)));for(const l in e)o&&bi(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const Cu=t=>t&&(t.proxy?t.proxy:Cu(t.parent)),Eu=gi(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Cu(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Ru(l,e,t))),Ru(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(Ua.length&&Ua.includes(e,Na&&e.allowRecurse?Da+1:Da)||e===Ha||(Ua.push(e),Qa()));var e},$nextTick:t=>Ga.bind(t.proxy),$watch:t=>cu.bind(t)}),Ou={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:c,appContext:i}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const c=l[e];if(void 0!==c)switch(c){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==di&&bi(o,e))return l[e]=0,o[e];if(r!==di&&bi(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&bi(a,e))return l[e]=2,s[e];if(n!==di&&bi(n,e))return l[e]=3,n[e];l[e]=4}}const u=Eu[e];let f,p;return u?("$attrs"===e&&Bi(t,0,e),u(t)):(f=c.__cssModules)&&(f=f[e])?f:n!==di&&bi(n,e)?(l[e]=3,n[e]):(p=i.config.globalProperties,bi(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==di&&bi(r,e))r[e]=n;else if(o!==di&&bi(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let c;return void 0!==n[l]||t!==di&&bi(t,l)||e!==di&&bi(e,l)||(c=s[0])&&bi(c,l)||bi(o,l)||bi(Eu,l)||bi(r.config.globalProperties,l)}};gi({},Ou,{get(t,e){if(e!==Symbol.unscopables)return Ou.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!ci(e)});let ju=null;const $u=()=>({src:"",alt:"",description:{value:"",align:"left"}});var Pu={name:"sb-image",getDefaultData:$u,edit:uu((()=>gn((()=>__import__("./edit.4ace5dcb.js")),["/schlechtenburg/assets/edit.4ace5dcb.js","/schlechtenburg/assets/style.d3f26b5f.css","/schlechtenburg/assets/vendor.9babb3f5.js"]))),display:uu((()=>gn((()=>__import__("./display.27947ee2.js")),["/schlechtenburg/assets/display.27947ee2.js","/schlechtenburg/assets/style.d3f26b5f.css","/schlechtenburg/assets/vendor.9babb3f5.js"]))),getChildren:t=>[t.data.description]};a(n({name:"App",setup(){const t=o("edit"),e=r({name:"none",id:"0",data:null});s((async()=>{const t=await fetch("/initial-data.json"),n=await t.json();e.name=n.name,e.id=n.id,e.data=n.data}));const n=l((()=>{switch(t.value){case u.Edit:return c(mn,{block:e,onUpdate:t=>{e.data=t.data},customBlocks:[Rs,Cs,Pu,si],key:"edit",mode:u.Edit},null);case u.Display:return c(mn,{block:e,customBlocks:[Rs,Cs,Pu,si],key:"display",mode:u.Display},null);case"data":return c("pre",null,[c("code",null,[JSON.stringify(e,null,2)])])}}));return()=>c("div",{id:"app"},[c("select",{value:t.value,onChange:e=>{t.value=e.target.value}},[c("option",null,[i("edit")]),c("option",null,[i("display")]),c("option",null,[i("data")])]),c(n.value,null,null)])}})).mount("#app");export{$u as A,ka as B,Pa as C,su as D,mu as E,ku as F,hu as G,xe as H,Ae as I,Te as J,Jn as S,fs as a,h as b,Ss as c,ts as d,un as e,bn as f,xs as g,vs as h,Kn as i,qn as j,Ic as k,ri as l,d as m,Wl as n,Zl as o,Ec as p,jc as q,pr as r,oi as s,Wc as t,Ye as u,Hn as v,Qr as w,qc as x,Gc as y,au as z}; diff --git a/docs/assets/index.be3c5d52.js b/docs/assets/index.be3c5d52.js new file mode 100644 index 0000000..ddb3b53 --- /dev/null +++ b/docs/assets/index.be3c5d52.js @@ -0,0 +1 @@ +var t=Object.assign;import{d as e,a as n,r as o,b as r,o as s,c as l,e as i,f as c,g as a}from"./vendor.9babb3f5.js";var u,f;!function(t=".",e="__import__"){try{self[e]=new Function("u","return import(u)")}catch(n){const o=new URL(t,location),r=t=>{URL.revokeObjectURL(t.src),t.remove()};self[e]=t=>new Promise(((n,s)=>{const l=new URL(t,o);if(self[e].moduleMap[l])return n(self[e].moduleMap[l]);const i=new Blob([`import * as m from '${l}';`,`${e}.moduleMap['${l}']=m;`],{type:"text/javascript"}),c=Object.assign(document.createElement("script"),{type:"module",src:URL.createObjectURL(i),onerror(){s(new Error(`Failed to import: ${t}`)),r(c)},onload(){n(self[e].moduleMap[l]),r(c)}});document.head.appendChild(c)})),self[e].moduleMap={}}}("assets/"),(f=u||(u={})).Edit="edit",f.Display="display";const p=Symbol("Schlechtenburg mode");var d,h=new Uint8Array(16);function _(){if(!d&&!(d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d(h)}var v=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function g(t){return"string"==typeof t&&v.test(t)}for(var y=[],m=0;m<256;++m)y.push((m+256).toString(16).substr(1));const b=function(t,e,n){var o=(t=t||{}).random||(t.rng||_)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var r=0;r<16;++r)e[n+r]=o[r];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(y[t[e+0]]+y[t[e+1]]+y[t[e+2]]+y[t[e+3]]+"-"+y[t[e+4]]+y[t[e+5]]+"-"+y[t[e+6]]+y[t[e+7]]+"-"+y[t[e+8]]+y[t[e+9]]+"-"+y[t[e+10]]+y[t[e+11]]+y[t[e+12]]+y[t[e+13]]+y[t[e+14]]+y[t[e+15]]).toLowerCase();if(!g(n))throw TypeError("Stringified UUID is invalid");return n}(o)},w={prop:"block",event:"update"},k={blockId:{type:String,default:b}};function S(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const x=S("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function R(t){if(T(t)){const e={};for(let n=0;n{if(t){const n=t.split(E);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function j(t){let e="";if(B(t))e=t;else if(T(t))for(let n=0;n{},F=/^on[^a-z]/,I=t=>F.test(t),A=Object.assign,M=Object.prototype.hasOwnProperty,N=(t,e)=>M.call(t,e),T=Array.isArray,U=t=>"[object Map]"===W(t),z=t=>"function"==typeof t,B=t=>"string"==typeof t,V=t=>"symbol"==typeof t,D=t=>null!==t&&"object"==typeof t,L=Object.prototype.toString,W=t=>L.call(t),K=t=>B(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,J=(t,e)=>t!==e&&(t==t||e==e),q=new WeakMap,H=[];let G;const Q=Symbol(""),X=Symbol("");function Y(t,e=$){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!H.includes(n)){tt(n);try{return nt.push(et),et=!0,H.push(n),G=n,t()}finally{H.pop(),rt(),G=H[H.length-1]}}};return n.id=Z++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let Z=0;function tt(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==G||t.allowRecurse)&&i.add(t)}))};if("clear"===e)l.forEach(c);else if("length"===n&&T(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&c(t)}));else switch(void 0!==n&&c(l.get(n)),e){case"add":T(t)?K(n)&&c(l.get("length")):(c(l.get(Q)),U(t)&&c(l.get(X)));break;case"delete":T(t)||(c(l.get(Q)),U(t)&&c(l.get(X)));break;case"set":U(t)&&c(l.get(Q))}i.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const it=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(V)),ct=dt(),at=dt(!1,!0),ut=dt(!0),ft=dt(!0,!0),pt={};function dt(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?Bt:zt).get(n))return n;const s=T(n);if(!t&&s&&N(pt,o))return Reflect.get(pt,o,r);const l=Reflect.get(n,o,r);if(V(o)?it.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||st(n,0,o),e)return l;if(Qt(l)){return!s||!K(o)?l.value:l}return D(l)?t?Lt(l):Dt(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];pt[t]=function(...t){const n=Ht(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];pt[t]=function(...t){ot();const n=e.apply(this,t);return rt(),n}}));function ht(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=Ht(o),!T(e)&&Qt(s)&&!Qt(o)))return s.value=o,!0;const l=T(e)&&K(n)?Number(n)!0,deleteProperty:(t,e)=>!0},gt=A({},_t,{get:at,set:ht(!0)});A({},vt,{get:ft});const yt=t=>D(t)?Dt(t):t,mt=t=>D(t)?Lt(t):t,bt=t=>t,wt=t=>Reflect.getPrototypeOf(t);function kt(t,e,n=!1,o=!1){const r=Ht(t=t.__v_raw),s=Ht(e);e!==s&&!n&&st(r,0,e),!n&&st(r,0,s);const{has:l}=wt(r),i=n?mt:o?bt:yt;return l.call(r,e)?i(t.get(e)):l.call(r,s)?i(t.get(s)):void 0}function St(t,e=!1){const n=this.__v_raw,o=Ht(n),r=Ht(t);return t!==r&&!e&&st(o,0,t),!e&&st(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function xt(t,e=!1){return t=t.__v_raw,!e&&st(Ht(t),0,Q),Reflect.get(t,"size",t)}function Rt(t){t=Ht(t);const e=Ht(this),n=wt(e).has.call(e,t);return e.add(t),n||lt(e,"add",t,t),this}function Ct(t,e){e=Ht(e);const n=Ht(this),{has:o,get:r}=wt(n);let s=o.call(n,t);s||(t=Ht(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?J(e,l)&<(n,"set",t,e):lt(n,"add",t,e),this}function Et(t){const e=Ht(this),{has:n,get:o}=wt(e);let r=n.call(e,t);r||(t=Ht(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&<(e,"delete",t,void 0),s}function Ot(){const t=Ht(this),e=0!==t.size,n=t.clear();return e&<(t,"clear",void 0,void 0),n}function jt(t,e){return function(n,o){const r=this,s=r.__v_raw,l=Ht(s),i=t?mt:e?bt:yt;return!t&&st(l,0,Q),s.forEach(((t,e)=>n.call(o,i(t),i(e),r)))}}function $t(t,e,n){return function(...o){const r=this.__v_raw,s=Ht(r),l=U(s),i="entries"===t||t===Symbol.iterator&&l,c="keys"===t&&l,a=r[t](...o),u=e?mt:n?bt:yt;return!e&&st(s,0,c?X:Q),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:i?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function Pt(t){return function(...e){return"delete"!==t&&this}}const Ft={get(t){return kt(this,t)},get size(){return xt(this)},has:St,add:Rt,set:Ct,delete:Et,clear:Ot,forEach:jt(!1,!1)},It={get(t){return kt(this,t,!1,!0)},get size(){return xt(this)},has:St,add:Rt,set:Ct,delete:Et,clear:Ot,forEach:jt(!1,!0)},At={get(t){return kt(this,t,!0)},get size(){return xt(this,!0)},has(t){return St.call(this,t,!0)},add:Pt("add"),set:Pt("set"),delete:Pt("delete"),clear:Pt("clear"),forEach:jt(!0,!1)};function Mt(t,e){const n=e?It:t?At:Ft;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(N(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{Ft[t]=$t(t,!1,!1),At[t]=$t(t,!0,!1),It[t]=$t(t,!1,!0)}));const Nt={get:Mt(!1,!1)},Tt={get:Mt(!1,!0)},Ut={get:Mt(!0,!1)},zt=new WeakMap,Bt=new WeakMap;function Vt(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>W(t).slice(8,-1))(t))}function Dt(t){return t&&t.__v_isReadonly?t:Wt(t,!1,_t,Nt)}function Lt(t){return Wt(t,!0,vt,Ut)}function Wt(t,e,n,o){if(!D(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?Bt:zt,s=r.get(t);if(s)return s;const l=Vt(t);if(0===l)return t;const i=new Proxy(t,2===l?o:n);return r.set(t,i),i}function Kt(t){return Jt(t)?Kt(t.__v_raw):!(!t||!t.__v_isReactive)}function Jt(t){return!(!t||!t.__v_isReadonly)}function qt(t){return Kt(t)||Jt(t)}function Ht(t){return t&&Ht(t.__v_raw)||t}const Gt=t=>D(t)?Dt(t):t;function Qt(t){return Boolean(t&&!0===t.__v_isRef)}function Xt(t){return function(t,e=!1){if(Qt(t))return t;return new Yt(t,e)}(t)}class Yt{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:Gt(t)}get value(){return st(Ht(this),0,"value"),this._value}set value(t){J(Ht(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:Gt(t),lt(Ht(this),"set","value",t))}}class Zt{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=Y(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,lt(Ht(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),st(Ht(this),0,"value"),this._value}set value(t){this._setter(t)}}function te(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){ne(s,e,n)}return r}function ee(t,e,n,o){if(z(t)){const s=te(t,e,n,o);return s&&(D(r=s)&&z(r.then)&&z(r.catch))&&s.catch((t=>{ne(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function we(t){re=!1,oe=!0,me(t),se.sort(((t,e)=>be(t)-be(e)));try{for(le=0;lebe(t)-be(e))),pe=0;peSe+=t;const Re=(Ce="um",(t,e=en)=>function(t,e,n=en,o=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;ot(),nn(n);const r=ee(e,n,t,o);return nn(null),rt(),r});return o?r.unshift(s):r.push(s),s}}(Ce,t,e));var Ce;const Ee={};function Oe(t,e,n){return je(t,e,n)}function je(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=$,i=en){let c,a,u=!1;if(Qt(t)?(c=()=>t.value,u=!!t._shallow):Kt(t)?(c=()=>t,o=!0):c=T(t)?()=>t.map((t=>Qt(t)?t.value:Kt(t)?Pe(t):z(t)?te(t,i,2):void 0)):z(t)?e?()=>te(t,i,2):()=>{if(!i||!i.isUnmounted)return a&&a(),te(t,i,3,[f])}:P,e&&o){const t=c;c=()=>Pe(t())}const f=t=>{a=_.options.onStop=()=>{te(t,i,4)}};let p=T(t)?[]:Ee;const d=()=>{if(_.active)if(e){const t=_();(o||u||J(t,p))&&(a&&a(),ee(e,i,3,[t,p===Ee?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>Me(d,i&&i.suspense):()=>{!i||i.isMounted?function(t){ye(t,ce,ie,ae)}(d):d()};const _=Y(c,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return on(_,i),e?n?d():p=_():"post"===r?Me(_,i&&i.suspense):_(),()=>{var t;(t=_).active&&(tt(t),t.options.onStop&&t.options.onStop(),t.active=!1),i&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(i.effects,_)}}function $e(t,e,n){const o=this.proxy;return je(B(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function Pe(t,e=new Set){if(!D(t)||e.has(t))return t;if(e.add(t),Qt(t))Pe(t.value,e);else if(T(t))for(let n=0;n{Pe(t,e)}));else for(const n in t)Pe(t[n],e);return t}function Fe(t){return z(t)?{setup:t,name:t.name}:t}function Ie(t){z(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:i}=t;let c,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),i)return new Promise(((e,n)=>{i(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),c=e,e))))};return Fe({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=en;if(c)return()=>Ae(c,t);const e=e=>{a=null,ne(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>Ae(e,t))).catch((t=>(e(t),()=>o?Le(o,{error:t}):null)));const i=Xt(!1),u=Xt(),p=Xt(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!i.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{i.value=!0})).catch((t=>{e(t),u.value=t})),()=>i.value&&c?Ae(c,t):u.value&&o?Le(o,{error:u.value}):n&&!p.value?Le(n):void 0}})}function Ae(t,{vnode:{ref:e,props:n,children:o}}){const r=Le(t,n,o);return r.ref=e,r}const Me=function(t,e){e&&e.pendingBranch?T(t)?e.effects.push(...t):e.effects.push(t):ye(t,fe,ue,pe)},Ne=Symbol(),Te=Symbol(void 0),Ue=Symbol(void 0),ze=Symbol(void 0);function Be(t){return!!t&&!0===t.__v_isVNode}const Ve=({key:t})=>null!=t?t:null,De=({ref:t})=>null!=t?B(t)||Qt(t)||z(t)?{i:null,r:t}:t:null,Le=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==Ne||(t=ze);if(Be(t)){const o=We(t,e,!0);return n&&qe(o,n),o}l=t,z(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(qt(e)||"__vInternal"in e)&&(e=A({},e));let{class:t,style:n}=e;t&&!B(t)&&(e.class=j(t)),D(n)&&(qt(n)&&!T(n)&&(n=A({},n)),e.style=R(n))}const i=B(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:D(t)?4:z(t)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Ve(e),ref:e&&De(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(qe(c,n),128&i){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=ke(n.default),r=ke(n.fallback)):(o=ke(n),r=Je(null)),{content:o,fallback:r}}(c);c.ssContent=t,c.ssFallback=e}0;return c};function We(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?He(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Ve(l),ref:e&&e.ref?n&&r?T(r)?r.concat(De(e)):[r,De(e)]:De(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Te?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&We(t.ssContent),ssFallback:t.ssFallback&&We(t.ssFallback),el:t.el,anchor:t.anchor}}function Ke(t=" ",e=0){return Le(Ue,null,t,e)}function Je(t){return null==t||"boolean"==typeof t?Le(ze):T(t)?Le(Te,null,t):"object"==typeof t?null===t.el?t:We(t):Le(Ue,null,String(t))}function qe(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(T(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&xe(1),qe(t,n()),n._c&&xe(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else z(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[Ke(e)]):n=8);t.children=e,t.shapeFlag|=n}function He(...t){const e=A({},t[0]);for(let n=1;n1)return n&&z(e)?e():e}}function Xe(t,e,n){const o=n.appContext.config.optionMergeStrategies,{mixins:r,extends:s}=e;s&&Xe(t,s,n),r&&r.forEach((e=>Xe(t,e,n)));for(const l in e)o&&N(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const Ye=t=>t&&(t.proxy?t.proxy:Ye(t.parent)),Ze=A(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Ye(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Xe(l,e,t))),Xe(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(se.length&&se.includes(e,oe&&e.allowRecurse?le+1:le)||e===_e||(se.push(e),ge()));var e},$nextTick:t=>ve.bind(t.proxy),$watch:t=>$e.bind(t)}),tn={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:i,appContext:c}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const i=l[e];if(void 0!==i)switch(i){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==$&&N(o,e))return l[e]=0,o[e];if(r!==$&&N(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&N(a,e))return l[e]=2,s[e];if(n!==$&&N(n,e))return l[e]=3,n[e];l[e]=4}}const u=Ze[e];let f,p;return u?("$attrs"===e&&st(t,0,e),u(t)):(f=i.__cssModules)&&(f=f[e])?f:n!==$&&N(n,e)?(l[e]=3,n[e]):(p=c.config.globalProperties,N(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==$&&N(r,e))r[e]=n;else if(o!==$&&N(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let i;return void 0!==n[l]||t!==$&&N(t,l)||e!==$&&N(e,l)||(i=s[0])&&N(i,l)||N(o,l)||N(Ze,l)||N(r.config.globalProperties,l)}};A({},tn,{get(t,e){if(e!==Symbol.unscopables)return tn.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!x(e)});let en=null;const nn=t=>{en=t};function on(t,e=en){e&&(e.effects||(e.effects=[])).push(t)}function rn(t){const e=function(t){let e,n;return z(t)?(e=t,n=P):(e=t.get,n=t.set),new Zt(e,n,z(t)||!t.set)}(t);return on(e.effect),e}const sn=Symbol("Schlechtenburg active block");function ln(t=null){const e=Qe(sn,Xt(null)),n=rn((()=>e.value===t)),o=n=>{e.value=void 0!==n?n:t};return{activeBlockId:e,isActive:n,activate:o,requestActivation:()=>{e.value||o()}}}const cn=Symbol("Schlechtenburg block library");function an(){const t=Qe(p,Xt(u.Edit)),e=Qe(cn,Dt({}));return{mode:t,customBlocks:e,getBlock:t=>e[t]}}const un=Symbol("Schlechtenburg block dimensions"),fn=Symbol("Schlechtenburg editor dimensions");function pn(t,e){const n=Xt(null);Ge(e,n);const o=()=>{if(!t.value)return;const e=t.value.getBoundingClientRect();n.value={width:e.width,height:e.height,left:t.value.offsetLeft,top:t.value.offsetTop}},r=new ResizeObserver(o),s=new MutationObserver(o);return Oe(t,(()=>{t.value&&(r.observe(t.value),s.observe(t.value,{attributes:!0,childList:!1,subtree:!1}))})),{triggerSizeCalculation:o,dimensions:n}}function dn(){return{editorDimensions:Qe(fn,Xt(null)),blockDimensions:Qe(un,Xt(null))}}const hn=Symbol("Schlechtenburg block tree"),_n=Symbol("Schlechtenburg block tree register"),vn=Symbol("Schlechtenburg block tree unregister");function gn(){const t=Qe(hn,Xt(null)),e=Qe(_n,(t=>{})),n=Qe(vn,(t=>{})),o=Dt({id:"",name:"",icon:"",children:[]});Ge(_n,(t=>{o.children.find((e=>e.id===t.id))||(o.children=[...o.children,t])})),Ge(vn,(({id:t})=>{o.children=o.children.filter((e=>e.id!==t))}));return Re((()=>{o.id&&n(o)})),{blockTree:t,register:t=>{if(!t.id)throw new Error(`Cannot register a block without an id: ${JSON.stringify(t)}`);o.id=t.id,o.name=t.name,e(o)}}}const yn=Fe({name:"sb-button",inheritAttrs:!1,setup:(e,n)=>()=>{var e,o;return Le("button",t(t({},n.attrs),{class:(n.attrs.class||"")+" sb-button"}),[null==(o=(e=n.slots).default)?void 0:o.call(e)])}});const mn=Fe({name:"sb-context-menu",props:{onClose:{type:Function,default:()=>{}},onOpen:{type:Function,default:()=>{}}},setup(t,e){const n=Xt(!1),o=()=>{n.value=!0},r=()=>{n.value=!1},s=t=>{"Escape"===t.key&&r()},l=()=>{n.value?r():o()};return Oe(n,((e,n)=>{e!==n&&(e?setTimeout((()=>{document.body.addEventListener("click",r),document.body.addEventListener("keypress",s),t.onOpen()})):(document.body.removeEventListener("click",r),document.body.removeEventListener("keypress",s),t.onClose()))})),()=>{var t,s,i,c;return Le("div",{class:"sb-context"},[(null==(s=(t=e.slots).context)?void 0:s.call(t,{opened:n,toggle:l,close:r,open:o}))||Le(yn,{onClick:l},{default:()=>[Ke("Menu")]}),Le("dialog",He({class:"sb-context-menu",open:!!n.value||void 0,onClick:t=>{t.stopPropagation()}},{onClose:r}),[(null==(c=(i=e.slots).default)?void 0:c.call(i,{opened:n,toggle:l,close:r,open:o}))||null])])}}});const bn=Fe({name:"sb-main-menu",setup(){const{blockTree:t}=gn(),{activate:e,activeBlockId:n}=ln(),o=(t,r)=>{var s,l;return Le("li",{class:{"sb-tree-block-select__block":!0,"sb-tree-block-select__block_active":n.value===t.id}},[Le("button",{class:"sb-tree-block-select__block-name",onClick:()=>{e(t.id),r()},onMouseenter:()=>e(t.id)},[t.name]),(null==(s=t.children)?void 0:s.length)?Le("ul",{class:"sb-tree-block-select__list"},[null==(l=t.children)?void 0:l.map((t=>o(t,r)))]):null])};return()=>t.value?Le(mn,{class:"sb-tree-block-select"},{context:({toggle:t})=>Le(yn,{onClick:t},{default:()=>[Ke("Tree")]}),default:({close:e})=>Le("ul",{class:"sb-tree-block-select__list sb-tree-block-select__list_base"},[o(t.value,e)])}):""}});const wn=Fe({name:"sb-main-menu",props:{block:{type:null,required:!0}},setup:()=>()=>Le("div",{class:"sb-main-menu"},[Le(bn,null,null)])});const kn=Fe({name:"sb-block-toolbar",setup:()=>()=>Le("div",{class:"sb-block-toolbar"},null)});let Sn;const xn={},Rn=function(t,e){if(!e)return t();if(void 0===Sn){const t=document.createElement("link").relList;Sn=t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(e.map((t=>{if(t in xn)return;xn[t]=!0;const e=t.endsWith(".css"),n=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":Sn,e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((t,e)=>{o.addEventListener("load",t),o.addEventListener("error",e)})):void 0}))).then((()=>t()))};var Cn={name:"sb-missing-block",edit:Ie((()=>Rn((()=>__import__("./display.9a74f321.js")),["./assets/display.9a74f321.js","./assets/display.08a50fb3.css","./assets/vendor.9babb3f5.js"]))),display:Ie((()=>Rn((()=>__import__("./display.9a74f321.js")),["./assets/display.9a74f321.js","./assets/display.08a50fb3.css","./assets/vendor.9babb3f5.js"])))};const En=Fe({name:"sb-block",props:{block:{type:null,required:!0},sortable:{type:String,default:null},onUpdate:{type:Function,default:()=>{}},onPrependBlock:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}}},setup(e,n){const o=Xt(null),{mode:r,getBlock:s}=an(),{isActive:l,activate:i}=ln(e.block.id),c=rn((()=>({"sb-block":!0,"sb-block_active":l.value}))),{triggerSizeCalculation:a}=pn(o,un);Oe((()=>e.block.data),a);const{register:f}=gn();f(e.block),Oe(e.block,(()=>{f(e.block)}));const p=n=>{e.onUpdate(t(t({},e.block),{data:t(t({},e.block.data),n)}))};return()=>{var l;const a=null==(l=s(e.block.name))?void 0:l[r.value];if(!a){const t=Cn[r.value];return Le(t,{name:e.block.name,blockId:e.block.id},null)}return r.value===u.Display?Le(a,{data:e.block.data,blockId:e.block.id},null):Le("div",{ref:o,class:c.value},[Le("div",{class:"sb-block__edit-cover"},null),n.slots["context-toolbar"]?n.slots["context-toolbar"]():null,Le(a,He({data:e.block.data,blockId:e.block.id,onUpdate:p,onPrependBlock:e.onPrependBlock,onAppendBlock:e.onAppendBlock,onRemoveSelf:e.onRemoveSelf,onActivatePrevious:e.onActivatePrevious,onActivateNext:e.onActivateNext},t({"onClick:value":t=>{t.stopPropagation(),i()}},n.attrs)),null)])}}});const On=Fe({name:"sb-main",model:w,props:{customBlocks:{type:Array,default:()=>[]},block:{type:Object,required:!0},onUpdate:{type:Function,default:()=>{}},mode:{type:String,validator:t=>Object.values(u).includes(t),default:u.Edit}},setup(e){const n=Xt(null);pn(n,fn);const o=Xt(e.mode);Ge(p,o);const r=Xt(null);Ge(sn,r);const s=Xt(null);Ge(hn,s),Ge(_n,(t=>{s.value=t})),Ge(vn,(()=>{s.value=null}));const l=Wt(t({},e.customBlocks.reduce(((e,n)=>t(t({},e),{[n.name]:n})),{})),!1,gt,Tt);return Ge(cn,l),()=>Le("div",{class:"sb-main",ref:n},[o.value===u.Edit?Le(Te,null,[Le(wn,{block:e.block},null),Le(kn,null,null)]):null,Le(En,{block:e.block,onUpdate:e.onUpdate},null)])}});const jn=Fe({name:"sb-modal",props:{open:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}}},setup(t,e){const n=rn((()=>({"sb-modal":!0,"sb-modal_open":t.open})));return()=>{var o,r;return Le("div",{class:n.value},[Le("div",{class:"sb-modal__overlay",onClick:e=>{e.stopPropagation(),t.onClose()}},[Le("div",{class:"sb-modal__content"},[null==(r=(o=e.slots).default)?void 0:r.call(o)])])])}}});const $n=Fe({name:"sb-block-picker",props:{onPickedBlock:{type:Function,default:()=>{}}},setup(t){const e=Xt(!1),{customBlocks:n}=an(),o=rn((()=>Object.keys(n).map((t=>n[t]))));return()=>Le("div",{class:"sb-block-picker"},[Le(yn,He({class:"sb-block-picker__add-button"},{type:"button",onClick:t=>{e.value=!0,t.stopPropagation()}}),{default:()=>[Ke("+")]}),Le(jn,He({open:e.value,onClose:()=>{e.value=!1}},{onClick:t=>t.stopPropagation()}),{default:()=>[...o.value.map((n=>Le(yn,{type:"button",onClick:()=>(n=>()=>{e.value=!1,t.onPickedBlock({name:n.name,id:""+ +new Date,data:n.getDefaultData()})})(n)},{default:()=>[n.name]})))]})])}});var Pn="object"==typeof global&&global&&global.Object===Object&&global,Fn="object"==typeof self&&self&&self.Object===Object&&self,In=Pn||Fn||Function("return this")(),An=In.Symbol,Mn=Object.prototype,Nn=Mn.hasOwnProperty,Tn=Mn.toString,Un=An?An.toStringTag:void 0;var zn=Object.prototype.toString;var Bn=An?An.toStringTag:void 0;function Vn(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Bn&&Bn in Object(t)?function(t){var e=Nn.call(t,Un),n=t[Un];try{t[Un]=void 0;var o=!0}catch(s){}var r=Tn.call(t);return o&&(e?t[Un]=n:delete t[Un]),r}(t):function(t){return zn.call(t)}(t)}var Dn=/\s/;var Ln=/^\s+/;function Wn(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Dn.test(t.charAt(e)););return e}(t)+1).replace(Ln,""):t}function Kn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Jn=/^[-+]0x[0-9a-f]+$/i,qn=/^0b[01]+$/i,Hn=/^0o[0-7]+$/i,Gn=parseInt;function Qn(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==Vn(t)}(t))return NaN;if(Kn(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Kn(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Wn(t);var n=qn.test(t);return n||Hn.test(t)?Gn(t.slice(2),n?2:8):Jn.test(t)?NaN:+t}var Xn=function(){return In.Date.now()},Yn=Math.max,Zn=Math.min;function to(t,e,n){var o,r,s,l,i,c,a=0,u=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=o,s=r;return o=r=void 0,a=e,l=t.apply(s,n)}function h(t){return a=t,i=setTimeout(v,e),u?d(t):l}function _(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-a>=s}function v(){var t=Xn();if(_(t))return g(t);i=setTimeout(v,function(t){var n=e-(t-c);return f?Zn(n,s-(t-a)):n}(t))}function g(t){return i=void 0,p&&o?d(t):(o=r=void 0,l)}function y(){var t=Xn(),n=_(t);if(o=arguments,r=this,c=t,n){if(void 0===i)return h(c);if(f)return clearTimeout(i),i=setTimeout(v,e),d(c)}return void 0===i&&(i=setTimeout(v,e)),l}return e=Qn(e)||0,Kn(n)&&(u=!!n.leading,s=(f="maxWait"in n)?Yn(Qn(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==i&&clearTimeout(i),a=0,o=c=r=i=void 0},y.flush=function(){return void 0===i?l:g(Xn())},y}const eo=Fe({name:"sb-block-ordering",props:{orientation:{type:String,default:null},onRemove:{type:Function,default:()=>{}},onMoveBackward:{type:Function,default:()=>{}},onMoveForward:{type:Function,default:()=>{}}},setup(t){const e=Dt({top:"",right:""}),n=rn((()=>({"sb-block-ordering":!0,[`sb-block-ordering_${t.orientation}`]:!!t.orientation}))),{editorDimensions:o,blockDimensions:r}=dn(),s=to((()=>{if(!o.value||!r.value)return;const t=o.value.width-r.value.left;e.top=`${r.value.top}px`,e.right=`${t}px`}));return Oe(o,s),Oe(r,s),Oe((()=>t.orientation),s),()=>Le("div",{class:n.value,style:e,onClick:t=>t.stopPropagation()},[Le(yn,{onClick:t.onMoveBackward},{default:()=>["vertical"===t.orientation?"↑":"←"]}),Le(yn,{onClick:t.onRemove},{default:()=>[Ke("x")]}),Le(yn,{onClick:t.onMoveForward},{default:()=>["vertical"===t.orientation?"↓":"→"]})])}});const no=Fe({name:"sb-block-placeholder",props:{onInsertBlock:{type:Function,default:()=>{}}},setup:t=>()=>Le("div",{class:"sb-block-placeholder"},[Le($n,{onPickedBlock:e=>t.onInsertBlock(e)},null)])});const oo=Fe({name:"sb-toolbar",setup(t,e){const n=Dt({bottom:"",left:"",maxWidth:""}),{editorDimensions:o,blockDimensions:r}=dn(),s=to((()=>{if(!o.value||!r.value)return;const t=o.value.height-r.value.top;n.bottom=`${t}px`,n.left=`${r.value.left}px`,n.maxWidth=`${r.value.width}px`}));return Oe(o,s),Oe(r,s),()=>{var t,o;return Le("div",{class:"sb-toolbar",style:n,onClick:t=>t.stopPropagation()},[null==(o=null==(t=e.slots)?void 0:t.default)?void 0:o.call(t)])}}});const ro=Fe({name:"sb-select",inheritAttrs:!1,setup:(t,e)=>()=>{var t,n;return Le("div",{class:"sb-select"},[Le("select",He({class:"sb-select__input"},e.attrs),[null==(n=(t=e.slots).default)?void 0:n.call(t)])])}});function so(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const lo=so("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function io(t){if(bo(t)){const e={};for(let n=0;n{if(t){const n=t.split(ao);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function fo(t){let e="";if(So(t))e=t;else if(bo(t))for(let n=0;n{},_o=/^on[^a-z]/,vo=t=>_o.test(t),go=Object.assign,yo=Object.prototype.hasOwnProperty,mo=(t,e)=>yo.call(t,e),bo=Array.isArray,wo=t=>"[object Map]"===Eo(t),ko=t=>"function"==typeof t,So=t=>"string"==typeof t,xo=t=>"symbol"==typeof t,Ro=t=>null!==t&&"object"==typeof t,Co=Object.prototype.toString,Eo=t=>Co.call(t),Oo=t=>So(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,jo=(t,e)=>t!==e&&(t==t||e==e),$o=new WeakMap,Po=[];let Fo;const Io=Symbol(""),Ao=Symbol("");function Mo(t,e=po){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!Po.includes(n)){To(n);try{return zo.push(Uo),Uo=!0,Po.push(n),Fo=n,t()}finally{Po.pop(),Bo(),Fo=Po[Po.length-1]}}};return n.id=No++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let No=0;function To(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==Fo||t.allowRecurse)&&i.add(t)}))};if("clear"===e)l.forEach(c);else if("length"===n&&bo(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&c(t)}));else switch(void 0!==n&&c(l.get(n)),e){case"add":bo(t)?Oo(n)&&c(l.get("length")):(c(l.get(Io)),wo(t)&&c(l.get(Ao)));break;case"delete":bo(t)||(c(l.get(Io)),wo(t)&&c(l.get(Ao)));break;case"set":wo(t)&&c(l.get(Io))}i.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const Lo=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(xo)),Wo=Go(),Ko=Go(!1,!0),Jo=Go(!0),qo=Go(!0,!0),Ho={};function Go(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?br:mr).get(n))return n;const s=bo(n);if(!t&&s&&mo(Ho,o))return Reflect.get(Ho,o,r);const l=Reflect.get(n,o,r);if(xo(o)?Lo.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||Vo(n,0,o),e)return l;if($r(l)){return!s||!Oo(o)?l.value:l}return Ro(l)?t?Sr(l):kr(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];Ho[t]=function(...t){const n=Or(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];Ho[t]=function(...t){zo.push(Uo),Uo=!1;const n=e.apply(this,t);return Bo(),n}}));function Qo(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=Or(o),!bo(e)&&$r(s)&&!$r(o)))return s.value=o,!0;const l=bo(e)&&Oo(n)?Number(n)!0,deleteProperty:(t,e)=>!0};go({},Xo,{get:Ko,set:Qo(!0)}),go({},Yo,{get:qo});const Zo=t=>Ro(t)?kr(t):t,tr=t=>Ro(t)?Sr(t):t,er=t=>t,nr=t=>Reflect.getPrototypeOf(t);function or(t,e,n=!1,o=!1){const r=Or(t=t.__v_raw),s=Or(e);e!==s&&!n&&Vo(r,0,e),!n&&Vo(r,0,s);const{has:l}=nr(r),i=n?tr:o?er:Zo;return l.call(r,e)?i(t.get(e)):l.call(r,s)?i(t.get(s)):void 0}function rr(t,e=!1){const n=this.__v_raw,o=Or(n),r=Or(t);return t!==r&&!e&&Vo(o,0,t),!e&&Vo(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function sr(t,e=!1){return t=t.__v_raw,!e&&Vo(Or(t),0,Io),Reflect.get(t,"size",t)}function lr(t){t=Or(t);const e=Or(this),n=nr(e).has.call(e,t);return e.add(t),n||Do(e,"add",t,t),this}function ir(t,e){e=Or(e);const n=Or(this),{has:o,get:r}=nr(n);let s=o.call(n,t);s||(t=Or(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?jo(e,l)&&Do(n,"set",t,e):Do(n,"add",t,e),this}function cr(t){const e=Or(this),{has:n,get:o}=nr(e);let r=n.call(e,t);r||(t=Or(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&Do(e,"delete",t,void 0),s}function ar(){const t=Or(this),e=0!==t.size,n=t.clear();return e&&Do(t,"clear",void 0,void 0),n}function ur(t,e){return function(n,o){const r=this,s=r.__v_raw,l=Or(s),i=t?tr:e?er:Zo;return!t&&Vo(l,0,Io),s.forEach(((t,e)=>n.call(o,i(t),i(e),r)))}}function fr(t,e,n){return function(...o){const r=this.__v_raw,s=Or(r),l=wo(s),i="entries"===t||t===Symbol.iterator&&l,c="keys"===t&&l,a=r[t](...o),u=e?tr:n?er:Zo;return!e&&Vo(s,0,c?Ao:Io),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:i?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function pr(t){return function(...e){return"delete"!==t&&this}}const dr={get(t){return or(this,t)},get size(){return sr(this)},has:rr,add:lr,set:ir,delete:cr,clear:ar,forEach:ur(!1,!1)},hr={get(t){return or(this,t,!1,!0)},get size(){return sr(this)},has:rr,add:lr,set:ir,delete:cr,clear:ar,forEach:ur(!1,!0)},_r={get(t){return or(this,t,!0)},get size(){return sr(this,!0)},has(t){return rr.call(this,t,!0)},add:pr("add"),set:pr("set"),delete:pr("delete"),clear:pr("clear"),forEach:ur(!0,!1)};function vr(t,e){const n=e?hr:t?_r:dr;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(mo(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{dr[t]=fr(t,!1,!1),_r[t]=fr(t,!0,!1),hr[t]=fr(t,!1,!0)}));const gr={get:vr(!1,!1)},yr={get:vr(!0,!1)},mr=new WeakMap,br=new WeakMap;function wr(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>Eo(t).slice(8,-1))(t))}function kr(t){return t&&t.__v_isReadonly?t:xr(t,!1,Xo,gr)}function Sr(t){return xr(t,!0,Yo,yr)}function xr(t,e,n,o){if(!Ro(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?br:mr,s=r.get(t);if(s)return s;const l=wr(t);if(0===l)return t;const i=new Proxy(t,2===l?o:n);return r.set(t,i),i}function Rr(t){return Cr(t)?Rr(t.__v_raw):!(!t||!t.__v_isReactive)}function Cr(t){return!(!t||!t.__v_isReadonly)}function Er(t){return Rr(t)||Cr(t)}function Or(t){return t&&Or(t.__v_raw)||t}const jr=t=>Ro(t)?kr(t):t;function $r(t){return Boolean(t&&!0===t.__v_isRef)}function Pr(t){return function(t,e=!1){if($r(t))return t;return new Fr(t,e)}(t)}class Fr{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:jr(t)}get value(){return Vo(Or(this),0,"value"),this._value}set value(t){jo(Or(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:jr(t),Do(Or(this),"set","value",t))}}class Ir{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=Mo(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,Do(Or(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),Vo(Or(this),0,"value"),this._value}set value(t){this._setter(t)}}function Ar(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){Nr(s,e,n)}return r}function Mr(t,e,n,o){if(ko(t)){const s=Ar(t,e,n,o);return s&&(Ro(r=s)&&ko(r.then)&&ko(r.catch))&&s.catch((t=>{Nr(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function es(t){Ur=!1,Tr=!0,Zr(t),zr.sort(((t,e)=>ts(t)-ts(e)));try{for(Br=0;Brts(t)-ts(e))),Jr=0;Jros+=t;const ss={};function ls(t,e,n){return is(t,e,n)}function is(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=po,i=Ps){let c,a,u=!1;if($r(t)?(c=()=>t.value,u=!!t._shallow):Rr(t)?(c=()=>t,o=!0):c=bo(t)?()=>t.map((t=>$r(t)?t.value:Rr(t)?as(t):ko(t)?Ar(t,i,2):void 0)):ko(t)?e?()=>Ar(t,i,2):()=>{if(!i||!i.isUnmounted)return a&&a(),Ar(t,i,3,[f])}:ho,e&&o){const t=c;c=()=>as(t())}const f=t=>{a=_.options.onStop=()=>{Ar(t,i,4)}};let p=bo(t)?[]:ss;const d=()=>{if(_.active)if(e){const t=_();(o||u||jo(t,p))&&(a&&a(),Mr(e,i,3,[t,p===ss?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>ds(d,i&&i.suspense):()=>{!i||i.isMounted?function(t){Yr(t,Dr,Vr,Lr)}(d):d()};const _=Mo(c,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return Fs(_,i),e?n?d():p=_():"post"===r?ds(_,i&&i.suspense):_(),()=>{var t;(t=_).active&&(To(t),t.options.onStop&&t.options.onStop(),t.active=!1),i&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(i.effects,_)}}function cs(t,e,n){const o=this.proxy;return is(So(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function as(t,e=new Set){if(!Ro(t)||e.has(t))return t;if(e.add(t),$r(t))as(t.value,e);else if(bo(t))for(let n=0;n{as(t,e)}));else for(const n in t)as(t[n],e);return t}function us(t){return ko(t)?{setup:t,name:t.name}:t}function fs(t){ko(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:i}=t;let c,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),i)return new Promise(((e,n)=>{i(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),c=e,e))))};return us({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=Ps;if(c)return()=>ps(c,t);const e=e=>{a=null,Nr(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>ps(e,t))).catch((t=>(e(t),()=>o?ws(o,{error:t}):null)));const i=Pr(!1),u=Pr(),p=Pr(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!i.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{i.value=!0})).catch((t=>{e(t),u.value=t})),()=>i.value&&c?ps(c,t):u.value&&o?ws(o,{error:u.value}):n&&!p.value?ws(n):void 0}})}function ps(t,{vnode:{ref:e,props:n,children:o}}){const r=ws(t,n,o);return r.ref=e,r}const ds=function(t,e){e&&e.pendingBranch?bo(t)?e.effects.push(...t):e.effects.push(t):Yr(t,Kr,Wr,Jr)},hs=Symbol(),_s=Symbol(void 0),vs=Symbol(void 0),gs=Symbol(void 0);function ys(t){return!!t&&!0===t.__v_isVNode}const ms=({key:t})=>null!=t?t:null,bs=({ref:t})=>null!=t?So(t)||$r(t)||ko(t)?{i:null,r:t}:t:null,ws=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==hs||(t=gs);if(ys(t)){const o=ks(t,e,!0);return n&&Rs(o,n),o}l=t,ko(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(Er(e)||"__vInternal"in e)&&(e=go({},e));let{class:t,style:n}=e;t&&!So(t)&&(e.class=fo(t)),Ro(n)&&(Er(n)&&!bo(n)&&(n=go({},n)),e.style=io(n))}const i=So(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:Ro(t)?4:ko(t)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ms(e),ref:e&&bs(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(Rs(c,n),128&i){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=ns(n.default),r=ns(n.fallback)):(o=ns(n),r=xs(null)),{content:o,fallback:r}}(c);c.ssContent=t,c.ssFallback=e}0;return c};function ks(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?Cs(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&ms(l),ref:e&&e.ref?n&&r?bo(r)?r.concat(bs(e)):[r,bs(e)]:bs(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==_s?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ks(t.ssContent),ssFallback:t.ssFallback&&ks(t.ssFallback),el:t.el,anchor:t.anchor}}function Ss(t=" ",e=0){return ws(vs,null,t,e)}function xs(t){return null==t||"boolean"==typeof t?ws(gs):bo(t)?ws(_s,null,t):"object"==typeof t?null===t.el?t:ks(t):ws(vs,null,String(t))}function Rs(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(bo(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&rs(1),Rs(t,n()),n._c&&rs(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else ko(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[Ss(e)]):n=8);t.children=e,t.shapeFlag|=n}function Cs(...t){const e=go({},t[0]);for(let n=1;nEs(t,e,n)));for(const l in e)o&&mo(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const Os=t=>t&&(t.proxy?t.proxy:Os(t.parent)),js=go(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Os(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Es(l,e,t))),Es(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(zr.length&&zr.includes(e,Tr&&e.allowRecurse?Br+1:Br)||e===Gr||(zr.push(e),Xr()));var e},$nextTick:t=>Qr.bind(t.proxy),$watch:t=>cs.bind(t)}),$s={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:i,appContext:c}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const i=l[e];if(void 0!==i)switch(i){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==po&&mo(o,e))return l[e]=0,o[e];if(r!==po&&mo(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&mo(a,e))return l[e]=2,s[e];if(n!==po&&mo(n,e))return l[e]=3,n[e];l[e]=4}}const u=js[e];let f,p;return u?("$attrs"===e&&Vo(t,0,e),u(t)):(f=i.__cssModules)&&(f=f[e])?f:n!==po&&mo(n,e)?(l[e]=3,n[e]):(p=c.config.globalProperties,mo(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==po&&mo(r,e))r[e]=n;else if(o!==po&&mo(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let i;return void 0!==n[l]||t!==po&&mo(t,l)||e!==po&&mo(e,l)||(i=s[0])&&mo(i,l)||mo(o,l)||mo(js,l)||mo(r.config.globalProperties,l)}};go({},$s,{get(t,e){if(e!==Symbol.unscopables)return $s.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!lo(e)});let Ps=null;function Fs(t,e=Ps){e&&(e.effects||(e.effects=[])).push(t)}function Is(t){const e=function(t){let e,n;return ko(t)?(e=t,n=ho):(e=t.get,n=t.set),new Ir(e,n,ko(t)||!t.set)}(t);return Fs(e.effect),e}const As=()=>({orientation:"vertical",children:[]});var Ms={name:"sb-layout",getDefaultData:As,edit:fs((()=>Rn((()=>__import__("./edit.1f668f17.js")),["./assets/edit.1f668f17.js","./assets/style.b876754e.css","./assets/vendor.9babb3f5.js"]))),display:fs((()=>Rn((()=>__import__("./display.65dc313e.js")),["./assets/display.65dc313e.js","./assets/style.b876754e.css","./assets/vendor.9babb3f5.js"])))};var Ns={name:"sb-heading",getDefaultData:()=>({}),edit:e((()=>Rn((()=>__import__("./edit.bd5075df.js")),void 0))),display:e((()=>Rn((()=>__import__("./edit.bd5075df.js")),void 0)))};function Ts(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const Us=Ts("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function zs(t){if(Xs(t)){const e={};for(let n=0;n{if(t){const n=t.split(Vs);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function Ls(t){let e="";if(tl(t))e=t;else if(Xs(t))for(let n=0;n{},Js=/^on[^a-z]/,qs=t=>Js.test(t),Hs=Object.assign,Gs=Object.prototype.hasOwnProperty,Qs=(t,e)=>Gs.call(t,e),Xs=Array.isArray,Ys=t=>"[object Map]"===rl(t),Zs=t=>"function"==typeof t,tl=t=>"string"==typeof t,el=t=>"symbol"==typeof t,nl=t=>null!==t&&"object"==typeof t,ol=Object.prototype.toString,rl=t=>ol.call(t),sl=t=>tl(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,ll=(t,e)=>t!==e&&(t==t||e==e),il=new WeakMap,cl=[];let al;const ul=Symbol(""),fl=Symbol("");function pl(t,e=Ws){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!cl.includes(n)){hl(n);try{return vl.push(_l),_l=!0,cl.push(n),al=n,t()}finally{cl.pop(),yl(),al=cl[cl.length-1]}}};return n.id=dl++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let dl=0;function hl(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==al||t.allowRecurse)&&i.add(t)}))};if("clear"===e)l.forEach(c);else if("length"===n&&Xs(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&c(t)}));else switch(void 0!==n&&c(l.get(n)),e){case"add":Xs(t)?sl(n)&&c(l.get("length")):(c(l.get(ul)),Ys(t)&&c(l.get(fl)));break;case"delete":Xs(t)||(c(l.get(ul)),Ys(t)&&c(l.get(fl)));break;case"set":Ys(t)&&c(l.get(ul))}i.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const wl=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(el)),kl=El(),Sl=El(!1,!0),xl=El(!0),Rl=El(!0,!0),Cl={};function El(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?Yl:Xl).get(n))return n;const s=Xs(n);if(!t&&s&&Qs(Cl,o))return Reflect.get(Cl,o,r);const l=Reflect.get(n,o,r);if(el(o)?wl.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||ml(n,0,o),e)return l;if(ci(l)){return!s||!sl(o)?l.value:l}return nl(l)?t?ei(l):ti(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];Cl[t]=function(...t){const n=li(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];Cl[t]=function(...t){gl();const n=e.apply(this,t);return yl(),n}}));function Ol(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=li(o),!Xs(e)&&ci(s)&&!ci(o)))return s.value=o,!0;const l=Xs(e)&&sl(n)?Number(n)!0,deleteProperty:(t,e)=>!0};Hs({},jl,{get:Sl,set:Ol(!0)}),Hs({},$l,{get:Rl});const Pl=t=>nl(t)?ti(t):t,Fl=t=>nl(t)?ei(t):t,Il=t=>t,Al=t=>Reflect.getPrototypeOf(t);function Ml(t,e,n=!1,o=!1){const r=li(t=t.__v_raw),s=li(e);e!==s&&!n&&ml(r,0,e),!n&&ml(r,0,s);const{has:l}=Al(r),i=n?Fl:o?Il:Pl;return l.call(r,e)?i(t.get(e)):l.call(r,s)?i(t.get(s)):void 0}function Nl(t,e=!1){const n=this.__v_raw,o=li(n),r=li(t);return t!==r&&!e&&ml(o,0,t),!e&&ml(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function Tl(t,e=!1){return t=t.__v_raw,!e&&ml(li(t),0,ul),Reflect.get(t,"size",t)}function Ul(t){t=li(t);const e=li(this),n=Al(e).has.call(e,t);return e.add(t),n||bl(e,"add",t,t),this}function zl(t,e){e=li(e);const n=li(this),{has:o,get:r}=Al(n);let s=o.call(n,t);s||(t=li(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?ll(e,l)&&bl(n,"set",t,e):bl(n,"add",t,e),this}function Bl(t){const e=li(this),{has:n,get:o}=Al(e);let r=n.call(e,t);r||(t=li(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&bl(e,"delete",t,void 0),s}function Vl(){const t=li(this),e=0!==t.size,n=t.clear();return e&&bl(t,"clear",void 0,void 0),n}function Dl(t,e){return function(n,o){const r=this,s=r.__v_raw,l=li(s),i=t?Fl:e?Il:Pl;return!t&&ml(l,0,ul),s.forEach(((t,e)=>n.call(o,i(t),i(e),r)))}}function Ll(t,e,n){return function(...o){const r=this.__v_raw,s=li(r),l=Ys(s),i="entries"===t||t===Symbol.iterator&&l,c="keys"===t&&l,a=r[t](...o),u=e?Fl:n?Il:Pl;return!e&&ml(s,0,c?fl:ul),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:i?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function Wl(t){return function(...e){return"delete"!==t&&this}}const Kl={get(t){return Ml(this,t)},get size(){return Tl(this)},has:Nl,add:Ul,set:zl,delete:Bl,clear:Vl,forEach:Dl(!1,!1)},Jl={get(t){return Ml(this,t,!1,!0)},get size(){return Tl(this)},has:Nl,add:Ul,set:zl,delete:Bl,clear:Vl,forEach:Dl(!1,!0)},ql={get(t){return Ml(this,t,!0)},get size(){return Tl(this,!0)},has(t){return Nl.call(this,t,!0)},add:Wl("add"),set:Wl("set"),delete:Wl("delete"),clear:Wl("clear"),forEach:Dl(!0,!1)};function Hl(t,e){const n=e?Jl:t?ql:Kl;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(Qs(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{Kl[t]=Ll(t,!1,!1),ql[t]=Ll(t,!0,!1),Jl[t]=Ll(t,!1,!0)}));const Gl={get:Hl(!1,!1)},Ql={get:Hl(!0,!1)},Xl=new WeakMap,Yl=new WeakMap;function Zl(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>rl(t).slice(8,-1))(t))}function ti(t){return t&&t.__v_isReadonly?t:ni(t,!1,jl,Gl)}function ei(t){return ni(t,!0,$l,Ql)}function ni(t,e,n,o){if(!nl(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?Yl:Xl,s=r.get(t);if(s)return s;const l=Zl(t);if(0===l)return t;const i=new Proxy(t,2===l?o:n);return r.set(t,i),i}function oi(t){return ri(t)?oi(t.__v_raw):!(!t||!t.__v_isReactive)}function ri(t){return!(!t||!t.__v_isReadonly)}function si(t){return oi(t)||ri(t)}function li(t){return t&&li(t.__v_raw)||t}const ii=t=>nl(t)?ti(t):t;function ci(t){return Boolean(t&&!0===t.__v_isRef)}function ai(t){return function(t,e=!1){if(ci(t))return t;return new ui(t,e)}(t)}class ui{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:ii(t)}get value(){return ml(li(this),0,"value"),this._value}set value(t){ll(li(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:ii(t),bl(li(this),"set","value",t))}}class fi{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=pl(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,bl(li(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),ml(li(this),0,"value"),this._value}set value(t){this._setter(t)}}function pi(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){hi(s,e,n)}return r}function di(t,e,n,o){if(Zs(t)){const s=pi(t,e,n,o);return s&&(nl(r=s)&&Zs(r.then)&&Zs(r.catch))&&s.catch((t=>{hi(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function Ii(t){vi=!1,_i=!0,Pi(t),gi.sort(((t,e)=>Fi(t)-Fi(e)));try{for(yi=0;yiFi(t)-Fi(e))),xi=0;xiMi+=t;const Ti=(t=>(e,n=uc)=>function(t,e,n=uc,o=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;gl(),fc(n);const r=di(e,n,t,o);return fc(null),yl(),r});return o?r.unshift(s):r.push(s),s}}(t,e,n))("m"),Ui={};function zi(t,e,n){return Bi(t,e,n)}function Bi(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=Ws,i=uc){let c,a,u=!1;if(ci(t)?(c=()=>t.value,u=!!t._shallow):oi(t)?(c=()=>t,o=!0):c=Xs(t)?()=>t.map((t=>ci(t)?t.value:oi(t)?Di(t):Zs(t)?pi(t,i,2):void 0)):Zs(t)?e?()=>pi(t,i,2):()=>{if(!i||!i.isUnmounted)return a&&a(),pi(t,i,3,[f])}:Ks,e&&o){const t=c;c=()=>Di(t())}const f=t=>{a=_.options.onStop=()=>{pi(t,i,4)}};let p=Xs(t)?[]:Ui;const d=()=>{if(_.active)if(e){const t=_();(o||u||ll(t,p))&&(a&&a(),di(e,i,3,[t,p===Ui?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>Ji(d,i&&i.suspense):()=>{!i||i.isMounted?function(t){$i(t,bi,mi,wi)}(d):d()};const _=pl(c,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return pc(_,i),e?n?d():p=_():"post"===r?Ji(_,i&&i.suspense):_(),()=>{var t;(t=_).active&&(hl(t),t.options.onStop&&t.options.onStop(),t.active=!1),i&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(i.effects,_)}}function Vi(t,e,n){const o=this.proxy;return Bi(tl(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function Di(t,e=new Set){if(!nl(t)||e.has(t))return t;if(e.add(t),ci(t))Di(t.value,e);else if(Xs(t))for(let n=0;n{Di(t,e)}));else for(const n in t)Di(t[n],e);return t}function Li(t){return Zs(t)?{setup:t,name:t.name}:t}function Wi(t){Zs(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:i}=t;let c,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),i)return new Promise(((e,n)=>{i(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),c=e,e))))};return Li({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=uc;if(c)return()=>Ki(c,t);const e=e=>{a=null,hi(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>Ki(e,t))).catch((t=>(e(t),()=>o?tc(o,{error:t}):null)));const i=ai(!1),u=ai(),p=ai(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!i.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{i.value=!0})).catch((t=>{e(t),u.value=t})),()=>i.value&&c?Ki(c,t):u.value&&o?tc(o,{error:u.value}):n&&!p.value?tc(n):void 0}})}function Ki(t,{vnode:{ref:e,props:n,children:o}}){const r=tc(t,n,o);return r.ref=e,r}const Ji=function(t,e){e&&e.pendingBranch?Xs(t)?e.effects.push(...t):e.effects.push(t):$i(t,Si,ki,xi)},qi=Symbol(),Hi=Symbol(void 0),Gi=Symbol(void 0),Qi=Symbol(void 0);function Xi(t){return!!t&&!0===t.__v_isVNode}const Yi=({key:t})=>null!=t?t:null,Zi=({ref:t})=>null!=t?tl(t)||ci(t)||Zs(t)?{i:null,r:t}:t:null,tc=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==qi||(t=Qi);if(Xi(t)){const o=ec(t,e,!0);return n&&rc(o,n),o}l=t,Zs(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(si(e)||"__vInternal"in e)&&(e=Hs({},e));let{class:t,style:n}=e;t&&!tl(t)&&(e.class=Ls(t)),nl(n)&&(si(n)&&!Xs(n)&&(n=Hs({},n)),e.style=zs(n))}const i=tl(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:nl(t)?4:Zs(t)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Yi(e),ref:e&&Zi(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(rc(c,n),128&i){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=Ai(n.default),r=Ai(n.fallback)):(o=Ai(n),r=oc(null)),{content:o,fallback:r}}(c);c.ssContent=t,c.ssFallback=e}0;return c};function ec(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?sc(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Yi(l),ref:e&&e.ref?n&&r?Xs(r)?r.concat(Zi(e)):[r,Zi(e)]:Zi(e):r,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Hi?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ec(t.ssContent),ssFallback:t.ssFallback&&ec(t.ssFallback),el:t.el,anchor:t.anchor}}function nc(t=" ",e=0){return tc(Gi,null,t,e)}function oc(t){return null==t||"boolean"==typeof t?tc(Qi):Xs(t)?tc(Hi,null,t):"object"==typeof t?null===t.el?t:ec(t):tc(Gi,null,String(t))}function rc(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(Xs(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&Ni(1),rc(t,n()),n._c&&Ni(-1)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else Zs(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&o?(n=16,e=[nc(e)]):n=8);t.children=e,t.shapeFlag|=n}function sc(...t){const e=Hs({},t[0]);for(let n=1;nlc(t,e,n)));for(const l in e)o&&Qs(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const ic=t=>t&&(t.proxy?t.proxy:ic(t.parent)),cc=Hs(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>ic(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>lc(l,e,t))),lc(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(gi.length&&gi.includes(e,_i&&e.allowRecurse?yi+1:yi)||e===Ei||(gi.push(e),ji()));var e},$nextTick:t=>Oi.bind(t.proxy),$watch:t=>Vi.bind(t)}),ac={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:i,appContext:c}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const i=l[e];if(void 0!==i)switch(i){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==Ws&&Qs(o,e))return l[e]=0,o[e];if(r!==Ws&&Qs(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&Qs(a,e))return l[e]=2,s[e];if(n!==Ws&&Qs(n,e))return l[e]=3,n[e];l[e]=4}}const u=cc[e];let f,p;return u?("$attrs"===e&&ml(t,0,e),u(t)):(f=i.__cssModules)&&(f=f[e])?f:n!==Ws&&Qs(n,e)?(l[e]=3,n[e]):(p=c.config.globalProperties,Qs(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==Ws&&Qs(r,e))r[e]=n;else if(o!==Ws&&Qs(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let i;return void 0!==n[l]||t!==Ws&&Qs(t,l)||e!==Ws&&Qs(e,l)||(i=s[0])&&Qs(i,l)||Qs(o,l)||Qs(cc,l)||Qs(r.config.globalProperties,l)}};Hs({},ac,{get(t,e){if(e!==Symbol.unscopables)return ac.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!Us(e)});let uc=null;const fc=t=>{uc=t};function pc(t,e=uc){e&&(e.effects||(e.effects=[])).push(t)}function dc(t){const e=function(t){let e,n;return Zs(t)?(e=t,n=Ks):(e=t.get,n=t.set),new fi(e,n,Zs(t)||!t.set)}(t);return pc(e.effect),e}const hc=()=>({value:"",align:"left"});var _c={name:"sb-paragraph",getDefaultData:hc,edit:Wi((()=>Rn((()=>__import__("./edit.25f6c7d7.js")),["./assets/edit.25f6c7d7.js","./assets/style.3e24e605.css","./assets/vendor.9babb3f5.js"]))),display:Wi((()=>Rn((()=>__import__("./display.e17abc85.js")),["./assets/display.e17abc85.js","./assets/style.3e24e605.css","./assets/vendor.9babb3f5.js"])))};function vc(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r!!n[t.toLowerCase()]:t=>!!n[t]}const gc=vc("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl");function yc(t){if($c(t)){const e={};for(let n=0;n{if(t){const n=t.split(bc);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function kc(t){let e="";if(Ic(t))e=t;else if($c(t))for(let n=0;n{},Rc=/^on[^a-z]/,Cc=t=>Rc.test(t),Ec=Object.assign,Oc=Object.prototype.hasOwnProperty,jc=(t,e)=>Oc.call(t,e),$c=Array.isArray,Pc=t=>"[object Map]"===Tc(t),Fc=t=>"function"==typeof t,Ic=t=>"string"==typeof t,Ac=t=>"symbol"==typeof t,Mc=t=>null!==t&&"object"==typeof t,Nc=Object.prototype.toString,Tc=t=>Nc.call(t),Uc=t=>Ic(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,zc=(t,e)=>t!==e&&(t==t||e==e),Bc=new WeakMap,Vc=[];let Dc;const Lc=Symbol(""),Wc=Symbol("");function Kc(t,e=Sc){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!Vc.includes(n)){qc(n);try{return Gc.push(Hc),Hc=!0,Vc.push(n),Dc=n,t()}finally{Vc.pop(),Qc(),Dc=Vc[Vc.length-1]}}};return n.id=Jc++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let Jc=0;function qc(t){const{deps:e}=t;if(e.length){for(let n=0;n{t&&t.forEach((t=>{(t!==Dc||t.allowRecurse)&&i.add(t)}))};if("clear"===e)l.forEach(c);else if("length"===n&&$c(t))l.forEach(((t,e)=>{("length"===e||e>=o)&&c(t)}));else switch(void 0!==n&&c(l.get(n)),e){case"add":$c(t)?Uc(n)&&c(l.get("length")):(c(l.get(Lc)),Pc(t)&&c(l.get(Wc)));break;case"delete":$c(t)||(c(l.get(Lc)),Pc(t)&&c(l.get(Wc)));break;case"set":Pc(t)&&c(l.get(Lc))}i.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const Zc=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(Ac)),ta=sa(),ea=sa(!1,!0),na=sa(!0),oa=sa(!0,!0),ra={};function sa(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?$a:ja).get(n))return n;const s=$c(n);if(!t&&s&&jc(ra,o))return Reflect.get(ra,o,r);const l=Reflect.get(n,o,r);if(Ac(o)?Zc.has(o):"__proto__"===o||"__v_isRef"===o)return l;if(t||Xc(n,0,o),e)return l;if(Ba(l)){return!s||!Uc(o)?l.value:l}return Mc(l)?t?Ia(l):Fa(l):l}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];ra[t]=function(...t){const n=Ua(this);for(let e=0,r=this.length;e{const e=Array.prototype[t];ra[t]=function(...t){Gc.push(Hc),Hc=!1;const n=e.apply(this,t);return Qc(),n}}));function la(t=!1){return function(e,n,o,r){const s=e[n];if(!t&&(o=Ua(o),!$c(e)&&Ba(s)&&!Ba(o)))return s.value=o,!0;const l=$c(e)&&Uc(n)?Number(n)!0,deleteProperty:(t,e)=>!0};Ec({},ia,{get:ea,set:la(!0)}),Ec({},ca,{get:oa});const aa=t=>Mc(t)?Fa(t):t,ua=t=>Mc(t)?Ia(t):t,fa=t=>t,pa=t=>Reflect.getPrototypeOf(t);function da(t,e,n=!1,o=!1){const r=Ua(t=t.__v_raw),s=Ua(e);e!==s&&!n&&Xc(r,0,e),!n&&Xc(r,0,s);const{has:l}=pa(r),i=n?ua:o?fa:aa;return l.call(r,e)?i(t.get(e)):l.call(r,s)?i(t.get(s)):void 0}function ha(t,e=!1){const n=this.__v_raw,o=Ua(n),r=Ua(t);return t!==r&&!e&&Xc(o,0,t),!e&&Xc(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function _a(t,e=!1){return t=t.__v_raw,!e&&Xc(Ua(t),0,Lc),Reflect.get(t,"size",t)}function va(t){t=Ua(t);const e=Ua(this),n=pa(e).has.call(e,t);return e.add(t),n||Yc(e,"add",t,t),this}function ga(t,e){e=Ua(e);const n=Ua(this),{has:o,get:r}=pa(n);let s=o.call(n,t);s||(t=Ua(t),s=o.call(n,t));const l=r.call(n,t);return n.set(t,e),s?zc(e,l)&&Yc(n,"set",t,e):Yc(n,"add",t,e),this}function ya(t){const e=Ua(this),{has:n,get:o}=pa(e);let r=n.call(e,t);r||(t=Ua(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&Yc(e,"delete",t,void 0),s}function ma(){const t=Ua(this),e=0!==t.size,n=t.clear();return e&&Yc(t,"clear",void 0,void 0),n}function ba(t,e){return function(n,o){const r=this,s=r.__v_raw,l=Ua(s),i=t?ua:e?fa:aa;return!t&&Xc(l,0,Lc),s.forEach(((t,e)=>n.call(o,i(t),i(e),r)))}}function wa(t,e,n){return function(...o){const r=this.__v_raw,s=Ua(r),l=Pc(s),i="entries"===t||t===Symbol.iterator&&l,c="keys"===t&&l,a=r[t](...o),u=e?ua:n?fa:aa;return!e&&Xc(s,0,c?Wc:Lc),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:i?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function ka(t){return function(...e){return"delete"!==t&&this}}const Sa={get(t){return da(this,t)},get size(){return _a(this)},has:ha,add:va,set:ga,delete:ya,clear:ma,forEach:ba(!1,!1)},xa={get(t){return da(this,t,!1,!0)},get size(){return _a(this)},has:ha,add:va,set:ga,delete:ya,clear:ma,forEach:ba(!1,!0)},Ra={get(t){return da(this,t,!0)},get size(){return _a(this,!0)},has(t){return ha.call(this,t,!0)},add:ka("add"),set:ka("set"),delete:ka("delete"),clear:ka("clear"),forEach:ba(!0,!1)};function Ca(t,e){const n=e?xa:t?Ra:Sa;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(jc(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{Sa[t]=wa(t,!1,!1),Ra[t]=wa(t,!0,!1),xa[t]=wa(t,!1,!0)}));const Ea={get:Ca(!1,!1)},Oa={get:Ca(!0,!1)},ja=new WeakMap,$a=new WeakMap;function Pa(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>Tc(t).slice(8,-1))(t))}function Fa(t){return t&&t.__v_isReadonly?t:Aa(t,!1,ia,Ea)}function Ia(t){return Aa(t,!0,ca,Oa)}function Aa(t,e,n,o){if(!Mc(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=e?$a:ja,s=r.get(t);if(s)return s;const l=Pa(t);if(0===l)return t;const i=new Proxy(t,2===l?o:n);return r.set(t,i),i}function Ma(t){return Na(t)?Ma(t.__v_raw):!(!t||!t.__v_isReactive)}function Na(t){return!(!t||!t.__v_isReadonly)}function Ta(t){return Ma(t)||Na(t)}function Ua(t){return t&&Ua(t.__v_raw)||t}const za=t=>Mc(t)?Fa(t):t;function Ba(t){return Boolean(t&&!0===t.__v_isRef)}function Va(t){return function(t,e=!1){if(Ba(t))return t;return new Da(t,e)}(t)}class Da{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:za(t)}get value(){return Xc(Ua(this),0,"value"),this._value}set value(t){zc(Ua(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:za(t),Yc(Ua(this),"set","value",t))}}function La(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){Ka(s,e,n)}return r}function Wa(t,e,n,o){if(Fc(t)){const s=La(t,e,n,o);return s&&(Mc(r=s)&&Fc(r.then)&&Fc(r.catch))&&s.catch((t=>{Ka(t,e,n)})),s}var r;const s=[];for(let l=0;lnull==t.id?1/0:t.id;function uu(t){qa=!1,Ja=!0,cu(t),Ha.sort(((t,e)=>au(t)-au(e)));try{for(Ga=0;Gaau(t)-au(e))),eu=0;eupu+=t;const hu={};function _u(t,e,n){return vu(t,e,n)}function vu(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:l}=Sc,i=zu){let c,a,u=!1;if(Ba(t)?(c=()=>t.value,u=!!t._shallow):Ma(t)?(c=()=>t,o=!0):c=$c(t)?()=>t.map((t=>Ba(t)?t.value:Ma(t)?yu(t):Fc(t)?La(t,i,2):void 0)):Fc(t)?e?()=>La(t,i,2):()=>{if(!i||!i.isUnmounted)return a&&a(),La(t,i,3,[f])}:xc,e&&o){const t=c;c=()=>yu(t())}const f=t=>{a=_.options.onStop=()=>{La(t,i,4)}};let p=$c(t)?[]:hu;const d=()=>{if(_.active)if(e){const t=_();(o||u||zc(t,p))&&(a&&a(),Wa(e,i,3,[t,p===hu?void 0:p,f]),p=t)}else _()};let h;d.allowRecurse=!!e,h="sync"===r?d:"post"===r?()=>ku(d,i&&i.suspense):()=>{!i||i.isMounted?function(t){iu(t,Xa,Qa,Ya)}(d):d()};const _=Kc(c,{lazy:!0,onTrack:s,onTrigger:l,scheduler:h});return function(t,e=zu){e&&(e.effects||(e.effects=[])).push(t)}(_,i),e?n?d():p=_():"post"===r?ku(_,i&&i.suspense):_(),()=>{var t;(t=_).active&&(qc(t),t.options.onStop&&t.options.onStop(),t.active=!1),i&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(i.effects,_)}}function gu(t,e,n){const o=this.proxy;return vu(Ic(t)?()=>o[t]:t.bind(o),e.bind(o),n,this)}function yu(t,e=new Set){if(!Mc(t)||e.has(t))return t;if(e.add(t),Ba(t))yu(t.value,e);else if($c(t))for(let n=0;n{yu(t,e)}));else for(const n in t)yu(t[n],e);return t}function mu(t){return Fc(t)?{setup:t,name:t.name}:t}function bu(t){Fc(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:l=!0,onError:i}=t;let c,a=null,u=0;const f=()=>{let t;return a||(t=a=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),i)return new Promise(((e,n)=>{i(t,(()=>e((u++,a=null,f()))),(()=>n(t)),u+1)}));throw t})).then((e=>t!==a&&a?a:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),c=e,e))))};return mu({__asyncLoader:f,name:"AsyncComponentWrapper",setup(){const t=zu;if(c)return()=>wu(c,t);const e=e=>{a=null,Ka(e,t,13,!o)};if(l&&t.suspense)return f().then((e=>()=>wu(e,t))).catch((t=>(e(t),()=>o?$u(o,{error:t}):null)));const i=Va(!1),u=Va(),p=Va(!!r);return r&&setTimeout((()=>{p.value=!1}),r),null!=s&&setTimeout((()=>{if(!i.value&&!u.value){const t=new Error(`Async component timed out after ${s}ms.`);e(t),u.value=t}}),s),f().then((()=>{i.value=!0})).catch((t=>{e(t),u.value=t})),()=>i.value&&c?wu(c,t):u.value&&o?$u(o,{error:u.value}):n&&!p.value?$u(n):void 0}})}function wu(t,{vnode:{ref:e,props:n,children:o}}){const r=$u(t,n,o);return r.ref=e,r}const ku=function(t,e){e&&e.pendingBranch?$c(t)?e.effects.push(...t):e.effects.push(t):iu(t,tu,Za,eu)},Su=Symbol(),xu=Symbol(void 0),Ru=Symbol(void 0),Cu=Symbol(void 0);function Eu(t){return!!t&&!0===t.__v_isVNode}const Ou=({key:t})=>null!=t?t:null,ju=({ref:t})=>null!=t?Ic(t)||Ba(t)||Fc(t)?{i:null,r:t}:t:null,$u=function(t,e=null,n=null,o=0,r=null,s=!1){t&&t!==Su||(t=Cu);if(Eu(t)){const o=Pu(t,e,!0);return n&&Au(o,n),o}l=t,Fc(l)&&"__vccOpts"in l&&(t=t.__vccOpts);var l;if(e){(Ta(e)||"__vInternal"in e)&&(e=Ec({},e));let{class:t,style:n}=e;t&&!Ic(t)&&(e.class=kc(t)),Mc(n)&&(Ta(n)&&!$c(n)&&(n=Ec({},n)),e.style=yc(n))}const i=Ic(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:Mc(t)?4:Fc(t)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Ou(e),ref:e&&ju(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(Au(c,n),128&i){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:n}=t;let o,r;return 32&e?(o=fu(n.default),r=fu(n.fallback)):(o=fu(n),r=Iu(null)),{content:o,fallback:r}}(c);c.ssContent=t,c.ssFallback=e}0;return c};function Pu(t,e,n=!1){const{props:o,ref:r,patchFlag:s}=t,l=e?function(...t){const e=Ec({},t[0]);for(let n=1;nMu(t,e,n)));for(const l in e)o&&jc(o,l)?t[l]=o[l](t[l],e[l],n.proxy,l):t[l]=e[l]}const Nu=t=>t&&(t.proxy?t.proxy:Nu(t.parent)),Tu=Ec(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Nu(t.parent),$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:n,mixins:o,extends:r}=e;if(n)return n;const s=t.appContext.mixins;if(!s.length&&!o&&!r)return e;const l={};return s.forEach((e=>Mu(l,e,t))),Mu(l,e,t),e.__merged=l}(t),$forceUpdate:t=>()=>{return e=t.update,void(Ha.length&&Ha.includes(e,Ja&&e.allowRecurse?Ga+1:Ga)||e===ru||(Ha.push(e),lu()));var e},$nextTick:t=>su.bind(t.proxy),$watch:t=>gu.bind(t)}),Uu={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:l,type:i,appContext:c}=t;if("__v_skip"===e)return!0;let a;if("$"!==e[0]){const i=l[e];if(void 0!==i)switch(i){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==Sc&&jc(o,e))return l[e]=0,o[e];if(r!==Sc&&jc(r,e))return l[e]=1,r[e];if((a=t.propsOptions[0])&&jc(a,e))return l[e]=2,s[e];if(n!==Sc&&jc(n,e))return l[e]=3,n[e];l[e]=4}}const u=Tu[e];let f,p;return u?("$attrs"===e&&Xc(t,0,e),u(t)):(f=i.__cssModules)&&(f=f[e])?f:n!==Sc&&jc(n,e)?(l[e]=3,n[e]):(p=c.config.globalProperties,jc(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==Sc&&jc(r,e))r[e]=n;else if(o!==Sc&&jc(o,e))o[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},l){let i;return void 0!==n[l]||t!==Sc&&jc(t,l)||e!==Sc&&jc(e,l)||(i=s[0])&&jc(i,l)||jc(o,l)||jc(Tu,l)||jc(r.config.globalProperties,l)}};Ec({},Uu,{get(t,e){if(e!==Symbol.unscopables)return Uu.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!gc(e)});let zu=null;const Bu=()=>({src:"",alt:"",description:{id:b(),name:"sb-paragraph",data:{value:"",align:"left"}}});var Vu={name:"sb-image",getDefaultData:Bu,edit:bu((()=>Rn((()=>__import__("./edit.fbd6e1aa.js")),["./assets/edit.fbd6e1aa.js","./assets/style.d3f26b5f.css","./assets/vendor.9babb3f5.js"]))),display:bu((()=>Rn((()=>__import__("./display.8a67d4c4.js")),["./assets/display.8a67d4c4.js","./assets/style.d3f26b5f.css","./assets/vendor.9babb3f5.js"])))};a(n({name:"App",setup(){const t=o("edit"),e=r({name:"none",id:"0",data:null});s((async()=>{const t=await fetch("/initial-data.json"),n=await t.json();e.name=n.name,e.id=n.id,e.data=n.data}));const n=l((()=>{switch(t.value){case u.Edit:return i(On,{block:e,onUpdate:t=>{e.data=t.data},customBlocks:[Ms,Ns,Vu,_c],key:"edit",mode:u.Edit},null);case u.Display:return i(On,{block:e,customBlocks:[Ms,Ns,Vu,_c],key:"display",mode:u.Display},null);case"data":return i("pre",null,[i("code",null,[JSON.stringify(e,null,2)])])}}));return()=>i("div",{id:"app"},[i("select",{value:t.value,onChange:e=>{t.value=e.target.value}},[i("option",null,[c("edit")]),i("option",null,[c("display")]),i("option",null,[c("data")])]),n.value])}})).mount("#app");export{Fa as A,Va as B,_u as C,$u as D,Fu as E,xu as F,Fe as G,k as H,Le as I,Ke as J,oo as S,ws as a,yn as b,Is as c,us as d,En as e,Cs as f,As as g,eo as h,no as i,Li as j,hc as k,ti as l,w as m,ai as n,Ti as o,zi as p,dc as q,kr as r,tc as s,ro as t,ln as u,nc as v,ls as w,sc as x,mu as y,Bu as z}; diff --git a/docs/index.html b/docs/index.html index aa4bb52..1ac3887 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,12 +2,12 @@ - + Vite App - - - + + +
diff --git a/package-lock.json b/package-lock.json index 3c12389..5711892 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3394,6 +3394,115 @@ "typedarray": "^0.0.6" } }, + "concurrently": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.0.0.tgz", + "integrity": "sha512-Ik9Igqnef2ONLjN2o/OVx1Ow5tymVvvEwQeYCQdD/oV+CN9oWhxLk7ibcBdOtv0UzBqHCEKRwbKceYoTK8t3fQ==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "date-fns": "^2.16.1", + "lodash": "^4.17.20", + "read-pkg": "^5.2.0", + "rxjs": "^6.6.3", + "spawn-command": "^0.0.2-1", + "supports-color": "^8.1.0", + "tree-kill": "^1.2.2", + "yargs": "^16.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + } + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, "config-chain": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", @@ -3806,6 +3915,12 @@ "assert-plus": "^1.0.0" } }, + "date-fns": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.19.0.tgz", + "integrity": "sha512-X3bf2iTPgCAQp9wvjOQytnf5vO5rESYRXlPIVcgSbtT5OTScPcsf9eZU+B/YIkKAtYr5WeCii58BgATrNitlWg==", + "dev": true + }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -8232,6 +8347,12 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "spawn-command": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", + "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", + "dev": true + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -8627,6 +8748,12 @@ "punycode": "^2.1.0" } }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, "trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", diff --git a/package.json b/package.json index d34545d..6e8b43f 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.0.0", "license": "GPL-3.0-or-later", "scripts": { - "dev": "vite", - "build": "vuedx-typecheck . && vite build" + "dev": "concurrently 'vuedx-typecheck --no-pretty --watch ./src' 'vite'", + "build": "vuedx-typecheck --no-pretty ./src && vite build" }, "dependencies": { "lodash-es": "^4.17.20", @@ -15,6 +15,7 @@ "@vue/compiler-sfc": "^3.0.5", "@vuedx/typecheck": "^0.6.3", "@vuedx/typescript-plugin-vue": "^0.6.3", + "concurrently": "^6.0.0", "lerna": "^3.22.1", "sass": "^1.30.0", "typescript": "^4.1.2", diff --git a/packages/core/lib/block-helpers.ts b/packages/core/lib/block-helpers.ts new file mode 100644 index 0000000..df5ba00 --- /dev/null +++ b/packages/core/lib/block-helpers.ts @@ -0,0 +1,15 @@ +import { v4 as uuidv4 } from 'uuid'; + +export const generateBlockId = uuidv4; + +export const model = { + prop: 'block', + event: 'update', +}; + +export const blockProps = { + blockId: { + type: String, + default: generateBlockId, + }, +}; diff --git a/packages/core/lib/blocks.ts b/packages/core/lib/blocks.ts deleted file mode 100644 index 115380f..0000000 --- a/packages/core/lib/blocks.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component } from 'vue'; - -export interface BlockTree { - id: string; - name: string; - icon?: string; - children?: BlockTree[]; -} - -export interface BlockDefinition { - name: string; - icon?: string; - getDefaultData: any; - edit: Component; - display: Component; - getChildren?: (block: Block) => Block[], -} - -export interface BlockLibraryDefinition { - [name: string]: BlockDefinition; -} - -export interface BlockProps { - id: string; - data: any; -} - -export interface Block extends BlockProps { - name: string; -} - -export const model = { - prop: 'block', - event: 'update', -}; - -export const blockProps = { - id: { - type: String, - default: () => `${+(new Date())}`, - }, - data: { type: Object, default: () => ({}) }, -}; diff --git a/packages/core/lib/components/Block.tsx b/packages/core/lib/components/Block.tsx index 42c1bfa..c5dfc4c 100644 --- a/packages/core/lib/components/Block.tsx +++ b/packages/core/lib/components/Block.tsx @@ -6,37 +6,23 @@ import { ref, Ref, } from 'vue'; -import { Block } from '../blocks'; +import { BlockData } from '../types'; import { SbMode } from '../mode'; -import { useResizeObserver, BlockDimensions } from '../use-resize-observer'; +import { useResizeObserver, SymBlockDimensions } from '../use-resize-observer'; import { useActivation } from '../use-activation'; import { useBlockTree } from '../use-block-tree'; import { useDynamicBlocks } from '../use-dynamic-blocks'; -import { SbBlockOrdering } from './BlockOrdering'; -import SbMissingBlock from './BlockMissing/index'; +import SbMissingBlock from './MissingBlock'; import './Block.scss'; -interface BlockProps { - block: Block; - onUpdate: (b?: Block) => void; - onPrependBlock: (b?: Block) => void; - onAppendBlock: (b?: Block) => void; - onRemoveSelf: () => void; - onMoveBackward: () => void; - onMoveForward: () => void; - onActivateNext: () => void; - onActivatePrevious: () => void; - sortable: string; -} - export const SbBlock = defineComponent({ name: 'sb-block', props: { block: { - type: (null as unknown) as PropType, + type: (null as unknown) as PropType>, required: true, }, sortable: { @@ -47,24 +33,23 @@ export const SbBlock = defineComponent({ onPrependBlock: { type: Function, default: () => {} }, onAppendBlock: { type: Function, default: () => {} }, onRemoveSelf: { type: Function, default: () => {} }, - onMoveBackward: { type: Function, default: () => {} }, - onMoveForward: { type: Function, default: () => {} }, + onActivatePrevious: { type: Function, default: () => {} }, + onActivateNext: { type: Function, default: () => {} }, }, - setup(props: BlockProps, context) { + setup(props, context) { const el: Ref = ref(null); const { mode, getBlock } = useDynamicBlocks(); const { isActive, activate, - isHighlighted, } = useActivation(props.block.id); const classes = computed(() => ({ 'sb-block': true, 'sb-block_active': isActive.value, })); - const { triggerSizeCalculation } = useResizeObserver(el, BlockDimensions); + const { triggerSizeCalculation } = useResizeObserver(el, SymBlockDimensions); watch(() => props.block.data, triggerSizeCalculation); const { register } = useBlockTree(); @@ -114,11 +99,14 @@ export const SbBlock = defineComponent({ onRemoveSelf={props.onRemoveSelf} onActivatePrevious={props.onActivatePrevious} onActivateNext={props.onActivateNext} - onClick={($event: MouseEvent) => { - $event.stopPropagation(); - activate(); + + {...{ + 'onClick:value': ($event: MouseEvent) => { + $event.stopPropagation(); + activate(); + }, + ...context.attrs, }} - {...context.attrs} /> ; }; diff --git a/packages/core/lib/components/BlockOrdering.tsx b/packages/core/lib/components/BlockOrdering.tsx index 08cce62..1fd2f76 100644 --- a/packages/core/lib/components/BlockOrdering.tsx +++ b/packages/core/lib/components/BlockOrdering.tsx @@ -15,13 +15,13 @@ export const SbBlockOrdering = defineComponent({ name: 'sb-block-ordering', props: { - sortable: { + orientation: { type: String, default: null, }, onRemove: { type: Function, default: () => {} }, - onMoveUp: { type: Function, default: () => {} }, - onMoveDown: { type: Function, default: () => {} }, + onMoveBackward: { type: Function, default: () => {} }, + onMoveForward: { type: Function, default: () => {} }, }, setup(props) { @@ -32,7 +32,7 @@ export const SbBlockOrdering = defineComponent({ const classes = computed(() => ({ 'sb-block-ordering': true, - [`sb-block-ordering_${props.sortable}`]: !!props.sortable, + [`sb-block-ordering_${props.orientation}`]: !!props.orientation, })); const { editorDimensions, blockDimensions } = useBlockSizing(); @@ -47,7 +47,7 @@ export const SbBlockOrdering = defineComponent({ }); watch(editorDimensions, resetStyles); watch(blockDimensions, resetStyles); - watch(() => props.sortable, resetStyles); + watch(() => props.orientation, resetStyles); return () => (
$event.stopPropagation()} > - {props.sortable === 'vertical' ? '↑' : '←'} - x - {props.sortable === 'vertical' ? '↓' : '→'} + {props.orientation === 'vertical' ? '↑' : '←'} + x + {props.orientation === 'vertical' ? '↓' : '→'}
); }, diff --git a/packages/core/lib/components/BlockPicker.tsx b/packages/core/lib/components/BlockPicker.tsx index 2990b1c..0509255 100644 --- a/packages/core/lib/components/BlockPicker.tsx +++ b/packages/core/lib/components/BlockPicker.tsx @@ -3,10 +3,8 @@ import { ref, defineComponent, } from 'vue'; -import { - useDynamicBlocks, - BlockDefinition, -} from '../use-dynamic-blocks'; +import { useDynamicBlocks } from '../use-dynamic-blocks'; +import { BlockDefinition } from '../types'; import { SbButton } from './Button'; import { SbModal } from './Modal'; @@ -16,17 +14,19 @@ import './BlockPicker.scss'; export const SbBlockPicker = defineComponent({ name: 'sb-block-picker', - props: {}, + props: { + onPickedBlock: { type: Function, default: () => {} }, + }, - setup(props, context) { + setup(props) { const open = ref(false); const { customBlocks } = useDynamicBlocks(); const blockList = computed(() => Object.keys(customBlocks).map((key) => customBlocks[key])); - const selectBlock = (block: BlockDefinition) => () => { + const selectBlock = (block: BlockDefinition) => () => { open.value = false; - context.emit('picked-block', { + props.onPickedBlock({ name: block.name, id: `${+(new Date())}`, data: block.getDefaultData(), @@ -37,23 +37,27 @@ export const SbBlockPicker = defineComponent({
{ - open.value = true; - $event.stopPropagation(); + {...{ + type: 'button', + onClick: ($event: MouseEvent) => { + open.value = true; + $event.stopPropagation(); + }, }} >+ $event.stopPropagation()} onClose={() => { open.value = false; }} + {...{ onClick: ($event: MouseEvent) => $event.stopPropagation() }} > - {...blockList.value.map((block: BlockDefinition) => ( + {...blockList.value.map((block: BlockDefinition) => ( selectBlock(block), + }} >{block.name} ))} diff --git a/packages/core/lib/components/BlockPlaceholder.tsx b/packages/core/lib/components/BlockPlaceholder.tsx index 28262e0..17160dd 100644 --- a/packages/core/lib/components/BlockPlaceholder.tsx +++ b/packages/core/lib/components/BlockPlaceholder.tsx @@ -1,5 +1,5 @@ import { defineComponent } from 'vue'; -import { BlockDefinition } from '../blocks'; +import { BlockData } from '../types'; import { SbBlockPicker } from './BlockPicker'; @@ -8,11 +8,15 @@ import './BlockPlaceholder.scss'; export const SbBlockPlaceholder = defineComponent({ name: 'sb-block-placeholder', - setup(props, context) { + props: { + onInsertBlock: { type: Function, default: () => {} }, + }, + + setup(props) { return () => (
context.emit('insert-block', block)} + onPickedBlock={(block: BlockData) => props.onInsertBlock(block)} />
); diff --git a/packages/core/lib/components/BlockToolbar.tsx b/packages/core/lib/components/BlockToolbar.tsx index 62e4875..7e4fb30 100644 --- a/packages/core/lib/components/BlockToolbar.tsx +++ b/packages/core/lib/components/BlockToolbar.tsx @@ -1,26 +1,11 @@ -import { - defineComponent, - PropType, -} from 'vue'; -import { Block } from '../blocks'; +import { defineComponent } from 'vue'; import './BlockToolbar.scss'; -interface BlockToolbarProps { - block: Block; -} - export const SbBlockToolbar = defineComponent({ name: 'sb-block-toolbar', - props: { - block: { - type: (null as unknown) as PropType, - required: true, - }, - }, - - setup(props: BlockToolbarProps, context) { + setup() { return () => (
); diff --git a/packages/core/lib/components/Button.tsx b/packages/core/lib/components/Button.tsx index f87187b..b144e72 100644 --- a/packages/core/lib/components/Button.tsx +++ b/packages/core/lib/components/Button.tsx @@ -7,7 +7,7 @@ export const SbButton = defineComponent({ inheritAttrs: false, - setup(props, context) { + setup(_, context) { return () => ( ); }, diff --git a/packages/core/lib/components/ContextMenu.tsx b/packages/core/lib/components/ContextMenu.tsx index fc62850..2951a10 100644 --- a/packages/core/lib/components/ContextMenu.tsx +++ b/packages/core/lib/components/ContextMenu.tsx @@ -3,16 +3,10 @@ import { defineComponent, ref, } from 'vue'; - import { SbButton } from './Button'; import './ContextMenu.scss'; -interface ContextMenuProps { - onClose: () => void; - onOpen: () => void; -} - export const SbContextMenu = defineComponent({ name: 'sb-context-menu', @@ -21,7 +15,7 @@ export const SbContextMenu = defineComponent({ onOpen: { type: Function, default: () => {} }, }, - setup(props: ContextMenuProps, context) { + setup(props, context) { const opened = ref(false); const open = () => { opened.value = true; }; const close = () => { opened.value = false; }; @@ -40,10 +34,12 @@ export const SbContextMenu = defineComponent({ if (!curr) { document.body.removeEventListener('click', close); document.body.removeEventListener('keypress', closeOnEscape); + props.onClose(); } else { setTimeout(() => { document.body.addEventListener('click', close); document.body.addEventListener('keypress', closeOnEscape); + props.onOpen(); }); } }); @@ -51,24 +47,23 @@ export const SbContextMenu = defineComponent({ return () => (
{ - context.slots.context({ + context.slots.context?.({ opened, toggle, close, open, - }) || - Menu + }) || Menu } { // Make sure clicks inside do not autoclose this $event.stopPropagation(); }} + {...{ onClose: close /* TODO: DialogHTMLAttributes needs an onClose handler type */ }} > - {context.slots.default({ + {context.slots.default?.({ opened, toggle, close, diff --git a/packages/core/lib/components/MainMenu.tsx b/packages/core/lib/components/MainMenu.tsx index 3894607..c947176 100644 --- a/packages/core/lib/components/MainMenu.tsx +++ b/packages/core/lib/components/MainMenu.tsx @@ -2,32 +2,25 @@ import { defineComponent, PropType, } from 'vue'; -import { Block } from '../blocks'; - +import { BlockData } from '../types'; import { SbTreeBlockSelect } from './TreeBlockSelect'; import './MainMenu.scss'; -interface MainMenuProps { - block: Block; -} - export const SbMainMenu = defineComponent({ name: 'sb-main-menu', props: { block: { - type: (null as unknown) as PropType, + type: (null as unknown) as PropType>, required: true, }, }, - setup(props: MainMenuProps, context) { + setup() { return () => (
- +
); }, diff --git a/packages/core/lib/components/BlockMissing/display.tsx b/packages/core/lib/components/MissingBlock/display.tsx similarity index 62% rename from packages/core/lib/components/BlockMissing/display.tsx rename to packages/core/lib/components/MissingBlock/display.tsx index a89ca3f..c1a68a1 100644 --- a/packages/core/lib/components/BlockMissing/display.tsx +++ b/packages/core/lib/components/MissingBlock/display.tsx @@ -2,25 +2,18 @@ import { defineComponent, PropType } from 'vue'; import { model, blockProps, - BlockProps, -} from '../../blocks'; +} from '../../block-helpers'; import './style.scss'; -interface MissingBlockProps extends BlockProps { - eventUpdate: (b?: any) => void; - eventAppendBlock: (b?: any) => void; - eventRemoveBlock: () => void; -} - export default defineComponent({ name: 'sb-missing-block', model, props: { - name: String, ...blockProps, + name: String, data: { type: (null as unknown) as PropType, default: null, @@ -30,11 +23,9 @@ export default defineComponent({ eventRemoveBlock: { type: Function, default: () => {} }, }, - setup(props: MissingBlockProps) { + setup(props) { return () => ( -
- Missing block: {props.name} -
+
Missing block: {props.name}
); }, }); diff --git a/packages/core/lib/components/BlockMissing/index.ts b/packages/core/lib/components/MissingBlock/index.ts similarity index 100% rename from packages/core/lib/components/BlockMissing/index.ts rename to packages/core/lib/components/MissingBlock/index.ts diff --git a/packages/core/lib/components/BlockMissing/style.scss b/packages/core/lib/components/MissingBlock/style.scss similarity index 100% rename from packages/core/lib/components/BlockMissing/style.scss rename to packages/core/lib/components/MissingBlock/style.scss diff --git a/packages/core/lib/components/BlockMissing/util.ts b/packages/core/lib/components/MissingBlock/util.ts similarity index 100% rename from packages/core/lib/components/BlockMissing/util.ts rename to packages/core/lib/components/MissingBlock/util.ts diff --git a/packages/core/lib/components/Modal.tsx b/packages/core/lib/components/Modal.tsx index 71c5b28..b53e456 100644 --- a/packages/core/lib/components/Modal.tsx +++ b/packages/core/lib/components/Modal.tsx @@ -5,11 +5,6 @@ import { import './Modal.scss'; -interface ModalProps { - open: boolean; - onClose: () => void; -} - export const SbModal = defineComponent({ name: 'sb-modal', @@ -21,7 +16,7 @@ export const SbModal = defineComponent({ onClose: { type: Function, default: () => {} }, }, - setup(props: ModalProps, context) { + setup(props, context) { const classes = computed(() => ({ 'sb-modal': true, 'sb-modal_open': props.open, @@ -37,7 +32,7 @@ export const SbModal = defineComponent({ }} >
- {context.slots.default()} + {context.slots.default?.()}
diff --git a/packages/core/lib/components/Schlechtenburg.tsx b/packages/core/lib/components/Schlechtenburg.tsx index fb96d46..b3223bb 100644 --- a/packages/core/lib/components/Schlechtenburg.tsx +++ b/packages/core/lib/components/Schlechtenburg.tsx @@ -7,17 +7,21 @@ import { Ref, } from 'vue'; import { - model, - Block, - BlockTree, + BlockData, BlockDefinition, - BlockLibraryDefinition, -} from '../blocks'; + BlockLibrary, + TreeNode, +} from '../types'; +import { model } from '../block-helpers'; import { Mode, SbMode } from '../mode'; -import { BlockLibrary } from '../use-dynamic-blocks'; -import { BlockTreeSym, BlockTreeRegister, BlockTreeUnregister } from '../use-block-tree'; -import { EditorDimensions, useResizeObserver } from '../use-resize-observer'; -import { ActiveBlock } from '../use-activation'; +import { SymBlockLibrary} from '../use-dynamic-blocks'; +import { + SymBlockTree, + SymBlockTreeRegister, + SymBlockTreeUnregister, +} from '../use-block-tree'; +import { SymEditorDimensions, useResizeObserver } from '../use-resize-observer'; +import { SymActiveBlock } from '../use-activation'; import { SbMainMenu } from './MainMenu'; import { SbBlockToolbar } from './BlockToolbar'; @@ -25,21 +29,20 @@ import { SbBlock } from './Block'; import './Schlechtenburg.scss'; -export interface SchlechtenburgProps { - customBlocks: BlockDefinition[]; - onUpdate: (b: Block) => void; - block: Block; - mode: SbMode; -} - -export const Schlechtenburg = defineComponent({ - name: 'schlechtenburg-main', +export const SbMain = defineComponent({ + name: 'sb-main', model, props: { - customBlocks: { type: Array as PropType, default: () => [] }, - block: { type: Object as PropType>, required: true }, + customBlocks: { + type: Array as PropType[]>, + default: () => [], + }, + block: { + type: Object as PropType>, + required: true, + }, onUpdate: { type: Function, default: () => {} }, mode: { type: String as PropType, @@ -50,29 +53,29 @@ export const Schlechtenburg = defineComponent({ }, }, - setup(props: SchlechtenburgProps) { + setup(props) { // TODO: why does the typing of props not work here? const el: Ref = ref(null); - useResizeObserver(el, EditorDimensions); + useResizeObserver(el, SymEditorDimensions); const mode = ref(props.mode); provide(Mode, mode); const activeBlock = ref(null); - provide(ActiveBlock, activeBlock); + provide(SymActiveBlock, activeBlock); - const blockTree = ref(null); - provide(BlockTreeSym, blockTree); - provide(BlockTreeRegister, (block: BlockTree) => { blockTree.value = block; }); - provide(BlockTreeUnregister, () => { blockTree.value = null; }); + const blockTree: Ref = ref(null); + provide(SymBlockTree, blockTree); + provide(SymBlockTreeRegister, (block: TreeNode) => { blockTree.value = block; }); + provide(SymBlockTreeUnregister, () => { blockTree.value = null; }); - const blockLibrary: BlockLibraryDefinition = shallowReactive({ + const blockLibrary: BlockLibrary = shallowReactive({ ...props.customBlocks.reduce( - (blocks: {[name: string]: Block}, block: Block) => ({ ...blocks, [block.name]: block }), + (blocks: BlockLibrary, block: BlockDefinition) => ({ ...blocks, [block.name]: block }), {}, ), }); - provide(BlockLibrary, blockLibrary); + provide(SymBlockLibrary, blockLibrary); return () => (
- + : null } diff --git a/packages/core/lib/components/Select.tsx b/packages/core/lib/components/Select.tsx index 2d86603..1a46b46 100644 --- a/packages/core/lib/components/Select.tsx +++ b/packages/core/lib/components/Select.tsx @@ -6,14 +6,14 @@ export const SbSelect = defineComponent({ inheritAttrs: false, - setup(props, context) { + setup(_, context) { return () => (
); diff --git a/packages/core/lib/components/TreeBlockSelect.tsx b/packages/core/lib/components/TreeBlockSelect.tsx index f4c985d..1cb2bbc 100644 --- a/packages/core/lib/components/TreeBlockSelect.tsx +++ b/packages/core/lib/components/TreeBlockSelect.tsx @@ -1,11 +1,5 @@ -import { - defineComponent, - PropType, -} from 'vue'; -import { - Block, - BlockTree, -} from '../blocks'; +import { defineComponent } from 'vue'; +import { TreeNode } from '../types'; import { useBlockTree } from '../use-block-tree'; import { useActivation } from '../use-activation'; @@ -14,10 +8,6 @@ import { SbButton } from './Button'; import './TreeBlockSelect.scss'; -interface TreeBlockSelectProps { - block: Block; -} - export const SbTreeBlockSelect = defineComponent({ name: 'sb-main-menu', @@ -28,7 +18,7 @@ export const SbTreeBlockSelect = defineComponent({ activeBlockId, } = useActivation(); - const treeToHtml = (tree: BlockTree, close: Function) =>
  • activate(tree.id)} + onMouseenter={() => activate(tree.id)} >{tree.name} - {tree.children.length + {tree.children?.length ?
      - {tree.children.map((child: BlockTree) => treeToHtml(child, close))} + {tree.children?.map((child: TreeNode) => treeToHtml(child, close))}
    : null } @@ -55,10 +45,10 @@ export const SbTreeBlockSelect = defineComponent({ ? Tree, - default: ({ close }) =>
      Tree, + default: ({ close }: { close: Function }) =>
        {treeToHtml(blockTree.value, close)}
      , + >{treeToHtml(blockTree.value as TreeNode, close)}
    , }} /> : '' diff --git a/packages/core/lib/id.ts b/packages/core/lib/id.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/core/lib/index.ts b/packages/core/lib/index.ts index e821976..a354c90 100644 --- a/packages/core/lib/index.ts +++ b/packages/core/lib/index.ts @@ -1,5 +1,7 @@ export * from './mode'; -export * from './blocks'; +export * from './types'; + +export * from './block-helpers'; export * from './use-activation'; export * from './use-dynamic-blocks'; diff --git a/packages/core/lib/types.d.ts b/packages/core/lib/types.d.ts new file mode 100644 index 0000000..c1b185c --- /dev/null +++ b/packages/core/lib/types.d.ts @@ -0,0 +1,8 @@ +/* +import {HTMLAttributes} from "vue"; + +interface DialogHTMLAttributes extends HTMLAttributes { + open?: boolean; + onClose?: Function; +} +*/ diff --git a/packages/core/lib/types.ts b/packages/core/lib/types.ts new file mode 100644 index 0000000..293596f --- /dev/null +++ b/packages/core/lib/types.ts @@ -0,0 +1,37 @@ +import { Component } from 'vue'; + +export interface TreeNode { + id: string; + name: string; + icon?: string; + children: TreeNode[]; +} + +export interface BlockData { + id: string; + name: string; + data: T; +} + +export interface BlockProps { + blockId: string; + data?: T, + onUpdate?: (b?: BlockData) => void; + onPrependBlock?: (b?: BlockData) => void; + onAppendBlock?: (b?: BlockData) => void; + onRemoveSelf?: () => void; + onActivateNext?: () => void; + onActivatePrevious?: () => void; +} + +export interface BlockDefinition { + name: string; + icon?: string; + getDefaultData: T; + edit: Component>; + display: Component>; +} + +export interface BlockLibrary { + [name: string]: BlockDefinition; +} diff --git a/packages/core/lib/use-activation.ts b/packages/core/lib/use-activation.ts index 37d1778..616b66d 100644 --- a/packages/core/lib/use-activation.ts +++ b/packages/core/lib/use-activation.ts @@ -5,9 +5,9 @@ import { computed, } from 'vue'; -export const ActiveBlock = Symbol('Schlechtenburg active block'); -export function useActivation(currentBlockId?: string) { - const activeBlockId: Ref = inject(ActiveBlock, ref(null)); +export const SymActiveBlock = Symbol('Schlechtenburg active block'); +export function useActivation(currentBlockId: string|null = null) { + const activeBlockId: Ref = inject(SymActiveBlock, ref(null)); const isActive = computed(() => activeBlockId.value === currentBlockId); const activate = (id?: string|null) => { activeBlockId.value = id !== undefined ? id : currentBlockId; diff --git a/packages/core/lib/use-block-tree.ts b/packages/core/lib/use-block-tree.ts index d9702b2..3d52abe 100644 --- a/packages/core/lib/use-block-tree.ts +++ b/packages/core/lib/use-block-tree.ts @@ -1,4 +1,5 @@ import { + ref, Ref, reactive, inject, @@ -6,19 +7,19 @@ import { onUnmounted, } from 'vue'; import { - BlockTree, - Block, -} from './blocks'; + TreeNode, + BlockData, +} from './types'; -export const BlockTreeSym = Symbol('Schlechtenburg block tree'); -export const BlockTreeRegister = Symbol('Schlechtenburg block tree'); -export const BlockTreeUnregister = Symbol('Schlechtenburg block tree'); +export const SymBlockTree= Symbol('Schlechtenburg block tree'); +export const SymBlockTreeRegister = Symbol('Schlechtenburg block tree register'); +export const SymBlockTreeUnregister = Symbol('Schlechtenburg block tree unregister'); export function useBlockTree() { - const blockTree: Ref = inject(BlockTreeSym, null); - const registerWithParent = inject(BlockTreeRegister, (_: BlockTree) => {}); - const unregisterWithParent = inject(BlockTreeUnregister, (_: BlockTree) => {}); + const blockTree: Ref = inject(SymBlockTree, ref(null)); + const registerWithParent = inject(SymBlockTreeRegister, (_: TreeNode) => {}); + const unregisterWithParent = inject(SymBlockTreeUnregister, (_: TreeNode) => {}); - const self: BlockTree= reactive({ + const self: TreeNode = reactive({ id: '', name: '', icon: '', @@ -26,8 +27,8 @@ export function useBlockTree() { }); // Provide a registration function to child blocks - provide(BlockTreeRegister, (block: BlockTree) => { - if (self.children.find((child: BlockTree) => child.id === block.id)) { + provide(SymBlockTreeRegister, (block: TreeNode) => { + if (self.children.find((child: TreeNode) => child.id === block.id)) { return; } @@ -38,11 +39,11 @@ export function useBlockTree() { }); // Provide an unregistration function to child blocks - provide(BlockTreeUnregister, ({ id }: BlockTree) => { - self.children = self.children.filter((child: BlockTree) => child.id !== id); + provide(SymBlockTreeUnregister, ({ id }: TreeNode) => { + self.children = self.children.filter((child: TreeNode) => child.id !== id); }); - const register = (block: Block) => { + const register = (block: BlockData) => { if (!block.id) { throw new Error(`Cannot register a block without an id: ${JSON.stringify(block)}`); } diff --git a/packages/core/lib/use-dynamic-blocks.ts b/packages/core/lib/use-dynamic-blocks.ts index 8baf84e..e9b64ca 100644 --- a/packages/core/lib/use-dynamic-blocks.ts +++ b/packages/core/lib/use-dynamic-blocks.ts @@ -3,13 +3,13 @@ import { inject, reactive, } from 'vue'; -import { BlockLibraryDefinition } from './blocks'; +import { BlockLibrary } from './types'; import { Mode, SbMode } from './mode'; -export const BlockLibrary = Symbol('Schlechtenburg block library'); +export const SymBlockLibrary = Symbol('Schlechtenburg block library'); export function useDynamicBlocks() { const mode = inject(Mode, ref(SbMode.Edit)); - const customBlocks: BlockLibraryDefinition = inject(BlockLibrary, reactive({})); + const customBlocks: BlockLibrary = inject(SymBlockLibrary, reactive({})); const getBlock = (name: string) => customBlocks[name]; return { diff --git a/packages/core/lib/use-resize-observer.ts b/packages/core/lib/use-resize-observer.ts index 92c5721..b8e8728 100644 --- a/packages/core/lib/use-resize-observer.ts +++ b/packages/core/lib/use-resize-observer.ts @@ -1,3 +1,5 @@ +/// + import { Ref, ref, @@ -13,8 +15,8 @@ interface BlockRect { top: number; } -export const BlockDimensions = Symbol('Schlechtenburg block dimensions'); -export const EditorDimensions = Symbol('Schlechtenburg editor dimensions'); +export const SymBlockDimensions = Symbol('Schlechtenburg block dimensions'); +export const SymEditorDimensions = Symbol('Schlechtenburg editor dimensions'); export function useResizeObserver(el: Ref, symbol: symbol) { const dimensions: Ref = ref(null); provide(symbol, dimensions); @@ -47,8 +49,8 @@ export function useResizeObserver(el: Ref, symbol: symbol) { } export function useBlockSizing() { - const editorDimensions: Ref = inject(EditorDimensions, ref(null)); - const blockDimensions: Ref = inject(BlockDimensions, ref(null)); + const editorDimensions: Ref = inject(SymEditorDimensions, ref(null)); + const blockDimensions: Ref = inject(SymBlockDimensions, ref(null)); return { editorDimensions, blockDimensions }; } diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index badc72a..3dcbac6 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -24,6 +24,33 @@ "to-fast-properties": "^2.0.0" } }, + "@types/lodash": { + "version": "4.14.168", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", + "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "dev": true + }, + "@types/lodash-es": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.4.tgz", + "integrity": "sha512-BBz79DCJbD2CVYZH67MBeHZRX++HF+5p8Mo5MzjZi64Wac39S3diedJYHZtScbRVf4DjZyN6LzA0SB0zy+HSSQ==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, + "@types/resize-observer-browser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@types/resize-observer-browser/-/resize-observer-browser-0.1.5.tgz", + "integrity": "sha512-8k/67Z95Goa6Lznuykxkfhq9YU3l1Qe6LNZmwde1u7802a3x8v44oq0j91DICclxatTr0rNnhXx7+VTIetSrSQ==", + "dev": true + }, + "@types/uuid": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "dev": true + }, "@vue/compiler-core": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.4.tgz", @@ -88,14 +115,14 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash-es": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.20.tgz", - "integrity": "sha512-JD1COMZsq8maT6mnuz1UMV0jvYD0E0aUsSOdrr1/nAG3dhqQXwRRgeW0cSqH1U43INKcqxaiVIQNOUDld7gRDA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, "source-map": { "version": "0.6.1", @@ -107,6 +134,11 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "vue": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.4.tgz", diff --git a/packages/core/package.json b/packages/core/package.json index 5cfa4c5..da8eb9a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,13 @@ "url": "git@git.b12f.io:b12f/schlechtenburg.git" }, "dependencies": { - "vue": "^3.0.4", - "lodash-es": "^4.17.20" + "lodash-es": "^4.17.21", + "uuid": "^8.3.2", + "vue": "^3.0.4" + }, + "devDependencies": { + "@types/lodash-es": "^4.17.4", + "@types/resize-observer-browser": "^0.1.5", + "@types/uuid": "^8.3.0" } } diff --git a/packages/heading/lib/index.ts b/packages/heading/lib/index.ts index 411c700..f27e56c 100644 --- a/packages/heading/lib/index.ts +++ b/packages/heading/lib/index.ts @@ -1,8 +1,11 @@ import { defineAsyncComponent } from 'vue'; import { getDefaultData } from './util'; +export * from './util'; +export const name = 'sb-heading'; + export default { - name: 'sb-heading', + name, getDefaultData, edit: defineAsyncComponent(() => import('./edit')), display: defineAsyncComponent(() => import('./edit')), diff --git a/packages/image/lib/display.tsx b/packages/image/lib/display.tsx index 50269b6..79fadde 100644 --- a/packages/image/lib/display.tsx +++ b/packages/image/lib/display.tsx @@ -1,14 +1,11 @@ import { defineComponent, PropType } from 'vue'; import { model, - blockProps, SbBlock, } from '@schlechtenburg/core'; - import { getDefaultData, ImageData, - ImageProps, } from './util'; import './style.scss'; @@ -19,14 +16,13 @@ export default defineComponent({ model, props: { - ...blockProps, data: { type: (null as unknown) as PropType, default: getDefaultData, }, }, - setup(props: ImageProps) { + setup(props) { return () =>
    {} }, data: { type: (null as unknown) as PropType, @@ -36,7 +34,7 @@ export default defineComponent({ }, }, - setup(props: ImageProps) { + setup(props) { const localData = reactive({ src: props.data.src, alt: props.data.alt, @@ -61,8 +59,13 @@ export default defineComponent({ if (fileInput.value && fileInput.value.files && fileInput.value.files.length) { const reader = new FileReader(); reader.addEventListener('load', () => { + const src = reader?.result?.toString(); + if (!src) { + throw new Error('Couldn\'t load image src'); + } + props.onUpdate({ - src: reader.result, + src, alt: props.data.alt, description: props.data.description, }); @@ -72,7 +75,7 @@ export default defineComponent({ } }; - const onDescriptionUpdate = (description) => { + const onDescriptionUpdate = (description: BlockData) => { props.onUpdate({ ...props.data, description, @@ -83,7 +86,7 @@ export default defineComponent({
    {localData.src - ? Change Image + ? Select Image : null} onDescriptionUpdate(updated)} + onUpdate={(updated: BlockData) => onDescriptionUpdate(updated)} /> - : Select Image} + : Select Image + }
    ); }, diff --git a/packages/image/lib/index.ts b/packages/image/lib/index.ts index 8102655..fab01f8 100644 --- a/packages/image/lib/index.ts +++ b/packages/image/lib/index.ts @@ -1,10 +1,12 @@ import { defineAsyncComponent } from 'vue'; import { getDefaultData } from './util'; +export * from './util'; +export const name = 'sb-image'; + export default { - name: 'sb-image', + name, getDefaultData, edit: defineAsyncComponent(() => import('./edit')), display: defineAsyncComponent(() => import('./display')), - getChildren: (block) => [ block.data.description ], }; diff --git a/packages/image/lib/util.ts b/packages/image/lib/util.ts index c2b5022..8601a6a 100644 --- a/packages/image/lib/util.ts +++ b/packages/image/lib/util.ts @@ -1,22 +1,25 @@ import { + BlockData, + generateBlockId, +} from '@schlechtenburg/core'; +import { + name as paragraphName, ParagraphData, getDefaultData as getDefaultParagraphData } from '@schlechtenburg/paragraph'; -import { BlockData, BlockProps } from '/@/blocks'; export interface ImageData { src: string; alt: string; - description: ParagraphData; -} - -export interface ImageProps extends BlockProps { - data: ImageData; - eventUpdate: (b?: BlockData) => void; + description: BlockData; } export const getDefaultData: () => ImageData = () => ({ src: '', alt: '', - description: getDefaultParagraphData(), + description: { + id: generateBlockId(), + name: paragraphName, + data: getDefaultParagraphData(), + }, }); diff --git a/packages/image/package-lock.json b/packages/image/package-lock.json index 46d141a..ae7fc68 100644 --- a/packages/image/package-lock.json +++ b/packages/image/package-lock.json @@ -102,6 +102,11 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "vue": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.4.tgz", diff --git a/packages/layout/lib/display.tsx b/packages/layout/lib/display.tsx index 73cd1f0..2c41f91 100644 --- a/packages/layout/lib/display.tsx +++ b/packages/layout/lib/display.tsx @@ -5,13 +5,10 @@ import { } from 'vue'; import { model, - blockProps, SbBlock, } from '@schlechtenburg/core'; - import { LayoutData, - LayoutProps, getDefaultData, } from './util'; @@ -23,14 +20,13 @@ export default defineComponent({ model, props: { - ...blockProps, data: { type: (null as unknown) as PropType, default: getDefaultData, }, }, - setup(props: LayoutProps) { + setup(props) { const classes = computed(() => ({ 'sb-layout': true, [`sb-layout_${props.data.orientation}`]: true, diff --git a/packages/layout/lib/edit.tsx b/packages/layout/lib/edit.tsx index 4ae937d..8700665 100644 --- a/packages/layout/lib/edit.tsx +++ b/packages/layout/lib/edit.tsx @@ -7,8 +7,7 @@ import { } from 'vue'; import { model, - Block, - blockProps, + BlockData, useActivation, SbBlock, @@ -20,7 +19,6 @@ import { import { LayoutData, - LayoutProps, getDefaultData, } from './util'; @@ -32,7 +30,6 @@ export default defineComponent({ model, props: { - ...blockProps, onUpdate: { type: Function, default: () => {} }, data: { type: (null as unknown) as PropType, @@ -40,8 +37,8 @@ export default defineComponent({ }, }, - setup(props: LayoutProps) { - const { activate } = useActivation(props.id); + setup(props) { + const { activate } = useActivation(); const localData: LayoutData = reactive({ orientation: props.data.orientation, @@ -59,13 +56,12 @@ export default defineComponent({ })); const toggleOrientation = () => { - console.log('toggle'); props.onUpdate({ orientation: localData.orientation === 'vertical' ? 'horizontal' : 'vertical', }); }; - const onChildUpdate = (child: Block, updated: Block) => { + const onChildUpdate = (child: BlockData, updated: BlockData) => { const index = localData.children.indexOf(child); if (index === -1) { return; @@ -82,7 +78,7 @@ export default defineComponent({ }); }; - const appendBlock = (block: Block) => { + const appendBlock = (block: BlockData) => { localData.children = [ ...localData.children, block, @@ -91,7 +87,7 @@ export default defineComponent({ activate(block.id); }; - const insertBlock = (index: number, block: Block) => { + const insertBlock = (index: number, block: BlockData) => { localData.children = [ ...localData.children.slice(0, index + 1), block, @@ -162,8 +158,10 @@ export default defineComponent({
    {localData.orientation} @@ -172,12 +170,12 @@ export default defineComponent({ {...{ key: child.id }} data-order={index} block={child} - onUpdate={(updated: Block) => onChildUpdate(child, updated)} + onUpdate={(updated: BlockData) => onChildUpdate(child, updated)} onRemoveSelf={() => removeBlock(index)} - onPrependBlock={(block: Block) => insertBlock(index - 1, block)} - onAppendBlock={(block: Block) => insertBlock(index, block)} - onActivatePrevious={(block: Block) => activateBlock(index - 1,)} - onActivateNext={(block: Block) => activateBlock(index + 1,)} + onPrependBlock={(block: BlockData) => insertBlock(index - 1, block)} + onAppendBlock={(block: BlockData) => insertBlock(index, block)} + onActivatePrevious={() => activateBlock(index - 1,)} + onActivateNext={() => activateBlock(index + 1,)} > {{ 'context-toolbar': () => @@ -185,7 +183,7 @@ export default defineComponent({ onMoveBackward={() => moveBackward(index)} onMoveForward={() => moveForward(index)} onRemove={() => removeBlock(index)} - sortable={props.sortable} + orientation={localData.orientation} />, }} diff --git a/packages/layout/lib/index.ts b/packages/layout/lib/index.ts index f8225c8..865de82 100644 --- a/packages/layout/lib/index.ts +++ b/packages/layout/lib/index.ts @@ -1,8 +1,11 @@ import { defineAsyncComponent } from 'vue'; import { getDefaultData } from './util'; +export * from './util'; +export const name = 'sb-layout'; + export default { - name: 'sb-layout', + name, getDefaultData, edit: defineAsyncComponent(() => import('./edit')), display: defineAsyncComponent(() => import('./display')), diff --git a/packages/layout/lib/util.ts b/packages/layout/lib/util.ts index f9b0ea9..d2757f7 100644 --- a/packages/layout/lib/util.ts +++ b/packages/layout/lib/util.ts @@ -1,17 +1,8 @@ -import { - BlockProps, - Block, - BlockData, -} from '/@/blocks'; +import { BlockData } from '@schlechtenburg/core'; export interface LayoutData { orientation: string; - children: Block[]; -} - -export interface LayoutProps extends BlockProps { - data: LayoutData; - eventUpdate: (b?: BlockData) => void; + children: BlockData[]; } export const getDefaultData: () => LayoutData = () => ({ diff --git a/packages/paragraph/lib/display.tsx b/packages/paragraph/lib/display.tsx index c94186f..1e6e3e7 100644 --- a/packages/paragraph/lib/display.tsx +++ b/packages/paragraph/lib/display.tsx @@ -5,10 +5,7 @@ import { } from 'vue'; import { model, - blockProps, - BlockProps, } from '@schlechtenburg/core'; - import { getDefaultData, ParagraphData, @@ -16,24 +13,19 @@ import { import './style.scss'; -interface ParagraphProps extends BlockProps { - data: ParagraphData; -} - export default defineComponent({ name: 'sb-paragraph-display', model, props: { - ...blockProps, data: { type: Object as PropType, default: getDefaultData, }, }, - setup(props: ParagraphProps) { + setup(props) { const classes = computed(() => ({ 'sb-paragraph': true, [`sb-paragraph_align-${props.data.align}`]: true, diff --git a/packages/paragraph/lib/edit.tsx b/packages/paragraph/lib/edit.tsx index 47dc24b..1e139c0 100644 --- a/packages/paragraph/lib/edit.tsx +++ b/packages/paragraph/lib/edit.tsx @@ -10,15 +10,10 @@ import { } from 'vue'; import { model, - blockProps, - BlockProps, - BlockData, useActivation, - SbToolbar, SbSelect, } from '@schlechtenburg/core'; - import { getDefaultData, ParagraphData, @@ -26,22 +21,13 @@ import { import './style.scss'; -interface ParagraphProps extends BlockProps { - data: ParagraphData; - onUpdate: (b?: ParagraphData) => void; - onAppendBlock: (b?: BlockData) => void; - onRemoveSelf: () => void; - onActivateNext: () => void; - onActivatePrevious: () => void; -} - export default defineComponent({ name: 'sb-paragraph-edit', model, props: { - ...blockProps, + blockId: { type: String, required: true }, data: { type: (null as unknown) as PropType, default: getDefaultData, @@ -53,7 +39,7 @@ export default defineComponent({ onActivatePrevious: { type: Function, default: () => {} }, }, - setup(props: ParagraphProps) { + setup(props) { const localData = (reactive({ value: props.data.value, align: props.data.align, @@ -91,7 +77,7 @@ export default defineComponent({ } }); - const onTextUpdate = ($event: InputEvent) => { + const onTextUpdate = ($event: Event) => { localData.value = ($event.target as HTMLElement).innerHTML; }; @@ -142,9 +128,9 @@ export default defineComponent({ } const selection = window.getSelection(); - const node = selection.focusNode; - const childNodes = Array.from(inputEl.value.childNodes); - const index = childNodes.indexOf(node); + const node = selection?.focusNode; + const childNodes = Array.from(inputEl?.value?.childNodes || []); + const index = node ? childNodes.indexOf(node as ChildNode) : -1; if (node === inputEl.value || index === 0 || index === childNodes.length -1) { switch ($event.key) { case 'ArrowDown': @@ -161,8 +147,10 @@ export default defineComponent({
    diff --git a/packages/paragraph/lib/index.ts b/packages/paragraph/lib/index.ts index 6b29c3e..36da411 100644 --- a/packages/paragraph/lib/index.ts +++ b/packages/paragraph/lib/index.ts @@ -2,9 +2,10 @@ import { defineAsyncComponent } from 'vue'; import { getDefaultData } from './util'; export * from './util'; +export const name = 'sb-paragraph'; export default { - name: 'sb-paragraph', + name, getDefaultData, edit: defineAsyncComponent(() => import('./edit')), display: defineAsyncComponent(() => import('./display')), diff --git a/src/App.tsx b/src/App.tsx index 637a103..92ed29c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,7 +6,7 @@ import { ref, } from 'vue'; -import { Schlechtenburg, Block, SbMode } from '../packages/core/lib'; +import { SbMain, BlockData, SbMode } from '../packages/core/lib'; import SbLayout from '../packages/layout/lib'; import SbHeading from '../packages/heading/lib'; @@ -20,7 +20,7 @@ export default defineComponent({ setup() { const activeTab = ref('edit'); - const block: Block = reactive({ + const block: BlockData = reactive({ name: 'none', id: '0', data: null, @@ -34,12 +34,12 @@ export default defineComponent({ block.data = data.data; }); - const Example = computed(() => { + const displayedElement = computed(() => { switch (activeTab.value) { case SbMode.Edit: - return ) => { + onUpdate={(newBlock: BlockData) => { block.data = newBlock.data; }} customBlocks={[ @@ -52,7 +52,7 @@ export default defineComponent({ mode={SbMode.Edit} />; case SbMode.Display: - return display - + {displayedElement.value}
    ; }; }, diff --git a/tsconfig.json b/tsconfig.json index 074bea3..6d3a4da 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,14 @@ // "noErrorTruncation": true, "paths": {} }, - "include": [ "lib/**/*.ts", "lib/**/*.d.ts", "lib/**/*.tsx", "lib/**/*.vue" ] + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue", + "packages/**/lib/**/*.ts", + "packages/**lib/**/*.d.ts", + "packages/**lib/**/*.tsx", + "packages/**lib/**/*.vue" + ] } diff --git a/vite.config.js b/vite.config.js index a5a9c6e..cee531e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'; export default { - base: '/schlechtenburg/', + base: './', plugins: [ vueJsx({}), ],