-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
1 lines (1 loc) · 208 KB
/
app.js
1
!function(){"use strict";function e(e,t){return e===t}function t(){return!0}function n(){return!1}function i(e){return e}function r(e){return e[0]}function o(){}const l={equal:(t,n,i=e)=>t.length==n.length&&t.every(((e,t)=>i(e,n[t]))),distinct:e=>[...new Set(e)],move(e,t,n){let i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i},containCommon:(e,t)=>e.some((e=>t.includes(e))),remove(e,t){let n=e.slice(),i=n.indexOf(t);return i>-1&&n.splice(i,1),n},removeBy(e,t){let n=e.slice(),i=e.findIndex(t);return i>-1&&n.splice(i,1),n},append:(e,t)=>[...e,t],prepend:(e,t)=>[t,...e]};let u=Array.isArray;function s(e,t){return Object.hasOwnProperty.call(e,t)}function a(e){return e===Object(e)&&"Object"==e.constructor.name}function c(e,t){return e===t||(a(e)&&a(t)?d(e,t):!(!u(e)||!u(t))&&l.equal(e,t,c))}function d(e,t){if(e===t)return!0;for(let[n,i]of Object.entries(t)){if(!s(e,n))return!1;if(!c(e[n],i))return!1}return!0}const f={isObj:a,equal:function e(t,n){if(t===n)return!0;if(!a(t)||!a(n))throw new Error("invalid argument");let i=Object.keys(t),r=Object.keys(n);for(let o of l.distinct([...i,...r])){let i=t[o],r=n[o];if(a(i)&&a(r)){if(!e(i,r))return!1}else if(u(i)&&u(r)){if(!l.equal(i,r,e))return!1}else if(i!==r)return!1}return!0},match:d,hasOwn:s},p={nextId:(()=>{let e=0;return()=>{let t=e;return e+=1,t}})()};class h{constructor(e,t,n){this.id=e,this.facet=t,this.value=n}}class g{constructor(e,t){this.id=e,this.combine=t,this.default=this.combine([])}static define(e={}){let t=e.combine??i;return new g(p.nextId(),t)}of(e){return new h(p.nextId(),this,e)}}class m{constructor(e,t,n){this.id=e,this.create=t,this.update=n}static define(e){return new m(p.nextId(),e.create,e.update)}}const $={fallback:0,default:1,extend:2,override:3,lessOrEqual:(e,t)=>$[e]<=$[t]};const x={resolve(e){let t=[],n={},i={};for(let i of function(e){let t={fallback:[],default:[],extend:[],override:[]},n=new Map;return function e(i,r){let o=n.get(i);if(o){if($.lessOrEqual(o,r))return;t[o]=l.remove(t[o],i)}n.set(i,r),Array.isArray(i)?i.forEach((t=>e(t,r))):i.extension?e(i.extension,r):i instanceof class{constructor(e,t){this.x=e,this.level=t}}?e(i.x,i.level):t[r].includes(i)||t[r].push(i)}(e,"default"),t.override.concat(t.extend).concat(t.default).concat(t.fallback)}(e))i instanceof m?t.push(i):i instanceof h&&(null==n[i.facet.id]&&(n[i.facet.id]=[]),n[i.facet.id].push(i));for(let e of Object.values(n)){let t=e[0].facet,n=t.combine(e.map((e=>e.value)));i[t.id]=n}return{source:e,facets:i,fields:t}},facet(e,t){let n=e.facets[t.id];return null!=n?n:t.default}};function v(e,t={}){let n={};for(let t of e)for(let[e,i]of Object.entries(t)){let t=n[e];if(null==t)n[e]=i;else if(t!=i&&null!=i)throw new Error(`Config merge conflict for field ${e}`)}for(let[e,i]of Object.entries(t))null==n[e]&&(n[e]=i);return n}const C={isBuilder:e=>f.isObj(e)&&e.$builder,create(e={}){let n=e.allowChild??t,i=e.children??[],r=e.extensions??[],o=x.resolve(r),l={$builder:!0,configuration:o,fields:{},children:i,selecting:void 0,hovering:void 0,allowChild:n};for(let e of o.fields){let t=e.create(l);l.fields[e.id]=t}return l},apply(e,t){if(e!=t.startBuilder)throw new Error("invalid operation");let n={...e.fields};for(let i of e.configuration.fields){let e=n[i.id],r=i.update(e,t);n[i.id]=r}return{...t.builder,fields:n}},facet:(e,t)=>x.facet(e.configuration,t),field(e,t){if(!f.hasOwn(e.fields,t.id))throw new Error("Field is not present in this editor");return e.fields[t.id]}},B={root:[],isPath:e=>Array.isArray(e)&&e.every((e=>"number"==typeof e)),isRoot:e=>0==e.length,index(e){if(B.isRoot(e))throw new Error("Cannot get index of root path.");return e[e.length-1]},compare(e,t){let n=Math.min(e.length,t.length);for(let i=0;i<n;i+=1){if(e[i]<t[i])return-1;if(e[i]>t[i])return 1}return 0},equal:(e,t)=>0==B.compare(e,t)&&e.length==t.length,isAncestor:(e,t)=>0==B.compare(e,t)&&e.length<t.length,isDescendant:(e,t)=>0==B.compare(e,t)&&e.length>t.length,isSibling(e,t){let n=e.length;return e.length==t.length&&B.equal(e.slice(0,-1),t.slice(0,-1))&&e[n-1]!=t[n-1]},endBefore(e,t){let n=e.length-1;return B.equal(e.slice(0,n),t.slice(0,n))&&e[n]<t[n]},endAt(e,t){let n=e.length;return B.equal(e.slice(0,n),t.slice(0,n))},endAfter(e,t){let n=e.length-1;return B.equal(e.slice(0,n),t.slice(0,n))&&e[n]>t[n]},isBefore:(e,t)=>-1==B.compare(e,t),isAfter:(e,t)=>1==B.compare(e,t),parent(e){if(B.isRoot(e))throw new Error("Cannot get parent of root path");return e.slice(0,-1)},previousSibling(e){if(B.isRoot(e))throw new Error("Cannot get previous sibling of root path");let t=e[e.length-1];if(t<=0)throw new Error(`Cannot get previous sibling of the first child [${e}]`);return e.slice(0,-1).concat(t-1)},nextSibling(e){if(B.isRoot(e))throw new Error("Cannot get next slibing of root path");let t=e[e.length-1];return e.slice(0,-1).concat(t+1)},hasPreviousSibling:e=>e[e.length-1]>0,isFirstChild:e=>0==e[e.length-1],transform(e,t){switch(t.type){case"insert_node":if(B.equal(t.path,e)||B.isAncestor(t.path,e)||B.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]+1,n}return e;case"move_node":if(B.equal(t.path,t.newPath))return e;if(B.equal(t.path,e)||B.isAncestor(t.path,e)){let n=t.newPath.slice();return B.endBefore(t.path,t.newPath)&&(n[t.path.length-1]=n[t.path.length-1]-1),n.concat(e.slice(t.path.length))}if((B.equal(t.newPath,e)||B.isAncestor(t.newPath,e))&&B.isSibling(t.newPath,t.path)){let n=e.slice();return B.endBefore(t.path,e)?n[t.path.length-1]=n[t.path.length-1]-1:n[t.path.length-1]=n[t.path.length-1]+1,n}if(B.equal(t.newPath,e)||B.isAncestor(t.newPath,e)||B.endBefore(t.newPath,e)){let n=e.slice();return B.endBefore(t.path,e)&&(n[t.path.length-1]=n[t.path.length-1]-1),n[t.newPath.length-1]=n[t.newPath.length-1]+1,n}if(B.endBefore(t.path,e)){let n=e.slice();return B.equal(e,t.newPath)&&(n[t.newPath.length-1]=n[t.newPath.length-1]+1),n[t.path.length-1]=n[t.path.length-1]-1,n}return e;case"remove_node":if(B.equal(t.path,e)||B.isAncestor(t.path,e))return;if(B.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]-1,n}return e;default:return e}},transformExn(e,t){let n=B.transform(e,t);if(null==n)throw new Error("expect a transformed path");return n}};let w=(()=>{let e=new WeakMap;return t=>{if(!Array.isArray(t))return!1;let n=e.get(t);if(null!=n)return n;let i=t.every(y);return e.set(t,i),i}})();function y(e){return f.isObj(e)&&(null==e.children||w(e.children))}const b={isNode:y,isNodeList:w,equal:function e(t,n){if(t==n)return!0;let i=b.props(t),r=b.props(n);return f.equal(i,r)&&(null==t.children&&null==n.children||null!=t.children&&null!=n.children&&l.equal(t.children,n.children,e))},props(e){let{children:t,...n}=e;return n},get(e,t){let n=e;for(let i=0;i<t.length;i+=1){let r=t[i];if(null==n.children||null==n.children[r])throw new Error(`Cannot find a descendant at path [${t}] in node: ${JSON.stringify(e)}`);n=n.children[r]}return n},hasPath(e,t){let n=e;for(let e of t){if(null==n.children||null==n.children[e])return!1;n=n.children[e]}return!0},transform(e,t){function n(e,t,n){if(null==e.children)throw new Error("invalid operation");if(t<0||t>e.children.length-1)throw new Error(`index ${t} out of range`);if(e.children[t]==n)return e;let i=e.children.slice();return i[t]=n,{...e,children:i}}function i(e,t,n){if(null==e.children)throw new Error("invalid operation");if(t<0||t>e.children.length)throw new Error(`index ${t} out of range`);let i=e.children.slice();return i.splice(t,0,n),{...e,children:i}}function r(e,t){if(null==e.children)throw new Error("invalid operation");if(t<0||t>e.children.length-1)throw new Error(`index ${t} out of range`);let n=e.children.slice();return n.splice(t,1),{...e,children:n}}function o(e,t,i){let r=i,o=t;for(;r.length>0;){o=n(b.get(e,B.parent(r)),B.index(r),o),r=B.parent(r)}return o}switch(t.type){case"insert_node":{let{path:n,node:r}=t,l=b.get(e,B.parent(n));return l=i(l,B.index(n),r),o(e,l,B.parent(n))}case"move_node":{let{path:n,newPath:l}=t;if(B.isAncestor(n,l))throw new Error(`Cannot move a path [${n}] to new path [${l}] because the destination is inside itself.`);let u=b.get(e,n),s=b.get(e,B.parent(n));s=r(s,B.index(n));let a=o(e,s,B.parent(n)),c=B.transformExn(n,t);return s=b.get(a,B.parent(c)),s=i(s,B.index(c),u),a=o(a,s,B.parent(c)),a}case"remove_node":{let{path:n}=t,i=b.get(e,B.parent(n));return i=r(i,B.index(n)),o(e,i,B.parent(n))}case"set_node":{let{path:n,properties:i,newProperties:r}=t;if(B.isRoot(n))throw new Error("Cannot set properties on the root node");if(Object.keys(r).some((e=>"children"==e)))throw new Error("Cannot set the children to node");let l=b.get(e,n);return l=function(e,t){let n={...e};for(let[e,i]of Object.entries(t))null==i?delete n[e]:n[e]=i;return n}(l,r),l=function(e,t,n){let i={...e};for(let e of Object.keys(t))f.hasOwn(n,e)||delete i[e];return i}(l,i,r),o(e,l,n)}default:return e}}},D={isOperation(e){if(!f.isObj(e))return!1;switch(e.type){case"insert_node":case"remove_node":return B.isPath(e.path)&&b.isNode(e.node);case"move_node":return B.isPath(e.path)&&B.isPath(e.newPath);case"set_node":return B.isPath(e.path)&&f.isObj(e.properties)&&f.isObj(e.newProperties);case"set_selecting":case"set_hovering":return null==e.path&&B.isPath(e.newPath)||null==e.newPath&&B.isPath(e.path)||B.isPath(e.path)&&B.isPath(e.newPath);default:return!1}},isNodeOperation:e=>D.isOperation(e)&&["insert_node","move_node","remove_node","set_node"].includes(e.type),inverse(e){switch(e.type){case"insert_node":return{...e,type:"remove_node"};case"move_node":{let{path:t,newPath:n}=e;if(B.equal(t,n))return e;if(B.isSibling(t,n))return{...e,path:n,newPath:t};let i=B.transformExn(t,e),r=B.transformExn(B.nextSibling(t),e);return{...e,path:i,newPath:r}}case"remove_node":return{...e,type:"insert_node"};case"set_node":{let{properties:t,newProperties:n}=e;return{...e,properties:n,newProperties:t}}case"set_selecting":{let{path:t,newPath:n}=e;return{...e,path:n,newPath:t}}case"set_hovering":{let{path:t,newPath:n}=e;return{...e,path:n,newPath:t}}}}};function E(e,t){return(null!=e||null!=t)&&(null==e||null==t||!B.equal(e,t))}class A{constructor(e){this.builders=[e],this.operations=[]}get startBuilder(){return this.builders[0]}get builder(){return this.builders[this.builders.length-1]}get nodeChanged(){return this.operations.some(D.isNodeOperation)}get selectingChanged(){return E(this.startBuilder.selecting,this.builder.selecting)}get hoveringChanged(){return E(this.startBuilder.hovering,this.builder.hovering)}apply(e){let t=function(e,t){return"set_hovering"==t.type?{...e,hovering:t.newPath}:"set_selecting"==t.type?{...e,selecting:t.newPath}:{...b.transform(e,t),selecting:e.selecting&&B.transform(e.selecting,t),hovering:e.hovering&&B.transform(e.hovering,t)}}(this.builder,e);this.builders.push(t),this.operations.push(e)}select(e){let t={type:"set_selecting",path:this.builder.selecting,newPath:e};return this.apply(t),this}hover(e){let t={type:"set_hovering",path:this.builder.hovering,newPath:e};return this.apply(t),this}deselect(){if(null!=this.builder.selecting){let e={type:"set_selecting",path:this.builder.selecting,newPath:void 0};this.apply(e)}return this}dehover(){if(null!=this.builder.hovering){let e={type:"set_hovering",path:this.builder.hovering,newPath:void 0};this.apply(e)}return this}insertNode(e,t){let n=b.get(this.builder,B.parent(t.at));if(!C.isBuilder(n)&&!this.builder.allowChild(n,e))throw new Error("invalid operation");let i={type:"insert_node",path:t.at,node:e};return this.apply(i),this}removeNode(e){let t={type:"remove_node",node:b.get(this.builder,e.at),path:e.at};return this.apply(t),this}moveNode(e){if(!b.hasPath(this.builder,e.at))throw new Error("invalid operation");if(B.isAncestor(e.at,e.to))throw new Error(`Cannot move a path [${e.at}] to new path [${e.to}] because the destination is inside itself.`);if(B.equal(e.at,e.to))return this;let t=b.get(this.builder,e.at),n=b.get(this.builder,B.parent(e.to));if(!C.isBuilder(n)&&!this.builder.allowChild(n,t))throw new Error("invalid operation");let i={type:"move_node",path:e.at,newPath:e.to};return this.apply(i),this}setNode(e,t){let n=b.get(this.builder,t.at),i={},r={};for(let[t,o]of Object.entries(e))"children"!=t&&o!=n[t]&&(f.hasOwn(n,t)&&(i[t]=n[t]),null!=o&&(r[t]=o));let o={type:"set_node",path:t.at,properties:i,newProperties:r};return this.apply(o),this}effect(e,t){return null==this.effects&&(this.effects=new Map),this.effects.set(e,t),this}hasEffect(e){return null!=this.effects&&this.effects.has(e)}getEffect(e){if(null==this.effects)throw new Error("invalid operation");let t=this.effects.get(e);if(null==t)throw new Error("invalid operation");return t}}function F(e=""){let t=46656*Math.random()|0,n=46656*Math.random()|0;return t=`000${t.toString(36)}`.slice(-3),n=`000${n.toString(36)}`.slice(-3),`${e}${t}${n}`}function _(e,t){return new e({target:document.createDocumentFragment(),props:t})}let k={},T={},N={},V={},P=m.define({create:e=>({structureOpen:!0,nodeMenuOpen:0==e.children.length}),update:(e,t)=>t.hasEffect(k)?{...e,structureOpen:!0}:t.hasEffect(T)?{...e,structureOpen:!1}:t.hasEffect(N)?{...e,nodeMenuOpen:!0}:t.hasEffect(V)?{...e,nodeMenuOpen:!1}:e});function U(e,t){for(let[n,i]of Object.entries(t))e.classList.toggle(n,Boolean(i))}function L(e){return`${e}px`}function R(e,t,n){let i=document.createElement(e);if(t&&(i.className=t),"string"==typeof n)i.append(n);else if("number"==typeof n)i.append(n.toString());else if(n)for(let e of n)null!=e&&i.append(e);return i}function O(e){e.preventDefault()}function S(e){e.stopPropagation()}function q(e,t){return e.querySelector(t)}function M(e,t){return Array.from(e.querySelectorAll(t))}function I(e){return"[object Window]"==Object.prototype.toString.call(e)}function z(e){return e instanceof Element}function j(e){return e instanceof HTMLElement}function X(e){return e instanceof Text}function Y(e){return"HTML"==e.nodeName}function H(e){return"BODY"==e.nodeName}function G(e){let t=e.ownerDocument?.defaultView;if(null==t)throw new Error("cannot find window");return t}function W(e){let t=e.ownerDocument;if(null==t)throw new Error("cannot find document");return t}function J(e){return W(e).body}function Z(e){return W(e).documentElement}function K(e){return G(e).getComputedStyle(e)}const Q={"align-center":'<line x1="21" y1="6" x2="3" y2="6"></line><line x1="17" y1="12" x2="7" y2="12"></line><line x1="19" y1="18" x2="5" y2="18"></line>',"align-left":'<line x1="21" y1="6" x2="3" y2="6"></line><line x1="15" y1="12" x2="3" y2="12"></line><line x1="17" y1="18" x2="3" y2="18"></line>',"align-right":'<line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="12" x2="9" y2="12"></line><line x1="21" y1="18" x2="7" y2="18"></line>',bold:'<path d="M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z"></path><path d="M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z"></path>',brush:'<path d="M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08"></path><path d="M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z"></path>',"chevron-down":'<polyline points="6 9 12 15 18 9"></polyline>',"chevron-left":'<polyline points="15 18 9 12 15 6"></polyline>',"chevron-right":'<polyline points="9 18 15 12 9 6"></polyline>',"chevron-up":'<polyline points="18 15 12 9 6 15"></polyline>',"chevrons-down-up":'<path d="M7 20l5-5 5 5"></path><path d="M7 4l5 5 5-5"></path>',"chevrons-left":'<polyline points="11 17 6 12 11 7"></polyline><polyline points="18 17 13 12 18 7"></polyline>',"chevrons-right":'<polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline>',"chevrons-up-down":'<path d="M7 15l5 5 5-5"></path><path d="M7 9l5-5 5 5"></path>',circle:'<circle cx="12" cy="12" r="10"></circle>',column:'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="3" x2="12" y2="21"></line>',droplets:'<path d="M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z"></path><path d="M12.56 6.6A10.97 10.97 0 0014 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 01-11.91 4.97"></path>',"edit-3":'<path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"></path>',equal:'<line x1="5" y1="9" x2="19" y2="9"></line><line x1="5" y1="15" x2="19" y2="15"></line>',function:'<path d="M9 17c1.93 0 2.85-1 2.85-2.8V9.99c0-1.93 1.03-3.26 3.15-2.93M9 11.24h5.66"></path>',gamepad:'<line x1="6" y1="12" x2="10" y2="12"></line><line x1="8" y1="10" x2="8" y2="14"></line><line x1="15" y1="13" x2="15.01" y2="13"></line><line x1="18" y1="11" x2="18.01" y2="11"></line><rect x="2" y="6" width="20" height="12" rx="2"></rect>',"grip-horizontal":'<circle cx="12" cy="9" r="1"></circle><circle cx="19" cy="9" r="1"></circle><circle cx="5" cy="9" r="1"></circle><circle cx="12" cy="15" r="1"></circle><circle cx="19" cy="15" r="1"></circle><circle cx="5" cy="15" r="1"></circle>',"grip-vertical":'<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',image:'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline>',italic:'<line x1="19" y1="4" x2="10" y2="4"></line><line x1="14" y1="20" x2="5" y2="20"></line><line x1="15" y1="4" x2="9" y2="20"></line>',"maximize-2":'<polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line>',"minimize-2":'<polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line>',"more-horizontal":'<circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle>',move:'<polyline points="5 9 2 12 5 15"></polyline><polyline points="9 5 12 2 15 5"></polyline><polyline points="15 19 12 22 9 19"></polyline><polyline points="19 9 22 12 19 15"></polyline><line x1="2" y1="12" x2="22" y2="12"></line><line x1="12" y1="2" x2="12" y2="22"></line>',plus:'<line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line>',search:'<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>',settings:'<path d="M12.22 2h-.44a2 2 0 00-2 2v.18a2 2 0 01-1 1.73l-.43.25a2 2 0 01-2 0l-.15-.08a2 2 0 00-2.73.73l-.22.38a2 2 0 00.73 2.73l.15.1a2 2 0 011 1.72v.51a2 2 0 01-1 1.74l-.15.09a2 2 0 00-.73 2.73l.22.38a2 2 0 002.73.73l.15-.08a2 2 0 012 0l.43.25a2 2 0 011 1.73V20a2 2 0 002 2h.44a2 2 0 002-2v-.18a2 2 0 011-1.73l.43-.25a2 2 0 012 0l.15.08a2 2 0 002.73-.73l.22-.39a2 2 0 00-.73-2.73l-.15-.08a2 2 0 01-1-1.74v-.5a2 2 0 011-1.74l.15-.09a2 2 0 00.73-2.73l-.22-.38a2 2 0 00-2.73-.73l-.15.08a2 2 0 01-2 0l-.43-.25a2 2 0 01-1-1.73V4a2 2 0 00-2-2z"></path><circle cx="12" cy="12" r="3"></circle>',square:'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>',type:'<polyline points="4 7 4 4 20 4 20 7"></polyline><line x1="9" y1="20" x2="15" y2="20"></line><line x1="12" y1="4" x2="12" y2="20"></line>',x:'<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>'};function ee(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("aria-hidden","true"),n.setAttribute("width","24"),n.setAttribute("height","24"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.innerHTML=Q[e],t&&n.classList.add(t),n}function te(){}function ne(e,t){for(const n in t)e[n]=t[n];return e}function ie(e){return e()}function re(){return Object.create(null)}function oe(e){e.forEach(ie)}function le(e){return"function"==typeof e}function ue(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let se,ae;function ce(e,t){return se||(se=document.createElement("a")),se.href=t,e===se.href}function de(e,...t){if(null==e)return te;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function fe(e,t,n){e.$$.on_destroy.push(de(t,n))}function pe(e,t,n,i){if(e){const r=he(e,t,n,i);return e[0](r)}}function he(e,t,n,i){return e[1]&&i?ne(n.ctx.slice(),e[1](i(t))):n.ctx}function ge(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(void 0===t.dirty)return r;if("object"==typeof r){const e=[],n=Math.max(t.dirty.length,r.length);for(let i=0;i<n;i+=1)e[i]=t.dirty[i]|r[i];return e}return t.dirty|r}return t.dirty}function me(e,t,n,i,r,o){if(r){const l=he(t,n,i,o);e.p(l,r)}}function $e(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let e=0;e<n;e++)t[e]=-1;return t}return-1}function xe(e,t,n){return e.set(n),t}function ve(e){return e&&le(e.destroy)?e.destroy:te}function Ce(e,t){e.appendChild(t)}function Be(e,t,n){e.insertBefore(t,n||null)}function we(e){e.parentNode.removeChild(e)}function ye(e){return document.createElement(e)}function be(e){return document.createTextNode(e)}function De(){return be(" ")}function Ee(){return be("")}function Ae(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function Fe(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function _e(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function ke(e,t){e.value=null==t?"":t}function Te(e,t,n,i){null===n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function Ne(e,t){for(let n=0;n<e.options.length;n+=1){const i=e.options[n];if(i.__value===t)return void(i.selected=!0)}e.selectedIndex=-1}function Ve(e){ae=e}function Pe(){if(!ae)throw new Error("Function called outside component initialization");return ae}function Ue(e){Pe().$$.on_mount.push(e)}function Le(){const e=Pe();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const r=function(e,t,n=!1){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,!1,t),i}(t,n);i.slice().forEach((t=>{t.call(e,r)}))}}}function Re(e,t){Pe().$$.context.set(e,t)}function Oe(e){return Pe().$$.context.get(e)}function Se(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const qe=[],Me=[],Ie=[],ze=[],je=Promise.resolve();let Xe=!1;function Ye(){Xe||(Xe=!0,je.then(Ze))}function He(){return Ye(),je}function Ge(e){Ie.push(e)}const We=new Set;let Je=0;function Ze(){const e=ae;do{for(;Je<qe.length;){const e=qe[Je];Je++,Ve(e),Ke(e.$$)}for(Ve(null),qe.length=0,Je=0;Me.length;)Me.pop()();for(let e=0;e<Ie.length;e+=1){const t=Ie[e];We.has(t)||(We.add(t),t())}Ie.length=0}while(qe.length);for(;ze.length;)ze.pop()();Xe=!1,We.clear(),Ve(e)}function Ke(e){if(null!==e.fragment){e.update(),oe(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Ge)}}const Qe=new Set;let et;function tt(){et={r:0,c:[],p:et}}function nt(){et.r||oe(et.c),et=et.p}function it(e,t){e&&e.i&&(Qe.delete(e),e.i(t))}function rt(e,t,n,i){if(e&&e.o){if(Qe.has(e))return;Qe.add(e),et.c.push((()=>{Qe.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function ot(e,t){e.d(1),t.delete(e.key)}function lt(e,t){rt(e,1,1,(()=>{t.delete(e.key)}))}function ut(e,t,n,i,r,o,l,u,s,a,c,d){let f=e.length,p=o.length,h=f;const g={};for(;h--;)g[e[h].key]=h;const m=[],$=new Map,x=new Map;for(h=p;h--;){const e=d(r,o,h),u=n(e);let s=l.get(u);s?i&&s.p(e,t):(s=a(u,e),s.c()),$.set(u,m[h]=s),u in g&&x.set(u,Math.abs(h-g[u]))}const v=new Set,C=new Set;function B(e){it(e,1),e.m(u,c),l.set(e.key,e),c=e.first,p--}for(;f&&p;){const t=m[p-1],n=e[f-1],i=t.key,r=n.key;t===n?(c=t.first,f--,p--):$.has(r)?!l.has(i)||v.has(i)?B(t):C.has(r)?f--:x.get(i)>x.get(r)?(C.add(i),B(t)):(v.add(r),f--):(s(n,l),f--)}for(;f--;){const t=e[f];$.has(t.key)||s(t,l)}for(;p;)B(m[p-1]);return m}function st(e){e&&e.c()}function at(e,t,n,i){const{fragment:r,on_mount:o,on_destroy:l,after_update:u}=e.$$;r&&r.m(t,n),i||Ge((()=>{const t=o.map(ie).filter(le);l?l.push(...t):oe(t),e.$$.on_mount=[]})),u.forEach(Ge)}function ct(e,t){const n=e.$$;null!==n.fragment&&(oe(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function dt(e,t,n,i,r,o,l,u=[-1]){const s=ae;Ve(e);const a=e.$$={fragment:null,ctx:null,props:o,update:te,not_equal:r,bound:re(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(s?s.$$.context:[])),callbacks:re(),dirty:u,skip_bound:!1,root:t.target||s.$$.root};l&&l(a.root);let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const o=i.length?i[0]:n;return a.ctx&&r(a.ctx[t],a.ctx[t]=o)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](o),c&&function(e,t){-1===e.$$.dirty[0]&&(qe.push(e),Ye(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,oe(a.before_update),a.fragment=!!i&&i(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(we)}else a.fragment&&a.fragment.c();t.intro&&it(e.$$.fragment),at(e,t.target,t.anchor,t.customElement),Ze()}Ve(s)}class ft{$destroy(){ct(this,1),this.$destroy=te}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!function(e){return 0===Object.keys(e).length}(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function pt(e){let t;return{c(){var n;n="svg",t=document.createElementNS("http://www.w3.org/2000/svg",n),Fe(t,"aria-hidden","true"),Fe(t,"xmlns","http://www.w3.org/2000/svg"),Fe(t,"width","24"),Fe(t,"height","24"),Fe(t,"viewBox","0 0 24 24"),Fe(t,"fill","none"),Fe(t,"stroke","currentColor"),Fe(t,"stroke-width","2"),Fe(t,"stroke-linecap","round"),Fe(t,"stroke-linejoin","round"),Fe(t,"class",e[0])},m(n,i){Be(n,t,i),t.innerHTML=e[1]},p(e,[n]){2&n&&(t.innerHTML=e[1]),1&n&&Fe(t,"class",e[0])},i:te,o:te,d(e){e&&we(t)}}}function ht(e,t,n){let i,{name:r}=t,{class:o}=t;return e.$$set=e=>{"name"in e&&n(2,r=e.name),"class"in e&&n(0,o=e.class)},e.$$.update=()=>{4&e.$$.dirty&&n(1,i=Q[r])},[o,i,r]}class gt extends ft{constructor(e){super(),dt(this,e,ht,pt,ue,{name:2,class:0})}}const mt={nextId:(()=>{let e=0;return()=>{let t=e;return e+=1,t}})()};class $t{constructor(e,t,n){this.id=e,this.facet=t,this.value=n}}class xt{constructor(e,t){this.id=e,this.combine=t,this.default=this.combine([])}static define(e={}){let t=e.combine??i;return new xt(mt.nextId(),t)}of(e){return new $t(mt.nextId(),this,e)}}class vt{static define(){return new vt}}class Ct{constructor(e,t){this.event=e,this.handler=t}}const Bt={resolve(e){let t=new Map,n={},i={};for(let i of function(e){let t=[];return function e(t,n){Array.isArray(n)?n.forEach((n=>e(t,n))):n.extension?e(t,n.extension):t.includes(n)||t.push(n)}(t,e),t}(e))i instanceof Ct?(t.has(i.event)||t.set(i.event,[]),t.get(i.event)?.push(i)):i instanceof $t&&(null==n[i.facet.id]&&(n[i.facet.id]=[]),n[i.facet.id].push(i));for(let e of Object.values(n)){let t=e[0].facet,n=t.combine(e.map((e=>e.value)));i[t.id]=n}return{source:e,facets:i,handlers:t}},facet(e,t){let n=e.facets[t.id];return null!=n?n:t.default}};function wt(e,t={}){let n={};for(let t of e)for(let[e,i]of Object.entries(t)){let t=n[e];if(null==t)n[e]=i;else if(t!=i&&null!=i)throw new Error(`Config merge conflict for field ${e}`)}for(let[e,i]of Object.entries(t))null==n[e]&&(n[e]=i);return n}let yt=xt.define();class bt{constructor(e,t){this.extension=yt.of(this),this.id=e,this.create=t}static define(e){return new bt(mt.nextId(),e)}}class Dt{constructor(e,t){this.spec=e,this.extension=t}static create(e,t){let n=e.create(t);return new Dt(e,n)}}let Et=xt.define({combine:e=>e.flat()}),At=xt.define({combine:e=>wt(e,{hosts:[document]})}),Ft=vt.define();let _t=vt.define();function kt(e){return new Ct(_t,e)}class Tt{constructor(e){let{extensions:t=[],modifiers:n=[],...i}=e;this.configuration=Bt.resolve([At.of(i),Et.of(n),t]);let r=[];for(let e of this.facet(yt)){let t=Dt.create(e,this);r.push(t.extension)}this.configuration=Bt.resolve([this.configuration.source,r]),this.dispatch(Ft,{type:"draggable:init"})}destroy(){this.dispatch(_t,{type:"draggable:destroy"})}dispatch(e,t){let n=this.configuration.handlers.get(e);if(null!=n)for(let e of n)e.handler(t)}facet(e){return Bt.facet(this.configuration,e)}}let Nt=({transform:e,source:t,windowRect:n})=>function(e,t,n){let i={...e};return t.clientY+e.y<=n.clientY?i.y=n.clientY-t.clientY:t.clientY+t.height+e.y>=n.clientY+n.height&&(i.y=n.clientY+n.height-(t.clientY+t.height)),t.clientX+e.x<=n.clientX?i.x=n.clientX-t.clientX:t.clientX+t.width+e.x>=n.clientX+n.width&&(i.x=n.clientX+n.width-(t.clientX+t.width)),i}(e,t.viewRect,n);function Vt(e){let{overflow:t,overflowX:n,overflowY:i}=K(e);return/auto|scroll|overlay|hidden/.test(t+i+n)}function Pt(e){let t=function(e){return Y(e)?e:e.parentNode??Z(e)}(e);if(H(t)||Y(t)){let n=J(t);return n&&Vt(n)?n:G(e)}return j(t)&&Vt(t)?t:Pt(t)}function Ut(e){return e.reduce(((e,t)=>{let n=function(e){return I(e)?{scrollLeft:(n=e).scrollX,scrollTop:n.scrollY}:{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop};var t,n}(t);return{scrollLeft:e.scrollLeft+n.scrollLeft,scrollTop:e.scrollTop+n.scrollTop}}),{scrollLeft:0,scrollTop:0})}function Lt(e){let t=0,n=0,i=e;for(;null!=i&&j(i);)t+=i.offsetLeft,n+=i.offsetTop,i=i.offsetParent;return{pageX:t,pageY:n}}function Rt(e){let{offsetWidth:t,offsetHeight:n}=e,{pageY:i,pageX:r}=Lt(e);return{width:t,height:n,pageY:i,pageX:r}}function Ot(e){let t=e.getBoundingClientRect(),{pageX:n,pageY:i}=Lt(e);return{width:e.offsetWidth,height:e.offsetHeight,clientX:t.left,clientY:t.top,pageX:n,pageY:i}}function St(e){let t=e.frameElement,n=(t&&t.getBoundingClientRect())??{top:0,left:0},i=(t&&Lt(t))??{pageX:0,pageY:0},r=e.document.documentElement;return{width:r.clientWidth,height:r.clientHeight,clientX:n.left,clientY:n.top,pageX:i.pageX,pageY:i.pageY}}function qt(e){let t=e.defaultView;if(null==t)throw new Error("cannot find window");let n=t.frameElement??void 0;return{document:e,frameElement:n,viewRect:n?Ot(n):St(t)}}function Mt(e,t){let n=t.view?.document;if(null==n)throw new Error("cannot find document for event");return e.find((e=>e.document==n))}let It=({transform:e,hosts:t,startEvent:n,moveEvent:i})=>{let r=Mt(t,n),o=Mt(t,i);if(r==o)return e;let l=o.viewRect.clientX-r.viewRect.clientX,u=o.viewRect.clientY-r.viewRect.clientY;return{...e,x:e.x+l,y:e.y+u}};function zt(e){return`${e}px`}const jt={transform:e=>`scaleX(${e.scaleX}) scaleY(${e.scaleY}) translate3d(${e.x}px, ${e.y}px, 0)`,translate:e=>`translate3d(${e.x}px, ${e.y}px, 0)`,transition:({property:e,easing:t,duration:n})=>`${e} ${n}ms ${t}`},Xt=0,Yt={Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Escape:"Escape",Space:" ",Delete:"Delete",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",isLetter:e=>e>="a"&&e<="z",isDigit:e=>e>="0"&&e<="9"};function Ht(e,t){let n=e.find((e=>e.node==t));if(!n)throw new Error("invalid operation");return n}function Gt(e,t){let n=t.map((e=>e.node)),i=Z(e),r=e;for(;null!=r&&r!=i;){if(n.includes(r))return Ht(t,r);r=r.parentElement}}function Wt(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Jt(e,t,n,i){Array.isArray(e)?e.forEach((e=>{e.addEventListener(t,n,i)})):e.addEventListener(t,n,i)}function Zt(e,t,n,i){Array.isArray(e)?e.forEach((e=>{e.removeEventListener(t,n,i)})):e.removeEventListener(t,n,i)}let Kt=vt.define();let Qt=vt.define();function en(e){return new Ct(Qt,e)}let tn=vt.define();function nn(e){return new Ct(tn,e)}let rn=vt.define();function on(e){return new Ct(rn,e)}let ln=xt.define({combine:wt}),un=bt.define((e=>{let t,n,{hosts:i,draggable:r,handle:o}=e.facet(At),l=e.facet(ln),u=i.map((e=>e.defaultView)).filter(Boolean),s={x:0,y:0},a=!1;function c(e){if(!e.target||!e.isPrimary||e.button!=Xt)return;let a=e.target;if(o){if(!a.closest(o))return}let c=Gt(a,r());c&&(n=c,t=e,s={x:e.clientX,y:e.clientY},Jt(i,"pointermove",p),Jt(i,"pointerup",g),Jt(i,"keydown",$),Jt(u,"resize",m),Jt(u,"visibilitychange",m),Jt(u,"contextmenu",O),l.constraint||f())}function d(){Zt(i,"pointermove",p),Zt(i,"pointerup",g),Zt(i,"keydown",$),setTimeout((()=>Zt(i,"click",S,{capture:!0}))),Zt(u,"resize",m),Zt(u,"visibilitychange",m),Zt(u,"contextmenu",O)}function f(){a=!0,Jt(i,"click",S,{capture:!0}),e.dispatch(Kt,{type:"sensor-drag:start",coords:s,source:n,nativeEvent:t}),p(t)}function p(t){let i={x:t.clientX,y:t.clientY};a?(t.preventDefault(),e.dispatch(Qt,{type:"sensor-drag:move",coords:i,nativeEvent:t,source:n})):l.constraint&&Wt(s,i)>l.constraint.distance&&f()}function h(){a=!1,s={x:0,y:0},n=void 0,t=void 0}function g(t){d(),e.dispatch(tn,{type:"sensor-drag:end",nativeEvent:t,source:n}),h()}function m(t){d(),e.dispatch(rn,{type:"sensor-drag:cancel",nativeEvent:t,source:n}),h()}function $(e){e.key==Yt.Escape&&m(e)}return[(x=()=>{Jt(i,"pointerdown",c,{capture:!0})},new Ct(Ft,x)),kt((()=>{Zt(i,"pointerdown",c,{capture:!0})}))];var x}));function sn(e={}){return[ln.of(e),un]}let an=vt.define();function cn(e){return new Ct(an,e)}let dn=vt.define();function fn(e){return new Ct(dn,e)}let pn=vt.define();function hn(e){return new Ct(pn,e)}let gn=vt.define();function mn(e){return new Ct(gn,e)}let $n=bt.define((e=>{let t,n,i,r,o=e.facet(Et),{hosts:l}=e.facet(At),u={x:0,y:0},s={x:0,y:0,scaleX:1,scaleY:1};function a(){n=void 0,i=void 0,r=void 0}return[(c=o=>{i=o.nativeEvent,u=o.coords,t=St(G(o.source.node)),n={...o.source,viewRect:Ot(o.source.node),pageRect:Rt(o.source.node)},r=l.map(qt),e.dispatch(an,{type:"drag:start",source:n,nativeEvent:o.nativeEvent})},new Ct(Kt,c)),en((l=>{s.x=l.coords.x-u.x,s.y=l.coords.y-u.y,s=function(e,{transform:t,...n}){return e.length>0?e.reduce(((e,t)=>t({transform:e,...n})),t):t}(o,{transform:s,source:n,windowRect:t,startEvent:i,moveEvent:l.nativeEvent,hosts:r}),e.dispatch(dn,{type:"drag:move",nativeEvent:l.nativeEvent,transform:s,source:n})})),nn((t=>{e.dispatch(pn,{type:"drag:end",nativeEvent:t.nativeEvent,source:n}),a()})),on((t=>{e.dispatch(gn,{type:"drag:cancel",nativeEvent:t.nativeEvent,source:n}),a()}))];var c}));function xn(){return[$n]}let vn=xt.define({combine:e=>wt(e,{zIndex:999,dropAnimation:{duration:250,easing:"ease",dragSourceOpacity:0},tag:"div",mount:document.body})}),Cn=vt.define();let Bn=vt.define();let wn=bt.define((e=>{let t,n=e.facet(vn),i={x:0,y:0,scaleX:1,scaleY:1};function r(){t.node.remove(),t=void 0,i={x:0,y:0,scaleX:1,scaleY:1}}function o(o){e.dispatch(Bn,{type:"overlay:destroy",source:o.source,overlay:t}),n.dropAnimation?function(e){let{overlay:t,source:n,transform:i,dragSourceOpacity:r,easing:o,duration:l,onComplete:u}=e;window.requestAnimationFrame((()=>{let e=t.firstChild.getBoundingClientRect(),s=n.getBoundingClientRect(),a=e.left-s.left,c=e.top-s.top;if(0!=a||0!=c){let e=jt.transform({x:i.x-a,y:i.y-c,scaleX:1,scaleY:1}),s=n.style.opacity;null!=r&&(n.style.opacity=r.toString()),t.animate([{transform:jt.transform(i)},{transform:e}],{easing:o,duration:l}).onfinish=()=>{t.style.display="none",u(),null!=r&&(n.style.opacity=s)}}else u()}))}({source:o.source.node,overlay:t.node,duration:n.dropAnimation.duration,easing:n.dropAnimation.easing,dragSourceOpacity:n.dropAnimation.dragSourceOpacity,transform:i,onComplete:r}):r()}return[cn((i=>{let{node:r,viewRect:o}=i.source,l=document.createElement(n.tag),u=null!=n.render?n.render(i.source):r.cloneNode(!0);l.append(u),n.mount.append(l),Object.assign(l.style,{position:"fixed",width:zt(o.width),height:zt(o.height),top:zt(o.clientY),left:zt(o.clientX),zIndex:n.zIndex,touchAction:"none"}),t={node:l,viewRect:Ot(u)},e.dispatch(Cn,{type:"overlay:init",source:i.source,overlay:t})})),fn((({transform:e})=>{i=e,t.node.style.transform=jt.transform(e)})),hn(o),mn(o)]}));function yn(e={}){return[vn.of(e),wn]}function bn(e,t){let n=Math.max(e.pageY,t.pageY),i=Math.max(e.pageX,t.pageX),r=Math.min(e.pageX+e.width,t.pageX+t.width),o=Math.min(e.pageY+e.height,t.pageY+t.height),l=r-i,u=o-n;if(i<r&&n<o){let n=t.width*t.height,i=e.width*e.height,r=l*u;return Number((r/(n+i-r)).toFixed(4))}return 0}let Dn=({target:e,colliders:t})=>{let n,i=0;for(let r of t){let t=bn(r.pageRect,e);t>i&&(i=t,n=r)}return n},En=xt.define({combine:e=>wt(e,{algorithm:Dn})}),An=vt.define();function Fn(e){return new Ct(An,e)}let _n=vt.define();function kn(e){return new Ct(_n,e)}let Tn=vt.define();let Nn=bt.define((e=>{let t,n,i,r,o,l,{algorithm:u,collider:s}=e.facet(En);function a(){t=void 0,n=void 0,l=void 0,i=void 0,r=void 0,o=void 0}return[cn((n=>{t=n.source,l=function(e){let t=[],n=e;for(;null!=n;){let e=Pt(n);if(t.push(e),I(e)||H(e))break;n=e}return t}(n.source.node),i=function(e){return e.map(((e,t)=>{let n=Rt(e.node);return{...e,pageRect:n,index:t}}))}(s(t)),r=function(e,t){let n=Gt(e,t);if(null==n)throw new Error("invalid operation");return n}(t.node,i),e.dispatch(An,{type:"collision:init",colliders:i,nativeEvent:n.nativeEvent,sourceDraggable:t,source:r})})),(c=e=>{n=e.overlay},new Ct(Cn,c)),fn((({transform:s,nativeEvent:a})=>{let c={...t.viewRect,width:n.viewRect.width,height:n.viewRect.height};var d,f;d=c,f=s,c={...d,clientX:d.clientX+f.x,clientY:d.clientY+f.y,pageX:d.pageX+f.x,pageY:d.pageY+f.y},c=function(e,t){let n={...e},i=Ut(t);return n.pageX=n.clientX+i.scrollLeft,n.pageY=n.clientY+i.scrollTop,n}(c,l);let p=u({target:c,colliders:i,event:a}),h=p&&p!=o;o&&o!=p&&(e.dispatch(Tn,{type:"drag:out",nativeEvent:a,sourceDraggable:t,source:r,over:o}),o=void 0),h&&(o=p,e.dispatch(_n,{type:"drag:over",nativeEvent:a,sourceDraggable:t,source:r,over:o}))})),hn(a),mn(a)];var c}));function Vn(e){return{x:e.pageX+e.width/2,y:e.pageY+e.height/2}}let Pn=({target:e,colliders:t})=>{let n,i=1/0,r=Vn(e);for(let e of t){let t=Wt(Vn(e.pageRect),r);t<i&&(i=t,n=e)}return n},Un=xt.define({combine:e=>wt(e,{transition:{easing:"ease",duration:200}})}),Ln=vt.define(),Rn=vt.define(),On=vt.define();function Sn(){let e;return(t,n)=>{let{top:i,right:r,onClose:o,props:l}=n;if(!e){e=R("div","float-box popover",[R("button","float-box__move button button_icon",[ee("grip-horizontal","button__icon")]),R("button","float-box__close button button_icon",[ee("x","button__icon")]),R("div","popover__body")]),e.style.position="fixed",e.style.top=i,e.style.right=r,document.body.append(e);let t=q(e,".float-box__move");!function(e,t,n){new Tt({hosts:[document,e.window.document],draggable:()=>[{node:t}],modifiers:[It,Nt],extensions:[sn(),xn(),bt.define((()=>{let e={x:0,y:0},i={x:0,y:0};return[cn((()=>{t.style.cursor="grabbing",document.body.style.cursor="grabbing"})),fn((({transform:t})=>{i={x:e.x+t.x,y:e.y+t.y},n.style.transform=jt.translate(i)})),hn((()=>{document.body.style.cursor="",t.style.cursor="grab",e=i,n.style.transform=jt.translate(i)})),mn((()=>{document.body.style.cursor="",t.style.cursor="grab",e=i,n.style.transform=jt.translate(i)}))]}))]})}(l.view,t,e)}e.style.display="";let u=q(e,".popover__body"),s=new t({target:u,props:l});return q(e,".float-box__close").addEventListener("click",o),{component:s,destroy:()=>{s.$destroy(),s=void 0,u.innerHTML="",e.style.display="none"}}}}bt.define((e=>{let t,n,i,{strategy:r,transition:o}=e.facet(Un);function l({nativeEvent:n}){e.dispatch(On,{type:"sort:end",source:t,colliders:i,nativeEvent:n}),t=void 0,i=void 0}return[Fn((r=>{i=r.colliders,t=r.source,n=Ot(t.node),e.dispatch(Ln,{type:"sort:start",colliders:i,nativeEvent:r.nativeEvent,source:t})})),kn((({over:l,nativeEvent:u})=>{let s=r({items:i,overIndex:l.index,sourceIndex:t.index,sourceViewRect:n}).map((({transform:e},t)=>{return{...i[t],transform:e,transition:(o&&(n=o,jt.transition({property:"transform",...n})))??""};var n}));e.dispatch(Rn,{type:"sort",over:l,source:t,colliders:s,nativeEvent:u})})),hn(l),mn(l)]}));let qn=(()=>{let e=Sn();return(t,n)=>{let{component:i,destroy:r}=e(t,{props:n,top:"3.125rem",right:"38.75rem",onClose:()=>{let e=new A(n.view.builder).deselect();n.view.apply(e)}});return{component:i,destroy:r}}})(),Mn=(()=>{let e=Sn();return(t,n)=>{let{component:i,destroy:r}=e(t,{props:n,top:"3.125rem",right:"18.75rem",onClose:()=>{let e=new A(n.view.builder);e.effect(V),n.view.apply(e)}});return{component:i,destroy:r}}})();function In(...e){let t=[];for(let n of e){if(!n)continue;let e=typeof n;if("string"==e||"number"==e)t.push(n);else if(Array.isArray(n)){if(n.length>0){let e=In(...n);e&&t.push(e)}}else if("object"==e)if(n.toString!=Object.prototype.toString)t.push(n.toString());else for(let[e,i]of Object.entries(n))i&&t.push(e)}return t.join(" ")}class zn{constructor(e,t){function n(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,r,o,l){let u=[],s=[],a=/^@(\w+)\b/.exec(e[0]),c=Boolean(a&&"keyframes"==a[1]);for(let[t,l]of Object.entries(r))if(/&/.test(t)){i(t.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,o)}else if(l&&"object"==typeof l){if(!a)throw new Error(`The value of a property (${t}) should be a primitive value`);i(n(t),l,s,c)}else if(null!=l){let e=t.replace(/_.*/,"").replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`));u.push(`${e}: ${l};`)}if(u.length>0){let n=(t?.finish&&!l?e.map(t.finish):e).join(", "),i=`${n} {${u.join(" ")}}`;o.push({selectorText:n,cssText:i})}if(s.length>0){let t=e.join(", "),n=`${t} {${s.map((e=>e.cssText)).join(" ")}}`;o.push({atText:t,cssText:n,rules:s})}}this.rules=[];for(let[t,r]of Object.entries(e))i(n(t),r,this.rules)}get cssRules(){return this.rules.join("\n")}static shortid(){return F("css-")}}function jn(e){return Boolean(e.atText)}function Xn(e,t){let n=Array.from(e.cssRules).filter((e=>e.selectorText==t.selectorText));if(n.length>1)throw new Error(`DOM for rule ${t.selectorText} is duplicate`);return n[0]}function Yn(e,t){return Array.from(e.cssRules).findIndex((e=>e.selectorText==t))}class Hn{constructor(e){let t=e.defaultView||window;if(null!=e.adoptedStyleSheets&&void 0!==t.CSSStyleSheet)this.sheet=new t.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets);else{let t=e.createElement("style");e.head.append(t),this.sheet=t.sheet}}mount(e){let t=this.sheet,n=0;for(let i=0;i<e.length;i++){let r=e[i];for(let e=0;e<r.rules.length;e++){let i=r.rules[e];t.insertRule(i.cssText,n),n+=1}}}render(e){for(let t of e.rules){if(jn(t))throw new Error("TODO");let e=Xn(this.sheet,t);if(null!=e){let n=e.style.cssText,i=t.cssText.match(/{(.*)}/),r=i?i[1]:"";n!=r&&(e.style.cssText=r)}else this.sheet.insertRule(t.cssText)}}delete(...e){for(let t of e){let e=Yn(this.sheet,t);if(-1==e)throw new Error("invalid operation");this.sheet.deleteRule(e)}}}let Gn=g.define();class Wn{constructor(e,t){this.extension=Gn.of(this),this.id=e,this.create=t}static define(e){return new Wn(p.nextId(),e)}}class Jn{constructor(e,t){this.spec=e,this.value=t}static create(e,t){try{let n=e.create(t);return new Jn(e,n)}catch(e){return console.error(t.builder,e,"plugin crashed on create"),Jn.Crashed}}update(e){if(null==this.value.update)return this;try{return this.value.update(e),this}catch(t){if(console.error(e.builder,t,"plugin crashed on update"),null!=this.value.destroy)try{this.value.destroy()}catch{}return Jn.Crashed}}destroy(e){if(null!=this.value.destroy)try{this.value.destroy()}catch(t){console.error(e.builder,t,"plugin crashed on destroy")}}}Jn.Crashed=new Jn(Wn.define((()=>({}))),{});let Zn={};function Kn(e){let t=-1,n=[];function i(){let i=n;n=[],function(e,t){let n=e.map((e=>{try{return e.read?e.read(t):void 0}catch(e){return console.error(e),Zn}}));for(let i=0,r=e.length;i<r;i++)if(n[i]!=Zn)try{let r=e[i].write;r&&r(n[i],t)}catch(e){console.error(e)}}(i,e),t=-1,n.length>0&&n.forEach((e=>r(e)))}function r(e){n.push(e),-1==t&&(t=requestAnimationFrame(i))}return r}function Qn(e,t,n){let i={view:e,node:n,children:[],parent:t,nodeview:void 0,domNode:void 0,slotDomNode:void 0},r=e.nodeview(e,(()=>ui.path(e,i)),n);if(i.nodeview=r,null!=n.children)for(let t of n.children){let n=Qn(e,i,t);i.children.push(n)}return i}function ei(e,t){let{node:n,nodeview:i}=t,{domNode:r,slotDomNode:o}=i.render(n);if(t.domNode=r,t.slotDomNode=o,r.$viewdesc=t,t.children.length>0){if(null==o)throw new Error("invalid operation");for(let n of t.children){let t=ei(e,n);o.append(t)}}return r}function ti(e,t){if("set_node"==t.type){let{path:n}=t,i=ui.get(e,n),r=b.get(e.builder,n);if(i.node=r,null!=i.nodeview.update){let t=b.get(e.builder,n);i.nodeview.update(t)}let o=B.parent(n);for(;!B.isRoot(o);){let t=b.get(e.builder,o);ui.get(e,o).node=t,o=B.parent(o)}}}function ni(e,t){t.children.forEach((t=>ni(e,t)));let n=t.parent.children.indexOf(t);t.parent.children.splice(n,1),t.parent=void 0,null!=t.nodeview.destroy&&t.nodeview.destroy(t.node),t.domNode.$viewdesc=void 0,t.domNode.remove()}function ii(e,t){if("remove_node"==t.type){let{path:n}=t;ni(e,ui.get(e,n));let i=B.parent(n);for(;!B.isRoot(i);){let t=b.get(e.builder,i),n=ui.get(e,i);n.node=t,null!=n.nodeview.update&&n.nodeview.update(t),i=B.parent(i)}}}function ri(e,t,n){e.insertBefore(t,e.children[n])}function oi(e,t){if("insert_node"==t.type){let{path:n}=t,i=ui.get(e,B.parent(n)),r=Qn(e,i,b.get(e.builder,n)),o=ei(e,r);if(null==i.slotDomNode)throw new Error("invalid operation");let l=B.index(n);i.children.splice(l,0,r),ri(i.slotDomNode,o,l);let u=B.parent(n);for(;!B.isRoot(u);){let t=b.get(e.builder,u),n=ui.get(e,u);n.node=t,null!=n.nodeview.update&&n.nodeview.update(t),u=B.parent(u)}}}function li(e,t){if("move_node"==t.type){let{path:n,newPath:i}=t,r=ui.get(e,n),o=r.parent;o.children.splice(B.index(n),1);let l=B.transformExn(n,t),u=ui.get(e,B.parent(l));if(u.children.splice(B.index(l),0,r),r.parent=u,null==u.slotDomNode)throw new Error("invalid operation");let s=B.isSibling(n,i)&&B.isBefore(n,i)?B.index(B.nextSibling(l)):B.index(l);ri(u.slotDomNode,r.domNode,s);let a=o;for(;null!=a;){let t=ui.path(e,a);if(B.isRoot(t))break;let n=b.get(e.builder,t);a.node=n,null!=a.nodeview.update&&a.nodeview.update(n),a=a.parent}for(a=u;null!=a;){let t=ui.path(e,a);if(B.isRoot(t))break;let n=b.get(e.builder,t);a.node=n,null!=a.nodeview.update&&a.nodeview.update(n),a=a.parent}}}const ui={path(e,t){let n=[],i=t;for(;null!=i.parent;){let e=i.parent.children.indexOf(i);n.unshift(e),i=i.parent}return n},closest(e,n,i=t){let r=n;for(;null!=r;){if(null!=r.$viewdesc&&r.$viewdesc!=e.viewdesc&&i(r.$viewdesc.node))return r.$viewdesc;r=r.parentNode}},closestExn(e,n,i=t){let r=ui.closest(e,n,i);if(null==r)throw new Error("Cannot resolve view description");return r},tryGet(e,t){let n=e.viewdesc;for(let e=0;e<t.length;e+=1){let i=t[e];if(null==n.children[i])return;n=n.children[i]}return n},get(e,t){let n=ui.tryGet(e,t);if(null==n)throw new Error("expect a view description");return n}};let si=(()=>{let e=new WeakMap;return t=>{let n=e.get(t);return n||(n=new Hn(t),e.set(t,n)),n}})();function ai(e,t){return""!=e&&""!=t?`${e}${t}`:""}const ci={flexDirection:"row",flexJustify:"flex-start",flexAlign:"flex-start",flexGapValue:"",flexGapUnit:"px",widthValue:"",widthUnit:"px",heightValue:"",heightUnit:"px",maxWidthValue:"",maxWidthUnit:"px",marginTopValue:"",marginTopUnit:"px",marginRightValue:"",marginRightUnit:"px",marginBottomValue:"",marginBottomUnit:"px",marginLeftValue:"",marginLeftUnit:"px",paddingTopValue:"10",paddingTopUnit:"px",paddingRightValue:"10",paddingRightUnit:"px",paddingBottomValue:"10",paddingBottomUnit:"px",paddingLeftValue:"10",paddingLeftUnit:"px"};function di(e){let t,n,i,r,o,l;return{c(){t=ye("div"),n=ye("div"),i=De(),r=ye("div"),Fe(n,"class","f-container__content"),Fe(r,"class",o=In("outline",{hovered:e[3],selected:e[2]})),Fe(t,"class",l=In(e[5],"f-container",{"is-empty":0==e[4].length}))},m(o,l){Be(o,t,l),Ce(t,n),e[32](n),Ce(t,i),Ce(t,r),e[33](t)},p(e,n){12&n[0]&&o!==(o=In("outline",{hovered:e[3],selected:e[2]}))&&Fe(r,"class",o),16&n[0]&&l!==(l=In(e[5],"f-container",{"is-empty":0==e[4].length}))&&Fe(t,"class",l)},i:te,o:te,d(n){n&&we(t),e[32](null),e[33](null)}}}function fi(e,t,n){let{domNode:i}=t,{slotDomNode:r}=t,{view:o}=t,{selected:l}=t,{hovered:u}=t,{children:s}=t,{flexDirection:a=ci.flexDirection}=t,{flexJustify:c=ci.flexJustify}=t,{flexAlign:d=ci.flexAlign}=t,{flexGapValue:f=ci.flexGapValue}=t,{flexGapUnit:p=ci.flexGapUnit}=t,{marginTopValue:h=ci.marginTopValue}=t,{marginTopUnit:g=ci.marginTopUnit}=t,{marginRightValue:m=ci.marginRightValue}=t,{marginRightUnit:$=ci.marginRightUnit}=t,{marginBottomValue:x=ci.marginBottomValue}=t,{marginBottomUnit:v=ci.marginBottomUnit}=t,{marginLeftValue:C=ci.marginLeftValue}=t,{marginLeftUnit:B=ci.marginLeftUnit}=t,{paddingTopValue:w=ci.paddingTopValue}=t,{paddingTopUnit:y=ci.paddingTopUnit}=t,{paddingRightValue:b=ci.paddingRightValue}=t,{paddingRightUnit:D=ci.paddingRightUnit}=t,{paddingBottomValue:E=ci.paddingBottomValue}=t,{paddingBottomUnit:A=ci.paddingBottomUnit}=t,{paddingLeftValue:F=ci.paddingLeftValue}=t,{paddingLeftUnit:_=ci.paddingLeftUnit}=t,{widthValue:k=ci.widthValue}=t,{widthUnit:T=ci.widthUnit}=t,{heightValue:N=ci.heightValue}=t,{heightUnit:V=ci.heightUnit}=t,P=zn.shortid();var U;return U=()=>{o.deleteCSS(`.${P}.f-container`,`.${P} > .f-container__content`)},Pe().$$.on_destroy.push(U),e.$$set=e=>{"domNode"in e&&n(0,i=e.domNode),"slotDomNode"in e&&n(1,r=e.slotDomNode),"view"in e&&n(6,o=e.view),"selected"in e&&n(2,l=e.selected),"hovered"in e&&n(3,u=e.hovered),"children"in e&&n(4,s=e.children),"flexDirection"in e&&n(7,a=e.flexDirection),"flexJustify"in e&&n(8,c=e.flexJustify),"flexAlign"in e&&n(9,d=e.flexAlign),"flexGapValue"in e&&n(10,f=e.flexGapValue),"flexGapUnit"in e&&n(11,p=e.flexGapUnit),"marginTopValue"in e&&n(12,h=e.marginTopValue),"marginTopUnit"in e&&n(13,g=e.marginTopUnit),"marginRightValue"in e&&n(14,m=e.marginRightValue),"marginRightUnit"in e&&n(15,$=e.marginRightUnit),"marginBottomValue"in e&&n(16,x=e.marginBottomValue),"marginBottomUnit"in e&&n(17,v=e.marginBottomUnit),"marginLeftValue"in e&&n(18,C=e.marginLeftValue),"marginLeftUnit"in e&&n(19,B=e.marginLeftUnit),"paddingTopValue"in e&&n(20,w=e.paddingTopValue),"paddingTopUnit"in e&&n(21,y=e.paddingTopUnit),"paddingRightValue"in e&&n(22,b=e.paddingRightValue),"paddingRightUnit"in e&&n(23,D=e.paddingRightUnit),"paddingBottomValue"in e&&n(24,E=e.paddingBottomValue),"paddingBottomUnit"in e&&n(25,A=e.paddingBottomUnit),"paddingLeftValue"in e&&n(26,F=e.paddingLeftValue),"paddingLeftUnit"in e&&n(27,_=e.paddingLeftUnit),"widthValue"in e&&n(28,k=e.widthValue),"widthUnit"in e&&n(29,T=e.widthUnit),"heightValue"in e&&n(30,N=e.heightValue),"heightUnit"in e&&n(31,V=e.heightUnit)},e.$$.update=()=>{2147483584&e.$$.dirty[0]|1&e.$$.dirty[1]&&o.renderCSS({[`.${P} > .f-container__content`]:{flexDirection:a,justifyContent:c,alignItems:d,gap:ai(f,p)},[`.${P}.f-container`]:{marginTop:ai(h,g),marginRight:ai(m,$),marginBottom:ai(x,v),marginLeft:ai(C,B),paddingTop:ai(w,y),paddingRight:ai(b,D),paddingBottom:ai(E,A),paddingLeft:ai(F,_),width:ai(k,T),height:ai(N,V)}})},[i,r,l,u,s,P,o,a,c,d,f,p,h,g,m,$,x,v,C,B,w,y,b,D,E,A,F,_,k,T,N,V,function(e){Me[e?"unshift":"push"]((()=>{r=e,n(1,r)}))},function(e){Me[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class pi extends ft{constructor(e){super(),dt(this,e,fi,di,ue,{domNode:0,slotDomNode:1,view:6,selected:2,hovered:3,children:4,flexDirection:7,flexJustify:8,flexAlign:9,flexGapValue:10,flexGapUnit:11,marginTopValue:12,marginTopUnit:13,marginRightValue:14,marginRightUnit:15,marginBottomValue:16,marginBottomUnit:17,marginLeftValue:18,marginLeftUnit:19,paddingTopValue:20,paddingTopUnit:21,paddingRightValue:22,paddingRightUnit:23,paddingBottomValue:24,paddingBottomUnit:25,paddingLeftValue:26,paddingLeftUnit:27,widthValue:28,widthUnit:29,heightValue:30,heightUnit:31},null,[-1,-1])}get domNode(){return this.$$.ctx[0]}set domNode(e){this.$$set({domNode:e}),Ze()}get slotDomNode(){return this.$$.ctx[1]}set slotDomNode(e){this.$$set({slotDomNode:e}),Ze()}get view(){return this.$$.ctx[6]}set view(e){this.$$set({view:e}),Ze()}get selected(){return this.$$.ctx[2]}set selected(e){this.$$set({selected:e}),Ze()}get hovered(){return this.$$.ctx[3]}set hovered(e){this.$$set({hovered:e}),Ze()}get children(){return this.$$.ctx[4]}set children(e){this.$$set({children:e}),Ze()}get flexDirection(){return this.$$.ctx[7]}set flexDirection(e){this.$$set({flexDirection:e}),Ze()}get flexJustify(){return this.$$.ctx[8]}set flexJustify(e){this.$$set({flexJustify:e}),Ze()}get flexAlign(){return this.$$.ctx[9]}set flexAlign(e){this.$$set({flexAlign:e}),Ze()}get flexGapValue(){return this.$$.ctx[10]}set flexGapValue(e){this.$$set({flexGapValue:e}),Ze()}get flexGapUnit(){return this.$$.ctx[11]}set flexGapUnit(e){this.$$set({flexGapUnit:e}),Ze()}get marginTopValue(){return this.$$.ctx[12]}set marginTopValue(e){this.$$set({marginTopValue:e}),Ze()}get marginTopUnit(){return this.$$.ctx[13]}set marginTopUnit(e){this.$$set({marginTopUnit:e}),Ze()}get marginRightValue(){return this.$$.ctx[14]}set marginRightValue(e){this.$$set({marginRightValue:e}),Ze()}get marginRightUnit(){return this.$$.ctx[15]}set marginRightUnit(e){this.$$set({marginRightUnit:e}),Ze()}get marginBottomValue(){return this.$$.ctx[16]}set marginBottomValue(e){this.$$set({marginBottomValue:e}),Ze()}get marginBottomUnit(){return this.$$.ctx[17]}set marginBottomUnit(e){this.$$set({marginBottomUnit:e}),Ze()}get marginLeftValue(){return this.$$.ctx[18]}set marginLeftValue(e){this.$$set({marginLeftValue:e}),Ze()}get marginLeftUnit(){return this.$$.ctx[19]}set marginLeftUnit(e){this.$$set({marginLeftUnit:e}),Ze()}get paddingTopValue(){return this.$$.ctx[20]}set paddingTopValue(e){this.$$set({paddingTopValue:e}),Ze()}get paddingTopUnit(){return this.$$.ctx[21]}set paddingTopUnit(e){this.$$set({paddingTopUnit:e}),Ze()}get paddingRightValue(){return this.$$.ctx[22]}set paddingRightValue(e){this.$$set({paddingRightValue:e}),Ze()}get paddingRightUnit(){return this.$$.ctx[23]}set paddingRightUnit(e){this.$$set({paddingRightUnit:e}),Ze()}get paddingBottomValue(){return this.$$.ctx[24]}set paddingBottomValue(e){this.$$set({paddingBottomValue:e}),Ze()}get paddingBottomUnit(){return this.$$.ctx[25]}set paddingBottomUnit(e){this.$$set({paddingBottomUnit:e}),Ze()}get paddingLeftValue(){return this.$$.ctx[26]}set paddingLeftValue(e){this.$$set({paddingLeftValue:e}),Ze()}get paddingLeftUnit(){return this.$$.ctx[27]}set paddingLeftUnit(e){this.$$set({paddingLeftUnit:e}),Ze()}get widthValue(){return this.$$.ctx[28]}set widthValue(e){this.$$set({widthValue:e}),Ze()}get widthUnit(){return this.$$.ctx[29]}set widthUnit(e){this.$$set({widthUnit:e}),Ze()}get heightValue(){return this.$$.ctx[30]}set heightValue(e){this.$$set({heightValue:e}),Ze()}get heightUnit(){return this.$$.ctx[31]}set heightUnit(e){this.$$set({heightUnit:e}),Ze()}}const hi=[];function gi(e,t=te){let n;const i=new Set;function r(t){if(ue(e,t)&&(e=t,n)){const t=!hi.length;for(const t of i)t[1](),hi.push(t,e);if(t){for(let e=0;e<hi.length;e+=2)hi[e][0](hi[e+1]);hi.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(o,l=te){const u=[o,l];return i.add(u),1===i.size&&(n=t(r)||te),o(e),()=>{i.delete(u),0===i.size&&(n(),n=null)}}}}let mi={};function $i(e,t,n){const i=e.slice();return i[10]=t[n],i}function xi(e,t){let n,i,r,o,l,u,s,a,c,d=t[10].label+"";return{key:e,first:null,c(){n=ye("li"),i=ye("a"),r=be(d),u=De(),Fe(i,"class","tabs__link"),Fe(i,"role","tab"),Fe(i,"aria-selected",o=t[3]==t[10].key),Fe(i,"tabindex",l=t[3]==t[10].key?0:-1),Fe(n,"class",s=In("tabs__item",{"is-active":t[3]==t[10].key})),Fe(n,"title",a=t[10].label),Fe(n,"role","presentation"),Fe(n,"data-key",c=t[10].key),this.first=n},m(e,t){Be(e,n,t),Ce(n,i),Ce(i,r),Ce(n,u)},p(e,u){t=e,4&u&&d!==(d=t[10].label+"")&&_e(r,d),12&u&&o!==(o=t[3]==t[10].key)&&Fe(i,"aria-selected",o),12&u&&l!==(l=t[3]==t[10].key?0:-1)&&Fe(i,"tabindex",l),12&u&&s!==(s=In("tabs__item",{"is-active":t[3]==t[10].key}))&&Fe(n,"class",s),4&u&&a!==(a=t[10].label)&&Fe(n,"title",a),4&u&&c!==(c=t[10].key)&&Fe(n,"data-key",c)},d(e){e&&we(n)}}}function vi(e){let t,n,i,r,o,l,u,s=[],a=new Map,c=e[2];const d=e=>e[10].key;for(let t=0;t<c.length;t+=1){let n=$i(e,c,t),i=d(n);a.set(i,s[t]=xi(i,n))}const f=e[8].default,p=pe(f,e,e[7],null);return{c(){t=ye("div"),n=ye("ul");for(let e=0;e<s.length;e+=1)s[e].c();i=De(),p&&p.c(),Fe(n,"class","tabs__nav"),Fe(n,"role","tablist"),Fe(t,"class",r=In({tabs_default:!e[1],tabs_scoped:e[1]},e[0]))},m(r,a){Be(r,t,a),Ce(t,n);for(let e=0;e<s.length;e+=1)s[e].m(n,null);Ce(t,i),p&&p.m(t,null),o=!0,l||(u=[Ae(n,"click",e[5]),Ae(n,"keydown",e[6])],l=!0)},p(e,[i]){12&i&&(c=e[2],s=ut(s,i,d,1,e,c,a,n,ot,xi,null,$i)),p&&p.p&&(!o||128&i)&&me(p,f,e,e[7],o?ge(f,e[7],i,null):$e(e[7]),null),(!o||3&i&&r!==(r=In({tabs_default:!e[1],tabs_scoped:e[1]},e[0])))&&Fe(t,"class",r)},i(e){o||(it(p,e),o=!0)},o(e){rt(p,e),o=!1},d(e){e&&we(t);for(let e=0;e<s.length;e+=1)s[e].d();p&&p.d(e),l=!1,oe(u)}}}function Ci(e,t,n){let i,{$$slots:r={},$$scope:o}=t,{class:u}=t,{scoped:s}=t,a=[],c=gi("__DEFER");function d(e,t){var n;(n=`li[data-key="${t}"] .tabs__link`,e.querySelector(n)).focus()}return fe(e,c,(e=>n(3,i=e))),Re(mi,{selected:c,registerTab:e=>{n(2,a=l.append(a,e)),"__DEFER"==i&&xe(c,i=e.key,i)}}),e.$$set=e=>{"class"in e&&n(0,u=e.class),"scoped"in e&&n(1,s=e.scoped),"$$scope"in e&&n(7,o=e.$$scope)},[u,s,a,i,c,function(e){let t=(n=e.target,r="li",n.closest(r));var n,r;if(t){let e=t.dataset.key;e&&e!=i&&xe(c,i=e,i)}},function(e){let t=e.currentTarget;if(e.key==Yt.ArrowLeft||e.key==Yt.ArrowUp){e.preventDefault();let n=function(e,t){let n=e.findIndex((e=>e.key==t));return n<=0?e[e.length-1].key:e[n-1].key}(a,i);return xe(c,i=n,i),void d(t,i)}if(e.key==Yt.ArrowRight||e.key==Yt.ArrowDown){e.preventDefault();let n=function(e,t){let n=e.findIndex((e=>e.key==t));return n==e.length-1?e[0].key:e[n+1].key}(a,i);xe(c,i=n,i),d(t,i)}},o,r]}class Bi extends ft{constructor(e){super(),dt(this,e,Ci,vi,ue,{class:0,scoped:1})}}function wi(e){let t,n,i;const r=e[6].default,o=pe(r,e,e[5],null);return{c(){t=ye("div"),o&&o.c(),Fe(t,"class",n=In("tabs__content",{block:e[0]==e[1],hidden:e[0]!=e[1]})),Fe(t,"role","tabpanel")},m(e,n){Be(e,t,n),o&&o.m(t,null),i=!0},p(e,[l]){o&&o.p&&(!i||32&l)&&me(o,r,e,e[5],i?ge(r,e[5],l,null):$e(e[5]),null),(!i||1&l&&n!==(n=In("tabs__content",{block:e[0]==e[1],hidden:e[0]!=e[1]})))&&Fe(t,"class",n)},i(e){i||(it(o,e),i=!0)},o(e){rt(o,e),i=!1},d(e){e&&we(t),o&&o.d(e)}}}function yi(e,t,n){let i,{$$slots:r={},$$scope:o}=t,{label:l}=t,{iconLeft:u}=t,s=F("tab-panel-"),{selected:a,registerTab:c}=Oe(mi);return fe(e,a,(e=>n(0,i=e))),c({label:l,iconLeft:u,key:s}),e.$$set=e=>{"label"in e&&n(3,l=e.label),"iconLeft"in e&&n(4,u=e.iconLeft),"$$scope"in e&&n(5,o=e.$$scope)},[i,s,a,l,u,o,r]}class bi extends ft{constructor(e){super(),dt(this,e,yi,wi,ue,{label:3,iconLeft:4})}}function Di(e){let t,n,i,r=e[4]&&Ei();return{c(){t=ye("legend"),r&&r.c(),n=De(),i=be(e[3]),Fe(t,"class","form-element__legend form-element__label")},m(e,o){Be(e,t,o),r&&r.m(t,null),Ce(t,n),Ce(t,i)},p(e,o){e[4]?r||(r=Ei(),r.c(),r.m(t,n)):r&&(r.d(1),r=null),8&o&&_e(i,e[3])},d(e){e&&we(t),r&&r.d()}}}function Ei(e){let t;return{c(){t=ye("abbr"),t.textContent="*",Fe(t,"class","required"),Fe(t,"title","required")},m(e,n){Be(e,t,n)},d(e){e&&we(t)}}}function Ai(e){let t,n;return{c(){t=ye("div"),n=be(e[5]),Fe(t,"class","form-element__help")},m(e,i){Be(e,t,i),Ce(t,n)},p(e,t){32&t&&_e(n,e[5])},d(e){e&&we(t)}}}function Fi(e){let t,n,i,r,o,l,u=e[3]&&Di(e);const s=e[7].default,a=pe(s,e,e[6],null);let c=e[5]&&Ai(e);return{c(){t=ye("fieldset"),u&&u.c(),n=De(),i=ye("div"),a&&a.c(),r=De(),c&&c.c(),Fe(i,"class","form-element__control"),Fe(t,"class",o=In("form-element",{"form-element_horizontal":e[2],"form-element_stacked":e[1]},e[0]))},m(e,o){Be(e,t,o),u&&u.m(t,null),Ce(t,n),Ce(t,i),a&&a.m(i,null),Ce(t,r),c&&c.m(t,null),l=!0},p(e,[i]){e[3]?u?u.p(e,i):(u=Di(e),u.c(),u.m(t,n)):u&&(u.d(1),u=null),a&&a.p&&(!l||64&i)&&me(a,s,e,e[6],l?ge(s,e[6],i,null):$e(e[6]),null),e[5]?c?c.p(e,i):(c=Ai(e),c.c(),c.m(t,null)):c&&(c.d(1),c=null),(!l||7&i&&o!==(o=In("form-element",{"form-element_horizontal":e[2],"form-element_stacked":e[1]},e[0])))&&Fe(t,"class",o)},i(e){l||(it(a,e),l=!0)},o(e){rt(a,e),l=!1},d(e){e&&we(t),u&&u.d(),a&&a.d(e),c&&c.d()}}}function _i(e,t,n){let{$$slots:i={},$$scope:r}=t,{class:o}=t,{stacked:l}=t,{horizontal:u}=t,{label:s}=t,{required:a}=t,{error:c}=t;return e.$$set=e=>{"class"in e&&n(0,o=e.class),"stacked"in e&&n(1,l=e.stacked),"horizontal"in e&&n(2,u=e.horizontal),"label"in e&&n(3,s=e.label),"required"in e&&n(4,a=e.required),"error"in e&&n(5,c=e.error),"$$scope"in e&&n(6,r=e.$$scope)},[o,l,u,s,a,c,r,i]}class ki extends ft{constructor(e){super(),dt(this,e,_i,Fi,ue,{class:0,stacked:1,horizontal:2,label:3,required:4,error:5})}}function Ti(e){let t,n,i,r=e[4]&&Ni();return{c(){t=ye("label"),r&&r.c(),n=De(),i=be(e[3]),Fe(t,"class","form-element__label"),Fe(t,"for",e[6])},m(e,o){Be(e,t,o),r&&r.m(t,null),Ce(t,n),Ce(t,i)},p(e,o){e[4]?r||(r=Ni(),r.c(),r.m(t,n)):r&&(r.d(1),r=null),8&o&&_e(i,e[3]),64&o&&Fe(t,"for",e[6])},d(e){e&&we(t),r&&r.d()}}}function Ni(e){let t;return{c(){t=ye("abbr"),t.textContent="*",Fe(t,"class","required"),Fe(t,"title","required")},m(e,n){Be(e,t,n)},d(e){e&&we(t)}}}function Vi(e){let t,n;return{c(){t=ye("div"),n=be(e[5]),Fe(t,"class","form-element__help")},m(e,i){Be(e,t,i),Ce(t,n)},p(e,t){32&t&&_e(n,e[5])},d(e){e&&we(t)}}}function Pi(e){let t,n,i,r,o,l,u=e[3]&&Ti(e);const s=e[8].default,a=pe(s,e,e[7],null);let c=e[5]&&Vi(e);return{c(){t=ye("div"),u&&u.c(),n=De(),i=ye("div"),a&&a.c(),r=De(),c&&c.c(),Fe(i,"class","form-element__control"),Fe(t,"class",o=In("form-element",{"form-element_horizontal":e[2],"form-element_stacked":e[1]},e[0]))},m(e,o){Be(e,t,o),u&&u.m(t,null),Ce(t,n),Ce(t,i),a&&a.m(i,null),Ce(t,r),c&&c.m(t,null),l=!0},p(e,[i]){e[3]?u?u.p(e,i):(u=Ti(e),u.c(),u.m(t,n)):u&&(u.d(1),u=null),a&&a.p&&(!l||128&i)&&me(a,s,e,e[7],l?ge(s,e[7],i,null):$e(e[7]),null),e[5]?c?c.p(e,i):(c=Vi(e),c.c(),c.m(t,null)):c&&(c.d(1),c=null),(!l||7&i&&o!==(o=In("form-element",{"form-element_horizontal":e[2],"form-element_stacked":e[1]},e[0])))&&Fe(t,"class",o)},i(e){l||(it(a,e),l=!0)},o(e){rt(a,e),l=!1},d(e){e&&we(t),u&&u.d(),a&&a.d(e),c&&c.d()}}}function Ui(e,t,n){let{$$slots:i={},$$scope:r}=t,{class:o}=t,{stacked:l}=t,{horizontal:u}=t,{label:s}=t,{required:a}=t,{error:c}=t,{labelFor:d}=t;return e.$$set=e=>{"class"in e&&n(0,o=e.class),"stacked"in e&&n(1,l=e.stacked),"horizontal"in e&&n(2,u=e.horizontal),"label"in e&&n(3,s=e.label),"required"in e&&n(4,a=e.required),"error"in e&&n(5,c=e.error),"labelFor"in e&&n(6,d=e.labelFor),"$$scope"in e&&n(7,r=e.$$scope)},[o,l,u,s,a,c,d,r,i]}class Li extends ft{constructor(e){super(),dt(this,e,Ui,Pi,ue,{class:0,stacked:1,horizontal:2,label:3,required:4,error:5,labelFor:6})}}function Ri(e){let t,n,i,r,o,l,u,s,a;return{c(){t=ye("span"),n=ye("input"),i=De(),r=ye("label"),o=ye("span"),l=be(e[4]),Fe(n,"type","radio"),Fe(n,"id",e[1]),Fe(n,"name",e[3]),n.__value=e[2],n.value=n.__value,n.disabled=e[5],e[12][0].push(n),Fe(o,"class","radio_faux"),Fe(r,"class","radio_button__label"),Fe(r,"for",e[1]),Fe(t,"class",u=In("button radio_button",e[6]))},m(u,c){Be(u,t,c),Ce(t,n),e[10](n),n.checked=n.__value===e[0],Ce(t,i),Ce(t,r),Ce(r,o),Ce(o,l),s||(a=[Ae(n,"change",e[11]),Ae(n,"change",e[9])],s=!0)},p(e,[i]){2&i&&Fe(n,"id",e[1]),8&i&&Fe(n,"name",e[3]),4&i&&(n.__value=e[2],n.value=n.__value),32&i&&(n.disabled=e[5]),1&i&&(n.checked=n.__value===e[0]),16&i&&_e(l,e[4]),2&i&&Fe(r,"for",e[1]),64&i&&u!==(u=In("button radio_button",e[6]))&&Fe(t,"class",u)},i:te,o:te,d(i){i&&we(t),e[10](null),e[12][0].splice(e[12][0].indexOf(n),1),s=!1,oe(a)}}}function Oi(e,t,n){let i,r,{id:o}=t,{value:l=o}=t,{group:u}=t,{name:s}=t,{label:a=""}=t,{disabled:c}=t,{class:d}=t;return e.$$set=e=>{"id"in e&&n(1,o=e.id),"value"in e&&n(2,l=e.value),"group"in e&&n(0,u=e.group),"name"in e&&n(3,s=e.name),"label"in e&&n(4,a=e.label),"disabled"in e&&n(5,c=e.disabled),"class"in e&&n(6,d=e.class)},e.$$.update=()=>{5&e.$$.dirty&&n(8,i=u==l),384&e.$$.dirty&&r&&(i?r.setAttribute("checked","checked"):r.removeAttribute("checked"))},[u,o,l,s,a,c,d,r,i,function(t){Se.call(this,e,t)},function(e){Me[e?"unshift":"push"]((()=>{r=e,n(7,r)}))},function(){u=this.__value,n(0,u)},[[]]]}class Si extends ft{constructor(e){super(),dt(this,e,Oi,Ri,ue,{id:1,value:2,group:0,name:3,label:4,disabled:5,class:6})}}const qi={};function Mi(e){let t,n,i;const r=e[5].default,o=pe(r,e,e[4],null);return{c(){t=ye("ul"),o&&o.c(),Fe(t,"class",n=In("accordion",e[0]))},m(e,n){Be(e,t,n),o&&o.m(t,null),i=!0},p(e,[l]){o&&o.p&&(!i||16&l)&&me(o,r,e,e[4],i?ge(r,e[4],l,null):$e(e[4]),null),(!i||1&l&&n!==(n=In("accordion",e[0])))&&Fe(t,"class",n)},i(e){i||(it(o,e),i=!0)},o(e){rt(o,e),i=!1},d(e){e&&we(t),o&&o.d(e)}}}function Ii(e,t,n){let i,r,o,{$$slots:u={},$$scope:s}=t,{class:a}=t,c=gi([]);fe(e,c,(e=>n(7,r=e)));let d=gi(void 0);fe(e,d,(e=>n(8,o=e)));let f=gi(void 0);return fe(e,f,(e=>n(6,i=e))),Re(qi,{expandedIndex:d,focusIndex:f,index:(()=>{let e=-1;return()=>(e+=1,e)})(),registerPanel:e=>{xe(c,r=l.append(r,e),r),e.expanded&&xe(d,o=e.index,o)},togglePanel:e=>{xe(f,i=void 0,i),xe(d,o=o==e?void 0:e,o)},navigate:(e,t)=>{let n=null!=i?i:t;if(e.key==Yt.ArrowDown){e.preventDefault();let t=n<r.length-1?n+1:0;xe(f,i=t,i)}else if(e.key==Yt.ArrowUp){e.preventDefault();let t=n>0?n-1:r.length-1;xe(f,i=t,i)}}}),e.$$set=e=>{"class"in e&&n(0,a=e.class),"$$scope"in e&&n(4,s=e.$$scope)},[a,c,d,f,s,u]}class zi extends ft{constructor(e){super(),dt(this,e,Ii,Mi,ue,{class:0})}}function ji(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x;l=new gt({props:{class:"accordion__summary-action-icon button__icon button__icon_left",name:"chevron-right"}});const v=e[12].default,C=pe(v,e,e[11],null);return{c(){t=ye("li"),n=ye("section"),i=ye("div"),r=ye("h2"),o=ye("button"),st(l.$$.fragment),u=De(),s=ye("span"),a=be(e[0]),f=De(),p=ye("div"),C&&C.c(),Fe(s,"class","accordion__summary-content"),Fe(o,"class","button button_reset accordion__summary-action"),Fe(o,"aria-expanded",c=e[3]==e[6]),Fe(o,"title",d=e[1]??e[0]),Fe(r,"class","accordion__summary-heading"),Fe(i,"class","accordion__summary"),Fe(p,"class","accordion__content"),Fe(p,"aria-hidden",h=e[3]!=e[6]),Fe(n,"class",g=In("accordion__section",{"is-open":e[3]==e[6]})),Fe(t,"class","accordion__list-item")},m(c,d){Be(c,t,d),Ce(t,n),Ce(n,i),Ce(i,r),Ce(r,o),at(l,o,null),Ce(o,u),Ce(o,s),Ce(s,a),e[13](o),Ce(n,f),Ce(n,p),C&&C.m(p,null),m=!0,$||(x=[Ae(o,"click",e[7]),Ae(o,"keydown",e[8])],$=!0)},p(e,[t]){(!m||1&t)&&_e(a,e[0]),(!m||8&t&&c!==(c=e[3]==e[6]))&&Fe(o,"aria-expanded",c),(!m||3&t&&d!==(d=e[1]??e[0]))&&Fe(o,"title",d),C&&C.p&&(!m||2048&t)&&me(C,v,e,e[11],m?ge(v,e[11],t,null):$e(e[11]),null),(!m||8&t&&h!==(h=e[3]!=e[6]))&&Fe(p,"aria-hidden",h),(!m||8&t&&g!==(g=In("accordion__section",{"is-open":e[3]==e[6]})))&&Fe(n,"class",g)},i(e){m||(it(l.$$.fragment,e),it(C,e),m=!0)},o(e){rt(l.$$.fragment,e),rt(C,e),m=!1},d(n){n&&we(t),ct(l),e[13](null),C&&C.d(n),$=!1,oe(x)}}}function Xi(e,t,n){let i,r,o,{$$slots:l={},$$scope:u}=t,{summary:s}=t,{title:a}=t,{expanded:c}=t,{index:d,expandedIndex:f,focusIndex:p,registerPanel:h,togglePanel:g,navigate:m}=Oe(qi);fe(e,f,(e=>n(3,r=e))),fe(e,p,(e=>n(10,i=e)));let $=d();return h({expanded:c,index:$}),e.$$set=e=>{"summary"in e&&n(0,s=e.summary),"title"in e&&n(1,a=e.title),"expanded"in e&&n(9,c=e.expanded),"$$scope"in e&&n(11,u=e.$$scope)},e.$$.update=()=>{1028&e.$$.dirty&&i==$&&o&&o.focus()},[s,a,o,r,f,p,$,function(){g($)},function(e){m(e,$)},c,i,u,l,function(e){Me[e?"unshift":"push"]((()=>{o=e,n(2,o)}))}]}class Yi extends ft{constructor(e){super(),dt(this,e,Xi,ji,ue,{summary:0,title:1,expanded:9})}}function Hi(e,t=200){let n;return(...i)=>{window.clearTimeout(n),n=window.setTimeout((()=>{e(...i)}),t)}}function Gi(e){let t,n,i,r,o,l,u,s,a;return{c(){t=ye("div"),n=ye("select"),i=ye("option"),i.textContent="-",r=ye("option"),r.textContent="px",o=ye("option"),o.textContent="em",l=ye("option"),l.textContent="rem",u=ye("option"),u.textContent="%",i.__value="",i.value=i.__value,r.__value="px",r.value=r.__value,o.__value="em",o.value=o.__value,l.__value="rem",l.value=l.__value,u.__value="%",u.value=u.__value,Fe(n,"class","select"),Fe(t,"class","select_container")},m(c,d){Be(c,t,d),Ce(t,n),Ce(n,i),Ce(n,r),Ce(n,o),Ce(n,l),Ce(n,u),Ne(n,e[0]),s||(a=Ae(n,"change",e[1]),s=!0)},p(e,[t]){1&t&&Ne(n,e[0])},i:te,o:te,d(e){e&&we(t),s=!1,a()}}}function Wi(e,t,n){let{value:i}=t;return e.$$set=e=>{"value"in e&&n(0,i=e.value)},[i,function(t){Se.call(this,e,t)}]}class Ji extends ft{constructor(e){super(),dt(this,e,Wi,Gi,ue,{value:0})}}function Zi(e){let t,n,i,r,o;return n=new Si({props:{label:"Row",id:"container-props-direction-row",value:"row",group:e[0]}}),n.$on("change",e[25]),r=new Si({props:{label:"Column",id:"container-props-direction-column",value:"column",group:e[0]}}),r.$on("change",e[25]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),Fe(t,"class","radio_button-group")},m(e,l){Be(e,t,l),at(n,t,null),Ce(t,i),at(r,t,null),o=!0},p(e,t){const i={};1&t[0]&&(i.group=e[0]),n.$set(i);const o={};1&t[0]&&(o.group=e[0]),r.$set(o)},i(e){o||(it(n.$$.fragment,e),it(r.$$.fragment,e),o=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),o=!1},d(e){e&&we(t),ct(n),ct(r)}}}function Ki(e){let t,n,i,r,o,l,u;return n=new Si({props:{label:"Start",id:"container-props-justify-start",value:"flex-start",group:e[1]}}),n.$on("change",e[26]),r=new Si({props:{label:"Center",id:"container-props-justify-center",value:"center",group:e[1]}}),r.$on("change",e[26]),l=new Si({props:{label:"End",id:"container-props-justify-end",value:"flex-end",group:e[1]}}),l.$on("change",e[26]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),o=De(),st(l.$$.fragment),Fe(t,"class","radio_button-group")},m(e,s){Be(e,t,s),at(n,t,null),Ce(t,i),at(r,t,null),Ce(t,o),at(l,t,null),u=!0},p(e,t){const i={};2&t[0]&&(i.group=e[1]),n.$set(i);const o={};2&t[0]&&(o.group=e[1]),r.$set(o);const u={};2&t[0]&&(u.group=e[1]),l.$set(u)},i(e){u||(it(n.$$.fragment,e),it(r.$$.fragment,e),it(l.$$.fragment,e),u=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),rt(l.$$.fragment,e),u=!1},d(e){e&&we(t),ct(n),ct(r),ct(l)}}}function Qi(e){let t,n,i,r,o,l,u;return n=new Si({props:{label:"Start",id:"container-props-align-start",value:"flex-start",group:e[2]}}),n.$on("change",e[27]),r=new Si({props:{label:"Center",id:"container-props-align-center",value:"center",group:e[2]}}),r.$on("change",e[27]),l=new Si({props:{label:"End",id:"container-props-align-end",value:"flex-end",group:e[2]}}),l.$on("change",e[27]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),o=De(),st(l.$$.fragment),Fe(t,"class","radio_button-group")},m(e,s){Be(e,t,s),at(n,t,null),Ce(t,i),at(r,t,null),Ce(t,o),at(l,t,null),u=!0},p(e,t){const i={};4&t[0]&&(i.group=e[2]),n.$set(i);const o={};4&t[0]&&(o.group=e[2]),r.$set(o);const u={};4&t[0]&&(u.group=e[2]),l.$set(u)},i(e){u||(it(n.$$.fragment,e),it(r.$$.fragment,e),it(l.$$.fragment,e),u=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),rt(l.$$.fragment,e),u=!1},d(e){e&&we(t),ct(n),ct(r),ct(l)}}}function er(e){let t,n,i,r,o,l,u,s;return o=new Ji({props:{value:e[4]}}),o.$on("change",e[29]),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-gap"),n.value=e[3],Fe(r,"class","input-addon_end"),Fe(t,"class","input-group")},m(a,c){Be(a,t,c),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0,u||(s=Ae(n,"input",e[28]),u=!0)},p(e,t){(!l||8&t[0]&&n.value!==e[3])&&(n.value=e[3]);const i={};16&t[0]&&(i.value=e[4]),o.$set(i)},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o),u=!1,s()}}}function tr(e){let t,n,i,r,o,l,u,s;return t=new ki({props:{horizontal:!0,label:"Direction",$$slots:{default:[Zi]},$$scope:{ctx:e}}}),i=new ki({props:{horizontal:!0,label:"Justify",$$slots:{default:[Ki]},$$scope:{ctx:e}}}),o=new ki({props:{horizontal:!0,label:"Align",$$slots:{default:[Qi]},$$scope:{ctx:e}}}),u=new Li({props:{horizontal:!0,label:"Gap",labelFor:"container-props-gap",$$slots:{default:[er]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment),r=De(),st(o.$$.fragment),l=De(),st(u.$$.fragment)},m(e,a){at(t,e,a),Be(e,n,a),at(i,e,a),Be(e,r,a),at(o,e,a),Be(e,l,a),at(u,e,a),s=!0},p(e,n){const r={};1&n[0]|4194304&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};2&n[0]|4194304&n[1]&&(l.$$scope={dirty:n,ctx:e}),i.$set(l);const s={};4&n[0]|4194304&n[1]&&(s.$$scope={dirty:n,ctx:e}),o.$set(s);const a={};24&n[0]|4194304&n[1]&&(a.$$scope={dirty:n,ctx:e}),u.$set(a)},i(e){s||(it(t.$$.fragment,e),it(i.$$.fragment,e),it(o.$$.fragment,e),it(u.$$.fragment,e),s=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),rt(o.$$.fragment,e),rt(u.$$.fragment,e),s=!1},d(e){ct(t,e),e&&we(n),ct(i,e),e&&we(r),ct(o,e),e&&we(l),ct(u,e)}}}function nr(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C,B,w,y,b,D,E,A,F,_,k,T,N,V,P,U;return s=new Ji({props:{value:e[6]}}),s.$on("change",e[31]),m=new Ji({props:{value:e[8]}}),m.$on("change",e[33]),b=new Ji({props:{value:e[10]}}),b.$on("change",e[35]),N=new Ji({props:{value:e[12]}}),N.$on("change",e[37]),{c(){t=ye("div"),n=ye("div"),i=ye("label"),i.textContent="margin top",r=De(),o=ye("input"),l=De(),u=ye("div"),st(s.$$.fragment),a=De(),c=ye("div"),d=ye("label"),d.textContent="margin right",f=De(),p=ye("input"),h=De(),g=ye("div"),st(m.$$.fragment),$=De(),x=ye("div"),v=ye("label"),v.textContent="margin bottom",C=De(),B=ye("input"),w=De(),y=ye("div"),st(b.$$.fragment),D=De(),E=ye("div"),A=ye("label"),A.textContent="margin left",F=De(),_=ye("input"),k=De(),T=ye("div"),st(N.$$.fragment),Fe(i,"class","assistive-text"),Fe(i,"for","container-props-margin-top"),Fe(o,"class","input"),Fe(o,"id","container-props-margin-top"),o.value=e[5],Fe(u,"class","input-addon_end"),Fe(n,"class","input-dimension"),Fe(d,"class","assistive-text"),Fe(d,"for","container-props-margin-right"),Fe(p,"class","input"),Fe(p,"id","container-props-margin-right"),p.value=e[7],Fe(g,"class","input-addon_end"),Fe(c,"class","input-dimension"),Fe(v,"class","assistive-text"),Fe(v,"for","container-props-margin-bottom"),Fe(B,"class","input"),Fe(B,"id","container-props-margin-bottom"),B.value=e[9],Fe(y,"class","input-addon_end"),Fe(x,"class","input-dimension"),Fe(A,"class","assistive-text"),Fe(A,"for","container-props-margin-left"),Fe(_,"class","input"),Fe(_,"id","container-props-margin-left"),_.value=e[11],Fe(T,"class","input-addon_end"),Fe(E,"class","input-dimension"),Fe(t,"class","input-group-dimensions")},m(L,R){Be(L,t,R),Ce(t,n),Ce(n,i),Ce(n,r),Ce(n,o),Ce(n,l),Ce(n,u),at(s,u,null),Ce(t,a),Ce(t,c),Ce(c,d),Ce(c,f),Ce(c,p),Ce(c,h),Ce(c,g),at(m,g,null),Ce(t,$),Ce(t,x),Ce(x,v),Ce(x,C),Ce(x,B),Ce(x,w),Ce(x,y),at(b,y,null),Ce(t,D),Ce(t,E),Ce(E,A),Ce(E,F),Ce(E,_),Ce(E,k),Ce(E,T),at(N,T,null),V=!0,P||(U=[Ae(o,"input",e[30]),Ae(p,"input",e[32]),Ae(B,"input",e[34]),Ae(_,"input",e[36])],P=!0)},p(e,t){(!V||32&t[0]&&o.value!==e[5])&&(o.value=e[5]);const n={};64&t[0]&&(n.value=e[6]),s.$set(n),(!V||128&t[0]&&p.value!==e[7])&&(p.value=e[7]);const i={};256&t[0]&&(i.value=e[8]),m.$set(i),(!V||512&t[0]&&B.value!==e[9])&&(B.value=e[9]);const r={};1024&t[0]&&(r.value=e[10]),b.$set(r),(!V||2048&t[0]&&_.value!==e[11])&&(_.value=e[11]);const l={};4096&t[0]&&(l.value=e[12]),N.$set(l)},i(e){V||(it(s.$$.fragment,e),it(m.$$.fragment,e),it(b.$$.fragment,e),it(N.$$.fragment,e),V=!0)},o(e){rt(s.$$.fragment,e),rt(m.$$.fragment,e),rt(b.$$.fragment,e),rt(N.$$.fragment,e),V=!1},d(e){e&&we(t),ct(s),ct(m),ct(b),ct(N),P=!1,oe(U)}}}function ir(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C,B,w,y,b,D,E,A,F,_,k,T,N,V,P,U;return s=new Ji({props:{value:e[14]}}),s.$on("change",e[39]),m=new Ji({props:{value:e[16]}}),m.$on("change",e[41]),b=new Ji({props:{value:e[18]}}),b.$on("change",e[43]),N=new Ji({props:{value:e[20]}}),N.$on("change",e[45]),{c(){t=ye("div"),n=ye("div"),i=ye("label"),i.textContent="padding top",r=De(),o=ye("input"),l=De(),u=ye("div"),st(s.$$.fragment),a=De(),c=ye("div"),d=ye("label"),d.textContent="padding right",f=De(),p=ye("input"),h=De(),g=ye("div"),st(m.$$.fragment),$=De(),x=ye("div"),v=ye("label"),v.textContent="padding bottom",C=De(),B=ye("input"),w=De(),y=ye("div"),st(b.$$.fragment),D=De(),E=ye("div"),A=ye("label"),A.textContent="padding left",F=De(),_=ye("input"),k=De(),T=ye("div"),st(N.$$.fragment),Fe(i,"class","assistive-text"),Fe(i,"for","container-props-padding-top"),Fe(o,"class","input"),Fe(o,"id","container-props-padding-top"),o.value=e[13],Fe(u,"class","input-addon_end"),Fe(n,"class","input-dimension"),Fe(d,"class","assistive-text"),Fe(d,"for","container-props-padding-right"),Fe(p,"class","input"),Fe(p,"id","container-props-padding-right"),p.value=e[15],Fe(g,"class","input-addon_end"),Fe(c,"class","input-dimension"),Fe(v,"class","assistive-text"),Fe(v,"for","container-props-padding-bottom"),Fe(B,"class","input"),Fe(B,"id","container-props-padding-bottom"),B.value=e[17],Fe(y,"class","input-addon_end"),Fe(x,"class","input-dimension"),Fe(A,"class","assistive-text"),Fe(A,"for","container-props-padding-left"),Fe(_,"class","input"),Fe(_,"id","container-props-padding-left"),_.value=e[19],Fe(T,"class","input-addon_end"),Fe(E,"class","input-dimension"),Fe(t,"class","input-group-dimensions")},m(L,R){Be(L,t,R),Ce(t,n),Ce(n,i),Ce(n,r),Ce(n,o),Ce(n,l),Ce(n,u),at(s,u,null),Ce(t,a),Ce(t,c),Ce(c,d),Ce(c,f),Ce(c,p),Ce(c,h),Ce(c,g),at(m,g,null),Ce(t,$),Ce(t,x),Ce(x,v),Ce(x,C),Ce(x,B),Ce(x,w),Ce(x,y),at(b,y,null),Ce(t,D),Ce(t,E),Ce(E,A),Ce(E,F),Ce(E,_),Ce(E,k),Ce(E,T),at(N,T,null),V=!0,P||(U=[Ae(o,"input",e[38]),Ae(p,"input",e[40]),Ae(B,"input",e[42]),Ae(_,"input",e[44])],P=!0)},p(e,t){(!V||8192&t[0]&&o.value!==e[13])&&(o.value=e[13]);const n={};16384&t[0]&&(n.value=e[14]),s.$set(n),(!V||32768&t[0]&&p.value!==e[15])&&(p.value=e[15]);const i={};65536&t[0]&&(i.value=e[16]),m.$set(i),(!V||131072&t[0]&&B.value!==e[17])&&(B.value=e[17]);const r={};262144&t[0]&&(r.value=e[18]),b.$set(r),(!V||524288&t[0]&&_.value!==e[19])&&(_.value=e[19]);const l={};1048576&t[0]&&(l.value=e[20]),N.$set(l)},i(e){V||(it(s.$$.fragment,e),it(m.$$.fragment,e),it(b.$$.fragment,e),it(N.$$.fragment,e),V=!0)},o(e){rt(s.$$.fragment,e),rt(m.$$.fragment,e),rt(b.$$.fragment,e),rt(N.$$.fragment,e),V=!1},d(e){e&&we(t),ct(s),ct(m),ct(b),ct(N),P=!1,oe(U)}}}function rr(e){let t,n,i,r,o,l,u,s;return o=new Ji({props:{value:e[22]}}),o.$on("change",e[47]),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-width"),n.value=e[21],Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(a,c){Be(a,t,c),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0,u||(s=Ae(n,"input",e[46]),u=!0)},p(e,t){(!l||2097152&t[0]&&n.value!==e[21])&&(n.value=e[21]);const i={};4194304&t[0]&&(i.value=e[22]),o.$set(i)},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o),u=!1,s()}}}function or(e){let t,n,i,r,o,l;return o=new Ji({}),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-min-width"),Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(e,u){Be(e,t,u),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o)}}}function lr(e){let t,n,i,r,o,l;return o=new Ji({}),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-max-width"),Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(e,u){Be(e,t,u),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o)}}}function ur(e){let t,n,i,r,o,l,u,s;return o=new Ji({props:{value:e[24]}}),o.$on("change",e[49]),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-height"),n.value=e[23],Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(a,c){Be(a,t,c),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0,u||(s=Ae(n,"input",e[48]),u=!0)},p(e,t){(!l||8388608&t[0]&&n.value!==e[23])&&(n.value=e[23]);const i={};16777216&t[0]&&(i.value=e[24]),o.$set(i)},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o),u=!1,s()}}}function sr(e){let t,n,i,r,o,l;return o=new Ji({}),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-min-height"),Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(e,u){Be(e,t,u),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o)}}}function ar(e){let t,n,i,r,o,l;return o=new Ji({}),{c(){t=ye("div"),n=ye("input"),i=De(),r=ye("div"),st(o.$$.fragment),Fe(n,"class","input"),Fe(n,"id","container-props-max-height"),Fe(r,"class","input-addon_end"),Fe(t,"class","input-dimension")},m(e,u){Be(e,t,u),Ce(t,n),Ce(t,i),Ce(t,r),at(o,r,null),l=!0},i(e){l||(it(o.$$.fragment,e),l=!0)},o(e){rt(o.$$.fragment,e),l=!1},d(e){e&&we(t),ct(o)}}}function cr(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m;return t=new ki({props:{label:"Margin",$$slots:{default:[nr]},$$scope:{ctx:e}}}),i=new ki({props:{label:"Padding",$$slots:{default:[ir]},$$scope:{ctx:e}}}),o=new Li({props:{horizontal:!0,label:"Width",labelFor:"container-props-width",$$slots:{default:[rr]},$$scope:{ctx:e}}}),u=new Li({props:{horizontal:!0,label:"Min width",labelFor:"container-props-min-width",$$slots:{default:[or]},$$scope:{ctx:e}}}),a=new Li({props:{horizontal:!0,label:"Max width",labelFor:"container-props-max-width",$$slots:{default:[lr]},$$scope:{ctx:e}}}),d=new Li({props:{horizontal:!0,label:"Height",labelFor:"container-props-height",$$slots:{default:[ur]},$$scope:{ctx:e}}}),p=new Li({props:{horizontal:!0,label:"Height",labelFor:"container-props-min-height",$$slots:{default:[sr]},$$scope:{ctx:e}}}),g=new Li({props:{horizontal:!0,label:"Height",labelFor:"container-props-max-height",$$slots:{default:[ar]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment),r=De(),st(o.$$.fragment),l=De(),st(u.$$.fragment),s=De(),st(a.$$.fragment),c=De(),st(d.$$.fragment),f=De(),st(p.$$.fragment),h=De(),st(g.$$.fragment)},m(e,$){at(t,e,$),Be(e,n,$),at(i,e,$),Be(e,r,$),at(o,e,$),Be(e,l,$),at(u,e,$),Be(e,s,$),at(a,e,$),Be(e,c,$),at(d,e,$),Be(e,f,$),at(p,e,$),Be(e,h,$),at(g,e,$),m=!0},p(e,n){const r={};8160&n[0]|4194304&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};2088960&n[0]|4194304&n[1]&&(l.$$scope={dirty:n,ctx:e}),i.$set(l);const s={};6291456&n[0]|4194304&n[1]&&(s.$$scope={dirty:n,ctx:e}),o.$set(s);const c={};4194304&n[1]&&(c.$$scope={dirty:n,ctx:e}),u.$set(c);const f={};4194304&n[1]&&(f.$$scope={dirty:n,ctx:e}),a.$set(f);const h={};25165824&n[0]|4194304&n[1]&&(h.$$scope={dirty:n,ctx:e}),d.$set(h);const m={};4194304&n[1]&&(m.$$scope={dirty:n,ctx:e}),p.$set(m);const $={};4194304&n[1]&&($.$$scope={dirty:n,ctx:e}),g.$set($)},i(e){m||(it(t.$$.fragment,e),it(i.$$.fragment,e),it(o.$$.fragment,e),it(u.$$.fragment,e),it(a.$$.fragment,e),it(d.$$.fragment,e),it(p.$$.fragment,e),it(g.$$.fragment,e),m=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),rt(o.$$.fragment,e),rt(u.$$.fragment,e),rt(a.$$.fragment,e),rt(d.$$.fragment,e),rt(p.$$.fragment,e),rt(g.$$.fragment,e),m=!1},d(e){ct(t,e),e&&we(n),ct(i,e),e&&we(r),ct(o,e),e&&we(l),ct(u,e),e&&we(s),ct(a,e),e&&we(c),ct(d,e),e&&we(f),ct(p,e),e&&we(h),ct(g,e)}}}function dr(e){let t;return{c(){t=be("Background")},m(e,n){Be(e,t,n)},d(e){e&&we(t)}}}function fr(e){let t,n,i,r;return t=new Yi({props:{summary:"Layout",expanded:!0,$$slots:{default:[cr]},$$scope:{ctx:e}}}),i=new Yi({props:{summary:"Background",$$slots:{default:[dr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment)},m(e,o){at(t,e,o),Be(e,n,o),at(i,e,o),r=!0},p(e,n){const r={};33554400&n[0]|4194304&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const o={};4194304&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o)},i(e){r||(it(t.$$.fragment,e),it(i.$$.fragment,e),r=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),r=!1},d(e){ct(t,e),e&&we(n),ct(i,e)}}}function pr(e){let t,n;return t=new zi({props:{$$slots:{default:[fr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p(e,n){const i={};33554400&n[0]|4194304&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function hr(e){let t,n,i,r;return t=new bi({props:{label:"Container",$$slots:{default:[tr]},$$scope:{ctx:e}}}),i=new bi({props:{label:"Style",$$slots:{default:[pr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment)},m(e,o){at(t,e,o),Be(e,n,o),at(i,e,o),r=!0},p(e,n){const r={};31&n[0]|4194304&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const o={};33554400&n[0]|4194304&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o)},i(e){r||(it(t.$$.fragment,e),it(i.$$.fragment,e),r=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),r=!1},d(e){ct(t,e),e&&we(n),ct(i,e)}}}function gr(e){let t,n;return t=new Bi({props:{class:"container-props",$$slots:{default:[hr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p(e,n){const i={};33554431&n[0]|4194304&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function mr(e,t,n){let{view:i}=t,{path:r}=t,{flexDirection:o=ci.flexDirection}=t,{flexJustify:l=ci.flexJustify}=t,{flexAlign:u=ci.flexAlign}=t,{flexGapValue:s=ci.flexGapValue}=t,{flexGapUnit:a=ci.flexGapUnit}=t,{marginTopValue:c=ci.marginTopValue}=t,{marginTopUnit:d=ci.marginTopUnit}=t,{marginRightValue:f=ci.marginRightValue}=t,{marginRightUnit:p=ci.marginRightUnit}=t,{marginBottomValue:h=ci.marginBottomValue}=t,{marginBottomUnit:g=ci.marginBottomUnit}=t,{marginLeftValue:m=ci.marginLeftValue}=t,{marginLeftUnit:$=ci.marginLeftUnit}=t,{paddingTopValue:x=ci.paddingTopValue}=t,{paddingTopUnit:v=ci.paddingTopUnit}=t,{paddingRightValue:C=ci.paddingRightValue}=t,{paddingRightUnit:B=ci.paddingRightUnit}=t,{paddingBottomValue:w=ci.paddingBottomValue}=t,{paddingBottomUnit:y=ci.paddingBottomUnit}=t,{paddingLeftValue:b=ci.paddingLeftValue}=t,{paddingLeftUnit:D=ci.paddingLeftUnit}=t,{widthValue:E=ci.widthValue}=t,{widthUnit:F=ci.widthUnit}=t,{heightValue:_=ci.heightValue}=t,{heightUnit:k=ci.heightUnit}=t,T=e=>t=>{let n=t.target.value,o=e(n),l=new A(i.builder);l.setNode(o,{at:r()}),i.apply(l)},N=T((e=>({flexDirection:e}))),V=T((e=>({flexJustify:e}))),P=T((e=>({flexAlign:e}))),U=Hi(T((e=>({flexGapValue:e})))),L=T((e=>({flexGapUnit:e}))),R=Hi(T((e=>({marginTopValue:e})))),O=T((e=>({marginTopUnit:e}))),S=Hi(T((e=>({marginRightValue:e})))),q=T((e=>({marginRightUnit:e}))),M=Hi(T((e=>({marginBottomValue:e})))),I=T((e=>({marginBottomUnit:e}))),z=Hi(T((e=>({marginLeftValue:e})))),j=T((e=>({marginLeftUnit:e}))),X=Hi(T((e=>({paddingTopValue:e})))),Y=T((e=>({paddingTopUnit:e}))),H=Hi(T((e=>({paddingRightValue:e})))),G=T((e=>({paddingRightUnit:e}))),W=Hi(T((e=>({paddingBottomValue:e})))),J=T((e=>({paddingBottomUnit:e}))),Z=Hi(T((e=>({paddingLeftValue:e})))),K=T((e=>({paddingLeftUnit:e}))),Q=Hi(T((e=>({widthValue:e})))),ee=T((e=>({widthUnit:e}))),te=Hi(T((e=>({heightValue:e})))),ne=T((e=>({heightUnit:e})));return e.$$set=e=>{"view"in e&&n(50,i=e.view),"path"in e&&n(51,r=e.path),"flexDirection"in e&&n(0,o=e.flexDirection),"flexJustify"in e&&n(1,l=e.flexJustify),"flexAlign"in e&&n(2,u=e.flexAlign),"flexGapValue"in e&&n(3,s=e.flexGapValue),"flexGapUnit"in e&&n(4,a=e.flexGapUnit),"marginTopValue"in e&&n(5,c=e.marginTopValue),"marginTopUnit"in e&&n(6,d=e.marginTopUnit),"marginRightValue"in e&&n(7,f=e.marginRightValue),"marginRightUnit"in e&&n(8,p=e.marginRightUnit),"marginBottomValue"in e&&n(9,h=e.marginBottomValue),"marginBottomUnit"in e&&n(10,g=e.marginBottomUnit),"marginLeftValue"in e&&n(11,m=e.marginLeftValue),"marginLeftUnit"in e&&n(12,$=e.marginLeftUnit),"paddingTopValue"in e&&n(13,x=e.paddingTopValue),"paddingTopUnit"in e&&n(14,v=e.paddingTopUnit),"paddingRightValue"in e&&n(15,C=e.paddingRightValue),"paddingRightUnit"in e&&n(16,B=e.paddingRightUnit),"paddingBottomValue"in e&&n(17,w=e.paddingBottomValue),"paddingBottomUnit"in e&&n(18,y=e.paddingBottomUnit),"paddingLeftValue"in e&&n(19,b=e.paddingLeftValue),"paddingLeftUnit"in e&&n(20,D=e.paddingLeftUnit),"widthValue"in e&&n(21,E=e.widthValue),"widthUnit"in e&&n(22,F=e.widthUnit),"heightValue"in e&&n(23,_=e.heightValue),"heightUnit"in e&&n(24,k=e.heightUnit)},[o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C,B,w,y,b,D,E,F,_,k,N,V,P,U,L,R,O,S,q,M,I,z,j,X,Y,H,G,W,J,Z,K,Q,ee,te,ne,i,r]}class $r extends ft{constructor(e){super(),dt(this,e,mr,gr,ue,{view:50,path:51,flexDirection:0,flexJustify:1,flexAlign:2,flexGapValue:3,flexGapUnit:4,marginTopValue:5,marginTopUnit:6,marginRightValue:7,marginRightUnit:8,marginBottomValue:9,marginBottomUnit:10,marginLeftValue:11,marginLeftUnit:12,paddingTopValue:13,paddingTopUnit:14,paddingRightValue:15,paddingRightUnit:16,paddingBottomValue:17,paddingBottomUnit:18,paddingLeftValue:19,paddingLeftUnit:20,widthValue:21,widthUnit:22,heightValue:23,heightUnit:24},null,[-1,-1])}}function xr(e,t){let n,i;function r(){null!=i&&(i.destroy(),i=void 0)}return{render:i=>(n=_(pi,{view:e,path:t,...i}),{domNode:n.domNode,slotDomNode:n.slotDomNode}),update(e){n.$set({...e}),null!=i&&i.component.$set({...e})},destroy(){n.$destroy(),n=void 0,r()},hover(){n.$set({hovered:!0})},dehover(){n.$set({hovered:!1})},select(r){n.$set({selected:!0}),i=qn($r,{view:e,path:t,...r})},deselect(){n.$set({selected:!1}),r()}}}const vr={label:"I am a button",size:"small",fill:"solid",corner:"square"};function Cr(e){let t,n,i,r,o,l,u;return{c(){t=ye("div"),n=ye("span"),i=be(e[3]),r=De(),o=ye("div"),Fe(n,"class","f-button__content"),Fe(o,"class",l=In("outline",{hovered:e[2],selected:e[1]})),Fe(t,"class",u=In(e[7],"f-button",{"f-button_small":"small"==e[4],"f-button_medium":"medium"==e[4],"f-button_large":"large"==e[4],"f-button_solid":"solid"==e[5],"f-button_outline":"outline"==e[5],"f-button_square":"square"==e[6],"f-button_round":"round"==e[6]}))},m(l,u){Be(l,t,u),Ce(t,n),Ce(n,i),Ce(t,r),Ce(t,o),e[8](t)},p(e,[n]){8&n&&_e(i,e[3]),6&n&&l!==(l=In("outline",{hovered:e[2],selected:e[1]}))&&Fe(o,"class",l),112&n&&u!==(u=In(e[7],"f-button",{"f-button_small":"small"==e[4],"f-button_medium":"medium"==e[4],"f-button_large":"large"==e[4],"f-button_solid":"solid"==e[5],"f-button_outline":"outline"==e[5],"f-button_square":"square"==e[6],"f-button_round":"round"==e[6]}))&&Fe(t,"class",u)},i:te,o:te,d(n){n&&we(t),e[8](null)}}}function Br(e,t,n){let{domNode:i}=t,{selected:r}=t,{hovered:o}=t,{label:l=vr.label}=t,{size:u=vr.size}=t,{fill:s=vr.fill}=t,{corner:a=vr.corner}=t,c=zn.shortid();return e.$$set=e=>{"domNode"in e&&n(0,i=e.domNode),"selected"in e&&n(1,r=e.selected),"hovered"in e&&n(2,o=e.hovered),"label"in e&&n(3,l=e.label),"size"in e&&n(4,u=e.size),"fill"in e&&n(5,s=e.fill),"corner"in e&&n(6,a=e.corner)},[i,r,o,l,u,s,a,c,function(e){Me[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class wr extends ft{constructor(e){super(),dt(this,e,Br,Cr,ue,{domNode:0,selected:1,hovered:2,label:3,size:4,fill:5,corner:6})}get domNode(){return this.$$.ctx[0]}set domNode(e){this.$$set({domNode:e}),Ze()}get selected(){return this.$$.ctx[1]}set selected(e){this.$$set({selected:e}),Ze()}get hovered(){return this.$$.ctx[2]}set hovered(e){this.$$set({hovered:e}),Ze()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),Ze()}get size(){return this.$$.ctx[4]}set size(e){this.$$set({size:e}),Ze()}get fill(){return this.$$.ctx[5]}set fill(e){this.$$set({fill:e}),Ze()}get corner(){return this.$$.ctx[6]}set corner(e){this.$$set({corner:e}),Ze()}}function yr(e){let t,n,i;return{c(){t=ye("input"),Fe(t,"class","input"),Fe(t,"type","text"),Fe(t,"id","button-props-label"),t.value=e[0]},m(r,o){Be(r,t,o),n||(i=Ae(t,"input",e[4]),n=!0)},p(e,n){1&n&&t.value!==e[0]&&(t.value=e[0])},d(e){e&&we(t),n=!1,i()}}}function br(e){let t,n,i,r,o,l,u;return n=new Si({props:{label:"S",value:"small",id:"button-props-size_small",group:e[1]}}),n.$on("change",e[5]),r=new Si({props:{label:"M",value:"medium",id:"button-props-size_medium",group:e[1]}}),r.$on("change",e[5]),l=new Si({props:{label:"L",value:"large",id:"button-props-size_large",group:e[1]}}),l.$on("change",e[5]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),o=De(),st(l.$$.fragment),Fe(t,"class","radio_button-group")},m(e,s){Be(e,t,s),at(n,t,null),Ce(t,i),at(r,t,null),Ce(t,o),at(l,t,null),u=!0},p(e,t){const i={};2&t&&(i.group=e[1]),n.$set(i);const o={};2&t&&(o.group=e[1]),r.$set(o);const u={};2&t&&(u.group=e[1]),l.$set(u)},i(e){u||(it(n.$$.fragment,e),it(r.$$.fragment,e),it(l.$$.fragment,e),u=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),rt(l.$$.fragment,e),u=!1},d(e){e&&we(t),ct(n),ct(r),ct(l)}}}function Dr(e){let t,n,i,r,o;return n=new Si({props:{label:"Solid",value:"solid",id:"button-props-fill_solid",group:e[2]}}),n.$on("change",e[6]),r=new Si({props:{label:"Outline",value:"outline",id:"button-props-fill_outline",group:e[2]}}),r.$on("change",e[6]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),Fe(t,"class","radio_button-group")},m(e,l){Be(e,t,l),at(n,t,null),Ce(t,i),at(r,t,null),o=!0},p(e,t){const i={};4&t&&(i.group=e[2]),n.$set(i);const o={};4&t&&(o.group=e[2]),r.$set(o)},i(e){o||(it(n.$$.fragment,e),it(r.$$.fragment,e),o=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),o=!1},d(e){e&&we(t),ct(n),ct(r)}}}function Er(e){let t,n,i,r,o;return n=new Si({props:{label:"Square",value:"square",id:"button-props-corner_square",group:e[3]}}),n.$on("change",e[7]),r=new Si({props:{label:"Round",value:"round",id:"button-props-corner_round",group:e[3]}}),r.$on("change",e[7]),{c(){t=ye("div"),st(n.$$.fragment),i=De(),st(r.$$.fragment),Fe(t,"class","radio_button-group")},m(e,l){Be(e,t,l),at(n,t,null),Ce(t,i),at(r,t,null),o=!0},p(e,t){const i={};8&t&&(i.group=e[3]),n.$set(i);const o={};8&t&&(o.group=e[3]),r.$set(o)},i(e){o||(it(n.$$.fragment,e),it(r.$$.fragment,e),o=!0)},o(e){rt(n.$$.fragment,e),rt(r.$$.fragment,e),o=!1},d(e){e&&we(t),ct(n),ct(r)}}}function Ar(e){let t,n,i,r,o,l,u,s;return t=new Li({props:{horizontal:!0,label:"Label",labelFor:"button-props-label",$$slots:{default:[yr]},$$scope:{ctx:e}}}),i=new ki({props:{horizontal:!0,label:"Size",$$slots:{default:[br]},$$scope:{ctx:e}}}),o=new ki({props:{horizontal:!0,label:"Fill",$$slots:{default:[Dr]},$$scope:{ctx:e}}}),u=new ki({props:{horizontal:!0,label:"Corner",$$slots:{default:[Er]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment),r=De(),st(o.$$.fragment),l=De(),st(u.$$.fragment)},m(e,a){at(t,e,a),Be(e,n,a),at(i,e,a),Be(e,r,a),at(o,e,a),Be(e,l,a),at(u,e,a),s=!0},p(e,n){const r={};2049&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};2050&n&&(l.$$scope={dirty:n,ctx:e}),i.$set(l);const s={};2052&n&&(s.$$scope={dirty:n,ctx:e}),o.$set(s);const a={};2056&n&&(a.$$scope={dirty:n,ctx:e}),u.$set(a)},i(e){s||(it(t.$$.fragment,e),it(i.$$.fragment,e),it(o.$$.fragment,e),it(u.$$.fragment,e),s=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),rt(o.$$.fragment,e),rt(u.$$.fragment,e),s=!1},d(e){ct(t,e),e&&we(n),ct(i,e),e&&we(r),ct(o,e),e&&we(l),ct(u,e)}}}function Fr(e){let t,n,i,r;return t=new bi({props:{label:"Button",$$slots:{default:[Ar]},$$scope:{ctx:e}}}),i=new bi({props:{label:"Style"}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment)},m(e,o){at(t,e,o),Be(e,n,o),at(i,e,o),r=!0},p(e,n){const i={};2063&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){r||(it(t.$$.fragment,e),it(i.$$.fragment,e),r=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),r=!1},d(e){ct(t,e),e&&we(n),ct(i,e)}}}function _r(e){let t,n;return t=new Bi({props:{class:"button-props",$$slots:{default:[Fr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p(e,[n]){const i={};2063&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function kr(e,t,n){let{view:i}=t,{path:r}=t,{label:o=vr.label}=t,{size:l=vr.size}=t,{fill:u=vr.fill}=t,{corner:s=vr.corner}=t,a=e=>t=>{let n=t.target.value,o=e(n),l=new A(i.builder);l.setNode(o,{at:r()}),i.apply(l)},c=a((e=>({label:e}))),d=a((e=>({size:e}))),f=a((e=>({fill:e}))),p=a((e=>({corner:e})));return e.$$set=e=>{"view"in e&&n(8,i=e.view),"path"in e&&n(9,r=e.path),"label"in e&&n(0,o=e.label),"size"in e&&n(1,l=e.size),"fill"in e&&n(2,u=e.fill),"corner"in e&&n(3,s=e.corner)},[o,l,u,s,c,d,f,p,i,r]}class Tr extends ft{constructor(e){super(),dt(this,e,kr,_r,ue,{view:8,path:9,label:0,size:1,fill:2,corner:3})}}function Nr(e,t){let n,i;function r(){null!=i&&(i.destroy(),i=void 0)}return{render:i=>(n=_(wr,{view:e,path:t,...i}),{domNode:n.domNode}),update(e){n.$set({...e}),null!=i&&i.component.$set({...e})},destroy(){n.$destroy(),n=void 0,r()},hover(){n.$set({hovered:!0})},dehover(){n.$set({hovered:!1})},select(r){n.$set({selected:!0}),i=qn(Tr,{view:e,path:t,...r})},deselect(){n.$set({selected:!1}),r()}}}let Vr={src:"",alt:""};function Pr(e){let t,n;return{c(){t=ye("img"),ce(t.src,n=e[3])||Fe(t,"src",n),Fe(t,"alt",e[4])},m(e,n){Be(e,t,n)},p(e,i){8&i&&!ce(t.src,n=e[3])&&Fe(t,"src",n),16&i&&Fe(t,"alt",e[4])},i:te,o:te,d(e){e&&we(t)}}}function Ur(e){let t,n;return t=new gt({props:{class:"placeholder",name:"image"}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p:te,i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function Lr(e){let t,n,i,r,o,l,u;const s=[Ur,Pr],a=[];function c(e,t){return e[3]?1:0}return n=c(e),i=a[n]=s[n](e),{c(){t=ye("div"),i.c(),r=De(),o=ye("div"),Fe(o,"class",l=In("outline",{hovered:e[2],selected:e[1]})),Fe(t,"class",In(e[5],"f-image"))},m(i,l){Be(i,t,l),a[n].m(t,null),Ce(t,r),Ce(t,o),e[6](t),u=!0},p(e,[d]){let f=n;n=c(e),n===f?a[n].p(e,d):(tt(),rt(a[f],1,1,(()=>{a[f]=null})),nt(),i=a[n],i?i.p(e,d):(i=a[n]=s[n](e),i.c()),it(i,1),i.m(t,r)),(!u||6&d&&l!==(l=In("outline",{hovered:e[2],selected:e[1]})))&&Fe(o,"class",l)},i(e){u||(it(i),u=!0)},o(e){rt(i),u=!1},d(i){i&&we(t),a[n].d(),e[6](null)}}}function Rr(e,t,n){let{domNode:i}=t,{selected:r=!1}=t,{hovered:o=!1}=t,{src:l=Vr.src}=t,{alt:u=Vr.alt}=t,s=zn.shortid();return e.$$set=e=>{"domNode"in e&&n(0,i=e.domNode),"selected"in e&&n(1,r=e.selected),"hovered"in e&&n(2,o=e.hovered),"src"in e&&n(3,l=e.src),"alt"in e&&n(4,u=e.alt)},[i,r,o,l,u,s,function(e){Me[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Or extends ft{constructor(e){super(),dt(this,e,Rr,Lr,ue,{domNode:0,selected:1,hovered:2,src:3,alt:4})}get domNode(){return this.$$.ctx[0]}set domNode(e){this.$$set({domNode:e}),Ze()}get selected(){return this.$$.ctx[1]}set selected(e){this.$$set({selected:e}),Ze()}get hovered(){return this.$$.ctx[2]}set hovered(e){this.$$set({hovered:e}),Ze()}get src(){return this.$$.ctx[3]}set src(e){this.$$set({src:e}),Ze()}get alt(){return this.$$.ctx[4]}set alt(e){this.$$set({alt:e}),Ze()}}function Sr(e){let t,n,i;return{c(){t=ye("input"),Fe(t,"class","input"),Fe(t,"type","text"),Fe(t,"id","image-props-src"),t.value=e[0]},m(r,o){Be(r,t,o),n||(i=Ae(t,"input",e[1]),n=!0)},p(e,n){1&n&&t.value!==e[0]&&(t.value=e[0])},d(e){e&&we(t),n=!1,i()}}}function qr(e){let t,n;return t=new Li({props:{horizontal:!0,label:"URL",labelFor:"image-props-src",$$slots:{default:[Sr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p(e,n){const i={};33&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function Mr(e){let t,n,i,r;return t=new bi({props:{label:"Image",$$slots:{default:[qr]},$$scope:{ctx:e}}}),i=new bi({props:{label:"Style"}}),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment)},m(e,o){at(t,e,o),Be(e,n,o),at(i,e,o),r=!0},p(e,n){const i={};33&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){r||(it(t.$$.fragment,e),it(i.$$.fragment,e),r=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),r=!1},d(e){ct(t,e),e&&we(n),ct(i,e)}}}function Ir(e){let t,n;return t=new Bi({props:{class:"button-props",$$slots:{default:[Mr]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},m(e,i){at(t,e,i),n=!0},p(e,[n]){const i={};33&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(it(t.$$.fragment,e),n=!0)},o(e){rt(t.$$.fragment,e),n=!1},d(e){ct(t,e)}}}function zr(e,t,n){let{view:i}=t,{path:r}=t,{src:o=Vr.src}=t,l=(u=e=>({src:e}),e=>{let t=e.target.value,n=u(t),o=new A(i.builder);o.setNode(n,{at:r()}),i.apply(o)});var u;return e.$$set=e=>{"view"in e&&n(2,i=e.view),"path"in e&&n(3,r=e.path),"src"in e&&n(0,o=e.src)},[o,l,i,r]}class jr extends ft{constructor(e){super(),dt(this,e,zr,Ir,ue,{view:2,path:3,src:0})}}function Xr(e,t){let n,i;function r(){null!=i&&(i.destroy(),i=void 0)}return{render:i=>(n=_(Or,{view:e,path:t,...i}),{domNode:n.domNode}),update(e){n.$set({...e}),null!=i&&i.component.$set({...e})},destroy(){n.$destroy(),n=void 0,r()},hover(){n.$set({hovered:!0})},dehover(){n.$set({hovered:!1})},select(r){n.$set({selected:!0}),i=qn(jr,{view:e,path:t,...r})},deselect(){n.$set({selected:!1}),r()}}}const Yr={root:[],isPath:e=>Array.isArray(e)&&e.every((e=>"number"==typeof e)),isRoot:e=>0==e.length,compare(e,t){let n=Math.min(e.length,t.length);for(let i=0;i<n;i+=1){if(e[i]<t[i])return-1;if(e[i]>t[i])return 1}return 0},equal:(e,t)=>0==Yr.compare(e,t)&&e.length==t.length,isAncestor:(e,t)=>0==Yr.compare(e,t)&&e.length<t.length,isDescendant:(e,t)=>0==Yr.compare(e,t)&&e.length>t.length,isSibling(e,t){let n=e.length;return e.length==t.length&&Yr.equal(e.slice(0,-1),t.slice(0,-1))&&e[n-1]!=t[n-1]},endBefore(e,t){let n=e.length-1;return Yr.equal(e.slice(0,n),t.slice(0,n))&&e[n]<t[n]},endAt(e,t){let n=e.length;return Yr.equal(e.slice(0,n),t.slice(0,n))},endAfter(e,t){let n=e.length-1;return Yr.equal(e.slice(0,n),t.slice(0,n))&&e[n]>t[n]},isBefore:(e,t)=>-1==Yr.compare(e,t),isAfter:(e,t)=>1==Yr.compare(e,t),parent(e){if(Yr.isRoot(e))throw new Error("Cannot get parent of root path");return e.slice(0,-1)},previousSibling(e){if(Yr.isRoot(e))throw new Error("Cannot get previous sibling of root path");let t=e[e.length-1];if(t<=0)throw new Error(`Cannot get previous sibling of the first child [${e}]`);return e.slice(0,-1).concat(t-1)},nextSibling(e){if(Yr.isRoot(e))throw new Error("Cannot get next slibing of root path");let t=e[e.length-1];return e.slice(0,-1).concat(t+1)},hasPreviousSibling:e=>e[e.length-1]>0,isFirstChild:e=>0==e[e.length-1],common(e,t){let n=[],i=Math.min(e.length,t.length);for(let r=0;r<i&&e[r]==t[r];r+=1)n.push(e[r]);return n},index(e){if(Yr.isRoot(e))throw new Error("Cannot get index of root path.");return e[e.length-1]},levels(e){let t=[];for(let n=0,i=e.length;n<=i;n+=1){let i=e.slice(0,n);t.push(i)}return t},ancestors:e=>Yr.levels(e).slice(0,-1),transform(e,t,n){switch(t.type){case"insert_node":if(Yr.equal(t.path,e)||Yr.isAncestor(t.path,e)||Yr.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]+1,n}return e;case"move_node":if(Yr.equal(t.path,t.newPath))return e;if(Yr.equal(t.path,e)||Yr.isAncestor(t.path,e)){let n=t.newPath.slice();return Yr.endBefore(t.path,t.newPath)&&(n[t.path.length-1]=n[t.path.length-1]-1),n.concat(e.slice(t.path.length))}if((Yr.equal(t.newPath,e)||Yr.isAncestor(t.newPath,e))&&Yr.isSibling(t.newPath,t.path)){let n=e.slice();return Yr.endBefore(t.path,e)?n[t.path.length-1]=n[t.path.length-1]-1:n[t.path.length-1]=n[t.path.length-1]+1,n}if(Yr.equal(t.newPath,e)||Yr.isAncestor(t.newPath,e)||Yr.endBefore(t.newPath,e)){let n=e.slice();return Yr.endBefore(t.path,e)&&(n[t.path.length-1]=n[t.path.length-1]-1),n[t.newPath.length-1]=n[t.newPath.length-1]+1,n}if(Yr.endBefore(t.path,e)){let n=e.slice();return Yr.equal(e,t.newPath)&&(n[t.newPath.length-1]=n[t.newPath.length-1]+1),n[t.path.length-1]=n[t.path.length-1]-1,n}return e;case"merge_node":if(Yr.equal(t.path,e)||Yr.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]-1,n}if(Yr.isAncestor(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]-1,n[t.path.length]=n[t.path.length]+t.position,n}return e;case"remove_node":if(Yr.equal(t.path,e)||Yr.isAncestor(t.path,e))return;if(Yr.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]-1,n}return e;case"split_node":if(Yr.equal(t.path,e)){let i=n?.bias;if("forward"==i){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]+1,n}return"backward"==i?e:void 0}if(Yr.endBefore(t.path,e)){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]+1,n}if(Yr.isAncestor(t.path,e)&&e[t.path.length]>=t.position){let n=e.slice();return n[t.path.length-1]=n[t.path.length-1]+1,n[t.path.length]=n[t.path.length]-t.position,n}return e;default:return e}},transformExn(e,t,n){let i=Yr.transform(e,t,n);if(null==i)throw new Error("expect a transformed path");return i}},Hr={isPoint:e=>f.isObj(e)&&"number"==typeof e.offset&&Yr.isPath(e.path),equal:(e,t)=>e.offset==t.offset&&Yr.equal(e.path,t.path),compare(e,t){let n=Yr.compare(e.path,t.path);return 0==n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isBefore:(e,t)=>-1==Hr.compare(e,t),isAfter:(e,t)=>1==Hr.compare(e,t),transform(e,t,n){switch(t.type){case"insert_node":case"move_node":{let n=Yr.transformExn(e.path,t);return{...e,path:n}}case"merge_node":{let n=Yr.equal(e.path,t.path)?e.offset+t.position:e.offset;return{path:Yr.transformExn(e.path,t),offset:n}}case"remove_node":{if(Yr.equal(e.path,t.path)||Yr.isDescendant(e.path,t.path))return;let n=Yr.transformExn(e.path,t);return{...e,path:n}}case"split_node":{if(Yr.equal(e.path,t.path)){let i=n?.bias;if(e.offset==t.position&&null==i)return;if(e.offset>t.position||e.offset==t.position&&"forward"==i){let n=e.offset-t.position;return{path:Yr.transformExn(e.path,t,{bias:"forward"}),offset:n}}return e}let i=Yr.transformExn(e.path,t,n);return{...e,path:i}}case"insert_text":if(Yr.equal(e.path,t.path)&&e.offset>=t.offset){let n={...e};return n.offset=e.offset+t.text.length,n}return e;case"remove_text":if(Yr.equal(e.path,t.path)&&e.offset>=t.offset){let n={...e};return n.offset=e.offset-Math.min(e.offset-t.offset,t.text.length),n}return e;default:return e}},transformExn(e,t,n){let i=Hr.transform(e,t,n);if(null==i)throw new Error("expected a transformed point");return i}},Gr={isRange:e=>f.isObj(e)&&Hr.isPoint(e.anchor)&&Hr.isPoint(e.focus),equal:(e,t)=>Hr.equal(e.anchor,t.anchor)&&Hr.equal(e.focus,t.focus),isCollapsed:e=>Hr.equal(e.anchor,e.focus),isExpanded:e=>!Gr.isCollapsed(e),isBackward:e=>Hr.isAfter(e.anchor,e.focus),isForward:e=>!Gr.isBackward(e),edges:e=>Gr.isBackward(e)?[e.focus,e.anchor]:[e.anchor,e.focus],start(e){let[t]=Gr.edges(e);return t},end(e){let[,t]=Gr.edges(e);return t},intersection(e,t){let[n,i]=Gr.edges(e),[r,o]=Gr.edges(t),l=Hr.isBefore(n,r)?r:n,u=Hr.isBefore(i,o)?i:o;return Hr.isBefore(u,l)?void 0:{anchor:l,focus:u}},intersectionExn(e,t){let n=Gr.intersection(e,t);if(null==n)throw new Error("expect an intersection");return n},transform(e,t,n={}){let i,r,{bias:o}=n;if("inward"==o){let t=Gr.isCollapsed(e);Gr.isForward(e)?(i="forward",r=t?i:"backward"):(i="backward",r=t?i:"forward")}else"outward"==o?Gr.isForward(e)?(i="backward",r="forward"):(i="forward",r="backward"):(i=o,r=o);let l=Hr.transform(e.anchor,t,{bias:i}),u=Hr.transform(e.focus,t,{bias:r});return l&&u&&{anchor:l,focus:u}}},Wr={isText:e=>f.isObj(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Wr.isText(e))),equal:(e,t)=>f.equal(e,t),sameMarks(e,t){let{text:n,...i}=e,{text:r,...o}=t;return f.equal(i,o)},match(e,t){let{text:n,...i}=e;return f.match(i,t)}};let Jr=(()=>{let e=new WeakMap;return t=>{if(!Array.isArray(t))return!1;let n=e.get(t);if(null!=n)return n;let i=t.every(Zr);return e.set(t,i),i}})();function Zr(e){return Wr.isText(e)||function(e){return f.isObj(e)&&Jr(e.children)}(e)}const Kr={isElement:e=>f.isObj(e)&&Jr(e.children),isElementList:e=>Array.isArray(e)&&e.every(Kr.isElement),match(e,t){let{children:n,...i}=e;return f.match(i,t)}};const Qr={isNode:e=>Wr.isText(e)||Kr.isElement(e),isNodeList:Jr,equal:function e(t,n){if(t==n)return!0;if(Wr.isText(t)&&Wr.isText(n))return Wr.equal(t,n);if(Kr.isElement(t)&&Kr.isElement(n)){let i=Qr.props(t),r=Qr.props(n);return f.equal(i,r)&&l.equal(t.children,n.children,e)}return!1},node(e,t){let n=e;for(let i=0;i<t.length;i+=1){let r=t[i];if(Wr.isText(n)||null==n.children[r])throw new Error(`Cannot find a descendant at path [${t}] in node: ${JSON.stringify(e)}`);n=n.children[r]}return n},element(e,t){let n=Qr.node(e,t);if(!Kr.isElement(n))throw new Error(`expect an element at path [${t}]`);return n},text(e,t){let n=Qr.node(e,t);if(!Wr.isText(n))throw new Error(`expect a text at path [${t}]`);return n},props(e){if(Kr.isElement(e)){let{children:t,...n}=e;return n}let{text:t,...n}=e;return n},nodes:(()=>{function e(t,n,i,r,o,l,u,s){if(i(t,n)&&s.push([t,n]),!r(t,n)&&!Wr.isText(t)&&t.children.length>0){let a=Yr.isAncestor(n,o)?o[n.length]:0,c=null!=l&&Yr.isAncestor(n,l)?l[n.length]:t.children.length-1;if(u)for(let d=c;d>=a;d-=1){e(t.children[d],n.concat(d),i,r,o,l,u,s)}else for(let d=a;d<=c;d+=1){e(t.children[d],n.concat(d),i,r,o,l,u,s)}}return s}return(r,o={})=>{let{match:l=t,filter:u=i,ignoreChildren:s=n,from:a=Yr.root,to:c,reverse:d=!1}=o;if(null!=c&&Yr.isBefore(c,a))throw new Error("invalid operation");let f=e(r,Yr.root,l,s,a,c,d,[]);return f=u(f),f}})(),texts:e=>Qr.nodes(e,{match:Wr.isText}),levels(e,n){let{at:i,match:r=t}=n,o=[];for(let t of Yr.levels(i)){let n=Qr.node(e,t);r(n,t)&&o.push([n,t])}return o},ancestors(e,t){let n=[];for(let i of Yr.ancestors(t)){let t=[Qr.element(e,i),i];n.push(t)}return n},first(e,t){let n=t.slice(),i=Qr.node(e,n);for(;!Wr.isText(i)&&i.children.length>0;)n.push(0),i=i.children[0];return[i,n]},last(e,t){let n=t.slice(),i=Qr.node(e,n);for(;!Wr.isText(i)&&i.children.length>0;){let e=i.children.length-1;n.push(e),i=i.children[e]}return[i,n]},hasPath(e,t){let n=e;for(let e of t){if(Wr.isText(n)||null==n.children[e])return!1;n=n.children[e]}return!0},transform(e,t){function n(e,t,n){if(t<0||t>e.children.length-1)throw new Error(`index ${t} out of range`);if(e.children[t]==n)return e;let i=e.children.slice();return i[t]=n,{...e,children:i}}function i(e,t,n){if(t<0||t>e.children.length)throw new Error(`index ${t} out of range`);let i=e.children.slice();return i.splice(t,0,n),{...e,children:i}}function r(e,t){if(t<0||t>e.children.length-1)throw new Error(`index ${t} out of range`);let n=e.children.slice();return n.splice(t,1),{...e,children:n}}function o(e,t,i){let r=i,o=t;for(;r.length>0;){o=n(Qr.element(e,Yr.parent(r)),Yr.index(r),o),r=Yr.parent(r)}if(!Kr.isElement(o))throw new Error("invalid operation");return o}switch(t.type){case"insert_node":{let{path:n,node:r}=t,l=Qr.element(e,Yr.parent(n));return l=i(l,Yr.index(n),r),o(e,l,Yr.parent(n))}case"merge_node":{let{path:i}=t,l=Qr.node(e,i),u=Qr.node(e,Yr.previousSibling(i)),s=Qr.element(e,Yr.parent(i)),a={...u};if(Wr.isText(u)&&Wr.isText(l))a.text=u.text+l.text;else{if(!Kr.isElement(u)||!Kr.isElement(l))throw new Error(`Cannot apply "merge_node" operation at path [${i}].`);a.children=u.children.concat(l.children)}return s=r(s,Yr.index(i)),s=n(s,Yr.index(i)-1,a),o(e,s,Yr.parent(i))}case"move_node":{let{path:n,newPath:l}=t;if(Yr.isAncestor(n,l))throw new Error(`Cannot move a path [${n}] to new path [${l}] because the destination is inside itself.`);let u=Qr.node(e,n),s=Qr.element(e,Yr.parent(n));s=r(s,Yr.index(n));let a=o(e,s,Yr.parent(n)),c=Yr.transformExn(n,t);return s=Qr.element(a,Yr.parent(c)),s=i(s,Yr.index(c),u),a=o(a,s,Yr.parent(c)),a}case"remove_node":{let{path:n}=t,i=Qr.element(e,Yr.parent(n));return i=r(i,Yr.index(n)),o(e,i,Yr.parent(n))}case"set_node":{let{path:n,properties:i,newProperties:r}=t;if(Yr.isRoot(n))throw new Error("Cannot set properties on the root node");if(Object.keys(r).some((e=>"children"==e||"text"==e)))throw new Error("Cannot set the children or text to node");let l=Qr.node(e,n);return l=function(e,t){let n={...e};for(let[e,i]of Object.entries(t))null==i?delete n[e]:n[e]=i;return n}(l,r),l=function(e,t,n){let i={...e};for(let e of Object.keys(t))f.hasOwn(n,e)||delete i[e];return i}(l,i,r),o(e,l,n)}case"split_node":{let{path:r,position:l,properties:u}=t;if(Yr.isRoot(r))throw new Error('Cannot apply "split_node" at root path.');let s,a=Qr.node(e,r),c=Qr.element(e,Yr.parent(r)),d={...a};if(Wr.isText(a)){let e=a.text.slice(0,l),t=a.text.slice(l);d.text=e,s={...u,text:t}}else{let e=a.children.slice(0,l),t=a.children.slice(l);d.children=e,s={...u,children:t}}return c=n(c,Yr.index(r),d),c=i(c,Yr.index(r)+1,s),o(e,c,Yr.parent(r))}case"insert_text":{let{path:n,text:i,offset:r}=t;if(0==i.length)return e;let l=Qr.text(e,n),u=l.text.slice(0,r),s=l.text.slice(r);return l={...l,text:u+i+s},o(e,l,n)}case"remove_text":{let{path:n,offset:i,text:r}=t;if(0==r.length)return e;let l=Qr.text(e,n),u=l.text.slice(0,i),s=l.text.slice(i+r.length);return l={...l,text:u+s},o(e,l,n)}case"set_selection":return e}}},eo={lowest(e){let t,n=[];for(let[i,r]of e){null!=t&&0==Yr.compare(r,t[1])||null!=t&&n.push(t),t=[i,r]}return null!=t&&n.push(t),n},highest(e){let t,n=[];for(let[i,r]of e){null!=t&&0==Yr.compare(r,t[1])||(t=[i,r],n.push(t))}return n}};function to(e){return e>=55296&&e<=56319}var no;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(no||(no={}));const io=/^[\p{Gr_Ext}\p{EMod}]$/u,ro=/^[\u0600-\u0605\u06DD\u070F\u0890-\u0891\u08E2\u0D4E\u{110BD}\u{110CD}\u{111C2}-\u{111C3}\u{1193F}\u{11941}\u{11A3A}\u{11A84}-\u{11A89}\u{11D46}]$/u,oo=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BF-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC1\u0CC3-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0D02-\u0D03\u0D3F-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82-\u0D83\u0DD0-\u0DD1\u0DD8-\u0DDE\u0DF2-\u0DF3\u0E33\u0EB3\u0F3E-\u0F3F\u0F7F\u1031\u103B-\u103C\u1056-\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF7\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BE-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC\u{11000}\u{11002}\u{11082}\u{110B0}-\u{110B2}\u{110B7}-\u{110B8}\u{1112C}\u{11145}-\u{11146}\u{11182}\u{111B3}-\u{111B5}\u{111BF}-\u{111C0}\u{111CE}\u{1122C}-\u{1122E}\u{11232}-\u{11233}\u{11235}\u{112E0}-\u{112E2}\u{11302}-\u{11303}\u{1133F}\u{11341}-\u{11344}\u{11347}-\u{11348}\u{1134B}-\u{1134D}\u{11362}-\u{11363}\u{11435}-\u{11437}\u{11440}-\u{11441}\u{11445}\u{114B1}-\u{114B2}\u{114B9}\u{114BB}-\u{114BC}\u{114BE}\u{114C1}\u{115B0}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{11630}-\u{11632}\u{1163B}-\u{1163C}\u{1163E}\u{116AC}\u{116AE}-\u{116AF}\u{116B6}\u{11726}\u{1182C}-\u{1182E}\u{11838}\u{11931}-\u{11935}\u{11937}-\u{11938}\u{1193D}\u{11940}\u{11942}\u{119D1}-\u{119D3}\u{119DC}-\u{119DF}\u{119E4}\u{11A39}\u{11A57}-\u{11A58}\u{11A97}\u{11C2F}\u{11C3E}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D8A}-\u{11D8E}\u{11D93}-\u{11D94}\u{11D96}\u{11EF5}-\u{11EF6}\u{16F51}-\u{16F87}\u{16FF0}-\u{16FF1}\u{1D166}\u{1D16D}]$/u,lo=/^[\u1100-\u115F\uA960-\uA97C]$/u,uo=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/u,so=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/u,ao=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/u,co=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/u,fo=/^\p{ExtPict}$/u;function po(e,t){let n=no.Any;return-1!=e.search(io)&&(n|=no.Extend),8205==t&&(n|=no.ZWJ),t>=127462&&t<=127487&&(n|=no.RI),-1!=e.search(ro)&&(n|=no.Prepend),-1!=e.search(oo)&&(n|=no.SpacingMark),-1!=e.search(lo)&&(n|=no.L),-1!=e.search(uo)&&(n|=no.V),-1!=e.search(so)&&(n|=no.T),-1!=e.search(ao)&&(n|=no.LV),-1!=e.search(co)&&(n|=no.LVT),-1!=e.search(fo)&&(n|=no.ExtPict),n}let ho=[[no.L,no.L|no.V|no.LV|no.LVT],[no.LV|no.V,no.V|no.T],[no.LVT|no.T,no.T],[no.Any,no.Extend|no.ZWJ],[no.Any,no.SpacingMark],[no.Prepend,no.Any],[no.ZWJ,no.ExtPict],[no.RI,no.RI]];function go(e,t){return 0!=(e&t)}function mo(e,t){return-1==ho.findIndex((n=>go(e,n[0])&&go(t,n[1])))}let $o=/\p{ExtPict}[\p{Gr_Ext}\p{EMod}]*\u200D$/u;function xo(e){return-1!=e.search($o)}let vo=/\p{RI}+$/gu;function Co(e){let t=e.match(vo);return null!=t&&t[0].length/2%2==1}function Bo(e,t=!1){let n,i,r=!t,o=t?function*(e){let t=e.length-1;for(let i=0,r=e.length;i<r;i+=1){let r=e.charAt(t-i);if((n=r.charCodeAt(0))>=56320&&n<=57343){let n=e.charAt(t-i-1);if(to(n.charCodeAt(0))){yield n+r,i+=1;continue}}yield r}var n}(e):e,l=no.None,u=no.None,s=0;for(let t of o){let o=t.codePointAt(0);if(null==o)break;let a=po(t,o);if([l,u]=r?[u,a]:[a,l],go(l,no.ZWJ)&&go(u,no.ExtPict)&&(n=xo(r?e.substring(0,s):e.substring(0,e.length-s)),!n))break;if(go(l,no.RI)&&go(u,no.RI)&&(i=null!=i?!i:!!r||Co(e.substring(0,e.length-s)),!i))break;if(l!=no.None&&u!=no.None&&mo(l,u))break;s+=t.length}return s||1}function wo(e,t,n){if(n){let n=e.length-t;return[e.slice(n),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]}let yo=/\s/,bo=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Do=/['\u2018\u2019]/;function Eo(e,t,n){if(yo.test(e))return!1;if(Do.test(e)){let e=Bo(t,n),[i,r]=wo(t,e,n);if(Eo(i,r,n))return!0}return!bo.test(e)}const Ao={nextId:(()=>{let e=0;return()=>{let t=e;return e+=1,t}})()};class Fo{constructor(e,t,n){this.id=e,this.facet=t,this.value=n}}class _o{constructor(e,t){this.id=e,this.combine=t,this.default=this.combine([])}static define(e={}){let t=e.combine??i;return new _o(Ao.nextId(),t)}of(e){return new Fo(Ao.nextId(),this,e)}}class ko{constructor(e,t,n){this.id=e,this.create=t,this.update=n}static define(e){return new ko(Ao.nextId(),e.create,e.update)}}const To={resolve(e){let t=[],n={},i={};for(let i of function(e){let t=[];return function e(t,n){Array.isArray(t)?t.forEach((t=>e(t,n))):null!=t.extension?e(t.extension,n):n.includes(t)||n.push(t)}(e,t),t}(e))i instanceof ko?t.push(i):i instanceof Fo&&(null==n[i.facet.id]&&(n[i.facet.id]=[]),n[i.facet.id].push(i));for(let e of Object.values(n)){let t=e[0].facet,n=t.combine(e.map((e=>e.value)));i[t.id]=n}return{source:e,facets:i,fields:t}},facet(e,t){let n=e.facets[t.id];return null!=n?n:t.default}},No={isSpan:e=>f.isObj(e)&&Yr.isPath(e.from)&&Yr.isPath(e.to)},Vo={transform(e,t,n={}){function i(e,t,n){let i=e;for(let e of t){if(null==i)return;i=n(i,e)}return i}let r=n.bias;if(Yr.isPath(e)){if("backward"!=r&&"forward"!=r&&null!=r)throw new Error(`invalid bias ${r}`);return i(e,t,((e,t)=>Yr.transform(e,t,{bias:r})))}if(Hr.isPoint(e)){if("backward"!=r&&"forward"!=r&&null!=r)throw new Error(`invalid bias ${r}`);return i(e,t,((e,t)=>Hr.transform(e,t,{bias:r})))}return i(e,t,((e,t)=>Gr.transform(e,t,{bias:r})))},transformExn(e,t,n={}){let i=Vo.transform(e,t,n);if(null==i)throw new Error("expect a location");return i}},Po={isEditor:e=>f.isObj(e)&&e.$$editor,facet:(e,t)=>To.facet(e.configuration,t),field(e,t){if(!f.hasOwn(e.fields,t.id))throw new Error("Field is not present in this editor");return e.fields[t.id]},startPoint(e,t){if(Yr.isPath(t)){let[n,i]=Qr.first(e,t);if(!Wr.isText(n))throw new Error(`Cannot get the start point in the node at path [${t}] because it has no start text node.`);return{path:i,offset:0}}if(Hr.isPoint(t))return t;let[n]=Gr.edges(t);return n},isStartPoint(e,t,n){if(0!=t.offset)return!1;let i=Po.startPoint(e,n);return Hr.equal(t,i)},endPoint(e,t){if(Yr.isPath(t)){let[n,i]=Qr.last(e,t);if(!Wr.isText(n))throw new Error(`Cannot get the end point in the node at path [${t}] because it has no end text node.`);return{path:i,offset:n.text.length}}if(Hr.isPoint(t))return t;let[,n]=Gr.edges(t);return n},isEndPoint(e,t,n){let i=Po.endPoint(e,n);return Hr.equal(t,i)},isEdgePoint:(e,t,n)=>Po.isStartPoint(e,t,n)||Po.isEndPoint(e,t,n),span(e,t){if(Yr.isPath(t)){let[,n]=Qr.first(e,t),[,i]=Qr.last(e,t);return{from:n,to:i}}if(Hr.isPoint(t))return{from:t.path,to:t.path};let[n,i]=Gr.edges(t);return{from:n.path,to:i.path}},range(e,t){if(Yr.isPath(t)){return{anchor:Po.startPoint(e,t),focus:Po.endPoint(e,t)}}return Hr.isPoint(t)?{anchor:t,focus:t}:t},rangeFromTo:(e,t,n)=>({anchor:Po.startPoint(e,t),focus:Po.endPoint(e,n)}),path:(e,t)=>Yr.isPath(t)?t:Hr.isPoint(t)?t.path:Yr.common(t.anchor.path,t.focus.path),nodes(e,t){let{at:n,match:i,ignoreChildren:r,filter:o,reverse:l}=t,{from:u,to:s}=No.isSpan(n)?n:Po.span(e,n);return Qr.nodes(e,{from:u,to:s,match:i,ignoreChildren:r,filter:o,reverse:l})},textContent(e,t){let n=Po.range(e,t),[i,r]=Gr.edges(n),o=Po.nodes(e,{at:t,match:Wr.isText}),l="";for(let[e,t]of o){let n=e.text;Yr.equal(t,r.path)&&(n=n.slice(0,r.offset)),Yr.equal(t,i.path)&&(n=n.slice(i.offset)),l+=n}return l},hasInlines:(e,t)=>t.children.some((t=>Wr.isText(t)||e.isInline(t))),points(e,t,n={}){let{unit:i="offset",reverse:r=!1}=n,o=Po.range(e,t),[l,u]=Gr.edges(o),s=r?u:l,a=!1,c="",d=0,f=0,p=0,h=[];for(let[n,o]of Po.nodes(e,{at:t,reverse:r})){if(Kr.isElement(n)){if(e.isInline(n))continue;if(Po.hasInlines(e,n)){let t=Yr.isAncestor(o,u.path)?u:Po.endPoint(e,o),n=Yr.isAncestor(o,l.path)?l:Po.startPoint(e,o);c=Po.textContent(e,{anchor:n,focus:t}),a=!0}}if(Wr.isText(n)){let e=Yr.equal(o,s.path);for(e?(f=r?s.offset:n.text.length-s.offset,p=s.offset):(f=n.text.length,p=r?f:0),(e||a||"offset"==i)&&(h.push({path:o,offset:p}),a=!1);;){if(0==d){if(""==c)break;d=g(c,i,r),c=wo(c,d,r)[1]}if(p=r?p-d:p+d,f-=d,f<0){d=-f;break}h.push({path:o,offset:p}),d=0}}}return h;function g(e,t,n){return"character"==t?Bo(e,n):"word"==t?function(e,t=!1){let n=e,i=0,r=!1;for(;n.length>0;){let e=Bo(n,t),[o,l]=wo(n,e,t);if(Eo(o,l,t))r=!0,i+=e;else{if(r)break;i+=e}n=l}return i}(e,n):"line"==t||"block"==t?e.length:1}},pointBefore(e,t,n={}){let i,{distance:r=1,unit:o}=n,l={anchor:Po.startPoint(e,Yr.root),focus:Po.startPoint(e,t)},u=0;for(let t of Po.points(e,l,{unit:o,reverse:!0})){if(u>r)break;0!=u&&(i=t),u+=1}return i},pointAfter(e,t,n={}){let i,{distance:r=1,unit:o}=n,l={anchor:Po.endPoint(e,t),focus:Po.endPoint(e,Yr.root)},u=0;for(let t of Po.points(e,l,{unit:o})){if(u>r)break;0!=u&&(i=t),u+=1}return i},previousNode(e,n){let{at:i,match:r}=n;if(Yr.isPath(i)&&Yr.isRoot(i))throw new Error("Cannot get the previous node from the root node.");if(null==r)if(Yr.isPath(i)){let t=Qr.element(e,Yr.parent(i));r=e=>t.children.includes(e)}else r=t;let o=Po.pointBefore(e,i);if(null==o)return;let[,l]=Qr.first(e,Yr.root),u={from:l,to:o.path},[s]=Po.nodes(e,{at:u,match:r,filter:eo.lowest}).reverse();return s},nextNode(e,n){let{at:i,match:r}=n;if(Yr.isPath(i)&&Yr.isRoot(i))throw new Error("Cannot get the next node from the root node.");if(null==r)if(Yr.isPath(i)){let t=Qr.element(e,Yr.parent(i));r=e=>t.children.includes(e)}else r=t;let o=Po.pointAfter(e,i);if(null==o)return;let[,l]=Qr.last(e,Yr.root),u={from:o.path,to:l},[s]=Po.nodes(e,{at:u,match:r,filter:eo.lowest});return s},levels(e,n){let{at:i,match:r=t}=n;return i=Po.path(e,i),Qr.levels(e,{at:i,match:r})},highestAncestor(e,t){let{at:n,match:i}=t,r=Po.path(e,n),o=Po.levels(e,{at:r,match:i});for(let[e,t]of o)if(!Wr.isText(e)&&!Yr.equal(r,t))return[e,t]},lowestAncestor(e,t){let{at:n,match:i}=t,r=Po.path(e,n),o=Po.levels(e,{at:r,match:i}).reverse();for(let[e,t]of o)if(!Wr.isText(e)&&!Yr.equal(r,t))return[e,t]},isEmpty(e,t){let{children:n}=t;return 0==n.length||1==n.length&&Wr.isText(n[0])&&""==n[0].text},marks(e){let{marks:t,selection:n}=e;if(null==n)return;if(null!=t)return t;if(Gr.isExpanded(n)){let[t]=Po.nodes(e,{at:n,match:Wr.isText});if(null!=t){let[e]=t,{text:n,...i}=e;return i}return{}}let{anchor:i}=n,{path:r}=i,o=Qr.text(e,r);if(0==i.offset){let t=Po.previousNode(e,{at:r,match:Wr.isText}),i=Po.lowestAncestor(e,{at:n,match:e.isBlock});if(null!=t&&null!=i){let[e,n]=t,[,r]=i;Yr.isAncestor(r,n)&&(o=e)}}let{text:l,...u}=o;return u}};function Uo(e,t){let n,i,r,o;for(let[n,i]of Qr.texts(e)){if(-1!=Yr.compare(i,t)){o=[n,i];break}r=[n,i]}let l=!1;return null!=r&&null!=o&&(l=Yr.equal(o[1],t)?!Yr.hasPreviousSibling(o[1]):Yr.common(r[1],t).length<Yr.common(o[1],t).length),null==r||l?null!=o&&(n=o[1],i=0):(n=r[1],i=r[0].text.length),null!=n&&null!=i?{path:n,offset:i}:void 0}function Lo(e,t,n){switch(t.type){case"insert_node":case"merge_node":case"move_node":case"insert_text":case"remove_text":{let n,i=Qr.transform(e,t);if(null!=e.selection){n={anchor:Hr.transformExn(e.selection.anchor,t),focus:Hr.transformExn(e.selection.focus,t)}}return{...i,selection:n}}case"split_node":{let i,r=Qr.transform(e,t);if(null!=e.selection){i={anchor:Hr.transformExn(e.selection.anchor,t,n),focus:Hr.transformExn(e.selection.focus,t,n)}}return{...r,selection:i}}case"remove_node":{let n,i=Qr.transform(e,t);if(null!=e.selection){let r=Hr.transform(e.selection.anchor,t);null==r&&(r=Uo(i,t.path));let o=Hr.transform(e.selection.focus,t);null==o&&(o=Uo(i,t.path)),n=null!=r&&null!=o?{anchor:r,focus:o}:void 0}return{...i,selection:n}}case"set_node":return Qr.transform(e,t);case"set_selection":return{...e,selection:t.newRange}}}function Ro(e,t){let n=Qr.node(e,t);return e=>e==n}function Oo(e,t){return Kr.isElement(t)?1==t.children.length&&Oo(e,t.children[0]):!Po.isEditor(t)}class So{constructor(e){this.editors=[e],this.operations=[],this.marks=e.marks}get startEditor(){return this.editors[0]}get editor(){return this.editors[this.editors.length-1]}apply(e,t){let n=Lo(this.editor,e,t);this.editors.push(n),this.operations.push(e)}deselect(){let e=[];if(null!=this.editor.selection){let t={type:"set_selection",range:this.editor.selection,newRange:void 0};e.push(t),this.apply(t)}return this.marks=void 0,e}select(e){let t=[],n=Po.range(this.editor,e),i={type:"set_selection",range:this.editor.selection,newRange:n};return t.push(i),this.apply(i),this.marks=void 0,t}removeNodes(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,match:r}=e;if(null==i)return[];null==r&&(r=Yr.isPath(i)?Ro(this.editor,i):n);let o=[],l=Po.nodes(this.editor,{at:i,match:r,filter:eo.lowest});for(let[e,t]of l){let n=Vo.transform(t,o);if(null!=n){let t={type:"remove_node",path:n,node:e};o.push(t),this.apply(t)}}return o}moveNodes(e){let{selection:t,isBlock:n}=this.editor,{at:i=t,to:r,match:o}=e;if(null==i)return[];null==o&&(o=Yr.isPath(i)?Ro(this.editor,i):n);let l=[],u=Po.nodes(this.editor,{at:i,match:o,filter:eo.lowest});for(let[,e]of u){let t=Vo.transformExn(e,l),n=Vo.transformExn(r,l);if(Yr.isSibling(r,e)&&Yr.isAfter(r,e))for(let e=0;e<l.length;e+=1)n=Yr.nextSibling(n);if(t.length>0){let e={type:"move_node",path:t,newPath:n};l.push(e),this.apply(e)}}return l}mergeNodes(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,match:o}=e;if(null==i)return[];if(null==o)if(Yr.isPath(i)){let e=Qr.element(this.editor,Yr.parent(i));o=t=>e.children.includes(t)}else o=n;let l=[];if(Gr.isRange(i))if(Gr.isCollapsed(i))i=i.anchor;else{let[,t]=Gr.edges(i),n=this.delete({at:i});if(l.push(...n),i=Vo.transformExn(t,n),null==e.at){let e=this.select(i);l.push(...e)}}let[u]=Po.nodes(this.editor,{at:i,match:o,filter:eo.lowest}),s=Po.previousNode(this.editor,{at:i,match:o});if(null==u||null==s)return[];let a,c,[d,f]=u,[p,h]=s;if(Yr.isRoot(f)||Yr.isRoot(h))return[];if(Wr.isText(d)&&Wr.isText(p)){let{text:e,...t}=d;c=p.text.length,a=t}else{if(!Kr.isElement(d)||!Kr.isElement(p))throw new Error(`Cannot merge the node at path [${f}] with the previous sibling because they are not the same kind.`);{let{children:e,...t}=d;c=p.children.length,a=t}}let g=Yr.nextSibling(h),m=Yr.common(f,h),$=Po.levels(this.editor,{at:f}).slice(m.length).slice(0,-1).map(r),x=Po.highestAncestor(this.editor,{at:f,match:e=>$.includes(e)&&Oo(this.editor,e)});if(!Yr.isSibling(f,h)){let e=this.moveNodes({at:f,to:g});l.push(...e)}if(null!=x){let[,e]=x,t=Vo.transformExn(e,l),n=this.removeNodes({at:t});l.push(...n)}if(Kr.isElement(p)&&Po.isEmpty(this.editor,p)||Wr.isText(p)&&""==p.text&&Yr.index(h)>0){let e=this.removeNodes({at:h});l.push(...e)}else{let e={type:"merge_node",path:g,position:c,properties:a};l.push(e),this.apply(e)}return l}insertNodes(e,t={}){let{isInline:n,isBlock:i}=this.editor,{at:r,match:o}=t,l=Qr.isNode(e)?[e]:e;if(0==l.length)return[];null==r&&(r=null!=this.editor.selection?this.editor.selection:this.editor.children.length>0?Po.endPoint(this.editor,Yr.root):[0]);let u=[];if(Gr.isRange(r))if(Gr.isCollapsed(r))r=r.anchor;else{let[,e]=Gr.edges(r),t=this.delete({at:r});u.push(...t),r=Vo.transformExn(e,t)}let s=l[0];if(Hr.isPoint(r)){null==o&&(o=Wr.isText(s)?Wr.isText:n(s)?e=>Wr.isText(e)||n(e):i);let[e]=Po.nodes(this.editor,{at:r,match:o,filter:eo.lowest});if(null==e)return u;let[,t]=e,l=Po.isEndPoint(this.editor,r,t),a=this.splitNodes({at:r,match:o});u.push(...a),t=Vo.transformExn(t,a,{bias:"forward"}),r=l?Yr.nextSibling(t):t}let a=Yr.parent(r),c=Yr.index(r);for(let e of l){let t={type:"insert_node",node:e,path:a.concat(c)};u.push(t),this.apply(t),r=Yr.nextSibling(r),c+=1}if(null==t.at){r=Yr.previousSibling(r);let e=Po.endPoint(this.editor,r),t=this.select(e);u.push(...t)}return u}splitNodes(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,always:r=!1,highest:o=!1,match:l}=e,u=0;if(null==i)return[];null==l&&(l=n);let s=[];if(Gr.isRange(i))if(Gr.isCollapsed(i))i=i.anchor;else{let[,e]=Gr.edges(i),t=this.delete({at:i});s.push(...t),i=Vo.transformExn(e,t)}if(Yr.isPath(i)){let e=Po.startPoint(this.editor,i),t=Qr.element(this.editor,Yr.parent(i));l=e=>e==t,u=e.path.length-i.length+1,i=e,r=!0}let[a]=Po.nodes(this.editor,{at:i,match:l,filter:o?eo.highest:eo.lowest});if(null==a)return s;let c=i.path.length-u,[,d]=a,f=i.path.slice(0,c),p=0==u?i.offset:i.path[c],h=Po.levels(this.editor,{at:f}).reverse(),g=[];for(let[e,t]of h){if(t.length<d.length||Yr.isRoot(t))break;let n=!1,o=Vo.transformExn(i,g,{bias:"backward"}),l=Po.isEndPoint(this.editor,o,t);if(r||!Po.isEdgePoint(this.editor,o,t)){n=!0;let i={type:"split_node",path:t,position:p,properties:Qr.props(e)};g.push(i),this.apply(i,{bias:"backward"})}p=Yr.index(t)+(n||l?1:0)}if(s.push(...g),null==e.at){let e=Vo.transform(i,g,{bias:"forward"});null==e&&(e=Po.endPoint(this.editor,Yr.root));let t=this.select(e);s.push(...t)}return s}setNodes(e,t={}){let{selection:n,isBlock:i}=this.editor,{at:r=n,match:o,split:l}=t;if(null==r)return[];null==o&&(o=Yr.isPath(r)?Ro(this.editor,r):i);let u=[];if(l&&Gr.isRange(r)){if(Gr.isCollapsed(r)&&Qr.text(this.editor,r.anchor.path).text.length>0)return u;let[e,n]=Gr.edges(r),i=Po.isStartPoint(this.editor,e,e.path),l=Po.isEndPoint(this.editor,n,n.path),s=this.splitNodes({at:n,match:o,always:!l}),a=this.splitNodes({at:e,match:o,always:!i});if(u.push(...s),u.push(...a),r=Vo.transformExn(r,u,{bias:"inward"}),null==t.at){let e=this.select(r);u.push(...e)}}let s=Po.nodes(this.editor,{at:r,match:o,filter:eo.lowest});for(let[t,n]of s)if(!Yr.isRoot(n)){let i=!1,r={},o={};for(let[n,l]of Object.entries(e))"children"!=n&&"text"!=n&&l!=t[n]&&(i=!0,f.hasOwn(t,n)&&(r[n]=t[n]),null!=l&&(o[n]=l));if(i){let e={type:"set_node",path:n,properties:r,newProperties:o};u.push(e),this.apply(e)}}return u}unsetNodes(e,t={}){let n=Array.isArray(e)?e:[e],i={};for(let e of n)i[e]=void 0;return this.setNodes(i,t)}liftNodes(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,match:r}=e;if(null==r&&(r=Yr.isPath(i)?Ro(this.editor,i):n),null==i)return[];let o=[],l=Po.nodes(this.editor,{at:i,match:r,filter:eo.lowest});for(let[,e]of l){if(e=Vo.transformExn(e,o),e.length<2)throw new Error(`Cannot lift node at a path [${e}] because it has depth less than 2.`);let t=Yr.parent(e),n=Qr.element(this.editor,t).children.length,i=Yr.index(e);if(1==n){let n=Yr.nextSibling(t),i=this.moveNodes({at:e,to:n}),r=this.removeNodes({at:t});o.push(...i),o.push(...r)}else if(0==i){let n=this.moveNodes({at:e,to:t});o.push(...n)}else if(i==n-1){let n=Yr.nextSibling(t),i=this.moveNodes({at:e,to:n});o.push(...i)}else{let n=Yr.nextSibling(e),i=Yr.nextSibling(t),r=this.splitNodes({at:n}),l=this.moveNodes({at:e,to:i});o.push(...r),o.push(...l)}}return o}wrapNodes(e,t={}){let{selection:n,isInline:i,isBlock:r}=this.editor,{at:o=n,match:l,split:u}=t;if(null==o)return[];null==l&&(l=Yr.isPath(o)?Ro(this.editor,o):i(e)?e=>i(e)||Wr.isText(e):r);let s=[];if(u&&Gr.isRange(o)){let[e,n]=Gr.edges(o),i=this.splitNodes({at:n,match:l}),r=this.splitNodes({at:e,match:l});if(s.push(...i),s.push(...r),o=Vo.transformExn(o,s,{bias:"inward"}),null==t.at){let e=this.select(o);s.push(...e)}}let a=Po.nodes(this.editor,{at:o,match:i(e)?r:Po.isEditor,filter:eo.lowest});for(let[,t]of a){let n=Gr.isRange(o)?Gr.intersection(o,Po.range(this.editor,t)):o;if(null==n)continue;let i=Po.nodes(this.editor,{at:n,match:l,filter:eo.lowest});if(0==i.length)continue;let r=i[0],u=i[i.length-1],[,a]=r,[,c]=u;if(Yr.isRoot(a)&&Yr.isRoot(c))continue;let d=Yr.equal(a,c)?Yr.parent(a):Yr.common(a,c),f=Qr.node(this.editor,d),p=Po.rangeFromTo(this.editor,a,c),h=d.length+1,g=Yr.nextSibling(c.slice(0,h)),m={...e,children:[]},$=this.insertNodes(m,{at:g});s.push(...$);let x=this.moveNodes({at:p,to:g.concat(0),match:e=>Kr.isElement(f)&&f.children.includes(e)});s.push(...x)}return s}unwrapNodes(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,match:r,split:o}=e;if(null==i)return[];null==r&&(r=Yr.isPath(i)?Ro(this.editor,i):n),Yr.isPath(i)&&(i=Po.range(this.editor,i));let l=[],u=Po.nodes(this.editor,{at:i,match:r,filter:eo.lowest});u=u.reverse();for(let[e,t]of u){t=Vo.transformExn(t,l);let n=Po.range(this.editor,t);if(o&&Gr.isRange(i)){let e=Vo.transform(i,l);null!=e&&(n=Gr.intersectionExn(e,n))}let r=this.liftNodes({at:n,match:t=>Kr.isElement(e)&&e.children.includes(t)});l.push(...r)}return l}delete(e={}){let{selection:t,isBlock:n}=this.editor,{at:i=t,bias:r="forward",distance:o=1,unit:l="character"}=e;if(null==i)return[];if(Yr.isPath(i))return this.removeNodes({at:i});if(Gr.isRange(i)&&Gr.isCollapsed(i)&&(i=i.anchor),Hr.isPoint(i)){let e={unit:l,distance:o};i={anchor:i,focus:"forward"==r?Po.pointAfter(this.editor,i,e)??Po.endPoint(this.editor,Yr.root):Po.pointBefore(this.editor,i,e)??Po.startPoint(this.editor,Yr.root)}}if(Gr.isCollapsed(i))return[];let u,s=[],[a,c]=Gr.edges(i),d=Po.lowestAncestor(this.editor,{at:a,match:n}),f=Po.lowestAncestor(this.editor,{at:c,match:n}),p=d&&f&&!Yr.equal(d[1],f[1]),h=Yr.equal(a.path,c.path),g=[];for(let e of Po.nodes(this.editor,{at:i})){let[,t]=e;null!=u&&0==Yr.compare(t,u)||(Yr.isAncestor(t,a.path)||Yr.equal(t,a.path)||Yr.isAncestor(t,c.path)||Yr.equal(t,c.path)||(g.push(e),u=t))}if(!h){let e=Qr.text(this.editor,a.path).text.slice(a.offset);if(e.length>0){let t={type:"remove_text",path:a.path,offset:a.offset,text:e};s.push(t),this.apply(t)}}for(let[,e]of g){e=Vo.transformExn(e,s);let t=this.removeNodes({at:e});s.push(...t)}let m=Vo.transformExn(c,s),$=Qr.text(this.editor,m.path),x=h?a.offset:0,v=$.text.slice(x,c.offset);if(v.length>0){let e={type:"remove_text",path:m.path,offset:x,text:v};s.push(e),this.apply(e),m=Vo.transformExn(c,s)}if(!h&&p){let e=this.mergeNodes({at:m});s.push(...e)}let C="forward"==r?Vo.transform(c,s)??Vo.transform(a,s):Vo.transform(a,s)??Vo.transform(c,s);if(null==e.at&&null!=C){let e=this.select(C);s.push(...e)}return s}insertText(e,t={}){let{at:n=this.editor.selection}=t;if(null==n)return[];let i=[];if(Yr.isPath(n)&&(n=Po.range(this.editor,n)),Gr.isRange(n))if(Gr.isCollapsed(n))n=n.anchor;else{let e=Gr.end(n),r=this.delete({at:n});if(i.push(...r),n=Vo.transformExn(e,r),null==t.at){let e=this.select(n);i.push(...e)}}if(e.length>0){let t={type:"insert_text",path:n.path,offset:n.offset,text:e};i.push(t),this.apply(t)}return i}addMark(e,t){let{selection:n}=this.editor;if(null!=n){let i={[e]:t};if(Gr.isExpanded(n))return this.setNodes(i,{match:Wr.isText,split:!0});this.marks={...this.marks,...i}}return[]}removeMark(e){let{selection:t}=this.editor;if(null!=t){if(Gr.isExpanded(t))return this.unsetNodes(e,{match:Wr.isText,split:!0});null!=this.marks&&delete this.marks[e]}return[]}insert(e){let{selection:t,marks:n}=this.editor;if(null!=t){if(this.marks=void 0,null!=n){let t={text:e,...n};return this.insertNodes(t)}return this.insertText(e)}return[]}}function qo(e,t){let[n,i]=t,{isInline:r}=e;if(Wr.isText(n))return[];let o=new So(e);if(Kr.isElement(n)&&0==n.children.length){let e={text:""};return o.insertNodes(e,{at:i.concat(0)})}let l=!1;Po.isEditor(n)?l=!1:Kr.isElement(n)&&(l=r(n)||0==n.children.length||Wr.isText(n.children[0])||r(n.children[0]));let u=0;for(let e=0;e<n.children.length;e+=1,u+=1){let t=Qr.node(o.editor,i);if(Wr.isText(t))continue;let s=n.children[e],a=t.children[u-1],c=e==n.children.length-1;if((Wr.isText(s)||Kr.isElement(s)&&r(s))!=l)o.removeNodes({at:i.concat(u)}),u-=1;else if(Kr.isElement(s)){if(r(s))if(null!=a&&Wr.isText(a)){if(c){let e={text:""};o.insertNodes(e,{at:i.concat(u+1)}),u+=1}}else{let e={text:""};o.insertNodes(e,{at:i.concat(u)}),u+=1}}else null!=a&&Wr.isText(a)&&(Wr.sameMarks(s,a)?(o.mergeNodes({at:i.concat(u)}),u-=1):""==a.text?(o.removeNodes({at:i.concat(u-1)}),u-=1):""==s.text&&(o.removeNodes({at:i.concat(u)}),u-=1))}return o.operations}function Mo(e){return e.join(",")}function Io(e,t){if(function(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}}(t)){let n=new Set,i=e.map((e=>Yr.transform(e,t))).filter(Boolean),r=function(e){switch(e.type){case"insert_text":case"remove_text":case"set_node":return Yr.levels(e.path);case"insert_node":return[...Yr.levels(e.path),...Wr.isText(e.node)?[]:Qr.nodes(e.node).map((([,t])=>e.path.concat(t)))];case"merge_node":return[...Yr.ancestors(e.path),Yr.previousSibling(e.path)];case"move_node":{if(Yr.equal(e.path,e.newPath))return[];let t=[],n=[];for(let n of Yr.ancestors(e.path)){let i=Yr.transformExn(n,e);t.push(i)}for(let t of Yr.ancestors(e.newPath)){let i=Yr.transformExn(t,e);n.push(i)}let i=n[n.length-1],r=e.newPath[e.newPath.length-1],o=i.concat(r);return[...t,...n,o]}case"remove_node":return Yr.ancestors(e.path);case"split_node":return[...Yr.levels(e.path),Yr.nextSibling(e.path)];default:return[]}}(t),o=[...i,...r],l=[];for(let e of o)n.has(Mo(e))||(n.add(Mo(e)),l.push(e));return l}return e}function zo(e,t){return t.reduce(((e,t)=>Io(e,t)),e)}function jo(e,t){let n=e;for(let e of t)n=Lo(n,e);return n}function Xo(e,t){if(e!=t.startEditor)throw new Error("editor mismatch");let n={...t.editor},i={...n.fields};n=function(e,t){return 0==t.length?e:function e(n,i){let{normalizeNode:r}=n,o=n,l=i;for(let n of t)if(Qr.hasPath(o,n)){let t=Qr.node(o,n),i=[t,n];if(Kr.isElement(t)&&0==t.children.length){let t=r(o,i);return l=zo(l,t),o=jo(o,t),l.length>0?e(o,l):o}}let u=l.pop();if(null==u)return o;if(Qr.hasPath(o,u)){let e=r(o,[Qr.node(o,u),u]);l=zo(l,e),o=jo(o,e)}return l.length>0?e(o,l):o}(e,t)}(n,function(e){return zo([],e.operations)}(t));for(let e of n.configuration.fields){let n=i[e.id],r=e.update(n,t);i[e.id]=r}return n.fields=i,n.marks=t.marks,n}let Yo=[],Ho={};function Go(e,t=Ho,n=Yo){return{tag:e,attributes:t,children:n}}const Wo={isText:e=>"string"==typeof e.text,isElement:e=>!Wo.isText(e)};function Jo(e){return function e(t){let{parent:n,node:i,vnodeToViewDesc:r,renderText:o,renderElement:l}=t;if(Wr.isText(i)){let e=o(i,{text:i.text}),t={parent:n,node:i,domNode:void 0,domText:void 0};return r.set(e,t),{vnode:e,viewdesc:t,vnodeToViewDesc:r}}let u={parent:n,node:i,children:[],domNode:void 0,slotDomNode:void 0},s=[];for(let t of i.children){let{vnode:n,viewdesc:i}=e({parent:u,node:t,vnodeToViewDesc:r,renderText:o,renderElement:l});s.push(n),u.children.push(i)}let a=l(i,s);return r.set(a,u),{vnode:a,viewdesc:u,vnodeToViewDesc:r}}({...e,vnodeToViewDesc:new Map})}function Zo(e,t,n){return Wr.isText(n)&&""==n.text&&e.isBlock(t)&&1==t.children.length&&t.children[0]==n}function Ko(e,t,n){return Wr.isText(n)&&""==n.text&&e.isInline(t)&&1==t.children.length&&t.children[0]==n}function Qo(e){let{editor:t,vnode:n,viewdesc:i,parentViewDesc:r,vnodeToViewDesc:o,parentDomNode:l}=e;if(Wo.isText(n)){let e=document.createTextNode(n.text);if(i.domText=e,o.has(n)&&(i.domNode=e,e.$$viewdesc=i,null==r.slotDomNode&&(r.slotDomNode=l)),Zo(t,r.node,i.node)){e.nodeValue="\ufeff";let t=document.createElement("span");return t.setAttribute("data-zero-width","n"),t.append(e),t}if(Ko(t,r.node,i.node)){e.nodeValue="\ufeff";let t=document.createElement("span");return t.setAttribute("data-zero-width","z"),t.append(e),t}return e}let{tag:u,attributes:s,children:a}=n,c=document.createElement(u);for(let[e,t]of Object.entries(s))c.setAttribute(e,t);for(let e of a){let n=Qo({editor:t,vnode:e,vnodeToViewDesc:o,viewdesc:o.has(e)?o.get(e):i,parentViewDesc:o.has(e)?i:r,parentDomNode:c});c.append(n)}return o.has(n)&&(i.domNode=c,c.$$viewdesc=i,null==r.slotDomNode&&(r.slotDomNode=l)),c}function el(e,t,n,i,r,o){let l=n.node;if(n.node=i,Wr.isText(l)&&Wr.isText(i)&&ol.isText(n)){let{domText:r}=n,{parentNode:o}=r;if(""!=l.text&&Zo(e,t.node,n.node)){r.nodeValue="\ufeff";let e=r.parentNode,t=document.createElement("span");return t.setAttribute("data-zero-width","n"),e.insertBefore(t,r),void t.append(r)}if(Ko(e,t.node,n.node)){r.nodeValue="\ufeff";let e=r.parentNode,t=document.createElement("span");return t.setAttribute("data-zero-width","z"),e.insertBefore(t,r),void t.append(r)}if(""==l.text&&""!=i.text&&z(o)&&"SPAN"==o.tagName){r.nodeValue=i.text;let e=o.parentNode;return e.insertBefore(r,o),void e.removeChild(o)}l.text!=i.text&&(r.nodeValue=i.text)}else{if(!(Kr.isElement(l)&&Kr.isElement(i)&&ol.isElement(n)))throw new Error("invalid operation: patchNode mismatch");il(e,n,n.children,i.children,r,o)}}function tl(e,t,n){let i=e[t];e.splice(t,1),e.splice(n,0,i)}function nl(e,t){if(Wr.isText(e)&&Wr.isText(t))return Wr.sameMarks(e,t);if(Kr.isElement(e)&&Kr.isElement(t)){let n=Qr.props(e),i=Qr.props(t);return f.equal(n,i)}return!1}function il(e,t,n,i,r,o){let l=0,u=(n=n.slice()).length-1,s=0,a=i.length-1;for(;l<=u&&s<=a;){let e=n[l],t=i[s];if(e.node!=t)break;l+=1,s+=1}for(;l<=u&&s<=a;){let e=n[u],t=i[a];if(e.node!=t)break;u-=1,a-=1}if(l>u){let u=n[l]?.domNode;for(;s<=a;){let n=i[s],{vnode:l,viewdesc:a,vnodeToViewDesc:c}=Jo({parent:t,node:n,renderText:r,renderElement:o});t.children.push(a);let d=Qo({editor:e,vnode:l,viewdesc:a,vnodeToViewDesc:c,parentViewDesc:t,parentDomNode:t.slotDomNode});t.slotDomNode.insertBefore(d,u),s+=1}return}if(s>a){for(;l<=u;){let e=n[l],i=t.children.findIndex((t=>t==e));t.children.splice(i,1),t.slotDomNode.removeChild(e.domNode),l+=1}return}let c=n.slice(l,u+1),d=new Set;for(;s<=a;){let u=n[l],a=i[s],f=u&&u.domNode;if(null!=u&&d.has(u)){l+=1;continue}let p=c.findIndex((e=>e.node==a));if(p>-1){let e=c[p],n=t.children.findIndex((t=>t==e));n!=s&&(tl(t.children,n,s),t.slotDomNode.insertBefore(e.domNode,f)),d.add(e),s+=1;continue}if(null!=u&&c.includes(u)&&nl(u.node,a)){el(e,t,u,a,r,o),d.add(u),s+=1,l+=1;continue}let{vnode:h,viewdesc:g,vnodeToViewDesc:m}=Jo({parent:t,node:a,renderText:r,renderElement:o});t.children.splice(s,0,g);let $=Qo({editor:e,vnode:h,viewdesc:g,vnodeToViewDesc:m,parentViewDesc:t,parentDomNode:t.slotDomNode});t.slotDomNode.insertBefore($,f),s+=1}for(let e of c)if(!d.has(e)){let n=t.children.findIndex((t=>t==e));t.children.splice(n,1),t.slotDomNode.removeChild(e.domNode)}}function rl(e){let{viewdesc:t,editor:n,renderText:i,renderElement:r}=e;t.node=n,il(n,t,t.children,n.children,i,r)}const ol={isText:e=>null!=e.domText,isElement:e=>null==e.domText,closest(e,n,i=t){let r=n;for(;null!=r&&r!=e.root;){if(null!=r.$$viewdesc&&i(r.$$viewdesc.node))return r.$$viewdesc;r=r.parentNode}},closestExn(e,n,i=t){let r=ol.closest(e,n,i);if(null==r)throw new Error("Cannot resolve view description");return r},path(e,t){let n=[],i=t;for(;null!=i.parent;){let e=i.parent.children.indexOf(i);n.unshift(e),i=i.parent}return n},viewdesc(e,t){if(0==t.length)return;let n=e.viewdesc;for(let e=0;e<t.length;e+=1){let i=t[e];if(!ol.isElement(n)||null==n.children[i])return;n=n.children[i]}return n},viewdescExn(e,t){let n=ol.viewdesc(e,t);if(null==n)throw new Error("expect a view description");return n}};function ll(e){return!(t=e,t instanceof Comment||z(e)&&0==e.childNodes.length);var t}function ul(e){let[t,n]=e;if(X(t))return e;for(let e=n;e<t.childNodes.length;e+=1){let n=t.childNodes[e];if(ll(n))return ul([n,0])}}function sl(e){let[t,n]=e;if(X(t))return e;for(let e=n-1;e>=0;e-=1){let n=t.childNodes[e];if(ll(n)){return sl([n,X(n)?n.nodeValue.length:n.childNodes.length])}}}function al(e){let t=ul(e);return null==t&&(t=sl(e)),t}function cl(e){return null!=e.parentNode&&z(e.parentNode)&&"SPAN"==e.parentNode.tagName&&e.parentNode.hasAttribute("data-zero-width")}function dl(e,t){let n=al(t);if(null==n)throw new Error(`Cannot resolve an editor point from DOM point ${t}`);let[i,r]=n;cl(i)&&(r=0);let o=ol.closestExn(e,i,Wr.isText);return{path:ol.path(e,o),offset:r}}function fl(e,t){let[n,i]=t;cl(n)&&(i=0);let r=ol.closest(e,n);if(null!=r)return{path:ol.path(e,r),offset:i}}function pl(e){let{window:t,root:n}=e,i=t.document.getSelection();if(null==i){let t=new So(e.editor);return t.deselect(),void e.apply(t)}let{anchorNode:r,focusNode:o}=i;if(n.contains(r)&&n.contains(o)){let t=function(e,t){let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o,isCollapsed:l}=t;if(null==n||null==r)throw new Error(`Cannot resolve range for dom selection ${t}`);let u=dl(e,[n,i]);return{anchor:u,focus:l?u:dl(e,[r,o])}}(e,i),n=new So(e.editor);n.select(t),e.apply(n)}}function hl(e,t){let n=ol.viewdescExn(e,t.path);if(!ol.isText(n))throw new Error("expect a text view description");let i=cl(n.domText)?1:t.offset;return[n.domText,i]}let gl=_o.define();class ml{constructor(e,t){this.extension=gl.of(this),this.id=e,this.create=t}static define(e){return new ml(Ao.nextId(),e)}}class $l{constructor(e,t){this.spec=e,this.value=t}static create(e,t){try{let n=e.create(t);return new $l(e,n)}catch(e){return console.error(t.editor,e,"plugin crashed on create"),$l.Crashed}}update(e){if(null==this.value.update)return this;try{return this.value.update(e),this}catch(t){if(console.error(e.editor,t,"plugin crashed on update"),null!=this.value.destroy)try{this.value.destroy()}catch{}return $l.Crashed}}destroy(e){if(null!=this.value.destroy)try{this.value.destroy()}catch(t){console.error(e.editor,t,"plugin crashed on destroy")}}}$l.Crashed=new $l(ml.define((()=>({}))),{});class xl{constructor(e){let{root:t,editor:n,renderText:i,renderElement:r}=e;this.root=t;let o=e.window??G(t);if(null==o)throw new Error("Unable to find a host window to root");this.window=o,this.editor=n,this.plugins=Po.facet(n,gl).map((e=>$l.create(e,this))),this.renderText=i,this.renderElement=r,this.viewdesc=function(e,t){let n={parent:void 0,node:e,domNode:t,slotDomNode:t,children:[],vnode:void 0};return t.$$viewdesc=n,n}(n,t),rl({viewdesc:this.viewdesc,editor:this.editor,renderText:this.renderText,renderElement:this.renderElement}),this.onDomSelectionChange=this.onDomSelectionChange.bind(this),this.onDomBeforeInput=this.onDomBeforeInput.bind(this),this.addEventListeners()}destroy(){this.plugins.forEach((e=>e.destroy(this))),this.plugins=void 0,this.removeEventListeners(),this.viewdesc=void 0,this.window=void 0,this.editor=void 0}addEventListeners(){this.window.document.addEventListener("selectionchange",this.onDomSelectionChange),this.root.addEventListener("beforeinput",this.onDomBeforeInput),this.root.addEventListener("dragstart",O)}removeEventListeners(){this.window.document.removeEventListener("selectionchange",this.onDomSelectionChange),this.root.removeEventListener("beforeinput",this.onDomBeforeInput),this.root.removeEventListener("dragstart",O)}apply(e){let t=this.editor,n=Xo(t,e);this.editor=n;let i={previousEditor:t,transform:e,editor:n};this.plugins.forEach((e=>e.update(i))),l.equal(t.children,n.children,Qr.equal)||rl({viewdesc:this.viewdesc,editor:n,renderText:this.renderText,renderElement:this.renderElement});let r=this.window.document.getSelection(),o=r&&function(e,t){let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o,isCollapsed:l}=t;if(null==n||null==r)return;if(!X(n)||!X(r))return;let u=fl(e,[n,i]),s=l?u:fl(e,[r,o]);return null!=u&&null!=s?{anchor:u,focus:s}:void 0}(this,r);if(!(null==o&&null==n.selection||null!=o&&null!=n.selection&&Gr.equal(o,n.selection))&&null!=r){let{selection:e}=n,t=e&&function(e,t){let{anchor:n,focus:i}=t,r=Gr.isBackward(t),o=hl(e,n),l=Gr.isCollapsed(t)?o:hl(e,i),u=new globalThis.Range,[s,a]=r?l:o,[c,d]=r?o:l;return u.setStart(s,a),u.setEnd(c,d),u}(this,e);null!=t&&null!=e?Gr.isBackward(e)?r.setBaseAndExtent(t.endContainer,t.endOffset,t.startContainer,t.startOffset):r.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset):r.removeAllRanges()}}onDomSelectionChange(){pl(this)}onDomBeforeInput(e){!function(e,t){let{inputType:n}=t,{editor:i}=e,{selection:r}=i;t.preventDefault();let o=new So(i);switch(n){case"deleteByCut":case"deleteByDrag":null!=r&&Gr.isExpanded(r)&&(o.delete(),e.apply(o));break;case"deleteContent":case"deleteContentForward":o.delete({bias:"forward"}),e.apply(o);break;case"deleteContentBackward":o.delete({bias:"backward"}),e.apply(o);break;case"deleteEntireSoftLine":o.delete({bias:"backward",unit:"line"}),o.delete({bias:"forward",unit:"line"}),e.apply(o);break;case"deleteHardLineBackward":o.delete({bias:"backward",unit:"block"}),e.apply(o);break;case"deleteSoftLineBackward":o.delete({bias:"backward",unit:"line"}),e.apply(o);break;case"deleteHardLineForward":o.delete({bias:"forward",unit:"block"}),e.apply(o);break;case"deleteSoftLineForward":o.delete({bias:"forward",unit:"line"}),e.apply(o);break;case"deleteWordBackward":o.delete({bias:"backward",unit:"word"}),e.apply(o);break;case"deleteWordForward":o.delete({bias:"forward",unit:"word"}),e.apply(o);break;case"insertLineBreak":case"insertParagraph":o.splitNodes({always:!0}),e.apply(o);break;case"insertFromPaste":case"insertFromYank":case"insertReplacementText":{let{dataTransfer:n}=t;if(null!=n){let t=n.getData("text/plain");if(""!=t){let e=t.split(/\r\n|\r|\n/),n=!1;for(let t of e)n&&o.splitNodes({always:!0}),o.insert(t),n=!0}e.apply(o)}break}case"insertText":{let{data:n}=t;"string"==typeof n&&(o.insert(n),e.apply(o));break}}}(this,e)}}function vl(e,t){let n=t;return e.bold&&(n=Go("strong",void 0,[n])),e.italic&&(n=Go("em",void 0,[n])),n}function Cl(e,t){switch(e.type){case"heading-1":return Go("h1",void 0,t);case"heading-2":return Go("h2",void 0,t);case"heading-3":return Go("h3",void 0,t);case"heading-4":return Go("h4",void 0,t);case"heading-5":return Go("h5",void 0,t);case"heading-6":return Go("h6",void 0,t);default:return Go("p",void 0,t)}}function Bl(e){return"link"==e.type}function wl(e){let t,n,i,r,o,l;return{c(){t=ye("div"),n=ye("div"),i=De(),r=ye("div"),Fe(n,"class","f-text__content"),Fe(n,"contenteditable","true"),Fe(n,"spellcheck","false"),Fe(r,"class",o=In("outline",{hovered:e[2],selected:e[1]})),Fe(t,"class",l=In(e[5],"f-text",{"align-center":"center"==e[3],"align-right":"right"==e[3]}))},m(o,l){Be(o,t,l),Ce(t,n),e[10](n),Ce(t,i),Ce(t,r),e[11](t)},p(e,[n]){6&n&&o!==(o=In("outline",{hovered:e[2],selected:e[1]}))&&Fe(r,"class",o),8&n&&l!==(l=In(e[5],"f-text",{"align-center":"center"==e[3],"align-right":"right"==e[3]}))&&Fe(t,"class",l)},i:te,o:te,d(n){n&&we(t),e[10](null),e[11](null)}}}function yl(e,t,i){let r,{view:o}=t,{path:u}=t,{domNode:s}=t,{selected:a}=t,{hovered:c}=t,{toolbar:d}=t,{align:f}=t,{value:p=[{type:"paragraph",children:[{text:"Here goes your text..."}]}]}=t,h=zn.shortid();return Ue((()=>{let e=ml.define((()=>({update({previousEditor:e,editor:t}){if(!l.equal(e.children,t.children,Qr.equal)){let e=new A(o.builder);e.setNode({value:t.children},{at:u()}),o.apply(e)}}}))),t=ml.define((e=>{let t=d.$on("typeChange",(t=>{if(a){let{type:n}=t.detail,i=new So(e.editor);i.setNodes({type:n}),e.apply(i)}}));return{destroy(){t()}}})),i=function(e={}){let{extensions:t=[],children:i=[]}=e,r=To.resolve(t);function o(t){let i=e.isInline??n;return!Po.isEditor(t)&&i(t)}let l={$$editor:!0,configuration:r,children:i,selection:void 0,marks:void 0,fields:{},isInline:o,isBlock:function(e){return!Po.isEditor(e)&&Kr.isElement(e)&&!o(e)},normalizeNode:function(t,n){return null!=e.normalizeNode?[...e.normalizeNode(t,n),...qo(t,n)]:qo(t,n)}};for(let e of r.fields){let t=e.create(l);l.fields[e.id]=t}return l}({children:p,isInline:Bl,extensions:[e,t]}),s=new xl({window:o.window,root:r,editor:i,renderText:vl,renderElement:Cl}),c=d.$on("alignChange",(e=>{if(a){let{align:t}=e.detail,n=new A(o.builder);n.setNode({align:t},{at:u()}),o.apply(n)}}));return()=>{s.destroy(),c()}})),e.$$set=e=>{"view"in e&&i(6,o=e.view),"path"in e&&i(7,u=e.path),"domNode"in e&&i(0,s=e.domNode),"selected"in e&&i(1,a=e.selected),"hovered"in e&&i(2,c=e.hovered),"toolbar"in e&&i(8,d=e.toolbar),"align"in e&&i(3,f=e.align),"value"in e&&i(9,p=e.value)},[s,a,c,f,r,h,o,u,d,p,function(e){Me[e?"unshift":"push"]((()=>{r=e,i(4,r)}))},function(e){Me[e?"unshift":"push"]((()=>{s=e,i(0,s)}))}]}class bl extends ft{constructor(e){super(),dt(this,e,yl,wl,ue,{view:6,path:7,domNode:0,selected:1,hovered:2,toolbar:8,align:3,value:9})}get view(){return this.$$.ctx[6]}set view(e){this.$$set({view:e}),Ze()}get path(){return this.$$.ctx[7]}set path(e){this.$$set({path:e}),Ze()}get domNode(){return this.$$.ctx[0]}set domNode(e){this.$$set({domNode:e}),Ze()}get selected(){return this.$$.ctx[1]}set selected(e){this.$$set({selected:e}),Ze()}get hovered(){return this.$$.ctx[2]}set hovered(e){this.$$set({hovered:e}),Ze()}get toolbar(){return this.$$.ctx[8]}set toolbar(e){this.$$set({toolbar:e}),Ze()}get align(){return this.$$.ctx[3]}set align(e){this.$$set({align:e}),Ze()}get value(){return this.$$.ctx[9]}set value(e){this.$$set({value:e}),Ze()}}let Dl={};const El={ciEqual:(e,t)=>e.toUpperCase()==t.toUpperCase()};function Al(e){let t,n,i,r,o;const l=e[10].default,u=pe(l,e,e[9],null);return{c(){t=ye("ul"),u&&u.c(),Fe(t,"class",n=In("dropdown__list",e[0])),Fe(t,"role","menu")},m(n,l){Be(n,t,l),u&&u.m(t,null),e[11](t),i=!0,r||(o=Ae(t,"keydown",e[4]),r=!0)},p(e,[r]){u&&u.p&&(!i||512&r)&&me(u,l,e,e[9],i?ge(l,e[9],r,null):$e(e[9]),null),(!i||1&r&&n!==(n=In("dropdown__list",e[0])))&&Fe(t,"class",n)},i(e){i||(it(u,e),i=!0)},o(e){rt(u,e),i=!1},d(n){n&&we(t),u&&u.d(n),e[11](null),r=!1,o()}}}function Fl(e,t,n){let i,r,o,{$$slots:u={},$$scope:s}=t,{class:a}=t,c=Le(),d=gi(void 0),f=gi(void 0);fe(e,f,(e=>n(7,i=e)));let p=gi([]);return fe(e,p,(e=>n(8,r=e))),Re(Dl,{registerItem(e){xe(p,r=l.append(r,e),r)},unregisterItem(e){xe(p,r=l.removeBy(r,(t=>t.value==e)),r)},items:p,focused:f,selected:d}),e.$$set=e=>{"class"in e&&n(0,a=e.class),"$$scope"in e&&n(9,s=e.$$scope)},e.$$.update=()=>{if(386&e.$$.dirty&&o&&i){let e=r.find((e=>e.value==i));e&&(e.linkNode.focus(),function(e,t,n=4){let i=e.scrollTop+(e.offsetHeight-n)-t.offsetHeight,r=e.scrollTop+n;t.offsetTop<=r?e.scrollTop=t.offsetTop-n:t.offsetTop>=i&&(e.scrollTop=t.offsetTop-(e.offsetHeight-n-t.offsetHeight))}(o,e.node))}},[a,o,f,p,function(e){if(e.key!=Yt.Enter&&e.key!=Yt.Escape&&e.key!=Yt.Tab&&e.key!=Yt.ArrowUp&&e.key!=Yt.ArrowRight||e.preventDefault(),e.key!=Yt.Escape)if(e.key!=Yt.Tab)if(e.key!=Yt.Enter)!function(e){let{event:t,currentFocus:n}=e,i=e.items.filter((e=>!e.disabled));if(t.key==Yt.Enter||t.key==Yt.Space){let e=i.find((e=>e.value==n));return void(e&&e.select())}let r=i.length-1,o=i.findIndex((e=>e.value==n));if(t.key!=Yt.ArrowDown)if(t.key!=Yt.ArrowUp){if(Yt.isLetter(t.key)||Yt.isDigit(t.key)){let e=i.reduce(((e,n,i)=>(El.ciEqual(n.text.charAt(0),t.key)&&e.push(i),e)),[]);e.length>0&&i[function(e,t){let n=e.find((e=>e>t));if(null==n)return e[0];let i=e.indexOf(n);return e[i]}(e,o)].focus()}}else i[0==o?r:o-1].focus();else i[o==r?0:o+1].focus()}({event:e,items:r,currentFocus:i});else{let e=r.find((e=>e.value==i));e&&e.select()}else c("tabpress");else c("escpress")},function(){let e=r.find((e=>!e.disabled));e&&e.focus()},function(){for(let e=r.length-1;e>=0;e--){let t=r[e];if(!t.disabled){t.focus();break}}},i,r,s,u,function(e){Me[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class _l extends ft{constructor(e){super(),dt(this,e,Fl,Al,ue,{class:0,focusFirst:5,focusLast:6})}get class(){return this.$$.ctx[0]}set class(e){this.$$set({class:e}),Ze()}get focusFirst(){return this.$$.ctx[5]}get focusLast(){return this.$$.ctx[6]}}function kl(e){let t,n,i,r,o,l;const u=e[10].default,s=pe(u,e,e[9],null);return{c(){t=ye("li"),n=ye("a"),s&&s.c(),Fe(n,"role","menuitem"),Fe(n,"tabindex","-1"),Fe(n,"aria-disabled",e[2]),Fe(t,"class",i=In("dropdown__item",{"is-selected":e[1]==e[5]},e[0])),Fe(t,"role","presentation")},m(i,u){Be(i,t,u),Ce(t,n),s&&s.m(n,null),e[11](n),e[12](t),r=!0,o||(l=Ae(n,"click",e[8]),o=!0)},p(e,[o]){s&&s.p&&(!r||512&o)&&me(s,u,e,e[9],r?ge(u,e[9],o,null):$e(e[9]),null),(!r||4&o)&&Fe(n,"aria-disabled",e[2]),(!r||35&o&&i!==(i=In("dropdown__item",{"is-selected":e[1]==e[5]},e[0])))&&Fe(t,"class",i)},i(e){r||(it(s,e),r=!0)},o(e){rt(s,e),r=!1},d(n){n&&we(t),s&&s.d(n),e[11](null),e[12](null),o=!1,l()}}}function Tl(e,t,n){let i,r,o,l,{$$slots:u={},$$scope:s}=t,{class:a}=t,{value:c=F("menu-item-")}=t,{disabled:d}=t,f=Le(),{selected:p,focused:h,registerItem:g,unregisterItem:m}=Oe(Dl);function $(){xe(h,i=c,i),xe(p,r=c,r),f("select",{value:c})}function x(){xe(h,i=c,i),f("focus",{value:c})}return fe(e,p,(e=>n(5,r=e))),fe(e,h,(e=>n(13,i=e))),Ue((()=>{let e=(o.textContent??"").trim();return g({node:o,linkNode:l,value:c,text:e,disabled:d,focus:x,select:$}),()=>m(c)})),e.$$set=e=>{"class"in e&&n(0,a=e.class),"value"in e&&n(1,c=e.value),"disabled"in e&&n(2,d=e.disabled),"$$scope"in e&&n(9,s=e.$$scope)},[a,c,d,o,l,r,p,h,function(){d||$()},s,u,function(e){Me[e?"unshift":"push"]((()=>{l=e,n(4,l)}))},function(e){Me[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class Nl extends ft{constructor(e){super(),dt(this,e,Tl,kl,ue,{class:0,value:1,disabled:2})}}function Vl(e,t){function n(e){if(e.key==Yt.ArrowDown||e.key==Yt.Space||e.key==Yt.Enter)return e.preventDefault(),void t.focusFirst();e.key==Yt.ArrowUp&&(e.preventDefault(),t.focusLast())}return e.addEventListener("keydown",n),{destroy(){e.removeEventListener("keydown",n)}}}function Pl(){let e=gi({isOpen:!1});return{subscribe:e.subscribe,open(){e.set({isOpen:!0})},close(){e.set({isOpen:!1})},toggle(){e.update((e=>({isOpen:!e.isOpen})))}}}const Ul={nextId:(()=>{let e=0;return()=>{let t=e;return e+=1,t}})()};class Ll{constructor(e,t,n){this.id=e,this.facet=t,this.value=n}}class Rl{constructor(e,t){this.id=e,this.combine=t,this.default=this.combine([])}static define(e={}){let t=e.combine??i;return new Rl(Ul.nextId(),t)}of(e){return new Ll(Ul.nextId(),this,e)}}class Ol{constructor(e,t){this.id=e,this.create=t}static define(e){return new Ol(Ul.nextId(),e)}}class Sl{constructor(e,t){this.id=e,this.create=t}static define(e){return new Sl(Ul.nextId(),e)}}const ql={resolve(e){let t=[],n=[],i={},r={};for(let r of function(e){let t=[];return function e(t,n){Array.isArray(t)?t.forEach((t=>e(t,n))):null!=t.extension?e(t.extension,n):n.includes(t)||n.push(t)}(e,t),t}(e))r instanceof Ol?t.push(r):r instanceof Ll?(null==i[r.facet.id]&&(i[r.facet.id]=[]),i[r.facet.id].push(r)):r instanceof Sl&&n.push(r);for(let e of Object.values(i)){let t=e[0].facet,n=t.combine(e.map((e=>e.value)));r[t.id]=n}return{source:e,facets:r,fields:t,plugins:n}},facet(e,t){let n=e.facets[t.id];return null!=n?n:t.default}};function Ml(e,t={}){let n={};for(let t of e)for(let[e,i]of Object.entries(t)){let t=n[e];if(null==t)n[e]=i;else if(t!=i&&null!=i)throw new Error(`Config merge conflict for field ${e}`)}for(let[e,i]of Object.entries(t))null==n[e]&&(n[e]=i);return n}function Il(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function zl(e){return{width:e.width,height:e.height,left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height,x:e.x,y:e.y}}function jl(e){return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xl(e){let t=Z(e),n=G(e);return Il(t).left+jl(n).scrollLeft}let Yl="undefined"!=typeof navigator&&"undefined"!=typeof document&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1;function Hl(e){let{nodeName:t}=e;return"TABLE"==t||"TD"==t||"TH"==t}function Gl(e){return Y(e)?e:e.parentNode??Z(e)}function Wl(e){return j(e)&&"fixed"!=K(e).position?e.offsetParent:null}function Jl(e){let t=K(e);return Boolean("none"!=t.transform||"none"!=t.perspective||"paint"==t.contain||"transform"==t.willChange||"perspective"==t.willChange||Yl&&"filter"==t.willChange||Yl&&t.filter&&"none"!=t.filter)}function Zl(e){let t=G(e),n=Wl(e);for(;null!=n&&Hl(n)&&"static"==K(n).position;)n=Wl(n);return null!=n&&(Y(n)||H(n)&&"static"==K(n).position)?t:n??function(e){let t=Gl(e);for(;null!=t&&j(t)&&!Y(t)&&!H(t);){if(Jl(t))return t;t=t.parentNode}return null}(e)??t}function Kl(e){let{overflow:t,overflowX:n,overflowY:i}=K(e);return/auto|scroll|overlay|hidden/.test(t+i+n)}function Ql(e){let t=Gl(e);if(H(t)||Y(t)){let n=J(t);return n&&Kl(n)?n:G(e)}return j(t)&&Kl(t)?t:Ql(t)}function eu(e){let t=[],n=e;for(;null!=n;){let e=Ql(n);if(t.push(e),I(e)||H(e))break;n=e}return t}function tu(e,t){if("viewport"==t){let t=function(e){let t=G(e),n=Z(e),{visualViewport:i}=t,r=n.clientWidth,o=n.clientHeight,l=0,u=0;return i&&(r=i.width,o=i.height,Math.abs(t.innerWidth/i.scale-i.width)<.01&&(l=i.offsetLeft,u=i.offsetTop)),{width:r,height:o,x:l,y:u}}(e);return zl(t)}if("document"==t||!j(t)){let t=function(e){let t=jl(G(e)),n=J(e),i=Math.max(e.scrollWidth,e.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=Math.max(e.scrollHeight,e.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-t.scrollLeft+Xl(e),l=-t.scrollTop;return"rtl"==K(n||e).direction&&(o+=Math.max(e.clientWidth,n?n.clientWidth:0)-i),{width:i,height:r,x:o,y:l}}(Z(e));return zl(t)}return function(e){let t=Il(e);return{width:e.clientWidth,height:e.clientHeight,top:t.top+e.clientTop,left:t.left+e.clientLeft,bottom:t.top+e.clientHeight,right:t.left+e.clientWidth,x:t.left,y:t.top}}(t)}function nu(e,t,n){let i="clippingParents"==t?function(e){let t=eu(e),n=["absolute","fixed"].includes(K(e).position)&&j(e)?Zl(e):e;return I(n)?[]:t.filter((e=>!I(e)&&e.contains(n)&&!H(e)))}(e):[].concat(t),r=[...i,n],o=r[0],l=r.reduce(((t,n)=>{let i=tu(e,n);return{...t,top:Math.max(i.top,t.top),left:Math.max(i.left,t.left),right:Math.min(i.right,t.right),bottom:Math.min(i.bottom,t.bottom)}}),tu(e,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function iu(e,t,n){let i=(I(t)?t.document:W(t)).documentElement,r=Il(e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return I(t)&&n.fixed?{width:r.width,height:r.height,x:r.left,y:r.top}:(I(t)?o=jl(t):j(t)?H(t)&&!Kl(i)||(o=function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(t)):o=jl(G(t)),!I(t)&&j(t)?(l=Il(t),l.x=l.x+t.clientLeft,l.y=l.y+t.clientTop):l.x=Xl(i),{width:r.width,height:r.height,x:r.left+o.scrollLeft-l.x,y:r.top+o.scrollTop-l.y})}function ru(e){let t=Il(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}let ou={placement:"bottom",extensions:[],strategy:"absolute"};class lu{constructor(e,t,n={}){this.update=function(e){let t;return()=>(t||(t=new Promise((n=>{Promise.resolve().then((()=>{t=void 0,n(e())}))}))),t)}((()=>new Promise((e=>{this.forceUpdate(),e()})))),this.isDestroyed=!1,this.spec={...ou,...n},this.configuration=ql.resolve(this.spec.extensions),this.state={plugins:[],fields:{},placement:this.spec.placement,elements:{reference:e,popper:t},scrollParents:{reference:eu(e),popper:eu(t)},rects:{},attributes:{},styles:{},offsets:{x:0,y:0}};for(let e of this.configuration.fields){let t=e.create(this);this.state.fields[e.id]=t}for(let e of this.configuration.plugins){let t=e.create(this);this.state.plugins.push(t)}this.update()}destroy(){this.isDestroyed=!0;for(let e of this.state.plugins)"function"==typeof e.destroy&&e.destroy();this.spec=void 0,this.configuration=void 0,this.state=void 0}setOptions(e){this.spec={...ou,...e},this.state.placement=this.spec.placement,this.update()}facet(e){return ql.facet(this.configuration,e)}field(e){return this.state.fields[e.id]}forceUpdate(){if(this.isDestroyed)return;let{reference:e,popper:t}=this.state.elements;this.state.rects={reference:iu(e,Zl(t),{fixed:"fixed"==this.spec.strategy}),popper:ru(t)};for(let e=0,t=this.state.plugins.length;e<t;e++){let t=this.state.plugins[e];if("function"==typeof t.update){let n=t.update(this.state);this.state=n,this.state.reset&&(this.state.reset=!1,e=-1)}}}}let uu=Rl.define({combine:e=>Ml(e,{scroll:!0,resize:!0})}),su=Sl.define((e=>{let{scroll:t,resize:n}=e.facet(uu),i=l.distinct([G(e.state.elements.reference),G(e.state.elements.popper)]),r=l.distinct([...e.state.scrollParents.reference,...e.state.scrollParents.popper]);return t&&r.forEach((t=>{t.addEventListener("scroll",e.update,{passive:!0})})),n&&i.forEach((t=>{t.addEventListener("resize",e.update,{capture:!0,passive:!0})})),{destroy(){t&&r.forEach((t=>{t.removeEventListener("scroll",e.update)})),n&&i.forEach((t=>{t.removeEventListener("resize",e.update,{capture:!0})}))}}}));function au(e={}){return[uu.of(e),su]}let cu=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"];function du(e){return e.split("-")[0]}function fu(e){return e.split("-")[1]}let pu=(()=>{let e={left:"right",right:"left",bottom:"top",top:"bottom"};return t=>t.replace(/left|right|bottom|top/g,(t=>e[t]))})(),hu=(()=>{let e={start:"end",end:"start"};return t=>t.replace(/start|end/g,(t=>e[t]))})();function gu(e){return"top"==e||"bottom"==e?"x":"y"}function mu(e,t,n){let i,r=du(n),o=fu(n),l=gu(r);switch(r){case"top":i={x:e.x+e.width/2-t.width/2,y:e.y-t.height};break;case"bottom":i={x:e.x+e.width/2-t.width/2,y:e.y+e.height};break;case"right":i={x:e.x+e.width,y:e.y+e.height/2-t.height/2};break;case"left":i={x:e.x-t.width,y:e.y+e.height/2-t.height/2}}let u="y"==l?"height":"width";switch(o){case"start":i[l]=i[l]-(e[u]/2-t[u]/2);break;case"end":i[l]=i[l]+(e[u]/2-t[u]/2)}return i}let $u=Ol.define((()=>({x:0,y:0}))),xu=Sl.define((()=>({update(e){let{rects:t,placement:n,fields:i}=e,r=mu(t.reference,t.popper,n);return{...e,offsets:r,fields:{...i,[$u.id]:r}}}})));let vu=Rl.define({combine:e=>Ml(e,{offset:[0,0]})}),Cu=Ol.define((()=>({}))),Bu=Sl.define((e=>{let t=e.facet(vu);return{update(e){let{rects:n,placement:i,offsets:r,fields:o}=e,l=cu.reduce(((e,i)=>(e[i]=function(e,t,n){let[i=0,r=0]="function"==typeof n?n({...t,placement:e}):n;switch(du(e)){case"left":return{x:-r,y:i};case"top":return{x:i,y:-r};case"bottom":return{x:i,y:r};case"right":return{x:r,y:i}}}(i,n,t.offset),e)),{}),u={x:r.x+l[i].x,y:r.y+l[i].y};return{...e,offsets:u,fields:{...o,[Cu.id]:l}}}}}));function wu(e={}){return[vu.of(e),Cu,Bu]}function yu(e,t={}){let{placement:n=e.placement,boundary:i="clippingParents",rootBoundary:r="viewport",elementContext:o="popper",altBoundary:l=!1,padding:u=0}=t,{rects:s,elements:a}=e,c="number"!=typeof u?{top:0,left:0,right:0,bottom:0,...u}:{top:u,left:u,right:u,bottom:u},d=nu(a[l?"popper"==o?"reference":"popper":o],i,r),f=Il(a.reference),p=mu(f,s.popper,n),h=zl({...s.popper,...p}),g="popper"==o?h:f;return{top:d.top-g.top+c.top,bottom:g.bottom-d.bottom+c.bottom,left:d.left-g.left+c.left,right:g.right-d.right+c.right}}function bu(e,t){return{top:e.top-t.y,left:e.left-t.x,bottom:e.bottom+t.y,right:e.right+t.x}}let Du=Rl.define({combine:e=>Ml(e,{flipVariations:!0,mainAxis:!0,altAxis:!0})}),Eu=Sl.define((e=>{let{flipVariations:t,fallbackPlacements:n,boundary:i,rootBoundary:r,altBoundary:o,padding:l,mainAxis:u,altAxis:s}=e.facet(Du),a=!1;return{update(c){if(a)return a=!1,c;let d=e.spec.placement,f=du(d),p=n??(f!=d&&t?function(e){let t=pu(e);return[hu(e),t,hu(t)]}(d):[pu(d)]),h=[d,...p],{rects:g,placement:m}=c,$=new Map,x=!0,v=h[0],C=e.field(Cu);for(let e of h){let t=du(e),n="start"==fu(e),a="top"==t||"bottom"==t,d=a?"width":"height",f=yu(c,{placement:e,boundary:i,rootBoundary:r,altBoundary:o,padding:l});if(C){f=bu(f,C[e])}let p=a?n?"right":"left":n?"bottom":"top";g.reference[d]>g.popper[d]&&(p=pu(p));let h=pu(p),m=[];if(u&&m.push(f[t]<=0),s&&m.push(f[p]<=0,f[h]<=0),m.every(Boolean)){v=e,x=!1;break}$.set(e,m)}if(x){for(let e=t?3:1;e>0;e--){let t=h.find((t=>{let n=$.get(t);return null!=n&&n.slice(0,e).every(Boolean)}));if(t){v=t;break}}}return m!=v?(a=!0,{...c,placement:v,reset:!0}):c}}}));function Au(e={}){return[Du.of(e),Eu]}function Fu(e,t,n){return Math.max(e,Math.min(t,n))}let _u=Rl.define({combine:e=>Ml(e,{mainAxis:!0,altAxis:!1,tether:!0,tetherOffset:0})}),ku=Ol.define((()=>({x:0,y:0})));Sl.define((e=>{let{boundary:t,rootBoundary:n,padding:i,altBoundary:r,mainAxis:o,altAxis:l,tether:u,tetherOffset:s}=e.facet(_u);return{update(a){let c=e.field($u),d=e.field(Cu),{rects:f,placement:p,fields:h}=a;if(null==c)return a;let g=yu(a,{boundary:t,rootBoundary:n,padding:i,altBoundary:r}),m=du(p),$=fu(p),x=!$,v=gu(m),C=function(e){return"x"==e?"y":"x"}(v),B="function"==typeof s?s({...f,placement:p}):s,w={x:0,y:0},y={...a.offsets};if(o||l){let e="y"==v?"top":"left",t="y"==v?"bottom":"right",n="y"==v?"height":"width",i=c[v],r=c[v]+g[e],s=c[v]-g[t],a=u?-f.popper[n]/2:0,h="start"==$?f.reference[n]:f.popper[n],m="start"==$?-f.popper[n]:-f.reference[n],b=x?f.reference[n]/2-a-B:h-B,D=x?-f.reference[n]/2+a+B:m+B,E=null!=d?d[p][v]:0,A=c[v]+b,F=c[v]+D;if(o){let e=Fu(u?Math.min(r,A):r,i+E,u?Math.max(s,F):s);w[v]=e-i,y[v]=e}if(l){let e="x"==v?"top":"left",t="x"==v?"bottom":"right",n=c[C],i=null!=d?d[p][C]:0,r=n+g[e],o=n-g[t],l=Fu(u?Math.min(r,A):r,n+i,u?Math.max(o,F):o);w[C]=l-n,y[C]=l}}return{...a,offsets:y,fields:{...h,[ku.id]:w}}}}}));let Tu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Nu(e){let{x:t,y:n}=e.roundOffsets?function({x:e,y:t}){let n=window.devicePixelRatio||1;return{x:Math.round(Math.round(e*n)/n)||0,y:Math.round(Math.round(t*n)/n)||0}}(e.offsets):e.offsets,i="left",r="top",o=window;if(e.adaptive){let o=Zl(e.popper),l="clientHeight",u="clientWidth";I(o)&&(o=Z(e.popper),"static"!=K(o).position&&(l="scrollHeight",u="scrollWidth")),"top"==e.placement&&(r="bottom",n-=o[l]-e.popperRect.height,n*=e.gpuAcceleration?1:-1),"left"==e.placement&&(i="right",t-=o[u]-e.popperRect.width,t*=e.gpuAcceleration?1:-1)}let l={position:e.position,...e.adaptive&&Tu};return e.gpuAcceleration?{...l,[r]:"0",[i]:"0",transform:(o.devicePixelRatio||1)<2?`translate(${t}px, ${n}px)`:`translate3d(${t}px, ${n}px, 0)`}:{...l,[r]:`${n}px`,[i]:`${t}px`,transform:""}}let Vu=Rl.define({combine:e=>Ml(e,{gpuAcceleration:!0,adaptive:!0,roundOffsets:!0})}),Pu=Sl.define((e=>{let{adaptive:t,gpuAcceleration:n,roundOffsets:i}=e.facet(Vu);return{update(r){let{elements:o,rects:l,placement:u,offsets:s,attributes:a,styles:c}=r,d=Nu({placement:du(u),popper:o.popper,popperRect:l.popper,gpuAcceleration:n,adaptive:t,roundOffsets:i,offsets:s,position:e.spec.strategy}),f={...a.popper,"data-popper-placement":u};return{...r,styles:{...c,popper:d},attributes:{...a,popper:f}}}}}));function Uu(e={}){return[Vu.of(e),Pu]}let Lu=Sl.define((e=>{let t={popper:{position:e.spec.strategy,left:"0",top:"0",margin:"0"},reference:{}},{elements:n,attributes:i,styles:r}=e.state;return Object.assign(n.popper,t.popper),{destroy(){Object.keys(n).forEach((e=>{let o=n[e],l=i[e]??{};if(!j(o))return;let u=Object.keys(Object.hasOwnProperty.call(r,e)?r[e]:t[e]).reduce(((e,t)=>(e[t]="",e)),{});Object.assign(o.style,u),Object.keys(l).forEach((e=>o.removeAttribute(e)))}))},update(e){let{elements:t,styles:n,attributes:i}=e;return Object.keys(t).forEach((e=>{let r=t[e],o=n[e]??{},l=i[e]??{};if(j(r)){Object.assign(r.style,o);for(let[e,t]of Object.entries(l))!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}})),e}}}));function Ru(){let e,t,n,i;function r(){if(e&&t){let{inheritReferenceWidth:r,offset:o,placement:l,strategy:u}=i;r&&(t.style.width=`${e.offsetWidth}px`),n=new lu(e,t,{placement:l,strategy:u,extensions:[au(),[$u,xu],wu({offset:o}),Au(),Uu(),[Lu]]})}}function o(){n&&(n.destroy(),n=void 0)}return[function(t){return e=t,r(),{destroy(){e=void 0,o()}}},function(e,l={}){return t=e,i=l,r(),{update(e){i=e,n&&i&&n.setOptions(i)},destroy(){t=void 0,o()}}}]}let Ou,Su,qu={capture:!0};function Mu(e){let t=new Set;function n(n){if(n.target){for(let e of t)if(e.contains(n.target))return;e()}}return[function(e){return t.add(e),{destroy(){t.delete(e)}}},function(){document.addEventListener("pointerdown",n,qu)},function(){document.removeEventListener("pointerdown",n,qu)}]}function Iu(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C;return{c(){t=ye("div"),n=ye("ul"),i=ye("li"),r=ye("a"),r.innerHTML='<span class="truncate">Heading 1</span>',o=De(),l=ye("li"),u=ye("a"),u.innerHTML='<span class="truncate">Heading 2</span>',s=De(),a=ye("li"),c=ye("a"),c.innerHTML='<span class="truncate">Heading 3</span>',d=De(),f=ye("li"),p=ye("a"),p.innerHTML='<span class="truncate">Heading 4</span>',h=De(),g=ye("li"),m=ye("a"),m.innerHTML='<span class="truncate">Paragraph</span>',Fe(r,"role","menuitem"),Fe(r,"tabindex","-1"),Fe(i,"class","dropdown__item"),Fe(i,"role","presentation"),Fe(u,"role","menuitem"),Fe(u,"tabindex","-1"),Fe(l,"class","dropdown__item"),Fe(l,"role","presentation"),Fe(c,"role","menuitem"),Fe(c,"tabindex","-1"),Fe(a,"class","dropdown__item"),Fe(a,"role","presentation"),Fe(p,"role","menuitem"),Fe(p,"tabindex","-1"),Fe(f,"class","dropdown__item"),Fe(f,"role","presentation"),Fe(m,"role","menuitem"),Fe(m,"tabindex","-1"),Fe(g,"class","dropdown__item"),Fe(g,"role","presentation"),Fe(n,"class","dropdown__list"),Fe(n,"role","menu"),Te(t,"position","absolute"),Fe(t,"class","dropdown")},m(B,w){Be(B,t,w),Ce(t,n),Ce(n,i),Ce(i,r),Ce(n,o),Ce(n,l),Ce(l,u),Ce(n,s),Ce(n,a),Ce(a,c),Ce(n,d),Ce(n,f),Ce(f,p),Ce(n,h),Ce(n,g),Ce(g,m),v||(C=[Ae(r,"click",e[11]),Ae(u,"click",e[12]),Ae(c,"click",e[13]),Ae(p,"click",e[14]),Ae(m,"click",e[15]),ve($=e[3].call(null,t,{placement:"top-start",offset:[0,1]})),ve(x=e[4].call(null,t))],v=!0)},p:te,d(e){e&&we(t),v=!1,oe(C)}}}function zu(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C,B,w;o=new gt({props:{class:"button__icon",name:"type"}}),c=new gt({props:{class:"button__icon",name:"align-left"}}),h=new gt({props:{class:"button__icon",name:"align-center"}}),x=new gt({props:{class:"button__icon",name:"align-right"}});let y=e[1].isOpen&&Iu(e);return{c(){t=ye("div"),n=ye("ul"),i=ye("li"),r=ye("button"),st(o.$$.fragment),u=De(),s=ye("li"),a=ye("button"),st(c.$$.fragment),d=De(),f=ye("li"),p=ye("button"),st(h.$$.fragment),g=De(),m=ye("li"),$=ye("button"),st(x.$$.fragment),v=De(),y&&y.c(),Fe(r,"class","button button_icon button_icon-border bg-neutral-100"),Fe(r,"aria-haspopup","dialog"),Fe(r,"aria-expanded",l=e[1].isOpen),Fe(a,"class","button button_icon button_icon-border bg-neutral-100"),Fe(p,"class","button button_icon button_icon-border bg-neutral-100"),Fe($,"class","button button_icon button_icon-border bg-neutral-100"),Fe(n,"class","button-group-list"),Fe(t,"class","text-toolbar")},m(l,b){var D;Be(l,t,b),Ce(t,n),Ce(n,i),Ce(i,r),at(o,r,null),Ce(n,u),Ce(n,s),Ce(s,a),at(c,a,null),Ce(n,d),Ce(n,f),Ce(f,p),at(h,p,null),Ce(n,g),Ce(n,m),Ce(m,$),at(x,$,null),Ce(t,v),y&&y.m(t,null),C=!0,B||(w=[Ae(r,"click",(function(){le(e[0].toggle)&&e[0].toggle.apply(this,arguments)})),ve(e[2].call(null,r)),ve(e[4].call(null,r)),Ae(a,"mousedown",e[8]),Ae(p,"mousedown",e[9]),Ae($,"mousedown",e[10]),Ae(t,"mousedown",(D=e[7],function(e){return e.preventDefault(),D.call(this,e)}))],B=!0)},p(n,[i]){e=n,(!C||2&i&&l!==(l=e[1].isOpen))&&Fe(r,"aria-expanded",l),e[1].isOpen?y?y.p(e,i):(y=Iu(e),y.c(),y.m(t,null)):y&&(y.d(1),y=null)},i(e){C||(it(o.$$.fragment,e),it(c.$$.fragment,e),it(h.$$.fragment,e),it(x.$$.fragment,e),C=!0)},o(e){rt(o.$$.fragment,e),rt(c.$$.fragment,e),rt(h.$$.fragment,e),rt(x.$$.fragment,e),C=!1},d(e){e&&we(t),ct(o),ct(c),ct(h),ct(x),y&&y.d(),B=!1,oe(w)}}}function ju(e,t,n){let i,r=te,o=()=>(r(),r=de(l,(e=>n(1,i=e))),l);e.$$.on_destroy.push((()=>r()));let{popup:l=Pl()}=t;o();let[u,s]=Ru(),[a,c,d]=Mu(l.close),f=Le();function p(e){l.close(),f("typeChange",{type:e})}function h(e){f("alignChange",{align:e})}return e.$$set=e=>{"popup"in e&&o(n(0,l=e.popup))},e.$$.update=()=>{2&e.$$.dirty&&(i.isOpen?c():d())},[l,i,u,s,a,p,h,function(t){Se.call(this,e,t)},()=>h("left"),()=>h("center"),()=>h("right"),()=>p("heading-1"),()=>p("heading-2"),()=>p("heading-3"),()=>p("heading-4"),()=>p("paragraph")]}class Xu extends ft{constructor(e){super(),dt(this,e,ju,zu,ue,{popup:0})}get popup(){return this.$$.ctx[0]}set popup(e){this.$$set({popup:e}),Ze()}}let Yu={get component(){return null==Su&&(Ou=R("div","float-toolbar"),document.body.append(Ou),Object.assign(Ou.style,{display:"none"}),Su=new Xu({target:Ou})),Su},show(e){Object.assign(Ou.style,{display:"",top:L(e.top),left:L(e.left)})},hide(){Su.popup.close(),Object.assign(Ou.style,{display:"none"})}};function Hu(e,t){let n,i,r=[];function o(){let e=function(e){let t=G(e),n=e.getBoundingClientRect(),i=t.frameElement,r=i?i.getBoundingClientRect():{top:0,left:0};return{top:n.top+r.top,left:n.left+r.left,width:n.width,height:n.height}}(i);Yu.show(e)}function l(){Yu.hide(),r.forEach((e=>e())),r=[]}return{render:r=>(n=_(bl,{view:e,path:t,toolbar:Yu.component,...r}),i=n.domNode,{domNode:i}),update(e){n.$set({...e})},destroy(){n.$destroy(),n=void 0,l()},hover(){n.$set({hovered:!0})},dehover(){n.$set({hovered:!1})},select(){n.$set({selected:!0}),o()},deselect(){n.$set({selected:!1}),l()}}}function Gu(e){switch(e.type){case"button":return"Button";case"container":return"Container";case"image":return"Image";case"text":return"Text";default:throw new Error("invalid operation")}}function Wu(e){let t,n,i,r,o=e[1](e[0])+"";return{c(){t=ye("span"),n=be("No nodes available for "),i=be(o),r=be("."),Fe(t,"class","text-placeholder")},m(e,o){Be(e,t,o),Ce(t,n),Ce(t,i),Ce(t,r)},p(e,t){3&t&&o!==(o=e[1](e[0])+"")&&_e(i,o)},i:te,o:te,d(e){e&&we(t)}}}function Ju(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v,C,B,w,y,b,D,E,A,F,_,k,T,N,V,P,U,L,R,O,S,q=e[1]("container")+"",M=e[1]("text")+"",I=e[1]("button")+"",z=e[1]("image")+"";return i=new gt({props:{class:"icon input__icon input__icon-left",name:"search"}}),f=new gt({props:{class:"icon",name:"square"}}),v=new gt({props:{class:"icon",name:"type"}}),E=new gt({props:{class:"icon",name:"gamepad"}}),V=new gt({props:{class:"icon",name:"image"}}),{c(){t=ye("div"),n=ye("div"),st(i.$$.fragment),r=De(),o=ye("input"),l=De(),u=ye("div"),u.textContent="Basic",s=De(),a=ye("ul"),c=ye("li"),d=ye("button"),st(f.$$.fragment),p=De(),h=ye("span"),g=be(q),m=De(),$=ye("li"),x=ye("button"),st(v.$$.fragment),C=De(),B=ye("span"),w=be(M),y=De(),b=ye("li"),D=ye("button"),st(E.$$.fragment),A=De(),F=ye("span"),_=be(I),k=De(),T=ye("li"),N=ye("button"),st(V.$$.fragment),P=De(),U=ye("span"),L=be(z),Fe(o,"class","input"),Fe(o,"type","text"),Fe(o,"placeholder","Search nodes..."),Fe(n,"class","form-element__control input-has-icon input-has-icon_left"),Fe(t,"class","form-element node-search"),Fe(u,"class","divide"),Fe(h,"class","truncate"),Fe(c,"class","node-menu__item"),Fe(B,"class","truncate"),Fe($,"class","node-menu__item"),Fe(F,"class","truncate"),Fe(b,"class","node-menu__item"),Fe(U,"class","truncate"),Fe(T,"class","node-menu__item"),Fe(a,"class","node-menu")},m(q,M){Be(q,t,M),Ce(t,n),at(i,n,null),Ce(n,r),Ce(n,o),Be(q,l,M),Be(q,u,M),Be(q,s,M),Be(q,a,M),Ce(a,c),Ce(c,d),at(f,d,null),Ce(d,p),Ce(d,h),Ce(h,g),Ce(a,m),Ce(a,$),Ce($,x),at(v,x,null),Ce(x,C),Ce(x,B),Ce(B,w),Ce(a,y),Ce(a,b),Ce(b,D),at(E,D,null),Ce(D,A),Ce(D,F),Ce(F,_),Ce(a,k),Ce(a,T),Ce(T,N),at(V,N,null),Ce(N,P),Ce(N,U),Ce(U,L),R=!0,O||(S=[Ae(d,"click",e[2]("container")),Ae(x,"click",e[2]("text")),Ae(D,"click",e[2]("button")),Ae(N,"click",e[2]("image"))],O=!0)},p(e,t){(!R||2&t)&&q!==(q=e[1]("container")+"")&&_e(g,q),(!R||2&t)&&M!==(M=e[1]("text")+"")&&_e(w,M),(!R||2&t)&&I!==(I=e[1]("button")+"")&&_e(_,I),(!R||2&t)&&z!==(z=e[1]("image")+"")&&_e(L,z)},i(e){R||(it(i.$$.fragment,e),it(f.$$.fragment,e),it(v.$$.fragment,e),it(E.$$.fragment,e),it(V.$$.fragment,e),R=!0)},o(e){rt(i.$$.fragment,e),rt(f.$$.fragment,e),rt(v.$$.fragment,e),rt(E.$$.fragment,e),rt(V.$$.fragment,e),R=!1},d(e){e&&we(t),ct(i),e&&we(l),e&&we(u),e&&we(s),e&&we(a),ct(f),ct(v),ct(E),ct(V),O=!1,oe(S)}}}function Zu(e){let t,n,i,r;const o=[Ju,Wu],l=[];function u(e,t){return null==e[0]||"container"==e[0]?0:null!=e[0]?1:-1}return~(t=u(e))&&(n=l[t]=o[t](e)),{c(){n&&n.c(),i=Ee()},m(e,n){~t&&l[t].m(e,n),Be(e,i,n),r=!0},p(e,[r]){let s=t;t=u(e),t===s?~t&&l[t].p(e,r):(n&&(tt(),rt(l[s],1,1,(()=>{l[s]=null})),nt()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=o[t](e),n.c()),it(n,1),n.m(i.parentNode,i)):n=null)},i(e){r||(it(n),r=!0)},o(e){rt(n),r=!1},d(e){~t&&l[t].d(e),e&&we(i)}}}function Ku(e,t,n){let{parent:i}=t,{selecting:r}=t,{nodeName:o}=t,l=Le();return e.$$set=e=>{"parent"in e&&n(0,i=e.parent),"selecting"in e&&n(3,r=e.selecting),"nodeName"in e&&n(1,o=e.nodeName)},[i,o,e=>()=>{l("insert",{selecting:r,type:e})},r]}class Qu extends ft{constructor(e){super(),dt(this,e,Ku,Zu,ue,{parent:0,selecting:3,nodeName:1})}}let es=Wn.define((e=>{let t,n=C.field(e.builder,P),i=n;function r(n){let i=n.selecting,r=(i&&b.get(n,i))?.type;null==t?(t=Mn(Qu,{view:e,nodeName:e=>Gu({type:e}),parent:r,selecting:i}),t.component.$on("close",l),t.component.$on("insert",u)):t.component.$set({parent:r,selecting:i})}function o(){null!=t&&(t.destroy(),t=void 0)}function l(){let t=new A(e.builder);t.effect(V),e.apply(t)}function u(t){let{selecting:n=[],type:i}=t.detail,r=function(e){let t={key:F(),type:e};return"container"==e&&(t.children=[]),t}(i),o=b.get(e.builder,n);if(null==o.children)throw new Error("invalid operation");let l=o.children.length,u=n.concat(l),s=new A(e.builder);s.insertNode(r,{at:u}),e.apply(s)}return n.nodeMenuOpen&&r(e.builder),{update({previousBuilder:e,builder:l,transform:u}){i=C.field(e,P),n=C.field(l,P),!i.nodeMenuOpen&&n.nodeMenuOpen?r(l):i.nodeMenuOpen&&!n.nodeMenuOpen&&o(),u.selectingChanged&&null!=t&&r(l)},destroy(){o()}}}));function ts(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m,$,x,v;return l=new gt({props:{class:"icon",name:"function"}}),f=new gt({props:{class:"button__icon",name:"equal"}}),m=new gt({props:{class:"button__icon",name:"plus"}}),{c(){t=ye("header"),n=ye("div"),i=ye("div"),r=ye("a"),o=ye("div"),st(l.$$.fragment),u=De(),s=ye("div"),a=ye("ul"),c=ye("li"),d=ye("button"),st(f.$$.fragment),p=De(),h=ye("li"),g=ye("button"),st(m.$$.fragment),Fe(o,"class","global-header__logo"),Fe(r,"class","text-link_reset"),Fe(r,"href","/"),Fe(i,"class","global-header__item"),Fe(d,"class","button button_icon global-actions__item-action"),Fe(d,"title","Structure"),Fe(c,"class","global-actions__item"),Fe(g,"class","button button_icon global-actions__item-action"),Fe(g,"title","Add nodes"),Fe(h,"class","global-actions__item"),Fe(a,"class","global-actions"),Fe(s,"class","global-header__item"),Fe(n,"class","global-header"),Fe(t,"class","global-header_container")},m(C,B){Be(C,t,B),Ce(t,n),Ce(n,i),Ce(i,r),Ce(r,o),at(l,o,null),Ce(n,u),Ce(n,s),Ce(s,a),Ce(a,c),Ce(c,d),at(f,d,null),Ce(a,p),Ce(a,h),Ce(h,g),at(m,g,null),$=!0,x||(v=[Ae(d,"click",e[1]),Ae(g,"click",e[2])],x=!0)},p:te,i(e){$||(it(l.$$.fragment,e),it(f.$$.fragment,e),it(m.$$.fragment,e),$=!0)},o(e){rt(l.$$.fragment,e),rt(f.$$.fragment,e),rt(m.$$.fragment,e),$=!1},d(e){e&&we(t),ct(l),ct(f),ct(m),x=!1,oe(v)}}}function ns(e){let t=Le();return[t,()=>t("toggleStructure"),()=>t("toggleNodeMenu")]}class is extends ft{constructor(e){super(),dt(this,e,ns,ts,ue,{})}}let rs=g.define({combine:v}),os=Wn.define((e=>{let t=C.facet(e.builder,rs),n=new is({target:t.mount});return n.$on("toggleStructure",(()=>{let t=C.field(e.builder,P).structureOpen?new A(e.builder).effect(T):new A(e.builder).effect(k);e.apply(t)})),n.$on("toggleNodeMenu",(()=>{let t=C.field(e.builder,P).nodeMenuOpen?new A(e.builder).effect(V):new A(e.builder).effect(N);e.apply(t)})),{destroy(){n.$destroy(),n=void 0}}}));function ls(e){let t,n,i,r,o;return n=new gt({props:{class:"button__icon",name:e[0]}}),{c(){t=ye("button"),st(n.$$.fragment),Fe(t,"class","button button_icon button_icon-container button_icon-small"),Fe(t,"title",e[1])},m(l,u){Be(l,t,u),at(n,t,null),i=!0,r||(o=Ae(t,"click",e[2]),r=!0)},p(e,[r]){const o={};1&r&&(o.name=e[0]),n.$set(o),(!i||2&r)&&Fe(t,"title",e[1])},i(e){i||(it(n.$$.fragment,e),i=!0)},o(e){rt(n.$$.fragment,e),i=!1},d(e){e&&we(t),ct(n),r=!1,o()}}}function us(e,t,n){let i,r,{allExpanded:o}=t,l=Le();return e.$$set=e=>{"allExpanded"in e&&n(3,o=e.allExpanded)},e.$$.update=()=>{8&e.$$.dirty&&n(1,i=o?"Collapse all":"Expand all"),8&e.$$.dirty&&n(0,r=o?"chevrons-down-up":"chevrons-up-down")},[r,i,function(){l(o?"collapse":"expand")},o]}class ss extends ft{constructor(e){super(),dt(this,e,us,ls,ue,{allExpanded:3})}}function as(e,t){return t.append(e),{destroy:()=>{e.remove()}}}function cs(e){let t,n,i,r,o,l,u,s;return n=new _l({props:{$$slots:{default:[ps]},$$scope:{ctx:e}}}),e[16](n),n.$on("escpress",e[10]),n.$on("tabpress",e[10]),{c(){t=ye("div"),st(n.$$.fragment),Te(t,"position","absolute"),Fe(t,"class","dropdown")},m(a,c){Be(a,t,c),at(n,t,null),l=!0,u||(s=[ve(i=as.call(null,t,document.body)),ve(r=e[5].call(null,t,{placement:"bottom-end"})),ve(o=e[6].call(null,t))],u=!0)},p(e,t){const i={};1048576&t&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){l||(it(n.$$.fragment,e),l=!0)},o(e){rt(n.$$.fragment,e),l=!1},d(i){i&&we(t),e[16](null),ct(n),u=!1,oe(s)}}}function ds(e){let t;return{c(){t=ye("span"),t.textContent="Duplicate",Fe(t,"class","truncate")},m(e,n){Be(e,t,n)},d(e){e&&we(t)}}}function fs(e){let t;return{c(){t=ye("span"),t.textContent="Remove",Fe(t,"class","truncate")},m(e,n){Be(e,t,n)},d(e){e&&we(t)}}}function ps(e){let t,n,i,r;return t=new Nl({props:{$$slots:{default:[ds]},$$scope:{ctx:e}}}),t.$on("select",e[14]),i=new Nl({props:{$$slots:{default:[fs]},$$scope:{ctx:e}}}),i.$on("select",e[15]),{c(){st(t.$$.fragment),n=De(),st(i.$$.fragment)},m(e,o){at(t,e,o),Be(e,n,o),at(i,e,o),r=!0},p(e,n){const r={};1048576&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const o={};1048576&n&&(o.$$scope={dirty:n,ctx:e}),i.$set(o)},i(e){r||(it(t.$$.fragment,e),it(i.$$.fragment,e),r=!0)},o(e){rt(t.$$.fragment,e),rt(i.$$.fragment,e),r=!1},d(e){ct(t,e),e&&we(n),ct(i,e)}}}function hs(e){let t,n,i,r,o,l,u,s;n=new gt({props:{class:"button__icon",name:"more-horizontal"}});let a=e[0].isOpen&&cs(e);return{c(){t=ye("button"),st(n.$$.fragment),r=De(),a&&a.c(),o=Ee(),Fe(t,"class","node__menu button button_icon"),Fe(t,"aria-haspopup","dialog"),Fe(t,"aria-expanded",i=e[0].isOpen)},m(i,c){Be(i,t,c),at(n,t,null),e[13](t),Be(i,r,c),a&&a.m(i,c),Be(i,o,c),l=!0,u||(s=[Ae(t,"click",e[9]),Ae(t,"focus",e[12]),ve(Vl.call(null,t,{focusFirst:e[7],focusLast:e[8]})),ve(e[4].call(null,t)),ve(e[6].call(null,t))],u=!0)},p(e,[n]){(!l||1&n&&i!==(i=e[0].isOpen))&&Fe(t,"aria-expanded",i),e[0].isOpen?a?(a.p(e,n),1&n&&it(a,1)):(a=cs(e),a.c(),it(a,1),a.m(o.parentNode,o)):a&&(tt(),rt(a,1,1,(()=>{a=null})),nt())},i(e){l||(it(n.$$.fragment,e),it(a),l=!0)},o(e){rt(n.$$.fragment,e),rt(a),l=!1},d(i){i&&we(t),ct(n),e[13](null),i&&we(r),a&&a.d(i),i&&we(o),u=!1,oe(s)}}}function gs(e,t,n){let i,r,o,l=Le(),u=Pl();fe(e,u,(e=>n(0,i=e)));let[s,a]=Ru(),[c,d,f]=Mu(u.close);function p(){u.open(),He().then((()=>o.focusFirst()))}function h(e){u.close(),l("menuSelect",{item:e})}return e.$$.update=()=>{1&e.$$.dirty&&(i.isOpen?d():f())},[i,r,o,u,s,a,c,p,function(){u.open(),He().then((()=>o.focusLast()))},function(){u.toggle(),i.isOpen&&p()},function(){u.close(),He().then((()=>r.focus()))},h,function(t){Se.call(this,e,t)},function(e){Me[e?"unshift":"push"]((()=>{r=e,n(1,r)}))},()=>h("duplicate"),()=>h("remove"),function(e){Me[e?"unshift":"push"]((()=>{o=e,n(2,o)}))}]}class ms extends ft{constructor(e){super(),dt(this,e,gs,hs,ue,{})}}function $s(e){let t;return{c(){t=ye("span"),Fe(t,"class","node__expand-placeholder")},m(e,n){Be(e,t,n)},p:te,i:te,o:te,d(e){e&&we(t)}}}function xs(e){let t,n,i,r,o;return n=new gt({props:{class:"button__icon",name:"chevron-right"}}),{c(){t=ye("button"),st(n.$$.fragment),Fe(t,"class","node__expand button button_icon"),Fe(t,"title",e[4])},m(l,u){Be(l,t,u),at(n,t,null),i=!0,r||(o=Ae(t,"click",e[5]),r=!0)},p(e,n){(!i||16&n)&&Fe(t,"title",e[4])},i(e){i||(it(n.$$.fragment,e),i=!0)},o(e){rt(n.$$.fragment,e),i=!1},d(e){e&&we(t),ct(n),r=!1,o()}}}function vs(e){let t,n,i,r,o,l,u,s,a,c,d,f,p,h,g,m;const $=[xs,$s],x=[];function v(e,t){return e[3]?0:1}return n=v(e),i=x[n]=$[n](e),u=new gt({props:{class:"button__icon",name:"grip-vertical"}}),f=new ms({}),f.$on("focus",e[10]),f.$on("menuSelect",e[11]),{c(){t=ye("div"),i.c(),r=De(),o=ye("div"),l=ye("button"),st(u.$$.fragment),s=De(),a=ye("div"),c=ye("input"),d=De(),st(f.$$.fragment),Fe(l,"class","node__handle button button_icon"),Fe(a,"class","node__edit-name"),Fe(o,"class","node__name"),Fe(t,"class","node__content"),Fe(t,"style",p=`--padding: ${e[2]*e[1]}px`)},m(i,p){Be(i,t,p),x[n].m(t,null),Ce(t,r),Ce(t,o),Ce(o,l),at(u,l,null),Ce(o,s),Ce(o,a),Ce(a,c),ke(c,e[0]),Ce(o,d),at(f,o,null),h=!0,g||(m=[Ae(c,"input",e[9]),Ae(c,"input",e[6]),Ae(c,"focus",e[8])],g=!0)},p(e,[o]){let l=n;n=v(e),n===l?x[n].p(e,o):(tt(),rt(x[l],1,1,(()=>{x[l]=null})),nt(),i=x[n],i?i.p(e,o):(i=x[n]=$[n](e),i.c()),it(i,1),i.m(t,r)),1&o&&c.value!==e[0]&&ke(c,e[0]),(!h||6&o&&p!==(p=`--padding: ${e[2]*e[1]}px`))&&Fe(t,"style",p)},i(e){h||(it(i),it(u.$$.fragment,e),it(f.$$.fragment,e),h=!0)},o(e){rt(i),rt(u.$$.fragment,e),rt(f.$$.fragment,e),h=!1},d(e){e&&we(t),x[n].d(),ct(u),ct(f),g=!1,oe(m)}}}function Cs(e,t,n){let i,{Indentation:r}=t,{depth:o}=t,{text:l}=t,{expandable:u}=t,{expanded:s}=t,a=Le();let c=Hi((e=>{let t=e.target.value;a("nameChange",{name:t})}));return e.$$set=e=>{"Indentation"in e&&n(1,r=e.Indentation),"depth"in e&&n(2,o=e.depth),"text"in e&&n(0,l=e.text),"expandable"in e&&n(3,u=e.expandable),"expanded"in e&&n(7,s=e.expanded)},e.$$.update=()=>{128&e.$$.dirty&&n(4,i=s?"Collapse":"Expand")},[l,r,o,u,i,function(){a(s?"collapse":"expand")},c,s,function(t){Se.call(this,e,t)},function(){l=this.value,n(0,l)},function(t){Se.call(this,e,t)},function(t){Se.call(this,e,t)}]}class Bs extends ft{constructor(e){super(),dt(this,e,Cs,vs,ue,{Indentation:1,depth:2,text:0,expandable:3,expanded:7})}}function ws(e,t,n,i,r,o,l){let u=function(e,t){let{name:n}=e;return null!=n?n:t(e)}(e,o),{key:s}=e;if(null==s)throw new Error("structure plugin require every node has an unique key");let a={depth:n,text:u,key:s,index:i.index,parent:t,children:[],node:e,path:r};if(t.children.push(a),i.index=i.index+1,l.push(a),null!=e.children)for(let t=0;t<e.children.length;t+=1){let r=e.children[t],u=a.path.concat(t);ws(r,a,n+1,i,u,o,l)}return l}function ys(e,t){for(let n of e.children)t.push(n),ys(n,t);return t}const bs={fromBuilder(e,t){let n={depth:-1,index:-1,text:void 0,key:void 0,parent:void 0,node:void 0,children:[],path:[]},i={index:0},r=[];for(let o=0;o<e.children.length;o+=1){let l=e.children[o],u=n.path.concat(o);ws(l,n,0,i,u,t,r)}return r},ancestors(e){let t=[],n=e.parent;for(;null!=n;)t.unshift(n),n=n.parent;return t},descendants:e=>ys(e,[]),isDescendant(e,t){let n=bs.ancestors(e).map((e=>e.key));return l.containCommon(n,t)},excludeChildren(e,t){let n=t.slice(),i=[];for(let t of e)n.includes(t.parent)?n.push(t):i.push(t);return i},path(e){let t=[],n=e;for(;null!=n.parent;){let e=n.parent.children.indexOf(n);t.unshift(e),n=n.parent}return t}};function Ds(e,t,n,i,r){return new Tt({handle:".structure-tree .node__handle",draggable(){let e=M(document,".structure-tree .node__name"),t=n();return e.map(((e,n)=>({node:e,data:t[n]})))},extensions:[sn(),xn(),yn({dropAnimation:!1,mount:q(document,".structure-tree"),render(e){let t=e.data,n=1+t.children.length;return R("div","node-clone",[R("div","node-clone__content",[R("button","node-clone__handle button button_icon",[ee("grip-vertical","button__icon")]),R("span","node-clone__name",t.text),n>1?R("span","node-clone__count",n):void 0])])}}),bt.define((()=>{let e=[];function t(t){document.body.style.cursor="",t.source.node.classList.remove("ghost"),e.forEach((e=>{e.classList.remove("disable-interaction")})),e=[]}return[cn((t=>{let{source:n}=t;document.body.style.cursor="grabbing",n.node.classList.add("ghost"),e=M(document,".structure-tree .node"),e.forEach((e=>{e.classList.add("disable-interaction")}))})),hn(t),mn(t)]})),[bt.define((()=>{let e=[];function t(){e.forEach((e=>{e.style.display=""})),e=[]}return[cn((t=>{let n=M(document,".structure-tree .node"),i=t.source.data;e=bs.descendants(i).map((e=>n[e.index])),e.forEach((e=>{e.style.display="none"}))})),hn(t),mn(t)]})),(o={algorithm:Pn,collider(e){let t=M(document,".structure-tree .node"),r=n(),o=[...i(),e.data];return bs.excludeChildren(r,o).map((e=>({node:t[e.index],data:e})))}},[En.of(o),Nn])],bt.define((()=>{let n,i,o,l,u=[];return[Fn((e=>{u=e.colliders,n=e.source,i=n})),kn((e=>{i=e.over})),fn((r=>{let s=function(e){let{allowChild:t,colliders:n,source:i,over:r,Indentation:o,offsetX:l}=e,u=i.index<r.index?r:n[r.index-1],s=i.index>r.index?r:n[r.index+1],a=function(e,t){return Math.round(e/t)}(l,o),c=function(e,t,n,i,r){if(null==n)return 0;let o=n.data,l=i?.data,u=o.depth+1,s=null==l?0:l.depth,a=t.data.depth+r,c=o;for(let n=u;n>=s;n-=1)if(a<n)c=c.parent;else{if(null==c.node||e(c.node,t.data.node))return n;c=c.parent}return s}(t,i,u,s,a);return n.map((e=>e==r?{node:e.node,depth:c,prevNode:u?.data,place:i.index>r.index?"before":"after"}:{node:e.node}))}({allowChild:e,colliders:u,Indentation:t,offsetX:r.transform.x,over:i,source:n});for(let{node:e,place:n,depth:i,prevNode:r}of s)U(e,{"indicator-before":"before"==n,"indicator-after":"after"==n}),null!=i&&(l=r,o=i,e.style.setProperty("--indicator-padding",i*t+"px"))})),mn((()=>{for(let{node:e}of u)U(e,{"indicator-before":!1,"indicator-after":!1}),e.style.removeProperty("--indicator-padding");u=[],n=void 0,i=void 0})),hn((()=>{for(let{node:e}of u)U(e,{"indicator-before":!1,"indicator-after":!1}),e.style.removeProperty("--indicator-padding");let e=function(e,t,n){let i,r=bs.path(e);if(null==t)return[r,[0]];if(n==t.depth+1){return[r,bs.path(t).concat(0)]}let o=t;for(;null!=o&&n<=o.depth;){let e=bs.path(o);i=B.nextSibling(e),o=o.parent}if(null==i)throw new Error("invalid logic");return[r,i]}(n.data,l,o);r(e),u=[],n=void 0,i=void 0}))]}))]});var o}let Es=null,As=e=>t=>{if(null==Es)return;let n=t.relatedTarget;if(null!=n&&n instanceof Node){for(;null!=n;){if(n==Es)return;n=n.parentNode}e(Es),Es=null}};function Fs(e,t,n){const i=e.slice();return i[25]=t[n],i}function _s(e,t){let n,i,r,o,l;const u=[t[25],{Indentation:Ts},{expandable:Ns(t[25])},{expanded:!t[1].includes(t[25].key)}];let s={};for(let e=0;e<u.length;e+=1)s=ne(s,u[e]);return i=new Bs({props:s}),i.$on("expand",(function(){return t[17](t[25])})),i.$on("collapse",(function(){return t[18](t[25])})),i.$on("focus",(function(){return t[19](t[25])})),i.$on("blur",(function(){return t[20](t[25])})),i.$on("menuSelect",(function(...e){return t[21](t[25],...e)})),i.$on("nameChange",(function(...e){return t[22](t[25],...e)})),{key:e,first:null,c(){n=ye("li"),st(i.$$.fragment),r=De(),Fe(n,"class",o=In("node",{hidden:bs.isDescendant(t[25],t[1]),"is-expanded":!t[1].includes(t[25].key),"is-selected":t[3]==t[25]})),this.first=n},m(e,t){Be(e,n,t),at(i,n,null),Ce(n,r),l=!0},p(e,r){t=e;const s=3&r?function(e,t){const n={},i={},r={$$scope:1};let o=e.length;for(;o--;){const l=e[o],u=t[o];if(u){for(const e in l)e in u||(i[e]=1);for(const e in u)r[e]||(n[e]=u[e],r[e]=1);e[o]=u}else for(const e in l)r[e]=1}for(const e in i)e in n||(n[e]=void 0);return n}(u,[1&r&&(a=t[25],"object"==typeof a&&null!==a?a:{}),0&r&&{Indentation:Ts},1&r&&{expandable:Ns(t[25])},3&r&&{expanded:!t[1].includes(t[25].key)}]):{};var a;i.$set(s),(!l||11&r&&o!==(o=In("node",{hidden:bs.isDescendant(t[25],t[1]),"is-expanded":!t[1].includes(t[25].key),"is-selected":t[3]==t[25]})))&&Fe(n,"class",o)},i(e){l||(it(i.$$.fragment,e),l=!0)},o(e){rt(i.$$.fragment,e),l=!1},d(e){e&&we(n),ct(i)}}}function ks(e){let t,n,i,r,l,u,s,a,c,d,f,p=[],h=new Map;u=new ss({props:{allExpanded:e[4]}}),u.$on("expand",e[5]),u.$on("collapse",e[6]);let g=e[0];const m=e=>e[25].key;for(let t=0;t<g.length;t+=1){let n=Fs(e,g,t),i=m(n);h.set(i,p[t]=_s(i,n))}return{c(){t=ye("div"),n=ye("div"),i=ye("div"),i.textContent="Structure",r=De(),l=ye("div"),st(u.$$.fragment),s=De(),a=ye("ul");for(let e=0;e<p.length;e+=1)p[e].c();Fe(i,"class","panel__header-title truncate"),Fe(l,"class","panel__header-actions"),Fe(n,"class","panel__header"),Fe(a,"class","structure-tree"),Fe(t,"class","panel panel_docked panel_docked-right")},m(h,g){Be(h,t,g),Ce(t,n),Ce(n,i),Ce(n,r),Ce(n,l),at(u,l,null),Ce(t,s),Ce(t,a);for(let e=0;e<p.length;e+=1)p[e].m(a,null);e[23](a),c=!0,d||(f=[Ae(a,"mouseover",e[9]),Ae(a,"mouseout",e[10]),Ae(a,"focus",o),Ae(a,"blur",o)],d=!0)},p(e,[t]){const n={};16&t&&(n.allExpanded=e[4]),u.$set(n),31115&t&&(g=e[0],tt(),p=ut(p,t,m,1,e,g,h,a,lt,_s,null,Fs),nt())},i(e){if(!c){it(u.$$.fragment,e);for(let e=0;e<g.length;e+=1)it(p[e]);c=!0}},o(e){rt(u.$$.fragment,e);for(let e=0;e<p.length;e+=1)rt(p[e]);c=!1},d(n){n&&we(t),ct(u);for(let e=0;e<p.length;e+=1)p[e].d();e[23](null),d=!1,oe(f)}}}let Ts=20;function Ns(e){return e.children.length>0}function Vs(e,t,n){let i,r,o,{allowChild:u}=t,{nodes:s}=t,{selecting:a}=t,c=[],d=Le();function f(e){n(1,c=l.remove(c,e.key))}function p(e){n(1,c=l.append(c,e.key))}Ue((()=>{let e=Ds(u,Ts,(()=>s),(()=>s.filter((e=>c.includes(e.key)))),(([e,t])=>{d("sortEnd",{from:e,to:t})}));return()=>{e.destroy()}}));let h=(g=e=>{let t=M(o,".node__name").indexOf(e),n=s[t];d("hover",{node:n})},e=>{if(null!=Es)return;if(null==e.target||!z(e.target))return;let t=e.target.closest(".node__name");null!=t&&(Es=t,g(t))});var g;let m=As((()=>{d("dehover")}));function $(e){d("select",{node:e})}function x(e){d("deselect",{node:e})}function v(e,t){let n=t.detail.item;d("menuSelect",{node:e,item:n})}function C(e,t){let n=t.detail.name;d("nameChange",{node:e,name:n})}return e.$$set=e=>{"allowChild"in e&&n(15,u=e.allowChild),"nodes"in e&&n(0,s=e.nodes),"selecting"in e&&n(16,a=e.selecting)},e.$$.update=()=>{2&e.$$.dirty&&n(4,i=0==c.length),65537&e.$$.dirty&&n(3,r=a&&s.find((e=>B.equal(e.path,a))))},[s,c,o,r,i,function(){n(1,c=[])},function(){n(1,c=s.filter(Ns).map((e=>e.key)))},f,p,h,m,$,x,v,C,u,a,e=>f(e),e=>p(e),e=>$(e),e=>x(e),(e,t)=>v(e,t),(e,t)=>C(e,t),function(e){Me[e?"unshift":"push"]((()=>{o=e,n(2,o)}))}]}class Ps extends ft{constructor(e){super(),dt(this,e,Vs,ks,ue,{allowChild:15,nodes:0,selecting:16})}}let Us=g.define({combine:v}),Ls=Wn.define((e=>{let t,{mount:n,nodeName:i,cloneNode:r}=C.facet(e.builder,Us),o=C.field(e.builder,P),l=o;function u(e){let r=bs.fromBuilder(e,i);null==t?(t=new Ps({target:n,props:{allowChild:e.allowChild,nodes:r,selecting:e.selecting}}),t.$on("sortEnd",a),t.$on("hover",c),t.$on("dehover",d),t.$on("select",f),t.$on("deselect",p),t.$on("menuSelect",h),t.$on("nameChange",g)):t.$set({nodes:r,selecting:e.selecting})}function s(){null!=t&&(t.$destroy(),t=void 0)}function a(t){let{from:n,to:i}=t.detail,r=new A(e.builder);r.moveNode({at:n,to:i}),e.apply(r)}function c(t){let n=bs.path(t.detail.node),i=new A(e.builder);i.hover(n),e.apply(i)}function d(){let t=new A(e.builder);t.dehover(),e.apply(t)}function f(t){let n=bs.path(t.detail.node),i=new A(e.builder);i.select(n),e.apply(i),ui.get(e,n).domNode.scrollIntoView({block:"center"})}function p(){let t=new A(e.builder);t.deselect(),e.apply(t)}function h(t){let{node:n,item:i}=t.detail,o=bs.path(n),l=new A(e.builder);if("duplicate"==i){let e=r(n.node);l.insertNode(e,{at:B.nextSibling(o)})}else"remove"==i&&l.removeNode({at:o});e.apply(l)}function g(t){let{node:n,name:i}=t.detail,r=bs.path(n),o=new A(e.builder);o.setNode({name:i},{at:r}),e.apply(o)}return o.structureOpen&&(U(n,{hidden:!1}),u(e.builder)),{update({previousBuilder:e,builder:i,transform:r}){if(l=C.field(e,P),o=C.field(i,P),!l.structureOpen&&o.structureOpen?(U(n,{hidden:!1}),u(i)):l.structureOpen&&!o.structureOpen&&(U(n,{hidden:!0}),s()),r.nodeChanged&&u(i),r.selectingChanged&&null!=t){let e=r.builder.selecting;t.$set({selecting:e})}},destroy(){s()}}}));let Rs=[{key:F(),type:"container",name:"Hero",children:[{key:F(),type:"container",name:"Content",flexDirection:"column",flexGapValue:"30",flexGapUnit:"px",children:[{key:F(),type:"text",value:[{type:"heading-3",children:[{text:"I am a Heading"}]},{type:"heading-1",children:[{text:"Pretium Volutpat Eros"}]}]},{key:F(),type:"text",value:[{type:"paragraph",children:[{text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."}]}]},{key:F(),type:"button"}]},{key:F(),type:"container",name:"Image",children:[{key:F(),type:"image",src:"https://7c78.github.io/squarespace-concept/cat.jpg"}]}]},{key:F(),type:"container",name:"Intro",flexDirection:"column",children:[{key:F(),type:"text",value:[{type:"heading-1",children:[{text:"I am a Heading"}]}]},{key:F(),type:"text"}]}],Os=C.create({allowChild:function(e,t){return"container"===e.type&&("button"==t.type||"container"==t.type||"image"==t.type||"text"==t.type)},children:Rs,extensions:[(Ss={mount:document.querySelector(".f-header")},[P,rs.of(Ss),os]),function(e){return[P,Us.of(e),Ls]}({mount:document.querySelector(".f-sidebar_right"),nodeName:Gu,cloneNode:function e(t){let{children:n,key:i,...r}=t,o={...r,key:F()};if(null!=n){o.children=[];for(let t of n){let n=e(t);o.children.push(n)}}return o}}),[P,es]]});var Ss;new class{constructor(e){this.requestMeasure=Kn(this);let{builder:t,iframe:n,nodeview:i}=e;this.builder=t,this.iframe=n,this.nodeview=i,async function(e,t){let n=100,i=0;async function r(){var t;await(t=33,new Promise((e=>{setTimeout(e,t)}))),i+=1,"complete"!=e.ownerDocument.readyState&&i<n&&await r()}if(await r(),i>n)throw new Error("can not render");t()}(n,(()=>{this.window=n.contentWindow,this.viewdesc=function(e){let{body:t}=e.window.document,n={view:e,node:e.builder,children:[],parent:void 0,nodeview:void 0,domNode:e.iframe,slotDomNode:t};t.$viewdesc=n;for(let t of e.builder.children){let i=Qn(e,n,t);n.children.push(i)}return n}(this),this.plugins=C.facet(t,Gn).map((e=>Jn.create(e,this))),function(e){let t=e.viewdesc.slotDomNode;for(let n of e.viewdesc.children){let i=ei(e,n);t.append(i)}}(this),function(e){let t=e.window.document.body;t.addEventListener("mousemove",(function(t){let n=null!=t.target?ui.closest(e,t.target):void 0,i=e.builder.hovering?ui.get(e,e.builder.hovering):void 0,r=null!=n&&n!=i;if(null!=i&&i!=n)e.apply(new A(e.builder).dehover());else if(r){let t=ui.path(e,n);e.apply(new A(e.builder).hover(t))}})),t.addEventListener("mouseleave",(function(){let t=new A(e.builder).dehover();e.apply(t)})),t.addEventListener("click",(function(t){let n=null!=t.target?ui.closest(e,t.target):void 0,i=e.builder.selecting?ui.get(e,e.builder.selecting):void 0;if(null!=n&&n!=i){let t=ui.path(e,n);e.apply(new A(e.builder).select(t))}else null==n&&null!=i&&e.apply(new A(e.builder).deselect())}))}(this)}))}apply(e){let t=this.builder,n=C.apply(t,e);this.builder=n;let i={previousBuilder:t,transform:e,builder:n};this.plugins.forEach((e=>e.update(i))),function(e,t){let n=t.startBuilder,i=t.builder;e.viewdesc.node=i;let r=t.hoveringChanged&&n.hovering?ui.get(e,n.hovering):void 0,o=t.selectingChanged&&n.selecting?ui.get(e,n.selecting):void 0;for(let n of t.operations)oi(e,n),li(e,n),ii(e,n),ti(e,n);if(t.hoveringChanged&&(null==r||t.operations.some((e=>"remove_node"==e.type))||null!=r.nodeview.dehover&&r.nodeview.dehover(r.node),null!=i.hovering)){let t=ui.get(e,i.hovering);null!=t.nodeview.hover&&t.nodeview.hover(t.node)}if(t.selectingChanged&&(null==o||t.operations.some((e=>"remove_node"==e.type))||null!=o.nodeview.deselect&&o.nodeview.deselect(o.node),null!=i.selecting)){let t=ui.get(e,i.selecting);null!=t.nodeview.select&&t.nodeview.select(t.node)}}(this,e)}renderCSS(e){let t=new zn(e);si(this.window.document).render(t)}deleteCSS(...e){si(this.window.document).delete(...e)}}({builder:Os,nodeview:function(e,t,n){switch(n.type){case"button":return Nr(e,t);case"container":return xr(e,t);case"image":return Xr(e,t);case"text":return Hu(e,t);default:throw new Error("invalid operation")}},iframe:document.querySelector(".f-iframe")})}();